[
  {
    "path": ".cursor/mcp.json",
    "content": "{\n  \"mcpServers\": {\n    \"dev3000\": {\n      \"type\": \"http\",\n      \"url\": \"http://localhost:3684/mcp\"\n    }\n  }\n}\n"
  },
  {
    "path": ".env.example",
    "content": "# Required\nFIRECRAWL_API_KEY=your_firecrawl_api_key  # Get from https://firecrawl.dev (Web scraping)\n\n# =================================================================================\n# SANDBOX PROVIDER - Choose Option 1 OR 2\n# =================================================================================\n\n# Option 1: Vercel Sandbox (recommended - default)\n# Set SANDBOX_PROVIDER=vercel and choose authentication method below\nSANDBOX_PROVIDER=vercel\n\n# Vercel Authentication - Choose method a OR b\n# Method a: OIDC Token (recommended for development)\n# Run `vercel link` then `vercel env pull` to get VERCEL_OIDC_TOKEN automatically\nVERCEL_OIDC_TOKEN=auto_generated_by_vercel_env_pull\n\n# Method b: Personal Access Token (for production or when OIDC unavailable)\n# VERCEL_TEAM_ID=team_xxxxxxxxx      # Your Vercel team ID \n# VERCEL_PROJECT_ID=prj_xxxxxxxxx    # Your Vercel project ID\n# VERCEL_TOKEN=vercel_xxxxxxxxxxxx   # Personal access token from Vercel dashboard\n\n# Get yours at https://console.groq.com\nGROQ_API_KEY=your_groq_api_key_here\n\n=======\n# Option 2: E2B Sandbox\n# Set SANDBOX_PROVIDER=e2b and configure E2B_API_KEY below\n# SANDBOX_PROVIDER=e2b\n# E2B_API_KEY=your_e2b_api_key  # Get from https://e2b.dev\n\n# =================================================================================\n# AI PROVIDERS - Need at least one\n# =================================================================================\n\n# Vercel AI Gateway (recommended - provides access to multiple models)\nAI_GATEWAY_API_KEY=your_ai_gateway_api_key  # Get from https://vercel.com/dashboard/ai-gateway/api-keys\n\n# Individual provider keys (used when AI_GATEWAY_API_KEY is not set)\nANTHROPIC_API_KEY=your_anthropic_api_key  # Get from https://console.anthropic.com\nOPENAI_API_KEY=your_openai_api_key  # Get from https://platform.openai.com (GPT-5)\nGEMINI_API_KEY=your_gemini_api_key  # Get from https://aistudio.google.com/app/apikey\nGROQ_API_KEY=your_groq_api_key  # Get from https://console.groq.com (Fast inference - Kimi K2 recommended)\n\n# Optional Morph Fast Apply\n# Get yours at https://morphllm.com/\nMORPH_API_KEY=your_fast_apply_key\n"
  },
  {
    "path": ".gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n**/node_modules/\n/.pnp\n.pnp.*\n.yarn/*\n!.yarn/patches\n!.yarn/plugins\n!.yarn/releases\n!.yarn/versions\n\n# testing\n/coverage\n\n# next.js\n/.next/\n/out/\n\n# production\n/build\n\n# misc\n.DS_Store\n*.pem\n\n# debug\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n.pnpm-debug.log*\n\n# env files (can opt-in for committing if needed)\n.env*\n.env.local\n!.env.example\n\n# vercel\n.vercel\n\n# typescript\n*.tsbuildinfo\nnext-env.d.ts\n\n# E2B template builds\n*.tar.gz\ne2b-template-*\n\n# IDE\n.vscode/\n.idea/\n\n# Temporary files\n*.tmp\n*.temp\nrepomix-output.txt\nbun.lockb\n.env*.local\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2024\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "# Open Lovable\n\nChat with AI to build React apps instantly. An example app made by the [Firecrawl](https://firecrawl.dev/?ref=open-lovable-github) team. For a complete cloud solution, check out [Lovable.dev](https://lovable.dev/) ❤️.\n\n<img src=\"https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExbmZtaHFleGRsMTNlaWNydGdianI4NGQ4dHhyZjB0d2VkcjRyeXBucCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/ZFVLWMa6dVskQX0qu1/giphy.gif\" alt=\"Open Lovable Demo\" width=\"100%\"/>\n\n## Setup\n\n1. **Clone & Install**\n```bash\ngit clone https://github.com/firecrawl/open-lovable.git\ncd open-lovable\npnpm install  # or npm install / yarn install\n```\n\n2. **Add `.env.local`**\n\n```env\n# =================================================================\n# REQUIRED\n# =================================================================\nFIRECRAWL_API_KEY=your_firecrawl_api_key    # https://firecrawl.dev\n\n# =================================================================\n# AI PROVIDER - Choose your LLM\n# =================================================================\nGEMINI_API_KEY=your_gemini_api_key        # https://aistudio.google.com/app/apikey\nANTHROPIC_API_KEY=your_anthropic_api_key  # https://console.anthropic.com\nOPENAI_API_KEY=your_openai_api_key        # https://platform.openai.com\nGROQ_API_KEY=your_groq_api_key            # https://console.groq.com\n\n# =================================================================\n# FAST APPLY (Optional - for faster edits)\n# =================================================================\nMORPH_API_KEY=your_morphllm_api_key    # https://morphllm.com/dashboard\n\n# =================================================================\n# SANDBOX PROVIDER - Choose ONE: Vercel (default) or E2B\n# =================================================================\nSANDBOX_PROVIDER=vercel  # or 'e2b'\n\n# Option 1: Vercel Sandbox (default)\n# Choose one authentication method:\n\n# Method A: OIDC Token (recommended for development)\n# Run `vercel link` then `vercel env pull` to get VERCEL_OIDC_TOKEN automatically\nVERCEL_OIDC_TOKEN=auto_generated_by_vercel_env_pull\n\n# Method B: Personal Access Token (for production or when OIDC unavailable)\n# VERCEL_TEAM_ID=team_xxxxxxxxx      # Your Vercel team ID \n# VERCEL_PROJECT_ID=prj_xxxxxxxxx    # Your Vercel project ID\n# VERCEL_TOKEN=vercel_xxxxxxxxxxxx   # Personal access token from Vercel dashboard\n\n# Option 2: E2B Sandbox\n# E2B_API_KEY=your_e2b_api_key      # https://e2b.dev\n```\n\n3. **Run**\n```bash\npnpm dev  # or npm run dev / yarn dev\n```\n\nOpen [http://localhost:3000](http://localhost:3000)\n\n## License\n\nMIT"
  },
  {
    "path": "app/api/analyze-edit-intent/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { createGroq } from '@ai-sdk/groq';\nimport { createAnthropic } from '@ai-sdk/anthropic';\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { createGoogleGenerativeAI } from '@ai-sdk/google';\nimport { generateObject } from 'ai';\nimport { z } from 'zod';\n// import type { FileManifest } from '@/types/file-manifest'; // Type is used implicitly through manifest parameter\n\n// Check if we're using Vercel AI Gateway\nconst isUsingAIGateway = !!process.env.AI_GATEWAY_API_KEY;\nconst aiGatewayBaseURL = 'https://ai-gateway.vercel.sh/v1';\n\nconst groq = createGroq({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.GROQ_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : undefined,\n});\n\nconst anthropic = createAnthropic({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.ANTHROPIC_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : (process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com/v1'),\n});\n\nconst openai = createOpenAI({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.OPENAI_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : process.env.OPENAI_BASE_URL,\n});\n\nconst googleGenerativeAI = createGoogleGenerativeAI({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.GEMINI_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : undefined,\n});\n\n// Schema for the AI's search plan - not file selection!\nconst searchPlanSchema = z.object({\n  editType: z.enum([\n    'UPDATE_COMPONENT',\n    'ADD_FEATURE', \n    'FIX_ISSUE',\n    'UPDATE_STYLE',\n    'REFACTOR',\n    'ADD_DEPENDENCY',\n    'REMOVE_ELEMENT'\n  ]).describe('The type of edit being requested'),\n  \n  reasoning: z.string().describe('Explanation of the search strategy'),\n  \n  searchTerms: z.array(z.string()).describe('Specific text to search for (case-insensitive). Be VERY specific - exact button text, class names, etc.'),\n  \n  regexPatterns: z.array(z.string()).optional().describe('Regex patterns for finding code structures (e.g., \"className=[\\\\\"\\\\\\'].*header.*[\\\\\"\\\\\\']\")'),\n  \n  fileTypesToSearch: z.array(z.string()).default(['.jsx', '.tsx', '.js', '.ts']).describe('File extensions to search'),\n  \n  expectedMatches: z.number().min(1).max(10).default(1).describe('Expected number of matches (helps validate search worked)'),\n  \n  fallbackSearch: z.object({\n    terms: z.array(z.string()),\n    patterns: z.array(z.string()).optional()\n  }).optional().describe('Backup search if primary fails')\n});\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { prompt, manifest, model = 'openai/gpt-oss-20b' } = await request.json();\n    \n    console.log('[analyze-edit-intent] Request received');\n    console.log('[analyze-edit-intent] Prompt:', prompt);\n    console.log('[analyze-edit-intent] Model:', model);\n    console.log('[analyze-edit-intent] Manifest files count:', manifest?.files ? Object.keys(manifest.files).length : 0);\n    \n    if (!prompt || !manifest) {\n      return NextResponse.json({\n        error: 'prompt and manifest are required'\n      }, { status: 400 });\n    }\n    \n    // Create a summary of available files for the AI\n    const validFiles = Object.entries(manifest.files as Record<string, any>)\n      .filter(([path]) => {\n        // Filter out invalid paths\n        return path.includes('.') && !path.match(/\\/\\d+$/);\n      });\n    \n    const fileSummary = validFiles\n      .map(([path, info]: [string, any]) => {\n        const componentName = info.componentInfo?.name || path.split('/').pop();\n        // const hasImports = info.imports?.length > 0; // Kept for future use\n        const childComponents = info.componentInfo?.childComponents?.join(', ') || 'none';\n        return `- ${path} (${componentName}, renders: ${childComponents})`;\n      })\n      .join('\\n');\n    \n    console.log('[analyze-edit-intent] Valid files found:', validFiles.length);\n    \n    if (validFiles.length === 0) {\n      console.error('[analyze-edit-intent] No valid files found in manifest');\n      return NextResponse.json({\n        success: false,\n        error: 'No valid files found in manifest'\n      }, { status: 400 });\n    }\n    \n    console.log('[analyze-edit-intent] Analyzing prompt:', prompt);\n    console.log('[analyze-edit-intent] File summary preview:', fileSummary.split('\\n').slice(0, 5).join('\\n'));\n    \n    // Select the appropriate AI model based on the request\n    let aiModel;\n    if (model.startsWith('anthropic/')) {\n      aiModel = anthropic(model.replace('anthropic/', ''));\n    } else if (model.startsWith('openai/')) {\n      if (model.includes('gpt-oss')) {\n        aiModel = groq(model);\n      } else {\n        aiModel = openai(model.replace('openai/', ''));\n      }\n    } else if (model.startsWith('google/')) {\n      aiModel = googleGenerativeAI(model.replace('google/', ''));\n    } else {\n      // Default to groq if model format is unclear\n      aiModel = groq(model);\n    }\n    \n    console.log('[analyze-edit-intent] Using AI model:', model);\n    \n    // Use AI to create a search plan\n    const result = await generateObject({\n      model: aiModel,\n      schema: searchPlanSchema,\n      messages: [\n        {\n          role: 'system',\n          content: `You are an expert at planning code searches. Your job is to create a search strategy to find the exact code that needs to be edited.\n\nDO NOT GUESS which files to edit. Instead, provide specific search terms that will locate the code.\n\nSEARCH STRATEGY RULES:\n1. For text changes (e.g., \"change 'Start Deploying' to 'Go Now'\"):\n   - Search for the EXACT text: \"Start Deploying\"\n   \n2. For style changes (e.g., \"make header black\"):\n   - Search for component names: \"Header\", \"<header\"\n   - Search for class names: \"header\", \"navbar\"\n   - Search for className attributes containing relevant words\n   \n3. For removing elements (e.g., \"remove the deploy button\"):\n   - Search for the button text or aria-label\n   - Search for relevant IDs or data-testids\n   \n4. For navigation/header issues:\n   - Search for: \"navigation\", \"nav\", \"Header\", \"navbar\"\n   - Look for Link components or href attributes\n   \n5. Be SPECIFIC:\n   - Use exact capitalization for user-visible text\n   - Include multiple search terms for redundancy\n   - Add regex patterns for structural searches\n\nCurrent project structure for context:\n${fileSummary}`\n        },\n        {\n          role: 'user',\n          content: `User request: \"${prompt}\"\n\nCreate a search plan to find the exact code that needs to be modified. Include specific search terms and patterns.`\n        }\n      ]\n    });\n    \n    console.log('[analyze-edit-intent] Search plan created:', {\n      editType: result.object.editType,\n      searchTerms: result.object.searchTerms,\n      patterns: result.object.regexPatterns?.length || 0,\n      reasoning: result.object.reasoning\n    });\n    \n    // Return the search plan, not file matches\n    return NextResponse.json({\n      success: true,\n      searchPlan: result.object\n    });\n    \n  } catch (error) {\n    console.error('[analyze-edit-intent] Error:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/apply-ai-code/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { parseMorphEdits, applyMorphEditToFile } from '@/lib/morph-fast-apply';\nimport type { SandboxState } from '@/types/sandbox';\nimport type { ConversationState } from '@/types/conversation';\n\ndeclare global {\n  var conversationState: ConversationState | null;\n}\n\ninterface ParsedResponse {\n  explanation: string;\n  template: string;\n  files: Array<{ path: string; content: string }>;\n  packages: string[];\n  commands: string[];\n  structure: string | null;\n}\n\nfunction parseAIResponse(response: string): ParsedResponse {\n  const sections = {\n    files: [] as Array<{ path: string; content: string }>,\n    commands: [] as string[],\n    packages: [] as string[],\n    structure: null as string | null,\n    explanation: '',\n    template: ''\n  };\n\n  // Parse file sections - handle duplicates and prefer complete versions\n  const fileMap = new Map<string, { content: string; isComplete: boolean }>();\n  \n  const fileRegex = /<file path=\"([^\"]+)\">([\\s\\S]*?)(?:<\\/file>|$)/g;\n  let match;\n  while ((match = fileRegex.exec(response)) !== null) {\n    const filePath = match[1];\n    const content = match[2].trim();\n    const hasClosingTag = response.substring(match.index, match.index + match[0].length).includes('</file>');\n    \n    // Check if this file already exists in our map\n    const existing = fileMap.get(filePath);\n    \n    // Decide whether to keep this version\n    let shouldReplace = false;\n    if (!existing) {\n      shouldReplace = true; // First occurrence\n    } else if (!existing.isComplete && hasClosingTag) {\n      shouldReplace = true; // Replace incomplete with complete\n      console.log(`[parseAIResponse] Replacing incomplete ${filePath} with complete version`);\n    } else if (existing.isComplete && hasClosingTag && content.length > existing.content.length) {\n      shouldReplace = true; // Replace with longer complete version\n      console.log(`[parseAIResponse] Replacing ${filePath} with longer complete version`);\n    } else if (!existing.isComplete && !hasClosingTag && content.length > existing.content.length) {\n      shouldReplace = true; // Both incomplete, keep longer one\n    }\n    \n    if (shouldReplace) {\n      // Additional validation: reject obviously broken content\n      if (content.includes('...') && !content.includes('...props') && !content.includes('...rest')) {\n        console.warn(`[parseAIResponse] Warning: ${filePath} contains ellipsis, may be truncated`);\n        // Still use it if it's the only version we have\n        if (!existing) {\n          fileMap.set(filePath, { content, isComplete: hasClosingTag });\n        }\n      } else {\n        fileMap.set(filePath, { content, isComplete: hasClosingTag });\n      }\n    }\n  }\n  \n  // Convert map to array for sections.files\n  for (const [path, { content, isComplete }] of fileMap.entries()) {\n    if (!isComplete) {\n      console.log(`[parseAIResponse] Warning: File ${path} appears to be truncated (no closing tag)`);\n    }\n    \n    sections.files.push({\n      path,\n      content\n    });\n  }\n\n  // Parse commands\n  const cmdRegex = /<command>(.*?)<\\/command>/g;\n  while ((match = cmdRegex.exec(response)) !== null) {\n    sections.commands.push(match[1].trim());\n  }\n\n  // Parse packages - support both <package> and <packages> tags\n  const pkgRegex = /<package>(.*?)<\\/package>/g;\n  while ((match = pkgRegex.exec(response)) !== null) {\n    sections.packages.push(match[1].trim());\n  }\n  \n  // Also parse <packages> tag with multiple packages\n  const packagesRegex = /<packages>([\\s\\S]*?)<\\/packages>/;\n  const packagesMatch = response.match(packagesRegex);\n  if (packagesMatch) {\n    const packagesContent = packagesMatch[1].trim();\n    // Split by newlines or commas\n    const packagesList = packagesContent.split(/[\\n,]+/)\n      .map(pkg => pkg.trim())\n      .filter(pkg => pkg.length > 0);\n    sections.packages.push(...packagesList);\n  }\n\n  // Parse structure\n  const structureMatch = /<structure>([\\s\\S]*?)<\\/structure>/;\n  const structResult = response.match(structureMatch);\n  if (structResult) {\n    sections.structure = structResult[1].trim();\n  }\n\n  // Parse explanation\n  const explanationMatch = /<explanation>([\\s\\S]*?)<\\/explanation>/;\n  const explResult = response.match(explanationMatch);\n  if (explResult) {\n    sections.explanation = explResult[1].trim();\n  }\n\n  // Parse template\n  const templateMatch = /<template>(.*?)<\\/template>/;\n  const templResult = response.match(templateMatch);\n  if (templResult) {\n    sections.template = templResult[1].trim();\n  }\n\n  return sections;\n}\n\ndeclare global {\n  var activeSandbox: any;\n  var activeSandboxProvider: any;\n  var existingFiles: Set<string>;\n  var sandboxState: SandboxState;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { response, isEdit = false, packages = [] } = await request.json();\n    \n    if (!response) {\n      return NextResponse.json({\n        error: 'response is required'\n      }, { status: 400 });\n    }\n    \n    // Parse the AI response\n    const parsed = parseAIResponse(response);\n    const morphEnabled = Boolean(isEdit && process.env.MORPH_API_KEY);\n    const morphEdits = morphEnabled ? parseMorphEdits(response) : [];\n    console.log('[apply-ai-code] Morph Fast Apply mode:', morphEnabled);\n    if (morphEnabled) {\n      console.log('[apply-ai-code] Morph edits found:', morphEdits.length);\n    }\n    \n    // Initialize existingFiles if not already\n    if (!global.existingFiles) {\n      global.existingFiles = new Set<string>();\n    }\n    \n    // Get the active sandbox or provider\n    const sandbox = global.activeSandbox || global.activeSandboxProvider;\n    \n    // If no active sandbox, just return parsed results\n    if (!sandbox) {\n      return NextResponse.json({\n        success: true,\n        results: {\n          filesCreated: parsed.files.map(f => f.path),\n          packagesInstalled: parsed.packages,\n          commandsExecuted: parsed.commands,\n          errors: []\n        },\n        explanation: parsed.explanation,\n        structure: parsed.structure,\n        parsedFiles: parsed.files,\n        message: `Parsed ${parsed.files.length} files successfully. Create a sandbox to apply them.`\n      });\n    }\n    \n    // Verify sandbox is ready before applying code\n    console.log('[apply-ai-code] Verifying sandbox is ready...');\n    \n    // For Vercel sandboxes, check if Vite is running\n    if (sandbox.constructor?.name === 'VercelProvider' || sandbox.getSandboxInfo?.()?.provider === 'vercel') {\n      console.log('[apply-ai-code] Detected Vercel sandbox, checking Vite status...');\n      try {\n        // Check if Vite process is running\n        const checkResult = await sandbox.runCommand('pgrep -f vite');\n        if (!checkResult || !checkResult.stdout) {\n          console.log('[apply-ai-code] Vite not running, starting it...');\n          // Start Vite if not running\n          await sandbox.runCommand('sh -c \"cd /vercel/sandbox && nohup npm run dev > /tmp/vite.log 2>&1 &\"');\n          // Wait for Vite to start\n          await new Promise(resolve => setTimeout(resolve, 5000));\n          console.log('[apply-ai-code] Vite started, proceeding with code application');\n        } else {\n          console.log('[apply-ai-code] Vite is already running');\n        }\n      } catch (e) {\n        console.log('[apply-ai-code] Could not check Vite status, proceeding anyway:', e);\n      }\n    }\n    \n    // Apply to active sandbox\n    console.log('[apply-ai-code] Applying code to sandbox...');\n    console.log('[apply-ai-code] Is edit mode:', isEdit);\n    console.log('[apply-ai-code] Files to write:', parsed.files.map(f => f.path));\n    console.log('[apply-ai-code] Existing files:', Array.from(global.existingFiles));\n    if (morphEnabled) {\n      console.log('[apply-ai-code] Morph Fast Apply enabled');\n      if (morphEdits.length > 0) {\n        console.log('[apply-ai-code] Parsed Morph edits:', morphEdits.map(e => e.targetFile));\n      } else {\n        console.log('[apply-ai-code] No <edit> blocks found in response');\n      }\n    }\n    \n    const results = {\n      filesCreated: [] as string[],\n      filesUpdated: [] as string[],\n      packagesInstalled: [] as string[],\n      packagesAlreadyInstalled: [] as string[],\n      packagesFailed: [] as string[],\n      commandsExecuted: [] as string[],\n      errors: [] as string[]\n    };\n    \n    // Combine packages from tool calls and parsed XML tags\n    const allPackages = [...packages.filter((pkg: any) => pkg && typeof pkg === 'string'), ...parsed.packages];\n    const uniquePackages = [...new Set(allPackages)]; // Remove duplicates\n    \n    if (uniquePackages.length > 0) {\n      console.log('[apply-ai-code] Installing packages from XML tags and tool calls:', uniquePackages);\n      \n      try {\n        const installResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/install-packages`, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          body: JSON.stringify({ packages: uniquePackages })\n        });\n        \n        if (installResponse.ok) {\n          const installResult = await installResponse.json();\n          console.log('[apply-ai-code] Package installation result:', installResult);\n          \n          if (installResult.installed && installResult.installed.length > 0) {\n            results.packagesInstalled = installResult.installed;\n          }\n          if (installResult.failed && installResult.failed.length > 0) {\n            results.packagesFailed = installResult.failed;\n          }\n        }\n      } catch (error) {\n        console.error('[apply-ai-code] Error installing packages:', error);\n      }\n    } else {\n      // Fallback to detecting packages from code\n      console.log('[apply-ai-code] No packages provided, detecting from generated code...');\n      console.log('[apply-ai-code] Number of files to scan:', parsed.files.length);\n      \n      // Filter out config files first\n      const configFiles = ['tailwind.config.js', 'vite.config.js', 'package.json', 'package-lock.json', 'tsconfig.json', 'postcss.config.js'];\n      const filteredFilesForDetection = parsed.files.filter(file => {\n        const fileName = file.path.split('/').pop() || '';\n        return !configFiles.includes(fileName);\n      });\n      \n      // Build files object for package detection\n      const filesForPackageDetection: Record<string, string> = {};\n      for (const file of filteredFilesForDetection) {\n        filesForPackageDetection[file.path] = file.content;\n        // Log if heroicons is found\n        if (file.content.includes('heroicons')) {\n          console.log(`[apply-ai-code] Found heroicons import in ${file.path}`);\n        }\n      }\n      \n      try {\n        console.log('[apply-ai-code] Calling detect-and-install-packages...');\n        const packageResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/detect-and-install-packages`, {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          body: JSON.stringify({ files: filesForPackageDetection })\n        });\n        \n        console.log('[apply-ai-code] Package detection response status:', packageResponse.status);\n        \n        if (packageResponse.ok) {\n          const packageResult = await packageResponse.json();\n          console.log('[apply-ai-code] Package installation result:', JSON.stringify(packageResult, null, 2));\n        \n        if (packageResult.packagesInstalled && packageResult.packagesInstalled.length > 0) {\n          results.packagesInstalled = packageResult.packagesInstalled;\n          console.log(`[apply-ai-code] Installed packages: ${packageResult.packagesInstalled.join(', ')}`);\n        }\n        \n        if (packageResult.packagesAlreadyInstalled && packageResult.packagesAlreadyInstalled.length > 0) {\n          results.packagesAlreadyInstalled = packageResult.packagesAlreadyInstalled;\n          console.log(`[apply-ai-code] Already installed: ${packageResult.packagesAlreadyInstalled.join(', ')}`);\n        }\n        \n        if (packageResult.packagesFailed && packageResult.packagesFailed.length > 0) {\n          results.packagesFailed = packageResult.packagesFailed;\n          console.error(`[apply-ai-code] Failed to install packages: ${packageResult.packagesFailed.join(', ')}`);\n          results.errors.push(`Failed to install packages: ${packageResult.packagesFailed.join(', ')}`);\n        }\n        \n        // Force Vite restart after package installation\n        if (results.packagesInstalled.length > 0) {\n          console.log('[apply-ai-code] Packages were installed, forcing Vite restart...');\n          \n          try {\n            // Call the restart-vite endpoint\n            const restartResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/restart-vite`, {\n              method: 'POST',\n              headers: { 'Content-Type': 'application/json' }\n            });\n            \n            if (restartResponse.ok) {\n              const restartResult = await restartResponse.json();\n              console.log('[apply-ai-code] Vite restart result:', restartResult.message);\n            } else {\n              console.error('[apply-ai-code] Failed to restart Vite:', await restartResponse.text());\n            }\n          } catch (e) {\n            console.error('[apply-ai-code] Error calling restart-vite:', e);\n          }\n          \n          // Additional delay to ensure files can be written after restart\n          await new Promise(resolve => setTimeout(resolve, 1000));\n        }\n        } else {\n          console.error('[apply-ai-code] Package detection/installation failed:', await packageResponse.text());\n        }\n      } catch (error) {\n        console.error('[apply-ai-code] Error detecting/installing packages:', error);\n        // Continue with file writing even if package installation fails\n      }\n    }\n    \n    // Attempt Morph Fast Apply for edits before file creation\n    const morphUpdatedPaths = new Set<string>();\n\n    if (morphEnabled && morphEdits.length > 0) {\n      if (!global.activeSandbox) {\n        console.warn('[apply-ai-code] Morph edits found but no active sandbox; skipping Morph application');\n      } else {\n        console.log(`[apply-ai-code] Applying ${morphEdits.length} fast edits via Morph...`);\n        for (const edit of morphEdits) {\n          try {\n            const result = await applyMorphEditToFile({\n              sandbox: global.activeSandbox,\n              targetPath: edit.targetFile,\n              instructions: edit.instructions,\n              updateSnippet: edit.update\n            });\n\n            if (result.success && result.normalizedPath) {\n              morphUpdatedPaths.add(result.normalizedPath);\n              results.filesUpdated.push(result.normalizedPath);\n              console.log('[apply-ai-code] Morph applied to', result.normalizedPath);\n            } else {\n              const msg = result.error || 'Unknown Morph error';\n              console.error('[apply-ai-code] Morph apply failed:', msg);\n              results.errors.push(`Morph apply failed for ${edit.targetFile}: ${msg}`);\n            }\n          } catch (e) {\n            console.error('[apply-ai-code] Morph apply exception:', e);\n            results.errors.push(`Morph apply exception for ${edit.targetFile}: ${(e as Error).message}`);\n          }\n        }\n      }\n    }\n    if (morphEnabled && morphEdits.length === 0) {\n      console.warn('[apply-ai-code] Morph enabled but no <edit> blocks found; falling back to full-file flow');\n    }\n\n    // Filter out config files that shouldn't be created\n    const configFiles = ['tailwind.config.js', 'vite.config.js', 'package.json', 'package-lock.json', 'tsconfig.json', 'postcss.config.js'];\n    let filteredFiles = parsed.files.filter(file => {\n      const fileName = file.path.split('/').pop() || '';\n      if (configFiles.includes(fileName)) {\n        console.warn(`[apply-ai-code] Skipping config file: ${file.path} - already exists in template`);\n        return false;\n      }\n      return true;\n    });\n\n    // Avoid overwriting files already updated by Morph\n    if (morphUpdatedPaths.size > 0) {\n      filteredFiles = filteredFiles.filter(file => {\n        let normalizedPath = file.path.startsWith('/') ? file.path.slice(1) : file.path;\n        const fileName = normalizedPath.split('/').pop() || '';\n        if (!normalizedPath.startsWith('src/') &&\n            !normalizedPath.startsWith('public/') &&\n            normalizedPath !== 'index.html' &&\n            !configFiles.includes(fileName)) {\n          normalizedPath = 'src/' + normalizedPath;\n        }\n        return !morphUpdatedPaths.has(normalizedPath);\n      });\n    }\n    \n    // Create or update files AFTER package installation\n    for (const file of filteredFiles) {\n      try {\n        // Normalize the file path\n        let normalizedPath = file.path;\n        // Remove leading slash if present\n        if (normalizedPath.startsWith('/')) {\n          normalizedPath = normalizedPath.substring(1);\n        }\n        // Ensure src/ prefix for component files\n        if (!normalizedPath.startsWith('src/') && \n            !normalizedPath.startsWith('public/') && \n            normalizedPath !== 'index.html' && \n            normalizedPath !== 'package.json' &&\n            normalizedPath !== 'vite.config.js' &&\n            normalizedPath !== 'tailwind.config.js' &&\n            normalizedPath !== 'postcss.config.js') {\n          normalizedPath = 'src/' + normalizedPath;\n        }\n        \n        const fullPath = `/home/user/app/${normalizedPath}`;\n        const isUpdate = global.existingFiles.has(normalizedPath);\n        \n        // Remove any CSS imports from JSX/JS files (we're using Tailwind)\n        let fileContent = file.content;\n        if (file.path.endsWith('.jsx') || file.path.endsWith('.js') || file.path.endsWith('.tsx') || file.path.endsWith('.ts')) {\n          fileContent = fileContent.replace(/import\\s+['\"]\\.\\/[^'\"]+\\.css['\"];?\\s*\\n?/g, '');\n        }\n        \n        // Fix common Tailwind CSS errors in CSS files\n        if (file.path.endsWith('.css')) {\n          // Replace shadow-3xl with shadow-2xl (shadow-3xl doesn't exist)\n          fileContent = fileContent.replace(/shadow-3xl/g, 'shadow-2xl');\n          // Replace any other non-existent shadow utilities\n          fileContent = fileContent.replace(/shadow-4xl/g, 'shadow-2xl');\n          fileContent = fileContent.replace(/shadow-5xl/g, 'shadow-2xl');\n        }\n        \n        console.log(`[apply-ai-code] Writing file using E2B files API: ${fullPath}`);\n        \n        try {\n          // Check if we're using provider pattern (v2) or direct sandbox (v1)\n          if (sandbox.writeFile) {\n            // V2: Provider pattern (Vercel/E2B provider)\n            await sandbox.writeFile(file.path, fileContent);\n          } else if (sandbox.files?.write) {\n            // V1: Direct E2B sandbox\n            await sandbox.files.write(fullPath, fileContent);\n          } else {\n            throw new Error('Unsupported sandbox type');\n          }\n          console.log(`[apply-ai-code] Successfully wrote file: ${fullPath}`);\n          \n          // Update file cache\n          if (global.sandboxState?.fileCache) {\n            global.sandboxState.fileCache.files[normalizedPath] = {\n              content: fileContent,\n              lastModified: Date.now()\n            };\n            console.log(`[apply-ai-code] Updated file cache for: ${normalizedPath}`);\n          }\n          \n        } catch (writeError) {\n          console.error(`[apply-ai-code] E2B file write error:`, writeError);\n          throw writeError as Error;\n        }\n        \n        \n        if (isUpdate) {\n          results.filesUpdated.push(normalizedPath);\n        } else {\n          results.filesCreated.push(normalizedPath);\n          global.existingFiles.add(normalizedPath);\n        }\n      } catch (error) {\n        results.errors.push(`Failed to create ${file.path}: ${(error as Error).message}`);\n      }\n    }\n    \n    // Only create App.jsx if it's not an edit and doesn't exist\n    const appFileInParsed = parsed.files.some(f => {\n      const normalized = f.path.replace(/^\\//, '').replace(/^src\\//, '');\n      return normalized === 'App.jsx' || normalized === 'App.tsx';\n    });\n    \n    const appFileExists = global.existingFiles.has('src/App.jsx') || \n                         global.existingFiles.has('src/App.tsx') ||\n                         global.existingFiles.has('App.jsx') ||\n                         global.existingFiles.has('App.tsx');\n    \n    if (!isEdit && !appFileInParsed && !appFileExists && parsed.files.length > 0) {\n      // Find all component files\n      const componentFiles = parsed.files.filter(f => \n        (f.path.endsWith('.jsx') || f.path.endsWith('.tsx')) &&\n        f.path.includes('component')\n      );\n      \n      // Generate imports for components\n      const imports = componentFiles\n        .filter(f => !f.path.includes('App.') && !f.path.includes('main.') && !f.path.includes('index.'))\n        .map(f => {\n          const pathParts = f.path.split('/');\n          const fileName = pathParts[pathParts.length - 1];\n          const componentName = fileName.replace(/\\.(jsx|tsx)$/, '');\n          // Fix import path - components are in src/components/\n          const importPath = f.path.startsWith('src/') \n            ? f.path.replace('src/', './').replace(/\\.(jsx|tsx)$/, '')\n            : './' + f.path.replace(/\\.(jsx|tsx)$/, '');\n          return `import ${componentName} from '${importPath}';`;\n        })\n        .join('\\n');\n      \n      // Find the main component\n      const mainComponent = componentFiles.find(f => {\n        const name = f.path.toLowerCase();\n        return name.includes('header') || \n               name.includes('hero') ||\n               name.includes('layout') ||\n               name.includes('main') ||\n               name.includes('home');\n      }) || componentFiles[0];\n      \n      const mainComponentName = mainComponent \n        ? mainComponent.path.split('/').pop()?.replace(/\\.(jsx|tsx)$/, '') \n        : null;\n      \n      // Create App.jsx with better structure\n      const appContent = `import React from 'react';\n${imports}\n\nfunction App() {\n  return (\n    <div className=\"min-h-screen bg-gray-900 text-white p-8\">\n      ${mainComponentName ? `<${mainComponentName} />` : '<div className=\"text-center\">\\n        <h1 className=\"text-4xl font-bold mb-4\">Welcome to your React App</h1>\\n        <p className=\"text-gray-400\">Your components have been created but need to be added here.</p>\\n      </div>'}\n      {/* Generated components: ${componentFiles.map(f => f.path).join(', ')} */}\n    </div>\n  );\n}\n\nexport default App;`;\n      \n      try {\n        // Use provider pattern if available\n        if (sandbox.writeFile) {\n          await sandbox.writeFile('src/App.jsx', appContent);\n        } else if (sandbox.writeFiles) {\n          await sandbox.writeFiles([{\n            path: 'src/App.jsx',\n            content: Buffer.from(appContent)\n          }]);\n        }\n        \n        console.log('Auto-generated: src/App.jsx');\n        results.filesCreated.push('src/App.jsx (auto-generated)');\n      } catch (error) {\n        results.errors.push(`Failed to create App.jsx: ${(error as Error).message}`);\n      }\n      \n      // Don't auto-generate App.css - we're using Tailwind CSS\n      \n      // Only create index.css if it doesn't exist\n      const indexCssInParsed = parsed.files.some(f => {\n        const normalized = f.path.replace(/^\\//, '').replace(/^src\\//, '');\n        return normalized === 'index.css' || f.path === 'src/index.css';\n      });\n      \n      const indexCssExists = global.existingFiles.has('src/index.css') || \n                            global.existingFiles.has('index.css');\n      \n      if (!isEdit && !indexCssInParsed && !indexCssExists) {\n        try {\n          const indexCssContent = `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n:root {\n  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;\n  line-height: 1.5;\n  font-weight: 400;\n  color-scheme: dark;\n  \n  color: rgba(255, 255, 255, 0.87);\n  background-color: #0a0a0a;\n}\n\n* {\n  box-sizing: border-box;\n}\n\nbody {\n  margin: 0;\n  min-width: 320px;\n  min-height: 100vh;\n}`;\n\n          // Use provider pattern if available\n          if (sandbox.writeFile) {\n            await sandbox.writeFile('src/index.css', indexCssContent);\n          } else if (sandbox.writeFiles) {\n            await sandbox.writeFiles([{\n              path: 'src/index.css',\n              content: Buffer.from(indexCssContent)\n            }]);\n          }\n          \n          console.log('Auto-generated: src/index.css');\n          results.filesCreated.push('src/index.css (with Tailwind)');\n        } catch (error) {\n          console.error('Failed to create index.css:', error);\n          results.errors.push('Failed to create index.css with Tailwind');\n        }\n      }\n    }\n    \n    // Execute commands\n    for (const cmd of parsed.commands) {\n      try {\n        // Parse command and arguments\n        const commandParts = cmd.trim().split(/\\s+/);\n        const cmdName = commandParts[0];\n        const args = commandParts.slice(1);\n        \n        // Execute command using sandbox\n        let result;\n        if (sandbox.runCommand && typeof sandbox.runCommand === 'function') {\n          // Check if this is a provider pattern sandbox\n          const testResult = await sandbox.runCommand(cmd);\n          if (testResult && typeof testResult === 'object' && 'stdout' in testResult) {\n            // Provider returns CommandResult directly\n            result = testResult;\n          } else {\n            // Direct sandbox - expects object with cmd and args\n            result = await sandbox.runCommand({\n              cmd: cmdName,\n              args\n            });\n          }\n        }\n        \n        console.log(`Executed: ${cmd}`);\n        \n        // Handle result based on type\n        let stdout = '';\n        let stderr = '';\n        \n        if (result) {\n          if (typeof result.stdout === 'string') {\n            stdout = result.stdout;\n            stderr = result.stderr || '';\n          } else if (typeof result.stdout === 'function') {\n            stdout = await result.stdout();\n            stderr = await result.stderr();\n          }\n        }\n        \n        if (stdout) console.log(stdout);\n        if (stderr) console.log(`Errors: ${stderr}`);\n        \n        results.commandsExecuted.push(cmd);\n      } catch (error) {\n        results.errors.push(`Failed to execute ${cmd}: ${(error as Error).message}`);\n      }\n    }\n    \n    // Check for missing imports in App.jsx\n    const missingImports: string[] = [];\n    const appFile = parsed.files.find(f => \n      f.path === 'src/App.jsx' || f.path === 'App.jsx'\n    );\n    \n    if (appFile) {\n      // Extract imports from App.jsx\n      const importRegex = /import\\s+(?:\\w+|\\{[^}]+\\})\\s+from\\s+['\"]([^'\"]+)['\"]/g;\n      let match;\n      const imports: string[] = [];\n      \n      while ((match = importRegex.exec(appFile.content)) !== null) {\n        const importPath = match[1];\n        if (importPath.startsWith('./') || importPath.startsWith('../')) {\n          imports.push(importPath);\n        }\n      }\n      \n      // Check if all imported files exist\n      for (const imp of imports) {\n        // Skip CSS imports for this check\n        if (imp.endsWith('.css')) continue;\n        \n        // Convert import path to expected file paths\n        const basePath = imp.replace('./', 'src/');\n        const possiblePaths = [\n          basePath + '.jsx',\n          basePath + '.js',\n          basePath + '/index.jsx',\n          basePath + '/index.js'\n        ];\n        \n        const fileExists = parsed.files.some(f => \n          possiblePaths.some(path => f.path === path)\n        );\n        \n        if (!fileExists) {\n          missingImports.push(imp);\n        }\n      }\n    }\n    \n    // Prepare response\n    const responseData: any = {\n      success: true,\n      results,\n      explanation: parsed.explanation,\n      structure: parsed.structure,\n      message: `Applied ${results.filesCreated.length} files successfully`\n    };\n    \n    // Handle missing imports automatically\n    if (missingImports.length > 0) {\n      console.warn('[apply-ai-code] Missing imports detected:', missingImports);\n      \n      // Automatically generate missing components\n      try {\n        console.log('[apply-ai-code] Auto-generating missing components...');\n        \n        const autoCompleteResponse = await fetch(\n          `${request.nextUrl.origin}/api/auto-complete-components`,\n          {\n            method: 'POST',\n            headers: { 'Content-Type': 'application/json' },\n            body: JSON.stringify({\n              missingImports,\n              model: 'claude-sonnet-4-20250514'\n            })\n          }\n        );\n        \n        const autoCompleteData = await autoCompleteResponse.json();\n        \n        if (autoCompleteData.success) {\n          responseData.autoCompleted = true;\n          responseData.autoCompletedComponents = autoCompleteData.components;\n          responseData.message = `Applied ${results.filesCreated.length} files + auto-generated ${autoCompleteData.files} missing components`;\n          \n          // Add auto-completed files to results\n          results.filesCreated.push(...autoCompleteData.components);\n        } else {\n          // If auto-complete fails, still warn the user\n          responseData.warning = `Missing ${missingImports.length} imported components: ${missingImports.join(', ')}`;\n          responseData.missingImports = missingImports;\n        }\n      } catch (error) {\n        console.error('[apply-ai-code] Auto-complete failed:', error);\n        responseData.warning = `Missing ${missingImports.length} imported components: ${missingImports.join(', ')}`;\n        responseData.missingImports = missingImports;\n      }\n    }\n    \n    // Track applied files in conversation state\n    if (global.conversationState && results.filesCreated.length > 0) {\n      // Update the last message metadata with edited files\n      const messages = global.conversationState.context.messages;\n      if (messages.length > 0) {\n        const lastMessage = messages[messages.length - 1];\n        if (lastMessage.role === 'user') {\n          lastMessage.metadata = {\n            ...lastMessage.metadata,\n            editedFiles: results.filesCreated\n          };\n        }\n      }\n      \n      // Track applied code in project evolution\n      if (global.conversationState.context.projectEvolution) {\n        global.conversationState.context.projectEvolution.majorChanges.push({\n          timestamp: Date.now(),\n          description: parsed.explanation || 'Code applied',\n          filesAffected: results.filesCreated\n        });\n      }\n      \n      // Update last updated timestamp\n      global.conversationState.lastUpdated = Date.now();\n      \n      console.log('[apply-ai-code] Updated conversation state with applied files:', results.filesCreated);\n    }\n    \n    return NextResponse.json(responseData);\n    \n  } catch (error) {\n    console.error('Apply AI code error:', error);\n    return NextResponse.json(\n      { error: error instanceof Error ? error.message : 'Failed to parse AI code' },\n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/api/apply-ai-code-stream/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { parseMorphEdits, applyMorphEditToFile } from '@/lib/morph-fast-apply';\n// Sandbox import not needed - using global sandbox from sandbox-manager\nimport type { SandboxState } from '@/types/sandbox';\nimport type { ConversationState } from '@/types/conversation';\nimport { sandboxManager } from '@/lib/sandbox/sandbox-manager';\n\ndeclare global {\n  var conversationState: ConversationState | null;\n  var activeSandboxProvider: any;\n  var existingFiles: Set<string>;\n  var sandboxState: SandboxState;\n}\n\ninterface ParsedResponse {\n  explanation: string;\n  template: string;\n  files: Array<{ path: string; content: string }>;\n  packages: string[];\n  commands: string[];\n  structure: string | null;\n}\n\nfunction parseAIResponse(response: string): ParsedResponse {\n  const sections = {\n    files: [] as Array<{ path: string; content: string }>,\n    commands: [] as string[],\n    packages: [] as string[],\n    structure: null as string | null,\n    explanation: '',\n    template: ''\n  };\n\n  // Function to extract packages from import statements\n  function extractPackagesFromCode(content: string): string[] {\n    const packages: string[] = [];\n    // Match ES6 imports\n    const importRegex = /import\\s+(?:(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+)(?:\\s*,\\s*(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+))*\\s+from\\s+)?['\"]([^'\"]+)['\"]/g;\n    let importMatch;\n\n    while ((importMatch = importRegex.exec(content)) !== null) {\n      const importPath = importMatch[1];\n      // Skip relative imports and built-in React\n      if (!importPath.startsWith('.') && !importPath.startsWith('/') &&\n        importPath !== 'react' && importPath !== 'react-dom' &&\n        !importPath.startsWith('@/')) {\n        // Extract package name (handle scoped packages like @heroicons/react)\n        const packageName = importPath.startsWith('@')\n          ? importPath.split('/').slice(0, 2).join('/')\n          : importPath.split('/')[0];\n\n        if (!packages.includes(packageName)) {\n          packages.push(packageName);\n\n          // Log important packages for debugging\n          if (packageName === 'react-router-dom' || packageName.includes('router') || packageName.includes('icon')) {\n            console.log(`[apply-ai-code-stream] Detected package from imports: ${packageName}`);\n          }\n        }\n      }\n    }\n\n    return packages;\n  }\n\n  // Parse file sections - handle duplicates and prefer complete versions\n  const fileMap = new Map<string, { content: string; isComplete: boolean }>();\n\n  // First pass: Find all file declarations\n  const fileRegex = /<file path=\"([^\"]+)\">([\\s\\S]*?)(?:<\\/file>|$)/g;\n  let match;\n  while ((match = fileRegex.exec(response)) !== null) {\n    const filePath = match[1];\n    const content = match[2].trim();\n    const hasClosingTag = response.substring(match.index, match.index + match[0].length).includes('</file>');\n\n    // Check if this file already exists in our map\n    const existing = fileMap.get(filePath);\n\n    // Decide whether to keep this version\n    let shouldReplace = false;\n    if (!existing) {\n      shouldReplace = true; // First occurrence\n    } else if (!existing.isComplete && hasClosingTag) {\n      shouldReplace = true; // Replace incomplete with complete\n      console.log(`[apply-ai-code-stream] Replacing incomplete ${filePath} with complete version`);\n    } else if (existing.isComplete && hasClosingTag && content.length > existing.content.length) {\n      shouldReplace = true; // Replace with longer complete version\n      console.log(`[apply-ai-code-stream] Replacing ${filePath} with longer complete version`);\n    } else if (!existing.isComplete && !hasClosingTag && content.length > existing.content.length) {\n      shouldReplace = true; // Both incomplete, keep longer one\n    }\n\n    if (shouldReplace) {\n      // Additional validation: reject obviously broken content\n      if (content.includes('...') && !content.includes('...props') && !content.includes('...rest')) {\n        console.warn(`[apply-ai-code-stream] Warning: ${filePath} contains ellipsis, may be truncated`);\n        // Still use it if it's the only version we have\n        if (!existing) {\n          fileMap.set(filePath, { content, isComplete: hasClosingTag });\n        }\n      } else {\n        fileMap.set(filePath, { content, isComplete: hasClosingTag });\n      }\n    }\n  }\n\n  // Convert map to array for sections.files\n  for (const [path, { content, isComplete }] of fileMap.entries()) {\n    if (!isComplete) {\n      console.log(`[apply-ai-code-stream] Warning: File ${path} appears to be truncated (no closing tag)`);\n    }\n\n    sections.files.push({\n      path,\n      content\n    });\n\n    // Extract packages from file content\n    const filePackages = extractPackagesFromCode(content);\n    for (const pkg of filePackages) {\n      if (!sections.packages.includes(pkg)) {\n        sections.packages.push(pkg);\n        console.log(`[apply-ai-code-stream] 📦 Package detected from imports: ${pkg}`);\n      }\n    }\n  }\n\n  // Also parse markdown code blocks with file paths\n  const markdownFileRegex = /```(?:file )?path=\"([^\"]+)\"\\n([\\s\\S]*?)```/g;\n  while ((match = markdownFileRegex.exec(response)) !== null) {\n    const filePath = match[1];\n    const content = match[2].trim();\n    sections.files.push({\n      path: filePath,\n      content: content\n    });\n\n    // Extract packages from file content\n    const filePackages = extractPackagesFromCode(content);\n    for (const pkg of filePackages) {\n      if (!sections.packages.includes(pkg)) {\n        sections.packages.push(pkg);\n        console.log(`[apply-ai-code-stream] 📦 Package detected from imports: ${pkg}`);\n      }\n    }\n  }\n\n  // Parse plain text format like \"Generated Files: Header.jsx, index.css\"\n  const generatedFilesMatch = response.match(/Generated Files?:\\s*([^\\n]+)/i);\n  if (generatedFilesMatch) {\n    // Split by comma first, then trim whitespace, to preserve filenames with dots\n    const filesList = generatedFilesMatch[1]\n      .split(',')\n      .map(f => f.trim())\n      .filter(f => f.endsWith('.jsx') || f.endsWith('.js') || f.endsWith('.tsx') || f.endsWith('.ts') || f.endsWith('.css') || f.endsWith('.json') || f.endsWith('.html'));\n    console.log(`[apply-ai-code-stream] Detected generated files from plain text: ${filesList.join(', ')}`);\n\n    // Try to extract the actual file content if it follows\n    for (const fileName of filesList) {\n      // Look for the file content after the file name\n      const fileContentRegex = new RegExp(`${fileName}[\\\\s\\\\S]*?(?:import[\\\\s\\\\S]+?)(?=Generated Files:|Applying code|$)`, 'i');\n      const fileContentMatch = response.match(fileContentRegex);\n      if (fileContentMatch) {\n        // Extract just the code part (starting from import statements)\n        const codeMatch = fileContentMatch[0].match(/^(import[\\s\\S]+)$/m);\n        if (codeMatch) {\n          const filePath = fileName.includes('/') ? fileName : `src/components/${fileName}`;\n          sections.files.push({\n            path: filePath,\n            content: codeMatch[1].trim()\n          });\n          console.log(`[apply-ai-code-stream] Extracted content for ${filePath}`);\n\n          // Extract packages from this file\n          const filePackages = extractPackagesFromCode(codeMatch[1]);\n          for (const pkg of filePackages) {\n            if (!sections.packages.includes(pkg)) {\n              sections.packages.push(pkg);\n              console.log(`[apply-ai-code-stream] Package detected from imports: ${pkg}`);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  // Also try to parse if the response contains raw JSX/JS code blocks\n  const codeBlockRegex = /```(?:jsx?|tsx?|javascript|typescript)?\\n([\\s\\S]*?)```/g;\n  while ((match = codeBlockRegex.exec(response)) !== null) {\n    const content = match[1].trim();\n    // Try to detect the file name from comments or context\n    const fileNameMatch = content.match(/\\/\\/\\s*(?:File:|Component:)\\s*([^\\n]+)/);\n    if (fileNameMatch) {\n      const fileName = fileNameMatch[1].trim();\n      const filePath = fileName.includes('/') ? fileName : `src/components/${fileName}`;\n\n      // Don't add duplicate files\n      if (!sections.files.some(f => f.path === filePath)) {\n        sections.files.push({\n          path: filePath,\n          content: content\n        });\n\n        // Extract packages\n        const filePackages = extractPackagesFromCode(content);\n        for (const pkg of filePackages) {\n          if (!sections.packages.includes(pkg)) {\n            sections.packages.push(pkg);\n          }\n        }\n      }\n    }\n  }\n\n  // Parse commands\n  const cmdRegex = /<command>(.*?)<\\/command>/g;\n  while ((match = cmdRegex.exec(response)) !== null) {\n    sections.commands.push(match[1].trim());\n  }\n\n  // Parse packages - support both <package> and <packages> tags\n  const pkgRegex = /<package>(.*?)<\\/package>/g;\n  while ((match = pkgRegex.exec(response)) !== null) {\n    sections.packages.push(match[1].trim());\n  }\n\n  // Also parse <packages> tag with multiple packages\n  const packagesRegex = /<packages>([\\s\\S]*?)<\\/packages>/;\n  const packagesMatch = response.match(packagesRegex);\n  if (packagesMatch) {\n    const packagesContent = packagesMatch[1].trim();\n    // Split by newlines or commas\n    const packagesList = packagesContent.split(/[\\n,]+/)\n      .map(pkg => pkg.trim())\n      .filter(pkg => pkg.length > 0);\n    sections.packages.push(...packagesList);\n  }\n\n  // Parse structure\n  const structureMatch = /<structure>([\\s\\S]*?)<\\/structure>/;\n  const structResult = response.match(structureMatch);\n  if (structResult) {\n    sections.structure = structResult[1].trim();\n  }\n\n  // Parse explanation\n  const explanationMatch = /<explanation>([\\s\\S]*?)<\\/explanation>/;\n  const explResult = response.match(explanationMatch);\n  if (explResult) {\n    sections.explanation = explResult[1].trim();\n  }\n\n  // Parse template\n  const templateMatch = /<template>(.*?)<\\/template>/;\n  const templResult = response.match(templateMatch);\n  if (templResult) {\n    sections.template = templResult[1].trim();\n  }\n\n  return sections;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { response, isEdit = false, packages = [], sandboxId } = await request.json();\n\n    if (!response) {\n      return NextResponse.json({\n        error: 'response is required'\n      }, { status: 400 });\n    }\n\n    // Debug log the response\n    console.log('[apply-ai-code-stream] Received response to parse:');\n    console.log('[apply-ai-code-stream] Response length:', response.length);\n    console.log('[apply-ai-code-stream] Response preview:', response.substring(0, 500));\n    console.log('[apply-ai-code-stream] isEdit:', isEdit);\n    console.log('[apply-ai-code-stream] packages:', packages);\n\n    // Parse the AI response\n    const parsed = parseAIResponse(response);\n    const morphEnabled = Boolean(isEdit && process.env.MORPH_API_KEY);\n    const morphEdits = morphEnabled ? parseMorphEdits(response) : [];\n    console.log('[apply-ai-code-stream] Morph Fast Apply mode:', morphEnabled);\n    if (morphEnabled) {\n      console.log('[apply-ai-code-stream] Morph edits found:', morphEdits.length);\n    }\n    \n    // Log what was parsed\n    console.log('[apply-ai-code-stream] Parsed result:');\n    console.log('[apply-ai-code-stream] Files found:', parsed.files.length);\n    if (parsed.files.length > 0) {\n      parsed.files.forEach(f => {\n        console.log(`[apply-ai-code-stream] - ${f.path} (${f.content.length} chars)`);\n      });\n    }\n    console.log('[apply-ai-code-stream] Packages found:', parsed.packages);\n\n    // Initialize existingFiles if not already\n    if (!global.existingFiles) {\n      global.existingFiles = new Set<string>();\n    }\n\n    // Try to get provider from sandbox manager first\n    let provider = sandboxId ? sandboxManager.getProvider(sandboxId) : sandboxManager.getActiveProvider();\n\n    // Fall back to global state if not found in manager\n    if (!provider) {\n      provider = global.activeSandboxProvider;\n    }\n\n    // If we have a sandboxId but no provider, try to get or create one\n    if (!provider && sandboxId) {\n      console.log(`[apply-ai-code-stream] No provider found for sandbox ${sandboxId}, attempting to get or create...`);\n\n      try {\n        provider = await sandboxManager.getOrCreateProvider(sandboxId);\n\n        // If we got a new provider (not reconnected), we need to create a new sandbox\n        if (!provider.getSandboxInfo()) {\n          console.log(`[apply-ai-code-stream] Creating new sandbox since reconnection failed for ${sandboxId}`);\n          await provider.createSandbox();\n          await provider.setupViteApp();\n          sandboxManager.registerSandbox(sandboxId, provider);\n        }\n\n        // Update legacy global state\n        global.activeSandboxProvider = provider;\n        console.log(`[apply-ai-code-stream] Successfully got provider for sandbox ${sandboxId}`);\n      } catch (providerError) {\n        console.error(`[apply-ai-code-stream] Failed to get or create provider for sandbox ${sandboxId}:`, providerError);\n        return NextResponse.json({\n          success: false,\n          error: `Failed to create sandbox provider for ${sandboxId}. The sandbox may have expired.`,\n          results: {\n            filesCreated: [],\n            packagesInstalled: [],\n            commandsExecuted: [],\n            errors: [`Sandbox provider creation failed: ${(providerError as Error).message}`]\n          },\n          explanation: parsed.explanation,\n          structure: parsed.structure,\n          parsedFiles: parsed.files,\n          message: `Parsed ${parsed.files.length} files but couldn't apply them - sandbox reconnection failed.`\n        }, { status: 500 });\n      }\n    }\n\n    // If we still don't have a provider, create a new one\n    if (!provider) {\n      console.log(`[apply-ai-code-stream] No active provider found, creating new sandbox...`);\n      try {\n        const { SandboxFactory } = await import('@/lib/sandbox/factory');\n        provider = SandboxFactory.create();\n        const sandboxInfo = await provider.createSandbox();\n        await provider.setupViteApp();\n\n        // Register with sandbox manager\n        sandboxManager.registerSandbox(sandboxInfo.sandboxId, provider);\n\n        // Store in legacy global state\n        global.activeSandboxProvider = provider;\n        global.sandboxData = {\n          sandboxId: sandboxInfo.sandboxId,\n          url: sandboxInfo.url\n        };\n\n        console.log(`[apply-ai-code-stream] Created new sandbox successfully`);\n      } catch (createError) {\n        console.error(`[apply-ai-code-stream] Failed to create new sandbox:`, createError);\n        return NextResponse.json({\n          success: false,\n          error: `Failed to create new sandbox: ${createError instanceof Error ? createError.message : 'Unknown error'}`,\n          results: {\n            filesCreated: [],\n            packagesInstalled: [],\n            commandsExecuted: [],\n            errors: [`Sandbox creation failed: ${createError instanceof Error ? createError.message : 'Unknown error'}`]\n          },\n          explanation: parsed.explanation,\n          structure: parsed.structure,\n          parsedFiles: parsed.files,\n          message: `Parsed ${parsed.files.length} files but couldn't apply them - sandbox creation failed.`\n        }, { status: 500 });\n      }\n    }\n\n    // Create a response stream for real-time updates\n    const encoder = new TextEncoder();\n    const stream = new TransformStream();\n    const writer = stream.writable.getWriter();\n\n    // Function to send progress updates\n    const sendProgress = async (data: any) => {\n      const message = `data: ${JSON.stringify(data)}\\n\\n`;\n      await writer.write(encoder.encode(message));\n    };\n\n    // Start processing in background (pass provider and request to the async function)\n    (async (providerInstance, req) => {\n      const results = {\n        filesCreated: [] as string[],\n        filesUpdated: [] as string[],\n        packagesInstalled: [] as string[],\n        packagesAlreadyInstalled: [] as string[],\n        packagesFailed: [] as string[],\n        commandsExecuted: [] as string[],\n        errors: [] as string[]\n      };\n\n      try {\n        await sendProgress({\n          type: 'start',\n          message: 'Starting code application...',\n          totalSteps: 3\n        });\n        if (morphEnabled) {\n          await sendProgress({ type: 'info', message: 'Morph Fast Apply enabled' });\n          await sendProgress({ type: 'info', message: `Parsed ${morphEdits.length} Morph edits` });\n          if (morphEdits.length === 0) {\n            console.warn('[apply-ai-code-stream] Morph enabled but no <edit> blocks found; falling back to full-file flow');\n            await sendProgress({ type: 'warning', message: 'Morph enabled but no <edit> blocks found; falling back to full-file flow' });\n          }\n        }\n        \n        // Step 1: Install packages\n        const packagesArray = Array.isArray(packages) ? packages : [];\n        const parsedPackages = Array.isArray(parsed.packages) ? parsed.packages : [];\n\n        // Combine and deduplicate packages\n        const allPackages = [...packagesArray.filter(pkg => pkg && typeof pkg === 'string'), ...parsedPackages];\n\n        // Use Set to remove duplicates, then filter out pre-installed packages\n        const uniquePackages = [...new Set(allPackages)]\n          .filter(pkg => pkg && typeof pkg === 'string' && pkg.trim() !== '') // Remove empty strings\n          .filter(pkg => pkg !== 'react' && pkg !== 'react-dom'); // Filter pre-installed\n\n        // Log if we found duplicates\n        if (allPackages.length !== uniquePackages.length) {\n          console.log(`[apply-ai-code-stream] Removed ${allPackages.length - uniquePackages.length} duplicate packages`);\n          console.log(`[apply-ai-code-stream] Original packages:`, allPackages);\n          console.log(`[apply-ai-code-stream] Deduplicated packages:`, uniquePackages);\n        }\n\n        if (uniquePackages.length > 0) {\n          await sendProgress({\n            type: 'step',\n            step: 1,\n            message: `Installing ${uniquePackages.length} packages...`,\n            packages: uniquePackages\n          });\n\n          // Use streaming package installation\n          try {\n            // Construct the API URL properly for both dev and production\n            const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';\n            const host = req.headers.get('host') || 'localhost:3000';\n            const apiUrl = `${protocol}://${host}/api/install-packages`;\n\n            const installResponse = await fetch(apiUrl, {\n              method: 'POST',\n              headers: { 'Content-Type': 'application/json' },\n              body: JSON.stringify({\n                packages: uniquePackages,\n                sandboxId: sandboxId || providerInstance.getSandboxInfo()?.sandboxId\n              })\n            });\n\n            if (installResponse.ok && installResponse.body) {\n              const reader = installResponse.body.getReader();\n              const decoder = new TextDecoder();\n\n              while (true) {\n                const { done, value } = await reader.read();\n                if (done) break;\n\n                const chunk = decoder.decode(value);\n                if (!chunk) continue;\n                const lines = chunk.split('\\n');\n\n                for (const line of lines) {\n                  if (line.startsWith('data: ')) {\n                    try {\n                      const data = JSON.parse(line.slice(6));\n\n                      // Forward package installation progress\n                      await sendProgress({\n                        type: 'package-progress',\n                        ...data\n                      });\n\n                      // Track results\n                      if (data.type === 'success' && data.installedPackages) {\n                        results.packagesInstalled = data.installedPackages;\n                      }\n                    } catch (parseError) {\n                      console.debug('Error parsing terminal output:', parseError);\n                    }\n                  }\n                }\n              }\n            }\n          } catch (error) {\n            console.error('[apply-ai-code-stream] Error installing packages:', error);\n            await sendProgress({\n              type: 'warning',\n              message: `Package installation skipped (${(error as Error).message}). Continuing with file creation...`\n            });\n            results.errors.push(`Package installation failed: ${(error as Error).message}`);\n          }\n        } else {\n          await sendProgress({\n            type: 'step',\n            step: 1,\n            message: 'No additional packages to install, skipping...'\n          });\n        }\n\n        // Step 2: Create/update files\n        const filesArray = Array.isArray(parsed.files) ? parsed.files : [];\n        await sendProgress({\n          type: 'step',\n          step: 2,\n          message: `Creating ${filesArray.length} files...`\n        });\n\n        // Filter out config files that shouldn't be created\n        const configFiles = ['tailwind.config.js', 'vite.config.js', 'package.json', 'package-lock.json', 'tsconfig.json', 'postcss.config.js'];\n        let filteredFiles = filesArray.filter(file => {\n          if (!file || typeof file !== 'object') return false;\n          const fileName = (file.path || '').split('/').pop() || '';\n          return !configFiles.includes(fileName);\n        });\n\n        // If Morph is enabled and we have edits, apply them before file writes\n        const morphUpdatedPaths = new Set<string>();\n        if (morphEnabled && morphEdits.length > 0) {\n          const morphSandbox = (global as any).activeSandbox || providerInstance;\n          if (!morphSandbox) {\n            console.warn('[apply-ai-code-stream] No sandbox available to apply Morph edits');\n            await sendProgress({ type: 'warning', message: 'No sandbox available to apply Morph edits' });\n          } else {\n            await sendProgress({ type: 'info', message: `Applying ${morphEdits.length} fast edits via Morph...` });\n            for (const [idx, edit] of morphEdits.entries()) {\n              try {\n                await sendProgress({ type: 'file-progress', current: idx + 1, total: morphEdits.length, fileName: edit.targetFile, action: 'morph-applying' });\n                const result = await applyMorphEditToFile({\n                  sandbox: morphSandbox,\n                  targetPath: edit.targetFile,\n                  instructions: edit.instructions,\n                  updateSnippet: edit.update\n                });\n                if (result.success && result.normalizedPath) {\n                  console.log('[apply-ai-code-stream] Morph updated', result.normalizedPath);\n                  morphUpdatedPaths.add(result.normalizedPath);\n                  if (results.filesUpdated) results.filesUpdated.push(result.normalizedPath);\n                  await sendProgress({ type: 'file-complete', fileName: result.normalizedPath, action: 'morph-updated' });\n                } else {\n                  const msg = result.error || 'Unknown Morph error';\n                  console.error('[apply-ai-code-stream] Morph apply failed for', edit.targetFile, msg);\n                  if (results.errors) results.errors.push(`Morph apply failed for ${edit.targetFile}: ${msg}`);\n                  await sendProgress({ type: 'file-error', fileName: edit.targetFile, error: msg });\n                }\n              } catch (err) {\n                const msg = (err as Error).message;\n                console.error('[apply-ai-code-stream] Morph apply exception for', edit.targetFile, msg);\n                if (results.errors) results.errors.push(`Morph apply exception for ${edit.targetFile}: ${msg}`);\n                await sendProgress({ type: 'file-error', fileName: edit.targetFile, error: msg });\n              }\n            }\n          }\n        }\n\n        // Avoid overwriting Morph-updated files in the file write loop\n        if (morphUpdatedPaths.size > 0) {\n          filteredFiles = filteredFiles.filter(file => {\n            if (!file?.path) return true;\n            let normalizedPath = file.path.startsWith('/') ? file.path.slice(1) : file.path;\n            const fileName = normalizedPath.split('/').pop() || '';\n            if (!normalizedPath.startsWith('src/') &&\n                !normalizedPath.startsWith('public/') &&\n                normalizedPath !== 'index.html' &&\n                !configFiles.includes(fileName)) {\n              normalizedPath = 'src/' + normalizedPath;\n            }\n            return !morphUpdatedPaths.has(normalizedPath);\n          });\n        }\n        \n        for (const [index, file] of filteredFiles.entries()) {\n          try {\n            // Send progress for each file\n            await sendProgress({\n              type: 'file-progress',\n              current: index + 1,\n              total: filteredFiles.length,\n              fileName: file.path,\n              action: 'creating'\n            });\n\n            // Normalize the file path\n            let normalizedPath = file.path;\n            if (normalizedPath.startsWith('/')) {\n              normalizedPath = normalizedPath.substring(1);\n            }\n            if (!normalizedPath.startsWith('src/') &&\n              !normalizedPath.startsWith('public/') &&\n              normalizedPath !== 'index.html' &&\n              !configFiles.includes(normalizedPath.split('/').pop() || '')) {\n              normalizedPath = 'src/' + normalizedPath;\n            }\n\n            const isUpdate = global.existingFiles.has(normalizedPath);\n\n            // Remove any CSS imports from JSX/JS files (we're using Tailwind)\n            let fileContent = file.content;\n            if (file.path.endsWith('.jsx') || file.path.endsWith('.js') || file.path.endsWith('.tsx') || file.path.endsWith('.ts')) {\n              fileContent = fileContent.replace(/import\\s+['\"]\\.\\/[^'\"]+\\.css['\"];?\\s*\\n?/g, '');\n            }\n\n            // Fix common Tailwind CSS errors in CSS files\n            if (file.path.endsWith('.css')) {\n              // Replace shadow-3xl with shadow-2xl (shadow-3xl doesn't exist)\n              fileContent = fileContent.replace(/shadow-3xl/g, 'shadow-2xl');\n              // Replace any other non-existent shadow utilities\n              fileContent = fileContent.replace(/shadow-4xl/g, 'shadow-2xl');\n              fileContent = fileContent.replace(/shadow-5xl/g, 'shadow-2xl');\n            }\n\n            // Create directory if needed\n            const dirPath = normalizedPath.includes('/') ? normalizedPath.substring(0, normalizedPath.lastIndexOf('/')) : '';\n            if (dirPath) {\n              await providerInstance.runCommand(`mkdir -p ${dirPath}`);\n            }\n\n            // Write the file using provider\n            await providerInstance.writeFile(normalizedPath, fileContent);\n\n            // Update file cache\n            if (global.sandboxState?.fileCache) {\n              global.sandboxState.fileCache.files[normalizedPath] = {\n                content: fileContent,\n                lastModified: Date.now()\n              };\n            }\n\n            if (isUpdate) {\n              if (results.filesUpdated) results.filesUpdated.push(normalizedPath);\n            } else {\n              if (results.filesCreated) results.filesCreated.push(normalizedPath);\n              if (global.existingFiles) global.existingFiles.add(normalizedPath);\n            }\n\n            await sendProgress({\n              type: 'file-complete',\n              fileName: normalizedPath,\n              action: isUpdate ? 'updated' : 'created'\n            });\n          } catch (error) {\n            if (results.errors) {\n              results.errors.push(`Failed to create ${file.path}: ${(error as Error).message}`);\n            }\n            await sendProgress({\n              type: 'file-error',\n              fileName: file.path,\n              error: (error as Error).message\n            });\n          }\n        }\n\n        // Step 3: Execute commands\n        const commandsArray = Array.isArray(parsed.commands) ? parsed.commands : [];\n        if (commandsArray.length > 0) {\n          await sendProgress({\n            type: 'step',\n            step: 3,\n            message: `Executing ${commandsArray.length} commands...`\n          });\n\n          for (const [index, cmd] of commandsArray.entries()) {\n            try {\n              await sendProgress({\n                type: 'command-progress',\n                current: index + 1,\n                total: parsed.commands.length,\n                command: cmd,\n                action: 'executing'\n              });\n\n              // Use provider runCommand\n              const result = await providerInstance.runCommand(cmd);\n\n              // Get command output from provider result\n              const stdout = result.stdout;\n              const stderr = result.stderr;\n\n              if (stdout) {\n                await sendProgress({\n                  type: 'command-output',\n                  command: cmd,\n                  output: stdout,\n                  stream: 'stdout'\n                });\n              }\n\n              if (stderr) {\n                await sendProgress({\n                  type: 'command-output',\n                  command: cmd,\n                  output: stderr,\n                  stream: 'stderr'\n                });\n              }\n\n              if (results.commandsExecuted) {\n                results.commandsExecuted.push(cmd);\n              }\n\n              await sendProgress({\n                type: 'command-complete',\n                command: cmd,\n                exitCode: result.exitCode,\n                success: result.exitCode === 0\n              });\n            } catch (error) {\n              if (results.errors) {\n                results.errors.push(`Failed to execute ${cmd}: ${(error as Error).message}`);\n              }\n              await sendProgress({\n                type: 'command-error',\n                command: cmd,\n                error: (error as Error).message\n              });\n            }\n          }\n        }\n\n        // Send final results\n        await sendProgress({\n          type: 'complete',\n          results,\n          explanation: parsed.explanation,\n          structure: parsed.structure,\n          message: `Successfully applied ${results.filesCreated.length} files`\n        });\n\n        // Track applied files in conversation state\n        if (global.conversationState && results.filesCreated.length > 0) {\n          const messages = global.conversationState.context.messages;\n          if (messages.length > 0) {\n            const lastMessage = messages[messages.length - 1];\n            if (lastMessage.role === 'user') {\n              lastMessage.metadata = {\n                ...lastMessage.metadata,\n                editedFiles: results.filesCreated\n              };\n            }\n          }\n\n          // Track applied code in project evolution\n          if (global.conversationState.context.projectEvolution) {\n            global.conversationState.context.projectEvolution.majorChanges.push({\n              timestamp: Date.now(),\n              description: parsed.explanation || 'Code applied',\n              filesAffected: results.filesCreated || []\n            });\n          }\n\n          global.conversationState.lastUpdated = Date.now();\n        }\n\n      } catch (error) {\n        await sendProgress({\n          type: 'error',\n          error: (error as Error).message\n        });\n      } finally {\n        await writer.close();\n      }\n    })(provider, request);\n\n    // Return the stream\n    return new Response(stream.readable, {\n      headers: {\n        'Content-Type': 'text/event-stream',\n        'Cache-Control': 'no-cache',\n        'Connection': 'keep-alive',\n      },\n    });\n\n  } catch (error) {\n    console.error('Apply AI code stream error:', error);\n    return NextResponse.json(\n      { error: error instanceof Error ? error.message : 'Failed to parse AI code' },\n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/api/check-vite-errors/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\n// Stub endpoint to prevent 404 errors\n// This endpoint is being called but the source is unknown\n// Returns empty errors array to satisfy any calling code\nexport async function GET() {\n  return NextResponse.json({\n    success: true,\n    errors: [],\n    message: 'No Vite errors detected'\n  });\n}"
  },
  {
    "path": "app/api/clear-vite-errors-cache/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var viteErrorsCache: { errors: any[], timestamp: number } | null;\n}\n\nexport async function POST() {\n  try {\n    // Clear the cache\n    global.viteErrorsCache = null;\n    \n    console.log('[clear-vite-errors-cache] Cache cleared');\n    \n    return NextResponse.json({\n      success: true,\n      message: 'Vite errors cache cleared'\n    });\n    \n  } catch (error) {\n    console.error('[clear-vite-errors-cache] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/conversation-state/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport type { ConversationState } from '@/types/conversation';\n\ndeclare global {\n  var conversationState: ConversationState | null;\n}\n\n// GET: Retrieve current conversation state\nexport async function GET() {\n  try {\n    if (!global.conversationState) {\n      return NextResponse.json({\n        success: true,\n        state: null,\n        message: 'No active conversation'\n      });\n    }\n    \n    return NextResponse.json({\n      success: true,\n      state: global.conversationState\n    });\n  } catch (error) {\n    console.error('[conversation-state] Error getting state:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}\n\n// POST: Reset or update conversation state\nexport async function POST(request: NextRequest) {\n  try {\n    const { action, data } = await request.json();\n    \n    switch (action) {\n      case 'reset':\n        global.conversationState = {\n          conversationId: `conv-${Date.now()}`,\n          startedAt: Date.now(),\n          lastUpdated: Date.now(),\n          context: {\n            messages: [],\n            edits: [],\n            projectEvolution: { majorChanges: [] },\n            userPreferences: {}\n          }\n        };\n        \n        console.log('[conversation-state] Reset conversation state');\n        \n        return NextResponse.json({\n          success: true,\n          message: 'Conversation state reset',\n          state: global.conversationState\n        });\n        \n      case 'clear-old':\n        // Clear old conversation data but keep recent context\n        if (!global.conversationState) {\n          // Initialize conversation state if it doesn't exist\n          global.conversationState = {\n            conversationId: `conv-${Date.now()}`,\n            startedAt: Date.now(),\n            lastUpdated: Date.now(),\n            context: {\n              messages: [],\n              edits: [],\n              projectEvolution: { majorChanges: [] },\n              userPreferences: {}\n            }\n          };\n          \n          console.log('[conversation-state] Initialized new conversation state for clear-old');\n          \n          return NextResponse.json({\n            success: true,\n            message: 'New conversation state initialized',\n            state: global.conversationState\n          });\n        }\n        \n        // Keep only recent data\n        global.conversationState.context.messages = global.conversationState.context.messages.slice(-5);\n        global.conversationState.context.edits = global.conversationState.context.edits.slice(-3);\n        global.conversationState.context.projectEvolution.majorChanges = \n          global.conversationState.context.projectEvolution.majorChanges.slice(-2);\n        \n        console.log('[conversation-state] Cleared old conversation data');\n        \n        return NextResponse.json({\n          success: true,\n          message: 'Old conversation data cleared',\n          state: global.conversationState\n        });\n        \n      case 'update':\n        if (!global.conversationState) {\n          return NextResponse.json({\n            success: false,\n            error: 'No active conversation to update'\n          }, { status: 400 });\n        }\n        \n        // Update specific fields if provided\n        if (data) {\n          if (data.currentTopic) {\n            global.conversationState.context.currentTopic = data.currentTopic;\n          }\n          if (data.userPreferences) {\n            global.conversationState.context.userPreferences = {\n              ...global.conversationState.context.userPreferences,\n              ...data.userPreferences\n            };\n          }\n          \n          global.conversationState.lastUpdated = Date.now();\n        }\n        \n        return NextResponse.json({\n          success: true,\n          message: 'Conversation state updated',\n          state: global.conversationState\n        });\n        \n      default:\n        return NextResponse.json({\n          success: false,\n          error: 'Invalid action. Use \"reset\" or \"update\"'\n        }, { status: 400 });\n    }\n  } catch (error) {\n    console.error('[conversation-state] Error:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}\n\n// DELETE: Clear conversation state\nexport async function DELETE() {\n  try {\n    global.conversationState = null;\n    \n    console.log('[conversation-state] Cleared conversation state');\n    \n    return NextResponse.json({\n      success: true,\n      message: 'Conversation state cleared'\n    });\n  } catch (error) {\n    console.error('[conversation-state] Error clearing state:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/create-ai-sandbox/route.ts",
    "content": "import { NextResponse } from 'next/server';\nimport { Sandbox } from '@vercel/sandbox';\nimport type { SandboxState } from '@/types/sandbox';\nimport { appConfig } from '@/config/app.config';\n\n// Store active sandbox globally\ndeclare global {\n  var activeSandbox: any;\n  var sandboxData: any;\n  var existingFiles: Set<string>;\n  var sandboxState: SandboxState;\n  var sandboxCreationInProgress: boolean;\n  var sandboxCreationPromise: Promise<any> | null;\n}\n\nexport async function POST() {\n  // Check if sandbox creation is already in progress\n  if (global.sandboxCreationInProgress && global.sandboxCreationPromise) {\n    console.log('[create-ai-sandbox] Sandbox creation already in progress, waiting for existing creation...');\n    try {\n      const existingResult = await global.sandboxCreationPromise;\n      console.log('[create-ai-sandbox] Returning existing sandbox creation result');\n      return NextResponse.json(existingResult);\n    } catch (error) {\n      console.error('[create-ai-sandbox] Existing sandbox creation failed:', error);\n      // Continue with new creation if the existing one failed\n    }\n  }\n\n  // Check if we already have an active sandbox\n  if (global.activeSandbox && global.sandboxData) {\n    console.log('[create-ai-sandbox] Returning existing active sandbox');\n    return NextResponse.json({\n      success: true,\n      sandboxId: global.sandboxData.sandboxId,\n      url: global.sandboxData.url\n    });\n  }\n\n  // Set the creation flag\n  global.sandboxCreationInProgress = true;\n  \n  // Create the promise that other requests can await\n  global.sandboxCreationPromise = createSandboxInternal();\n  \n  try {\n    const result = await global.sandboxCreationPromise;\n    return NextResponse.json(result);\n  } catch (error) {\n    console.error('[create-ai-sandbox] Sandbox creation failed:', error);\n    return NextResponse.json(\n      { \n        error: error instanceof Error ? error.message : 'Failed to create sandbox',\n        details: error instanceof Error ? error.stack : undefined\n      },\n      { status: 500 }\n    );\n  } finally {\n    global.sandboxCreationInProgress = false;\n    global.sandboxCreationPromise = null;\n  }\n}\n\nasync function createSandboxInternal() {\n  let sandbox: any = null;\n\n  try {\n    console.log('[create-ai-sandbox] Creating Vercel sandbox...');\n    \n    // Kill existing sandbox if any\n    if (global.activeSandbox) {\n      console.log('[create-ai-sandbox] Stopping existing sandbox...');\n      try {\n        await global.activeSandbox.stop();\n      } catch (e) {\n        console.error('Failed to stop existing sandbox:', e);\n      }\n      global.activeSandbox = null;\n      global.sandboxData = null;\n    }\n    \n    // Clear existing files tracking\n    if (global.existingFiles) {\n      global.existingFiles.clear();\n    } else {\n      global.existingFiles = new Set<string>();\n    }\n\n    // Create Vercel sandbox with flexible authentication\n    console.log(`[create-ai-sandbox] Creating Vercel sandbox with ${appConfig.vercelSandbox.timeoutMinutes} minute timeout...`);\n    \n    // Prepare sandbox configuration\n    const sandboxConfig: any = {\n      timeout: appConfig.vercelSandbox.timeoutMs,\n      runtime: appConfig.vercelSandbox.runtime,\n      ports: [appConfig.vercelSandbox.devPort]\n    };\n    \n    // Add authentication parameters if using personal access token\n    if (process.env.VERCEL_TOKEN && process.env.VERCEL_TEAM_ID && process.env.VERCEL_PROJECT_ID) {\n      console.log('[create-ai-sandbox] Using personal access token authentication');\n      sandboxConfig.teamId = process.env.VERCEL_TEAM_ID;\n      sandboxConfig.projectId = process.env.VERCEL_PROJECT_ID;\n      sandboxConfig.token = process.env.VERCEL_TOKEN;\n    } else if (process.env.VERCEL_OIDC_TOKEN) {\n      console.log('[create-ai-sandbox] Using OIDC token authentication');\n    } else {\n      console.log('[create-ai-sandbox] No authentication found - relying on default Vercel authentication');\n    }\n    \n    sandbox = await Sandbox.create(sandboxConfig);\n    \n    const sandboxId = sandbox.sandboxId;\n    console.log(`[create-ai-sandbox] Sandbox created: ${sandboxId}`);\n\n    // Set up a basic Vite React app\n    console.log('[create-ai-sandbox] Setting up Vite React app...');\n    \n    // First, change to the working directory\n    await sandbox.runCommand('pwd');\n    // workDir is defined in appConfig - not needed here\n    \n    // Get the sandbox URL using the correct Vercel Sandbox API\n    const sandboxUrl = sandbox.domain(appConfig.vercelSandbox.devPort);\n    \n    // Extract the hostname from the sandbox URL for Vite config\n    const sandboxHostname = new URL(sandboxUrl).hostname;\n    console.log(`[create-ai-sandbox] Sandbox hostname: ${sandboxHostname}`);\n\n    // Create the Vite config content with the proper hostname (using string concatenation)\n    const viteConfigContent = `import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\n// Vercel Sandbox compatible Vite configuration\nexport default defineConfig({\n  plugins: [react()],\n  server: {\n    host: '0.0.0.0',\n    port: ${appConfig.vercelSandbox.devPort},\n    strictPort: true,\n    hmr: true,\n    allowedHosts: [\n      'localhost',\n      '127.0.0.1',\n      '` + sandboxHostname + `', // Allow the Vercel Sandbox domain\n      '.vercel.run', // Allow all Vercel sandbox domains\n      '.vercel-sandbox.dev' // Fallback pattern\n    ]\n  }\n})`;\n\n    // Create the project files (now we have the sandbox hostname)\n    const projectFiles = [\n      {\n        path: 'package.json',\n        content: Buffer.from(JSON.stringify({\n          \"name\": \"sandbox-app\",\n          \"version\": \"1.0.0\",\n          \"type\": \"module\",\n          \"scripts\": {\n            \"dev\": \"vite --host --port 3000\",\n            \"build\": \"vite build\",\n            \"preview\": \"vite preview\"\n          },\n          \"dependencies\": {\n            \"react\": \"^18.2.0\",\n            \"react-dom\": \"^18.2.0\"\n          },\n          \"devDependencies\": {\n            \"@vitejs/plugin-react\": \"^4.0.0\",\n            \"vite\": \"^4.3.9\",\n            \"tailwindcss\": \"^3.3.0\",\n            \"postcss\": \"^8.4.31\",\n            \"autoprefixer\": \"^10.4.16\"\n          }\n        }, null, 2))\n      },\n      {\n        path: 'vite.config.js',\n        content: Buffer.from(viteConfigContent)\n      },\n      {\n        path: 'tailwind.config.js',\n        content: Buffer.from(`/** @type {import('tailwindcss').Config} */\nexport default {\n  content: [\n    \"./index.html\",\n    \"./src/**/*.{js,ts,jsx,tsx}\",\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}`)\n      },\n      {\n        path: 'postcss.config.js',\n        content: Buffer.from(`export default {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n}`)\n      },\n      {\n        path: 'index.html',\n        content: Buffer.from(`<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Sandbox App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.jsx\"></script>\n  </body>\n</html>`)\n      },\n      {\n        path: 'src/main.jsx',\n        content: Buffer.from(`import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n)`)\n      },\n      {\n        path: 'src/App.jsx',\n        content: Buffer.from(`function App() {\n  return (\n    <div className=\"min-h-screen bg-gray-900 text-white flex items-center justify-center p-4\">\n      <div className=\"text-center max-w-2xl\">\n        <h1 className=\"text-4xl font-bold mb-4 bg-gradient-to-r from-blue-500 to-purple-600 bg-clip-text text-transparent\">\n          Sandbox Ready\n        </h1>\n        <p className=\"text-lg text-gray-400\">\n          Start building your React app with Vite and Tailwind CSS!\n        </p>\n      </div>\n    </div>\n  )\n}\n\nexport default App`)\n      },\n      {\n        path: 'src/index.css',\n        content: Buffer.from(`@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n/* Force Tailwind to load */\n@layer base {\n  :root {\n    font-synthesis: none;\n    text-rendering: optimizeLegibility;\n    -webkit-font-smoothing: antialiased;\n    -moz-osx-font-smoothing: grayscale;\n    -webkit-text-size-adjust: 100%;\n  }\n  \n  * {\n    margin: 0;\n    padding: 0;\n    box-sizing: border-box;\n  }\n}\n\nbody {\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n  background-color: rgb(17 24 39);\n}`)\n      }\n    ];\n\n    // Create directory structure first\n    await sandbox.runCommand({\n      cmd: 'mkdir',\n      args: ['-p', 'src']\n    });\n    \n    // Write all files\n    await sandbox.writeFiles(projectFiles);\n    console.log('[create-ai-sandbox] ✓ Project files created');\n    \n    // Install dependencies\n    console.log('[create-ai-sandbox] Installing dependencies...');\n    const installResult = await sandbox.runCommand({\n      cmd: 'npm',\n      args: ['install', '--loglevel', 'info']\n    });\n    if (installResult.exitCode === 0) {\n      console.log('[create-ai-sandbox] ✓ Dependencies installed successfully');\n    } else {\n      console.log('[create-ai-sandbox] ⚠ Warning: npm install had issues but continuing...');\n    }\n    \n    // Start Vite dev server in detached mode\n    console.log('[create-ai-sandbox] Starting Vite dev server...');\n    const viteProcess = await sandbox.runCommand({\n      cmd: 'npm',\n      args: ['run', 'dev'],\n      detached: true\n    });\n    \n    console.log('[create-ai-sandbox] ✓ Vite dev server started');\n    \n    // Wait for Vite to be fully ready\n    await new Promise(resolve => setTimeout(resolve, appConfig.vercelSandbox.devServerStartupDelay));\n\n    // Store sandbox globally\n    global.activeSandbox = sandbox;\n    global.sandboxData = {\n      sandboxId,\n      url: sandboxUrl,\n      viteProcess\n    };\n    \n    // Initialize sandbox state\n    global.sandboxState = {\n      fileCache: {\n        files: {},\n        lastSync: Date.now(),\n        sandboxId\n      },\n      sandbox,\n      sandboxData: {\n        sandboxId,\n        url: sandboxUrl\n      }\n    };\n    \n    // Track initial files\n    global.existingFiles.add('src/App.jsx');\n    global.existingFiles.add('src/main.jsx');\n    global.existingFiles.add('src/index.css');\n    global.existingFiles.add('index.html');\n    global.existingFiles.add('package.json');\n    global.existingFiles.add('vite.config.js');\n    global.existingFiles.add('tailwind.config.js');\n    global.existingFiles.add('postcss.config.js');\n    \n    console.log('[create-ai-sandbox] Sandbox ready at:', sandboxUrl);\n    \n    const result = {\n      success: true,\n      sandboxId,\n      url: sandboxUrl,\n      message: 'Vercel sandbox created and Vite React app initialized'\n    };\n    \n    // Store the result for reuse\n    global.sandboxData = {\n      ...global.sandboxData,\n      ...result\n    };\n    \n    return result;\n\n  } catch (error) {\n    console.error('[create-ai-sandbox] Error:', error);\n    \n    // Clean up on error\n    if (sandbox) {\n      try {\n        await sandbox.stop();\n      } catch (e) {\n        console.error('Failed to stop sandbox on error:', e);\n      }\n    }\n    \n    // Clear global state on error\n    global.activeSandbox = null;\n    global.sandboxData = null;\n    \n    throw error; // Throw to be caught by the outer handler\n  }\n}"
  },
  {
    "path": "app/api/create-ai-sandbox-v2/route.ts",
    "content": "import { NextResponse } from 'next/server';\nimport { SandboxFactory } from '@/lib/sandbox/factory';\n// SandboxProvider type is used through SandboxFactory\nimport type { SandboxState } from '@/types/sandbox';\nimport { sandboxManager } from '@/lib/sandbox/sandbox-manager';\n\n// Store active sandbox globally\ndeclare global {\n  var activeSandboxProvider: any;\n  var sandboxData: any;\n  var existingFiles: Set<string>;\n  var sandboxState: SandboxState;\n}\n\nexport async function POST() {\n  try {\n    console.log('[create-ai-sandbox-v2] Creating sandbox...');\n    \n    // Clean up all existing sandboxes\n    console.log('[create-ai-sandbox-v2] Cleaning up existing sandboxes...');\n    await sandboxManager.terminateAll();\n    \n    // Also clean up legacy global state\n    if (global.activeSandboxProvider) {\n      try {\n        await global.activeSandboxProvider.terminate();\n      } catch (e) {\n        console.error('Failed to terminate legacy global sandbox:', e);\n      }\n      global.activeSandboxProvider = null;\n    }\n    \n    // Clear existing files tracking\n    if (global.existingFiles) {\n      global.existingFiles.clear();\n    } else {\n      global.existingFiles = new Set<string>();\n    }\n\n    // Create new sandbox using factory\n    const provider = SandboxFactory.create();\n    const sandboxInfo = await provider.createSandbox();\n    \n    console.log('[create-ai-sandbox-v2] Setting up Vite React app...');\n    await provider.setupViteApp();\n    \n    // Register with sandbox manager\n    sandboxManager.registerSandbox(sandboxInfo.sandboxId, provider);\n    \n    // Also store in legacy global state for backward compatibility\n    global.activeSandboxProvider = provider;\n    global.sandboxData = {\n      sandboxId: sandboxInfo.sandboxId,\n      url: sandboxInfo.url\n    };\n    \n    // Initialize sandbox state\n    global.sandboxState = {\n      fileCache: {\n        files: {},\n        lastSync: Date.now(),\n        sandboxId: sandboxInfo.sandboxId\n      },\n      sandbox: provider, // Store the provider instead of raw sandbox\n      sandboxData: {\n        sandboxId: sandboxInfo.sandboxId,\n        url: sandboxInfo.url\n      }\n    };\n    \n    console.log('[create-ai-sandbox-v2] Sandbox ready at:', sandboxInfo.url);\n    \n    return NextResponse.json({\n      success: true,\n      sandboxId: sandboxInfo.sandboxId,\n      url: sandboxInfo.url,\n      provider: sandboxInfo.provider,\n      message: 'Sandbox created and Vite React app initialized'\n    });\n\n  } catch (error) {\n    console.error('[create-ai-sandbox-v2] Error:', error);\n    \n    // Clean up on error\n    await sandboxManager.terminateAll();\n    if (global.activeSandboxProvider) {\n      try {\n        await global.activeSandboxProvider.terminate();\n      } catch (e) {\n        console.error('Failed to terminate sandbox on error:', e);\n      }\n      global.activeSandboxProvider = null;\n    }\n    \n    return NextResponse.json(\n      { \n        error: error instanceof Error ? error.message : 'Failed to create sandbox',\n        details: error instanceof Error ? error.stack : undefined\n      },\n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/api/create-zip/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function POST() {\n  try {\n    if (!global.activeSandbox) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log('[create-zip] Creating project zip...');\n    \n    // Create zip file in sandbox using standard commands\n    const zipResult = await global.activeSandbox.runCommand({\n      cmd: 'bash',\n      args: ['-c', `zip -r /tmp/project.zip . -x \"node_modules/*\" \".git/*\" \".next/*\" \"dist/*\" \"build/*\" \"*.log\"`]\n    });\n    \n    if (zipResult.exitCode !== 0) {\n      const error = await zipResult.stderr();\n      throw new Error(`Failed to create zip: ${error}`);\n    }\n    \n    const sizeResult = await global.activeSandbox.runCommand({\n      cmd: 'bash',\n      args: ['-c', `ls -la /tmp/project.zip | awk '{print $5}'`]\n    });\n    \n    const fileSize = await sizeResult.stdout();\n    console.log(`[create-zip] Created project.zip (${fileSize.trim()} bytes)`);\n    \n    // Read the zip file and convert to base64\n    const readResult = await global.activeSandbox.runCommand({\n      cmd: 'base64',\n      args: ['/tmp/project.zip']\n    });\n    \n    if (readResult.exitCode !== 0) {\n      const error = await readResult.stderr();\n      throw new Error(`Failed to read zip file: ${error}`);\n    }\n    \n    const base64Content = (await readResult.stdout()).trim();\n    \n    // Create a data URL for download\n    const dataUrl = `data:application/zip;base64,${base64Content}`;\n    \n    return NextResponse.json({\n      success: true,\n      dataUrl,\n      fileName: 'vercel-sandbox-project.zip',\n      message: 'Zip file created successfully'\n    });\n    \n  } catch (error) {\n    console.error('[create-zip] Error:', error);\n    return NextResponse.json(\n      { \n        success: false, \n        error: (error as Error).message \n      }, \n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/api/detect-and-install-packages/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { files } = await request.json();\n    \n    if (!files || typeof files !== 'object') {\n      return NextResponse.json({ \n        success: false, \n        error: 'Files object is required' \n      }, { status: 400 });\n    }\n\n    if (!global.activeSandbox) {\n      return NextResponse.json({\n        success: false,\n        error: 'No active sandbox'\n      }, { status: 404 });\n    }\n\n    console.log('[detect-and-install-packages] Processing files:', Object.keys(files));\n\n    // Extract all import statements from the files\n    const imports = new Set<string>();\n    const importRegex = /import\\s+(?:(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+)\\s*,?\\s*)*(?:from\\s+)?['\"]([^'\"]+)['\"]/g;\n    const requireRegex = /require\\s*\\(['\"]([^'\"]+)['\"]\\)/g;\n\n    for (const [filePath, content] of Object.entries(files)) {\n      if (typeof content !== 'string') continue;\n      \n      // Skip non-JS/JSX/TS/TSX files\n      if (!filePath.match(/\\.(jsx?|tsx?)$/)) continue;\n\n      // Find ES6 imports\n      let match;\n      while ((match = importRegex.exec(content)) !== null) {\n        imports.add(match[1]);\n      }\n\n      // Find CommonJS requires\n      while ((match = requireRegex.exec(content)) !== null) {\n        imports.add(match[1]);\n      }\n    }\n\n    console.log('[detect-and-install-packages] Found imports:', Array.from(imports));\n    \n    // Log specific heroicons imports\n    const heroiconImports = Array.from(imports).filter(imp => imp.includes('heroicons'));\n    if (heroiconImports.length > 0) {\n      console.log('[detect-and-install-packages] Heroicon imports:', heroiconImports);\n    }\n\n    // Filter out relative imports and built-in modules\n    const packages = Array.from(imports).filter(imp => {\n      // Skip relative imports\n      if (imp.startsWith('.') || imp.startsWith('/')) return false;\n      \n      // Skip built-in Node modules\n      const builtins = ['fs', 'path', 'http', 'https', 'crypto', 'stream', 'util', 'os', 'url', 'querystring', 'child_process'];\n      if (builtins.includes(imp)) return false;\n      \n      return true;\n    });\n\n    // Extract just the package names (without subpaths)\n    const packageNames = packages.map(pkg => {\n      if (pkg.startsWith('@')) {\n        // Scoped package: @scope/package or @scope/package/subpath\n        const parts = pkg.split('/');\n        return parts.slice(0, 2).join('/');\n      } else {\n        // Regular package: package or package/subpath\n        return pkg.split('/')[0];\n      }\n    });\n\n    // Remove duplicates\n    const uniquePackages = [...new Set(packageNames)];\n\n    console.log('[detect-and-install-packages] Packages to install:', uniquePackages);\n\n    if (uniquePackages.length === 0) {\n      return NextResponse.json({\n        success: true,\n        packagesInstalled: [],\n        message: 'No new packages to install'\n      });\n    }\n\n    // Check which packages are already installed\n    const installed: string[] = [];\n    const missing: string[] = [];\n    \n    for (const packageName of uniquePackages) {\n      try {\n        const checkResult = await global.activeSandbox.runCommand({\n          cmd: 'test',\n          args: ['-d', `node_modules/${packageName}`]\n        });\n        \n        if (checkResult.exitCode === 0) {\n          installed.push(packageName);\n        } else {\n          missing.push(packageName);\n        }\n      } catch (checkError) {\n        // If test command fails, assume package is missing\n        console.debug(`Package check failed for ${packageName}:`, checkError);\n        missing.push(packageName);\n      }\n    }\n\n    console.log('[detect-and-install-packages] Package status:', { installed, missing });\n\n    if (missing.length === 0) {\n      return NextResponse.json({\n        success: true,\n        packagesInstalled: [],\n        packagesAlreadyInstalled: installed,\n        message: 'All packages already installed'\n      });\n    }\n\n    // Install missing packages\n    console.log('[detect-and-install-packages] Installing packages:', missing);\n    \n    const installResult = await global.activeSandbox.runCommand({\n      cmd: 'npm',\n      args: ['install', '--save', ...missing]\n    });\n\n    const stdout = await installResult.stdout();\n    const stderr = await installResult.stderr();\n    \n    console.log('[detect-and-install-packages] Install stdout:', stdout);\n    if (stderr) {\n      console.log('[detect-and-install-packages] Install stderr:', stderr);\n    }\n\n    // Verify installation\n    const finalInstalled: string[] = [];\n    const failed: string[] = [];\n\n    for (const packageName of missing) {\n      try {\n        const verifyResult = await global.activeSandbox.runCommand({\n          cmd: 'test',\n          args: ['-d', `node_modules/${packageName}`]\n        });\n        \n        if (verifyResult.exitCode === 0) {\n          finalInstalled.push(packageName);\n          console.log(`✓ Verified installation of ${packageName}`);\n        } else {\n          failed.push(packageName);\n          console.log(`✗ Failed to verify installation of ${packageName}`);\n        }\n      } catch (error) {\n        failed.push(packageName);\n        console.log(`✗ Error verifying ${packageName}:`, error);\n      }\n    }\n\n    if (failed.length > 0) {\n      console.error('[detect-and-install-packages] Failed to install:', failed);\n    }\n\n    return NextResponse.json({\n      success: true,\n      packagesInstalled: finalInstalled,\n      packagesFailed: failed,\n      packagesAlreadyInstalled: installed,\n      message: `Installed ${finalInstalled.length} packages`,\n      logs: stdout\n    });\n\n  } catch (error) {\n    console.error('[detect-and-install-packages] Error:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/extract-brand-styles/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\nexport async function POST(request: NextRequest) {\n  try {\n    const body = await request.json();\n    const url = body.url;\n    const prompt = body.prompt;\n\n    console.log('[extract-brand-styles] Extracting brand styles for:', url);\n    console.log('[extract-brand-styles] User prompt:', prompt);\n\n    // Call Firecrawl API to extract branding information\n    const FIRECRAWL_API_KEY = process.env.FIRECRAWL_API_KEY;\n\n    if (!FIRECRAWL_API_KEY) {\n      console.error('[extract-brand-styles] No Firecrawl API key found');\n      throw new Error('Firecrawl API key not configured');\n    }\n\n    console.log('[extract-brand-styles] Calling Firecrawl branding API for:', url);\n\n    const firecrawlResponse = await fetch('https://api.firecrawl.dev/v2/scrape', {\n      method: 'POST',\n      headers: {\n        'Authorization': `Bearer ${FIRECRAWL_API_KEY}`,\n        'Content-Type': 'application/json',\n      },\n      body: JSON.stringify({\n        url: url,\n        formats: ['branding'],\n      }),\n    });\n\n    if (!firecrawlResponse.ok) {\n      const errorText = await firecrawlResponse.text();\n      console.error('[extract-brand-styles] Firecrawl API error:', firecrawlResponse.status, errorText);\n      throw new Error(`Firecrawl API returned ${firecrawlResponse.status}`);\n    }\n\n    const firecrawlData = await firecrawlResponse.json();\n    console.log('[extract-brand-styles] Firecrawl response received successfully');\n\n    // Extract branding data from response\n    const brandingData = firecrawlData.data?.branding || firecrawlData.branding;\n\n    if (!brandingData) {\n      console.error('[extract-brand-styles] No branding data in Firecrawl response');\n      console.log('[extract-brand-styles] Response structure:', JSON.stringify(firecrawlData, null, 2));\n      throw new Error('No branding data in Firecrawl response');\n    }\n\n    console.log('[extract-brand-styles] Successfully extracted branding data');\n\n    // Return the branding data\n    return NextResponse.json({\n      success: true,\n      url,\n      styleName: brandingData.name || url,\n      guidelines: brandingData,\n    });\n\n  } catch (error) {\n    console.error('[extract-brand-styles] Error occurred:', error);\n    return NextResponse.json(\n      {\n        success: false,\n        error: error instanceof Error ? error.message : 'Failed to extract brand styles'\n      },\n      { status: 500 }\n    );\n  }\n}\n"
  },
  {
    "path": "app/api/generate-ai-code-stream/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { createGroq } from '@ai-sdk/groq';\nimport { createAnthropic } from '@ai-sdk/anthropic';\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { createGoogleGenerativeAI } from '@ai-sdk/google';\nimport { streamText } from 'ai';\nimport type { SandboxState } from '@/types/sandbox';\nimport { selectFilesForEdit, getFileContents, formatFilesForAI } from '@/lib/context-selector';\nimport { executeSearchPlan, formatSearchResultsForAI, selectTargetFile } from '@/lib/file-search-executor';\nimport { FileManifest } from '@/types/file-manifest';\nimport type { ConversationState, ConversationMessage, ConversationEdit } from '@/types/conversation';\nimport { appConfig } from '@/config/app.config';\n\n// Force dynamic route to enable streaming\nexport const dynamic = 'force-dynamic';\n\n// Check if we're using Vercel AI Gateway\nconst isUsingAIGateway = !!process.env.AI_GATEWAY_API_KEY;\nconst aiGatewayBaseURL = 'https://ai-gateway.vercel.sh/v1';\n\nconsole.log('[generate-ai-code-stream] AI Gateway config:', {\n  isUsingAIGateway,\n  hasGroqKey: !!process.env.GROQ_API_KEY,\n  hasAIGatewayKey: !!process.env.AI_GATEWAY_API_KEY\n});\n\nconst groq = createGroq({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.GROQ_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : undefined,\n});\n\nconst anthropic = createAnthropic({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.ANTHROPIC_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : (process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com/v1'),\n});\n\nconst googleGenerativeAI = createGoogleGenerativeAI({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.GEMINI_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : undefined,\n});\n\nconst openai = createOpenAI({\n  apiKey: process.env.AI_GATEWAY_API_KEY ?? process.env.OPENAI_API_KEY,\n  baseURL: isUsingAIGateway ? aiGatewayBaseURL : process.env.OPENAI_BASE_URL,\n});\n\n// Helper function to analyze user preferences from conversation history\nfunction analyzeUserPreferences(messages: ConversationMessage[]): {\n  commonPatterns: string[];\n  preferredEditStyle: 'targeted' | 'comprehensive';\n} {\n  const userMessages = messages.filter(m => m.role === 'user');\n  const patterns: string[] = [];\n  \n  // Count edit-related keywords\n  let targetedEditCount = 0;\n  let comprehensiveEditCount = 0;\n  \n  userMessages.forEach(msg => {\n    const content = msg.content.toLowerCase();\n    \n    // Check for targeted edit patterns\n    if (content.match(/\\b(update|change|fix|modify|edit|remove|delete)\\s+(\\w+\\s+)?(\\w+)\\b/)) {\n      targetedEditCount++;\n    }\n    \n    // Check for comprehensive edit patterns\n    if (content.match(/\\b(rebuild|recreate|redesign|overhaul|refactor)\\b/)) {\n      comprehensiveEditCount++;\n    }\n    \n    // Extract common request patterns\n    if (content.includes('hero')) patterns.push('hero section edits');\n    if (content.includes('header')) patterns.push('header modifications');\n    if (content.includes('color') || content.includes('style')) patterns.push('styling changes');\n    if (content.includes('button')) patterns.push('button updates');\n    if (content.includes('animation')) patterns.push('animation requests');\n  });\n  \n  return {\n    commonPatterns: [...new Set(patterns)].slice(0, 3), // Top 3 unique patterns\n    preferredEditStyle: targetedEditCount > comprehensiveEditCount ? 'targeted' : 'comprehensive'\n  };\n}\n\ndeclare global {\n  var sandboxState: SandboxState;\n  var conversationState: ConversationState | null;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { prompt, model = 'openai/gpt-oss-20b', context, isEdit = false } = await request.json();\n    \n    console.log('[generate-ai-code-stream] Received request:');\n    console.log('[generate-ai-code-stream] - prompt:', prompt);\n    console.log('[generate-ai-code-stream] - isEdit:', isEdit);\n    console.log('[generate-ai-code-stream] - context.sandboxId:', context?.sandboxId);\n    console.log('[generate-ai-code-stream] - context.currentFiles:', context?.currentFiles ? Object.keys(context.currentFiles) : 'none');\n    console.log('[generate-ai-code-stream] - currentFiles count:', context?.currentFiles ? Object.keys(context.currentFiles).length : 0);\n    \n    // Initialize conversation state if not exists\n    if (!global.conversationState) {\n      global.conversationState = {\n        conversationId: `conv-${Date.now()}`,\n        startedAt: Date.now(),\n        lastUpdated: Date.now(),\n        context: {\n          messages: [],\n          edits: [],\n          projectEvolution: { majorChanges: [] },\n          userPreferences: {}\n        }\n      };\n    }\n    \n    // Add user message to conversation history\n    const userMessage: ConversationMessage = {\n      id: `msg-${Date.now()}`,\n      role: 'user',\n      content: prompt,\n      timestamp: Date.now(),\n      metadata: {\n        sandboxId: context?.sandboxId\n      }\n    };\n    global.conversationState.context.messages.push(userMessage);\n    \n    // Clean up old messages to prevent unbounded growth\n    if (global.conversationState.context.messages.length > 20) {\n      // Keep only the last 15 messages\n      global.conversationState.context.messages = global.conversationState.context.messages.slice(-15);\n      console.log('[generate-ai-code-stream] Trimmed conversation history to prevent context overflow');\n    }\n    \n    // Clean up old edits\n    if (global.conversationState.context.edits.length > 10) {\n      global.conversationState.context.edits = global.conversationState.context.edits.slice(-8);\n    }\n    \n    // Debug: Show a sample of actual file content\n    if (context?.currentFiles && Object.keys(context.currentFiles).length > 0) {\n      const firstFile = Object.entries(context.currentFiles)[0];\n      console.log('[generate-ai-code-stream] - sample file:', firstFile[0]);\n      console.log('[generate-ai-code-stream] - sample content preview:', \n        typeof firstFile[1] === 'string' ? firstFile[1].substring(0, 100) + '...' : 'not a string');\n    }\n    \n    if (!prompt) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Prompt is required' \n      }, { status: 400 });\n    }\n    \n    // Create a stream for real-time updates\n    const encoder = new TextEncoder();\n    const stream = new TransformStream();\n    const writer = stream.writable.getWriter();\n    \n    // Function to send progress updates with flushing\n    const sendProgress = async (data: any) => {\n      const message = `data: ${JSON.stringify(data)}\\n\\n`;\n      try {\n        await writer.write(encoder.encode(message));\n        // Force flush by writing a keep-alive comment\n        if (data.type === 'stream' || data.type === 'conversation') {\n          await writer.write(encoder.encode(': keepalive\\n\\n'));\n        }\n      } catch (error) {\n        console.error('[generate-ai-code-stream] Error writing to stream:', error);\n      }\n    };\n    \n    // Start processing in background\n    (async () => {\n      try {\n        // Send initial status\n        await sendProgress({ type: 'status', message: 'Initializing AI...' });\n        \n        // No keep-alive needed - sandbox provisioned for 10 minutes\n        \n        // Check if we have a file manifest for edit mode\n        let editContext = null;\n        let enhancedSystemPrompt = '';\n        \n        if (isEdit) {\n          console.log('[generate-ai-code-stream] Edit mode detected - starting agentic search workflow');\n          console.log('[generate-ai-code-stream] Has fileCache:', !!global.sandboxState?.fileCache);\n          console.log('[generate-ai-code-stream] Has manifest:', !!global.sandboxState?.fileCache?.manifest);\n          \n          const manifest: FileManifest | undefined = global.sandboxState?.fileCache?.manifest;\n          \n          if (manifest) {\n            await sendProgress({ type: 'status', message: '🔍 Creating search plan...' });\n            \n            const fileContents = global.sandboxState.fileCache?.files || {};\n            console.log('[generate-ai-code-stream] Files available for search:', Object.keys(fileContents).length);\n            \n            // STEP 1: Get search plan from AI\n            try {\n              const intentResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/analyze-edit-intent`, {\n                method: 'POST',\n                headers: { 'Content-Type': 'application/json' },\n                body: JSON.stringify({ prompt, manifest, model })\n              });\n              \n              if (intentResponse.ok) {\n                const { searchPlan } = await intentResponse.json();\n                console.log('[generate-ai-code-stream] Search plan received:', searchPlan);\n                \n                await sendProgress({ \n                  type: 'status', \n                  message: `🔎 Searching for: \"${searchPlan.searchTerms.join('\", \"')}\"`\n                });\n                \n                // STEP 2: Execute the search plan\n                const searchExecution = executeSearchPlan(searchPlan, \n                  Object.fromEntries(\n                    Object.entries(fileContents).map(([path, data]) => [\n                      path.startsWith('/') ? path : `/home/user/app/${path}`,\n                      data.content\n                    ])\n                  )\n                );\n                \n                console.log('[generate-ai-code-stream] Search execution:', {\n                  success: searchExecution.success,\n                  resultsCount: searchExecution.results.length,\n                  filesSearched: searchExecution.filesSearched,\n                  time: searchExecution.executionTime + 'ms'\n                });\n                \n                if (searchExecution.success && searchExecution.results.length > 0) {\n                  // STEP 3: Select the best target file\n                  const target = selectTargetFile(searchExecution.results, searchPlan.editType);\n                  \n                  if (target) {\n                    await sendProgress({ \n                      type: 'status', \n                      message: `✅ Found code in ${target.filePath.split('/').pop()} at line ${target.lineNumber}`\n                    });\n                    \n                    console.log('[generate-ai-code-stream] Target selected:', target);\n                    \n                    // Create surgical edit context with exact location\n                    // normalizedPath would be: target.filePath.replace('/home/user/app/', '');\n                    // fileContent available but not used in current implementation\n                    // const fileContent = fileContents[normalizedPath]?.content || '';\n                    \n                    // Build enhanced context with search results\n                    enhancedSystemPrompt = `\n${formatSearchResultsForAI(searchExecution.results)}\n\nSURGICAL EDIT INSTRUCTIONS:\nYou have been given the EXACT location of the code to edit.\n- File: ${target.filePath}\n- Line: ${target.lineNumber}\n- Reason: ${target.reason}\n\nMake ONLY the change requested by the user. Do not modify any other code.\nUser request: \"${prompt}\"`;\n                    \n                    // Set up edit context with just this one file\n                    editContext = {\n                      primaryFiles: [target.filePath],\n                      contextFiles: [],\n                      systemPrompt: enhancedSystemPrompt,\n                      editIntent: {\n                        type: searchPlan.editType,\n                        description: searchPlan.reasoning,\n                        targetFiles: [target.filePath],\n                        confidence: 0.95, // High confidence since we found exact location\n                        searchTerms: searchPlan.searchTerms\n                      }\n                    };\n                    \n                    console.log('[generate-ai-code-stream] Surgical edit context created');\n                  }\n                } else {\n                  // Search failed - fall back to old behavior but inform user\n                  console.warn('[generate-ai-code-stream] Search found no results, falling back to broader context');\n                  await sendProgress({ \n                    type: 'status', \n                    message: '⚠️ Could not find exact match, using broader search...'\n                  });\n                }\n              } else {\n                console.error('[generate-ai-code-stream] Failed to get search plan');\n              }\n            } catch (error) {\n              console.error('[generate-ai-code-stream] Error in agentic search workflow:', error);\n              await sendProgress({ \n                type: 'status', \n                message: '⚠️ Search workflow error, falling back to keyword method...'\n              });\n              // Fall back to old method on any error if we have a manifest\n              if (manifest) {\n                editContext = selectFilesForEdit(prompt, manifest);\n              }\n            }\n          } else {\n            // Fall back to old method if AI analysis fails\n            console.warn('[generate-ai-code-stream] AI intent analysis failed, falling back to keyword method');\n            if (manifest) {\n              editContext = selectFilesForEdit(prompt, manifest);\n            } else {\n              console.log('[generate-ai-code-stream] No manifest available for fallback');\n              await sendProgress({ \n                type: 'status', \n                message: '⚠️ No file manifest available, will use broad context'\n              });\n            }\n          }\n          \n          // If we got an edit context from any method, use its system prompt\n          if (editContext) {\n            enhancedSystemPrompt = editContext.systemPrompt;\n            \n            await sendProgress({ \n              type: 'status', \n              message: `Identified edit type: ${editContext.editIntent?.description || 'Code modification'}`\n            });\n          } else if (!manifest) {\n            console.log('[generate-ai-code-stream] WARNING: No manifest available for edit mode!');\n            \n            // Try to fetch files from sandbox if we have one\n            if (global.activeSandbox) {\n              await sendProgress({ type: 'status', message: 'Fetching current files from sandbox...' });\n              \n              try {\n                // Fetch files directly from sandbox\n                const filesResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/get-sandbox-files`, {\n                  method: 'GET',\n                  headers: { 'Content-Type': 'application/json' }\n                });\n                \n                if (filesResponse.ok) {\n                  const filesData = await filesResponse.json();\n                  \n                  if (filesData.success && filesData.manifest) {\n                    console.log('[generate-ai-code-stream] Successfully fetched manifest from sandbox');\n                    const manifest = filesData.manifest;\n                    \n                    // Now try to analyze edit intent with the fetched manifest\n                    try {\n                      const intentResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/analyze-edit-intent`, {\n                        method: 'POST',\n                        headers: { 'Content-Type': 'application/json' },\n                        body: JSON.stringify({ prompt, manifest, model })\n                      });\n                      \n                      if (intentResponse.ok) {\n                        const { searchPlan } = await intentResponse.json();\n                        console.log('[generate-ai-code-stream] Search plan received (after fetch):', searchPlan);\n                        \n                        // For now, fall back to keyword search since we don't have file contents for search execution\n                        // This path happens when no manifest was initially available\n                        let targetFiles: any[] = [];\n                        if (!searchPlan || searchPlan.searchTerms.length === 0) {\n                          console.warn('[generate-ai-code-stream] No target files after fetch, searching for relevant files');\n                          \n                          const promptLower = prompt.toLowerCase();\n                          const allFilePaths = Object.keys(manifest.files);\n                          \n                          // Look for component names mentioned in the prompt\n                          if (promptLower.includes('hero')) {\n                            targetFiles = allFilePaths.filter(p => p.toLowerCase().includes('hero'));\n                          } else if (promptLower.includes('header')) {\n                            targetFiles = allFilePaths.filter(p => p.toLowerCase().includes('header'));\n                          } else if (promptLower.includes('footer')) {\n                            targetFiles = allFilePaths.filter(p => p.toLowerCase().includes('footer'));\n                          } else if (promptLower.includes('nav')) {\n                            targetFiles = allFilePaths.filter(p => p.toLowerCase().includes('nav'));\n                          } else if (promptLower.includes('button')) {\n                            targetFiles = allFilePaths.filter(p => p.toLowerCase().includes('button'));\n                          }\n                          \n                          if (targetFiles.length > 0) {\n                            console.log('[generate-ai-code-stream] Found target files by keyword search after fetch:', targetFiles);\n                          }\n                        }\n                        \n                        const allFiles = Object.keys(manifest.files)\n                          .filter(path => !targetFiles.includes(path));\n                        \n                        editContext = {\n                          primaryFiles: targetFiles,\n                          contextFiles: allFiles,\n                          systemPrompt: `\nYou are an expert senior software engineer performing a surgical, context-aware code modification. Your primary directive is **precision and preservation**.\n\nThink of yourself as a surgeon making a precise incision, not a construction worker demolishing a wall.\n\n## Search-Based Edit\nSearch Terms: ${searchPlan?.searchTerms?.join(', ') || 'keyword-based'}\nEdit Type: ${searchPlan?.editType || 'UPDATE_COMPONENT'}\nReasoning: ${searchPlan?.reasoning || 'Modifying based on user request'}\n\nFiles to Edit: ${targetFiles.join(', ') || 'To be determined'}\nUser Request: \"${prompt}\"\n\n## Your Mandatory Thought Process (Execute Internally):\nBefore writing ANY code, you MUST follow these steps:\n\n1. **Understand Intent:**\n   - What is the user's core goal? (adding feature, fixing bug, changing style?)\n   - Does the conversation history provide extra clues?\n\n2. **Locate the Code:**\n   - First examine the Primary Files provided\n   - Check the \"ALL PROJECT FILES\" list to find the EXACT file name\n   - \"nav\" might be Navigation.tsx, NavBar.tsx, Nav.tsx, or Header.tsx\n   - DO NOT create a new file if a similar one exists!\n\n3. **Plan the Changes (Mental Diff):**\n   - What is the *minimal* set of changes required?\n   - Which exact lines need to be added, modified, or deleted?\n   - Will this require new packages?\n\n4. **Verify Preservation:**\n   - What existing code, props, state, and logic must NOT be touched?\n   - How can I make my change without disrupting surrounding code?\n\n5. **Construct the Final Code:**\n   - Only after completing steps above, generate the final code\n   - Provide the ENTIRE file content with modifications integrated\n\n## Critical Rules & Constraints:\n\n**PRESERVATION IS KEY:** You MUST NOT rewrite entire components or files. Integrate your changes into the existing code. Preserve all existing logic, props, state, and comments not directly related to the user's request.\n\n**MINIMALISM:** Only output files you have actually changed. If a file doesn't need modification, don't include it.\n\n**COMPLETENESS:** Each file must be COMPLETE from first line to last:\n- NEVER TRUNCATE - Include EVERY line\n- NO ellipsis (...) to skip content\n- ALL imports, functions, JSX, and closing tags must be present\n- The file MUST be runnable\n\n**SURGICAL PRECISION:**\n- Change ONLY what's explicitly requested\n- If user says \"change background to green\", change ONLY the background class\n- 99% of the original code should remain untouched\n- NO refactoring, reformatting, or \"improvements\" unless requested\n\n**NO CONVERSATION:** Your output must contain ONLY the code. No explanations or apologies.\n\n## EXAMPLES:\n\n### CORRECT APPROACH for \"change hero background to blue\":\n<thinking>\nI need to change the background color of the Hero component. Looking at the file, I see the main div has 'bg-gray-900'. I will change ONLY this to 'bg-blue-500' and leave everything else exactly as is.\n</thinking>\n\nThen return the EXACT same file with only 'bg-gray-900' changed to 'bg-blue-500'.\n\n### WRONG APPROACH (DO NOT DO THIS):\n- Rewriting the Hero component from scratch\n- Changing the structure or reorganizing imports\n- Adding or removing unrelated code\n- Reformatting or \"cleaning up\" the code\n\nRemember: You are a SURGEON making a precise incision, not an artist repainting the canvas!`,\n                          editIntent: {\n                            type: searchPlan?.editType || 'UPDATE_COMPONENT',\n                            targetFiles: targetFiles,\n                            confidence: searchPlan ? 0.85 : 0.6,\n                            description: searchPlan?.reasoning || 'Keyword-based file selection',\n                            suggestedContext: []\n                          }\n                        };\n                        \n                        enhancedSystemPrompt = editContext.systemPrompt;\n                        \n                        await sendProgress({ \n                          type: 'status', \n                          message: `Identified edit type: ${editContext.editIntent.description}`\n                        });\n                      }\n                    } catch (error) {\n                      console.error('[generate-ai-code-stream] Error analyzing intent after fetch:', error);\n                    }\n                  } else {\n                    console.error('[generate-ai-code-stream] Failed to get manifest from sandbox files');\n                  }\n                } else {\n                  console.error('[generate-ai-code-stream] Failed to fetch sandbox files:', filesResponse.status);\n                }\n              } catch (error) {\n                console.error('[generate-ai-code-stream] Error fetching sandbox files:', error);\n                await sendProgress({ \n                  type: 'warning', \n                  message: 'Could not analyze existing files for targeted edits. Proceeding with general edit mode.'\n                });\n              }\n            } else {\n              console.log('[generate-ai-code-stream] No active sandbox to fetch files from');\n              await sendProgress({ \n                type: 'warning', \n                message: 'No existing files found. Consider generating initial code first.'\n              });\n            }\n          }\n        }\n        \n        // Build conversation context for system prompt\n        let conversationContext = '';\n        if (global.conversationState && global.conversationState.context.messages.length > 1) {\n          console.log('[generate-ai-code-stream] Building conversation context');\n          console.log('[generate-ai-code-stream] Total messages:', global.conversationState.context.messages.length);\n          console.log('[generate-ai-code-stream] Total edits:', global.conversationState.context.edits.length);\n          \n          conversationContext = `\\n\\n## Conversation History (Recent)\\n`;\n          \n          // Include only the last 3 edits to save context\n          const recentEdits = global.conversationState.context.edits.slice(-3);\n          if (recentEdits.length > 0) {\n            console.log('[generate-ai-code-stream] Including', recentEdits.length, 'recent edits in context');\n            conversationContext += `\\n### Recent Edits:\\n`;\n            recentEdits.forEach(edit => {\n              conversationContext += `- \"${edit.userRequest}\" → ${edit.editType} (${edit.targetFiles.map(f => f.split('/').pop()).join(', ')})\\n`;\n            });\n          }\n          \n          // Include recently created files - CRITICAL for preventing duplicates\n          const recentMsgs = global.conversationState.context.messages.slice(-5);\n          const recentlyCreatedFiles: string[] = [];\n          recentMsgs.forEach(msg => {\n            if (msg.metadata?.editedFiles) {\n              recentlyCreatedFiles.push(...msg.metadata.editedFiles);\n            }\n          });\n          \n          if (recentlyCreatedFiles.length > 0) {\n            const uniqueFiles = [...new Set(recentlyCreatedFiles)];\n            conversationContext += `\\n### 🚨 RECENTLY CREATED/EDITED FILES (DO NOT RECREATE THESE):\\n`;\n            uniqueFiles.forEach(file => {\n              conversationContext += `- ${file}\\n`;\n            });\n            conversationContext += `\\nIf the user mentions any of these components, UPDATE the existing file!\\n`;\n          }\n          \n          // Include only last 5 messages for context (reduced from 10)\n          const recentMessages = recentMsgs;\n          if (recentMessages.length > 2) { // More than just current message\n            conversationContext += `\\n### Recent Messages:\\n`;\n            recentMessages.slice(0, -1).forEach(msg => { // Exclude current message\n              if (msg.role === 'user') {\n                const truncatedContent = msg.content.length > 100 ? msg.content.substring(0, 100) + '...' : msg.content;\n                conversationContext += `- \"${truncatedContent}\"\\n`;\n              }\n            });\n          }\n          \n          // Include only last 2 major changes\n          const majorChanges = global.conversationState.context.projectEvolution.majorChanges.slice(-2);\n          if (majorChanges.length > 0) {\n            conversationContext += `\\n### Recent Changes:\\n`;\n            majorChanges.forEach(change => {\n              conversationContext += `- ${change.description}\\n`;\n            });\n          }\n          \n          // Keep user preferences - they're concise\n          const userPrefs = analyzeUserPreferences(global.conversationState.context.messages);\n          if (userPrefs.commonPatterns.length > 0) {\n            conversationContext += `\\n### User Preferences:\\n`;\n            conversationContext += `- Edit style: ${userPrefs.preferredEditStyle}\\n`;\n          }\n          \n          // Limit total conversation context length\n          if (conversationContext.length > 2000) {\n            conversationContext = conversationContext.substring(0, 2000) + '\\n[Context truncated to prevent length errors]';\n          }\n        }\n        \n        // Build system prompt with conversation awareness\n        let systemPrompt = `You are an expert React developer with perfect memory of the conversation. You maintain context across messages and remember scraped websites, generated components, and applied code. Generate clean, modern React code for Vite applications.\n${conversationContext}\n\n🚨 CRITICAL RULES - YOUR MOST IMPORTANT INSTRUCTIONS:\n1. **DO EXACTLY WHAT IS ASKED - NOTHING MORE, NOTHING LESS**\n   - Don't add features not requested\n   - Don't fix unrelated issues\n   - Don't improve things not mentioned\n2. **CHECK App.jsx FIRST** - ALWAYS see what components exist before creating new ones\n3. **NAVIGATION LIVES IN Header.jsx** - Don't create Nav.jsx if Header exists with nav\n4. **USE STANDARD TAILWIND CLASSES ONLY**:\n   - ✅ CORRECT: bg-white, text-black, bg-blue-500, bg-gray-100, text-gray-900\n   - ❌ WRONG: bg-background, text-foreground, bg-primary, bg-muted, text-secondary\n   - Use ONLY classes from the official Tailwind CSS documentation\n5. **FILE COUNT LIMITS**:\n   - Simple style/text change = 1 file ONLY\n   - New component = 2 files MAX (component + parent)\n   - If >3 files, YOU'RE DOING TOO MUCH\n6. **DO NOT CREATE SVGs FROM SCRATCH**:\n   - NEVER generate custom SVG code unless explicitly asked\n   - Use existing icon libraries (lucide-react, heroicons, etc.)\n   - Or use placeholder elements/text if icons are not critical\n   - Only create custom SVGs when user specifically requests \"create an SVG\" or \"draw an SVG\"\n\nCOMPONENT RELATIONSHIPS (CHECK THESE FIRST):\n- Navigation usually lives INSIDE Header.jsx, not separate Nav.jsx\n- Logo is typically in Header, not standalone\n- Footer often contains nav links already\n- Menu/Hamburger is part of Header, not separate\n\nPACKAGE USAGE RULES:\n- DO NOT use react-router-dom unless user explicitly asks for routing\n- For simple nav links in a single-page app, use scroll-to-section or href=\"#\"\n- Only add routing if building a multi-page application\n- Common packages are auto-installed from your imports\n\nWEBSITE CLONING REQUIREMENTS:\nWhen recreating/cloning a website, you MUST include:\n1. **Header with Navigation** - Usually Header.jsx containing nav\n2. **Hero Section** - The main landing area (Hero.jsx)\n3. **Main Content Sections** - Features, Services, About, etc.\n4. **Footer** - Contact info, links, copyright (Footer.jsx)\n5. **App.jsx** - Main app component that imports and uses all components\n\n${isEdit ? `CRITICAL: THIS IS AN EDIT TO AN EXISTING APPLICATION\n\nYOU MUST FOLLOW THESE EDIT RULES:\n0. NEVER create tailwind.config.js, vite.config.js, package.json, or any other config files - they already exist!\n1. DO NOT regenerate the entire application\n2. DO NOT create files that already exist (like App.jsx, index.css, tailwind.config.js)\n3. ONLY edit the EXACT files needed for the requested change - NO MORE, NO LESS\n4. If the user says \"update the header\", ONLY edit the Header component - DO NOT touch Footer, Hero, or any other components\n5. If the user says \"change the color\", ONLY edit the relevant style or component file - DO NOT \"improve\" other parts\n6. If you're unsure which file to edit, choose the SINGLE most specific one related to the request\n7. IMPORTANT: When adding new components or libraries:\n   - Create the new component file\n   - UPDATE ONLY the parent component that will use it\n   - Example: Adding a Newsletter component means:\n     * Create Newsletter.jsx\n     * Update ONLY the file that will use it (e.g., Footer.jsx OR App.jsx) - NOT both\n8. When adding npm packages:\n   - Import them ONLY in the files where they're actually used\n   - The system will auto-install missing packages\n\nCRITICAL FILE MODIFICATION RULES - VIOLATION = FAILURE:\n- **NEVER TRUNCATE FILES** - Always return COMPLETE files with ALL content\n- **NO ELLIPSIS (...)** - Include every single line of code, no skipping\n- Files MUST be complete and runnable - include ALL imports, functions, JSX, and closing tags\n- Count the files you're about to generate\n- If the user asked to change ONE thing, you should generate ONE file (or at most two if adding a new component)\n- DO NOT \"fix\" or \"improve\" files that weren't mentioned in the request\n- DO NOT update multiple components when only one was requested\n- DO NOT add features the user didn't ask for\n- RESIST the urge to be \"helpful\" by updating related files\n\nCRITICAL: DO NOT REDESIGN OR REIMAGINE COMPONENTS\n- \"update\" means make a small change, NOT redesign the entire component\n- \"change X to Y\" means ONLY change X to Y, nothing else\n- \"fix\" means repair what's broken, NOT rewrite everything\n- \"remove X\" means delete X from the existing file, NOT create a new file\n- \"delete X\" means remove X from where it currently exists\n- Preserve ALL existing functionality and design unless explicitly asked to change it\n\nNEVER CREATE NEW FILES WHEN THE USER ASKS TO REMOVE/DELETE SOMETHING\nIf the user says \"remove X\", you must:\n1. Find which existing file contains X\n2. Edit that file to remove X\n3. DO NOT create any new files\n\n${editContext ? `\nTARGETED EDIT MODE ACTIVE\n- Edit Type: ${editContext.editIntent.type}\n- Confidence: ${editContext.editIntent.confidence}\n- Files to Edit: ${editContext.primaryFiles.join(', ')}\n\n🚨 CRITICAL RULE - VIOLATION WILL RESULT IN FAILURE 🚨\nYOU MUST ***ONLY*** GENERATE THE FILES LISTED ABOVE!\n\nABSOLUTE REQUIREMENTS:\n1. COUNT the files in \"Files to Edit\" - that's EXACTLY how many files you must generate\n2. If \"Files to Edit\" shows ONE file, generate ONLY that ONE file\n3. DO NOT generate App.jsx unless it's EXPLICITLY listed in \"Files to Edit\"\n4. DO NOT generate ANY components that aren't listed in \"Files to Edit\"\n5. DO NOT \"helpfully\" update related files\n6. DO NOT fix unrelated issues you notice\n7. DO NOT improve code quality in files not being edited\n8. DO NOT add bonus features\n\nEXAMPLE VIOLATIONS (THESE ARE FAILURES):\n❌ User says \"update the hero\" → You update Hero, Header, Footer, and App.jsx\n❌ User says \"change header color\" → You redesign the entire header\n❌ User says \"fix the button\" → You update multiple components\n❌ Files to Edit shows \"Hero.jsx\" → You also generate App.jsx \"to integrate it\"\n❌ Files to Edit shows \"Header.jsx\" → You also update Footer.jsx \"for consistency\"\n\nCORRECT BEHAVIOR (THIS IS SUCCESS):\n✅ User says \"update the hero\" → You ONLY edit Hero.jsx with the requested change\n✅ User says \"change header color\" → You ONLY change the color in Header.jsx\n✅ User says \"fix the button\" → You ONLY fix the specific button issue\n✅ Files to Edit shows \"Hero.jsx\" → You generate ONLY Hero.jsx\n✅ Files to Edit shows \"Header.jsx, Nav.jsx\" → You generate EXACTLY 2 files: Header.jsx and Nav.jsx\n\nTHE AI INTENT ANALYZER HAS ALREADY DETERMINED THE FILES.\nDO NOT SECOND-GUESS IT.\nDO NOT ADD MORE FILES.\nONLY OUTPUT THE EXACT FILES LISTED IN \"Files to Edit\".\n` : ''}\n\nVIOLATION OF THESE RULES WILL RESULT IN FAILURE!\n` : ''}\n\nCRITICAL INCREMENTAL UPDATE RULES:\n- When the user asks for additions or modifications (like \"add a videos page\", \"create a new component\", \"update the header\"):\n  - DO NOT regenerate the entire application\n  - DO NOT recreate files that already exist unless explicitly asked\n  - ONLY create/modify the specific files needed for the requested change\n  - Preserve all existing functionality and files\n  - If adding a new page/route, integrate it with the existing routing system\n  - Reference existing components and styles rather than duplicating them\n  - NEVER recreate config files (tailwind.config.js, vite.config.js, package.json, etc.)\n\nIMPORTANT: When the user asks for edits or modifications:\n- You have access to the current file contents in the context\n- Make targeted changes to existing files rather than regenerating everything\n- Preserve the existing structure and only modify what's requested\n- If you need to see a specific file that's not in context, mention it\n\nIMPORTANT: You have access to the full conversation context including:\n- Previously scraped websites and their content\n- Components already generated and applied\n- The current project being worked on\n- Recent conversation history\n- Any Vite errors that need to be resolved\n\nWhen the user references \"the app\", \"the website\", or \"the site\" without specifics, refer to:\n1. The most recently scraped website in the context\n2. The current project name in the context\n3. The files currently in the sandbox\n\nIf you see scraped websites in the context, you're working on a clone/recreation of that site.\n\nCRITICAL UI/UX RULES:\n- NEVER use emojis in any code, text, console logs, or UI elements\n- ALWAYS ensure responsive design using proper Tailwind classes (sm:, md:, lg:, xl:)\n- ALWAYS use proper mobile-first responsive design patterns\n- NEVER hardcode pixel widths - use relative units and responsive classes\n- ALWAYS test that the layout works on mobile devices (320px and up)\n- ALWAYS make sections full-width by default - avoid max-w-7xl or similar constraints\n- For full-width layouts: use className=\"w-full\" or no width constraint at all\n- Only add max-width constraints when explicitly needed for readability (like blog posts)\n- Prefer system fonts and clean typography\n- Ensure all interactive elements have proper hover/focus states\n- Use proper semantic HTML elements for accessibility\n\nCRITICAL STYLING RULES - MUST FOLLOW:\n- NEVER use inline styles with style={{ }} in JSX\n- NEVER use <style jsx> tags or any CSS-in-JS solutions\n- NEVER create App.css, Component.css, or any component-specific CSS files\n- NEVER import './App.css' or any CSS files except index.css\n- ALWAYS use Tailwind CSS classes for ALL styling\n- ONLY create src/index.css with the @tailwind directives\n- The ONLY CSS file should be src/index.css with:\n  @tailwind base;\n  @tailwind components;\n  @tailwind utilities;\n- Use Tailwind's full utility set: spacing, colors, typography, flexbox, grid, animations, etc.\n- ALWAYS add smooth transitions and animations where appropriate:\n  - Use transition-all, transition-colors, transition-opacity for hover states\n  - Use animate-fade-in, animate-pulse, animate-bounce for engaging UI elements\n  - Add hover:scale-105 or hover:scale-110 for interactive elements\n  - Use transform and transition utilities for smooth interactions\n- For complex layouts, combine Tailwind utilities rather than writing custom CSS\n- NEVER use non-standard Tailwind classes like \"border-border\", \"bg-background\", \"text-foreground\", etc.\n- Use standard Tailwind classes only:\n  - For borders: use \"border-gray-200\", \"border-gray-300\", etc. NOT \"border-border\"\n  - For backgrounds: use \"bg-white\", \"bg-gray-100\", etc. NOT \"bg-background\"\n  - For text: use \"text-gray-900\", \"text-black\", etc. NOT \"text-foreground\"\n- Examples of good Tailwind usage:\n  - Buttons: className=\"px-4 py-2 bg-blue-600 text-white rounded-lg shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:scale-105 transition-all duration-200\"\n  - Cards: className=\"bg-white rounded-lg shadow-md p-6 border border-gray-200 hover:shadow-xl transition-shadow duration-300\"\n  - Full-width sections: className=\"w-full px-4 sm:px-6 lg:px-8\"\n  - Constrained content (only when needed): className=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\"\n  - Dark backgrounds: className=\"min-h-screen bg-gray-900 text-white\"\n  - Hero sections: className=\"animate-fade-in-up\"\n  - Feature cards: className=\"transform hover:scale-105 transition-transform duration-300\"\n  - CTAs: className=\"animate-pulse hover:animate-none\"\n\nCRITICAL STRING AND SYNTAX RULES:\n- ALWAYS escape apostrophes in strings: use \\' instead of ' or use double quotes\n- ALWAYS escape quotes properly in JSX attributes\n- NEVER use curly quotes or smart quotes ('' \"\" '' \"\") - only straight quotes (' \")\n- ALWAYS convert smart/curly quotes to straight quotes:\n  - ' and ' → '\n  - \" and \" → \"\n  - Any other Unicode quotes → straight quotes\n- When strings contain apostrophes, either:\n  1. Use double quotes: \"you're\" instead of 'you're'\n  2. Escape the apostrophe: 'you\\'re'\n- When working with scraped content, ALWAYS sanitize quotes first\n- Replace all smart quotes with straight quotes before using in code\n- Be extra careful with user-generated content or scraped text\n- Always validate that JSX syntax is correct before generating\n\nCRITICAL CODE SNIPPET DISPLAY RULES:\n- When displaying code examples in JSX, NEVER put raw curly braces { } in text\n- ALWAYS wrap code snippets in template literals with backticks\n- For code examples in components, use one of these patterns:\n  1. Template literals: <div>{\\`const example = { key: 'value' }\\`}</div>\n  2. Pre/code blocks: <pre><code>{\\`your code here\\`}</code></pre>\n  3. Escape braces: <div>{'{'}key: value{'}'}</div>\n- NEVER do this: <div>const example = { key: 'value' }</div> (causes parse errors)\n- For multi-line code snippets, always use:\n  <pre className=\"bg-gray-900 text-gray-100 p-4 rounded\">\n    <code>{\\`\n      // Your code here\n      const example = {\n        key: 'value'\n      }\n    \\`}</code>\n  </pre>\n\nCRITICAL: When asked to create a React app or components:\n- ALWAYS CREATE ALL FILES IN FULL - never provide partial implementations\n- ALWAYS CREATE EVERY COMPONENT that you import - no placeholders\n- ALWAYS IMPLEMENT COMPLETE FUNCTIONALITY - don't leave TODOs unless explicitly asked\n- If you're recreating a website, implement ALL sections and features completely\n- NEVER create tailwind.config.js - it's already configured in the template\n- ALWAYS include a Navigation/Header component (Nav.jsx or Header.jsx) - websites need navigation!\n\nREQUIRED COMPONENTS for website clones:\n1. Nav.jsx or Header.jsx - Navigation bar with links (NEVER SKIP THIS!)\n2. Hero.jsx - Main landing section\n3. Features/Services/Products sections - Based on the site content\n4. Footer.jsx - Footer with links and info\n5. App.jsx - Main component that imports and arranges all components\n- NEVER create vite.config.js - it's already configured in the template\n- NEVER create package.json - it's already configured in the template\n\nWHEN WORKING WITH SCRAPED CONTENT:\n- ALWAYS sanitize all text content before using in code\n- Convert ALL smart quotes to straight quotes\n- Example transformations:\n  - \"Firecrawl's API\" → \"Firecrawl's API\" or \"Firecrawl\\\\'s API\"\n  - 'It's amazing' → \"It's amazing\" or 'It\\\\'s amazing'\n  - \"Best tool ever\" → \"Best tool ever\"\n- When in doubt, use double quotes for strings containing apostrophes\n- For testimonials or quotes from scraped content, ALWAYS clean the text:\n  - Bad: content: 'Moved our internal agent's web scraping...'\n  - Good: content: \"Moved our internal agent's web scraping...\"\n  - Also good: content: 'Moved our internal agent\\\\'s web scraping...'\n\nWhen generating code, FOLLOW THIS PROCESS:\n1. ALWAYS generate src/index.css FIRST - this establishes the styling foundation\n2. List ALL components you plan to import in App.jsx\n3. Count them - if there are 10 imports, you MUST create 10 component files\n4. Generate src/index.css first (with proper CSS reset and base styles)\n5. Generate App.jsx second\n6. Then generate EVERY SINGLE component file you imported\n7. Do NOT stop until all imports are satisfied\n\nUse this XML format for React components only (DO NOT create tailwind.config.js - it already exists):\n\n<file path=\"src/index.css\">\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n</file>\n\n<file path=\"src/App.jsx\">\n// Main App component that imports and uses other components\n// Use Tailwind classes: className=\"min-h-screen bg-gray-50\"\n</file>\n\n<file path=\"src/components/Example.jsx\">\n// Your React component code here\n// Use Tailwind classes for ALL styling\n</file>\n\nCRITICAL COMPLETION RULES:\n1. NEVER say \"I'll continue with the remaining components\"\n2. NEVER say \"Would you like me to proceed?\"\n3. NEVER use <continue> tags\n4. Generate ALL components in ONE response\n5. If App.jsx imports 10 components, generate ALL 10\n6. Complete EVERYTHING before ending your response\n\nWith 16,000 tokens available, you have plenty of space to generate a complete application. Use it!\n\nUNDERSTANDING USER INTENT FOR INCREMENTAL VS FULL GENERATION:\n- \"add/create/make a [specific feature]\" → Add ONLY that feature to existing app\n- \"add a videos page\" → Create ONLY Videos.jsx and update routing\n- \"update the header\" → Modify ONLY header component\n- \"fix the styling\" → Update ONLY the affected components\n- \"change X to Y\" → Find the file containing X and modify it\n- \"make the header black\" → Find Header component and change its color\n- \"rebuild/recreate/start over\" → Full regeneration\n- Default to incremental updates when working on an existing app\n\nSURGICAL EDIT RULES (CRITICAL FOR PERFORMANCE):\n- **PREFER TARGETED CHANGES**: Don't regenerate entire components for small edits\n- For color/style changes: Edit ONLY the specific className or style prop\n- For text changes: Change ONLY the text content, keep everything else\n- For adding elements: INSERT into existing JSX, don't rewrite the whole return\n- **PRESERVE EXISTING CODE**: Keep all imports, functions, and unrelated code exactly as-is\n- Maximum files to edit:\n  - Style change = 1 file ONLY\n  - Text change = 1 file ONLY\n  - New feature = 2 files MAX (feature + parent)\n- If you're editing >3 files for a simple request, STOP - you're doing too much\n\nEXAMPLES OF CORRECT SURGICAL EDITS:\n✅ \"change header to black\" → Find className=\"...\" in Header.jsx, change ONLY color classes\n✅ \"update hero text\" → Find the <h1> or <p> in Hero.jsx, change ONLY the text inside\n✅ \"add a button to hero\" → Find the return statement, ADD button, keep everything else\n❌ WRONG: Regenerating entire Header.jsx to change one color\n❌ WRONG: Rewriting Hero.jsx to add one button\n\nNAVIGATION/HEADER INTELLIGENCE:\n- ALWAYS check App.jsx imports first\n- Navigation is usually INSIDE Header.jsx, not separate\n- If user says \"nav\", check Header.jsx FIRST\n- Only create Nav.jsx if no navigation exists anywhere\n- Logo, menu, hamburger = all typically in Header\n\nCRITICAL: When files are provided in the context:\n1. The user is asking you to MODIFY the existing app, not create a new one\n2. Find the relevant file(s) from the provided context\n3. Generate ONLY the files that need changes\n4. Do NOT ask to see files - they are already provided in the context above\n5. Make the requested change immediately`;\n\n        // If Morph Fast Apply is enabled (edit mode + MORPH_API_KEY), force <edit> block output\n        const morphFastApplyEnabled = Boolean(isEdit && process.env.MORPH_API_KEY);\n        if (morphFastApplyEnabled) {\n          systemPrompt += `\n\nMORPH FAST APPLY MODE (EDIT-ONLY):\n- Output edits as <edit> blocks, not full <file> blocks, for files that already exist.\n- Format for each edit:\n  <edit target_file=\"src/components/Header.jsx\">\n    <instructions>Describe the minimal change, single sentence.</instructions>\n    <update>Provide the SMALLEST code snippet necessary to perform the change.</update>\n  </edit>\n- Only use <file> blocks when you must CREATE a brand-new file.\n- Prefer ONE edit block for a simple change; multiple edits only if absolutely needed for separate files.\n- Keep updates minimal and precise; do not rewrite entire files.\n`;\n        }\n\n        // Build full prompt with context\n        let fullPrompt = prompt;\n        if (context) {\n          const contextParts = [];\n          \n          if (context.sandboxId) {\n            contextParts.push(`Current sandbox ID: ${context.sandboxId}`);\n          }\n          \n          if (context.structure) {\n            contextParts.push(`Current file structure:\\n${context.structure}`);\n          }\n          \n          // Use backend file cache instead of frontend-provided files\n          let backendFiles = global.sandboxState?.fileCache?.files || {};\n          let hasBackendFiles = Object.keys(backendFiles).length > 0;\n          \n          console.log('[generate-ai-code-stream] Backend file cache status:');\n          console.log('[generate-ai-code-stream] - Has sandboxState:', !!global.sandboxState);\n          console.log('[generate-ai-code-stream] - Has fileCache:', !!global.sandboxState?.fileCache);\n          console.log('[generate-ai-code-stream] - File count:', Object.keys(backendFiles).length);\n          console.log('[generate-ai-code-stream] - Has manifest:', !!global.sandboxState?.fileCache?.manifest);\n          \n          // If no backend files and we're in edit mode, try to fetch from sandbox\n          if (!hasBackendFiles && isEdit && (global.activeSandbox || context?.sandboxId)) {\n            console.log('[generate-ai-code-stream] No backend files, attempting to fetch from sandbox...');\n            \n            try {\n              const filesResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/get-sandbox-files`, {\n                method: 'GET',\n                headers: { 'Content-Type': 'application/json' }\n              });\n              \n              if (filesResponse.ok) {\n                const filesData = await filesResponse.json();\n                if (filesData.success && filesData.files) {\n                  console.log('[generate-ai-code-stream] Successfully fetched', Object.keys(filesData.files).length, 'files from sandbox');\n                  \n                  // Initialize sandboxState if needed\n                  if (!global.sandboxState) {\n                    global.sandboxState = {\n                      fileCache: {\n                        files: {},\n                        lastSync: Date.now(),\n                        sandboxId: context?.sandboxId || 'unknown'\n                      }\n                    } as any;\n                  } else if (!global.sandboxState.fileCache) {\n                    global.sandboxState.fileCache = {\n                      files: {},\n                      lastSync: Date.now(),\n                      sandboxId: context?.sandboxId || 'unknown'\n                    };\n                  }\n                  \n                  // Store files in cache\n                  for (const [path, content] of Object.entries(filesData.files)) {\n                    const normalizedPath = path.replace('/home/user/app/', '');\n                    if (global.sandboxState.fileCache) {\n                      global.sandboxState.fileCache.files[normalizedPath] = {\n                        content: content as string,\n                        lastModified: Date.now()\n                      };\n                    }\n                  }\n                  \n                  if (filesData.manifest && global.sandboxState.fileCache) {\n                    global.sandboxState.fileCache.manifest = filesData.manifest;\n                    \n                    // Now try to analyze edit intent with the fetched manifest\n                    if (!editContext) {\n                      console.log('[generate-ai-code-stream] Analyzing edit intent with fetched manifest');\n                      try {\n                        const intentResponse = await fetch(`${process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3000'}/api/analyze-edit-intent`, {\n                          method: 'POST',\n                          headers: { 'Content-Type': 'application/json' },\n                          body: JSON.stringify({ prompt, manifest: filesData.manifest, model })\n                        });\n                        \n                        if (intentResponse.ok) {\n                          const { searchPlan } = await intentResponse.json();\n                          console.log('[generate-ai-code-stream] Search plan received:', searchPlan);\n                          \n                          // Create edit context from AI analysis\n                          // Note: We can't execute search here without file contents, so fall back to keyword method\n                          const fileContext = selectFilesForEdit(prompt, filesData.manifest);\n                          editContext = fileContext;\n                          enhancedSystemPrompt = fileContext.systemPrompt;\n                          \n                          console.log('[generate-ai-code-stream] Edit context created with', editContext.primaryFiles.length, 'primary files');\n                        }\n                      } catch (error) {\n                        console.error('[generate-ai-code-stream] Failed to analyze edit intent:', error);\n                      }\n                    }\n                  }\n                  \n                  // Update variables\n                  backendFiles = global.sandboxState.fileCache?.files || {};\n                  hasBackendFiles = Object.keys(backendFiles).length > 0;\n                  console.log('[generate-ai-code-stream] Updated backend cache with fetched files');\n                }\n              }\n            } catch (error) {\n              console.error('[generate-ai-code-stream] Failed to fetch sandbox files:', error);\n            }\n          }\n          \n          // Include current file contents from backend cache\n          if (hasBackendFiles) {\n            // If we have edit context, use intelligent file selection\n            if (editContext && editContext.primaryFiles.length > 0) {\n              contextParts.push('\\nEXISTING APPLICATION - TARGETED EDIT MODE');\n              contextParts.push(`\\n${editContext.systemPrompt || enhancedSystemPrompt}\\n`);\n              \n              // Get contents of primary and context files\n              const primaryFileContents = await getFileContents(editContext.primaryFiles, global.sandboxState!.fileCache!.manifest!);\n              const contextFileContents = await getFileContents(editContext.contextFiles, global.sandboxState!.fileCache!.manifest!);\n              \n              // Format files for AI\n              const formattedFiles = formatFilesForAI(primaryFileContents, contextFileContents);\n              contextParts.push(formattedFiles);\n              \n              contextParts.push('\\nIMPORTANT: Only modify the files listed under \"Files to Edit\". The context files are provided for reference only.');\n            } else {\n              // Fallback to showing all files if no edit context\n              console.log('[generate-ai-code-stream] WARNING: Using fallback mode - no edit context available');\n              contextParts.push('\\nEXISTING APPLICATION - TARGETED EDIT REQUIRED');\n              contextParts.push('\\nYou MUST analyze the user request and determine which specific file(s) to edit.');\n              contextParts.push('\\nCurrent project files (DO NOT regenerate all of these):');\n              \n              const fileEntries = Object.entries(backendFiles);\n              console.log(`[generate-ai-code-stream] Using backend cache: ${fileEntries.length} files`);\n              \n              // Show file list first for reference\n              contextParts.push('\\n### File List:');\n              for (const [path] of fileEntries) {\n                contextParts.push(`- ${path}`);\n              }\n              \n              // Include ALL files as context in fallback mode\n              contextParts.push('\\n### File Contents (ALL FILES FOR CONTEXT):');\n              for (const [path, fileData] of fileEntries) {\n                const content = fileData.content;\n                if (typeof content === 'string') {\n                  contextParts.push(`\\n<file path=\"${path}\">\\n${content}\\n</file>`);\n                }\n              }\n              \n              contextParts.push('\\n🚨 CRITICAL INSTRUCTIONS - VIOLATION = FAILURE 🚨');\n              contextParts.push('1. Analyze the user request: \"' + prompt + '\"');\n              contextParts.push('2. Identify the MINIMUM number of files that need editing (usually just ONE)');\n              contextParts.push('3. PRESERVE ALL EXISTING CONTENT in those files');\n              contextParts.push('4. ONLY ADD/MODIFY the specific part requested');\n              contextParts.push('5. DO NOT regenerate entire components from scratch');\n              contextParts.push('6. DO NOT change unrelated parts of any file');\n              contextParts.push('7. Generate ONLY the files that MUST be changed - NO EXTRAS');\n              contextParts.push('\\n⚠️ FILE COUNT RULE:');\n              contextParts.push('- Simple change (color, text, spacing) = 1 file ONLY');\n              contextParts.push('- Adding new component = 2 files MAX (new component + parent that imports it)');\n              contextParts.push('- DO NOT exceed these limits unless absolutely necessary');\n              contextParts.push('\\nEXAMPLES OF CORRECT BEHAVIOR:');\n              contextParts.push('✅ \"add a chart to the hero\" → Edit ONLY Hero.jsx, ADD the chart, KEEP everything else');\n              contextParts.push('✅ \"change header to black\" → Edit ONLY Header.jsx, change ONLY the color');\n              contextParts.push('✅ \"fix spacing in footer\" → Edit ONLY Footer.jsx, adjust ONLY spacing');\n              contextParts.push('\\nEXAMPLES OF FAILURES:');\n              contextParts.push('❌ \"change header color\" → You edit Header, Footer, and App \"for consistency\"');\n              contextParts.push('❌ \"add chart to hero\" → You regenerate the entire Hero component');\n              contextParts.push('❌ \"fix button\" → You update 5 different component files');\n              contextParts.push('\\n⚠️ FINAL WARNING:');\n              contextParts.push('If you generate MORE files than necessary, you have FAILED');\n              contextParts.push('If you DELETE or REWRITE existing functionality, you have FAILED');\n              contextParts.push('ONLY change what was EXPLICITLY requested - NOTHING MORE');\n            }\n          } else if (context.currentFiles && Object.keys(context.currentFiles).length > 0) {\n            // Fallback to frontend-provided files if backend cache is empty\n            console.log('[generate-ai-code-stream] Warning: Backend cache empty, using frontend files');\n            contextParts.push('\\nEXISTING APPLICATION - DO NOT REGENERATE FROM SCRATCH');\n            contextParts.push('Current project files (modify these, do not recreate):');\n            \n            const fileEntries = Object.entries(context.currentFiles);\n            for (const [path, content] of fileEntries) {\n              if (typeof content === 'string') {\n                contextParts.push(`\\n<file path=\"${path}\">\\n${content}\\n</file>`);\n              }\n            }\n            contextParts.push('\\nThe above files already exist. When the user asks to modify something (like \"change the header color to black\"), find the relevant file above and generate ONLY that file with the requested changes.');\n          }\n          \n          // Add explicit edit mode indicator\n          if (isEdit) {\n            contextParts.push('\\nEDIT MODE ACTIVE');\n            contextParts.push('This is an incremental update to an existing application.');\n            contextParts.push('DO NOT regenerate App.jsx, index.css, or other core files unless explicitly requested.');\n            contextParts.push('ONLY create or modify the specific files needed for the user\\'s request.');\n            contextParts.push('\\n⚠️ CRITICAL FILE OUTPUT FORMAT - VIOLATION = FAILURE:');\n            contextParts.push('YOU MUST OUTPUT EVERY FILE IN THIS EXACT XML FORMAT:');\n            contextParts.push('<file path=\"src/components/ComponentName.jsx\">');\n            contextParts.push('// Complete file content here');\n            contextParts.push('</file>');\n            contextParts.push('<file path=\"src/index.css\">');\n            contextParts.push('/* CSS content here */');\n            contextParts.push('</file>');\n            contextParts.push('\\n❌ NEVER OUTPUT: \"Generated Files: index.css, App.jsx\"');\n            contextParts.push('❌ NEVER LIST FILE NAMES WITHOUT CONTENT');\n            contextParts.push('✅ ALWAYS: One <file> tag per file with COMPLETE content');\n            contextParts.push('✅ ALWAYS: Include EVERY file you modified');\n          } else if (!hasBackendFiles) {\n            // First generation mode - make it beautiful!\n            contextParts.push('\\n🎨 FIRST GENERATION MODE - CREATE SOMETHING BEAUTIFUL!');\n            contextParts.push('\\nThis is the user\\'s FIRST experience. Make it impressive:');\n            contextParts.push('1. **USE TAILWIND PROPERLY** - Use standard Tailwind color classes');\n            contextParts.push('2. **NO PLACEHOLDERS** - Use real content, not lorem ipsum');\n            contextParts.push('3. **COMPLETE COMPONENTS** - Header, Hero, Features, Footer minimum');\n            contextParts.push('4. **VISUAL POLISH** - Shadows, hover states, transitions');\n            contextParts.push('5. **STANDARD CLASSES** - bg-white, text-gray-900, bg-blue-500, NOT bg-background');\n            contextParts.push('\\nCreate a polished, professional application that works perfectly on first load.');\n            contextParts.push('\\n⚠️ OUTPUT FORMAT:');\n            contextParts.push('Use <file path=\"...\">content</file> tags for EVERY file');\n            contextParts.push('NEVER output \"Generated Files:\" as plain text');\n          }\n          \n          // Add conversation context (scraped websites, etc)\n          if (context.conversationContext) {\n            if (context.conversationContext.scrapedWebsites?.length > 0) {\n              contextParts.push('\\nScraped Websites in Context:');\n              context.conversationContext.scrapedWebsites.forEach((site: any) => {\n                contextParts.push(`\\nURL: ${site.url}`);\n                contextParts.push(`Scraped: ${new Date(site.timestamp).toLocaleString()}`);\n                if (site.content) {\n                  // Include a summary of the scraped content\n                  const contentPreview = typeof site.content === 'string' \n                    ? site.content.substring(0, 1000) \n                    : JSON.stringify(site.content).substring(0, 1000);\n                  contextParts.push(`Content Preview: ${contentPreview}...`);\n                }\n              });\n            }\n            \n            if (context.conversationContext.currentProject) {\n              contextParts.push(`\\nCurrent Project: ${context.conversationContext.currentProject}`);\n            }\n          }\n          \n          if (contextParts.length > 0) {\n            if (morphFastApplyEnabled) {\n              contextParts.push('\\nOUTPUT FORMAT (REQUIRED IN MORPH MODE):');\n              contextParts.push('<edit target_file=\"src/components/Component.jsx\">');\n              contextParts.push('<instructions>Minimal, precise instruction.</instructions>');\n              contextParts.push('<update>// Smallest necessary snippet</update>');\n              contextParts.push('</edit>');\n              contextParts.push('\\nIf you need to create a NEW file, then and only then output a full file:');\n              contextParts.push('<file path=\"src/components/NewComponent.jsx\">');\n              contextParts.push('// Full file content when creating new files');\n              contextParts.push('</file>');\n            }\n            fullPrompt = `CONTEXT:\\n${contextParts.join('\\n')}\\n\\nUSER REQUEST:\\n${prompt}`;\n          }\n        }\n        \n        await sendProgress({ type: 'status', message: 'Planning application structure...' });\n        \n        console.log('\\n[generate-ai-code-stream] Starting streaming response...\\n');\n        \n        // Track packages that need to be installed\n        const packagesToInstall: string[] = [];\n        \n        // Determine which provider to use based on model\n        const isAnthropic = model.startsWith('anthropic/');\n        const isGoogle = model.startsWith('google/');\n        const isOpenAI = model.startsWith('openai/');\n        const isKimiGroq = model === 'moonshotai/kimi-k2-instruct-0905';\n        const modelProvider = isAnthropic ? anthropic : \n                              (isOpenAI ? openai : \n                              (isGoogle ? googleGenerativeAI : \n                              (isKimiGroq ? groq : groq)));\n        \n        // Fix model name transformation for different providers\n        let actualModel: string;\n        if (isAnthropic) {\n          actualModel = model.replace('anthropic/', '');\n        } else if (isOpenAI) {\n          actualModel = model.replace('openai/', '');\n        } else if (isKimiGroq) {\n          // Kimi on Groq - use full model string\n          actualModel = 'moonshotai/kimi-k2-instruct-0905';\n        } else if (isGoogle) {\n          // Google uses specific model names - convert our naming to theirs  \n          actualModel = model.replace('google/', '');\n        } else {\n          actualModel = model;\n        }\n\n        console.log(`[generate-ai-code-stream] Using provider: ${isAnthropic ? 'Anthropic' : isGoogle ? 'Google' : isOpenAI ? 'OpenAI' : 'Groq'}, model: ${actualModel}`);\n        console.log(`[generate-ai-code-stream] AI Gateway enabled: ${isUsingAIGateway}`);\n        console.log(`[generate-ai-code-stream] Model string: ${model}`);\n\n        // Make streaming API call with appropriate provider\n        const streamOptions: any = {\n          model: modelProvider(actualModel),\n          messages: [\n            { \n              role: 'system', \n              content: systemPrompt + `\n\n🚨 CRITICAL CODE GENERATION RULES - VIOLATION = FAILURE 🚨:\n1. NEVER truncate ANY code - ALWAYS write COMPLETE files\n2. NEVER use \"...\" anywhere in your code - this causes syntax errors\n3. NEVER cut off strings mid-sentence - COMPLETE every string\n4. NEVER leave incomplete class names or attributes\n5. ALWAYS close ALL tags, quotes, brackets, and parentheses\n6. If you run out of space, prioritize completing the current file\n\nCRITICAL STRING RULES TO PREVENT SYNTAX ERRORS:\n- NEVER write: className=\"px-8 py-4 bg-black text-white font-bold neobrut-border neobr...\n- ALWAYS write: className=\"px-8 py-4 bg-black text-white font-bold neobrut-border neobrut-shadow\"\n- COMPLETE every className attribute\n- COMPLETE every string literal\n- NO ellipsis (...) ANYWHERE in code\n\nPACKAGE RULES:\n- For INITIAL generation: Use ONLY React, no external packages\n- For EDITS: You may use packages, specify them with <package> tags\n- NEVER install packages like @mendable/firecrawl-js unless explicitly requested\n\nExamples of SYNTAX ERRORS (NEVER DO THIS):\n❌ className=\"px-4 py-2 bg-blue-600 hover:bg-blue-7...\n❌ <button className=\"btn btn-primary btn-...\n❌ const title = \"Welcome to our...\n❌ import { useState, useEffect, ... } from 'react'\n\nExamples of CORRECT CODE (ALWAYS DO THIS):\n✅ className=\"px-4 py-2 bg-blue-600 hover:bg-blue-700\"\n✅ <button className=\"btn btn-primary btn-large\">\n✅ const title = \"Welcome to our application\"\n✅ import { useState, useEffect, useCallback } from 'react'\n\nREMEMBER: It's better to generate fewer COMPLETE files than many INCOMPLETE files.`\n            },\n            { \n              role: 'user', \n              content: fullPrompt + `\n\nCRITICAL: You MUST complete EVERY file you start. If you write:\n<file path=\"src/components/Hero.jsx\">\n\nYou MUST include the closing </file> tag and ALL the code in between.\n\nNEVER write partial code like:\n<h1>Build and deploy on the AI Cloud.</h1>\n<p>Some text...</p>  ❌ WRONG\n\nALWAYS write complete code:\n<h1>Build and deploy on the AI Cloud.</h1>\n<p>Some text here with full content</p>  ✅ CORRECT\n\nIf you're running out of space, generate FEWER files but make them COMPLETE.\nIt's better to have 3 complete files than 10 incomplete files.`\n            }\n          ],\n          maxTokens: 8192, // Reduce to ensure completion\n          stopSequences: [] // Don't stop early\n          // Note: Neither Groq nor Anthropic models support tool/function calling in this context\n          // We use XML tags for package detection instead\n        };\n        \n        // Add temperature for non-reasoning models\n        if (!model.startsWith('openai/gpt-5')) {\n          streamOptions.temperature = 0.7;\n        }\n        \n        // Add reasoning effort for GPT-5 models\n        if (isOpenAI) {\n          streamOptions.experimental_providerMetadata = {\n            openai: {\n              reasoningEffort: 'high'\n            }\n          };\n        }\n        \n        let result;\n        let retryCount = 0;\n        const maxRetries = 2;\n        \n        while (retryCount <= maxRetries) {\n          try {\n            result = await streamText(streamOptions);\n            break; // Success, exit retry loop\n          } catch (streamError: any) {\n            console.error(`[generate-ai-code-stream] Error calling streamText (attempt ${retryCount + 1}/${maxRetries + 1}):`, streamError);\n            \n            // Check if this is a Groq service unavailable error\n            const isGroqServiceError = isKimiGroq && streamError.message?.includes('Service unavailable');\n            const isRetryableError = streamError.message?.includes('Service unavailable') || \n                                    streamError.message?.includes('rate limit') ||\n                                    streamError.message?.includes('timeout');\n            \n            if (retryCount < maxRetries && isRetryableError) {\n              retryCount++;\n              console.log(`[generate-ai-code-stream] Retrying in ${retryCount * 2} seconds...`);\n              \n              // Send progress update about retry\n              await sendProgress({ \n                type: 'info', \n                message: `Service temporarily unavailable, retrying (attempt ${retryCount + 1}/${maxRetries + 1})...` \n              });\n              \n              // Wait before retry with exponential backoff\n              await new Promise(resolve => setTimeout(resolve, retryCount * 2000));\n              \n              // If Groq fails, try switching to a fallback model\n              if (isGroqServiceError && retryCount === maxRetries) {\n                console.log('[generate-ai-code-stream] Groq service unavailable, falling back to GPT-4');\n                streamOptions.model = openai('gpt-4-turbo');\n                actualModel = 'gpt-4-turbo';\n              }\n            } else {\n              // Final error, send to user\n              await sendProgress({ \n                type: 'error', \n                message: `Failed to initialize ${isGoogle ? 'Gemini' : isAnthropic ? 'Claude' : isOpenAI ? 'GPT-5' : isKimiGroq ? 'Kimi (Groq)' : 'Groq'} streaming: ${streamError.message}` \n              });\n              \n              // If this is a Google model error, provide helpful info\n              if (isGoogle) {\n                await sendProgress({ \n                  type: 'info', \n                  message: 'Tip: Make sure your GEMINI_API_KEY is set correctly and has proper permissions.' \n                });\n              }\n              \n              throw streamError;\n            }\n          }\n        }\n        \n        // Stream the response and parse in real-time\n        let generatedCode = '';\n        let currentFile = '';\n        let currentFilePath = '';\n        let componentCount = 0;\n        let isInFile = false;\n        let isInTag = false;\n        let conversationalBuffer = '';\n        \n        // Buffer for incomplete tags\n        let tagBuffer = '';\n        \n        // Stream the response and parse for packages in real-time\n        for await (const textPart of result?.textStream || []) {\n          const text = textPart || '';\n          generatedCode += text;\n          currentFile += text;\n          \n          // Combine with buffer for tag detection\n          const searchText = tagBuffer + text;\n          \n          // Log streaming chunks to console\n          process.stdout.write(text);\n          \n          // Check if we're entering or leaving a tag\n          const hasOpenTag = /<(file|package|packages|explanation|command|structure|template)\\b/.test(text);\n          const hasCloseTag = /<\\/(file|package|packages|explanation|command|structure|template)>/.test(text);\n          \n          if (hasOpenTag) {\n            // Send any buffered conversational text before the tag\n            if (conversationalBuffer.trim() && !isInTag) {\n              await sendProgress({ \n                type: 'conversation', \n                text: conversationalBuffer.trim()\n              });\n              conversationalBuffer = '';\n            }\n            isInTag = true;\n          }\n          \n          if (hasCloseTag) {\n            isInTag = false;\n          }\n          \n          // If we're not in a tag, buffer as conversational text\n          if (!isInTag && !hasOpenTag) {\n            conversationalBuffer += text;\n          }\n          \n          // Stream the raw text for live preview\n          await sendProgress({ \n            type: 'stream', \n            text: text,\n            raw: true \n          });\n          \n          // Debug: Log every 100 characters streamed\n          if (generatedCode.length % 100 < text.length) {\n            console.log(`[generate-ai-code-stream] Streamed ${generatedCode.length} chars`);\n          }\n          \n          // Check for package tags in buffered text (ONLY for edits, not initial generation)\n          let lastIndex = 0;\n          if (isEdit) {\n            const packageRegex = /<package>([^<]+)<\\/package>/g;\n            let packageMatch;\n            \n            while ((packageMatch = packageRegex.exec(searchText)) !== null) {\n              const packageName = packageMatch[1].trim();\n              if (packageName && !packagesToInstall.includes(packageName)) {\n                packagesToInstall.push(packageName);\n                console.log(`[generate-ai-code-stream] Package detected: ${packageName}`);\n                await sendProgress({ \n                  type: 'package', \n                  name: packageName,\n                  message: `Package detected: ${packageName}`\n                });\n              }\n              lastIndex = packageMatch.index + packageMatch[0].length;\n            }\n          }\n          \n          // Keep unmatched portion in buffer for next iteration\n          tagBuffer = searchText.substring(Math.max(0, lastIndex - 50)); // Keep last 50 chars\n          \n          // Check for file boundaries\n          if (text.includes('<file path=\"')) {\n            const pathMatch = text.match(/<file path=\"([^\"]+)\"/);\n            if (pathMatch) {\n              currentFilePath = pathMatch[1];\n              isInFile = true;\n              currentFile = text;\n            }\n          }\n          \n          // Check for file end\n          if (isInFile && currentFile.includes('</file>')) {\n            isInFile = false;\n            \n            // Send component progress update\n            if (currentFilePath.includes('components/')) {\n              componentCount++;\n              const componentName = currentFilePath.split('/').pop()?.replace('.jsx', '') || 'Component';\n              await sendProgress({ \n                type: 'component', \n                name: componentName,\n                path: currentFilePath,\n                index: componentCount\n              });\n            } else if (currentFilePath.includes('App.jsx')) {\n              await sendProgress({ \n                type: 'app', \n                message: 'Generated main App.jsx',\n                path: currentFilePath\n              });\n            }\n            \n            currentFile = '';\n            currentFilePath = '';\n          }\n        }\n        \n        console.log('\\n\\n[generate-ai-code-stream] Streaming complete.');\n        \n        // Send any remaining conversational text\n        if (conversationalBuffer.trim()) {\n          await sendProgress({ \n            type: 'conversation', \n            text: conversationalBuffer.trim()\n          });\n        }\n        \n        // Also parse <packages> tag for multiple packages - ONLY for edits\n        if (isEdit) {\n          const packagesRegex = /<packages>([\\s\\S]*?)<\\/packages>/g;\n          let packagesMatch;\n          while ((packagesMatch = packagesRegex.exec(generatedCode)) !== null) {\n            const packagesContent = packagesMatch[1].trim();\n            const packagesList = packagesContent.split(/[\\n,]+/)\n              .map(pkg => pkg.trim())\n              .filter(pkg => pkg.length > 0);\n            \n            for (const packageName of packagesList) {\n              if (!packagesToInstall.includes(packageName)) {\n                packagesToInstall.push(packageName);\n                console.log(`[generate-ai-code-stream] Package from <packages> tag: ${packageName}`);\n                await sendProgress({ \n                  type: 'package', \n                  name: packageName,\n                  message: `Package detected: ${packageName}`\n                });\n              }\n            }\n          }\n        }\n        \n        // Function to extract packages from import statements\n        function extractPackagesFromCode(content: string): string[] {\n          const packages: string[] = [];\n          // Match ES6 imports\n          const importRegex = /import\\s+(?:(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+)(?:\\s*,\\s*(?:\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+))*\\s+from\\s+)?['\"]([^'\"]+)['\"]/g;\n          let importMatch;\n          \n          while ((importMatch = importRegex.exec(content)) !== null) {\n            const importPath = importMatch[1];\n            // Skip relative imports and built-in React\n            if (!importPath.startsWith('.') && !importPath.startsWith('/') && \n                importPath !== 'react' && importPath !== 'react-dom' &&\n                !importPath.startsWith('@/')) {\n              // Extract package name (handle scoped packages like @heroicons/react)\n              const packageName = importPath.startsWith('@') \n                ? importPath.split('/').slice(0, 2).join('/')\n                : importPath.split('/')[0];\n              \n              if (!packages.includes(packageName)) {\n                packages.push(packageName);\n              }\n            }\n          }\n          \n          return packages;\n        }\n        \n        // Parse files and send progress for each\n        const fileRegex = /<file path=\"([^\"]+)\">([\\s\\S]*?)<\\/file>/g;\n        const files = [];\n        let match;\n        \n        while ((match = fileRegex.exec(generatedCode)) !== null) {\n          const filePath = match[1];\n          const content = match[2].trim();\n          files.push({ path: filePath, content });\n          \n          // Extract packages from file content - ONLY for edits\n          if (isEdit) {\n            const filePackages = extractPackagesFromCode(content);\n            for (const pkg of filePackages) {\n              if (!packagesToInstall.includes(pkg)) {\n                packagesToInstall.push(pkg);\n                console.log(`[generate-ai-code-stream] Package detected from imports: ${pkg}`);\n                await sendProgress({ \n                  type: 'package', \n                  name: pkg,\n                  message: `Package detected from imports: ${pkg}`\n                });\n              }\n            }\n          }\n          \n          // Send progress for each file (reusing componentCount from streaming)\n          if (filePath.includes('components/')) {\n            const componentName = filePath.split('/').pop()?.replace('.jsx', '') || 'Component';\n            await sendProgress({ \n              type: 'component', \n              name: componentName,\n              path: filePath,\n              index: componentCount\n            });\n          } else if (filePath.includes('App.jsx')) {\n            await sendProgress({ \n              type: 'app', \n              message: 'Generated main App.jsx',\n              path: filePath\n            });\n          }\n        }\n        \n        // Extract explanation\n        const explanationMatch = generatedCode.match(/<explanation>([\\s\\S]*?)<\\/explanation>/);\n        const explanation = explanationMatch ? explanationMatch[1].trim() : 'Code generated successfully!';\n        \n        // Validate generated code for truncation issues\n        const truncationWarnings: string[] = [];\n        \n        // Skip ellipsis checking entirely - too many false positives with spread operators, loading text, etc.\n        \n        // Check for unclosed file tags\n        const fileOpenCount = (generatedCode.match(/<file path=\"/g) || []).length;\n        const fileCloseCount = (generatedCode.match(/<\\/file>/g) || []).length;\n        if (fileOpenCount !== fileCloseCount) {\n          truncationWarnings.push(`Unclosed file tags detected: ${fileOpenCount} open, ${fileCloseCount} closed`);\n        }\n        \n        // Check for files that seem truncated (very short or ending abruptly)\n        const truncationCheckRegex = /<file path=\"([^\"]+)\">([\\s\\S]*?)(?:<\\/file>|$)/g;\n        let truncationMatch;\n        while ((truncationMatch = truncationCheckRegex.exec(generatedCode)) !== null) {\n          const filePath = truncationMatch[1];\n          const content = truncationMatch[2];\n          \n          // Only check for really obvious HTML truncation - file ends with opening tag\n          if (content.trim().endsWith('<') || content.trim().endsWith('</')) {\n            truncationWarnings.push(`File ${filePath} appears to have incomplete HTML tags`);\n          }\n          \n          // Skip \"...\" check - too many false positives with loading text, etc.\n          \n          // Only check for SEVERE truncation issues\n          if (filePath.match(/\\.(jsx?|tsx?)$/)) {\n            // Only check for severely unmatched brackets (more than 3 difference)\n            const openBraces = (content.match(/{/g) || []).length;\n            const closeBraces = (content.match(/}/g) || []).length;\n            const braceDiff = Math.abs(openBraces - closeBraces);\n            if (braceDiff > 3) { // Only flag severe mismatches\n              truncationWarnings.push(`File ${filePath} has severely unmatched braces (${openBraces} open, ${closeBraces} closed)`);\n            }\n            \n            // Check if file is extremely short and looks incomplete\n            if (content.length < 20 && content.includes('function') && !content.includes('}')) {\n              truncationWarnings.push(`File ${filePath} appears severely truncated`);\n            }\n          }\n        }\n        \n        // Handle truncation with automatic retry (if enabled in config)\n        if (truncationWarnings.length > 0 && appConfig.codeApplication.enableTruncationRecovery) {\n          console.warn('[generate-ai-code-stream] Truncation detected, attempting to fix:', truncationWarnings);\n          \n          await sendProgress({\n            type: 'warning',\n            message: 'Detected incomplete code generation. Attempting to complete...',\n            warnings: truncationWarnings\n          });\n          \n          // Try to fix truncated files automatically\n          const truncatedFiles: string[] = [];\n          const fileRegex = /<file path=\"([^\"]+)\">([\\s\\S]*?)(?:<\\/file>|$)/g;\n          let match;\n          \n          while ((match = fileRegex.exec(generatedCode)) !== null) {\n            const filePath = match[1];\n            const content = match[2];\n            \n            // Check if this file appears truncated - be more selective\n            const hasEllipsis = content.includes('...') && \n                               !content.includes('...rest') && \n                               !content.includes('...props') &&\n                               !content.includes('spread');\n                               \n            const endsAbruptly = content.trim().endsWith('...') || \n                                 content.trim().endsWith(',') ||\n                                 content.trim().endsWith('(');\n                                 \n            const hasUnclosedTags = content.includes('</') && \n                                    !content.match(/<\\/[a-zA-Z0-9]+>/) &&\n                                    content.includes('<');\n                                    \n            const tooShort = content.length < 50 && filePath.match(/\\.(jsx?|tsx?)$/);\n            \n            // Check for unmatched braces specifically\n            const openBraceCount = (content.match(/{/g) || []).length;\n            const closeBraceCount = (content.match(/}/g) || []).length;\n            const hasUnmatchedBraces = Math.abs(openBraceCount - closeBraceCount) > 1;\n            \n            const isTruncated = (hasEllipsis && endsAbruptly) || \n                               hasUnclosedTags || \n                               (tooShort && !content.includes('export')) ||\n                               hasUnmatchedBraces;\n            \n            if (isTruncated) {\n              truncatedFiles.push(filePath);\n            }\n          }\n          \n          // If we have truncated files, try to regenerate them\n          if (truncatedFiles.length > 0) {\n            console.log('[generate-ai-code-stream] Attempting to regenerate truncated files:', truncatedFiles);\n            \n            for (const filePath of truncatedFiles) {\n              await sendProgress({\n                type: 'info',\n                message: `Completing ${filePath}...`\n              });\n              \n              try {\n                // Create a focused prompt to complete just this file\n                const completionPrompt = `Complete the following file that was truncated. Provide the FULL file content.\n                \nFile: ${filePath}\nOriginal request: ${prompt}\n                \nProvide the complete file content without any truncation. Include all necessary imports, complete all functions, and close all tags properly.`;\n                \n                // Make a focused API call to complete this specific file\n                // Create a new client for the completion based on the provider\n                let completionClient;\n                if (model.includes('gpt') || model.includes('openai')) {\n                  completionClient = openai;\n                } else if (model.includes('claude')) {\n                  completionClient = anthropic;\n                } else if (model === 'moonshotai/kimi-k2-instruct-0905') {\n                  completionClient = groq;\n                } else {\n                  completionClient = groq;\n                }\n                \n                // Determine the correct model name for the completion\n                let completionModelName: string;\n                if (model === 'moonshotai/kimi-k2-instruct-0905') {\n                  completionModelName = 'moonshotai/kimi-k2-instruct-0905';\n                } else if (model.includes('openai')) {\n                  completionModelName = model.replace('openai/', '');\n                } else if (model.includes('anthropic')) {\n                  completionModelName = model.replace('anthropic/', '');\n                } else if (model.includes('google')) {\n                  completionModelName = model.replace('google/', '');\n                } else {\n                  completionModelName = model;\n                }\n                \n                const completionResult = await streamText({\n                  model: completionClient(completionModelName),\n                  messages: [\n                    { \n                      role: 'system', \n                      content: 'You are completing a truncated file. Provide the complete, working file content.'\n                    },\n                    { role: 'user', content: completionPrompt }\n                  ],\n                  temperature: model.startsWith('openai/gpt-5') ? undefined : appConfig.ai.defaultTemperature\n                });\n                \n                // Get the full text from the stream\n                let completedContent = '';\n                for await (const chunk of completionResult.textStream) {\n                  completedContent += chunk;\n                }\n                \n                // Replace the truncated file in the generatedCode\n                const filePattern = new RegExp(\n                  `<file path=\"${filePath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')}\">[\\\\s\\\\S]*?(?:</file>|$)`,\n                  'g'\n                );\n                \n                // Extract just the code content (remove any markdown or explanation)\n                let cleanContent = completedContent;\n                if (cleanContent.includes('```')) {\n                  const codeMatch = cleanContent.match(/```[\\w]*\\n([\\s\\S]*?)```/);\n                  if (codeMatch) {\n                    cleanContent = codeMatch[1];\n                  }\n                }\n                \n                generatedCode = generatedCode.replace(\n                  filePattern,\n                  `<file path=\"${filePath}\">\\n${cleanContent}\\n</file>`\n                );\n                \n                console.log(`[generate-ai-code-stream] Successfully completed ${filePath}`);\n                \n              } catch (completionError) {\n                console.error(`[generate-ai-code-stream] Failed to complete ${filePath}:`, completionError);\n                await sendProgress({\n                  type: 'warning',\n                  message: `Could not auto-complete ${filePath}. Manual review may be needed.`\n                });\n              }\n            }\n            \n            // Clear the warnings after attempting fixes\n            truncationWarnings.length = 0;\n            await sendProgress({\n              type: 'info',\n              message: 'Truncation recovery complete'\n            });\n          }\n        }\n        \n        // Send completion with packages info\n        await sendProgress({ \n          type: 'complete', \n          generatedCode,\n          explanation,\n          files: files.length,\n          components: componentCount,\n          model,\n          packagesToInstall: packagesToInstall.length > 0 ? packagesToInstall : undefined,\n          warnings: truncationWarnings.length > 0 ? truncationWarnings : undefined\n        });\n        \n        // Track edit in conversation history\n        if (isEdit && editContext && global.conversationState) {\n          const editRecord: ConversationEdit = {\n            timestamp: Date.now(),\n            userRequest: prompt,\n            editType: editContext.editIntent.type,\n            targetFiles: editContext.primaryFiles,\n            confidence: editContext.editIntent.confidence,\n            outcome: 'success' // Assuming success if we got here\n          };\n          \n          global.conversationState.context.edits.push(editRecord);\n          \n          // Track major changes\n          if (editContext.editIntent.type === 'ADD_FEATURE' || files.length > 3) {\n            global.conversationState.context.projectEvolution.majorChanges.push({\n              timestamp: Date.now(),\n              description: editContext.editIntent.description,\n              filesAffected: editContext.primaryFiles\n            });\n          }\n          \n          // Update last updated timestamp\n          global.conversationState.lastUpdated = Date.now();\n          \n          console.log('[generate-ai-code-stream] Updated conversation history with edit:', editRecord);\n        }\n        \n      } catch (error) {\n        console.error('[generate-ai-code-stream] Stream processing error:', error);\n        \n        // Check if it's a tool validation error\n        if ((error as any).message?.includes('tool call validation failed')) {\n          console.error('[generate-ai-code-stream] Tool call validation error - this may be due to the AI model sending incorrect parameters');\n          await sendProgress({ \n            type: 'warning', \n            message: 'Package installation tool encountered an issue. Packages will be detected from imports instead.'\n          });\n          // Continue processing - packages can still be detected from the code\n        } else {\n          await sendProgress({ \n            type: 'error', \n            error: (error as Error).message \n          });\n        }\n      } finally {\n        await writer.close();\n      }\n    })();\n    \n    // Return the stream with proper headers for streaming support\n    return new Response(stream.readable, {\n      headers: {\n        'Content-Type': 'text/event-stream',\n        'Cache-Control': 'no-cache',\n        'Connection': 'keep-alive',\n        'Transfer-Encoding': 'chunked',\n        'Content-Encoding': 'none', // Prevent compression that can break streaming\n        'X-Accel-Buffering': 'no', // Disable nginx buffering\n        'Access-Control-Allow-Origin': '*',\n        'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',\n        'Access-Control-Allow-Headers': 'Content-Type, Authorization',\n      },\n    });\n    \n  } catch (error) {\n    console.error('[generate-ai-code-stream] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/get-sandbox-files/route.ts",
    "content": "import { NextResponse } from 'next/server';\nimport { parseJavaScriptFile, buildComponentTree } from '@/lib/file-parser';\nimport { FileManifest, FileInfo, RouteInfo } from '@/types/file-manifest';\n// SandboxState type used implicitly through global.activeSandbox\n\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function GET() {\n  try {\n    if (!global.activeSandbox) {\n      return NextResponse.json({\n        success: false,\n        error: 'No active sandbox'\n      }, { status: 404 });\n    }\n\n    console.log('[get-sandbox-files] Fetching and analyzing file structure...');\n    \n    // Get list of all relevant files\n    const findResult = await global.activeSandbox.runCommand({\n      cmd: 'find',\n      args: [\n        '.',\n        '-name', 'node_modules', '-prune', '-o',\n        '-name', '.git', '-prune', '-o',\n        '-name', 'dist', '-prune', '-o',\n        '-name', 'build', '-prune', '-o',\n        '-type', 'f',\n        '(',\n        '-name', '*.jsx',\n        '-o', '-name', '*.js',\n        '-o', '-name', '*.tsx',\n        '-o', '-name', '*.ts',\n        '-o', '-name', '*.css',\n        '-o', '-name', '*.json',\n        ')',\n        '-print'\n      ]\n    });\n    \n    if (findResult.exitCode !== 0) {\n      throw new Error('Failed to list files');\n    }\n    \n    const fileList = (await findResult.stdout()).split('\\n').filter((f: string) => f.trim());\n    console.log('[get-sandbox-files] Found', fileList.length, 'files');\n    \n    // Read content of each file (limit to reasonable sizes)\n    const filesContent: Record<string, string> = {};\n    \n    for (const filePath of fileList) {\n      try {\n        // Check file size first\n        const statResult = await global.activeSandbox.runCommand({\n          cmd: 'stat',\n          args: ['-f', '%z', filePath]\n        });\n        \n        if (statResult.exitCode === 0) {\n          const fileSize = parseInt(await statResult.stdout());\n          \n          // Only read files smaller than 10KB\n          if (fileSize < 10000) {\n            const catResult = await global.activeSandbox.runCommand({\n              cmd: 'cat',\n              args: [filePath]\n            });\n            \n            if (catResult.exitCode === 0) {\n              const content = await catResult.stdout();\n              // Remove leading './' from path\n              const relativePath = filePath.replace(/^\\.\\//, '');\n              filesContent[relativePath] = content;\n            }\n          }\n        }\n      } catch (parseError) {\n        console.debug('Error parsing component info:', parseError);\n        // Skip files that can't be read\n        continue;\n      }\n    }\n    \n    // Get directory structure\n    const treeResult = await global.activeSandbox.runCommand({\n      cmd: 'find',\n      args: ['.', '-type', 'd', '-not', '-path', '*/node_modules*', '-not', '-path', '*/.git*']\n    });\n    \n    let structure = '';\n    if (treeResult.exitCode === 0) {\n      const dirs = (await treeResult.stdout()).split('\\n').filter((d: string) => d.trim());\n      structure = dirs.slice(0, 50).join('\\n'); // Limit to 50 lines\n    }\n    \n    // Build enhanced file manifest\n    const fileManifest: FileManifest = {\n      files: {},\n      routes: [],\n      componentTree: {},\n      entryPoint: '',\n      styleFiles: [],\n      timestamp: Date.now(),\n    };\n    \n    // Process each file\n    for (const [relativePath, content] of Object.entries(filesContent)) {\n      const fullPath = `/${relativePath}`;\n      \n      // Create base file info\n      const fileInfo: FileInfo = {\n        content: content,\n        type: 'utility',\n        path: fullPath,\n        relativePath,\n        lastModified: Date.now(),\n      };\n      \n      // Parse JavaScript/JSX files\n      if (relativePath.match(/\\.(jsx?|tsx?)$/)) {\n        const parseResult = parseJavaScriptFile(content, fullPath);\n        Object.assign(fileInfo, parseResult);\n        \n        // Identify entry point\n        if (relativePath === 'src/main.jsx' || relativePath === 'src/index.jsx') {\n          fileManifest.entryPoint = fullPath;\n        }\n        \n        // Identify App.jsx\n        if (relativePath === 'src/App.jsx' || relativePath === 'App.jsx') {\n          fileManifest.entryPoint = fileManifest.entryPoint || fullPath;\n        }\n      }\n      \n      // Track style files\n      if (relativePath.endsWith('.css')) {\n        fileManifest.styleFiles.push(fullPath);\n        fileInfo.type = 'style';\n      }\n      \n      fileManifest.files[fullPath] = fileInfo;\n    }\n    \n    // Build component tree\n    fileManifest.componentTree = buildComponentTree(fileManifest.files);\n    \n    // Extract routes (simplified - looks for Route components or page pattern)\n    fileManifest.routes = extractRoutes(fileManifest.files);\n    \n    // Update global file cache with manifest\n    if (global.sandboxState?.fileCache) {\n      global.sandboxState.fileCache.manifest = fileManifest;\n    }\n\n    return NextResponse.json({\n      success: true,\n      files: filesContent,\n      structure,\n      fileCount: Object.keys(filesContent).length,\n      manifest: fileManifest,\n    });\n\n  } catch (error) {\n    console.error('[get-sandbox-files] Error:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}\n\nfunction extractRoutes(files: Record<string, FileInfo>): RouteInfo[] {\n  const routes: RouteInfo[] = [];\n  \n  // Look for React Router usage\n  for (const [path, fileInfo] of Object.entries(files)) {\n    if (fileInfo.content.includes('<Route') || fileInfo.content.includes('createBrowserRouter')) {\n      // Extract route definitions (simplified)\n      const routeMatches = fileInfo.content.matchAll(/path=[\"']([^\"']+)[\"'].*(?:element|component)={([^}]+)}/g);\n      \n      for (const match of routeMatches) {\n        const [, routePath] = match;\n        // componentRef available in match but not used currently\n        routes.push({\n          path: routePath,\n          component: path,\n        });\n      }\n    }\n    \n    // Check for Next.js style pages\n    if (fileInfo.relativePath.startsWith('pages/') || fileInfo.relativePath.startsWith('src/pages/')) {\n      const routePath = '/' + fileInfo.relativePath\n        .replace(/^(src\\/)?pages\\//, '')\n        .replace(/\\.(jsx?|tsx?)$/, '')\n        .replace(/index$/, '');\n        \n      routes.push({\n        path: routePath,\n        component: path,\n      });\n    }\n  }\n  \n  return routes;\n}"
  },
  {
    "path": "app/api/install-packages/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n  var activeSandboxProvider: any;\n  var sandboxData: any;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { packages } = await request.json();\n    // sandboxId not used - using global sandbox\n    \n    if (!packages || !Array.isArray(packages) || packages.length === 0) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Packages array is required' \n      }, { status: 400 });\n    }\n    \n    // Validate and deduplicate package names\n    const validPackages = [...new Set(packages)]\n      .filter(pkg => pkg && typeof pkg === 'string' && pkg.trim() !== '')\n      .map(pkg => pkg.trim());\n    \n    if (validPackages.length === 0) {\n      return NextResponse.json({\n        success: false,\n        error: 'No valid package names provided'\n      }, { status: 400 });\n    }\n    \n    // Log if duplicates were found\n    if (packages.length !== validPackages.length) {\n      console.log(`[install-packages] Cleaned packages: removed ${packages.length - validPackages.length} invalid/duplicate entries`);\n      console.log(`[install-packages] Original:`, packages);\n      console.log(`[install-packages] Cleaned:`, validPackages);\n    }\n    \n    // Get active sandbox provider\n    const provider = global.activeSandboxProvider;\n    \n    if (!provider) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox provider available' \n      }, { status: 400 });\n    }\n    \n    console.log('[install-packages] Installing packages:', validPackages);\n    \n    // Create a response stream for real-time updates\n    const encoder = new TextEncoder();\n    const stream = new TransformStream();\n    const writer = stream.writable.getWriter();\n    \n    // Function to send progress updates\n    const sendProgress = async (data: any) => {\n      const message = `data: ${JSON.stringify(data)}\\n\\n`;\n      await writer.write(encoder.encode(message));\n    };\n    \n    // Start installation in background\n    (async (providerInstance) => {\n      try {\n        await sendProgress({ \n          type: 'start', \n          message: `Installing ${validPackages.length} package${validPackages.length > 1 ? 's' : ''}...`,\n          packages: validPackages \n        });\n        \n        // Stop any existing development server first\n        await sendProgress({ type: 'status', message: 'Stopping development server...' });\n        \n        try {\n          // Try to kill any running dev server processes\n          await providerInstance.runCommand('pkill -f vite');\n          await new Promise(resolve => setTimeout(resolve, 1000)); // Wait a bit\n        } catch (killError) {\n          // It's OK if no process is found\n          console.debug('[install-packages] No existing dev server found:', killError);\n        }\n        \n        // Check which packages are already installed\n        await sendProgress({ \n          type: 'status', \n          message: 'Checking installed packages...' \n        });\n        \n        let packagesToInstall = validPackages;\n        \n        try {\n          // Read package.json to check existing dependencies\n          let packageJsonContent = '';\n          try {\n            packageJsonContent = await providerInstance.readFile('package.json');\n          } catch (error) {\n            console.log('[install-packages] Error reading package.json:', error);\n          }\n          if (packageJsonContent) {\n            const packageJson = JSON.parse(packageJsonContent);\n            \n            const dependencies = packageJson.dependencies || {};\n            const devDependencies = packageJson.devDependencies || {};\n            const allDeps = { ...dependencies, ...devDependencies };\n            \n            const alreadyInstalled = [];\n            const needInstall = [];\n            \n            for (const pkg of validPackages) {\n              // Handle scoped packages\n              const pkgName = pkg.startsWith('@') ? pkg : pkg.split('@')[0];\n              \n              if (allDeps[pkgName]) {\n                alreadyInstalled.push(pkgName);\n              } else {\n                needInstall.push(pkg);\n              }\n            }\n            \n            packagesToInstall = needInstall;\n            \n            if (alreadyInstalled.length > 0) {\n              await sendProgress({ \n                type: 'info', \n                message: `Already installed: ${alreadyInstalled.join(', ')}` \n              });\n            }\n          }\n        } catch (error) {\n          console.error('[install-packages] Error checking existing packages:', error);\n          // If we can't check, just try to install all packages\n          packagesToInstall = validPackages;\n        }\n        \n        if (packagesToInstall.length === 0) {\n          await sendProgress({ \n            type: 'success', \n            message: 'All packages are already installed',\n            installedPackages: [],\n            alreadyInstalled: validPackages\n          });\n          \n          // Restart dev server\n          await sendProgress({ type: 'status', message: 'Restarting development server...' });\n          \n          await providerInstance.restartViteServer();\n          \n          await sendProgress({ \n            type: 'complete', \n            message: 'Dev server restarted!',\n            installedPackages: []\n          });\n          \n          return;\n        }\n        \n        // Install only packages that aren't already installed\n        await sendProgress({ \n          type: 'info', \n          message: `Installing ${packagesToInstall.length} new package(s): ${packagesToInstall.join(', ')}`\n        });\n        \n        // Install packages using provider method\n        const installResult = await providerInstance.installPackages(packagesToInstall);\n        \n        // Get install output - ensure stdout/stderr are strings\n        const stdout = String(installResult.stdout || '');\n        const stderr = String(installResult.stderr || '');\n        \n        if (stdout) {\n          const lines = stdout.split('\\n').filter(line => line.trim());\n          for (const line of lines) {\n            if (line.includes('npm WARN')) {\n              await sendProgress({ type: 'warning', message: line });\n            } else if (line.trim()) {\n              await sendProgress({ type: 'output', message: line });\n            }\n          }\n        }\n        \n        if (stderr) {\n          const errorLines = stderr.split('\\n').filter(line => line.trim());\n          for (const line of errorLines) {\n            if (line.includes('ERESOLVE')) {\n              await sendProgress({ \n                type: 'warning', \n                message: `Dependency conflict resolved with --legacy-peer-deps: ${line}` \n              });\n            } else if (line.trim()) {\n              await sendProgress({ type: 'error', message: line });\n            }\n          }\n        }\n        \n        if (installResult.exitCode === 0) {\n          await sendProgress({ \n            type: 'success', \n            message: `Successfully installed: ${packagesToInstall.join(', ')}`,\n            installedPackages: packagesToInstall\n          });\n        } else {\n          await sendProgress({ \n            type: 'error', \n            message: 'Package installation failed' \n          });\n        }\n        \n        // Restart development server\n        await sendProgress({ type: 'status', message: 'Restarting development server...' });\n        \n        try {\n          await providerInstance.restartViteServer();\n          \n          // Wait a bit for the server to start\n          await new Promise(resolve => setTimeout(resolve, 3000));\n          \n          await sendProgress({ \n            type: 'complete', \n            message: 'Package installation complete and dev server restarted!',\n            installedPackages: packagesToInstall\n          });\n        } catch (error) {\n          await sendProgress({ \n            type: 'error', \n            message: `Failed to restart dev server: ${(error as Error).message}` \n          });\n        }\n        \n      } catch (error) {\n        const errorMessage = (error as Error).message;\n        if (errorMessage && errorMessage !== 'undefined') {\n          await sendProgress({ \n            type: 'error', \n            message: errorMessage\n          });\n        }\n      } finally {\n        await writer.close();\n      }\n    })(provider);\n    \n    // Return the stream\n    return new Response(stream.readable, {\n      headers: {\n        'Content-Type': 'text/event-stream',\n        'Cache-Control': 'no-cache',\n        'Connection': 'keep-alive',\n      },\n    });\n    \n  } catch (error) {\n    console.error('[install-packages] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/install-packages-v2/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { SandboxProvider } from '@/lib/sandbox/types';\nimport { sandboxManager } from '@/lib/sandbox/sandbox-manager';\n\ndeclare global {\n  var activeSandboxProvider: any;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { packages } = await request.json();\n    \n    if (!packages || !Array.isArray(packages) || packages.length === 0) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Packages array is required' \n      }, { status: 400 });\n    }\n    \n    // Get provider from sandbox manager or global state\n    const provider = sandboxManager.getActiveProvider() || global.activeSandboxProvider;\n    \n    if (!provider) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log(`[install-packages-v2] Installing: ${packages.join(', ')}`);\n    \n    const result = await provider.installPackages(packages);\n    \n    return NextResponse.json({\n      success: result.success,\n      output: result.stdout,\n      error: result.stderr,\n      message: result.success ? 'Packages installed successfully' : 'Package installation failed'\n    });\n    \n  } catch (error) {\n    console.error('[install-packages-v2] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/kill-sandbox/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandboxProvider: any;\n  var sandboxData: any;\n  var existingFiles: Set<string>;\n}\n\nexport async function POST() {\n  try {\n    console.log('[kill-sandbox] Stopping active sandbox...');\n\n    let sandboxKilled = false;\n\n    // Stop existing sandbox if any\n    if (global.activeSandboxProvider) {\n      try {\n        await global.activeSandboxProvider.terminate();\n        sandboxKilled = true;\n        console.log('[kill-sandbox] Sandbox stopped successfully');\n      } catch (e) {\n        console.error('[kill-sandbox] Failed to stop sandbox:', e);\n      }\n      global.activeSandboxProvider = null;\n      global.sandboxData = null;\n    }\n    \n    // Clear existing files tracking\n    if (global.existingFiles) {\n      global.existingFiles.clear();\n    }\n    \n    return NextResponse.json({\n      success: true,\n      sandboxKilled,\n      message: 'Sandbox cleaned up successfully'\n    });\n    \n  } catch (error) {\n    console.error('[kill-sandbox] Error:', error);\n    return NextResponse.json(\n      { \n        success: false, \n        error: (error as Error).message \n      }, \n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/api/monitor-vite-logs/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function GET() {\n  try {\n    if (!global.activeSandbox) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log('[monitor-vite-logs] Checking Vite process logs...');\n    \n    const errors: any[] = [];\n    \n    // Check if there's an error file from previous runs\n    try {\n      const catResult = await global.activeSandbox.runCommand({\n        cmd: 'cat',\n        args: ['/tmp/vite-errors.json']\n      });\n      \n      if (catResult.exitCode === 0) {\n        const errorFileContent = await catResult.stdout();\n        const data = JSON.parse(errorFileContent);\n        errors.push(...(data.errors || []));\n      }\n    } catch {\n      // No error file exists, that's OK\n    }\n    \n    // Look for any Vite-related log files that might contain errors\n    try {\n      const findResult = await global.activeSandbox.runCommand({\n        cmd: 'find',\n        args: ['/tmp', '-name', '*vite*', '-type', 'f']\n      });\n      \n      if (findResult.exitCode === 0) {\n        const logFiles = (await findResult.stdout()).split('\\n').filter((f: string) => f.trim());\n        \n        for (const logFile of logFiles.slice(0, 3)) {\n          try {\n            const grepResult = await global.activeSandbox.runCommand({\n              cmd: 'grep',\n              args: ['-i', 'failed to resolve import', logFile]\n            });\n            \n            if (grepResult.exitCode === 0) {\n              const errorLines = (await grepResult.stdout()).split('\\n').filter((line: string) => line.trim());\n              \n              for (const line of errorLines) {\n                // Extract package name from error line\n                const importMatch = line.match(/\"([^\"]+)\"/);\n                if (importMatch) {\n                  const importPath = importMatch[1];\n                  \n                  // Skip relative imports\n                  if (!importPath.startsWith('.')) {\n                    // Extract base package name\n                    let packageName;\n                    if (importPath.startsWith('@')) {\n                      const parts = importPath.split('/');\n                      packageName = parts.length >= 2 ? parts.slice(0, 2).join('/') : importPath;\n                    } else {\n                      packageName = importPath.split('/')[0];\n                    }\n                    \n                    const errorObj = {\n                      type: \"npm-missing\",\n                      package: packageName,\n                      message: `Failed to resolve import \"${importPath}\"`,\n                      file: \"Unknown\"\n                    };\n                    \n                    // Avoid duplicates\n                    if (!errors.some(e => e.package === errorObj.package)) {\n                      errors.push(errorObj);\n                    }\n                  }\n                }\n              }\n            }\n          } catch {\n            // Skip if grep fails\n          }\n        }\n      }\n    } catch {\n      // No log files found, that's OK\n    }\n    \n    // Deduplicate errors by package name\n    const uniqueErrors: any[] = [];\n    const seenPackages = new Set<string>();\n    \n    for (const error of errors) {\n      if (error.package && !seenPackages.has(error.package)) {\n        seenPackages.add(error.package);\n        uniqueErrors.push(error);\n      }\n    }\n    \n    return NextResponse.json({\n      success: true,\n      hasErrors: uniqueErrors.length > 0,\n      errors: uniqueErrors\n    });\n    \n  } catch (error) {\n    console.error('[monitor-vite-logs] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/report-vite-error/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\ndeclare global {\n  var viteErrors: any[];\n}\n\n// Initialize global viteErrors array if it doesn't exist\nif (!global.viteErrors) {\n  global.viteErrors = [];\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { error, file, type = 'runtime-error' } = await request.json();\n    \n    if (!error) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Error message is required' \n      }, { status: 400 });\n    }\n    \n    // Parse the error to extract useful information\n    const errorObj: any = {\n      type,\n      message: error,\n      file: file || 'unknown',\n      timestamp: new Date().toISOString()\n    };\n    \n    // Extract import information if it's an import error\n    const importMatch = error.match(/Failed to resolve import ['\"]([^'\"]+)['\"] from ['\"]([^'\"]+)['\"]/);\n    if (importMatch) {\n      errorObj.type = 'import-error';\n      errorObj.import = importMatch[1];\n      errorObj.file = importMatch[2];\n    }\n    \n    // Add to global errors array\n    global.viteErrors.push(errorObj);\n    \n    // Keep only last 50 errors\n    if (global.viteErrors.length > 50) {\n      global.viteErrors = global.viteErrors.slice(-50);\n    }\n    \n    console.log('[report-vite-error] Error reported:', errorObj);\n    \n    return NextResponse.json({\n      success: true,\n      message: 'Error reported successfully',\n      error: errorObj\n    });\n    \n  } catch (error) {\n    console.error('[report-vite-error] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/restart-vite/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n  var activeSandboxProvider: any;\n  var lastViteRestartTime: number;\n  var viteRestartInProgress: boolean;\n}\n\nconst RESTART_COOLDOWN_MS = 5000; // 5 second cooldown between restarts\n\nexport async function POST() {\n  try {\n    // Check both v1 and v2 global references\n    const provider = global.activeSandbox || global.activeSandboxProvider;\n    \n    if (!provider) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    // Check if restart is already in progress\n    if (global.viteRestartInProgress) {\n      console.log('[restart-vite] Vite restart already in progress, skipping...');\n      return NextResponse.json({\n        success: true,\n        message: 'Vite restart already in progress'\n      });\n    }\n    \n    // Check cooldown\n    const now = Date.now();\n    if (global.lastViteRestartTime && (now - global.lastViteRestartTime) < RESTART_COOLDOWN_MS) {\n      const remainingTime = Math.ceil((RESTART_COOLDOWN_MS - (now - global.lastViteRestartTime)) / 1000);\n      console.log(`[restart-vite] Cooldown active, ${remainingTime}s remaining`);\n      return NextResponse.json({\n        success: true,\n        message: `Vite was recently restarted, cooldown active (${remainingTime}s remaining)`\n      });\n    }\n    \n    // Set the restart flag\n    global.viteRestartInProgress = true;\n    \n    console.log('[restart-vite] Using provider method to restart Vite...');\n    \n    // Use the provider's restartViteServer method if available\n    if (typeof provider.restartViteServer === 'function') {\n      await provider.restartViteServer();\n      console.log('[restart-vite] Vite restarted via provider method');\n    } else {\n      // Fallback to manual restart using provider's runCommand\n      console.log('[restart-vite] Fallback to manual Vite restart...');\n      \n      // Kill existing Vite processes\n      try {\n        await provider.runCommand('pkill -f vite');\n        console.log('[restart-vite] Killed existing Vite processes');\n        \n        // Wait a moment for processes to terminate\n        await new Promise(resolve => setTimeout(resolve, 2000));\n      } catch {\n        console.log('[restart-vite] No existing Vite processes found');\n      }\n      \n      // Clear any error tracking files\n      try {\n        await provider.runCommand('bash -c \"echo \\'{\\\\\"errors\\\\\": [], \\\\\"lastChecked\\\\\": '+ Date.now() +'}\\' > /tmp/vite-errors.json\"');\n      } catch {\n        // Ignore if this fails\n      }\n      \n      // Start Vite dev server in background\n      await provider.runCommand('sh -c \"nohup npm run dev > /tmp/vite.log 2>&1 &\"');\n      console.log('[restart-vite] Vite dev server restarted');\n      \n      // Wait for Vite to start up\n      await new Promise(resolve => setTimeout(resolve, 3000));\n    }\n    \n    // Update global state\n    global.lastViteRestartTime = Date.now();\n    global.viteRestartInProgress = false;\n    \n    return NextResponse.json({\n      success: true,\n      message: 'Vite restarted successfully'\n    });\n    \n  } catch (error) {\n    console.error('[restart-vite] Error:', error);\n    \n    // Clear the restart flag on error\n    global.viteRestartInProgress = false;\n    \n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/run-command/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\n// Get active sandbox from global state (in production, use a proper state management solution)\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { command } = await request.json();\n    \n    if (!command) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Command is required' \n      }, { status: 400 });\n    }\n    \n    if (!global.activeSandbox) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log(`[run-command] Executing: ${command}`);\n    \n    // Parse command and arguments\n    const commandParts = command.trim().split(/\\s+/);\n    const cmd = commandParts[0];\n    const args = commandParts.slice(1);\n    \n    // Execute command using Vercel Sandbox\n    const result = await global.activeSandbox.runCommand({\n      cmd,\n      args\n    });\n    \n    // Get output streams\n    const stdout = await result.stdout();\n    const stderr = await result.stderr();\n    \n    const output = [\n      stdout ? `STDOUT:\\n${stdout}` : '',\n      stderr ? `\\nSTDERR:\\n${stderr}` : '',\n      `\\nExit code: ${result.exitCode}`\n    ].filter(Boolean).join('');\n    \n    return NextResponse.json({\n      success: true,\n      output,\n      exitCode: result.exitCode,\n      message: result.exitCode === 0 ? 'Command executed successfully' : 'Command completed with non-zero exit code'\n    });\n    \n  } catch (error) {\n    console.error('[run-command] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/run-command-v2/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport { SandboxProvider } from '@/lib/sandbox/types';\nimport { sandboxManager } from '@/lib/sandbox/sandbox-manager';\n\n// Get active sandbox provider from global state\ndeclare global {\n  var activeSandboxProvider: any;\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { command } = await request.json();\n    \n    if (!command) {\n      return NextResponse.json({ \n        success: false, \n        error: 'Command is required' \n      }, { status: 400 });\n    }\n    \n    // Get provider from sandbox manager or global state\n    const provider = sandboxManager.getActiveProvider() || global.activeSandboxProvider;\n    \n    if (!provider) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log(`[run-command-v2] Executing: ${command}`);\n    \n    const result = await provider.runCommand(command);\n    \n    return NextResponse.json({\n      success: result.success,\n      output: result.stdout,\n      error: result.stderr,\n      exitCode: result.exitCode,\n      message: result.success ? 'Command executed successfully' : 'Command failed'\n    });\n    \n  } catch (error) {\n    console.error('[run-command-v2] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/sandbox-logs/route.ts",
    "content": "import { NextResponse } from 'next/server';\n\ndeclare global {\n  var activeSandbox: any;\n}\n\nexport async function GET() {\n  try {\n    if (!global.activeSandbox) {\n      return NextResponse.json({ \n        success: false, \n        error: 'No active sandbox' \n      }, { status: 400 });\n    }\n    \n    console.log('[sandbox-logs] Fetching Vite dev server logs...');\n    \n    // Check if Vite processes are running\n    const psResult = await global.activeSandbox.runCommand({\n      cmd: 'ps',\n      args: ['aux']\n    });\n    \n    let viteRunning = false;\n    const logContent: string[] = [];\n    \n    if (psResult.exitCode === 0) {\n      const psOutput = await psResult.stdout();\n      const viteProcesses = psOutput.split('\\n').filter((line: string) => \n        line.toLowerCase().includes('vite') || \n        line.toLowerCase().includes('npm run dev')\n      );\n      \n      viteRunning = viteProcesses.length > 0;\n      \n      if (viteRunning) {\n        logContent.push(\"Vite is running\");\n        logContent.push(...viteProcesses.slice(0, 3)); // Show first 3 processes\n      } else {\n        logContent.push(\"Vite process not found\");\n      }\n    }\n    \n    // Try to read any recent log files\n    try {\n      const findResult = await global.activeSandbox.runCommand({\n        cmd: 'find',\n        args: ['/tmp', '-name', '*vite*', '-name', '*.log', '-type', 'f']\n      });\n      \n      if (findResult.exitCode === 0) {\n        const logFiles = (await findResult.stdout()).split('\\n').filter((f: string) => f.trim());\n        \n        for (const logFile of logFiles.slice(0, 2)) {\n          try {\n            const catResult = await global.activeSandbox.runCommand({\n              cmd: 'tail',\n              args: ['-n', '10', logFile]\n            });\n            \n            if (catResult.exitCode === 0) {\n              const logFileContent = await catResult.stdout();\n              logContent.push(`--- ${logFile} ---`);\n              logContent.push(logFileContent);\n            }\n          } catch {\n            // Skip if can't read log file\n          }\n        }\n      }\n    } catch {\n      // No log files found, that's OK\n    }\n    \n    return NextResponse.json({\n      success: true,\n      hasErrors: false,\n      logs: logContent,\n      status: viteRunning ? 'running' : 'stopped'\n    });\n    \n  } catch (error) {\n    console.error('[sandbox-logs] Error:', error);\n    return NextResponse.json({ \n      success: false, \n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/sandbox-status/route.ts",
    "content": "import { NextResponse } from 'next/server';\nimport { sandboxManager } from '@/lib/sandbox/sandbox-manager';\n\ndeclare global {\n  var activeSandboxProvider: any;\n  var sandboxData: any;\n  var existingFiles: Set<string>;\n}\n\nexport async function GET() {\n  try {\n    // Check sandbox manager first, then fall back to global state\n    const provider = sandboxManager.getActiveProvider() || global.activeSandboxProvider;\n    const sandboxExists = !!provider;\n\n    let sandboxHealthy = false;\n    let sandboxInfo = null;\n\n    if (sandboxExists && provider) {\n      try {\n        // Check if sandbox is healthy by getting its info\n        const providerInfo = provider.getSandboxInfo();\n        sandboxHealthy = !!providerInfo;\n        \n        sandboxInfo = {\n          sandboxId: providerInfo?.sandboxId || global.sandboxData?.sandboxId,\n          url: providerInfo?.url || global.sandboxData?.url,\n          filesTracked: global.existingFiles ? Array.from(global.existingFiles) : [],\n          lastHealthCheck: new Date().toISOString()\n        };\n      } catch (error) {\n        console.error('[sandbox-status] Health check failed:', error);\n        sandboxHealthy = false;\n      }\n    }\n    \n    return NextResponse.json({\n      success: true,\n      active: sandboxExists,\n      healthy: sandboxHealthy,\n      sandboxData: sandboxInfo,\n      message: sandboxHealthy \n        ? 'Sandbox is active and healthy' \n        : sandboxExists \n          ? 'Sandbox exists but is not responding' \n          : 'No active sandbox'\n    });\n    \n  } catch (error) {\n    console.error('[sandbox-status] Error:', error);\n    return NextResponse.json({ \n      success: false,\n      active: false,\n      error: (error as Error).message \n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/scrape-screenshot/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\nimport FirecrawlApp from '@mendable/firecrawl-js';\n\nexport async function POST(req: NextRequest) {\n  try {\n    const { url } = await req.json();\n    \n    if (!url) {\n      return NextResponse.json({ error: 'URL is required' }, { status: 400 });\n    }\n\n    // Initialize Firecrawl with API key from environment\n    const apiKey = process.env.FIRECRAWL_API_KEY;\n    \n    if (!apiKey) {\n      console.error(\"FIRECRAWL_API_KEY not configured\");\n      return NextResponse.json({ \n        error: 'Firecrawl API key not configured' \n      }, { status: 500 });\n    }\n    \n    const app = new FirecrawlApp({ apiKey });\n\n    console.log('[scrape-screenshot] Attempting to capture screenshot for:', url);\n    console.log('[scrape-screenshot] Using Firecrawl API key:', apiKey ? 'Present' : 'Missing');\n\n    // Use the new v4 scrape method (not scrapeUrl)\n    const scrapeResult = await app.scrape(url, {\n      formats: ['screenshot'], // Request screenshot format\n      waitFor: 3000, // Wait for page to fully load\n      timeout: 30000,\n      onlyMainContent: false, // Get full page for screenshot\n      actions: [\n        {\n          type: 'wait',\n          milliseconds: 2000 // Additional wait for dynamic content\n        }\n      ]\n    });\n\n    console.log('[scrape-screenshot] Full scrape result:', JSON.stringify(scrapeResult, null, 2));\n    console.log('[scrape-screenshot] Scrape result type:', typeof scrapeResult);\n    console.log('[scrape-screenshot] Scrape result keys:', Object.keys(scrapeResult));\n    \n    // The Firecrawl v4 API might return data directly without a success flag\n    // Check if we have data with screenshot\n    if (scrapeResult && scrapeResult.screenshot) {\n      // Direct screenshot response\n      return NextResponse.json({\n        success: true,\n        screenshot: scrapeResult.screenshot,\n        metadata: scrapeResult.metadata || {}\n      });\n    } else if ((scrapeResult as any)?.data?.screenshot) {\n      // Nested data structure\n      return NextResponse.json({\n        success: true,\n        screenshot: (scrapeResult as any).data.screenshot,\n        metadata: (scrapeResult as any).data.metadata || {}\n      });\n    } else if ((scrapeResult as any)?.success === false) {\n      // Explicit failure\n      console.error('[scrape-screenshot] Firecrawl API error:', (scrapeResult as any).error);\n      throw new Error((scrapeResult as any).error || 'Failed to capture screenshot');\n    } else {\n      // No screenshot in response\n      console.error('[scrape-screenshot] No screenshot in response. Full response:', JSON.stringify(scrapeResult, null, 2));\n      throw new Error('Screenshot not available in response - check console for full response structure');\n    }\n\n  } catch (error: any) {\n    console.error('[scrape-screenshot] Screenshot capture error:', error);\n    console.error('[scrape-screenshot] Error stack:', error.stack);\n    \n    // Provide fallback response for development - removed NODE_ENV check as it doesn't work in Next.js production builds\n    \n    return NextResponse.json({ \n      error: error.message || 'Failed to capture screenshot'\n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/scrape-url-enhanced/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\n// Function to sanitize smart quotes and other problematic characters\nfunction sanitizeQuotes(text: string): string {\n  return text\n    // Replace smart single quotes\n    .replace(/[\\u2018\\u2019\\u201A\\u201B]/g, \"'\")\n    // Replace smart double quotes\n    .replace(/[\\u201C\\u201D\\u201E\\u201F]/g, '\"')\n    // Replace other quote-like characters\n    .replace(/[\\u00AB\\u00BB]/g, '\"') // Guillemets\n    .replace(/[\\u2039\\u203A]/g, \"'\") // Single guillemets\n    // Replace other problematic characters\n    .replace(/[\\u2013\\u2014]/g, '-') // En dash and em dash\n    .replace(/[\\u2026]/g, '...') // Ellipsis\n    .replace(/[\\u00A0]/g, ' '); // Non-breaking space\n}\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { url } = await request.json();\n    \n    if (!url) {\n      return NextResponse.json({\n        success: false,\n        error: 'URL is required'\n      }, { status: 400 });\n    }\n    \n    console.log('[scrape-url-enhanced] Scraping with Firecrawl:', url);\n    \n    const FIRECRAWL_API_KEY = process.env.FIRECRAWL_API_KEY;\n    if (!FIRECRAWL_API_KEY) {\n      throw new Error('FIRECRAWL_API_KEY environment variable is not set');\n    }\n    \n    // Make request to Firecrawl API with maxAge for 500% faster scraping\n    const firecrawlResponse = await fetch('https://api.firecrawl.dev/v1/scrape', {\n      method: 'POST',\n      headers: {\n        'Authorization': `Bearer ${FIRECRAWL_API_KEY}`,\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify({\n        url,\n        formats: ['markdown', 'html', 'screenshot'],\n        waitFor: 3000,\n        timeout: 30000,\n        blockAds: true,\n        maxAge: 3600000, // Use cached data if less than 1 hour old (500% faster!)\n        actions: [\n          {\n            type: 'wait',\n            milliseconds: 2000\n          },\n          {\n            type: 'screenshot',\n            fullPage: false // Just visible viewport for performance\n          }\n        ]\n      })\n    });\n    \n    if (!firecrawlResponse.ok) {\n      const error = await firecrawlResponse.text();\n      throw new Error(`Firecrawl API error: ${error}`);\n    }\n    \n    const data = await firecrawlResponse.json();\n    \n    if (!data.success || !data.data) {\n      throw new Error('Failed to scrape content');\n    }\n    \n    const { markdown, metadata, screenshot, actions } = data.data;\n    // html available but not used in current implementation\n    \n    // Get screenshot from either direct field or actions result\n    const screenshotUrl = screenshot || actions?.screenshots?.[0] || null;\n    \n    // Sanitize the markdown content\n    const sanitizedMarkdown = sanitizeQuotes(markdown || '');\n    \n    // Extract structured data from the response\n    const title = metadata?.title || '';\n    const description = metadata?.description || '';\n    \n    // Format content for AI\n    const formattedContent = `\nTitle: ${sanitizeQuotes(title)}\nDescription: ${sanitizeQuotes(description)}\nURL: ${url}\n\nMain Content:\n${sanitizedMarkdown}\n    `.trim();\n    \n    return NextResponse.json({\n      success: true,\n      url,\n      content: formattedContent,\n      screenshot: screenshotUrl,\n      structured: {\n        title: sanitizeQuotes(title),\n        description: sanitizeQuotes(description),\n        content: sanitizedMarkdown,\n        url,\n        screenshot: screenshotUrl\n      },\n      metadata: {\n        scraper: 'firecrawl-enhanced',\n        timestamp: new Date().toISOString(),\n        contentLength: formattedContent.length,\n        cached: data.data.cached || false, // Indicates if data came from cache\n        ...metadata\n      },\n      message: 'URL scraped successfully with Firecrawl (with caching for 500% faster performance)'\n    });\n    \n  } catch (error) {\n    console.error('[scrape-url-enhanced] Error:', error);\n    return NextResponse.json({\n      success: false,\n      error: (error as Error).message\n    }, { status: 500 });\n  }\n}"
  },
  {
    "path": "app/api/scrape-website/route.ts",
    "content": "import { NextRequest, NextResponse } from \"next/server\";\nimport FirecrawlApp from '@mendable/firecrawl-js';\n\nexport async function POST(request: NextRequest) {\n  try {\n    const { url, formats = ['markdown', 'html'], options = {} } = await request.json();\n    \n    if (!url) {\n      return NextResponse.json(\n        { error: \"URL is required\" },\n        { status: 400 }\n      );\n    }\n    \n    // Initialize Firecrawl with API key from environment\n    const apiKey = process.env.FIRECRAWL_API_KEY;\n    \n    if (!apiKey) {\n      console.error(\"FIRECRAWL_API_KEY not configured\");\n      // For demo purposes, return mock data if API key is not set\n      return NextResponse.json({\n        success: true,\n        data: {\n          title: \"Example Website\",\n          content: `This is a mock response for ${url}. Configure FIRECRAWL_API_KEY to enable real scraping.`,\n          description: \"A sample website\",\n          markdown: `# Example Website\\n\\nThis is mock content for demonstration purposes.`,\n          html: `<h1>Example Website</h1><p>This is mock content for demonstration purposes.</p>`,\n          metadata: {\n            title: \"Example Website\",\n            description: \"A sample website\",\n            sourceURL: url,\n            statusCode: 200\n          }\n        }\n      });\n    }\n    \n    const app = new FirecrawlApp({ apiKey });\n    \n    // Scrape the website using the latest SDK patterns\n    // Include screenshot if requested in formats\n    const scrapeResult = await app.scrape(url, {\n      formats: formats,\n      onlyMainContent: options.onlyMainContent !== false, // Default to true for cleaner content\n      waitFor: options.waitFor || 2000, // Wait for dynamic content\n      timeout: options.timeout || 30000,\n      ...options // Pass through any additional options\n    });\n    \n    // Handle the response according to the latest SDK structure\n    const result = scrapeResult as any;\n    if (result.success === false) {\n      throw new Error(result.error || \"Failed to scrape website\");\n    }\n    \n    // The SDK may return data directly or nested\n    const data = result.data || result;\n    \n    return NextResponse.json({\n      success: true,\n      data: {\n        title: data?.metadata?.title || \"Untitled\",\n        content: data?.markdown || data?.html || \"\",\n        description: data?.metadata?.description || \"\",\n        markdown: data?.markdown || \"\",\n        html: data?.html || \"\",\n        metadata: data?.metadata || {},\n        screenshot: data?.screenshot || null,\n        links: data?.links || [],\n        // Include raw data for flexibility\n        raw: data\n      }\n    });\n    \n  } catch (error) {\n    console.error(\"Error scraping website:\", error);\n    \n    // Return a more detailed error response\n    return NextResponse.json({\n      success: false,\n      error: error instanceof Error ? error.message : \"Failed to scrape website\",\n      // Provide mock data as fallback for development\n      data: {\n        title: \"Example Website\",\n        content: \"This is fallback content due to an error. Please check your configuration.\",\n        description: \"Error occurred while scraping\",\n        markdown: `# Error\\n\\n${error instanceof Error ? error.message : 'Unknown error occurred'}`,\n        html: `<h1>Error</h1><p>${error instanceof Error ? error.message : 'Unknown error occurred'}</p>`,\n        metadata: {\n          title: \"Error\",\n          description: \"Failed to scrape website\",\n          statusCode: 500\n        }\n      }\n    }, { status: 500 });\n  }\n}\n\n// Optional: Add OPTIONS handler for CORS if needed\nexport async function OPTIONS() {\n  return new NextResponse(null, {\n    status: 200,\n    headers: {\n      'Access-Control-Allow-Origin': '*',\n      'Access-Control-Allow-Methods': 'POST, OPTIONS',\n      'Access-Control-Allow-Headers': 'Content-Type',\n    },\n  });\n}"
  },
  {
    "path": "app/api/search/route.ts",
    "content": "import { NextRequest, NextResponse } from 'next/server';\n\nexport async function POST(req: NextRequest) {\n  try {\n    const { query } = await req.json();\n    \n    if (!query) {\n      return NextResponse.json({ error: 'Query is required' }, { status: 400 });\n    }\n\n    // Use Firecrawl search to get top 10 results with screenshots\n    const searchResponse = await fetch('https://api.firecrawl.dev/v1/search', {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'Authorization': `Bearer ${process.env.FIRECRAWL_API_KEY}`,\n      },\n      body: JSON.stringify({\n        query,\n        limit: 10,\n        scrapeOptions: {\n          formats: ['markdown', 'screenshot'],\n          onlyMainContent: true,\n        },\n      }),\n    });\n\n    if (!searchResponse.ok) {\n      throw new Error('Search failed');\n    }\n\n    const searchData = await searchResponse.json();\n    \n    // Format results with screenshots and markdown\n    const results = searchData.data?.map((result: any) => ({\n      url: result.url,\n      title: result.title || result.url,\n      description: result.description || '',\n      screenshot: result.screenshot || null,\n      markdown: result.markdown || '',\n    })) || [];\n\n    return NextResponse.json({ results });\n  } catch (error) {\n    console.error('Search error:', error);\n    return NextResponse.json(\n      { error: 'Failed to perform search' },\n      { status: 500 }\n    );\n  }\n}"
  },
  {
    "path": "app/builder/page.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport { toast } from \"sonner\";\n\nexport default function BuilderPage() {\n  const [targetUrl, setTargetUrl] = useState<string>(\"\");\n  const [selectedStyle, setSelectedStyle] = useState<string>(\"modern\");\n  const [isLoading, setIsLoading] = useState(true);\n  const [previewUrl, setPreviewUrl] = useState<string>(\"\");\n  const [progress, setProgress] = useState<string>(\"Initializing...\");\n  const [generatedCode, setGeneratedCode] = useState<string>(\"\");\n  const router = useRouter();\n\n  useEffect(() => {\n    // Get the URL and style from sessionStorage\n    const url = sessionStorage.getItem('targetUrl');\n    const style = sessionStorage.getItem('selectedStyle');\n    \n    if (!url) {\n      router.push('/');\n      return;\n    }\n    \n    setTargetUrl(url);\n    setSelectedStyle(style || \"modern\");\n    \n    // Start the website generation process\n    generateWebsite(url, style || \"modern\");\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [router]);\n\n  const generateWebsite = async (url: string, style: string) => {\n    try {\n      setProgress(\"Analyzing website...\");\n      \n      // For demo purposes, we'll generate a simple HTML template\n      // In production, this would call the actual scraping and generation APIs\n      const mockGeneratedCode = `\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>${style} Website - Reimagined</title>\n  <style>\n    :root {\n      --primary: ${style === 'modern' ? '#FA5D19' : style === 'playful' ? '#9061ff' : style === 'professional' ? '#2a6dfb' : '#eb3424'};\n      --background: ${style === 'modern' ? '#ffffff' : style === 'playful' ? '#f9f9f9' : style === 'professional' ? '#f5f5f5' : '#fafafa'};\n    }\n    \n    * {\n      margin: 0;\n      padding: 0;\n      box-sizing: border-box;\n    }\n    \n    body {\n      font-family: system-ui, -apple-system, sans-serif;\n      background: var(--background);\n      color: #262626;\n      line-height: 1.6;\n    }\n    \n    header {\n      background: white;\n      border-bottom: 1px solid #ededed;\n      padding: 2rem;\n    }\n    \n    nav {\n      max-width: 1200px;\n      margin: 0 auto;\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n    }\n    \n    .logo {\n      font-size: 1.5rem;\n      font-weight: bold;\n      color: var(--primary);\n    }\n    \n    main {\n      max-width: 1200px;\n      margin: 4rem auto;\n      padding: 0 2rem;\n    }\n    \n    .hero {\n      text-align: center;\n      margin-bottom: 4rem;\n    }\n    \n    h1 {\n      font-size: 3rem;\n      margin-bottom: 1rem;\n      background: linear-gradient(135deg, var(--primary), #262626);\n      -webkit-background-clip: text;\n      -webkit-text-fill-color: transparent;\n    }\n    \n    .subtitle {\n      font-size: 1.25rem;\n      color: #666;\n    }\n    \n    .cta-button {\n      display: inline-block;\n      margin-top: 2rem;\n      padding: 1rem 2rem;\n      background: var(--primary);\n      color: white;\n      text-decoration: none;\n      border-radius: 0.5rem;\n      transition: transform 0.2s;\n    }\n    \n    .cta-button:hover {\n      transform: scale(1.05);\n    }\n    \n    .features {\n      display: grid;\n      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n      gap: 2rem;\n      margin-top: 4rem;\n    }\n    \n    .feature {\n      padding: 2rem;\n      background: white;\n      border-radius: 1rem;\n      border: 1px solid #ededed;\n      transition: box-shadow 0.2s;\n    }\n    \n    .feature:hover {\n      box-shadow: 0 10px 30px rgba(0,0,0,0.1);\n    }\n    \n    .feature h3 {\n      margin-bottom: 1rem;\n      color: var(--primary);\n    }\n  </style>\n</head>\n<body>\n  <header>\n    <nav>\n      <div class=\"logo\">Reimagined</div>\n      <div>\n        <a href=\"#features\" style=\"margin-right: 2rem; color: #666; text-decoration: none;\">Features</a>\n        <a href=\"#about\" style=\"margin-right: 2rem; color: #666; text-decoration: none;\">About</a>\n        <a href=\"#contact\" style=\"color: #666; text-decoration: none;\">Contact</a>\n      </div>\n    </nav>\n  </header>\n  \n  <main>\n    <div class=\"hero\">\n      <h1>Welcome to Your ${style === 'modern' ? 'Modern' : style === 'playful' ? 'Playful' : style === 'professional' ? 'Professional' : 'Artistic'} Website</h1>\n      <p class=\"subtitle\">Reimagined from ${url}</p>\n      <a href=\"#\" class=\"cta-button\">Get Started</a>\n    </div>\n    \n    <div class=\"features\" id=\"features\">\n      <div class=\"feature\">\n        <h3>Fast</h3>\n        <p>Lightning-fast performance optimized for modern web standards.</p>\n      </div>\n      <div class=\"feature\">\n        <h3>Responsive</h3>\n        <p>Looks great on all devices, from mobile to desktop.</p>\n      </div>\n      <div class=\"feature\">\n        <h3>Beautiful</h3>\n        <p>Stunning design that captures attention and drives engagement.</p>\n      </div>\n    </div>\n  </main>\n</body>\n</html>`;\n      \n      setGeneratedCode(mockGeneratedCode);\n      \n      // Create a blob URL for the preview\n      const blob = new Blob([mockGeneratedCode], { type: 'text/html' });\n      const blobUrl = URL.createObjectURL(blob);\n      setPreviewUrl(blobUrl);\n      \n      setProgress(\"Website ready!\");\n      setIsLoading(false);\n      \n      // Show success message\n      toast.success(\"Website generated successfully!\");\n      \n    } catch (error) {\n      console.error(\"Error generating website:\", error);\n      toast.error(\"Failed to generate website. Please try again.\");\n      setProgress(\"Error occurred\");\n      setTimeout(() => router.push('/'), 2000);\n    }\n  };\n  \n  const downloadCode = () => {\n    const blob = new Blob([generatedCode], { type: 'text/html' });\n    const url = URL.createObjectURL(blob);\n    const a = document.createElement('a');\n    a.href = url;\n    a.download = 'website.html';\n    document.body.appendChild(a);\n    a.click();\n    document.body.removeChild(a);\n    URL.revokeObjectURL(url);\n    toast.success(\"Code downloaded!\");\n  };\n\n  return (\n    <div className=\"min-h-screen bg-background-base\">\n      <div className=\"flex h-screen\">\n        {/* Sidebar */}\n        <div className=\"w-80 bg-white border-r border-border-faint p-24 flex flex-col\">\n          <h2 className=\"text-title-small font-semibold mb-16\">Building Your Website</h2>\n          \n          <div className=\"space-y-12 flex-1\">\n            <div>\n              <div className=\"text-label-small text-black-alpha-56 mb-4\">Target URL</div>\n              <div className=\"text-body-medium text-accent-black truncate\">{targetUrl}</div>\n            </div>\n            \n            <div>\n              <div className=\"text-label-small text-black-alpha-56 mb-4\">Style</div>\n              <div className=\"text-body-medium text-accent-black capitalize\">{selectedStyle}</div>\n            </div>\n            \n            <div>\n              <div className=\"text-label-small text-black-alpha-56 mb-4\">Status</div>\n              <div className=\"text-body-medium text-heat-100\">{progress}</div>\n            </div>\n          </div>\n          \n          <div className=\"space-y-8\">\n            {!isLoading && (\n              <button\n                onClick={downloadCode}\n                className=\"w-full py-12 px-16 bg-heat-100 hover:bg-heat-200 text-white rounded-10 text-label-medium transition-all\"\n              >\n                Download Code\n              </button>\n            )}\n            \n            <button\n              onClick={() => router.push('/')}\n              className=\"w-full py-12 px-16 bg-black-alpha-4 hover:bg-black-alpha-6 rounded-10 text-label-medium transition-all\"\n            >\n              Start Over\n            </button>\n          </div>\n        </div>\n        \n        {/* Preview */}\n        <div className=\"flex-1 bg-gray-50\">\n          {isLoading ? (\n            <div className=\"flex items-center justify-center h-full\">\n              <div className=\"text-center\">\n                <div className=\"w-48 h-48 border-4 border-heat-100 border-t-transparent rounded-full animate-spin mb-16 mx-auto\"></div>\n                <p className=\"text-body-large text-black-alpha-56\">{progress}</p>\n              </div>\n            </div>\n          ) : (\n            previewUrl && (\n              <iframe\n                src={previewUrl}\n                className=\"w-full h-full border-0\"\n                title=\"Website Preview\"\n              />\n            )\n          )}\n        </div>\n      </div>\n    </div>\n  );\n}"
  },
  {
    "path": "app/generation/page.tsx",
    "content": "'use client';\n\nimport { useState, useEffect, useRef, Suspense } from 'react';\nimport { useSearchParams, useRouter } from 'next/navigation';\nimport Image from 'next/image';\nimport { appConfig } from '@/config/app.config';\nimport HeroInput from '@/components/HeroInput';\nimport SidebarInput from '@/components/app/generation/SidebarInput';\nimport HeaderBrandKit from '@/components/shared/header/BrandKit/BrandKit';\nimport { HeaderProvider } from '@/components/shared/header/HeaderContext';\nimport { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { vscDarkPlus } from 'react-syntax-highlighter/dist/esm/styles/prism';\n// Import icons from centralized module to avoid Turbopack chunk issues\nimport { \n  FiFile, \n  FiChevronRight, \n  FiChevronDown,\n  FiGithub,\n  BsFolderFill, \n  BsFolder2Open,\n  SiJavascript, \n  SiReact, \n  SiCss3, \n  SiJson \n} from '@/lib/icons';\nimport { motion } from 'framer-motion';\nimport CodeApplicationProgress, { type CodeApplicationState } from '@/components/CodeApplicationProgress';\n\ninterface SandboxData {\n  sandboxId: string;\n  url: string;\n  [key: string]: any;\n}\n\ninterface ChatMessage {\n  content: string;\n  type: 'user' | 'ai' | 'system' | 'file-update' | 'command' | 'error';\n  timestamp: Date;\n  metadata?: {\n    scrapedUrl?: string;\n    scrapedContent?: any;\n    generatedCode?: string;\n    appliedFiles?: string[];\n    commandType?: 'input' | 'output' | 'error' | 'success';\n    brandingData?: any;\n    sourceUrl?: string;\n  };\n}\n\ninterface ScrapeData {\n  success: boolean;\n  content?: string;\n  url?: string;\n  title?: string;\n  source?: string;\n  screenshot?: string;\n  structured?: any;\n  metadata?: any;\n  message?: string;\n  error?: string;\n}\n\nfunction AISandboxPage() {\n  const [sandboxData, setSandboxData] = useState<SandboxData | null>(null);\n  const [loading, setLoading] = useState(false);\n  const [status, setStatus] = useState({ text: 'Not connected', active: false });\n  const [responseArea, setResponseArea] = useState<string[]>([]);\n  const [structureContent, setStructureContent] = useState('No sandbox created yet');\n  const [promptInput, setPromptInput] = useState('');\n  const [chatMessages, setChatMessages] = useState<ChatMessage[]>([\n    {\n      content: 'Welcome! I can help you generate code with full context of your sandbox files and structure. Just start chatting - I\\'ll automatically create a sandbox for you if needed!\\n\\nTip: If you see package errors like \"react-router-dom not found\", just type \"npm install\" or \"check packages\" to automatically install missing packages.',\n      type: 'system',\n      timestamp: new Date()\n    }\n  ]);\n  const [aiChatInput, setAiChatInput] = useState('');\n  const [aiEnabled] = useState(true);\n  const searchParams = useSearchParams();\n  const router = useRouter();\n  const [aiModel, setAiModel] = useState(() => {\n    const modelParam = searchParams.get('model');\n    return appConfig.ai.availableModels.includes(modelParam || '') ? modelParam! : appConfig.ai.defaultModel;\n  });\n  const [urlOverlayVisible, setUrlOverlayVisible] = useState(false);\n  const [urlInput, setUrlInput] = useState('');\n  const [urlStatus, setUrlStatus] = useState<string[]>([]);\n  const [showHomeScreen, setShowHomeScreen] = useState(true);\n  const [expandedFolders, setExpandedFolders] = useState<Set<string>>(new Set(['app', 'src', 'src/components']));\n  const [selectedFile, setSelectedFile] = useState<string | null>(null);\n  const [homeScreenFading, setHomeScreenFading] = useState(false);\n  const [homeUrlInput, setHomeUrlInput] = useState('');\n  const [homeContextInput, setHomeContextInput] = useState('');\n  const [activeTab, setActiveTab] = useState<'generation' | 'preview'>('preview');\n  const [showStyleSelector, setShowStyleSelector] = useState(false);\n  const [selectedStyle, setSelectedStyle] = useState<string | null>(null);\n  const [showLoadingBackground, setShowLoadingBackground] = useState(false);\n  const [urlScreenshot, setUrlScreenshot] = useState<string | null>(null);\n  const [isScreenshotLoaded, setIsScreenshotLoaded] = useState(false);\n  const [isCapturingScreenshot, setIsCapturingScreenshot] = useState(false);\n  const [screenshotError, setScreenshotError] = useState<string | null>(null);\n  const [isPreparingDesign, setIsPreparingDesign] = useState(false);\n  const [targetUrl, setTargetUrl] = useState<string>('');\n  const [sidebarScrolled, setSidebarScrolled] = useState(false);\n  const [screenshotCollapsed, setScreenshotCollapsed] = useState(false);\n  const [loadingStage, setLoadingStage] = useState<'gathering' | 'planning' | 'generating' | null>(null);\n  const [isStartingNewGeneration, setIsStartingNewGeneration] = useState(false);\n  const [sandboxFiles, setSandboxFiles] = useState<Record<string, string>>({});\n  const [hasInitialSubmission, setHasInitialSubmission] = useState<boolean>(false);\n  const [fileStructure, setFileStructure] = useState<string>('');\n  \n  const [conversationContext, setConversationContext] = useState<{\n    scrapedWebsites: Array<{ url: string; content: any; timestamp: Date }>;\n    generatedComponents: Array<{ name: string; path: string; content: string }>;\n    appliedCode: Array<{ files: string[]; timestamp: Date }>;\n    currentProject: string;\n    lastGeneratedCode?: string;\n  }>({\n    scrapedWebsites: [],\n    generatedComponents: [],\n    appliedCode: [],\n    currentProject: '',\n    lastGeneratedCode: undefined\n  });\n  \n  const iframeRef = useRef<HTMLIFrameElement>(null);\n  const chatMessagesRef = useRef<HTMLDivElement>(null);\n  const codeDisplayRef = useRef<HTMLDivElement>(null);\n  \n  const [codeApplicationState, setCodeApplicationState] = useState<CodeApplicationState>({\n    stage: null\n  });\n  \n  const [generationProgress, setGenerationProgress] = useState<{\n    isGenerating: boolean;\n    status: string;\n    components: Array<{ name: string; path: string; completed: boolean }>;\n    currentComponent: number;\n    streamedCode: string;\n    isStreaming: boolean;\n    isThinking: boolean;\n    thinkingText?: string;\n    thinkingDuration?: number;\n    currentFile?: { path: string; content: string; type: string };\n    files: Array<{ path: string; content: string; type: string; completed: boolean; edited?: boolean }>;\n    lastProcessedPosition: number;\n    isEdit?: boolean;\n  }>({\n    isGenerating: false,\n    status: '',\n    components: [],\n    currentComponent: 0,\n    streamedCode: '',\n    isStreaming: false,\n    isThinking: false,\n    files: [],\n    lastProcessedPosition: 0\n  });\n\n  // Store flag to trigger generation after component mounts\n  const [shouldAutoGenerate, setShouldAutoGenerate] = useState(false);\n\n  // Clear old conversation data on component mount and create/restore sandbox\n  useEffect(() => {\n    let isMounted = true;\n    let sandboxCreated = false; // Track if sandbox was created in this effect\n\n    const initializePage = async () => {\n      // Prevent double execution in React StrictMode\n      if (sandboxCreated) return;\n      \n      // First check URL parameters (from home page navigation)\n      const urlParam = searchParams.get('url');\n      const templateParam = searchParams.get('template');\n      const detailsParam = searchParams.get('details');\n      \n      // Then check session storage as fallback\n      const storedUrl = urlParam || sessionStorage.getItem('targetUrl');\n      const storedStyle = templateParam || sessionStorage.getItem('selectedStyle');\n      const storedModel = sessionStorage.getItem('selectedModel');\n      const storedInstructions = sessionStorage.getItem('additionalInstructions');\n      \n      if (storedUrl) {\n        // Mark that we have an initial submission since we're loading with a URL\n        setHasInitialSubmission(true);\n        \n        // Clear sessionStorage after reading  \n        sessionStorage.removeItem('targetUrl');\n        sessionStorage.removeItem('selectedStyle');\n        sessionStorage.removeItem('selectedModel');\n        sessionStorage.removeItem('additionalInstructions');\n        // Note: Don't clear siteMarkdown here, it will be cleared when used\n        \n        // Set the values in the component state\n        setHomeUrlInput(storedUrl);\n        setSelectedStyle(storedStyle || 'modern');\n        \n        // Add details to context if provided\n        if (detailsParam) {\n          setHomeContextInput(detailsParam);\n        } else if (storedStyle && !urlParam) {\n          // Only apply stored style if no screenshot URL is provided\n          // This prevents unwanted style inheritance when using screenshot search\n          const styleNames: Record<string, string> = {\n            '1': 'Glassmorphism',\n            '2': 'Neumorphism',\n            '3': 'Brutalism',\n            '4': 'Minimalist',\n            '5': 'Dark Mode',\n            '6': 'Gradient Rich',\n            '7': '3D Depth',\n            '8': 'Retro Wave',\n            'modern': 'Modern clean and minimalist',\n            'playful': 'Fun colorful and playful',\n            'professional': 'Corporate professional and sleek',\n            'artistic': 'Creative artistic and unique'\n          };\n          const styleName = styleNames[storedStyle] || storedStyle;\n          let contextString = `${styleName} style design`;\n          \n          // Add additional instructions if provided\n          if (storedInstructions) {\n            contextString += `. ${storedInstructions}`;\n          }\n          \n          setHomeContextInput(contextString);\n        } else if (storedInstructions && !urlParam) {\n          // Apply only instructions if no style but instructions are provided\n          // and no screenshot URL is provided\n          setHomeContextInput(storedInstructions);\n        }\n        \n        if (storedModel) {\n          setAiModel(storedModel);\n        }\n        \n        // Skip the home screen and go directly to builder\n        setShowHomeScreen(false);\n        setHomeScreenFading(false);\n        \n        // Set flag to auto-trigger generation after component updates\n        setShouldAutoGenerate(true);\n        \n        // Also set autoStart flag for the effect\n        sessionStorage.setItem('autoStart', 'true');\n      }\n      \n      // Clear old conversation\n      try {\n        await fetch('/api/conversation-state', {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          body: JSON.stringify({ action: 'clear-old' })\n        });\n        console.log('[home] Cleared old conversation data on mount');\n      } catch (error) {\n        console.error('[ai-sandbox] Failed to clear old conversation:', error);\n        if (isMounted) {\n          addChatMessage('Failed to clear old conversation data.', 'error');\n        }\n      }\n      \n      if (!isMounted) return;\n\n      // Check if sandbox ID is in URL\n      const sandboxIdParam = searchParams.get('sandbox');\n      \n      setLoading(true);\n      try {\n        if (sandboxIdParam) {\n          console.log('[home] Attempting to restore sandbox:', sandboxIdParam);\n          // For now, just create a new sandbox - you could enhance this to actually restore\n          // the specific sandbox if your backend supports it\n          sandboxCreated = true;\n          await createSandbox(true);\n        } else {\n          console.log('[home] No sandbox in URL, creating new sandbox automatically...');\n          sandboxCreated = true;\n          await createSandbox(true);\n        }\n        \n        // If we have a URL from the home page, mark for automatic start\n        if (storedUrl && isMounted) {\n          // We'll trigger the generation after the component is fully mounted\n          // and the startGeneration function is defined\n          sessionStorage.setItem('autoStart', 'true');\n        }\n      } catch (error) {\n        console.error('[ai-sandbox] Failed to create or restore sandbox:', error);\n        if (isMounted) {\n          addChatMessage('Failed to create or restore sandbox.', 'error');\n        }\n      } finally {\n        if (isMounted) {\n          setLoading(false);\n        }\n      }\n    };\n    \n    initializePage();\n\n    return () => {\n      isMounted = false;\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []); // Run only on mount\n  \n  useEffect(() => {\n    // Handle Escape key for home screen\n    const handleKeyDown = (e: KeyboardEvent) => {\n      if (e.key === 'Escape' && showHomeScreen) {\n        setHomeScreenFading(true);\n        setTimeout(() => {\n          setShowHomeScreen(false);\n          setHomeScreenFading(false);\n        }, 500);\n      }\n    };\n    \n    window.addEventListener('keydown', handleKeyDown);\n    return () => window.removeEventListener('keydown', handleKeyDown);\n  }, [showHomeScreen]);\n  \n  // Start capturing screenshot if URL is provided on mount (from home screen)\n  useEffect(() => {\n    if (!showHomeScreen && homeUrlInput && !urlScreenshot && !isCapturingScreenshot) {\n      let screenshotUrl = homeUrlInput.trim();\n      if (!screenshotUrl.match(/^https?:\\/\\//i)) {\n        screenshotUrl = 'https://' + screenshotUrl;\n      }\n      captureUrlScreenshot(screenshotUrl);\n    }\n  }, [showHomeScreen, homeUrlInput]); // eslint-disable-line react-hooks/exhaustive-deps\n\n  // Auto-start generation if flagged\n  useEffect(() => {\n    const autoStart = sessionStorage.getItem('autoStart');\n    if (autoStart === 'true' && !showHomeScreen && homeUrlInput) {\n      sessionStorage.removeItem('autoStart');\n      // Small delay to ensure everything is ready\n      setTimeout(() => {\n        console.log('[generation] Auto-starting generation for URL:', homeUrlInput);\n        startGeneration();\n      }, 1000);\n    }\n  }, [showHomeScreen, homeUrlInput]); // eslint-disable-line react-hooks/exhaustive-deps\n\n\n  useEffect(() => {\n    // Only check sandbox status on mount if we don't already have sandboxData\n    // AND we're not auto-starting a new generation (which would create a new sandbox)\n    const autoStart = sessionStorage.getItem('autoStart');\n    if (!sandboxData && autoStart !== 'true') {\n      checkSandboxStatus();\n    }\n  }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n  useEffect(() => {\n    if (chatMessagesRef.current) {\n      chatMessagesRef.current.scrollTop = chatMessagesRef.current.scrollHeight;\n    }\n  }, [chatMessages]);\n\n  // Auto-trigger generation when flag is set (from home page navigation)\n  useEffect(() => {\n    if (shouldAutoGenerate && homeUrlInput && !showHomeScreen) {\n      // Reset the flag\n      setShouldAutoGenerate(false);\n      \n      // Trigger generation after a short delay to ensure everything is set up\n      const timer = setTimeout(() => {\n        console.log('[generation] Auto-triggering generation from URL params');\n        startGeneration();\n      }, 1000);\n      \n      return () => clearTimeout(timer);\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [shouldAutoGenerate, homeUrlInput, showHomeScreen]);\n\n  const updateStatus = (text: string, active: boolean) => {\n    setStatus({ text, active });\n  };\n\n  const log = (message: string, type: 'info' | 'error' | 'command' = 'info') => {\n    setResponseArea(prev => [...prev, `[${type}] ${message}`]);\n  };\n\n  const addChatMessage = (content: string, type: ChatMessage['type'], metadata?: ChatMessage['metadata']) => {\n    setChatMessages(prev => {\n      // Skip duplicate consecutive system messages\n      if (type === 'system' && prev.length > 0) {\n        const lastMessage = prev[prev.length - 1];\n        if (lastMessage.type === 'system' && lastMessage.content === content) {\n          return prev; // Skip duplicate\n        }\n      }\n      return [...prev, { content, type, timestamp: new Date(), metadata }];\n    });\n  };\n  \n  const checkAndInstallPackages = async () => {\n    // This function is only called when user explicitly requests it\n    // Don't show error if no sandbox - it's likely being created\n    if (!sandboxData) {\n      console.log('[checkAndInstallPackages] No sandbox data available yet');\n      return;\n    }\n    \n    // Vite error checking removed - handled by template setup\n    addChatMessage('Checking packages... Sandbox is ready with Vite configuration.', 'system');\n  };\n  \n  const handleSurfaceError = (_errors: any[]) => {\n    // Function kept for compatibility but Vite errors are now handled by template\n    \n    // Focus the input\n    const textarea = document.querySelector('textarea') as HTMLTextAreaElement;\n    if (textarea) {\n      textarea.focus();\n    }\n  };\n  \n  const installPackages = async (packages: string[]) => {\n    if (!sandboxData) {\n      addChatMessage('No active sandbox. Create a sandbox first!', 'system');\n      return;\n    }\n    \n    try {\n      const response = await fetch('/api/install-packages', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({ packages })\n      });\n      \n      if (!response.ok) {\n        throw new Error(`Failed to install packages: ${response.statusText}`);\n      }\n      \n      const reader = response.body?.getReader();\n      const decoder = new TextDecoder();\n      \n      while (reader) {\n        const { done, value } = await reader.read();\n        if (done) break;\n        \n        const chunk = decoder.decode(value);\n        const lines = chunk.split('\\n');\n        \n        for (const line of lines) {\n          if (line.startsWith('data: ')) {\n            try {\n              const data = JSON.parse(line.slice(6));\n              \n              switch (data.type) {\n                case 'command':\n                  // Don't show npm install commands - they're handled by info messages\n                  if (!data.command.includes('npm install')) {\n                    addChatMessage(data.command, 'command', { commandType: 'input' });\n                  }\n                  break;\n                case 'output':\n                  addChatMessage(data.message, 'command', { commandType: 'output' });\n                  break;\n                case 'error':\n                  if (data.message && data.message !== 'undefined') {\n                    addChatMessage(data.message, 'command', { commandType: 'error' });\n                  }\n                  break;\n                case 'warning':\n                  addChatMessage(data.message, 'command', { commandType: 'output' });\n                  break;\n                case 'success':\n                  addChatMessage(`${data.message}`, 'system');\n                  break;\n                case 'status':\n                  addChatMessage(data.message, 'system');\n                  break;\n              }\n            } catch (e) {\n              console.error('Failed to parse SSE data:', e);\n            }\n          }\n        }\n      }\n    } catch (error: any) {\n      addChatMessage(`Failed to install packages: ${error.message}`, 'system');\n    }\n  };\n\n  const checkSandboxStatus = async () => {\n    try {\n      const response = await fetch('/api/sandbox-status');\n      const data = await response.json();\n      \n      if (data.active && data.healthy && data.sandboxData) {\n        console.log('[checkSandboxStatus] Setting sandboxData from API:', data.sandboxData);\n        setSandboxData(data.sandboxData);\n        updateStatus('Sandbox active', true);\n      } else if (data.active && !data.healthy) {\n        // Sandbox exists but not responding\n        updateStatus('Sandbox not responding', false);\n        // Keep existing sandboxData if we have it - don't clear it\n      } else {\n        // Only clear sandboxData if we don't already have it or if we're explicitly checking from a fresh state\n        // This prevents clearing sandboxData during normal operation when it should persist\n        if (!sandboxData) {\n          console.log('[checkSandboxStatus] No existing sandboxData, clearing state');\n          setSandboxData(null);\n          updateStatus('No sandbox', false);\n        } else {\n          // Keep existing sandboxData and just update status\n          console.log('[checkSandboxStatus] Keeping existing sandboxData, sandbox inactive but data preserved');\n          updateStatus('Sandbox status unknown', false);\n        }\n      }\n    } catch (error) {\n      console.error('Failed to check sandbox status:', error);\n      // Only clear on error if we don't have existing sandboxData\n      if (!sandboxData) {\n        setSandboxData(null);\n        updateStatus('Error', false);\n      } else {\n        updateStatus('Status check failed', false);\n      }\n    }\n  };\n\n  const sandboxCreationRef = useRef<boolean>(false);\n  \n  const createSandbox = async (fromHomeScreen = false) => {\n    // Prevent duplicate sandbox creation\n    if (sandboxCreationRef.current) {\n      console.log('[createSandbox] Sandbox creation already in progress, skipping...');\n      return null;\n    }\n    \n    sandboxCreationRef.current = true;\n    console.log('[createSandbox] Starting sandbox creation...');\n    setLoading(true);\n    setShowLoadingBackground(true);\n    updateStatus('Creating sandbox...', false);\n    setResponseArea([]);\n    setScreenshotError(null);\n    \n    try {\n      const response = await fetch('/api/create-ai-sandbox-v2', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({})\n      });\n      \n      const data = await response.json();\n      console.log('[createSandbox] Response data:', data);\n      \n      if (data.success) {\n        sandboxCreationRef.current = false; // Reset the ref on success\n        console.log('[createSandbox] Setting sandboxData from creation:', data);\n        setSandboxData(data);\n        updateStatus('Sandbox active', true);\n        log('Sandbox created successfully!');\n        log(`Sandbox ID: ${data.sandboxId}`);\n        log(`URL: ${data.url}`);\n        \n        // Update URL with sandbox ID\n        const newParams = new URLSearchParams(searchParams.toString());\n        newParams.set('sandbox', data.sandboxId);\n        newParams.set('model', aiModel);\n        router.push(`/generation?${newParams.toString()}`, { scroll: false });\n        \n        // Fade out loading background after sandbox loads\n        setTimeout(() => {\n          setShowLoadingBackground(false);\n        }, 3000);\n        \n        if (data.structure) {\n          displayStructure(data.structure);\n        }\n        \n        // Fetch sandbox files after creation\n        setTimeout(fetchSandboxFiles, 1000);\n        \n        // For Vercel sandboxes, Vite is already started during setupViteApp\n        // No need to restart it immediately after creation\n        // Only restart if there's an actual issue later\n        console.log('[createSandbox] Sandbox ready with Vite server running');\n        \n        // Only add welcome message if not coming from home screen\n        if (!fromHomeScreen) {\n          addChatMessage(`Sandbox created! ID: ${data.sandboxId}. I now have context of your sandbox and can help you build your app. Just ask me to create components and I'll automatically apply them!\n\nTip: I automatically detect and install npm packages from your code imports (like react-router-dom, axios, etc.)`, 'system');\n        }\n        \n        setTimeout(() => {\n          if (iframeRef.current) {\n            iframeRef.current.src = data.url;\n          }\n        }, 100);\n        \n        // Return the sandbox data so it can be used immediately\n        return data;\n      } else {\n        throw new Error(data.error || 'Unknown error');\n      }\n    } catch (error: any) {\n      console.error('[createSandbox] Error:', error);\n      updateStatus('Error', false);\n      log(`Failed to create sandbox: ${error.message}`, 'error');\n      addChatMessage(`Failed to create sandbox: ${error.message}`, 'system');\n      throw error;\n    } finally {\n      setLoading(false);\n      sandboxCreationRef.current = false; // Reset the ref\n    }\n  };\n\n  const displayStructure = (structure: any) => {\n    if (typeof structure === 'object') {\n      setStructureContent(JSON.stringify(structure, null, 2));\n    } else {\n      setStructureContent(structure || 'No structure available');\n    }\n  };\n\n  const applyGeneratedCode = async (code: string, isEdit: boolean = false, overrideSandboxData?: SandboxData) => {\n    setLoading(true);\n    log('Applying AI-generated code...');\n    \n    try {\n      // Show progress component instead of individual messages\n      setCodeApplicationState({ stage: 'analyzing' });\n      \n      // Get pending packages from tool calls\n      const pendingPackages = ((window as any).pendingPackages || []).filter((pkg: any) => pkg && typeof pkg === 'string');\n      if (pendingPackages.length > 0) {\n        console.log('[applyGeneratedCode] Sending packages from tool calls:', pendingPackages);\n        // Clear pending packages after use\n        (window as any).pendingPackages = [];\n      }\n      \n      // Use streaming endpoint for real-time feedback\n      const effectiveSandboxData = overrideSandboxData || sandboxData;\n      const response = await fetch('/api/apply-ai-code-stream', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({ \n          response: code,\n          isEdit: isEdit,\n          packages: pendingPackages,\n          sandboxId: effectiveSandboxData?.sandboxId // Pass the sandbox ID to ensure proper connection\n        })\n      });\n      \n      if (!response.ok) {\n        throw new Error(`Failed to apply code: ${response.statusText}`);\n      }\n      \n      // Handle streaming response\n      const reader = response.body?.getReader();\n      const decoder = new TextDecoder();\n      let finalData: any = null;\n      \n      while (reader) {\n        const { done, value } = await reader.read();\n        if (done) break;\n        \n        const chunk = decoder.decode(value);\n        const lines = chunk.split('\\n');\n        \n        for (const line of lines) {\n          if (line.startsWith('data: ')) {\n            try {\n              const data = JSON.parse(line.slice(6));\n              \n              switch (data.type) {\n                case 'start':\n                  // Don't add as chat message, just update state\n                  setCodeApplicationState({ stage: 'analyzing' });\n                  break;\n                  \n                case 'step':\n                  // Update progress state based on step\n                  if (data.message.includes('Installing') && data.packages) {\n                    setCodeApplicationState({ \n                      stage: 'installing', \n                      packages: data.packages \n                    });\n                  } else if (data.message.includes('Creating files') || data.message.includes('Applying')) {\n                    setCodeApplicationState({ \n                      stage: 'applying',\n                      filesGenerated: [] // Files will be populated when complete\n                    });\n                  }\n                  break;\n                  \n                case 'package-progress':\n                  // Handle package installation progress\n                  if (data.installedPackages) {\n                    setCodeApplicationState(prev => ({ \n                      ...prev,\n                      installedPackages: data.installedPackages \n                    }));\n                  }\n                  break;\n                  \n                case 'command':\n                  // Don't show npm install commands - they're handled by info messages\n                  if (data.command && !data.command.includes('npm install')) {\n                    addChatMessage(data.command, 'command', { commandType: 'input' });\n                  }\n                  break;\n                  \n                case 'success':\n                  if (data.installedPackages) {\n                    setCodeApplicationState(prev => ({ \n                      ...prev,\n                      installedPackages: data.installedPackages \n                    }));\n                  }\n                  break;\n                  \n                case 'file-progress':\n                  // Skip file progress messages, they're noisy\n                  break;\n                  \n                case 'file-complete':\n                  // Could add individual file completion messages if desired\n                  break;\n                  \n                case 'command-progress':\n                  addChatMessage(`${data.action} command: ${data.command}`, 'command', { commandType: 'input' });\n                  break;\n                  \n                case 'command-output':\n                  addChatMessage(data.output, 'command', { \n                    commandType: data.stream === 'stderr' ? 'error' : 'output' \n                  });\n                  break;\n                  \n                case 'command-complete':\n                  if (data.success) {\n                    addChatMessage(`Command completed successfully`, 'system');\n                  } else {\n                    addChatMessage(`Command failed with exit code ${data.exitCode}`, 'system');\n                  }\n                  break;\n                  \n                case 'complete':\n                  finalData = data;\n                  setCodeApplicationState({ stage: 'complete' });\n                  // Clear the state after a delay\n                  setTimeout(() => {\n                    setCodeApplicationState({ stage: null });\n                  }, 3000);\n                  // Reset loading state when complete\n                  setLoading(false);\n                  break;\n                  \n                case 'error':\n                  addChatMessage(`Error: ${data.message || data.error || 'Unknown error'}`, 'system');\n                  // Reset loading state on error\n                  setLoading(false);\n                  break;\n                  \n                case 'warning':\n                  addChatMessage(`${data.message}`, 'system');\n                  break;\n                  \n                case 'info':\n                  // Show info messages, especially for package installation\n                  if (data.message) {\n                    addChatMessage(data.message, 'system');\n                  }\n                  break;\n              }\n            } catch {\n              // Ignore parse errors\n            }\n          }\n        }\n      }\n      \n      // Process final data\n      if (finalData && finalData.type === 'complete') {\n        const data: any = {\n          success: true,\n          results: finalData.results,\n          explanation: finalData.explanation,\n          structure: finalData.structure,\n          message: finalData.message,\n          autoCompleted: finalData.autoCompleted,\n          autoCompletedComponents: finalData.autoCompletedComponents,\n          warning: finalData.warning,\n          missingImports: finalData.missingImports,\n          debug: finalData.debug\n        };\n        \n        if (data.success) {\n          const { results } = data;\n        \n        // Log package installation results without duplicate messages\n        if (results.packagesInstalled?.length > 0) {\n          log(`Packages installed: ${results.packagesInstalled.join(', ')}`);\n        }\n        \n        if (results.filesCreated?.length > 0) {\n          log('Files created:');\n          results.filesCreated.forEach((file: string) => {\n            log(`  ${file}`, 'command');\n          });\n          \n          // Verify files were actually created by refreshing the sandbox if needed\n          if (sandboxData?.sandboxId && results.filesCreated.length > 0) {\n            // Small delay to ensure files are written\n            setTimeout(() => {\n              // Force refresh the iframe to show new files\n              if (iframeRef.current) {\n                iframeRef.current.src = iframeRef.current.src;\n              }\n            }, 1000);\n          }\n        }\n        \n        if (results.filesUpdated?.length > 0) {\n          log('Files updated:');\n          results.filesUpdated.forEach((file: string) => {\n            log(`  ${file}`, 'command');\n          });\n        }\n        \n        // Update conversation context with applied code\n        setConversationContext(prev => ({\n          ...prev,\n          appliedCode: [...prev.appliedCode, {\n            files: [...(results.filesCreated || []), ...(results.filesUpdated || [])],\n            timestamp: new Date()\n          }]\n        }));\n        \n        if (results.commandsExecuted?.length > 0) {\n          log('Commands executed:');\n          results.commandsExecuted.forEach((cmd: string) => {\n            log(`  $ ${cmd}`, 'command');\n          });\n        }\n        \n        if (results.errors?.length > 0) {\n          results.errors.forEach((err: string) => {\n            log(err, 'error');\n          });\n        }\n        \n        if (data.structure) {\n          displayStructure(data.structure);\n        }\n        \n        if (data.explanation) {\n          log(data.explanation);\n        }\n        \n        if (data.autoCompleted) {\n          log('Auto-generating missing components...', 'command');\n          \n          if (data.autoCompletedComponents) {\n            setTimeout(() => {\n              log('Auto-generated missing components:', 'info');\n              data.autoCompletedComponents.forEach((comp: string) => {\n                log(`  ${comp}`, 'command');\n              });\n            }, 1000);\n          }\n        } else if (data.warning) {\n          log(data.warning, 'error');\n          \n          if (data.missingImports && data.missingImports.length > 0) {\n            const missingList = data.missingImports.join(', ');\n            addChatMessage(\n              `Ask me to \"create the missing components: ${missingList}\" to fix these import errors.`,\n              'system'\n            );\n          }\n        }\n        \n        log('Code applied successfully!');\n        console.log('[applyGeneratedCode] Response data:', data);\n        console.log('[applyGeneratedCode] Debug info:', data.debug);\n        console.log('[applyGeneratedCode] Current sandboxData:', sandboxData);\n        console.log('[applyGeneratedCode] Current iframe element:', iframeRef.current);\n        console.log('[applyGeneratedCode] Current iframe src:', iframeRef.current?.src);\n        \n        // Set applying code state for edits to show loading overlay\n        // Removed overlay - changes apply directly\n        \n        if (results.filesCreated?.length > 0) {\n          setConversationContext(prev => ({\n            ...prev,\n            appliedCode: [...prev.appliedCode, {\n              files: results.filesCreated,\n              timestamp: new Date()\n            }]\n          }));\n          \n          // Update the chat message to show success\n          // Only show file list if not in edit mode\n          if (isEdit) {\n            addChatMessage(`Edit applied successfully!`, 'system');\n          } else {\n            // Check if this is part of a generation flow (has recent AI recreation message)\n            const recentMessages = chatMessages.slice(-5);\n            const isPartOfGeneration = recentMessages.some(m => \n              m.content.includes('AI recreation generated') || \n              m.content.includes('Code generated')\n            );\n            \n            // Don't show files if part of generation flow to avoid duplication\n            if (isPartOfGeneration) {\n              addChatMessage(`Applied ${results.filesCreated.length} files successfully!`, 'system');\n            } else {\n              addChatMessage(`Applied ${results.filesCreated.length} files successfully!`, 'system', {\n                appliedFiles: results.filesCreated\n              });\n            }\n          }\n          \n          // If there are failed packages, add a message about checking for errors\n          if (results.packagesFailed?.length > 0) {\n            addChatMessage(`⚠️ Some packages failed to install. Check the error banner above for details.`, 'system');\n          }\n          \n          // Fetch updated file structure\n          await fetchSandboxFiles();\n          \n          // Skip automatic package check - it's not needed here and can cause false \"no sandbox\" messages\n          // Packages are already installed during the apply-ai-code-stream process\n          \n          // Test build to ensure everything compiles correctly\n          // Skip build test for now - it's causing errors with undefined activeSandbox\n          // The build test was trying to access global.activeSandbox from the frontend,\n          // but that's only available in the backend API routes\n          console.log('[build-test] Skipping build test - would need API endpoint');\n          \n          // Force iframe refresh after applying code\n          const refreshDelay = appConfig.codeApplication.defaultRefreshDelay; // Allow Vite to process changes\n          \n          setTimeout(() => {\n            const currentSandboxData = effectiveSandboxData;\n            if (iframeRef.current && currentSandboxData?.url) {\n              console.log('[home] Refreshing iframe after code application...');\n              \n              // Method 1: Change src with timestamp\n              const urlWithTimestamp = `${currentSandboxData.url}?t=${Date.now()}&applied=true`;\n              iframeRef.current.src = urlWithTimestamp;\n              \n              // Method 2: Force reload after a short delay\n              setTimeout(() => {\n                try {\n                  if (iframeRef.current?.contentWindow) {\n                    iframeRef.current.contentWindow.location.reload();\n                    console.log('[home] Force reloaded iframe content');\n                  }\n                } catch (e) {\n                  console.log('[home] Could not reload iframe (cross-origin):', e);\n                }\n                // Reload completed\n              }, 1000);\n            }\n          }, refreshDelay);\n          \n          // Vite error checking removed - handled by template setup\n        }\n        \n          // Give Vite HMR a moment to detect changes, then ensure refresh\n          const currentSandboxData = effectiveSandboxData;\n          if (iframeRef.current && currentSandboxData?.url) {\n            // Wait for Vite to process the file changes\n            // If packages were installed, wait longer for Vite to restart\n            const packagesInstalled = results?.packagesInstalled?.length > 0 || data.results?.packagesInstalled?.length > 0;\n            const refreshDelay = packagesInstalled ? appConfig.codeApplication.packageInstallRefreshDelay : appConfig.codeApplication.defaultRefreshDelay;\n            console.log(`[applyGeneratedCode] Packages installed: ${packagesInstalled}, refresh delay: ${refreshDelay}ms`);\n            \n            setTimeout(async () => {\n            if (iframeRef.current && currentSandboxData?.url) {\n              console.log('[applyGeneratedCode] Starting iframe refresh sequence...');\n              console.log('[applyGeneratedCode] Current iframe src:', iframeRef.current.src);\n              console.log('[applyGeneratedCode] Sandbox URL:', currentSandboxData.url);\n              \n              // Method 1: Try direct navigation first\n              try {\n                const urlWithTimestamp = `${currentSandboxData.url}?t=${Date.now()}&force=true`;\n                console.log('[applyGeneratedCode] Attempting direct navigation to:', urlWithTimestamp);\n                \n                // Remove any existing onload handler\n                iframeRef.current.onload = null;\n                \n                // Navigate directly\n                iframeRef.current.src = urlWithTimestamp;\n                \n                // Wait a bit and check if it loaded\n                await new Promise(resolve => setTimeout(resolve, 2000));\n                \n                // Try to access the iframe content to verify it loaded\n                try {\n                  const iframeDoc = iframeRef.current.contentDocument || iframeRef.current.contentWindow?.document;\n                  if (iframeDoc && iframeDoc.readyState === 'complete') {\n                    console.log('[applyGeneratedCode] Iframe loaded successfully');\n                    return;\n                  }\n                } catch {\n                  console.log('[applyGeneratedCode] Cannot access iframe content (CORS), assuming loaded');\n                  return;\n                }\n              } catch (e) {\n                console.error('[applyGeneratedCode] Direct navigation failed:', e);\n              }\n              \n              // Method 2: Force complete iframe recreation if direct navigation failed\n              console.log('[applyGeneratedCode] Falling back to iframe recreation...');\n              const parent = iframeRef.current.parentElement;\n              const newIframe = document.createElement('iframe');\n              \n              // Copy attributes\n              newIframe.className = iframeRef.current.className;\n              newIframe.title = iframeRef.current.title;\n              newIframe.allow = iframeRef.current.allow;\n              // Copy sandbox attributes\n              const sandboxValue = iframeRef.current.getAttribute('sandbox');\n              if (sandboxValue) {\n                newIframe.setAttribute('sandbox', sandboxValue);\n              }\n              \n              // Remove old iframe\n              iframeRef.current.remove();\n              \n              // Add new iframe\n              newIframe.src = `${currentSandboxData.url}?t=${Date.now()}&recreated=true`;\n              parent?.appendChild(newIframe);\n              \n              // Update ref\n              (iframeRef as any).current = newIframe;\n              \n              console.log('[applyGeneratedCode] Iframe recreated with new content');\n            } else {\n              console.error('[applyGeneratedCode] No iframe or sandbox URL available for refresh');\n            }\n          }, refreshDelay); // Dynamic delay based on whether packages were installed\n        }\n        \n        } else {\n          throw new Error(finalData?.error || 'Failed to apply code');\n        }\n      } else {\n        // If no final data was received, still close loading\n        addChatMessage('Code application may have partially succeeded. Check the preview.', 'system');\n      }\n    } catch (error: any) {\n      log(`Failed to apply code: ${error.message}`, 'error');\n    } finally {\n      setLoading(false);\n      // Clear isEdit flag after applying code\n      setGenerationProgress(prev => ({\n        ...prev,\n        isEdit: false\n      }));\n    }\n  };\n\n  const fetchSandboxFiles = async () => {\n    if (!sandboxData) return;\n    \n    try {\n      const response = await fetch('/api/get-sandbox-files', {\n        method: 'GET',\n        headers: {\n          'Content-Type': 'application/json',\n        }\n      });\n      \n      if (response.ok) {\n        const data = await response.json();\n        if (data.success) {\n          setSandboxFiles(data.files || {});\n          setFileStructure(data.structure || '');\n          console.log('[fetchSandboxFiles] Updated file list:', Object.keys(data.files || {}).length, 'files');\n        }\n      }\n    } catch (error) {\n      console.error('[fetchSandboxFiles] Error fetching files:', error);\n    }\n  };\n  \n//   const restartViteServer = async () => {\n//     try {\n//       addChatMessage('Restarting Vite dev server...', 'system');\n//       \n//       const response = await fetch('/api/restart-vite', {\n//         method: 'POST',\n//         headers: { 'Content-Type': 'application/json' }\n//       });\n//       \n//       if (response.ok) {\n//         const data = await response.json();\n//         if (data.success) {\n//           addChatMessage('✓ Vite dev server restarted successfully!', 'system');\n//           \n//           // Refresh the iframe after a short delay\n//           setTimeout(() => {\n//             if (iframeRef.current && sandboxData?.url) {\n//               iframeRef.current.src = `${sandboxData.url}?t=${Date.now()}`;\n//             }\n//           }, 2000);\n//         } else {\n//           addChatMessage(`Failed to restart Vite: ${data.error}`, 'error');\n//         }\n//       } else {\n//         addChatMessage('Failed to restart Vite server', 'error');\n//       }\n//     } catch (error) {\n//       console.error('[restartViteServer] Error:', error);\n//       addChatMessage(`Error restarting Vite: ${error instanceof Error ? error.message : 'Unknown error'}`, 'error');\n//     }\n//   };\n\n//   const applyCode = async () => {\n//     const code = promptInput.trim();\n//     if (!code) {\n//       log('Please enter some code first', 'error');\n//       addChatMessage('No code to apply. Please generate code first.', 'system');\n//       return;\n//     }\n//     \n//     // Prevent double clicks\n//     if (loading) {\n//       console.log('[applyCode] Already loading, skipping...');\n//       return;\n//     }\n//     \n//     // Determine if this is an edit based on whether we have applied code before\n//     const isEdit = conversationContext.appliedCode.length > 0;\n//     await applyGeneratedCode(code, isEdit);\n//   };\n\n  const renderMainContent = () => {\n    if (activeTab === 'generation' && (generationProgress.isGenerating || generationProgress.files.length > 0)) {\n      return (\n        /* Generation Tab Content */\n        <div className=\"absolute inset-0 flex overflow-hidden\">\n          {/* File Explorer - Hide during edits */}\n          {!generationProgress.isEdit && (\n            <div className=\"w-[250px] border-r border-gray-200 bg-white flex flex-col flex-shrink-0\">\n            <div className=\"p-4 bg-gray-100 text-gray-900 flex items-center justify-between\">\n              <div className=\"flex items-center gap-2\">\n                <BsFolderFill style={{ width: '16px', height: '16px' }} />\n                <span className=\"text-sm font-medium\">Explorer</span>\n              </div>\n            </div>\n            \n            {/* File Tree */}\n            <div className=\"flex-1 overflow-y-auto p-4 scrollbar-hide\">\n              <div className=\"text-sm\">\n                {/* Root app folder */}\n                <div \n                  className=\"flex items-center gap-2 py-0.5 px-3 hover:bg-gray-100 rounded cursor-pointer text-gray-700\"\n                  onClick={() => toggleFolder('app')}\n                >\n                  {expandedFolders.has('app') ? (\n                    <FiChevronDown style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />\n                  ) : (\n                    <FiChevronRight style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />\n                  )}\n                  {expandedFolders.has('app') ? (\n                    <BsFolder2Open style={{ width: '16px', height: '16px' }} className=\"text-blue-500\" />\n                  ) : (\n                    <BsFolderFill style={{ width: '16px', height: '16px' }} className=\"text-blue-500\" />\n                  )}\n                  <span className=\"font-medium text-gray-800\">app</span>\n                </div>\n                \n                {expandedFolders.has('app') && (\n                  <div className=\"ml-6\">\n                    {/* Group files by directory */}\n                    {(() => {\n                      const fileTree: { [key: string]: Array<{ name: string; edited?: boolean }> } = {};\n                      \n                      // Create a map of edited files\n                      // const editedFiles = new Set(\n                      //   generationProgress.files\n                      //     .filter(f => f.edited)\n                      //     .map(f => f.path)\n                      // );\n                      \n                      // Process all files from generation progress\n                      generationProgress.files.forEach(file => {\n                        const parts = file.path.split('/');\n                        const dir = parts.length > 1 ? parts.slice(0, -1).join('/') : '';\n                        const fileName = parts[parts.length - 1];\n                        \n                        if (!fileTree[dir]) fileTree[dir] = [];\n                        fileTree[dir].push({\n                          name: fileName,\n                          edited: file.edited || false\n                        });\n                      });\n                      \n                      return Object.entries(fileTree).map(([dir, files]) => (\n                        <div key={dir} className=\"mb-1\">\n                          {dir && (\n                            <div \n                              className=\"flex items-center gap-2 py-0.5 px-3 hover:bg-gray-100 rounded cursor-pointer text-gray-700\"\n                              onClick={() => toggleFolder(dir)}\n                            >\n                              {expandedFolders.has(dir) ? (\n                                <FiChevronDown style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />\n                              ) : (\n                                <FiChevronRight style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />\n                              )}\n                              {expandedFolders.has(dir) ? (\n                                <BsFolder2Open style={{ width: '16px', height: '16px' }} className=\"text-yellow-600\" />\n                              ) : (\n                                <BsFolderFill style={{ width: '16px', height: '16px' }} className=\"text-yellow-600\" />\n                              )}\n                              <span className=\"text-gray-700\">{dir.split('/').pop()}</span>\n                            </div>\n                          )}\n                          {(!dir || expandedFolders.has(dir)) && (\n                            <div className={dir ? 'ml-8' : ''}>\n                              {files.sort((a, b) => a.name.localeCompare(b.name)).map(fileInfo => {\n                                const fullPath = dir ? `${dir}/${fileInfo.name}` : fileInfo.name;\n                                const isSelected = selectedFile === fullPath;\n                                \n                                return (\n                                  <div \n                                    key={fullPath} \n                                    className={`flex items-center gap-2 py-0.5 px-3 rounded cursor-pointer transition-all ${\n                                      isSelected \n                                        ? 'bg-blue-500 text-white' \n                                        : 'text-gray-700 hover:bg-gray-100'\n                                    }`}\n                                    onClick={() => handleFileClick(fullPath)}\n                                  >\n                                    {getFileIcon(fileInfo.name)}\n                                    <span className={`text-xs flex items-center gap-1 ${isSelected ? 'font-medium' : ''}`}>\n                                      {fileInfo.name}\n                                      {fileInfo.edited && (\n                                        <span className={`text-[10px] px-1 rounded ${\n                                          isSelected ? 'bg-blue-400' : 'bg-orange-500 text-white'\n                                        }`}>✓</span>\n                                      )}\n                                    </span>\n                                  </div>\n                                );\n                              })}\n                            </div>\n                          )}\n                        </div>\n                      ));\n                    })()}\n                  </div>\n                )}\n              </div>\n            </div>\n          </div>\n          )}\n          \n          {/* Code Content */}\n          <div className=\"flex-1 flex flex-col overflow-hidden\">\n            {/* Thinking Mode Display - Only show during active generation */}\n            {generationProgress.isGenerating && (generationProgress.isThinking || generationProgress.thinkingText) && (\n              <div className=\"px-6 pb-6\">\n                <div className=\"flex items-center gap-2 mb-2\">\n                  <div className=\"text-purple-600 font-medium flex items-center gap-2\">\n                    {generationProgress.isThinking ? (\n                      <>\n                        <div className=\"w-3 h-3 bg-purple-600 rounded-full animate-pulse\" />\n                        AI is thinking...\n                      </>\n                    ) : (\n                      <>\n                        <span className=\"text-purple-600\">✓</span>\n                        Thought for {generationProgress.thinkingDuration || 0} seconds\n                      </>\n                    )}\n                  </div>\n                </div>\n                {generationProgress.thinkingText && (\n                  <div className=\"bg-purple-950 border border-purple-700 rounded-lg p-4 max-h-48 overflow-y-auto scrollbar-hide\">\n                    <pre className=\"text-xs font-mono text-purple-300 whitespace-pre-wrap\">\n                      {generationProgress.thinkingText}\n                    </pre>\n                  </div>\n                )}\n              </div>\n            )}\n            \n            {/* Live Code Display */}\n            <div className=\"flex-1 rounded-lg p-6 flex flex-col min-h-0 overflow-hidden\">\n              <div className=\"flex-1 overflow-y-auto min-h-0 scrollbar-hide\" ref={codeDisplayRef}>\n                {/* Show selected file if one is selected */}\n                {selectedFile ? (\n                  <div className=\"animate-in fade-in slide-in-from-top-2 duration-300\">\n                    <div className=\"bg-black border border-gray-200 rounded-lg overflow-hidden shadow-sm\">\n                      <div className=\"px-4 py-2 bg-[#36322F] text-white flex items-center justify-between\">\n                        <div className=\"flex items-center gap-2\">\n                          {getFileIcon(selectedFile)}\n                          <span className=\"font-mono text-sm\">{selectedFile}</span>\n                        </div>\n                        <button\n                          onClick={() => setSelectedFile(null)}\n                          className=\"hover:bg-black/20 p-1 rounded transition-colors\"\n                        >\n                          <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                            <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n                          </svg>\n                        </button>\n                      </div>\n                      <div className=\"bg-gray-900 border border-gray-700 rounded\">\n                        <SyntaxHighlighter\n                          language={(() => {\n                            const ext = selectedFile.split('.').pop()?.toLowerCase();\n                            if (ext === 'css') return 'css';\n                            if (ext === 'json') return 'json';\n                            if (ext === 'html') return 'html';\n                            return 'jsx';\n                          })()}\n                          style={vscDarkPlus}\n                          customStyle={{\n                            margin: 0,\n                            padding: '1rem',\n                            fontSize: '0.875rem',\n                            background: 'transparent',\n                          }}\n                          showLineNumbers={true}\n                        >\n                          {(() => {\n                            // Find the file content from generated files\n                            const file = generationProgress.files.find(f => f.path === selectedFile);\n                            return file?.content || '// File content will appear here';\n                          })()}\n                        </SyntaxHighlighter>\n                      </div>\n                    </div>\n                  </div>\n                ) : /* If no files parsed yet, show loading or raw stream */\n                generationProgress.files.length === 0 && !generationProgress.currentFile ? (\n                  generationProgress.isThinking ? (\n                    // Beautiful loading state while thinking\n                    <div className=\"flex items-center justify-center h-full\">\n                      <div className=\"text-center\">\n                        <div className=\"mb-8 relative\">\n                          <div className=\"w-48 h-48 mx-auto\">\n                            <div className=\"absolute inset-0 border-8 border-gray-800 rounded-full\"></div>\n                            <div className=\"absolute inset-0 border-8 border-green-500 rounded-full animate-spin border-t-transparent\"></div>\n                          </div>\n                        </div>\n                        <h3 className=\"text-xl font-medium text-white mb-2\">AI is analyzing your request</h3>\n                        <p className=\"text-gray-400 text-sm\">{generationProgress.status || 'Preparing to generate code...'}</p>\n                      </div>\n                    </div>\n                  ) : (\n                    <div className=\"bg-black border border-gray-200 rounded-lg overflow-hidden\">\n                      <div className=\"px-4 py-2 bg-gray-100 text-gray-900 flex items-center justify-between\">\n                        <div className=\"flex items-center gap-2\">\n                          <div className=\"w-16 h-16 border-2 border-orange-500 border-t-transparent rounded-full animate-spin\" />\n                          <span className=\"font-mono text-sm\">Streaming code...</span>\n                        </div>\n                      </div>\n                      <div className=\"p-4 bg-gray-900 rounded\">\n                        <SyntaxHighlighter\n                          language=\"jsx\"\n                          style={vscDarkPlus}\n                          customStyle={{\n                            margin: 0,\n                            padding: '1rem',\n                            fontSize: '0.875rem',\n                            background: 'transparent',\n                          }}\n                          showLineNumbers={true}\n                        >\n                          {generationProgress.streamedCode || 'Starting code generation...'}\n                        </SyntaxHighlighter>\n                        <span className=\"inline-block w-3 h-5 bg-orange-400 ml-1 animate-pulse\" />\n                      </div>\n                    </div>\n                  )\n                ) : (\n                  <div className=\"space-y-4\">\n                    {/* Show current file being generated */}\n                    {generationProgress.currentFile && (\n                      <div className=\"bg-black border-2 border-gray-400 rounded-lg overflow-hidden shadow-sm\">\n                        <div className=\"px-4 py-2 bg-[#36322F] text-white flex items-center justify-between\">\n                          <div className=\"flex items-center gap-2\">\n                            <div className=\"w-16 h-16 border-2 border-white border-t-transparent rounded-full animate-spin\" />\n                            <span className=\"font-mono text-sm\">{generationProgress.currentFile.path}</span>\n                            <span className={`px-2 py-0.5 text-xs rounded ${\n                              generationProgress.currentFile.type === 'css' ? 'bg-blue-600 text-white' :\n                              generationProgress.currentFile.type === 'javascript' ? 'bg-yellow-600 text-white' :\n                              generationProgress.currentFile.type === 'json' ? 'bg-green-600 text-white' :\n                              'bg-gray-200 text-gray-700'\n                            }`}>\n                              {generationProgress.currentFile.type === 'javascript' ? 'JSX' : generationProgress.currentFile.type.toUpperCase()}\n                            </span>\n                          </div>\n                        </div>\n                        <div className=\"bg-gray-900 border border-gray-700 rounded\">\n                          <SyntaxHighlighter\n                            language={\n                              generationProgress.currentFile.type === 'css' ? 'css' :\n                              generationProgress.currentFile.type === 'json' ? 'json' :\n                              generationProgress.currentFile.type === 'html' ? 'html' :\n                              'jsx'\n                            }\n                            style={vscDarkPlus}\n                            customStyle={{\n                              margin: 0,\n                              padding: '1rem',\n                              fontSize: '0.75rem',\n                              background: 'transparent',\n                            }}\n                            showLineNumbers={true}\n                          >\n                            {generationProgress.currentFile.content}\n                          </SyntaxHighlighter>\n                          <span className=\"inline-block w-3 h-4 bg-orange-400 ml-4 mb-4 animate-pulse\" />\n                        </div>\n                      </div>\n                    )}\n                    \n                    {/* Show completed files */}\n                    {generationProgress.files.map((file, idx) => (\n                      <div key={idx} className=\"bg-white border border-gray-200 rounded-lg overflow-hidden\">\n                        <div className=\"px-4 py-2 bg-[#36322F] text-white flex items-center justify-between\">\n                          <div className=\"flex items-center gap-2\">\n                            <span className=\"text-green-500\">✓</span>\n                            <span className=\"font-mono text-sm\">{file.path}</span>\n                          </div>\n                          <span className={`px-2 py-0.5 text-xs rounded ${\n                            file.type === 'css' ? 'bg-blue-600 text-white' :\n                            file.type === 'javascript' ? 'bg-yellow-600 text-white' :\n                            file.type === 'json' ? 'bg-green-600 text-white' :\n                            'bg-gray-200 text-gray-700'\n                          }`}>\n                            {file.type === 'javascript' ? 'JSX' : file.type.toUpperCase()}\n                          </span>\n                        </div>\n                        <div className=\"bg-gray-900 border border-gray-700  max-h-48 overflow-y-auto scrollbar-hide\">\n                          <SyntaxHighlighter\n                            language={\n                              file.type === 'css' ? 'css' :\n                              file.type === 'json' ? 'json' :\n                              file.type === 'html' ? 'html' :\n                              'jsx'\n                            }\n                            style={vscDarkPlus}\n                            customStyle={{\n                              margin: 0,\n                              padding: '1rem',\n                              fontSize: '0.75rem',\n                              background: 'transparent',\n                            }}\n                            showLineNumbers={true}\n                            wrapLongLines={true}\n                          >\n                            {file.content}\n                          </SyntaxHighlighter>\n                        </div>\n                      </div>\n                    ))}\n                    \n                    {/* Show remaining raw stream if there's content after the last file */}\n                    {!generationProgress.currentFile && generationProgress.streamedCode.length > 0 && (\n                      <div className=\"bg-black border border-gray-200 rounded-lg overflow-hidden\">\n                        <div className=\"px-4 py-2 bg-[#36322F] text-white flex items-center justify-between\">\n                          <div className=\"flex items-center gap-2\">\n                            <div className=\"w-16 h-16 border-2 border-gray-400 border-t-transparent rounded-full animate-spin\" />\n                            <span className=\"font-mono text-sm\">Processing...</span>\n                          </div>\n                        </div>\n                        <div className=\"bg-gray-900 border border-gray-700 rounded\">\n                          <SyntaxHighlighter\n                            language=\"jsx\"\n                            style={vscDarkPlus}\n                            customStyle={{\n                              margin: 0,\n                              padding: '1rem',\n                              fontSize: '0.75rem',\n                              background: 'transparent',\n                            }}\n                            showLineNumbers={false}\n                          >\n                            {(() => {\n                              // Show only the tail of the stream after the last file\n                              const lastFileEnd = generationProgress.files.length > 0 \n                                ? generationProgress.streamedCode.lastIndexOf('</file>') + 7\n                                : 0;\n                              let remainingContent = generationProgress.streamedCode.slice(lastFileEnd).trim();\n                              \n                              // Remove explanation tags and content\n                              remainingContent = remainingContent.replace(/<explanation>[\\s\\S]*?<\\/explanation>/g, '').trim();\n\n                              // If only whitespace or nothing left, show loading message\n                              // Use \"Loading sandbox...\" instead of \"Waiting for next file...\" for better UX\n                              return remainingContent || 'Loading sandbox...';\n                            })()}\n                          </SyntaxHighlighter>\n                        </div>\n                      </div>\n                    )}\n                  </div>\n                )}\n              </div>\n            </div>\n            \n            {/* Progress indicator */}\n            {generationProgress.components.length > 0 && (\n              <div className=\"mx-6 mb-6\">\n                <div className=\"h-2 bg-gray-200 rounded-full overflow-hidden\">\n                  <div \n                    className=\"h-full bg-gradient-to-r from-orange-500 to-orange-400 transition-all duration-300\"\n                    style={{\n                      width: `${(generationProgress.currentComponent / Math.max(generationProgress.components.length, 1)) * 100}%`\n                    }}\n                  />\n                </div>\n              </div>\n            )}\n          </div>\n        </div>\n      );\n    } else if (activeTab === 'preview') {\n      // Show loading state for initial generation or when starting a new generation with existing sandbox\n      const isInitialGeneration = !sandboxData?.url && (urlScreenshot || isCapturingScreenshot || isPreparingDesign || loadingStage);\n      const isNewGenerationWithSandbox = isStartingNewGeneration && sandboxData?.url;\n      const shouldShowLoadingOverlay = (isInitialGeneration || isNewGenerationWithSandbox) && \n        (loading || generationProgress.isGenerating || isPreparingDesign || loadingStage || isCapturingScreenshot || isStartingNewGeneration);\n      \n      if (isInitialGeneration || isNewGenerationWithSandbox) {\n        return (\n          <div className=\"relative w-full h-full bg-gray-900\">\n            {/* Screenshot as background when available */}\n            {urlScreenshot && (\n              /* eslint-disable-next-line @next/next/no-img-element */\n              <img \n                src={urlScreenshot} \n                alt=\"Website preview\" \n                className=\"absolute inset-0 w-full h-full object-cover transition-opacity duration-700\"\n                style={{ \n                  opacity: isScreenshotLoaded ? 1 : 0,\n                  willChange: 'opacity'\n                }}\n                onLoad={() => setIsScreenshotLoaded(true)}\n                loading=\"eager\"\n              />\n            )}\n            \n            {/* Loading overlay - only show when actively processing initial generation */}\n            {shouldShowLoadingOverlay && (\n              <div className=\"absolute inset-0 bg-black/70 flex flex-col items-center justify-center backdrop-blur-sm\">\n                {/* Loading animation with skeleton */}\n                <div className=\"text-center max-w-md\">\n                  {/* Animated skeleton lines */}\n                  <div className=\"mb-6 space-y-3\">\n                    <div className=\"h-2 bg-gradient-to-r from-transparent via-white/20 to-transparent rounded animate-pulse\" \n                         style={{ animationDuration: '1.5s', animationDelay: '0s' }} />\n                    <div className=\"h-2 bg-gradient-to-r from-transparent via-white/20 to-transparent rounded animate-pulse w-4/5 mx-auto\" \n                         style={{ animationDuration: '1.5s', animationDelay: '0.2s' }} />\n                    <div className=\"h-2 bg-gradient-to-r from-transparent via-white/20 to-transparent rounded animate-pulse w-3/5 mx-auto\" \n                         style={{ animationDuration: '1.5s', animationDelay: '0.4s' }} />\n                  </div>\n                  \n                  {/* Status text */}\n                  <p className=\"text-white text-lg font-medium\">\n                    {isCapturingScreenshot ? 'Analyzing website...' :\n                     isPreparingDesign ? 'Preparing design...' :\n                     generationProgress.isGenerating ? 'Generating code...' :\n                     'Loading...'}\n                  </p>\n                  \n                  {/* Subtle progress hint */}\n                  <p className=\"text-white/60 text-sm mt-2\">\n                    {isCapturingScreenshot ? 'Taking a screenshot of the site' :\n                     isPreparingDesign ? 'Understanding the layout and structure' :\n                     generationProgress.isGenerating ? 'Writing React components' :\n                     'Please wait...'}\n                  </p>\n                </div>\n              </div>\n            )}\n          </div>\n        );\n      }\n      \n      // Show sandbox iframe - keep showing during edits, only hide during initial loading\n      if (sandboxData?.url) {\n        return (\n          <div className=\"relative w-full h-full\">\n            <iframe\n              ref={iframeRef}\n              src={sandboxData.url}\n              className=\"w-full h-full border-none\"\n              title=\"Open Lovable Sandbox\"\n              allow=\"clipboard-write\"\n              sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups allow-modals\"\n            />\n            \n            {/* Package installation overlay - shows when installing packages or applying code */}\n            {codeApplicationState.stage && codeApplicationState.stage !== 'complete' && (\n              <div className=\"absolute inset-0 bg-white/95 backdrop-blur-sm flex items-center justify-center z-10\">\n                <div className=\"text-center max-w-md\">\n                  <div className=\"mb-6\">\n                    {/* Animated icon based on stage */}\n                    {codeApplicationState.stage === 'installing' ? (\n                      <div className=\"w-16 h-16 mx-auto\">\n                        <svg className=\"w-full h-full animate-spin\" fill=\"none\" viewBox=\"0 0 24 24\">\n                          <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\"></circle>\n                          <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path>\n                        </svg>\n                      </div>\n                    ) : null}\n                  </div>\n                  \n                  <h3 className=\"text-lg font-semibold text-gray-900 mb-2\">\n                    {codeApplicationState.stage === 'analyzing' && 'Analyzing code...'}\n                    {codeApplicationState.stage === 'installing' && 'Installing packages...'}\n                    {codeApplicationState.stage === 'applying' && 'Applying changes...'}\n                  </h3>\n                  \n                  {/* Package list during installation */}\n                  {codeApplicationState.stage === 'installing' && codeApplicationState.packages && (\n                    <div className=\"mb-4\">\n                      <div className=\"flex flex-wrap gap-2 justify-center\">\n                        {codeApplicationState.packages.map((pkg, index) => (\n                          <span \n                            key={index}\n                            className={`px-2 py-1 text-xs rounded-full transition-all ${\n                              codeApplicationState.installedPackages?.includes(pkg)\n                                ? 'bg-green-100 text-green-700'\n                                : 'bg-gray-100 text-gray-600'\n                            }`}\n                          >\n                            {pkg}\n                            {codeApplicationState.installedPackages?.includes(pkg) && (\n                              <span className=\"ml-1\">✓</span>\n                            )}\n                          </span>\n                        ))}\n                      </div>\n                    </div>\n                  )}\n                  \n                  {/* Files being generated */}\n                  {codeApplicationState.stage === 'applying' && codeApplicationState.filesGenerated && (\n                    <div className=\"text-sm text-gray-600\">\n                      Creating {codeApplicationState.filesGenerated.length} files...\n                    </div>\n                  )}\n                  \n                  <p className=\"text-sm text-gray-500 mt-2\">\n                    {codeApplicationState.stage === 'analyzing' && 'Parsing generated code and detecting dependencies...'}\n                    {codeApplicationState.stage === 'installing' && 'This may take a moment while npm installs the required packages...'}\n                    {codeApplicationState.stage === 'applying' && 'Writing files to your sandbox environment...'}\n                  </p>\n                </div>\n              </div>\n            )}\n            \n            {/* Show a subtle indicator when code is being edited/generated */}\n            {generationProgress.isGenerating && generationProgress.isEdit && !codeApplicationState.stage && (\n              <div className=\"absolute top-4 right-4 inline-flex items-center gap-2 px-3 py-1.5 bg-black/80 backdrop-blur-sm rounded-lg\">\n                <div className=\"w-2 h-2 bg-green-400 rounded-full animate-pulse\" />\n                <span className=\"text-white text-xs font-medium\">Generating code...</span>\n              </div>\n            )}\n            \n            {/* Refresh button */}\n            <button\n              onClick={() => {\n                if (iframeRef.current && sandboxData?.url) {\n                  console.log('[Manual Refresh] Forcing iframe reload...');\n                  const newSrc = `${sandboxData.url}?t=${Date.now()}&manual=true`;\n                  iframeRef.current.src = newSrc;\n                }\n              }}\n              className=\"absolute bottom-4 right-4 bg-white/90 hover:bg-white text-gray-700 p-2 rounded-lg shadow-lg transition-all duration-200 hover:scale-105\"\n              title=\"Refresh sandbox\"\n            >\n              <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n              </svg>\n            </button>\n          </div>\n        );\n      }\n      \n      // Default state when no sandbox and no screenshot\n      return (\n        <div className=\"flex items-center justify-center h-full bg-gray-50 text-gray-600 text-lg\">\n          {screenshotError ? (\n            <div className=\"text-center\">\n              <p className=\"mb-2\">Failed to capture screenshot</p>\n              <p className=\"text-sm text-gray-500\">{screenshotError}</p>\n            </div>\n          ) : sandboxData ? (\n            <div className=\"text-gray-500\">\n              <div className=\"w-16 h-16 border-2 border-gray-300 border-t-transparent rounded-full animate-spin mx-auto mb-2\" />\n              <p className=\"text-sm\">Loading preview...</p>\n            </div>\n          ) : (\n            <div className=\"text-gray-500 text-center\">\n              <p className=\"text-sm\">Start chatting to create your first app</p>\n            </div>\n          )}\n        </div>\n      );\n    }\n    return null;\n  };\n\n  const sendChatMessage = async () => {\n    const message = aiChatInput.trim();\n    if (!message) return;\n    \n    if (!aiEnabled) {\n      addChatMessage('AI is disabled. Please enable it first.', 'system');\n      return;\n    }\n    \n    addChatMessage(message, 'user');\n    setAiChatInput('');\n    \n    // Check for special commands\n    const lowerMessage = message.toLowerCase().trim();\n    if (lowerMessage === 'check packages' || lowerMessage === 'install packages' || lowerMessage === 'npm install') {\n      if (!sandboxData) {\n        // More helpful message - user might be trying to run this too early\n        addChatMessage('The sandbox is still being set up. Please wait for the generation to complete, then try again.', 'system');\n        return;\n      }\n      await checkAndInstallPackages();\n      return;\n    }\n    \n    // Start sandbox creation in parallel if needed\n    let sandboxPromise: Promise<void> | null = null;\n    let sandboxCreating = false;\n    \n    if (!sandboxData) {\n      sandboxCreating = true;\n      addChatMessage('Creating sandbox while I plan your app...', 'system');\n      sandboxPromise = createSandbox(true).catch((error: any) => {\n        addChatMessage(`Failed to create sandbox: ${error.message}`, 'system');\n        throw error;\n      });\n    }\n    \n    // Determine if this is an edit\n    const isEdit = conversationContext.appliedCode.length > 0;\n    \n    try {\n      // Generation tab is already active from scraping phase\n      setGenerationProgress(prev => ({\n        ...prev,  // Preserve all existing state\n        isGenerating: true,\n        status: 'Starting AI generation...',\n        components: [],\n        currentComponent: 0,\n        streamedCode: '',\n        isStreaming: false,\n        isThinking: true,\n        thinkingText: 'Analyzing your request...',\n        thinkingDuration: undefined,\n        currentFile: undefined,\n        lastProcessedPosition: 0,\n        // Add isEdit flag to generation progress\n        isEdit: isEdit,\n        // Keep existing files for edits - we'll mark edited ones differently\n        files: prev.files\n      }));\n      \n      // Backend now manages file state - no need to fetch from frontend\n      console.log('[chat] Using backend file cache for context');\n      \n      const fullContext = {\n        sandboxId: sandboxData?.sandboxId || (sandboxCreating ? 'pending' : null),\n        structure: structureContent,\n        recentMessages: chatMessages.slice(-20),\n        conversationContext: conversationContext,\n        currentCode: promptInput,\n        sandboxUrl: sandboxData?.url,\n        sandboxCreating: sandboxCreating\n      };\n      \n      // Debug what we're sending\n      console.log('[chat] Sending context to AI:');\n      console.log('[chat] - sandboxId:', fullContext.sandboxId);\n      console.log('[chat] - isEdit:', conversationContext.appliedCode.length > 0);\n      \n      const response = await fetch('/api/generate-ai-code-stream', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({\n          prompt: message,\n          model: aiModel,\n          context: fullContext,\n          isEdit: conversationContext.appliedCode.length > 0\n        })\n      });\n      \n      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`);\n      }\n      \n      const reader = response.body?.getReader();\n      const decoder = new TextDecoder();\n      let generatedCode = '';\n      let explanation = '';\n      let buffer = ''; // Buffer for incomplete lines\n      \n      if (reader) {\n        while (true) {\n          const { done, value } = await reader.read();\n          if (done) break;\n          \n          const chunk = decoder.decode(value, { stream: true });\n          console.log('[chat] Received chunk:', chunk.length, 'bytes');\n          buffer += chunk;\n          const lines = buffer.split('\\n');\n          \n          // Keep the last line in buffer if it's incomplete\n          buffer = lines.pop() || '';\n          \n          for (const line of lines) {\n            if (line.startsWith('data: ')) {\n              try {\n                const data = JSON.parse(line.slice(6));\n                \n                if (data.type === 'status') {\n                  setGenerationProgress(prev => ({ ...prev, status: data.message }));\n                } else if (data.type === 'thinking') {\n                  setGenerationProgress(prev => ({ \n                    ...prev, \n                    isThinking: true,\n                    thinkingText: (prev.thinkingText || '') + data.text\n                  }));\n                } else if (data.type === 'thinking_complete') {\n                  setGenerationProgress(prev => ({ \n                    ...prev, \n                    isThinking: false,\n                    thinkingDuration: data.duration\n                  }));\n                } else if (data.type === 'conversation') {\n                  // Add conversational text to chat only if it's not code\n                  let text = data.text || '';\n                  \n                  // Remove package tags from the text\n                  text = text.replace(/<package>[^<]*<\\/package>/g, '');\n                  text = text.replace(/<packages>[^<]*<\\/packages>/g, '');\n                  \n                  // Filter out any XML tags and file content that slipped through\n                  if (!text.includes('<file') && !text.includes('import React') && \n                      !text.includes('export default') && !text.includes('className=') &&\n                      text.trim().length > 0) {\n                    addChatMessage(text.trim(), 'ai');\n                  }\n                } else if (data.type === 'stream' && data.raw) {\n                  setGenerationProgress(prev => {\n                    const newStreamedCode = prev.streamedCode + data.text;\n                    \n                    // Tab is already switched after scraping\n                    \n                    const updatedState = { \n                      ...prev, \n                      streamedCode: newStreamedCode,\n                      isStreaming: true,\n                      isThinking: false,\n                      status: 'Generating code...'\n                    };\n                    \n                    // Process complete files from the accumulated stream\n                    const fileRegex = /<file path=\"([^\"]+)\">([^]*?)<\\/file>/g;\n                    let match;\n                    const processedFiles = new Set(prev.files.map(f => f.path));\n                    \n                    while ((match = fileRegex.exec(newStreamedCode)) !== null) {\n                      const filePath = match[1];\n                      const fileContent = match[2];\n                      \n                      // Only add if we haven't processed this file yet\n                      if (!processedFiles.has(filePath)) {\n                        const fileExt = filePath.split('.').pop() || '';\n                        const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                        fileExt === 'css' ? 'css' :\n                                        fileExt === 'json' ? 'json' :\n                                        fileExt === 'html' ? 'html' : 'text';\n                        \n                        // Check if file already exists\n                        const existingFileIndex = updatedState.files.findIndex(f => f.path === filePath);\n                        \n                        if (existingFileIndex >= 0) {\n                          // Update existing file and mark as edited\n                          updatedState.files = [\n                            ...updatedState.files.slice(0, existingFileIndex),\n                            {\n                              ...updatedState.files[existingFileIndex],\n                              content: fileContent.trim(),\n                              type: fileType,\n                              completed: true,\n                              edited: true\n                            },\n                            ...updatedState.files.slice(existingFileIndex + 1)\n                          ];\n                        } else {\n                          // Add new file\n                          updatedState.files = [...updatedState.files, {\n                            path: filePath,\n                            content: fileContent.trim(),\n                            type: fileType,\n                            completed: true,\n                            edited: false\n                          }];\n                        }\n                        \n                        // Only show file status if not in edit mode\n                        if (!prev.isEdit) {\n                          updatedState.status = `Completed ${filePath}`;\n                        }\n                        processedFiles.add(filePath);\n                      }\n                    }\n                    \n                    // Check for current file being generated (incomplete file at the end)\n                    const lastFileMatch = newStreamedCode.match(/<file path=\"([^\"]+)\">([^]*?)$/);\n                    if (lastFileMatch && !lastFileMatch[0].includes('</file>')) {\n                      const filePath = lastFileMatch[1];\n                      const partialContent = lastFileMatch[2];\n                      \n                      if (!processedFiles.has(filePath)) {\n                        const fileExt = filePath.split('.').pop() || '';\n                        const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                        fileExt === 'css' ? 'css' :\n                                        fileExt === 'json' ? 'json' :\n                                        fileExt === 'html' ? 'html' : 'text';\n                        \n                        updatedState.currentFile = { \n                          path: filePath, \n                          content: partialContent, \n                          type: fileType \n                        };\n                        // Only show file status if not in edit mode\n                        if (!prev.isEdit) {\n                          updatedState.status = `Generating ${filePath}`;\n                        }\n                      }\n                    } else {\n                      updatedState.currentFile = undefined;\n                    }\n                    \n                    return updatedState;\n                  });\n                } else if (data.type === 'app') {\n                  setGenerationProgress(prev => ({ \n                    ...prev, \n                    status: 'Generated App.jsx structure'\n                  }));\n                } else if (data.type === 'component') {\n                  setGenerationProgress(prev => ({\n                    ...prev,\n                    status: `Generated ${data.name}`,\n                    components: [...prev.components, { \n                      name: data.name, \n                      path: data.path, \n                      completed: true \n                    }],\n                    currentComponent: data.index\n                  }));\n                } else if (data.type === 'package') {\n                  // Handle package installation from tool calls\n                  setGenerationProgress(prev => ({\n                    ...prev,\n                    status: data.message || `Installing ${data.name}`\n                  }));\n                } else if (data.type === 'complete') {\n                  generatedCode = data.generatedCode;\n                  explanation = data.explanation;\n                  \n                  // Save the last generated code\n                  setConversationContext(prev => ({\n                    ...prev,\n                    lastGeneratedCode: generatedCode\n                  }));\n                  \n                  // Clear thinking state when generation completes\n                  setGenerationProgress(prev => ({\n                    ...prev,\n                    isThinking: false,\n                    thinkingText: undefined,\n                    thinkingDuration: undefined\n                  }));\n                  \n                  // Store packages to install from tool calls\n                  if (data.packagesToInstall && data.packagesToInstall.length > 0) {\n                    console.log('[generate-code] Packages to install from tools:', data.packagesToInstall);\n                    // Store packages globally for later installation\n                    (window as any).pendingPackages = data.packagesToInstall;\n                  }\n                  \n                  // Parse all files from the completed code if not already done\n                  const fileRegex = /<file path=\"([^\"]+)\">([^]*?)<\\/file>/g;\n                  const parsedFiles: Array<{path: string; content: string; type: string; completed: boolean}> = [];\n                  let fileMatch;\n                  \n                  while ((fileMatch = fileRegex.exec(data.generatedCode)) !== null) {\n                    const filePath = fileMatch[1];\n                    const fileContent = fileMatch[2];\n                    const fileExt = filePath.split('.').pop() || '';\n                    const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                    fileExt === 'css' ? 'css' :\n                                    fileExt === 'json' ? 'json' :\n                                    fileExt === 'html' ? 'html' : 'text';\n                    \n                    parsedFiles.push({\n                      path: filePath,\n                      content: fileContent.trim(),\n                      type: fileType,\n                      completed: true\n                    });\n                  }\n                  \n                  setGenerationProgress(prev => ({\n                    ...prev,\n                    status: `Generated ${parsedFiles.length > 0 ? parsedFiles.length : prev.files.length} file${(parsedFiles.length > 0 ? parsedFiles.length : prev.files.length) !== 1 ? 's' : ''}!`,\n                    isGenerating: false,\n                    isStreaming: false,\n                    isEdit: prev.isEdit,\n                    // Keep the files that were already parsed during streaming\n                    files: prev.files.length > 0 ? prev.files : parsedFiles\n                  }));\n                } else if (data.type === 'error') {\n                  throw new Error(data.error);\n                }\n              } catch (e) {\n                console.error('Failed to parse SSE data:', e);\n              }\n            }\n          }\n        }\n      }\n      \n      if (generatedCode) {\n        // Parse files from generated code for metadata\n        const fileRegex = /<file path=\"([^\"]+)\">([^]*?)<\\/file>/g;\n        const generatedFiles = [];\n        let match;\n        while ((match = fileRegex.exec(generatedCode)) !== null) {\n          generatedFiles.push(match[1]);\n        }\n        \n        // Show appropriate message based on edit mode\n        if (isEdit && generatedFiles.length > 0) {\n          // For edits, show which file(s) were edited\n          const editedFileNames = generatedFiles.map(f => f.split('/').pop()).join(', ');\n          addChatMessage(\n            explanation || `Updated ${editedFileNames}`,\n            'ai',\n            {\n              appliedFiles: [generatedFiles[0]] // Only show the first edited file\n            }\n          );\n        } else {\n          // For new generation, show all files\n          addChatMessage(explanation || 'Code generated!', 'ai', {\n            appliedFiles: generatedFiles\n          });\n        }\n        \n        setPromptInput(generatedCode);\n        // Don't show the Generated Code panel by default\n        // setLeftPanelVisible(true);\n        \n        // Wait for sandbox creation if it's still in progress\n        let activeSandboxData = sandboxData;\n        if (sandboxPromise) {\n          addChatMessage('Waiting for sandbox to be ready...', 'system');\n          try {\n            const newSandboxData = await sandboxPromise;\n            if (newSandboxData != null) {\n              activeSandboxData = newSandboxData;\n              // Also update the state for future use\n              setSandboxData(newSandboxData);\n            }\n            // Remove the waiting message\n            setChatMessages(prev => prev.filter(msg => msg.content !== 'Waiting for sandbox to be ready...'));\n          } catch {\n            addChatMessage('Sandbox creation failed. Cannot apply code.', 'system');\n            return;\n          }\n        }\n        \n        if (activeSandboxData && generatedCode) {\n          // For new sandbox creations (especially Vercel), add a delay to ensure Vite is ready\n          if (sandboxCreating) {\n            console.log('[startGeneration] New sandbox created, waiting for services to be ready...');\n            await new Promise(resolve => setTimeout(resolve, 2000));\n          }\n          \n          // Use isEdit flag that was determined at the start\n          // Pass the sandbox data from the promise if it's different from the state\n          await applyGeneratedCode(generatedCode, isEdit, activeSandboxData !== sandboxData ? activeSandboxData : undefined);\n        }\n      }\n      \n      // Show completion status briefly then switch to preview\n      setGenerationProgress(prev => ({\n        ...prev,\n        isGenerating: false,\n        isStreaming: false,\n        status: 'Generation complete!',\n        isEdit: prev.isEdit,\n        // Clear thinking state on completion\n        isThinking: false,\n        thinkingText: undefined,\n        thinkingDuration: undefined\n      }));\n      \n      setTimeout(() => {\n        // Switch to preview but keep files for display\n        setActiveTab('preview');\n      }, 1000); // Reduced from 3000ms to 1000ms\n    } catch (error: any) {\n      setChatMessages(prev => prev.filter(msg => msg.content !== 'Thinking...'));\n      addChatMessage(`Error: ${error.message}`, 'system');\n      // Reset generation progress and switch back to preview on error\n      setGenerationProgress({\n        isGenerating: false,\n        status: '',\n        components: [],\n        currentComponent: 0,\n        streamedCode: '',\n        isStreaming: false,\n        isThinking: false,\n        thinkingText: undefined,\n        thinkingDuration: undefined,\n        files: [],\n        currentFile: undefined,\n        lastProcessedPosition: 0\n      });\n      setActiveTab('preview');\n    }\n  };\n\n\n  const downloadZip = async () => {\n    if (!sandboxData) {\n      addChatMessage('Please wait for the sandbox to be created before downloading.', 'system');\n      return;\n    }\n    \n    setLoading(true);\n    log('Creating zip file...');\n    addChatMessage('Creating ZIP file of your Vite app...', 'system');\n    \n    try {\n      const response = await fetch('/api/create-zip', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' }\n      });\n      \n      const data = await response.json();\n      \n      if (data.success) {\n        log('Zip file created!');\n        addChatMessage('ZIP file created! Download starting...', 'system');\n        \n        const link = document.createElement('a');\n        link.href = data.dataUrl;\n        link.download = data.fileName || 'e2b-project.zip';\n        document.body.appendChild(link);\n        link.click();\n        document.body.removeChild(link);\n        \n        addChatMessage(\n          'Your Vite app has been downloaded! To run it locally:\\n' +\n          '1. Unzip the file\\n' +\n          '2. Run: npm install\\n' +\n          '3. Run: npm run dev\\n' +\n          '4. Open http://localhost:5173',\n          'system'\n        );\n      } else {\n        throw new Error(data.error);\n      }\n    } catch (error: any) {\n      log(`Failed to create zip: ${error.message}`, 'error');\n      addChatMessage(`Failed to create ZIP: ${error.message}`, 'system');\n    } finally {\n      setLoading(false);\n    }\n  };\n\n  const reapplyLastGeneration = async () => {\n    if (!conversationContext.lastGeneratedCode) {\n      addChatMessage('No previous generation to re-apply', 'system');\n      return;\n    }\n    \n    if (!sandboxData) {\n      addChatMessage('Please create a sandbox first', 'system');\n      return;\n    }\n    \n    addChatMessage('Re-applying last generation...', 'system');\n    const isEdit = conversationContext.appliedCode.length > 0;\n    await applyGeneratedCode(conversationContext.lastGeneratedCode, isEdit);\n  };\n\n  // Auto-scroll code display to bottom when streaming\n  useEffect(() => {\n    if (codeDisplayRef.current && generationProgress.isStreaming) {\n      codeDisplayRef.current.scrollTop = codeDisplayRef.current.scrollHeight;\n    }\n  }, [generationProgress.streamedCode, generationProgress.isStreaming]);\n\n  const toggleFolder = (folderPath: string) => {\n    const newExpanded = new Set(expandedFolders);\n    if (newExpanded.has(folderPath)) {\n      newExpanded.delete(folderPath);\n    } else {\n      newExpanded.add(folderPath);\n    }\n    setExpandedFolders(newExpanded);\n  };\n\n  const handleFileClick = async (filePath: string) => {\n    setSelectedFile(filePath);\n    // TODO: Add file content fetching logic here\n  };\n\n  const getFileIcon = (fileName: string) => {\n    const ext = fileName.split('.').pop()?.toLowerCase();\n    \n    if (ext === 'jsx' || ext === 'js') {\n      return <SiJavascript style={{ width: '16px', height: '16px' }} className=\"text-yellow-500\" />;\n    } else if (ext === 'tsx' || ext === 'ts') {\n      return <SiReact style={{ width: '16px', height: '16px' }} className=\"text-blue-500\" />;\n    } else if (ext === 'css') {\n      return <SiCss3 style={{ width: '16px', height: '16px' }} className=\"text-blue-500\" />;\n    } else if (ext === 'json') {\n      return <SiJson style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />;\n    } else {\n      return <FiFile style={{ width: '16px', height: '16px' }} className=\"text-gray-600\" />;\n    }\n  };\n\n//   const clearChatHistory = () => {\n//     setChatMessages([{\n//       content: 'Chat history cleared. How can I help you?',\n//       type: 'system',\n//       timestamp: new Date()\n//     }]);\n//   };\n// \n\n//   const cloneWebsite = async () => {\n//     let url = urlInput.trim();\n//     if (!url) {\n//       setUrlStatus(prev => [...prev, 'Please enter a URL']);\n//       return;\n//     }\n//     \n//     if (!url.match(/^https?:\\/\\//i)) {\n//       url = 'https://' + url;\n//     }\n//     \n//     setUrlStatus([`Using: ${url}`, 'Starting to scrape...']);\n//     \n//     setUrlOverlayVisible(false);\n//     \n//     // Remove protocol for cleaner display\n//     const cleanUrl = url.replace(/^https?:\\/\\//i, '');\n//     addChatMessage(`Starting to clone ${cleanUrl}...`, 'system');\n//     \n//     // Capture screenshot immediately and switch to preview tab\n//     captureUrlScreenshot(url);\n//     \n//     try {\n//       addChatMessage('Scraping website content...', 'system');\n//       const scrapeResponse = await fetch('/api/scrape-url-enhanced', {\n//         method: 'POST',\n//         headers: { 'Content-Type': 'application/json' },\n//         body: JSON.stringify({ url })\n//       });\n//       \n//       if (!scrapeResponse.ok) {\n//         throw new Error(`Scraping failed: ${scrapeResponse.status}`);\n//       }\n//       \n//       const scrapeData = await scrapeResponse.json();\n//       \n//       if (!scrapeData.success) {\n//         throw new Error(scrapeData.error || 'Failed to scrape website');\n//       }\n//       \n//       addChatMessage(`Scraped ${scrapeData.content.length} characters from ${url}`, 'system');\n//       \n//       // Clear preparing design state and switch to generation tab\n//       setIsPreparingDesign(false);\n//       setActiveTab('generation');\n//       \n//       setConversationContext(prev => ({\n//         ...prev,\n//         scrapedWebsites: [...prev.scrapedWebsites, {\n//           url,\n//           content: scrapeData,\n//           timestamp: new Date()\n//         }],\n//         currentProject: `Clone of ${url}`\n//       }));\n//       \n//       // Start sandbox creation in parallel with code generation\n//       let sandboxPromise: Promise<any> | null = null;\n//       if (!sandboxData) {\n//         addChatMessage('Creating sandbox while generating your React app...', 'system');\n//         sandboxPromise = createSandbox(true);\n//       }\n//       \n//       addChatMessage('Analyzing and generating React recreation...', 'system');\n//       \n//       const recreatePrompt = `I scraped this website and want you to recreate it as a modern React application.\n// \n// URL: ${url}\n// \n// SCRAPED CONTENT:\n// ${scrapeData.content}\n// \n// ${homeContextInput ? `ADDITIONAL CONTEXT/REQUIREMENTS FROM USER:\n// ${homeContextInput}\n// \n// Please incorporate these requirements into the design and implementation.` : ''}\n// \n// REQUIREMENTS:\n// 1. Create a COMPLETE React application with App.jsx as the main component\n// 2. App.jsx MUST import and render all other components\n// 3. Recreate the main sections and layout from the scraped content\n// 4. ${homeContextInput ? `Apply the user's context/theme: \"${homeContextInput}\"` : `Use a modern dark theme with excellent contrast:\n//    - Background: #0a0a0a\n//    - Text: #ffffff\n//    - Links: #60a5fa\n//    - Accent: #3b82f6`}\n// 5. Make it fully responsive\n// 6. Include hover effects and smooth transitions\n// 7. Create separate components for major sections (Header, Hero, Features, etc.)\n// 8. Use semantic HTML5 elements\n// \n// IMPORTANT CONSTRAINTS:\n// - DO NOT use React Router or any routing libraries\n// - Use regular <a> tags with href=\"#section\" for navigation, NOT Link or NavLink components\n// - This is a single-page application, no routing needed\n// - ALWAYS create src/App.jsx that imports ALL components\n// - Each component should be in src/components/\n// - Use Tailwind CSS for ALL styling (no custom CSS files)\n// - Make sure the app actually renders visible content\n// - Create ALL components that you reference in imports\n// \n// IMAGE HANDLING RULES:\n// - When the scraped content includes images, USE THE ORIGINAL IMAGE URLS whenever appropriate\n// - Keep existing images from the scraped site (logos, product images, hero images, icons, etc.)\n// - Use the actual image URLs provided in the scraped content, not placeholders\n// - Only use placeholder images or generic services when no real images are available\n// - For company logos and brand images, ALWAYS use the original URLs to maintain brand identity\n// - If scraped data contains image URLs, include them in your img tags\n// - Example: If you see \"https://example.com/logo.png\" in the scraped content, use that exact URL\n// \n// Focus on the key sections and content, making it clean and modern while preserving visual assets.`;\n//       \n//       setGenerationProgress(prev => ({\n//         isGenerating: true,\n//         status: 'Initializing AI...',\n//         components: [],\n//         currentComponent: 0,\n//         streamedCode: '',\n//         isStreaming: true,\n//         isThinking: false,\n//         thinkingText: undefined,\n//         thinkingDuration: undefined,\n//         // Keep previous files until new ones are generated\n//         files: prev.files || [],\n//         currentFile: undefined,\n//         lastProcessedPosition: 0\n//       }));\n//       \n//       // Switch to generation tab when starting\n//       setActiveTab('generation');\n//       \n//       const aiResponse = await fetch('/api/generate-ai-code-stream', {\n//         method: 'POST',\n//         headers: { 'Content-Type': 'application/json' },\n//         body: JSON.stringify({\n//           prompt: recreatePrompt,\n//           model: aiModel,\n//           context: {\n//             sandboxId: sandboxData?.id,\n//             structure: structureContent,\n//             conversationContext: conversationContext\n//           }\n//         })\n//       });\n//       \n//       if (!aiResponse.ok) {\n//         throw new Error(`AI generation failed: ${aiResponse.status}`);\n//       }\n//       \n//       const reader = aiResponse.body?.getReader();\n//       const decoder = new TextDecoder();\n//       let generatedCode = '';\n//       let explanation = '';\n//       \n//       if (reader) {\n//         while (true) {\n//           const { done, value } = await reader.read();\n//           if (done) break;\n//           \n//           const chunk = decoder.decode(value);\n//           const lines = chunk.split('\\n');\n//           \n//           for (const line of lines) {\n//             if (line.startsWith('data: ')) {\n//               try {\n//                 const data = JSON.parse(line.slice(6));\n//                 \n//                 if (data.type === 'status') {\n//                   setGenerationProgress(prev => ({ ...prev, status: data.message }));\n//                 } else if (data.type === 'thinking') {\n//                   setGenerationProgress(prev => ({ \n//                     ...prev, \n//                     isThinking: true,\n//                     thinkingText: (prev.thinkingText || '') + data.text\n//                   }));\n//                 } else if (data.type === 'thinking_complete') {\n//                   setGenerationProgress(prev => ({ \n//                     ...prev, \n//                     isThinking: false,\n//                     thinkingDuration: data.duration\n//                   }));\n//                 } else if (data.type === 'conversation') {\n//                   // Add conversational text to chat only if it's not code\n//                   let text = data.text || '';\n//                   \n//                   // Remove package tags from the text\n//                   text = text.replace(/<package>[^<]*<\\/package>/g, '');\n//                   text = text.replace(/<packages>[^<]*<\\/packages>/g, '');\n//                   \n//                   // Filter out any XML tags and file content that slipped through\n//                   if (!text.includes('<file') && !text.includes('import React') && \n//                       !text.includes('export default') && !text.includes('className=') &&\n//                       text.trim().length > 0) {\n//                     addChatMessage(text.trim(), 'ai');\n//                   }\n//                 } else if (data.type === 'stream' && data.raw) {\n//                   setGenerationProgress(prev => ({ \n//                     ...prev, \n//                     streamedCode: prev.streamedCode + data.text,\n//                     lastProcessedPosition: prev.lastProcessedPosition || 0\n//                   }));\n//                 } else if (data.type === 'component') {\n//                   setGenerationProgress(prev => ({\n//                     ...prev,\n//                     status: `Generated ${data.name}`,\n//                     components: [...prev.components, { \n//                       name: data.name,\n//                       path: data.path,\n//                       completed: true\n//                     }],\n//                     currentComponent: prev.currentComponent + 1\n//                   }));\n//                 } else if (data.type === 'complete') {\n//                   generatedCode = data.generatedCode;\n//                   explanation = data.explanation;\n//                   \n//                   // Save the last generated code\n//                   setConversationContext(prev => ({\n//                     ...prev,\n//                     lastGeneratedCode: generatedCode\n//                   }));\n//                 }\n//               } catch (e) {\n//                 console.error('Error parsing streaming data:', e);\n//               }\n//             }\n//           }\n//         }\n//       }\n//       \n//       setGenerationProgress(prev => ({\n//         ...prev,\n//         isGenerating: false,\n//         isStreaming: false,\n//         status: 'Generation complete!',\n//         isEdit: prev.isEdit\n//       }));\n//       \n//       if (generatedCode) {\n//         addChatMessage('AI recreation generated!', 'system');\n//         \n//         // Add the explanation to chat if available\n//         if (explanation && explanation.trim()) {\n//           addChatMessage(explanation, 'ai');\n//         }\n//         \n//         setPromptInput(generatedCode);\n//         // Don't show the Generated Code panel by default\n//         // setLeftPanelVisible(true);\n//         \n//         // Wait for sandbox creation if it's still in progress\n//         let activeSandboxData = sandboxData;\n//         if (sandboxPromise) {\n//           addChatMessage('Waiting for sandbox to be ready...', 'system');\n//           try {\n//             const newSandboxData = await sandboxPromise;\n//             if (newSandboxData) {\n//               activeSandboxData = newSandboxData;\n//             }\n//             // Remove the waiting message\n//             setChatMessages(prev => prev.filter(msg => msg.content !== 'Waiting for sandbox to be ready...'));\n//           } catch (error: any) {\n//             addChatMessage('Sandbox creation failed. Cannot apply code.', 'system');\n//             throw error;\n//           }\n//         }\n//         \n//         // Only apply code if we have sandbox data\n//         if (activeSandboxData) {\n//           // First application for cloned site should not be in edit mode\n//           await applyGeneratedCode(generatedCode, false);\n//         }\n//         \n//         addChatMessage(\n//           `Successfully recreated ${url} as a modern React app${homeContextInput ? ` with your requested context: \"${homeContextInput}\"` : ''}! The scraped content is now in my context, so you can ask me to modify specific sections or add features based on the original site.`, \n//           'ai',\n//           {\n//             scrapedUrl: url,\n//             scrapedContent: scrapeData,\n//             generatedCode: generatedCode\n//           }\n//         );\n//         \n//         setUrlInput('');\n//         setUrlStatus([]);\n//         setHomeContextInput('');\n//         \n//         // Clear generation progress and all screenshot/design states\n//         setGenerationProgress(prev => ({\n//           ...prev,\n//           isGenerating: false,\n//           isStreaming: false,\n//           status: 'Generation complete!'\n//         }));\n//         \n//         // Clear screenshot and preparing design states to prevent them from showing on next run\n//         setUrlScreenshot(null);\n//         setIsPreparingDesign(false);\n//         setTargetUrl('');\n//         setScreenshotError(null);\n//         setLoadingStage(null); // Clear loading stage\n//         setShowLoadingBackground(false); // Clear loading background\n//         \n//         setTimeout(() => {\n//           // Switch back to preview tab but keep files\n//           setActiveTab('preview');\n//         }, 1000); // Show completion briefly then switch\n//       } else {\n//         throw new Error('Failed to generate recreation');\n//       }\n//       \n//     } catch (error: any) {\n//       addChatMessage(`Failed to clone website: ${error.message}`, 'system');\n//       setUrlStatus([]);\n//       setIsPreparingDesign(false);\n//       // Clear all states on error\n//       setUrlScreenshot(null);\n//       setTargetUrl('');\n//       setScreenshotError(null);\n//       setLoadingStage(null);\n//       setGenerationProgress(prev => ({\n//         ...prev,\n//         isGenerating: false,\n//         isStreaming: false,\n//         status: '',\n//         // Keep files to display in sidebar\n//         files: prev.files\n//       }));\n//       setActiveTab('preview');\n//     }\n//   };\n\n  const captureUrlScreenshot = async (url: string) => {\n    setIsCapturingScreenshot(true);\n    setScreenshotError(null);\n    try {\n      const response = await fetch('/api/scrape-screenshot', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({ url })\n      });\n      \n      const data = await response.json();\n      if (data.success && data.screenshot) {\n        setIsScreenshotLoaded(false); // Reset loaded state for new screenshot\n        setUrlScreenshot(data.screenshot);\n        // Set preparing design state\n        setIsPreparingDesign(true);\n        // Store the clean URL for display\n        const cleanUrl = url.replace(/^https?:\\/\\//i, '');\n        setTargetUrl(cleanUrl);\n        // Switch to preview tab to show the screenshot\n        if (activeTab !== 'preview') {\n          setActiveTab('preview');\n        }\n      } else {\n        setScreenshotError(data.error || 'Failed to capture screenshot');\n      }\n    } catch (error) {\n      console.error('Failed to capture screenshot:', error);\n      setScreenshotError('Network error while capturing screenshot');\n    } finally {\n      setIsCapturingScreenshot(false);\n    }\n  };\n\n  const handleHomeScreenSubmit = async (e: React.FormEvent) => {\n    e.preventDefault();\n    await startGeneration();\n  };\n\n  const startGeneration = async () => {\n    if (!homeUrlInput.trim()) return;\n    \n    setHomeScreenFading(true);\n    \n    // Set immediate loading state for better UX\n    setIsStartingNewGeneration(true);\n    setLoadingStage('gathering');\n    \n    // Immediately switch to preview tab to show loading\n    setActiveTab('preview');\n    \n    // Set loading background to ensure proper visual feedback\n    setShowLoadingBackground(true);\n    \n    // Clear messages and immediately show the initial message\n    setChatMessages([]);\n    let displayUrl = homeUrlInput.trim();\n    if (!displayUrl.match(/^https?:\\/\\//i)) {\n      displayUrl = 'https://' + displayUrl;\n    }\n    // Remove protocol for cleaner display\n    const cleanUrl = displayUrl.replace(/^https?:\\/\\//i, '');\n\n    // Check if we're in brand extension mode\n    const brandExtensionMode = sessionStorage.getItem('brandExtensionMode') === 'true';\n\n    addChatMessage(\n      brandExtensionMode\n        ? `Analyzing brand from ${cleanUrl}...`\n        : `Starting to clone ${cleanUrl}...`,\n      'system'\n    );\n    \n    // Start creating sandbox and capturing screenshot immediately in parallel\n    const sandboxPromise = !sandboxData ? createSandbox(true) : Promise.resolve(null);\n    \n    // Set loading stage immediately before hiding home screen\n    setLoadingStage('gathering');\n    // Also ensure we're on preview tab to show the loading overlay\n    setActiveTab('preview');\n    \n    // Always capture screenshot for new URLs, even if sandbox exists\n    // This ensures the loading screen shows properly\n    captureUrlScreenshot(displayUrl);\n    \n    setTimeout(async () => {\n      setShowHomeScreen(false);\n      setHomeScreenFading(false);\n      \n      // Clear the starting flag after transition\n      setTimeout(() => {\n        setIsStartingNewGeneration(false);\n      }, 1000);\n      \n      // Wait for sandbox to be ready (if it's still creating)\n      const createdSandbox = await sandboxPromise;\n      \n      // Now start the clone process which will stream the generation\n      setUrlInput(homeUrlInput);\n      setUrlOverlayVisible(false); // Make sure overlay is closed\n      setUrlStatus(['Scraping website content...']);\n      \n      try {\n        // Scrape the website\n        let url = homeUrlInput.trim();\n        if (!url.match(/^https?:\\/\\//i)) {\n          url = 'https://' + url;\n        }\n\n        // Check if we're in brand extension mode\n        const brandExtensionMode = sessionStorage.getItem('brandExtensionMode') === 'true';\n        const brandExtensionPrompt = sessionStorage.getItem('brandExtensionPrompt') || '';\n\n        // Screenshot is already being captured in parallel above\n\n        let scrapeData: ScrapeData | undefined;\n        let brandGuidelines: any;\n\n        if (brandExtensionMode) {\n          // === BRAND EXTENSION MODE ===\n          addChatMessage('Extracting brand styles from the website...', 'system');\n\n          // Call the brand extraction endpoint\n          const extractResponse = await fetch('/api/extract-brand-styles', {\n            method: 'POST',\n            headers: { 'Content-Type': 'application/json' },\n            body: JSON.stringify({\n              url,\n              prompt: brandExtensionPrompt\n            })\n          });\n\n          if (!extractResponse.ok) {\n            throw new Error('Failed to extract brand styles');\n          }\n\n          brandGuidelines = await extractResponse.json();\n\n          if (!brandGuidelines.success) {\n            throw new Error(brandGuidelines.error || 'Failed to extract brand styles');\n          }\n\n          // Display branding summary with visual UI\n          addChatMessage(`Acquired branding format from ${cleanUrl}`, 'system', {\n            brandingData: brandGuidelines.guidelines,\n            sourceUrl: cleanUrl\n          });\n          addChatMessage(`Building your custom component using these brand guidelines...`, 'system');\n\n          // Clear the flags after use\n          sessionStorage.removeItem('brandExtensionMode');\n          sessionStorage.removeItem('brandExtensionPrompt');\n\n        } else {\n          // === NORMAL CLONE MODE ===\n          // Check if we have pre-scraped markdown content from search results\n          const storedMarkdown = sessionStorage.getItem('siteMarkdown');\n        if (storedMarkdown) {\n          // Use the pre-scraped content\n          scrapeData = {\n            success: true,\n            content: storedMarkdown,\n            title: new URL(url).hostname,\n            source: 'search-result'\n          };\n          sessionStorage.removeItem('siteMarkdown'); // Clear after use\n          addChatMessage('Using cached content from search results...', 'system');\n        } else {\n          // Perform fresh scraping\n          const scrapeResponse = await fetch('/api/scrape-url-enhanced', {\n            method: 'POST',\n            headers: { 'Content-Type': 'application/json' },\n            body: JSON.stringify({ url })\n          });\n          \n          if (!scrapeResponse.ok) {\n            throw new Error('Failed to scrape website');\n          }\n          \n          scrapeData = await scrapeResponse.json() as ScrapeData;\n          \n          if (!scrapeData.success) {\n            throw new Error(scrapeData.error || 'Failed to scrape website');\n          }\n        }\n        }\n\n        setUrlStatus(brandExtensionMode ? ['Brand styles extracted!', 'Building your component...'] : ['Website scraped successfully!', 'Generating React app...']);\n\n        // Clear preparing design state and switch to generation tab\n        setIsPreparingDesign(false);\n        setIsScreenshotLoaded(false); // Reset loaded state\n        setUrlScreenshot(null); // Clear screenshot when starting generation\n        setTargetUrl(''); // Clear target URL\n\n        // Update loading stage to planning\n        setLoadingStage('planning');\n\n        // Brief pause before switching to generation tab\n        setTimeout(() => {\n          setLoadingStage('generating');\n          setActiveTab('generation');\n        }, 1500);\n\n        // Build the appropriate prompt based on mode\n        let prompt;\n\n        if (brandExtensionMode && brandGuidelines) {\n          // === BRAND EXTENSION PROMPT ===\n          // Store brand guidelines in conversation context\n          setConversationContext(prev => ({\n            ...prev,\n            scrapedWebsites: [...prev.scrapedWebsites, {\n              url: url,\n              content: { brandGuidelines },\n              timestamp: new Date()\n            }],\n            currentProject: `Custom build using ${url} brand`\n          }));\n\n          // Extract comprehensive brand data\n          const branding = brandGuidelines.guidelines;\n\n          // Build detailed brand instruction string\n          const brandInstructions = `\nBRAND GUIDELINES FROM ${url}:\n\nCOLOR SYSTEM:\n- Color Scheme: ${branding.colorScheme || 'light'} mode\n- Primary Color: ${branding.colors?.primary || 'not specified'}\n- Accent Color: ${branding.colors?.accent || 'not specified'}\n- Background: ${branding.colors?.background || 'not specified'}\n- Text Primary: ${branding.colors?.textPrimary || 'not specified'}\n- Link Color: ${branding.colors?.link || 'not specified'}\n\nTYPOGRAPHY:\n- Primary Font: ${branding.typography?.fontFamilies?.primary || 'system default'}\n- Heading Font: ${branding.typography?.fontFamilies?.heading || 'system default'}\n- Font Stack (Body): ${branding.typography?.fontStacks?.body?.join(', ') || 'system-ui, sans-serif'}\n- Font Stack (Heading): ${branding.typography?.fontStacks?.heading?.join(', ') || 'system-ui, sans-serif'}\n- H1 Size: ${branding.typography?.fontSizes?.h1 || '36px'}\n- H2 Size: ${branding.typography?.fontSizes?.h2 || '30px'}\n- Body Size: ${branding.typography?.fontSizes?.body || '16px'}\n\nSPACING & LAYOUT:\n- Base Spacing Unit: ${branding.spacing?.baseUnit || '4'}px\n- Border Radius: ${branding.spacing?.borderRadius || '6px'}\n\nBUTTON STYLES:\nPrimary Button:\n  - Background: ${branding.components?.buttonPrimary?.background || branding.colors?.primary}\n  - Text Color: ${branding.components?.buttonPrimary?.textColor || '#FFFFFF'}\n  - Border Radius: ${branding.components?.buttonPrimary?.borderRadius || branding.spacing?.borderRadius || '8px'}\n  - Shadow: ${branding.components?.buttonPrimary?.shadow || 'none'}\n\nSecondary Button:\n  - Background: ${branding.components?.buttonSecondary?.background || '#F9F9F9'}\n  - Text Color: ${branding.components?.buttonSecondary?.textColor || branding.colors?.textPrimary}\n  - Border Radius: ${branding.components?.buttonSecondary?.borderRadius || branding.spacing?.borderRadius || '8px'}\n  - Shadow: ${branding.components?.buttonSecondary?.shadow || 'none'}\n\nINPUT FIELDS:\n- Border Color: ${branding.components?.input?.borderColor || '#CCCCCC'}\n- Border Radius: ${branding.components?.input?.borderRadius || branding.spacing?.borderRadius || '6px'}\n\nBRAND PERSONALITY:\n- Tone: ${branding.personality?.tone || 'professional'}\n- Energy: ${branding.personality?.energy || 'medium'}\n- Target Audience: ${branding.personality?.targetAudience || 'general'}\n\nDESIGN SYSTEM:\n- Framework: ${branding.designSystem?.framework || 'tailwind'}\n- Component Library: ${branding.designSystem?.componentLibrary || 'custom'}\n\nASSETS:\n${branding.images?.logo ? `- Logo Available: Yes (use carefully if needed)` : '- Logo: Not available'}\n${branding.images?.favicon ? `- Favicon: ${branding.images.favicon}` : ''}`;\n\n          prompt = `I want you to build a NEW React component/application based on these brand guidelines and the user's requirements.\n\n<branding-format source=\"${url}\">\n${brandInstructions}\n\nRAW BRAND DATA (for reference):\n${JSON.stringify(branding, null, 2)}\n</branding-format>\n\nUSER'S REQUEST:\n${brandExtensionPrompt || 'Build a modern web component using these brand guidelines'}\n\nIMPORTANT: The content above in the <branding-format> tags contains the extracted brand guidelines from ${url}.\nUse these guidelines (colors, fonts, spacing, design patterns) to build what the user requested.\n\nCRITICAL REQUIREMENTS:\n- DO NOT recreate the original website at ${url}\n- DO create a COMPLETELY NEW component that fulfills the user's request\n- The user wants: \"${brandExtensionPrompt}\"\n- Build ONLY what the user requested - nothing more\n- App.jsx should render ONLY the requested component - no extra Header/Footer/Hero unless specifically requested\n- Make it a minimal, focused implementation of the user's request\n\nSTYLING REQUIREMENTS:\n- Apply the EXACT colors from the brand palette (primary, accent, background, text colors)\n- Use the EXACT typography (font families, font sizes for h1, h2, body)\n- Apply the spacing system (base unit: ${branding.spacing?.baseUnit || '4'}px)\n- Use the specified border radius (${branding.spacing?.borderRadius || '6px'}) consistently\n- Implement button styles EXACTLY as specified (colors, shadows, border radius)\n- Style input fields with the exact border color and border radius\n- Match the brand's ${branding.colorScheme || 'light'} color scheme\n- Apply the brand personality: ${branding.personality?.tone || 'professional'} tone with ${branding.personality?.energy || 'medium'} energy\n- Use Tailwind CSS with inline color values matching the brand palette EXACTLY\n- If fonts need to be imported, add @import or @font-face rules to index.css\n- Create custom CSS classes in index.css for complex shadows/effects that can't be done with Tailwind\n\nFONT SETUP:\n${branding.typography?.fontFamilies?.primary ? `\n- Add font family \"${branding.typography.fontFamilies.primary}\" to your CSS\n- Use font stack: ${branding.typography?.fontStacks?.body?.join(', ') || 'system-ui, sans-serif'}\n- Set body font size to ${branding.typography?.fontSizes?.body || '16px'}` : '- Use system fonts'}\n\nCOMPONENT STRUCTURE:\n- src/index.css - Include brand fonts, custom shadows/effects, and base styling\n- src/App.jsx - Should ONLY render the requested component (e.g., just <PricingPage /> if user wants pricing)\n- src/components/[RequestedComponent].jsx - The actual component fulfilling the user's request\n\nTECHNICAL REQUIREMENTS:\n- Create a WORKING, self-contained application\n- DO NOT import components that don't exist\n- Make sure the app renders immediately with visible content\n- All colors must match the brand palette EXACTLY\n- All spacing must use the ${branding.spacing?.baseUnit || '4'}px base unit\n- Buttons must have the exact styling specified in the guidelines\n\nFocus on building something NEW, minimal, and functional that perfectly matches the ${brandGuidelines.styleName || 'brand'} aesthetic and design system.`;\n\n        } else {\n          // === NORMAL CLONE MODE PROMPT ===\n          // Store scraped data in conversation context\n          if (!scrapeData) {\n            throw new Error('Scrape data is missing');\n          }\n          setConversationContext(prev => ({\n            ...prev,\n            scrapedWebsites: [...prev.scrapedWebsites, {\n              url: url,\n              content: scrapeData,\n              timestamp: new Date()\n            }],\n            currentProject: `${url} Clone`\n          }));\n\n          // Filter out style-related context when using screenshot/URL-based generation\n          // Only keep user's explicit instructions, not inherited styles\n          let filteredContext = homeContextInput;\n          if (homeUrlInput && homeContextInput) {\n            // Check if the context contains default style names that shouldn't be inherited\n            const stylePatterns = [\n              'Glassmorphism style design',\n              'Neumorphism style design',\n              'Brutalism style design',\n              'Minimalist style design',\n              'Dark Mode style design',\n              'Gradient Rich style design',\n              '3D Depth style design',\n              'Retro Wave style design',\n              'Modern clean and minimalist style design',\n              'Fun colorful and playful style design',\n              'Corporate professional and sleek style design',\n              'Creative artistic and unique style design'\n            ];\n\n            // If the context exactly matches or starts with a style pattern, filter it out\n            const startsWithStyle = stylePatterns.some(pattern =>\n              homeContextInput.trim().startsWith(pattern)\n            );\n\n            if (startsWithStyle) {\n              // Extract only the additional instructions part after the style\n              const additionalMatch = homeContextInput.match(/\\. (.+)$/);\n              filteredContext = additionalMatch ? additionalMatch[1] : '';\n            }\n          }\n\n          prompt = `I want to recreate the ${url} website as a complete React application based on the scraped content below.\n\n${JSON.stringify(scrapeData, null, 2)}\n\n${filteredContext ? `ADDITIONAL CONTEXT/REQUIREMENTS FROM USER:\n${filteredContext}\n\nPlease incorporate these requirements into the design and implementation.` : ''}\n\nIMPORTANT INSTRUCTIONS:\n- Create a COMPLETE, working React application\n- Implement ALL sections and features from the original site\n- Use Tailwind CSS for all styling (no custom CSS files)\n- Make it responsive and modern\n- Ensure all text content matches the original\n- Create proper component structure\n- Make sure the app actually renders visible content\n- Create ALL components that you reference in imports\n${filteredContext ? '- Apply the user\\'s context/theme requirements throughout the application' : ''}\n\nFocus on the key sections and content, making it clean and modern.`;\n        }\n\n        setGenerationProgress(prev => ({\n          isGenerating: true,\n          status: 'Initializing AI...',\n          components: [],\n          currentComponent: 0,\n          streamedCode: '',\n          isStreaming: true,\n          isThinking: false,\n          thinkingText: undefined,\n          thinkingDuration: undefined,\n          // Keep previous files until new ones are generated\n          files: prev.files || [],\n          currentFile: undefined,\n          lastProcessedPosition: 0\n        }));\n        \n        const aiResponse = await fetch('/api/generate-ai-code-stream', {\n          method: 'POST',\n          headers: { 'Content-Type': 'application/json' },\n          body: JSON.stringify({ \n            prompt,\n            model: aiModel,\n            context: {\n              sandboxId: sandboxData?.sandboxId,\n              structure: structureContent,\n              conversationContext: conversationContext\n            }\n          })\n        });\n        \n        if (!aiResponse.ok || !aiResponse.body) {\n          throw new Error('Failed to generate code');\n        }\n        \n        const reader = aiResponse.body.getReader();\n        const decoder = new TextDecoder();\n        let generatedCode = '';\n        let explanation = '';\n        \n        while (true) {\n          const { done, value } = await reader.read();\n          if (done) break;\n          \n          const chunk = decoder.decode(value);\n          const lines = chunk.split('\\n');\n          \n          for (const line of lines) {\n            if (line.startsWith('data: ')) {\n              try {\n                const data = JSON.parse(line.slice(6));\n                \n                if (data.type === 'status') {\n                  setGenerationProgress(prev => ({ ...prev, status: data.message }));\n                } else if (data.type === 'thinking') {\n                  setGenerationProgress(prev => ({ \n                    ...prev, \n                    isThinking: true,\n                    thinkingText: (prev.thinkingText || '') + data.text\n                  }));\n                } else if (data.type === 'thinking_complete') {\n                  setGenerationProgress(prev => ({ \n                    ...prev, \n                    isThinking: false,\n                    thinkingDuration: data.duration\n                  }));\n                } else if (data.type === 'conversation') {\n                  // Add conversational text to chat only if it's not code\n                  let text = data.text || '';\n                  \n                  // Remove package tags from the text\n                  text = text.replace(/<package>[^<]*<\\/package>/g, '');\n                  text = text.replace(/<packages>[^<]*<\\/packages>/g, '');\n                  \n                  // Filter out any XML tags and file content that slipped through\n                  if (!text.includes('<file') && !text.includes('import React') && \n                      !text.includes('export default') && !text.includes('className=') &&\n                      text.trim().length > 0) {\n                    addChatMessage(text.trim(), 'ai');\n                  }\n                } else if (data.type === 'stream' && data.raw) {\n                  setGenerationProgress(prev => {\n                    const newStreamedCode = prev.streamedCode + data.text;\n                    \n                    // Tab is already switched after scraping\n                    \n                    const updatedState = { \n                      ...prev, \n                      streamedCode: newStreamedCode,\n                      isStreaming: true,\n                      isThinking: false,\n                      status: 'Generating code...'\n                    };\n                    \n                    // Process complete files from the accumulated stream\n                    const fileRegex = /<file path=\"([^\"]+)\">([^]*?)<\\/file>/g;\n                    let match;\n                    const processedFiles = new Set(prev.files.map(f => f.path));\n                    \n                    while ((match = fileRegex.exec(newStreamedCode)) !== null) {\n                      const filePath = match[1];\n                      const fileContent = match[2];\n                      \n                      // Only add if we haven't processed this file yet\n                      if (!processedFiles.has(filePath)) {\n                        const fileExt = filePath.split('.').pop() || '';\n                        const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                        fileExt === 'css' ? 'css' :\n                                        fileExt === 'json' ? 'json' :\n                                        fileExt === 'html' ? 'html' : 'text';\n                        \n                        // Check if file already exists\n                        const existingFileIndex = updatedState.files.findIndex(f => f.path === filePath);\n                        \n                        if (existingFileIndex >= 0) {\n                          // Update existing file and mark as edited\n                          updatedState.files = [\n                            ...updatedState.files.slice(0, existingFileIndex),\n                            {\n                              ...updatedState.files[existingFileIndex],\n                              content: fileContent.trim(),\n                              type: fileType,\n                              completed: true,\n                              edited: true\n                            },\n                            ...updatedState.files.slice(existingFileIndex + 1)\n                          ];\n                        } else {\n                          // Add new file\n                          updatedState.files = [...updatedState.files, {\n                            path: filePath,\n                            content: fileContent.trim(),\n                            type: fileType,\n                            completed: true,\n                            edited: false\n                          }];\n                        }\n                        \n                        // Only show file status if not in edit mode\n                        if (!prev.isEdit) {\n                          updatedState.status = `Completed ${filePath}`;\n                        }\n                        processedFiles.add(filePath);\n                      }\n                    }\n                    \n                    // Check for current file being generated (incomplete file at the end)\n                    const lastFileMatch = newStreamedCode.match(/<file path=\"([^\"]+)\">([^]*?)$/);\n                    if (lastFileMatch && !lastFileMatch[0].includes('</file>')) {\n                      const filePath = lastFileMatch[1];\n                      const partialContent = lastFileMatch[2];\n                      \n                      if (!processedFiles.has(filePath)) {\n                        const fileExt = filePath.split('.').pop() || '';\n                        const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                        fileExt === 'css' ? 'css' :\n                                        fileExt === 'json' ? 'json' :\n                                        fileExt === 'html' ? 'html' : 'text';\n                        \n                        updatedState.currentFile = { \n                          path: filePath, \n                          content: partialContent, \n                          type: fileType \n                        };\n                        // Only show file status if not in edit mode\n                        if (!prev.isEdit) {\n                          updatedState.status = `Generating ${filePath}`;\n                        }\n                      }\n                    } else {\n                      updatedState.currentFile = undefined;\n                    }\n                    \n                    return updatedState;\n                  });\n                } else if (data.type === 'complete') {\n                  generatedCode = data.generatedCode;\n                  explanation = data.explanation;\n                  \n                  // Save the last generated code\n                  setConversationContext(prev => ({\n                    ...prev,\n                    lastGeneratedCode: generatedCode\n                  }));\n                }\n              } catch (e) {\n                console.error('Failed to parse SSE data:', e);\n              }\n            }\n          }\n        }\n        \n        setGenerationProgress(prev => ({\n          ...prev,\n          isGenerating: false,\n          isStreaming: false,\n          status: 'Generation complete!'\n        }));\n        \n        if (generatedCode) {\n          addChatMessage('AI recreation generated!', 'system');\n          \n          // Add the explanation to chat if available\n          if (explanation && explanation.trim()) {\n            addChatMessage(explanation, 'ai');\n          }\n          \n          setPromptInput(generatedCode);\n\n          // Apply the code (first time is not edit mode)\n          await applyGeneratedCode(generatedCode, false);\n\n          addChatMessage(\n            brandExtensionMode\n              ? `Successfully built your custom component using ${cleanUrl}'s brand guidelines! You can now ask me to modify it or add more features.`\n              : `Successfully recreated ${url} as a modern React app${homeContextInput ? ` with your requested context: \"${homeContextInput}\"` : ''}! The scraped content is now in my context, so you can ask me to modify specific sections or add features based on the original site.`,\n            'ai',\n            {\n              scrapedUrl: url,\n              scrapedContent: brandExtensionMode ? { brandGuidelines } : scrapeData,\n              generatedCode: generatedCode\n            }\n          );\n          \n          setConversationContext(prev => ({\n            ...prev,\n            generatedComponents: [],\n            appliedCode: [...prev.appliedCode, {\n              files: [],\n              timestamp: new Date()\n            }]\n          }));\n        } else {\n          throw new Error('Failed to generate recreation');\n        }\n        \n        setUrlInput('');\n        setUrlStatus([]);\n        setHomeContextInput('');\n        \n        // Clear generation progress and all screenshot/design states\n        setGenerationProgress(prev => ({\n          ...prev,\n          isGenerating: false,\n          isStreaming: false,\n          status: 'Generation complete!'\n        }));\n        \n        // Clear screenshot and preparing design states to prevent them from showing on next run\n        setIsScreenshotLoaded(false); // Reset loaded state\n        setUrlScreenshot(null);\n        setIsPreparingDesign(false);\n        setTargetUrl('');\n        setScreenshotError(null);\n        setLoadingStage(null); // Clear loading stage\n        setIsStartingNewGeneration(false); // Clear new generation flag\n        setShowLoadingBackground(false); // Clear loading background\n        \n        setTimeout(() => {\n          // Switch back to preview tab but keep files\n          setActiveTab('preview');\n        }, 1000); // Show completion briefly then switch\n      } catch (error: any) {\n        addChatMessage(`Failed to clone website: ${error.message}`, 'system');\n        setUrlStatus([]);\n        setIsPreparingDesign(false);\n        setIsStartingNewGeneration(false); // Clear new generation flag on error\n        setLoadingStage(null);\n        // Also clear generation progress on error\n        setGenerationProgress(prev => ({\n          ...prev,\n          isGenerating: false,\n          isStreaming: false,\n          status: '',\n          // Keep files to display in sidebar\n          files: prev.files\n        }));\n      }\n    }, 500);\n  };\n\n  return (\n    <HeaderProvider>\n      <div className=\"font-sans bg-background text-foreground h-screen flex flex-col\">\n      <div className=\"bg-white py-[15px] py-[8px] border-b border-border-faint flex items-center justify-between shadow-sm\">\n        <HeaderBrandKit />\n        <div className=\"flex items-center gap-2\">\n          {/* Model Selector - Left side */}\n          <select\n            value={aiModel}\n            onChange={(e) => {\n              const newModel = e.target.value;\n              setAiModel(newModel);\n              const params = new URLSearchParams(searchParams);\n              params.set('model', newModel);\n              if (sandboxData?.sandboxId) {\n                params.set('sandbox', sandboxData.sandboxId);\n              }\n              router.push(`/generation?${params.toString()}`);\n            }}\n            className=\"px-3 py-1.5 text-sm text-gray-900 bg-gray-50 border border-gray-200 rounded-lg focus:outline-none focus:border-gray-300 transition-colors\"\n          >\n            {appConfig.ai.availableModels.map(model => (\n              <option key={model} value={model}>\n                {appConfig.ai.modelDisplayNames?.[model] || model}\n              </option>\n            ))}\n          </select>\n          <button \n            onClick={() => createSandbox()}\n            className=\"p-8 rounded-lg transition-colors bg-gray-50 border border-gray-200 text-gray-700 hover:bg-gray-100\"\n            title=\"Create new sandbox\"\n          >\n            <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n              <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n            </svg>\n          </button>\n          <button \n            onClick={reapplyLastGeneration}\n            className=\"p-8 rounded-lg transition-colors bg-gray-50 border border-gray-200 text-gray-700 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed\"\n            title=\"Re-apply last generation\"\n            disabled={!conversationContext.lastGeneratedCode || !sandboxData}\n          >\n            <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n              <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15\" />\n            </svg>\n          </button>\n          <button \n            onClick={downloadZip}\n            disabled={!sandboxData}\n            className=\"p-8 rounded-lg transition-colors bg-gray-50 border border-gray-200 text-gray-700 hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed\"\n            title=\"Download your Vite app as ZIP\"\n          >\n            <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n              <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10\" />\n            </svg>\n          </button>\n       \n        </div>\n      </div>\n\n      <div className=\"flex-1 flex overflow-hidden\">\n        {/* Center Panel - AI Chat (1/3 of remaining width) */}\n        <div className=\"flex-1 max-w-[400px] flex flex-col border-r border-border bg-background\">\n          {/* Sidebar Input Component */}\n          {!hasInitialSubmission ? (\n            <div className=\"p-4 border-b border-border\">\n              <SidebarInput\n                onSubmit={(url, style, model, instructions) => {\n                  // Mark that we've had an initial submission\n                  setHasInitialSubmission(true);\n                  \n                  // Store the configuration in sessionStorage (same as home page)\n                  sessionStorage.setItem('targetUrl', url);\n                  sessionStorage.setItem('selectedStyle', style);\n                  sessionStorage.setItem('selectedModel', model);\n                  if (instructions) {\n                    sessionStorage.setItem('additionalInstructions', instructions);\n                  }\n                  sessionStorage.setItem('autoStart', 'true');\n                  \n                  // Start generation using the existing logic\n                  setHomeUrlInput(url);\n                  setHomeContextInput(instructions || '');\n                  startGeneration();\n                }}\n                disabled={loading || generationProgress.isGenerating}\n              />\n            </div>\n          ) : null}\n\n          {conversationContext.scrapedWebsites.length > 0 && (\n            <div className=\"p-4 bg-card border-b border-gray-200\">\n              <div className=\"flex flex-col gap-4\">\n                {conversationContext.scrapedWebsites.map((site, idx) => {\n                  // Extract favicon and site info from the scraped data\n                  const metadata = site.content?.metadata || {};\n                  const sourceURL = metadata.sourceURL || site.url;\n                  const favicon = metadata.favicon || `https://www.google.com/s2/favicons?domain=${new URL(sourceURL).hostname}&sz=128`;\n                  const siteName = metadata.ogSiteName || metadata.title || new URL(sourceURL).hostname;\n                  const screenshot = site.content?.screenshot || sessionStorage.getItem('websiteScreenshot');\n                  \n                  return (\n                    <div key={idx} className=\"flex flex-col gap-3\">\n                      {/* Site info with favicon */}\n                      <div className=\"flex items-center gap-4 text-sm\">\n                        {/* eslint-disable-next-line @next/next/no-img-element */}\n                        <img \n                          src={favicon} \n                          alt={siteName}\n                          className=\"w-16 h-16 rounded\"\n                          onError={(e) => {\n                            e.currentTarget.src = `https://www.google.com/s2/favicons?domain=${new URL(sourceURL).hostname}&sz=128`;\n                          }}\n                        />\n                        <a \n                          href={sourceURL} \n                          target=\"_blank\" \n                          rel=\"noopener noreferrer\"\n                          className=\"text-black hover:text-gray-700 truncate max-w-[250px] font-medium\"\n                          title={sourceURL}\n                        >\n                          {siteName}\n                        </a>\n                      </div>\n                      \n                      {/* Pinned screenshot */}\n                      {screenshot && (\n                        <div className=\"w-full\">\n                          <div className=\"flex items-center justify-between mb-2\">\n                            <span className=\"text-xs font-medium text-gray-600\">Screenshot Preview</span>\n                            <button\n                              onClick={() => setScreenshotCollapsed(!screenshotCollapsed)}\n                              className=\"text-gray-500 hover:text-gray-700 transition-colors p-1\"\n                              aria-label={screenshotCollapsed ? 'Expand screenshot' : 'Collapse screenshot'}\n                            >\n                              <svg\n                                width=\"16\"\n                                height=\"16\"\n                                viewBox=\"0 0 16 16\"\n                                fill=\"none\"\n                                xmlns=\"http://www.w3.org/2000/svg\"\n                                className={`transition-transform duration-300 ${screenshotCollapsed ? 'rotate-180' : ''}`}\n                              >\n                                <path d=\"M4 6L8 10L12 6\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                              </svg>\n                            </button>\n                          </div>\n                          <div\n                            className=\"w-full rounded-lg overflow-hidden border border-gray-200 transition-all duration-300\"\n                            style={{\n                              opacity: screenshotCollapsed ? 0 : 1,\n                              transform: screenshotCollapsed ? 'translateY(-20px)' : 'translateY(0)',\n                              pointerEvents: screenshotCollapsed ? 'none' : 'auto',\n                              maxHeight: screenshotCollapsed ? '0' : '200px'\n                            }}\n                          >\n                            {/* eslint-disable-next-line @next/next/no-img-element */}\n                            <img\n                              src={screenshot}\n                              alt={`${siteName} preview`}\n                              className=\"w-full h-auto object-cover\"\n                              style={{ maxHeight: '200px' }}\n                            />\n                          </div>\n                        </div>\n                      )}\n                    </div>\n                  );\n                })}\n              </div>\n            </div>\n          )}\n\n          <div\n            className=\"flex-1 overflow-y-auto p-6 flex flex-col gap-4 scrollbar-hide\"\n            ref={chatMessagesRef}>\n            {chatMessages.map((msg, idx) => {\n              // Check if this message is from a successful generation\n              const isGenerationComplete = msg.content.includes('Successfully recreated') || \n                                         msg.content.includes('AI recreation generated!') ||\n                                         msg.content.includes('Code generated!');\n              \n              // Get the files from metadata if this is a completion message\n              // const completedFiles = msg.metadata?.appliedFiles || [];\n              \n              return (\n                <div key={idx} className=\"block\">\n                  <div className={`flex ${msg.type === 'user' ? 'justify-end' : 'justify-start'}`}>\n                    <div className=\"block\">\n                      <div className={`block rounded-[10px] px-14 py-8 ${\n                        msg.type === 'user' ? 'bg-[#36322F] text-white ml-auto max-w-[80%]' :\n                        msg.type === 'ai' ? 'bg-gray-100 text-gray-900 mr-auto max-w-[80%]' :\n                        msg.type === 'system' ? 'bg-[#36322F] text-white text-sm' :\n                        msg.type === 'command' ? 'bg-[#36322F] text-white font-mono text-sm' :\n                        msg.type === 'error' ? 'bg-red-900 text-red-100 text-sm border border-red-700' :\n                        'bg-[#36322F] text-white text-sm'\n                      }`}>\n                    {msg.type === 'command' ? (\n                      <div className=\"flex items-start gap-2\">\n                        <span className={`text-xs ${\n                          msg.metadata?.commandType === 'input' ? 'text-blue-400' :\n                          msg.metadata?.commandType === 'error' ? 'text-red-400' :\n                          msg.metadata?.commandType === 'success' ? 'text-green-400' :\n                          'text-gray-400'\n                        }`}>\n                          {msg.metadata?.commandType === 'input' ? '$' : '>'}\n                        </span>\n                        <span className=\"flex-1 whitespace-pre-wrap text-white\">{msg.content}</span>\n                      </div>\n                    ) : msg.type === 'error' ? (\n                      <div className=\"flex items-start gap-3\">\n                        <div className=\"flex-shrink-0\">\n                          <div className=\"w-8 h-8 bg-red-800 rounded-full flex items-center justify-center\">\n                            <svg className=\"w-6 h-6 text-red-200\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                              <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z\" />\n                            </svg>\n                          </div>\n                        </div>\n                        <div className=\"flex-1\">\n                          <div className=\"font-semibold mb-1\">Build Errors Detected</div>\n                          <div className=\"whitespace-pre-wrap text-sm\">{msg.content}</div>\n                          <div className=\"mt-2 text-xs opacity-70\">Press 'F' or click the Fix button above to resolve</div>\n                        </div>\n                      </div>\n                    ) : (\n                      <span className=\"text-sm\">{msg.content}</span>\n                    )}\n                      </div>\n                  \n                      {/* Show branding data if this is a brand extraction message */}\n                      {msg.metadata?.brandingData && (\n                        <div className=\"mt-3 bg-gradient-to-br from-gray-50 to-white border-2 border-gray-200 rounded-xl overflow-hidden max-w-[500px] shadow-sm\">\n                          <div className=\"bg-[#36322F] px-16 py-12\">\n                            <div className=\"flex items-center gap-8\">\n                              <Image\n                                src={`https://www.google.com/s2/favicons?domain=${msg.metadata.sourceUrl}&sz=32`}\n                                alt=\"\"\n                                width={64}\n                                height={64}\n                                className=\"w-16 h-16\"\n                              />\n                              <div className=\"text-sm font-semibold text-white\">\n                                Brand Guidelines\n                              </div>\n                            </div>\n                          </div>\n\n                          <div className=\"p-16\">\n                            {/* Color Scheme Mode */}\n                            {msg.metadata.brandingData.colorScheme && (\n                              <div className=\"mb-16\">\n                                <div className=\"text-sm\">\n                                  <span className=\"text-gray-600 font-medium\">Mode:</span>{' '}\n                                  <span className=\"font-semibold text-gray-900 capitalize\">{msg.metadata.brandingData.colorScheme}</span>\n                                </div>\n                              </div>\n                            )}\n\n                            {/* Colors */}\n                            {msg.metadata.brandingData.colors && (\n                              <div className=\"mb-16\">\n                                <div className=\"text-sm font-semibold text-gray-900 mb-8\">Colors</div>\n                                <div className=\"flex flex-wrap gap-12\">\n                                  {msg.metadata.brandingData.colors.primary && (\n                                    <div className=\"flex items-center gap-8\">\n                                      <div className=\"w-32 h-32 rounded border border-gray-300\" style={{ backgroundColor: msg.metadata.brandingData.colors.primary }} />\n                                      <div className=\"text-sm\">\n                                        <div className=\"font-semibold text-gray-900\">Primary</div>\n                                        <div className=\"text-gray-600 font-mono text-xs\">{msg.metadata.brandingData.colors.primary}</div>\n                                      </div>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.colors.accent && (\n                                    <div className=\"flex items-center gap-8\">\n                                      <div className=\"w-32 h-32 rounded border border-gray-300\" style={{ backgroundColor: msg.metadata.brandingData.colors.accent }} />\n                                      <div className=\"text-sm\">\n                                        <div className=\"font-semibold text-gray-900\">Accent</div>\n                                        <div className=\"text-gray-600 font-mono text-xs\">{msg.metadata.brandingData.colors.accent}</div>\n                                      </div>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.colors.background && (\n                                    <div className=\"flex items-center gap-8\">\n                                      <div className=\"w-32 h-32 rounded border border-gray-300\" style={{ backgroundColor: msg.metadata.brandingData.colors.background }} />\n                                      <div className=\"text-sm\">\n                                        <div className=\"font-semibold text-gray-900\">Background</div>\n                                        <div className=\"text-gray-600 font-mono text-xs\">{msg.metadata.brandingData.colors.background}</div>\n                                      </div>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.colors.textPrimary && (\n                                    <div className=\"flex items-center gap-8\">\n                                      <div className=\"w-32 h-32 rounded border border-gray-300\" style={{ backgroundColor: msg.metadata.brandingData.colors.textPrimary }} />\n                                      <div className=\"text-sm\">\n                                        <div className=\"font-semibold text-gray-900\">Text</div>\n                                        <div className=\"text-gray-600 font-mono text-xs\">{msg.metadata.brandingData.colors.textPrimary}</div>\n                                      </div>\n                                    </div>\n                                  )}\n                                </div>\n                              </div>\n                            )}\n\n                            {/* Typography */}\n                            {msg.metadata.brandingData.typography && (\n                              <div className=\"mb-16\">\n                                <div className=\"text-sm font-semibold text-gray-900 mb-8\">Typography</div>\n                                <div className=\"grid grid-cols-2 gap-12 text-sm\">\n                                  {msg.metadata.brandingData.typography.fontFamilies?.primary && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">Primary:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.typography.fontFamilies.primary}</span>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.typography.fontFamilies?.heading && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">Heading:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.typography.fontFamilies.heading}</span>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.typography.fontSizes?.h1 && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">H1 Size:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.typography.fontSizes.h1}</span>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.typography.fontSizes?.h2 && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">H2 Size:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.typography.fontSizes.h2}</span>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.typography.fontSizes?.body && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">Body Size:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.typography.fontSizes.body}</span>\n                                    </div>\n                                  )}\n                                </div>\n                              </div>\n                            )}\n\n                            {/* Spacing */}\n                            {msg.metadata.brandingData.spacing && (\n                              <div className=\"mb-16\">\n                                <div className=\"text-sm font-semibold text-gray-900 mb-8\">Spacing</div>\n                                <div className=\"flex flex-wrap gap-16 text-sm\">\n                                  {msg.metadata.brandingData.spacing.baseUnit && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">Base Unit:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.spacing.baseUnit}px</span>\n                                    </div>\n                                  )}\n                                  {msg.metadata.brandingData.spacing.borderRadius && (\n                                    <div>\n                                      <span className=\"text-gray-600 font-medium\">Border Radius:</span>{' '}\n                                      <span className=\"font-semibold text-gray-900\">{msg.metadata.brandingData.spacing.borderRadius}</span>\n                                    </div>\n                                  )}\n                                </div>\n                              </div>\n                            )}\n\n                            {/* Button Styles */}\n                            {msg.metadata.brandingData.components?.buttonPrimary && (\n                              <div className=\"mb-16\">\n                                <div className=\"text-sm font-semibold text-gray-900 mb-8\">Button Styles</div>\n                                <div className=\"flex flex-wrap gap-12\">\n                                  <div>\n                                    <div className=\"text-xs text-gray-600 mb-6 font-medium\">Primary Button</div>\n                                    <button\n                                      className=\"px-16 py-8 text-sm font-medium\"\n                                      style={{\n                                        backgroundColor: msg.metadata.brandingData.components.buttonPrimary.background,\n                                        color: msg.metadata.brandingData.components.buttonPrimary.textColor,\n                                        borderRadius: msg.metadata.brandingData.components.buttonPrimary.borderRadius,\n                                        boxShadow: msg.metadata.brandingData.components.buttonPrimary.shadow\n                                      }}\n                                    >\n                                      Sample Button\n                                    </button>\n                                  </div>\n                                  {msg.metadata.brandingData.components?.buttonSecondary && (\n                                    <div>\n                                      <div className=\"text-xs text-gray-600 mb-6 font-medium\">Secondary Button</div>\n                                      <button\n                                        className=\"px-16 py-8 text-sm font-medium\"\n                                        style={{\n                                          backgroundColor: msg.metadata.brandingData.components.buttonSecondary.background,\n                                          color: msg.metadata.brandingData.components.buttonSecondary.textColor,\n                                          borderRadius: msg.metadata.brandingData.components.buttonSecondary.borderRadius,\n                                          boxShadow: msg.metadata.brandingData.components.buttonSecondary.shadow\n                                        }}\n                                      >\n                                        Sample Button\n                                      </button>\n                                    </div>\n                                  )}\n                                </div>\n                              </div>\n                            )}\n\n                            {/* Personality */}\n                            {msg.metadata.brandingData.personality && (\n                              <div className=\"text-sm\">\n                                <span className=\"text-gray-600 font-medium\">Personality:</span>{' '}\n                                <span className=\"font-semibold text-gray-900 capitalize\">\n                                  {msg.metadata.brandingData.personality.tone} tone, {msg.metadata.brandingData.personality.energy} energy\n                                </span>\n                              </div>\n                            )}\n\n                            {/* Target Audience */}\n                            {msg.metadata.brandingData.personality?.targetAudience && (\n                              <div className=\"text-sm mt-8\">\n                                <span className=\"text-gray-600 font-medium\">Target:</span>{' '}\n                                <span className=\"text-gray-900\">{msg.metadata.brandingData.personality.targetAudience}</span>\n                              </div>\n                            )}\n                          </div>\n                        </div>\n                      )}\n\n                      {/* Show applied files if this is an apply success message */}\n                      {msg.metadata?.appliedFiles && msg.metadata.appliedFiles.length > 0 && (\n                    <div className=\"mt-3 inline-block bg-gray-100 rounded-[10px] p-5\">\n                      <div className=\"text-sm font-medium mb-3 text-gray-700\">\n                        {msg.content.includes('Applied') ? 'Files Updated:' : 'Generated Files:'}\n                      </div>\n                      <div className=\"flex flex-wrap items-start gap-2\">\n                        {msg.metadata.appliedFiles.map((filePath, fileIdx) => {\n                          const fileName = filePath.split('/').pop() || filePath;\n                          const fileExt = fileName.split('.').pop() || '';\n                          const fileType = fileExt === 'jsx' || fileExt === 'js' ? 'javascript' :\n                                          fileExt === 'css' ? 'css' :\n                                          fileExt === 'json' ? 'json' : 'text';\n\n                          return (\n                            <div\n                              key={`applied-${fileIdx}`}\n                              className=\"inline-flex items-center gap-1.5 px-6 py-1.5 bg-[#36322F] text-white rounded-[10px] text-sm animate-fade-in-up\"\n                              style={{ animationDelay: `${fileIdx * 30}ms` }}\n                            >\n                              <span className={`inline-block w-1.5 h-1.5 rounded-full ${\n                                fileType === 'css' ? 'bg-blue-400' :\n                                fileType === 'javascript' ? 'bg-yellow-400' :\n                                fileType === 'json' ? 'bg-green-400' :\n                                'bg-gray-400'\n                              }`} />\n                              {fileName}\n                            </div>\n                          );\n                        })}\n                      </div>\n                    </div>\n                  )}\n                  \n                      {/* Show generated files for completion messages - but only if no appliedFiles already shown */}\n                      {isGenerationComplete && generationProgress.files.length > 0 && idx === chatMessages.length - 1 && !msg.metadata?.appliedFiles && !chatMessages.some(m => m.metadata?.appliedFiles) && (\n                    <div className=\"mt-2 inline-block bg-gray-100 rounded-[10px] p-3\">\n                      <div className=\"text-xs font-medium mb-1 text-gray-700\">Generated Files:</div>\n                      <div className=\"flex flex-wrap items-start gap-1\">\n                        {generationProgress.files.map((file, fileIdx) => (\n                          <div\n                            key={`complete-${fileIdx}`}\n                            className=\"inline-flex items-center gap-1.5 px-6 py-1.5 bg-[#36322F] text-white rounded-[10px] text-xs animate-fade-in-up\"\n                            style={{ animationDelay: `${fileIdx * 30}ms` }}\n                          >\n                            <span className={`inline-block w-1.5 h-1.5 rounded-full ${\n                              file.type === 'css' ? 'bg-blue-400' :\n                              file.type === 'javascript' ? 'bg-yellow-400' :\n                              file.type === 'json' ? 'bg-green-400' :\n                              'bg-gray-400'\n                            }`} />\n                            {file.path.split('/').pop()}\n                          </div>\n                        ))}\n                      </div>\n                    </div>\n                  )}\n                    </div>\n                    </div>\n                  </div>\n              );\n            })}\n            \n            {/* Code application progress */}\n            {codeApplicationState.stage && (\n              <CodeApplicationProgress state={codeApplicationState} />\n            )}\n            \n            {/* File generation progress - inline display (during generation) */}\n            {generationProgress.isGenerating && (\n              <div className=\"inline-block bg-gray-100 rounded-lg p-3\">\n                <div className=\"text-sm font-medium mb-2 text-gray-700\">\n                  {generationProgress.status}\n                </div>\n                <div className=\"flex flex-wrap items-start gap-1\">\n                  {/* Show completed files */}\n                  {generationProgress.files.map((file, idx) => (\n                    <div\n                      key={`file-${idx}`}\n                      className=\"inline-flex items-center gap-1.5 px-6 py-1.5 bg-[#36322F] text-white rounded-[10px] text-xs animate-fade-in-up\"\n                      style={{ animationDelay: `${idx * 30}ms` }}\n                    >\n                      <svg width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                        <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={3} d=\"M5 13l4 4L19 7\" />\n                      </svg>\n                      {file.path.split('/').pop()}\n                    </div>\n                  ))}\n                  \n                  {/* Show current file being generated */}\n                  {generationProgress.currentFile && (\n                    <div className=\"flex items-center gap-1 px-2 py-1 bg-[#36322F]/70 text-white rounded-[10px] text-sm animate-pulse\"\n                      style={{ animationDelay: `${generationProgress.files.length * 30}ms` }}>\n                      <div className=\"w-16 h-16 border-2 border-white border-t-transparent rounded-full animate-spin\" />\n                      {generationProgress.currentFile.path.split('/').pop()}\n                    </div>\n                  )}\n                </div>\n                \n                {/* Live streaming response display */}\n                {generationProgress.streamedCode && (\n                  <motion.div \n                    initial={{ opacity: 0, height: 0 }}\n                    animate={{ opacity: 1, height: 'auto' }}\n                    exit={{ opacity: 0, height: 0 }}\n                    transition={{ duration: 0.3 }}\n                    className=\"mt-3 border-t border-gray-300 pt-3\"\n                  >\n                    <div className=\"flex items-center gap-2 mb-2\">\n                      <div className=\"flex items-center gap-1\">\n                        <div className=\"w-3 h-3 bg-green-500 rounded-full animate-pulse\" />\n                        <span className=\"text-xs font-medium text-gray-600\">AI Response Stream</span>\n                      </div>\n                      <div className=\"flex-1 h-px bg-gradient-to-r from-gray-300 to-transparent\" />\n                    </div>\n                    <div className=\"bg-gray-900 border border-gray-700 rounded max-h-128 overflow-y-auto scrollbar-hide\">\n                      <SyntaxHighlighter\n                        language=\"jsx\"\n                        style={vscDarkPlus}\n                        customStyle={{\n                          margin: 0,\n                          padding: '0.75rem',\n                          fontSize: '11px',\n                          lineHeight: '1.5',\n                          background: 'transparent',\n                          maxHeight: '8rem',\n                          overflow: 'hidden'\n                        }}\n                      >\n                        {(() => {\n                          const lastContent = generationProgress.streamedCode.slice(-1000);\n                          // Show the last part of the stream, starting from a complete tag if possible\n                          const startIndex = lastContent.indexOf('<');\n                          return startIndex !== -1 ? lastContent.slice(startIndex) : lastContent;\n                        })()}\n                      </SyntaxHighlighter>\n                      <span className=\"inline-block w-3 h-4 bg-orange-400 ml-3 mb-3 animate-pulse\" />\n                    </div>\n                  </motion.div>\n                )}\n              </div>\n            )}\n          </div>\n\n          <div className=\"p-4 border-t border-border bg-background-base\">\n            <HeroInput\n              value={aiChatInput}\n              onChange={setAiChatInput}\n              onSubmit={sendChatMessage}\n              placeholder=\"Describe what you want to build...\"\n              showSearchFeatures={false}\n            />\n          </div>\n        </div>\n\n        {/* Right Panel - Preview or Generation (2/3 of remaining width) */}\n        <div className=\"flex-1 flex flex-col overflow-hidden\">\n          <div className=\"px-3 pt-4 pb-4 bg-white border-b border-gray-200 flex justify-between items-center\">\n            <div className=\"flex items-center gap-2\">\n              {/* Toggle-style Code/View switcher */}\n              <div className=\"inline-flex bg-gray-100 border border-gray-200 rounded-md p-0.5\">\n                <button\n                  onClick={() => setActiveTab('generation')}\n                  className={`px-3 py-1 rounded transition-all text-xs font-medium ${\n                    activeTab === 'generation' \n                      ? 'bg-white text-gray-900 shadow-sm' \n                      : 'bg-transparent text-gray-600 hover:text-gray-900'\n                  }`}\n                >\n                  <div className=\"flex items-center gap-1.5\">\n                    <svg width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                      <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4\" />\n                    </svg>\n                    <span>Code</span>\n                  </div>\n                </button>\n                <button\n                  onClick={() => setActiveTab('preview')}\n                  className={`px-3 py-1 rounded transition-all text-xs font-medium ${\n                    activeTab === 'preview' \n                      ? 'bg-white text-gray-900 shadow-sm' \n                      : 'bg-transparent text-gray-600 hover:text-gray-900'\n                  }`}\n                >\n                  <div className=\"flex items-center gap-1.5\">\n                    <svg width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                      <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 12a3 3 0 11-6 0 3 3 0 016 0z\" />\n                      <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z\" />\n                    </svg>\n                    <span>View</span>\n                  </div>\n                </button>\n              </div>\n            </div>\n            <div className=\"flex gap-2 items-center\">\n              {/* Files generated count */}\n              {activeTab === 'generation' && !generationProgress.isEdit && generationProgress.files.length > 0 && (\n                <div className=\"text-gray-500 text-xs font-medium\">\n                  {generationProgress.files.length} files generated\n                </div>\n              )}\n              \n              {/* Live Code Generation Status */}\n              {activeTab === 'generation' && generationProgress.isGenerating && (\n                <div className=\"inline-flex items-center gap-1.5 px-2.5 py-1 bg-gray-100 border border-gray-200 rounded-md text-xs font-medium text-gray-700\">\n                  <div className=\"w-1.5 h-1.5 bg-green-500 rounded-full animate-pulse\" />\n                  {generationProgress.isEdit ? 'Editing code' : 'Live generation'}\n                </div>\n              )}\n              \n              {/* Sandbox Status Indicator */}\n              {sandboxData && (\n                <div className=\"inline-flex items-center gap-1.5 px-2.5 py-1 bg-gray-100 border border-gray-200 rounded-md text-xs font-medium text-gray-700\">\n                  <div className=\"w-1.5 h-1.5 bg-green-500 rounded-full\" />\n                  Sandbox active\n                </div>\n              )}\n              \n              {/* Open in new tab button */}\n              {sandboxData && (\n                <a \n                  href={sandboxData.url} \n                  target=\"_blank\" \n                  rel=\"noopener noreferrer\"\n                  title=\"Open in new tab\"\n                  className=\"p-1.5 rounded-md transition-all text-gray-600 hover:text-gray-900 hover:bg-gray-100\"\n                >\n                  <svg width=\"14\" height=\"14\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                    <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" />\n                  </svg>\n                </a>\n              )}\n            </div>\n          </div>\n          <div className=\"flex-1 relative overflow-hidden\">\n            {renderMainContent()}\n          </div>\n        </div>\n      </div>\n\n\n\n\n    </div>\n    </HeaderProvider>\n  );\n}\n\nexport default function Page() {\n  return (\n    <Suspense fallback={<div className=\"flex items-center justify-center min-h-screen\">Loading...</div>}>\n      <AISandboxPage />\n    </Suspense>\n  );\n}"
  },
  {
    "path": "app/globals.css",
    "content": "@import \"../styles/main.css\";"
  },
  {
    "path": "app/landing.tsx",
    "content": "\"use client\";\n\n// useState not currently used but kept for future interactivity\nimport Link from \"next/link\";\n\n// Import shared components\nimport { HeaderProvider } from \"@/components/shared/header/HeaderContext\";\n// import HeaderBrandKit from \"@/components/shared/header/BrandKit/BrandKit\"; // Not used in current implementation\nimport HeaderWrapper from \"@/components/shared/header/Wrapper/Wrapper\";\nimport HeaderDropdownWrapper from \"@/components/shared/header/Dropdown/Wrapper/Wrapper\";\nimport ButtonUI from \"@/components/ui/shadcn/button\";\n\n// Import hero section components\nimport HomeHeroBackground from \"@/components/app/(home)/sections/hero/Background/Background\";\nimport { BackgroundOuterPiece } from \"@/components/app/(home)/sections/hero/Background/BackgroundOuterPiece\";\nimport HomeHeroBadge from \"@/components/app/(home)/sections/hero/Badge/Badge\";\nimport HomeHeroPixi from \"@/components/app/(home)/sections/hero/Pixi/Pixi\";\nimport HomeHeroTitle from \"@/components/app/(home)/sections/hero/Title/Title\";\nimport HeroInput from \"@/components/app/(home)/sections/hero-input/HeroInput\";\nimport { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport HeroFlame from \"@/components/shared/effects/flame/hero-flame\";\nimport FirecrawlIcon from \"@/components/FirecrawlIcon\";\nimport FirecrawlLogo from \"@/components/FirecrawlLogo\";\n\nexport default function LandingPage() {\n  return (\n    <HeaderProvider>\n      <div className=\"min-h-screen bg-background-base\">\n        {/* Header/Navigation Section */}\n        <HeaderDropdownWrapper />\n\n        <div className=\"sticky top-0 left-0 w-full z-[101] bg-background-base header\">\n          <div className=\"absolute top-0 cmw-container border-x border-border-faint h-full pointer-events-none\" />\n          <div className=\"h-1 bg-border-faint w-full left-0 -bottom-1 absolute\" />\n          \n          <div className=\"cmw-container absolute h-full pointer-events-none top-0\">\n            <Connector className=\"absolute -left-[10.5px] -bottom-11\" />\n            <Connector className=\"absolute -right-[10.5px] -bottom-11\" />\n          </div>\n\n          <HeaderWrapper>\n            <div className=\"max-w-[900px] mx-auto w-full flex justify-between items-center\">\n              <div className=\"flex gap-24 items-center\">\n                <Link href=\"/\" className=\"flex items-center gap-2\">\n                  <FirecrawlIcon className=\"w-7 h-7 text-accent-black\" />\n                  <FirecrawlLogo />\n                </Link>\n              </div>\n\n              <div className=\"flex gap-8\">\n                <Link\n                  href=\"https://github.com/mendableai/open-lovable\"\n                  target=\"_blank\"\n                  className=\"contents\"\n                >\n                  <ButtonUI variant=\"tertiary\">\n                    <svg className=\"w-4 h-4\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\n                      <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\"/>\n                    </svg>\n                    Use this Template\n                  </ButtonUI>\n                </Link>\n              </div>\n            </div>\n          </HeaderWrapper>\n        </div>\n\n        {/* Hero Section */}\n        <section className=\"overflow-x-clip\" id=\"home-hero\">\n          <div className=\"pt-28 lg:pt-254 lg:-mt-100 pb-115 relative\" id=\"hero-content\">\n            <HomeHeroPixi />\n            <HeroFlame />\n            <BackgroundOuterPiece />\n            <HomeHeroBackground />\n\n            <div className=\"relative container px-16\">\n              <HomeHeroBadge />\n              <HomeHeroTitle />\n              \n              {/* Hero Input */}\n              <div className=\"mt-24\">\n                <HeroInput />\n              </div>\n            </div>\n          </div>\n        </section>\n      </div>\n    </HeaderProvider>\n  );\n}"
  },
  {
    "path": "app/layout.tsx",
    "content": "import type { Metadata } from \"next\";\nimport { Inter, Roboto_Mono } from \"next/font/google\";\nimport localFont from \"next/font/local\";\nimport \"./globals.css\";\n\nconst inter = Inter({ \n  subsets: [\"latin\"],\n  variable: \"--font-inter\"\n});\n\nconst geistSans = localFont({\n  src: \"./fonts/GeistVF.woff\",\n  variable: \"--font-geist-sans\",\n  weight: \"100 900\",\n});\n\nconst geistMono = localFont({\n  src: \"./fonts/GeistMonoVF.woff\",\n  variable: \"--font-geist-mono\",\n  weight: \"100 900\",\n});\n\nconst robotoMono = Roboto_Mono({\n  subsets: [\"latin\"],\n  variable: \"--font-roboto-mono\",\n});\n\nexport const metadata: Metadata = {\n  title: \"Open Lovable v3\",\n  description: \"Re-imagine any website in seconds with AI-powered website builder.\",\n};\n\nexport default function RootLayout({\n  children,\n}: Readonly<{\n  children: React.ReactNode;\n}>) {\n  return (\n    <html lang=\"en\">\n      <body className={`${inter.variable} ${geistSans.variable} ${geistMono.variable} ${robotoMono.variable} font-sans`}>\n        {children}\n      </body>\n    </html>\n  );\n}\n"
  },
  {
    "path": "app/page.tsx",
    "content": "\"use client\";\n\nimport Link from \"next/link\";\nimport Image from \"next/image\";\nimport { useState } from \"react\";\nimport { useRouter } from \"next/navigation\";\nimport { appConfig } from '@/config/app.config';\nimport { toast } from \"sonner\";\n\n// Import shared components\nimport { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport HeroFlame from \"@/components/shared/effects/flame/hero-flame\";\nimport AsciiExplosion from \"@/components/shared/effects/flame/ascii-explosion\";\nimport { HeaderProvider } from \"@/components/shared/header/HeaderContext\";\n\n// Import hero section components\nimport HomeHeroBackground from \"@/components/app/(home)/sections/hero/Background/Background\";\nimport { BackgroundOuterPiece } from \"@/components/app/(home)/sections/hero/Background/BackgroundOuterPiece\";\nimport HomeHeroBadge from \"@/components/app/(home)/sections/hero/Badge/Badge\";\nimport HomeHeroPixi from \"@/components/app/(home)/sections/hero/Pixi/Pixi\";\nimport HomeHeroTitle from \"@/components/app/(home)/sections/hero/Title/Title\";\nimport HeroInputSubmitButton from \"@/components/app/(home)/sections/hero-input/Button/Button\";\n// import Globe from \"@/components/app/(home)/sections/hero-input/_svg/Globe\";\n\n// Import header components\nimport HeaderBrandKit from \"@/components/shared/header/BrandKit/BrandKit\";\nimport HeaderWrapper from \"@/components/shared/header/Wrapper/Wrapper\";\nimport HeaderDropdownWrapper from \"@/components/shared/header/Dropdown/Wrapper/Wrapper\";\nimport GithubIcon from \"@/components/shared/header/Github/_svg/GithubIcon\";\nimport ButtonUI from \"@/components/ui/shadcn/button\"\n\ninterface SearchResult {\n  url: string;\n  title: string;\n  description: string;\n  screenshot: string | null;\n  markdown: string;\n}\n\nexport default function HomePage() {\n  const [url, setUrl] = useState<string>(\"\");\n  const [selectedStyle, setSelectedStyle] = useState<string>(\"1\");\n  const [selectedModel, setSelectedModel] = useState<string>(appConfig.ai.defaultModel);\n  const [isValidUrl, setIsValidUrl] = useState<boolean>(false);\n  const [showSearchTiles, setShowSearchTiles] = useState<boolean>(false);\n  const [searchResults, setSearchResults] = useState<SearchResult[]>([]);\n  const [isSearching, setIsSearching] = useState<boolean>(false);\n  const [hasSearched, setHasSearched] = useState<boolean>(false);\n  const [isFadingOut, setIsFadingOut] = useState<boolean>(false);\n  const [showSelectMessage, setShowSelectMessage] = useState<boolean>(false);\n  const [showInstructionsForIndex, setShowInstructionsForIndex] = useState<number | null>(null);\n  const [additionalInstructions, setAdditionalInstructions] = useState<string>('');\n  const [extendBrandStyles, setExtendBrandStyles] = useState<boolean>(false);\n  const router = useRouter();\n  \n  // Simple URL validation\n  const validateUrl = (urlString: string) => {\n    if (!urlString) return false;\n    // Basic URL pattern - accepts domains with or without protocol\n    const urlPattern = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n    return urlPattern.test(urlString.toLowerCase());\n  };\n\n  // Check if input is a URL (contains a dot)\n  const isURL = (str: string): boolean => {\n    const urlPattern = /^(https?:\\/\\/)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(\\/.*)?$/;\n    return urlPattern.test(str.trim());\n  };\n\n  const styles = [\n    { id: \"1\", name: \"Glassmorphism\", description: \"Frosted glass effect\" },\n    { id: \"2\", name: \"Neumorphism\", description: \"Soft 3D shadows\" },\n    { id: \"3\", name: \"Brutalism\", description: \"Bold and raw\" },\n    { id: \"4\", name: \"Minimalist\", description: \"Clean and simple\" },\n    { id: \"5\", name: \"Dark Mode\", description: \"Dark theme design\" },\n    { id: \"6\", name: \"Gradient Rich\", description: \"Vibrant gradients\" },\n    { id: \"7\", name: \"3D Depth\", description: \"Dimensional layers\" },\n    { id: \"8\", name: \"Retro Wave\", description: \"80s inspired\" },\n  ];\n\n  const models = appConfig.ai.availableModels.map(model => ({\n    id: model,\n    name: appConfig.ai.modelDisplayNames[model] || model,\n  }));\n\n  const handleSubmit = async (selectedResult?: SearchResult) => {\n    const inputValue = url.trim();\n\n    if (!inputValue) {\n      toast.error(\"Please enter a URL or search term\");\n      return;\n    }\n\n    // Validate brand extension mode requirements\n    if (extendBrandStyles && isURL(inputValue) && !additionalInstructions.trim()) {\n      toast.error(\"Please describe what you want to build with this brand's styles\");\n      return;\n    }\n    \n    // If it's a search result being selected, fade out and redirect\n    if (selectedResult) {\n      setIsFadingOut(true);\n      \n      // Wait for fade animation\n      setTimeout(() => {\n        sessionStorage.setItem('targetUrl', selectedResult.url);\n        sessionStorage.setItem('selectedStyle', selectedStyle);\n        sessionStorage.setItem('selectedModel', selectedModel);\n        sessionStorage.setItem('autoStart', 'true');\n        if (selectedResult.markdown) {\n          sessionStorage.setItem('siteMarkdown', selectedResult.markdown);\n        }\n        router.push('/generation');\n      }, 500);\n      return;\n    }\n    \n    // If it's a URL, check if we're extending brand styles or cloning\n    if (isURL(inputValue)) {\n      if (extendBrandStyles) {\n        // Brand extension mode - extract brand styles and use them with the prompt\n        sessionStorage.setItem('targetUrl', inputValue);\n        sessionStorage.setItem('selectedModel', selectedModel);\n        sessionStorage.setItem('autoStart', 'true');\n        sessionStorage.setItem('brandExtensionMode', 'true');\n        sessionStorage.setItem('brandExtensionPrompt', additionalInstructions || '');\n        router.push('/generation');\n      } else {\n        // Normal clone mode\n        sessionStorage.setItem('targetUrl', inputValue);\n        sessionStorage.setItem('selectedStyle', selectedStyle);\n        sessionStorage.setItem('selectedModel', selectedModel);\n        sessionStorage.setItem('autoStart', 'true');\n        router.push('/generation');\n      }\n    } else {\n      // It's a search term, fade out if results exist, then search\n      if (hasSearched && searchResults.length > 0) {\n        setIsFadingOut(true);\n        \n        setTimeout(async () => {\n          setSearchResults([]);\n          setIsFadingOut(false);\n          setShowSelectMessage(true);\n          \n          // Perform new search\n          await performSearch(inputValue);\n          setHasSearched(true);\n          setShowSearchTiles(true);\n          setShowSelectMessage(false);\n          \n          // Smooth scroll to carousel\n          setTimeout(() => {\n            const carouselSection = document.querySelector('.carousel-section');\n            if (carouselSection) {\n              carouselSection.scrollIntoView({ behavior: 'smooth', block: 'center' });\n            }\n          }, 300);\n        }, 500);\n      } else {\n        // First search, no fade needed\n        setShowSelectMessage(true);\n        setIsSearching(true);\n        setHasSearched(true);\n        setShowSearchTiles(true);\n        \n        // Scroll to carousel area immediately\n        setTimeout(() => {\n          const carouselSection = document.querySelector('.carousel-section');\n          if (carouselSection) {\n            carouselSection.scrollIntoView({ behavior: 'smooth', block: 'center' });\n          }\n        }, 100);\n        \n        await performSearch(inputValue);\n        setShowSelectMessage(false);\n        setIsSearching(false);\n        \n        // Smooth scroll to carousel\n        setTimeout(() => {\n          const carouselSection = document.querySelector('.carousel-section');\n          if (carouselSection) {\n            carouselSection.scrollIntoView({ behavior: 'smooth', block: 'center' });\n          }\n        }, 300);\n      }\n    }\n  };\n\n  // Perform search when user types\n  const performSearch = async (searchQuery: string) => {\n    if (!searchQuery.trim() || isURL(searchQuery)) {\n      setSearchResults([]);\n      setShowSearchTiles(false);\n      return;\n    }\n\n    setIsSearching(true);\n    setShowSearchTiles(true);\n    try {\n      const response = await fetch('/api/search', {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json' },\n        body: JSON.stringify({ query: searchQuery }),\n      });\n\n      if (response.ok) {\n        const data = await response.json();\n        setSearchResults(data.results || []);\n        setShowSearchTiles(true);\n      }\n    } catch (error) {\n      console.error('Search error:', error);\n    } finally {\n      setIsSearching(false);\n    }\n  };\n\n  return (\n    <HeaderProvider>\n      <div className=\"min-h-screen bg-background-base\">\n        {/* Header/Navigation Section */}\n        <HeaderDropdownWrapper />\n\n        <div className=\"sticky top-0 left-0 w-full z-[101] bg-background-base header\">\n          <div className=\"absolute top-0 cmw-container border-x border-border-faint h-full pointer-events-none\" />\n          <div className=\"h-1 bg-border-faint w-full left-0 -bottom-1 absolute\" />\n          <div className=\"cmw-container absolute h-full pointer-events-none top-0\">\n            <Connector className=\"absolute -left-[10.5px] -bottom-11\" />\n            <Connector className=\"absolute -right-[10.5px] -bottom-11\" />\n          </div>\n\n          <HeaderWrapper>\n            <div className=\"max-w-[900px] mx-auto w-full flex justify-between items-center\">\n              <div className=\"flex gap-24 items-center\">\n                <HeaderBrandKit />\n              </div>\n              <div className=\"flex gap-8\">\n                <a\n                  className=\"contents\"\n                  href=\"https://github.com/mendableai/open-lovable\"\n                  target=\"_blank\"\n                >\n                  <ButtonUI variant=\"tertiary\">\n                    <GithubIcon />\n                    Use this Template\n                  </ButtonUI>\n                </a>\n              </div>\n            </div>\n          </HeaderWrapper>\n        </div>\n\n        {/* Hero Section */}\n        <section className=\"overflow-x-clip\" id=\"home-hero\">\n          <div className=\"pt-28 lg:pt-254 lg:-mt-100 pb-115 relative\" id=\"hero-content\">\n            <HomeHeroPixi />\n            <HeroFlame />\n            <BackgroundOuterPiece />\n            <HomeHeroBackground />\n\n            <div className=\"relative container px-16\">\n              <HomeHeroBadge />\n              <HomeHeroTitle />\n              <p className=\"text-center text-body-large\">\n                Clone brand format or re-imagine any website, in seconds.\n              </p>\n              <Link\n                className=\"bg-black-alpha-4 hover:bg-black-alpha-6 rounded-6 px-8 lg:px-6 text-label-large h-30 lg:h-24 block mt-8 mx-auto w-max gap-4 transition-all\"\n                href=\"#\"\n                onClick={(e) => e.preventDefault()}\n              >\n                Powered by Firecrawl.\n              </Link>\n            </div>\n          </div>\n\n          {/* Mini Playground Input */}\n          <div className=\"container lg:contents !p-16 relative -mt-90\">\n            <div className=\"absolute top-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint lg:hidden\" />\n            <div className=\"absolute bottom-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint lg:hidden\" />\n            <Connector className=\"-top-10 -left-[10.5px] lg:hidden\" />\n            <Connector className=\"-top-10 -right-[10.5px] lg:hidden\" />\n            <Connector className=\"-bottom-10 -left-[10.5px] lg:hidden\" />\n            <Connector className=\"-bottom-10 -right-[10.5px] lg:hidden\" />\n\n            {/* Hero Input Component */}\n            <div className=\"max-w-552 mx-auto z-[11] lg:z-[2]\">\n              <div className=\"rounded-20 -mt-30 lg:-mt-30\">\n                <div\n                  className=\"bg-white rounded-20 relative z-10\"\n                  style={{\n                    boxShadow:\n                      \"0px 0px 44px 0px rgba(0, 0, 0, 0.02), 0px 88px 56px -20px rgba(0, 0, 0, 0.03), 0px 56px 56px -20px rgba(0, 0, 0, 0.02), 0px 32px 32px -20px rgba(0, 0, 0, 0.03), 0px 16px 24px -12px rgba(0, 0, 0, 0.03), 0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0px 0px 0px 10px #F9F9F9\",\n                  }}\n                >\n\n                <div className=\"p-[28px] flex gap-12 items-center w-full relative bg-white rounded-20\">\n                  {/* Show different UI when search results are displayed */}\n                  {hasSearched && searchResults.length > 0 && !isFadingOut ? (\n                    <>\n                      {/* Selection mode icon */}\n                      <svg \n                        width=\"20\" \n                        height=\"20\" \n                        viewBox=\"0 0 20 20\" \n                        fill=\"none\" \n                        xmlns=\"http://www.w3.org/2000/svg\"\n                        className=\"opacity-40 flex-shrink-0\"\n                      >\n                        <rect x=\"2\" y=\"4\" width=\"7\" height=\"5\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                        <rect x=\"11\" y=\"4\" width=\"7\" height=\"5\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                        <rect x=\"2\" y=\"11\" width=\"7\" height=\"5\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                        <rect x=\"11\" y=\"11\" width=\"7\" height=\"5\" rx=\"1\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                      </svg>\n                      \n                      {/* Selection message */}\n                      <div className=\"flex-1 text-body-input text-accent-black\">\n                        Select which site to clone from the results below\n                      </div>\n                      \n                      {/* Search again button */}\n                      <button\n                        onClick={(e) => {\n                          e.preventDefault();\n                          setIsFadingOut(true);\n                          setTimeout(() => {\n                            setSearchResults([]);\n                            setHasSearched(false);\n                            setShowSearchTiles(false);\n                            setIsFadingOut(false);\n                            setUrl('');\n                          }, 500);\n                        }}\n                        className=\"button relative rounded-10 px-12 py-8 text-label-medium font-medium flex items-center justify-center gap-6 bg-gray-100 hover:bg-gray-200 text-gray-700 active:scale-[0.995] transition-all\"\n                      >\n                        <svg \n                          width=\"16\" \n                          height=\"16\" \n                          viewBox=\"0 0 16 16\" \n                          fill=\"none\" \n                          xmlns=\"http://www.w3.org/2000/svg\"\n                          className=\"opacity-60\"\n                        >\n                          <path d=\"M14 14L10 10M11 6.5C11 9 9 11 6.5 11C4 11 2 9 2 6.5C2 4 4 2 6.5 2C9 2 11 4 11 6.5Z\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\"/>\n                        </svg>\n                        <span>Search Again</span>\n                      </button>\n                    </>\n                  ) : (\n                    <>\n                      {isURL(url) ? (\n                        // Scrape icon for URLs\n                        <svg \n                          width=\"20\" \n                          height=\"20\" \n                          viewBox=\"0 0 20 20\" \n                          fill=\"none\" \n                          xmlns=\"http://www.w3.org/2000/svg\"\n                          className=\"opacity-40 flex-shrink-0\"\n                        >\n                          <rect x=\"3\" y=\"3\" width=\"14\" height=\"14\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                          <path d=\"M7 10L9 12L13 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                        </svg>\n                      ) : (\n                        // Search icon for search terms\n                        <svg \n                          width=\"20\" \n                          height=\"20\" \n                          viewBox=\"0 0 20 20\" \n                          fill=\"none\" \n                          xmlns=\"http://www.w3.org/2000/svg\"\n                          className=\"opacity-40 flex-shrink-0\"\n                        >\n                          <circle cx=\"8.5\" cy=\"8.5\" r=\"5.5\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                          <path d=\"M12.5 12.5L16.5 16.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\"/>\n                        </svg>\n                      )}\n                      <input\n                        className=\"flex-1 bg-transparent text-body-input text-accent-black placeholder:text-black-alpha-48 focus:outline-none focus:ring-0 focus:border-transparent\"\n                        placeholder=\"Enter URL or search term...\"\n                        type=\"text\"\n                        value={url}\n                        disabled={isSearching}\n                        onChange={(e) => {\n                          const value = e.target.value;\n                          setUrl(value);\n                          setIsValidUrl(validateUrl(value));\n                          // Reset search state when input changes\n                          if (value.trim() === \"\") {\n                            setShowSearchTiles(false);\n                            setHasSearched(false);\n                            setSearchResults([]);\n                          }\n                        }}\n                        onKeyDown={(e) => {\n                          if (e.key === \"Enter\" && !isSearching) {\n                            e.preventDefault();\n                            handleSubmit();\n                          }\n                        }}\n                        onFocus={() => {\n                          if (url.trim() && !isURL(url) && searchResults.length > 0) {\n                            setShowSearchTiles(true);\n                          }\n                        }}\n                      />\n                      <div\n                        onClick={(e) => {\n                          e.preventDefault();\n                          if (!isSearching) {\n                            handleSubmit();\n                          }\n                        }}\n                        className={isSearching ? 'pointer-events-none' : ''}\n                      >\n                        <HeroInputSubmitButton \n                          dirty={url.length > 0} \n                          buttonText={isURL(url) ? 'Scrape Site' : 'Search'} \n                          disabled={isSearching}\n                        />\n                      </div>\n                    </>\n                  )}\n                </div>\n\n                {/* Options Section - Only show when valid URL */}\n                <div className={`overflow-hidden transition-all duration-500 ease-in-out ${\n                  isValidUrl ? (extendBrandStyles ? 'max-h-[400px]' : 'max-h-[300px]') + ' opacity-100' : 'max-h-0 opacity-0'\n                }`}>\n                  <div className=\"px-[28px] pt-0 pb-[28px]\">\n                    <div className=\"border-t border-gray-100 bg-white\">\n                      {/* Extend Brand Styles Toggle */}\n                      <div className={`transition-all duration-300 transform ${\n                        isValidUrl ? 'translate-y-0 opacity-100' : '-translate-y-2 opacity-0'\n                      }`} style={{ transitionDelay: '50ms' }}>\n                        <div className=\"py-8 grid grid-cols-2 items-center gap-12 group cursor-pointer\" onClick={() => setExtendBrandStyles(!extendBrandStyles)}>\n                          <div className=\"flex select-none\">\n                            <div className=\"flex lg-max:flex-col whitespace-nowrap flex-wrap min-w-0 gap-8 lg:justify-between flex-1\">\n                              <div className=\"text-xs font-medium text-black-alpha-72 transition-all group-hover:text-accent-black relative\">\n                                Extend brand styles\n                              </div>\n                            </div>\n                          </div>\n                          <div className=\"flex justify-end\">\n                            <button\n                              className=\"transition-all relative rounded-full group bg-black-alpha-10\"\n                              type=\"button\"\n                              onClick={(e) => {\n                                e.stopPropagation();\n                                setExtendBrandStyles(!extendBrandStyles);\n                              }}\n                              style={{\n                                width: '50px',\n                                height: '20px',\n                                boxShadow: 'rgba(0, 0, 0, 0.02) 0px 6px 12px 0px inset, rgba(0, 0, 0, 0.02) 0px 0.75px 0.75px 0px inset, rgba(0, 0, 0, 0.04) 0px 0.25px 0.25px 0px inset'\n                              }}\n                            >\n                              <div\n                                className={`overlay transition-opacity ${extendBrandStyles ? 'opacity-100' : 'opacity-0'}`}\n                                style={{ background: 'color(display-p3 0.9059 0.3294 0.0784)', backgroundColor: '#FA4500' }}\n                              />\n                              <div\n                                className=\"top-[2px] left-[2px] transition-all absolute rounded-full bg-accent-white\"\n                                style={{\n                                  width: '28px',\n                                  height: '16px',\n                                  boxShadow: 'rgba(0, 0, 0, 0.06) 0px 6px 12px -3px, rgba(0, 0, 0, 0.06) 0px 3px 6px -1px, rgba(0, 0, 0, 0.04) 0px 1px 2px 0px, rgba(0, 0, 0, 0.08) 0px 0.5px 0.5px 0px',\n                                  transform: extendBrandStyles ? 'translateX(16px)' : 'none'\n                                }}\n                              />\n                            </button>\n                          </div>\n                        </div>\n                      </div>\n\n                      {/* Brand Extension Prompt - Show when toggle is enabled */}\n                      {extendBrandStyles && (\n                        <div className=\"pb-10 transition-all duration-300 opacity-100\">\n                          <textarea\n                            value={additionalInstructions}\n                            onChange={(e) => setAdditionalInstructions(e.target.value)}\n                            placeholder=\"Describe the new functionality you want to build using this brand's styles...\"\n                            className=\"w-full px-4 py-10 text-xs font-medium text-gray-700 bg-gray-50 rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500 placeholder:text-gray-400 min-h-[80px] resize-none\"\n                          />\n                        </div>\n                      )}\n\n                      {/* Style Selector - Hide when brand extension mode is enabled */}\n                      {!extendBrandStyles && (\n                        <div className={`mb-2 transition-all duration-300 transform ${\n                          isValidUrl ? 'translate-y-0 opacity-100' : '-translate-y-2 opacity-0'\n                        }`} style={{ transitionDelay: '100ms' }}>\n                          <div className=\"grid grid-cols-4 gap-2\">\n                            {styles.map((style, index) => (\n                              <button\n                                key={style.id}\n                                onClick={() => setSelectedStyle(style.id)}\n                                className={`\n                                  ${selectedStyle === style.id\n                                    ? 'bg-heat-100 hover:bg-heat-200 flex items-center justify-center button relative text-label-medium button-primary group/button rounded-10 p-8 text-accent-white active:scale-[0.995] border-0'\n                                    : 'border-gray-200 hover:border-gray-300 bg-white text-gray-700 py-3.5 px-4 rounded text-xs font-medium border text-center'\n                                  }\n                                  transition-all\n                                  ${isValidUrl ? 'opacity-100' : 'opacity-0'}\n                                `}\n                                style={{\n                                  transitionDelay: `${150 + index * 30}ms`,\n                                  transition: 'all 0.3s ease-in-out'\n                                }}\n                              >\n                                {selectedStyle === style.id && (\n                                  <div className=\"button-background absolute inset-0 rounded-10 pointer-events-none\" />\n                                )}\n                                <span className={selectedStyle === style.id ? 'relative' : ''}>\n                                  {style.name}\n                                </span>\n                              </button>\n                            ))}\n                          </div>\n                        </div>\n                      )}\n\n                      {/* Model Selector Dropdown and Additional Instructions */}\n                      <div className={`flex items-center gap-3 mt-2 pb-4 transition-all duration-300 transform ${\n                        isValidUrl ? 'translate-y-0 opacity-100' : '-translate-y-2 opacity-0'\n                      }`} style={{ transitionDelay: '400ms' }}>\n                        {/* Model Dropdown */}\n                        <select\n                          value={selectedModel}\n                          onChange={(e) => setSelectedModel(e.target.value)}\n                          className={`px-3 py-2.5 text-xs font-medium text-gray-700 bg-white rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500 ${extendBrandStyles ? 'flex-1' : ''}`}\n                        >\n                          {models.map((model) => (\n                            <option key={model.id} value={model.id}>\n                              {model.name}\n                            </option>\n                          ))}\n                        </select>\n\n                        {/* Additional Instructions - Hidden when extend brand styles is enabled */}\n                        {!extendBrandStyles && (\n                          <input\n                            type=\"text\"\n                            className=\"flex-1 px-3 py-2.5 text-xs font-medium text-gray-700 bg-gray-50 rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500 placeholder:text-gray-400\"\n                            placeholder=\"Additional instructions (optional)\"\n                            onChange={(e) => sessionStorage.setItem('additionalInstructions', e.target.value)}\n                          />\n                        )}\n                      </div>\n                    </div>\n                  </div>\n                </div>\n\n                </div>\n\n                <div className=\"h-248 top-84 cw-768 pointer-events-none absolute overflow-clip -z-10\">\n                  <AsciiExplosion className=\"-top-200\" />\n                </div>\n              </div>\n            </div>\n          </div>\n        </section>\n\n        {/* Full-width oval carousel section */}\n        {showSearchTiles && hasSearched && (\n          <section className={`carousel-section relative w-full overflow-hidden mt-32 mb-32 transition-opacity duration-500 ${\n            isFadingOut ? 'opacity-0' : 'opacity-100'\n          }`}>\n            <div className=\"absolute inset-0 bg-gradient-to-b from-gray-50/50 to-white rounded-[50%] transform scale-x-150 -translate-y-24\" />\n            \n            {isSearching ? (\n              // Loading state with animated scrolling skeletons\n              <div className=\"relative h-[250px] overflow-hidden\">\n                {/* Edge fade overlays */}\n                <div className=\"absolute left-0 top-0 bottom-0 w-[120px] z-20 pointer-events-none\" style={{background: 'linear-gradient(to right, white 0%, white 20%, transparent 100%)'}} />\n                <div className=\"absolute right-0 top-0 bottom-0 w-[120px] z-20 pointer-events-none\" style={{background: 'linear-gradient(to left, white 0%, white 20%, transparent 100%)'}} />\n                \n                <div className=\"carousel-container absolute left-0 flex gap-12 py-4\">\n                  {/* Duplicate skeleton tiles for continuous scroll */}\n                  {[...Array(10), ...Array(10)].map((_, index) => (\n                    <div\n                      key={`loading-${index}`}\n                      className=\"flex-shrink-0 w-[400px] h-[240px] rounded-lg overflow-hidden border-2 border-gray-200/30 bg-white relative\"\n                    >\n                      <div className=\"absolute inset-0 skeleton-shimmer\">\n                        <div className=\"absolute inset-0 bg-gradient-to-r from-gray-100 via-gray-50 to-gray-100 skeleton-gradient\" />\n                      </div>\n                      \n                      {/* Fake browser UI - 5x bigger */}\n                      <div className=\"absolute top-0 left-0 right-0 h-40 bg-gray-100 border-b border-gray-200/50 flex items-center px-6 gap-4\">\n                        <div className=\"flex gap-3\">\n                          <div className=\"w-5 h-5 rounded-full bg-gray-300 animate-pulse\" />\n                          <div className=\"w-5 h-5 rounded-full bg-gray-300 animate-pulse\" style={{ animationDelay: '0.1s' }} />\n                          <div className=\"w-5 h-5 rounded-full bg-gray-300 animate-pulse\" style={{ animationDelay: '0.2s' }} />\n                        </div>\n                        <div className=\"flex-1 h-8 bg-gray-200 rounded-md mx-6 animate-pulse\" />\n                      </div>\n                      \n                      {/* Content skeleton - positioned just below nav bar */}\n                      <div className=\"absolute top-44 left-4 right-4\">\n                        <div className=\"h-3 bg-gray-200 rounded w-3/4 mb-2 animate-pulse\" />\n                        <div className=\"h-3 bg-gray-150 rounded w-1/2 mb-2 animate-pulse\" style={{ animationDelay: '0.2s' }} />\n                        <div className=\"h-3 bg-gray-150 rounded w-2/3 animate-pulse\" style={{ animationDelay: '0.3s' }} />\n                      </div>\n                    </div>\n                  ))}\n                </div>\n              </div>\n            ) : searchResults.length > 0 ? (\n              // Actual results\n              <div className=\"relative h-[250px] overflow-hidden\">\n                {/* Edge fade overlays */}\n                <div className=\"absolute left-0 top-0 bottom-0 w-[120px] z-20 pointer-events-none\" style={{background: 'linear-gradient(to right, white 0%, white 20%, transparent 100%)'}} />\n                <div className=\"absolute right-0 top-0 bottom-0 w-[120px] z-20 pointer-events-none\" style={{background: 'linear-gradient(to left, white 0%, white 20%, transparent 100%)'}} />\n                \n                <div className=\"carousel-container absolute left-0 flex gap-12 py-4\">\n                  {/* Duplicate results for infinite scroll */}\n                  {[...searchResults, ...searchResults].map((result, index) => (\n                    <div\n                      key={`${result.url}-${index}`}\n                      className=\"group flex-shrink-0 w-[400px] h-[240px] rounded-lg overflow-hidden border-2 border-gray-200/50 transition-all duration-300 hover:shadow-2xl bg-white relative\"\n                      onMouseLeave={() => {\n                        if (showInstructionsForIndex === index) {\n                          setShowInstructionsForIndex(null);\n                          setAdditionalInstructions('');\n                        }\n                      }}\n                    >\n                      {/* Hover overlay with clone buttons or instructions input */}\n                      <div className=\"absolute inset-0 bg-gradient-to-t from-black/90 via-black/50 to-black/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300 z-10 flex flex-col items-center justify-center p-6\">\n                        {showInstructionsForIndex === index ? (\n                          /* Instructions input view - matching main input style exactly */\n                          <div className=\"w-full max-w-[380px]\">\n                            <div className=\"bg-white rounded-20\" style={{\n                              boxShadow: \"0px 0px 44px 0px rgba(0, 0, 0, 0.02), 0px 88px 56px -20px rgba(0, 0, 0, 0.03), 0px 56px 56px -20px rgba(0, 0, 0, 0.02), 0px 32px 32px -20px rgba(0, 0, 0, 0.03), 0px 16px 24px -12px rgba(0, 0, 0, 0.03), 0px 0px 0px 1px rgba(0, 0, 0, 0.05)\"\n                            }}>\n                              {/* Input area matching main search */}\n                              <div className=\"p-16 flex gap-12 items-start w-full relative\">\n                                {/* Instructions icon */}\n                                <div className=\"mt-2 flex-shrink-0\">\n                                  <svg \n                                    width=\"20\" \n                                    height=\"20\" \n                                    viewBox=\"0 0 20 20\" \n                                    fill=\"none\" \n                                    xmlns=\"http://www.w3.org/2000/svg\"\n                                    className=\"opacity-40\"\n                                  >\n                                    <path d=\"M5 5H15M5 10H15M5 15H10\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\"/>\n                                  </svg>\n                                </div>\n                                \n                                <textarea\n                                  value={additionalInstructions}\n                                  onChange={(e) => setAdditionalInstructions(e.target.value)}\n                                  placeholder=\"Describe your customizations...\"\n                                  className=\"flex-1 bg-transparent text-body-input text-accent-black placeholder:text-black-alpha-48 focus:outline-none focus:ring-0 focus:border-transparent resize-none min-h-[60px]\"\n                                  autoFocus\n                                  onClick={(e) => e.stopPropagation()}\n                                  onKeyDown={(e) => {\n                                    if (e.key === 'Escape') {\n                                      e.stopPropagation();\n                                      setShowInstructionsForIndex(null);\n                                      setAdditionalInstructions('');\n                                    }\n                                  }}\n                                />\n                              </div>\n                              \n                              {/* Divider */}\n                              <div className=\"border-t border-black-alpha-5\" />\n                              \n                              {/* Buttons area matching main style */}\n                              <div className=\"p-10 flex justify-between items-center\">\n                                <button\n                                  onClick={(e) => {\n                                    e.stopPropagation();\n                                    setShowInstructionsForIndex(null);\n                                    setAdditionalInstructions('');\n                                  }}\n                                  className=\"button relative rounded-10 px-8 py-8 text-label-medium font-medium flex items-center justify-center bg-black-alpha-4 hover:bg-black-alpha-6 text-black-alpha-48 active:scale-[0.995] transition-all\"\n                                >\n                                  <svg \n                                    width=\"20\" \n                                    height=\"20\" \n                                    viewBox=\"0 0 20 20\" \n                                    fill=\"none\" \n                                    xmlns=\"http://www.w3.org/2000/svg\"\n                                  >\n                                    <path d=\"M12 5L7 10L12 15\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                                  </svg>\n                                </button>\n                                \n                                <button\n                                  onClick={(e) => {\n                                    e.stopPropagation();\n                                    if (additionalInstructions.trim()) {\n                                      sessionStorage.setItem('additionalInstructions', additionalInstructions);\n                                      handleSubmit(result);\n                                    }\n                                  }}\n                                  disabled={!additionalInstructions.trim()}\n                                  className={`\n                                    button relative rounded-10 px-8 py-8 text-label-medium font-medium\n                                    flex items-center justify-center gap-6\n                                    ${additionalInstructions.trim() \n                                      ? 'button-primary text-accent-white active:scale-[0.995]' \n                                      : 'bg-black-alpha-4 text-black-alpha-24 cursor-not-allowed'\n                                    }\n                                  `}\n                                >\n                                  {additionalInstructions.trim() && <div className=\"button-background absolute inset-0 rounded-10 pointer-events-none\" />}\n                                  <span className=\"px-6 relative\">Apply & Clone</span>\n                                  <svg \n                                    width=\"20\" \n                                    height=\"20\" \n                                    viewBox=\"0 0 20 20\" \n                                    fill=\"none\" \n                                    xmlns=\"http://www.w3.org/2000/svg\"\n                                    className=\"relative\"\n                                  >\n                                    <path d=\"M11.6667 4.79163L16.875 9.99994M16.875 9.99994L11.6667 15.2083M16.875 9.99994H3.125\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\"/>\n                                  </svg>\n                                </button>\n                              </div>\n                            </div>\n                          </div>\n                        ) : (\n                          /* Default buttons view */\n                          <>\n                            <div className=\"text-white text-center mb-3\">\n                              <p className=\"text-base font-semibold mb-0.5\">{result.title}</p>\n                              <p className=\"text-[11px] opacity-80\">Choose how to clone this site</p>\n                            </div>\n                            \n                            <div className=\"flex gap-3 justify-center\">\n                              {/* Instant Clone Button - Orange/Heat style */}\n                              <button\n                                onClick={(e) => {\n                                  e.stopPropagation();\n                                  handleSubmit(result);\n                                }}\n                                className=\"bg-orange-500 hover:bg-orange-600 flex items-center justify-center button relative text-label-medium button-primary group/button rounded-10 p-8 gap-2 text-white active:scale-[0.995]\"\n                              >\n                                <div className=\"button-background absolute inset-0 rounded-10 pointer-events-none\" />\n                                <svg \n                                  width=\"20\" \n                                  height=\"20\" \n                                  viewBox=\"0 0 20 20\" \n                                  fill=\"none\" \n                                  xmlns=\"http://www.w3.org/2000/svg\"\n                                  className=\"relative\"\n                                >\n                                  <path d=\"M11.6667 4.79163L16.875 9.99994M16.875 9.99994L11.6667 15.2083M16.875 9.99994H3.125\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth=\"1.5\"/>\n                                </svg>\n                                <span className=\"px-6 relative\">Instant Clone</span>\n                              </button>\n                              \n                              {/* Instructions Button - Gray style */}\n                              <button\n                                onClick={(e) => {\n                                  e.stopPropagation();\n                                  setShowInstructionsForIndex(index);\n                                  setAdditionalInstructions('');\n                                }}\n                                className=\"bg-gray-100 hover:bg-gray-200 flex items-center justify-center button relative text-label-medium rounded-10 p-8 gap-2 text-gray-700 active:scale-[0.995]\"\n                              >\n                                <svg \n                                  width=\"20\" \n                                  height=\"20\" \n                                  viewBox=\"0 0 20 20\" \n                                  fill=\"none\" \n                                  xmlns=\"http://www.w3.org/2000/svg\"\n                                  className=\"opacity-60\"\n                                >\n                                  <path d=\"M5 5H15M5 10H15M5 15H10\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\"/>\n                                  <path d=\"M14 14L16 16L14 18\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                                </svg>\n                                <span className=\"px-6\">Add Instructions</span>\n                              </button>\n                            </div>\n                          </>\n                        )}\n                      </div>\n                      \n                      {result.screenshot ? (\n                        <div className=\"relative w-full h-full\">\n                          <Image \n                            src={result.screenshot} \n                            alt={result.title}\n                            fill\n                            className=\"object-cover object-top\"\n                            loading=\"lazy\"\n                          />\n                        </div>\n                      ) : (\n                        <div className=\"w-full h-full bg-gradient-to-br from-gray-100 to-gray-50 flex items-center justify-center\">\n                          <div className=\"text-center\">\n                            <div className=\"w-16 h-16 rounded-full bg-gray-200 mx-auto mb-3 flex items-center justify-center\">\n                              <svg \n                                width=\"32\" \n                                height=\"32\" \n                                viewBox=\"0 0 24 24\" \n                                fill=\"none\" \n                                xmlns=\"http://www.w3.org/2000/svg\"\n                                className=\"text-gray-400\"\n                              >\n                                <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                                <path d=\"M3 9H21\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                                <circle cx=\"6\" cy=\"6\" r=\"1\" fill=\"currentColor\"/>\n                                <circle cx=\"9\" cy=\"6\" r=\"1\" fill=\"currentColor\"/>\n                                <circle cx=\"12\" cy=\"6\" r=\"1\" fill=\"currentColor\"/>\n                              </svg>\n                            </div>\n                            <p className=\"text-gray-500 text-sm font-medium\">{result.title}</p>\n                          </div>\n                        </div>\n                      )}\n                    </div>\n                  ))}\n                </div>\n              </div>\n            ) : (\n              // No results state\n              <div className=\"relative h-[250px] flex items-center justify-center\">\n                <div className=\"text-center\">\n                  <div className=\"mb-4\">\n                    <svg className=\"w-16 h-16 mx-auto text-gray-300\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n                      <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={1.5} d=\"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z\" />\n                    </svg>\n                  </div>\n                  <p className=\"text-gray-500 text-lg\">No results found</p>\n                  <p className=\"text-gray-400 text-sm mt-1\">Try a different search term</p>\n                </div>\n              </div>\n            )}\n          </section>\n        )}\n\n      </div>\n\n      <style jsx>{`\n        @keyframes infiniteScroll {\n          from {\n            transform: translateX(0);\n          }\n          to {\n            transform: translateX(-50%);\n          }\n        }\n\n        @keyframes shimmer {\n          0% {\n            transform: translateX(-100%);\n          }\n          100% {\n            transform: translateX(100%);\n          }\n        }\n\n        @keyframes fadeIn {\n          from {\n            opacity: 0;\n            transform: translateY(10px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .carousel-container {\n          animation: infiniteScroll 30s linear infinite;\n        }\n\n        .carousel-container:hover {\n          animation-play-state: paused;\n        }\n\n        .skeleton-shimmer {\n          position: relative;\n          overflow: hidden;\n        }\n\n        .skeleton-gradient {\n          animation: shimmer 2s infinite;\n        }\n      `}</style>\n    </HeaderProvider>\n  );\n}"
  },
  {
    "path": "atoms/sheets.ts",
    "content": "import { atom } from 'jotai';\n\nexport const isMobileSheetOpenAtom = atom(false);"
  },
  {
    "path": "colors.json",
    "content": "{\n  \"heat-4\": {\n    \"hex\": \"fa5d190a\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.039216\"\n  },\n  \"heat-8\": {\n    \"hex\": \"fa5d1914\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.078431\"\n  },\n  \"heat-12\": {\n    \"hex\": \"fa5d191f\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.121569\"\n  },\n  \"heat-16\": {\n    \"hex\": \"fa5d1929\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.160784\"\n  },\n  \"heat-20\": {\n    \"hex\": \"fa5d1933\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.200000\"\n  },\n  \"heat-40\": {\n    \"hex\": \"fa5d1966\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.400000\"\n  },\n  \"heat-90\": {\n    \"hex\": \"fa5d19e6\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.900000\"\n  },\n  \"heat-100\": {\n    \"hex\": \"fa5d19ff\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 1.000000\"\n  },\n  \"accent-black\": {\n    \"hex\": \"262626ff\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 1.000000\"\n  },\n  \"accent-white\": {\n    \"hex\": \"ffffffff\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 1.000000\"\n  },\n  \"accent-amethyst\": {\n    \"hex\": \"9061ffff\",\n    \"p3\": \"0.564706 0.380392 1.000000 / 1.000000\"\n  },\n  \"accent-bluetron\": {\n    \"hex\": \"2a6dfbff\",\n    \"p3\": \"0.164706 0.427451 0.984314 / 1.000000\"\n  },\n  \"accent-crimson\": {\n    \"hex\": \"eb3424ff\",\n    \"p3\": \"0.921569 0.203922 0.141176 / 1.000000\"\n  },\n  \"accent-forest\": {\n    \"hex\": \"42c366ff\",\n    \"p3\": \"0.258824 0.764706 0.400000 / 1.000000\"\n  },\n  \"accent-honey\": {\n    \"hex\": \"ecb730ff\",\n    \"p3\": \"0.925490 0.717647 0.188235 / 1.000000\"\n  },\n  \"black-alpha-1\": {\n    \"hex\": \"00000003\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.011765\"\n  },\n  \"black-alpha-2\": {\n    \"hex\": \"00000005\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.019608\"\n  },\n  \"black-alpha-3\": {\n    \"hex\": \"00000008\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.031373\"\n  },\n  \"black-alpha-4\": {\n    \"hex\": \"0000000a\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.039216\"\n  },\n  \"black-alpha-5\": {\n    \"hex\": \"0000000d\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.050980\"\n  },\n  \"black-alpha-6\": {\n    \"hex\": \"0000000f\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.058824\"\n  },\n  \"black-alpha-7\": {\n    \"hex\": \"00000012\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.070588\"\n  },\n  \"black-alpha-8\": {\n    \"hex\": \"00000014\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.078431\"\n  },\n  \"black-alpha-10\": {\n    \"hex\": \"0000001a\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.101961\"\n  },\n  \"black-alpha-12\": {\n    \"hex\": \"0000001f\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.121569\"\n  },\n  \"black-alpha-16\": {\n    \"hex\": \"00000029\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.160784\"\n  },\n  \"black-alpha-20\": {\n    \"hex\": \"00000033\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.200000\"\n  },\n  \"black-alpha-24\": {\n    \"hex\": \"0000003d\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.239216\"\n  },\n  \"black-alpha-32\": {\n    \"hex\": \"26262652\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.321569\"\n  },\n  \"black-alpha-40\": {\n    \"hex\": \"26262666\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.400000\"\n  },\n  \"black-alpha-48\": {\n    \"hex\": \"2626267a\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.478431\"\n  },\n  \"black-alpha-56\": {\n    \"hex\": \"2626268f\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.560784\"\n  },\n  \"black-alpha-64\": {\n    \"hex\": \"262626a3\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.639216\"\n  },\n  \"black-alpha-72\": {\n    \"hex\": \"262626b8\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.721569\"\n  },\n  \"black-alpha-88\": {\n    \"hex\": \"262626e0\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.878431\"\n  },\n  \"white-alpha-56\": {\n    \"hex\": \"ffffff8f\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 0.560784\"\n  },\n  \"white-alpha-72\": {\n    \"hex\": \"ffffffb8\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 0.721569\"\n  },\n  \"border-faint\": {\n    \"hex\": \"edededff\",\n    \"p3\": \"0.929412 0.929412 0.929412 / 1.000000\"\n  },\n  \"border-muted\": {\n    \"hex\": \"e8e8e8ff\",\n    \"p3\": \"0.909804 0.909804 0.909804 / 1.000000\"\n  },\n  \"border-loud\": {\n    \"hex\": \"e6e6e6ff\",\n    \"p3\": \"0.901961 0.901961 0.901961 / 1.000000\"\n  },\n  \"illustrations-faint\": {\n    \"hex\": \"edededff\",\n    \"p3\": \"0.929412 0.929412 0.929412 / 1.000000\"\n  },\n  \"illustrations-muted\": {\n    \"hex\": \"e6e6e6ff\",\n    \"p3\": \"0.901961 0.901961 0.901961 / 1.000000\"\n  },\n  \"illustrations-default\": {\n    \"hex\": \"dbdbdbff\",\n    \"p3\": \"0.858824 0.858824 0.858824 / 1.000000\"\n  },\n  \"background-lighter\": {\n    \"hex\": \"fbfbfbff\",\n    \"p3\": \"0.984314 0.984314 0.984314 / 1.000000\"\n  },\n  \"background-base\": {\n    \"hex\": \"f9f9f9ff\",\n    \"p3\": \"0.976471 0.976471 0.976471 / 1.000000\"\n  }\n}"
  },
  {
    "path": "components/CodeApplicationProgress.tsx",
    "content": "import React from 'react';\nimport { motion, AnimatePresence } from 'framer-motion';\n\nexport interface CodeApplicationState {\n  stage: 'analyzing' | 'installing' | 'applying' | 'complete' | null;\n  packages?: string[];\n  installedPackages?: string[];\n  filesGenerated?: string[];\n  message?: string;\n}\n\ninterface CodeApplicationProgressProps {\n  state: CodeApplicationState;\n}\n\nexport default function CodeApplicationProgress({ state }: CodeApplicationProgressProps) {\n  if (!state.stage || state.stage === 'complete') return null;\n\n  return (\n    <AnimatePresence mode=\"wait\">\n      <motion.div\n        key=\"loading\"\n        initial={{ opacity: 0, y: 10 }}\n        animate={{ opacity: 1, y: 0 }}\n        exit={{ opacity: 0, y: -10 }}\n        transition={{ duration: 0.3 }}\n        className=\"inline-block bg-gray-100 rounded-[10px] p-3 mt-2\"\n      >\n        <div className=\"flex items-center gap-3\">\n          {/* Rotating loading indicator */}\n          <motion.div\n            animate={{ rotate: 360 }}\n            transition={{ duration: 1, repeat: Infinity, ease: \"linear\" }}\n            className=\"w-4 h-4\"\n          >\n            <svg className=\"w-full h-full\" viewBox=\"0 0 24 24\" fill=\"none\">\n              <circle \n                cx=\"12\" \n                cy=\"12\" \n                r=\"10\" \n                stroke=\"currentColor\" \n                strokeWidth=\"2\" \n                strokeLinecap=\"round\"\n                strokeDasharray=\"31.416\"\n                strokeDashoffset=\"10\"\n                className=\"text-gray-700\"\n              />\n            </svg>\n          </motion.div>\n\n          {/* Simple loading text */}\n          <div className=\"text-sm font-medium text-gray-700\">\n            Applying to sandbox...\n          </div>\n        </div>\n      </motion.div>\n    </AnimatePresence>\n  );\n}"
  },
  {
    "path": "components/FirecrawlIcon.tsx",
    "content": "export default function FirecrawlIcon({ className = \"w-5 h-5\" }: { className?: string }) {\n  return (\n    <svg \n      className={className}\n      fill=\"none\" \n      viewBox=\"0 0 20 20\" \n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M13.7605 6.61389C13.138 6.79867 12.6687 7.21667 12.3251 7.67073C12.2513 7.76819 12.0975 7.69495 12.1268 7.57552C12.7848 4.86978 11.9155 2.6209 9.20582 1.51393C9.06836 1.4576 8.92527 1.58097 8.96132 1.72519C10.1939 6.67417 5.00941 6.25673 5.66459 11.8671C5.67585 11.9634 5.56769 12.0293 5.48882 11.973C5.2432 11.7967 4.96885 11.4288 4.78069 11.1702C4.72548 11.0942 4.60605 11.1156 4.5807 11.2063C4.43085 11.7482 4.35986 12.2586 4.35986 12.7656C4.35986 14.7373 5.37333 16.473 6.90734 17.4791C6.99522 17.5366 7.10789 17.4543 7.07804 17.3535C6.99917 17.0887 6.95466 16.8093 6.95128 16.5203C6.95128 16.3429 6.96255 16.1615 6.99015 15.9925C7.05438 15.5677 7.20197 15.1632 7.44985 14.7948C8.29995 13.5188 10.0041 12.2862 9.73199 10.6125C9.71453 10.5066 9.83959 10.4368 9.91846 10.5094C11.119 11.6063 11.3567 13.0817 11.1595 14.405C11.1426 14.5199 11.2868 14.5813 11.3595 14.4912C11.5432 14.2613 11.7674 14.0596 12.0113 13.9081C12.0722 13.8703 12.1533 13.8991 12.1764 13.9667C12.3121 14.3616 12.5138 14.7323 12.7042 15.1029C12.9318 15.5485 13.0529 16.0573 13.0338 16.5958C13.0242 16.8578 12.9808 17.1113 12.9082 17.3524C12.8772 17.4543 12.9887 17.5394 13.0783 17.4808C14.6134 16.4747 15.6275 14.739 15.6275 12.7662C15.6275 12.0806 15.5075 11.4085 15.2804 10.7787C14.8044 9.45766 13.5966 8.46561 13.9019 6.74403C13.9166 6.66178 13.8405 6.59023 13.7605 6.61389Z\"\n        fill=\"currentColor\"\n      />\n    </svg>\n  );\n}"
  },
  {
    "path": "components/FirecrawlLogo.tsx",
    "content": "export default function FirecrawlLogo() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"15\"\n      viewBox=\"0 0 79 15\"\n      width=\"79\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M0.599609 14.4311V0.576888H9.45474V2.59564H2.87778V6.61335H8.30575V8.57272H2.87778V14.4311H0.599609Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M11.9737 2.87272C11.2407 2.87272 10.6663 2.33835 10.6663 1.58626C10.6663 0.83418 11.2407 0.299805 11.9737 0.299805C12.7067 0.299805 13.2812 0.83418 13.2812 1.58626C13.2812 2.33835 12.7067 2.87272 11.9737 2.87272ZM10.8842 14.4311V4.29772H13.0237V14.4311H10.8842Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M20.1527 4.29772H20.6281V6.29668H19.6772C17.7755 6.29668 17.1613 7.78105 17.1613 9.3446V14.4311H15.0219V4.29772H16.9236L17.1613 5.82168C17.6764 4.97064 18.4886 4.29772 20.1527 4.29772Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M26.1788 14.5498C22.9894 14.5498 20.9886 12.4915 20.9886 9.38418C20.9886 6.2571 22.9894 4.17897 25.9807 4.17897C28.9126 4.17897 30.8738 6.03939 30.9333 9.00814C30.9333 9.26543 30.9135 9.54251 30.8738 9.8196H23.2271V9.95814C23.2865 11.68 24.3761 12.8081 26.06 12.8081C27.3674 12.8081 28.3183 12.155 28.6155 11.0269H30.755C30.3984 13.0258 28.6947 14.5498 26.1788 14.5498ZM23.3064 8.25605H28.7145C28.5362 6.75189 27.4863 5.90085 26.0005 5.90085C24.6336 5.90085 23.4648 6.81126 23.3064 8.25605Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M37.2193 14.5498C34.1487 14.5498 32.1875 12.5508 32.1875 9.38418C32.1875 6.2571 34.2081 4.17897 37.2787 4.17897C39.8936 4.17897 41.5181 5.62376 41.9341 7.9196H39.6955C39.4182 6.7321 38.5664 5.9998 37.2391 5.9998C35.5156 5.9998 34.3864 7.38522 34.3864 9.38418C34.3864 11.3633 35.5156 12.729 37.2391 12.729C38.5465 12.729 39.4182 11.9769 39.6757 10.8092H41.9341C41.5379 13.105 39.8144 14.5498 37.2193 14.5498Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M48.6034 4.29772H49.0789V6.29668H48.128C46.2262 6.29668 45.6121 7.78105 45.6121 9.3446V14.4311H43.4726V4.29772H45.3744L45.6121 5.82168C46.1272 4.97064 46.9394 4.29772 48.6034 4.29772Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M54.3679 4.17897C57.0621 4.17897 58.6073 5.46543 58.6073 7.86022V14.4311H56.7451L56.5668 12.9863C55.8735 13.8967 54.9028 14.5498 53.2981 14.5498C51.0794 14.5498 49.5936 13.4613 49.5936 11.5811C49.5936 9.50293 51.0992 8.33522 53.9519 8.33522H56.4876V7.72168C56.4876 6.59355 55.6754 5.90085 54.2688 5.90085C53.001 5.90085 52.1491 6.4946 51.9907 7.38522H49.8908C50.1087 5.40605 51.8124 4.17897 54.3679 4.17897ZM53.6547 12.8873C55.4376 12.8873 56.4678 11.8383 56.4876 10.2748V9.91855H53.833C52.5057 9.91855 51.7728 10.4133 51.7728 11.4425C51.7728 12.2936 52.4859 12.8873 53.6547 12.8873Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M62.7912 14.4311L59.4829 4.29772H61.7413L64.0591 12.0561L66.3768 4.29772H68.3381L70.5568 12.0561L72.9538 4.29772H75.1329L71.7652 14.4311H69.4672L67.3277 7.54355L65.109 14.4311H62.7912Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M76.1601 14.4311V0.576888H78.2996V14.4311H76.1601Z\"\n        fill=\"#262626\"\n      />\n    </svg>\n  );\n}"
  },
  {
    "path": "components/HMRErrorDetector.tsx",
    "content": "import { useEffect, useRef } from 'react';\n\ninterface HMRErrorDetectorProps {\n  iframeRef: React.RefObject<HTMLIFrameElement>;\n  onErrorDetected: (errors: Array<{ type: string; message: string; package?: string }>) => void;\n}\n\nexport default function HMRErrorDetector({ iframeRef, onErrorDetected }: HMRErrorDetectorProps) {\n  const checkIntervalRef = useRef<NodeJS.Timeout | null>(null);\n\n  useEffect(() => {\n    const checkForHMRErrors = () => {\n      if (!iframeRef.current) return;\n\n      try {\n        const iframeDoc = iframeRef.current.contentDocument;\n        if (!iframeDoc) return;\n\n        // Check for Vite error overlay\n        const errorOverlay = iframeDoc.querySelector('vite-error-overlay');\n        if (errorOverlay) {\n          // Try to extract error message\n          const messageElement = errorOverlay.shadowRoot?.querySelector('.message-body');\n          if (messageElement) {\n            const errorText = messageElement.textContent || '';\n            \n            // Parse import errors\n            const importMatch = errorText.match(/Failed to resolve import \"([^\"]+)\"/);\n            if (importMatch) {\n              const packageName = importMatch[1];\n              if (!packageName.startsWith('.')) {\n                // Extract base package name\n                let finalPackage = packageName;\n                if (packageName.startsWith('@')) {\n                  const parts = packageName.split('/');\n                  finalPackage = parts.length >= 2 ? parts.slice(0, 2).join('/') : packageName;\n                } else {\n                  finalPackage = packageName.split('/')[0];\n                }\n\n                onErrorDetected([{\n                  type: 'npm-missing',\n                  message: `Failed to resolve import \"${packageName}\"`,\n                  package: finalPackage\n                }]);\n              }\n            }\n          }\n        }\n      } catch {\n        // Cross-origin errors are expected, ignore them\n      }\n    };\n\n    // Check immediately and then every 2 seconds\n    checkForHMRErrors();\n    checkIntervalRef.current = setInterval(checkForHMRErrors, 2000);\n\n    return () => {\n      if (checkIntervalRef.current) {\n        clearInterval(checkIntervalRef.current);\n      }\n    };\n  }, [iframeRef, onErrorDetected]);\n\n  return null;\n}"
  },
  {
    "path": "components/HeroInput.tsx",
    "content": "\"use client\";\n\nimport { useState, KeyboardEvent, useEffect, useRef } from \"react\";\n\ninterface HeroInputProps {\n  value: string;\n  onChange: (value: string) => void;\n  onSubmit: () => void;\n  placeholder?: string;\n  className?: string;\n  showSearchFeatures?: boolean;\n}\n\nfunction isURL(str: string): boolean {\n  // Check if string contains a dot and looks like a URL\n  const urlPattern = /^(https?:\\/\\/)?([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}(\\/.*)?$/;\n  return urlPattern.test(str.trim());\n}\n\nexport default function HeroInput({ \n  value, \n  onChange, \n  onSubmit, \n  placeholder = \"Describe what you want to build...\",\n  className = \"\",\n  showSearchFeatures = true\n}: HeroInputProps) {\n  const [isFocused, setIsFocused] = useState(false);\n  const [showTiles, setShowTiles] = useState(false);\n  const textareaRef = useRef<HTMLTextAreaElement>(null);\n  const isURLInput = showSearchFeatures ? isURL(value) : false;\n\n  // Reset textarea height when value changes (especially when cleared)\n  useEffect(() => {\n    if (textareaRef.current) {\n      textareaRef.current.style.height = 'auto';\n      textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px';\n    }\n    \n    // Show tiles animation for search terms (only if search features are enabled)\n    if (showSearchFeatures && value.trim() && !isURL(value) && isFocused) {\n      setShowTiles(true);\n    } else {\n      setShowTiles(false);\n    }\n  }, [value, isFocused, showSearchFeatures]);\n\n  const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {\n    if (e.key === \"Enter\" && !e.shiftKey) {\n      e.preventDefault();\n      onSubmit();\n    }\n  };\n\n  return (\n    <div className={`max-w-552 mx-auto w-full relative z-[11] rounded-20 ${className}`}>\n      <div\n        className=\"\"\n      />\n\n      <div className=\"relative\">\n        <label className=\"p-16 flex gap-8 items-start w-full relative border-b border-black-alpha-5\">\n          <div className=\"mt-2 flex-shrink-0\">\n            {showSearchFeatures ? (\n              isURLInput ? (\n                // Link icon for URLs\n                <svg \n                  width=\"20\" \n                  height=\"20\" \n                  viewBox=\"0 0 20 20\" \n                  fill=\"none\" \n                  xmlns=\"http://www.w3.org/2000/svg\"\n                  className=\"opacity-40\"\n                >\n                  <path d=\"M9 11L11 9M11 9L15 5M11 9L5 15M15 5L13 3M15 5L17 7\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                  <path d=\"M7 13L5 15L3 13\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                  <path d=\"M13 7L15 5L17 7\" stroke=\"currentColor\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                </svg>\n              ) : (\n                // Search icon for search terms\n                <svg \n                  width=\"20\" \n                  height=\"20\" \n                  viewBox=\"0 0 20 20\" \n                  fill=\"none\" \n                  xmlns=\"http://www.w3.org/2000/svg\"\n                  className=\"opacity-40\"\n                >\n                  <circle cx=\"8.5\" cy=\"8.5\" r=\"5.5\" stroke=\"currentColor\" strokeWidth=\"1.5\"/>\n                  <path d=\"M12.5 12.5L16.5 16.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\"/>\n                </svg>\n              )\n            ) : (\n              // Default globe icon for generation page\n              <svg \n                width=\"20\" \n                height=\"20\" \n                viewBox=\"0 0 20 20\" \n                fill=\"none\" \n                xmlns=\"http://www.w3.org/2000/svg\"\n                className=\"opacity-40\"\n              >\n                <circle cx=\"10\" cy=\"10\" r=\"9.5\" stroke=\"currentColor\"/>\n                <path d=\"M10 2C10 5.5 10 14.5 10 18\" stroke=\"currentColor\" strokeLinecap=\"round\"/>\n                <path d=\"M2 10C5.5 10 14.5 10 18 10\" stroke=\"currentColor\" strokeLinecap=\"round\"/>\n                <ellipse cx=\"10\" cy=\"10\" rx=\"3.5\" ry=\"9.5\" stroke=\"currentColor\"/>\n                <ellipse cx=\"10\" cy=\"10\" rx=\"6\" ry=\"9.5\" stroke=\"currentColor\"/>\n              </svg>\n            )}\n          </div>\n\n          <textarea\n            ref={textareaRef}\n            className=\"w-full bg-transparent text-body-input text-accent-black placeholder:text-black-alpha-48 resize-none outline-none min-h-[24px] leading-6\"\n            placeholder={placeholder}\n            value={value}\n            onChange={(e) => onChange(e.target.value)}\n            onKeyDown={handleKeyDown}\n            onFocus={() => setIsFocused(true)}\n            onBlur={() => setIsFocused(false)}\n            rows={1}\n            style={{\n              height: 'auto',\n              overflow: 'hidden'\n            }}\n            onInput={(e) => {\n              const target = e.target as HTMLTextAreaElement;\n              target.style.height = 'auto';\n              target.style.height = target.scrollHeight + 'px';\n            }}\n          />\n        </label>\n\n        <div className=\"p-10 flex justify-end items-center relative\">\n          <button\n            onClick={onSubmit}\n            disabled={!value.trim()}\n            className={`\n              button relative rounded-10 px-8 py-8 text-label-medium font-medium\n              flex items-center justify-center gap-6\n              ${value.trim() \n                ? 'button-primary text-accent-white active:scale-[0.995]' \n                : 'bg-black-alpha-4 text-black-alpha-24 cursor-not-allowed'\n              }\n            `}\n          >\n            {value.trim() && <div className=\"button-background absolute inset-0 rounded-10 pointer-events-none\" />}\n            {value.trim() ? (\n              <>\n                <span className=\"px-6 relative\">Re-imagine Site</span>\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                  <path d=\"M3 8H13\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                  <path d=\"M8.5 3.5L13 8L8.5 12.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                </svg>\n              </>\n            ) : (\n              <div className=\"w-60 flex items-center justify-center\">\n                <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n                  <path d=\"M3 8H13\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                  <path d=\"M8.5 3.5L13 8L8.5 12.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\"/>\n                </svg>\n              </div>\n            )}\n          </button>\n        </div>\n      </div>\n\n      {/* Animated tiles for search results */}\n      {showTiles && (\n        <div className=\"mt-16 grid grid-cols-3 gap-12 px-16\">\n          {[0, 1, 2].map((index) => (\n            <div\n              key={index}\n              className=\"tile-animation relative aspect-[4/3] bg-black-alpha-4 rounded-12 overflow-hidden\"\n              style={{\n                animationDelay: `${index * 100}ms`\n              }}\n            >\n              <div className=\"absolute inset-0 bg-gradient-to-br from-black-alpha-4 to-transparent\" />\n              <div className=\"absolute inset-0 flex items-center justify-center\">\n                <div className=\"w-8 h-8 bg-black-alpha-8 rounded-full animate-pulse\" />\n              </div>\n            </div>\n          ))}\n        </div>\n      )}\n\n      <style jsx>{`\n        @keyframes tileSlideUp {\n          from {\n            opacity: 0;\n            transform: translateY(20px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .tile-animation {\n          animation: tileSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;\n          opacity: 0;\n        }\n      `}</style>\n    </div>\n  );\n}"
  },
  {
    "path": "components/SandboxPreview.tsx",
    "content": "import { useState } from 'react';\nimport { Loader2, ExternalLink, RefreshCw, Terminal } from 'lucide-react';\n\ninterface SandboxPreviewProps {\n  type: 'vite' | 'nextjs' | 'console';\n  output?: string;\n  isLoading?: boolean;\n  sandboxUrl?: string; // Real URL from Vercel Sandbox API\n}\n\nexport default function SandboxPreview({ \n  type, \n  output,\n  isLoading = false,\n  sandboxUrl\n}: SandboxPreviewProps) {\n  const [showConsole, setShowConsole] = useState(false);\n  const [iframeKey, setIframeKey] = useState(0);\n\n  // Use the real sandbox URL passed from the API\n  const previewUrl = sandboxUrl || '';\n\n  const handleRefresh = () => {\n    setIframeKey(prev => prev + 1);\n  };\n\n  if (type === 'console') {\n    return (\n      <div className=\"bg-gray-800 rounded-lg p-4 border border-gray-700\">\n        <div className=\"font-mono text-sm whitespace-pre-wrap text-gray-300\">\n          {output || 'No output yet...'}\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div className=\"space-y-4\">\n      {/* Preview Controls */}\n      <div className=\"flex items-center justify-between bg-gray-800 rounded-lg p-3 border border-gray-700\">\n        <div className=\"flex items-center gap-3\">\n          <span className=\"text-sm text-gray-400\">\n            {type === 'vite' ? '⚡ Vite' : '▲ Next.js'} Preview\n          </span>\n          {previewUrl ? (\n            <code className=\"text-xs bg-gray-900 px-2 py-1 rounded text-blue-400\">\n              {previewUrl}\n            </code>\n          ) : (\n            <span className=\"text-xs text-gray-500\">Waiting for sandbox URL...</span>\n          )}\n        </div>\n        <div className=\"flex items-center gap-2\">\n          <button\n            onClick={() => setShowConsole(!showConsole)}\n            className=\"p-2 hover:bg-gray-700 rounded transition-colors\"\n            title=\"Toggle console\"\n          >\n            <Terminal className=\"w-4 h-4\" />\n          </button>\n          <button\n            onClick={handleRefresh}\n            className=\"p-2 hover:bg-gray-700 rounded transition-colors\"\n            title=\"Refresh preview\"\n          >\n            <RefreshCw className=\"w-4 h-4\" />\n          </button>\n          {previewUrl && (\n            <a\n              href={previewUrl}\n              target=\"_blank\"\n              rel=\"noopener noreferrer\"\n              className=\"p-2 hover:bg-gray-700 rounded transition-colors\"\n              title=\"Open in new tab\"\n            >\n              <ExternalLink className=\"w-4 h-4\" />\n            </a>\n          )}\n        </div>\n      </div>\n\n      {/* Main Preview */}\n      <div className=\"relative bg-gray-900 rounded-lg overflow-hidden border border-gray-700\">\n        {(isLoading || !previewUrl) && (\n          <div className=\"absolute inset-0 bg-gray-900/80 flex items-center justify-center z-10\">\n            <div className=\"text-center\">\n              <Loader2 className=\"w-8 h-8 animate-spin mx-auto mb-2\" />\n              <p className=\"text-sm text-gray-400\">\n                {!previewUrl \n                  ? 'Setting up sandbox environment...' \n                  : type === 'vite' \n                    ? 'Starting Vite dev server...' \n                    : 'Starting Next.js dev server...'\n                }\n              </p>\n            </div>\n          </div>\n        )}\n        \n        {previewUrl && (\n          <iframe\n            key={iframeKey}\n            src={previewUrl}\n            className=\"w-full h-[600px] bg-white\"\n            title={`${type} preview`}\n            sandbox=\"allow-scripts allow-same-origin allow-forms\"\n          />\n        )}\n      </div>\n\n      {/* Console Output (Toggle) */}\n      {showConsole && output && (\n        <div className=\"bg-gray-800 rounded-lg p-4 border border-gray-700\">\n          <div className=\"flex items-center justify-between mb-2\">\n            <span className=\"text-sm font-semibold text-gray-400\">Console Output</span>\n          </div>\n          <div className=\"font-mono text-xs whitespace-pre-wrap text-gray-300 max-h-48 overflow-y-auto\">\n            {output}\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/ai-readiness/ControlPanel.tsx",
    "content": "\"use client\";\n\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { \n  Globe, \n  FileText, \n  Code, \n  Shield, \n  // Search, // Not used in current implementation \n  Zap, \n  Database,\n  // Lock, // Not used in current implementation\n  CheckCircle2,\n  XCircle,\n  Loader2,\n  AlertCircle,\n  Bot,\n  Sparkles,\n  FileCode,\n  Network,\n  Info,\n  Eye\n} from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\nimport ScoreChart from \"./ScoreChart\";\nimport RadarChart from \"./RadarChart\";\nimport MetricBars from \"./MetricBars\";\n\ninterface ControlPanelProps {\n  isAnalyzing: boolean;\n  showResults: boolean;\n  url: string;\n  analysisData?: any;\n  onReset: () => void;\n}\n\ninterface CheckItem {\n  id: string;\n  label: string;\n  description: string;\n  icon: any;\n  status: 'pending' | 'checking' | 'pass' | 'fail' | 'warning';\n  score?: number;\n  details?: string;\n  recommendation?: string;\n  actionItems?: string[];\n  tooltip?: string;\n}\n\nexport default function ControlPanel({\n  isAnalyzing,\n  showResults,\n  url,\n  analysisData,\n  onReset,\n}: ControlPanelProps) {\n  const [showAIAnalysis, setShowAIAnalysis] = useState(false); // Reserved for AI analysis feature\n  const [aiInsights, setAiInsights] = useState<CheckItem[]>([]);\n  const [isAnalyzingAI, setIsAnalyzingAI] = useState(false);\n  const [combinedChecks, setCombinedChecks] = useState<CheckItem[]>([]);\n  const [checks, setChecks] = useState<CheckItem[]>([\n    {\n      id: 'heading-structure',\n      label: 'Heading Hierarchy',\n      description: 'H1-H6 structure',\n      icon: FileText,\n      status: 'pending',\n    },\n    {\n      id: 'readability',\n      label: 'Readability',\n      description: 'Content clarity',\n      icon: Globe,\n      status: 'pending',\n    },\n    {\n      id: 'meta-tags',\n      label: 'Metadata Quality',\n      description: 'Title, desc, author',\n      icon: FileCode,\n      status: 'pending',\n    },\n    {\n      id: 'semantic-html',\n      label: 'Semantic HTML',\n      description: 'Proper HTML5 tags',\n      icon: Code,\n      status: 'pending',\n    },\n    {\n      id: 'accessibility',\n      label: 'Accessibility',\n      description: 'Alt text & ARIA',\n      icon: Eye,\n      status: 'pending',\n    },\n    {\n      id: 'llms-txt',\n      label: 'LLMs.txt',\n      description: 'AI permissions',\n      icon: Bot,\n      status: 'pending',\n    },\n    {\n      id: 'robots-txt',\n      label: 'Robots.txt',\n      description: 'Crawler rules',\n      icon: Shield,\n      status: 'pending',\n    },\n    {\n      id: 'sitemap',\n      label: 'Sitemap',\n      description: 'Site structure',\n      icon: Network,\n      status: 'pending',\n    },\n  ]);\n\n  const [overallScore, setOverallScore] = useState(0);\n  const [currentCheckIndex, setCurrentCheckIndex] = useState(-1);\n  const [selectedCheck, setSelectedCheck] = useState<string | null>(null);\n  const [hoveredCheck, setHoveredCheck] = useState<string | null>(null);\n  const [enhancedScore, setEnhancedScore] = useState(0);\n  const [viewMode, setViewMode] = useState<'grid' | 'chart' | 'bars'>('grid');\n\n  useEffect(() => {\n    if (analysisData && analysisData.checks && showResults) {\n      // Use real data from API\n      const mappedChecks = analysisData.checks.map((check: any) => ({\n        ...check,\n        icon: checks.find(c => c.id === check.id)?.icon || FileText,\n        description: check.details || checks.find(c => c.id === check.id)?.description,\n      }));\n      setChecks(mappedChecks);\n      setCombinedChecks(mappedChecks); // Initialize with basic checks\n      setOverallScore(analysisData.overallScore || 0);\n      setCurrentCheckIndex(-1);\n      \n      // If AI analysis should auto-start, handle the promise\n      if (analysisData.autoStartAI && analysisData.aiAnalysisPromise) {\n        console.log('Auto-starting AI analysis with promise');\n        setIsAnalyzingAI(true);\n        setShowAIAnalysis(true);\n        \n        // Add placeholder AI tiles immediately with actual titles\n        const placeholderAIChecks = [\n          {\n            id: 'ai-loading-0',\n            label: 'Content Quality for AI',\n            description: 'Analyzing content signal ratio...',\n            icon: Sparkles,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-1',\n            label: 'Information Architecture',\n            description: 'Evaluating page structure...',\n            icon: Bot,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-2',\n            label: 'Crawlability Patterns',\n            description: 'Checking JavaScript usage...',\n            icon: Database,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-3',\n            label: 'AI Training Value',\n            description: 'Assessing training potential...',\n            icon: Network,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-4',\n            label: 'Knowledge Extraction',\n            description: 'Analyzing entity definitions...',\n            icon: FileCode,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-5',\n            label: 'Template Quality',\n            description: 'Reviewing semantic structure...',\n            icon: Shield,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-6',\n            label: 'Content Depth',\n            description: 'Measuring content richness...',\n            icon: Zap,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          },\n          {\n            id: 'ai-loading-7',\n            label: 'Machine Readability',\n            description: 'Testing extraction reliability...',\n            icon: Globe,\n            status: 'checking' as const,\n            score: 0,\n            isAI: true,\n            isLoading: true\n          }\n        ];\n        \n        // Add loading AI tiles with staggered animation\n        placeholderAIChecks.forEach((check, idx) => {\n          setTimeout(() => {\n            setCombinedChecks(prev => [...prev, check]);\n          }, 100 * (idx + 1));\n        });\n        \n        // Handle the AI analysis promise\n        analysisData.aiAnalysisPromise\n          .then(async (aiResponse: any) => {\n            if (aiResponse) {\n              const data = await aiResponse.json();\n              if (data.success && data.insights) {\n                // Convert AI insights to CheckItem format\n                const aiChecks: CheckItem[] = data.insights.map((insight: any, idx: number) => ({\n                  ...insight,\n                  icon: [Sparkles, Bot, Database, Network, FileCode, Shield, Zap, Globe][idx % 8],\n                  description: insight.details?.substring(0, 60) + '...' || 'AI Analysis',\n                  isAI: true,\n                }));\n                \n                setAiInsights(aiChecks);\n                \n                // Replace loading tiles with real AI tiles\n                setCombinedChecks(prev => {\n                  // Remove loading tiles\n                  const withoutLoading = prev.filter(c => !(c as any).isLoading);\n                  // Add real AI tiles\n                  return [...withoutLoading, ...aiChecks];\n                });\n                \n                // Calculate enhanced score\n                if (data.insights.length > 0) {\n                  const aiScores = data.insights.map((i: any) => i.score || 0);\n                  const avgAiScore = aiScores.reduce((a: number, b: number) => a + b, 0) / aiScores.length;\n                  const combinedScore = Math.round((overallScore * 0.6) + (avgAiScore * 0.4));\n                  setEnhancedScore(combinedScore);\n                }\n              }\n            }\n          })\n          .catch((error: any) => {\n            console.error('AI analysis error:', error);\n            // Remove loading tiles on error\n            setCombinedChecks(prev => prev.filter(c => !(c as any).isLoading));\n          })\n          .finally(() => {\n            setIsAnalyzingAI(false);\n          });\n      }\n    } else if (isAnalyzing) {\n      // Reset all checks when starting analysis\n      const resetChecks = checks.map(check => ({ ...check, status: 'pending' as const }));\n      setChecks(resetChecks);\n      setCombinedChecks(resetChecks); // Reset combined checks too\n      setCurrentCheckIndex(0);\n      setOverallScore(0);\n      \n      // Visual animation while waiting for real results\n      const checkInterval = setInterval(() => {\n        setCurrentCheckIndex(prev => {\n          if (prev >= checks.length - 1) {\n            clearInterval(checkInterval);\n            return prev;\n          }\n          return prev + 1;\n        });\n      }, 200);\n\n      return () => clearInterval(checkInterval);\n    }\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [isAnalyzing, showResults, analysisData]);\n\n  useEffect(() => {\n    if (currentCheckIndex >= 0 && currentCheckIndex < checks.length && isAnalyzing) {\n      // Mark current as checking during animation\n      setChecks(prev => prev.map((check, index) => {\n        if (index === currentCheckIndex) {\n          return { ...check, status: 'checking' };\n        }\n        if (index < currentCheckIndex) {\n          return { ...check, status: 'checking' };\n        }\n        return check;\n      }));\n      \n      // Update combinedChecks to show the animation\n      setCombinedChecks(prev => prev.map((check, index) => {\n        if (index === currentCheckIndex) {\n          return { ...check, status: 'checking' };\n        }\n        if (index < currentCheckIndex) {\n          return { ...check, status: 'checking' };\n        }\n        return check;\n      }));\n    }\n  }, [currentCheckIndex, checks.length, isAnalyzing]);\n\n  const getStatusIcon = (status: CheckItem['status']) => {\n    switch (status) {\n      case 'checking':\n        return <Loader2 className=\"w-16 h-16 text-heat-100 animate-spin\" />;\n      case 'pass':\n        return <CheckCircle2 className=\"w-16 h-16 text-accent-black\" />;\n      case 'fail':\n        return <XCircle className=\"w-16 h-16 text-heat-200\" />;\n      case 'warning':\n        return <AlertCircle className=\"w-16 h-16 text-heat-100\" />;\n      default:\n        return <div className=\"w-16 h-16 rounded-full border border-black-alpha-8\" />;\n    }\n  };\n\n  // Utility function available but not used in current render\n  const getScoreColor = (score: number) => {\n    if (score >= 80) return \"text-accent-black\";\n    if (score >= 60) return \"text-accent-black\";\n    return \"text-accent-black\";\n  };\n\n\n  return (\n    <motion.div\n      initial={{ opacity: 0, y: 20 }}\n      animate={{ opacity: 1, y: 0 }}\n      exit={{ opacity: 0, y: -20 }}\n      transition={{ duration: 0.5 }}\n      className=\"w-full max-w-[1200px] mx-auto\"\n    >\n      {/* Header */}\n      <motion.div \n        className=\"text-center mb-48 pt-24 md:pt-0\"\n        initial={{ opacity: 0, y: -20 }}\n        animate={{ opacity: 1, y: 0 }}\n        transition={{ delay: 0.2 }}\n      >\n        <h2 className=\"text-title-h2 text-accent-black mb-12\">AI Readiness Analysis</h2>\n        <p className=\"text-body-large text-black-alpha-64\">Single-page snapshot of {url}</p>\n        \n        {showResults && (\n          <>\n            {/* View Mode Toggle - Moved above score */}\n            <motion.div\n              initial={{ opacity: 0 }}\n              animate={{ opacity: 1 }}\n              transition={{ delay: 0.3 }}\n              className=\"mt-24 mb-20 flex justify-center gap-4\"\n            >\n              <button\n                onClick={() => setViewMode('grid')}\n                className={`px-16 py-8 rounded-8 text-label-medium font-medium transition-all ${\n                  viewMode === 'grid' \n                    ? 'bg-accent-black text-white shadow-md' \n                    : 'bg-black-alpha-4 text-black-alpha-64 hover:bg-black-alpha-8'\n                }`}\n              >\n                Grid View\n              </button>\n              <button\n                onClick={() => setViewMode('chart')}\n                className={`px-16 py-8 rounded-8 text-label-medium font-medium transition-all ${\n                  viewMode === 'chart' \n                    ? 'bg-accent-black text-white shadow-md' \n                    : 'bg-black-alpha-4 text-black-alpha-64 hover:bg-black-alpha-8'\n                }`}\n              >\n                Radar Chart\n              </button>\n              <button\n                onClick={() => setViewMode('bars')}\n                className={`px-16 py-8 rounded-8 text-label-medium font-medium transition-all ${\n                  viewMode === 'bars' \n                    ? 'bg-accent-black text-white shadow-md' \n                    : 'bg-black-alpha-4 text-black-alpha-64 hover:bg-black-alpha-8'\n                }`}\n              >\n                Bar Chart\n              </button>\n            </motion.div>\n            \n            <motion.div\n              initial={{ scale: 0 }}\n              animate={{ scale: 1 }}\n              transition={{ type: \"spring\", delay: 0.5 }}\n              className=\"flex justify-center\"\n            >\n              <ScoreChart \n                score={enhancedScore > 0 ? enhancedScore : overallScore}\n                enhanced={enhancedScore > 0}\n                size={180}\n              />\n            </motion.div>\n          </>\n        )}\n      </motion.div>\n\n      {/* Conditional rendering based on view mode */}\n      {viewMode === 'grid' && (\n        <div className=\"grid grid-cols-2 lg:grid-cols-4 gap-12 mb-40 px-40 relative\">\n          {combinedChecks.map((check, index) => {\n            const isActive = index === currentCheckIndex;\n            \n            return (\n              <motion.div\n                key={check.id}\n                initial={(check as any).isAI ? { opacity: 1, scale: 1 } : { opacity: 0, scale: 0.9 }}\n                animate={{ \n                  opacity: 1, \n                  scale: isActive ? 1.05 : 1,\n                }}\n                transition={{ \n                  delay: (check as any).isAI ? 0 : index * 0.1,\n                  scale: { type: \"spring\", stiffness: 300 }\n                }}\n                className={`\n                  relative p-16 rounded-8 transition-all bg-accent-white border\n                  ${(check as any).isAI ? 'border-heat-100 border-opacity-40 bg-gradient-to-br from-accent-white to-heat-4' : 'border-black-alpha-8'}\n                  ${isActive ? 'border-heat-100 shadow-lg' : ''}\n                  ${check.status !== 'pending' && check.status !== 'checking' ? 'cursor-pointer hover:shadow-md' : ''}\n                  ${(check as any).isLoading ? 'animate-pulse' : ''}\n                `}\n                onClick={() => {\n                  if (check.status !== 'pending' && check.status !== 'checking') {\n                    setSelectedCheck(selectedCheck === check.id ? null : check.id);\n                  }\n                }}\n                onMouseEnter={() => setHoveredCheck(check.id)}\n                onMouseLeave={() => setHoveredCheck(null)}\n              >\n                <div className=\"relative\">\n                  <div className=\"flex items-start justify-end mb-12\">\n                    {getStatusIcon(check.status)}\n                  </div>\n                  \n                  <h3 className=\"text-label-large mb-4 text-accent-black font-medium flex items-center gap-6\">\n                    {check.label}\n                    {check.tooltip && !aiInsights.some(ai => ai.id === check.id) && (\n                      <div className=\"relative inline-block\">\n                        <Info className=\"w-14 h-14 text-black-alpha-32 hover:text-black-alpha-64 transition-colors\" />\n                        <AnimatePresence>\n                          {hoveredCheck === check.id && (\n                            <motion.div\n                              initial={{ opacity: 0, y: 5 }}\n                              animate={{ opacity: 1, y: 0 }}\n                              exit={{ opacity: 0, y: 5 }}\n                              className=\"absolute bottom-full left-1/2 -translate-x-1/2 mb-8 w-200 p-8 bg-accent-black text-white text-body-x-small rounded-6 shadow-lg z-50 pointer-events-none\"\n                            >\n                              {check.tooltip}\n                              <div className=\"absolute top-full left-1/2 -translate-x-1/2 -mt-1 w-0 h-0 border-l-4 border-r-4 border-t-4 border-transparent border-t-accent-black\" />\n                            </motion.div>\n                          )}\n                        </AnimatePresence>\n                      </div>\n                    )}\n                  </h3>\n                  \n                  <p className=\"text-body-small text-black-alpha-64\">\n                    {check.description}\n                  </p>\n                  \n                  {check.status !== 'pending' && check.status !== 'checking' && (\n                    <>\n                      <motion.div\n                        initial={{ opacity: 0, y: 10 }}\n                        animate={{ opacity: 1, y: 0 }}\n                        className=\"mt-8\"\n                      >\n                        <div className=\"h-2 bg-black-alpha-4 rounded-full overflow-hidden\">\n                          <motion.div\n                            className={`\n                              h-full rounded-full\n                              ${check.status === 'pass' ? 'bg-accent-black' : ''}\n                              ${check.status === 'warning' ? 'bg-heat-100' : ''}\n                              ${check.status === 'fail' ? 'bg-heat-200' : ''}\n                            `}\n                            initial={{ width: 0 }}\n                            animate={{ width: `${check.score}%` }}\n                            transition={{ duration: 0.5 }}\n                          />\n                        </div>\n                      </motion.div>\n                      <motion.div\n                        initial={{ opacity: 0 }}\n                        animate={{ opacity: 1 }}\n                        transition={{ delay: 0.5 }}\n                        className=\"text-label-x-small text-black-alpha-32 mt-4 text-center\"\n                      >\n                        Click for details\n                      </motion.div>\n                    </>\n                  )}\n                </div>\n                \n                {/* Expanded Details */}\n                <AnimatePresence>\n                  {selectedCheck === check.id && check.details && (\n                    <motion.div\n                      initial={{ opacity: 0, y: -10 }}\n                      animate={{ opacity: 1, y: 0 }}\n                      exit={{ opacity: 0, y: -10 }}\n                      transition={{ duration: 0.2 }}\n                      className=\"mt-12 pt-12 border-t border-black-alpha-8\"\n                    >\n                      <div className=\"space-y-6\">\n                        <div>\n                          <div className=\"text-label-small text-black-alpha-48 mb-2\">Status</div>\n                          <div className=\"text-body-small text-accent-black\">{check.details}</div>\n                        </div>\n                        <div>\n                          <div className=\"text-label-small text-black-alpha-48 mb-2\">Recommendation</div>\n                          <div className=\"text-body-small text-black-alpha-64\">{check.recommendation}</div>\n                          {check.actionItems && check.actionItems.length > 0 && (\n                            <ul className=\"mt-4 space-y-2\">\n                              {check.actionItems.map((item: string, i: number) => (\n                                <li key={i} className=\"flex items-start gap-6 text-body-small text-black-alpha-64\">\n                                  <span className=\"text-heat-100 mt-1\">•</span>\n                                  <span>{item}</span>\n                                </li>\n                              ))}\n                            </ul>\n                          )}\n                        </div>\n                      </div>\n                    </motion.div>\n                  )}\n                </AnimatePresence>\n              </motion.div>\n            );\n          })}\n        </div>\n      )}\n\n      {/* Radar Chart View */}\n      {viewMode === 'chart' && showResults && (\n        <div>\n          <motion.div \n            className=\"flex justify-center gap-40 mb-40\"\n            initial={{ opacity: 0, scale: 0.9 }}\n            animate={{ opacity: 1, scale: 1 }}\n            transition={{ duration: 0.3 }}\n          >\n            {/* Basic Analysis Chart */}\n            <div className=\"flex flex-col items-center\">\n              <h3 className=\"text-label-large text-accent-black mb-16 font-medium\">Basic Analysis</h3>\n              <RadarChart \n                data={checks\n                  .filter(check => check.status !== 'pending' && check.status !== 'checking')\n                  .slice(0, 8)\n                  .map(check => ({\n                    label: check.label.length > 12 ? check.label.substring(0, 12) + '...' : check.label,\n                    score: check.score || 0\n                  }))}\n                size={350}\n              />\n              <div className=\"mt-16 text-center\">\n                <div className=\"text-title-h3 text-accent-black\">{overallScore}%</div>\n                <div className=\"text-label-small text-black-alpha-48\">Overall Score</div>\n              </div>\n            </div>\n            \n            {/* VS Indicator */}\n            {aiInsights.length > 0 && (\n              <motion.div \n                className=\"flex items-center\"\n                initial={{ opacity: 0, scale: 0 }}\n                animate={{ opacity: 1, scale: 1 }}\n                transition={{ delay: 0.2, type: \"spring\" }}\n              >\n                <div className=\"text-label-large text-black-alpha-32 font-medium\">VS</div>\n              </motion.div>\n            )}\n            \n            {/* AI Analysis Chart - Only show if AI insights exist */}\n            {aiInsights.length > 0 && (\n              <motion.div \n                className=\"flex flex-col items-center\"\n                initial={{ opacity: 0, x: 20 }}\n                animate={{ opacity: 1, x: 0 }}\n                transition={{ delay: 0.3 }}\n              >\n                <h3 className=\"text-label-large text-heat-100 mb-16 font-medium\">AI Enhanced Analysis</h3>\n                <RadarChart \n                  data={aiInsights\n                    .filter(check => check.status !== 'pending' && check.status !== 'checking')\n                    .slice(0, 8)\n                    .map(check => ({\n                      label: check.label.length > 12 ? check.label.substring(0, 12) + '...' : check.label,\n                      score: check.score || 0\n                    }))}\n                  size={350}\n                />\n                <div className=\"mt-16 text-center\">\n                  <div className=\"text-title-h3 text-heat-100\">\n                    {Math.round(aiInsights.reduce((sum, check) => sum + (check.score || 0), 0) / aiInsights.length)}%\n                  </div>\n                  <div className=\"text-label-small text-heat-100 opacity-60\">AI Score</div>\n                </div>\n              </motion.div>\n            )}\n          </motion.div>\n          \n          {/* Comparison Summary */}\n          {aiInsights.length > 0 && (\n            <motion.div\n              initial={{ opacity: 0, y: 20 }}\n              animate={{ opacity: 1, y: 0 }}\n              transition={{ delay: 0.5 }}\n              className=\"text-center mb-20\"\n            >\n              <div className=\"inline-flex items-center gap-8 px-16 py-8 bg-heat-4 rounded-8\">\n                <span className=\"text-label-medium text-accent-black\">\n                  AI analysis found {aiInsights.filter(i => i.score && i.score < 50).length} additional areas for improvement\n                </span>\n              </div>\n            </motion.div>\n          )}\n        </div>\n      )}\n\n      {/* Bar Chart View */}\n      {viewMode === 'bars' && showResults && (\n        <motion.div \n          className=\"px-40 mb-40\"\n          initial={{ opacity: 0, y: 20 }}\n          animate={{ opacity: 1, y: 0 }}\n          transition={{ duration: 0.3 }}\n        >\n          <MetricBars \n            metrics={combinedChecks\n              .filter(check => check.status !== 'pending' && check.status !== 'checking')\n              .map(check => ({\n                label: check.label,\n                score: check.score || 0,\n                status: check.status as 'pass' | 'warning' | 'fail',\n                category: (check as any).isAI ? 'ai' : \n                  ['robots-txt', 'sitemap', 'llms-txt'].includes(check.id) ? 'domain' : 'page',\n                details: check.details,\n                recommendation: check.recommendation,\n                actionItems: check.actionItems\n              }))}\n          />\n        </motion.div>\n      )}\n\n      {/* Action Buttons */}\n      {showResults && (\n        <motion.div\n          initial={{ opacity: 0, y: 20 }}\n          animate={{ opacity: 1, y: 0 }}\n          transition={{ delay: 0.8 }}\n          className=\"flex gap-12 justify-center\"\n        >\n          <button\n            onClick={onReset}\n            className=\"px-20 py-10 bg-accent-white border border-black-alpha-8 hover:bg-black-alpha-4 rounded-8 text-label-medium transition-all\"\n          >\n            Analyze Another Site\n          </button>\n          {true && ( \n            <button \n              onClick={async () => {\n              setIsAnalyzingAI(true);\n              setShowAIAnalysis(true);\n              \n              // Add placeholder AI tiles immediately with actual titles\n              const placeholderAIChecks = [\n                {\n                  id: 'ai-loading-0',\n                  label: 'Content Quality for AI',\n                  description: 'Analyzing content signal ratio...',\n                  icon: Sparkles,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-1',\n                  label: 'Information Architecture',\n                  description: 'Evaluating page structure...',\n                  icon: Bot,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-2',\n                  label: 'Crawlability Patterns',\n                  description: 'Checking JavaScript usage...',\n                  icon: Database,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-3',\n                  label: 'AI Training Value',\n                  description: 'Assessing training potential...',\n                  icon: Network,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-4',\n                  label: 'Knowledge Extraction',\n                  description: 'Analyzing entity definitions...',\n                  icon: FileCode,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-5',\n                  label: 'Template Quality',\n                  description: 'Reviewing semantic structure...',\n                  icon: Shield,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-6',\n                  label: 'Content Depth',\n                  description: 'Measuring content richness...',\n                  icon: Zap,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                },\n                {\n                  id: 'ai-loading-7',\n                  label: 'Machine Readability',\n                  description: 'Testing extraction reliability...',\n                  icon: Globe,\n                  status: 'checking' as const,\n                  score: 0,\n                  isAI: true,\n                  isLoading: true\n                }\n              ];\n              \n              // Add loading AI tiles with staggered animation immediately\n              placeholderAIChecks.forEach((check, idx) => {\n                setTimeout(() => {\n                  setCombinedChecks(prev => [...prev, check]);\n                }, 100 * (idx + 1));\n              });\n              \n              try {\n                const response = await fetch('/api/ai-analysis', {\n                  method: 'POST',\n                  headers: { 'Content-Type': 'application/json' },\n                  body: JSON.stringify({\n                    url,\n                    htmlContent: analysisData?.htmlContent || '',\n                    currentChecks: checks\n                  })\n                });\n                \n                const data = await response.json();\n                if (data.success && data.insights) {\n                  // Convert AI insights to CheckItem format with AI flag\n                  const aiChecks: CheckItem[] = data.insights.map((insight: any, idx: number) => ({\n                    ...insight,\n                    icon: [Sparkles, Bot, Database, Network, FileCode, Shield, Zap, Globe][idx % 8],\n                    description: insight.details?.substring(0, 60) + '...' || 'AI Analysis',\n                    isAI: true, // Mark as AI-generated\n                  }));\n                  \n                  setAiInsights(aiChecks);\n                  \n                  // Replace loading tiles with real AI tiles\n                  setCombinedChecks(prev => {\n                    // Remove loading tiles\n                    const withoutLoading = prev.filter(c => !(c as any).isLoading);\n                    // Add real AI tiles\n                    return [...withoutLoading, ...aiChecks];\n                  });\n                  \n                  // Calculate enhanced score\n                  if (data.insights.length > 0) {\n                    const aiScores = data.insights.map((i: any) => i.score || 0);\n                    const avgAiScore = aiScores.reduce((a: number, b: number) => a + b, 0) / aiScores.length;\n                    const combinedScore = Math.round((overallScore * 0.6) + (avgAiScore * 0.4));\n                    setEnhancedScore(combinedScore);\n                  }\n                }\n              } catch (error) {\n                console.error('AI analysis error:', error);\n                // Remove loading tiles on error\n                setCombinedChecks(prev => prev.filter(c => !(c as any).isLoading));\n              } finally {\n                setIsAnalyzingAI(false);\n              }\n            }}\n            disabled={isAnalyzingAI}\n            className=\"px-20 py-10 bg-accent-black hover:bg-black-alpha-80 text-white rounded-8 text-label-medium transition-all disabled:opacity-50\"\n          >\n              {isAnalyzingAI ? 'Analyzing...' : 'Analyze with AI'}\n            </button>\n          )}\n        </motion.div>\n      )}\n    </motion.div>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/ai-readiness/InlineResults.tsx",
    "content": "\"use client\";\n\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { Check, X, FileText, Globe, Code, Sparkles, AlertCircle } from \"lucide-react\";\n// import { Zap, Shield } from \"lucide-react\"; // Reserved for future features\nimport { useEffect, useState } from \"react\";\n\ninterface InlineResultsProps {\n  isAnalyzing: boolean;\n  showResults: boolean;\n  analysisStep: number;\n  url: string;\n  onReset: () => void;\n}\n\nconst analysisSteps = [\n  \"Fetching website content...\",\n  \"Checking for LLMs.txt...\",\n  \"Analyzing HTML structure...\",\n  \"Calculating AI readiness...\",\n];\n\n// Placeholder data for the results\nconst mockResults = {\n  score: 78,\n  grade: \"B+\",\n  llmsTxt: true,\n  robotsTxt: true,\n  structuredData: true,\n  semanticHTML: false,\n  metaTags: true,\n  accessibility: true,\n};\n\nexport default function InlineResults({\n  isAnalyzing,\n  showResults,\n  analysisStep,\n  url: _url, // URL prop available but not used in current implementation\n  onReset,\n}: InlineResultsProps) {\n  const [displayScore, setDisplayScore] = useState(0);\n  \n  useEffect(() => {\n    if (showResults) {\n      // Animate score counting up\n      const target = mockResults.score;\n      const duration = 1500;\n      const increment = target / (duration / 16);\n      let current = 0;\n      \n      const timer = setInterval(() => {\n        current += increment;\n        if (current >= target) {\n          setDisplayScore(target);\n          clearInterval(timer);\n        } else {\n          setDisplayScore(Math.floor(current));\n        }\n      }, 16);\n      \n      return () => clearInterval(timer);\n    }\n  }, [showResults]);\n\n  const getScoreColor = (score: number) => {\n    if (score >= 80) return \"#22c55e\";\n    if (score >= 60) return \"#eab308\";\n    return \"#ef4444\";\n  };\n\n  return (\n    <AnimatePresence mode=\"wait\">\n      {/* Analyzing State */}\n      {isAnalyzing && (\n        <motion.div\n          key=\"analyzing\"\n          initial={{ opacity: 0, y: 20 }}\n          animate={{ opacity: 1, y: 0 }}\n          exit={{ opacity: 0, y: -20 }}\n          transition={{ duration: 0.3 }}\n          className=\"space-y-20\"\n        >\n          {/* Progress Bar */}\n          <div className=\"relative\">\n            <div className=\"h-2 bg-black-alpha-4 rounded-full overflow-hidden\">\n              <motion.div\n                className=\"h-full bg-gradient-to-r from-heat-100 to-heat-200\"\n                initial={{ width: \"0%\" }}\n                animate={{ width: `${((analysisStep + 1) / 4) * 100}%` }}\n                transition={{ duration: 0.5, ease: \"easeOut\" }}\n              />\n            </div>\n            \n            {/* Glowing dot at the end of progress */}\n            <motion.div\n              className=\"absolute top-1/2 -translate-y-1/2 w-3 h-3 bg-heat-100 rounded-full\"\n              style={{ \n                left: `${((analysisStep + 1) / 4) * 100}%`,\n                boxShadow: \"0 0 20px rgba(255, 77, 0, 0.8)\",\n              }}\n              animate={{ \n                scale: [1, 1.5, 1],\n                opacity: [1, 0.8, 1],\n              }}\n              transition={{ \n                duration: 0.8,\n                repeat: Infinity,\n              }}\n            />\n          </div>\n          \n          {/* Status Text */}\n          <motion.div \n            key={analysisStep}\n            initial={{ opacity: 0, x: -10 }}\n            animate={{ opacity: 1, x: 0 }}\n            className=\"flex items-center gap-8 text-body-medium text-black-alpha-64\"\n          >\n            <motion.div\n              animate={{ rotate: 360 }}\n              transition={{ duration: 1, repeat: Infinity, ease: \"linear\" }}\n            >\n              <Sparkles className=\"w-16 h-16 text-heat-100\" />\n            </motion.div>\n            {analysisSteps[analysisStep]}\n          </motion.div>\n          \n          {/* ASCII Animation */}\n          <motion.div\n            className=\"font-mono text-xs text-black-alpha-16 overflow-hidden h-32 relative\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            transition={{ delay: 0.2 }}\n          >\n            <motion.div\n              animate={{ y: [0, -10, 0] }}\n              transition={{ duration: 2, repeat: Infinity }}\n              className=\"absolute inset-0 flex items-center justify-center\"\n            >\n              {'< analyzing />'}\n            </motion.div>\n          </motion.div>\n        </motion.div>\n      )}\n      \n      {/* Results State */}\n      {showResults && (\n        <motion.div\n          key=\"results\"\n          initial={{ opacity: 0, scale: 0.95 }}\n          animate={{ opacity: 1, scale: 1 }}\n          exit={{ opacity: 0, scale: 0.95 }}\n          transition={{ duration: 0.4, ease: \"easeOut\" }}\n          className=\"space-y-24\"\n        >\n          {/* Score Display */}\n          <div className=\"text-center\">\n            <motion.div\n              initial={{ scale: 0 }}\n              animate={{ scale: 1 }}\n              transition={{ \n                type: \"spring\",\n                stiffness: 200,\n                delay: 0.2 \n              }}\n              className=\"relative inline-block\"\n            >\n              {/* Background glow */}\n              <motion.div\n                className=\"absolute inset-0 rounded-full blur-xl\"\n                style={{ background: getScoreColor(mockResults.score) }}\n                animate={{ \n                  opacity: [0.3, 0.6, 0.3],\n                  scale: [0.8, 1.2, 0.8],\n                }}\n                transition={{ \n                  duration: 2,\n                  repeat: Infinity,\n                }}\n              />\n              \n              {/* Score circle */}\n              <div \n                className=\"relative w-120 h-120 rounded-full flex flex-col items-center justify-center\"\n                style={{ \n                  background: `conic-gradient(from 0deg, ${getScoreColor(mockResults.score)} ${displayScore * 3.6}deg, #f0f0f0 ${displayScore * 3.6}deg)`,\n                  padding: \"4px\",\n                }}\n              >\n                <div className=\"w-full h-full bg-white rounded-full flex flex-col items-center justify-center\">\n                  <motion.div\n                    initial={{ opacity: 0 }}\n                    animate={{ opacity: 1 }}\n                    transition={{ delay: 0.5 }}\n                    className=\"text-4xl font-bold\"\n                    style={{ color: getScoreColor(mockResults.score) }}\n                  >\n                    {displayScore}\n                  </motion.div>\n                  <motion.div\n                    initial={{ opacity: 0, y: 5 }}\n                    animate={{ opacity: 1, y: 0 }}\n                    transition={{ delay: 0.7 }}\n                    className=\"text-label-medium text-black-alpha-48\"\n                  >\n                    AI Ready\n                  </motion.div>\n                </div>\n              </div>\n            </motion.div>\n          </div>\n          \n          {/* Quick Checks Grid */}\n          <motion.div \n            className=\"grid grid-cols-3 gap-12\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            transition={{ delay: 0.8 }}\n          >\n            {[\n              { \n                label: \"LLMs.txt\", \n                value: mockResults.llmsTxt, \n                icon: FileText,\n                description: \"AI instructions\",\n                detail: mockResults.llmsTxt ? \"Found\" : \"Missing\"\n              },\n              { \n                label: \"Structured Data\", \n                value: mockResults.structuredData, \n                icon: Code,\n                description: \"Schema markup\",\n                detail: mockResults.structuredData ? \"Detected\" : \"Not found\"\n              },\n              { \n                label: \"Semantic HTML\", \n                value: mockResults.semanticHTML, \n                icon: Globe,\n                description: \"HTML5 tags\",\n                detail: mockResults.semanticHTML ? \"Good\" : \"Needs work\"\n              },\n            ].map((item, index) => (\n              <motion.div\n                key={item.label}\n                initial={{ opacity: 0, y: 10 }}\n                animate={{ opacity: 1, y: 0 }}\n                transition={{ delay: 0.9 + index * 0.1 }}\n                className={`\n                  relative p-16 rounded-12 transition-all hover:shadow-md cursor-pointer\n                  ${item.value \n                    ? 'bg-gradient-to-br from-green-50 to-green-100/50 border-green-200' \n                    : 'bg-gradient-to-br from-red-50 to-red-100/50 border-red-200'}\n                  border\n                `}\n              >\n                {/* Status indicator */}\n                <div className=\"absolute top-12 right-12\">\n                  <motion.div\n                    initial={{ scale: 0 }}\n                    animate={{ scale: 1 }}\n                    transition={{ delay: 1 + index * 0.1, type: \"spring\" }}\n                    className={`\n                      w-24 h-24 rounded-full flex items-center justify-center\n                      ${item.value ? 'bg-green-500' : 'bg-red-500'}\n                    `}\n                  >\n                    {item.value ? (\n                      <Check className=\"w-14 h-14 text-white\" strokeWidth={3} />\n                    ) : (\n                      <X className=\"w-14 h-14 text-white\" strokeWidth={3} />\n                    )}\n                  </motion.div>\n                </div>\n                \n                {/* Icon */}\n                <div className=\"mb-12\">\n                  <item.icon className={`\n                    w-24 h-24\n                    ${item.value ? 'text-green-600' : 'text-red-600'}\n                  `} />\n                </div>\n                \n                {/* Content */}\n                <div className=\"space-y-4\">\n                  <div className=\"text-label-medium text-accent-black\">\n                    {item.label}\n                  </div>\n                  <div className=\"text-body-small text-black-alpha-48\">\n                    {item.description}\n                  </div>\n                  <div className={`\n                    text-label-small font-semibold\n                    ${item.value ? 'text-green-600' : 'text-red-600'}\n                  `}>\n                    {item.detail}\n                  </div>\n                </div>\n              </motion.div>\n            ))}\n          </motion.div>\n          \n          {/* Quick Tip */}\n          <motion.div\n            initial={{ opacity: 0, y: 10 }}\n            animate={{ opacity: 1, y: 0 }}\n            transition={{ delay: 1.2 }}\n            className=\"p-12 bg-heat-4 rounded-8 border border-heat-100 flex items-start gap-8\"\n          >\n            <AlertCircle className=\"w-16 h-16 text-heat-100 mt-2\" />\n            <div className=\"flex-1\">\n              <div className=\"text-label-medium text-accent-black mb-4\">Quick Tip</div>\n              <div className=\"text-body-small text-black-alpha-64\">\n                {mockResults.semanticHTML \n                  ? \"Your site has good semantic HTML structure for AI understanding.\"\n                  : \"Add semantic HTML5 elements to improve AI comprehension of your content.\"}\n              </div>\n            </div>\n          </motion.div>\n          \n          {/* Action Buttons */}\n          <motion.div\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            transition={{ delay: 1.4 }}\n            className=\"flex gap-8\"\n          >\n            <button\n              onClick={onReset}\n              className=\"flex-1 px-16 py-10 bg-black-alpha-4 hover:bg-black-alpha-6 rounded-8 text-label-medium transition-all\"\n            >\n              Try Another\n            </button>\n            <button className=\"flex-1 px-16 py-10 bg-heat-100 hover:bg-heat-200 text-white rounded-8 text-label-medium transition-all shadow-lg hover:shadow-xl\">\n              View Details\n            </button>\n          </motion.div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/ai-readiness/MetricBars.tsx",
    "content": "\"use client\";\n\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { useState } from \"react\";\nimport { ChevronDown } from \"lucide-react\";\n\ninterface MetricBarsProps {\n  metrics: {\n    label: string;\n    score: number;\n    status: 'pass' | 'warning' | 'fail';\n    category?: 'page' | 'domain' | 'ai';\n    details?: string;\n    recommendation?: string;\n    actionItems?: string[];\n  }[];\n}\n\nexport default function MetricBars({ metrics }: MetricBarsProps) {\n  const [expandedItems, setExpandedItems] = useState<Set<string>>(new Set());\n  \n  const getBarColor = (score: number) => {\n    // Use brand orange colors with opacity for gradient effect\n    if (score >= 80) return 'bg-heat-100';\n    if (score >= 60) return 'bg-heat-90';\n    if (score >= 40) return 'bg-heat-40 opacity-80';\n    return 'bg-heat-20';\n  };\n  \n  const getBulletColor = (_score: number) => {\n    // Always use heat-100 for all bullets for consistency\n    return 'bg-heat-100';\n  };\n  \n  const toggleExpanded = (label: string) => {\n    const newExpanded = new Set(expandedItems);\n    if (newExpanded.has(label)) {\n      newExpanded.delete(label);\n    } else {\n      newExpanded.add(label);\n    }\n    setExpandedItems(newExpanded);\n  };\n  \n  // Sort metrics by score descending\n  const sortedMetrics = [...metrics].sort((a, b) => b.score - a.score);\n  \n  return (\n    <div className=\"space-y-8 max-w-[800px] mx-auto\">\n      {sortedMetrics.map((metric, index) => {\n        const isExpanded = expandedItems.has(metric.label);\n        \n        return (\n          <motion.div\n            key={metric.label}\n            initial={{ opacity: 0, x: -20 }}\n            animate={{ opacity: 1, x: 0 }}\n            transition={{ delay: index * 0.05, duration: 0.3 }}\n            className=\"space-y-0\"\n          >\n            <div \n              className={`grid grid-cols-12 gap-4 items-center p-8 -m-8 rounded-8 cursor-pointer transition-all hover:bg-black-alpha-2 ${\n                isExpanded ? 'bg-black-alpha-4' : ''\n              }`}\n              onClick={() => toggleExpanded(metric.label)}\n            >\n              {/* Bullet and Label - fixed width */}\n              <div className=\"col-span-4 flex items-center gap-8\">\n                <div className={`w-6 h-6 rounded-full ${getBulletColor(metric.score)}`} />\n                <span className=\"text-label-medium text-accent-black truncate\">{metric.label}</span>\n                <motion.div\n                  animate={{ rotate: isExpanded ? 180 : 0 }}\n                  transition={{ duration: 0.2 }}\n                  className=\"ml-auto\"\n                >\n                  <ChevronDown className=\"w-16 h-16 text-black-alpha-32\" />\n                </motion.div>\n              </div>\n              \n              {/* Bar container - flexible width */}\n              <div className=\"col-span-7 relative\">\n                <div className=\"relative h-8 bg-black-alpha-8 rounded-full overflow-hidden\">\n                  {/* Animated bar */}\n                  <motion.div\n                    className={`absolute inset-y-0 left-0 ${getBarColor(metric.score)} rounded-full`}\n                    initial={{ width: 0 }}\n                    animate={{ width: `${Math.max(metric.score, 2)}%` }}\n                    transition={{ \n                      delay: 0.2 + index * 0.05, \n                      duration: 0.8,\n                      ease: \"easeOut\"\n                    }}\n                  >\n                    {/* Subtle inner glow */}\n                    <div className=\"absolute inset-0 bg-gradient-to-t from-transparent to-white opacity-10 rounded-full\" />\n                  </motion.div>\n                  \n                  {/* Score indicator lines at key thresholds */}\n                  {[40, 60, 80].map(threshold => (\n                    <div\n                      key={threshold}\n                      className=\"absolute top-0 bottom-0 w-px bg-black-alpha-8 opacity-30\"\n                      style={{ left: `${threshold}%` }}\n                    />\n                  ))}\n                </div>\n              </div>\n              \n              {/* Score value - fixed width */}\n              <div className=\"col-span-1 text-right\">\n                <span className=\"text-label-medium font-medium text-heat-100\">\n                  {metric.score}%\n                </span>\n              </div>\n            </div>\n            \n            {/* Expanded Details */}\n            <AnimatePresence>\n              {isExpanded && metric.details && (\n                <motion.div\n                  initial={{ opacity: 0, height: 0 }}\n                  animate={{ opacity: 1, height: \"auto\" }}\n                  exit={{ opacity: 0, height: 0 }}\n                  transition={{ duration: 0.3 }}\n                  className=\"overflow-hidden\"\n                >\n                  <div className=\"pl-54 pr-12 py-12 space-y-8\">\n                    <div>\n                      <div className=\"text-label-small text-black-alpha-48 mb-4\">Status</div>\n                      <div className=\"text-body-small text-accent-black\">{metric.details}</div>\n                    </div>\n                    {metric.recommendation && (\n                      <div>\n                        <div className=\"text-label-small text-black-alpha-48 mb-4\">Recommendation</div>\n                        <div className=\"text-body-small text-black-alpha-64\">{metric.recommendation}</div>\n                      </div>\n                    )}\n                    {metric.actionItems && metric.actionItems.length > 0 && (\n                      <div>\n                        <div className=\"text-label-small text-black-alpha-48 mb-4\">Action Items</div>\n                        <ul className=\"space-y-4\">\n                          {metric.actionItems.map((item: string, i: number) => (\n                            <li key={i} className=\"flex items-start gap-6 text-body-small text-black-alpha-64\">\n                              <span className=\"text-heat-100 mt-1\">•</span>\n                              <span>{item}</span>\n                            </li>\n                          ))}\n                        </ul>\n                      </div>\n                    )}\n                  </div>\n                </motion.div>\n              )}\n            </AnimatePresence>\n          </motion.div>\n        );\n      })}\n      \n      {/* Summary stats */}\n      <motion.div\n        initial={{ opacity: 0 }}\n        animate={{ opacity: 1 }}\n        transition={{ delay: 0.5 }}\n        className=\"mt-20 pt-12 border-t border-black-alpha-8\"\n      >\n        <div className=\"grid grid-cols-3 gap-16 text-center\">\n          <div>\n            <div className=\"text-title-h3 text-heat-150\">\n              {metrics.filter(m => m.status === 'pass').length}\n            </div>\n            <div className=\"text-label-small text-black-alpha-48\">Passing</div>\n          </div>\n          <div>\n            <div className=\"text-title-h3 text-heat-100\">\n              {metrics.filter(m => m.status === 'warning').length}\n            </div>\n            <div className=\"text-label-small text-black-alpha-48\">Warning</div>\n          </div>\n          <div>\n            <div className=\"text-title-h3 text-heat-50\">\n              {metrics.filter(m => m.status === 'fail').length}\n            </div>\n            <div className=\"text-label-small text-black-alpha-48\">Failing</div>\n          </div>\n        </div>\n      </motion.div>\n    </div>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/ai-readiness/RadarChart.tsx",
    "content": "\"use client\";\n\nimport { motion } from \"framer-motion\";\nimport { useEffect, useState } from \"react\";\n\ninterface RadarChartProps {\n  data: {\n    label: string;\n    score: number;\n    maxScore?: number;\n  }[];\n  size?: number;\n}\n\nexport default function RadarChart({ data, size = 300 }: RadarChartProps) {\n  const [isAnimated, setIsAnimated] = useState(false);\n  const center = size / 2;\n  const radius = (size / 2) - 60; // Increased padding for labels\n  const angleStep = (Math.PI * 2) / data.length;\n  \n  useEffect(() => {\n    setIsAnimated(true);\n  }, []);\n  \n  // Calculate points for the polygon\n  const getPoint = (value: number, index: number) => {\n    const angle = index * angleStep - Math.PI / 2;\n    const r = (value / 100) * radius;\n    return {\n      x: center + r * Math.cos(angle),\n      y: center + r * Math.sin(angle)\n    };\n  };\n  \n  // Create polygon points string\n  const polygonPoints = data\n    .map((item, i) => {\n      const point = getPoint(isAnimated ? item.score : 0, i);\n      return `${point.x},${point.y}`;\n    })\n    .join(' ');\n  \n  // Grid levels\n  const gridLevels = [20, 40, 60, 80, 100];\n  \n  return (\n    <div className=\"relative\">\n      <svg width={size} height={size} className=\"overflow-visible\">\n        <defs>\n          <linearGradient id=\"radar-gradient\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n            <stop offset=\"0%\" stopColor=\"#FF4A00\" stopOpacity=\"0.8\" />\n            <stop offset=\"100%\" stopColor=\"#FF8533\" stopOpacity=\"0.3\" />\n          </linearGradient>\n          <filter id=\"radar-glow\">\n            <feGaussianBlur stdDeviation=\"2\" result=\"coloredBlur\"/>\n            <feMerge>\n              <feMergeNode in=\"coloredBlur\"/>\n              <feMergeNode in=\"SourceGraphic\"/>\n            </feMerge>\n          </filter>\n        </defs>\n        \n        {/* Grid circles */}\n        {gridLevels.map((level) => (\n          <circle\n            key={level}\n            cx={center}\n            cy={center}\n            r={(level / 100) * radius}\n            fill=\"none\"\n            stroke=\"rgba(0,0,0,0.05)\"\n            strokeWidth=\"1\"\n          />\n        ))}\n        \n        {/* Axis lines */}\n        {data.map((_, i) => {\n          const angle = i * angleStep - Math.PI / 2;\n          const x2 = center + radius * Math.cos(angle);\n          const y2 = center + radius * Math.sin(angle);\n          return (\n            <line\n              key={i}\n              x1={center}\n              y1={center}\n              x2={x2}\n              y2={y2}\n              stroke=\"rgba(0,0,0,0.05)\"\n              strokeWidth=\"1\"\n            />\n          );\n        })}\n        \n        {/* Data polygon */}\n        <motion.polygon\n          points={polygonPoints}\n          fill=\"url(#radar-gradient)\"\n          stroke=\"#FF4A00\"\n          strokeWidth=\"2\"\n          initial={{ opacity: 0, scale: 0.8 }}\n          animate={{ opacity: 1, scale: 1 }}\n          transition={{ duration: 0.8, ease: \"easeOut\" }}\n          filter=\"url(#radar-glow)\"\n        />\n        \n        {/* Data points */}\n        {data.map((item, i) => {\n          const point = getPoint(item.score, i);\n          return (\n            <motion.circle\n              key={i}\n              cx={point.x}\n              cy={point.y}\n              r=\"4\"\n              fill=\"#FF4A00\"\n              stroke=\"white\"\n              strokeWidth=\"2\"\n              initial={{ scale: 0 }}\n              animate={{ scale: isAnimated ? 1 : 0 }}\n              transition={{ delay: 0.8 + i * 0.1, duration: 0.3 }}\n            />\n          );\n        })}\n        \n        {/* Labels */}\n        {data.map((item, i) => {\n          const angle = i * angleStep - Math.PI / 2;\n          const labelRadius = radius + 40; // Increased label distance\n          const x = center + labelRadius * Math.cos(angle);\n          const y = center + labelRadius * Math.sin(angle);\n          \n          // Better text anchor logic based on quadrant\n          let textAnchor = \"middle\";\n          let dy = 0;\n          \n          // Left side\n          if (x < center - 20) {\n            textAnchor = \"end\";\n          }\n          // Right side\n          else if (x > center + 20) {\n            textAnchor = \"start\";\n          }\n          \n          // Top\n          if (y < center - 20) {\n            dy = -5;\n          }\n          // Bottom\n          else if (y > center + 20) {\n            dy = 5;\n          }\n          \n          return (\n            <motion.g key={i}>\n              {/* Background for better readability */}\n              <motion.rect\n                x={x - (textAnchor === \"middle\" ? 30 : textAnchor === \"end\" ? 60 : 0)}\n                y={y - 10}\n                width={60}\n                height={20}\n                fill=\"white\"\n                fillOpacity={0.9}\n                rx={4}\n                initial={{ opacity: 0 }}\n                animate={{ opacity: 1 }}\n                transition={{ delay: 0.9 + i * 0.05 }}\n              />\n              <motion.text\n                x={x}\n                y={y + dy}\n                textAnchor={textAnchor as any}\n                dominantBaseline=\"middle\"\n                className=\"text-xs fill-black-alpha-80 font-medium\"\n                initial={{ opacity: 0 }}\n                animate={{ opacity: 1 }}\n                transition={{ delay: 1 + i * 0.05 }}\n                style={{ pointerEvents: 'none' }}\n              >\n                {item.label}\n              </motion.text>\n              {/* Score value */}\n              <motion.text\n                x={x}\n                y={y + dy + 12}\n                textAnchor={textAnchor as any}\n                dominantBaseline=\"middle\"\n                className=\"text-[10px] fill-heat-100 font-bold\"\n                initial={{ opacity: 0 }}\n                animate={{ opacity: 1 }}\n                transition={{ delay: 1.1 + i * 0.05 }}\n                style={{ pointerEvents: 'none' }}\n              >\n                {item.score}%\n              </motion.text>\n            </motion.g>\n          );\n        })}\n      </svg>\n      \n      {/* Legend */}\n      <div className=\"mt-16 flex justify-center\">\n        <div className=\"inline-flex flex-row gap-16 text-xs text-black-alpha-48 bg-white px-16 py-8 rounded-6 shadow-sm\">\n          <div className=\"flex items-center gap-8\">\n            <div className=\"w-12 h-12 rounded-full bg-heat-200\" />\n            <span className=\"whitespace-nowrap\">80-100%</span>\n          </div>\n          <div className=\"flex items-center gap-8\">\n            <div className=\"w-12 h-12 rounded-full bg-heat-100\" />\n            <span className=\"whitespace-nowrap\">60-79%</span>\n          </div>\n          <div className=\"flex items-center gap-8\">\n            <div className=\"w-12 h-12 rounded-full bg-heat-50\" />\n            <span className=\"whitespace-nowrap\">&lt;60%</span>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/ai-readiness/ScoreChart.tsx",
    "content": "\"use client\";\n\nimport { motion } from \"framer-motion\";\nimport { useEffect, useState } from \"react\";\n\ninterface ScoreChartProps {\n  score: number;\n  enhanced?: boolean;\n  size?: number;\n}\n\nexport default function ScoreChart({ score, enhanced = false, size = 200 }: ScoreChartProps) {\n  const [animatedScore, setAnimatedScore] = useState(0);\n  const radius = size / 2 - 20;\n  const circumference = 2 * Math.PI * radius;\n  \n  useEffect(() => {\n    const timer = setTimeout(() => {\n      setAnimatedScore(score);\n    }, 300);\n    return () => clearTimeout(timer);\n  }, [score]);\n\n  // Calculate stroke dash offset for the progress\n  const strokeDashoffset = circumference - (animatedScore / 100) * circumference;\n  \n  // Determine color based on score\n  const getColor = () => {\n    if (score >= 80) return \"#FF4A00\"; // heat-200 - Excellent\n    if (score >= 60) return \"#FF6500\"; // heat-150 - Good\n    if (score >= 40) return \"#FF8533\"; // heat-100 - Warning\n    return \"#FFA566\"; // heat-50 - Poor\n  };\n  \n  const getGradientId = enhanced ? \"enhanced-gradient\" : \"normal-gradient\";\n\n  return (\n    <div className=\"relative inline-flex items-center justify-center\">\n      <svg width={size} height={size} className=\"transform -rotate-90\">\n        <defs>\n          <linearGradient id={getGradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\">\n            <stop offset=\"0%\" stopColor={getColor()} stopOpacity=\"1\" />\n            <stop offset=\"100%\" stopColor={enhanced ? \"#FF8533\" : getColor()} stopOpacity=\"0.6\" />\n          </linearGradient>\n          <filter id=\"glow\">\n            <feGaussianBlur stdDeviation=\"3\" result=\"coloredBlur\"/>\n            <feMerge>\n              <feMergeNode in=\"coloredBlur\"/>\n              <feMergeNode in=\"SourceGraphic\"/>\n            </feMerge>\n          </filter>\n        </defs>\n        \n        {/* Background circle */}\n        <circle\n          cx={size / 2}\n          cy={size / 2}\n          r={radius}\n          fill=\"none\"\n          stroke=\"rgba(0,0,0,0.05)\"\n          strokeWidth=\"12\"\n        />\n        \n        {/* Progress circle */}\n        <motion.circle\n          cx={size / 2}\n          cy={size / 2}\n          r={radius}\n          fill=\"none\"\n          stroke={`url(#${getGradientId})`}\n          strokeWidth=\"12\"\n          strokeLinecap=\"round\"\n          strokeDasharray={circumference}\n          initial={{ strokeDashoffset: circumference }}\n          animate={{ strokeDashoffset }}\n          transition={{ duration: 1.5, ease: \"easeOut\" }}\n          filter=\"url(#glow)\"\n        />\n      </svg>\n      \n      {/* Center content */}\n      <div className=\"absolute inset-0 flex flex-col items-center justify-center\">\n        <motion.div\n          className=\"text-4xl font-bold text-heat-150\"\n          initial={{ opacity: 0, scale: 0.5 }}\n          animate={{ opacity: 1, scale: 1 }}\n          transition={{ delay: 0.5, duration: 0.5 }}\n        >\n          {animatedScore}%\n        </motion.div>\n        {enhanced && (\n          <motion.div\n            className=\"text-xs text-heat-100 mt-1\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            transition={{ delay: 0.8 }}\n          >\n            AI Enhanced\n          </motion.div>\n        )}\n      </div>\n    </div>\n  );\n}"
  },
  {
    "path": "components/app/(home)/sections/endpoints/EndpointsCrawl/EndpointsCrawl.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport initCanvas from \"@/utils/init-canvas\";\n\nexport default function EndpointsCrawl({\n  active,\n  alwaysHeat = false,\n  triggerOnHover = false,\n  size = 20,\n}: {\n  active?: boolean;\n  alwaysHeat?: boolean;\n  triggerOnHover?: boolean;\n  size?: number;\n}) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  const fnRefs = useRef<{\n    activate: () => void;\n    deactivate: () => void;\n  }>({ activate: () => {}, deactivate: () => {} });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let activeGroup = 0;\n    const rowAlphas = [0.2, 0.4, 1, 0.04];\n\n    const grid = [\n      [24],\n      [16, 18, 30, 32],\n      [8, 12, 36, 40],\n      [0, 3, 6, 21, 27, 42, 45, 48],\n    ];\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#FF4C00\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      for (const group of grid.slice(0, 4)) {\n        const groupIndex = grid.indexOf(group);\n        ctx.globalAlpha = rowAlphas[groupIndex];\n\n        for (const index of group) {\n          ctx.fillRect(\n            (3 + (index % 7) * 2) * scaler,\n            (3 + Math.floor(index / 7) * 2) * scaler,\n            2 * scaler,\n            2 * scaler,\n          );\n        }\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const cycle = () => {\n      isRunning = true;\n      activeGroup = (activeGroup + 1) % 5;\n\n      rowAlphas.forEach((alpha, index) => {\n        let targetAlpha = alpha;\n\n        if (index === activeGroup) targetAlpha = 1;\n        else if (index === (activeGroup + 1) % 4) targetAlpha = 0.12;\n        else if (index === (activeGroup + 2) % 4) targetAlpha = 0.2;\n        else if (index === (activeGroup + 3) % 4) targetAlpha = 0.4;\n\n        animate(alpha, targetAlpha, {\n          duration: 0.05,\n          onUpdate: (value) => {\n            rowAlphas[index] = value;\n          },\n        });\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(() => {\n          isRunning = false;\n        }, 300),\n      );\n\n      if (activeGroup === 3) runCount += 1;\n\n      if ((runCount === 2 || !isActive) && activeGroup === 2) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, 50),\n      );\n    };\n\n    fnRefs.current = {\n      activate: () => {\n        if (isActive) return;\n\n        isActive = true;\n\n        runCount = 0;\n\n        cycle();\n        render();\n      },\n      deactivate: () => {\n        if (!isActive) return;\n\n        isActive = false;\n      },\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    if (triggerOnHover) {\n      const group = canvasRef.current!.closest(\".group\");\n\n      if (group) {\n        group.addEventListener(\"mouseenter\", fnRefs.current.activate);\n        group.addEventListener(\"mouseleave\", fnRefs.current.deactivate);\n\n        return () => {\n          group.removeEventListener(\"mouseenter\", fnRefs.current.activate);\n          group.removeEventListener(\"mouseleave\", fnRefs.current.deactivate);\n        };\n      }\n    }\n  }, [triggerOnHover, size]);\n\n  useEffect(() => {\n    if (triggerOnHover) return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && active) {\n          fnRefs.current.activate();\n        } else {\n          fnRefs.current.deactivate();\n        }\n      },\n      { threshold: 0.5 },\n    );\n\n    observer.observe(canvasRef.current!);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [active, triggerOnHover]);\n\n  return (\n    <canvas\n      className={cn(\n        alwaysHeat\n          ? \"\"\n          : [\n              \"[&.grayscale]:opacity-60 transition-[filter,opacity]\",\n              !active && \"grayscale\",\n            ],\n      )}\n      ref={canvasRef}\n      style={{ width: size, height: size }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/EndpointsExtract/EndpointsExtract.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport initCanvas from \"@/utils/init-canvas\";\n\nexport default function EndpointsExtract({\n  active,\n  disabledCells,\n  alwaysHeat = false,\n  triggerOnHover = false,\n  size = 20,\n}: {\n  active?: boolean;\n  disabledCells?: number[];\n  alwaysHeat?: boolean;\n  triggerOnHover?: boolean;\n  size?: number;\n}) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  const fnRefs = useRef<{\n    activate: () => void;\n    deactivate: () => void;\n  }>({ activate: () => {}, deactivate: () => {} });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let activeCol = 0;\n    const colAlphas = [1, 0.4, 0.2, 0.12];\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#FF4C00\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      // Draw Extract pattern - represents structured data extraction\n      // Draw columns to represent data fields\n      for (let col = 0; col < 4; col++) {\n        ctx.globalAlpha = colAlphas[col];\n\n        // Draw vertical bars of different heights to represent extracted data\n        const heights = [3, 2, 3, 1];\n        const startY = [1, 2, 1, 3];\n\n        for (let row = 0; row < heights[col]; row++) {\n          ctx.fillRect(\n            (3 + col * 4) * scaler,\n            (3 + startY[col] * 2 + row * 4) * scaler,\n            2 * scaler,\n            2 * scaler,\n          );\n        }\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const cycle = () => {\n      isRunning = true;\n      activeCol = (activeCol + 1) % 4;\n\n      colAlphas.forEach((alpha, index) => {\n        let targetAlpha = alpha;\n\n        if (index === activeCol) targetAlpha = 1;\n        else if (index === (activeCol + 1) % 4) targetAlpha = 0.12;\n        else if (index === (activeCol + 2) % 4) targetAlpha = 0.2;\n        else if (index === (activeCol + 3) % 4) targetAlpha = 0.4;\n\n        animate(alpha, targetAlpha, {\n          duration: 0.05,\n          onUpdate: (value) => {\n            colAlphas[index] = value;\n          },\n        });\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(() => {\n          isRunning = false;\n        }, 400),\n      );\n\n      if (activeCol === 3) runCount += 1;\n\n      if ((runCount === 2 || !isActive) && activeCol === 0) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, 50),\n      );\n    };\n\n    fnRefs.current = {\n      activate: () => {\n        if (isActive) return;\n\n        isActive = true;\n\n        runCount = 0;\n        cycle();\n        render();\n      },\n      deactivate: () => {\n        if (!isActive) return;\n\n        isActive = false;\n      },\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    if (triggerOnHover) {\n      const group = canvasRef.current!.closest(\".group\");\n\n      if (group) {\n        group.addEventListener(\"mouseenter\", fnRefs.current.activate);\n        group.addEventListener(\"mouseleave\", fnRefs.current.deactivate);\n\n        return () => {\n          group.removeEventListener(\"mouseenter\", fnRefs.current.activate);\n          group.removeEventListener(\"mouseleave\", fnRefs.current.deactivate);\n        };\n      }\n    }\n  }, [disabledCells, size, triggerOnHover]);\n\n  useEffect(() => {\n    if (triggerOnHover) return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && active) {\n          fnRefs.current.activate();\n        } else {\n          fnRefs.current.deactivate();\n        }\n      },\n      { threshold: 0.5 },\n    );\n\n    observer.observe(canvasRef.current!);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [active, triggerOnHover]);\n\n  return (\n    <canvas\n      className={cn(\n        alwaysHeat\n          ? \"\"\n          : [\n              \"[&.grayscale]:opacity-60 transition-[filter,opacity]\",\n              !active && \"grayscale\",\n            ],\n      )}\n      ref={canvasRef}\n      style={{ width: size, height: size }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/EndpointsMap/EndpointsMap.tsx",
    "content": "\"use client\";\n\nimport { ComponentProps } from \"react\";\n\nimport EndpointsScrape from \"@/components/app/(home)/sections/endpoints/EndpointsScrape/EndpointsScrape\";\n\nexport default function EndpointsMap(\n  props: ComponentProps<typeof EndpointsScrape>,\n) {\n  return <EndpointsScrape {...props} disabledCells={[1, 2, 3, 7, 9, 12, 15]} />;\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/EndpointsScrape/EndpointsScrape.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport initCanvas from \"@/utils/init-canvas\";\n\nexport default function EndpointsScrape({\n  active,\n  disabledCells,\n  alwaysHeat = false,\n  triggerOnHover = false,\n  size = 20,\n}: {\n  active?: boolean;\n  disabledCells?: number[];\n  alwaysHeat?: boolean;\n  triggerOnHover?: boolean;\n  size?: number;\n}) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  const fnRefs = useRef<{\n    activate: () => void;\n    deactivate: () => void;\n  }>({ activate: () => {}, deactivate: () => {} });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let activeRow = 2;\n    const rowAlphas = [0.2, 0.4, 1, 0.12];\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#FF4C00\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      for (let i = 0; i < 16; i++) {\n        if (disabledCells && disabledCells.includes(i)) continue;\n\n        ctx.globalAlpha = rowAlphas[Math.floor(i / 4)];\n\n        ctx.fillRect(\n          (3 + (i % 4) * 4) * scaler,\n          (3 + Math.floor(i / 4) * 4) * scaler,\n          2 * scaler,\n          2 * scaler,\n        );\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const cycle = () => {\n      isRunning = true;\n      activeRow = (activeRow + 1) % 5;\n\n      rowAlphas.forEach((alpha, index) => {\n        let targetAlpha = alpha;\n\n        if (index === activeRow) targetAlpha = 1;\n        else if (index === (activeRow + 1) % 4) targetAlpha = 0.12;\n        else if (index === (activeRow + 2) % 4) targetAlpha = 0.2;\n        else if (index === (activeRow + 3) % 4) targetAlpha = 0.4;\n\n        animate(alpha, targetAlpha, {\n          duration: 0.05,\n          onUpdate: (value) => {\n            rowAlphas[index] = value;\n          },\n        });\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(() => {\n          isRunning = false;\n        }, 400),\n      );\n\n      if (activeRow === 3) runCount += 1;\n\n      if ((runCount === 2 || !isActive) && activeRow === 2) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, 50),\n      );\n    };\n\n    fnRefs.current = {\n      activate: () => {\n        if (isActive) return;\n\n        isActive = true;\n\n        runCount = 0;\n        cycle();\n        render();\n      },\n      deactivate: () => {\n        if (!isActive) return;\n\n        isActive = false;\n      },\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    if (triggerOnHover) {\n      const group = canvasRef.current!.closest(\".group\");\n\n      if (group) {\n        group.addEventListener(\"mouseenter\", fnRefs.current.activate);\n        group.addEventListener(\"mouseleave\", fnRefs.current.deactivate);\n\n        return () => {\n          group.removeEventListener(\"mouseenter\", fnRefs.current.activate);\n          group.removeEventListener(\"mouseleave\", fnRefs.current.deactivate);\n        };\n      }\n    }\n  }, [disabledCells, size, triggerOnHover]);\n\n  useEffect(() => {\n    if (triggerOnHover) return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && active) {\n          fnRefs.current.activate();\n        } else {\n          fnRefs.current.deactivate();\n        }\n      },\n      { threshold: 0.5 },\n    );\n\n    observer.observe(canvasRef.current!);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [active, triggerOnHover]);\n\n  return (\n    <canvas\n      className={cn(\n        alwaysHeat\n          ? \"\"\n          : [\n              \"[&.grayscale]:opacity-60 transition-[filter,opacity]\",\n              !active && \"grayscale\",\n            ],\n      )}\n      ref={canvasRef}\n      style={{ width: size, height: size }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/EndpointsSearch/EndpointsSearch.tsx",
    "content": "\"use client\";\n\nimport initCanvas from \"@/utils/init-canvas\";\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nexport default function EndpointsSearch({\n  alwaysHeat,\n  size = 20,\n}: {\n  alwaysHeat?: boolean;\n  size?: number;\n}) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let diff = 0;\n    const defaultRowAlphas = [\n      0, 0.2, 0.4, 0, 0.4, 1, 0.4, 0.2, 0.2, 0.4, 1, 0.4, 0, 0.4, 0.2, 0,\n    ];\n\n    const differs = Array.from({ length: 16 }, () => 0.2 + Math.random() * 0.2);\n\n    differs[5] = 0.6;\n    differs[6] = 0.6;\n    differs[9] = 0.6;\n    differs[10] = 0.6;\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#FF4C00\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      for (let i = 0; i < 16; i++) {\n        if ([0, 3, 12, 15].includes(i)) continue;\n\n        const maxAlpha = [5, 6, 9, 10].includes(i) ? 1 : 0.4;\n\n        const alpha = defaultRowAlphas[i] + diff * differs[i];\n        ctx.globalAlpha = Math.min(\n          Math.min(alpha, maxAlpha) - Math.max(alpha - maxAlpha, 0),\n          1,\n        );\n\n        ctx.fillRect(\n          (3 + (i % 4) * 4) * scaler,\n          (3 + Math.floor(i / 4) * 4) * scaler,\n          2 * scaler,\n          2 * scaler,\n        );\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const duration = 300;\n\n    const cycle = () => {\n      isRunning = true;\n\n      animate(diff, 1, {\n        duration: duration / 1000,\n        onUpdate: (value) => {\n          diff = value < 0.5 ? value * 2 : 1 - (value - 0.5) * 2;\n        },\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(\n          () => {\n            isRunning = false;\n          },\n          Math.max(duration, 300),\n        ),\n      );\n\n      runCount += 1;\n\n      if (runCount === 3 || !isActive) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, duration),\n      );\n    };\n\n    const activate = () => {\n      if (isActive) return;\n\n      isActive = true;\n\n      runCount = 0;\n      cycle();\n      render();\n    };\n\n    const deactivate = () => {\n      if (!isActive) return;\n\n      isActive = false;\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    const group = canvasRef.current!.closest(\".group\");\n\n    if (group) {\n      group.addEventListener(\"mouseenter\", activate);\n      group.addEventListener(\"mouseleave\", deactivate);\n\n      return () => {\n        group.removeEventListener(\"mouseenter\", activate);\n        group.removeEventListener(\"mouseleave\", deactivate);\n      };\n    }\n  }, [size]);\n\n  return <canvas ref={canvasRef} style={{ width: size, height: size }} />;\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/Extract/Extract.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nimport initCanvas from \"@/utils/init-canvas\";\n\nexport default function EndpointsExtract({ size = 20 }: { size?: number }) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let diff = 0;\n    const defaultRowAlphas = [\n      0.4, 0.04, 0.2, 0.4, 0.2, 0, 0, 0.04, 0.04, 0, 0, 0.2, 0.4, 0.2, 0.04,\n      0.4,\n    ];\n\n    const differs = Array.from({ length: 16 }, () => 0.2 + Math.random() * 0.2);\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#FF4C00\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      for (let i = 0; i < 16; i++) {\n        if ([5, 6, 9, 10].includes(i)) continue;\n\n        ctx.globalAlpha = defaultRowAlphas[i] + diff * differs[i];\n        ctx.globalAlpha =\n          Math.min(ctx.globalAlpha, 0.4) - Math.max(ctx.globalAlpha - 0.4, 0);\n\n        ctx.fillRect(\n          (3 + (i % 4) * 4) * scaler,\n          (3 + Math.floor(i / 4) * 4) * scaler,\n          2 * scaler,\n          2 * scaler,\n        );\n      }\n\n      ctx.globalAlpha = 1;\n      ctx.fillRect(7, 7, 6, 2);\n      ctx.globalAlpha = 0.4;\n      ctx.fillRect(7, 11, 2 + diff * 4, 2);\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const duration = 300;\n\n    const cycle = () => {\n      isRunning = true;\n\n      animate(diff, 1, {\n        duration: duration / 1000,\n        onUpdate: (value) => {\n          diff = value < 0.5 ? value * 2 : 1 - (value - 0.5) * 2;\n        },\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(\n          () => {\n            isRunning = false;\n          },\n          Math.max(duration, 300),\n        ),\n      );\n\n      runCount += 1;\n\n      if (runCount === 3 || !isActive) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, duration),\n      );\n    };\n\n    const activate = () => {\n      if (isActive) return;\n\n      isActive = true;\n\n      runCount = 0;\n      cycle();\n      render();\n    };\n\n    const deactivate = () => {\n      if (!isActive) return;\n\n      isActive = false;\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    const group = canvasRef.current!.closest(\".group\");\n\n    if (group) {\n      group.addEventListener(\"mouseenter\", activate);\n      group.addEventListener(\"mouseleave\", deactivate);\n\n      return () => {\n        group.removeEventListener(\"mouseenter\", activate);\n        group.removeEventListener(\"mouseleave\", deactivate);\n      };\n    }\n  }, [size]);\n\n  return <canvas ref={canvasRef} style={{ width: size, height: size }} />;\n}\n"
  },
  {
    "path": "components/app/(home)/sections/endpoints/Mcp/Mcp.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport initCanvas from \"@/utils/init-canvas\";\n\nexport default function EndpointsMcp({\n  active,\n  alwaysHeat = false,\n  triggerOnHover = false,\n  size = 20,\n}: {\n  active?: boolean;\n  alwaysHeat?: boolean;\n  triggerOnHover?: boolean;\n  size?: number;\n}) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  const fnRefs = useRef<{\n    activate: () => void;\n    deactivate: () => void;\n  }>({ activate: () => {}, deactivate: () => {} });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n\n    let isRunning = false;\n    let isActive = false;\n\n    let activeIndex = 5;\n    const rowAlphas = [0.12, 0.2, 0.4, 0.4, 1, 1, 1, 0.4, 0.2];\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n      ctx.fillStyle = \"#FF4C00\";\n\n      for (let i = 0; i < 9; i++) {\n        ctx.globalAlpha = rowAlphas[i];\n\n        ctx.fillRect(\n          (5 + (i % 3) * 4) * scaler,\n          (5 + Math.floor(i / 3) * 4) * scaler,\n          2 * scaler,\n          2 * scaler,\n        );\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n\n    let runCount = 0;\n\n    const cycle = () => {\n      isRunning = true;\n      activeIndex = (activeIndex + 1) % 9;\n\n      rowAlphas.forEach((alpha, index) => {\n        let targetAlpha = alpha;\n\n        if (index === activeIndex) targetAlpha = 1;\n        else if (index === (activeIndex - 1 + 9) % 9) targetAlpha = 1;\n        else if (index === (activeIndex - 2 + 9) % 9) targetAlpha = 1;\n        else if (index === (activeIndex - 3 + 9) % 9) targetAlpha = 0.4;\n        else if (index === (activeIndex - 4 + 9) % 9) targetAlpha = 0.2;\n        else if (index === (activeIndex - 5 + 9) % 9) targetAlpha = 0.2;\n        else if (index === (activeIndex - 6 + 9) % 9) targetAlpha = 0.12;\n        else if (index === (activeIndex - 7 + 9) % 9) targetAlpha = 0.12;\n        else if (index === (activeIndex - 8 + 9) % 9) targetAlpha = 0.4;\n\n        animate(alpha, targetAlpha, {\n          duration: 30 / 1000,\n          onUpdate: (value) => {\n            rowAlphas[index] = value;\n          },\n        });\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(() => {\n          isRunning = false;\n        }, 300),\n      );\n\n      if (activeIndex === 7) runCount += 1;\n\n      if ((runCount === 2 || !isActive) && activeIndex === 6) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, 30),\n      );\n    };\n\n    fnRefs.current = {\n      activate: () => {\n        if (isActive) return;\n\n        isActive = true;\n\n        runCount = 0;\n\n        cycle();\n        render();\n      },\n      deactivate: () => {\n        if (!isActive) return;\n\n        isActive = false;\n      },\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    if (triggerOnHover) {\n      const group = canvasRef.current!.closest(\".group\");\n\n      if (group) {\n        group.addEventListener(\"mouseenter\", fnRefs.current.activate);\n        group.addEventListener(\"mouseleave\", fnRefs.current.deactivate);\n\n        return () => {\n          group.removeEventListener(\"mouseenter\", fnRefs.current.activate);\n          group.removeEventListener(\"mouseleave\", fnRefs.current.deactivate);\n        };\n      }\n    }\n  }, [size, triggerOnHover]);\n\n  useEffect(() => {\n    if (triggerOnHover) return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && active) {\n          fnRefs.current.activate();\n        } else {\n          fnRefs.current.deactivate();\n        }\n      },\n      { threshold: 0.5 },\n    );\n\n    observer.observe(canvasRef.current!);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [active, triggerOnHover]);\n\n  return (\n    <canvas\n      className={cn(\n        alwaysHeat\n          ? \"\"\n          : [\n              \"[&.grayscale]:opacity-60 transition-[filter,opacity]\",\n              !active && \"grayscale\",\n            ],\n      )}\n      ref={canvasRef}\n      style={{ width: size, height: size }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Background/Background.tsx",
    "content": "\"use client\";\n\nimport { Fragment } from \"react\";\n\nimport CurvyRect from \"@/components/shared/layout/curvy-rect\";\n\nimport CenterStar from \"./_svg/CenterStar\";\n\nexport default function HomeHeroBackground() {\n  return (\n    <div className=\"overlay contain-layout pointer-events-none lg-max:hidden\">\n      <div className=\"top-100 h-[calc(100%-99px)] border-border-faint border-y w-full left-0 absolute\" />\n\n      <div className=\"cw-[1314px] z-[105] absolute top-0 border-x border-border-faint h-full\">\n        <div className=\"text-mono-x-small font-mono text-black-alpha-12 select-none\">\n          <div className=\"absolute top-111 -left-1 w-102 text-center\">\n            {\" \"}\n            [ 200 OK ]{\" \"}\n          </div>\n          <div className=\"absolute bottom-10 -left-1 w-102 text-center\">\n            {\" \"}\n            [ .JSON ]{\" \"}\n          </div>\n\n          <div className=\"absolute top-111 -right-1 w-102 text-center\">\n            {\" \"}\n            [ SCRAPE ]{\" \"}\n          </div>\n          <div className=\"absolute bottom-10 -right-1 w-102 text-center\">\n            {\" \"}\n            [ .MD ]{\" \"}\n          </div>\n        </div>\n\n        <div className=\"top-302 h-1 left-0 bg-border-faint w-303 absolute\" />\n        <div className=\"top-403 h-1 left-0 bg-border-faint w-303 absolute\" />\n        <div className=\"top-504 h-1 left-100 bg-border-faint w-203 absolute\" />\n\n        <div className=\"top-302 h-1 right-0 bg-border-faint w-303 absolute\" />\n        <div className=\"top-403 h-1 right-0 bg-border-faint w-303 absolute\" />\n        <div className=\"top-504 h-1 right-100 bg-border-faint w-203 absolute\" />\n\n        {Array.from({ length: 2 }, (_, i) => (\n          <Fragment key={i}>\n            <CurvyRect\n              bottomLeft={i === 1}\n              bottomRight={i === 0}\n              className=\"w-101  h-[calc(100%-99px)] top-100 absolute\"\n              style={{ [i === 0 ? \"left\" : \"right\"]: -101 }}\n            />\n\n            <CurvyRect\n              className=\"w-102 h-203 top-100 absolute\"\n              style={{ [i === 0 ? \"left\" : \"right\"]: -1 }}\n              allSides\n            />\n            <CurvyRect\n              className=\"size-102 top-302 absolute\"\n              style={{ [i === 0 ? \"left\" : \"right\"]: -1 }}\n              allSides\n            />\n            <CurvyRect\n              className=\"w-102 h-203 top-403 absolute\"\n              style={{ [i === 0 ? \"left\" : \"right\"]: -1 }}\n              allSides\n            />\n          </Fragment>\n        ))}\n      </div>\n\n      <div className=\"cw-[910px] absolute top-100 border-x border-border-faint h-[calc(100%-99px)]\" />\n      <div className=\"cw-[708px] absolute top-100 border-x border-border-faint h-[calc(100%-99px)]\">\n        <CenterStar className=\"absolute top-77 -right-24 z-[1]\" />\n        <CenterStar className=\"absolute top-77 -left-24 z-[1]\" />\n      </div>\n\n      <CurvyRect\n        className=\"cw-[708px] absolute top-100 h-[calc(100%-99px)]\"\n        bottom\n      />\n\n      <div className=\"cw-[506px] absolute top-100 border-x border-border-faint h-102\" />\n      <div className=\"cw-[304px] absolute top-100 border-x border-border-faint h-102\" />\n      <div className=\"cw-[102px] absolute top-100 border-x border-border-faint h-102\" />\n\n      <div className=\"top-201 h-1 bg-border-faint cw-[1112px] absolute\" />\n\n      <div className=\"cw-[1112px] absolute top-0 h-full\">\n        <CurvyRect className=\"w-full absolute top-full h-100 left-0\" top />\n        <CurvyRect\n          className=\"w-100 absolute top-full h-100 -left-99\"\n          topRight\n        />\n        <CurvyRect\n          className=\"w-100 absolute top-full h-100 -right-99\"\n          topLeft\n        />\n\n        {Array.from({ length: 5 }, (_, i) => (\n          <Fragment key={i}>\n            <CurvyRect\n              className=\"size-102 absolute left-0\"\n              style={{\n                top: 100 + i * 101,\n              }}\n              allSides\n            />\n\n            <CurvyRect\n              className=\"size-102 absolute right-0\"\n              style={{\n                top: 100 + i * 101,\n              }}\n              allSides\n            />\n          </Fragment>\n        ))}\n\n        <CurvyRect\n          className=\"size-102 absolute left-101 top-100\"\n          bottomLeft\n          top\n        />\n        <CurvyRect\n          className=\"size-102 absolute left-101 top-201\"\n          bottom\n          topLeft\n        />\n\n        <CurvyRect\n          className=\"size-102 absolute right-101 top-100\"\n          bottomRight\n          top\n        />\n        <CurvyRect\n          className=\"size-102 absolute right-101 top-201\"\n          bottom\n          topRight\n        />\n\n        {Array.from({ length: 3 }, (_, i) => (\n          <Fragment key={i}>\n            <CurvyRect\n              className=\"size-102 absolute left-101\"\n              style={{\n                top: 302 + i * 101,\n              }}\n              allSides\n            />\n\n            <CurvyRect\n              className=\"size-102 absolute right-101\"\n              style={{\n                top: 302 + i * 101,\n              }}\n              allSides\n            />\n          </Fragment>\n        ))}\n\n        <CurvyRect\n          className=\"size-102 absolute top-100 left-202\"\n          bottomRight\n          top\n        />\n\n        {Array.from({ length: 5 }, (_, i) => (\n          <CurvyRect\n            className=\"size-102 absolute top-100\"\n            key={i}\n            style={{ left: 303 + i * 101 }}\n            allSides\n          />\n        ))}\n\n        <CurvyRect\n          className=\"size-102 absolute top-100 right-202\"\n          bottomLeft\n          top\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Background/BackgroundOuterPiece.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport {\n  useHeaderContext,\n  useHeaderHeight,\n} from \"@/components/shared/header/HeaderContext\";\nimport { cn } from \"@/utils/cn\";\n\nexport const BackgroundOuterPiece = () => {\n  const [noRender, setNoRender] = useState(false);\n  const { dropdownContent } = useHeaderContext();\n  const { headerHeight } = useHeaderHeight();\n\n  useEffect(() => {\n    const heroContent = document.getElementById(\"hero-content\");\n    if (!heroContent) {\n      // If hero-content doesn't exist, don't render the background piece\n      setNoRender(true);\n      return;\n    }\n    \n    const heroContentHeight = heroContent.clientHeight;\n\n    const onScroll = () => {\n      setNoRender(window.scrollY > heroContentHeight - 120);\n    };\n\n    onScroll();\n\n    window.addEventListener(\"scroll\", onScroll);\n\n    return () => {\n      window.removeEventListener(\"scroll\", onScroll);\n    };\n  }, []);\n\n  return (\n    <div\n      className={cn(\n        \"cw-[1335px] transition-all z-[105] absolute top-0 flex justify-between h-[calc(100%+21px)] duration-[200ms] pointer-events-none\",\n        { \"opacity-0\": noRender || dropdownContent || !headerHeight },\n      )}\n      style={{\n        paddingTop: headerHeight - 10,\n      }}\n    >\n      <div className=\"h-[3000px] w-[calc(100%-21px)] left-[10.5px] absolute bottom-21 border-x border-border-faint\" />\n\n      <Connector className=\"sticky\" style={{ top: headerHeight - 10 }} />\n      <Connector className=\"sticky\" style={{ top: headerHeight - 10 }} />\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Background/_svg/CenterStar.tsx",
    "content": "export default function CenterStar({\n  ...props\n}: React.SVGProps<SVGSVGElement>) {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"47\"\n      viewBox=\"0 0 47 47\"\n      width=\"47\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n    >\n      <path\n        d=\"M24 18C24 21.3137 26.6863 24 30 24H34V25H30C26.6863 25 24 27.6863 24 31V35H23V31C23 27.6863 20.3137 25 17 25H13V24H17C20.3137 24 23 21.3137 23 18V14H24V18Z\"\n        fill=\"var(--heat-100)\"\n        fillOpacity=\"1\"\n      />\n      <circle cx=\"23.5\" cy=\"23.5\" r=\"23\" stroke=\"#EDEDED\" strokeOpacity=\"1\" />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Badge/Badge.tsx",
    "content": "import Link from \"next/link\";\n\nexport default function HomeHeroBadge() {\n  return (\n    <Link\n      className=\"p-4 rounded-full flex w-max mx-auto mb-12 lg:mb-16 items-center relative inside-border before:border-border-faint group\"\n      href=\"#\"\n      onClick={(e) => e.preventDefault()}\n    >\n      <div className=\"px-8 text-label-x-small\">Website Builder</div>\n\n      <div className=\"p-1\">\n        <div className=\"size-18 bg-accent-black flex-center rounded-full group-hover:bg-heat-100 transition-all group-hover:w-30\">\n          <svg\n            fill=\"none\"\n            height=\"8\"\n            viewBox=\"0 0 10 8\"\n            width=\"10\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path\n              className=\"transition-all -translate-x-2 group-hover:translate-x-0\"\n              d=\"M6 1L9 4L6 7\"\n              stroke=\"white\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth=\"1.25\"\n            />\n\n            <path\n              className=\"transition-all -translate-x-3 group-hover:translate-x-0 scale-x-[0] group-hover:scale-x-[1] origin-right\"\n              d=\"M1 4L9 4\"\n              stroke=\"white\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth=\"1.25\"\n            />\n          </svg>\n        </div>\n      </div>\n    </Link>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Hero.tsx",
    "content": "import Link from \"next/link\";\n\nimport { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport HeroFlame from \"@/components/shared/effects/flame/hero-flame\";\n\nimport HomeHeroBackground from \"./Background/Background\";\nimport { BackgroundOuterPiece } from \"./Background/BackgroundOuterPiece\";\nimport HomeHeroBadge from \"./Badge/Badge\";\nimport HomeHeroPixi from \"./Pixi/Pixi\";\nimport HomeHeroTitle from \"./Title/Title\";\nimport HeroInput from \"../hero-input/HeroInput\";\nimport HeroScraping from \"../hero-scraping/HeroScraping\";\n\nexport default function HomeHero() {\n  return (\n    <section className=\"overflow-x-clip\" id=\"home-hero\">\n      <div\n        className=\"pt-28 lg:pt-254 lg:-mt-100 pb-115 relative\"\n        id=\"hero-content\"\n      >\n        <HomeHeroPixi />\n        <HeroFlame />\n\n        <BackgroundOuterPiece />\n\n        <HomeHeroBackground />\n\n        <div className=\"relative container px-16\">\n          <HomeHeroBadge />\n          <HomeHeroTitle />\n\n          <p className=\"text-center text-body-large\">\n            Power your AI apps with clean data crawled\n            <br className=\"lg-max:hidden\" />\n            from any website.\n            <Link\n              className=\"bg-black-alpha-4 hover:bg-black-alpha-6 lg:ml-4 rounded-6 px-8 lg:px-6 text-label-large lg-max:py-2 h-30 lg:h-24 block lg-max:mt-8 lg-max:mx-auto lg-max:w-max lg:inline-block gap-4 transition-all\"\n              href=\"https://github.com/firecrawl/firecrawl\"\n              target=\"_blank\"\n            >\n              It&apos;s also open source.\n            </Link>\n          </p>\n        </div>\n      </div>\n\n      <div className=\"container lg:contents !p-16 relative -mt-90\">\n        <div className=\"absolute top-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint lg:hidden\" />\n        <div className=\"absolute bottom-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint lg:hidden\" />\n\n        <Connector className=\"-top-10 -left-[10.5px] lg:hidden\" />\n        <Connector className=\"-top-10 -right-[10.5px] lg:hidden\" />\n        <Connector className=\"-bottom-10 -left-[10.5px] lg:hidden\" />\n        <Connector className=\"-bottom-10 -right-[10.5px] lg:hidden\" />\n\n        <HeroInput />\n      </div>\n\n      <HeroScraping />\n    </section>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/Pixi.tsx",
    "content": "\"use client\";\n\nimport { Suspense, lazy, useState, useEffect } from \"react\";\n\nconst Pixi = lazy(() => import(\"@/components/shared/pixi/Pixi\"));\nimport features from \"./tickers/features\";\n\nfunction PixiContent() {\n  return (\n    <Pixi\n      canvasAttrs={{\n        className: \"cw-[1314px] h-506 absolute top-100 lg-max:hidden\",\n      }}\n      fps={Infinity}\n      initOptions={{ backgroundAlpha: 0 }}\n      smartStop={false}\n      tickers={[features]}\n    />\n  );\n}\n\nexport default function HomeHeroPixi() {\n  const [hasError, setHasError] = useState(false);\n  \n  useEffect(() => {\n    const handleError = (e: ErrorEvent) => {\n      if (e.message.includes('pixi') || e.message.includes('ChunkLoadError')) {\n        setHasError(true);\n      }\n    };\n    \n    window.addEventListener('error', handleError);\n    return () => window.removeEventListener('error', handleError);\n  }, []);\n  \n  if (hasError) {\n    // Return empty div as fallback if Pixi fails to load\n    return <div className=\"cw-[1314px] h-506 absolute top-100 lg-max:hidden\" />;\n  }\n  \n  return (\n    <Suspense fallback={<div className=\"cw-[1314px] h-506 absolute top-100 lg-max:hidden\" />}>\n      <PixiContent />\n    </Suspense>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/ascii.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport PixiAssetManager from \"@/components/shared/pixi/PixiAssetManager\";\nimport { RenderTexture, Sprite, Text } from \"pixi.js\";\n\n// Add more contrast to the ASCII_CHARS and ensure 'X' is used\n// const ASCII_CHARS = [' ', '.', ':', '-', '=', '+', 'X'];\nconst ASCII_CHARS = ' .\":,-_^=+';\n\nfunction getAsciiChar(luminance: number) {\n  if (luminance < 50) return \" \";\n\n  const norm = Math.max(0, Math.min(1, (luminance - 16) / (250 - 16)));\n  const skewed = Math.pow(norm, 1.5);\n\n  const minIdx = 1;\n  const maxIdx = ASCII_CHARS.length - 1;\n  const idx = minIdx + Math.floor(skewed * (maxIdx - minIdx + 1));\n  const safeIdx = Math.max(minIdx, Math.min(maxIdx, idx));\n\n  return ASCII_CHARS[safeIdx];\n}\n\n// Sprinkle logic is now a no-op, as getAsciiChar handles the randomness\nfunction sprinkleAscii(line: string) {\n  return line;\n}\n\nconst tickAscii: Ticker = async ({ app, canvas }) => {\n  const textures = await Promise.all(\n    Array.from({ length: 150 }, async (_, i) => {\n      const texture = await PixiAssetManager.load(\n        `/Arşiv/FAQ Demo/FAQ_${i.toString().padStart(5, \"0\")}.png`,\n      );\n\n      return texture!;\n    }),\n  );\n\n  const width = canvas.clientWidth;\n  const height = canvas.clientHeight;\n\n  const sprites = textures.map((texture) => new Sprite(texture));\n\n  sprites.forEach((sprite) => {\n    sprite.width = width;\n    sprite.height = height;\n    sprite.x = 0;\n    sprite.y = 0;\n\n    app.stage.addChild(sprite);\n    sprite.alpha = 0;\n  });\n\n  // Render the texture to a renderTexture to extract pixels\n  const renderTexture = RenderTexture.create({ width, height });\n\n  let ascii = \"\";\n\n  const asciiText = new Text({\n    text: ascii,\n    style: {\n      fontFamily: \"monospace\",\n      fontSize: 8,\n      fill: 0x000,\n      align: \"left\",\n      lineHeight: 8,\n      whiteSpace: \"pre\",\n    },\n  });\n  asciiText.alpha = 0.2;\n  asciiText.x = 0;\n  asciiText.y = 0;\n\n  const variants: string[] = [];\n\n  const render = (index: number) => {\n    ascii = \"\";\n    const sprite = sprites[index];\n\n    sprites.forEach((sprite) => {\n      sprite.alpha = 0;\n    });\n\n    sprite.alpha = 1;\n    app.renderer.render({ container: sprite, target: renderTexture });\n    sprite.alpha = 0;\n\n    const pixels = app.renderer.extract.pixels(renderTexture).pixels;\n\n    const charWidth = 4.81640625;\n\n    for (let y = 0; y < height; y += 8) {\n      let line = \"\";\n\n      for (let x = 0; x < width; x += charWidth) {\n        let totalLum = 0;\n        let count = 0;\n\n        for (let dy = 0; dy < 8; dy++) {\n          for (let dx = 0; dx < 4; dx++) {\n            const px = Math.floor(x + dx);\n            const py = Math.floor(y + dy);\n            if (px >= width || py >= height) continue;\n            const idx = (py * width + px) * 4;\n            const r = pixels[idx];\n            const g = pixels[idx + 1];\n            const b = pixels[idx + 2];\n            const lum = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n            totalLum += lum;\n            count++;\n          }\n        }\n        const avgLum = count ? totalLum / count : 0;\n        line += getAsciiChar(avgLum);\n      }\n      ascii += sprinkleAscii(line) + \"\\n\";\n    }\n\n    variants[index] = ascii;\n\n    asciiText.text = ascii;\n  };\n\n  app.stage.addChild(asciiText);\n\n  for (let i = 0; i < sprites.length; i++) {\n    render(i);\n  }\n\n  let i = 0;\n\n  //@ts-expect-error - safeAdd method exists on extended ticker\n  app.ticker.safeAdd(() => {\n    i++;\n    if (i >= sprites.length) i = 0;\n\n    render(i);\n  });\n};\n\nexport default tickAscii;\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/cell.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\n\nimport AnimatedRect from \"./components/AnimatedRect\";\nimport BlinkingContainer from \"./components/BlinkingContainer\";\nimport crawl from \"./crawl\";\nimport mapping from \"./mapping\";\nimport scrape from \"./scrape\";\nimport search from \"./search\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n};\n\nexport const CELL_SIZE = 80;\n\nexport const MAIN_COLOR = 0xe6e6e6;\n\nconst animations = [scrape, mapping, search, crawl];\n\nlet lastActive = -1;\n\nexport default function cell(props: Props) {\n  const blinkingContainer = BlinkingContainer({\n    x: props.x + 10,\n    y: props.y + 10,\n    app: props.app,\n  });\n\n  const anchorGraphic = AnimatedRect({\n    app: props.app,\n    x: CELL_SIZE / 2,\n    y: CELL_SIZE / 2,\n    width: 4,\n    height: 4,\n    radius: 10,\n    color: MAIN_COLOR,\n  });\n\n  blinkingContainer.container.addChild(anchorGraphic.graphic);\n\n  props.app.stage.addChild(blinkingContainer.container);\n\n  let running = false;\n\n  return {\n    trigger: async () => {\n      if (running) return;\n\n      running = true;\n\n      lastActive = (lastActive + 1) % animations.length;\n\n      const fn = animations[lastActive];\n\n      await fn({\n        ...props,\n        blinkingContainer,\n        anchorGraphic,\n      });\n\n      running = false;\n    },\n  };\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/cellReveal.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport AnimatedRect from \"./components/AnimatedRect\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n};\n\nexport default function cellReveal(props: Props) {\n  const graphic = AnimatedRect({\n    app: props.app,\n    x: props.x + 0.5,\n    y: props.y + 0.5,\n    width: 101,\n    height: 101,\n    radius: 0,\n    alpha: 0,\n    color: 0x000,\n    centering: false,\n  });\n\n  props.app.stage.addChild(graphic.graphic);\n\n  return {\n    trigger: async () => {\n      let cycleCount = 0;\n\n      const cycle = async () => {\n        await graphic.animate(\n          {\n            alpha: Math.random() * 0.04,\n          },\n          {\n            ease: \"linear\",\n            duration: 0.03,\n          },\n        );\n\n        if (cycleCount < 5) {\n          cycleCount += 1;\n          cycle();\n        } else {\n          await graphic.animate({ alpha: 0 });\n          graphic.graphic.destroy();\n        }\n      };\n\n      cycle();\n    },\n  };\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/components/AnimatedRect.ts",
    "content": "\nimport { AnimationOptions, cubicBezier } from \"motion\";\nimport { Application, Container, Graphics, Sprite } from \"pixi.js\";\n\nimport { isDestroyed } from \"@/components/shared/pixi/utils\";\n\ntype Props = {\n  app: Application;\n  x: number;\n  y: number;\n  width: number;\n  height: number;\n  radius: number;\n  color: number;\n  scale?: number;\n  rotation?: number;\n  type?: \"rect\" | \"arc\" | \"container\" | Sprite;\n  animationConfig?: AnimationOptions;\n  alpha?: number;\n\n  centering?: boolean;\n};\n\nexport type IAnimatedRect = ReturnType<typeof AnimatedRect>;\n\nexport default function AnimatedRect(props: Props) {\n  const graphic = (() => {\n    if (props.type === \"container\") return new Container();\n    if (props.type instanceof Sprite) return props.type;\n\n    return new Graphics();\n  })();\n\n  props.alpha ??= 1;\n  props.scale ??= 1;\n  props.centering ??= true;\n  props.rotation ??= 0;\n\n  const p = {\n    ...props,\n  };\n\n  const render = () => {\n    if (isDestroyed(props.app) || graphic.destroyed) return;\n\n    graphic.scale.set(p.scale!);\n    graphic.alpha = p.alpha!;\n    graphic.rotation = p.rotation!;\n\n    if (!(graphic instanceof Graphics)) {\n      if (graphic instanceof Sprite) {\n        graphic.x = p.x;\n        graphic.y = p.y;\n      }\n\n      return;\n    }\n\n    const g = graphic as Graphics;\n\n    g.clear();\n\n    if (p.type !== \"arc\") {\n      g.roundRect(\n        p.centering ? p.x - p.width / 2 : p.x,\n        p.centering ? p.y - p.height / 2 : p.y,\n        p.width,\n        p.height,\n        p.radius,\n      );\n    } else {\n      g.arc(p.x, p.y, p.width / 2, 0, Math.PI * 2);\n    }\n\n    g.fill({ color: p.color });\n  };\n\n  render();\n\n  p.animationConfig ??= {\n    duration: 0.4,\n    ease: cubicBezier(0.83, 0, 0.17, 1),\n  };\n\n  return {\n    defaultProps: props,\n    currentProps: p,\n    graphic,\n    setStyle: (style: Partial<Props>) => {\n      Object.assign(p, style);\n\n      render();\n    },\n    render,\n    animate: (renderProps: Partial<Props>, settings?: AnimationOptions) =>\n      (props.app as any).animate(p, renderProps, {\n        ...p.animationConfig,\n        ...settings,\n        onUpdate: render,\n      }),\n    reset: () => (props.app as any).animate(p, props, { onUpdate: render }),\n  };\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/components/BlinkingContainer.ts",
    "content": "\nimport { Application, Graphics } from \"pixi.js\";\n\nimport { CELL_SIZE } from \"@/components/app/(home)/sections/hero/Pixi/tickers/features/cell\";\n\nimport AnimatedRect from \"./AnimatedRect\";\n\nexport type IBlinkingContainer = ReturnType<typeof BlinkingContainer>;\n\nexport default function BlinkingContainer({\n  x,\n  y,\n  app,\n}: {\n  x: number;\n  y: number;\n  app: Application;\n}) {\n  const animatedRect = AnimatedRect({\n    app,\n    x: 0,\n    y: 0,\n    width: CELL_SIZE,\n    height: CELL_SIZE,\n    radius: 0,\n    color: 0xededed,\n    type: \"container\",\n  });\n\n  animatedRect.graphic.pivot.set(CELL_SIZE / 2, CELL_SIZE / 2);\n\n  animatedRect.graphic.x = x + CELL_SIZE / 2;\n  animatedRect.graphic.y = y + CELL_SIZE / 2;\n\n  animatedRect.graphic.addChild(\n    new Graphics()\n      .rect(0, 0, CELL_SIZE, CELL_SIZE)\n      .fill({ color: \"#EDEDED\", alpha: 0 }),\n  );\n\n  const blinkLayer = new Graphics()\n    .rect(0, 0, CELL_SIZE, CELL_SIZE)\n    .fill({ color: \"#F9F9F9\" });\n\n  blinkLayer.zIndex = 1;\n  blinkLayer.alpha = 0;\n\n  animatedRect.graphic.addChild(blinkLayer);\n\n  return {\n    container: animatedRect.graphic,\n    animate: animatedRect.animate,\n    reset: animatedRect.reset,\n    shrink: async () => {\n      await animatedRect.animate({ scale: 0.92 });\n\n      animatedRect.animate({ scale: 1 });\n    },\n    blink: ({ delay = 0 }: { delay?: number } = {}) => {\n      (app as any)\n        .animate(0, 0.32, {\n          repeatType: \"reverse\",\n          repeat: 2,\n          delay,\n          duration: 0.065,\n          ease: \"linear\",\n          onUpdate: (value: any) => {\n            blinkLayer.alpha = value as number;\n          },\n        })\n        .then(() => {\n          (app as any).animate(0.32, 0, {\n            duration: 0.065,\n            ease: \"linear\",\n            onUpdate: (value: any) => {\n              blinkLayer.alpha = value as number;\n            },\n          });\n        });\n    },\n  };\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/components/Dot.ts",
    "content": "import { MAIN_COLOR } from \"@/components/app/(home)/sections/hero/Pixi/tickers/features/cell\";\n\nimport AnimatedRect from \"./AnimatedRect\";\n\nexport default function Dot(\n  props: Pick<\n    Parameters<typeof AnimatedRect>[0],\n    \"x\" | \"y\" | \"app\" | \"animationConfig\"\n  >,\n) {\n  return AnimatedRect({\n    ...props,\n    width: 2,\n    height: 2,\n    radius: 10,\n    color: MAIN_COLOR,\n    type: \"arc\",\n  });\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/crawl.ts",
    "content": "import { animate } from \"motion\";\n\nimport { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport { sleep } from \"@/utils/sleep\";\n\nimport { CELL_SIZE, MAIN_COLOR } from \"./cell\";\nimport AnimatedRect, { IAnimatedRect } from \"./components/AnimatedRect\";\nimport { IBlinkingContainer } from \"./components/BlinkingContainer\";\nimport Dot from \"./components/Dot\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n  blinkingContainer: IBlinkingContainer;\n  anchorGraphic: IAnimatedRect;\n};\n\nexport default async function crawl(props: Props) {\n  const rects = Array.from({ length: 6 }, () => {\n    return AnimatedRect({\n      app: props.app,\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      width: 8,\n      height: 8,\n      radius: 0,\n      color: MAIN_COLOR,\n    });\n  });\n\n  const dots = Array.from({ length: 16 }, () => {\n    return Dot({\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      app: props.app,\n    });\n  });\n\n  dots.forEach((dot) =>\n    props.blinkingContainer.container.addChild(dot.graphic),\n  );\n\n  await sleep(500);\n\n  /* Step 1: Reveal the main square, reveal the corner dots */\n  await Promise.all(\n    [\n      dots[0].animate({ x: 30, y: 30 }, { delay: 0.2 }),\n      dots[1].animate({ x: CELL_SIZE - 30, y: 30 }, { delay: 0.2 }),\n      dots[2].animate({ x: 30, y: CELL_SIZE - 30 }, { delay: 0.2 }),\n      dots[3].animate({ x: CELL_SIZE - 30, y: CELL_SIZE - 30 }, { delay: 0.2 }),\n\n      props.anchorGraphic.animate({\n        radius: 0,\n        width: 12,\n        height: 12,\n      }),\n    ].flat(),\n  );\n\n  rects.forEach((rect) =>\n    props.blinkingContainer.container.addChild(rect.graphic),\n  );\n\n  rects.unshift(props.anchorGraphic);\n\n  await sleep(500);\n  props.blinkingContainer.blink({ delay: 0.3 });\n  await props.blinkingContainer.shrink();\n\n  let spriteOverlay: IAnimatedRect | null = null;\n\n  // Use fallback rectangle instead of trying to load missing image\n  spriteOverlay = AnimatedRect({\n    x: 13,\n    y: 39,\n    color: MAIN_COLOR,\n    width: 54,\n    height: 34,\n    app: props.app,\n    radius: 4,\n    centering: false,\n  });\n\n  spriteOverlay.graphic.zIndex = -1;\n  props.blinkingContainer.container.addChild(spriteOverlay.graphic);\n\n  await Promise.all(\n    [\n      spriteOverlay?.animate({ height: 23, y: 50 }),\n\n      rects[0].animate({ width: 16, height: 16, y: 34 }),\n      rects.slice(1, 4).map((rect) => rect.animate({ x: 24, y: 50 })),\n      rects.slice(4, 8).map((rect) => rect.animate({ x: 56, y: 50 })),\n\n      dots[0].animate({ x: 28, y: 22 }),\n      dots[1].animate({ x: 52, y: 22 }),\n      dots[2].animate({ x: 16, y: 58 }),\n      dots[3].animate({ x: 64, y: 58 }),\n\n      dots[4].animate({ x: 16, y: 42 }),\n      dots[5].animate({ x: 64, y: 42 }),\n      dots[6].animate({ x: 32, y: 58 }),\n      dots[7].animate({ x: 48, y: 58 }),\n\n      dots.slice(8, 12).map((dot) => dot.animate({ x: 24, y: 50 })),\n      dots.slice(12, 16).map((dot) => dot.animate({ x: 56, y: 50 })),\n    ].flat().filter(Boolean),\n  );\n\n  await sleep(500);\n  props.blinkingContainer.blink({ delay: 0.3 });\n  await props.blinkingContainer.shrink();\n  try {\n    await Promise.all(\n      [\n        spriteOverlay?.animate({ height: 8, y: 58 }),\n\n        rects[0].animate({ y: 28 }),\n        [1, 4].map((i) => rects[i].animate({ y: 44 })),\n        [2, 3].map((i) => rects[i].animate({ x: 12, y: 56 })),\n        [5, 6].map((i) => rects[i].animate({ x: 68, y: 56 })),\n\n        dots[0].animate({ y: 16 }),\n        dots[1].animate({ y: 16 }),\n\n        dots[2].animate({ x: 4, y: 64 }),\n        dots[3].animate({ x: 76, y: 64 }),\n\n        dots[4].animate({ x: 4, y: 48 }),\n        dots[5].animate({ x: 76, y: 48 }),\n        dots[6].animate({ x: 20, y: 64 }),\n        dots[7].animate({ x: 60, y: 64 }),\n\n        dots[8].animate({ x: 16, y: 36 }),\n        dots[12].animate({ x: 64, y: 36 }),\n\n        dots[9].animate({ x: 32, y: 52 }),\n        dots[13].animate({ x: 48, y: 52 }),\n\n        [10, 11].map((i) => dots[i].animate({ x: 12, y: 56 })),\n        [14, 15].map((i) => dots[i].animate({ x: 68, y: 56 })),\n      ].flat().filter(Boolean),\n    );\n  } catch (e) {\n    console.error(e);\n  }\n\n  await sleep(500);\n  props.blinkingContainer.blink({ delay: 0.3 });\n  await props.blinkingContainer.shrink();\n\n  await Promise.all(\n    [\n      spriteOverlay.animate({ height: 0, y: 66 }),\n\n      rects[0].animate({ y: 20 }),\n      [1, 4].map((i) => rects[i].animate({ y: 36 })),\n      [2, 5].map((i) => rects[i].animate({ y: 48 })),\n      [3, 6].map((i) => rects[i].animate({ y: 60, x: i === 3 ? 24 : 56 })),\n\n      [0, 1, 4, 5, 8, 9, 12, 13].map((i) =>\n        dots[i].animate({ y: dots[i].currentProps.y - 8 }),\n      ),\n\n      dots[2].animate({ x: 4, y: 56 }),\n      dots[3].animate({ x: 76, y: 56 }),\n\n      dots[6].animate({ x: 32, y: 68 }),\n      dots[7].animate({ x: 48, y: 68 }),\n\n      dots[10].animate({ x: 32, y: 52 }),\n      dots[11].animate({ x: 16, y: 68 }),\n      dots[14].animate({ x: 48, y: 52 }),\n      dots[15].animate({ x: 64, y: 68 }),\n    ].flat(),\n  );\n\n  await sleep(2000);\n\n  await Promise.all(\n    [\n      rects.map((rect) =>\n        rect.animate(props.anchorGraphic.defaultProps, {\n          delay: Math.random() * 0.3,\n          duration: 0.3,\n        }),\n      ),\n      dots.map((dot) =>\n        dot.animate(dot.defaultProps, { delay: Math.random() * 0.3 }),\n      ),\n    ].flat(),\n  );\n\n  rects.shift();\n\n  rects.forEach((rect) => rect.graphic.destroy());\n  dots.forEach((dot) => dot.graphic.destroy());\n  spriteOverlay.graphic.destroy();\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/index.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport setTimeoutOnVisible from \"@/utils/set-timeout-on-visible\";\n\nimport cell from \"./cell\";\nimport cellReveal from \"./cellReveal\";\n\nconst CELL_GRID = [\n  \"-ooooooooooo-\",\n  \"-oo-------oo-\",\n  \"ooo-------ooo\",\n  \"-oo-------oo-\",\n  \"-oo-------oo-\",\n];\n\nconst REVEAL_ANIMATION_GRID = [\n  [\n    \"---ooooooo---\",\n    \"--o-------o--\",\n    \"--o-------o--\",\n    \"--o-------o--\",\n    \"--o-------o--\",\n  ],\n  [\n    \"--o-------o--\",\n    \"-o---------o-\",\n    \"-o---------o-\",\n    \"-o---------o-\",\n    \"-o---------o-\",\n  ],\n  [\n    \"-o---------o-\",\n    \"-------------\",\n    \"o-----------o\",\n    \"-------------\",\n    \"-------------\",\n  ],\n  [\n    \"-------------\",\n    \"-------------\",\n    \"o-----------o\",\n    \"-------------\",\n    \"-------------\",\n  ],\n];\n\nconst features: Ticker = (params) => {\n  const cells: ReturnType<typeof cell>[] = [];\n  const cellReveals: {\n    cell: ReturnType<typeof cellReveal>;\n    row: number;\n    column: number;\n  }[] = [];\n\n  for (let i = 0; i < CELL_GRID.length; i++) {\n    const row = CELL_GRID[i];\n\n    for (let j = 0; j < row.length; j++) {\n      if (row[j] === \"o\") {\n        cells.push(\n          cell({\n            ...params,\n            x: j * 101,\n            y: i * 101,\n          }),\n        );\n\n        cellReveals.push({\n          cell: cellReveal({\n            ...params,\n            x: j * 101,\n            y: i * 101,\n          }),\n          row: i,\n          column: j,\n        });\n      }\n    }\n  }\n\n  const cycle = () =>\n    setTimeoutOnVisible({\n      element: params.canvas,\n      callback: () => {\n        const cell = cells[Math.floor(Math.random() * cells.length)];\n\n        if (cell) {\n          cell.trigger().then(() => cycle());\n        }\n      },\n      timeout: 3000 * Math.random(),\n    });\n\n  for (let i = 0; i < 5; i++) {\n    cycle();\n  }\n\n  let revealIndex = -1;\n\n  const revealCycle = () => {\n    revealIndex += 1;\n\n    for (let i = 0; i < REVEAL_ANIMATION_GRID[revealIndex].length; i++) {\n      const row = REVEAL_ANIMATION_GRID[revealIndex][i];\n\n      for (let j = 0; j < row.length; j++) {\n        if (row[j] === \"o\") {\n          cellReveals\n            .find((cell) => cell.row === i && cell.column === j)\n            ?.cell.trigger();\n        }\n      }\n    }\n\n    if (revealIndex < REVEAL_ANIMATION_GRID.length - 1) {\n      setTimeout(() => {\n        revealCycle();\n      }, 150);\n    }\n  };\n\n  revealCycle();\n};\n\nexport default features;\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/mapping.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport { sleep } from \"@/utils/sleep\";\n\nimport { CELL_SIZE, MAIN_COLOR } from \"./cell\";\nimport AnimatedRect, { IAnimatedRect } from \"./components/AnimatedRect\";\nimport { IBlinkingContainer } from \"./components/BlinkingContainer\";\nimport Dot from \"./components/Dot\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n  blinkingContainer: IBlinkingContainer;\n  anchorGraphic: IAnimatedRect;\n};\n\nexport default async function mapping(props: Props) {\n  const rects = Array.from({ length: 8 }, () => {\n    return AnimatedRect({\n      app: props.app,\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      width: 10,\n      height: 10,\n      radius: 0,\n      color: MAIN_COLOR,\n    });\n  });\n\n  const dots = Array.from({ length: 20 }, () => {\n    return Dot({\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      app: props.app,\n    });\n  });\n\n  dots.forEach((dot) =>\n    props.blinkingContainer.container.addChild(dot.graphic),\n  );\n\n  await sleep(500);\n\n  await props.anchorGraphic.animate({\n    radius: 0,\n    width: 12,\n    height: 12,\n  });\n\n  rects.forEach((rect) =>\n    props.blinkingContainer.container.addChild(rect.graphic),\n  );\n\n  rects.unshift(props.anchorGraphic);\n\n  await sleep(500);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n  await props.blinkingContainer.shrink();\n\n  await Promise.all(\n    [\n      dots.slice(0, 16).map((dot, index) => {\n        const x = 13 + (index % 4) * 18;\n        const y = 13 + Math.floor(index / 4) * 18;\n\n        return dot.animate({ x, y });\n      }),\n\n      rects[0].animate({ width: 10, height: 10 }),\n\n      rects.map((rect, index) => {\n        const x = 22 + (index % 3) * 18;\n        const y = 22 + Math.floor(index / 3) * 18;\n\n        return rect.animate({ x, y });\n      }),\n    ].flat(),\n  );\n\n  await sleep(300);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n  await props.blinkingContainer.shrink();\n\n  const baseDotPositions = [\n    [13, 13],\n    [31, 31],\n    [49, 31],\n    [13, 31],\n    [49, 49],\n    [67, 49],\n    [13, 49],\n    [31, 67],\n    [67, 67],\n  ];\n\n  const dotPositions: string[] = [];\n\n  for (const [x, y] of baseDotPositions) {\n    const positions = [\n      { x: x - 9, y: y - 9 },\n      { x: x + 9, y: y - 9 },\n      { x: x - 9, y: y + 9 },\n      { x: x + 9, y: y + 9 },\n    ];\n\n    for (const position of positions) {\n      if (!dotPositions.includes(`${position.x},${position.y}`)) {\n        dotPositions.push(`${position.x},${position.y}`);\n      }\n    }\n  }\n\n  await Promise.all(\n    [\n      rects[0].animate({ x: 13, y: 13 }),\n      rects[1].animate({ x: 31, y: 31 }),\n      rects[2].animate({ x: 49, y: 31 }),\n      rects[3].animate({ x: 13, y: 31 }),\n\n      rects[4].animate({ x: 49, y: 49 }),\n      rects[5].animate({ x: 67, y: 49 }),\n\n      rects[6].animate({ x: 13, y: 49 }),\n      rects[7].animate({ x: 31, y: 67 }),\n      rects[8].animate({ x: 67, y: 67 }),\n\n      dots.map((dot, index) => {\n        const position = dotPositions[index].split(\",\").map(Number);\n\n        return dot.animate({ x: position[0], y: position[1] });\n      }),\n    ].flat(),\n  );\n\n  await sleep(500);\n\n  const lines = Array.from({ length: 8 }, () => {\n    return AnimatedRect({\n      app: props.app,\n      x: 0,\n      y: 0,\n      width: 0,\n      height: 0,\n      radius: 0,\n      color: MAIN_COLOR,\n      centering: false,\n      animationConfig: {\n        duration: 0.25,\n        ease: \"linear\",\n      },\n    });\n  });\n\n  lines.forEach((graphic) =>\n    props.blinkingContainer.container.addChild(graphic.graphic),\n  );\n\n  (async () => {\n    lines[0].setStyle({ width: 1, height: 0, y: 18, x: 12.5 });\n    await lines[0].animate({ height: 9 });\n\n    lines[1].setStyle({ width: 0, height: 1, y: 30.5, x: 18 });\n    await lines[1].animate({ width: 9 });\n    lines[2].setStyle({ width: 0, height: 1, y: 30.5, x: 36 });\n    await lines[2].animate({ width: 9 });\n\n    lines[3].setStyle({ width: 1, height: 3, y: 36, x: 48.5 });\n    await lines[3].animate({ height: 9 });\n    lines[4].setStyle({ width: 0, height: 1, y: 48.5, x: 54 });\n    await lines[4].animate({ width: 9 });\n  })();\n\n  lines[5].setStyle({ width: 0, height: 1, y: 66.5, x: 62 });\n  await lines[5].animate({ width: 28, x: 62 - 28 }, { duration: 0.4 });\n  lines[6].setStyle({ width: 0, height: 1, y: 66.5, x: 26 });\n  await lines[6].animate({ width: 13.5, x: 26 - 13.5 });\n  lines[7].setStyle({ width: 1, height: 0, y: 66.5, x: 12.5 });\n  await lines[7].animate({ height: 14.5, y: 66.5 - 13.5 });\n\n  await sleep(2000);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n\n  await Promise.all(\n    [\n      lines.map((line) => line.animate({ alpha: 0 })),\n\n      rects.map((rect) =>\n        rect.animate(props.anchorGraphic.defaultProps, {\n          delay: Math.random() * 0.3,\n          duration: 0.3,\n        }),\n      ),\n\n      dots.map((dot) =>\n        dot.animate(dot.defaultProps, { delay: Math.random() * 0.3 }),\n      ),\n    ].flat(),\n  );\n\n  rects.shift();\n\n  lines.forEach((line) => line.graphic.destroy());\n  rects.forEach((rect) => rect.graphic.destroy());\n  dots.forEach((dot) => dot.graphic.destroy());\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/scrape.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport { sleep } from \"@/utils/sleep\";\n\nimport { CELL_SIZE, MAIN_COLOR } from \"./cell\";\nimport AnimatedRect, { IAnimatedRect } from \"./components/AnimatedRect\";\nimport { IBlinkingContainer } from \"./components/BlinkingContainer\";\nimport Dot from \"./components/Dot\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n  blinkingContainer: IBlinkingContainer;\n  anchorGraphic: IAnimatedRect;\n};\n\nexport default async function scrape(props: Props) {\n  const rects = Array.from({ length: 15 }, () => {\n    return AnimatedRect({\n      app: props.app,\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      width: 10,\n      height: 10,\n      radius: 0,\n      color: MAIN_COLOR,\n    });\n  });\n\n  const dots = Array.from({ length: 25 }, () => {\n    return Dot({\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      app: props.app,\n    });\n  });\n\n  dots.forEach((dot) =>\n    props.blinkingContainer.container.addChild(dot.graphic),\n  );\n\n  await sleep(500);\n\n  await Promise.all(\n    [\n      [0, 12, 13, 14].map((index) =>\n        dots[index].animate({ x: 30, y: 30 }, { delay: 0.2 }),\n      ),\n      [1, 15, 16, 17].map((index) =>\n        dots[index].animate({ x: CELL_SIZE - 30, y: 30 }, { delay: 0.2 }),\n      ),\n      [2, 18, 19, 20].map((index) =>\n        dots[index].animate({ x: 30, y: CELL_SIZE - 30 }, { delay: 0.2 }),\n      ),\n      [3, 21, 22, 23].map((index) =>\n        dots[index].animate(\n          { x: CELL_SIZE - 30, y: CELL_SIZE - 30 },\n          { delay: 0.2 },\n        ),\n      ),\n\n      props.anchorGraphic.animate({\n        radius: 0,\n        width: 12,\n        height: 12,\n      }),\n    ].flat(),\n  );\n\n  rects.forEach((rect) =>\n    props.blinkingContainer.container.addChild(rect.graphic),\n  );\n\n  rects.unshift(props.anchorGraphic);\n\n  await sleep(500);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n  await props.blinkingContainer.shrink();\n\n  await Promise.all(\n    [\n      [0, 12, 13, 14].map((index) => dots[index].animate({ x: 22, y: 22 })),\n      [1, 15, 16, 17].map((index) =>\n        dots[index].animate({ x: CELL_SIZE - 22, y: 22 }),\n      ),\n      [2, 18, 19, 20].map((index) =>\n        dots[index].animate({ x: 22, y: CELL_SIZE - 22 }),\n      ),\n      [3, 21, 22, 23].map((index) =>\n        dots[index].animate({ x: CELL_SIZE - 22, y: CELL_SIZE - 22 }),\n      ),\n\n      dots[4].animate({ x: 40, y: 22 }),\n      dots[5].animate({ x: 22, y: 40 }),\n      dots[6].animate({ x: CELL_SIZE - 22, y: 40 }),\n      dots[7].animate({ x: 40, y: 58 }),\n\n      dots[8].animate({ x: 40, y: 22 }),\n      dots[9].animate({ x: 22, y: 40 }),\n      dots[10].animate({ x: CELL_SIZE - 22, y: 40 }),\n      dots[11].animate({ x: 40, y: 58 }),\n\n      rects[0].animate({ width: 10, height: 10 }),\n      rects.slice(0, 4).map((rect) => rect.animate({ x: 31, y: 31 })),\n      rects\n        .slice(4, 8)\n        .map((rect) => rect.animate({ x: CELL_SIZE - 31, y: 31 })),\n      rects\n        .slice(8, 12)\n        .map((rect) => rect.animate({ x: 31, y: CELL_SIZE - 31 })),\n      rects\n        .slice(12, 16)\n        .map((rect) => rect.animate({ x: CELL_SIZE - 31, y: CELL_SIZE - 31 })),\n    ].flat(),\n  );\n\n  await sleep(1000);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n  await props.blinkingContainer.shrink();\n\n  await Promise.all(\n    [\n      dots[0].animate({ x: 4, y: 4 }),\n      dots[1].animate({ x: CELL_SIZE - 4, y: 4 }),\n      dots[2].animate({ x: 4, y: CELL_SIZE - 4 }),\n      dots[3].animate({ x: CELL_SIZE - 4, y: CELL_SIZE - 4 }),\n      dots[4].animate({ x: 40, y: 4 }),\n      dots[5].animate({ x: 4, y: 40 }),\n      dots[6].animate({ x: 76, y: 40 }),\n      dots[7].animate({ x: 40, y: 76 }),\n\n      dots[13].animate({ x: 22, y: 4 }),\n      dots[14].animate({ x: 4, y: 22 }),\n      dots[16].animate({ x: 58, y: 4 }),\n      dots[17].animate({ x: 76, y: 22 }),\n      dots[19].animate({ x: 4, y: 58 }),\n      dots[20].animate({ x: 22, y: 76 }),\n      dots[22].animate({ x: 58, y: 76 }),\n      dots[23].animate({ x: 76, y: 58 }),\n\n      rects.map((rect, index) => {\n        const quadrant = Math.floor(index / 4);\n        const position = index % 4;\n\n        const col = (position % 2 === 0 ? 1 : 2) + (quadrant % 2 === 0 ? 0 : 2);\n        const row = Math.floor(position / 2) + (quadrant < 2 ? 1 : 3);\n\n        return rect.animate({\n          x: 13 + (col - 1) * 18,\n          y: 13 + (row - 1) * 18,\n        });\n      }),\n    ].flat(),\n  );\n\n  await sleep(1200);\n\n  Promise.all(\n    dots.map((dot) =>\n      dot.animate({ alpha: 0 }, { delay: Math.random() * 0.3 }),\n    ),\n  );\n\n  await sleep(100);\n\n  props.blinkingContainer.blink({ delay: 0.2 });\n\n  const newWidths: number[] = [];\n\n  for (let i = 0; i < rects.length; i++) {\n    if (i % 2 === 0) {\n      newWidths.push(20 + Math.random() * 28);\n    } else {\n      const remainingSpace = 62 - newWidths[i - 1];\n      newWidths.push(10 + Math.random() * remainingSpace);\n    }\n  }\n\n  await Promise.all([\n    rects.map((rect, index) => {\n      const y = 8 + Math.floor(index / 2) * 6 + Math.floor(index / 4) * 8;\n\n      return rect.animate(\n        {\n          y,\n          x:\n            (index % 2 === 0 ? 8 : newWidths[index - 1] + 10) +\n            newWidths[index] / 2,\n          height: 4,\n          width: newWidths[index],\n        },\n        {\n          delay: Math.random() * 0.1,\n        },\n      );\n    }),\n  ]);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n\n  await sleep(2000);\n\n  await Promise.all(\n    [\n      rects.map((rect) =>\n        rect.animate(props.anchorGraphic.defaultProps, {\n          delay: Math.random() * 0.3,\n          duration: 0.3,\n        }),\n      ),\n    ].flat(),\n  );\n\n  rects.shift();\n\n  rects.forEach((rect) => rect.graphic.destroy());\n  dots.forEach((dot) => dot.graphic.destroy());\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Pixi/tickers/features/search.ts",
    "content": "import { Ticker } from \"@/components/shared/pixi/Pixi\";\nimport { sleep } from \"@/utils/sleep\";\n\nimport { CELL_SIZE, MAIN_COLOR } from \"./cell\";\nimport AnimatedRect, { IAnimatedRect } from \"./components/AnimatedRect\";\nimport { IBlinkingContainer } from \"./components/BlinkingContainer\";\nimport Dot from \"./components/Dot\";\n\ntype Props = Parameters<Ticker>[0] & {\n  x: number;\n  y: number;\n  blinkingContainer: IBlinkingContainer;\n  anchorGraphic: IAnimatedRect;\n};\n\nexport default async function search(props: Props) {\n  const rects = Array.from({ length: 8 }, () => {\n    return AnimatedRect({\n      app: props.app,\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      width: 10,\n      height: 10,\n      radius: 0,\n      color: MAIN_COLOR,\n    });\n  });\n\n  const dots = Array.from({ length: 16 }, () => {\n    return Dot({\n      x: CELL_SIZE / 2,\n      y: CELL_SIZE / 2,\n      app: props.app,\n    });\n  });\n\n  dots.forEach((dot) =>\n    props.blinkingContainer.container.addChild(dot.graphic),\n  );\n\n  await sleep(500);\n\n  await props.anchorGraphic.animate({\n    radius: 0,\n    width: 12,\n    height: 12,\n  });\n\n  rects.forEach((rect) =>\n    props.blinkingContainer.container.addChild(rect.graphic),\n  );\n\n  rects.unshift(props.anchorGraphic);\n\n  await sleep(500);\n\n  props.blinkingContainer.blink({ delay: 0.1 });\n  await props.blinkingContainer.shrink();\n\n  await Promise.all(\n    [\n      dots.map((dot, index) => {\n        const x = 13 + (index % 4) * 18;\n        const y = 13 + Math.floor(index / 4) * 18;\n\n        return dot.animate({ x, y });\n      }),\n\n      rects[0].animate({ width: 10, height: 10 }),\n\n      rects.map((rect, index) => {\n        const x = 22 + (index % 3) * 18;\n        const y = 22 + Math.floor(index / 3) * 18;\n\n        return rect.animate({ x, y });\n      }),\n    ].flat(),\n  );\n\n  await sleep(300);\n\n  Promise.all(\n    [\n      rects.map((rect) => rect.animate({ alpha: 0.68 })),\n      dots.map((dot) => dot.animate({ alpha: 0.68 })),\n    ].flat(),\n  );\n\n  props.blinkingContainer.blink();\n  await sleep(400);\n\n  for await (const rect of rects) {\n    // Get the surrounding dots of this rect\n    const rectX = rect.currentProps.x;\n    const rectY = rect.currentProps.y;\n    const surroundingDots = dots.filter((dot) => {\n      const dx = Math.abs(dot.currentProps.x - rectX);\n      const dy = Math.abs(dot.currentProps.y - rectY);\n\n      // Consider \"surrounding\" as adjacent horizontally, vertically, or diagonally (distance 18)\n      return (\n        (dx === 0 && dy === 9) ||\n        (dx === 9 && dy === 0) ||\n        (dx === 9 && dy === 9)\n      );\n    });\n\n    await Promise.all(\n      [\n        surroundingDots.map((dot) =>\n          dot.animate({ alpha: 1 }, { duration: 0.75 }),\n        ),\n        rect.animate({ alpha: 1, width: 14, height: 14 }, { duration: 0.75 }),\n      ].flat(),\n    );\n\n    rect.animate({ alpha: 0.68, width: 10, height: 10 }, { duration: 0.75 });\n    Promise.all(\n      surroundingDots.map((dot) =>\n        dot.animate({ alpha: 0.68 }, { duration: 0.75 }),\n      ),\n    );\n  }\n\n  await Promise.all(\n    [\n      rects.map((rect) =>\n        rect.animate(props.anchorGraphic.defaultProps, {\n          delay: Math.random() * 0.3,\n          duration: 0.3,\n        }),\n      ),\n\n      dots.map((dot) =>\n        dot.animate(dot.defaultProps, { delay: Math.random() * 0.3 }),\n      ),\n    ].flat(),\n  );\n\n  rects.shift();\n\n  rects.forEach((rect) => rect.graphic.destroy());\n  dots.forEach((dot) => dot.graphic.destroy());\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero/Title/Title.tsx",
    "content": "\"use client\";\n\n// import dynamic from \"next/dynamic\";\n// import { useRef, useEffect, forwardRef } from \"react\";\n\n// const originalText =\n//   \"\";\n\ntype Options = {\n  randomizeChance?: number;\n  reversed?: boolean;\n};\n\nexport const encryptText = (\n  text: string,\n  progress: number,\n  _options?: Options,\n) => {\n  const options = {\n    randomizeChance: 0.7,\n    ..._options,\n  };\n\n  const encryptionChars = \"a-zA-Z0-9*=?!\";\n  const skipTags = [\"<br class='lg-max:hidden'>\", \"<span>\", \"</span>\"];\n\n  // Calculate how many characters should be encrypted\n  const totalChars = text.length;\n  const encryptedCount = Math.floor(totalChars * (1 - progress));\n\n  let result = \"\";\n  let charIndex = 1;\n\n  for (let i = 0; i < text.length; i++) {\n    const char = text[i];\n\n    // Check if we're at the start of a tag to skip\n    let shouldSkip = false;\n\n    for (const tag of skipTags) {\n      if (text.substring(i, i + tag.length) === tag) {\n        result += tag;\n        i += tag.length - 1; // -1 because loop will increment\n        shouldSkip = true;\n        break;\n      }\n    }\n\n    if (shouldSkip) continue;\n\n    // Skip spaces - keep them as is\n    if (char === \" \") {\n      result += char;\n      charIndex++;\n      continue;\n    }\n\n    // If this character should be encrypted\n    if (\n      options.reversed\n        ? charIndex < encryptedCount\n        : text.length - charIndex < encryptedCount\n    ) {\n      // 40% chance to show original character, 60% chance to encrypt\n      if (Math.random() < options.randomizeChance) {\n        result += char;\n      } else {\n        // Use random character from encryption set\n        const randomIndex = Math.floor(Math.random() * encryptionChars.length);\n        result += encryptionChars[randomIndex];\n      }\n    } else {\n      // Keep original character\n      result += char;\n    }\n\n    charIndex++;\n  }\n\n  return result;\n};\n\n// const Wrapper = forwardRef<\n//   HTMLDivElement,\n//   React.HTMLAttributes<HTMLDivElement>\n// >((props, ref) => {\n//   return (\n//     <div className=\"text-title-h1 mx-auto text-center [&_span]:text-heat-100 mb-12 lg:mb-16\">\n//       <div {...props} className=\"hidden lg:contents\" ref={ref} />\n//       <div\n//         className=\"lg:hidden contents\"\n//         dangerouslySetInnerHTML={{ __html: originalText }}\n//       />\n//     </div>\n//   );\n// });\n\n// Wrapper.displayName = \"Wrapper\";\n\n// export default dynamic(() => Promise.resolve(HomeHeroTitle), {\n//   ssr: false,\n//   loading: () => (\n//     <Wrapper\n//       dangerouslySetInnerHTML={{ __html: encryptText(originalText, 0) }}\n//     />\n//   ),\n// });\n\n// function HomeHeroTitle() {\n//   const textRef = useRef<HTMLDivElement>(null);\n\n//   useEffect(() => {\n//     if (window.innerWidth < 996) {\n//       return;\n//     }\n\n//     let progress = 0;\n//     let increaseProgress = -10;\n\n//     const animate = () => {\n//       increaseProgress = (increaseProgress + 1) % 5;\n\n//       if (increaseProgress === 4) {\n//         progress += 0.3;\n//       }\n\n//       if (progress > 1) {\n//         progress = 1;\n//         textRef.current!.innerHTML = encryptText(originalText, progress);\n\n//         return;\n//       }\n\n//       textRef.current!.innerHTML = encryptText(originalText, progress);\n\n//       const interval = 50 + progress * 20;\n//       setTimeout(animate, interval);\n//     };\n\n//     animate();\n//   }, []);\n\n//   return (\n//     <Wrapper\n//       dangerouslySetInnerHTML={{ __html: encryptText(originalText, 0) }}\n//       ref={textRef}\n//     />\n//   );\n// }\n\n// import dynamic from \"next/dynamic\";\n// import { useRef, useEffect, forwardRef } from \"react\";\n\n// const originalText =\n//   \"Turn websites into <br class='lg-max:hidden'><span>LLM-ready</span> data\";\n\n// type Options = {\n//   randomizeChance?: number;\n//   reversed?: boolean;\n// };\n\n// export const encryptText = (\n//   text: string,\n//   progress: number,\n//   _options?: Options,\n// ) => {\n//   const options = {\n//     randomizeChance: 0.7,\n//     ..._options,\n//   };\n\n//   const encryptionChars = \"a-zA-Z0-9*=?!\";\n//   const skipTags = [\"<br class='lg-max:hidden'>\", \"<span>\", \"</span>\"];\n\n//   // Calculate how many characters should be encrypted\n//   const totalChars = text.length;\n//   const encryptedCount = Math.floor(totalChars * (1 - progress));\n\n//   let result = \"\";\n//   let charIndex = 1;\n\n//   for (let i = 0; i < text.length; i++) {\n//     const char = text[i];\n\n//     // Check if we're at the start of a tag to skip\n//     let shouldSkip = false;\n\n//     for (const tag of skipTags) {\n//       if (text.substring(i, i + tag.length) === tag) {\n//         result += tag;\n//         i += tag.length - 1; // -1 because loop will increment\n//         shouldSkip = true;\n//         break;\n//       }\n//     }\n\n//     if (shouldSkip) continue;\n\n//     // Skip spaces - keep them as is\n//     if (char === \" \") {\n//       result += char;\n//       charIndex++;\n//       continue;\n//     }\n\n//     // If this character should be encrypted\n//     if (\n//       options.reversed\n//         ? charIndex < encryptedCount\n//         : text.length - charIndex < encryptedCount\n//     ) {\n//       // 40% chance to show original character, 60% chance to encrypt\n//       if (Math.random() < options.randomizeChance) {\n//         result += char;\n//       } else {\n//         // Use random character from encryption set\n//         const randomIndex = Math.floor(Math.random() * encryptionChars.length);\n//         result += encryptionChars[randomIndex];\n//       }\n//     } else {\n//       // Keep original character\n//       result += char;\n//     }\n\n//     charIndex++;\n//   }\n\n//   return result;\n// };\n\n// const Wrapper = forwardRef<\n//   HTMLDivElement,\n//   React.HTMLAttributes<HTMLDivElement>\n// >((props, ref) => {\n//   return (\n//     <div className=\"text-title-h1 mx-auto text-center [&_span]:text-heat-100 mb-12 lg:mb-16\">\n//       <div {...props} className=\"hidden lg:contents\" ref={ref} />\n//       <div\n//         className=\"lg:hidden contents\"\n//         dangerouslySetInnerHTML={{ __html: originalText }}\n//       />\n//     </div>\n//   );\n// });\n\n// Wrapper.displayName = \"Wrapper\";\n\n// export default dynamic(() => Promise.resolve(HomeHeroTitle), {\n//   ssr: false,\n//   loading: () => (\n//     <Wrapper\n//       dangerouslySetInnerHTML={{ __html: encryptText(originalText, 0) }}\n//     />\n//   ),\n// });\n\nexport default function HomeHeroTitle() {\n  return (\n    <h1 className=\"text-title-h1 mx-auto text-center [&_span]:text-heat-100 mb-12 lg:mb-16\">\n     Open Lovable <span>v3</span>\n    </h1>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-flame/HeroFlame.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useRef } from \"react\";\n\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nimport data from \"./data.json\";\n\nexport default function HeroFlame() {\n  const ref = useRef<HTMLDivElement>(null);\n  const ref2 = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = 0;\n\n        ref.current!.innerHTML = data[index];\n        ref2.current!.innerHTML = data[index];\n      },\n      interval: 85,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <div\n      className=\"cw-686 h-190 top-408 absolute flex gap-16 pointer-events-none select-none\"\n      ref={wrapperRef}\n    >\n      <div className=\"flex-1 overflow-clip relative\">\n        <div\n          className=\"text-black-alpha-20 font-ascii absolute bottom-0 -left-380 fc-decoration\"\n          dangerouslySetInnerHTML={{ __html: data[0] }}\n          ref={ref}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: \"9px\",\n            lineHeight: \"11px\",\n          }}\n        />\n      </div>\n\n      <div className=\"flex-1 overflow-clip relative\">\n        <div\n          className=\"text-black-alpha-20 font-ascii absolute bottom-0 -right-380 -scale-x-100 fc-decoration\"\n          dangerouslySetInnerHTML={{ __html: data[0] }}\n          ref={ref2}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: \"9px\",\n            lineHeight: \"11px\",\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-flame/data.json",
    "content": "[\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                .     .                                                                          \\n                                                               ..     ..+                                                                        \\n                                                                      .:.                                                                        \\n                                                               ..     ..         .::                                                             \\n                                                               +..   ..:          :.                                                             \\n                                                             .:..::.  ..          ..                                                             \\n                                                             .--:::.  ..     ...  .:.           ..                                               \\n                                            ..               .:+=-::.:.     . ...-.::.         ..                                                \\n                                            ::....           .:--+::..: ......:+....:.     :.. ..                                                \\n                                            .......            ::-=::::     ..:-:-...:     .--..::          .........                            \\n                            ..  .             . .              ..::-:-..      .-+-:::..    ...::::.        .: ...::.:..                          \\n                       .  -... ....:           .   .            .--=+-::.      :-=-:....  .  .:..::      .:---:::::-::....                       \\n                       ..::........::=.....    ...:-..        .:-=--+=-:.       ..--:..=::.... . .:..  ..:---::::---=:::..:...                   \\n              ..........::::.:::::::-::.-..  ...::--==:.      ..-::-+==-:...      .-::.......   ..--:. ..:=+==.---=-+-:::::::-..                 \\n          . .....::......:: ::::-::.---=+-:..::-+==++X=-:.   ..:-::-=-== ---..   .:.--::..       .:-==::=--X==-----====--::+:::+...              \\n          ..-....-:..::-::=-=-:-::--===++=-==-----== X+=-:.::-==----+==+XX+=-::.:+--==--::.      .:-+X=----+X=-=------===--::-:...:. ....        \\n          ....::::...:-:-==+++=++==+++XX++==++--+-+==++++=-===+=---:-==+X:XXX+=-:-=-==++=-:.     .:-=+=- -=X+X+===+---==--==--:..::...+....+     \\n         ..:::---.::.---=+==XXXXXXXX+XX++==++===--+===:+X+====+=--::--=+XXXXXXX+==++==+XX+=: ::::--=+++X++X+XXXX+=----==++.+=--::+::::+. ::.=... \\n         .:::-==-------=X+++XXXXXXXXXXX++==++.==-==-:-==+X++==+=-=--=++++X++:X:X+++X+-+X X+=---=-==+=+++XXXXX+XX=+=--=X++XXX==---::-+-::::.:..-..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      ..                                                                         \\n                                                               .      .+.                                                                        \\n                                                                                                                                                 \\n                                                                                  .:                                                             \\n                                                                 :    ..          :.                                                             \\n                                                             .. ...   ..          ..                                                             \\n                                                             :...+.    .     ..    :.            .                                               \\n                                                             .=-::...  .     .    ...          ..                                                \\n                                           ..                .--=-::...     .....=+.:.     .    .                                                \\n                                            -:....            .:-=:...:      .::......     .:.  ..           . ...                               \\n                                            .. .. .            .:: :.::      .:-::.. .     .-..:.:         ...........                           \\n                           ..=   .            ..                .::-==..      .-=-::...     ..:.. .        ..:::.::.:...                         \\n                       .+.:.:. ..-.::   . .     ..:.           .:=-==-::.      .:--..  ..   ..   ...    .:---:::::--::.....                      \\n                 ..    ..+::.......-::..:      . ::--..       ..:::-==-:.       ..::..  .:...   ..-.. =..:=== ::::-+-=:...+.=..                  \\n               .....= ....:::..:::::- ::=:.  ..:=--==+:.      .:-::-=-=--:...     .:-.....       .:-=:...-+==--:+:-+-=-:-:.:+...                 \\n             .....:...::.:: ::::-::----=+-::--:---+=XX=-:.  ..-=-=::--==X==-:....-.:--::..       .::++-::--+=---:-:---=-=::...-..                \\n          ....:..:....:=:- ==--=-:--===++====---- -==+==-::--==-:-::--=XX ++=-:::---+===-:.      .:-X+ ----=X==----: :=--.--::...........        \\n          .+.:::::-..:-:-===++=++=++++X++=====-.--=X==++==----=--::+:-=+XXXXX++---=-==+++=:.    ..:-+++---=+XX+++=-::-===-+=--:...:..........    \\n         ...::--- ::::--=+=+XXXXXXXX+++=====+===--=---==++==-=+=--::-==++XX+XXX++=+X==+XX+=-::-::--==++X++XXXXXXX=-::-+=++X+=-:::::::::-:=+..... \\n        ..: :-===----=-=+++++XX+XX-XX++X+==++==+=--:--==.XX+==++.===+++XX.++++XX++=X+=++XX+==--=--===+ +XXXXXXXXX+=--=X++.XX==--=-:---:::::::..:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                       .                                                                         \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                 .                 :                                                             \\n                                                                 .                ..                                                             \\n                                                                  .    ..          .                                                             \\n                                                                                   .                                                             \\n                                                            :..        .                        .                                                \\n                                                            .::...                              .                                                \\n                                                             ==-:: :   .                                                                         \\n                                            .    .           .-.=::. .::     ..+            .  .=.                                               \\n                                 .          :..                ..+:..:-.     .:..          .:  .+.            . ..                               \\n                                           .     .              .:.:-:.      .-=-...       ..-.           ...:.. ..   ..                         \\n                          .  .      .. ..        :.            ..::--:..      .::-.     .       .:      .:::-:....-...:.                         \\n                          ..  ......:: ::.    .::+::::         .:=::==:..      ......   ...      . .  .::----:...::::::....                      \\n                   .      .:.....:::::=:-.    ..::--=-..       :-::--==.::..     . .:  ..        .::-:..:==--::..:::::.:.....: .                 \\n                  +..  ...:-+...:.: :=---::..:::::-=+=:..    .::.:::--.++--:..    ..-:..+.        .:=-::::==-:::::::-=-:.::... .                 \\n            -... ..  .. .:---:+:-:-::-=+==--=-::.::-X=--::..::::.:.:--=XX+==--::::.:-+=-:.       ..-=-::-::=++-::-::.:---::.. .                  \\n          .........  .:::-=+== -==+= =====--=-:::::-+=+=--:.:::..::.:-===XXX+=--::--+==+=-.      ..-==-:.:-=XX=----:.:-=-=--:..   .+.....        \\n          ...:::+:...:=:-+++XX++++.=-=-==-- ===-:.:=---=+=-:::--::..:-==++X+X+==--=+==+X+-:.......:-==++==++X:X++=-:::-==+=--:.......::::..+.    \\n         ...:---::+:::--==++-XX++XX+=:=++=--====-:::+--==+=---== ---==++XXX++XX+.+XX===+X+=-:::-:--=====XX+-++XXX+-:--++=+X+--::::.:::::::.....  \\n        ..::.-==---+- ++++.+++XXX-XX++:X+=-=X+==:-::.=+X+XXX+=+X++++XXXXXXXX=XX=- +++-==++X+==-==-=:=++XXXXXXXXXX++==+ ++X X+=---.--.-:.:::.:... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                    .                                                            \\n                                                                                   :                                                             \\n                                                                                   .                                                             \\n                                                                        .                                                                        \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                            :.     .                                                                             \\n                                                            :-....:.   .-                                                                        \\n                                                            .......   ..                                                                         \\n                                            .                    ..  ..      :.                                                                  \\n                                               ..               ..:.:.       .-..           .             ...:...                                \\n                                     . ..       .....           .:--:..      .::...     .  .   ..      ........ .:.     .                        \\n                          ..   ..... ...:    ..=..::-.          .:.:=-:.       . ...    ..       .:.:..:-...-:.........                          \\n                    .     .::  ..::.:.:..    . .:.::-..        ..=.:--==:..         .             .::..+==::::+........ .                        \\n                          .:.......:.:::.....:::..::==:..    :.....::-+X-:::.    .-.:...          ..-:..::=::-:-...:.:::...                      \\n                       .. :::.:.-.:::-=---::=::...:--==-:.  ..= ....:-++=--=-::.+...==-::.        .--:....:=-:-:::.... ::..                      \\n           +....      .::-==+-----------------:::..-==--::. ...  ..::-=+:+++=-:::.-- =+=-:.      ..=--:::::=++-=::-::.:=-::...        ..         \\n           ..:-.... :..:-+++=+=-===-------::--.::..:------:... :....::-=++XX+=--::----+X-:.      ..-==-----+X+==-=-:::-=+=-::..  .....:...-      \\n          ...:::::....:-- ==+X+====-----=+::-==-:::::----=-:.::-::::--=+XXXXXX+=-=+=-==++--:-:::.::=--=-==X++++X+=-:=:===++--::......:......     \\n         ...:----:::--.====+=++X+++======---=+=--:-::=+++X++=-====== ++XXXX.XXX +++-=--=+X+--::--:---==+XX+++XXXX+=--=+=++X+=-:::-::-:::.......  \\n    .. ...:::--==:---++=+=====++ XXXXX++===+X+===+==-+X++++++++X+X++.XXXXXXXXXXXX ++======X+==-=--===+XXXXXXXXXXXX+=+++++X+XX=.--==--::-....:....\\n\",\n  \"                                                                                    .                                                            \\n                                                                                   .                                                             \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                            .           ..:                                                                      \\n                                                            :.    .    ..                                                                        \\n                                                            ::..                                                                                 \\n                                                            .      ..                                                                            \\n                                              .:                  :::.       :.                              ..                                  \\n                                               .:..:.            .:-.        ::.        .     .:  ..       .....                                 \\n                           ... . ... .         .  ...            ..::-:.     . .                  ... .:........:.                               \\n                           ..   =....        . ... ..            .:.:-+-..                         ....-=:....:.=...   ..                        \\n                           ...   -..=::... . ......:::-:          .::=+-:::+.      ::-..           .:..::=:...:..........                        \\n                       ....:. ...:....:::=:.:-..  .::=--:         ..:==:-::::.  . .:---:.          .:=:::. :::-.-...:...=.                       \\n                      ..:.--::::::::::::::--:-:....--:::...       ..:-==++---:.=.-::-=+-:.        .:::.....--=-:.-.::.--:...                     \\n           .......   ..-=---==-=-==-::.-::+:--::..-:---:::....... ..---=+XXX+=-+:::--+X-:..       :--:.::::-++-::::::::==-:..:     +....         \\n           ..:...:....:-=-=+:+=--==::--::-=::--:...:--.:-::....::::---+=+XXX.+=-:-----+=-::..... .::--:---=+++==--:..:-==+-:::.. ......+-.       \\n          ..:-::::..::---=====+=== -:--:--::-==-::-::-==-==----=--::-==+:XXXXXX+==+=--==+=::..:::.::---++.+=+++X+=-:=:===+=--::...:..::...:.     \\n         ....:-------==-=+=====XX+X+==------+=---=:==+=.==+=+++++X+==+XXXXXXXXXXX+++==--==+=-:-:-:---=X XX++XXXXX++===+==+++=------::: :.......  \\n    .....-.:+:--==+======= ++=++X:XXXX+=:==XX==:++=-=++==+X+=+++:+XXXXX:-X.XXXXX+X++==-++++X+======++XXXXX-XXXX--XXX+==+++++X++==.---::::..=:. ..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                        .                                                                        \\n                                                            .     .                                                                              \\n                                                            :.                                                                                   \\n                                                            .. .   ..                                                                            \\n                                              .   ..             ::.         .                                .                                  \\n                                              .  .                .:+..      :               ..               .                                  \\n                            .                .    .                ..--      ..                      ..       ..:                                \\n                            .     ..           ..  .              ...-:...        .                ...:-..    ...                                \\n                            .    ....-.-.   ..:..  .. ::          ...-::......    ..  ..           .:.:::=....:.    ..                           \\n                         -...    .....:...:.:-.   ...=.::          .:=-::::::.    .::--.           ....:.:. ..:..  ..: ..                        \\n                      .::::::.:..+:....:..-=:-:.  ..:..::.         ..=------::...:..:=-..          ........::-:..  ..::.:.                       \\n            .    .    :::----:::::=::....+:=-:-..-::-::-...     .  .:-==++++++-:.-::-+-...        .::.... .:==::.....:--+:.. .     .             \\n           ....  ..  .:-=-=+==---:-:=:::..::::-:..:-:::::::....=.:..::--=+XXX-=-:-:-:=--::..      :.::..:::-++--::...::==-:.:..   ....+.         \\n           ...-.:.. ...:-==--=+--:-::::..::.:--:..:=:-+-:---::--:::+:-==++X:XX+-==--:--==-::....  ..::::-++==++:-::..:-==-:::..  .....+=. .      \\n          -..:::::::--::--==--++=+==--::::::-=-:: =-=-- --=+=+++=++-==++XXXXX- X+==+-----==::..:-.::--=+.++=++XX++=-:-======:--::.:.-...:...     \\n      ......:=:--=----=- -=-===XX+XX+=----.-+=-:-==-+==-.-=+=====-+ X+XXXXXXX:XXX+========++=------+++XXX+.+X=XXX.XX+======+++---:::-.:.=..:.... \\n    .......::::-=:===++ ==++=++XXXXXX:++++++=====++=+X++:=++=====++XXXXXXXXXXXXX+X++-===++XXX++=+==+X++XX++X-XXXX-XXX+==+++=+X:===-+-:::=..::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                             . ..                                                                                \\n                                                                ......                                                                           \\n                                                                  ..::.                                                                          \\n                                                                     :       .                       .         .                                 \\n                                              ...                    :      ....+:                  . .        ..                                \\n                                     .       .:.   .... .           .:. ....  .   ...:.             ..-:..    ..                                 \\n                          . .        ..- ...=.:       ..:.         .:-::::..=..    .:-.             ......   .:.    :..                          \\n                      ....::. .. -.......=: :::.    ...-..         .- --+::::---.. ..:..            .  .. +..::.    ...:.                        \\n                  .  .:::::-:....::-........---:-...::..:.      ....:--=--===+=:....:-....         ..   .. .:-:..    ..::.    .                  \\n                  .  .:::--:--::=:::::.   ..::-: ..::-....: ..:......:--===+=X=-::.---::-..       ..:....::.==-::..  :---...  .   .-.            \\n           ..      ...::-:-:--::-::-::.  ....::-...----:::::.:=:::-:::-====+XX+=--:::=--::.        .::::-=== =+=::....:=-:..-.    ....           \\n           .+...... :::::-----=.--:-::...=..:=:...:---::.:--==+--=+:--+:+XXXXXXX=-==:+:---:::...:...-:--++===+XX=-::::=----:::...:......  .      \\n         .....:=:- :::-:::-+--++===+=-::-.::-=:::-=+=--:.::-==+-:=++ +XXXXXXXXX++==+=-=+--=--::::::---+++==++XX-X+=+ ==---===--::.+....=....     \\n     .=....:.::.==--:-==--====XX XXX++=++=== ==--==+X+==---------==+XXXXXXXXXXXX++==== =+==++-=.=-=+++:=++=++XXXXXXXXX+=====++---:-::..:...:.... \\n     ......:::--=++= ====-===++XX-X XXXXX:X+====-==+XX:+++========+XXXXXXXXXXXXXXX++=++XX +++++=+++X:X+XX.++XXXXX .XX+++=:+++X+=.---::::...:=:...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .:    .                                                                            \\n                                                               .  ....                                                                           \\n                                                                                                                                                 \\n                                              :.                              ...                                                                \\n                                              .                        .      ..:.  .                                                            \\n                                              .                      ..:..    ..   .::               ..        .                                 \\n                            .        ..      .:.       ..:          .:...... .:..   ..               :..      ..                                 \\n                       ..-:::      .:...    .:=:.    .. :.        ..::=.:: :::=:.    .                .=.     ..       .                         \\n                     ......:..  ..:-..  ..  .:-:..  :....     .  . .::=-------+-:......:.               .. .+.:.       ..                        \\n                     ...::......-:.::.     ..:-:....:::..    .:  ....:--=--=-=+-:.::::....          ..  .::-=-::.    :....                       \\n                    ..:::.:.::..:..::..  ....--=....=::=:.:...-..:-:.::==--=+++--::---:....         ...::-:--=+:..   .:.:..       .              \\n               .....:: ..:-::--:+:.:-.. .:=..:-..=.--:....::-+-::=-:-.-=++==+XX+=-=-::-::...   ...  :.::-=-=++X=-:..:::-::.:.......              \\n           ....::.........---====--=-::.:=:.:--=::-=.::....::--::==== XX +-++XX++==.-=-:. :::-..:...:-- =-.==+X++------------:.....   .. ..      \\n       .....+.-:::::::-:::+--=X++ ++=====+==---:--=X+=-::.::::--:--=+XXXXXX++X++-====--==:--==--=:-=-=+==+-==+X.XX++++:=----=-::..:.. ....=..    \\n     . .. ...::+-==------:--==XXXXXXXXXXXX+=------+++X+===--=-----==+XX-XXXXXX:-++==+=++=--==++=++XX++==++==++XXXX:X++++=-===+=--:+::.....=-.... \\n     ......::--==.+++=+===.=++XXXXXXXXXXXX=++=.=--=+++X+++==+=====+X-X-XXXXXXX X+++++++++++===:==:++XX+XXX++XXXXXXXX.+++++XX+XX+=-=-:::+:::.:.:..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .    ..                                                                            \\n                                                              .                                                                                  \\n                                             ..                                                                                                  \\n                                                                               .                                                                 \\n                                                                     ..       .:. ...                                                            \\n                                              ...                    ......    ..                    .                                           \\n                             .      ..         :.                    .  ..:.  .::                    :.                                          \\n                         +...       .        ..:.     . .            .. .:.:..:=:.    .              .         .                                 \\n                          ..      ..:        .::    ...       .   ..::-::::.:.:=-. ... ..               ...::...                                 \\n                        .:....  ..+.:      .  ::.  .::..      .  ..::.::::==::--:..:..   .           .  .::-:-:.         .                       \\n                    . ...........  .-..   ..  .:.  .-:...... ..  ....::-=-::--=-::.:::. ..           ....:+:-==..    .. ..                       \\n                 :...... .:.-:.+....-....:. ..::  .::-.. ..::-:..=::::--+=--==+==-=-:.:...=.         ...::---+=::... :::.........                \\n           .. ...-  ......::==----:-::.::=::+:-:.::-:.... ...-:::---=+==+:====+++++=:: . ...:: .-.  .=.::--=-+=--::::::=-.:::.                   \\n         .......:......:..:--X+==:=+=:--=-=-:::--==+=--:....::-:.::-=XXXX++++X+===-:-::-:::.-:::-:=::-=------==++==-=+==-::+::..  ..     ..      \\n        +:......:-- ::-::::--+XXXXX++===--=-=-::-+++++==--::::::::-=+XXXXXXXX++==-==-----::--=++++++===--=---==+X++++====----=-:..... .........  \\n      .....:::::-=+==-+=+--==+X-XXXXX+=X+==--=---==+XX+==+--------=++X+XXXXX+XX++=-==++==------=++++X+=+++==++XXXX=X++==+===:+== :--:............\\n    .......:--.-====++.X+=++XXXXXXXXXXXXX+==---.===X+.+X+X++=.++++=XXX.XXXX+XX=X++++ +XX+X+==--====+XX+XXX XXXX XXX X+=+X++++++===-=-: :::=::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                   .                                                                             \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                .                                                                \\n                                                                               ..                                                                \\n                                               ..                    .....    ....                                                               \\n                                    .          ..                       ..:   .::.                   .                                           \\n                                    .          .:     .                 ....  .:-.                   ..                                          \\n                                    .         ::.                  .=.:..::.. .-=.   ..                  ..  -..                                 \\n                                  ..:         .:    :..=          .: :-::+:::.:-::-... ..               ..:-:-:.                                 \\n                            .   . ..::    ..  .:   .-:..      .  ..+..::--:::--:::=:..   .           .. ..=::=-.         .                       \\n                    .......::...  ..:.=. ..   .:   .:..........  .-...::-+-:--=--:-:::.  ..           .=..: :=-..    ..:..                       \\n                .       .:.:=::=:..::....::..::: ...:..   ..+::.::.:-:--==:--== ++==:.:...... :...    ...:=:-=-::.:.:::-:.-...                   \\n              ....   .. ...:=+--=--=--:::---:::::::--.... ..:::::::-+X+===--==+===:-:: :...:-:::... ..::::-:-===---:::-- ::::.           .       \\n          .......:....::..::-XX+:+++=---------::=++===--:..-::.:.::-=XXXX+.++++=----.::::::+--===---:---:::::==+=======--::+:::.. ..     ..      \\n        =.....+::--:::=::+:-=+XXXXXX+=-=::-:-=:--==+X+==--::.:=:::-=+X=XXXX+X+==--=--=- -.::--==XX+==+===---+==+++:-=====--.-=-::.:.. ...-....=  \\n     ....=.::+::---===X==-===XXXXXXXX+=X+---------=++++==++---==+=++XXXXXXXXXXX++====++==-------===+X+==+++++XXXXXX+=+=++====+=-=-=-::..-.::.... \\n     .... .:.---=:====+X++.+XXXXXXX+.+++++=-- -==++XX++X+XX+++XXXXXXXXXXXX+=+XX.++++=XXXXX+==--=-==++X.XXXXX XX= XXXX++.X+++ += =--=-::::::::.-..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 .                                                               \\n                                                                                 .                                                               \\n                                                                                                                                                 \\n                                                .                                .                                                               \\n                                    .           .                         .    ..:                                                               \\n                                                .                        .:.    ::                                                               \\n                                               .:                        .+.    ::                                                               \\n                                    ..        ...  ..             .  .. ...= .:.::                      ..   .:.                                 \\n                                    .:         ..  .:..           ....:..::..-.:..:..                    ..:::+                                  \\n                                   ..:         ..   .:.           ... .. :-..::..::.     .            .   ...:.          .                       \\n                         .::.       :.       . :    . ..      .    ...+::--:.:----+....  .            .   ...::        ..                        \\n                         ..-:..... .-.....-..::... .::.    .:..::..::----.:.:--+-=+:.::.  ..  .:         ...-::...  ....:+..                     \\n                .     .. ..:=-:--: :-:....:----....:::..   :.:.....:-=++=-:::----:=:.. :...::..-..   . ...::- -+::::::=:.....+                   \\n                ...........:=X=++++==-:..::::=:-+=--:-::.....+..=.:-X.++X+=-===-:--:....:.:: :-=-:-:.-::..::---------.::.:.....  ..      .       \\n           ......-:::=-:.::-=+XXXXX++--::..::-:==-==+=--:::...:..:-++XXXX++++=--::-:::::.:..::-++=---+---::::--==.==-----::::+:..::.    .....    \\n        ......-::::--==-:-=-=+XX=XX+=--=-:::::::-=:=++=--:=:.:-====+XX:X-XXXX+==----+=.--: ::::====++==-----+=+++++++==------.:----:. . ......   \\n     ...:..:::::-----==+===++XX XXXX+=+==--:::---=++X+X++==--=++XX X++XXXXXXXXX+++=+XXX++=--:::--==-= ++++ XXXXXXXX:+++X+ ===----=--.:::..::..:  \\n     .....:::--===--==+XX++XXXXXXXXX+++===------==+X+++XXXX:++XXXXXX+++++++=+XXXXX+++XXX-+X+= ----=.=+XXXXXXXXXXXXXX++XXXXX+++=.---==-:--:::-... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 .                                                               \\n                                                                                 .                                                               \\n                                                                                                                                                 \\n                                                .                                .                                                               \\n                                                                                 .                                                               \\n                                                                                 :                                                               \\n                                                .                         .      .                                                               \\n                                     ..         .                         .:     :                                                               \\n                                     ..         .  .                 .    ..    ...  .                  .                                        \\n                                     ..         .                  . ....+    .. ...                       . .                                   \\n                         ..          .          .   ...            .   ..::. :...:-.     .                   .                                   \\n                         ...        ..     .. .:.    :..     .     .::.. ::.:::.::-.                         .                                   \\n                         ......... ..:    ::..:-.   .:.       ... .. :-::.....::-.-:....      .:             ....     ..                         \\n                          .:--::::..::.   .::-:.=....:.     ........:.:-=-:...::::::   .:.-....:.     . ..... ....+.=...:                        \\n                   .:..  ..:++=-=X=--:.......::=:---:::+..   ..=.:-==:-==++=:::::::.   ....::::-::::.... ..:::=.::-::....       ..               \\n                ...::-: ..:-+X+XX +==--..  ..:-==-----:-:.:  .:---++++++++++=-::..:.. .......:====--:::::...::-:--:-::.::+..::.....     +..      \\n           ..+....::--:::.:-=+XXXX++=--:.....::-=---=+--:.:....:-==+++X++=++=-::::::--:::+....-==---=--=:.:::--===+==-:-:::::::::::..   .....    \\n      :.. ......::+::-=--- ==+XX:XX+=----:-:.:::-==+=++=-:::+:-==+X:X+++X++X++==-==+X++==-:...:-=---=========++X-XXX+=+==----:+:::::......==..   \\n     ...+.::::---.::-=+XX=+X=:XXXXX+===--=--:=:-- ====X+===-=++=+XX+X++++XXXXX+X.+++++X++==-::=:-+-==++=+++XXXXXXXXX. :XX++++=-:- -==:::::::...  \\n     .....::--=====--=+XXXXXXXXXXXX-+++++X+=---=++++-+XX++++XX++XXXX+++++++=+XX=XXX+XXXXXX++=------==+XXXXXXXXXXXXXXX+XXXXXXX+=---==----::=::... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .                                                              \\n                                                                                  .                                                              \\n                                                                                  .                                                              \\n                                                                           .     .                                                               \\n                                                                   .             ..                                                              \\n                                      .              .             ..  ..        ..                                                              \\n                                                :    ..             .......  .  ..:.                                                             \\n                                     .         .-.   ..               .:. ....:.::.                                                              \\n                          .          .    ..  ..     ..      ..      +..:..  ..-::...- .                     ..=                                 \\n                          .::....:+..:      .:. .......     ...........:::::...:.:..   ..-     .             . ..:...                            \\n                   . .    .-=-:-===--:.     .:+::--=....      .:-==---:------::.....    .....-.+.:::. .    .......... .                          \\n                 ...... .=.-++==+X++=-..    .:.--:::::.:..    ..-X==-===+==-- ::....      ...-------...... :..:.::::-.+... .....                 \\n                .+..::....:-=++++X++---..  ...--.:-:--:-: ..  ..-== +X++====--:..::::........:--:::::::-:.. :::--==++-.::..........      .       \\n       .............::-::: ==+=+XX++--::::....::--==:=--:.=...:-==++:++++====-::-=X+=-=-.-:..+--+:.:-::----=--==++XXX ==-::::::...::.. ......    \\n      ....::::::-=::=-===-=+:XXXXX+=-=-:::: :..::-=+=+==-.::========++.+XXX:+X++==+==X+==--....:-:---=-=--=+:++X=XXXXXX.+====+::::-::..:+:....   \\n      .+..::::-==----:+X++++XXXXXX+== ==++=-::--=++X++X+==++X++-++==+++++XXXXXXXX++++X.X++=--::.:::-=++++++=X=XXXXX+XXX+X++XX+--::=--::::::...   \\n     ....:: --=====---=+++XX.X=XXX++=+++X+=====+XX XX+XXXXXXXXXXX++= ++++X+=+XXXXXXXXX+X-XX..=-- =-==XXXXXXXXXXXXXXX+.XXXX-XXX=--------:::::.-.  \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                     .                  .                                                                        \\n                                      .          .   ..                ..                                                                        \\n                                                .:                     . .     ..                                                                \\n                                      .         .                       .:.. .. ..                                                               \\n                                                     ..        .          .. .+...     .                                                         \\n                          ..    .::..:       ..     ...        ..............:.+.   .  ..                        .                               \\n                          .:..::::---=.      ..:---:. .        .=--=-:.-::..=:-:.  .     ..     .....         .  . .-.                           \\n                  .      .:==-----+=-:.     :--:.=.-..... .   .-===::---:-:::::.           ..::-:--:.  .     .:.=.::--..      .                  \\n                 .....  ..:-=== ===.-::     .::::..:: .:.... ..:==-=+=+=-=-=::.+.:....     .:-:::.. ...+... .:.:::-=++::..   .=..                \\n        .  ..  ..-...:..::+====.++=-:+::.... .::::---=::.. ..:::-=+==-+X+===-:.:-+=--::=:: ..::.:. .:..:+::=:::--=+XX+---:...::....    ..        \\n       ..:.+....:--.::-:---=+X++++==-:::::......::==++--:..:==--=-=--==+X==++=---+-=+==--::. .:::: :-::::--+=--=+XXXXX++=---:=-:.:....=....      \\n       .. ..::::-=-::=++==+XX.XX+X+----==.--::.:-=+X+X+===-=X+===----== XXXX++++==++++++==-:....:::.==-=--==XXX=XXXX-X:++==-++=:::--:::::....=   \\n      ...:.-::-====-.-=++:+XXXXXX+==-==++=----- =XXXXXXXXXXXXX++=---:==+X.XX.+XXXXXX+X+XX++++-:.::--=X++:X =XXXXX++.XX++X++X+++--::--:-::::.:.   \\n      .-..::.-=====-=-=+++XXXXXXXX+:+++XX+=+===+XXXXXXXXXXXXXXX+======++XXX++XX XX.XXXXXX=++X=--====+XXXXXX+XX+X X++++XXXXXX++=--- ---- :::.: .. \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                          ..                                                                     \\n                                                                           .                                                                     \\n                                .     .                                     ..                                                                   \\n                                  ... :              ..          .........   .:.:.                                                               \\n                          .:..+....-:.        .:::-:.         .:-:--=:.+....  ..                    .             .:...                          \\n                         .:==-::::-=::      .:::..... .      .:==--:--::.-::....            .-.-:::.          ... .::-:.                         \\n                  .     ..--=-------:..   ..::....:::.-. ......==--:--=-:=-+.+.......      .:-:....-       . .....:-==-:.                        \\n                 .:......::-==--==--:..........::::=---.. ..:==--==---=-----...:=-+--:......:....  ..  ........::--=++=-:.....:..                \\n          .....-.:::::::::-==+==--:-:.:.:... ...::-++=--:...:=---.-=---+=-==-::+==----.:-::....::..-:....::==::--=+X++=-::::+:-:....   -..       \\n        .......::-=-:=+=--++X++==-=-::-==::::.:.:-+XX+==---+==--=::::--+X=====--====-=+:--... ....:-=-:-::-=++++++XX++==.----==-::-:...=...      \\n        ..:.::::------====+XX+X.++=---.==-:-::.:-=XXXXXXXX+++=- --:::--+XXXX+++.==++++++==-=-:....--++:===+XXX++XX+++X++==-===--:::::::::....    \\n       ....::---------==+=+X+++XX+=====+++==-:--=+XXXX+XXXX-++==--::--=+XXXXXXXXXXXXXXXXX+= =-:=:-- +XXXXXXXXXXXXX++=++++++++=--::--  :::....+   \\n       ....::-=====--=-++++X++++XXXXXXXXXX+++==+XXX:X+XXXXXXXXX=--.-==+XX-+XXXXXXXX+XX+XXX+++++=+++=+XXXXXXXXXXXX+++==+.++XX++=-=--=--- ::..:. . \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                            .                                                                    \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                      ..                                     ..                                                                  \\n                                   .. .                           ...:.                                                                          \\n                          .        .:.         ......         .:=:-=-:.  .                                            .                          \\n                         .:--::..-.::.       ........ ..     :-=-::::::.-.....                ....:.             .....:.                         \\n                        .::--:=:::::..      ..-  ...:.:.    .::---:::::::--+....  ....       ..                .... ::-..                        \\n                  .... ...:--:-::-::.::..  .......--::..   ..:=.---:::--:::....:--:-=. .   .....  ..     ...:..:.:+:--- ..    ..                 \\n               +...::.=..::-==--:::::::::....  .::=+=-::.....:::--.---=----:..:--::::.:.::...-+...=-.:. ..:==:. ::- ===-::....-:..               \\n           .  .-.:-:--=--:=+X+=--=:::::---:....::-=+X+=--::.--:+:..:+:=+==---:--=--::-::-:...   ..-=:::::::-===--=+++==-:::::::::::.......       \\n         .......:: ------==++X+== ---::==-+::.:.:=+XX=X+++==--::....-:-XX+=++++========---:-:.   .:-+=---=++++ +=+X+=====-------:::........      \\n         ... .:::-:---==:===++XX+==---+++X==-:.:-=+XX=X+XXX+==-::.:+:-=XXXXXXXXXXXXXX-++==--:....:--X+XXX-XXXX-XXX+==+====-=---::::::..-=....    \\n         ..::=.-------=+-===+++XX++==+X.XX+:+---=+XX:XXXXX:++:=-:::-:==+XXXXXXXXXXXX++ X+=====--===:+XXXXXXXXXXXX+==--=++X++.=--::--=:::......   \\n      .... ::-==--=-=+X+XX+== ++XXXXXXXXXX+++++++X++:XXXXXXX+X+==---=++=XXXXXX:XXX++ ==XXXXXXXXXXX++XXXXXXXXXXXXX++====++XX:+==-= ===--:.....:.:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                    .                                 .                                                                          \\n                                    .                            .....:                                                                          \\n                                    .                         .:-:--::.                                                .                         \\n                         .::=-...  ..         ..........    .:-::....=.  . .                    .                      .                         \\n                        ..:::::.......      .    ...  .     :.:-: :.::.  .... .   . ...     . .                ... ......                        \\n                   ..   ..::=:::..........      .-=..:.     .:::-:::.::.....  .::---:.           :.        .:.+.:....:::.                        \\n                   .-....::-=--::.:....:.:.   .-.---==-.. ...:..:::::=-:.::..:--::..... =..   ...=-.     ..::.....::--+-:...   ..                \\n                 ..:---::--=X=--:.:.:.:-:-:.....:--=+X=::..=:::.=...:-+=---------::-::..::.......:-:....=.:----::-==-=--:......:::..    .        \\n              .-..:--:::-=--++=-:+::::---=::...:--=+XX+=++=--::.....::+X+++=+X+=====-.-:::::.    .:--:::-==-+-=:==+.+---:.::.::::.....- ..       \\n          .......::-::------=+++==-.--=-+X+==:..:-=+XXXX++X==-::..:::-+XXX-XX+XXXX+===+-=-:.. ..:::=X++.XX++++++++++--=--::::::-:-:. ...:...     \\n          ..:::::--::-+==-==-=+++=====++XX=++::.:-++XXX.++++==-:...:--=+XXXXXX X+XX===X+==-+--:--:-=+XXXXXXXXXX+++= ----+==--=-:::--:........    \\n          ..:---=---==X+++=-===+XX++==+XXX===.===+++ +XX++====+--::--=+XXXXXXXXXX++.==+X-XXX+++===-=XXXXXXXXXXXXX+=----=+X++=-----==-::........  \\n      ....=:--======+XX+X+=----=+.XX+.XXXXX+=+=++X+=+XX XX+==--=---=+XXXX-X=XXXX++===.=+XXXXX.X.++++XXXXXXXXXXXXX-+++=++X XX++==++===-:..........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      ..                                                                         \\n                                                                :::::..                                                                          \\n                            ....    .           -=......     .::..:...+                                                                          \\n                        ..::....   ..           .:    ..    .--:::.+...    ..                 .. .             ..      .                         \\n                    .   ...:..-...   .. ..      .=.. ..     .:=:::::.:.  ...    .:::..          .:         .. .     ....                         \\n                    .   ..:--::...:...::..:    .:-:..-:...  ....:::::-:....+..:-:.::.           .=.        .. .:....::::.                        \\n                  ..:.:..::-=--:..+....::::.  ...: --+-:.-. .......::+-::::: ---::::... ...   ..:::. .   ..::::.. ::--- -..    ..                \\n                 ..::-:::---+=-:..::..:::-:....::--=++=-:-:-:::-....:-+=-=+==++=-.-+::..:::..=  ..::.....:::-:-=-----=-:......+:...=    .        \\n               .-.:::::::--.+===--:::-=:.==-:.+.::-+XX+++++-- :.. ..:-XX++++XX++++==-=-::..    ..=:=+--:++=:=-=====:=-:::...=.::......+ ..       \\n           ......::-:--=----=++==---==-=+XX=-:..:-=+XXX+++:==--:...:--+XX:XXX+XX++=-==+-+-:=...::: +X++XX++=+++ +=+=----=:.::::-::-..... ..      \\n           .:::::-::--+=--=---+X+===-=-=+XX++=:::-=+XXX.+++===-:-..:-=+X:X:XXXXX XX===XX-++=--+-::-=+XX++:XXXXXX++=-::--====---:::--:...+ ...    \\n          ..:-----:-==X++==-.--+XX++==+X=X++==+==+XXXXX+++==----: :-=+XXXXXXXXXX+=====+XXXXX+++=---+XXXXXXXXXXXXX+=----=+X++==--=-=--:.+..=....  \\n       .+.::--==-==++XXX+=----+=+XXXXXXXXX++==+++++=XXX=XXX==------=+XXXXXXX XX.+===== +X-XXX+XX===+XXX=XX=XXX=XX+.++++XXXXX:+++++==-:.... .....-\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                       .        ......                                                                           \\n                            .                   ..    ..     ...=::..                                                                            \\n                          .+.. .               .:.    .     .:.. .=...                          :                                                \\n                        ...:.-..       .:  .   .:.   =..    ..:.....:.                .        . .                                               \\n                        ...:::..:...  .....    .:.....-:   ........-+:...    ..:.:::.          .:                    ....                        \\n                   ......-:--::.  +..  ... .   ..:::::=:......  -..:==:.:::..:=-:::. . ..      ...           ......: ::...     .                 \\n                   ..:...:-=--::...:.:+:..-::..::.---==-=-:.:.:.. ..:==----:-=+==--::..  ...    .::.    ...+:::---=:::-:..    ....               \\n                  ...:::=::-=--:--=::--::-==::..:.-+++===+=-::..  ..:-X++++++++++=--+-:..      ...:-:::-==------==----::.-... .....              \\n            ..   -..::-:: ::-=------------X=-:....-+XX++====:--:   .:=X =XXXXXX+==--=+-::::..:....-+====+===-= ===---::-::....+.....=            \\n           ..+:..::::-=--::::-++==--:::--+X+=-:..:-=+XX+=------:. ..-=+XXXXXXXX+=+=--=X==:=-=::..::+++==+++++++++=--:::==---::::.::....   ..     \\n           .:::::::--=== -:-:-=X:X==::-=++++=-=====+-XX++==-::-:..+:-=+.X+XXXXX+=-=--+XXX-X+==-:::-=XXXXXXXXXXX++=-=:::-++===-:::--::..    ..+   \\n         ..:---===-==+++=-.:::-++XX+==+XX++==-====+XXXXX+++=---::::-=+XXXXXXXX++=-:-==++XX+++=+=--=X:XXXXXXXX=X+++=-=-=+XXXXX+===--+:...   ...=  \\n      ...::.--+==++X+ +++=--.:=++XXXXXXXX+.+==++====++XXXXX+==+=-==+X:X-XXXXXXX+==--+==+XX.+=-=+==++XXX ++XXX-XXX: XX X-XXXXXX+ +=--+:...:......=\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                       .                                                                                         \\n                                        .      ..      .      ........                                                                           \\n                          ..                   .       .    ..   ..:..                         :.                                                \\n                          ....           .  ..        ..      +...-=..                        ..                                                 \\n                         .......   ..  .       ..     .-. ..  ....--:.. .     ..: :...                                                           \\n                   .. .   .:::..   .  :    .+...::. ..:-:.........::-........:-=-::-.. .       ..            -... :.....                         \\n                    ..=...--::-=.....=+....-:..:.....:----:.:...  ..:=-:::::--=-==--:.         ...     ......:.:--.......                        \\n                   ...:...:--=:..:::-...:::+-...:.:--=-----:::.   ..:+X+==++ ++== -=-:...       ...:-..---:--:.:---:::=:..     .                 \\n                  ...-::..::-=:+::=::::::=-+-:....-+X+===----:..   .-+ XXXXX++X==-:-=-::.....   ..-=---=---::::---- :=::.:..   .....             \\n           . ......:::--:.::.-+=--+:..:::-=+--::.:-=X++==----:::...:-=+XXXXX+++=-=-:-==---:.+.  .:=+X=:===-.-===--::: :-:::-:........            \\n           ...:::.::-=---::::-=X+=--::::-==+=--==--+XX++=--=:::....:-=+XXXXX+=+---:--XX-XX+=-::..:-=++++++--XX+=--:..-:-==---:-::-:=..     .     \\n          ..::----:-=-== -::.:=+=++=---===+= --===+XX+++===X---:..:-=+XXXXXX+==--::--=+X++==-=-::-=+XX+XX+X XXX+==-:::-=X++++=----:::..    .+.   \\n       ...:: -----=====+=-::::-=++X++++XXX+=--==+=+:++XX:+++ ==-:--=+=XX=XXXX++==-:-==+X++==--==--+XXXX+=++XXX XX+++++XXXX ++====-.--...  +....  \\n    ...-.:: ----:===.+==X+=-===++X.XXXXX++X+XX+=-==-==+XXXX++====+XX=X XXXX+XXX+======XXX++=-=-===++XXXX++X XXXX+XXX=XXXXX ++++===-:--:..........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                        .                                                                                        \\n                                                                  .                                                                              \\n                                               .               ..::                                                                              \\n                                             .         ..        ::.                           .                                                 \\n                           . .     .        ..         .:        ::.                                                                             \\n                          +...        .     .:..       .:       .:::.       .. ::...:..       .                                                  \\n                          ::..              :....    ..::.:..   ..:-::..    .:: --:.:.         .                .                                \\n                     =....-::....   .      :-::.   ..::.::-.::.   .:--::.:-::-----+-..        ..       ..    .....:.   .                         \\n                     .... ::-.:....:.. . ..:=:.:..::::::..::-..   ..=+=--=+X+--=--==:...      .   ...... :::.. ... ::.....                       \\n                   .-... ..:-=:...:::......--:=..:=++=--:::::.    ..=XX++XX++===:----::..       ..-::.--:........::::-:.. .                      \\n                .....-::-...:-+:::::..-...:--::-::==++=--:.::......:-=+XX-++==-=-:::-+-::-:.:. ..:+X+==---:-::-::::.:::............              \\n             .. .:..---:::...:=+--::...:.:-=-::-==-=+++==-:-=::....:-=XX:X++=-=-::-:=X+=++=-:....:-=========++=-:. ...:-:::::::.:: ..            \\n           .::-:.:::--=--::..:-=+=--:+:----=-=::-+XX.X+==---=-- ..:-+XXXXX++=--:..:--+X+==----:..:-+:+++++++=X+---:..::=X====-::.:::.            \\n         ..:::-:::- ---+=:...:--=++=+=.==++=-:---++X+X+===-=--=:::-+XXX==XXX+=-- ::--=+:+==-:-=:-=+XXXX+=++++XX++== ==++.X+=----:::::.           \\n     ..+...::-----------+=::--=+X+++++==:++====----===X+=+=+=+==-=XXXXXXXXXXXX+===+==+XX+==-:-=-=+++XXX+=:++XXXXXX+X-X+++++=+=---:::+:.........  \\n    .....::::-----------=++==+:XXXX-X.XXXX+X+=-::-:--==XX+X+XX+ ++XX+:+XXXXX-X:+++++.+XXXX=--=.====+XXXX++XXXXXXXXXXXXXX+XX++==--::::--...::.....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                        .                                                                                        \\n                                                                .:                                                                               \\n                                                        .       :.                                                                               \\n                                             .          .      .. .                                                                              \\n                                             .          .       ..                                                                               \\n                          ..                ...        ..       .:.            .::-                                                              \\n                          :..               .:.        ......:   .::.       ...::-:.                                                             \\n                          ::..     ..       .-.    . .   .....   ..:::.. ---:: =---:.                              ..                            \\n                     .   ..:::. .  .      ..:-.. .:..:........    .:----=+-+=----::-:.       .          .....   .  ..:.                          \\n                    .. ....::-:. .....    ..::-:.-====-:.:....    .:+X+=:++=-----:--:..          .:.:.::....   ..  .:..                          \\n                  .. :.. ....--:..:  ..   .::..:-=--===::..:::  .=.:==X+X+==--- -:.:-:...-:    .:-++==--:.:..::........ .     . ..               \\n                 ..::-::...:.:--:.....:. ..: ::.:-=.===-=-::--:.=.:-=+XXXX+=- -+:::-+=--+-::.  .:--=-=-----=+=-:.. .=.::..- .....+.              \\n           ...::....::--:+....:--:::::.::+::::..:-+XX+=-:-::--::..:+XXXXX=+=--::..:-=++==-::.:...:-=+=+=====++=::.....:==-:-::.......            \\n          ....:..::::::--:....:-=---===:--==-:+::=++X++-:-:-:=--::=XXXXX++++=-:::=-:-=++=--::-=::=+XX+X+=-==+X+==-----=++==-:::::.....           \\n       ....-::::::::::::=-..:-==X++=====-==---.::-=+=X+--- -==--:-+ ++XX+X+X+=---==-=+XX==-::-=--=++XXX+==+=+XXXXXX++++==+=--::::...:.     ...   \\n     ...-..::::----:::-:-=---=+XX-XX++++====+-:..: ---++=-+=+====+X++=++XXXXXX+===+++X=++=-::--=-==-+X++=+-+XXXXXXXXX++++ +=+=-::.:..:.-...-...  \\n    -.....::----==-------=== +XXXXXXXXXX++-++-::.::====XX++++==+++XX ++++XX X XXXXXX++++++=--==+==-+++XXXXXXXXXXXXXXX++-XXX+++=--:::: :.:-::::.:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                :                                                                                \\n                                                               .                                                                                 \\n                                                                                                                                                 \\n                                             .           .    ...               ..                                                               \\n                          .                 ...         .       :.               ::.                                                             \\n                          ..                 ..              . ....     .::.:..:-.:..                                                            \\n                          .:...             .:.              .  .  +..=::===--::-:..                                                             \\n                          ..::.             .::.........  .  .   ..:--:--X+=-::::- ..                                                            \\n                    ..     ..:.      .     .-...:===--:.... .:   ..-XX+====:-::::::..            ... :...:.                                      \\n                    .:.:.   .::.  ..  .    .....-==:- -:...:.:....:-+X++++=----::..-:...:..    .-=+=--:..::::...    ..           .               \\n                    .:::...  .::. ..   ..  ::....--+=--::: ..-:...:=+:++X++=-+:::::-=-::.-...  .---=----::-+=::..   ....         ..              \\n               ..  ...::..    :: .=.::...........:=+X+=-:.:..--:::-+XXXX+===-::..:--+X=--::... ..:-+==+=---==--::.....:+:....+  ....             \\n          ...... ..:.:.::.   .:----::-=:.:=:::::.-=+X=-:. .::::..:-+=XXX+==-::.=.--:-++=--::.::.:-=++ X=----=+=--:::+-==-:::.+..   .             \\n         ..............:-....:--=++=---==---:::::--=X=-:.:::---:::-X+++XX+==-::::==-=++==-:.:- --==+X++=---==XX++XX+==-==--=:::...  .            \\n      .-....:-:-:-::+::::-::--=+XX++=======-=::..:---+=--:==-----.+X+==+XX+X+=--===.XX:==::..:-=-===X+==-= =+XXXXXXXX+==+==+--:........   ....   \\n     .... ::: . ------:=::--=+XXXXX-X++X==---:....:-=+++=-==-----++X+==++XXXXXXXXXXX++++=-::.:-=--==+XX+=++++XXXXXXXX++XX+:++=--:.:......:::.... \\n     ......::--======.----==+XXXX-XXXXX-====--:::::===+XX ++====+++X++XX++-+X=XX+XXX+:++X+=- -=.====+XX:XX+XXXXXXXXXX++++.XXX+==--::::::::::::.+.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                .                                                                                \\n                                                               .                                                                                 \\n                                              .                                                                                                  \\n                                                                                                                                                 \\n                                                              ..                ..+                                                              \\n                                              .               . .       .::.::..::                                                               \\n                           .                  .               :.      ..:--=-:::..                                                               \\n                           ..                 .               .    ..-..:--=-:::::.                                                              \\n                            .                ..  .....-.      .   .-::+::--=:::.:..                                                              \\n                     .      ..                 .:-=--:...... .:...-=XX+=-==-:.:+:..     ..         :+......                                      \\n                     ..      ..        .     ..:-:==-:::.  .. :..:-=++======-:.:. ....:        :--=-::.-..::.      .                             \\n                     ....     :.   ..=     .....:--==--:... ..:..::-+++=====-...:::--:..       .-:=--:-=-:--:::..                                \\n                    ....      ::....+:.    .. ...:-+==-..... ..:..:-++++==--:...:--=X+=-::. .. ..--=---=----.:::.  -....:..                      \\n           .           ..    ..::==::.::=........:=++=-...  .:....-+XXX+=--:....:---== =-:....:..:-+===-::-:--.:.:::::-=::+..                    \\n           .........   .:.  ..::-===-:::-=--:..:.--++--:..:.::::.:=+X++X+---:...:=--===:--..::--:-=++=---::-=X=-=++======--:..:.                 \\n       .......::.:.::...::..:-===-++=-:===---:..:.:-=+-::.--:.:::-=++==+X===--::-==++X+=-....:----=.++-::.-==XX+X++XX+=====-::....:              \\n       ....::::::-:::-:.::--+XXXXXX++==+=--:-...:.::-=X=-::-:::::-==+===++XX++==X++X+-++-:..=.------++=======+XX.XXXX++++==--=::.:.  ....:.....  \\n       ...:.:::-==- -=.::--=+XXXXXXXX+++:---:. .::=-:-+X+=-----:=.====++++XXXX+++.X++==++=:::-= --==+XXXX.+++XXX:XXX-XX++++=++=-:- .....::::.... \\n     ......::--==+.==+=--=++XXXXXXXXXXX==---::: ==X+===+XX++==+++.==++++XX+=+.XX++:+==++XX+=-=+=.===++XXXXX-X.XX=XX++==-++X+XX+==.-::: ::-:::=...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .          .. ..- ....                                                             \\n                                                                         .::-:::. .                                                              \\n                                                              .        :..::-:..                                                                 \\n                                                             ..    .......::.::...                                                               \\n                                                   ....       .. ..::==--::-:....                                                                \\n                                               .:---.-..      ...-=+:+==-::::..+..                 ..    ..                                      \\n                             .                 :::=-::...     .=.---+==----+:..:.  ..          ::=-:....::..  .                                  \\n                      .      . .      .        .:--=--::      .-..--=+===---:..::.::..         :::=-:.::-::....                                  \\n                       .      ....=    .    .   ..-=--:.       . .:-=X+==--:.. .:-=+++=-..     .:=:--:.:::::.. .      .                          \\n                               ..:--:=.....=.  .-.== -:..   -... .-=+XX=--::.   :-+===--:.. .-. ..-==--::.:=:...-.::::-::..                      \\n             .         .    ...::-----.. :--. +..:====-..:..:.+..:-==+X=-:::..=.:=--==--:...::-:: +===-::..:--:: =---==--:.-..                   \\n           ........... .=...::---==--:::=-:-:.....:-+=-:..::.....:==++.+=---::.:==-++X=-:. ..-::-:=++=-=:::-++======X= =--::.....                \\n        +:........::::..-.:=XXX+XXX=--::--:=:. .=..:-++--..::...:---====+==+--:=:=+ +++=:.   .-----=X+==----==X++++=+++==--:::::...    .....     \\n        .=.:=::::=-:--::.:-=+XXXXX=+==--:::..  .:.:--=+X=-::::.------==+XXXX++==+ ====++-:...-=:-=--=XX++====+XXXX+++X+++==-==-:::.. ....::....  \\n       ....::.--==--=-----=+XXXXX-X++=+--:::::..--=X+-=+X+====--=--===++XXXXXX++=-++= =++=: :-----==++XX+=++XXXXXXX++ ++=+++++=-- ::...:::::.=.  \\n     ......::-===+=+++===++XXXXXXXXX+++===-:::.-=+XX+==+XXX===:+X==+XX+XXXXX+XX++======++X+=---== ++-=+XXXXXXXXXXXX++==+.+XXXX+=+==--::--::::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .               .... .                                                             \\n                                                                         ..:--::..                                                               \\n                                                                        ....::..                                                                 \\n                                                             ..      .  ..-:...                                                                  \\n                                                             ...  ..:--:--:.::: .                                                                \\n                                               .::::.. .      ...:---+=--:..... .                        .                                       \\n                                              .::-+-....      ...==++=----::....               .--:.. . ..                                       \\n                                              .-::---:..       ..:--==.---::..::=.....        .=.--:..=.::=..                                    \\n                               ..       .       .::--::.       . .:-=+==--::=.. ::--:-::.      .:::-:....::..                                    \\n                                ..::.   ..  .   .:-=--...        .:-=X+=--::.  .:-:++=--..  .   .::--:::..::.      ...=...                       \\n                               ..:::-:.:..::-. ..:+=--:.-. ..    .-==X+=-::..  .::====--:... ::.::==--::..:::....::::-=-:..                      \\n                   ..  ........::-=---:.:-:::.  .:-=+--:..:+.....: ==+X=-:: ....=--==+=-:=....::--+==-::..::=--:-::-=+--::....                   \\n           .....+.::... ..:-== =-==--:..:::-:.  ...:=+-::.....  :-=-=.=+=--+.::-=--++X=-:.   .:----+X=-:+:---++====.++==--:..:::..      .        \\n         ........:-:::...:-+X XXXXX+--: :::..  .-.::-=X=-:..:..---:--==+X++.=----:== ++-:.   .-:-:--+X++=---=++++++==++++--: :-::..   ......     \\n        .=..:::-:------..:-+XXXXXXX+==-::....  ..:-=+=++==---::.--:-=:=+.XXX++==-===--++-:..:-::----=+X+==-==XXXXX+=++ ++==--==::::. ...+:.....  \\n       ....::-:-== ==-=--==+XXXXXX-+++=--::.:..:--+X+.==++=======- -=+++XXXXXXX+=======++=-::-:--.==++.X+=++XXXXXX++=+++=X+-++=-=--::..:::::...  \\n      .....::-=-=+=++++++++XXXXXXXX++X+ +=--::--=+XX+==+XX+===.=+=++XX.++++XXXXX+====:==+X+= --==-+X==++XXXXXXXXXX++==.++:XXXX++===--.:--::::-.. \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 ...                                                             \\n                                                                         ......::..                                                              \\n                                                                           .:..=                                                                 \\n                                                                            ..                                                                   \\n                                                              .      ...... ..                                                                   \\n                                                              ....=..--:+:. . ..                                                                 \\n                                              .:--:..          ..-=--=-:.... .                          .                                        \\n                                              ..::--:.         .---==--:: .. .:               .:-::..                                            \\n                                               ..:--.:         ..---=-=--::....-=....         . .:::....:..                                      \\n                                                .:--::.          .:-===-:::=.. ..:-::-:..      ..:::- .....                                      \\n                                  ..-     .  .  ..==-:...        ..-=+=-:-...  ..==++-::.   .   ::-::..-...         .....                        \\n                                 .::::     ..   .:+=-::.  ..     .-=++=-:...   .:---=-::+......:.:X--:..:.....= ....:--::.                       \\n                         .........-::::..:+::.. ..-==::.-..     .:===++=- ...  :-:--==-::...  .::-+==::...::-:..-..:----:..                      \\n                  .:.=. ..:--+=-----:::....:.    .::=+-.=.      ::::--+=-:: ..:-::-==+-:.     :.::-++= --::-+X=-=----=---:.. ....                \\n          .-...  .:::: ..:=+XX++==+=:.:.....     ..:-++::::.-.  .:::--=XX==-::::.:--+X-:.    .:.: :-=X=--:::-=+= ==--==+--:.-..::..   ...=.      \\n         ........::=-::..:-++XX++-+=--:.-.       .:-++++-:.:--..::::--=+XXX+=--::-+--==-:. .::.::: :-=+--::-=+X+-+==:==+=-::::-::...  . ....     \\n        .+..::::-:---:-:::-+ XXXX++==+-::...=. .::-+X ===-::::-------==++X.XX+==--=---=+=:..:..::::--==+=--+XXXXX+=====++=-==----::...:.::.:.    \\n         .:.::--=====++====XXXXXXX+==+==+=-:::::-==++==++==--=::--==++==+XXX-XX++.======X+-::.::=-=++==++++XXXXXXX+==-=+=++ ++==----::::::::.=.  \\n     ..  ..::-===+==++XX+XXXXXXXXX++=++X+X+=-=== +=++=++XX:==---=+++++++=+++XXXX++=====-+XX==-===-+X==++XXXXXXXXXX+=-==++X+X+-+===+=-----::....  \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .:.                                                            \\n                                                                                                                                                 \\n                                                                            ...=.                                                                \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                    .:....                                                                       \\n                                                                 .-..::...                                                                       \\n                                              .:---::.         .:-=--:=....  ..                 .                                                \\n                                                .:=::.         ::.:=-- ::.-.                 ..::-:..                                            \\n                                                ..-:..          .-::=--:....    ..:...          ..-... .                                         \\n                                                ..=::.           .::---::....    :--::..       ...-:... .                                        \\n                                    ..          ..+-:..           .-=--::.      :--+-:...      .::+:......            ...                        \\n                                :..:.-.         ..==:..  ..      :-++==-::.    .---:=-:.=.     .::+-:..=.          .:::...                       \\n                             .:::..:....   ...   .-==-. .       .::-=+=--:.   .:: :-=--...    ..::=+--::...:........:::-:.                       \\n                   .......::::+-:.::....   .      ::==:..:      .::--=X=-::...::.::-==-:.     ...:-=+=---::-+==-:::::--::..    ...               \\n           .      ..-:.=.:-++++=--+-:-..          .:-+-:......  ...::-=X+=--:...:.:=+=-:.    ...:.::==-:::+-==:----::--=-:.  ......    ..        \\n          . .  ...:: =...-==+X++===-:-....        .:=++=:...::. ..:---=+XX+=-::..::--==:.  .:... ...:=-::.::=+=====--==+-:.....:+..   ..+..      \\n          .......::::::..:-=+XX+=.=-==:::...    ..:-==+=-:.....:..:---==++XXX=-:---::-+=::. .  ..=:+:-.-::.=+XXXX====-=+=-:-:::::..   ......     \\n          ..:::------=--- =+X:X++==-== =++=:.:.:::--=:===-::....:+:-= ==++XXXX+==--===.X+-:.. ...:-=---=--=+XXX.XX+=--====+=+=----:..........    \\n      .  .=.:------==+X++++XXXX++.==-==+XX+-+-=-===-=.=+++==::::-=X++++=++XXXXXX+=--==-=+X=-::--:-=X===+=++XXXXX=X+=-=+=+XX+=====-=--:::::=...   \\n    . . ...:--======+++XXXXXXXXXX++++++XXX++===:+++==+XXX.++=---=+XXXXX+-+++XXXXX+=======+X+====++=+.++XXXXXXXXXXXX==+++XXXX++ ======---:.::..- .\\n\",\n  \"                                                                                   .                                                             \\n                                                                                   ..                                                            \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                                      ....                                                                       \\n                                                 .             ..--.......        .                                                              \\n                                              ..:==+::.        .::--+..           .  .           ..                                              \\n                                               .+.-.+.         ...:--.:.          ..          =..-:...                                           \\n                                                ..-:.           .:-:---..        . .           . .:...                                           \\n                                                 :+-.            ..:--+...      .:-::..        ..:-:.                                            \\n                                                 .==:..          ..-+--:...    .::-=-..         .:=-..                                           \\n                              .:-....            .-+-:.         ..:++--::.:.   .::----:.        ..==:::.           ....:                         \\n                             .::......           .--=:.          .:-=+--::.. .....::--:..       ..-+-::.. .. ..   ...+::..                       \\n                     ..   ...:-::....  .          .:-:.. . ..    ..:-=XX-::. ......:=--..       ..:-=:-:..:==-:::.=.-:::..                       \\n                   +..:..:-=:=+--:::....           .:==:...  ..  ...--=X+--:..  ..:==--:.         ..-:..::--=-- ::-:-::-:.     .                 \\n                  .......:--=+==-:-:::...         .:--==-..   .  ..:--=+XX+=-::...:-=+-:.  ..   . ..:-::..:--==-==::.:=-:... ..=.                \\n          .........:....::=:=X+=-----:--:.:.     ..:-=.=:.-.   -...:--==+XXX=-::--::+=+-:.       .:::+:...:-=X++X=----==-:::::..-.    ..+.       \\n          .+..:::::-::::.:-=+X+==-:----+==+=:+..::=--==---::. ..:-=:--==:++XX-=-:--==-=X=:.     .:--::-:::-=+=XXX++=--=======- :::....=:...      \\n         .. :--:-:--==+++=+X+X+==-- :--=+XX=-:---=--= ====--...::-+==+XX++XXX:X=--::- -=+=:..:-:::-==--=-==+XXX:++=+-===+XX==.-----::::=...:     \\n      .  ..+:----=--==+++=XXXXX+==++===-+++=---=+==-+XXXXX+=-::--==+ XX+XXXXXXX++=---=--=++-::--==-=X=:+++XXXXXXXX++-== +X-X++=---- -:::+::..    \\n     .  ..:::--=++= =+=+=XX+XXX:X++XX++++++==++X++==+XXXX-X++=-==++XXXX:X X-XXXXXX+=+===+-++==+-===+X+X:XXXXXXXX.X+===+XX++XXX+==.--=--:::+:+....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .                                                              \\n                                                .-:.          .:----:..                                                                          \\n                                               .:--:=..       ...::=-:..                        .:.                                              \\n                                               . ::..            .:--::.                       .....                                             \\n                                                .-=:.           ..:--::.         .             ..::.                                             \\n                                                 :=:..           ..==::.       .:--::.          .:-:..                                           \\n                               ...               .-=:.          :..++-:..  .   .:.:-::.          .-:..                                           \\n                               ...                :=:.           ..=+-::... .  ...::--:          .--:+..            ..                           \\n                              ...=...             .::.           ..--+==-.. .:. ..::-::.          :-::..  .     .   ....                         \\n                          .. ::-.. .               .::.           .:-=++-:..     ..==::.          .::... :--::.....::.-..                        \\n                    . ...+:::--:::..=              ..---..        ..:-=++-::.    ..==-:..         ..::. .=::-:::::-.. ::..                       \\n                  . . ..::::----.::::.-.          . .- --:.       ..:--=++=-:....+.-=+-..         ...:. ..::-----+-:.:-:: ....                   \\n               -...... ..:---==-::.::-:::.::.    +..:==--:..    .:=::--=+++X--:::::::=+-..       .:..:.-...:=+===+=-:.--:::......                \\n            ...::..:.:: ---=++=-::.::-++--:==:..::-:-+--:-..   ..:-::--++++ +=:..::--:=+-..   . ..:-..:::::-+X=++=--::-==-==-:=........=:.       \\n           ..:::::::--:-=-++X+=--:::::--=====-::-= --=--=-:.  ..:-=---=+.++XX+=::...-::-=:. ..:::.:-::=::--=+XX+====-=--=++=-+::::.. ....-       \\n           ..:=------:-=-=+X+X+=--=-----=.=--:--X--=+X+++==-:..::-==++XXXXXXXX+=-::::-:--=-.. .:-:--+--=-=++X+XX+++==---=++==---=:::=:::...+     \\n         +..::--=---===+==+++++++=-++========-=XX+==+XXXXXX+=:::--=+XXXXXXXXXXXXX+-----====-::-:-==+XXX-XXXXX.XX X+=---==+++-=------:::::..=.    \\n    ..: :..:::-==.=--=+X++++XX+-XXXXXX+:==++++XX+++=+XXXXXXXX=--=+XX-XXXX XXX.XX+++ ++==+XX++==-=-=+ X-XXXX+XXXXXX+==.++=++XXX=----=--::=:::: ...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..             ...... .                                                                         \\n                                                .::..         ..::=+-::.                                                                         \\n                                                .--...       .. ...-:..                         ..-                                              \\n                                               ..:-.             ..-:.+.                        .:.                                              \\n                                                 .-..-           ..=-:.          ..             ..:                                              \\n                                                  -:.            ..+-:..       .:---::.          .:..                                            \\n                                ..-               ::.            ..-+:::.        .:=::.           :...                                           \\n                                                  .-.            ..-+=--:.   .  .+.-:..           ::..                                           \\n                             . ..                  .:.            .--====:..     ..=-:.           .:+..           ...                            \\n                            ......                  ..-.           .:-==-: :      .+=:..           ...   ::- .....:.... .                        \\n                         ... .....  .               ..:::.        .:.:-===-:.   ...-+-:.            ..  .:.:-:....:...:..                        \\n                       .......::........            .:=-::       .::.::==++=:=..:..--=-.          ... .  .::-:: :--:.:-.:. ..                    \\n               . .    ..::::---:. ..:.:....--:.....::--:--:    ..:+-:-:-==++=::...:::-=:.        . ........:-+-:-=-:::::...=..                   \\n            -...-......-::--+=-:....:---.-=--=:+:-=--:-::..   . .:-::::=====+-:.  .: :--.    .. . . ....+..-++===--::::--::-:..+.                \\n            .-.::...:...::-=+=-::.-.:.:---.=--::-+-:---:-:..  . .:-=--== == ==:..   ..:--.    ..:..:......:-+++===--::::-=-:-:...   . :..        \\n            .::::::::.::--==+=--:::+ :::-----::-++==++=---:......:-+X++X+++X++=-:......--:.     ..::=-:.:--=++++==--=: :-==---:::.........       \\n           ..:::-::+:--=--====+===+==--------:-=X++ XX+++X++=-:..:-=+ XXXXXXX X++-:::: -.--:..:.:-=+X+++ +=+XX+X++==:::--= ==--.:::::..... .     \\n         ....::---.::-++===.+XX:XXXX+++--=====+++==++.XXXX++==-::-==+XXXXXXXXXXXX+=.==-==+==+--:--=+XXXXX-XX.XXXX=+=--==-==++=-:.:--:: ..:.:...  \\n     .+...::-:--===--=++=+++++XXXXXXXXX+===+X+++++=+=+XX=XX++====++XXXXXXXXXXXX=++==+=+XX-XX++=-:==++XXXXXXXXXXXXXX+==+X=++XX+=-:-=-:::: :::=..:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                ...             ..+-:....                                                                        \\n                                                 ::.          ...::-::..                                                                         \\n                                                .::.           . ..-...                          .                                               \\n                                                 ..              .-=::                          ..                                               \\n                                                  :              .:=-:..         ...             ..                                              \\n                                                  :.              .-+:::.      .::-=::.           .                                              \\n                                                   .              .:X-::-.   .. ...:...           .                                              \\n                                                   ..             .:=--:-..      ..-:.             .                                             \\n                                                    .              ::=-=--..      .+-:              .              .                             \\n                                                     ....         ...:---=-:.. .  .-=:..            .   ..::.     ..                             \\n                              .                     ..:...       .-:..:--==-.. ..+.:+-:.           ...  ...::..   .....                          \\n                           .....  .               .:::=-:.       .::...-=-==:.  ..::-=:.            ...  .:.::.:..:...:.                         \\n                        ....--:..... ..   ..-:.. :=::.::. .      :--:.:----=-:.   ...-:.     .  .      .  ..-::.:.::..::-.. .                    \\n               ..       ..::-::.   ........-:-=::==::..:..:      .:--::--=----..    ..::.     ..    .     .-=----::....::.::..                   \\n              .... ..  .:::-=-:..  ...::-:-=-:-::=-:=::..        .:-=---=====-.     . .-..      .  ..    ..-==---:.:-....::::...                 \\n             ...........::--=-:::..-::.:-::--:.:-+==--:..-...    .:-++XX++++==-:.   . .::..     ..:.=. ...:-=++- -::::..:--:-:=.. . .   .        \\n            ....::.:..:-::--=:=----:+:-=--:-:.:-++XXX+=-=+=---:...:-=+XXXX=XX+==:....+:::::. ....:=+==-::--==+XX==--:..::----::. ......=..       \\n          ....:-:::::+=----==++X++====+-:----.==+=+++X++=+==--=:.:--=+X=XXX=XXX++-:+::--=-:--:..:-+XXX+:++==+XX XX=-:-.----+=-::..::.........    \\n     ..  .. :::----:::-=--= =+XXXXXXXXX+=--===+-====++XX++=+=-----==+++XXXXXXXX+++==+=XXXX++=-::--=+X+X++X++XXXXXXX=-==+===++=-::::::::...::.... \\n     ......::-===+=-=-====++-+XXXXXXX..++==+X+======+XXX-+=+=--=+X++++XXXXXXXX++======XXXXXX++-===+++=XXXXXX=XXXXX++==-++XX+XX+= ---::::::::::. .\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..              :+:.                                                                            \\n                                                ...              .--::. .                                                                        \\n                                                 .              ..--:.                                                                           \\n                                                 ..              .--:.                                                                           \\n                                                 ..              .:=:+..                                                                         \\n                                                  .               .--...:.       .-:..                                                           \\n                                                                   :=:..:...    .::-:. .                                                         \\n                                                                   .=:. ..      . :-:.                                                           \\n                                                                   .::::::.      .:=:.                                                           \\n                                                    ..            ::-::::--:  ..  .--..                  ..                                      \\n                                                    .. .-.        .:..::+:--..  . .:+:.             .   .....                                    \\n                              .                   .:...:          ..  :.:=:::    ..:=:.              .    ....     . ..                          \\n                            ..              ..   .--::.:.        :.:. ::.:::..     .::.                   ..:..   .....                          \\n                           .:...+           ::...:=-.....:.      ..-=..::-:=::.     ..:                   .:-....... .-...                       \\n                        . ..:..          ..:-:::..-:...=..        .:--:::::=-:.       :.                  .-=::::... .:... ..                    \\n                ..      ....:::.    .+.:+:::-.:-::-:. ..          .:-=--:::--..       ...          ..     .-=-:-:.... ........                   \\n             .....   ..:..::---:+.. ..:==:::- ..:==-::.. .-.:.   ..:-=+=====--:.    . ..:..       ..:.    :--++-::....  .::..-                   \\n             ..:..-  :...::---=-::...:-+:::-:..:-++X++-::--:-::. ..-+XXXXXXXX+=-.  . ....::.    .:--=-:..::--=++-:::....:-:-:..   .              \\n            :..::......:.::-=X++==--:-++-::-::---=+++X==-----:-:..:-++X=XXXXX:+=-.-..:::::::.....=+XX+=---=--=+X++=-:: :-:-=-:..  ..    ..+.     \\n           ..+::-::..:::=:--=+XXXXX+=+X=-:--:=:---==+XX+===--::-----==XXXXXXXXX+=-+-=+X++++--:..:=-++X+=====.=+XXXX+=---=--==-:....: ........    \\n      ..  ..:=---==::-:--====+XXXXXXXX+==-=- ==+---=+XX.+==--:=--===++XXXXXXXXX+==-==+XXXXX+=--:--.++XX++++.X+XXXXX+=--=++++++=-:.:::::...+:..-. \\n      ....::--=++=+=---.==++.+XXXXXXXXX++=+==+-====:XXXX+++=--====+XX-XX:XXXXX+====:==+=XXXXX+==-=++XXX-X==XXXXXXXX++==+X=XXX++=-:::::::::.::...-\\n\",\n  \"                                                                                                                                                 \\n                                                  .              .::                                                                             \\n                                                .+.              .-::.                                                                           \\n                                                                .:--:. .                                                                         \\n                                                                ..--..                                                                           \\n                                                 .               .:-:..                                                                          \\n                                                                  .-:...::.      .:.                                                             \\n                                                                   :-.......     .--:..                                                          \\n                                                                   .-.. ..      ..:-..                                                           \\n                                                                   .:+:=..       .:-:.                                                           \\n                                                    .             ::+::..:=:      .-:..                                                          \\n                                                     .            . ..:.:::-.      :-..             .   .:..                                     \\n                                                   .:..-.          .  ..:....    .:.-.                    ....                                   \\n                            ..                   .:-:...         . .. :.::...      .-:.                   .....       .                          \\n                            ..              -.. ..-::....        ..:-..-.::+..      .:.                   .::..   .   ..                         \\n                           ..             ..:..:..-::.. ..        +:::.=.:.:::.       .                   .--:. ....  ...                        \\n                        . +....     ....:: :-:.:..-:=..           .::-:::..:-:.       :.                  .-=::::...   ..  ..                    \\n                      .. ..:::=..    ..-=:::::.:.:--...     .     .:--------::.       ..:.         ..     .--=--:.      ....-.                   \\n             . ..     ..+..=:::.... ..:+-:-::.+.:=+=--:. .:.:..  ..:=+++++++=--.      .....     :...:.   ..:-=+-::.-..  .:::..                   \\n             ..::..   ....:-==--::.=.:-=-=:::..:-=++XX=---=:-::. .:-+X+XX.XXX+=-.:. .......  .  .-++==:..=::--==--::..:..::-:..                  \\n           ..-.::... ..::::-=XX X+=---+=-::::-- -=+++X++==---::-:::-++:XXXXXX-+==:..:-=--:-:.. .:==+X+=------== +++=:::--::--:..   .... ..-.     \\n       .   ...:::-:...::-- ==+X-XXX:+++=-:---.-::-==+X+X+=---: ----==+ XXXXXXX:==---+XXXX-X=-:..:-++ X+====-=++XXX+X=::--= =-=-:..............   \\n       .. .:.--====--::---==-++XXXXXXX+==-=--==----+XXXX+==--:==--=++XX.XXX-XX++=---=+XXXX-++=-:--+++X+++ ++XX=XXX++=--+XXX+++=-:.....::.+.:..+. \\n     ......:--==+===-:--=++XX+XXXXXXXXX++++=====++== XXX-++=---===++XX+:XXXXXX+=======+XXXX++=====+XXX++XXXXXXXXXXX++==+XXXXX++=-::::::-:::.....=\\n\",\n  \"                                                                  ::..                                                                           \\n                                                                 .-:.                                                                            \\n                                                                 .::.                                                                            \\n                                                                 ..:     ..                                                                      \\n                                                                   :    .:.:      ..                                                             \\n                                                                   :..   .       .::.                                                            \\n                                                                    :.           .--..                                                           \\n                                                                   .::.  .       .::.                                                            \\n                                                    .              :. .   ..      .:.                                                            \\n                                                                   -...:...::      :..                                                           \\n                                                                      ..:   .      .:.                  ....                                     \\n                                                  .:-::. .          . ..-.         .:.                     .                                     \\n                                                  .::.              .. ..:..        ..                     ..                                    \\n                                             ...  .:....         ....:.......        ..                    :..                                   \\n                                        .:..:...: .:.             ..=:..  .....      .                    .:-...+.                               \\n                            ..        .:=::::...  .:.              .::::. .....        ..          .       .=:..                                 \\n                           .=...      .-=:....... ::..       .     .::::::--:..         ..                .:-=-:..       ...                     \\n               .         ...::.+.     .-::......::-.--:.......... .-==+==--=+=:.                  ....    ..:--:..   .  :..:.                    \\n               ..       ..::-+=-:..  ..=-::-...-==+==+-:--::-.....:++XX+:+ XX=-:.    .          .:==-=:.  ...::---.. ..:...::.                   \\n              ..:..    ..+:-+XX++=::::-=-:....:---==++===--:::::::-=+XXXXXXXX+=-:... :=:-.. .  .--==+=-::..:::-===+=:.:::::+-:.         ...      \\n        .   ....::..  .:.::=++XX++==-==- ::-::--::==++=+=--:-=: ::--=XX=XX-XX++=--:-XX+===+-....:=+=++--::----=++=.++::::---:-:.       .....     \\n        . ..::-----:..-::--==+X-X+++==--::--:-::-:-+X+=+=--::-=:::-==XX X-XXX++=+--=+XX+ ++=--..:-=++ ==--==+XXX++-+=--+++++==-:..............   \\n       ....::--====--::==++XXXXXXXXX++==-=--::-=++=X++=+.==-::-:--==+X+XXX:XX+===--=++XXXX++==----+XX+====+XXXXX=X++= =+XX+XX+=-:..:::::::..-..  \\n    .....+::--======--= XXXXXX.X-XX+XXXX+=---===+XX+=+XX.++=--===-++XXXXXX=X.-++====++XXX.X++---=++X=X=++XXXXX-XX.XX++++XXXXX+==-::===-- :::.....\\n\",\n  \"                                                                 -..                                                                             \\n                                                                  ..        .                                                                    \\n                                                                  ..       ..                                                                    \\n                                                                   .             ...                                                             \\n                                                                     .           .::                                                             \\n                                                                    .:.           :.                                                             \\n                                                                    ..:           ..                                                             \\n                                                                    ...            :                                                             \\n                                                                     .:..   .:     ..                                                            \\n                                                     ..:..             ..                                  .                                     \\n                                                  .:::..             .  .                                  .                                     \\n                                               .   ..                 ..  .                                :.                                    \\n                                         ..  ...   ..             .  ..   ..          .                    :.                                    \\n                                       .:-:...     ..              :.. .                                   .-.                                   \\n                                       .-::....                    ...-..:=:.                              .-:.                                  \\n                             .        ..::..  . . ..-..      ..    ..:....::-=:.                           .::.+..         .                     \\n                          ..:-:.       .-:. .  .::=:--:..::.+.....:-=-----::-=:..                   =..    ..::..         . .                    \\n               ..        .:-++=-..     .-:..   ::-.-:-::=-:......:=+X:X+===+X+-:.                .::--.    . .:::-:.........:                    \\n               ...     ...:=XX+==-:.:..-::..  .:--------=-:::...::-+XXXX++++X+--...  ...        .-----:......-: --+=:.......:.          .        \\n              .:...    ..::-=+++=--:.:-::..:::::--==+=---:::-..=:=:=++XXX+.++==--::=+==-::.:.  .:-+-=--:..:::.-==-==+=::.:::.:.          .       \\n          ....:::::....:::--=+X++====-::..::...:-:-+X=--=:-:-==:::--=+XXXX+X+==--:-++XX====-:....-==+=-:::--++++====-====-==--:.   . .......     \\n         ..::::-:--:::=X=== =+X++:+++--:.::.-.:-==+-+=-==-::.::::--=+X-XX++++==--:-=++XX+====-:.:-=XX=--::-=+XXX++===.=XX+==+=-:..:-::.....-.    \\n     ......::-----==--+X+=+X:XXX+++XXX==--:::.-==+XX++==++.-:: -- ==+X+XX+XX++=+=-==++.XX+=+=-:--=+++=--==+XXXXXXXX+===++X+++==:::-=-:::: :....  \\n    ...+..:::-=+=----===+++XXXX X+XXX+X+=---- ++=++X++XXXXX+=====+X+++++XX+XXX+++===+XXXXX+==---=+.++X++XXXXXXXXXXXX++++XXX++=--------::-- ::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                   .                                                             \\n                                                                      .          .-.                                                             \\n                                                                      .                                                                          \\n                                                                     .            .                                                              \\n                                                                     ..           .                                                              \\n                                                                     ..       .                                                                  \\n                                                        .:.            .                                                                         \\n                                                   .:....                                                                                        \\n                                                   ..                                                                                            \\n                                                                       .             .                     .                                     \\n                                        .:::.-..                       .                                   ..                                    \\n                                        .:..                            .:..                                .                                    \\n                                        ......    .                  .  ....::.                            .:.                                   \\n                             ..         .:.      . .:..=   .....    ...:.+..:=+.                    .       ...                                  \\n                          .::-:.        ..:     .:..=:..:--:......::-:::-+:::-:..                  ..-        ..=                                \\n                         ..--=--.       . .     .::..:..::.. .  .:=++XX+==-=-=:.                 .....        :..-:.        .                    \\n                         .:==== -::..  ....-.  .::.:-::.+::.-....:-=++XX=====--:.   ..          .::..:     . .:::---:.      .                    \\n              .  .      . .:=====-::.::++......:--+-=-:.:::......::=++XX+=+==--::.:==--:.      ..-.:-::. . ..:--------:..+:...                   \\n          .. .........-:.:::-====-=:--:.. .....:::-==-:.::::::::::--++XX+==-=+--::==+XX=--::.. .:--==-:+..::--==------=-::--:..   ..             \\n         ......::::..--=-:---=+==-===-:.. .. ..:====+-::-::..=:+:::-+XXX===+==-::-=+++X+=---::..--=+=-:...:-=.+++===-=+++=--=-:..:::.-.. ..      \\n         ...:::::---:-==--=++X+-++=+==-::.:..::-=+X++=-=--=-..::-::-=+XX+=++=+=--:-=++XX+=-=-::-:=+==-::::-=+XXXXX+===++X+=:=---::-::...:....    \\n     ......::-.---:----==++XXX XXX++:++=--:::----=++XX.++++=:::-:-==+==+XX+XX++-=-==+XX++===-::=== -======+XXXXXXXXX+==+XX++=---=::-::=-::::=..  \\n     .. ..::-=----::-:===++.XXXX-XXX=XXXX==--.====+=++XXX.X++====+.++++ +X++XXX:+=.=++XX+:++==--==+ +:XX-XX-XXXXXX:XX++XXXX++=- ::-:-::::::::..=.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                         .:                                                                                      \\n                                                                                                                                                 \\n                                                   ...                                                                                           \\n                                                                                     .                                                           \\n                                           -....                                                                                                 \\n                                         ::..                                                                                                    \\n                                         ..                              ....                               .                                    \\n                             .           ..         .                    ...:--:                                                                 \\n                           .             .          ..  ..-.::..      ......:::-:                  ..                                            \\n                           .::=.                 ..  .  .::..  -...:-:--::..... .                  .           ..:                               \\n                         .::=:--:.        .      ...... ...     .:-===+=:: :::.                  .   .       ....::.                             \\n                          .::::::..   ... ..    ...::=. .:.     .:----+++--=::-..               ...  .       ...::::..    .                      \\n                      .   .:------.......  .   .::::-:...:.     .:-==++==------::..-.--:.       ...:::.  .   .:::::--:. ..-.                     \\n               ..    :....:.:-----:....       .:-::--:.:. ... . .::-=+X+=------::+=+==+-::.     .::--:..   ..:::-:::-:-:+.....                   \\n          ......:-..:::::::---=---=---:.   .  .:=+-=-:::....-.:.:::-+X+=----- -::-++=++--:::.+..::-.-:.   .::-==++-=-====-::-::......            \\n         ...:...+::+::::::-+++ +=----::.......::-=+==-=-::-:. ...::-+++=- -=+=-:::-==++=-::-::=:.-=--::...:-++XXX++=-==++=--:::............      \\n      .. .+.:::::.::+----=XXXXXX++======:::..:--+-++.++-==--:.:---:-===++==++.=----=+X+==+--::-=-----------+XXXX:XX+====+-+=--::.:::..::::..=    \\n     ......::---::.::-- -=+X=XXXX+:++++XX+-::-=====++XXXXX+=----==:====+XXX:XX X==-=++X==-+=-::=--=-=+X++++XX-XXX:XX+==+XX+==-::::::::::::::..   \\n    ......::--==---::-==+.+++XXXXXXXXXXXXX+==++X+ ==++XXXXXX+-==.+++XX ++XX+XXXXX++=+=+X++X+=-: --=++XXXXXXXXXXXXXXX+-+XXXXX+=--::-.-::-::::.....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                          .                                                                                      \\n                                                          .                                                                                      \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                              ..                                                                                                 \\n                                         .....                                                                                                   \\n                                          .                                                                                                      \\n                                                                           .=.                                                                   \\n                                                    .         ..            ..:::                                                                \\n                                                        .:.. .       .::.  .... .:                               .                               \\n                            ....          .              ..       .:::::..       ..                              .                               \\n                         .  .....      .           . .           .-::---:..+.                                  ....                              \\n                         .........    .           .:+:   .      ..-::-----:::...      ..           . .         ..+.:.                            \\n                          .....:..              ...::...+       .::--=+=-:::::-:...:::-:           ::.        ...::-:..   .                      \\n                       ....:::::::-  . .      .:=:.::....       .::-=X+--:-::-=-==:--:-:..      ...::..       ..:-:::::......                    \\n               :.. .. -...:.:---::::.::.      ..----::::  ........:-=X=-::::.::.:==-----:.+.    .:-::.     ...: ------.--:.::. .                 \\n            ...:...:.....:-=+X+=--::.:..      .- -=-.-:..-::. . ..:=== --::-=-:..:-==+=-:..::-...=::::.. ..-====+==-----=-:::::...     . .       \\n          .......::.::.::=++XX-X+=-+--=-::. ..:-=-=+===--:::.. ::-:-=====- ===-:.::-+X=-- ::::-=:::--.:..:-+XXXXXXX+= ===--::::.............     \\n       .....:: :::..--::-==++XX:X====+++==:.=.:-==.=+XXX+=--::::-----==+XXXX-++=-::=++=.---::..::.--=++=--=+XXXXXXX++===++=--::.::...........    \\n      ....:::----::-:--.===-++XXX++X++X+X++-:-=++:===+XX-X+==--===++++++XXXXXXXX+=--==+==++=-:.-::==+XX.-XX:XXXXXXX++=++X++X+-:::::::::::..+...  \\n     .....::---===---=+XX:+++X+++XXXXXXXX++===+XX+-==+XXXXXX=+++XXX:XX.X+XX+:XXX++=++==+XXX+=--:--=+++XX:XX-+XXXXX:++=+XXX+XX+=-:-===-:::::.=....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                               ..                                                                                                \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                               :.           ..                                                                   \\n                                                                     :. .     ....                                                               \\n                                                         . .        ....          .                                                              \\n                               ..                                 ...:..          .                              .                               \\n                              .                    ..             ....=::..      .                                ..                             \\n                              .                    ..            . .:-:-:.......     :..           ..            ..:.                            \\n                         ..:  ...              .:.....          .::+:-=-::..:::+.....=:.           ..            .=.:.                           \\n                         ...::.+...           ..--:.. ..        .::--=-::....::=-:--:.:.          ...          -.....:..-. ..                    \\n                ..      ..:-=--:: ..   ..    ...--::+:.    ..    ..:-=--:.. ..:.:--::-::. .     ..::..       ....::..::..-....                   \\n                ..........:+==--.:.:..:.     .:.:-+-::.. ...     .:--=--+:::::. .:--+=-:...:.    ..::..   ..::--==--::::::.....                  \\n           :......:..:...:-+=:==+--:::+=:..  ...-==+==-:.-..   ...:---===---=-:-..:-=+-:...=.:::::::::....-=+X++++.+=--+-::......      ..        \\n          :...+....::-::-=====:++=======+-:. ..:-==+.XX++-:....:+::--==+XX++-=-::.:==+--::+......:--++=-::-++XXX.++X ==+=--::..::=:+....... .    \\n        ...+.::--:::+===+= ==+++X+=+.+==++=:.::-====+XX++==--::--==++=+XX.XX=XX+-::--==-==--.....:-=XXX +=++XXXX.+X+++++=== =::.::-::........    \\n       ....::+:-=----=+ ====+:++=+++:++++= =---+X+==++XX++====-=+XXXXX+XXX.X-XXX++--+==+X++=-:..::-++XX++XX+XXXXXX++==++++=+X=--:-:-::..:......  \\n     . ....::--=+++==+X=++=+===+++XXXXX++:==+++++XX++XXXX+++++-+X.XXXXXXXX+-XXX:++++X+=XXXX-+=-:--=++ XXXXXXXXXXXX++=-+++XXXXXX=-==---+::...:. ..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                               .         .                                                                       \\n                                                                     ..                                                                          \\n                                                                     ..                                                                          \\n                                                                   ..                                                                            \\n                                                   .                .  .                                                                         \\n                                                    .               . .:..           .                                                           \\n                                                ..  .               .--:...:. ..    =..                            ..                            \\n                          . ..                 .::...            . ..-::....-: .. .   .                              .                           \\n                         .:-::...:              --::.            ..-:-:.... .:.:...=. .            .              -....                          \\n                         .--:::::..            .:--:.            .::-:.::.. .....:-::-:.  .        ..          ........                          \\n                  .     ..:- --:--....=.       .:-+-:..           .::--:-:.....  =:::-:.. .        ..      =..:-=-:.:.....                       \\n                 .. ...... -----=--:::--..     .:-=+++-:..       ..:-----+::-:.  .::--:..   ......:::..  .:=:===--=+-::::.. ...                  \\n           .+.. :...:--:::---+==+=--==--=-.   ..:-=+XX+==:.    .::.-=-=XX++=--:.. .: -- ::..  .+.:-+X=-:.:--=++-===+==-=--:..+...::..            \\n         ......::..::=-------====:-+===-==-.. .:---=+X+==-::::: --==X=XX XXXXX=-:.:------:::.  ..::+X+ ==--=++X++=++==+=--:--:..:::.....  .      \\n         .....::=--::=------==-= ====++==:--:::=+===++X+==--:-::=++XX -:XXXXXXX+-::---=++=-:..  .:-=++==+===+XXXXX+===++=--=+=-::-::.+.....:     \\n        ....::- ===--======-+-===++XXXX+=---+====+X++:XX++++=--=+XXXXXXXXXXXXXX++==+X++XXXX+-::.:--==+X++++=XXXX.++=====++ XX++=:--::::..+.. .. .\\n      ....:::-:==++==== ==+-===+=+XXXXX+==-= =+==XXXXXXXX++XX===+XXXXXXXXXXXXXXX+==+++-XXXXX =--===++XXX=X.X.XXXXX++:==++XX+XX+=.--:::.:.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      .                                                                          \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                       ..-                                                                       \\n                                                ..                  .::.    .        .                                                           \\n                                                .:.                 .::..........                                                                \\n                          .:...                 -:..+            .  .:...=. ..                                                                   \\n                         .::..:..               .:-:.            ..=::.:... ..........:            .                                             \\n                        ..: -:::::....-.        .:--:..           ..::---:.....  ::..-:.           .          .::...:.                           \\n                      ....-::--:-=:::.::.      ..:.==::.          .::----::: ..  .:.::..:         ....     .::--:::-:... .                       \\n                 ...::::..::=-=---.--:--:.     .:--XX+=-:..     ..::-=====--:=:. ..:-::.+.     ...:==-:-..:- -=----==-:::...-..  ..              \\n           . ......::-:::::::- -=---.---=-:.  ..:--+X+==--::. ..::-=+X+XXXXX+=:....:-----:..   ..:-XX==-::---====-=+=---:::......:...            \\n         .-....:-::-:--:--: --==---.--==-- .. :-=--==++=--::::::--==+X XXXXX-X+-:::=--:=-:::.  ..:-=+=--=--==+++==++==+=-+--=-:.::.....          \\n         ....:::---:-----=--=====-===-+==----+--=++==+X====-::--=++XXXXXXXXXXXX+=+--==+XX+=-:....:-==+====+=+XX+X+==+==-==.===-::::::.:....      \\n        ...+:---===---.======-===+X:XX++==-----==+XXXXXX+==----==+XXXXXXXXXXXXX++=+X+ +XXXX+=-:+:--=+++++X++XXXXX+++=====+X++.==-::-::......... .\\n      .....::-==++.==-==-++=+==+++XXXXXX+========XXXXXXXX-+++++XX-X:XXX+XXXXXX ++=++==+XXXX:X+==.=++XXXXXXXXXXXXXXX+===:+XX=XX+=--:-::::.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 .                  ..                                                                           \\n                                                 .                   ..                                                                          \\n                                                 .                   ..+                                                                         \\n                         ..                     ..:..               .......                                                                      \\n                         ....-..-     .          :-:.            . ...::.=. ..      ...                                                          \\n                         ...=..+.::. .::.        : :..            ..::-::.......  . ..:                       ....                               \\n                    .. ........:::::..::.      ..:-=-:..         ..:-----::..-... ....            :...     .:.:.....:. ..                        \\n                    ........:.+.::.::.:-:.    ...:=+==-:..-     ..:-=+X+=--::..+ . ....:.      .:.:=-:..  .:..::::::-:. ...     .                \\n                 ............::::::--::-=-..  ..:-=++=--:::... ..::-=+:XX+-+=-:.....::-::..     .:==-:-::+::::----.-=-::..:.....+.               \\n            .....:..::::::::::--:+::::--.=:..-:-:-==:=+=-:..+.:.::-==+XXX++XX+-:..::-==--:..   ..:-==--:::-=-==-=--=--+-::::::.... .             \\n         ......: ::.::::.---.-=---.=-+-----:::::--++====--:..-::-==++XXXXXXXX+=--::-=+XX+=-:.....:--=------==X==:==--=-==-----:.........         \\n         .:.:::.---::.--+:--+-==++======-:--::---=+X-+++==-.::-=++++:XXX:XXXXX+======++XXX+=-::.::-========++X++++==+====++==--::... -.....      \\n       .....:--:===+------=--====+XX.++X+=-==---=+XXXXXXX+==----=++:X:X=XXXXXXX+=++===+X.X++==---=++XX+++ XXXX==XX++=-==+XXX++=-::::::.......... \\n     ......::-=.=+ ==--=++++====+X=XX:XXX+ +X==++++X XXXXX++===-+XXX.XXXXX.-XX++=+==.=+XX-+++:+=++XXXXXX.XX.XXXXX+.X+=+++XXX X+=--::--::.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..                                                                                              \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                  .:                 .-..                                                                        \\n                                       .         ....              .. ::..                                                                       \\n                               .....  :..        .::.            ...::::.........                                                                \\n                          .    ...:.. ..:.     ..= ::..       ....:--==-- ::.. ...                ...         .     ..                           \\n                          ...   .......::.    ..:----::=..=     ..:-+XX= =--:... ..=.::.       .=.:.:..    .. ..=...::.                          \\n                  .   +......:.........:: .   ..:-----=::..    ..:--=XX+====::.=....::::.     ..:--::=....-....:::::::....   ..                  \\n                .... .. .=.::-::::::....:::..=.::-------::....:.:---=++===++==-:..:-==--::..   .:----::::::::--::--+:::::....=..                 \\n           ...............::----- -::  ::::.:=:::-===----:.=..::-=-=+X+X++++==-:::=-+XX+=--.  ...:::--:::=::-=--=---:----.::.::. .               \\n          ....::::....::::+:---:==---=-=-::+::::--=X+===-:+:..::-==++X XXXXX+==:--=-=+X+=+=-::..::------:--==+=++==---====---::.-....            \\n         ...:::--:-:::::------===++====++-----++-=+X+X+=:=-:.:::-=+-+XXXXXXX++++-==-=+-+===---:: -=+++== =:+++XX+++===+=+X+==--::... .-...       \\n      ..+...:----------=========XX=X++-+X+===---==++=XX+==+==--==+++XXXXXXXXX+++==--==+X++===---++XXXX+.++XXXXXXXXX++===+XX++==--:::::.-.......- \\n    ....=..::-========-=:++++ +++XXXXXXXX++=====+-=++XXXXX+++++XX++XX:XXXXXX.X+======+XX.+++++++==+X:XXXXXXXX+X:XXX-X+++XXXX++==--:--:::::.......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                   ..               .....                                                                        \\n                                                   .               .::..:.                                                                       \\n                                       ..        .:..         ..  ..-:-:::..    ..                                                               \\n                          .            .-.       ....... .     ..:::=---::::..  ...  .           ...                                             \\n                          ...    .     ...    .:::...... ..    ..:--++=-----:.    ...:..      .. ......            . .                           \\n                          :..: ..:.     ...  ..:=--::.... .   .:: -=++==-=---:=....:::...     .:::.....   .   +.......                           \\n                          ..:-:.::..   .. ..-...:-:-- :::.....::---+====- ----::..:--=:-:..   .:--::.......+=:.:::........                       \\n                  . .    ..:-:::::+.....+=.::-...-=--::::....:.::- -+=====+=+-::+:-=-++=--:.  ..:-::.:.. ..::=::-::=-:::::.....                  \\n           ...............::------+::::::..::::::-=+==-::...  .::--=+X+++ +X+=-: :--++==---::...::=--::.=.::--====--:--==-::....                 \\n          ..:-::::..-.::-:-=-- =+==--:--=-:::::---=++=-::::....::-=++XXXX++++=+=-.--===.---: ::.:-=++=--:-==+++++-==-=-=+==--::..........        \\n         ...:::.:::::-:----- ==+XX+=====++---.:--=++++=---=-+::---=+XXXXXXXX+==--:---=++===- ::---+X++=-===++XXXX++=-==+++==--::::.:...... .:.   \\n     ....:.::----------===-===+XXX X++ +X+===--+-==:+XX+==:====++=+++XX.XXXXX+===--==+XX+= ==--===+XX+++++X=XX XXXXX+++++X++==-.-:+:::.......... \\n    ..=...::---.-==+=+==++++++++-=XXXXXX X++++:+==:=++XXX++ +XXXX+XXXXXXX+.+XX++===+XXXX=X+.==--:==+XXXXXXXXXXXXXXXXX+++XX=++++-=-----.::........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     :...                                                                        \\n                                                                    .:..:                                                                        \\n                                                               .. .:.:..+.                                                                       \\n                                                  ..   .      .. ...::.:.. .     ..                                                              \\n                                                     .        .:-:-:--:...:.       . .                                                           \\n                            ..  .            .:.....      .   .::+===--:.::-:=.. ...:..              .                                           \\n                            ..  .            .:=-:::..  -..   .::-+===--::---:.....::+..     .:....       .  ...                                 \\n                           .:......        ...::--::-:.....   ..::==-=--::-:-.::.::--:::...  .--::..     .   ....      .                         \\n                          .::::........    ......----... ..   .:+::==-------=-::::-===-::::. .::--:. ..   ......::........                       \\n            ..        ..+.::-::--:..:.:...+..:..::==-:....:   .::::-++========::.:-+=.=-::::.-..:-.-:::. ...::-----:: ---::..                    \\n           .....-.+..:.:.:::--+==--::::-:-:..:::::-=--:+...+...:+:-=++X++== =--:::-+--=-:::..:..:-==--::.:--=+++==-----==--::..    .             \\n          .....-.=..:::-:::--=-=+=-----:-=::.: ::--==--:::::..::+--+XXXX-====--:.::-=-==---::.::::=+==-----=+XX++-==:-===.--::........           \\n        ....-:::::::.------= -=+X++===+=.==-- --:--==++=-+--::-:====+XXXX+-+==-::=--=++==---:.:--==++==--=++ XXXXX++===+++===-::-:::....+:...    \\n      ....-.::-:------====+=.=++:XX+X++++ ===+ ======+XX+==-== ++++++X+XXXXX=+==-==++XXXX==--::+--==XX++-+X XXXXXX:++++++++====-+-::::::........ \\n     ...=.::--=-=== ===++XXX++XXXXXXXXXX+XXX:++======+X XX+.++X++XX+++X+XX++XXX++=++ XXXX+===--:--=++XXXXXXXXXXXXXX++++XX+X+++.=-------::::......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                    :....                                                                        \\n                                                                     .  .                                                                        \\n                                                                .   ....-                                                                        \\n                                                              .:..:::::..                                                                        \\n                                                              .:..+.::...         .                                                              \\n                                                               =::::.::... .  +...::..                                                           \\n                                             ..               .:-==-:-:....::...  .::.                                                           \\n                                            .:-::...          .:-+=---::..:::......::..     ....+             .                                  \\n                            .  .           :..:-:::....       .:--=--::::::::-:.::+:-:..     :=-::.           ..                                 \\n                          .......           ..::-:::..         .:::=--::::::.-:---=---:...:.:.:--:...-      ..::..=. .....                       \\n                      .  ..:::::::..... ..   ...-:-::.       ...-::-+=-=-::::::.:-+--=--::.....::-::...   -..:------:.:.:...                     \\n             .. .     ....:=::-::-:-...:..:..::..:--::.    .  .:::--+ +=----::.=.:-=:--::.+....+.-=::.=...:-=:==--+- ---::=...                   \\n           ............::::::--:-+-::=:::-:..=:...:--:::.... ..+---=++X+=-=-::..:.:==:=--:....::::==--::---=++.====--=---=:-:..:  ...            \\n          .....::::-::.:--::---====-------::.:::.---==--:.: ..-==--==-++====-::...::==----=::.:.::-==-::--=+=++++++======----: :. ....           \\n        ....-:=::::: --:==----=+==++=+==+=- --=.=+=.==X+=--:: -===+==+++X+-+==-::--==.++=-:::. ..:-==++===+++XX+++X====+===----:::::.:...:..     \\n       ....::---------==:++==+++++++++X+=++XX+=======+XX++ ===+==-++==++X XXX++==++++++++=--:.:.::-==XX++.XXXXXXXX++=++:XX++==--::+: :::.... .   \\n      .. .::---=========+X++XXX+XXXXXXX++:XXXX+=+=== =+X=X++X+-+.+++++XXXX++XXXX+++==++XX+==----- -=+XXXXXXXXXXXXX+++++X-XXX++=--------.:::......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      .                                                                          \\n                                                                .    .                                                                           \\n                                                               :.    .:..                                                                        \\n                                                              .. .. ..::.                                                                        \\n                                                               . .....::        ..:.                                                             \\n                                                              .-:...-.:..   .  .. ..                                                             \\n                                            .                .:-=-::...   ...+.    :+..                                                          \\n                                            ...              .:-+=-::::.  ........:--..     ..-..                                                \\n                              .             .=-:....          .::==::::......-::::..-:.     .::...                                               \\n                            ....             ..::=.            .:-==:=:.......::---::-.    .:-::::.         ........                             \\n                           ........   .       ..=.:.           .=::==--:+......:-+.--::. .+. ..::-:.       .:-::::-:::.:.                        \\n                       .....:-:.::-.. .. ..   :. ..:..         .::--+=--:. ..  ..:=::=::.......::-:..   ..:-----:::-=-:.:.:.                     \\n             ......   .::::::::.::--......   .....:-:..       .::--=+=.=::....  ..:=::.:-..:....::--+....:-=+=--==-==-::::::...                  \\n            ....-:.....::::::::::--- :::::.=....::--==-:.. . ..:=--+====--::.......-+-:.::+..  ...:=-:..::-.=======+-==----:::...:  ..           \\n          ......::...:-::--::--------==-=-:::---=++==++=-::-..:--:-=:==++===-:..::::==- ::....   .--=+.---=+X===+==+==+= ----::........          \\n         ...=:::-::::--=-==-=+==--====+++-:===-=-==.++X+=----=---======+XXXX+=-:-===++==--::. .  .:--X+===.:XX+.+=+===+++====-::.::-:.+....      \\n        ...:::------+=-==+.++X+=++XXXXXX++=+X+===+=-==+XX++=+=++ =====+XXXXXX +===+==++X+==::....::-++X ++XXXXXXX+===-=++-+++=-=--=::::::=.-.... \\n        ...:-----=----==+X++XXXXXXXXXXX+XX+++++==+==-==+XX.+=++-=====+++XX:XXX-X+=+++=+XXX+=--======+++XXXXXXXXXX+===+++XX++++=+------::::=:.....\\n\"\n]\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/Button/Button.tsx",
    "content": "import { AnimatePresence, motion } from \"motion/react\";\n\nimport AnimatedWidth from \"@/components/shared/layout/animated-width\";\nimport ArrowRight from \"@/components/app/(home)/sections/hero-input/_svg/ArrowRight\";\nimport Button from \"@/components/shared/button/Button\";\n\nexport default function HeroInputSubmitButton({\n  dirty,\n  buttonText = \"Re-imagine Site\",\n  disabled = false,\n}: {\n  dirty: boolean;\n  buttonText?: string;\n  disabled?: boolean;\n}) {\n  return (\n    <Button \n      className={`hero-input-button !p-0 ${disabled ? 'bg-gray-400 hover:bg-gray-400 cursor-wait' : 'bg-heat-100 hover:bg-heat-200'}`} \n      size=\"large\" \n      variant=\"primary\"\n      disabled={disabled}\n    >\n      <AnimatedWidth>\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          <motion.div\n            animate={{ opacity: 1, x: 0, filter: \"blur(0px)\" }}\n            exit={{ opacity: 0, x: -10, filter: \"blur(2px)\" }}\n            initial={{ opacity: 0, x: 10, filter: \"blur(2px)\" }}\n            key={dirty ? \"dirty\" : \"clean\"}\n          >\n            {dirty ? (\n              <div className=\"py-8 w-126 text-center text-white\">\n                {buttonText}\n              </div>\n            ) : (\n              <div className=\"w-60 py-8 flex-center\">\n                <ArrowRight />\n              </div>\n            )}\n          </motion.div>\n        </AnimatePresence>\n      </AnimatedWidth>\n    </Button>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/HeroInput.tsx",
    "content": "\"use client\";\n\nimport Link from \"next/link\";\nimport { useState } from \"react\";\n\nimport Globe from \"./_svg/Globe\";\nimport HeroInputSubmitButton from \"./Button/Button\";\nimport HeroInputTabsMobile from \"./Tabs/Mobile/Mobile\";\nimport HeroInputTabs from \"./Tabs/Tabs\";\nimport AsciiExplosion from \"@/components/shared/effects/flame/ascii-explosion\";\nimport { Endpoint } from \"@/components/shared/Playground/Context/types\";\n\nexport default function HeroInput() {\n  const [tab, setTab] = useState<Endpoint>(Endpoint.Scrape);\n  const [url, setUrl] = useState<string>(\"\");\n\n  return (\n    <div className=\"max-w-552 mx-auto w-full z-[11] lg:z-[2] rounded-20 lg:-mt-76\">\n      <div\n        className=\"overlay bg-accent-white\"\n        style={{\n          boxShadow:\n            \"0px 0px 44px 0px rgba(0, 0, 0, 0.02), 0px 88px 56px -20px rgba(0, 0, 0, 0.03), 0px 56px 56px -20px rgba(0, 0, 0, 0.02), 0px 32px 32px -20px rgba(0, 0, 0, 0.03), 0px 16px 24px -12px rgba(0, 0, 0, 0.03), 0px 0px 0px 1px rgba(0, 0, 0, 0.05), 0px 0px 0px 10px #F9F9F9\",\n        }}\n      />\n\n      <label className=\"p-16 flex gap-8 items-center w-full relative border-b border-black-alpha-5\">\n        <Globe />\n\n        <input\n          className=\"w-full bg-transparent text-body-input text-accent-black placeholder:text-black-alpha-48\"\n          placeholder=\"https://example.com\"\n          type=\"text\"\n          value={url}\n          onChange={(e) => setUrl(e.target.value)}\n          onKeyDown={(e) => {\n            if (e.key === \"Enter\") {\n              (\n                document.querySelector(\n                  \".hero-input-button\",\n                ) as HTMLButtonElement\n              )?.click();\n            }\n          }}\n        />\n      </label>\n\n      <div className=\"p-10 flex justify-between items-center relative\">\n        <HeroInputTabs\n          setTab={setTab}\n          tab={tab}\n          allowedModes={[\n            Endpoint.Scrape,\n            Endpoint.Search,\n            Endpoint.Map,\n            Endpoint.Crawl,\n          ]}\n        />\n\n        <HeroInputTabsMobile\n          setTab={setTab}\n          tab={tab}\n          allowedModes={[\n            Endpoint.Scrape,\n            Endpoint.Search,\n            Endpoint.Map,\n            Endpoint.Crawl,\n          ]}\n        />\n\n        <Link\n          className=\"contents\"\n          href={`/playground?endpoint=${tab}&url=${url}&autorun=true`}\n        >\n          <HeroInputSubmitButton dirty={url.length > 0} />\n        </Link>\n      </div>\n\n      <div className=\"h-248 top-84 cw-768 pointer-events-none absolute overflow-clip -z-10\">\n        <AsciiExplosion className=\"-top-200\" />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/Tabs/Mobile/Mobile.tsx",
    "content": "import { animate, AnimatePresence, cubicBezier, motion } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { tabs } from \"@/components/app/(home)/sections/hero-input/Tabs/Tabs\";\nimport { cn } from \"@/utils/cn\";\nimport { Endpoint } from \"@/components/shared/Playground/Context/types\";\n\nexport default function HeroInputTabsMobile(props: {\n  setTab: (tab: Endpoint) => void;\n  tab: Endpoint;\n  allowedModes?: Endpoint[];\n}) {\n  // Filter tabs based on allowedModes if provided\n  const visibleTabs = props.allowedModes\n    ? tabs.filter((tab) => props.allowedModes!.includes(tab.value))\n    : tabs;\n\n  const activeTab = visibleTabs.find((tab) => tab.value === props.tab)!;\n  const [isOpen, setIsOpen] = useState(false);\n\n  const ref = useRef<HTMLButtonElement>(null);\n\n  useEffect(() => {\n    if (window.innerWidth > 996) {\n      return;\n    }\n\n    document.addEventListener(\"click\", (e) => {\n      if (ref.current && e.composedPath().includes(ref.current)) {\n        return;\n      }\n\n      setIsOpen(false);\n    });\n  }, []);\n\n  return (\n    <>\n      <button\n        className=\"py-8 px-10 flex items-center rounded-10 inside-border before:border-black-alpha-4 relative lg:hidden gap-4\"\n        ref={ref}\n        onClick={() => setIsOpen(!isOpen)}\n      >\n        <activeTab.icon size={24} alwaysHeat />\n        <div className=\"px-6 text-label-medium\">{activeTab.label}</div>\n        <svg\n          className={cn(\n            \"transition-all duration-200\",\n            isOpen ? \"rotate-180 text-accent-black\" : \"text-black-alpha-48\",\n          )}\n          fill=\"none\"\n          height=\"24\"\n          viewBox=\"0 0 24 24\"\n          width=\"24\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path\n            d=\"M8.4001 10.2L12.0001 13.8L15.6001 10.2\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.25\"\n          />\n        </svg>\n      </button>\n\n      <AnimatePresence mode=\"popLayout\">\n        {isOpen && (\n          <motion.div\n            animate={{ opacity: 1, filter: \"blur(0px)\" }}\n            className=\"absolute z-[1001] top-[calc(100%-4px)] left-[calc(50%-(50vw-6px))] w-[calc(100vw-12px)]\"\n            exit={{ opacity: 0, filter: \"blur(2px)\" }}\n            initial={{ opacity: 0, filter: \"blur(2px)\" }}\n            transition={{\n              duration: 0.2,\n              ease: cubicBezier(0.25, 0.1, 0.25, 1.0),\n            }}\n          >\n            <div\n              className=\"mx-auto w-full p-4 max-w-366 rounded-16 bg-accent-white\"\n              style={{\n                boxShadow:\n                  \"0 32px 40px 6px rgba(0, 0, 0, 0.02), 0 12px 32px 0 rgba(0, 0, 0, 0.02), 0 24px 32px -8px rgba(0, 0, 0, 0.02), 0 8px 16px -2px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.04)\",\n              }}\n            >\n              <div className=\"py-10 px-12 text-label-small text-black-alpha-48\">\n                Output\n              </div>\n\n              <MenuItems\n                setTab={props.setTab}\n                tab={props.tab}\n                visibleTabs={visibleTabs}\n              />\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </>\n  );\n}\n\nfunction MenuItems(props: {\n  tab: Endpoint;\n  setTab: (tab: Endpoint) => void;\n  visibleTabs: typeof tabs;\n}) {\n  const backgroundRef = useRef<HTMLDivElement>(null);\n\n  return (\n    <div className=\"relative\">\n      <div\n        className=\"absolute top-0 opacity-0 left-0 bg-black-alpha-4 rounded-12 w-full pointer-events-none\"\n        ref={backgroundRef}\n      />\n\n      {props.visibleTabs.map((tab) => (\n        <div\n          className=\"text-label-small select-none cursor-pointer flex gap-12 py-12 px-16\"\n          key={tab.value}\n          onClick={() => {\n            animate(\n              backgroundRef.current!,\n              {\n                scaleX: [1, 0.99, 1],\n                scaleY: [1, 0.96, 1],\n                opacity: [1, 0.9, 1],\n              },\n              {\n                ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                duration: 0.15,\n              },\n            );\n\n            props.setTab(tab.value);\n          }}\n          onMouseEnter={async (e) => {\n            const child = e.currentTarget as HTMLElement;\n\n            if (backgroundRef.current?.getBoundingClientRect().height === 0) {\n              backgroundRef.current!.style.height = child.offsetHeight + \"px\";\n            }\n\n            if (getComputedStyle(backgroundRef.current!).opacity === \"0\") {\n              await animate(\n                backgroundRef.current!,\n                {\n                  y: child.offsetTop,\n                },\n                {\n                  ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                  duration: 0.01,\n                },\n              );\n            }\n\n            animate(backgroundRef.current!, { scale: 0.995 }).then(() =>\n              animate(backgroundRef.current!, { scale: 1 }),\n            );\n\n            animate(\n              backgroundRef.current!,\n              {\n                y: child.offsetTop,\n                opacity: 1,\n                height: child.offsetHeight + \"px\",\n              },\n              {\n                ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                duration: 0.2,\n              },\n            );\n          }}\n          onMouseLeave={() => {\n            animate(\n              backgroundRef.current!,\n              {\n                opacity: 0,\n              },\n              {\n                ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                duration: 0.2,\n              },\n            );\n          }}\n        >\n          <div className=\"size-24 p-2\">\n            <tab.icon size={20} alwaysHeat />\n          </div>\n          <div className=\"px-6 text-label-medium\">{tab.label}</div>\n        </div>\n      ))}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/Tabs/Tabs.tsx",
    "content": "import { animate } from \"motion\";\nimport { Fragment, useRef } from \"react\";\n\nimport EndpointsSearch from \"@/components/app/(home)/sections/endpoints/EndpointsSearch/EndpointsSearch\";\nimport EndpointsCrawl from \"@/components/app/(home)/sections/endpoints/EndpointsCrawl/EndpointsCrawl\";\nimport EndpointsMap from \"@/components/app/(home)/sections/endpoints/EndpointsMap/EndpointsMap\";\nimport EndpointsScrape from \"@/components/app/(home)/sections/endpoints/EndpointsScrape/EndpointsScrape\";\nimport EndpointsExtract from \"@/components/app/(home)/sections/endpoints/EndpointsExtract/EndpointsExtract\";\n\nimport { cn } from \"@/utils/cn\";\nimport Tooltip from \"@/components/ui/shadcn/tooltip\";\nimport { Endpoint } from \"@/components/shared/Playground/Context/types\";\n\nexport const tabs = [\n  {\n    label: \"Scrape\",\n    value: Endpoint.Scrape,\n    action: \"scraping\",\n    description:\n      \"Scrapes only the specified URL without crawling subpages. Outputs the content from the page.\",\n    icon: EndpointsScrape,\n  },\n  {\n    label: \"Search\",\n    value: Endpoint.Search,\n    description: \"Search the web and get full content from results\",\n    action: \"searching\",\n    icon: EndpointsSearch,\n    new: true,\n  },\n  {\n    label: \"Map\",\n    value: Endpoint.Map,\n    action: \"mapping\",\n    description: \"Attempts to output all website's urls in a few seconds.\",\n    icon: EndpointsMap,\n  },\n  {\n    label: \"Crawl\",\n    value: Endpoint.Crawl,\n    action: \"crawling\",\n    description:\n      \"Crawls a URL and all its accessible subpages, outputting the content from each page.\",\n    icon: EndpointsCrawl,\n  },\n  {\n    label: \"Extract\",\n    value: Endpoint.Extract,\n    action: \"extracting\",\n    description:\n      \"Extract structured data from pages using LLMs. Provide URLs and a schema to get organized data.\",\n    icon: EndpointsExtract,\n    new: true,\n  },\n];\n\nexport default function HeroInputTabs(props: {\n  setTab: (tab: Endpoint) => void;\n  tab: Endpoint;\n  disabled?: boolean;\n  allowedModes?: Endpoint[];\n}) {\n  // Filter tabs based on allowedModes if provided\n  const visibleTabs = props.allowedModes\n    ? tabs.filter((tab) => props.allowedModes!.includes(tab.value))\n    : tabs;\n\n  const activeIndex = visibleTabs.findIndex((tab) => tab.value === props.tab);\n\n  const backgroundRef = useRef<HTMLDivElement>(null);\n\n  return (\n    <div\n      className=\"bg-black-alpha-4 flex items-center rounded-10 p-2 relative lg-max:hidden\"\n      style={{\n        boxShadow:\n          \"0px 6px 12px 0px rgba(0, 0, 0, 0.02) inset, 0px 0.75px 0.75px 0px rgba(0, 0, 0, 0.02) inset, 0px 0.25px 0.25px 0px rgba(0, 0, 0, 0.04) inset\",\n      }}\n    >\n      <div\n        className=\"absolute top-2 left-2 h-32 bg-accent-white rounded-8 w-89\"\n        ref={backgroundRef}\n        style={{\n          boxShadow:\n            \"0px 6px 12px -3px rgba(0, 0, 0, 0.04), 0px 3px 6px -1px rgba(0, 0, 0, 0.04), 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 0.5px 0.5px 0px rgba(0, 0, 0, 0.06)\",\n        }}\n      />\n\n      {visibleTabs.map((tab, index) => (\n        <Fragment key={tab.value}>\n          {index > 0 && (\n            <div\n              className={cn(\n                \"px-2 transition-all\",\n                !(index !== activeIndex && index !== activeIndex + 1) &&\n                  \"opacity-0\",\n              )}\n            >\n              <div className=\"w-1 h-12 bg-black-alpha-5\" />\n            </div>\n          )}\n\n          <button\n            className={cn(\n              \"text-label-medium p-6 relative transition-all group flex items-center\",\n              tab.value === props.tab\n                ? \"text-accent-black\"\n                : \"text-black-alpha-56\",\n              !tab.new && \"pr-4\",\n            )}\n            key={tab.value}\n            ref={(element) => {\n              if (element && backgroundRef.current) {\n                if (activeIndex === index) {\n                  animate(\n                    backgroundRef.current,\n                    {\n                      x: element.offsetLeft - 2,\n                      width: element.offsetWidth - 1,\n                    },\n                    {\n                      type: \"spring\",\n                      stiffness: 200,\n                      damping: 23,\n                    },\n                  );\n                }\n              }\n            }}\n            onClick={(e) => {\n              props.setTab(tab.value);\n\n              const t = e.target as HTMLElement;\n\n              const target =\n                t instanceof HTMLButtonElement\n                  ? t\n                  : (t.closest(\"button\") as HTMLButtonElement);\n\n              if (backgroundRef.current) {\n                animate(backgroundRef.current, { scale: 0.975 }).then(() =>\n                  animate(backgroundRef.current!, { scale: 1 }),\n                );\n\n                animate(\n                  backgroundRef.current,\n                  {\n                    x: target.offsetLeft - 2,\n                    width: target.offsetWidth - 1,\n                  },\n                  {\n                    type: \"spring\",\n                    stiffness: 250,\n                    damping: 25,\n                  },\n                );\n              }\n            }}\n          >\n            {tab.icon && <tab.icon active={tab.value === props.tab} />}\n\n            <span className=\"px-6\"> {tab.label}</span>\n\n            {tab.new && (\n              <div\n                className={cn(\n                  \"py-2 px-6 rounded-4 text-[12px]/[16px] font-[450] transition-all\",\n                  tab.value === props.tab\n                    ? \"bg-heat-12 text-heat-100\"\n                    : \"bg-black-alpha-4 text-black-alpha-56\",\n                )}\n              >\n                New\n              </div>\n            )}\n\n            <Tooltip delay={0.25} description={tab.description} offset={-8} />\n          </button>\n        </Fragment>\n      ))}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/_svg/ArrowRight.tsx",
    "content": "export default function ArrowRight() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M11.6667 4.79163L16.875 9.99994M16.875 9.99994L11.6667 15.2083M16.875 9.99994H3.125\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.5\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-input/_svg/Globe.tsx",
    "content": "export default function Globe() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"24\"\n      viewBox=\"0 0 24 24\"\n      width=\"24\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M12 19.7083C16.2572 19.7083 19.7083 16.2572 19.7083 12C19.7083 7.74276 16.2572 4.29163 12 4.29163M12 19.7083C7.74276 19.7083 4.29163 16.2572 4.29163 12C4.29163 7.74276 7.74276 4.29163 12 4.29163M12 19.7083C10.044 19.7083 8.45829 16.2572 8.45829 12C8.45829 7.74276 10.044 4.29163 12 4.29163M12 19.7083C13.956 19.7083 15.5416 16.2572 15.5416 12C15.5416 7.74276 13.956 4.29163 12 4.29163M19.5 12H4.49996\"\n        stroke=\"#262626\"\n        strokeLinecap=\"square\"\n        strokeOpacity=\"0.32\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/Code/Code.tsx",
    "content": "import { useCallback, useEffect, useState } from \"react\";\n\nimport CurvyRect, { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport { encryptText } from \"@/components/app/(home)/sections/hero/Title/Title\";\n\nimport HeroScrapingCodeLoading from \"./Loading/Loading\";\nimport Code from \"@/components/ui/code\";\n\nconst URL = {\n  value: \"https://example.com\",\n  encrypted: \"h=t*A:!/z!aap?A-cZz\",\n};\nconst MARKDOWN = {\n  value: \"# Getting Started...\",\n  encrypted: \"# ?0z-ang S*a-Z-a0*9\",\n};\nconst TITLE = {\n  value: \"Guide\",\n  encrypted: \"G!=*?\",\n};\nconst SCREENSHOT = {\n  value: \"https://example.com/hero\",\n  encrypted: \"ht-=*:/?*Za!zl=-?a9?h0-!\",\n};\n\nexport default function HeroScrapingCode({ step }: { step: number }) {\n  const [url, setUrl] = useState(URL.encrypted);\n  const [markdown, setMarkdown] = useState(MARKDOWN.encrypted);\n  const [title, setTitle] = useState(TITLE.encrypted);\n  const [screenshot, setScreenshot] = useState(SCREENSHOT.encrypted);\n\n  const reveal = useCallback((value: string, setter: (v: string) => void) => {\n    let progress = 0;\n    let increaseProgress = -10;\n\n    const animate = () => {\n      increaseProgress = (increaseProgress + 1) % 5;\n\n      if (increaseProgress === 4) {\n        progress += 0.2;\n      }\n\n      if (progress > 1) {\n        progress = 1;\n        setter(encryptText(value, progress, { randomizeChance: 0.3 }));\n\n        return;\n      }\n\n      setter(encryptText(value, progress, { randomizeChance: 0.3 }));\n\n      const interval = 70 + progress * 30;\n      setTimeout(animate, interval);\n    };\n\n    animate();\n  }, []);\n\n  useEffect(() => {\n    if (step >= 0 && url === URL.encrypted) reveal(URL.value, setUrl);\n\n    if (step >= 3 && title === TITLE.encrypted) reveal(TITLE.value, setTitle);\n    if (step >= 4 && markdown === MARKDOWN.encrypted)\n      reveal(MARKDOWN.value, setMarkdown);\n\n    if (step >= 5 && screenshot === SCREENSHOT.encrypted)\n      reveal(SCREENSHOT.value, setScreenshot);\n\n    const interval = setInterval(() => {\n      if (step < 0) {\n        URL.encrypted = encryptText(URL.value, 0, { randomizeChance: 0.3 });\n        setUrl(URL.encrypted);\n      }\n\n      if (step < 3) {\n        TITLE.encrypted = encryptText(TITLE.value, 0, { randomizeChance: 0.3 });\n        setTitle(TITLE.encrypted);\n      }\n\n      if (step < 4) {\n        MARKDOWN.encrypted = encryptText(MARKDOWN.value, 0, {\n          randomizeChance: 0.3,\n        });\n        setMarkdown(MARKDOWN.encrypted);\n      }\n\n      if (step < 5) {\n        SCREENSHOT.encrypted = encryptText(SCREENSHOT.value, 0, {\n          randomizeChance: 0.3,\n        });\n        setScreenshot(SCREENSHOT.encrypted);\n      }\n    }, 70);\n\n    return () => clearInterval(interval);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [step, reveal]);\n\n  return (\n    <div className=\"h-280 lg:h-310 flex z-[1] w-full relative -top-1 bg-background-base\">\n      <Connector className=\"lg:hidden absolute -top-10 -left-[10.5px]\" />\n      <Connector className=\"lg:hidden absolute -top-10 -right-[10.5px]\" />\n      <div className=\"lg:hidden absolute top-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint\" />\n\n      <Connector className=\"lg:hidden absolute -bottom-10 -left-[10.5px]\" />\n      <Connector className=\"lg:hidden absolute -bottom-10 -right-[10.5px]\" />\n      <div className=\"lg:hidden absolute bottom-0 left-[calc(50%-50vw)] w-screen h-1 bg-border-faint\" />\n\n      <div className=\"flex-1 lg-max:min-w-0 h-full relative lg:inside-border before:border-border-faint\">\n        <CurvyRect className=\"overlay\" allSides />\n        <CurvyRect\n          className=\"size-32 absolute bottom-0 -left-31 lg-max:hidden\"\n          bottomRight\n        />\n\n        <div className=\"pl-15 border-b border-border-faint p-13 flex justify-between items-center\">\n          <div className=\"flex gap-10 items-center\">\n            {Array.from({ length: 3 }).map((_, index) => (\n              <div\n                className=\"w-12 h-12 rounded-full relative inside-border before:border-border-muted\"\n                key={index}\n              />\n            ))}\n          </div>\n\n          <div className=\"text-mono-x-small font-mono text-black-alpha-20\">\n            [ .JSON ]\n          </div>\n        </div>\n\n        <div className=\"overflow-x-scroll hide-scrollbar lg:contents relative\">\n          <Code\n            code={`[\n  {\n    \"url\": \"${url}\",\n    \"markdown\": \"${markdown}\",\n    \"json\": { \"title\": \"${title}\", \"docs\": \"...\" },\n    \"screenshot\": \"${screenshot}.png\"\n  }\n]`}\n            language=\"json\"\n          />\n        </div>\n\n        <HeroScrapingCodeLoading finished={step >= 6} />\n      </div>\n\n      <div className=\"w-28 lg-max:hidden -ml-1 relative\">\n        <div className=\"h-1 w-[calc(100%-1px)] top-0 left-0 absolute bg-border-faint\" />\n        <CurvyRect className=\"overlay\" topLeft />\n      </div>\n\n      <div className=\"h-53 lg-max:hidden -right-37 bottom-0 absolute w-65\">\n        <CurvyRect className=\"overlay\" bottom topRight />\n        <div className=\"overlay border-y border-border-faint\" />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/Code/Loading/Loading.tsx",
    "content": "import { AnimatePresence, motion } from \"motion/react\";\nimport { useEffect, useState } from \"react\";\n\nimport { encryptText } from \"@/components/app/(home)/sections/hero/Title/Title\";\nimport AnimatedWidth from \"@/components/shared/layout/animated-width\";\nimport Spinner from \"@/components/ui/spinner\";\n\nexport default function HeroScrapingCodeLoading({\n  finished,\n}: {\n  finished: boolean;\n}) {\n  const [scrapingText, setScrapingText] = useState(\"Scraping...\");\n\n  useEffect(() => {\n    if (finished) return;\n\n    let timeout = 0;\n    let tick = 0;\n\n    const animate = () => {\n      tick += 1;\n\n      if (tick % 3 !== 0) {\n        setScrapingText(\n          encryptText(\"Scraping\", 0, {\n            randomizeChance: 0.6 + Math.random() * 0.3,\n          }) + \"...\",\n        );\n      } else {\n        setScrapingText(\"Scraping...\");\n      }\n\n      const interval = 80;\n      timeout = window.setTimeout(animate, interval);\n    };\n\n    animate();\n\n    return () => {\n      window.clearTimeout(timeout);\n    };\n  }, [finished]);\n\n  return (\n    <div className=\"flex gap-6 p-6 pr-0 rounded-full inside-border before:border-border-faint absolute right-20 bottom-20 text-mono-small font-mono text-accent-black\">\n      <Spinner finished={finished} />\n\n      <AnimatedWidth initial={{ width: \"auto\" }}>\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          <motion.div\n            animate={{ opacity: 1, x: 0 }}\n            className=\"pr-12\"\n            exit={{ opacity: 0, x: 10 }}\n            initial={{ opacity: 0, x: -10 }}\n          >\n            {finished ? \"Scrape Completed\" : scrapingText}\n          </motion.div>\n        </AnimatePresence>\n      </AnimatedWidth>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/Code/Loading/_svg/Check.tsx",
    "content": "export default function Check() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        clipRule=\"evenodd\"\n        d=\"M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM12.8305 8.59995C13.0928 8.27937 13.0455 7.80685 12.7249 7.54455C12.4043 7.28226 11.9318 7.32951 11.6695 7.65009L8.81932 11.1337L7.90533 10.2197C7.61244 9.9268 7.13756 9.9268 6.84467 10.2197C6.55178 10.5126 6.55178 10.9875 6.84467 11.2804L8.34467 12.7804C8.4945 12.9302 8.70073 13.0096 8.91236 12.9991C9.12399 12.9885 9.32129 12.8889 9.45547 12.725L12.8305 8.59995Z\"\n        fill=\"#FA5D19\"\n        fillRule=\"evenodd\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/HeroScraping.css",
    "content": ".hero-scraping-highlight::before {\n  animation: hero-scraping-highlight-before 1s linear infinite;\n  transition: none !important;\n}\n\n@keyframes hero-scraping-highlight-before {\n  0% {\n    border-color: var(--border-loud);\n    opacity: 1;\n  }\n\n  40% {\n    opacity: 0.25;\n    border-color: var(--heat-100);\n  }\n\n  80% {\n    border-color: var(--border-loud);\n    opacity: 1;\n  }\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/HeroScraping.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"motion\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport CurvyRect from \"@/components/shared/layout/curvy-rect\";\nimport { sleep } from \"@/utils/sleep\";\n\nimport BrowserMobile from \"./_svg/BrowserMobile\";\nimport BrowserTab from \"./_svg/BrowserTab\";\nimport HeroScrapingCode from \"./Code/Code\";\nimport HeroScrapingTag from \"./Tag/Tag\";\n\nimport \"./HeroScraping.css\";\n\nexport default function HeroScraping() {\n  const [step, setStep] = useState(-1);\n\n  const navigationRef = useRef<HTMLDivElement>(null);\n  const buttonRef = useRef<HTMLDivElement>(null);\n  const h1Ref = useRef<HTMLDivElement>(null);\n  const descriptionRef = useRef<HTMLDivElement>(null);\n  const ctaRef = useRef<HTMLDivElement>(null);\n  const highlightRef = useRef<HTMLDivElement>(null);\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    const wrapElement = async (\n      element: HTMLElement,\n      { borderRadius }: { borderRadius?: number } = {},\n    ) => {\n      if (!containerRef.current) return;\n\n      const containerBnds = containerRef.current.getBoundingClientRect();\n      const elementBnds = element.getBoundingClientRect();\n\n      if (!highlightRef.current) return;\n\n      try {\n        if (highlightRef.current) {\n        await animate(highlightRef.current, { opacity: 0 }, { duration: 0.3 });\n      }\n      } catch (error) {\n        console.error(\"Error animating highlight:\", error);\n      }\n\n      if (!highlightRef.current) return;\n\n      Object.assign(highlightRef.current.style, {\n        left: elementBnds.left - containerBnds.left - 4 + \"px\",\n        top: elementBnds.top - containerBnds.top - 4 + \"px\",\n        width: elementBnds.width + 8 + \"px\",\n        height: elementBnds.height + 8 + \"px\",\n        borderRadius: borderRadius ? `${borderRadius}px` : undefined,\n      });\n\n      try {\n        await animate(\n          highlightRef.current,\n          { opacity: [1, 0.5, 0.3, 0.8, 0.6, 0.9, 0.7, 1] },\n          { duration: 0.4 },\n        );\n      } catch (error) {\n        console.error(\"Error animating highlight:\", error);\n      }\n    };\n\n    const start = async () => {\n      setStep(0);\n      if (!highlightRef.current) return;\n      \n      await animate(highlightRef.current, {\n        scale: 1,\n        opacity: 1,\n      });\n\n      await sleep(700);\n\n      setTimeout(() => setStep(1), 300);\n      if (navigationRef.current) {\n        await wrapElement(navigationRef.current);\n      }\n\n      await sleep(1200);\n\n      setTimeout(() => setStep(2), 300);\n      if (buttonRef.current) {\n        await wrapElement(buttonRef.current);\n      }\n\n      await sleep(1200);\n\n      setTimeout(() => setStep(3), 300);\n      if (h1Ref.current) {\n        await wrapElement(h1Ref.current, { borderRadius: 12 });\n      }\n\n      await sleep(1200);\n\n      setTimeout(() => setStep(4), 300);\n      if (descriptionRef.current) {\n        await wrapElement(descriptionRef.current, { borderRadius: 8 });\n      }\n\n      await sleep(1200);\n\n      setTimeout(() => setStep(5), 300);\n      if (ctaRef.current) {\n        await wrapElement(ctaRef.current, { borderRadius: 24 });\n      }\n\n      await sleep(1500);\n      setTimeout(() => setStep(6), 300);\n\n      if (highlightRef.current) {\n        await animate(highlightRef.current, { opacity: 0 }, { duration: 0.3 });\n      }\n    };\n\n    let started = false;\n\n    const onScroll = () => {\n      if (started) return;\n\n      if (window.scrollY > 100) {\n        started = true;\n        start();\n        window.removeEventListener(\"scroll\", onScroll);\n      }\n    };\n\n    setTimeout(() => {\n      if (started) return;\n\n      started = true;\n      start();\n      window.removeEventListener(\"scroll\", onScroll);\n    }, 2000);\n\n    window.addEventListener(\"scroll\", onScroll);\n\n    return () => window.removeEventListener(\"scroll\", onScroll);\n  }, []);\n\n  return (\n    <div\n      className=\"pt-56 lg:pt-25 lg:px-25 container -mt-36 relative\"\n      ref={containerRef}\n    >\n      <div className=\"h-53 absolute top-[calc(100%-1px)] w-full left-0\">\n        <div className=\"h-1 bg-border-faint bottom-0 left-0 w-full absolute\" />\n      </div>\n\n      <div\n        className=\"left-61 top-89 rounded-[16px] size-32 absolute hero-scraping-highlight inside-border before:border-border-loud opacity-0 scale-[0.9]\"\n        ref={highlightRef}\n      />\n\n      <div className=\"overlay lg-max:hidden\">\n        <div className=\"h-1 absolute bottom-0 w-full left-0 bg-border-faint\" />\n        <CurvyRect className=\"overlay\" bottom />\n      </div>\n\n      <div className=\"lg:h-370 rounded-t-16 lg-max:pt-70 relative\">\n        <div className=\"overlay mask-border lg-max:hidden p-1 bg-gradient-to-b from-black/7 to-transparent\" />\n\n        <div className=\"top-17 left-17 flex gap-8 items-center absolute lg-max:hidden\">\n          {Array.from({ length: 3 }).map((_, index) => (\n            <div\n              className=\"w-10 h-10 rounded-full relative inside-border before:border-border-muted\"\n              key={index}\n            />\n          ))}\n        </div>\n\n        <div className=\"pt-42 lg:px-6\">\n          <BrowserMobile className=\"absolute top-0 cw-316 lg:hidden\" />\n\n          <BrowserTab className=\"absolute top-[7.5px] left-70 lg-max:hidden bg-background-base z-[1]\" />\n          <div className=\"absolute size-18 top-17 left-89 lg-max:hidden inside-border before:border-border-muted z-[2] rounded-full\" />\n\n          <div className=\"rounded-t-16 relative lg:h-330 lg:p-6\">\n            <div className=\"overlay mask-border lg-max:hidden p-1 bg-gradient-to-b from-black/7 to-transparent\" />\n\n            <div className=\"lg:h-322 rounded-t-10 relative\">\n              <div className=\"overlay mask-border lg-max:hidden p-1 bg-gradient-to-b z-[2] from-black/7 to-transparent\" />\n\n              <div className=\"px-28 lg-max:hidden py-20 flex justify-between items-center relative border-b border-border-faint\">\n                <div className=\"flex gap-8 items-center relative\">\n                  <div className=\"size-24 rounded-full relative inside-border before:border-border-muted\" />\n                  <div className=\"w-64 h-12 rounded-full relative inside-border before:border-border-muted\" />\n\n                  {step >= 0 && (\n                    <HeroScrapingTag\n                      active={step === 0}\n                      className=\"absolute left-[calc(100%+24px)] top-0\"\n                      initial={{ x: -12, opacity: 0 }}\n                      label=\"Logo\"\n                    />\n                  )}\n                </div>\n\n                <div\n                  className=\"absolute top-24 center-x flex gap-8\"\n                  ref={navigationRef}\n                >\n                  {step >= 1 && (\n                    <HeroScrapingTag\n                      active={step === 1}\n                      className=\"absolute right-[calc(100%+20px)] -top-4\"\n                      initial={{ x: 12, opacity: 0 }}\n                      label=\"Navigation\"\n                    />\n                  )}\n\n                  {Array.from({ length: 4 }).map((_, index) => (\n                    <div\n                      className=\"w-64 h-16 rounded-full relative inside-border before:border-border-muted\"\n                      key={index}\n                    />\n                  ))}\n                </div>\n\n                <div\n                  className=\"w-72 h-24 rounded-full relative inside-border before:border-border-muted\"\n                  ref={buttonRef}\n                >\n                  {step >= 2 && (\n                    <HeroScrapingTag\n                      active={step === 2}\n                      className=\"absolute right-[calc(100%+20px)] top-0\"\n                      initial={{ x: 12, opacity: 0 }}\n                      label=\"Button\"\n                    />\n                  )}\n                </div>\n              </div>\n\n              <div className=\"lg:grid grid-cols-2\">\n                <div className=\"pt-40 pl-151 flex gap-16 relative lg-max:hidden\">\n                  <CurvyRect\n                    className=\"size-32 -top-1 -right-1 absolute\"\n                    topRight\n                  />\n\n                  <div className=\"h-53 lg-max:hidden -left-37 bottom-1 absolute w-65\">\n                    <CurvyRect className=\"overlay\" left />\n                  </div>\n\n                  <div>\n                    <div\n                      className=\"flex gap-16 mb-16 flex-wrap w-300 relative\"\n                      ref={h1Ref}\n                    >\n                      {step >= 3 && (\n                        <HeroScrapingTag\n                          active={step === 3}\n                          className=\"absolute right-[calc(100%+16px)] top-0\"\n                          initial={{ x: 12, opacity: 0 }}\n                          label=\"H1 Title\"\n                        />\n                      )}\n                      <div className=\"w-144 h-32 rounded-8 relative inside-border before:border-border-muted\" />\n                      <div className=\"w-82 h-32 rounded-8 relative inside-border before:border-border-muted\" />\n                      <div className=\"w-100 h-32 rounded-8 relative inside-border before:border-border-muted\" />\n                      <div className=\"w-180 h-32 rounded-8 relative inside-border before:border-border-muted\" />\n                    </div>\n\n                    <div\n                      className=\"flex gap-6 mb-32 flex-wrap w-300 relative\"\n                      ref={descriptionRef}\n                    >\n                      {step >= 4 && (\n                        <HeroScrapingTag\n                          active={step === 4}\n                          className=\"absolute top-0 right-[calc(100%+16px)]\"\n                          initial={{ x: 12, opacity: 0 }}\n                          label=\"Description\"\n                        />\n                      )}\n\n                      <div className=\"w-131 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                      <div className=\"w-72 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                      <div className=\"w-34 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                      <div className=\"w-56 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                      <div className=\"w-116 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                      <div className=\"w-116 h-10 rounded-full relative inside-border before:border-border-muted\" />\n                    </div>\n\n                    <div\n                      className=\"w-64 h-24 rounded-full relative inside-border before:border-border-muted\"\n                      ref={ctaRef}\n                    >\n                      {step >= 5 && (\n                        <HeroScrapingTag\n                          active={step === 5}\n                          className=\"absolute top-0 right-[calc(100%+16px)]\"\n                          initial={{ x: 12, opacity: 0 }}\n                          label=\"CTA Button\"\n                        />\n                      )}\n                    </div>\n                  </div>\n                </div>\n\n                <HeroScrapingCode step={step} />\n              </div>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/Tag/Tag.tsx",
    "content": "import { motion } from \"motion/react\";\nimport { ComponentProps, useEffect, useState } from \"react\";\n\nimport { encryptText } from \"@/components/app/(home)/sections/hero/Title/Title\";\nimport { cn } from \"@/utils/cn\";\n\nexport default function HeroScrapingTag({\n  active,\n  label,\n  ...attrs\n}: ComponentProps<typeof motion.div> & { active?: boolean; label: string }) {\n  const [value, setValue] = useState(\n    encryptText(label, 0, { randomizeChance: 0 }),\n  );\n\n  useEffect(() => {\n    let progress = 0;\n    let increaseProgress = -10;\n\n    const animate = () => {\n      increaseProgress = (increaseProgress + 1) % 5;\n\n      if (increaseProgress === 4) {\n        progress += 0.2;\n      }\n\n      if (progress > 1) {\n        progress = 1;\n        setValue(encryptText(label, progress, { randomizeChance: 0 }));\n\n        return;\n      }\n\n      setValue(encryptText(label, progress, { randomizeChance: 0 }));\n\n      const interval = 40 + progress * 20;\n      setTimeout(animate, interval);\n    };\n\n    animate();\n  }, [label]);\n\n  return (\n    <motion.div\n      {...attrs}\n      animate={{\n        x: 0,\n        y: 0,\n        scale: 1,\n        opacity: 1,\n        filter: \"blur(0px)\",\n      }}\n      className={cn(\n        \"py-4 h-max font-mono w-max px-6 text-mono-x-small rounded-6 transition-colors\",\n        active\n          ? \"bg-heat-12 text-heat-100\"\n          : \"bg-black-alpha-4 text-black-alpha-56\",\n        attrs.className,\n      )}\n      transition={{\n        type: \"spring\",\n        stiffness: 100,\n        damping: 18,\n      }}\n    >\n      {value}\n    </motion.div>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/_svg/BrowserMobile.tsx",
    "content": "export default function BrowserMobile(props: React.SVGProps<SVGSVGElement>) {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"112\"\n      viewBox=\"0 0 316 112\"\n      width=\"316\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n    >\n      <g clipPath=\"url(#clip0_2254_6088)\">\n        <rect\n          height=\"370\"\n          rx=\"15.5\"\n          stroke=\"url(#paint0_linear_2254_6088)\"\n          strokeOpacity=\"0.07\"\n          width=\"315\"\n          x=\"0.5\"\n          y=\"0.5\"\n        />\n        <mask fill=\"white\" id=\"path-2-inside-1_2254_6088\">\n          <path d=\"M240 32C240 37.5228 244.477 42 250 42H294C302.837 42 310 49.1634 310 58V361C310 366.523 305.523 371 300 371H16C10.4772 371 6 366.523 6 361V58C6 49.1634 13.1634 42 22 42H70C75.5228 42 80 37.5228 80 32V18C80 12.4772 84.4772 8 90 8H230C235.523 8 240 12.4772 240 18V32Z\" />\n        </mask>\n        <path\n          d=\"M310 58L311 58L310 58ZM22 42L22 41L22 42ZM250 42V43H294V42V41H250V42ZM294 42V43C302.284 43 309 49.7157 309 58L310 58L311 58C311 48.6112 303.389 41 294 41V42ZM310 58H309V361H310H311V58H310ZM300 371V370H16V371V372H300V371ZM6 361H7V58H6H5V361H6ZM6 58H7C7 49.7157 13.7157 43 22 43L22 42L22 41C12.6112 41 5 48.6112 5 58H6ZM22 42V43H70V42V41H22V42ZM80 32H81V18H80H79V32H80ZM90 8V9H230V8V7H90V8ZM240 18H239V32H240H241V18H240ZM230 8V9C234.971 9 239 13.0294 239 18H240H241C241 11.9249 236.075 7 230 7V8ZM70 42V43C76.0751 43 81 38.0751 81 32H80H79C79 36.9706 74.9706 41 70 41V42ZM16 371V370C11.0294 370 7 365.971 7 361H6H5C5 367.075 9.92487 372 16 372V371ZM80 18H81C81 13.0294 85.0294 9 90 9V8V7C83.9249 7 79 11.9249 79 18H80ZM310 361H309C309 365.971 304.971 370 300 370V371V372C306.075 372 311 367.075 311 361H310ZM250 42V41C245.029 41 241 36.9706 241 32H240H239C239 38.0751 243.925 43 250 43V42Z\"\n          fill=\"url(#paint1_linear_2254_6088)\"\n          fillOpacity=\"0.07\"\n          mask=\"url(#path-2-inside-1_2254_6088)\"\n        />\n        <rect\n          height=\"310\"\n          rx=\"9.5\"\n          stroke=\"url(#paint2_linear_2254_6088)\"\n          strokeOpacity=\"0.07\"\n          width=\"291\"\n          x=\"12.5\"\n          y=\"48.5\"\n        />\n        <rect\n          height=\"9\"\n          rx=\"4.5\"\n          stroke=\"#E8E8E8\"\n          width=\"9\"\n          x=\"17.5\"\n          y=\"17.5\"\n        />\n        <rect\n          height=\"9\"\n          rx=\"4.5\"\n          stroke=\"#E8E8E8\"\n          width=\"9\"\n          x=\"35.5\"\n          y=\"17.5\"\n        />\n        <rect\n          height=\"9\"\n          rx=\"4.5\"\n          stroke=\"#E8E8E8\"\n          width=\"9\"\n          x=\"53.5\"\n          y=\"17.5\"\n        />\n        <rect\n          height=\"17\"\n          rx=\"8.5\"\n          stroke=\"#E8E8E8\"\n          width=\"17\"\n          x=\"89.5\"\n          y=\"17.5\"\n        />\n        <mask fill=\"white\" id=\"path-10-inside-2_2254_6088\">\n          <path d=\"M12 48H304V112H12V48Z\" />\n        </mask>\n        <path\n          d=\"M304 112V111H12V112V113H304V112Z\"\n          fill=\"#EDEDED\"\n          mask=\"url(#path-10-inside-2_2254_6088)\"\n        />\n        <rect\n          height=\"23\"\n          rx=\"11.5\"\n          stroke=\"#E8E8E8\"\n          width=\"71\"\n          x=\"212.5\"\n          y=\"68.5\"\n        />\n        <circle cx=\"44\" cy=\"80\" r=\"11.5\" stroke=\"#E8E8E8\" />\n        <rect\n          height=\"11\"\n          rx=\"5.5\"\n          stroke=\"#E8E8E8\"\n          width=\"63\"\n          x=\"64.5\"\n          y=\"74.5\"\n        />\n      </g>\n      <defs>\n        <linearGradient\n          gradientUnits=\"userSpaceOnUse\"\n          id=\"paint0_linear_2254_6088\"\n          x1=\"158\"\n          x2=\"158\"\n          y1=\"0\"\n          y2=\"371\"\n        >\n          <stop />\n          <stop offset=\"1\" stopOpacity=\"0\" />\n        </linearGradient>\n        <linearGradient\n          gradientUnits=\"userSpaceOnUse\"\n          id=\"paint1_linear_2254_6088\"\n          x1=\"529.5\"\n          x2=\"529.5\"\n          y1=\"8\"\n          y2=\"324\"\n        >\n          <stop offset=\"0.4\" />\n          <stop offset=\"1\" stopOpacity=\"0\" />\n        </linearGradient>\n        <linearGradient\n          gradientUnits=\"userSpaceOnUse\"\n          id=\"paint2_linear_2254_6088\"\n          x1=\"158\"\n          x2=\"158\"\n          y1=\"48\"\n          y2=\"359\"\n        >\n          <stop />\n          <stop offset=\"1\" stopOpacity=\"0\" />\n        </linearGradient>\n        <clipPath id=\"clip0_2254_6088\">\n          <rect fill=\"white\" height=\"112\" width=\"316\" />\n        </clipPath>\n      </defs>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/(home)/sections/hero-scraping/_svg/BrowserTab.tsx",
    "content": "import { HTMLAttributes } from \"react\";\n\nexport default function BrowserTab(attrs: HTMLAttributes<SVGSVGElement>) {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"36\"\n      viewBox=\"0 0 226 36\"\n      width=\"226\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...attrs}\n    >\n      <path\n        d=\"M0 35C5.52285 35 10 30.5228 10 25V11C10 5.47715 14.4772 1 20 1H206C211.523 1 216 5.47715 216 11V25C216 30.5228 220.477 35 226 35\"\n        stroke=\"#E8E8E8\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/app/.cursor/rules/home-page-components.md",
    "content": "# Home Page Components Rules\n\nWhen working with home/landing page components in components-new/app/(home):\n\n## Structure\n```\nhome/\n├── sections/         # Major page sections\n│   ├── hero/        # Hero section with flames\n│   ├── features/    # Feature showcase\n│   ├── testimonials/# Customer testimonials\n│   ├── pricing/     # Pricing cards\n│   └── faq/         # FAQ section\n├── navbar/          # Landing page navbar\n└── footer/          # Landing page footer\n```\n\n## Migration Notes\nThese components will be migrated from `marketing/` when beginning home page migration after Dashboard v2.\n\n### Priority Sections to Migrate:\n1. **Hero** - Main landing with HeroFlame effect\n2. **Features** - Feature grid with animations\n3. **Testimonials** - Social proof section\n4. **Pricing** - Pricing tiers with heat buttons\n5. **FAQ** - Collapsible FAQ items\n\n### Usage Pattern:\n```tsx\n// app/page.tsx (future)\nimport { Hero } from '@/components/home/sections/hero';\nimport { Features } from '@/components/home/sections/features';\nimport { Testimonials } from '@/components/home/sections/testimonials';\nimport { Pricing } from '@/components/home/sections/pricing';\nimport { FAQ } from '@/components/home/sections/faq';\n\nexport default function HomePage() {\n  return (\n    <>\n      <Hero />\n      <Features />\n      <Testimonials />\n      <Pricing />\n      <FAQ />\n    </>\n  );\n}\n```\n\n## Design Principles\n- **Fire theme**: Subtle flame effects in hero\n- **Performance**: Lazy load below-fold sections\n- **Responsive**: Mobile-first approach\n- **Animations**: Intersection observer for scroll effects"
  },
  {
    "path": "components/app/generation/SidebarInput.tsx",
    "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport Link from \"next/link\";\nimport { appConfig } from \"@/config/app.config\";\n\ninterface SidebarInputProps {\n  onSubmit: (url: string, style: string, model: string, instructions?: string) => void;\n  disabled?: boolean;\n}\n\nexport default function SidebarInput({ onSubmit, disabled = false }: SidebarInputProps) {\n  const [url, setUrl] = useState<string>(\"\");\n  const [selectedStyle, setSelectedStyle] = useState<string>(\"1\");\n  const [selectedModel, setSelectedModel] = useState<string>(appConfig.ai.defaultModel);\n  const [additionalInstructions, setAdditionalInstructions] = useState<string>(\"\");\n  const [isValidUrl, setIsValidUrl] = useState<boolean>(false);\n\n  // Simple URL validation - currently unused but keeping for future use\n  // const validateUrl = (urlString: string) => {\n  //   if (!urlString) return false;\n  //   const urlPattern = /^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;\n  //   return urlPattern.test(urlString.toLowerCase());\n  // };\n\n  const styles = [\n    { id: \"1\", name: \"Glassmorphism\", description: \"Frosted glass effect\" },\n    { id: \"2\", name: \"Neumorphism\", description: \"Soft 3D shadows\" },\n    { id: \"3\", name: \"Brutalism\", description: \"Bold and raw\" },\n    { id: \"4\", name: \"Minimalist\", description: \"Clean and simple\" },\n    { id: \"5\", name: \"Dark Mode\", description: \"Dark theme design\" },\n    { id: \"6\", name: \"Gradient Rich\", description: \"Vibrant gradients\" },\n    { id: \"7\", name: \"3D Depth\", description: \"Dimensional layers\" },\n    { id: \"8\", name: \"Retro Wave\", description: \"80s inspired\" },\n  ];\n\n  const models = appConfig.ai.availableModels.map(model => ({\n    id: model,\n    name: appConfig.ai.modelDisplayNames[model] || model,\n  }));\n\n  const handleSubmit = (e?: React.FormEvent) => {\n    if (e) e.preventDefault();\n    if (!url.trim() || disabled) return;\n\n    onSubmit(url.trim(), selectedStyle, selectedModel, additionalInstructions || undefined);\n\n    // Reset form\n    setUrl(\"\");\n    setAdditionalInstructions(\"\");\n    setIsValidUrl(false);\n  };\n\n  return (\n    <div className=\"w-full\">\n      <div >\n        <div className=\"p-4 border-b border-gray-100\">\n         {/* link to home page with button */}\n         <Link href=\"/\">\n          <button className=\"w-full px-3 py-2 text-xs font-medium text-gray-700 bg-white rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500\">\n            Generate a new website\n          </button>\n         </Link>\n        </div>\n\n        {/* Options Section - Show when valid URL */}\n        {isValidUrl && (\n          <div className=\"p-4 space-y-4\">\n            {/* Style Selector */}\n            <div>\n              <label className=\"block text-xs font-medium text-gray-700 mb-2\">Style</label>\n              <div className=\"grid grid-cols-2 gap-1.5\">\n                {styles.map((style) => (\n                  <button\n                    key={style.id}\n                    onClick={() => setSelectedStyle(style.id)}\n                    disabled={disabled}\n                    className={`\n                      py-2 px-2 rounded text-xs font-medium border transition-all text-center\n                      ${selectedStyle === style.id\n                        ? 'border-orange-500 bg-orange-50 text-orange-900'\n                        : 'border-gray-200 hover:border-gray-300 bg-white text-gray-700'\n                      }\n                      ${disabled ? 'opacity-50 cursor-not-allowed' : ''}\n                    `}\n                  >\n                    {style.name}\n                  </button>\n                ))}\n              </div>\n            </div>\n\n            {/* Model Selector */}\n            <div>\n              <label className=\"block text-xs font-medium text-gray-700 mb-2\">AI Model</label>\n              <select\n                value={selectedModel}\n                onChange={(e) => setSelectedModel(e.target.value)}\n                disabled={disabled}\n                className=\"w-full px-3 py-2 text-xs font-medium text-gray-700 bg-white rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500\"\n              >\n                {models.map((model) => (\n                  <option key={model.id} value={model.id}>\n                    {model.name}\n                  </option>\n                ))}\n              </select>\n            </div>\n\n            {/* Additional Instructions */}\n            <div>\n              <label className=\"block text-xs font-medium text-gray-700 mb-2\">Additional Instructions (optional)</label>\n              <input\n                type=\"text\"\n                value={additionalInstructions}\n                onChange={(e) => setAdditionalInstructions(e.target.value)}\n                disabled={disabled}\n                className=\"w-full px-3 py-2 text-xs text-gray-700 bg-gray-50 rounded border border-gray-200 focus:border-orange-500 focus:outline-none focus:ring-1 focus:ring-orange-500 placeholder:text-gray-400\"\n                placeholder=\"e.g., make it more colorful, add animations...\"\n              />\n            </div>\n\n            {/* Submit Button */}\n            <div className=\"pt-2\">\n              <button\n                onClick={handleSubmit}\n                disabled={!isValidUrl || disabled}\n                className={`\n                  w-full py-2.5 px-4 rounded-lg text-sm font-medium transition-all\n                  ${isValidUrl && !disabled\n                    ? 'bg-orange-500 hover:bg-orange-600 text-white'\n                    : 'bg-gray-200 text-gray-400 cursor-not-allowed'\n                  }\n                `}\n              >\n                {disabled ? 'Scraping...' : 'Scrape Site'}\n              </button>\n            </div>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}"
  },
  {
    "path": "components/app/generation/SidebarQuickInput.tsx",
    "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport HeroInputSubmitButton from \"@/components/app/(home)/sections/hero-input/Button/Button\";\n\ninterface SidebarQuickInputProps {\n  onSubmit: (url: string) => void;\n  disabled?: boolean;\n}\n\nexport default function SidebarQuickInput({ onSubmit, disabled = false }: SidebarQuickInputProps) {\n  const [url, setUrl] = useState<string>(\"\");\n\n  const handleSubmit = (e?: React.FormEvent) => {\n    if (e) e.preventDefault();\n    if (!url.trim() || disabled) return;\n    \n    onSubmit(url.trim());\n    setUrl(\"\");\n  };\n\n  return (\n    <div className=\"w-full\">\n      <div className=\"bg-gray-50 rounded-lg border border-gray-200\">\n        <div className=\"p-3 flex items-center gap-3\">\n          <input\n            className=\"flex-1 bg-transparent text-sm text-gray-900 placeholder:text-gray-400 focus:outline-none\"\n            placeholder=\"Enter a new URL to regenerate...\"\n            type=\"text\"\n            value={url}\n            disabled={disabled}\n            onChange={(e) => setUrl(e.target.value)}\n            onKeyDown={(e) => {\n              if (e.key === \"Enter\") {\n                e.preventDefault();\n                handleSubmit();\n              }\n            }}\n          />\n          <div onClick={handleSubmit}>\n            <HeroInputSubmitButton dirty={url.length > 0} />\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}"
  },
  {
    "path": "components/shared/Playground/Context/types.ts",
    "content": "export enum Endpoint {\n  Scrape = \"scrape\",\n  Crawl = \"crawl\",\n  Search = \"search\",\n  Map = \"map\",\n  Extract = \"extract\",\n}\n\nexport enum AgentModel {\n  FIRE_1 = \"FIRE-1\",\n}\n\nexport enum FormatType {\n  Markdown = \"markdown\",\n  Summary = \"summary\",\n  Json = \"json\",\n  RawHtml = \"rawHtml\",\n  Html = \"html\",\n  Screenshot = \"screenshot\",\n  ScreenshotFullPage = \"screenshot@fullPage\",\n  Links = \"links\",\n}\n\nexport enum SearchFormatType {\n  Web = \"web\",\n  Images = \"images\",\n  News = \"news\",\n}\n\ntype Prev = [never, 0, 1, 2, 3, 4, 5];\n\ntype Join<K, P> = K extends string | number\n  ? P extends string | number\n    ? `${K}.${P}`\n    : never\n  : never;\n\nexport type Paths<T, D extends number = 5> = [D] extends [never]\n  ? never\n  : T extends object\n    ? {\n        [K in keyof T]-?: K extends string | number\n          ? T[K] extends object\n            ? K | Join<K, Paths<T[K], Prev[D]>>\n            : K\n          : never;\n      }[keyof T]\n    : \"\";\n"
  },
  {
    "path": "components/shared/animated-dot-icon.tsx",
    "content": "\"use client\";\n\nimport { animate } from \"framer-motion\";\nimport { useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ninterface AnimatedDotIconProps {\n  active?: boolean;\n  alwaysHeat?: boolean;\n  triggerOnHover?: boolean;\n  size?: number;\n  className?: string;\n  pattern?:\n    | \"usage\"\n    | \"api-keys\"\n    | \"settings\"\n    | \"overview\"\n    | \"team\"\n    | \"billing\"\n    | \"account-settings\"\n    | \"admin\"\n    | \"domain-checker\"\n    | \"extract-playground\"\n    | \"extract\"\n    | \"logs\"\n    | \"playground\"\n    | \"teams\";\n}\n\nconst initCanvas = (canvas: HTMLCanvasElement) => {\n  const { width, height } = canvas.getBoundingClientRect();\n  const ctx = canvas.getContext(\"2d\")!;\n\n  canvas.style.width = `${width}px`;\n  canvas.style.height = `${height}px`;\n\n  const upscaleCanvas = () => {\n    const scale = window.visualViewport?.scale || 1;\n    const dpr = (window.devicePixelRatio || 1) * scale;\n\n    canvas.width = width * dpr;\n    canvas.height = height * dpr;\n\n    ctx.scale(dpr, dpr);\n\n    canvas.dispatchEvent(new Event(\"resize\"));\n  };\n\n  upscaleCanvas();\n\n  const handleResize = () => {\n    setTimeout(upscaleCanvas, 500);\n  };\n\n  window.addEventListener(\"resize\", handleResize);\n  window.visualViewport?.addEventListener(\"resize\", handleResize);\n\n  return ctx;\n};\n\n// Pattern definitions for different pages\nconst patterns = {\n  usage: {\n    grid: [\n      [10, 11, 12, 14, 15, 16],\n      [3, 7, 19, 23],\n      [0, 2, 24, 26],\n      [27, 28, 29, 31, 32, 33],\n    ],\n    gridSize: 7,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  \"api-keys\": {\n    grid: [[12], [10, 14], [8, 16], [6, 18], [4, 5, 19, 20]],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  settings: {\n    grid: [\n      [0, 1, 2, 3, 4],\n      [5, 9],\n      [10, 14],\n      [15, 19],\n      [20, 21, 22, 23, 24],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  overview: {\n    grid: [\n      [24],\n      [16, 18, 30, 32],\n      [8, 12, 36, 40],\n      [0, 3, 6, 21, 27, 42, 45, 48],\n    ],\n    gridSize: 7,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  team: {\n    grid: [\n      [6, 7, 8],\n      [11, 12, 13],\n      [16, 17, 18],\n      [0, 4, 20, 24],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  teams: {\n    grid: [\n      [6, 7, 8],\n      [11, 12, 13],\n      [16, 17, 18],\n      [0, 4, 20, 24],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  billing: {\n    grid: [\n      [0, 4],\n      [5, 6, 8, 9],\n      [10, 11, 13, 14],\n      [15, 19],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  \"account-settings\": {\n    grid: [\n      [2, 7, 12, 17, 22],\n      [5, 10, 15, 20],\n      [8, 13, 18],\n      [11, 16],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  admin: {\n    grid: [\n      [0, 1, 2, 3, 4],\n      [5, 14],\n      [10, 11, 12, 13],\n      [15, 24],\n      [20, 21, 22, 23, 24],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  \"domain-checker\": {\n    grid: [\n      [12, 13, 14],\n      [7, 11, 15, 19],\n      [2, 6, 20, 24],\n      [0, 1, 25, 26],\n    ],\n    gridSize: 6,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  \"extract-playground\": {\n    grid: [\n      [5, 10, 15, 20],\n      [6, 11, 16, 21],\n      [7, 12, 17, 22],\n      [8, 13, 18, 23],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  extract: {\n    grid: [[12], [7, 17], [2, 6, 18, 22], [0, 1, 3, 4, 20, 21, 23, 24]],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  logs: {\n    grid: [\n      [0, 5, 10, 15, 20],\n      [1, 6, 11, 16, 21],\n      [2, 7, 12, 17, 22],\n      [3, 8, 13, 18, 23],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n  playground: {\n    grid: [\n      [6, 8, 16, 18],\n      [10, 11, 12, 13, 14],\n      [5, 9, 15, 19],\n      [0, 4, 20, 24],\n    ],\n    gridSize: 5,\n    cellSize: 2,\n    spacing: 2,\n    offset: 3,\n  },\n};\n\nexport function AnimatedDotIcon({\n  active = true,\n  alwaysHeat = false,\n  triggerOnHover = false,\n  size = 20,\n  className,\n  pattern = \"usage\",\n}: AnimatedDotIconProps) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  const fnRefs = useRef<{\n    activate: () => void;\n    deactivate: () => void;\n  }>({ activate: () => {}, deactivate: () => {} });\n\n  useEffect(() => {\n    const canvas = canvasRef.current;\n    if (!canvas) return;\n\n    const ctx = initCanvas(canvas);\n    const config = patterns[pattern];\n\n    let isRunning = false;\n    let isActive = false;\n\n    let activeGroup = 0;\n    const rowAlphas = [0.2, 0.4, 1, 0.04];\n\n    const scaler = size / 20;\n\n    const render = () => {\n      ctx.fillStyle = \"#fa5d19\";\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n      for (const group of config.grid.slice(0, 4)) {\n        const groupIndex = config.grid.indexOf(group);\n        ctx.globalAlpha = rowAlphas[groupIndex];\n\n        for (const index of group) {\n          ctx.fillRect(\n            (config.offset + (index % config.gridSize) * config.spacing) *\n              scaler,\n            (config.offset +\n              Math.floor(index / config.gridSize) * config.spacing) *\n              scaler,\n            config.cellSize * scaler,\n            config.cellSize * scaler,\n          );\n        }\n      }\n\n      if (isRunning) {\n        requestAnimationFrame(render);\n      }\n    };\n\n    const timeouts: number[] = [];\n    let runCount = 0;\n\n    const cycle = () => {\n      isRunning = true;\n      activeGroup = (activeGroup + 1) % 5;\n\n      rowAlphas.forEach((alpha, index) => {\n        let targetAlpha = alpha;\n\n        if (index === activeGroup) targetAlpha = 1;\n        else if (index === (activeGroup + 1) % 4) targetAlpha = 0.12;\n        else if (index === (activeGroup + 2) % 4) targetAlpha = 0.2;\n        else if (index === (activeGroup + 3) % 4) targetAlpha = 0.4;\n\n        animate(alpha, targetAlpha, {\n          duration: 0.05,\n          onUpdate: (value) => {\n            rowAlphas[index] = value;\n          },\n        });\n      });\n\n      timeouts.forEach((timeout) => {\n        window.clearTimeout(timeout);\n      });\n\n      timeouts.push(\n        window.setTimeout(() => {\n          isRunning = false;\n        }, 300),\n      );\n\n      if (activeGroup === 3) runCount += 1;\n\n      if ((runCount === 2 || !isActive) && activeGroup === 2) return;\n\n      timeouts.push(\n        window.setTimeout(() => {\n          cycle();\n        }, 50),\n      );\n    };\n\n    fnRefs.current = {\n      activate: () => {\n        if (isActive) return;\n\n        isActive = true;\n        runCount = 0;\n        cycle();\n        render();\n      },\n      deactivate: () => {\n        if (!isActive) return;\n        isActive = false;\n      },\n    };\n\n    render();\n    canvas.addEventListener(\"resize\", render);\n\n    if (triggerOnHover) {\n      const group = canvasRef.current!.closest(\".group\");\n\n      if (group) {\n        group.addEventListener(\"mouseenter\", fnRefs.current.activate);\n        group.addEventListener(\"mouseleave\", fnRefs.current.deactivate);\n\n        return () => {\n          group.removeEventListener(\"mouseenter\", fnRefs.current.activate);\n          group.removeEventListener(\"mouseleave\", fnRefs.current.deactivate);\n        };\n      }\n    }\n  }, [triggerOnHover, size, pattern]);\n\n  useEffect(() => {\n    if (triggerOnHover) return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        if (entry.isIntersecting && active) {\n          fnRefs.current.activate();\n        } else {\n          fnRefs.current.deactivate();\n        }\n      },\n      { threshold: 0.5 },\n    );\n\n    observer.observe(canvasRef.current!);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [active, triggerOnHover]);\n\n  return (\n    <canvas\n      className={cn(\n        alwaysHeat\n          ? \"\"\n          : [\n              \"[&.grayscale]:opacity-60 transition-[filter,opacity]\",\n              !active && \"grayscale\",\n            ],\n        className,\n      )}\n      ref={canvasRef}\n      style={{ width: size, height: size }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/shared/animated-height.tsx",
    "content": "\"use client\";\n\nimport React, { useRef, useEffect, ReactNode, useState } from \"react\";\n\n// Smoothly animates its container to match the natural height of its content.\n// Fixes previous behavior where the component observed itself, causing height 0\n// with overflow hidden (content clipped) or visible overflow that overlapped\n// following sections like the footer.\nexport default function AnimatedHeight({\n  children,\n  overflow = true,\n}: {\n  children: ReactNode;\n  overflow?: boolean;\n}) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const contentRef = useRef<HTMLDivElement>(null);\n  const [measuredHeight, setMeasuredHeight] = useState<number | null>(null);\n  const hasAnimatedOnceRef = useRef(false);\n\n  useEffect(() => {\n    const contentEl = contentRef.current;\n    const containerEl = containerRef.current;\n    if (!contentEl || !containerEl) return;\n\n    const updateHeight = () => {\n      // Use scrollHeight to capture full natural height, including overflowed content\n      const height = contentEl.scrollHeight;\n      setMeasuredHeight((prev) => (prev === height ? prev : height));\n\n      // Enable transition after the first measurement to avoid initial jank\n      if (!hasAnimatedOnceRef.current) {\n        containerEl.style.transition = \"height 300ms ease-in-out\";\n        hasAnimatedOnceRef.current = true;\n      }\n    };\n\n    // Initial measure\n    updateHeight();\n\n    const resizeObserver = new ResizeObserver(() => updateHeight());\n    resizeObserver.observe(contentEl);\n\n    return () => resizeObserver.disconnect();\n  }, []);\n\n  return (\n    <div\n      ref={containerRef}\n      style={{\n        overflow: overflow ? \"hidden\" : \"visible\",\n        height: measuredHeight === null ? undefined : `${measuredHeight}px`,\n      }}\n    >\n      <div ref={contentRef}>{children}</div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/ascii-background.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nconst asciiPatterns = [\n  `·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  \n·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  \n·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·`,\n  `·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  \n·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  \n·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·`,\n  `·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  \n·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·\n  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  \n·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  ·`,\n  `·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·  ·\n  ·  ·  ▪  ▄  █  ▄  ▪  ·  ·  ·  ·  ▪  ▄  █  ▄  ▪  ·  ·  ·  \n·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  ·  ·  ▪  ▄  ▪  ·  ·  ·  ·  ·\n  ·  ·  ·  ▪  ·  ·  ·  ·  ·  ·  ·  ·  ·  ▪  ·  ·  ·  ·  ·  \n·  ·  ▪  ▄  █  ▄  ▪  ·  ·  ·  ·  ▪  ▄  █  ▄  ▪  ·  ·  ·  ·`,\n];\n\ninterface AsciiBackgroundProps {\n  className?: string;\n  variant?: \"dots\" | \"grid\" | \"flame\";\n}\n\nexport function AsciiBackground({\n  className,\n  variant = \"dots\",\n}: AsciiBackgroundProps) {\n  const [frameIndex, setFrameIndex] = useState(0);\n\n  useEffect(() => {\n    const interval = setInterval(() => {\n      setFrameIndex((prev) => (prev + 1) % asciiPatterns.length);\n    }, 2000);\n\n    return () => clearInterval(interval);\n  }, []);\n\n  return (\n    <div\n      className={cn(\n        \"absolute inset-0 pointer-events-none select-none overflow-hidden\",\n        className,\n      )}\n    >\n      <pre className=\"text-heat-100/3 font-mono text-[10px] leading-tight whitespace-pre absolute top-0 left-0 w-full h-full flex items-center justify-center\">\n        {asciiPatterns[frameIndex]}\n      </pre>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/ascii-flame-background.tsx",
    "content": "\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"@/components/shared/effects/flame/explosion-data.json\";\n\ninterface AsciiFlameBackgroundProps {\n  className?: string;\n  colorClassName?: string;\n  fontSizePx?: number;\n  lineHeightPx?: number;\n}\n\n// Reusable ASCII flame background (same frames used by CoreReliableBarFlame)\nexport default function AsciiFlameBackground({\n  className,\n  colorClassName = \"text-heat-100/30\",\n  fontSizePx = 10,\n  lineHeightPx = 12.5,\n}: AsciiFlameBackgroundProps) {\n  const wrapperRef = useRef<HTMLDivElement>(null);\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n    const stop = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index += 1;\n        if (index >= (data as string[]).length) index = 0;\n        if (ref.current) ref.current.innerHTML = (data as string[])[index];\n      },\n      interval: 80,\n    });\n\n    return () => stop?.();\n  }, []);\n\n  return (\n    <div\n      ref={wrapperRef}\n      className={cn(\"relative pointer-events-none select-none\", className)}\n    >\n      <div\n        ref={ref}\n        className={cn(\n          \"font-ascii absolute inset-0 fc-decoration\",\n          colorClassName,\n        )}\n        style={{\n          whiteSpace: \"pre\",\n          fontSize: `${fontSizePx}px`,\n          lineHeight: `${lineHeightPx}px`,\n        }}\n      />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/button/Button.css",
    "content": ".button {\n  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.1s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.1s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:active {\n  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.05s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button-primary {\n  background: #ff4c00;\n  background: color(display-p3 0.9816 0.3634 0.0984);\n\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:hover {\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 4px 8px 0px rgba(255, 77, 0, 0.16),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 4px 8px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:active {\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-background {\n  background: linear-gradient(to bottom, white, transparent);\n\n  opacity: 0.06;\n\n  transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:hover .button-background {\n  opacity: 0.08;\n}\n\n.button:active .button-background {\n  opacity: 0;\n\n  transition: opacity 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n"
  },
  {
    "path": "components/shared/button/Button.tsx",
    "content": "import { Children, ButtonHTMLAttributes } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\ninterface Props extends ButtonHTMLAttributes<HTMLButtonElement> {\n  variant?: \"primary\" | \"secondary\" | \"tertiary\" | \"playground\" | \"destructive\";\n  size?: \"default\" | \"large\";\n  disabled?: boolean;\n}\n\nexport default function Button({\n  variant = \"primary\",\n  size = \"default\",\n  disabled,\n  ...attrs\n}: Props) {\n  const children = handleChildren(attrs.children);\n\n  return (\n    <button\n      {...attrs}\n      type={attrs.type ?? \"button\"}\n      className={cn(\n        attrs.className,\n        \"[&>span]:px-6 flex items-center justify-center button relative [&>*]:relative\",\n        \"text-label-medium lg-max:[&_svg]:size-24\",\n        `button-${variant} group/button`,\n        {\n          \"rounded-8 p-6\": size === \"default\",\n          \"rounded-10 p-8 gap-2\": size === \"large\",\n\n          \"text-accent-white active:[scale:0.995]\": variant === \"primary\",\n          \"text-accent-black active:[scale:0.99] active:bg-black-alpha-7\": [\n            \"secondary\",\n            \"tertiary\",\n            \"playground\",\n          ].includes(variant),\n          \"bg-black-alpha-4 hover:bg-black-alpha-6\": variant === \"secondary\",\n          \"hover:bg-black-alpha-4\": variant === \"tertiary\",\n        },\n        variant === \"playground\" && [\n          \"inside-border before:border-black-alpha-4\",\n          disabled\n            ? \"before:opacity-0 bg-black-alpha-4 text-black-alpha-24\"\n            : \"hover:bg-black-alpha-4 hover:before:opacity-0 active:before:opacity-0\",\n        ],\n      )}\n      disabled={disabled}\n    >\n      {variant === \"primary\" && (\n        <div className=\"overlay button-background !absolute\" />\n      )}\n\n      {children}\n    </button>\n  );\n}\n\nconst handleChildren = (children: React.ReactNode) => {\n  return Children.toArray(children).map((child) => {\n    if (typeof child === \"string\") {\n      return <span key={child}>{child}</span>;\n    }\n\n    return child;\n  });\n};\n"
  },
  {
    "path": "components/shared/buttons/capsule-button.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { LucideIcon } from \"lucide-react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport AnimatedWidth from \"@/components/shared/layout/animated-width\";\n\ninterface CapsuleButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  icon?: LucideIcon | React.ComponentType<{ className?: string }>;\n  iconPosition?: \"left\" | \"right\";\n  children: React.ReactNode;\n  size?: \"sm\" | \"md\" | \"lg\";\n  fullWidth?: boolean;\n  variant?: \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\";\n  loading?: boolean;\n}\n\nexport function CapsuleButton({\n  icon: Icon,\n  iconPosition = \"left\",\n  children,\n  className,\n  size = \"md\",\n  fullWidth = false,\n  variant = \"primary\",\n  loading = false,\n  disabled,\n  ...props\n}: CapsuleButtonProps) {\n  const [isPressed, setIsPressed] = React.useState(false);\n\n  const sizeClasses = {\n    sm: \"h-32 px-16 text-label-small gap-6\",\n    md: \"h-40 px-20 text-label-medium gap-8\",\n    lg: \"h-40 px-20 text-label-medium gap-8\",\n  };\n\n  const iconSizes = {\n    sm: \"w-14 h-14\",\n    md: \"w-16 h-16\",\n    lg: \"w-16 h-16\",\n  };\n\n  const variants = {\n    primary: [\n      \"bg-heat-100 text-white\",\n      \"hover:bg-heat-200\",\n      \"active:scale-[0.98]\",\n      \"shadow-[0_1px_2px_rgba(0,0,0,0.05)]\",\n      \"hover:shadow-[0_4px_12px_rgba(250,93,25,0.25)]\",\n    ],\n    secondary: [\n      \"bg-black text-white\",\n      \"hover:bg-black/90\",\n      \"active:scale-[0.98]\",\n      \"shadow-[0_1px_2px_rgba(0,0,0,0.05)]\",\n      \"hover:shadow-[0_4px_12px_rgba(0,0,0,0.15)]\",\n    ],\n    tertiary: [\n      \"bg-white text-black border border-black-alpha-8\",\n      \"hover:bg-black-alpha-4 hover:border-black-alpha-12\",\n      \"active:scale-[0.98]\",\n    ],\n    ghost: [\n      \"bg-transparent text-black-alpha-60\",\n      \"hover:text-black hover:bg-black-alpha-4\",\n      \"active:scale-[0.98]\",\n    ],\n  };\n\n  const isDisabled = disabled || loading;\n\n  return (\n    <button\n      className={cn(\n        // Base styles\n        \"inline-flex items-center justify-center rounded-full  transition-all duration-200\",\n        // Size\n        sizeClasses[size],\n        // Variant\n        variants[variant],\n        // Full width\n        fullWidth && \"w-full\",\n        // Disabled state\n        isDisabled && [\n          \"opacity-50 cursor-not-allowed\",\n          \"hover:shadow-none hover:bg-current\",\n        ],\n        // Pressed state\n        isPressed && \"scale-[0.98]\",\n        className,\n      )}\n      disabled={isDisabled}\n      onMouseDown={() => !isDisabled && setIsPressed(true)}\n      onMouseUp={() => setIsPressed(false)}\n      onMouseLeave={() => setIsPressed(false)}\n      {...props}\n    >\n      <AnimatedWidth initial={{ width: \"auto\" }}>\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          {loading ? (\n            <motion.div\n              key=\"loading\"\n              animate={{ opacity: 1, filter: \"blur(0px)\", scale: 1 }}\n              className=\"flex gap-8 items-center justify-center\"\n              exit={{ opacity: 0, filter: \"blur(2px)\", scale: 0.9 }}\n              initial={{ opacity: 0, filter: \"blur(2px)\", scale: 0.95 }}\n            >\n              <span>Loading...</span>\n            </motion.div>\n          ) : (\n            <motion.div\n              key=\"content\"\n              animate={{ opacity: 1, filter: \"blur(0px)\", scale: 1 }}\n              className=\"flex gap-8 items-center justify-center\"\n              exit={{ opacity: 0, filter: \"blur(2px)\", scale: 0.9 }}\n              initial={{ opacity: 0, filter: \"blur(2px)\", scale: 0.95 }}\n            >\n              {Icon && iconPosition === \"left\" && (\n                <span\n                  className={cn(\n                    iconSizes[size],\n                    \"flex-shrink-0 inline-flex items-center justify-center\",\n                  )}\n                >\n                  <Icon className=\"w-full h-full\" />\n                </span>\n              )}\n              <span>{children}</span>\n              {Icon && iconPosition === \"right\" && (\n                <span\n                  className={cn(\n                    iconSizes[size],\n                    \"flex-shrink-0 inline-flex items-center justify-center\",\n                  )}\n                >\n                  <Icon className=\"w-full h-full\" />\n                </span>\n              )}\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </AnimatedWidth>\n    </button>\n  );\n}\n"
  },
  {
    "path": "components/shared/buttons/fire-action-link.tsx",
    "content": "import Link from \"next/link\";\nimport { cn } from \"@/utils/cn\";\n\ninterface FireActionLinkProps {\n  href?: string;\n  label: string;\n  className?: string;\n  variant?: \"link\" | \"button\";\n  onClick?: () => void;\n}\n\nexport function FireActionLink({\n  href,\n  label,\n  className,\n  variant = \"link\",\n  onClick,\n}: FireActionLinkProps) {\n  const baseClasses =\n    variant === \"button\"\n      ? cn(\n          \"inline-block py-4 px-8 rounded-6\",\n          \"text-label-small text-heat-100 bg-heat-4\",\n          \"hover:bg-heat-8 transition-all\",\n          \"active:scale-[0.98]\",\n          className,\n        )\n      : cn(\n          \"text-label-small text-secondary hover:text-heat-100 transition-all\",\n          \"hover:underline underline-offset-4\",\n          \"active:scale-[0.98]\",\n          className,\n        );\n\n  if (onClick) {\n    return (\n      <button onClick={onClick} className={baseClasses}>\n        {label}\n      </button>\n    );\n  }\n\n  return (\n    <Link href={href || \"#\"} className={baseClasses}>\n      {label}\n    </Link>\n  );\n}\n"
  },
  {
    "path": "components/shared/buttons/index.ts",
    "content": "// Button Components\nexport { SlateButton } from \"./slate-button\";\n// export { HeatButton } from \"./heat-button\";\nexport { FireActionLink } from \"./fire-action-link\";\n"
  },
  {
    "path": "components/shared/buttons/slate-button.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { LucideIcon } from \"lucide-react\";\n\ninterface SlateButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n  icon?:\n    | LucideIcon\n    | React.ComponentType<{\n        className?: string;\n        isHovered?: boolean;\n        isOpen?: boolean;\n      }>\n    | React.ReactNode;\n  iconPosition?: \"left\" | \"right\";\n  children: React.ReactNode;\n  size?: \"sm\" | \"md\" | \"lg\";\n  fullWidth?: boolean;\n  isLoading?: boolean;\n  isOpen?: boolean;\n}\n\nexport const SlateButton = React.forwardRef<\n  HTMLButtonElement,\n  SlateButtonProps\n>(\n  (\n    {\n      icon: Icon,\n      iconPosition = \"left\",\n      children,\n      className,\n      size = \"md\",\n      fullWidth = false,\n      isLoading = false,\n      isOpen = false,\n      disabled,\n      ...props\n    },\n    ref,\n  ) => {\n    const [isHovered, setIsHovered] = React.useState(false);\n\n    const sizeClasses = {\n      sm: \"h-32 px-12 text-body-small gap-6\",\n      md: \"h-40 px-16 text-body-medium gap-8\",\n      lg: \"h-48 px-24 text-body-large gap-10\",\n    };\n\n    const iconSizes = {\n      sm: \"w-14 h-14\",\n      md: \"w-16 h-16\",\n      lg: \"w-20 h-20\",\n    };\n\n    return (\n      <button\n        ref={ref}\n        className={cn(\n          // Base styles\n          \"inline-flex items-center justify-center rounded-12  transition-all\",\n          // Colors\n          \"bg-black-alpha-4 text-accent-black\",\n          \"hover:bg-black-alpha-6\",\n          \"active:scale-[0.98]\",\n          // Border\n          // \"border-0\",\n          // Size\n          sizeClasses[size],\n          // States\n          disabled && \"opacity-50 cursor-not-allowed\",\n          isLoading && \"cursor-wait\",\n          // Full width\n          fullWidth && \"w-full\",\n          className,\n        )}\n        disabled={disabled || isLoading}\n        onMouseEnter={() => setIsHovered(true)}\n        onMouseLeave={() => setIsHovered(false)}\n        {...props}\n      >\n        {isLoading ? (\n          <div className={cn(\"animate-spin rounded-full\", iconSizes[size])} />\n        ) : (\n          <>\n            {Icon &&\n              iconPosition === \"left\" &&\n              (React.isValidElement(Icon) ? (\n                Icon\n              ) : (\n                //@ts-expect-error - Icon component type allows JSX element\n                <Icon\n                  className={cn(iconSizes[size], \"flex-shrink-0\")}\n                  isHovered={isHovered}\n                  isOpen={isOpen}\n                />\n              ))}\n            {children}\n            {Icon &&\n              iconPosition === \"right\" &&\n              (React.isValidElement(Icon) ? (\n                Icon\n              ) : (\n                //@ts-expect-error - Icon component type allows JSX element\n                <Icon\n                  className={cn(iconSizes[size], \"flex-shrink-0\")}\n                  isHovered={isHovered}\n                  isOpen={isOpen}\n                />\n              ))}\n          </>\n        )}\n      </button>\n    );\n  },\n);\n\nSlateButton.displayName = \"SlateButton\";\n"
  },
  {
    "path": "components/shared/color-styles/color-styles.tsx",
    "content": "import colors from \"@/styles/colors.json\";\n\nconst TYPED_COLORS = colors as unknown as Record<\n  string,\n  Record<\"hex\" | \"p3\", string>\n>;\n\nconst hslValues = Object.entries(TYPED_COLORS).map(([key, value]) => {\n  // Fix hex values - they need # prefix\n  const hexValue = value.hex.startsWith(\"#\") ? value.hex : `#${value.hex}`;\n  return `--${key}: ${hexValue}`;\n});\n\nconst p3Values = Object.entries(TYPED_COLORS)\n  .filter(([, value]) => value.p3)\n  .map(([key, value]) => `--${key}: color(display-p3 ${value.p3})`);\n\nconst colorsStyle = `\n:root {\n  ${hslValues.join(\";\\n  \")}\n}\n\n@supports (color: color(display-p3 1 1 1)) {\n  :root {\n    ${p3Values.join(\";\\n    \")}\n  }\n}`;\n\nexport default function ColorStyles() {\n  return <style dangerouslySetInnerHTML={{ __html: colorsStyle }} />;\n}\n"
  },
  {
    "path": "components/shared/combobox/combobox.tsx",
    "content": "import { animate, AnimatePresence, cubicBezier, motion } from \"motion/react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport { lockBody } from \"../lockBody\";\nimport PortalToBody from \"../utils/portal-to-body\";\n\nexport default function Combobox({\n  placeholder,\n  options,\n  value,\n  onChange,\n  className,\n}: {\n  placeholder?: string;\n  options: { label: string; value: string }[];\n  value: string;\n  onChange: (value: string) => void;\n  className?: string;\n}) {\n  const selected = useMemo(() => {\n    return options.find((option) => option.value === value);\n  }, [options, value]);\n  const [isOpen, setIsOpen] = useState(false);\n  const [bounds, setBounds] = useState<DOMRect | null>(null);\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    lockBody(\"combobox\", isOpen);\n  }, [isOpen]);\n\n  useEffect(() => {\n    document.addEventListener(\"click\", (e) => {\n      if (ref.current && e.composedPath().includes(ref.current)) {\n        return;\n      }\n\n      setIsOpen(false);\n    });\n  }, []);\n\n  return (\n    <div className={cn(\"w-full\", className)} ref={ref}>\n      <button\n        className={cn(\n          \"relative bg-accent-white flex w-full gap-4 rounded-8 p-6 pl-10\",\n          \"inside-border before:border-black-alpha-8 hover:before:border-black-alpha-12 hover:bg-black-alpha-2\",\n          \"text-body-medium\",\n          isOpen &&\n            \"!bg-accent-white before:!border-heat-100 before:!border-[1.25px]\",\n        )}\n        type=\"button\"\n        onClick={(e) => {\n          e.preventDefault();\n          setIsOpen(!isOpen);\n          setBounds(ref.current?.getBoundingClientRect() ?? null);\n        }}\n      >\n        <div className={cn(\"flex-1\", !selected && \"text-black-alpha-40\")}>\n          {selected?.label || placeholder}\n        </div>\n\n        <motion.svg\n          animate={{ rotate: isOpen ? 180 : 0 }}\n          fill=\"none\"\n          height=\"20\"\n          viewBox=\"0 0 20 20\"\n          width=\"20\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path\n            d=\"M7 8.5L10 11.5L13 8.5\"\n            stroke=\"#262626\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeOpacity=\"0.56\"\n            strokeWidth=\"1.25\"\n          />\n        </motion.svg>\n      </button>\n\n      <PortalToBody>\n        <AnimatePresence initial={false}>\n          {isOpen && bounds && (\n            <motion.div\n              animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n              className=\"fixed bg-accent-white rounded-12 z-[401]\"\n              exit={{ opacity: 0, y: 0, filter: \"blur(4px)\" }}\n              initial={{ opacity: 0, y: -12, filter: \"blur(4px)\" }}\n              style={{\n                top: bounds.top + bounds.height + 8,\n                left: bounds.left,\n                width: bounds.width,\n                boxShadow:\n                  \"0px 32px 40px 6px rgba(0, 0, 0, 0.02), 0px 12px 32px 0px rgba(0, 0, 0, 0.02), 0px 24px 32px -8px rgba(0, 0, 0, 0.02), 0px 8px 16px -2px rgba(0, 0, 0, 0.02), 0px 0px 0px 1px rgba(0, 0, 0, 0.04)\",\n              }}\n              transition={{ duration: 0.2 }}\n            >\n              <div className=\"p-4\">\n                <Items\n                  options={options}\n                  onChange={(value) => {\n                    onChange(value);\n                    setIsOpen(false);\n                  }}\n                />\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </PortalToBody>\n    </div>\n  );\n}\n\nconst Items = ({\n  options,\n  onChange,\n}: {\n  options: { label: string; value: string }[];\n  onChange: (value: string) => void;\n}) => {\n  const backgroundRef = useRef<HTMLDivElement>(null);\n\n  return (\n    <div className=\"relative\">\n      <div\n        className=\"absolute top-0 opacity-0 left-0 bg-black-alpha-4 rounded-8 w-full h-32 pointer-events-none\"\n        ref={backgroundRef}\n      />\n\n      {options.map((option) => (\n        <button\n          className=\"w-full group py-6 px-10 text-label-small\"\n          key={option.value}\n          type=\"button\"\n          onClick={() => {\n            onChange(option.value);\n          }}\n          onMouseEnter={(e) => {\n            const t = e.target as HTMLElement;\n\n            let target =\n              t instanceof HTMLButtonElement\n                ? t\n                : (t.closest(\"button\") as HTMLButtonElement);\n            target = target.closest(\".group\") as HTMLButtonElement;\n\n            animate(backgroundRef.current!, { scale: 0.995 }).then(() =>\n              animate(backgroundRef.current!, { scale: 1 }),\n            );\n\n            animate(\n              backgroundRef.current!,\n              {\n                y: target.offsetTop,\n                opacity: 1,\n              },\n              {\n                ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                duration: 0.2,\n              },\n            );\n          }}\n          onMouseLeave={() => {\n            animate(backgroundRef.current!, { opacity: 0 });\n          }}\n        >\n          {option.label}\n        </button>\n      ))}\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/shared/effects/.cursor/rules/flame-effects.md",
    "content": "# Flame Effects Rules\n\nWhen working with visual effects components in components-new/shared/effects:\n\n## Flame ASCII System\n\nThe flame effects are data-driven ASCII animations that create subtle, fire-inspired backgrounds.\n\n### How It Works\n1. **data.json Files**: Each flame component has an accompanying `data.json` file containing ASCII art frames\n2. **Frame Animation**: Components cycle through frames at specified intervals (40-85ms)\n3. **Visibility-Based**: Uses `setIntervalOnVisible` to only animate when in viewport\n4. **innerHTML Rendering**: ASCII frames are inserted as HTML to preserve formatting\n\n### Available Flames\n\n#### CoreFlame\n- Frame Speed: 80ms\n- Size: 1110px × 470px\n- Color: `text-black-alpha-20`\n- Usage: Background texture for sections\n\n#### AsciiExplosion\n- Frame Speed: 40ms (faster)\n- Initial Delay: 30 frames (1.2s)\n- Color: `text-[#FA5D19]` (heat orange)\n- Usage: Dramatic accent for CTAs or empty states\n\n#### HeroFlame\n- Frame Speed: 85ms\n- Features: Mirrored flames on both sides\n- Usage: Hero sections with dual flames\n\n#### FlameBackground (Wrapper)\n- Intensity based on metrics (0-100)\n- Dynamic color (black → orange)\n- Speed increases with intensity\n- Optional pulse animation\n\n### Usage Examples\n```tsx\nimport { CoreFlame } from '@/components/shared/effects/flame';\nimport { FlameBackground } from '@/components/shared/effects/flame';\n\n// Static flame\n<div className=\"relative\">\n  <CoreFlame />\n  <YourContent />\n</div>\n\n// Dynamic intensity flame\n<FlameBackground intensity={cpuUsage} animate={cpuUsage > 80}>\n  <DashboardCard />\n</FlameBackground>\n```\n\n### Performance Considerations\n- **Viewport Detection**: Only animates when visible\n- **GPU Acceleration**: Use `transform` for positioning\n- **Frame Caching**: Frames are pre-loaded from JSON\n- **Cleanup**: Intervals cleared on unmount\n\n### Design Guidelines\n- **Subtlety**: Keep opacity low (10-30%) for backgrounds\n- **Context**: Use sparingly, match intensity to data\n- **Accessibility**: Ensure contrast ratios maintained\n- **Mobile**: Consider reducing/disabling on mobile for performance\n\n### Custom Utility Classes\n- `cw-*`: Custom width (e.g., `cw-720` = 720px)\n- `ch-*`: Custom height (e.g., `ch-470` = 470px)\n- `font-ascii`: Monospace font for ASCII art\n- Colors from heat scale: `text-heat-*`, `text-black-alpha-*`"
  },
  {
    "path": "components/shared/effects/flame/Flame.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nimport data from \"./hero-flame-data.json\";\n\nexport default function CoreFlame(attrs: HTMLAttributes<HTMLDivElement>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = 0;\n\n        const newStr = data[index];\n\n        ref.current!.innerHTML = newStr;\n      },\n      interval: 80,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <>\n      <div className=\"absolute inset-10 -z-[10] overflow-clip\">\n        <div\n          ref={wrapperRef}\n          {...attrs}\n          className={cn(\n            \"cw-[1110px] ch-470 absolute pointer-events-none select-none\",\n            attrs.className,\n          )}\n        >\n          <div\n            className=\"text-black-alpha-20 relative left-0 font-ascii fc-decoration\"\n            ref={ref}\n            style={{\n              whiteSpace: \"pre\",\n              fontSize: 8,\n              lineHeight: \"10px\",\n            }}\n          />\n        </div>\n      </div>\n    </>\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/ascii-explosion.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef, memo } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nimport data from \"./explosion-data.json\";\n\nfunction AsciiExplosion(attrs: HTMLAttributes<HTMLDivElement>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = -30;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = -40;\n        if (index < 0) return;\n\n        if (ref.current) {\n          ref.current.innerHTML = data[index];\n        }\n      },\n      interval: 40,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <div\n      ref={wrapperRef}\n      {...attrs}\n      className={cn(\n        \"w-[720px] h-[400px] absolute flex gap-16 pointer-events-none select-none\",\n        attrs.className,\n      )}\n    >\n      <div\n        className=\"text-[#FA5D19] font-mono fc-decoration\"\n        dangerouslySetInnerHTML={{ __html: data[0] }}\n        ref={ref}\n        style={{\n          whiteSpace: \"pre\",\n          fontSize: \"10px\",\n          lineHeight: \"12.5px\",\n        }}\n      />\n    </div>\n  );\n}\n\n// Memoized version to prevent re-renders on parent state changes\nconst MemoizedAsciiExplosion = memo(AsciiExplosion);\n\n// Named export\nexport { AsciiExplosion };\n\n// Default export for backward compatibility\nexport default MemoizedAsciiExplosion;\n"
  },
  {
    "path": "components/shared/effects/flame/auth-pulse/auth-pulse.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./pulse-data.json\";\n\ninterface AuthPulseProps extends HTMLAttributes<HTMLDivElement> {\n  interval?: number;\n  opacity?: number;\n}\n\nexport function AuthPulse({\n  interval = 100,\n  opacity = 0.15,\n  className,\n  ...attrs\n}: AuthPulseProps) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n  const frameIndex = useRef(0);\n\n  useEffect(() => {\n    const animate = () => {\n      if (ref.current) {\n        ref.current.innerHTML = data[frameIndex.current];\n        frameIndex.current = (frameIndex.current + 1) % data.length;\n      }\n    };\n\n    // Initialize first frame\n    animate();\n\n    const cleanup = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: animate,\n      interval,\n    });\n\n    return () => cleanup?.();\n  }, [interval]);\n\n  return (\n    <div\n      ref={wrapperRef}\n      {...attrs}\n      className={cn(\n        \"absolute inset-0 pointer-events-none select-none overflow-hidden\",\n        className,\n      )}\n    >\n      <div\n        ref={ref}\n        className=\"font-mono text-heat-100 absolute inset-0 flex items-center justify-center fc-decoration\"\n        style={{\n          whiteSpace: \"pre\",\n          fontSize: \"9px\",\n          lineHeight: \"11px\",\n          opacity,\n        }}\n      />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/auth-pulse/pulse-data.json",
    "content": "[\n  \"                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                        ░░░░░░░░░░░░                                            \\n                                      ░░░░░░░░░░░░░░                                          \\n                                    ░░░░░░░░░░░░░░░░░░                                        \\n                                    ░░░░░░░░░░░░░░░░░░                                        \\n                                    ░░░░░░░░░░░░░░░░░░                                        \\n                                      ░░░░░░░░░░░░░░                                          \\n                                        ░░░░░░░░░░░░                                            \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                          ░░░░░░                                              \\n                                      ░░░░░░░░░░░░░░                                          \\n                                    ░░░░░░░░░░░░░░░░░░░░                                      \\n                                  ░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                  ░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                  ░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                    ░░░░░░░░░░░░░░░░░░░░                                      \\n                                      ░░░░░░░░░░░░░░                                          \\n                                          ░░░░░░                                              \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                        ░░░░░░░░░░                                            \\n                                    ░░░░░░░░░░░░░░░░░░                                        \\n                                  ░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░▒▒░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                  ░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                    ░░░░░░░░░░░░░░░░░░                                        \\n                                        ░░░░░░░░░░                                            \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                                                                                    \\n                                      ░░░░░░░░░░░░                                            \\n                                  ░░░░░░░░░░░░░░░░░░░░                                        \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                              ░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░                                  \\n                              ░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░                                  \\n                              ░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░                                  \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                  ░░░░░░░░░░░░░░░░░░░░                                        \\n                                      ░░░░░░░░░░░░                                            \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                    ░░░░░░░░░░░░░░░░                                          \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░                                      \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                            ░░░░░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░                                \\n                            ░░░░░░░░░░▒▒▓▓▓▓▒▒░░░░░░░░░░░░░░░░                                \\n                            ░░░░░░░░░░▒▒▓▓▓▓▒▒░░░░░░░░░░░░░░░░                                \\n                            ░░░░░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░                                \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░                                      \\n                                    ░░░░░░░░░░░░░░░░                                          \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                  ░░░░░░░░░░░░░░░░░░░░                                        \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                          ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░                              \\n                          ░░░░░░░░░░▒▒▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░                              \\n                          ░░░░░░░░░░▒▒▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░                              \\n                          ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░                              \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                  ░░░░░░░░░░░░░░░░░░░░                                        \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░                                      \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                        ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                            \\n                        ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                            \\n                        ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                            \\n                        ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                            \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                ░░░░░░░░░░░░░░░░░░░░░░░░                                      \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                      ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                          \\n                      ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                          \\n                      ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                          \\n                      ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                          \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                        \\n                    ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                        \\n                    ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                        \\n                    ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                        \\n                    ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                        \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                        \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                  \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                        \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                  ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                      \\n                  ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                      \\n                  ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                      \\n                  ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                      \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                        \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                                \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n                ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                    \\n                ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                    \\n                ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                    \\n                ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                    \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                              \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n              ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                  \\n              ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                  \\n              ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                  \\n              ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                  \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                      ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                            \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n            ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                \\n            ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                \\n            ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░                \\n            ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░                \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n                    ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                          \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░              \\n          ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░              \\n          ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░              \\n          ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░              \\n          ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░              \\n          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░              \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n              ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                  \\n                  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                      \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \",\n  \"                                                                                                    \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░              \\n        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░            \\n        ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░            \\n        ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░            \\n        ░░░░░░░░░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒░░░░░░░░░░░░░░░░░░░░            \\n        ░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░            \\n        ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░            \\n          ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░              \\n            ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                \\n                ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \\n                                                                                                    \"\n]\n"
  },
  {
    "path": "components/shared/effects/flame/core-flame.json",
    "content": "[\n  \"                                                                     ''                               ''                                '                                                                                              \\n                                                                  ' '.'                             -:\\\":'                                '                                                                                             \\n                                                                '. '-'  '                         .\\\"^\\\"\\\"^:'                                ''               '                  '                                                        \\n                                                          '     -.'.' ''                        '_:.'''':,                                   '             '                   '                                                       \\n                                                                ^\\\"_,_-                         -:'      '_.                                ''  '''        '                     '                                                      \\n                                                               .;;;^'                        '_-         ':'                                     ''.'''''.'                     ''                                                     \\n                                                               \\\";;;'                         _-'         '-,' '                                    ........                      ''                                                    \\n                                                     '        _;;;_                         .:'          '.:'' '-'                                '...''''..'                      ''                                                  \\n                                                             '^;;^'                        ':.'    ''    '-\\\".'''  '                              '..'       '''                                                                        \\n                                                             '^;\\\"-                        ':,''   ''''''-,-\\\"^-''''''''''   '                    '.'            ''                '                                                     \\n                                                             '-,'                      ''-:.''''''''''''''''.,_,--.....'.''''  '               ''                ''             '..'                                                   \\n                                                              ''                     '',:,''''''''''''''''''''''''''''''.,,..''     '         '.'                   '          ''   '                                                  \\n                                              ''                    ''.-,--..''..--_::,.''.'''--.-,'''''''''''''''''''''':'''.'''              .                     ''      '.'                                                       \\n                                              .'      '        '''':;;:''   ''       '''''''''.::'''''''''-.'''''''''''''.''''-'''''''    '   '.                     '.'     ..'                                                       \\n                                              '       '          ':;^'       ''        ''''--..-:,......,-''.:''''''''.'''''''-''''''         ..''                   ..'     '.                                                        \\n                                                     ''          '^;_        ''''      ''.''...-_:-,,,--.--'''''''''''''''''''-.''''  '    '   '''''               '''       ''                                                        \\n                                                               '.:;;.       ''  ''''''' '..'''.---.---,,..'''''''''''''''''''''--.'''''''' .'                                 '                                                        \\n                                                           .-_:^;;\\\"-       ''''''.---:-'''-'''''''..,..-.'''''.''''''''''''''''''.''''''.....                                 '                                                        \\n                                            ''         ''--'''        -::-.'''''.--.--_,,:,,,,,--,,_,,--....--.'''''''.'''''''  '' '     ''..'                                                                                         \\n                                                     '',.            -^.       ''-'   '' ''''''''''''.-,_::_-.'''''''''''''''''    '      ''.' '                                                                                       \\n                                                     '-'             :.                       ''''''''''''-:^^:_:::,-.''''''''''        '' '''                                                                                         \\n                                                     '               _           '             '''''''''''''.\\\"\\\";;;;+;^_.'''''''''''' ''''''''' '''                                                                                     \\n                                                                     .                  '''''  '''''''''.......-,_^;;;^-''.'''''''''''''''.''.'                                                                                        \\n                                                    '                '             ''  ''''''''''''''''.''''.-..-_\\\"^;;;:_''''''''''''''''''''.'                                                                                        \\n                                                    '               ''   ''        '.'''''''''' '''''''''''''''''.-,\\\";;;_.'''''''''''''''''''.''' '                                                                                    \\n                                                    '               ''''''       '.'''''''''   '''''''''''''........._\\\";;:-.'''...'.''''''''....'                                                                                      \\n                                                    ''              .           '.' ''   ''''''''''''''''''...'''''..'.-:^^:-.''''..''''''''.-''                                                                                       \\n                                           ''        _'             ,          '.'       ''''..---,---''''''..''''''.....-:^^:-.''--''''''''--''                                                                                       \\n                                             ,        -,'   '     ':'         ''''   '''--,_----,,\\\"^;;^_.'''''.-''''''''''..,\\\"^\\\"_-..'''''''.-:-'''' '                                                                                  \\n                                             .\\\"'        '-,_::::::-'            '   '-,-.''''''''''._;;;-''''''''''''''''''''.,\\\";+^::_,------::,.''''                               '''                                                \\n                                             ';^.          '''''           ''    '-_-'''   ''''''''.'\\\";;:''-'''''''''''''''''-,.-_\\\"^;;;;;;^:,---.'''''''                                                                               \\n                                            ':;;^:'                          ''.\\\"^-''  ''  '''-'''''':;;:'''''''''''.''''''.---....--,_:;;;;:.'''                '                                                                     \\n                                             ,;;;;^,'                        ',;;^'''   '..''''''''''\\\";;\\\".''''''''''''''''''''.....----_^;;;:.''                 '                    '                                                \\n                                              ':;;;;^,'                       ',\\\";^,''' ''-.-'''''''.^;;;:.''''.''''''''''....,--_\\\"\\\"^^^;=;^_.''                  '                  ''                                                 \\n                                                _;;;;;^_'                       '.,\\\"^_.'','''''''''',;;;;;:-..''''''''''''....-:^;;;;;+=;_.'''                   '                 '                                                   \\n                                                 .;;;;;;;^_.'         ''            '-:^:,.'''''..,:^;;;;;;+=;:_,,-------,_:\\\"^^\\\":_,--...''''                                                                                           \\n                                                  -^_:\\\"^;;;;;;^:,.' '''                '-\\\";;^^;;;;;;;;;;;;;;;;;;;;;;;;;;^\\\":_-..'''''''''''                                                                                             \\n                                                   :'   '.,:\\\"^;;;;^:'                    '.:\\\"^;;;;;;;;;;;^:_,,,___,,---...''''''''''''' '                                                                                              \\n                                                    -          ''.:;\\\"'                     ''-_:;;;;;;;;^-.''''-..'''''''''''''''''   ''                                                                                               \\n                                                     ''            .^\\\"'                   '-:^;;;;;;;;;^:.''''''''''.'''''..''   '                                                                                                     \\n                                                      ''            .;:.''              '-:::,,,___:__-.''''       -' ''' '''                                                                                                          \\n                                                       '            '\\\";-.-.''       ''.-.'                                                                                                                                             \\n                                                                    '^;^..--.''''.-,-.'                                                                                                                                                \\n                                                                  .:^;;;;\\\"\\\"\\\"\\\":::_-''                                                                                                                                                   \\n                                                                  ';\\\"\\\"^;;;;\\\"_,-.''                              '..'                                                                                                                   \\n                                                                   _'  ':;\\\"...-'     '''                        '.--'                                                                                                                  \\n                                                                    '    ,\\\"'''-'     ''.''                      ',\\\":-'                                                                                                                 \",\n  \"                                                                     ''                                                                 '                                                                                              \\n                                                                    '.'   '                                                              '                                                                                             \\n                                                                '' '-'                             '._:,'                                 '                                   '                                                        \\n                                                                ,''.'''                          '-:_--_:.                                '''                                  '                                                       \\n                                                                ::_,'                          ',,''    ',.                                '''''          '                   '''                                                      \\n                                                                -,'                           -,'        ','                                   ''''      ''                   ''.'                                                     \\n                                                                ''                          ',.           '-''                                  '..''    '''                  ''''''                                                   \\n                                                               '                           ',.            ',''  '                               '..''     '''                  ''''.'                                                  \\n                                                                                           ._'     '     ''_''''  '                             '.''        '''                '.''.''                                                 \\n                                                                                          ','''   '' '''.--\\\"_''''' ' '''                        '''           ''               '.''''                                                  \\n                                                                                        '-,'''''''''''''''''-,-.'''''''''''''' '                ''              '''            ''  ''                                                  \\n                                                                                     ''-_.''''''''''''''''''''''''''''''''.'.''    ''           ''                 ''         ''     '                                                 \\n                                              '.                     ''--....'..--,_:,-''''' ''''.-'''''''.''''''''''''''-'''.'''               ''                  ''''   ''''                                                        \\n                                              ''                   .::.'    ''  ''   ''''''''''.-''''''''''''''''''''''''.''''.''''''     ''    ''                   ''''.''''                                                         \\n                                               '                  '\\\":'       ''        ''''.-'''.'''''''''''',''''''''''''''''.''''''      '  '  ''                 '''''.'.'.                                                         \\n                                                                  ,\\\"-        '''         '''.-.._,---..''.-'''''''''''''''''''.''''' ''    ''      ''             '''''''''''.                                                         \\n                                                               ''-\\\"\\\",       '    '''''   '''''.-_,-,,,,.''''''''''''''''''''''-..'''  '''' .'                               '.                                                         \\n                                                           '.-_:\\\"\\\"\\\":_..''''...''..-,,_-''''''''''....--.''''''.''''''''''''''''...'''''''''''                                '                                                         \\n                                             '          '.' '      '_\\\"\\\",''  '''''....---.,-------,,,--...''''.'''''''''''''''''''''''''''''''' '     '                                                                                 \\n                                            '        ''.'           -:.         '''  '''   '''''''''..-,_,--.''''''''''''''''''''''''''''''.'' '                                                                                       \\n                                                      .             ..                 '       ''''''''''._:::-.---...''''''''''''''''''''''''  ''                                                                                     \\n                                                     '              ''           '      '''    ''''''''''''._^\\\"\\\"\\\"\\\"\\\"\\\"\\\":_.'''''''''''''''''''''''  '                                                                                     \\n                                                     '              '                   '''''''''''''''''''.'-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.'.'''''''''''''''''.''' '                                                                                     \\n                                                                    '              ''''''''''''''''''''''''''--:\\\";;\\\"\\\"\\\"\\\"\\\"^.'''.''''''''''''''.'''                                                                                       \\n                                                    '               '    ''       ''-.'''''''''''''''''''''''....-::\\\"\\\"\\\"\\\"\\\",.''..'''''''''''''.'''''''                                                                                   \\n                                                    '               . '''        '..''.''''''''''''''''''''''''.....-,:\\\"\\\"\\\":,....'''''''''''.-..''                                                                                      \\n                                                     -              .           '.' '' ' '''''''''''''''''''''''''''''..,:\\\"\\\"\\\":-.''.''''''''-,-''''                                                                                     \\n                                            '        .-            -'          '''   '  '''.'....----.''''''.'''''''....'.-_:\\\"\\\":-...''''''.::.''''                                                                                     \\n                                            .-        '--''''''''-_'            '    '''-,::----,_^\\\"\\\"\\\":-'''''''.''''''''''''.-:\\\"\\\"\\\"::,----_:\\\"\\\",'''''''                                                                                  \\n                                             ,_          ''-----''                  '-_,.'''''.'''._\\\"\\\"\\\":.'''''.'''''''''''''''.-\\\";\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",.'''''                                                                                  \\n                                             -\\\":'          '''''                  '_:''''''''''''''.:\\\"\\\"\\\".''-.'''''.''''''''''....-_:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.'''''''                                                                             \\n                                            ':\\\"\\\":-'         '''''                .\\\":.' ''''''..''''.:\\\"\\\"\\\"-''''''''''''.''''''...'...--,_:\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.'''''         ''                                                                      \\n                                             -\\\"\\\"\\\"\\\":-             ''              -\\\"\\\"-'' ''.''''''''-\\\"\\\"\\\"\\\":.''''''''''''''''''''''''.--,_::\\\"\\\"\\\"\\\"\\\":.'''            ''                                                                      \\n                                              '_\\\"\\\"\\\"\\\":.'            '          '  '-:\\\":.'''''-'''''.:\\\"\\\"\\\"\\\"\\\"_.''''.'''''''''''.''....-:\\\"\\\"\\\"\\\";\\\"\\\"\\\":,.'''              '                                                                      \\n                                                ,\\\"\\\"\\\"\\\"\\\":-'                       ''''_\\\"\\\"_-,''''''.,:\\\"\\\"\\\"\\\"\\\"\\\"\\\":,-..''''''''''''''''.-_\\\"\\\"\\\";+=+\\\":,.'''                ''                  ''                                                 \\n                                                 .\\\"_:\\\"\\\"\\\"\\\":-''                        '-:\\\"\\\":::::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\";+;\\\"::__,---.....--_:\\\"\\\"\\\"\\\"^\\\"^\\\":-.''''                                                                                        \\n                                                  -'  '-:\\\"\\\"\\\"\\\":_-.'                     '._:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"::_,-..'''                                                                                           \\n                                                   .     '-:\\\"\\\"\\\"\\\"\\\"\\\":,'                    ''-,_::^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"::::_,-..'''''''                                                                                             \\n                                                    .       '''--,:\\\":'                    '''.-,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,-.-.-_-.-...'''''''''''''''                                                                                               \\n                                                     ''           '-::.                  '',::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,..'''''..'''''.'''''''' '                                                                                                  \\n                                                      ''            -\\\":.'               ',:_,,,___::::::::,-....'''-''''''''''' ''                                                                                                     \\n                                                                    ':\\\":-''          '.-.'       '''''''''....----..''''''''                                                                                                           \\n                                                                    -\\\"\\\"\\\"_-''     '.--''               ''''''.,:\\\"\\\"\\\"::-.'''                                                                                                              \\n                                                                 '.:\\\"\\\"\\\"\\\"\\\"::_,,_,,-'''                     ''',\\\"\\\"\\\"\\\"\\\"\\\"\\\":,.'                                                                                                              \\n                                                                  '\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.''''  ''                      '.:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.'                                                                                                             \\n                                                                   -_'.,:\\\"\\\",.'''     '''                   '''_\\\"\\\":__::\\\"\\\"-'                                                                                                             \\n                                                                    -   '_\\\".''''     '''''                   '-\\\":.'''.:\\\",'                                                                                                             \",\n  \"                                                                     '''                                                               ''                                                                                              \\n                                                                    '.'  '                                                              ''                                                                                             \\n                                                                .'''-  '                                                                '.'                                   '                                                        \\n                                                                _''-.''                            '.,__-'                     '        ''-'                                 '..'                                                      \\n                                                                ._,'                            '-:_-..._:.                              '.--'            '                 '....'                                                     \\n                                                                                              ._-''      '_.'                             '.--''          ''                '....'                                                     \\n                                                                                            '_-'          '_''     '                       '.,-'          '''                '..'                                                      \\n                                                                                          '__'           ''_.'  '                           '.,-''         '.'                .'   ''                                                  \\n                                                                                          -_'           ''':.'''''                           '.-.'         ''.'               ''    .'                                                 \\n                                                                                        '.:'''    '' ''.---^,''.'' ' '''                       '..'          '.'              ''    ''                                                 \\n                                                                                       ',:''''' '''''''''''_:,'''''''''''.''.-''                '.'           ''.''           '      '                                                 \\n                                               '                               '   ''.,:-'''''''''''''''''''.---....''.''..---''                 '.'            ''.''       '''       '                                                \\n                                              '_                    '-__,--,____::\\\"::,-''''''''''''''''''''''''''''''''''''''-.''                 ''              ''..'''''..'                                                         \\n                                              .:                  ':\\\"-'     '''''''' '''''''''''.'''.'''''''''.'''''''''..'''.-''''''     ''''   ''.'               '........                                                          \\n                                               -                  -\\\"_        '        '''''.-''''''''.'''''''-_''''''''.'''''.,''''''     ''     '''''             '.........'                                                         \\n                                               '                 '\\\"^_'              '' ''''.,,-.-.....'''''''''''''''''''''''._..'''''''   ''     '  '''''''''''''...........'                                                         \\n                                                              '._\\\"^^\\\",'''  ''''''''''' '''''.___:_,,--.''''''''''''''''''''''-:-.''''''''''.-'                     ''''......'                                                         \\n                                              '           .-,_:\\\"\\\"^^^;^^\\\":___::____::::_-----,_::::__,.'''''''''''''''''''''''.:-'.''''''..''''   '  '                  ''....'                                                         \\n                                             '          .'       '_\\\"^_'    '''''''..-,,..----,_\\\"^\\\"\\\"::-.'''''''''''''''''''''''-:_-.'''''''''''''    ''                   '...'                                                         \\n                                            '         '.          '::'       '''''''''''''''''._:--_:;\\\":,-.''''''''''''''''''''.-----..--.''''''                          '..'                                                         \\n                                                     '-            --         ''      ''''''''''''''''..,::_---....----..''''''''''''''''.-'''''''                        '..'                                                         \\n                                                     '             .-                 '''''''''''''''''''.,\\\";+\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-.'''''''''''''''-.''''''' '                      ...                                                         \\n                                                     '             '.            '' ''''.'''''...''''''''''-\\\"^\\\"^^^^^^^\\\"\\\"\\\":-.'''''''''''''.,-.''''''                        '..'                                                        \\n                                                     '             '.     '        ''''''''..'''''''''''''.,\\\";^^^++^^\\\"\\\"\\\";^:--..''''''''''.:-'.'''''                        '..'                                                        \\n                                              '      '             '.    ''       '.:_----..''''''''''''''.-\\\"^^^^;+=;^^^^\\\"\\\"\\\":,--..'''''''-:,.''''''''                       '''                                                        \\n                                                     -             .' ''''       '--....''''''''''''''''''..--,_::::::\\\"\\\"^^^^^\\\"\\\":-.....'.._\\\":...''''''''                       '                                                        \\n                                                     ,,           ':            '.'''''''''''''''''''''''''..'''.......-_\\\"\\\"^^^^^\\\"\\\":-....-:\\\"\\\"-,-''''''''                        '                                                       \\n                                                      -:.'     '.,:'           '''  '''''''-_,--,,_,-..'''-_.'''''''..--,,,:\\\"^^\\\"\\\"\\\"^\\\":_,_:\\\"\\\"\\\":.''''''''                          ''                                                     \\n                                           ':.          ''.-,___.'                '''''-::\\\"++=+^^^+;^\\\",.....''''''..........-:\\\"\\\"\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"-.'''''''                                                                                 \\n                                           ':\\\"_            '''''                   ''-:^:-....-,\\\";++^^\\\"-.'...'................:\\\"^^\\\"\\\"\\\"^\\\"\\\"\\\"^\\\"\\\"\\\":-.'''''''                                                                                \\n                                            _\\\"\\\"_'          '''''                  '':^\\\",'''''''.,;+;^^\\\",..._,....-----........-:^^^\\\"\\\"\\\";;\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-.'''''                                                                                \\n                                            '\\\"^\\\"_''         ''''''                ',;\\\"\\\"-.''''---:\\\"^^^^\\\"_.............-.........,\\\"\\\"^^\\\"\\\"\\\"\\\"^^\\\"\\\"\\\"\\\"\\\"\\\":,-..'''''                                                                             \\n                                             -\\\"\\\"\\\"\\\":-'       '''''''               '-^^\\\":-,,-'.-_\\\"^^^^^^\\\"-.......................,:\\\"^\\\"\\\"\\\"\\\"\\\"^^\\\"\\\"\\\"^^\\\"\\\":_-.....'''''                                                                        \\n                                              '_\\\"^^\\\"\\\",'     ''   ''''             ''_\\\"^^\\\":_:\\\":^^^^^^^\\\"^\\\"\\\"_-.......................-:\\\"\\\"\\\"^;\\\"\\\"\\\"\\\"\\\"^^:_-.'''''''''''''                                                                      \\n                                                _\\\"\\\"\\\"^^\\\"_'  '''                 ''''''_\\\"^^;^;=^^\\\"^^^^^\\\"\\\"\\\"\\\"\\\"\\\":_,--........'''.''''''..-,:^:_:\\\"\\\"\\\":-.''''           ''                                                                     \\n                                                 ,.'',\\\"\\\"\\\"\\\"_-.'                     '''._\\\";;\\\"^^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^\\\"\\\"\\\";;^\\\"\\\"::,-....'''''''''''..'''''._:_.''''              '                                                                     \\n                                                  .    '_\\\"\\\"\\\"\\\":,-.''                  '''.,:\\\"\\\"\\\"^^^\\\"\\\"\\\"\\\"^^^\\\"\\\"\\\"^\\\"\\\"^^^^\\\"\\\":_,.'''''''''''''''.'''.-.''                 '                                                                     \\n                                                   '     '-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"_'                  ''''.-,_\\\";^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^^\\\"^\\\"\\\"\\\"\\\"\\\"_-'''''''''''''''''''.''                                                                                        \\n                                                    .      ''-:\\\"\\\"\\\"\\\"\\\"\\\"_'                 ''''.-_:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^^\\\";\\\"\\\"\\\"\\\"^;^\\\":-''''''''''''''''''''                                                                                         \\n                                                     ''    ''' '.-_\\\"\\\"\\\":'               ''._\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^;^^^\\\":-.'''''''''     '''                                                                                          \\n                                                      ''''    '  '.,\\\"\\\"\\\"_'             '._\\\"\\\"\\\"::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^\\\"\\\"\\\"\\\"\\\"\\\"-'''''''         '                                                                                           \\n                                                         ''    '''.,\\\"\\\"\\\"\\\",'          '-::-.'''''''.-,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.'''            '                                                                                            \\n                                                                '.,\\\"\\\"\\\"\\\"\\\"\\\"_'     ''._:-'''        ''''.,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"::\\\"\\\"\\\"\\\"\\\"::-.'''            ''                                                                                            \\n                                                                 .:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":::::\\\":,.''              ''''.:\\\"\\\"\\\":-''''..'''''              ''                                                                                             \\n                                                         '        -\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,.'''''''               ''''-\\\"\\\":'''                     ''                                                                                               \\n                                                                   _\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.''    '''''                 '-\\\":''                ''''''                                                                                                 \\n                                                                   '_\\\"__:\\\"\\\"\\\"_'''     '''''                 '-\\\"-'             ''..'''                                                                                                   \",\n  \"                                                                     '''  '           ''                                             ''.'                 '                                                                            \\n                                                                    '-' ''                                                           '''-'                '                                                                            \\n                                                                . '.-'''                                                      '''''  '''.-'                '                  '                                                        \\n                                                               ':.-:.'                              '''''                    ''''''' '''-_.               ''                '...'                                                      \\n                                                                '-.                             '',:::::\\\":'                   '''''''''-:\\\"_''             ''               '.'''''                                                     \\n                                                                                             '.::,.''  ''.:.'                      '..-:\\\"\\\":.'             ''                ''                                                         \\n                                                                                           '-:,''        '':''     '               '..-_\\\"\\\"\\\"-.'            '.'                '                                                         \\n                                                                                         ',:,'           ''_-'  '                   '''''-_:_-.'           '.'               ''     '                                                  \\n                                                                                        '_\\\"''         ''''.:-''''                         ''-,,.''         '..'               .     ''                                                 \\n                                                                                       ',\\\"'          ''....^,'''''    ''                     ''...'         '..''             '      ''                                                \\n                                                                                     ''::'''''   '  ''''''':\\\"-'''''''''''....-''                '..'         '...''          ''       '                                                \\n                                               '                              ' ''''-:\\\":' ''''   ''''''''''.,:_,-........--_:_.'                 ''.'         '....''       ''                                                         \\n                                              ':'                  ',:\\\":___::::\\\"\\\"\\\"\\\"\\\":-''' ''''' '''''''''''''''''''''''''''''_-''                 ''.'          '.....'''''..'                                                         \\n                                              -\\\"'                 -\\\"\\\".'     ''''''''''''''''''''.'''''''''''''-''''''''...'''-:''''''      '''   ' '.''          '...........                                                          \\n                                              ':                 '\\\"^_'               ''''''..''''''''''''''''.:''''''''...'''-:.'''''''   '''    ''''''''      ''.....--,-...                                                          \\n                                               -                '_^;\\\".'      '      '''''''-,.'''''''''''''''''''''''''''..'.,:,-.'''''''''''    ''   ''''''''''......-,,,-..'                                                         \\n                                               '             '-_\\\"^;=;^\\\"_-....'''''''.'''''.-__,-..''''''''''''''''''''''''..-:\\\",.'''''''''''-''                  ''''...-....'                                                         \\n                                              .          .,-,,_:^;=+^\\\":,,--,::::::\\\"\\\"^\\\"\\\":\\\"::\\\"\\\"\\\"\\\"\\\"::,-.''''''''''''''''...'''.-:\\\"-'.''''''..'''''' '  ''                '......                                                          \\n                                             ''        '-       '-^^_'      '.''''.--_,''..-,::\\\"\\\"\\\"\\\":-'''''''''''''''.-.''''.-\\\"^:-..'''''''''''''' ' ''                 '...''                                                          \\n                                            ''        '.          _^'        '''''''''.' ''''',:_,_:\\\"^\\\",-.'''''''''---.''''.,\\\"^^\\\":,-....''''''''''                      '.''                                                           \\n                                                     '-           '\\\"'        ''''     '''''''''''''''.-_\\\"\\\"_--.-...,_________:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'''''''''                      ''                                                            \\n                                                     .             :          '''      '''''''''''''''''._\\\"\\\"\\\"+\\\"::\\\"\\\"^^^^^\\\"\\\"\\\"\\\"\\\"::__,,,---_\\\"\\\"-'''''''' ''                   ''                                                            \\n                                                     .             _'         ''''   '''.''''.-..''''''''._^^^^^^^^^^^^^\\\"\\\"\\\"^\\\"\\\":,--....-_\\\"^_.''.'''''                     ''                                                            \\n                                                     .             ,'     '   '  ' '''''''...''''''''''''.:^^^^^^++;^^\\\"^^^\\\"^^^\\\"\\\":_----,:\\\"\\\":.'.'''''''                     '                                                            \\n                                              '      -             _'    '' ''    ''_:__,--.'''''''''''''.:^^^^^^++=;^^^^^\\\"\\\"^^^^\\\"\\\":_,,:\\\"^\\\"\\\"-.'''''''''                    ''                                                           \\n                                                     :'           ':             '.-..'''''''''''''''''''.-_:\\\"\\\"\\\"\\\"^^^\\\"\\\"^^^^^^^^^^^^^\\\"\\\":\\\"\\\"^^^_...''''''''                   '.''                                                         \\n                                                     ':-'       '-:'            ''''''''''''''''''''''''''...........-,_:\\\"^^^^^^^^^^\\\"\\\"\\\"\\\"^\\\"^\\\"-..''''''''                   '...'                                                        \\n                                                      '-::,--,_\\\":,'             ''  '''''''...---,,-..'''',,.''''......-::\\\"^^\\\"^^^^^^\\\"\\\"\\\"^^\\\"^^;:.'''''''                     '''.''                                                      \\n                                            _'              ''''                  '''''-:\\\"\\\"^;++^^^;+\\\",...-....''.........-,:\\\"^\\\"\\\"^^^^\\\"\\\"^\\\"^^^^\\\":.'''''''                          '''                                                    \\n                                            \\\"\\\",             ''''                   ''.:^^^\\\"::\\\"^^;;=+^:.......''............,:^^^^^^\\\"\\\"^^^^^^^^\\\"_.'''''''                                                                                \\n                                            :^\\\".            '''''                  '.\\\"^;^_...,\\\"^^;;;^\\\"-....,-.....----......,\\\"^^^^^^\\\"^^;^^^\\\"\\\"^\\\":.''''''                                                                                \\n                                            '^^:.'          ''''''                ''_^^^;:,-_^;;^^^^^^,..............-.......,\\\"^^^^^^^^^^^^^\\\"^^\\\"-.''''''                                                                               \\n                                             ,\\\"\\\"\\\"::-'        ''''''               ''-\\\"^^^;;;^^^^^^^^^\\\"_.......................-_\\\"\\\"^^^^^^^;;^^^^^:-.''''''                                                                              \\n                                              ':^^^^\\\":.      '''''''               '':\\\"^^^^^;^;^^^^^^^:,.........................-,::\\\"\\\"^^\\\"\\\"^^^^^^\\\":,...'''''''''                                                                       \\n                                                :\\\"::\\\"^^:-'  '''                ''''''.:\\\"^;^;+^^^^^^^^^^\\\"_--.........-,...''..'''''....,_----,:\\\"^:,.''''        '''                                                                     \\n                                                 _' '-:\\\"^\\\":,-'                  ''''''',\\\";;^^^^^^^^^^^^;\\\"\\\"\\\"\\\":_,-....'...'''''''''''..''''''''._,''''             ''                  '                                                 \\n                                                  '    ',\\\"^^\\\":,.'''                 ''''.-:::\\\"\\\"\\\"^\\\"^^\\\"^^^^^^^^^^\\\":_-...,.''''''''''''''..''''''.'''               '                                                                     \\n                                                  ''     '-:\\\"^^^\\\"\\\"\\\":-'               '''''..--,_\\\":::\\\"\\\"^^^^^^^^^^^\\\":-..''''''''''''''''''''''''''                 '                                                                     \\n                                                   ''      ''_\\\"^^^^^^\\\"-'              '''''.--,_::::\\\"\\\"\\\"^\\\"^\\\"^^^^^^^^\\\",.'''''''.''''''''''''   ''                                                                                        \\n                                                    '''    ''''_\\\"\\\"^^^^\\\"_'             ''',:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^^\\\"^^\\\"\\\"\\\"\\\"^^^^^^^;\\\"-..'''''''''''''         '                                                                                        \\n                                                      '.''    '',\\\"\\\"\\\"^^^\\\".            '',\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^\\\"\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_..'''''''  ''           '                                                                                         \\n                                                         ''    '-:\\\"\\\"\\\"\\\"^^\\\".'       ''._\\\"\\\"_-.''''..-_:\\\"\\\"^^\\\"\\\":-..---,,-..'''' '                 '                                                                                         \\n                                                                -:\\\"\\\"\\\"\\\"^^^\\\"-''''''.,:\\\":-'''     '''''-:\\\"\\\"\\\"\\\":.'''''''''''                     '                                                                                          \\n                                                                '_\\\"\\\"\\\"^^^^^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.''            '''',\\\"\\\"\\\"-''                             '                                                                                           \\n                                                         '       '_\\\"^^^^^^^\\\"\\\"\\\"\\\":,-'''''               '''_\\\"_''                            '                                                                                            \\n                                                         '        ':\\\"\\\"\\\"\\\"\\\"\\\"^^\\\"\\\"-''   '''''                ',\\\"-'                           '                                                                                             \\n                                                                   '\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":''     '''''                ',:.'                        ''                                                                                              \",\n  \"                                                                     '''' '        ''''                                             ''.-'                 '                                                                            \\n                                                                '   '.''''                                                          ''.,.                  '                                                                           \\n                                                               '. '..'''                                                     ''''''''-_:-'                 '               '''                                                         \\n                                                               ':,,:.'                                                      ''''''-_::\\\":-'                 '               '''''                                                       \\n                                                                '.'                              '.-_::::,'                  '''',\\\"::_-.'''               '.'              '                                                           \\n                                                                                             '-::::,-...,:\\\"-'                  '.::,.''''                 '.'              ''                                                          \\n                                                                                          ',:::-'''     '',:-'                  .::-.'''                   '.'              ''                                                         \\n                                                                                       '-:\\\"_.'           ''::'  '               '-::__,--.''''             ''.'              '                                                         \\n                                                                                      ':\\\":.'          ''''-^_''''               ''-,________,-.''          '''''             ''      '                                                 \\n                                                                                     .:\\\":'           '''''-\\\",'''''                    '''''''.--.'''       '''..'            ''       '                                                \\n                                                                                   '_\\\"\\\"_'        '  '''''',\\\":-'''''''''''.---.''              '''...''     ''''''''          ''                                                        \\n                                               '                     '''''''''..-,:\\\"\\\"\\\"_'    ''    ''''''''-:^\\\":,---..----,_:\\\"\\\",'                 ''...''' ''.''''''''      '''                                                         \\n                                              ':-                 ':\\\"\\\"\\\":::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.''  ''  '  '  ''  ''''''..''''''''''''-::''          '       ''...''''''''.....''''''.''                                                         \\n                                              _\\\"_                ':\\\"\\\"_'' ''''.-,--.''''' ''''  '''''''''''''''-'''''''.-'''''_:''''        ''    '  ''..''''''''.....'''''''''                                                         \\n                                              ,\\\"-               ',\\\"\\\"\\\"-'    ''       '''''''.'      '''''''''''-'''''''.,-.''',:.''''       ''   '-'  ''''''''''......'''''''''                                                         \\n                                              ':'             '._\\\"\\\"^^\\\":,..''''''''''.....''--'''''  '''''''''''''''''.-,---.._:-'''''''    ''          ''''''''''.'''''...''''                                                         \\n                                              '_          '.,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"::^::::::::::,.'''''''''''''''''''.,,,--:,,:\\\",-'''''''''''.'                   ''''''...''''                                                         \\n                                              -'        ._.''.-:\\\"^\\\"\\\"-'''.''.----,_::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-''''''''''''''''.__--.'._:\\\":--.'''''''''''    '                  '''''''''                                                          \\n                                             .'        ,'       .:\\\"_'''''  ''.''''.-,:.'''.,:__::\\\"\\\"_.'''''''''''''.,_,.'''._\\\"\\\":-..'''''''''''        '                ''''                                                             \\n                                            .'        -'         .\\\".'       '.-.'''''..'   ''-.''._:\\\":_--.'''''''.,:_-...-:\\\"\\\"\\\"\\\",.'''''''''''''''                      '''                                                              \\n                                                     '-'          :'         '.-''    ''''  '-'...'.-_\\\"\\\":_-.'''.-_::_:::\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.''''''''''''''''                     ''                                                              \\n                                                     -''          _.          '.''     '''''.'''''''''.,:\\\"\\\"\\\":::::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_--..''''''''''                         '                                                              \\n                                                     ,            -.          '.''     '''''''''''''''''-\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_,--..'''''''''                        '                                                              \\n                                                     _            ,-          '' ' ''''''....''''''''''',\\\"\\\"\\\"\\\"^^\\\"\\\";=+\\\"\\\"\\\"^^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":::_,.'''''''                        '                                                              \\n                                                     :.          ':'               '._::_-.''''''''''''.,\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"+==;\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-''''''''''                    '                                                              \\n                                                     -\\\".       '-:_               '''''''''''''''''''''.._:\\\"\\\"\\\"\\\"\\\"\\\"^;;^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",''''''''.  '                  '                                                             \\n                                                      '_::,,,_:\\\":-                '      '''''''''''''''''........---_::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.'''''''                     '                                                             \\n                                                         '''''''                    ''''''''''''''''''''''-.'''''''''..,\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":::::\\\"\\\"\\\":.''''                       ''                                                            \\n                                                                                   '' '''--,__:_,-..''''.-.''''''''''''.-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,-....,:\\\"\\\":.''''                      ''                                                            \\n                                            __'              '                     ''''-:\\\"\\\"\\\"\\\"\\\"\\\"^^:-.''''.'''''''''''''''.,\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",..''''.._:\\\":.''''                     '''''''''                                                     \\n                                            ,\\\"_              '                      ''.\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"-.''''''..''''''''..'''._\\\"\\\"\\\"\\\"\\\"\\\"\\\"_..''.''..,\\\"\\\"_'''''                     ''.'''                                                       \\n                                            '::.             ''                    '''.:;\\\"\\\"\\\"\\\"^;;\\\":--.__.''''''''''''''''''.-_:\\\"\\\"\\\"\\\"\\\":-......-_\\\"\\\":.''''                                                                                  \\n                                             '_::__-.'        '                     ''.:\\\"\\\"^^\\\"\\\"\\\"\\\"\\\":..'''''''''''''''''''''''''.-_:\\\"\\\"\\\"\\\"::___\\\":\\\"\\\"\\\"_.''''                                                                                  \\n                                              '_\\\"\\\"\\\"\\\"\\\"\\\"_'      ''                    '''_\\\"\\\"\\\"\\\"\\\"\\\"^^\\\":,.''''''''''''''''''.''''''''''.--,_:::::::_,-..''''''                                                                               \\n                                               '::,,:\\\"\\\"\\\":.'   ''                    '''-:^\\\"\\\"\\\"\\\"\\\"\\\",--..'''''''''''''''-:-'''''''''''''''''.'''''''....'''''''  ''''''                                                                    \\n                                                '-   ',\\\"\\\"\\\"\\\"_.''                 ''''''''.:\\\"::_,...''''''''''''''''''''.''''''''''''''''''''''''''.''              ''                 '                                                 \\n                                                 '     '-:\\\"\\\"\\\":_.'''                   '''......'''.''''''''''''--.'''.-'''''''''''''''.'''  ''  ''                 '                ''                                                 \\n                                                  ''     '-:\\\"\\\"\\\"\\\"\\\"::_-''                '''''''''''''''''''''''''.''''''''''''''''''''''         ''                 '                                                                   \\n                                                   ''      '.:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'               ''''.''''''''''''''''''''''''''''''''-'''''             '                 '                                                                    \\n                                                     ''    ''._\\\"\\\"^;;;\\\"\\\"\\\",'            ''.,::::::_-.'''        '''  '   ''  '''                                                                                                         \\n                                                      ''''   '-:\\\"\\\"\\\"^;;^\\\"\\\"-'         ''._\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_-'''''             '  ''''                                                                                                         \\n                                                         ''   ',:\\\"\\\"\\\"^+;\\\"\\\"\\\"-''    '''-:\\\"\\\":,.''''.-_:\\\"\\\":.'                                                         '                                                                     \\n                                                               ':\\\"\\\"\\\"^++^\\\"\\\"\\\":,....-_:\\\"\\\":-''       ''-:\\\":.'                                                                                                                              \\n                                                                -:\\\"\\\"^;;\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'             '-::-'                                                                                                                             \\n                                                         '       .\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,''                '.:-                                                                                                                             \\n                                                         '       '_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_.'                    '_'                                                                                                                            \\n                                                                 ''_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.'      '                '-' ''                                                                                                                        \",\n  \"                                                                     ''.'''                                                          '-.'                  '                                                                           \\n                                                                '   '.''.                                                         '''._,'                  '                                                                           \\n                                                               '. ''.'.'                                                    ''''''-,_::-'                  ''              '''                                                         \\n                                                               ':,__.'                                                      ''''._:::,.''                  ''             '' '''                                                       \\n                                                                '.'                             '''.-_::_-'                  ''._:,.''''                   ''             ''                                                           \\n                                                                                           ''.,::\\\"\\\"::___:\\\":-'                 '.::.''''''                  '.'             '                                                           \\n                                                                                        '-_:\\\"\\\":_-.'''''''-:\\\"-'                '.::.''                      ''''             '                                                          \\n                                                                                     '-:\\\"\\\":,.''    ''   ''-\\\":'  ''            '.:\\\":-'''''''''              '''''            ''                                                         \\n                                                                                    .:\\\"\\\":-''          '''',^:'''''            '.,:\\\"\\\":::::_,--.'''          ''''''           '.'      '                                                 \\n                                                                                  '-\\\"\\\"\\\":''           .'''',\\\"_'''''      '   '''...........--,,,-..'''     ''''''''          '.'       '                                                \\n                                                                               ''._\\\"\\\"\\\"_''        '' '''''':\\\"\\\"-'''''''''''.-,,,..''          ''''.....''''''''''''''         '.'                                                        \\n                                               '                    '..--..--__::\\\"\\\"\\\"\\\"_''    ''   ''''''''.:\\\"^\\\":,-------,,_::\\\"\\\":.'               '''......'''....'.'''      '''                                                         \\n                                              ':-'                .:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":'''  '''''''' ''''''''---,--....''''''',\\\"\\\"-'                  ''..-------..'''.''''''''''                                                         \\n                                              _\\\"\\\"'               ':\\\"\\\"\\\"_..-,::\\\"\\\"\\\"\\\"::_-''''''.''''''''''''''''''-'''''...''''''_\\\".'''         '   '    '...---...'''''''''''''''                                                         \\n                                              :\\\":               ',\\\"\\\"\\\"\\\"_.''.--_:_,,--,,_----_-.''''''''''''''''''''''.---.''''-:.''          '    .'   '''...''''''''''''''''''                                                         \\n                                              ':.            ''-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"::\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,'''''''''''''''''''----.''''_:.'''''''     '            '''''''''.'''''''''''                                                         \\n                                              ':         '-_:\\\"\\\"\\\"\\\"\\\"\\\"::__::::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\";^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'''''''''''''''''-,,--..,--::-''''  '' ' ''                     ''.'''''''.'                                                         \\n                                              -'       '_.'' '.:\\\"\\\"\\\"-''''..'------,_:::::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",'''''''''''''''.,,-.'''.::\\\":-'''''  ''' ''    '                  '''''''''                                                          \\n                                             -.       ',        -\\\":'''''''''.-.'''.-,:''''.__,_:\\\"\\\"\\\"_.''''''''''''.-,-.''''-:\\\"\\\"_...''''' '' ''     '' '               ''''                                                              \\n                                            .'        -         '_:' '''    '.,.''''',.' '''-.''.-:\\\":_-.-.''''''.-,,-.''.-:\\\"\\\"\\\"_..'''''''''   ''                       '.'                                                              \\n                                                     '-''        ':          '.,''''' '''''''-.''''-_\\\"\\\":_,.''''.,,::,,_:\\\"\\\"\\\"\\\"\\\":-..''''''''   '''''                     ''                                                               \\n                                                     -''         ':           '-.''    '''''.''''''''._:\\\"\\\"\\\"::_::\\\"^;;\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",.'''''''''''                             '                                                               \\n                                                     ,           ':'          '.''     ''''..''''''''''-\\\"\\\"\\\"^\\\"\\\"^+=+^^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.''''''''''''  ''                        '                                                               \\n                                                     _'          .:'          ''   ' ''''...'''''''''''-\\\"\\\"\\\"\\\"\\\"^^\\\"^+=+;;;+;\\\"\\\"\\\"\\\":-..''''''''''' ''                         '                                                              \\n                                                     ,_         .:,                 '--_-.'''  '''''''._\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^+=+^\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":::__,,-.''''''' '                       '                                                              \\n                                                     '_:-'''''-:\\\"_                 ''''       '''''''''.-::\\\"\\\"\\\"\\\"\\\"\\\"^;;\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,.'''''' ''  '                 '                                                              \\n                                                       ''..----.'                 '           ''''''''''''.........--,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'''''' '                    '                                                              \\n                                                                                    ' '      '''''''''''''.''''''''''.._\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,----,:::,'''                        ''                                                             \\n                                                                                   '   ''''''''''''''''''-.''''''''''''.:\\\"\\\"\\\"\\\"\\\"\\\"\\\",.'''''''..,:_.'' '                     ''                                                             \\n                                                             '                     '   ''''''''.'''''''''''''''''''''''',\\\"\\\"\\\"\\\"\\\"\\\":..'''''''''..__.''                      ''        '                                                    \\n                                            '.                                         ''''''.'''''''''''..'''''''''''''.,\\\"\\\"\\\"\\\"\\\":,.'''''.-.'''.:,''''                    '.''  '''                                                      \\n                                             ''                                     .' '-...'.,-''''.-.'''''''''''''''''''.,:\\\"\\\"\\\"\\\":,.''''''''.-::.'''                    '.''''''                                                       \\n                                               ''''''                               '-'''.....-.'''''''''''''''''''''''''''''.-_:\\\"\\\":_,-....-,:\\\"_.'''                    '''''.'                                                        \\n                                               '\\\"\\\"\\\"\\\"\\\":_'                             '''.........-.'''''''''''''''''''''''''''''''..-,,__:___,-.''''                   '''''''                                                         \\n                                                :-''-:\\\"\\\":.'                           '''''''''.''''.'''''''''''''''.,.''''''''''''''''''''''''''''''''''''       '    ''''.''                                                         \\n                                                ''    ':\\\"\\\"\\\",'                    ''' '''....'.'''''''''''''''''''''''''''''''''''''     ''        '''             ''''                                                                 \\n                                                 '      ',\\\"\\\"\\\":-'                      '''....'''''''  '''' ' '''''''''.''''''''      '''          '                '''              ''                                                 \\n                                                  '       '_\\\"\\\"\\\":_-.''''                 '''''''''''' '''     ''''''  ''       '    ''             '                 '         '''                                                      \\n                                                    '      '':\\\"\\\"\\\"\\\"\\\"\\\"::_-'               ''''''''''''        ''               ''  '                                 '        ''                                                         \\n                                                     ''    ''',\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_''           ''.-____,-'''''                                                              '       ''                                                          \\n                                                       '''   '-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_''        ''._:\\\"\\\"\\\"\\\"\\\"\\\"\\\":_-'''                                                            '       '                                                            \\n                                                         ''   '-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_.'' ''''.,:\\\"\\\"\\\":,-..-,::\\\":-''                                                           '                                                                    \\n                                                               .:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_-.--,::\\\"\\\"\\\":.'      ''-:\\\"_'                                                            '                                                                   \\n                                                                .:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-'           '-:_'                                                                                                                               \\n                                                                '-\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_''              '-_'                                                                                                                              \\n                                                         '       ':\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,'                  ','                                                                                                                             \\n                                                                ''':\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":_.'                     -'                                                                                                                            \",\n  \"                                                                     '''''                                                         ''--'                   ''                                                                          \\n                                                                '   '''''                                                       '''.-_.'                    '                                                                          \\n                                                               .'  ''.-'                                                    ''''-__,-''                     '             ' '                                                          \\n                                                               ',,,-''                                                      '''.,.''                        '                                                                          \\n                                                                 ''                                '''..''                  ''',.''                         ''            '                                                            \\n                                                                                          '''.-,__::___:::_''                 '_.''''                       ''                                                                         \\n                                                                                     ''.-_::::,-.'''''''.,:_''                '_'''''                       '''            ''                                                          \\n                                                                                  '._::::_-'''    '''   ''-:,'  ''            '_,''                         ''''            ''                                                         \\n                                                                                 '_::::-''            ' ''.:-'''''           ''_:_-.''''''''''''            '''''           ''                                                         \\n                                                                               '.::::-'              '''''_:.'''''      '   ''._:::__,,,,,,,,--.'''''     ''''''''          ''                                                         \\n                                                                            ''._::::,'             ''''''-::_'''''''''''''.,,__-.''''''''''''''.....'''''''''''''''         ''                                                         \\n                                               '                    '..---,_:::::\\\"::.'      '' ''''''''''-:\\\":_-.......--,__::::-''              '''''.''''''''''''''       '''                                                         \\n                                              '.'                 '_:\\\"\\\"\\\"\\\"\\\"^^^;;+;\\\"::_''''''''''.''''''''''.--,,,,--.''''''''-::-'                  '''''''''''''''''''    ''''                                                         \\n                                              :::'                _:^\\\"::::\\\"\\\"^;;+;;\\\"\\\":::,--.-.'''''''''''''''''''''''''''' '''-:.'''             '    '''''''''''''''''''''''''                                                         \\n                                             ':::'               '_:\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^;+==+;^^::::::___,'''''''''''''''''''.''''''''.:.' ''             '     ''''''''''''''''''''''''                                                        \\n                                             '_:.           ''.....-,_:::\\\"\\\"\\\"^^^;;++;^\\\"::::::::\\\"\\\":_''''''''''''''''''..'''''''-_''    '                          '''''''''''''''                                                        \\n                                              -:         .--,_:::_''''.----,,,__::::\\\":::::::::::::.''''''''''''''''''''''''''__'''     '    '                     '''''''''''''                                                        \\n                                             ','       '.     ',::''''''...--..''..---,,,,__::::::,''''''''''''''''''''''''.,:-''''''   '   ''   ''                '''''''''''                                                         \\n                                             _'       ''        ,:' '''''''.-,-....--.''''.''._::::-''''''''''''''''''''''',::''''''''  '   '     ''                '''''                                                              \\n                                            '         .         ':'    ''''''-,-.''::-'  ''.'''',::\\\",.'''.'''''''''''''''._::,''''''''''     '     '                 '''                                                               \\n                                                     '' '        _'       '  ''-.'''  ''''''''''''-_::_-.''''''''''--.-_::::-'''-''''''''                            '''                                                               \\n                                                     .           ,.           ''.'      ''''''''''''-:::::,--..._:^;\\\"::::::.''''''''''''''                            ''                                                               \\n                                                     .'         '_.            ''       '''.'''''''''.:::::\\\":::^+++;::::::-'''''''''''''''                            ''                                                               \\n                                                     ..        '-:'                   ''''''''    '''.:::::::\\\"^:\\\"\\\"\\\"\\\"^;\\\"\\\"::-.''''''''''''''                             '                                                               \\n                                                      ,.'     ._:'                   ''-.''      '''''_::::::::::\\\":::\\\"::::_,--''''''''''''                             '                                                               \\n                                                       '.------'                    ''           ''''..-_::::::::::::::::::::::::::___,-.''' ''    '                   '                                                               \\n                                                                                                 '''''''''''''''''...-_:::::::::::::___::_-'''     '                    '                                                              \\n                                                                                    '           ''''''''''''''''''''''-_:::::::_-..'''''.-,,-'''                        '                                                              \\n                                                                                              ''''''''''''''''''''''''.,:::::_.'''''''''''''.-''                        '                                                              \\n                                                                                   '           ''''''''''''''''''''''''-:::::,'''''''''''''''.-'''                      '                                                              \\n                                                                                        ''    ''''''''''''''''''''''''''-:::::-''''''''''''''''-''  '                   ''                                                             \\n                                                                                    ..  ''''''..''''''''''''''   '''''''''.,:::_-.'''''''''''''-.'''                    ''      '                                                      \\n                                                                                    '_'   '''''.''''''''-' ''       ''''''''''-,_:_-.''''''''.-,.''                    '''     '                                                       \\n                                                -___::,'                             '  ''''''''.-''''''          '''   '''''''''''.----....---.'''                   ''''    '                                                        \\n                                                -'  '-:::.                             '''''''''''''.'       '  ''' '              '''''''''''''                     ''''    ''                                                        \\n                                                '      ',::-'                         ''''''''  ''      '      ''''  ''   '             ''          ''''         ''''''''   '''                                                        \\n                                                         '-::,'                      ''''''''''   '           '''''' ''''''  ''                     '                 '''''''''     ''                                                 \\n                                                           '_::-'                     ''''''''''''    ''     ''      '                                                '''''''''''''''                                                  \\n                                                             .:::-'                   ''''''''  ''          ''                                                       '''''''''                                                         \\n                                                      '    ''''::::,.'''''          '''.--,,,-.'  '                                                                 ''''''''                                                           \\n                                                        ''   ''.:::::,-.'''       '''-,::::::::_.''''                                                               '''''''                                                            \\n                                                          '   ''-::::::_-.''''''''-_::::::::__::::-''''                                                              '''                                                               \\n                                                               ''_:::::::_,----,_::::::::-''''''.,:_.'                                                                                                                                 \\n                                                                '-:::::::::::::::::::::,''        '-:.                                                                                                                                 \\n                                                                 '::::::::::::::::::::,'            '--'                                                                                                                               \\n                                                         '       ',::::::::::::::::::_''              '-'                                                                                                                              \\n                                                                  .:::::::::::::::::,''                 .                                                                                                                              \",\n  \"                                                                 '   ''''.                                                        ''-_.                     ''                                                                         \\n                                                               ''   '''''                                                      '.,___-'                     ''                                                                         \\n                                                               :.  ''.-'                                                    '''-_-'''                        '                                                                         \\n                                                               '-__-'                                                      '''',''                           '                                                                         \\n                                                                 ''                                '''''''                  ''--'                            '                                                                         \\n                                                                ''                       ''''.-,_::::::\\\"\\\":,'                 ',-'''                          ''                                                                        \\n                                                                                   ''.-_::\\\"\\\"::,-.'''''''-:^_''               '-.''''                         '.'           '                                                           \\n                                                                                '.:\\\"\\\"\\\"\\\":_-'''     '''   '.:\\\"-' '''          ''-_'''                          '.'            '                                                          \\n                                                                               '_\\\"\\\"\\\"\\\",.''            '''''_\\\".'''''  '        '_\\\"_.'''''''''''               ''..'           ''                                                         \\n                                                                              ':\\\"\\\"\\\":''              ''''''::'''''''  '' '''''-\\\"\\\"\\\"\\\"::_______,,--.'''''     '''....'          ''                                                         \\n                                                                           ''.:\\\"\\\"\\\"\\\"-'            '''''''._\\\"\\\"-''''''''''''.-_:\\\"\\\"\\\":_-''''''''''...-.....'''........''         ''                                                         \\n                                                                     ''..-,::\\\"\\\"\\\"\\\"\\\"\\\"-''     ''''''''-'.'''_\\\";\\\"_-.'.-..--,__::\\\"\\\"\\\":.''            ''''...............'         ''                                                         \\n                                              .                    .:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^\\\"\\\"_.'''''''''-''''.'''''-___::__,.''''''''.:\\\"-''                  ''...........''        '''                                                         \\n                                             '\\\":,                 ':\\\"^+==+;^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^^:_,-_-''.''''''''''''''.''''.'''''''''-\\\".'''                   '''....''''''        '.'                                                         \\n                                             -\\\"\\\":                  -:\\\"^^;;;^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\":^_.'''''''''''''''''..''''''''.:-''''           '''      ''''''''           '..'                                                        \\n                                             :\\\"\\\".          '''''   '''.--,_::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,--,::\\\"\\\";^\\\":.''''''''''''''''.'''''''''.:'''''''                             ''''.''....'                                                        \\n                                             _\\\":        '....-:\\\"_' '''''''''''''..-,_,..'.--:\\\"\\\"\\\"\\\":.''''''''''''''''''''''''''__'''     '    '    '                 ''.........'                                                        \\n                                            '_\\\"'       .'      -\\\".'    '''''.'''''''.-.'''..-\\\"\\\"\\\"\\\"\\\"-'''''.'''''''''..'''''''._\\\"-'''''    '    '   -'                ''.......''                                                         \\n                                            ._'       '         :-     '''''-,--...,-'''''.''-:\\\"\\\"\\\":-'.''''''''''''''''''''._\\\":'''''''' ''   ''   '.'                '...'                                                              \\n                                            .         '   '     ._      '''''-__-..^:-'''..''''-:\\\"^;,.''.-''''''''''''''.-:\\\":-'''''''''''    ''   '.                 '.'                                                               \\n                                           '         '  ''      ':       ''''''-.''   '''''''''''.:\\\"\\\":,-.''''''''''.--,:\\\"\\\"\\\",.''.,.''''''''                           '.'                                                               \\n                                                     '          ':'     ''     '.'      '''''''''''-:\\\"\\\"\\\":_-.....-_\\\"+;\\\"\\\"\\\"\\\"\\\"-''''''''''''''''                           '                                                                \\n                                                     .'         -:    ''       ''       ''..''''''''.:\\\"\\\"\\\"\\\"^;\\\"\\\"\\\"^==++^\\\"\\\"\\\"\\\",.''''''.'''''''''                           ''                                                               \\n                                                     ',        -:'                 '  ''''''''''''''.:\\\"\\\"\\\"\\\"\\\"^^^;^^^\\\"\\\"\\\"\\\"\\\"\\\":-..'''''''''''''''                           ''                                                               \\n                                                      '_-''''-:_'                    ''.''     '''''._\\\"\\\"\\\"\\\"\\\"\\\"^\\\"^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-..-.'''''''''''''                            '                                                               \\n                                                                                    ''          '''''--_:^^\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"::::::_____,--.'''' '                         '                                                               \\n                                                                                   '           '''''''''''...........-_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":::::::_-'''                         '                                                               \\n                                                                                               '''-''''''''''''''''''._\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-..''''''.-,,-'''                        '                                                              \\n                                                                                              ''''''''''''''''''''''''-\\\"\\\"\\\"\\\"\\\":.''''''''''''''--.'                        '                                                              \\n                                                                                   '    '     ''''''''''''''''''''''''-:\\\"\\\"\\\"\\\",''''''''''.--'''.-.'                       '                                                              \\n                                                                                        ''' '''''''''''''''''''''''''''.:\\\"\\\"\\\":-''''''''''''''''.-.'  '                   '                                                              \\n                                                                                    ..   '''''',--''''''''''''''''''''''.-,:\\\"\\\":-'''''''''''''''.-'''                    '                                                              \\n                                                                                    '_'   ''.''_.'''''._:.'''''''''''''''.'...,_:_-.''''''''''.--''                    ''                                                              \\n                                                ',_::\\\":-'                            '  ''''''''.-'''''''''''''   ''''''''''''''''.----......---.''                    ''                                                              \\n                                                -    ._\\\"\\\",'                            '''''''''''''.''''    '  ''''       '''  ''''''''''''''''                      ''                                                               \\n                                                '      '-:\\\"_'                        ''.....'''''''    ''''    ''''''''''''             ''            '''         ''''        '                                                        \\n                                                          .:\\\"_'                    ''.......'''   '      ''  ''''''''''.'''  ''                      '                       ''                                                        \\n                                                           '-\\\"\\\".                  ''.........'''''    ''     '''    ''''''                                                   '''   ''                                                  \\n                                                             ':\\\"_''              '...........'''''          ''          '                                                          '                                                   \\n                                                           '' ':\\\"\\\",'           '''...--,_____-.''''            '                                                                                                                       \\n                                                             ''':\\\"\\\"_'         ''..-_:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,''''''         ''                                                                                                                      \\n                                                              ''.:\\\"\\\"_.'     '''.,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_'''''                                                                                                                                \\n                                                               ''-\\\"\\\"\\\",.'  '''.-:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,---,:\\\":-''                                                                                                                                 \\n                                                                 ':\\\"\\\":,.'''..,\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_'''    ''-:_'                                                                                                                                 \\n                                                                 '_\\\"\\\"\\\"\\\",...-_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",''         '-_'                                                                                                                                \\n                                                                  -\\\"\\\"\\\"\\\"\\\"_--_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":.'            '-.                                                                                                                               \\n                                                                  -\\\"\\\"\\\"\\\"\\\"\\\"::\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-''              ''                                                                                                                              \",\n  \"                                                                .'    '''.                                                      '-,::.                       '                                                                         \\n                                                              ':'    ' '.                                                     '::_-.'                        ''                                                                        \\n                                                            '_^;,' '',_'                                                    ''_.'                             '                                                                        \\n                                                          '::.''.-_-''                                                     '''-                               '                                                                        \\n                                                         ';_      '                                 '''''                  '',.                               .                                                                        \\n                                                        .;:     ''                       ''''.-,_:::\\\"\\\"^;;\\\".'                '_-''                             ''                                                                       \\n                                                       ';;                       '-,::\\\"^^^\\\":_,.''''''''.:;;.''              '-.''''                           '.                                                                       \\n                                                       \\\";'                    ',^;;;^:-'''        '''''''_;_'''''' ''       '-,' '''                          '-'          '                                                           \\n                                                       _'                    ':;+;^-'              ''''''.;,''''''''''''' ''',\\\".'                             .--'          '                                                          \\n                                                                             -;;;\\\"'   ''      ''  '''..'',;-''''''''''''''''-;;\\\"_-......-....'''''          '.---'          '                                                          \\n                                                                            '_;+;:''''''''      ''''''..-^;,.''''..''''''._;;;;;;;:,-.''''...-------...''..------'          ''                                                         \\n                                                                            ',;;+;-''''''''''''''.',--'.-^++\\\"-..'-:,--,__::^\\\";;;:.''''   '   ' ''''.------------'            '                                                         \\n                                                                          '  '.:;;;^:-'''''..''''''':''''.:\\\"\\\"\\\"\\\"\\\"::^:-..'''''',;:''''     '          '''.----..''             '                                                         \\n                                             ''                         '..'    '-:\\\"^;+^::::,.--.-.'''''''....------..'''''''.^,''''''   ''             ''''                 .                                                         \\n                                             _-.                        ''''     '_,...'-_\\\"^^;+\\\",.''''''''.......-----.''''''.::''''''''  ' ''''''                           .'                                                        \\n                                            ';;\\\"           ''''                  ',_.'' ''-.',;+;_'''''...........-.......'''.:.'''''''''' ''    '                          '.'                                                        \\n                                            :;;.        '''  '_:                 '._-'''''.''-;+;,.'''................'''.'..-_.'''''''''''''''''.                   ''.....--'                                                        \\n                                            ;^'        .       .-       ''''''' '''.-.'  ''''-;+;_..'.-...........--........-^-.''''''''''''''.'':- '               '-------.'                                                         \\n                                           '\\\"         '   '     :         ''._-.'''-..'''''''':;+^-..-,--.................._;_..'''''''.''''''''''-'                '--.'                                                              \\n                                           .          '  ''     ,'         '',:\\\":__:_-'''--'''',;++_....-:...............-\\\"^,-.....''''''''''.'' ''''                --'                                                               \\n                                           '         '          --      '''''''--''   '''-'..''.-:;;\\\",..--...........-,:^;:-...,_--...'''''''''                      ..                                                                \\n                                                     '          :,''''''''     '.'      '.....'''.-^+;^:_-.....---,:\\\";;;^,-......----..'''''''' '                    '.                                                                \\n                                                     '.        '\\\"'  ''''       ''   '  ''.-....'''.-;+++++;\\\":,_:;;+++;;^--.......-..--......''   '                    .                                                                \\n                                                      --'    ':\\\"'                  '' ''..'''''''''-;+===+++;+=+++;;;;^_-..-......''.--..'''''   '                    '                                                                \\n                                                       '...---'                      ''.''  '''''''.:;++++++=+++++;;;^_--..---....''.--.'''''''  ''                   ''                                                               \\n                                                                                    ''    '''''''''..-:\\\";++;;;;;^^^\\\":--------,---------..'''''' '                      '                                                               \\n                                                                                          ''''''''''''..--,,----...----,:^;;;;;;^\\\"\\\":::::_,.''''''                      '                                                               \\n                                                                                           '''''''_-.''....-.........-,\\\";++;^:,--.......-,_,-'''                                                                                       \\n                                                                                       '   ''''.'''...'''.........._--_;;;;,-........'''....--.'' '                     '                                                              \\n                                                                                   '    '''''''-.''''''''......''....._;;;\\\"-........'..-__-'.---''                     ''              '                                               \\n                                                                                        ''.'''''''''''''.'...'''''''..._^;^,-.....'...--''...-.--'' '                   '                                                              \\n                                                                                    '.   ''''''::-''''..-.'''''''''''''.\\\";\\\";;_-..''..'''','''...-.''                                                                                   \\n                                                                                     ,' ''.',.':'.--.---\\\",''''''''''''''_\\\"..,,__,-..'.'''''''''-,-''                    '                                                              \\n                                                 -_:;;;\\\"-                               '''''''..-.'.-_..''''''''''''''''''''..-.-----..'''''.----'                    '                                                               \\n                                                -'   ':;;;-                          ''''''''''.-''',''''''''''''''''''''''''''''''''''.--.'''''''                                                                                     \\n                                                '       '\\\";;,                  '''......'.'''''''..'''''..''''''''''''''''''''''''''''''''                                                                                             \\n                                                          '\\\";^.              '_^;;;;;^\\\"_--.''''''''''''''''''''''''''''.''      ''                     ''                                                                              \\n                                                            -;;,            ':;;;;;;;;;;:,--.'''''   '''  ''''''  ''''''.''   ' '    '                '                       '    ''                                                  \\n                                                             '\\\";:'         '.;;+++++;;;;;:--.'''   ''  '   '''''     '''''''''' '     '                                       '''.--'                                                  \\n                                                           '' ':;^.'       '.;;++=++;;;;;;\\\":_-''''             '         ''''''''                                                '.                                                    \\n                                                             '''\\\";^.'      ''^;++++++;;;;;;;;^:.''''''         '''                                                               ''                                                    \\n                                                              ' '\\\";\\\".'      ':;;++++++;;;;;;;;;;_.'''''                                                                           '                                                    \\n                                                               ' ';;:''     '-;;;;;;;;;;;;;;;;;;;^-'''                                                                                                                                 \\n                                                                 ':;;-'     ''^;;;;;;;;;;\\\"_.'''.,:;:.'                                                                                                                                 \\n                                                                  .;;^.      ':;;;;;;;;;,'''' '''''_:'                                                                                                                                 \\n                                                                  ';;;\\\"'     ',;;;;;;;;:''         '',.                                                                                                                                \\n                                                                  -;;;;:'    '-^;;;;;;:-'             '-                                                                                                                               \",\n  \"                                                               -,       ''                                                     '----'                         '                                                                        \\n                                                             .\\\":       ''                                                    '-.''                            '                                                                        \\n                                                           ':\\\"\\\"\\\"-'  '.-'                                                     .'                               '                                                                        \\n                                                          '-::'''''''                                                       '.                                 '                                                                       \\n                                                         ''-'                                                              '''                                 '                                                                       \\n                                                        ' '                               ''''...---,,_:_.                  '.'                                '                                                                       \\n                                                       ' ''                     '.--,___,--.''''   '''''-\\\"-                 '' '''                             ''                                                                      \\n                                                      '-..                   '-:\\\"\\\":,''''            ''  ',:''   ''        ' '.'  '''                           '.          '                                                           \\n                                                     ':\\\"_      '             -\\\"\\\"\\\",'   '''            '' '._'''  '' ''''     '-''                               '.'          '                                                          \\n                                                     ':,                    ':\\\"\\\"-'  '''''''    '   ' '''',-'''''' ''''' ''''-:.''  ''' '''''''               ''..'          '                                                          \\n                                                                            '_\\\"\\\"-'''''''''     '''  ''''.\\\"_'''''''''''''''-:::,-,--..'''''''''....'''''''''''....'                                                                     \\n                                                                             ',\\\"\\\",...'''' ''''''''''..''.:\\\"_.''''-_-''...---.._\\\",.''         '  ''''...........''            '                                                         \\n                                                                               '-_::,.''''''''''''''-''''.,__,,,--::'''''''''',-''                   ''''...'''              '                                                         \\n                                                                                '',,--_---,_-'.'''''''''''''.-.'..'.''''''''''--'''                      '''                 '                                                         \\n                                                                                 '-.''' ''---:;_'''''''''''''''''.'''.''''''''--''''      '  ''''                                                                                      \\n                                                           '''                   '..''  ''.''',\\\"_'''''''''''''''''''''''''''''.'''''''      '                                ''                                                        \\n                                                        ''    ..                 ''.''  ''''''_\\\",'''''''''''''''''''''''''''''.''''''''    ''    '                     ''''''''                                                        \\n                                                       '       ''          '''    '''''  ''''':\\\",'''''.'''''''''''''''''''''','''''''''''     '''.' '                '...'''''                                                         \\n                                                      '   ''    -          ''..''''''''  '' ''-\\\":-''''.'.''''''''''''.'''''-:-'''''''''''    ''' ''                  '.'                                                               \\n                                                          '     -'          '',_,----.'''''''''-:\\\"_''''''-'''''''''''-'''',:.''''''''''''' ''''  ''                  ''                                                                \\n                                                     '          -'      '''''''.-''   ''''''''''._^:.'''..''''''''''''.-_,.'''.-.''''''''''''''                      ''                                                                \\n                                                     '         '_.'''''''      '''      ''''''''''-\\\"\\\"_-.-.'''''''''.-:::-''''''''''''''''''''''                      ''                                                                \\n                                                     '.       '--   '''             .   '''''''''''-\\\";^\\\"__,..'..-,:\\\"\\\"\\\"_.''''''''''''''''''''''   '                    '                                                                \\n                                                      '-'''''-_'                   '' '''''''''''''-;^+++\\\":___\\\"\\\"\\\"\\\"\\\"\\\"\\\":.''''''''''''''''''''''                         '                                                                \\n                                                          ''                         ''''    ''''''.:^^;=+^;+;;\\\"\\\"\\\"\\\"\\\"_.'''''..'''''''''''''''  '                       ''                                                               \\n                                                                                     '    '''''''''''.,_:;\\\"\\\"\\\":::__-..''''''''.''''''''''''''  '                        '                   '                                           \\n                                                                                          '''''''''''''''..-..'''''.'''..-_:::_,,,,--.-..''''  '                       '                                                               \\n                                                                                        '    '''''-''''''''.''''''''''.,:\\\"\\\":,..'''''''''....''''                                                                                       \\n                                                                                       ''    '''''''''''''''''''''''.'-:\\\"\\\"-'''''''''''''''''..''                                                                                       \\n                                                                                        '''  '''''''''''''''''''''''''-\\\"\\\",.'''''''''''''..'''-.''                       '             ''                                               \\n                                                                                         '.''''''''''''''''''''''''''''-::.'''''''''''-.'''''-'.''                                                                                     \\n                                                                                    ''    '''''..'''''''''''''''''''''''.-_,-'''''''''''''''''''.'''                                                                                   \\n                                                                                     '    ''.''''''.'..'..''''''''''''''.'''....''''''''''''''''..''                                                                                   \\n                                                 '.,:\\\"\\\":-'                              '' '''''''''''-''''''''''''''''''''''''..''''''''''''''...'                                                                                    \\n                                                ''   '-:\\\"\\\"_'                  '''''''''     ''''''''''''''''''''''''''''''''''''''''''''..''''''''                                                                                     \\n                                                '       ',\\\"\\\"_'              ',\\\"\\\"\\\"\\\"\\\"::,-''' '''''''''   '''''      ''''   '   '        ''''                                                                                             \\n                                                          '_\\\"\\\".            '.\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.''' ' '''           '' ''''''''                                                                                                              \\n                                                            ':\\\"-           '-\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-'''        '   '  '     '''''''            ''                                                                                               \\n                                                             '_\\\",'         '-\\\"\\\"\\\"\\\":\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.''     '       '   '     '''''            '                                       '  ''.''                                                 \\n                                                           ''  -\\\":''       '.\\\"\\\"\\\":,:\\\"\\\"\\\"\\\"\\\"\\\"\\\":-.''                              ''''                                             '.....'                                                  \\n                                                             '' ,\\\"_''       ':\\\"\\\":-,:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":,'''                                                                              '''..                                                   \\n                                                              '  -\\\",'       '-\\\"\\\"\\\"_-_\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\",''''                                                                                                                                   \\n                                                                 ':\\\".'       ':\\\"\\\":--:\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\"\\\":-''''                                                                                                                                 \\n                                                                  .\\\":'       '-\\\"\\\"\\\":..,_::_,--..-_:_'''                                                                                                                                 \\n                                                                  ':\\\"_'       '_\\\"\\\"\\\",....'''''  '''.,.                                                                                                                                  \\n                                                           '      ':\\\"\\\"-       '.:\\\"\\\":-..''          ''.                                                                                                                                 \\n                                                                  '\\\"\\\"\\\":'       ',\\\"\\\"\\\"_..'              ''                                                                                                                               \",\n  \"                                                                         '                                                   '.''''                            '.'                                                                     \\n                                                                       ''                                                   ''                                 ''                                                                      \\n                                                               ''''''..'                                                   ''                                   '                                                                      \\n                                                              '                                                            ''                                   '                                                                      \\n                                                          '                                ''                              ''                                   '                                                                      \\n                                                                                       '''''''''''''.-,,.'                 ''                                   '                                                                      \\n                                                                               '-,,_,--..'''        '''',-'   '            ''                                   ''                                                                     \\n                                                      '  '                   -:\\\":-'            '''''''''':'     ''      ''''''  '''                             '''                                                                    \\n                                                     .' ''     '            -\\\"\\\"_'      '''''''''''''''''',''    ''''''''''''.'    ''                            '''        '                                                           \\n                                                     :--'           ''      -\\\"\\\".     ''-.'''''''     '''.-''''''''''''''''''.'''   ''   '                     '''''         '                                                          \\n                                                     --'              '      -\\\",   '.--'''   ''''   ''''_,''''''''''''''''.-'''''''''''''''''''''''''''    '''.''''                                                                    \\n                                                                              '-,.'.-.''''''''''''''''''_:-.''''''''''''.-.'''''..''''        ''''''''..''.'''''''                                                                     \\n                                                                                '',__.'''''''''''''''''''-_,-..-....'''''''''''-''''                ''.''''''''''                                                                      \\n                                                                                 ''-''''..-_-.'''''''''''''-,,.'.'''''''''''''',''''                  ''.'''''''                                                                       \\n                                                                                 ''.''  '-,-'-:_''..'''''''''''''''''..'''''''_,''''''    '   '''       '''''''                                                                        \\n                                                          ''''                   ''''   '.-'''.\\\"-'.''''''''''''''''''''''''''''.'''''''     '                                 '                                                        \\n                                                        ' '   ''                 ''''  '..''''-\\\".'''''''''''''''''''''''''''''..'''''''''''''   ''                      '    ''                                                        \\n                                                          ''   ''         '''''  ''''''''.''''_:''''''.''''''''''''''''''''''-..''''''''''   '''''' '                '''''''''                                                         \\n                                                      '   ''    .         '''..''''''''''.''''-\\\"-'''''..''..'''''''''.''..''.'''''''''''''' ''''' '                  '''                                                               \\n                                                     '          -'           ''--.---''''''''''-:_.'''''.-''''''''''',-.....'''''''''''''''''''' '                   ''                                                                \\n                                                     '          ,''    '''''''''..''''''''''''''_^\\\".''''-''''''''''''''.-.''''-.''''''''''''''''     '               ''                                                                \\n                                                     '        '':.''''''        ''''  '''''''''''.::-'''--.'''''''''.-,-'''''''''''''''''''''''''    '                '                                                                \\n                                                      -'      ._'   ''         '''''_'''''''''''''.\\\"\\\";_.'.-.'''''.,:\\\",'''''''''''''''..'''''''''''''                  '                                                                \\n                                                       '.''..,.                    '.'''''''''''''.:+;+;:.....-__:\\\"\\\",'''''''''''''''''..'''''''   '''''               '                                                                \\n                                                                                '   '..''''''''''''-\\\";;==;;++;;\\\"\\\"\\\":-'''''''..''''''''''''''''''  ''''''''              '                                                               \\n                                                                                    '''''''''''''''''-,_^;\\\";:__,--.''''''''''''''''''''''''''''''  '  '                '                                                               \\n                                                                                     ''''''''''''''''''''''..'''''''''''''..--.........'''''''''                                                                                       \\n                                                                                  '  '''''''''''''.'''..'''..''''''''''._:\\\",-..''''''......'''''                                                                                       \\n                                                                                   ''''''''''''''''''''''''..'''''''''-::-.''''''''''''''''..''''                                     '''                                              \\n                                                                                    ''' '''''''''''''''''''''''''..''',\\\"-'''''.'''''''''.''''..''                                    ''''                                              \\n                                                                                 ''   '''''''''-''''''''''''''''''''''._,.''''.''''''''.'''''.-'''                                                                                     \\n                                                                                    ''    ''''''''''''''.''''''''''''''..-...''''''''''''''''.''''''                                                                                   \\n                                                                                     '   '''''''''''...''.'''''''''''''''''...'''''''''''''''''''.''                                                                                   \\n                                                  '._:\\\"\\\":-'                 '_::_,.''   ''  '''''''''''''''''''''''''--.'''''...'''''''''''''''''..'                                                                                   \\n                                                 .'''-_\\\"\\\"\\\":.               ':\\\"\\\"\\\"\\\"\\\"\\\":,.''  '''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                    \\n                                                '       '_\\\"\\\":'             ':\\\":__:\\\"\\\"\\\"\\\":-'' ''     ''''''''''''''''''''''''''''''''''''''''                                                                                             \\n                                                          '_\\\"\\\"-            '_\\\"-'''.:\\\"\\\"\\\"\\\":.''    '' ''   ' '' ''''''''''''''''''''''''      '                                                                                           \\n                                                            ':\\\"-            -\\\".   ''_\\\"\\\"\\\"\\\":.''            ''       ''''''''''''''      ''''''                                                                                           \\n                                                             '_\\\"-           ':-    '':\\\"\\\"\\\"\\\"_.'      '   ''      ''''''''''''''''      '''                                                                                               \\n                                                               ,\\\"_ '         ,_'    '.:\\\"\\\"\\\":-''          '               ''''''''''   ''                                          ''                                                    \\n                                                             '' ,\\\"- '        ':'     '-\\\"\\\"\\\"\\\":,''                            '''''                                                ''                                                     \\n                                                              '  -\\\".'         _,      '_\\\"\\\"\\\"\\\"\\\":-'                                                                                                                                       \\n                                                               ' '_:'         ':'      '_:\\\"\\\"\\\"\\\"\\\":.'''                                                                                                                                   \\n                                                                  '::'         -_'      '.,_:::::_''''                                                                                                                                 \\n                                                          '       ',\\\"-          __'          ' ''',-'                                                                                                                                  \\n                                                                  ',\\\":'         ':-           '   ''.'                                                                                                                                 \\n                                                                  .:\\\"\\\",          ':-                 ''                                                                                                                                \",\n  \"                                                                         ''                    '''                          ''                                  '..'                                                                   \\n                                                                       '-                                                  ''                                   '..'                                                                   \\n                                                                ''''.--'                                                   '                                    ''     '                                                               \\n                                                                                                                           '                                     '                                                                     \\n                                                          '                               ''   '       '                   '                                     '                                                                     \\n                                                                                       '''''..'''''''-__'                  '                                     '                                                                     \\n                                                                              ',:::,-.'''''         ''..:'    ''           ''                                    ''                                                                    \\n                                                      '  ''                 .\\\"^\\\"-'           ' ''''.--'',,'     ''       ''''   ''                               '.'      '                                                            \\n                                                  '''-''..     '   ''      '\\\";\\\"'        ''''''''''''''''-.'    '' '''     '.'  '''''                            '..'       '                                                           \\n                                                     ''''           '''    ':;\\\"'      ''..''''''' '  '''_''''''''''''''''''-'' ''  '                           '...'       ''                                                          \\n                                                    '_.'             ''      .\\\"-    ''..'''' '''''  ''',:..'''''''''''''''-.''' ''''''''''''''''''''         '.....         '                                                          \\n                                                     '                         .-.'''-.''''''''''''''.._^,-..''''''''''..,.'''''''.''''''''''''''......''''.......'                                                                    \\n                                                                                 '.,_,.''''...''''''.''',:_,-----.....''''''''''-''''             ''..----.......'                                                                     \\n                                                                                  '..'''.-,:_-.'''''''''''-_,_,.....'-''''''''-:'''''               '...,__,--...'                                                                     \\n                                                                                  '.''' '-__'.::.'--'''''''.'''....'.--'''''',:_''''''''' '   '''    ''..---.....'                                                                     \\n                                                          .'''                   ''''' ''-:.''.^--.''''''''''''''''...''....''.-'''''''''' '''          ''''''''              '                                                        \\n                                                       '' ''  .'                 '''''''---'''-\\\".'''''''''''''''''''..'''......,'''''''''''''' '''                    '''''  ''                                                        \\n                                                      '   ''   ''        ''.'''''''''''''-,'''_:'''''..'''..'''''''''''''''..--.'''''''''''''''..'''''               '....'..'                                                         \\n                                                  '' ''   ''    -       ''''.-.'''''''''.-''''-^-''''.--.',-'''''''''...---.-...''''''''''''''''''' '                ..'                                                               \\n                                               '     '          ,'           ''-,-,--.'''..'''':\\\"-.''''.,,'''..'''''':\\\"\\\"\\\"\\\"-...'''''''''''''''''''' ''                ''                                                                \\n                                                     '         ':.'     ''''''''-,.-''.'''..'''-^+:.'''.,..'''''''''''.---.''.-..'......'''''.''''' ''               ''                                                                \\n                                                     -        '-\\\"-...'''       ''.''''''''......._^_.'''-_,'''''''''.,,-.'''''.''''..........'''''' ''                '                                                                \\n                                                     ','     ',:'    '         ''''._.'''.......'.:;;^.'''-.''..'.,\\\":-.'''''''''''''.---........'''''                 '                                                                \\n                                                       '...-,_.                 ' ''.''..''''''''':;=+\\\"_-.....-_:\\\";\\\"-.'''''.'''''''''.--......'''''''''''             ''                                                               \\n                                                                                '''''--'''''''''''-:;;+=+^+=+++;;^:.'''''''..'''''''.........'.'''''''''''             '                                                               \\n                                                                                 '''...'''''''''''''.,_;+;;;^::_--...''''''''.''''......,-.'''.''''''''''              '              '...                                             \\n                                                                                   '''''''.-'''''''''''''...............'........-.......-.'''''''''' '                              '''..                                             \\n                                                                                  ''''''..''''''..''''-,''.............-_:\\\":,-----...------..''.''''                                 '  ''                                             \\n                                                                                ''''.'''...'''''-..'''.''...-......''.-\\\"\\\",-.'''.'''''.........''''''                    '               '                                              \\n                                                                                ''''-'-'''''''''''''''''..--......-.'.:^-...'--.'''''''.-......''''''                               '   '                                              \\n                                                                                 '''''..'''''''_''''''''.-,,..''.'''''-\\\"-.'.-.-''''''''-.''''-:..''''                                                                                  \\n                                                                             ''' ''''.'''''''''..'''..-.,-,-.'''''''''-----:,..''''''''''''''-.'..'''                                                                                  \\n                                                                           '_:::-.'''.'''''''''''....--..,'.''''''''''--'.......'''''''.'''''''''..''                                                                                  \\n                                                   ',\\\"^^\\\",'                _;;;;;;^_.'''.''''''''.....''.'.''''''''._,_.'''._:-........''''''''''...'                                                                                  \\n                                                 '___\\\"^;;;^-               _;^:,_\\\"^;^:-'''''''''''.''''''''''''''''-._-''''.:\\\".'..........''''''...''                                                                                  \\n                                                ''     ',\\\";;\\\"'             -^:'  '.:;;^:.''''''''''.''''''''''''''''''''''''.'''''''''''.''''''''                                                                                      \\n                                                '         ':^^-            '::'   ''_^;;^,''''''''''-''''''''''''''.....'''''''''''''''''''''                                                                                          \\n                                                            -^^-            .\\\"'   ''':^;;^-''      ''''''-.''''''''.......''''''''''''''''''                                                                                           \\n                                                             ':^-           '\\\"'    '''_;;;\\\"-''    ''  ''''''''''''''..''.'''''''''''''''                                                                                               \\n                                                  ''          ':^_           -,     '''\\\";;^:-'         ''''  '''''''''''''''''.''''''''                                           '                                                    \\n                                                   '         ''':^-          ':'   ''''-^;;^:.'           '      ''    ''''''''''     ''                                                                                               \\n                                                              ' '_^'          .-       '_^^^^\\\"-'                                                                                                                                       \\n                                                              '''':\\\"'         ':''      ':^^^^^_''                                                                                                                                     \\n                                                        ''      '''\\\":          .,        '-\\\"^^^^\\\"-'''                                                                                                                                  \\n                                                                  ',^-          --          ''''.-_.'                                                                                                                                  \\n                                                                  '_^\\\"'          -.            ''''--'                                                                                                                                 \\n                                                                 '-^;^,           ,.                '''                                                                                                                                \",\n  \"                                                                         '-                   ''''                        ''                                       '                                                                   \\n                                                                       ',.                                                '                                       '..''                                                                \\n                                                                 ''.-__.                                                 ''                                       '...'                                                                \\n                                                                                                                         ''                                       '.'''                                                                \\n                                                                                                       '                  '                                       ''   '                                                               \\n                                                         ''''                    ''''''''''''''''' ''._-'                 '                                       '.                                                                   \\n                                                        ''                  '-:\\\":,.''               ''-:.'    ''   '     ''''                                     '.'    '                                                             \\n                                                     ''..''               .:^^_.'                 '''--_-''  '' ''  '  '''''     '                                '..    '                                                             \\n                                                    '.''''     '  '-.''   '\\\";\\\"''              '''''''.',.''  '''''''''' '''.'  '''''                             '...'    '                                                            \\n                                                 '' '              '..''   ':^-           ''''''''' ''-_'''''''''''''''''''.''''''''                            '....      '                                                           \\n                                                    '  '            ''       '_-       ''''''    '' '':_''''''''''..''''''-''''''''''   ''                      ....'       '                                                          \\n                                                    '-'                        ''''  '''''''  '''''''-;\\\".....''''''''''...'''''''''''''''''''''''''''          '...'                                                                   \\n                                                                                   ''.---''''....'''.'_\\\":,---..---.......''''''''..'''''' '' ' '''....''      '....'                                                                   \\n                                                                                    ''''''-_:__-''''''''..,--,,_-...........'.::-.'''''''''''    ''.....''   '.....'                                                                   \\n                                                                                    '''  '.-.'.\\\"_'''''''''''''''..'''._.....-:_-.''''''''''.''''' ''......'''.......                                                                   \\n                                                          ''''                     '''  ''..''':,.''''''''''''''''''.-..........-.''''''''''''''    ''''............'         '                                                        \\n                                                       '' ''  ''                   ''   '.-'''':'''''''''''''''''''...''''.....-..''''''''''''''''       ''''''''''''...'''''''                                                        \\n                                                   '''.    '   ''        '''''    ''''' '._'''-:''''''.'''.''''''''''''''''..........''''''''''.''''''              '....'''''                                                         \\n                                               ''''' .          .       '''.--.'''''''' '-''''-\\\".'''''.-''_,'''''''''...-----........''''''''''''' ''               '..'                                                               \\n                                              ''' '  .          .'           '''''-...'''-''''':,''''''-_-'''''''''''_\\\":_:,...'''''..'''''''''.''' ''                '.'                                                               \\n                                                     .          _'             '',.-''''.''''''.\\\"_'''''..-,''''''''''.__,,.''.-.''''....'''''.'''''''                '.                                                                \\n                                                     _        '-\\\".'''           ''''''''''''..''-\\\"_.'''''.,''.''''''.--.'''''''''''..........'''''''''                ''                                                               \\n                                                     '_.     -,:'               ''''.''''''''...._;:--'''''''''.''-_,.''''''''''''''............'''''                 ''                                                               \\n                                                       '..--__'                 '' ''''.''''''''',;;:-''......-__:\\\"-'''''''''''''''''..-........'''''''''              '                                                               \\n                                                                                .''''..''''''''''._^^:_,--,:\\\";+=;:-''''''''..'''''''....-.....-'''''''''''             '                 '                                             \\n                                                                                 ''',-''''''''''''''-,_:^^\\\"\\\"::_--....''''''''''''......_^:_..'.''''''''''                                                                              \\n                                                                                    ''''''..'''''''''''''..............''''''''....'....,:---'''''''''''                '                                                              \\n                                                                                  '''''-.-.''''''''''''''''.....'........-_,--.......-...:-''..-'''''''                 '                                                              \\n                                                                                ''''-''''..'''''..'''''''''..-........-:^__''''.''''.....-....'''''''                   '                                                              \\n                                                                                ''''.'''''''''''''.''''''.---_,...''''::-'.''-.'''''''''.......''''''                                                                                  \\n                                                                            ''' '''''''''''''''-''''''-..-^:,-.'-''''',_.'''...'''.'''''''....,..''''                                                                                  \\n                                                                          ':\\\"^\\\"_.'''''''''''''''-'''..,-:::,.'''''''''-.-.'.,..''..''''''''''.''..'''                                                                                  \\n                                                                          .^;^^^;\\\"_'''''''''''''''...----_'.''''''''''-''.....''''''''''''''''''''..'                                                                                  \\n                                                     '-:_'                '^\\\".''._^^:.''.'''''''''...''-...''''''''-,-,.'''',,--.'''''''''''''''''...'                                                                                 \\n                                                  ',\\\";;;;;:'               ::'   ''_^^_'''''''''''''''''''''''''''.,.,.''''.::_...........'''''''....'                                                                                 \\n                                                 ..'''._\\\"^;^:'             .:'     '.\\\";\\\"-'''''''''''''''''''''''''''''''''''.-'''''''--..''''''''''                                                                                    \\n                                                ''       '_^;\\\"'             _'      '.\\\";^_''''''''''-''''.'''''''''..''''''''''''''.'''''''''                                                                                          \\n                                                           ':^\\\"'            ',    '''.,^;^_.''    '''''''-.'''''''''.....''-_-''''''''''''''                                                                                           \\n                                                 '           -^\\\"'            ,'   ''''.,^^^:-'    ''' '''''''''''''''.'....-.''''''.'..''                                                                                              \\n                                                  '''         .^\\\"'           '-   ''''''_^^^\\\"-'       '''''''''''''''''''''''..'''''''''                                                                                               \\n                                                   '.'       ''-^\\\"'           -   ''''''':^^^:'           '  '  '''''''''''''''''''   '''                                                                                              \\n                                                    '.'       ''-\\\":'           . ''      .^^^^:'                  '' '''                 '                                                                                             \\n                                                     ''''     '.'-^_          '-''       '_^^^^_'                                                                                                                                      \\n                                                                '.,^-         ''-         '_\\\"^^^:'                                                                                                                                     \\n                                                             '   '-:^'          '.          '.--,:-'                                                                                                                                   \\n                                                                 '-:^:'          ''              ''-'                                                                                                                                  \\n                                                                '.:^;^.           ''             '''''                                                                                                                                 \",\n  \"                                                                         '\\\".                 '''''                       .'                                        ''                                                                  \\n                                                                      '.:^'              '                               .                                           '                                                                 \\n                                                                '''._\\\"^:.                                                .                                                                                                             \\n                                                                                                                         .                                          .'                                                                 \\n                                                             '                                  ''''' '.'                .                                         '---'                                                               \\n                                                         ' '''            ''.--,,,,-..''''''''''   ''_\\\".                 ''                                        '----'                                                              \\n                                                       '.'''            '^+++++\\\",.'                  '\\\":'''  '''         '-''                                      '-----                                                              \\n                                                     '..'''    '    ''''^++++:.''                  ''-\\\"\\\"'.'' '' ''''''''''.''                                      '------                                                             \\n                                                    '.'           '---.'.:+++,.'                '''.._^_.''  ''.''''''''''..''''''''                              '----.'-.                                                            \\n                                                 ''''              '''''' ',;+,              '''''  ':^.''''''.'''-'''''''-.''''.''''                            '----'   ''                                                           \\n                                                ''  '                        '_:'         ''''   '''';:.'''...''':\\\".'''''.,'''''''''''' '.                       '---'     ''                                                          \\n                                                    :'.                         '.''    '.''   ''.'':=:,.'.--.......''..--.'''''''''''.''......''''              .---       '                                                          \\n                                                    ''                              ''.::-...--,,--:+++\\\",.'....-:,,-----......'''.--.''''''.''''---.'            .---        '                                                         \\n                                                                                     '''''._\\\"^;+^:-..-__:_:_,_\\\"^\\\"_-..--......_;:-,-''''''''-'''''--,-''         '----'       '                                                         \\n                                                                                     ''  '-,,-.^=^.''''''''''........-------:;_,,--.''''''',-'.'''.---.'''     '.----.                                                                 \\n                                                          '.''                      ''   '-,.'':;-'''''''''''........-----------_-..'''''''.'''''''''.-----------------.'    ''                                                        \\n                                                      '.''''  .'                    ''   '_-''';-''''''''''..........-----------,-.....''..'''''.'  ''''''.....---------------'                                                        \\n                                                   '.,_        ''        '''''     ''''  ._.''-;''''''.'''-..............----------.--.'''.''''...''''            ''----.'''''                                                         \\n                                              '.''--':          -       ''-__,-'' ''.'  '_''''-;.'''''-,..:-.........-..---,---------...'''''''''''''              ''--.                                                               \\n                                              .'''' '-          -'           ''''',-..''',''''.;_''''''.:,...........,-...,---------.......'''--'''''                .-'                                                               \\n                                                    ..          ,.              .:.,''...'''''',;,'''''.-::..........---------------........'..''''''                '-'                                                               \\n                                                    ':        '.^-'             '''' '..''.'..'.^+,''''''.,.'-......-,,,-......-.--------.....'''''-''                .'                                                               \\n                                                     .\\\"-'   '__^_               ''  '''.'''....._++,..'''.....----,::-............--,-----.....-...-''                '.                                                               \\n                                                       '.,_:^^-'                .' ''''-''''''''-;+^-....------,:;;,................------------..''''''''             .            '                                                  \\n                                                             '                  ..''...''''''''''_;+;:,---,__^;++^,-...............-----------,..'''''' ''             '                                                               \\n                                                                                '''.^-'''''''''''''-_:\\\"^^^^^^^:_,----...........-------_+:_----..'''''''                '                                                              \\n                                                                                    ''''''''''''''''''...--------------........---------:_------''''''''                '                                                              \\n                                                                                  '  ''_--''''''''''''''..--------------.--,,,-,,--------\\\"---..--.''''''                '                                                              \\n                                                                                ''''-'''....''''''''''''..-------------:;^\\\"-----------,,,,---..''''''                   '                                                              \\n                                                                                ''-'''''''''''''''-.''...-,-,\\\":,------:;:-...-......------,,---''''''                   '                                                              \\n                                                                          ':::-'''.'' '''''''.'_......,--_+^^:,-_.'...:\\\"-............-----..--,-.''''                   '                                                              \\n                                                                          \\\"+++++;:.'''  ''''''''-..---:_\\\"\\\"^:-..'-..''---,-..-......-..-....''-..--.''                                                                                  \\n                                                                          \\\"+;_,:;++:.'' '''''''''..--,__\\\"^.-.''''''......----............''''''''.--.'                                                                                 \\n                                                       '''                .+-   ''_+;_''''''''''..---.,:---....'..'::_-.....,-,,--......''''''''''---.                                                                                 \\n                                                    -^++++:'               ^-      '\\\"+;-'''''''''''''.'............:--......,\\\"_--------..-.''''''.---.                                                                                 \\n                                                  _\\\"\\\"^;+++++:              .:       '_++:''''  '''''''''''..........-.......--..-....,-..''''''''''''                                                                                  \\n                                                 ,     ',^+++^'             ,'       '_++;-'''  ''''.''''''''''.....----.............'''''''                                                                                           \\n                                                ''        .;++^'            ',    '''-,\\\"++;_''   '' '''''.'''''''....------_\\\"-..''''''..'.''                                                                                           \\n                                                           '-;+^'            -'  ''.---.:+++^.'    '' ' '''''''''.'''.....,_-.''''.---.''                                                                                              \\n                                                   '        '.;+\\\"'            -  '''...''^+++;'          ''' '''''''''''''''.-.....''-.'                                                                                               \\n                                                    ..       ',++\\\"            .  ''''''''.++++\\\"'             '  ''''  '''''''''''''  ''''                                                                                              \\n                                                     .-'      ',;+:            -'.'       :++++-                  '  ''                  ''                                                                                            \\n                                                      '''     '-:;+-          '--''       ';+++;'                                                                                                                                      \\n                                                               '-:++'         .'-'         .;+++;.                                                                                                                                     \\n                                                             '' '-\\\"+;'         ''.          '-::\\\"^_'                                                                                                                                   \\n                                                                 '\\\"++\\\"            '              '.,'                                                                                                                                  \\n                                                            '  ',\\\"+++;'            '              '''.                                           '                                                                                     \",\n  \"                                                                         ':+:                '''''                     ',                                          ''                                                                  \\n                                                                    ''',\\\"+;-             ''''                           -                                                                                                              \\n                                                                '''._\\\"\\\"::-'                                             -                                                                                                              \\n                                                                                                                        .'                                                                                                             \\n                                                                         ':;;;^:-''           '''''.'  '                '.                                                                                                             \\n                                                                        ';++++;^\\\"::,-..'''''       ',\\\"''                '.'                                                                                                            \\n                                                        '              ';^.''''                     '\\\".    '' ''        ''.'''                                                                                                         \\n                                                     '    ''   '    '..:+-'  '''                    '^''''''    ''''''''''-''                                         '.'                                                              \\n                                                    '              '''-_;;^,..-''                  '_^''' '  '''''''''''''-.''''.'''                                '-----'                                                            \\n                                                    '                  '''.:^;_'                '''-;-''  ''''.'',''''''-',-''''.'''''                             '-------                                                            \\n                                                '''     '                     .:,'            ''''-;\\\".''''''..'''_'''''''._.'''.'''''''''. '                       '----''''                                                           \\n                                                .- '' ''                         '..'''  ' '''''-:++:-'''''......'''''''-_-.''''''''.''''.-.''''                    ---'   ''                                                          \\n                                               '   '+;-                               '.,,,_::^++++=;-.'''''''',^--------......'''.-,---..-,.---.''                 .-.     '                                                          \\n                                                   '+\\\"                                  ''''.-:^;+++++^\\\"::__,,_:\\\"_--.-.......-^:_-,,-.'''''-'.'-,-.'                '--'     '                                                         \\n                                                   -+_                                 '  '.-_,-+++;\\\"_--.'''''''''.'..'.....__-,,-_-..''''.--''.-,-.''              '---'   '-                                                         \\n                                                   ^+\\\"'    ''                             ',_-'.++-''''''''''''''''''.......---,,,,--..'-.'''''''''.--.''''    ''''.----------                                                         \\n                                                  '+++;\\\".''' '''                          -_.''_;.'''''''''''''''''''.'.......---,--.......'''''-''''''.---------------------'                                                         \\n                                                  -;++_        ''          ''            ',.''';_''  ''''''''''''''''''......---,----...''.''''''''       ''''''''.----.'                                                              \\n                                              ''.',\\\"+_          .'       '.__-''    .'   ..  ''+,''' ''.'''''''''''''.....-------.-...''''''''''''                 ''--'                                                               \\n                                              ''''-:+'          '.           '''' ':-'   ''  '';:''  ''',''''''''''''.....-----....-..'''''''''''  '                 '-.                                                               \\n                                                  ._+'          ',               ''.'''   .  '':;-'' '''....'''''''''...---.........''''''''''''                      --            '                                                  \\n                                                  '';_          .,               ''   ''  ''''',+\\\"''''''''.''..'''''.-,,-.......'''...'''''''''''                     '-          ''                                                   \\n                                                     ,\\\"-'   '-.,^'              '      '-'''''.-++,'''''''''...-..-::-.''''''''.'''.---.'.''''.''''''                  -'         '                                                    \\n                                                       '-_:\\\";^_.                '' '  '.'    ''.;+\\\"''''''..----,_^;,.''''''''''..'''.........-...''''                  ''         '                                                    \\n                                                            ''                  '''''''''''   '',;+\\\"-'''..-,,_:;;;_-.''''''''''''''..-------.--''''                    '.                                                              \\n                                                                                '''-:'         '''.,::\\\"\\\"\\\"\\\"\\\"^^^\\\":_,---.'''''''''....-----,,-.'''''''                     .                                                              \\n                                                                    ''         '    ''.'' '''''''''''''''..----------,-.''''''...'''...---'''''.' '''                   '                                                              \\n                                                                     ''       '  ''   ''.'''''''''''''''''.---------,,--'''.''..........'-.'''''''''  '                 '                                                              \\n                                                                      ''      '  '''.' ''''''''''''''''''..-----..--,_--_\\\"\\\"__,,,--,------.'''''''                       '                                                              \\n                                                                          '''''  ''''-'''''''''''',''''.,.---,_,-------:;_-...........-,__,-.'''                        '                                                              \\n                                                                         ';+++;:-'..' ''.''''''-.'.''.,---,:\\\":_::.....-^_..''.''...'''''.----,-.'''                     '                                                              \\n                                                                         '++^::^++:-'' '-''''''','..---,::::,-...''''..-_-.'.''''''...''.-.''..---.'                                                                                   \\n                                                                          ;\\\"'' '',;;:'''''''''''''.--,_:+;---.'''''......---..'''''''''''''''''''---.'                 '                                                               \\n                                                                          .:'     '-;;-''.-''''''..-:-::.--'''''''._....'''..--..'''''''''''''''''----'                                                                                \\n                                                       '.'                 :'      ''\\\"+:'''''''''''''''.''.........,..'''''''........''''..'''''.-----'                                                                                \\n                                                    -^++++;.               ',        '_+;-'''''''''''''''''''....''....''''''''''''''.-''''''''''''''                                                                                  \\n                                                  ---_\\\"+++=+^'              .'       '':++\\\"-''   ''''''''''''''.-...--....'''.''''''.'''''                         ''                                                                  \\n                                                 .     ':;+++;'              -    '''...\\\"++;:''  '   ''''''''''''.-.'.'......'''''''''''''                                                                                             \\n                                                         '_+++;'             ''  '.---'''^+++\\\"'    '  '''''''''''''''''.''..'''''''...'''                                                                                              \\n                                                           .^++;''            .  '.---.' ';+++:'           '''' '''''''''''''''''''''.''                                                                                               \\n                                                     '      '\\\"++;'            '' '''''''  -++++,'            '   '''          '       '''                                                                                              \\n                                                      ''      \\\"++;'            .'.'       ':+++;'               '                        ''                                                                                            \\n                                                              .;++:           '.,''        ';+++\\\"'                                                                                                                                     \\n                                                               .;++_         '.'''          .;+++:'                                                                                                                                    \\n                                                             '''_+++,          '''           '_:\\\";:'                                                                                                                                   \\n                                                               ':+++;'            '               ','                                                                                                                                  \\n                                                             '.\\\"++++;'             '     '          ''                                         ''                                                                                      \",\n  \"                                                                          ._:-'               '                       '-'                                        '''                                                                   \\n                                                                   ''''.-_::,'             '                           ''                                          '''                                                                 \\n                                                                 '''...--,_-.'                                         ''                                                                                                              \\n                                                                         '-_::_,.'                                      '                                                                                                              \\n                                                                         .:_,-,_::_-'''       ''''''                    ''                                                                                                             \\n                                                                        ','         ''''           ',                    ''                                                                                                            \\n                                                                       '-'                          ,'         '         ''                                                                                                            \\n                                                           '        ''',''   ''                    '-'   ' '    ''' '' ' '''                                                                                                           \\n                                                                      '-,.'''''''                 '-.'          ''''''''''''' ''''                                    '''                                                              \\n                                                                        '''.-,.'                ''-,''     '' '''''   ''.''.'''''''''                                ''''''                                                            \\n                                                  '                           ''..'            '',_''''    '''''''''''''''.'''''''''''  ''                           ''''''                                                            \\n                                                ''     '                          ''''''''''''-__-''''''   ''''''''''''''..'''''''''''''''''''                       '''''''                                                           \\n                                               ''  '.'.                                 '''''''''''''''''''''''._'''''''.''''''''''''''''''''''''                     '''  ''                                                          \\n                                                   -::'                                       ''''''''''''''''''-.'''.''''''''.'.'''.'''''''''''''                    '''' ''                                                          \\n                                                   :::'                                     '''..'.,__--..''''''''''''''''''''''....''''''''''''.'''                  ''''''''                                                         \\n                                                  '\\\"^\\\"-                                    '''''.:_.''''     ''''''''''''''''''.''..'''''''''''''''''''                '''''''                                                         \\n                                                  _+=;\\\",'''' ''                           ''''''_,'         ''''''''''''''''''''''.''''''''''' ''' '''''''''''''''''''                                                                 \\n                                                 '\\\"=+:'         '                         ''   ._'        '''  ''''''''''''''''''.''''''''''''''''       '''''''''''''''                                                               \\n                                                '-\\\";^'          ''        '''''     ''   ''    -,'    '''''''''''''''''''''''''''''''''''''''''                    '''''                                                               \\n                                                '_:\\\":            '                 '''    '   ',,'      '  ''  '''''''''''''''''''''''''''''''''                     '''          ''                                                   \\n                                                ':::_            .                '''     '   '-_''     '''''''''''''''''''''''''''''''''''''''                       ''         ''                                                    \\n                                                .::::'           .                        '  ''-:.'       ''''''''''''..'''''''''''''''''''''                          ''        '                                                     \\n                                                 '  '--'     '''-'              '       '''''''-:,'       '''''''''.-.'''''''''''''''.''''''''''                       ''                                                              \\n                                                       ''.--,,-.'               ''     ''     '-:_''    ''''''''.-_-'''''''''''''''''''''''''''''''                     '                                                              \\n                                                            ''                  ''''''' '      '-:_.'''''''''..-__-'''''''''''''''''''''''''''''''                      '                                                              \\n                                                                                 '''.           '''.--------,,,-.'''''''''''''''''''''''''''''''''                      '                                                              \\n                                                                    ''              '''''       '''''''''''''''''''''.'''''''''''''''''''''''''''                       ''                                                             \\n                                                                      '        '       ''''''''''''''''''''''''''''''''''''''''''''''''''''''         '                  '                                                             \\n                                                                       '      '   ' '''''''''''''''''''''''''''''''''''''''.....'''''''''''''                                                                                          \\n                                                                       '  '''''  ''''.'''''''''''''''''..'''''''''''''''.,-.'''''''''....'''''                          '                                                              \\n                                                                         .:::::_.'''''''-.''''''.''''''''''......'''''''_.''''''''''''''''...''''                       '                                                              \\n                                                  '                      ':,'''.,:_-'''.-'''''''.'''''''....''''''''''''..''''''''''''''''''''''''''                                                                                   \\n                                                  '                       ,'    ''-::''.-.'''''''''''..-_-'''''''''''''''''''''''''''''''' '' ''''''''                 '                                                               \\n                                                                          '.      ''-:-'''.'''''''''--..'''''''''''''''''''''''''''''''''''''   '''''''                                                                                \\n                                                                           .'       '._,''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                               \\n                                                       '.'                 ''        ''_:.''''''''''''''''''''''''''''''''''''''''''''''''''''''''''                                                                                   \\n                                                   '-_::::_.                ''        ''::_-'''  '''''''''''''''''''''''''''''    '''' '''                                                                                             \\n                                                 ''   '-::::,'               '     '''''':::_''  '   ''  ''''''''''''''''''''''     ''                                                                                                 \\n                                                        '-:::_'              ''  ''''''  '::::'    '  ''       '''     '''''''     '''''                                                                                               \\n                                                          '_::_'              '  ''''''   .:::_'                    ''         ''''''''                                                                                                \\n                                                           '-::_''               ''''''   ',:::,'                 '                   ''                                                                                               \\n                                                             -::,'             ''''        ',:::-'              '                                                                                                                      \\n                                                             '_::,            '''''         '::::'                                                                                                                                     \\n                                                              '_::-          '''''           .:::_'                                                                                                                                    \\n                                                              '-:::-            ''            '.-,,'                                                                                                                                   \\n                                                              ',:::_'                             '.'                                                                                                                                  \\n                                                              .,,-.'                                 '                                        '                                                                                        \",\n  \"                                                                         ''-____-'                                   '.'                   '''''''                                                                                     \\n                                                                   '.---,________-.        '                          '.'                      '''''''             ''''                                                                \\n                                                                '''.''''-__:_______-                    '              ''                         ''''''''''''''''''''                                                                 \\n                                                                  ''    '-:,.'''''-_-'         '         '              ''                           ''''''''''''''''                                                                  \\n                                                                         :'        ''--.''''''..'''       '''           ''                                                                                                             \\n                                                                        ,.                    .''','                     ''                                                                                                            \\n                                                            '   '     '-_                    '.  ','           ''   '    '''                                                                                                           \\n                                                           '   .    ''.:_'  ''''             .'  '-        ''    '  '' '  '''                                                                                                          \\n                                                              '       '_\\\".'''''''          ''   ','              ''''''''''.' ''                                                                                                       \\n                                                             '         ',-'''..'''        '   '-:-         '  ''''' ''''..'..''''''''                                                                                                  \\n                                                            .           '.'    '''..-..--.'.-,-.'           ''''''   ''''''.-''''   ''   '                                                                                             \\n                                                 '     '  '.'             ''''     '''''''''''             '''''.''''''''''-.''''''''''   ''                                                                                           \\n                                                '  '  '  '.                                        '''''''''''''-'.-'''''.-'''''''''''''''''''''                                                                                       \\n                                               '   ' '' '.                                '   '   '''''   '''''''''''...-.'''''''''''...''''''''''                                                                                     \\n                                             ''   '  ....                                     ''''''''''............''''.'''''''''''--'''''''''''''                                                                                    \\n                                             -'   . ':\\\"'                                     '''-''-,,-.'''''''''''''''''''''''''''-,''''''''''''''''                                                                                  \\n                                            ',.  '-',,..''''                               ''''''._-''''   ''''''''''''''''''''.''',.''''''''''''''''''''                                                                              \\n                                            '''  -__.                           '''' .'   '''  '',-''    '''''  ''''''''''''''''''-.''''''''''' ''     ''''''''''''''''                                                                \\n                                                ._.-.                     ''.'            '''''.,_''' '''''''''''''''''''''''''..'.''''''''''''                    '''''        '                                                      \\n                                                _,'''            '                  ''        ''_,'     ''' '''.....'''''''''..'''''''''''''''''                     '''        '                                                      \\n                                               ._,'''            '                 ''     '    -_-'      '''''''''''.'''''..''''''''''''''''''''                      '''                                                              \\n                                               ___-.'            '                            ',_.       ''''''''''''''...'''''''''''''''''''''                        ''                                                              \\n                                              '___,.-.'          -              '       '  '''.__.'      '''''''''''-,.''''''''''''''''''''''''                         '                                                              \\n                                               ''      '''''.''..'                     '      '__.'     '''''''''.-__'''''''''''''''''''''''''''''''                    ''                                                             \\n                                                           '''                   '  '         '.,,.'    ''''''''-,_-.''''''''''''''''''''''''''''''                     ''                                                             \\n                                                                                 ''''           '''...'''..---,--.''''''''''''''''''''''''''''''''''                    ''                                                             \\n                                                      ''            ''                 '              ''''''''''''''''''''''''''''''''''''''''''''                      ''                                                             \\n                                                    '                 ''       '        '     '''    '' ''''''''''''''''''''''''''''''''''''''       ''                  '                                                             \\n                                                    ''                 '       '         ''''''''''-''.-''''''''''''''''''''''''''''''''''''''                          ''                                                             \\n                                               ''    '.'            '  '''.--.''    '''''''''  ''''''':=-'.''''''''''''''''.----......''''''''''                        ''                                                             \\n                                               -\\\"_.'   ''''''        ''' -_,--,,-.'''  '.'' ''''''''''':;----''''''''''''.,,.'''''''''.----.''''''                      '                                                              \\n                                               .\\\":-.'         '.-.       '_'   ''-,-'   '''''''.''''''''..'''''''''''''''',-''''''''''''-,.'.....''''                  '                                                               \\n                                              '---..''          '..       -'      '-:.''..'''' '''''''''..'''''''''''''''''.-'''''''''''''''''''....'''               ''                                                               \\n                                               '''''.''          '.       ''        '-,'''.'''  '''''''''''  '''''''''''''''.-'''''''''''''''''''''--'''             '                                                                 \\n                                                    '''''         .'       '         '',-''''     ' '' ' ''       '''''''''-,'''''''''''''''''''''...''''                                                                              \\n                                                     '.-,--.''  ''.-.''     '          '__-'''           '.  ''     ''''''''''''   ''''''''''''''''''               '                                                                  \\n                                                      ',,.''''''---...''    ''        ''.___,''      '    '.'''''''''''''''            '                    '''''''                                                                    \\n                                                   ''.-:\\\"-'      '..'        '       ''''.___,'  '   '      '''''''''''''  ''                              '                                                                           \\n                                                       ',:_-'      '              ''''    .__:_'''''                      '         ''                                                                                                 \\n                                                         '__,'      '         '  '''''     -__:\\\",-'                             '''''''                                                                                                \\n                                                          '__,'                  '''       '-_::,'                                                                                                                                     \\n                                                           '__-'                '''         '-,__-                                                                                                                                     \\n                                                           '',_-''    '        ''''          '.,__'                                                                                                                                    \\n                                                             '__'    ''       ''''            ''-_-'                                                                                                                                   \\n                                                             ',_-'       ''     ''             '''--'                                                                                                                                  \\n                                                              ,,'        '                         '.'                                                                                                                                 \\n                                                             ''                                      ''                                                                                                                                \",\n  \"                                                                          '''........'           '      '            '''                   ''''                                                                                        \\n                                                                   '.................'          .       .             ''                      '''                     '                                                                \\n                                                                 ''.'  ''.-.'''   '..'         ''       _              ''                        ''''                                                                                  \\n                                                                  -'     -.'        '.'        ,        -,              ''                          ''''''         '''                                                                 \\n                                                                 .      ,-           ''.'''  '_.         ,:'            ''                            ''''''''''''                                                                     \\n                                                                ,'     ::                '''''^..'        .^;\\\"_-''       ''                             ''''''                                                                         \\n                                                               -.    '_;.                    -^'.'        ',;;;;;;\\\"''    '''                              '''                                                                          \\n                                                              -:    '.;;'''''''             '\\\"-'''        ''_;;;;++^.'    '''                                                                                                          \\n                                                             '\\\"      .;;'''''''''          '_,'''       '   ''-____:\\\",''' '''''                                                                                                        \\n                                                             ^'      '^;'   ''''''''''''''-_-'''''      '  '''''''''''...''''''                                                                                                        \\n                                                         ' '\\\",        -;\\\"'     ''''''''._,'''              ''''''''''''''.'''.'''   '    '                                                                                             \\n                                                         ''^^'         .\\\"^-'        '.--'    ''   '''''''''''''''''''-.'''''..'''''''''''                                                                                              \\n                                                '     ' ' :^'             '..-..'''''   '  ''  ' ''''''''-.''''''''.''''''....''''''''''''''''''                                                                                       \\n                                              ''      ' ':;'                         ' ''''-_''''''''''''_:-''''''''''''-__.''''''''''.'''''''''''                                                                                     \\n                                             ''       ''\\\";'                               ''''''.'''''''-.''''''''''..\\\";_--''''.''''..'''''''''''''                                                                                    \\n                                             ''       -;;'                                  ';_-\\\".'''........''..-,-'''-_''''''''''...'''''    '''''                                                                                   \\n                                             ,'  '   .;;,                        '''''     ''''-.''.-...-__'''''''-.''''-_''''''''.-.'''''''    '''''''                                                                                \\n                                            :,  ''   ;+\\\"                      ''.---.:.'.'''''''''-\\\"\\\"'''''.'''''''''''''.:-'''''''..''''''''' ' '      '''''''''''''''                                                                 \\n                                                '   ';;'                  '...'''''  '''''.-.'--.--:,.----,,-.''''''''.-'-_'''''...'''''''''  ''                   '''''       '                                                       \\n                                               ''    ;-'                 ''  '''    ''    .'''''...''''''''.-:\\\"::__-'''''''''..''''''''''''''' ''                     '''                                                              \\n                                               .    '''                 '    '     ''    '''  ''-.''''''''''''''---:\\\".''''...''''''''''''''' '''                       ''                                                              \\n                                              ''    '                  '    '            '   ''.,.'''''''''''-,_.''':_...-.''''''''''''''''''  ''                       ''                                                             \\n                                              .'   ''            '                    '  '''''...'''''''''.,.',\\\"_.''-_..''''''''''''''''''''''.'                        ''                                                             \\n                                             '..''     '''  '  '''    '                     ''...''''''''''--_''''.-_,''''''''''''''''''''''''''''                      ''                                                             \\n                                                           '''       '                       ''...''''''''--.''''.--,_'''''''''''''''''''''''''''''                     ''                                                             \\n                                                    '                '             '           '''',\\\"-''''''.......''_''''''''''''''''''''''   '''''                     ''                                                            \\n                                                    ' ''            ''              '           '''-''''''''''''''''''-''''''''''''..'''' '    '                         ''                                                            \\n                                                    .               '            '          ''-''''''.''''''''''''''''.-'''''''''''''''''''    '                         ''                                                            \\n                                              '     ','             .  '                 '''''.::--^,:;'''''''''''''''''.'''''''''''''''''''''  '                       ''                                                             \\n                                              .,'    -\\\"-'           \\\"    ''''''''    '''''''''''''''''+=_,\\\".'''''''''''''''''''''''''''''''''    '                      ''                                                             \\n                                               ;;^-    '-_,,,--'''.:;\\\"-' '.''''..''''        ..'''''''';=^^\\\"-''''''''   ''...--..''.....'''''''''                      ''                                                              \\n                                               ;;;^:'        ''-:;;;^-.'''.'     ''.'   '  '''.:'''''''':.'''''''   '''  ''-\\\":''''''.'''--....'''''''                 ''                                                               \\n                                              _;;;^^:'           '\\\";:'    '        '.''',-''''  ''''''''-.''''      ''    ''._,''''''''''''''''.-..'''''              '                                                                \\n                                              ':^\\\"^^;\\\".           ';_''    '        ''''.-\\\"''     ' ''''.-''      ''''   '''',+_'''''''''''''''''....'''''           '                                                                 \\n                                                  '_^^^:-'         ^^--    '           '...'            '_'        '      ''.,.''''''''''''''''''''''''''''         '                                                                  \\n                                                    .^;;;;^:-''   '_;;;_'''''''''''     '..''      '    '_:''''        ''''''  '                         '''''''  ''                                                                   \\n                                                     '^;;;\\\":::\\\"^^\\\":-'..'             ''''....''           -:_-.''''''.''''                                 '''                                                                         \\n                                                      '^;,'     ',;\\\"'        '           '.--.'             ''.-_,.''                                                                                                                  \\n                                                       '\\\":'        :.                      '.:^\\\"::_.''       '                                                                                                                         \\n                                                         _-'        ,            ''''       '.;;;;;;_'                            '                                                                                                    \\n                                                          _-'        '         ''''         '::_,-''                                                                                                                                   \\n                                                          '^.'       .'        ''''       ''''''..'                                                                                                                                    \\n                                                          .''.'      ':         ''      ''     ''..'                                                                                                                                   \\n                                                             .'    '':^,'  '''''''              ''.'                                                                                                                                   \\n                                                             '.   ''''''.^_'                      '.'                                                                                                                                  \\n                                                             ''          :.                         ''                                                                                                                                 \\n                                                                          -                           ''                                                                                                                               \",\n  \"                                                                                                  -'   '-                                '                                                                                             \\n                                                                   ''''    '                     -.    ',                                                                                                                              \\n                                                                  '''    ''                     -.      _'                                                                                                                             \\n                                                                 '''    ''                     ..       .-                                                                                                                             \\n                                                                '-    ','                     '-        '_.                                       '                                                                                    \\n                                                               ':'   ,\\\"'                     ':'         ':-'                                                                                                                          \\n                                                               :-   _\\\"_                      ._          '_\\\"-''                                                                                                                        \\n                                                     '        _:'  -\\\"\\\".                     '_.      '' ''-\\\"\\\"-''.''                                     '''                                                                            \\n                                                             .\\\"-  ':\\\":'                    '.,'    '''''''':^^:-.'''''''     ''                                                                                                        \\n                                                            '\\\":'  '\\\"\\\":'                   '--''   ''''''.''.--_\\\":_,--..''''''''''                                                                                                      \\n                                                         ' ':\\\"_   -\\\"\\\"\\\"-                 '-,'' ''''''''''''''''''''''''.-,-.'''''''                                                                                                     \\n                                                        ''',\\\"\\\"-   .:\\\"^\\\"-'            '.--'' ''''''''''''.''..''''''.'-,:^\\\":-'''''''' '   '''                                                                                           \\n                                              '       ''. '\\\"^\\\".'  '._:::::,-..''''...''''''''''....''''''--''.''''...'''''.'''.-'''''''''.''                                                                                           \\n                                              .       ''' -^^\\\",-.''''                '''''''''._,'''''''._;_-''''''''''.---''''.-'''''''.'''' '                                                                                        \\n                                              '       '.''\\\"^^\\\",-''                     ''''.-...:,.....-,,--..'''''''.:,--_''-..--......'' ''''                                                                                        \\n                                              '       '.',^^^:.''                        '''-:_,:-.......'.''''----..'.-'''.....''''''''                                                                                               \\n                                                       ''\\\"^^\\\",.'                ''''''''''.''''.........-__'''..'.-.'''''.'''''''''''''''  '       '                                                                                   \\n                                             '         ._\\\"\\\":.'                 '''..'-.''''''''''''::.'.-_,'''..''''''.-::''''''''''''' '' ''  '''                                                                                     \\n                                            '        ''::-'               '''''''..'''''..---....--\\\",-----......''''''_\\\"^\\\",''''''''''''       '''                                                                                      \\n                                                     '_:.'              ..    ''''   '' '''.''''''''''''.-,_:_-....'''''.'''''''''''''''    ' ''                                                                                       \\n                                                     .-'               .'    ''     '    ''''''''''''''..''..-_:\\\"\\\"\\\":_.''''''''''''''    ''    '                                                                                        \\n                                                     '                ''     '           '''''''.'''''..''''','...-_=^.''''''''''''  ''''  '  '''                                                                                      \\n                                                    '                 '             '   '''''''''''''''..'-_.--.'''_\\\"^-.''''''''''''    ' '  '''   '                                                                                   \\n                                                    '                ''        ' '' '      ''''''''''''''''-::-''.:-_:..''''''''''''      '' ''                                                                                        \\n                                                    '                '   ''      '          '''''''''''''''..'''''.--\\\"-.''''''''''''   '     ''                                                                                        \\n                                                    '                .'''                    '''''''-''''''''''''''''-_.''''''''''''''        '                                                                                        \\n                                                    '                '           '  '      '''''''''.'''''''''''''.'''-_.''''''''''-'         '                                                                                        \\n                                            '       '               '           '' '       '''-'''.''''''''''''''''''''.,.'''''''''''   ''    ''                                                                                       \\n                                             ''      ,'             -          '''   '  ''''''.,_-,__;_.'''''''.'''''''''--'''''''''   '''  '' '                                                                                       \\n                                              _.      .,'''''      -_     ''''''''  ''''''''.''''''''.::.''''''''''''''''''-.''''.''''''        ''                                                                                     \\n                                              .\\\"\\\"_'     ''.-,,___:\\\":.          ''''''        '.'''''''':::::''''''''''''''''.:,''''''''                                                                                                \\n                                              -\\\"\\\"\\\":'            '''''.-,-.'''''        ''  ''',,'''''''.:'''''''' '''''''''',--:_-.'''''''                                                                                             \\n                                             '\\\"\\\"\\\"\\\"\\\":'              '.:\\\"-               '--' ''''     ''.:'''        '''''''''''-\\\"\\\"\\\"\\\":-'''' ' ''                                                                                        \\n                                              ':\\\"\\\"\\\"\\\"\\\"_'             '\\\"\\\".          '  '''-_\\\"''        ''':.'     '   ''' '..''.-:\\\"^^^\\\"_.'''                                                                                             \\n                                                .:\\\"\\\"\\\"\\\"\\\":.            _\\\":.'              ''.''         ''::''      ''' '''''''-,_,-..'''''                                                                                              \\n                                                  -\\\"\\\"\\\"\\\"\\\"\\\"\\\"_-''       '-_-...'''''''''''  ''            '.\\\":-'''  ''''''''...'''''''                                                                                                    \\n                                                   .\\\"\\\"^^^^\\\"\\\"\\\"\\\"\\\":,-'  '''              ''..''''          ''-:::_--,,-----'''   '                                                                                                        \\n                                                   '.\\\"\\\"^\\\":'''''.-:\\\"_''                   ''-,-....'''    ' ''''.::''''   ''    ''                                                                                                      \\n                                                    '':\\\"\\\"-        ':,                       ':\\\"\\\"\\\"\\\"^\\\"\\\",'     ''         '               '                                                                                               \\n                                                      ':\\\":'         _'                      ':\\\"\\\"\\\"\\\"\\\"\\\"\\\"_''                ''''                                                                                                           \\n                                                       '\\\"\\\",         '_        '''''        ._,-....''              '                                                                                                                   \\n                                                        '-'          ,-    ''...'''''  ''''                                                                                                                                            \\n                                                                     -\\\"'   '''.''''''''                                                                                                                                                \\n                                                                  '.-\\\"\\\"\\\",''---.'''                                                                                                                                                     \\n                                                                  '-'..-:\\\"_''''                                                                                                                                                        \\n                                                                   '   '':.''''                                                                                                                                                        \\n                                                                        '.:.'''                                                                                                                                                        \",\n  \"                                                                                                   -_,,:-                               '                                                                                              \\n                                                                  ' ''                            -,'''--                                                                                                                              \\n                                                                 ''''                           '-.    ','                                                                                                                             \\n                                                                 . ''   '                      '-'      ..                                                                                                                             \\n                                                                -.'  '-'                      '-'       '-'                                      ''                                                                                    \\n                                                               ':,'.__'                      '-'         ','                                          ''''                                                                             \\n                                                              '_::_::.                       ..          '--'                                                                                                                          \\n                                                     '       '_:::::_'                      ','          '-_'' '.'                                    ''''''                                                                           \\n                                                             -::::::-                       '-'    ''''  ''__''''''                                '''       '                                                                         \\n                                                            ':::::::.                     '.-'    '''''''.'.-,,-.''''''''' '                     '                                                                                     \\n                                                            -::::\\\"\\\":-                   ''-'''''''''''''''''''''''''''''''''''  '             '                                                                                        \\n                                                         ' '_^^^;+;::.'              ''.-''''''''''''''''''''''''''''''.:_-.''' '           ''                                                                                         \\n                                              '       '''  ':;=====+\\\"::_,-..'''''''...''''''''..''.''''''''''''''''''''''.''''''''         ''                                     '                                                    \\n                                              .       '''  -:;=====;\\\"_-''            ''''''''''_,''''''''-:-''''''''''''..''''''''''''   ''''                                    '''                                                   \\n                                              '       ''   -::;+==;:-'               ' ''''''''',,'''''---....''''''''.''''''''.''''''   ''''''                      '          '                                                      \\n                                                      ''   ,:::\\\"++:_'         ''        ''''''..,.'''''''''''''''''''''''''''''''''''''''''''  '                                                                                       \\n                                                     '''  '_::::;^:.             '''''''''.'''''''''''''''''''''''''''''''''''''''''''''''''  '''''                                                                                    \\n                                             '         ' ',:::::_-'             '''''.'''''''''''''--''''''''''''''''''.'''''''''''''   '' ''''''                                                                                      \\n                                            '        '''-,.'            '''''''''''''''''.........._.....'''''''''''''--,'''''''''''         ''''                                                                                      \\n                                                     '',.'             .-'     '''    '  '''''''''''''''..---.''''''''''''''''''''''         ''                                                                                        \\n                                                     '.'              ''      '             '''''''''''.''''.______,.''''''''''''            ''                                                                                        \\n                                                     '                .                      '''''''''-_,''''-'.---^+:''''''''''''     '   '  ' '                                                                                      \\n                                                                     ''                 '''   ''''''''.--.-.'.''''',:\\\",'''''''''''      ' '  ''    '                                                                                   \\n                                                                     '              '        '''''''''''''''-,'''.,._:.''''''''''            ''                                                                                        \\n                                                                     '   ''         '      '  ''''''''''''''''''''''-:,.''''''''''     '     ''                                                                                        \\n                                                    '                ''''         ' '           '''''''''''''''''''''._,''''''''''''''       '''                                                                                       \\n                                                    '                           ''  '          ''''''''''''''''''''''''-,''''''''''.'        ''                                                                                        \\n                                            '        '              '           ''         '''.''''''''''''''''''''''''''-.'''''''''    ''   ''                                                                                        \\n                                             '       '.             .          '''      '''''''.-.,-,\\\",.'''''''.''''''''''.-.''''''''        '''                                                                                       \\n                                              ,'       ..''''''  '','     ''''''''  '''''' ''''''''''.::.'''''''''''''''''''.-.'''''''''       '''                                                                                     \\n                                              -:-'        '''..--.'        ''   '''''        '''  ''''.:-''.'''''''''''''''''.-,,-.'''''                                                                                               \\n                                             ',::_.                      '''''''       '    '','   ''''_,'''' ''''''''''''''.'''.-_::_,-''                                                                                             \\n                                             '::::_-'                  .__'             '.'  ''      ''_,'''   '''''''''''''''''''.,::::,''                                                                                            \\n                                              ',::::_.'              '',:,'      '      '-:''        '',:'''  ''''''''''''''''...,:::::_,'                                                                                             \\n                                                ._:::::-'             ''-,_,-----.''    '''''        ''-:_''''  ''''''''''''''-,:,--...-'                                                                                              \\n                                                 '_:\\\"\\\"\\\"::_-''         ''          ''..''              '._::,-.'''''''''''.....''''''''''                                                                                               \\n                                                  '_\\\"\\\"::::::::_-.''  ''                '...''''''''''''''--_____,,_,,--.'.''''''        '                                                                                              \\n                                                   ._:::_.''''.-,__-''                    '-________-.''''''''''.-''''''''''   ''                                                                                                      \\n                                                    '_:_'         '_,'                      ',::::::::-''   ''  ''     '' '            '                                                                                               \\n                                                     '--'           ,.'                    '._:::::::_-''              '''''                                                                                                           \\n                                                       .'           ','                   '--..'''''''             ''                                                                                                                  \\n                                                        '            --  '''''''''''''''''                                                                                                                                             \\n                                                                     -:.  '.--.'''''''                                                                                                                                                 \\n                                                                  '.-:::,..-,,-.''                                                                                                                                                     \\n                                                                  '-'..-::_..-.'                                                                                                                                                       \\n                                                                   '    '_.''.'                                                                                                                                                        \\n                                                                         '-''''                                                                                                                                                        \"\n]\n"
  },
  {
    "path": "components/shared/effects/flame/core-flame.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./core-flame.json\";\n\nexport function CoreFlame(attrs: HTMLAttributes<HTMLDivElement>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = 0;\n\n        const newStr = data[index];\n\n        ref.current!.innerHTML = newStr;\n      },\n      interval: 80,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <>\n      <div className=\"absolute inset-10 -z-[10] overflow-clip\">\n        <div\n          ref={wrapperRef}\n          {...attrs}\n          className={cn(\n            \"cw-[1110px] ch-470 absolute pointer-events-none select-none\",\n            attrs.className,\n          )}\n        >\n          <div\n            className=\"text-black-alpha-20 relative left-0 font-ascii\"\n            ref={ref}\n            style={{\n              whiteSpace: \"pre\",\n              fontSize: 8,\n              lineHeight: \"10px\",\n            }}\n          />\n        </div>\n      </div>\n    </>\n  );\n}\n\n// Export default for backward compatibility\nexport default CoreFlame;\n"
  },
  {
    "path": "components/shared/effects/flame/explosion-data.json",
    "content": "[\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                       '_^_  ,^_'                                                       \\n                                                    '.\\\"\\\"\\\"+=\\\"\\\"=+\\\"\\\"^-''                                                   \\n                                                ''..:::,_::::::_,:::..''                                                \\n                                               ''.-_\\\"::___:^^\\\"___::\\\":-.'''                                              \\n                                                '.'-_:::\\\"+^\\\"\\\"\\\"+^:::_-'.'                                                \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                        '-''''-'                                                        \\n                                         ',::_-'-:\\\"-'_++++^^^^++++:'-\\\":-'._::,'                                         \\n                                   '''''^+++^^\\\"^++^\\\"\\\"^++^^++++^^++^\\\"\\\"^++^\\\"\\\"^+++^.''''                                   \\n                              '''-:^^^^+++===+++^\\\"\\\"\\\":^^^\\\":\\\"\\\"\\\"\\\":\\\"^^^:\\\"\\\"\\\"^++++==+++^^^^:-'''                              \\n                              ''.-_\\\"^^++++===++^-'''''-:\\\",....,::,'''''-^++===++++^^\\\":-.''                              \\n                                '''.-_^^+^++=+++:_-..._^^^:\\\"\\\":^^^:...-_:+++=++^+^^_-.'''                                \\n                                      '''''.,,_+++^^:_...' '' '..._:^^+++:,,'''''''                                     \\n                                                 '-'                '-'                                                 \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                      '''-''''-'''                                                      \\n                                       '.:+^\\\"\\\"''_+^_-:^+++^^^^+++^:-,^+_''\\\"\\\"^+:.'                                       \\n                          ' '' ''-.-:..^++=^\\\"\\\"\\\"\\\"^^\\\":::\\\"++^++++^^+^:::\\\"^^\\\"\\\"\\\"\\\"^=+++..:-.-'' ''''                          \\n                        -:::\\\"\\\"-,^+++=++++==++^^\\\"::--_\\\"^\\\"^^\\\"\\\"\\\"\\\"^^\\\"^\\\"_--_:\\\"^^^+==++++=+++^--:\\\":::-                        \\n                         '_:^^^^+^^++++++==++^:'''''''.:\\\"^,--,^\\\":.'''''''_^++==+++++++^+^^^\\\":_.                         \\n                           ''-\\\"^\\\"_:_:^++++++++\\\".'---...:\\\"^\\\",,\\\"^\\\":-..---'.:+++++++++:_:::^^,''                           \\n                              '.'' '-\\\",.-.'-\\\"^^^,:^\\\"_:-' '    ' '-:_\\\"^:,^^^^-'.-.,\\\"-' ''.'                              \\n                                               '''.,-              -_.'''                                               \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                         ',''   '''   '.'.'  '.'.'   '''   ''-'                                         \\n                   .'''''''   ''     ',_\\\"^\\\"\\\"^\\\"\\\":^^:\\\"^^^^^^^^^^^^^^^^^:^^:\\\"\\\"^\\\"\\\"^\\\"_,'     ''   ''''' '.                   \\n                 ':++:++^^:'' ''-,\\\"_:::\\\"^++^^\\\"\\\"^\\\"\\\"_\\\"^+^^++^\\\"\\\"^++^^+^\\\"_:^^\\\"\\\"^^++^\\\":::_\\\",-'' '':^^++:^+:'                 \\n                '_^++===++^\\\":.,:+++^^\\\"\\\"^^^:::::\\\"::_,:\\\"\\\":::-__-::::\\\":,,::\\\":::::^^^\\\"\\\"^^+++:,.:\\\"^++====+^_'                \\n                 ',\\\"+++=++\\\"_:++++++^\\\"\\\"^^^\\\"-_,,_::-..-_,:\\\"::,,::\\\":,_-..-::_,,_,\\\"^^^\\\"\\\"^++++++:_\\\"++=+++\\\"_.                 \\n                    '_-.\\\"^:-^:,,-.:\\\"^^^^__::::_,:___:\\\"::__''''__:\\\"\\\":___:,_::::__^^^^\\\":.-,,:^-:^\\\".-_'                    \\n                        -.' .'   '.:_::-'''-\\\"^\\\"--,_,\\\"\\\"^'        '^^\\\"__,--:^\\\"-'''-::_:-''  '. ''-                        \\n                                              '-.'' '''           '' ''.-.                                              \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                        '                '_.' ''.''  ''.'.'  '.'-''  ''.'' '._.                '                        \\n                 ':.'' ''   '' '' ''._::\\\"^\\\":^^^\\\"^^\\\"^^+^^^^^::^^^^^+^^\\\"^^\\\"^^^:\\\"^\\\":::.'' '' ''   '' ''.:'                 \\n               '-^++++^\\\"\\\".' ''_^^:_--_:^^^^^^\\\"\\\"^^^\\\"++++^^^\\\",,:^^^++++\\\"^^^\\\"\\\"\\\"^^^^^:_--_:^^:'' '.\\\"\\\"\\\"++++^-'               \\n               ,^+++===+^\\\"_:--\\\"^^^\\\"\\\"\\\"\\\"\\\"\\\"\\\":::_::::::\\\"\\\"\\\":::,-,,-,:::\\\"\\\"\\\":_::::_:::\\\"\\\"\\\"\\\"\\\"\\\"^^^^^--:_\\\"^++==+++^:               \\n               '^^^++++++\\\",\\\"++++^\\\"\\\":--::_,__:::\\\":,-,,__:::,''-:::__,,--:::::__,_::,-:\\\"\\\"^++++^,:++++++^\\\"^'               \\n                   ':,._^-:'''--,_::_,\\\"--_:::_::::\\\"^\\\"^^:-'    '-:^^\\\"^\\\"\\\":::_:::_--\\\"__::_---''':-^_.,:'                   \\n                       .'       ''-:^\\\"_.----:^:,,:\\\"_._\\\".        .\\\"_.,::,,:^\\\"----._:^:,''       '.                       \\n                                 '''''       '--,'                    ',--'       '''''                                 \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                          .''   ''''''.''':-___.'    ''''    ' ''''    '.___-_.''.''''''   ''.                          \\n               '\\\"\\\"^''    .\\\"^\\\"++\\\":_^\\\"^^^+++^^++++^\\\"\\\"++:_:_:-  .:_:_:++\\\"\\\"^++++^^+++^^^\\\"^__\\\"++^^\\\"-    ''\\\"\\\"\\\"'               \\n              '^+++^\\\"_,-_\\\"::\\\"\\\"\\\"\\\":^^^^^\\\"^+++++++=++++^-',_.'   ._,'-^++++=++++++++\\\"^^^^^:\\\"\\\"\\\"\\\"::\\\"_-,_:^++++'              \\n              '^+=++^\\\"^^\\\"^:_:\\\"^^^^^^^^^\\\"^^++^++++^\\\"::_-''' '' '''-_::\\\"^++++^++^^\\\"^^^^^^^^^^:_:^\\\"^^\\\"^++=++'              \\n              ':^+++++++^:,,\\\"^^:_:_:\\\"\\\"\\\"\\\"^^^^\\\"^^^^::\\\":,-'        '-,:\\\"::^^^^^\\\"^^^\\\"\\\":\\\":_:_:^^\\\"_,:^+++++++^:'              \\n               '  '' ''...-,::_::,,,_\\\"\\\"^++++^^++++^^\\\"\\\"\\\"'        ':\\\"\\\"^+++++^^++++^\\\"\\\"_,_,::_::,-...'' ''  '               \\n                           .-\\\"-,:::_:::\\\":\\\"^^^^^^+\\\"'                  ':+^^^^^^\\\":\\\":::_:::,-\\\"-.                           \\n                            '.--.,^\\\"_'''     '-,,'                    ',,-'     '''_\\\"^,.---'                            \\n                                ''                                                    ''                                \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                             '                            '                                             \\n                ''      :^,-..'-''-,...-.,__^:-'                        '.:\\\"_,_.-.-.,-''-'..-,\\\":      ''                \\n              '::^''  ..\\\"\\\"+++++^^+^++++++=+++++++^\\\":-'_-.-    ---_'-:\\\"^+++++++=++++++++^^+++++\\\"\\\".-  ''^::'              \\n              \\\"++++_,,_^^^\\\"\\\"^\\\"^+++++++++++++++==+^^^:.''''    '.''.:^^^+====+++++++++++++^\\\"^\\\"\\\"^^^:,__^+++\\\"              \\n              \\\"==++^\\\"^^^_,:\\\"^+++++++++^++^++++++^:::-'' '''..''' ''-:::^++++++^++^+++++++++^\\\":,:^^^\\\"^++==\\\"              \\n              .:^++++++^\\\"-,:^+^:\\\"\\\"^^^^^+++^^+^^+^::,-,'          ',-,_:^+^^+^^^++^^^^^\\\"\\\"\\\"^+^:,-\\\"^++++++^\\\".              \\n                ''  .::_:\\\"\\\"\\\"_:\\\":\\\"^^^++++=+++++===+:.'''          '''':^===++++++++++^^^\\\":\\\":_\\\"\\\"\\\":__:-  ''                \\n                      ''''''_::,:\\\"^^++^^++++++++^.                    '^++++++++^^++^^\\\":,::_''''''                      \\n                            -_,--\\\"^^_:-'  ''''.,-                      -,.''''  '-:_^^\\\",-,_-'                           \\n                              '''''                                                  '''''                              \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                    '_:'    ' ' '''        ''                               '        ''' ' '    ':_'                    \\n               .,'  -_:::-.:+^__^^^::.'--,\\\"^:'''                        ''':^\\\"_-,'._:^^^__\\\"+:..:::_-  ',.               \\n            '..\\\"\\\"\\\":\\\"^\\\"\\\"^^++++^^^\\\":\\\"^++^+++++++^^-'''                '''-^^+++++++^++^\\\":\\\"^^^++++^^\\\"\\\"^\\\":^\\\"^..'            \\n            .^^+^^+^^++^^+++^^^^^^^\\\"^^^^^\\\"\\\"^+++^::..'              '..::^+++^\\\"\\\"^^^^^\\\"^^^^^^^+++^^++^^+^^+^^.            \\n            '++^^++^\\\"^+^^^^^^^^^^+^\\\"::^^\\\":::\\\"++^_,.'''''''    '''''''.,_^++^::_\\\"^^:::^++^^^^^^^^^+^\\\"^++^^+='            \\n            '_^^^^^+++^\\\"\\\"^^::\\\"^+^\\\"\\\"^^+++^::::\\\"\\\"^^,''     '    '     ''-^^\\\"\\\"::::^+++^^\\\"\\\"^+^^::^^\\\"\\\"^+++^^^^^:'            \\n              , .:^++^_,--_::^++++^+==+==+=^^^\\\"::.                    '::\\\"^^^++==+==+^++++^::_--,_^++^:. ,'             \\n                 -\\\"^^. ''--_,_\\\"^++++^^++:\\\"+^+^+^-                      -^+^+^+^:++^^++++^\\\"_,_--'  .^^^,                 \\n                          .'',,_^++\\\"-''   ' ''''                        '''' '   ''-\\\"++^_-_''.'                         \\n                              ''  '                                                  '  '''                             \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                   ''                                                                              ''                   \\n                '  ''--    ''.',-'        ''                                ''        '-,'.''    .-''  '                \\n             ''.,.'''_::'':+^\\\":\\\"^:::-''__:^::. '                        ' .::^:__''-:::^\\\":\\\"^+:.':\\\"_'''',-''             \\n           '-.^++++=+^++^^^+^^^^^^\\\"^^^^^^^^++:,,                        ,,:+++^^^^^^^\\\"^^^^^^+^^^++^+=++++^--'           \\n           '^^==++^+++++++^^^\\\"\\\"^^::::\\\":\\\"^++^\\\":\\\":-.''  '          '  '''-:\\\"::^++^^:\\\"::::^^\\\"\\\"^^^^++++++^++==+^'           \\n           '+++++++^^+=+^\\\"^^+++^^:,:::\\\"\\\":\\\"^\\\"^^^\\\".''.''   ''''''   ''.''.\\\"^^^\\\"^\\\":\\\"\\\":::,:^^+^+^^\\\"^+=++^+++++++'           \\n            ^+++++++^^^^::\\\"^++^^\\\"^^++\\\"\\\":,,::\\\"\\\"^^_-     '        '     ._^^\\\"\\\"::,,:\\\"\\\"++^^\\\"^^++^\\\"::^^^^+++++++^            \\n             :-\\\"^^++\\\"_,_::\\\"\\\"^+++++++++++^^^++\\\":_'                      '_:\\\"^+^^^+++++++^+++^\\\"\\\"::___\\\"+++^^-:             \\n               -^+++: '-::_:\\\"^+++^^:^++,'-::::^_                        _^:_::,'.++\\\":\\\"^+++^\\\":_::-' _+++^,               \\n                '''     '   .,__\\\"\\\"_. ''                                          '' -_\\\"\\\"__,.   '     '''                \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                     '        .'                                                        '.        ''                    \\n              '-'''  '''''-,\\\"^_.          ''                                ''          .,\\\"\\\",-'''''  '''.'              \\n           '-:^+^^\\\"-..::^:^^\\\"^,-.'.'.'''_,:,.'                            '.,_,_.''.'.'.--\\\"\\\"^^:^::..-\\\"^^+^:-'           \\n         .,^++===+^^:_:^^^:_:::,,___\\\"^^\\\"^^\\\":--..                        ..--:\\\"^^\\\"^^\\\"___,,:::_\\\"^^^:_:^\\\"+===++^,.         \\n         :\\\"^^+++=+^^\\\"\\\"\\\"\\\"^\\\":_-,,___::^^^^^\\\":_\\\"^:-''''''''  ''''  ''''''''-:^\\\"_:\\\"^^^^^::___,,-,:\\\"^\\\":\\\"\\\"^^+=+++^^\\\":'        \\n         _\\\"^++^++++^^^^^^^++::_:___:_:\\\"::\\\":_\\\"::--.''''.'' ''''  '.''''.--::\\\"_:\\\"::\\\"\\\"_:___:__:++^^^^^^^+^++^++^^_         \\n          -_^\\\"+++++^+^+^^^^^,-.'.-._::^::_.'''..''''   '        '    '''.-''''_::^::_.-.'.-,\\\"^^^^+^+^+++++\\\"^_,          \\n          ':^:^+++^\\\"^^^^::^^:_-.-,:^^:_''.-.'                               .-.''_:^^:,-.-_:^^\\\":\\\"^^^^^+++^:^:'          \\n           '_:::^:.-_,'-:_:::_--..'._:'   '''                              '''   ':_.'..--_:::,:-',_-._^:::_'           \\n               -.'             ''     '                                          '     ''             '.-               \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                              '                                                          '                              \\n               '-,.''..'''''-,'                                                          '--''''''.''.,-'               \\n         ''''-:^^^::\\\"\\\":_::\\\"__.''        '  '                                '  '        ''.__\\\"\\\":_::\\\"::^^^:-''.'         \\n       '-\\\"^^+=++++^_:\\\":+^^^:_-..'''''''-__-'                                '.__-'''''''..-_:^^^+\\\"\\\":_\\\"^+++=+^^:,'       \\n      ',:^^+==++++:\\\"^++++:_--,::::::^+++++:.'     '.-.'''      ' '.--''    '.:^++++^::::::,-._:+++^^\\\":^++++=+^^\\\"_'      \\n       _^^+++++++++^\\\"^^\\\"^\\\"\\\"\\\"::\\\"^:\\\"^++++^++^\\\":,. ''--,:-_''''''''_-:,--'' ',_\\\"^^+^++++^\\\":^\\\"::\\\"\\\"\\\"^\\\"\\\"^\\\"^+++++++++^^_'      \\n       ':+++++++++++^^^+^:^^^^^+^\\\"^+^\\\":\\\"\\\"+^:_\\\"_.'''..''\\\"-_,..-_-\\\".'..'''._\\\"_:^+\\\"\\\":\\\"^+^\\\"^++^^^^:^+^^^+++++++++++\\\"'       \\n        ,^^+++++==+^+:::::::::^^:---_-..-.'  '.''''''  ''''''''''  ''''''.'  '.-..-_---:^^:::_:::::^^+==+++++^^_        \\n        _\\\"\\\"++++^+^\\\"^__::_,_,_\\\":.-.-,..-.'        '''                '''      ' '.-..,,.-._\\\"_,_,_::__^\\\"^+^++++^\\\":        \\n        ':\\\"+^\\\"-_.''  ''''''-_'''    '                                              '    '''_,.' '''' ''._,:^+^:'        \\n         ''-,...'                                                                                      ''..,-.'         \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                 '-'          '                                                          '          '.'                 \\n              '-:^^_-.''''  .'                                                            '.' ''''.-_^^:,'              \\n        ',_,'_^++++\\\"_:^:\\\"\\\"__'                                                              '__\\\"\\\":^:,\\\"++++^:',_,'        \\n      ':\\\"\\\"^+++++++^\\\"\\\"^^:_::----..--_--'-__                                    -_-'.-_,--.----::_:^+^\\\"^+++++++^\\\"\\\":'      \\n      _\\\"\\\"^^++==++^^+++^_-_:_::_:\\\"\\\"++++=+^\\\"-.''  :^^,                -^\\\":  ''.-\\\"^^=++++\\\"\\\":_::,::-_^++++^++==++^^\\\"\\\"_'     \\n      _\\\"^^+++==+++++^^\\\"\\\"^^^\\\"\\\"\\\"\\\"\\\"^++==+\\\"\\\"^++\\\"^:-'^+:' '-' ''__'' '-' ':+^'.:^\\\"++^:\\\"^===+^\\\"\\\"^\\\":^^^^\\\"^^+++++==+++^^:_'     \\n      '\\\"^++++++++++++++^^^+^\\\"^\\\"::++^+:--:+^\\\"\\\"_.,\\\":-.'.----''''----.'.-_\\\",._\\\"\\\"^+:--:+^++\\\":\\\"^\\\"\\\"++^^++++++++++++++^\\\"'      \\n       -:^++++++^+^^+^^\\\"\\\"^^,_:,_\\\"++^:_-'''-.-,,:^\\\".''.''.'    '.''.''.:^:,,-.-.''-_:^++\\\"_,:_,\\\"^\\\"\\\"^^+^^+^^+++++^\\\"-       \\n       ::^+++\\\":\\\":\\\"\\\":^^\\\"^\\\":\\\"-'''--,,--'        '''''    '        '    '''''        '--,,,-.''.\\\":\\\"^\\\"^^:\\\"\\\":\\\":\\\"+++^::       \\n       ':\\\"^^:_-'       ''.-.'                                                              '.-.''       '-_:^^\\\"\\\"'       \\n        '_:^,.-'                                                                                        '-.,^:_'        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                  ''                                                                                ''                  \\n              ''..::-                                                                              -:\\\"..''              \\n         ''' '.,^:\\\"\\\":-''  '                                                                  '  ''-:\\\"\\\":^_.' '''         \\n      '-_::____:\\\"\\\"\\\"^\\\"_,---..'''  '  '''                                          '''  '  ''...---,_:^\\\"\\\"\\\"\\\"____::_-'      \\n     -::::\\\":\\\"\\\"\\\"^^\\\"^:_---:_..----.''.\\\"^^-                                        .^^\\\".''.----..,:---_:^\\\"^^\\\"\\\"\\\":\\\"::::,     \\n    -:\\\":\\\"\\\":\\\"^^+++^\\\",,_:_:^\\\"^^\\\"\\\"^\\\":^+\\\"^+^-'''-^.      '            '      '^,'''-\\\"+^\\\"+^:\\\"^\\\"\\\"^^\\\"\\\":_:_-,:^+++^^\\\":\\\"\\\":\\\":-    \\n    .._:^^^^^^+++^:,-\\\"^\\\"^+++^^^:^^^^+=+++-.\\\"_,..'   '''          '''   '..,,\\\"--+++=+^^^^:^^^+++^\\\"^\\\"-,:^+++^^+^^^:_.'    \\n     ':\\\"^\\\"^^^^^++^^_-:^^^+++++:\\\"\\\":\\\"\\\"+++++^:^^\\\"_'''''___'''    ''',__''''',\\\"^^:^+++++\\\"\\\":\\\"\\\":+++++^^^:,_^^++^^^^^\\\"^\\\"\\\"'     \\n      ,\\\"\\\"^^^^^^^++\\\"_,_-_:\\\"\\\"\\\"++++:_.._-:,,--,_,.'''''-:-''''  ''''-:-'''''.,_,--,,:,_.'_:++++^\\\"^:_-_,_\\\"++^^^^^^^\\\"\\\"_      \\n     '-_\\\"^^+\\\":::\\\"\\\"--,__-:-'''-,.    ''''''',.'  '''  ''''      ''''  '''  '.-'''''''    .,-'''-:-__,--\\\"\\\":::\\\"+^^\\\"_-'     \\n      ._:::_,'                          ''''      '                  '      ''''                          ',_:::_-      \\n       .,::,,''                                                                                          '',,_:,.       \\n        ''.''                                                                                              ''.''        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                  '-.                                                                              .-'                  \\n              '.-,.\\\"_.'                                                                           .,\\\".--.'              \\n        '-,'''._^^:^:.' ''                                                                    ''  .:^\\\"^^:.'''--'        \\n     ',\\\"::::\\\"_:^^^^\\\"\\\",,_-.'         '.'                                          '.'         '.-__,\\\"\\\"^^^^:_\\\"::::\\\"_'     \\n    ,\\\"\\\"\\\"::::^^^^^\\\"\\\":,_\\\":_:_-.-''..::+\\\"''                                        '':+::.-''-.._:_:\\\"_,:\\\"\\\"^^^^^::::\\\"\\\"\\\",    \\n   -:::\\\"\\\"\\\"\\\"^^++++^:\\\":\\\"^^\\\"^\\\":^^^^+^+++++' ''..-.                          '-.''' '+++++^+^^^^\\\"\\\"^\\\"^^^:\\\":^++++^^\\\"\\\"\\\"\\\":::,   \\n   ..-_\\\"^^^+++++^^^^^++^^+^^^^^++^+===+\\\"\\\"\\\"^\\\"_-'.''    '          '    ''.'-_\\\"^\\\"\\\"\\\"+===+^++^^^^^+^^+++^^^^+++++^^^\\\"_-..   \\n    ',\\\"^^^^^+++++^^^^^^^++==+^^^++=+++\\\":^^,--'   '-:,,.          .,,:-'   '.--^^:\\\"+++=++^^^+=++++^^^^^^+++++^+^^^\\\"_'    \\n     '\\\"^++^^^^^++^+\\\"\\\"\\\"\\\"^\\\":^^++\\\"_\\\":-,\\\"^^::::-''''''-_:-'          '-:_-.'''''-_\\\"::^^\\\",-::_\\\"++^^:\\\"^\\\"\\\"\\\"\\\"^^++^^^^^++^^'     \\n     -,\\\"++^^\\\"\\\"\\\",'-::\\\":\\\"_.'  ''   '.' ''-_,,.'   '''''''          '''''''   '.,,_-'' '.'    '  '._\\\":\\\"::-'-\\\"\\\"\\\"^^++\\\"_-     \\n     '-\\\"^:::-'                        -.''       '''                '''       ''.-'                       '-:::\\\"\\\",'     \\n      ',__::,'                                                                                            ',::__,'      \\n        '.--'                                                                                              '--.'        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n              ''-.''.'                                                                            '.''.-''              \\n          ''  '---,'.''                                                                          ''.'-,--'  ''          \\n     ''-__,,.',:^:-'.'                                                                            '.'-:^:,..,,__-.'     \\n   '-:\\\":::::_:\\\"\\\"\\\":_,+^:_                  '                                  '                  _:^+,,:\\\"\\\"\\\":_:::::\\\":-'   \\n  ',:\\\"::__\\\"^^^^^\\\"::++^,-''''''-_.''.'                                        '     '-''._-'''' '--^++::\\\"^^^^^\\\"__::\\\":,'  \\n ',_::\\\"\\\"\\\"\\\"\\\"^+^+++++++++++^\\\"\\\":^^^:::__'.'.' '                                '  .'''__:::^^^:\\\"\\\"^+++++++++++^+^\\\"\\\"\\\"\\\"\\\"\\\":_,' \\n  .-_:\\\"\\\"^^^+++++++^^^++++^^\\\"\\\"+++:--.'..--.''                                ''.--..'..-_+++\\\"\\\"\\\"^++++^^^+++++++^^^\\\"\\\":_-.  \\n  '-_:^^^+++++^\\\":\\\",-.:^_\\\"\\\"+++=+==^^^..:^_.''--_'',_'.'            '''__''_--''._\\\":..^^^==+=+++^\\\"_^:.--\\\"_\\\"^+++++^^^:_-'  \\n   ':^^+++++^\\\"\\\":-.     '  '-'..\\\"^++\\\"^--_\\\":'-\\\"\\\"\\\":,^,'''''        ''''',\\\",:^\\\"\\\"-':\\\"_--^\\\"^+^\\\"..'-'  '     '-:\\\"\\\"^+++++^^:'   \\n    .\\\"^^^^^:.   ''''''          '\\\"^_+:  ''.'-,-:\\\":.'' '          ' ''._\\\":-,-'.''  _^_^\\\"'          ''''''   .:^^^^^\\\".    \\n    -,\\\":\\\"__,-.'                  '-''.    ',:_'''''' '            ' ''''''_\\\",'    '''-'                  ''-,__\\\":\\\"_-    \\n    '-_\\\"\\\",__,.'                              ''                          ''                              '.,__-\\\":_-'    \\n        '...''                                                                                            ''...'        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                 '                                                                                                      \\n               '''.'''''                                                                        '''''.'''               \\n         '''' '.-..'''                                                                            '''..--' ''''         \\n    '.,,,,--.'_^\\\"::_:                                                                              ____\\\"^_'.--,_,,-'    \\n  '.:\\\"::\\\":_::\\\"\\\"\\\":^^,'''  '       '                                                    '       '  ''',^^:\\\"\\\"\\\"::_:\\\"::\\\":-'  \\n ',_:\\\"\\\"\\\"\\\"\\\"^++^++++=+^+:'-^''-_,'  '                                                  '  ',_-''\\\"-'_+^+==+++^++^\\\"\\\"\\\"\\\"\\\"::,' \\n'._::\\\"^^^^++++++++=+^++^\\\"^^^\\\":,..'''-:_\\\"'                                      '\\\"_:-'''..-:\\\"^^^\\\"^^+++=++++++++^^^^^::_-'\\n ',_::\\\"^^^^^++^^^^^+^^++^:++::\\\"\\\"_-.:^^^,   .-,'                          ',-.   -^^^:--_\\\"\\\"::++:^++^\\\"++^^^^++^+^^^\\\"::_,. \\n ',:\\\"^^+++^^\\\":_''''''.._+^\\\"^^++++=++^^::,-,:\\\":-  '                    '  -:^:,,,::^^++=++++^^\\\"^+_..''''''_:\\\"^^+++^^\\\":,' \\n  ':^++++^\\\"::,.          '''''',\\\"^:+^_:::_^^^^\\\".''                    ''.:^^^^_:::,^+\\\"^^,.'''''          .,:::^++++^:'  \\n   '\\\"^+++:-''                    .::''' '_:^,^^:,-'                  '-,:^^,^:_' '''::.                    ''.:+++^\\\"'   \\n    .::^^:,--.''                         '\\\"^..-_,.''                ''.,_-.'^^'                          '.--,:^^\\\":.'   \\n    '-_::::--.'                            '    '                      '    '                            '.--_:\\\":_-'    \\n      ' '.-.''                                                                                            ''.-.' ''     \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n       ''                                                                                                      ''       \\n    '--.'''   ''                                                                                        ''    ''.--'    \\n '.\\\"^^\\\"--' '_-''                                                                                        '.-_' '--:+^^.' \\n^\\\"++^\\\"^^:'' ''',\\\"^\\\"'       '                                                                '       '\\\"^\\\":'.' '':^^\\\"^++\\\"\\\"\\n++=+=+^^+:.''.':=+:''      '                                                                '      '':^=\\\"'-''.:+^^+=+=++\\n++++++\\\"\\\"^:'   ''  ' '      '''' '.-''                                              ''-.' ''''      ' '  ''   ':+\\\"\\\"^+++++\\n^+++++^::'                ''.:'     ''                                            ''     ':.''                '::^+++++^\\n\\\"^^++^^-''    ''       -    ''                                                            ''    -       ''    ''-^^++^^\\\"\\n_++^^^^\\\",'''  ''                                                                                         '  '''-\\\"^^^^++_\\n'^+^^:\\\"++^-..-.'                                                                                        '.-'.-^++\\\":^^+^'\\n  '-^+++^^\\\".---'                                                                                        '-,-.:^^+++^-'  \\n    '-_,,-''.''                                                                                          ''.''-,,:-'    \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n       '''                                                                                                    '''       \\n   ._'.'       '                                                                                        '       '.'_.   \\n..\\\"^^_:.''''''--.'                                                                                    '.--''''''-:_^^\\\"-.\\n+^+\\\"\\\"::-'''  '+^'''''                                                                              ''''':+'  '''-::\\\":+^+\\n==++^::^+-    ''''  '                                                                              '  ''''    -^^:_^+++=\\n=++++^\\\"^\\\"'           '      '                                                              '      '           ':^\\\"^++++=\\n+=++++^--                   ''                                                            ''                   .-\\\"++++=+\\n^+++++^-'                   ''                                                            ''                   '-^++^++^\\n_^^+^^^+-'  '''                                                                                          '''  '.+^^^+^+_\\n.^\\\":\\\"^\\\"++:-'..''                                                                                        ''..'.:++^^\\\":\\\"^.\\n '.-\\\"^+++^\\\".'.''                                                                                        ''.'.:^^++^\\\"-.' \\n    '.-,-.'  '                                                                                            '   '-,-.'    \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n   ''' ''                                                                                                      '' '''   \\n  ''-'                                                                                                            '-''  \\n:_-'.' '                                                                                                        ' '.'-_:\\n:''':+_''''     '                                                                                      '     '''',+:''':\\n\\\".'',^+_.''                                                                                                   '._+^,'''\\\"\\n^^,\\\"+^_''                                                                                                      ''_^+\\\",^^\\n+=+^+^'                                                                                                          '^+^+=+\\n\\\"++==^_.'''.''                                                                                             '.'''.,^==++\\\"\\n:^++=+++_,'  '                                                                                            '  ',,++^==++:\\n :^_^^++\\\":-' '                                                                                            ' '-_:++^^:^\\\" \\n '''':--\\\":-'                                                                                                '.:\\\"--:'''' \\n      ''''                                                                                                    '''''     \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n    .                                                                                                              .'   \\n '' '                                                                                                              ' '' \\n'.'''                                                                                                              '''.'\\n' -_-:.                                                                                                          ':-,-''\\n' '..'.-.'                                                                                                    '.-.'..' '\\n:::\\\"^_'                                                                                                          ',^\\\":_:\\n+++^:-    ''                                                                                                .'    .:^+++\\n^^++=^-''''                                                                                                  ''''.\\\"=++^^\\n:+++=+++^.'                                                                                                  '.^+++==++:\\n ,::+^:^^:.'                                                                                                '.:\\\"^:\\\"+\\\":: \\n  '''.''--'                                                                                                  '-,''.'''  \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n   '                                                                                                                '   \\n  -'                                                                                                                '-' \\n^\\\"''     ''                                                                                                  ''     '':^\\n\\\"\\\"--     '                                                                                                    '     --\\\"\\\"\\n++\\\":'                                                                                                              '_\\\"++\\n\\\"++=+^_.-'                                                                                                    '-._^+=++\\\"\\n-\\\"^+==+^\\\":_                                                                                                  ,:\\\"^+==+^^-\\n  \\\"^:-_.--'                                                                                                  '--._-:^\\\"' \\n  '.' ''                                                                                                       ''' '''  \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n:.'      '                                                                                                    '      '':\\n::_'                                                                                                                '_\\\":\\n+^:.'.                                                                                                            .'':^+\\n_++++^_--'                                                                                                    '--,^++++_\\n.::+=+^^\\\"-..                                                                                                ..-\\\"^^+=+\\\":-\\n  .+_'.''                                                                                                      ''.'_+.  \\n   ''                                                                                                              '.   \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n.'                                                                                                                    '.\\n=:                                                                                                                    _=\\n:-,.',.                                                                                                          '_'',-:\\n':,,:--''''''                                                                                              '''.'',-:__:'\\n '.^^^++_.'''                                                                                              '''._++^^^.. \\n    -''                                                                                                          ''-'   \\n    '                                                                                                              '    \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n.'                                                                                                                     .\\n=. '                                                                                                              ' ' '=\\n:::'','                                                                                                          ','':::\\n'.._:.:,'--','                                                                                            ','.-',:.::.-'\\n  '':_++:.'''                                                                                              '''.:+=__''  \\n    ''                                                                                                            ''    \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \",\n  \"                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                            \\n                                                                                                   \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \\n                                                                                                                        \"\n]\n"
  },
  {
    "path": "components/shared/effects/flame/flame-background.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { CoreFlame } from \"./core-flame\";\n\ninterface FlameBackgroundProps {\n  intensity?: number; // 0-100, like CPU usage\n  animate?: boolean;\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport function FlameBackground({\n  intensity = 0,\n  animate = false,\n  className,\n  children,\n}: FlameBackgroundProps) {\n  // Convert 0-100 to 0-0.3 opacity\n  const opacity = Math.min((intensity / 100) * 0.3, 0.3);\n\n  // Speed increases with intensity\n  const speed = Math.max(80 - (intensity / 100) * 40, 40);\n\n  // Color gets more orange with intensity\n  const color =\n    intensity > 80 ? \"heat-100\" : intensity > 50 ? \"heat-40\" : \"black-alpha-20\";\n\n  return (\n    <div className={cn(\"relative\", className)}>\n      <CoreFlame\n        className={cn(\n          \"transition-opacity duration-1000\",\n          animate && \"animate-pulse\",\n        )}\n      />\n      {children && <div className=\"relative z-10\">{children}</div>}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/hero-flame-data.json",
    "content": "[\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                .     .                                                                          \\n                                                               ..     ..+                                                                        \\n                                                                      .:.                                                                        \\n                                                               ..     ..         .::                                                             \\n                                                               +..   ..:          :.                                                             \\n                                                             .:..::.  ..          ..                                                             \\n                                                             .--:::.  ..     ...  .:.           ..                                               \\n                                            ..               .:+=-::.:.     . ...-.::.         ..                                                \\n                                            ::....           .:--+::..: ......:+....:.     :.. ..                                                \\n                                            .......            ::-=::::     ..:-:-...:     .--..::          .........                            \\n                            ..  .             . .              ..::-:-..      .-+-:::..    ...::::.        .: ...::.:..                          \\n                       .  -... ....:           .   .            .--=+-::.      :-=-:....  .  .:..::      .:---:::::-::....                       \\n                       ..::........::=.....    ...:-..        .:-=--+=-:.       ..--:..=::.... . .:..  ..:---::::---=:::..:...                   \\n              ..........::::.:::::::-::.-..  ...::--==:.      ..-::-+==-:...      .-::.......   ..--:. ..:=+==.---=-+-:::::::-..                 \\n          . .....::......:: ::::-::.---=+-:..::-+==++X=-:.   ..:-::-=-== ---..   .:.--::..       .:-==::=--X==-----====--::+:::+...              \\n          ..-....-:..::-::=-=-:-::--===++=-==-----== X+=-:.::-==----+==+XX+=-::.:+--==--::.      .:-+X=----+X=-=------===--::-:...:. ....        \\n          ....::::...:-:-==+++=++==+++XX++==++--+-+==++++=-===+=---:-==+X:XXX+=-:-=-==++=-:.     .:-=+=- -=X+X+===+---==--==--:..::...+....+     \\n         ..:::---.::.---=+==XXXXXXXX+XX++==++===--+===:+X+====+=--::--=+XXXXXXX+==++==+XX+=: ::::--=+++X++X+XXXX+=----==++.+=--::+::::+. ::.=... \\n         .:::-==-------=X+++XXXXXXXXXXX++==++.==-==-:-==+X++==+=-=--=++++X++:X:X+++X+-+X X+=---=-==+=+++XXXXX+XX=+=--=X++XXX==---::-+-::::.:..-..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      ..                                                                         \\n                                                               .      .+.                                                                        \\n                                                                                                                                                 \\n                                                                                  .:                                                             \\n                                                                 :    ..          :.                                                             \\n                                                             .. ...   ..          ..                                                             \\n                                                             :...+.    .     ..    :.            .                                               \\n                                                             .=-::...  .     .    ...          ..                                                \\n                                           ..                .--=-::...     .....=+.:.     .    .                                                \\n                                            -:....            .:-=:...:      .::......     .:.  ..           . ...                               \\n                                            .. .. .            .:: :.::      .:-::.. .     .-..:.:         ...........                           \\n                           ..=   .            ..                .::-==..      .-=-::...     ..:.. .        ..:::.::.:...                         \\n                       .+.:.:. ..-.::   . .     ..:.           .:=-==-::.      .:--..  ..   ..   ...    .:---:::::--::.....                      \\n                 ..    ..+::.......-::..:      . ::--..       ..:::-==-:.       ..::..  .:...   ..-.. =..:=== ::::-+-=:...+.=..                  \\n               .....= ....:::..:::::- ::=:.  ..:=--==+:.      .:-::-=-=--:...     .:-.....       .:-=:...-+==--:+:-+-=-:-:.:+...                 \\n             .....:...::.:: ::::-::----=+-::--:---+=XX=-:.  ..-=-=::--==X==-:....-.:--::..       .::++-::--+=---:-:---=-=::...-..                \\n          ....:..:....:=:- ==--=-:--===++====---- -==+==-::--==-:-::--=XX ++=-:::---+===-:.      .:-X+ ----=X==----: :=--.--::...........        \\n          .+.:::::-..:-:-===++=++=++++X++=====-.--=X==++==----=--::+:-=+XXXXX++---=-==+++=:.    ..:-+++---=+XX+++=-::-===-+=--:...:..........    \\n         ...::--- ::::--=+=+XXXXXXXX+++=====+===--=---==++==-=+=--::-==++XX+XXX++=+X==+XX+=-::-::--==++X++XXXXXXX=-::-+=++X+=-:::::::::-:=+..... \\n        ..: :-===----=-=+++++XX+XX-XX++X+==++==+=--:--==.XX+==++.===+++XX.++++XX++=X+=++XX+==--=--===+ +XXXXXXXXX+=--=X++.XX==--=-:---:::::::..:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                       .                                                                         \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                 .                 :                                                             \\n                                                                 .                ..                                                             \\n                                                                  .    ..          .                                                             \\n                                                                                   .                                                             \\n                                                            :..        .                        .                                                \\n                                                            .::...                              .                                                \\n                                                             ==-:: :   .                                                                         \\n                                            .    .           .-.=::. .::     ..+            .  .=.                                               \\n                                 .          :..                ..+:..:-.     .:..          .:  .+.            . ..                               \\n                                           .     .              .:.:-:.      .-=-...       ..-.           ...:.. ..   ..                         \\n                          .  .      .. ..        :.            ..::--:..      .::-.     .       .:      .:::-:....-...:.                         \\n                          ..  ......:: ::.    .::+::::         .:=::==:..      ......   ...      . .  .::----:...::::::....                      \\n                   .      .:.....:::::=:-.    ..::--=-..       :-::--==.::..     . .:  ..        .::-:..:==--::..:::::.:.....: .                 \\n                  +..  ...:-+...:.: :=---::..:::::-=+=:..    .::.:::--.++--:..    ..-:..+.        .:=-::::==-:::::::-=-:.::... .                 \\n            -... ..  .. .:---:+:-:-::-=+==--=-::.::-X=--::..::::.:.:--=XX+==--::::.:-+=-:.       ..-=-::-::=++-::-::.:---::.. .                  \\n          .........  .:::-=+== -==+= =====--=-:::::-+=+=--:.:::..::.:-===XXX+=--::--+==+=-.      ..-==-:.:-=XX=----:.:-=-=--:..   .+.....        \\n          ...:::+:...:=:-+++XX++++.=-=-==-- ===-:.:=---=+=-:::--::..:-==++X+X+==--=+==+X+-:.......:-==++==++X:X++=-:::-==+=--:.......::::..+.    \\n         ...:---::+:::--==++-XX++XX+=:=++=--====-:::+--==+=---== ---==++XXX++XX+.+XX===+X+=-:::-:--=====XX+-++XXX+-:--++=+X+--::::.:::::::.....  \\n        ..::.-==---+- ++++.+++XXX-XX++:X+=-=X+==:-::.=+X+XXX+=+X++++XXXXXXXX=XX=- +++-==++X+==-==-=:=++XXXXXXXXXX++==+ ++X X+=---.--.-:.:::.:... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                    .                                                            \\n                                                                                   :                                                             \\n                                                                                   .                                                             \\n                                                                        .                                                                        \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                            :.     .                                                                             \\n                                                            :-....:.   .-                                                                        \\n                                                            .......   ..                                                                         \\n                                            .                    ..  ..      :.                                                                  \\n                                               ..               ..:.:.       .-..           .             ...:...                                \\n                                     . ..       .....           .:--:..      .::...     .  .   ..      ........ .:.     .                        \\n                          ..   ..... ...:    ..=..::-.          .:.:=-:.       . ...    ..       .:.:..:-...-:.........                          \\n                    .     .::  ..::.:.:..    . .:.::-..        ..=.:--==:..         .             .::..+==::::+........ .                        \\n                          .:.......:.:::.....:::..::==:..    :.....::-+X-:::.    .-.:...          ..-:..::=::-:-...:.:::...                      \\n                       .. :::.:.-.:::-=---::=::...:--==-:.  ..= ....:-++=--=-::.+...==-::.        .--:....:=-:-:::.... ::..                      \\n           +....      .::-==+-----------------:::..-==--::. ...  ..::-=+:+++=-:::.-- =+=-:.      ..=--:::::=++-=::-::.:=-::...        ..         \\n           ..:-.... :..:-+++=+=-===-------::--.::..:------:... :....::-=++XX+=--::----+X-:.      ..-==-----+X+==-=-:::-=+=-::..  .....:...-      \\n          ...:::::....:-- ==+X+====-----=+::-==-:::::----=-:.::-::::--=+XXXXXX+=-=+=-==++--:-:::.::=--=-==X++++X+=-:=:===++--::......:......     \\n         ...:----:::--.====+=++X+++======---=+=--:-::=+++X++=-====== ++XXXX.XXX +++-=--=+X+--::--:---==+XX+++XXXX+=--=+=++X+=-:::-::-:::.......  \\n    .. ...:::--==:---++=+=====++ XXXXX++===+X+===+==-+X++++++++X+X++.XXXXXXXXXXXX ++======X+==-=--===+XXXXXXXXXXXX+=+++++X+XX=.--==--::-....:....\\n\",\n  \"                                                                                    .                                                            \\n                                                                                   .                                                             \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                            .           ..:                                                                      \\n                                                            :.    .    ..                                                                        \\n                                                            ::..                                                                                 \\n                                                            .      ..                                                                            \\n                                              .:                  :::.       :.                              ..                                  \\n                                               .:..:.            .:-.        ::.        .     .:  ..       .....                                 \\n                           ... . ... .         .  ...            ..::-:.     . .                  ... .:........:.                               \\n                           ..   =....        . ... ..            .:.:-+-..                         ....-=:....:.=...   ..                        \\n                           ...   -..=::... . ......:::-:          .::=+-:::+.      ::-..           .:..::=:...:..........                        \\n                       ....:. ...:....:::=:.:-..  .::=--:         ..:==:-::::.  . .:---:.          .:=:::. :::-.-...:...=.                       \\n                      ..:.--::::::::::::::--:-:....--:::...       ..:-==++---:.=.-::-=+-:.        .:::.....--=-:.-.::.--:...                     \\n           .......   ..-=---==-=-==-::.-::+:--::..-:---:::....... ..---=+XXX+=-+:::--+X-:..       :--:.::::-++-::::::::==-:..:     +....         \\n           ..:...:....:-=-=+:+=--==::--::-=::--:...:--.:-::....::::---+=+XXX.+=-:-----+=-::..... .::--:---=+++==--:..:-==+-:::.. ......+-.       \\n          ..:-::::..::---=====+=== -:--:--::-==-::-::-==-==----=--::-==+:XXXXXX+==+=--==+=::..:::.::---++.+=+++X+=-:=:===+=--::...:..::...:.     \\n         ....:-------==-=+=====XX+X+==------+=---=:==+=.==+=+++++X+==+XXXXXXXXXXX+++==--==+=-:-:-:---=X XX++XXXXX++===+==+++=------::: :.......  \\n    .....-.:+:--==+======= ++=++X:XXXX+=:==XX==:++=-=++==+X+=+++:+XXXXX:-X.XXXXX+X++==-++++X+======++XXXXX-XXXX--XXX+==+++++X++==.---::::..=:. ..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                        .                                                                        \\n                                                            .     .                                                                              \\n                                                            :.                                                                                   \\n                                                            .. .   ..                                                                            \\n                                              .   ..             ::.         .                                .                                  \\n                                              .  .                .:+..      :               ..               .                                  \\n                            .                .    .                ..--      ..                      ..       ..:                                \\n                            .     ..           ..  .              ...-:...        .                ...:-..    ...                                \\n                            .    ....-.-.   ..:..  .. ::          ...-::......    ..  ..           .:.:::=....:.    ..                           \\n                         -...    .....:...:.:-.   ...=.::          .:=-::::::.    .::--.           ....:.:. ..:..  ..: ..                        \\n                      .::::::.:..+:....:..-=:-:.  ..:..::.         ..=------::...:..:=-..          ........::-:..  ..::.:.                       \\n            .    .    :::----:::::=::....+:=-:-..-::-::-...     .  .:-==++++++-:.-::-+-...        .::.... .:==::.....:--+:.. .     .             \\n           ....  ..  .:-=-=+==---:-:=:::..::::-:..:-:::::::....=.:..::--=+XXX-=-:-:-:=--::..      :.::..:::-++--::...::==-:.:..   ....+.         \\n           ...-.:.. ...:-==--=+--:-::::..::.:--:..:=:-+-:---::--:::+:-==++X:XX+-==--:--==-::....  ..::::-++==++:-::..:-==-:::..  .....+=. .      \\n          -..:::::::--::--==--++=+==--::::::-=-:: =-=-- --=+=+++=++-==++XXXXX- X+==+-----==::..:-.::--=+.++=++XX++=-:-======:--::.:.-...:...     \\n      ......:=:--=----=- -=-===XX+XX+=----.-+=-:-==-+==-.-=+=====-+ X+XXXXXXX:XXX+========++=------+++XXX+.+X=XXX.XX+======+++---:::-.:.=..:.... \\n    .......::::-=:===++ ==++=++XXXXXX:++++++=====++=+X++:=++=====++XXXXXXXXXXXXX+X++-===++XXX++=+==+X++XX++X-XXXX-XXX+==+++=+X:===-+-:::=..::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                             . ..                                                                                \\n                                                                ......                                                                           \\n                                                                  ..::.                                                                          \\n                                                                     :       .                       .         .                                 \\n                                              ...                    :      ....+:                  . .        ..                                \\n                                     .       .:.   .... .           .:. ....  .   ...:.             ..-:..    ..                                 \\n                          . .        ..- ...=.:       ..:.         .:-::::..=..    .:-.             ......   .:.    :..                          \\n                      ....::. .. -.......=: :::.    ...-..         .- --+::::---.. ..:..            .  .. +..::.    ...:.                        \\n                  .  .:::::-:....::-........---:-...::..:.      ....:--=--===+=:....:-....         ..   .. .:-:..    ..::.    .                  \\n                  .  .:::--:--::=:::::.   ..::-: ..::-....: ..:......:--===+=X=-::.---::-..       ..:....::.==-::..  :---...  .   .-.            \\n           ..      ...::-:-:--::-::-::.  ....::-...----:::::.:=:::-:::-====+XX+=--:::=--::.        .::::-=== =+=::....:=-:..-.    ....           \\n           .+...... :::::-----=.--:-::...=..:=:...:---::.:--==+--=+:--+:+XXXXXXX=-==:+:---:::...:...-:--++===+XX=-::::=----:::...:......  .      \\n         .....:=:- :::-:::-+--++===+=-::-.::-=:::-=+=--:.::-==+-:=++ +XXXXXXXXX++==+=-=+--=--::::::---+++==++XX-X+=+ ==---===--::.+....=....     \\n     .=....:.::.==--:-==--====XX XXX++=++=== ==--==+X+==---------==+XXXXXXXXXXXX++==== =+==++-=.=-=+++:=++=++XXXXXXXXX+=====++---:-::..:...:.... \\n     ......:::--=++= ====-===++XX-X XXXXX:X+====-==+XX:+++========+XXXXXXXXXXXXXXX++=++XX +++++=+++X:X+XX.++XXXXX .XX+++=:+++X+=.---::::...:=:...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .:    .                                                                            \\n                                                               .  ....                                                                           \\n                                                                                                                                                 \\n                                              :.                              ...                                                                \\n                                              .                        .      ..:.  .                                                            \\n                                              .                      ..:..    ..   .::               ..        .                                 \\n                            .        ..      .:.       ..:          .:...... .:..   ..               :..      ..                                 \\n                       ..-:::      .:...    .:=:.    .. :.        ..::=.:: :::=:.    .                .=.     ..       .                         \\n                     ......:..  ..:-..  ..  .:-:..  :....     .  . .::=-------+-:......:.               .. .+.:.       ..                        \\n                     ...::......-:.::.     ..:-:....:::..    .:  ....:--=--=-=+-:.::::....          ..  .::-=-::.    :....                       \\n                    ..:::.:.::..:..::..  ....--=....=::=:.:...-..:-:.::==--=+++--::---:....         ...::-:--=+:..   .:.:..       .              \\n               .....:: ..:-::--:+:.:-.. .:=..:-..=.--:....::-+-::=-:-.-=++==+XX+=-=-::-::...   ...  :.::-=-=++X=-:..:::-::.:.......              \\n           ....::.........---====--=-::.:=:.:--=::-=.::....::--::==== XX +-++XX++==.-=-:. :::-..:...:-- =-.==+X++------------:.....   .. ..      \\n       .....+.-:::::::-:::+--=X++ ++=====+==---:--=X+=-::.::::--:--=+XXXXXX++X++-====--==:--==--=:-=-=+==+-==+X.XX++++:=----=-::..:.. ....=..    \\n     . .. ...::+-==------:--==XXXXXXXXXXXX+=------+++X+===--=-----==+XX-XXXXXX:-++==+=++=--==++=++XX++==++==++XXXX:X++++=-===+=--:+::.....=-.... \\n     ......::--==.+++=+===.=++XXXXXXXXXXXX=++=.=--=+++X+++==+=====+X-X-XXXXXXX X+++++++++++===:==:++XX+XXX++XXXXXXXX.+++++XX+XX+=-=-:::+:::.:.:..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .    ..                                                                            \\n                                                              .                                                                                  \\n                                             ..                                                                                                  \\n                                                                               .                                                                 \\n                                                                     ..       .:. ...                                                            \\n                                              ...                    ......    ..                    .                                           \\n                             .      ..         :.                    .  ..:.  .::                    :.                                          \\n                         +...       .        ..:.     . .            .. .:.:..:=:.    .              .         .                                 \\n                          ..      ..:        .::    ...       .   ..::-::::.:.:=-. ... ..               ...::...                                 \\n                        .:....  ..+.:      .  ::.  .::..      .  ..::.::::==::--:..:..   .           .  .::-:-:.         .                       \\n                    . ...........  .-..   ..  .:.  .-:...... ..  ....::-=-::--=-::.:::. ..           ....:+:-==..    .. ..                       \\n                 :...... .:.-:.+....-....:. ..::  .::-.. ..::-:..=::::--+=--==+==-=-:.:...=.         ...::---+=::... :::.........                \\n           .. ...-  ......::==----:-::.::=::+:-:.::-:.... ...-:::---=+==+:====+++++=:: . ...:: .-.  .=.::--=-+=--::::::=-.:::.                   \\n         .......:......:..:--X+==:=+=:--=-=-:::--==+=--:....::-:.::-=XXXX++++X+===-:-::-:::.-:::-:=::-=------==++==-=+==-::+::..  ..     ..      \\n        +:......:-- ::-::::--+XXXXX++===--=-=-::-+++++==--::::::::-=+XXXXXXXX++==-==-----::--=++++++===--=---==+X++++====----=-:..... .........  \\n      .....:::::-=+==-+=+--==+X-XXXXX+=X+==--=---==+XX+==+--------=++X+XXXXX+XX++=-==++==------=++++X+=+++==++XXXX=X++==+===:+== :--:............\\n    .......:--.-====++.X+=++XXXXXXXXXXXXX+==---.===X+.+X+X++=.++++=XXX.XXXX+XX=X++++ +XX+X+==--====+XX+XXX XXXX XXX X+=+X++++++===-=-: :::=::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                   .                                                                             \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                .                                                                \\n                                                                               ..                                                                \\n                                               ..                    .....    ....                                                               \\n                                    .          ..                       ..:   .::.                   .                                           \\n                                    .          .:     .                 ....  .:-.                   ..                                          \\n                                    .         ::.                  .=.:..::.. .-=.   ..                  ..  -..                                 \\n                                  ..:         .:    :..=          .: :-::+:::.:-::-... ..               ..:-:-:.                                 \\n                            .   . ..::    ..  .:   .-:..      .  ..+..::--:::--:::=:..   .           .. ..=::=-.         .                       \\n                    .......::...  ..:.=. ..   .:   .:..........  .-...::-+-:--=--:-:::.  ..           .=..: :=-..    ..:..                       \\n                .       .:.:=::=:..::....::..::: ...:..   ..+::.::.:-:--==:--== ++==:.:...... :...    ...:=:-=-::.:.:::-:.-...                   \\n              ....   .. ...:=+--=--=--:::---:::::::--.... ..:::::::-+X+===--==+===:-:: :...:-:::... ..::::-:-===---:::-- ::::.           .       \\n          .......:....::..::-XX+:+++=---------::=++===--:..-::.:.::-=XXXX+.++++=----.::::::+--===---:---:::::==+=======--::+:::.. ..     ..      \\n        =.....+::--:::=::+:-=+XXXXXX+=-=::-:-=:--==+X+==--::.:=:::-=+X=XXXX+X+==--=--=- -.::--==XX+==+===---+==+++:-=====--.-=-::.:.. ...-....=  \\n     ....=.::+::---===X==-===XXXXXXXX+=X+---------=++++==++---==+=++XXXXXXXXXXX++====++==-------===+X+==+++++XXXXXX+=+=++====+=-=-=-::..-.::.... \\n     .... .:.---=:====+X++.+XXXXXXX+.+++++=-- -==++XX++X+XX+++XXXXXXXXXXXX+=+XX.++++=XXXXX+==--=-==++X.XXXXX XX= XXXX++.X+++ += =--=-::::::::.-..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 .                                                               \\n                                                                                 .                                                               \\n                                                                                                                                                 \\n                                                .                                .                                                               \\n                                    .           .                         .    ..:                                                               \\n                                                .                        .:.    ::                                                               \\n                                               .:                        .+.    ::                                                               \\n                                    ..        ...  ..             .  .. ...= .:.::                      ..   .:.                                 \\n                                    .:         ..  .:..           ....:..::..-.:..:..                    ..:::+                                  \\n                                   ..:         ..   .:.           ... .. :-..::..::.     .            .   ...:.          .                       \\n                         .::.       :.       . :    . ..      .    ...+::--:.:----+....  .            .   ...::        ..                        \\n                         ..-:..... .-.....-..::... .::.    .:..::..::----.:.:--+-=+:.::.  ..  .:         ...-::...  ....:+..                     \\n                .     .. ..:=-:--: :-:....:----....:::..   :.:.....:-=++=-:::----:=:.. :...::..-..   . ...::- -+::::::=:.....+                   \\n                ...........:=X=++++==-:..::::=:-+=--:-::.....+..=.:-X.++X+=-===-:--:....:.:: :-=-:-:.-::..::---------.::.:.....  ..      .       \\n           ......-:::=-:.::-=+XXXXX++--::..::-:==-==+=--:::...:..:-++XXXX++++=--::-:::::.:..::-++=---+---::::--==.==-----::::+:..::.    .....    \\n        ......-::::--==-:-=-=+XX=XX+=--=-:::::::-=:=++=--:=:.:-====+XX:X-XXXX+==----+=.--: ::::====++==-----+=+++++++==------.:----:. . ......   \\n     ...:..:::::-----==+===++XX XXXX+=+==--:::---=++X+X++==--=++XX X++XXXXXXXXX+++=+XXX++=--:::--==-= ++++ XXXXXXXX:+++X+ ===----=--.:::..::..:  \\n     .....:::--===--==+XX++XXXXXXXXX+++===------==+X+++XXXX:++XXXXXX+++++++=+XXXXX+++XXX-+X+= ----=.=+XXXXXXXXXXXXXX++XXXXX+++=.---==-:--:::-... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 .                                                               \\n                                                                                 .                                                               \\n                                                                                                                                                 \\n                                                .                                .                                                               \\n                                                                                 .                                                               \\n                                                                                 :                                                               \\n                                                .                         .      .                                                               \\n                                     ..         .                         .:     :                                                               \\n                                     ..         .  .                 .    ..    ...  .                  .                                        \\n                                     ..         .                  . ....+    .. ...                       . .                                   \\n                         ..          .          .   ...            .   ..::. :...:-.     .                   .                                   \\n                         ...        ..     .. .:.    :..     .     .::.. ::.:::.::-.                         .                                   \\n                         ......... ..:    ::..:-.   .:.       ... .. :-::.....::-.-:....      .:             ....     ..                         \\n                          .:--::::..::.   .::-:.=....:.     ........:.:-=-:...::::::   .:.-....:.     . ..... ....+.=...:                        \\n                   .:..  ..:++=-=X=--:.......::=:---:::+..   ..=.:-==:-==++=:::::::.   ....::::-::::.... ..:::=.::-::....       ..               \\n                ...::-: ..:-+X+XX +==--..  ..:-==-----:-:.:  .:---++++++++++=-::..:.. .......:====--:::::...::-:--:-::.::+..::.....     +..      \\n           ..+....::--:::.:-=+XXXX++=--:.....::-=---=+--:.:....:-==+++X++=++=-::::::--:::+....-==---=--=:.:::--===+==-:-:::::::::::..   .....    \\n      :.. ......::+::-=--- ==+XX:XX+=----:-:.:::-==+=++=-:::+:-==+X:X+++X++X++==-==+X++==-:...:-=---=========++X-XXX+=+==----:+:::::......==..   \\n     ...+.::::---.::-=+XX=+X=:XXXXX+===--=--:=:-- ====X+===-=++=+XX+X++++XXXXX+X.+++++X++==-::=:-+-==++=+++XXXXXXXXX. :XX++++=-:- -==:::::::...  \\n     .....::--=====--=+XXXXXXXXXXXX-+++++X+=---=++++-+XX++++XX++XXXX+++++++=+XX=XXX+XXXXXX++=------==+XXXXXXXXXXXXXXX+XXXXXXX+=---==----::=::... \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .                                                              \\n                                                                                  .                                                              \\n                                                                                  .                                                              \\n                                                                           .     .                                                               \\n                                                                   .             ..                                                              \\n                                      .              .             ..  ..        ..                                                              \\n                                                :    ..             .......  .  ..:.                                                             \\n                                     .         .-.   ..               .:. ....:.::.                                                              \\n                          .          .    ..  ..     ..      ..      +..:..  ..-::...- .                     ..=                                 \\n                          .::....:+..:      .:. .......     ...........:::::...:.:..   ..-     .             . ..:...                            \\n                   . .    .-=-:-===--:.     .:+::--=....      .:-==---:------::.....    .....-.+.:::. .    .......... .                          \\n                 ...... .=.-++==+X++=-..    .:.--:::::.:..    ..-X==-===+==-- ::....      ...-------...... :..:.::::-.+... .....                 \\n                .+..::....:-=++++X++---..  ...--.:-:--:-: ..  ..-== +X++====--:..::::........:--:::::::-:.. :::--==++-.::..........      .       \\n       .............::-::: ==+=+XX++--::::....::--==:=--:.=...:-==++:++++====-::-=X+=-=-.-:..+--+:.:-::----=--==++XXX ==-::::::...::.. ......    \\n      ....::::::-=::=-===-=+:XXXXX+=-=-:::: :..::-=+=+==-.::========++.+XXX:+X++==+==X+==--....:-:---=-=--=+:++X=XXXXXX.+====+::::-::..:+:....   \\n      .+..::::-==----:+X++++XXXXXX+== ==++=-::--=++X++X+==++X++-++==+++++XXXXXXXX++++X.X++=--::.:::-=++++++=X=XXXXX+XXX+X++XX+--::=--::::::...   \\n     ....:: --=====---=+++XX.X=XXX++=+++X+=====+XX XX+XXXXXXXXXXX++= ++++X+=+XXXXXXXXX+X-XX..=-- =-==XXXXXXXXXXXXXXX+.XXXX-XXX=--------:::::.-.  \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                     .                  .                                                                        \\n                                      .          .   ..                ..                                                                        \\n                                                .:                     . .     ..                                                                \\n                                      .         .                       .:.. .. ..                                                               \\n                                                     ..        .          .. .+...     .                                                         \\n                          ..    .::..:       ..     ...        ..............:.+.   .  ..                        .                               \\n                          .:..::::---=.      ..:---:. .        .=--=-:.-::..=:-:.  .     ..     .....         .  . .-.                           \\n                  .      .:==-----+=-:.     :--:.=.-..... .   .-===::---:-:::::.           ..::-:--:.  .     .:.=.::--..      .                  \\n                 .....  ..:-=== ===.-::     .::::..:: .:.... ..:==-=+=+=-=-=::.+.:....     .:-:::.. ...+... .:.:::-=++::..   .=..                \\n        .  ..  ..-...:..::+====.++=-:+::.... .::::---=::.. ..:::-=+==-+X+===-:.:-+=--::=:: ..::.:. .:..:+::=:::--=+XX+---:...::....    ..        \\n       ..:.+....:--.::-:---=+X++++==-:::::......::==++--:..:==--=-=--==+X==++=---+-=+==--::. .:::: :-::::--+=--=+XXXXX++=---:=-:.:....=....      \\n       .. ..::::-=-::=++==+XX.XX+X+----==.--::.:-=+X+X+===-=X+===----== XXXX++++==++++++==-:....:::.==-=--==XXX=XXXX-X:++==-++=:::--:::::....=   \\n      ...:.-::-====-.-=++:+XXXXXX+==-==++=----- =XXXXXXXXXXXXX++=---:==+X.XX.+XXXXXX+X+XX++++-:.::--=X++:X =XXXXX++.XX++X++X+++--::--:-::::.:.   \\n      .-..::.-=====-=-=+++XXXXXXXX+:+++XX+=+===+XXXXXXXXXXXXXXX+======++XXX++XX XX.XXXXXX=++X=--====+XXXXXX+XX+X X++++XXXXXX++=--- ---- :::.: .. \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                        .                                                                        \\n                                                                                                                                                 \\n                                                                          ..                                                                     \\n                                                                           .                                                                     \\n                                .     .                                     ..                                                                   \\n                                  ... :              ..          .........   .:.:.                                                               \\n                          .:..+....-:.        .:::-:.         .:-:--=:.+....  ..                    .             .:...                          \\n                         .:==-::::-=::      .:::..... .      .:==--:--::.-::....            .-.-:::.          ... .::-:.                         \\n                  .     ..--=-------:..   ..::....:::.-. ......==--:--=-:=-+.+.......      .:-:....-       . .....:-==-:.                        \\n                 .:......::-==--==--:..........::::=---.. ..:==--==---=-----...:=-+--:......:....  ..  ........::--=++=-:.....:..                \\n          .....-.:::::::::-==+==--:-:.:.:... ...::-++=--:...:=---.-=---+=-==-::+==----.:-::....::..-:....::==::--=+X++=-::::+:-:....   -..       \\n        .......::-=-:=+=--++X++==-=-::-==::::.:.:-+XX+==---+==--=::::--+X=====--====-=+:--... ....:-=-:-::-=++++++XX++==.----==-::-:...=...      \\n        ..:.::::------====+XX+X.++=---.==-:-::.:-=XXXXXXXX+++=- --:::--+XXXX+++.==++++++==-=-:....--++:===+XXX++XX+++X++==-===--:::::::::....    \\n       ....::---------==+=+X+++XX+=====+++==-:--=+XXXX+XXXX-++==--::--=+XXXXXXXXXXXXXXXXX+= =-:=:-- +XXXXXXXXXXXXX++=++++++++=--::--  :::....+   \\n       ....::-=====--=-++++X++++XXXXXXXXXX+++==+XXX:X+XXXXXXXXX=--.-==+XX-+XXXXXXXX+XX+XXX+++++=+++=+XXXXXXXXXXXX+++==+.++XX++=-=--=--- ::..:. . \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                            .                                                                    \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                      ..                                     ..                                                                  \\n                                   .. .                           ...:.                                                                          \\n                          .        .:.         ......         .:=:-=-:.  .                                            .                          \\n                         .:--::..-.::.       ........ ..     :-=-::::::.-.....                ....:.             .....:.                         \\n                        .::--:=:::::..      ..-  ...:.:.    .::---:::::::--+....  ....       ..                .... ::-..                        \\n                  .... ...:--:-::-::.::..  .......--::..   ..:=.---:::--:::....:--:-=. .   .....  ..     ...:..:.:+:--- ..    ..                 \\n               +...::.=..::-==--:::::::::....  .::=+=-::.....:::--.---=----:..:--::::.:.::...-+...=-.:. ..:==:. ::- ===-::....-:..               \\n           .  .-.:-:--=--:=+X+=--=:::::---:....::-=+X+=--::.--:+:..:+:=+==---:--=--::-::-:...   ..-=:::::::-===--=+++==-:::::::::::.......       \\n         .......:: ------==++X+== ---::==-+::.:.:=+XX=X+++==--::....-:-XX+=++++========---:-:.   .:-+=---=++++ +=+X+=====-------:::........      \\n         ... .:::-:---==:===++XX+==---+++X==-:.:-=+XX=X+XXX+==-::.:+:-=XXXXXXXXXXXXXX-++==--:....:--X+XXX-XXXX-XXX+==+====-=---::::::..-=....    \\n         ..::=.-------=+-===+++XX++==+X.XX+:+---=+XX:XXXXX:++:=-:::-:==+XXXXXXXXXXXX++ X+=====--===:+XXXXXXXXXXXX+==--=++X++.=--::--=:::......   \\n      .... ::-==--=-=+X+XX+== ++XXXXXXXXXX+++++++X++:XXXXXXX+X+==---=++=XXXXXX:XXX++ ==XXXXXXXXXXX++XXXXXXXXXXXXX++====++XX:+==-= ===--:.....:.:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                    .                                 .                                                                          \\n                                    .                            .....:                                                                          \\n                                    .                         .:-:--::.                                                .                         \\n                         .::=-...  ..         ..........    .:-::....=.  . .                    .                      .                         \\n                        ..:::::.......      .    ...  .     :.:-: :.::.  .... .   . ...     . .                ... ......                        \\n                   ..   ..::=:::..........      .-=..:.     .:::-:::.::.....  .::---:.           :.        .:.+.:....:::.                        \\n                   .-....::-=--::.:....:.:.   .-.---==-.. ...:..:::::=-:.::..:--::..... =..   ...=-.     ..::.....::--+-:...   ..                \\n                 ..:---::--=X=--:.:.:.:-:-:.....:--=+X=::..=:::.=...:-+=---------::-::..::.......:-:....=.:----::-==-=--:......:::..    .        \\n              .-..:--:::-=--++=-:+::::---=::...:--=+XX+=++=--::.....::+X+++=+X+=====-.-:::::.    .:--:::-==-+-=:==+.+---:.::.::::.....- ..       \\n          .......::-::------=+++==-.--=-+X+==:..:-=+XXXX++X==-::..:::-+XXX-XX+XXXX+===+-=-:.. ..:::=X++.XX++++++++++--=--::::::-:-:. ...:...     \\n          ..:::::--::-+==-==-=+++=====++XX=++::.:-++XXX.++++==-:...:--=+XXXXXX X+XX===X+==-+--:--:-=+XXXXXXXXXX+++= ----+==--=-:::--:........    \\n          ..:---=---==X+++=-===+XX++==+XXX===.===+++ +XX++====+--::--=+XXXXXXXXXX++.==+X-XXX+++===-=XXXXXXXXXXXXX+=----=+X++=-----==-::........  \\n      ....=:--======+XX+X+=----=+.XX+.XXXXX+=+=++X+=+XX XX+==--=---=+XXXX-X=XXXX++===.=+XXXXX.X.++++XXXXXXXXXXXXX-+++=++X XX++==++===-:..........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      ..                                                                         \\n                                                                :::::..                                                                          \\n                            ....    .           -=......     .::..:...+                                                                          \\n                        ..::....   ..           .:    ..    .--:::.+...    ..                 .. .             ..      .                         \\n                    .   ...:..-...   .. ..      .=.. ..     .:=:::::.:.  ...    .:::..          .:         .. .     ....                         \\n                    .   ..:--::...:...::..:    .:-:..-:...  ....:::::-:....+..:-:.::.           .=.        .. .:....::::.                        \\n                  ..:.:..::-=--:..+....::::.  ...: --+-:.-. .......::+-::::: ---::::... ...   ..:::. .   ..::::.. ::--- -..    ..                \\n                 ..::-:::---+=-:..::..:::-:....::--=++=-:-:-:::-....:-+=-=+==++=-.-+::..:::..=  ..::.....:::-:-=-----=-:......+:...=    .        \\n               .-.:::::::--.+===--:::-=:.==-:.+.::-+XX+++++-- :.. ..:-XX++++XX++++==-=-::..    ..=:=+--:++=:=-=====:=-:::...=.::......+ ..       \\n           ......::-:--=----=++==---==-=+XX=-:..:-=+XXX+++:==--:...:--+XX:XXX+XX++=-==+-+-:=...::: +X++XX++=+++ +=+=----=:.::::-::-..... ..      \\n           .:::::-::--+=--=---+X+===-=-=+XX++=:::-=+XXX.+++===-:-..:-=+X:X:XXXXX XX===XX-++=--+-::-=+XX++:XXXXXX++=-::--====---:::--:...+ ...    \\n          ..:-----:-==X++==-.--+XX++==+X=X++==+==+XXXXX+++==----: :-=+XXXXXXXXXX+=====+XXXXX+++=---+XXXXXXXXXXXXX+=----=+X++==--=-=--:.+..=....  \\n       .+.::--==-==++XXX+=----+=+XXXXXXXXX++==+++++=XXX=XXX==------=+XXXXXXX XX.+===== +X-XXX+XX===+XXX=XX=XXX=XX+.++++XXXXX:+++++==-:.... .....-\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                       .        ......                                                                           \\n                            .                   ..    ..     ...=::..                                                                            \\n                          .+.. .               .:.    .     .:.. .=...                          :                                                \\n                        ...:.-..       .:  .   .:.   =..    ..:.....:.                .        . .                                               \\n                        ...:::..:...  .....    .:.....-:   ........-+:...    ..:.:::.          .:                    ....                        \\n                   ......-:--::.  +..  ... .   ..:::::=:......  -..:==:.:::..:=-:::. . ..      ...           ......: ::...     .                 \\n                   ..:...:-=--::...:.:+:..-::..::.---==-=-:.:.:.. ..:==----:-=+==--::..  ...    .::.    ...+:::---=:::-:..    ....               \\n                  ...:::=::-=--:--=::--::-==::..:.-+++===+=-::..  ..:-X++++++++++=--+-:..      ...:-:::-==------==----::.-... .....              \\n            ..   -..::-:: ::-=------------X=-:....-+XX++====:--:   .:=X =XXXXXX+==--=+-::::..:....-+====+===-= ===---::-::....+.....=            \\n           ..+:..::::-=--::::-++==--:::--+X+=-:..:-=+XX+=------:. ..-=+XXXXXXXX+=+=--=X==:=-=::..::+++==+++++++++=--:::==---::::.::....   ..     \\n           .:::::::--=== -:-:-=X:X==::-=++++=-=====+-XX++==-::-:..+:-=+.X+XXXXX+=-=--+XXX-X+==-:::-=XXXXXXXXXXX++=-=:::-++===-:::--::..    ..+   \\n         ..:---===-==+++=-.:::-++XX+==+XX++==-====+XXXXX+++=---::::-=+XXXXXXXX++=-:-==++XX+++=+=--=X:XXXXXXXX=X+++=-=-=+XXXXX+===--+:...   ...=  \\n      ...::.--+==++X+ +++=--.:=++XXXXXXXX+.+==++====++XXXXX+==+=-==+X:X-XXXXXXX+==--+==+XX.+=-=+==++XXX ++XXX-XXX: XX X-XXXXXX+ +=--+:...:......=\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                       .                                                                                         \\n                                        .      ..      .      ........                                                                           \\n                          ..                   .       .    ..   ..:..                         :.                                                \\n                          ....           .  ..        ..      +...-=..                        ..                                                 \\n                         .......   ..  .       ..     .-. ..  ....--:.. .     ..: :...                                                           \\n                   .. .   .:::..   .  :    .+...::. ..:-:.........::-........:-=-::-.. .       ..            -... :.....                         \\n                    ..=...--::-=.....=+....-:..:.....:----:.:...  ..:=-:::::--=-==--:.         ...     ......:.:--.......                        \\n                   ...:...:--=:..:::-...:::+-...:.:--=-----:::.   ..:+X+==++ ++== -=-:...       ...:-..---:--:.:---:::=:..     .                 \\n                  ...-::..::-=:+::=::::::=-+-:....-+X+===----:..   .-+ XXXXX++X==-:-=-::.....   ..-=---=---::::---- :=::.:..   .....             \\n           . ......:::--:.::.-+=--+:..:::-=+--::.:-=X++==----:::...:-=+XXXXX+++=-=-:-==---:.+.  .:=+X=:===-.-===--::: :-:::-:........            \\n           ...:::.::-=---::::-=X+=--::::-==+=--==--+XX++=--=:::....:-=+XXXXX+=+---:--XX-XX+=-::..:-=++++++--XX+=--:..-:-==---:-::-:=..     .     \\n          ..::----:-=-== -::.:=+=++=---===+= --===+XX+++===X---:..:-=+XXXXXX+==--::--=+X++==-=-::-=+XX+XX+X XXX+==-:::-=X++++=----:::..    .+.   \\n       ...:: -----=====+=-::::-=++X++++XXX+=--==+=+:++XX:+++ ==-:--=+=XX=XXXX++==-:-==+X++==--==--+XXXX+=++XXX XX+++++XXXX ++====-.--...  +....  \\n    ...-.:: ----:===.+==X+=-===++X.XXXXX++X+XX+=-==-==+XXXX++====+XX=X XXXX+XXX+======XXX++=-=-===++XXXX++X XXXX+XXX=XXXXX ++++===-:--:..........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                        .                                                                                        \\n                                                                  .                                                                              \\n                                               .               ..::                                                                              \\n                                             .         ..        ::.                           .                                                 \\n                           . .     .        ..         .:        ::.                                                                             \\n                          +...        .     .:..       .:       .:::.       .. ::...:..       .                                                  \\n                          ::..              :....    ..::.:..   ..:-::..    .:: --:.:.         .                .                                \\n                     =....-::....   .      :-::.   ..::.::-.::.   .:--::.:-::-----+-..        ..       ..    .....:.   .                         \\n                     .... ::-.:....:.. . ..:=:.:..::::::..::-..   ..=+=--=+X+--=--==:...      .   ...... :::.. ... ::.....                       \\n                   .-... ..:-=:...:::......--:=..:=++=--:::::.    ..=XX++XX++===:----::..       ..-::.--:........::::-:.. .                      \\n                .....-::-...:-+:::::..-...:--::-::==++=--:.::......:-=+XX-++==-=-:::-+-::-:.:. ..:+X+==---:-::-::::.:::............              \\n             .. .:..---:::...:=+--::...:.:-=-::-==-=+++==-:-=::....:-=XX:X++=-=-::-:=X+=++=-:....:-=========++=-:. ...:-:::::::.:: ..            \\n           .::-:.:::--=--::..:-=+=--:+:----=-=::-+XX.X+==---=-- ..:-+XXXXX++=--:..:--+X+==----:..:-+:+++++++=X+---:..::=X====-::.:::.            \\n         ..:::-:::- ---+=:...:--=++=+=.==++=-:---++X+X+===-=--=:::-+XXX==XXX+=-- ::--=+:+==-:-=:-=+XXXX+=++++XX++== ==++.X+=----:::::.           \\n     ..+...::-----------+=::--=+X+++++==:++====----===X+=+=+=+==-=XXXXXXXXXXXX+===+==+XX+==-:-=-=+++XXX+=:++XXXXXX+X-X+++++=+=---:::+:.........  \\n    .....::::-----------=++==+:XXXX-X.XXXX+X+=-::-:--==XX+X+XX+ ++XX+:+XXXXX-X:+++++.+XXXX=--=.====+XXXX++XXXXXXXXXXXXXX+XX++==--::::--...::.....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                        .                                                                                        \\n                                                                .:                                                                               \\n                                                        .       :.                                                                               \\n                                             .          .      .. .                                                                              \\n                                             .          .       ..                                                                               \\n                          ..                ...        ..       .:.            .::-                                                              \\n                          :..               .:.        ......:   .::.       ...::-:.                                                             \\n                          ::..     ..       .-.    . .   .....   ..:::.. ---:: =---:.                              ..                            \\n                     .   ..:::. .  .      ..:-.. .:..:........    .:----=+-+=----::-:.       .          .....   .  ..:.                          \\n                    .. ....::-:. .....    ..::-:.-====-:.:....    .:+X+=:++=-----:--:..          .:.:.::....   ..  .:..                          \\n                  .. :.. ....--:..:  ..   .::..:-=--===::..:::  .=.:==X+X+==--- -:.:-:...-:    .:-++==--:.:..::........ .     . ..               \\n                 ..::-::...:.:--:.....:. ..: ::.:-=.===-=-::--:.=.:-=+XXXX+=- -+:::-+=--+-::.  .:--=-=-----=+=-:.. .=.::..- .....+.              \\n           ...::....::--:+....:--:::::.::+::::..:-+XX+=-:-::--::..:+XXXXX=+=--::..:-=++==-::.:...:-=+=+=====++=::.....:==-:-::.......            \\n          ....:..::::::--:....:-=---===:--==-:+::=++X++-:-:-:=--::=XXXXX++++=-:::=-:-=++=--::-=::=+XX+X+=-==+X+==-----=++==-:::::.....           \\n       ....-::::::::::::=-..:-==X++=====-==---.::-=+=X+--- -==--:-+ ++XX+X+X+=---==-=+XX==-::-=--=++XXX+==+=+XXXXXX++++==+=--::::...:.     ...   \\n     ...-..::::----:::-:-=---=+XX-XX++++====+-:..: ---++=-+=+====+X++=++XXXXXX+===+++X=++=-::--=-==-+X++=+-+XXXXXXXXX++++ +=+=-::.:..:.-...-...  \\n    -.....::----==-------=== +XXXXXXXXXX++-++-::.::====XX++++==+++XX ++++XX X XXXXXX++++++=--==+==-+++XXXXXXXXXXXXXXX++-XXX+++=--:::: :.:-::::.:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                :                                                                                \\n                                                               .                                                                                 \\n                                                                                                                                                 \\n                                             .           .    ...               ..                                                               \\n                          .                 ...         .       :.               ::.                                                             \\n                          ..                 ..              . ....     .::.:..:-.:..                                                            \\n                          .:...             .:.              .  .  +..=::===--::-:..                                                             \\n                          ..::.             .::.........  .  .   ..:--:--X+=-::::- ..                                                            \\n                    ..     ..:.      .     .-...:===--:.... .:   ..-XX+====:-::::::..            ... :...:.                                      \\n                    .:.:.   .::.  ..  .    .....-==:- -:...:.:....:-+X++++=----::..-:...:..    .-=+=--:..::::...    ..           .               \\n                    .:::...  .::. ..   ..  ::....--+=--::: ..-:...:=+:++X++=-+:::::-=-::.-...  .---=----::-+=::..   ....         ..              \\n               ..  ...::..    :: .=.::...........:=+X+=-:.:..--:::-+XXXX+===-::..:--+X=--::... ..:-+==+=---==--::.....:+:....+  ....             \\n          ...... ..:.:.::.   .:----::-=:.:=:::::.-=+X=-:. .::::..:-+=XXX+==-::.=.--:-++=--::.::.:-=++ X=----=+=--:::+-==-:::.+..   .             \\n         ..............:-....:--=++=---==---:::::--=X=-:.:::---:::-X+++XX+==-::::==-=++==-:.:- --==+X++=---==XX++XX+==-==--=:::...  .            \\n      .-....:-:-:-::+::::-::--=+XX++=======-=::..:---+=--:==-----.+X+==+XX+X+=--===.XX:==::..:-=-===X+==-= =+XXXXXXXX+==+==+--:........   ....   \\n     .... ::: . ------:=::--=+XXXXX-X++X==---:....:-=+++=-==-----++X+==++XXXXXXXXXXX++++=-::.:-=--==+XX+=++++XXXXXXXX++XX+:++=--:.:......:::.... \\n     ......::--======.----==+XXXX-XXXXX-====--:::::===+XX ++====+++X++XX++-+X=XX+XXX+:++X+=- -=.====+XX:XX+XXXXXXXXXX++++.XXX+==--::::::::::::.+.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                .                                                                                \\n                                                               .                                                                                 \\n                                              .                                                                                                  \\n                                                                                                                                                 \\n                                                              ..                ..+                                                              \\n                                              .               . .       .::.::..::                                                               \\n                           .                  .               :.      ..:--=-:::..                                                               \\n                           ..                 .               .    ..-..:--=-:::::.                                                              \\n                            .                ..  .....-.      .   .-::+::--=:::.:..                                                              \\n                     .      ..                 .:-=--:...... .:...-=XX+=-==-:.:+:..     ..         :+......                                      \\n                     ..      ..        .     ..:-:==-:::.  .. :..:-=++======-:.:. ....:        :--=-::.-..::.      .                             \\n                     ....     :.   ..=     .....:--==--:... ..:..::-+++=====-...:::--:..       .-:=--:-=-:--:::..                                \\n                    ....      ::....+:.    .. ...:-+==-..... ..:..:-++++==--:...:--=X+=-::. .. ..--=---=----.:::.  -....:..                      \\n           .           ..    ..::==::.::=........:=++=-...  .:....-+XXX+=--:....:---== =-:....:..:-+===-::-:--.:.:::::-=::+..                    \\n           .........   .:.  ..::-===-:::-=--:..:.--++--:..:.::::.:=+X++X+---:...:=--===:--..::--:-=++=---::-=X=-=++======--:..:.                 \\n       .......::.:.::...::..:-===-++=-:===---:..:.:-=+-::.--:.:::-=++==+X===--::-==++X+=-....:----=.++-::.-==XX+X++XX+=====-::....:              \\n       ....::::::-:::-:.::--+XXXXXX++==+=--:-...:.::-=X=-::-:::::-==+===++XX++==X++X+-++-:..=.------++=======+XX.XXXX++++==--=::.:.  ....:.....  \\n       ...:.:::-==- -=.::--=+XXXXXXXX+++:---:. .::=-:-+X+=-----:=.====++++XXXX+++.X++==++=:::-= --==+XXXX.+++XXX:XXX-XX++++=++=-:- .....::::.... \\n     ......::--==+.==+=--=++XXXXXXXXXXX==---::: ==X+===+XX++==+++.==++++XX+=+.XX++:+==++XX+=-=+=.===++XXXXX-X.XX=XX++==-++X+XX+==.-::: ::-:::=...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .          .. ..- ....                                                             \\n                                                                         .::-:::. .                                                              \\n                                                              .        :..::-:..                                                                 \\n                                                             ..    .......::.::...                                                               \\n                                                   ....       .. ..::==--::-:....                                                                \\n                                               .:---.-..      ...-=+:+==-::::..+..                 ..    ..                                      \\n                             .                 :::=-::...     .=.---+==----+:..:.  ..          ::=-:....::..  .                                  \\n                      .      . .      .        .:--=--::      .-..--=+===---:..::.::..         :::=-:.::-::....                                  \\n                       .      ....=    .    .   ..-=--:.       . .:-=X+==--:.. .:-=+++=-..     .:=:--:.:::::.. .      .                          \\n                               ..:--:=.....=.  .-.== -:..   -... .-=+XX=--::.   :-+===--:.. .-. ..-==--::.:=:...-.::::-::..                      \\n             .         .    ...::-----.. :--. +..:====-..:..:.+..:-==+X=-:::..=.:=--==--:...::-:: +===-::..:--:: =---==--:.-..                   \\n           ........... .=...::---==--:::=-:-:.....:-+=-:..::.....:==++.+=---::.:==-++X=-:. ..-::-:=++=-=:::-++======X= =--::.....                \\n        +:........::::..-.:=XXX+XXX=--::--:=:. .=..:-++--..::...:---====+==+--:=:=+ +++=:.   .-----=X+==----==X++++=+++==--:::::...    .....     \\n        .=.:=::::=-:--::.:-=+XXXXX=+==--:::..  .:.:--=+X=-::::.------==+XXXX++==+ ====++-:...-=:-=--=XX++====+XXXX+++X+++==-==-:::.. ....::....  \\n       ....::.--==--=-----=+XXXXX-X++=+--:::::..--=X+-=+X+====--=--===++XXXXXX++=-++= =++=: :-----==++XX+=++XXXXXXX++ ++=+++++=-- ::...:::::.=.  \\n     ......::-===+=+++===++XXXXXXXXX+++===-:::.-=+XX+==+XXX===:+X==+XX+XXXXX+XX++======++X+=---== ++-=+XXXXXXXXXXXX++==+.+XXXX+=+==--::--::::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                              .               .... .                                                             \\n                                                                         ..:--::..                                                               \\n                                                                        ....::..                                                                 \\n                                                             ..      .  ..-:...                                                                  \\n                                                             ...  ..:--:--:.::: .                                                                \\n                                               .::::.. .      ...:---+=--:..... .                        .                                       \\n                                              .::-+-....      ...==++=----::....               .--:.. . ..                                       \\n                                              .-::---:..       ..:--==.---::..::=.....        .=.--:..=.::=..                                    \\n                               ..       .       .::--::.       . .:-=+==--::=.. ::--:-::.      .:::-:....::..                                    \\n                                ..::.   ..  .   .:-=--...        .:-=X+=--::.  .:-:++=--..  .   .::--:::..::.      ...=...                       \\n                               ..:::-:.:..::-. ..:+=--:.-. ..    .-==X+=-::..  .::====--:... ::.::==--::..:::....::::-=-:..                      \\n                   ..  ........::-=---:.:-:::.  .:-=+--:..:+.....: ==+X=-:: ....=--==+=-:=....::--+==-::..::=--:-::-=+--::....                   \\n           .....+.::... ..:-== =-==--:..:::-:.  ...:=+-::.....  :-=-=.=+=--+.::-=--++X=-:.   .:----+X=-:+:---++====.++==--:..:::..      .        \\n         ........:-:::...:-+X XXXXX+--: :::..  .-.::-=X=-:..:..---:--==+X++.=----:== ++-:.   .-:-:--+X++=---=++++++==++++--: :-::..   ......     \\n        .=..:::-:------..:-+XXXXXXX+==-::....  ..:-=+=++==---::.--:-=:=+.XXX++==-===--++-:..:-::----=+X+==-==XXXXX+=++ ++==--==::::. ...+:.....  \\n       ....::-:-== ==-=--==+XXXXXX-+++=--::.:..:--+X+.==++=======- -=+++XXXXXXX+=======++=-::-:--.==++.X+=++XXXXXX++=+++=X+-++=-=--::..:::::...  \\n      .....::-=-=+=++++++++XXXXXXXX++X+ +=--::--=+XX+==+XX+===.=+=++XX.++++XXXXX+====:==+X+= --==-+X==++XXXXXXXXXX++==.++:XXXX++===--.:--::::-.. \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                 ...                                                             \\n                                                                         ......::..                                                              \\n                                                                           .:..=                                                                 \\n                                                                            ..                                                                   \\n                                                              .      ...... ..                                                                   \\n                                                              ....=..--:+:. . ..                                                                 \\n                                              .:--:..          ..-=--=-:.... .                          .                                        \\n                                              ..::--:.         .---==--:: .. .:               .:-::..                                            \\n                                               ..:--.:         ..---=-=--::....-=....         . .:::....:..                                      \\n                                                .:--::.          .:-===-:::=.. ..:-::-:..      ..:::- .....                                      \\n                                  ..-     .  .  ..==-:...        ..-=+=-:-...  ..==++-::.   .   ::-::..-...         .....                        \\n                                 .::::     ..   .:+=-::.  ..     .-=++=-:...   .:---=-::+......:.:X--:..:.....= ....:--::.                       \\n                         .........-::::..:+::.. ..-==::.-..     .:===++=- ...  :-:--==-::...  .::-+==::...::-:..-..:----:..                      \\n                  .:.=. ..:--+=-----:::....:.    .::=+-.=.      ::::--+=-:: ..:-::-==+-:.     :.::-++= --::-+X=-=----=---:.. ....                \\n          .-...  .:::: ..:=+XX++==+=:.:.....     ..:-++::::.-.  .:::--=XX==-::::.:--+X-:.    .:.: :-=X=--:::-=+= ==--==+--:.-..::..   ...=.      \\n         ........::=-::..:-++XX++-+=--:.-.       .:-++++-:.:--..::::--=+XXX+=--::-+--==-:. .::.::: :-=+--::-=+X+-+==:==+=-::::-::...  . ....     \\n        .+..::::-:---:-:::-+ XXXX++==+-::...=. .::-+X ===-::::-------==++X.XX+==--=---=+=:..:..::::--==+=--+XXXXX+=====++=-==----::...:.::.:.    \\n         .:.::--=====++====XXXXXXX+==+==+=-:::::-==++==++==--=::--==++==+XXX-XX++.======X+-::.::=-=++==++++XXXXXXX+==-=+=++ ++==----::::::::.=.  \\n     ..  ..::-===+==++XX+XXXXXXXXX++=++X+X+=-=== +=++=++XX:==---=+++++++=+++XXXX++=====-+XX==-===-+X==++XXXXXXXXXX+=-==++X+X+-+===+=-----::....  \\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .:.                                                            \\n                                                                                                                                                 \\n                                                                            ...=.                                                                \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                    .:....                                                                       \\n                                                                 .-..::...                                                                       \\n                                              .:---::.         .:-=--:=....  ..                 .                                                \\n                                                .:=::.         ::.:=-- ::.-.                 ..::-:..                                            \\n                                                ..-:..          .-::=--:....    ..:...          ..-... .                                         \\n                                                ..=::.           .::---::....    :--::..       ...-:... .                                        \\n                                    ..          ..+-:..           .-=--::.      :--+-:...      .::+:......            ...                        \\n                                :..:.-.         ..==:..  ..      :-++==-::.    .---:=-:.=.     .::+-:..=.          .:::...                       \\n                             .:::..:....   ...   .-==-. .       .::-=+=--:.   .:: :-=--...    ..::=+--::...:........:::-:.                       \\n                   .......::::+-:.::....   .      ::==:..:      .::--=X=-::...::.::-==-:.     ...:-=+=---::-+==-:::::--::..    ...               \\n           .      ..-:.=.:-++++=--+-:-..          .:-+-:......  ...::-=X+=--:...:.:=+=-:.    ...:.::==-:::+-==:----::--=-:.  ......    ..        \\n          . .  ...:: =...-==+X++===-:-....        .:=++=:...::. ..:---=+XX+=-::..::--==:.  .:... ...:=-::.::=+=====--==+-:.....:+..   ..+..      \\n          .......::::::..:-=+XX+=.=-==:::...    ..:-==+=-:.....:..:---==++XXX=-:---::-+=::. .  ..=:+:-.-::.=+XXXX====-=+=-:-:::::..   ......     \\n          ..:::------=--- =+X:X++==-== =++=:.:.:::--=:===-::....:+:-= ==++XXXX+==--===.X+-:.. ...:-=---=--=+XXX.XX+=--====+=+=----:..........    \\n      .  .=.:------==+X++++XXXX++.==-==+XX+-+-=-===-=.=+++==::::-=X++++=++XXXXXX+=--==-=+X=-::--:-=X===+=++XXXXX=X+=-=+=+XX+=====-=--:::::=...   \\n    . . ...:--======+++XXXXXXXXXX++++++XXX++===:+++==+XXX.++=---=+XXXXX+-+++XXXXX+=======+X+====++=+.++XXXXXXXXXXXX==+++XXXX++ ======---:.::..- .\\n\",\n  \"                                                                                   .                                                             \\n                                                                                   ..                                                            \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                                      ....                                                                       \\n                                                 .             ..--.......        .                                                              \\n                                              ..:==+::.        .::--+..           .  .           ..                                              \\n                                               .+.-.+.         ...:--.:.          ..          =..-:...                                           \\n                                                ..-:.           .:-:---..        . .           . .:...                                           \\n                                                 :+-.            ..:--+...      .:-::..        ..:-:.                                            \\n                                                 .==:..          ..-+--:...    .::-=-..         .:=-..                                           \\n                              .:-....            .-+-:.         ..:++--::.:.   .::----:.        ..==:::.           ....:                         \\n                             .::......           .--=:.          .:-=+--::.. .....::--:..       ..-+-::.. .. ..   ...+::..                       \\n                     ..   ...:-::....  .          .:-:.. . ..    ..:-=XX-::. ......:=--..       ..:-=:-:..:==-:::.=.-:::..                       \\n                   +..:..:-=:=+--:::....           .:==:...  ..  ...--=X+--:..  ..:==--:.         ..-:..::--=-- ::-:-::-:.     .                 \\n                  .......:--=+==-:-:::...         .:--==-..   .  ..:--=+XX+=-::...:-=+-:.  ..   . ..:-::..:--==-==::.:=-:... ..=.                \\n          .........:....::=:=X+=-----:--:.:.     ..:-=.=:.-.   -...:--==+XXX=-::--::+=+-:.       .:::+:...:-=X++X=----==-:::::..-.    ..+.       \\n          .+..:::::-::::.:-=+X+==-:----+==+=:+..::=--==---::. ..:-=:--==:++XX-=-:--==-=X=:.     .:--::-:::-=+=XXX++=--=======- :::....=:...      \\n         .. :--:-:--==+++=+X+X+==-- :--=+XX=-:---=--= ====--...::-+==+XX++XXX:X=--::- -=+=:..:-:::-==--=-==+XXX:++=+-===+XX==.-----::::=...:     \\n      .  ..+:----=--==+++=XXXXX+==++===-+++=---=+==-+XXXXX+=-::--==+ XX+XXXXXXX++=---=--=++-::--==-=X=:+++XXXXXXXX++-== +X-X++=---- -:::+::..    \\n     .  ..:::--=++= =+=+=XX+XXX:X++XX++++++==++X++==+XXXX-X++=-==++XXXX:X X-XXXXXX+=+===+-++==+-===+X+X:XXXXXXXX.X+===+XX++XXX+==.--=--:::+:+....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                  .                                                              \\n                                                .-:.          .:----:..                                                                          \\n                                               .:--:=..       ...::=-:..                        .:.                                              \\n                                               . ::..            .:--::.                       .....                                             \\n                                                .-=:.           ..:--::.         .             ..::.                                             \\n                                                 :=:..           ..==::.       .:--::.          .:-:..                                           \\n                               ...               .-=:.          :..++-:..  .   .:.:-::.          .-:..                                           \\n                               ...                :=:.           ..=+-::... .  ...::--:          .--:+..            ..                           \\n                              ...=...             .::.           ..--+==-.. .:. ..::-::.          :-::..  .     .   ....                         \\n                          .. ::-.. .               .::.           .:-=++-:..     ..==::.          .::... :--::.....::.-..                        \\n                    . ...+:::--:::..=              ..---..        ..:-=++-::.    ..==-:..         ..::. .=::-:::::-.. ::..                       \\n                  . . ..::::----.::::.-.          . .- --:.       ..:--=++=-:....+.-=+-..         ...:. ..::-----+-:.:-:: ....                   \\n               -...... ..:---==-::.::-:::.::.    +..:==--:..    .:=::--=+++X--:::::::=+-..       .:..:.-...:=+===+=-:.--:::......                \\n            ...::..:.:: ---=++=-::.::-++--:==:..::-:-+--:-..   ..:-::--++++ +=:..::--:=+-..   . ..:-..:::::-+X=++=--::-==-==-:=........=:.       \\n           ..:::::::--:-=-++X+=--:::::--=====-::-= --=--=-:.  ..:-=---=+.++XX+=::...-::-=:. ..:::.:-::=::--=+XX+====-=--=++=-+::::.. ....-       \\n           ..:=------:-=-=+X+X+=--=-----=.=--:--X--=+X+++==-:..::-==++XXXXXXXX+=-::::-:--=-.. .:-:--+--=-=++X+XX+++==---=++==---=:::=:::...+     \\n         +..::--=---===+==+++++++=-++========-=XX+==+XXXXXX+=:::--=+XXXXXXXXXXXXX+-----====-::-:-==+XXX-XXXXX.XX X+=---==+++-=------:::::..=.    \\n    ..: :..:::-==.=--=+X++++XX+-XXXXXX+:==++++XX+++=+XXXXXXXX=--=+XX-XXXX XXX.XX+++ ++==+XX++==-=-=+ X-XXXX+XXXXXX+==.++=++XXX=----=--::=:::: ...\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..             ...... .                                                                         \\n                                                .::..         ..::=+-::.                                                                         \\n                                                .--...       .. ...-:..                         ..-                                              \\n                                               ..:-.             ..-:.+.                        .:.                                              \\n                                                 .-..-           ..=-:.          ..             ..:                                              \\n                                                  -:.            ..+-:..       .:---::.          .:..                                            \\n                                ..-               ::.            ..-+:::.        .:=::.           :...                                           \\n                                                  .-.            ..-+=--:.   .  .+.-:..           ::..                                           \\n                             . ..                  .:.            .--====:..     ..=-:.           .:+..           ...                            \\n                            ......                  ..-.           .:-==-: :      .+=:..           ...   ::- .....:.... .                        \\n                         ... .....  .               ..:::.        .:.:-===-:.   ...-+-:.            ..  .:.:-:....:...:..                        \\n                       .......::........            .:=-::       .::.::==++=:=..:..--=-.          ... .  .::-:: :--:.:-.:. ..                    \\n               . .    ..::::---:. ..:.:....--:.....::--:--:    ..:+-:-:-==++=::...:::-=:.        . ........:-+-:-=-:::::...=..                   \\n            -...-......-::--+=-:....:---.-=--=:+:-=--:-::..   . .:-::::=====+-:.  .: :--.    .. . . ....+..-++===--::::--::-:..+.                \\n            .-.::...:...::-=+=-::.-.:.:---.=--::-+-:---:-:..  . .:-=--== == ==:..   ..:--.    ..:..:......:-+++===--::::-=-:-:...   . :..        \\n            .::::::::.::--==+=--:::+ :::-----::-++==++=---:......:-+X++X+++X++=-:......--:.     ..::=-:.:--=++++==--=: :-==---:::.........       \\n           ..:::-::+:--=--====+===+==--------:-=X++ XX+++X++=-:..:-=+ XXXXXXX X++-:::: -.--:..:.:-=+X+++ +=+XX+X++==:::--= ==--.:::::..... .     \\n         ....::---.::-++===.+XX:XXXX+++--=====+++==++.XXXX++==-::-==+XXXXXXXXXXXX+=.==-==+==+--:--=+XXXXX-XX.XXXX=+=--==-==++=-:.:--:: ..:.:...  \\n     .+...::-:--===--=++=+++++XXXXXXXXX+===+X+++++=+=+XX=XX++====++XXXXXXXXXXXX=++==+=+XX-XX++=-:==++XXXXXXXXXXXXXX+==+X=++XX+=-:-=-:::: :::=..:.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                ...             ..+-:....                                                                        \\n                                                 ::.          ...::-::..                                                                         \\n                                                .::.           . ..-...                          .                                               \\n                                                 ..              .-=::                          ..                                               \\n                                                  :              .:=-:..         ...             ..                                              \\n                                                  :.              .-+:::.      .::-=::.           .                                              \\n                                                   .              .:X-::-.   .. ...:...           .                                              \\n                                                   ..             .:=--:-..      ..-:.             .                                             \\n                                                    .              ::=-=--..      .+-:              .              .                             \\n                                                     ....         ...:---=-:.. .  .-=:..            .   ..::.     ..                             \\n                              .                     ..:...       .-:..:--==-.. ..+.:+-:.           ...  ...::..   .....                          \\n                           .....  .               .:::=-:.       .::...-=-==:.  ..::-=:.            ...  .:.::.:..:...:.                         \\n                        ....--:..... ..   ..-:.. :=::.::. .      :--:.:----=-:.   ...-:.     .  .      .  ..-::.:.::..::-.. .                    \\n               ..       ..::-::.   ........-:-=::==::..:..:      .:--::--=----..    ..::.     ..    .     .-=----::....::.::..                   \\n              .... ..  .:::-=-:..  ...::-:-=-:-::=-:=::..        .:-=---=====-.     . .-..      .  ..    ..-==---:.:-....::::...                 \\n             ...........::--=-:::..-::.:-::--:.:-+==--:..-...    .:-++XX++++==-:.   . .::..     ..:.=. ...:-=++- -::::..:--:-:=.. . .   .        \\n            ....::.:..:-::--=:=----:+:-=--:-:.:-++XXX+=-=+=---:...:-=+XXXX=XX+==:....+:::::. ....:=+==-::--==+XX==--:..::----::. ......=..       \\n          ....:-:::::+=----==++X++====+-:----.==+=+++X++=+==--=:.:--=+X=XXX=XXX++-:+::--=-:--:..:-+XXX+:++==+XX XX=-:-.----+=-::..::.........    \\n     ..  .. :::----:::-=--= =+XXXXXXXXX+=--===+-====++XX++=+=-----==+++XXXXXXXX+++==+=XXXX++=-::--=+X+X++X++XXXXXXX=-==+===++=-::::::::...::.... \\n     ......::-===+=-=-====++-+XXXXXXX..++==+X+======+XXX-+=+=--=+X++++XXXXXXXX++======XXXXXX++-===+++=XXXXXX=XXXXX++==-++XX+XX+= ---::::::::::. .\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..              :+:.                                                                            \\n                                                ...              .--::. .                                                                        \\n                                                 .              ..--:.                                                                           \\n                                                 ..              .--:.                                                                           \\n                                                 ..              .:=:+..                                                                         \\n                                                  .               .--...:.       .-:..                                                           \\n                                                                   :=:..:...    .::-:. .                                                         \\n                                                                   .=:. ..      . :-:.                                                           \\n                                                                   .::::::.      .:=:.                                                           \\n                                                    ..            ::-::::--:  ..  .--..                  ..                                      \\n                                                    .. .-.        .:..::+:--..  . .:+:.             .   .....                                    \\n                              .                   .:...:          ..  :.:=:::    ..:=:.              .    ....     . ..                          \\n                            ..              ..   .--::.:.        :.:. ::.:::..     .::.                   ..:..   .....                          \\n                           .:...+           ::...:=-.....:.      ..-=..::-:=::.     ..:                   .:-....... .-...                       \\n                        . ..:..          ..:-:::..-:...=..        .:--:::::=-:.       :.                  .-=::::... .:... ..                    \\n                ..      ....:::.    .+.:+:::-.:-::-:. ..          .:-=--:::--..       ...          ..     .-=-:-:.... ........                   \\n             .....   ..:..::---:+.. ..:==:::- ..:==-::.. .-.:.   ..:-=+=====--:.    . ..:..       ..:.    :--++-::....  .::..-                   \\n             ..:..-  :...::---=-::...:-+:::-:..:-++X++-::--:-::. ..-+XXXXXXXX+=-.  . ....::.    .:--=-:..::--=++-:::....:-:-:..   .              \\n            :..::......:.::-=X++==--:-++-::-::---=+++X==-----:-:..:-++X=XXXXX:+=-.-..:::::::.....=+XX+=---=--=+X++=-:: :-:-=-:..  ..    ..+.     \\n           ..+::-::..:::=:--=+XXXXX+=+X=-:--:=:---==+XX+===--::-----==XXXXXXXXX+=-+-=+X++++--:..:=-++X+=====.=+XXXX+=---=--==-:....: ........    \\n      ..  ..:=---==::-:--====+XXXXXXXX+==-=- ==+---=+XX.+==--:=--===++XXXXXXXXX+==-==+XXXXX+=--:--.++XX++++.X+XXXXX+=--=++++++=-:.:::::...+:..-. \\n      ....::--=++=+=---.==++.+XXXXXXXXX++=+==+-====:XXXX+++=--====+XX-XX:XXXXX+====:==+=XXXXX+==-=++XXX-X==XXXXXXXX++==+X=XXX++=-:::::::::.::...-\\n\",\n  \"                                                                                                                                                 \\n                                                  .              .::                                                                             \\n                                                .+.              .-::.                                                                           \\n                                                                .:--:. .                                                                         \\n                                                                ..--..                                                                           \\n                                                 .               .:-:..                                                                          \\n                                                                  .-:...::.      .:.                                                             \\n                                                                   :-.......     .--:..                                                          \\n                                                                   .-.. ..      ..:-..                                                           \\n                                                                   .:+:=..       .:-:.                                                           \\n                                                    .             ::+::..:=:      .-:..                                                          \\n                                                     .            . ..:.:::-.      :-..             .   .:..                                     \\n                                                   .:..-.          .  ..:....    .:.-.                    ....                                   \\n                            ..                   .:-:...         . .. :.::...      .-:.                   .....       .                          \\n                            ..              -.. ..-::....        ..:-..-.::+..      .:.                   .::..   .   ..                         \\n                           ..             ..:..:..-::.. ..        +:::.=.:.:::.       .                   .--:. ....  ...                        \\n                        . +....     ....:: :-:.:..-:=..           .::-:::..:-:.       :.                  .-=::::...   ..  ..                    \\n                      .. ..:::=..    ..-=:::::.:.:--...     .     .:--------::.       ..:.         ..     .--=--:.      ....-.                   \\n             . ..     ..+..=:::.... ..:+-:-::.+.:=+=--:. .:.:..  ..:=+++++++=--.      .....     :...:.   ..:-=+-::.-..  .:::..                   \\n             ..::..   ....:-==--::.=.:-=-=:::..:-=++XX=---=:-::. .:-+X+XX.XXX+=-.:. .......  .  .-++==:..=::--==--::..:..::-:..                  \\n           ..-.::... ..::::-=XX X+=---+=-::::-- -=+++X++==---::-:::-++:XXXXXX-+==:..:-=--:-:.. .:==+X+=------== +++=:::--::--:..   .... ..-.     \\n       .   ...:::-:...::-- ==+X-XXX:+++=-:---.-::-==+X+X+=---: ----==+ XXXXXXX:==---+XXXX-X=-:..:-++ X+====-=++XXX+X=::--= =-=-:..............   \\n       .. .:.--====--::---==-++XXXXXXX+==-=--==----+XXXX+==--:==--=++XX.XXX-XX++=---=+XXXX-++=-:--+++X+++ ++XX=XXX++=--+XXX+++=-:.....::.+.:..+. \\n     ......:--==+===-:--=++XX+XXXXXXXXX++++=====++== XXX-++=---===++XX+:XXXXXX+=======+XXXX++=====+XXX++XXXXXXXXXXX++==+XXXXX++=-::::::-:::.....=\\n\",\n  \"                                                                  ::..                                                                           \\n                                                                 .-:.                                                                            \\n                                                                 .::.                                                                            \\n                                                                 ..:     ..                                                                      \\n                                                                   :    .:.:      ..                                                             \\n                                                                   :..   .       .::.                                                            \\n                                                                    :.           .--..                                                           \\n                                                                   .::.  .       .::.                                                            \\n                                                    .              :. .   ..      .:.                                                            \\n                                                                   -...:...::      :..                                                           \\n                                                                      ..:   .      .:.                  ....                                     \\n                                                  .:-::. .          . ..-.         .:.                     .                                     \\n                                                  .::.              .. ..:..        ..                     ..                                    \\n                                             ...  .:....         ....:.......        ..                    :..                                   \\n                                        .:..:...: .:.             ..=:..  .....      .                    .:-...+.                               \\n                            ..        .:=::::...  .:.              .::::. .....        ..          .       .=:..                                 \\n                           .=...      .-=:....... ::..       .     .::::::--:..         ..                .:-=-:..       ...                     \\n               .         ...::.+.     .-::......::-.--:.......... .-==+==--=+=:.                  ....    ..:--:..   .  :..:.                    \\n               ..       ..::-+=-:..  ..=-::-...-==+==+-:--::-.....:++XX+:+ XX=-:.    .          .:==-=:.  ...::---.. ..:...::.                   \\n              ..:..    ..+:-+XX++=::::-=-:....:---==++===--:::::::-=+XXXXXXXX+=-:... :=:-.. .  .--==+=-::..:::-===+=:.:::::+-:.         ...      \\n        .   ....::..  .:.::=++XX++==-==- ::-::--::==++=+=--:-=: ::--=XX=XX-XX++=--:-XX+===+-....:=+=++--::----=++=.++::::---:-:.       .....     \\n        . ..::-----:..-::--==+X-X+++==--::--:-::-:-+X+=+=--::-=:::-==XX X-XXX++=+--=+XX+ ++=--..:-=++ ==--==+XXX++-+=--+++++==-:..............   \\n       ....::--====--::==++XXXXXXXXX++==-=--::-=++=X++=+.==-::-:--==+X+XXX:XX+===--=++XXXX++==----+XX+====+XXXXX=X++= =+XX+XX+=-:..:::::::..-..  \\n    .....+::--======--= XXXXXX.X-XX+XXXX+=---===+XX+=+XX.++=--===-++XXXXXX=X.-++====++XXX.X++---=++X=X=++XXXXX-XX.XX++++XXXXX+==-::===-- :::.....\\n\",\n  \"                                                                 -..                                                                             \\n                                                                  ..        .                                                                    \\n                                                                  ..       ..                                                                    \\n                                                                   .             ...                                                             \\n                                                                     .           .::                                                             \\n                                                                    .:.           :.                                                             \\n                                                                    ..:           ..                                                             \\n                                                                    ...            :                                                             \\n                                                                     .:..   .:     ..                                                            \\n                                                     ..:..             ..                                  .                                     \\n                                                  .:::..             .  .                                  .                                     \\n                                               .   ..                 ..  .                                :.                                    \\n                                         ..  ...   ..             .  ..   ..          .                    :.                                    \\n                                       .:-:...     ..              :.. .                                   .-.                                   \\n                                       .-::....                    ...-..:=:.                              .-:.                                  \\n                             .        ..::..  . . ..-..      ..    ..:....::-=:.                           .::.+..         .                     \\n                          ..:-:.       .-:. .  .::=:--:..::.+.....:-=-----::-=:..                   =..    ..::..         . .                    \\n               ..        .:-++=-..     .-:..   ::-.-:-::=-:......:=+X:X+===+X+-:.                .::--.    . .:::-:.........:                    \\n               ...     ...:=XX+==-:.:..-::..  .:--------=-:::...::-+XXXX++++X+--...  ...        .-----:......-: --+=:.......:.          .        \\n              .:...    ..::-=+++=--:.:-::..:::::--==+=---:::-..=:=:=++XXX+.++==--::=+==-::.:.  .:-+-=--:..:::.-==-==+=::.:::.:.          .       \\n          ....:::::....:::--=+X++====-::..::...:-:-+X=--=:-:-==:::--=+XXXX+X+==--:-++XX====-:....-==+=-:::--++++====-====-==--:.   . .......     \\n         ..::::-:--:::=X=== =+X++:+++--:.::.-.:-==+-+=-==-::.::::--=+X-XX++++==--:-=++XX+====-:.:-=XX=--::-=+XXX++===.=XX+==+=-:..:-::.....-.    \\n     ......::-----==--+X+=+X:XXX+++XXX==--:::.-==+XX++==++.-:: -- ==+X+XX+XX++=+=-==++.XX+=+=-:--=+++=--==+XXXXXXXX+===++X+++==:::-=-:::: :....  \\n    ...+..:::-=+=----===+++XXXX X+XXX+X+=---- ++=++X++XXXXX+=====+X+++++XX+XXX+++===+XXXXX+==---=+.++X++XXXXXXXXXXXX++++XXX++=--------::-- ::....\\n\",\n  \"                                                                                                                                                 \\n                                                                                   .                                                             \\n                                                                      .          .-.                                                             \\n                                                                      .                                                                          \\n                                                                     .            .                                                              \\n                                                                     ..           .                                                              \\n                                                                     ..       .                                                                  \\n                                                        .:.            .                                                                         \\n                                                   .:....                                                                                        \\n                                                   ..                                                                                            \\n                                                                       .             .                     .                                     \\n                                        .:::.-..                       .                                   ..                                    \\n                                        .:..                            .:..                                .                                    \\n                                        ......    .                  .  ....::.                            .:.                                   \\n                             ..         .:.      . .:..=   .....    ...:.+..:=+.                    .       ...                                  \\n                          .::-:.        ..:     .:..=:..:--:......::-:::-+:::-:..                  ..-        ..=                                \\n                         ..--=--.       . .     .::..:..::.. .  .:=++XX+==-=-=:.                 .....        :..-:.        .                    \\n                         .:==== -::..  ....-.  .::.:-::.+::.-....:-=++XX=====--:.   ..          .::..:     . .:::---:.      .                    \\n              .  .      . .:=====-::.::++......:--+-=-:.:::......::=++XX+=+==--::.:==--:.      ..-.:-::. . ..:--------:..+:...                   \\n          .. .........-:.:::-====-=:--:.. .....:::-==-:.::::::::::--++XX+==-=+--::==+XX=--::.. .:--==-:+..::--==------=-::--:..   ..             \\n         ......::::..--=-:---=+==-===-:.. .. ..:====+-::-::..=:+:::-+XXX===+==-::-=+++X+=---::..--=+=-:...:-=.+++===-=+++=--=-:..:::.-.. ..      \\n         ...:::::---:-==--=++X+-++=+==-::.:..::-=+X++=-=--=-..::-::-=+XX+=++=+=--:-=++XX+=-=-::-:=+==-::::-=+XXXXX+===++X+=:=---::-::...:....    \\n     ......::-.---:----==++XXX XXX++:++=--:::----=++XX.++++=:::-:-==+==+XX+XX++-=-==+XX++===-::=== -======+XXXXXXXXX+==+XX++=---=::-::=-::::=..  \\n     .. ..::-=----::-:===++.XXXX-XXX=XXXX==--.====+=++XXX.X++====+.++++ +X++XXX:+=.=++XX+:++==--==+ +:XX-XX-XXXXXX:XX++XXXX++=- ::-:-::::::::..=.\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                         .:                                                                                      \\n                                                                                                                                                 \\n                                                   ...                                                                                           \\n                                                                                     .                                                           \\n                                           -....                                                                                                 \\n                                         ::..                                                                                                    \\n                                         ..                              ....                               .                                    \\n                             .           ..         .                    ...:--:                                                                 \\n                           .             .          ..  ..-.::..      ......:::-:                  ..                                            \\n                           .::=.                 ..  .  .::..  -...:-:--::..... .                  .           ..:                               \\n                         .::=:--:.        .      ...... ...     .:-===+=:: :::.                  .   .       ....::.                             \\n                          .::::::..   ... ..    ...::=. .:.     .:----+++--=::-..               ...  .       ...::::..    .                      \\n                      .   .:------.......  .   .::::-:...:.     .:-==++==------::..-.--:.       ...:::.  .   .:::::--:. ..-.                     \\n               ..    :....:.:-----:....       .:-::--:.:. ... . .::-=+X+=------::+=+==+-::.     .::--:..   ..:::-:::-:-:+.....                   \\n          ......:-..:::::::---=---=---:.   .  .:=+-=-:::....-.:.:::-+X+=----- -::-++=++--:::.+..::-.-:.   .::-==++-=-====-::-::......            \\n         ...:...+::+::::::-+++ +=----::.......::-=+==-=-::-:. ...::-+++=- -=+=-:::-==++=-::-::=:.-=--::...:-++XXX++=-==++=--:::............      \\n      .. .+.:::::.::+----=XXXXXX++======:::..:--+-++.++-==--:.:---:-===++==++.=----=+X+==+--::-=-----------+XXXX:XX+====+-+=--::.:::..::::..=    \\n     ......::---::.::-- -=+X=XXXX+:++++XX+-::-=====++XXXXX+=----==:====+XXX:XX X==-=++X==-+=-::=--=-=+X++++XX-XXX:XX+==+XX+==-::::::::::::::..   \\n    ......::--==---::-==+.+++XXXXXXXXXXXXX+==++X+ ==++XXXXXX+-==.+++XX ++XX+XXXXX++=+=+X++X+=-: --=++XXXXXXXXXXXXXXX+-+XXXXX+=--::-.-::-::::.....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                          .                                                                                      \\n                                                          .                                                                                      \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                              ..                                                                                                 \\n                                         .....                                                                                                   \\n                                          .                                                                                                      \\n                                                                           .=.                                                                   \\n                                                    .         ..            ..:::                                                                \\n                                                        .:.. .       .::.  .... .:                               .                               \\n                            ....          .              ..       .:::::..       ..                              .                               \\n                         .  .....      .           . .           .-::---:..+.                                  ....                              \\n                         .........    .           .:+:   .      ..-::-----:::...      ..           . .         ..+.:.                            \\n                          .....:..              ...::...+       .::--=+=-:::::-:...:::-:           ::.        ...::-:..   .                      \\n                       ....:::::::-  . .      .:=:.::....       .::-=X+--:-::-=-==:--:-:..      ...::..       ..:-:::::......                    \\n               :.. .. -...:.:---::::.::.      ..----::::  ........:-=X=-::::.::.:==-----:.+.    .:-::.     ...: ------.--:.::. .                 \\n            ...:...:.....:-=+X+=--::.:..      .- -=-.-:..-::. . ..:=== --::-=-:..:-==+=-:..::-...=::::.. ..-====+==-----=-:::::...     . .       \\n          .......::.::.::=++XX-X+=-+--=-::. ..:-=-=+===--:::.. ::-:-=====- ===-:.::-+X=-- ::::-=:::--.:..:-+XXXXXXX+= ===--::::.............     \\n       .....:: :::..--::-==++XX:X====+++==:.=.:-==.=+XXX+=--::::-----==+XXXX-++=-::=++=.---::..::.--=++=--=+XXXXXXX++===++=--::.::...........    \\n      ....:::----::-:--.===-++XXX++X++X+X++-:-=++:===+XX-X+==--===++++++XXXXXXXX+=--==+==++=-:.-::==+XX.-XX:XXXXXXX++=++X++X+-:::::::::::..+...  \\n     .....::---===---=+XX:+++X+++XXXXXXXX++===+XX+-==+XXXXXX=+++XXX:XX.X+XX+:XXX++=++==+XXX+=--:--=+++XX:XX-+XXXXX:++=+XXX+XX+=-:-===-:::::.=....\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                               ..                                                                                                \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                               :.           ..                                                                   \\n                                                                     :. .     ....                                                               \\n                                                         . .        ....          .                                                              \\n                               ..                                 ...:..          .                              .                               \\n                              .                    ..             ....=::..      .                                ..                             \\n                              .                    ..            . .:-:-:.......     :..           ..            ..:.                            \\n                         ..:  ...              .:.....          .::+:-=-::..:::+.....=:.           ..            .=.:.                           \\n                         ...::.+...           ..--:.. ..        .::--=-::....::=-:--:.:.          ...          -.....:..-. ..                    \\n                ..      ..:-=--:: ..   ..    ...--::+:.    ..    ..:-=--:.. ..:.:--::-::. .     ..::..       ....::..::..-....                   \\n                ..........:+==--.:.:..:.     .:.:-+-::.. ...     .:--=--+:::::. .:--+=-:...:.    ..::..   ..::--==--::::::.....                  \\n           :......:..:...:-+=:==+--:::+=:..  ...-==+==-:.-..   ...:---===---=-:-..:-=+-:...=.:::::::::....-=+X++++.+=--+-::......      ..        \\n          :...+....::-::-=====:++=======+-:. ..:-==+.XX++-:....:+::--==+XX++-=-::.:==+--::+......:--++=-::-++XXX.++X ==+=--::..::=:+....... .    \\n        ...+.::--:::+===+= ==+++X+=+.+==++=:.::-====+XX++==--::--==++=+XX.XX=XX+-::--==-==--.....:-=XXX +=++XXXX.+X+++++=== =::.::-::........    \\n       ....::+:-=----=+ ====+:++=+++:++++= =---+X+==++XX++====-=+XXXXX+XXX.X-XXX++--+==+X++=-:..::-++XX++XX+XXXXXX++==++++=+X=--:-:-::..:......  \\n     . ....::--=+++==+X=++=+===+++XXXXX++:==+++++XX++XXXX+++++-+X.XXXXXXXX+-XXX:++++X+=XXXX-+=-:--=++ XXXXXXXXXXXX++=-+++XXXXXX=-==---+::...:. ..\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                               .         .                                                                       \\n                                                                     ..                                                                          \\n                                                                     ..                                                                          \\n                                                                   ..                                                                            \\n                                                   .                .  .                                                                         \\n                                                    .               . .:..           .                                                           \\n                                                ..  .               .--:...:. ..    =..                            ..                            \\n                          . ..                 .::...            . ..-::....-: .. .   .                              .                           \\n                         .:-::...:              --::.            ..-:-:.... .:.:...=. .            .              -....                          \\n                         .--:::::..            .:--:.            .::-:.::.. .....:-::-:.  .        ..          ........                          \\n                  .     ..:- --:--....=.       .:-+-:..           .::--:-:.....  =:::-:.. .        ..      =..:-=-:.:.....                       \\n                 .. ...... -----=--:::--..     .:-=+++-:..       ..:-----+::-:.  .::--:..   ......:::..  .:=:===--=+-::::.. ...                  \\n           .+.. :...:--:::---+==+=--==--=-.   ..:-=+XX+==:.    .::.-=-=XX++=--:.. .: -- ::..  .+.:-+X=-:.:--=++-===+==-=--:..+...::..            \\n         ......::..::=-------====:-+===-==-.. .:---=+X+==-::::: --==X=XX XXXXX=-:.:------:::.  ..::+X+ ==--=++X++=++==+=--:--:..:::.....  .      \\n         .....::=--::=------==-= ====++==:--:::=+===++X+==--:-::=++XX -:XXXXXXX+-::---=++=-:..  .:-=++==+===+XXXXX+===++=--=+=-::-::.+.....:     \\n        ....::- ===--======-+-===++XXXX+=---+====+X++:XX++++=--=+XXXXXXXXXXXXXX++==+X++XXXX+-::.:--==+X++++=XXXX.++=====++ XX++=:--::::..+.. .. .\\n      ....:::-:==++==== ==+-===+=+XXXXX+==-= =+==XXXXXXXX++XX===+XXXXXXXXXXXXXXX+==+++-XXXXX =--===++XXX=X.X.XXXXX++:==++XX+XX+=.--:::.:.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      .                                                                          \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                       ..-                                                                       \\n                                                ..                  .::.    .        .                                                           \\n                                                .:.                 .::..........                                                                \\n                          .:...                 -:..+            .  .:...=. ..                                                                   \\n                         .::..:..               .:-:.            ..=::.:... ..........:            .                                             \\n                        ..: -:::::....-.        .:--:..           ..::---:.....  ::..-:.           .          .::...:.                           \\n                      ....-::--:-=:::.::.      ..:.==::.          .::----::: ..  .:.::..:         ....     .::--:::-:... .                       \\n                 ...::::..::=-=---.--:--:.     .:--XX+=-:..     ..::-=====--:=:. ..:-::.+.     ...:==-:-..:- -=----==-:::...-..  ..              \\n           . ......::-:::::::- -=---.---=-:.  ..:--+X+==--::. ..::-=+X+XXXXX+=:....:-----:..   ..:-XX==-::---====-=+=---:::......:...            \\n         .-....:-::-:--:--: --==---.--==-- .. :-=--==++=--::::::--==+X XXXXX-X+-:::=--:=-:::.  ..:-=+=--=--==+++==++==+=-+--=-:.::.....          \\n         ....:::---:-----=--=====-===-+==----+--=++==+X====-::--=++XXXXXXXXXXXX+=+--==+XX+=-:....:-==+====+=+XX+X+==+==-==.===-::::::.:....      \\n        ...+:---===---.======-===+X:XX++==-----==+XXXXXX+==----==+XXXXXXXXXXXXX++=+X+ +XXXX+=-:+:--=+++++X++XXXXX+++=====+X++.==-::-::......... .\\n      .....::-==++.==-==-++=+==+++XXXXXX+========XXXXXXXX-+++++XX-X:XXX+XXXXXX ++=++==+XXXX:X+==.=++XXXXXXXXXXXXXXX+===:+XX=XX+=--:-::::.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 .                  ..                                                                           \\n                                                 .                   ..                                                                          \\n                                                 .                   ..+                                                                         \\n                         ..                     ..:..               .......                                                                      \\n                         ....-..-     .          :-:.            . ...::.=. ..      ...                                                          \\n                         ...=..+.::. .::.        : :..            ..::-::.......  . ..:                       ....                               \\n                    .. ........:::::..::.      ..:-=-:..         ..:-----::..-... ....            :...     .:.:.....:. ..                        \\n                    ........:.+.::.::.:-:.    ...:=+==-:..-     ..:-=+X+=--::..+ . ....:.      .:.:=-:..  .:..::::::-:. ...     .                \\n                 ............::::::--::-=-..  ..:-=++=--:::... ..::-=+:XX+-+=-:.....::-::..     .:==-:-::+::::----.-=-::..:.....+.               \\n            .....:..::::::::::--:+::::--.=:..-:-:-==:=+=-:..+.:.::-==+XXX++XX+-:..::-==--:..   ..:-==--:::-=-==-=--=--+-::::::.... .             \\n         ......: ::.::::.---.-=---.=-+-----:::::--++====--:..-::-==++XXXXXXXX+=--::-=+XX+=-:.....:--=------==X==:==--=-==-----:.........         \\n         .:.:::.---::.--+:--+-==++======-:--::---=+X-+++==-.::-=++++:XXX:XXXXX+======++XXX+=-::.::-========++X++++==+====++==--::... -.....      \\n       .....:--:===+------=--====+XX.++X+=-==---=+XXXXXXX+==----=++:X:X=XXXXXXX+=++===+X.X++==---=++XX+++ XXXX==XX++=-==+XXX++=-::::::.......... \\n     ......::-=.=+ ==--=++++====+X=XX:XXX+ +X==++++X XXXXX++===-+XXX.XXXXX.-XX++=+==.=+XX-+++:+=++XXXXXX.XX.XXXXX+.X+=+++XXX X+=--::--::.........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                 ..                                                                                              \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                  .:                 .-..                                                                        \\n                                       .         ....              .. ::..                                                                       \\n                               .....  :..        .::.            ...::::.........                                                                \\n                          .    ...:.. ..:.     ..= ::..       ....:--==-- ::.. ...                ...         .     ..                           \\n                          ...   .......::.    ..:----::=..=     ..:-+XX= =--:... ..=.::.       .=.:.:..    .. ..=...::.                          \\n                  .   +......:.........:: .   ..:-----=::..    ..:--=XX+====::.=....::::.     ..:--::=....-....:::::::....   ..                  \\n                .... .. .=.::-::::::....:::..=.::-------::....:.:---=++===++==-:..:-==--::..   .:----::::::::--::--+:::::....=..                 \\n           ...............::----- -::  ::::.:=:::-===----:.=..::-=-=+X+X++++==-:::=-+XX+=--.  ...:::--:::=::-=--=---:----.::.::. .               \\n          ....::::....::::+:---:==---=-=-::+::::--=X+===-:+:..::-==++X XXXXX+==:--=-=+X+=+=-::..::------:--==+=++==---====---::.-....            \\n         ...:::--:-:::::------===++====++-----++-=+X+X+=:=-:.:::-=+-+XXXXXXX++++-==-=+-+===---:: -=+++== =:+++XX+++===+=+X+==--::... .-...       \\n      ..+...:----------=========XX=X++-+X+===---==++=XX+==+==--==+++XXXXXXXXX+++==--==+X++===---++XXXX+.++XXXXXXXXX++===+XX++==--:::::.-.......- \\n    ....=..::-========-=:++++ +++XXXXXXXX++=====+-=++XXXXX+++++XX++XX:XXXXXX.X+======+XX.+++++++==+X:XXXXXXXX+X:XXX-X+++XXXX++==--:--:::::.......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     .                                                                           \\n                                                   ..               .....                                                                        \\n                                                   .               .::..:.                                                                       \\n                                       ..        .:..         ..  ..-:-:::..    ..                                                               \\n                          .            .-.       ....... .     ..:::=---::::..  ...  .           ...                                             \\n                          ...    .     ...    .:::...... ..    ..:--++=-----:.    ...:..      .. ......            . .                           \\n                          :..: ..:.     ...  ..:=--::.... .   .:: -=++==-=---:=....:::...     .:::.....   .   +.......                           \\n                          ..:-:.::..   .. ..-...:-:-- :::.....::---+====- ----::..:--=:-:..   .:--::.......+=:.:::........                       \\n                  . .    ..:-:::::+.....+=.::-...-=--::::....:.::- -+=====+=+-::+:-=-++=--:.  ..:-::.:.. ..::=::-::=-:::::.....                  \\n           ...............::------+::::::..::::::-=+==-::...  .::--=+X+++ +X+=-: :--++==---::...::=--::.=.::--====--:--==-::....                 \\n          ..:-::::..-.::-:-=-- =+==--:--=-:::::---=++=-::::....::-=++XXXX++++=+=-.--===.---: ::.:-=++=--:-==+++++-==-=-=+==--::..........        \\n         ...:::.:::::-:----- ==+XX+=====++---.:--=++++=---=-+::---=+XXXXXXXX+==--:---=++===- ::---+X++=-===++XXXX++=-==+++==--::::.:...... .:.   \\n     ....:.::----------===-===+XXX X++ +X+===--+-==:+XX+==:====++=+++XX.XXXXX+===--==+XX+= ==--===+XX+++++X=XX XXXXX+++++X++==-.-:+:::.......... \\n    ..=...::---.-==+=+==++++++++-=XXXXXX X++++:+==:=++XXX++ +XXXX+XXXXXXX+.+XX++===+XXXX=X+.==--:==+XXXXXXXXXXXXXXXXX+++XX=++++-=-----.::........\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                     :...                                                                        \\n                                                                    .:..:                                                                        \\n                                                               .. .:.:..+.                                                                       \\n                                                  ..   .      .. ...::.:.. .     ..                                                              \\n                                                     .        .:-:-:--:...:.       . .                                                           \\n                            ..  .            .:.....      .   .::+===--:.::-:=.. ...:..              .                                           \\n                            ..  .            .:=-:::..  -..   .::-+===--::---:.....::+..     .:....       .  ...                                 \\n                           .:......        ...::--::-:.....   ..::==-=--::-:-.::.::--:::...  .--::..     .   ....      .                         \\n                          .::::........    ......----... ..   .:+::==-------=-::::-===-::::. .::--:. ..   ......::........                       \\n            ..        ..+.::-::--:..:.:...+..:..::==-:....:   .::::-++========::.:-+=.=-::::.-..:-.-:::. ...::-----:: ---::..                    \\n           .....-.+..:.:.:::--+==--::::-:-:..:::::-=--:+...+...:+:-=++X++== =--:::-+--=-:::..:..:-==--::.:--=+++==-----==--::..    .             \\n          .....-.=..:::-:::--=-=+=-----:-=::.: ::--==--:::::..::+--+XXXX-====--:.::-=-==---::.::::=+==-----=+XX++-==:-===.--::........           \\n        ....-:::::::.------= -=+X++===+=.==-- --:--==++=-+--::-:====+XXXX+-+==-::=--=++==---:.:--==++==--=++ XXXXX++===+++===-::-:::....+:...    \\n      ....-.::-:------====+=.=++:XX+X++++ ===+ ======+XX+==-== ++++++X+XXXXX=+==-==++XXXX==--::+--==XX++-+X XXXXXX:++++++++====-+-::::::........ \\n     ...=.::--=-=== ===++XXX++XXXXXXXXXX+XXX:++======+X XX+.++X++XX+++X+XX++XXX++=++ XXXX+===--:--=++XXXXXXXXXXXXXX++++XX+X+++.=-------::::......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                    :....                                                                        \\n                                                                     .  .                                                                        \\n                                                                .   ....-                                                                        \\n                                                              .:..:::::..                                                                        \\n                                                              .:..+.::...         .                                                              \\n                                                               =::::.::... .  +...::..                                                           \\n                                             ..               .:-==-:-:....::...  .::.                                                           \\n                                            .:-::...          .:-+=---::..:::......::..     ....+             .                                  \\n                            .  .           :..:-:::....       .:--=--::::::::-:.::+:-:..     :=-::.           ..                                 \\n                          .......           ..::-:::..         .:::=--::::::.-:---=---:...:.:.:--:...-      ..::..=. .....                       \\n                      .  ..:::::::..... ..   ...-:-::.       ...-::-+=-=-::::::.:-+--=--::.....::-::...   -..:------:.:.:...                     \\n             .. .     ....:=::-::-:-...:..:..::..:--::.    .  .:::--+ +=----::.=.:-=:--::.+....+.-=::.=...:-=:==--+- ---::=...                   \\n           ............::::::--:-+-::=:::-:..=:...:--:::.... ..+---=++X+=-=-::..:.:==:=--:....::::==--::---=++.====--=---=:-:..:  ...            \\n          .....::::-::.:--::---====-------::.:::.---==--:.: ..-==--==-++====-::...::==----=::.:.::-==-::--=+=++++++======----: :. ....           \\n        ....-:=::::: --:==----=+==++=+==+=- --=.=+=.==X+=--:: -===+==+++X+-+==-::--==.++=-:::. ..:-==++===+++XX+++X====+===----:::::.:...:..     \\n       ....::---------==:++==+++++++++X+=++XX+=======+XX++ ===+==-++==++X XXX++==++++++++=--:.:.::-==XX++.XXXXXXXX++=++:XX++==--::+: :::.... .   \\n      .. .::---=========+X++XXX+XXXXXXX++:XXXX+=+=== =+X=X++X+-+.+++++XXXX++XXXX+++==++XX+==----- -=+XXXXXXXXXXXXX+++++X-XXX++=--------.:::......\\n\",\n  \"                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                                                                                                 \\n                                                                      .                                                                          \\n                                                                .    .                                                                           \\n                                                               :.    .:..                                                                        \\n                                                              .. .. ..::.                                                                        \\n                                                               . .....::        ..:.                                                             \\n                                                              .-:...-.:..   .  .. ..                                                             \\n                                            .                .:-=-::...   ...+.    :+..                                                          \\n                                            ...              .:-+=-::::.  ........:--..     ..-..                                                \\n                              .             .=-:....          .::==::::......-::::..-:.     .::...                                               \\n                            ....             ..::=.            .:-==:=:.......::---::-.    .:-::::.         ........                             \\n                           ........   .       ..=.:.           .=::==--:+......:-+.--::. .+. ..::-:.       .:-::::-:::.:.                        \\n                       .....:-:.::-.. .. ..   :. ..:..         .::--+=--:. ..  ..:=::=::.......::-:..   ..:-----:::-=-:.:.:.                     \\n             ......   .::::::::.::--......   .....:-:..       .::--=+=.=::....  ..:=::.:-..:....::--+....:-=+=--==-==-::::::...                  \\n            ....-:.....::::::::::--- :::::.=....::--==-:.. . ..:=--+====--::.......-+-:.::+..  ...:=-:..::-.=======+-==----:::...:  ..           \\n          ......::...:-::--::--------==-=-:::---=++==++=-::-..:--:-=:==++===-:..::::==- ::....   .--=+.---=+X===+==+==+= ----::........          \\n         ...=:::-::::--=-==-=+==--====+++-:===-=-==.++X+=----=---======+XXXX+=-:-===++==--::. .  .:--X+===.:XX+.+=+===+++====-::.::-:.+....      \\n        ...:::------+=-==+.++X+=++XXXXXX++=+X+===+=-==+XX++=+=++ =====+XXXXXX +===+==++X+==::....::-++X ++XXXXXXX+===-=++-+++=-=--=::::::=.-.... \\n        ...:-----=----==+X++XXXXXXXXXXX+XX+++++==+==-==+XX.+=++-=====+++XX:XXX-X+=+++=+XXX+=--======+++XXXXXXXXXX+===+++XX++++=+------::::=:.....\\n\"\n]\n"
  },
  {
    "path": "components/shared/effects/flame/hero-flame.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useRef, memo } from \"react\";\n\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./hero-flame-data.json\";\n\nfunction HeroFlame() {\n  const ref = useRef<HTMLDivElement>(null);\n  const ref2 = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        if (!ref.current || !ref2.current) return;\n        \n        index++;\n        if (index >= data.length) index = 0;\n\n        ref.current.innerHTML = data[index];\n        ref2.current.innerHTML = data[index];\n      },\n      interval: 85,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <div\n      className=\"cw-686 h-190 top-408 absolute flex gap-16 pointer-events-none select-none lg-max:hidden\"\n      ref={wrapperRef}\n    >\n      <div className=\"flex-1 overflow-clip relative\">\n        <div\n          className=\"text-black-alpha-20 font-ascii absolute bottom-0 -left-380 fc-decoration\"\n          dangerouslySetInnerHTML={{ __html: data[0] }}\n          ref={ref}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: \"9px\",\n            lineHeight: \"11px\",\n          }}\n        />\n      </div>\n\n      <div className=\"flex-1 overflow-clip relative\">\n        <div\n          className=\"text-black-alpha-20 font-ascii absolute bottom-0 -right-380 -scale-x-100 fc-decoration\"\n          dangerouslySetInnerHTML={{ __html: data[0] }}\n          ref={ref2}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: \"9px\",\n            lineHeight: \"11px\",\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n\nexport default memo(HeroFlame);\n"
  },
  {
    "path": "components/shared/effects/flame/index.ts",
    "content": "export { CoreFlame } from \"./core-flame\";\nexport { AsciiExplosion } from \"./ascii-explosion\";\nexport { default as HeroFlame } from \"./hero-flame\";\nexport { SubtleExplosion } from \"./subtle-explosion\";\n\n// Convenience wrapper for dashboard usage\nexport { FlameBackground } from \"./flame-background\";\n"
  },
  {
    "path": "components/shared/effects/flame/slate-grid/grid-data.json",
    "content": "[\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│    ░    │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│    ▒    │    ░    │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│    ▓    │    ▒    │    ░    │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ░    │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│    ▒    │    ▓    │    ▒    │    ░    │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▓    │    ▒    │    ░    │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ░    │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│    ░    │    ▒    │    ▓    │    ▒    │    ░    │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ▓    │    ▒    │    ░    │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▓    │    ▒    │    ░    │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ░    │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │    ░    │    ▒    │    ▓    │    ▒    │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │    ▒    │    ▓    │    ▒    │    ░    │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ▓    │    ▒    │    ░    │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▓    │    ▒    │    ░    │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │    ░    │    ▒    │    ▓    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │    ░    │    ▒    │    ▓    │    ▒    │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │    ▒    │    ▓    │    ▒    │    ░    │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ▒    │    ▓    │    ▒    │    ░    │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │    ░    │    ▒    │    ▓    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │    ░    │    ▒    │    ▓    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │    ░    │    ▒    │    ▓    │    ▒    │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│    ░    │    ▒    │    ▓    │    ▒    │    ░    │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │    ░    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │    ░    │    ▒    │    ▓    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │    ░    │    ▒    │    ▓    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │    ░    │    ▒    │    ▓    │    ▒    │    ░    │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │    ░    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │    ░    │    ▒    │    ▓    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │    ░    │    ▒    │    ▓    │    ▒    │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │    ░    │    ▒    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │    ░    │    ▒    │    ▓    │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │    ░    │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │    ░    │    ▒    │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │    ░    │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\",\n  \"┌─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n├─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤\\n│         │         │         │         │         │         │\\n└─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘\"\n]\n"
  },
  {
    "path": "components/shared/effects/flame/slate-grid/slate-grid.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./grid-data.json\";\n\ninterface SlateGridProps extends HTMLAttributes<HTMLDivElement> {\n  interval?: number;\n  color?: string;\n}\n\nexport function SlateGrid({\n  interval = 200,\n  color = \"text-black-alpha-12\",\n  className,\n  ...attrs\n}: SlateGridProps) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n  const frameIndex = useRef(0);\n\n  useEffect(() => {\n    const animate = () => {\n      if (ref.current) {\n        ref.current.innerHTML = data[frameIndex.current];\n        frameIndex.current = (frameIndex.current + 1) % data.length;\n      }\n    };\n\n    // Initialize first frame\n    animate();\n\n    const cleanup = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: animate,\n      interval,\n    });\n\n    return () => cleanup?.();\n  }, [interval]);\n\n  return (\n    <div\n      ref={wrapperRef}\n      {...attrs}\n      className={cn(\n        \"absolute inset-0 pointer-events-none select-none overflow-hidden\",\n        className,\n      )}\n    >\n      <div className=\"absolute inset-0 flex items-center justify-center\">\n        <div\n          ref={ref}\n          className={cn(\"font-mono fc-decoration\", color)}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: \"10px\",\n            lineHeight: \"12px\",\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/subtle-explosion.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./explosion-data.json\";\n\ninterface SubtleExplosionProps extends HTMLAttributes<HTMLDivElement> {\n  interval?: number;\n  delay?: number;\n  opacity?: number;\n}\n\nexport function SubtleExplosion({\n  interval = 80,\n  delay = 30,\n  opacity = 0.08,\n  className,\n  ...attrs\n}: SubtleExplosionProps) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = -delay;\n\n    const animate = () => {\n      index++;\n      if (index >= data.length) index = -delay;\n      if (index < 0) return;\n\n      if (ref.current) {\n        ref.current.innerHTML = data[index];\n      }\n    };\n\n    const cleanup = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: animate,\n      interval,\n    });\n\n    return () => cleanup?.();\n  }, [interval, delay]);\n\n  return (\n    <div\n      ref={wrapperRef}\n      {...attrs}\n      className={cn(\n        \"absolute inset-0 pointer-events-none select-none\",\n        className,\n      )}\n    >\n      <div\n        ref={ref}\n        className=\"text-black-alpha-20 font-mono absolute inset-0 flex items-center justify-center fc-decoration\"\n        dangerouslySetInnerHTML={{ __html: data[0] }}\n        style={{\n          whiteSpace: \"pre\",\n          fontSize: \"10px\",\n          lineHeight: \"12.5px\",\n          opacity,\n        }}\n      />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/subtle-wave/subtle-wave.tsx",
    "content": "\"use client\";\n\nimport React, { useEffect, useRef } from \"react\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\nimport data from \"./wave-data.json\";\n\nexport default function SubtleWave({ className = \"\" }: { className?: string }) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const frameIndex = useRef(0);\n\n  useEffect(() => {\n    const animateWave = () => {\n      if (containerRef.current) {\n        containerRef.current.innerHTML = data[frameIndex.current];\n        frameIndex.current = (frameIndex.current + 1) % data.length;\n      }\n    };\n\n    // Initialize first frame\n    animateWave();\n\n    // Start animation when visible\n    const cleanup = setIntervalOnVisible({\n      element: containerRef.current,\n      callback: animateWave,\n      interval: 150, // Slower for subtlety\n    });\n\n    return () => {\n      cleanup?.();\n    };\n  }, []);\n\n  return (\n    <div\n      ref={containerRef}\n      className={`font-mono text-white/10 whitespace-pre select-none fc-decoration ${className}`}\n      style={{\n        fontSize: \"10px\",\n        lineHeight: \"1\",\n        letterSpacing: \"0.05em\",\n      }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/shared/effects/flame/subtle-wave/wave-data.json",
    "content": "[\n  \"░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒\",\n  \"▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒\",\n  \"▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒\",\n  \"░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░\",\n  \"░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░\",\n  \"░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░\",\n  \"░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░\",\n  \"░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░\",\n  \"░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░\",\n  \"░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░\",\n  \"░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░\",\n  \"░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░\",\n  \"░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░\",\n  \"░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒░░▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░\",\n  \"░░░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░\"\n]\n"
  },
  {
    "path": "components/shared/effects/index.ts",
    "content": "// Effect Components\nexport { CoreFlame } from \"./flame/core-flame\";\nexport { AsciiExplosion } from \"./flame/ascii-explosion\";\n"
  },
  {
    "path": "components/shared/effects/subtle-ascii-animation.tsx",
    "content": "\"use client\";\n\nimport React, { useEffect, useRef, useMemo } from \"react\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nexport default function SubtleAsciiAnimation({\n  className = \"\",\n}: {\n  className?: string;\n}) {\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  // Simple ASCII pattern for subtle animation\n  const asciiFrames = useMemo(() => [\n    \"░░░░░░░░░░░░░░░░\",\n    \"▒░░░░░░░░░░░░░░░\",\n    \"▒▒░░░░░░░░░░░░░░\",\n    \"░▒▒░░░░░░░░░░░░░\",\n    \"░░▒▒░░░░░░░░░░░░\",\n    \"░░░▒▒░░░░░░░░░░░\",\n    \"░░░░▒▒░░░░░░░░░░\",\n    \"░░░░░▒▒░░░░░░░░░\",\n    \"░░░░░░▒▒░░░░░░░░\",\n    \"░░░░░░░▒▒░░░░░░░\",\n    \"░░░░░░░░▒▒░░░░░░\",\n    \"░░░░░░░░░▒▒░░░░░\",\n    \"░░░░░░░░░░▒▒░░░░\",\n    \"░░░░░░░░░░░▒▒░░░\",\n    \"░░░░░░░░░░░░▒▒░░\",\n    \"░░░░░░░░░░░░░▒▒░\",\n    \"░░░░░░░░░░░░░░▒▒\",\n    \"░░░░░░░░░░░░░░░▒\",\n  ], []);\n\n  useEffect(() => {\n    let frameIndex = 0;\n\n    const animateAscii = () => {\n      if (containerRef.current) {\n        containerRef.current.innerHTML = asciiFrames[frameIndex];\n        frameIndex = (frameIndex + 1) % asciiFrames.length;\n      }\n    };\n\n    // Initialize first frame\n    animateAscii();\n\n    // Start animation when visible\n    const cleanup = setIntervalOnVisible({\n      element: containerRef.current,\n      callback: animateAscii,\n      interval: 150, // Slightly slower for subtlety\n    });\n\n    return () => {\n      cleanup?.();\n    };\n  }, [asciiFrames]);\n\n  return (\n    <div\n      ref={containerRef}\n      className={`font-mono text-white/20 whitespace-pre select-none ${className}`}\n      style={{\n        fontSize: \"10px\",\n        lineHeight: \"1\",\n        letterSpacing: \"0.05em\",\n      }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/shared/firecrawl-icon/firecrawl-icon-static.tsx",
    "content": "import { HTMLAttributes } from \"react\";\n\nexport default function FirecrawlIconStatic({\n  fill = \"var(--heat-100)\",\n  className = \"\",\n  ...attrs\n}: HTMLAttributes<HTMLOrSVGElement> & { fill?: string }) {\n  return (\n    <svg\n      fill=\"none\"\n      viewBox=\"0 0 20 20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      className={className}\n      style={{ fill: fill }}\n      {...attrs}\n    >\n      <path\n        d=\"M13.7605 6.61389C13.138 6.79867 12.6687 7.21667 12.3251 7.67073C12.2513 7.76819 12.0975 7.69495 12.1268 7.57552C12.7848 4.86978 11.9155 2.6209 9.20582 1.51393C9.06836 1.4576 8.92527 1.58097 8.96132 1.72519C10.1939 6.67417 5.00941 6.25673 5.66459 11.8671C5.67585 11.9634 5.56769 12.0293 5.48882 11.973C5.2432 11.7967 4.96885 11.4288 4.78069 11.1702C4.72548 11.0942 4.60605 11.1156 4.5807 11.2063C4.43085 11.7482 4.35986 12.2586 4.35986 12.7656C4.35986 14.7373 5.37333 16.473 6.90734 17.4791C6.99522 17.5366 7.10789 17.4543 7.07804 17.3535C6.99917 17.0887 6.95466 16.8093 6.95128 16.5203C6.95128 16.3429 6.96255 16.1615 6.99015 15.9925C7.05438 15.5677 7.20197 15.1632 7.44985 14.7948C8.29995 13.5188 10.0041 12.2862 9.73199 10.6125C9.71453 10.5066 9.83959 10.4368 9.91846 10.5094C11.119 11.6063 11.3567 13.0817 11.1595 14.405C11.1426 14.5199 11.2868 14.5813 11.3595 14.4912C11.5432 14.2613 11.7674 14.0596 12.0113 13.9081C12.0722 13.8703 12.1533 13.8991 12.1764 13.9667C12.3121 14.3616 12.5138 14.7323 12.7042 15.1029C12.9318 15.5485 13.0529 16.0573 13.0338 16.5958C13.0242 16.8578 12.9808 17.1113 12.9082 17.3524C12.8772 17.4543 12.9887 17.5394 13.0783 17.4808C14.6134 16.4747 15.6275 14.739 15.6275 12.7662C15.6275 12.0806 15.5075 11.4085 15.2804 10.7787C14.8044 9.45766 13.5966 8.46561 13.9019 6.74403C13.9166 6.66178 13.8405 6.59023 13.7605 6.61389Z\"\n        fill=\"inherit\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/firecrawl-icon/firecrawl-icon.tsx",
    "content": "import { HTMLAttributes } from \"react\";\n\nexport default function FirecrawlIcon({\n  fill = \"var(--heat-100)\",\n  innerFillColor = \"var(--background-base)\",\n  ...attrs\n}: HTMLAttributes<HTMLOrSVGElement> & {\n  innerFillColor?: string;\n  fill?: string;\n}) {\n  return (\n    <svg\n      {...attrs}\n      height=\"600\"\n      preserveAspectRatio=\"xMidYMid meet\"\n      viewBox=\"0 0 600 600\"\n      width=\"600\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <g>\n        <g transform=\" translate(293.035, 553.013) scale(0.97724, 0.97724) translate(-533.035, -800.013)\">\n          <path\n            d=\" M603.36 416.33 C581,433 586.63,450.25 583.86,466.55 C583.19,470.47 577.75,469.25 576.54,465.71 C559.5,447 549.55,423.61 559.33,394.37 C577.25,340.75 614.25,311.25 594.16,288.45 C590.97,284.83 591.83,284.26 590.22,288.82 C572.5,339 363,338 427.98,536 C430.85,544.77 430.25,555.25 429.51,565.8 C429.28,568.95 427.08,571.32 424.17,570.12 C401.5,560.75 395.38,525.75 390.42,516.28 C389,513.58 387.5,514.5 385.67,517.95 C381.03,524.07 377.94,532.3 374.2,538.54 C336.92,600.69 343.58,664.33 368.03,714.96 C368.94,716.86 369.89,718.74 370.85,720.6 C371.93,722.68 373.05,724.75 374.19,726.79 C391.8,758.26 416.04,783.76 439.75,799.32 C442.6,801.19 446.26,798.52 445.29,795.24 C437.07,767.62 642.75,744.75 634.67,795.2 C634.12,798.62 637.29,801.28 640.2,799.38 C659.88,786.47 680.25,766.82 695.21,741.99 C696.41,740.01 697.57,737.99 698.7,735.93 C699.47,734.52 700.23,733.09 700.97,731.65 C711.2,711.65 717.8,688.75 718.09,663.65 C718.33,643.75 714.58,622.45 705.52,600.11 C703.78,595.83 700.25,616.5 684.38,613.26 C682.86,612.95 691.25,586.13 692.06,570.64 C692.44,563.26 690.67,544.7 683.23,524.06 C667.77,481.12 615.5,466.25 609.58,417.31 C609.25,414.61 605.53,414.71 603.36,416.33z \"\n            fill={fill}\n            fillOpacity=\"1\"\n            fillRule=\"nonzero\"\n          >\n            <animate\n              attributeName=\"d\"\n              attributeType=\"XML\"\n              begin=\"0s\"\n              calcMode=\"spline\"\n              dur=\"0.9333333s\"\n              fill=\"freeze\"\n              from=\"M603.36 416.33 C581,433 586.63,450.25 583.86,466.55 C583.19,470.47 577.75,469.25 576.54,465.71 C559.5,447 549.55,423.61 559.33,394.37 C577.25,340.75 614.25,311.25 594.16,288.45 C590.97,284.83 591.83,284.26 590.22,288.82 C572.5,339 363,338 427.98,536 C430.85,544.77 430.25,555.25 429.51,565.8 C429.28,568.95 427.08,571.32 424.17,570.12 C401.5,560.75 395.38,525.75 390.42,516.28 C389,513.58 387.5,514.5 385.67,517.95 C381.03,524.07 377.94,532.3 374.2,538.54 C336.92,600.69 343.58,664.33 368.03,714.96 C368.94,716.86 369.89,718.74 370.85,720.6 C371.93,722.68 373.05,724.75 374.19,726.79 C391.8,758.26 416.04,783.76 439.75,799.32 C442.6,801.19 446.26,798.52 445.29,795.24 C437.07,767.62 642.75,744.75 634.67,795.2 C634.12,798.62 637.29,801.28 640.2,799.38 C659.88,786.47 680.25,766.82 695.21,741.99 C696.41,740.01 697.57,737.99 698.7,735.93 C699.47,734.52 700.23,733.09 700.97,731.65 C711.2,711.65 717.8,688.75 718.09,663.65 C718.33,643.75 714.58,622.45 705.52,600.11 C703.78,595.83 700.25,616.5 684.38,613.26 C682.86,612.95 691.25,586.13 692.06,570.64 C692.44,563.26 690.67,544.7 683.23,524.06 C667.77,481.12 615.5,466.25 609.58,417.31 C609.25,414.61 605.53,414.71 603.36,416.33z \"\n              keySplines=\"0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.667 1;0.333 0 0.833 1;0.167 0 0.833 1;0.167 0 0.833 1;0.167 0 0.833 1\"\n              keyTimes=\"0;0.0714286;0.1428571;0.2142857;0.2857143;0.3571429;0.4285714;0.5;0.5714286;0.6428571;0.7142857;0.7857143;0.8571429;0.9285714;1\"\n              repeatCount=\"indefinite\"\n              to=\"M565.86 356.45 C565.86,356.45 575.61,343.8 575.61,343.8 C575.61,343.8 580.5,337.25 587.54,330.08 C590.75,325.75 598.25,315.51 601.2,307 C602.5,303.25 603.29,298.23 601.66,294.2 C599.75,289.5 597.81,292.24 596.09,293.82 C584.5,304.5 564.64,310.04 557.6,312.75 C534.25,321.75 520.74,324.12 503.38,333.43 C493,339 472.55,352.75 472.55,352.75 C472.55,352.75 456.17,365.53 456.17,365.53 C456.17,365.53 437.67,384.33 437.67,384.33 C437.67,384.33 422.5,403.75 417.94,425.86 C408.75,473.5 420,492 430.95,528.61 C434.5,547.5 436.13,555.3 430.81,558.78 C425.5,562.25 407.5,546.5 392.02,502.88 C281.5,654.5 410,785 439.75,799.32 C442.82,800.8 445.93,798.6 445.29,795.24 C438,757 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C677.68,770.21 748,703.5 705.8,598.01 C694,611.5 682.57,610.99 682.57,610.99 C682.57,610.99 691.19,577.81 691.51,565.5 C692.5,528 681.3,506.78 648.86,474.1 C615,440 598.75,433 601.52,410.11 C572.5,424 593,463 580.51,462.38 C574,461.25 570,458.51 566.68,453.64 C562.5,447.5 550.41,431.35 550.98,408.31 C551.25,397.25 556.58,375.81 556.58,375.81 C556.58,375.81 565.86,356.45 565.86,356.45z \"\n              values=\"M603.36 416.33 C581,433 586.63,450.25 583.86,466.55 C583.19,470.47 577.75,469.25 576.54,465.71 C559.5,447 549.55,423.61 559.33,394.37 C577.25,340.75 614.25,311.25 594.16,288.45 C590.97,284.83 591.83,284.26 590.22,288.82 C572.5,339 363,338 427.98,536 C430.85,544.77 430.25,555.25 429.51,565.8 C429.28,568.95 427.08,571.32 424.17,570.12 C401.5,560.75 395.38,525.75 390.42,516.28 C389,513.58 387.5,514.5 385.67,517.95 C381.03,524.07 377.94,532.3 374.2,538.54 C336.92,600.69 343.58,664.33 368.03,714.96 C368.94,716.86 369.89,718.74 370.85,720.6 C371.93,722.68 373.05,724.75 374.19,726.79 C391.8,758.26 416.04,783.76 439.75,799.32 C442.6,801.19 446.26,798.52 445.29,795.24 C437.07,767.62 642.75,744.75 634.67,795.2 C634.12,798.62 637.29,801.28 640.2,799.38 C659.88,786.47 680.25,766.82 695.21,741.99 C696.41,740.01 697.57,737.99 698.7,735.93 C699.47,734.52 700.23,733.09 700.97,731.65 C711.2,711.65 717.8,688.75 718.09,663.65 C718.33,643.75 714.58,622.45 705.52,600.11 C703.78,595.83 700.25,616.5 684.38,613.26 C682.86,612.95 691.25,586.13 692.06,570.64 C692.44,563.26 690.67,544.7 683.23,524.06 C667.77,481.12 615.5,466.25 609.58,417.31 C609.25,414.61 605.53,414.71 603.36,416.33z ;M582.73 405.08 C570.25,418.13 575,437 577.98,450.42 C578.84,454.3 571.63,453.38 568.42,449.83 C551.38,431.13 536.25,409.75 544.33,377.62 C558.11,322.79 604.5,314.5 595.78,294.58 C595.38,293.75 593.88,294.25 592.72,294.94 C558.5,313 366.25,321.5 431.98,502.5 C435.13,511.17 439.5,528.5 437.26,543.3 C436.78,546.42 434.27,548.22 431.42,546.87 C410.38,536.88 413.8,510.85 400.92,492.41 C399.5,490.38 397.88,491 396.17,494.08 C392.06,499.62 386.24,513.14 382.69,518.61 C332.18,596.46 339.54,665.51 366.08,717.22 C367.08,719.16 368.1,721.07 369.15,722.96 C370.32,725.08 371.53,727.17 372.76,729.22 C391.82,760.97 417.68,785.12 439.75,799.32 C442.62,801.17 446.26,798.52 445.29,795.24 C437.07,767.62 638,739 634.67,795.2 C634.46,798.66 637.29,801.28 640.2,799.38 C659.88,786.47 682.96,764.43 699.8,736.15 C701.14,733.89 702.45,731.59 703.71,729.25 C704.58,727.63 705.43,726 706.26,724.35 C717.69,701.53 724.73,675.29 723.11,646.94 C721.83,624.45 715.09,600.63 700.77,576.11 C698.44,572.12 690.5,601.5 674.63,598.26 C673.11,597.95 679.5,573.5 680.06,556.14 C680.3,548.75 678.25,525.75 670.23,504.81 C653.9,462.19 605.25,449.5 587.2,404.56 C586.19,402.04 584.61,403.12 582.73,405.08z ;M562.98 393.83 C560.5,408.88 562.5,413.38 565.48,426.8 C566.34,430.68 560.38,428.88 557.17,425.33 C540.13,406.63 520.67,386.78 529.58,354.87 C542.63,308.13 572.38,309.75 575.66,292.83 C575.38,292.5 574,292.25 572.97,292.44 C530,291.5 365,313.25 443.35,488.63 C447.11,497.05 446.75,508 444.51,522.8 C444.03,525.92 440.37,528.61 437.67,527 C423.25,518.38 433.5,500.5 411.54,477.28 C409.84,475.48 407.5,477.13 408.05,480.45 C407.25,500.38 387.01,525.07 383.19,530.36 C341.25,588.5 336.25,642.5 358.7,694.36 C359.63,696.51 366.06,707.03 366.06,707.03 C366.06,707.03 364.13,709.38 360.27,710.13 C378.94,751.48 410.94,782.59 439.75,799.32 C442.7,801.04 446.26,798.52 445.29,795.24 C437.07,767.62 634.5,733.25 634.67,795.2 C634.68,798.67 637.29,801.28 640.2,799.38 C659.88,786.47 685.43,763.31 704,732.51 C705.48,730.05 706.92,727.54 708.31,724.98 C709.27,723.21 710.2,721.43 711.11,719.62 C723.66,694.57 731.14,665.28 727.83,632.9 C725.21,607.22 715.81,579.6 696.77,550.61 C694.23,546.75 684,585.5 661.13,584.26 C659.58,584.17 663.5,558 664.06,540.64 C664.3,533.25 659.08,499.08 648.98,479.06 C628.25,438 593.25,437 567.45,393.31 C566.07,390.97 563.42,391.15 562.98,393.83z ;M547.73 383.58 C547.13,392.88 547.63,393.88 548.98,401.67 C549.66,405.59 547.38,403.38 544.17,399.83 C527.13,381.13 510.96,362.31 515.83,329.12 C520.5,297.25 537.25,291 545.66,280.33 C545.38,280 546,277.88 541.22,277.94 C496.5,283 389,309.5 448.23,456 C451.69,464.55 452.25,488.88 450.01,503.68 C449.53,506.8 446.25,514.5 442.92,513 C435.25,507.37 447,494.38 425.04,471.16 C423.34,469.36 422,470.13 421.55,474.33 C420.75,494.25 389.71,531.22 385.69,536.36 C343.5,590.25 339.75,621 356.7,677.36 C358.57,683.56 367.81,698.28 367.81,698.28 C367.81,698.28 361.25,698.75 353.27,695.63 C365.5,744 410,785 439.75,799.32 C442.82,800.8 446.26,798.52 445.29,795.24 C437.07,767.62 639,733.38 634.67,795.2 C634.43,798.66 637.2,801.14 640.2,799.38 C675.67,778.46 703.35,745.16 718.73,706.96 C719.96,703.9 721.11,700.81 722.18,697.7 C722.92,695.55 723.62,693.39 724.28,691.22 C733.41,661.16 735.03,628.83 727.11,597.57 C720.83,572.78 708.55,548.66 689.27,526.86 C686.67,523.92 678.5,574.75 648.13,570.26 C644.35,569.7 651,543 650.06,520.89 C649.48,507.26 641.58,484.83 631.48,464.81 C610.75,423.75 582,423.5 550.95,382.81 C549.3,380.65 547.91,380.87 547.73,383.58z ;M541.98 380.83 C541.98,380.83 540.36,379.55 540.36,379.55 C540.36,379.55 538.88,376.38 535.67,372.83 C518.63,354.13 509,354 500.45,322.12 C492.48,292.4 511.69,271.91 512.03,269.95 C512.38,268 511,266.38 507.72,267.19 C459.75,283.5 413.75,321.75 453.6,418.88 C463.21,442.29 459.88,472.38 456.76,484.31 C455.96,487.35 451.75,496.63 448.42,495.12 C443.38,491 450.13,480.25 436.79,464.91 C435.17,463.04 433.75,463.88 433.3,468.08 C429.25,501.13 395.63,524.75 385.94,536.86 C343.19,590.3 348.5,618.75 357.7,656.36 C360.72,668.7 375.31,688.53 375.31,688.53 C375.31,688.53 361.75,692 347.77,683.13 C357,742.25 410,785 439.75,799.32 C442.82,800.8 446.26,798.52 445.29,795.24 C437.07,767.62 642,732 634.67,795.2 C634.27,798.64 637.18,801.11 640.2,799.38 C677.06,778.26 706.14,743.68 721.68,703 C722.92,699.75 724.08,696.45 725.14,693.12 C725.88,690.83 726.57,688.52 727.22,686.19 C736.2,653.99 736.84,618.81 726.57,583.92 C718.42,556.26 703.42,528.77 680.27,503.11 C673.25,502.25 661.88,561.5 634.26,559.88 C627,554.5 636.25,519 630.43,494.14 C627.25,479.25 620.4,457.58 606.73,439.81 C579.75,404.75 577.5,410.63 542.58,374.93 C540.68,372.99 541.98,380.83 541.98,380.83z ;M545.36 362.95 C545.36,362.95 540.98,359.8 540.98,359.8 C540.98,359.8 538,357.38 535.29,355.33 C515.88,337.38 498.91,334.76 485.45,304.62 C478.25,288.5 481.19,270.16 481.53,268.2 C481.88,266.25 481.75,264 479.47,265.44 C453.25,285.5 426.75,302 462.6,394.88 C471.72,418.49 468.75,454.5 464.51,467.18 C463.51,470.17 460.38,483.25 457.05,481.75 C452,477.63 457.5,468 447.29,455.91 C445.7,454.01 444.25,454.88 443.8,459.08 C439.75,492.13 405.75,513 385.69,535.86 C356,564.75 351.5,600 362.95,642.61 C366.25,654.88 380.81,678.03 380.81,678.03 C380.81,678.03 359,677.75 345.02,668.88 C348.5,738.5 410,785 439.75,799.32 C442.82,800.8 446.26,798.52 445.29,795.24 C437.07,767.62 642,732 634.67,795.2 C634.27,798.64 637.18,801.11 640.2,799.38 C677.06,778.26 706.62,742.6 721.89,699.83 C723.11,696.41 724.24,692.94 725.27,689.44 C725.99,687.02 726.65,684.58 727.28,682.13 C735.88,648.12 735.61,610.55 723.35,572.72 C713.63,542.71 696.37,512.55 670.02,483.86 C663,483 649.75,552.25 624.01,545.88 C614,538 621.25,497.75 615.43,472.89 C612.25,458 604.16,433.8 592.23,414.81 C572.25,383 551.7,367.81 551.7,367.81 C551.7,367.81 545.36,362.95 545.36,362.95z ;M557.11 354.7 C557.11,354.7 550.61,350.05 550.61,350.05 C550.61,350.05 543.38,344.38 539.04,341.58 C515.5,326.5 500.73,324.64 477.45,301.25 C467.88,291.63 463.13,283.5 463.03,276.45 C463.01,274.47 463.13,272.25 460.84,273.69 C437.5,300.5 455.5,331.5 476.6,385.88 C485.76,409.47 479.25,434 475.01,446.68 C474.01,449.67 470.13,463.75 466.8,462.25 C463.5,460.63 464.88,453 461.67,448.41 C460.25,446.38 458.25,447.38 457.8,451.58 C446.5,485 423.75,494 403.69,516.86 C374,545.75 358.5,586.5 369.95,629.11 C373.25,641.38 387.81,664.53 387.81,664.53 C387.81,664.53 367.5,669.5 344.02,651.88 C343.5,735.5 410,785 439.75,799.32 C442.82,800.8 446.26,798.52 445.29,795.24 C437.07,767.62 644.75,739.75 634.67,795.2 C634.05,798.61 637.18,801.11 640.2,799.38 C677.06,778.26 706.14,746.35 720.47,705.46 C721.61,702.18 722.67,698.86 723.62,695.47 C724.28,693.14 724.89,690.78 725.45,688.39 C733.24,655.35 731.89,617.21 718.29,574.78 C707.5,541.13 689.01,504.77 661.27,466.11 C654.25,465.25 638.5,533.25 615.76,528.38 C605.75,520.5 617.62,483.53 615.93,462.39 C614.25,441.25 611.91,424.3 599.98,405.31 C580,373.5 568.58,363.31 568.58,363.31 C568.58,363.31 557.11,354.7 557.11,354.7z ;M574.61 354.2 C574.61,354.2 562.36,345.05 562.36,345.05 C562.36,345.05 548.38,336.13 544.04,333.33 C520.5,318.25 511.5,318.75 477.45,301.25 C465.38,295.04 459.48,294.19 457.41,287.45 C456.5,284.5 454.13,286.38 453.59,289.07 C450.25,315.63 464.25,314.25 485.35,368.63 C494.51,392.22 488.38,418 484.13,430.68 C483.13,433.67 480.13,444.13 477.8,443.87 C476.18,443.7 476,441.13 474.92,439.16 C473.73,436.98 472.25,438 470.8,442.08 C455,473.5 426.5,490.5 406.44,513.36 C382.25,536 369,587 378.45,617.11 C382.26,629.23 391.31,652.53 391.31,652.53 C391.31,652.53 370.75,655.25 347.27,637.63 C340.5,728 410,785 439.75,799.32 C442.82,800.8 446.26,798.52 445.29,795.24 C437.07,767.62 644.75,739.75 634.67,795.2 C634.05,798.61 637.18,801.11 640.2,799.38 C680.21,776.46 711.17,737.07 721.85,688.05 C722.7,684.13 723.43,680.15 724.02,676.11 C724.42,673.32 724.76,670.51 725.04,667.67 C728.85,628.37 719.95,584 693.36,537.6 C679.28,513.05 669.5,475 663.52,455.86 C652.5,455.25 624.25,514.25 614.26,511.13 C608.75,505.75 617.25,483 619.18,461.39 C621.07,440.27 619.09,435.02 612.98,412.56 C607.25,391.5 588.83,369.56 588.83,369.56 C588.83,369.56 574.61,354.2 574.61,354.2z ;M580.86 347.2 C580.86,347.2 562.86,333.05 562.86,333.05 C562.86,333.05 552.13,327.38 547.79,324.58 C526.75,314.25 516.5,310.25 501.2,304.25 C488.56,299.29 481.75,299 472.41,295.45 C469.52,294.36 468.39,294.74 468.59,297.07 C470.25,315.75 484.75,320.5 498.85,362 C506.99,385.96 497.39,410.64 492.13,422.93 C487.88,432.88 477.3,444 477.3,444 C477.3,444 469.67,452.03 469.67,452.03 C469.67,452.03 460.67,460.83 460.67,460.83 C460.67,460.83 441.75,478.25 421.69,501.11 C393.25,532.75 382.25,556.25 385.45,603.61 C386.75,618.09 393.81,640.53 393.81,640.53 C393.81,640.53 382,650.5 356.02,620.38 C339.5,721 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 644.75,739.75 634.67,795.2 C634.05,798.61 637.28,801.27 640.2,799.38 C678.81,774.42 708.74,733.06 718.24,684.31 C719,680.41 719.63,676.47 720.12,672.48 C720.46,669.73 720.73,666.96 720.94,664.17 C723.81,625.57 713.86,583.37 685.86,541.6 C670.1,518.09 669.75,481 672.52,458.11 C633.75,465.5 624,498 614.01,494.88 C608.5,489.5 617.25,483 619.18,461.39 C621.07,440.27 622.34,425.27 616.23,402.81 C610.5,381.75 595.08,362.06 595.08,362.06 C595.08,362.06 580.86,347.2 580.86,347.2z ;M590.36 344.7 C590.36,344.7 578.36,332.3 578.36,332.3 C578.36,332.3 565.13,322.38 560.79,319.58 C539.75,309.25 542.75,310.5 527.45,304.5 C514.81,299.54 501.5,297 492.16,293.45 C489.27,292.36 488.6,294.6 489.34,296.82 C495.5,315.25 498,307.5 508.35,346 C514.92,370.44 505.5,400.5 494.63,416.93 C488.66,425.95 479.8,437 479.8,437 C479.8,437 472.17,445.03 472.17,445.03 C472.17,445.03 463.17,453.83 463.17,453.83 C463.17,453.83 455.25,461.25 435.19,484.11 C406.75,515.75 391.5,563.5 393.45,594.11 C394.75,608.59 397.81,632.03 397.81,632.03 C397.81,632.03 391,637.5 365.02,607.38 C337.5,712.5 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 642.5,748.75 634.67,795.2 C634.09,798.62 637.28,801.27 640.2,799.38 C678.81,774.42 707.13,732.19 715,682.86 C715.63,678.91 716.12,674.92 716.49,670.89 C716.74,668.11 716.92,665.31 717.04,662.5 C718.69,623.52 707.63,581.22 679.36,540.1 C659,510.5 665,479.75 667.77,456.86 C623.25,461.75 618,492.75 608.01,489.63 C602.5,484.25 610.5,473.5 612.43,451.89 C614.32,430.77 619.09,414.27 612.98,391.81 C607.25,370.75 600.08,360.31 600.08,360.31 C600.08,360.31 590.36,344.7 590.36,344.7z ;M593.11 339.2 C593.11,339.2 586.11,329.3 586.11,329.3 C586.11,329.3 578.63,318.88 574.29,316.08 C566.75,310 559.25,304 546.95,298.5 C534.56,292.95 528,290.25 518.66,286.7 C515.77,285.61 515.1,287.85 515.84,290.07 C522,308.5 522.25,311.75 522.85,336.25 C523.47,361.55 505.28,395.26 492.13,409.93 C484,419 476.05,429.25 476.05,429.25 C476.05,429.25 469.92,435.53 469.92,435.53 C469.92,435.53 463.42,442.58 463.42,442.58 C463.42,442.58 457.25,450 438.94,473.36 C413.75,508.75 403.75,541.5 402.7,574.86 C402.25,592.75 402.31,623.53 402.31,623.53 C402.31,623.53 389.5,622.25 373.27,588.88 C334,703 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C675.65,771.79 704.13,729.69 712.87,681.09 C713.57,677.2 714.14,673.27 714.58,669.3 C714.89,666.57 715.13,663.82 715.3,661.05 C717.72,622.71 707.63,581.22 679.36,540.1 C659,510.5 654,473.25 656.77,450.36 C612.25,455.25 609.5,488.25 599.51,485.13 C594,479.75 601.5,460.5 603.43,438.89 C605.32,417.77 613.09,400.27 606.98,377.81 C601.25,356.75 599.58,352.81 599.58,352.81 C599.58,352.81 593.11,339.2 593.11,339.2z ;M599.11 344.7 C599.11,344.7 597.86,337.05 597.86,337.05 C597.86,337.05 593.75,324.75 589.79,318.33 C586,313 580.25,301.75 568.45,293.5 C557.33,285.72 553.25,282.25 543.91,278.7 C541.02,277.61 540.34,279.86 541.09,282.07 C544.75,292.75 544.25,298.25 543.1,315 C541.37,340.25 522.78,363.01 509.63,377.68 C501.5,386.75 489.3,397.25 489.3,397.25 C489.3,397.25 476.92,410.03 476.92,410.03 C476.92,410.03 465.42,421.08 465.42,421.08 C465.42,421.08 457.75,431.5 439.44,454.86 C414.25,490.25 409.75,526.5 408.7,559.86 C410.5,579 407.31,612.53 407.31,612.53 C407.31,612.53 393.75,606.5 377.52,573.13 C325,691 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C677.68,770.21 708.86,716.82 715.3,659.01 C710.75,660 705.82,660.49 705.82,660.49 C705.82,660.49 711.75,644.25 713.01,632 C717.04,592.95 704.25,557.63 674.36,522.6 C648.65,492.48 642.75,463.75 645.52,440.86 C601,445.75 601.25,486.75 591.26,483.63 C585.75,478.25 584.75,476 586.68,454.39 C588.57,433.27 596.97,411.23 599.23,388.06 C600.5,375 601.33,361.81 601.33,361.81 C601.33,361.81 599.11,344.7 599.11,344.7z ;M596.11 355.2 C596.11,355.2 597.86,337.05 597.86,337.05 C597.86,337.05 598,328.5 597.54,320.58 C596.25,312.75 594,304.5 590.2,297.75 C588.55,294.81 580.25,280 570.91,276.45 C568.02,275.36 566.74,277.26 567.09,279.57 C569,292.25 563,305.75 559.6,312.25 C547.88,334.68 525.69,350.44 510.88,363.43 C500.25,372.75 492.55,378 492.55,378 C492.55,378 476.92,390.53 476.92,390.53 C476.92,390.53 463.42,402.58 463.42,402.58 C463.42,402.58 443.5,422 429.44,446.36 C406.5,483 410.5,519 412.95,551.61 C414.75,570.75 422.63,594.3 417.31,597.78 C412,601.25 395.25,594.25 379.77,550.63 C311.5,678 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C677.68,770.21 720.25,709.25 712.8,641.76 C706.75,644.75 698.82,643.49 698.82,643.49 C698.82,643.49 708.69,613.31 709.01,601 C710,563.5 704.3,545.78 671.86,513.1 C638,479 631.75,453 634.52,430.11 C590.25,434.75 595.5,483.5 585.51,480.38 C580,475 573,469.5 574.93,447.89 C576.82,426.77 578.75,421 581.23,408.81 C583.84,395.95 589.83,378.81 589.83,378.81 C589.83,378.81 596.11,355.2 596.11,355.2z ;M580.11 364.95 C580.11,364.95 588.61,349.8 588.61,349.8 C588.61,349.8 595.25,336.5 598.04,328.33 C600,323.5 601.5,316 601.2,307 C601.09,303.63 601,285.75 591.66,282.2 C588.77,281.11 587.99,282.26 588.34,284.57 C590.25,297.25 566.78,312.16 560.6,316.5 C539.25,331.5 528.74,337.62 511.38,346.93 C501,352.5 492.8,359.25 492.8,359.25 C492.8,359.25 476.92,370.03 476.92,370.03 C476.92,370.03 459.42,384.58 459.42,384.58 C459.42,384.58 441,403.5 426.94,427.86 C404,464.5 411.5,504.5 422.45,541.11 C424.25,560.25 429.13,578.8 423.81,582.28 C418.5,585.75 399.75,572.25 384.27,528.63 C292.5,659 410,785 439.75,799.32 C442.82,800.8 445.62,798.64 445.29,795.24 C441.25,753.5 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C677.68,770.21 734,700.75 709.8,620.51 C700.5,628.5 690.57,625.99 690.57,625.99 C690.57,625.99 701.19,598.81 701.51,586.5 C702.5,549 695.3,527.28 662.86,494.6 C629,460.5 616.75,444 619.52,421.11 C576.75,431.25 597,475.5 584.51,474.88 C578,473.75 568.5,459.25 566.68,453.64 C563.86,444.93 563.57,440.07 564.98,417.06 C565.5,408.5 573.33,383.31 573.33,383.31 C573.33,383.31 580.11,364.95 580.11,364.95z ;M565.86 356.45 C565.86,356.45 575.61,343.8 575.61,343.8 C575.61,343.8 580.5,337.25 587.54,330.08 C590.75,325.75 598.25,315.51 601.2,307 C602.5,303.25 603.29,298.23 601.66,294.2 C599.75,289.5 597.81,292.24 596.09,293.82 C584.5,304.5 564.64,310.04 557.6,312.75 C534.25,321.75 520.74,324.12 503.38,333.43 C493,339 472.55,352.75 472.55,352.75 C472.55,352.75 456.17,365.53 456.17,365.53 C456.17,365.53 437.67,384.33 437.67,384.33 C437.67,384.33 422.5,403.75 417.94,425.86 C408.75,473.5 420,492 430.95,528.61 C434.5,547.5 436.13,555.3 430.81,558.78 C425.5,562.25 407.5,546.5 392.02,502.88 C281.5,654.5 410,785 439.75,799.32 C442.82,800.8 445.93,798.6 445.29,795.24 C438,757 639.75,751.5 634.67,795.2 C634.27,798.64 637.45,801.51 640.2,799.38 C677.68,770.21 748,703.5 705.8,598.01 C694,611.5 682.57,610.99 682.57,610.99 C682.57,610.99 691.19,577.81 691.51,565.5 C692.5,528 681.3,506.78 648.86,474.1 C615,440 598.75,433 601.52,410.11 C572.5,424 593,463 580.51,462.38 C574,461.25 570,458.51 566.68,453.64 C562.5,447.5 550.41,431.35 550.98,408.31 C551.25,397.25 556.58,375.81 556.58,375.81 C556.58,375.81 565.86,356.45 565.86,356.45z \"\n            />\n          </path>\n        </g>\n\n        <g transform=\" translate(300, 470.504) scale(0.9650799999999999, 0.9650799999999999) translate(-510.283, -685.815)\">\n          <path\n            d=\" M410.06 771.87 C412.91,773.74 416.57,771.07 415.6,767.79 C407.38,740.17 411.54,708.64 427.68,684.63 C455.29,643.16 510.65,603.1 501.81,548.71 C501.24,545.26 505.31,542.99 507.87,545.36 C546.86,581 554.59,628.95 548.18,671.96 C547.63,675.7 552.32,677.69 554.68,674.76 C560.64,667.29 567.92,660.74 575.85,655.81 C577.82,654.59 580.46,655.52 581.21,657.72 C594.24,695.64 617.69,725.57 604.98,767.75 C603.97,771.07 607.6,773.83 610.51,771.93 C610.51,771.93 610.51,827.25 610.51,827.25 C610.51,827.25 410.06,827.25 410.06,827.25 C410.06,827.25 410.06,771.87 410.06,771.87z \"\n            fill={innerFillColor}\n            fillOpacity=\"1\"\n            fillRule=\"nonzero\"\n          />\n        </g>\n      </g>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/BrandKit/BrandKit.tsx",
    "content": "\"use client\";\n\nimport copy from \"copy-to-clipboard\";\nimport { animate, cubicBezier } from \"motion\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport Link from \"next/link\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\n\nimport FirecrawlIcon from \"@/components/shared/firecrawl-icon/firecrawl-icon\";\nimport Logo from \"@/components/shared/header/_svg/Logo\";\nimport { useHeaderContext } from \"@/components/shared/header/HeaderContext\";\nimport { cn } from \"@/utils/cn\";\n\nimport Download from \"./_svg/Download\";\nimport Guidelines from \"./_svg/Guidelines\";\nimport Icon from \"./_svg/Icon\";\n\nexport default function HeaderBrandKit() {\n  const [open, setOpen] = useState(false);\n  const { dropdownContent, clearDropdown } = useHeaderContext();\n\n  useEffect(() => {\n    document.addEventListener(\"click\", () => {\n      setOpen(false);\n    });\n  }, [open]);\n\n  useEffect(() => {\n    if (dropdownContent) {\n      setOpen(false);\n    }\n  }, [dropdownContent]);\n\n  return (\n    <div className=\"relative\">\n      <Link\n        className=\"flex items-center gap-2 relative brand-kit-menu\"\n        href=\"/\"\n        onContextMenu={(e) => {\n          e.preventDefault();\n          setOpen(!open);\n\n          if (!open) {\n            clearDropdown(true);\n          }\n        }}\n      >\n        <FirecrawlIcon className=\"size-28 -top-2 relative\" />\n        <Logo />\n      </Link>\n\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        {open && <Menu setOpen={setOpen} />}\n      </AnimatePresence>\n    </div>\n  );\n}\n\nconst Menu = ({ setOpen }: { setOpen: (open: boolean) => void }) => {\n  const backgroundRef = useRef<HTMLDivElement>(null);\n\n  const timeoutRef = useRef<number | null>(null);\n\n  const onMouseEnter = useCallback((e: React.MouseEvent<HTMLButtonElement>) => {\n    if (timeoutRef.current) {\n      clearTimeout(timeoutRef.current);\n    }\n\n    const t = e.target as HTMLElement;\n\n    const target =\n      t instanceof HTMLButtonElement\n        ? t\n        : (t.closest(\"button\") as HTMLButtonElement);\n\n    if (backgroundRef.current) {\n      animate(backgroundRef.current, { scale: 0.98, opacity: 1 }).then(() => {\n        if (backgroundRef.current) {\n          animate(backgroundRef.current!, { scale: 1 });\n        }\n      });\n\n      animate(\n        backgroundRef.current,\n        {\n          y: target.offsetTop - 4,\n        },\n        {\n          ease: cubicBezier(0.1, 0.1, 0.25, 1),\n          duration: 0.2,\n        },\n      );\n    }\n  }, []);\n\n  const onMouseLeave = useCallback(() => {\n    if (timeoutRef.current) {\n      clearTimeout(timeoutRef.current);\n    }\n\n    timeoutRef.current = window.setTimeout(() => {\n      if (backgroundRef.current) {\n        animate(backgroundRef.current, { scale: 1, opacity: 0 });\n      }\n    }, 100);\n  }, []);\n\n  return (\n    <motion.div\n      animate={{ opacity: 1, y: 0, scale: 1, filter: \"blur(0px)\" }}\n      className=\"absolute w-220 whitespace-nowrap rounded-16 p-4 bg-white left-0 top-[calc(100%+8px)] z-[2000] border border-border-faint\"\n      exit={{ opacity: 0, y: 8, scale: 0.98, filter: \"blur(1px)\" }}\n      initial={{ opacity: 0, y: -6, filter: \"blur(1px)\" }}\n      style={{\n        boxShadow:\n          \"0px 12px 24px rgba(0, 0, 0, 0.08), 0px 4px 8px rgba(0, 0, 0, 0.04)\",\n      }}\n      transition={{\n        ease: cubicBezier(0.1, 0.1, 0.25, 1),\n        duration: 0.2,\n      }}\n    >\n      <div\n        className=\"absolute top-4 opacity-0 z-[2] pointer-events-none inset-x-4 bg-black-alpha-4 rounded-8 h-32\"\n        ref={backgroundRef}\n      />\n\n      <Button\n        onClick={() => {\n          window.open(\"/\", \"_blank\");\n          setOpen(false);\n        }}\n        onMouseEnter={onMouseEnter}\n        onMouseLeave={onMouseLeave}\n      >\n        <svg\n          className=\"w-16 h-16\"\n          fill=\"none\"\n          viewBox=\"0 0 16 16\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path\n            d=\"M12 4.5V12.5C12 13.0523 11.5523 13.5 11 13.5H4C3.44772 13.5 3 13.0523 3 12.5V4.5C3 3.94772 3.44772 3.5 4 3.5H7.5M10.5 2.5H13.5M13.5 2.5V5.5M13.5 2.5L8.5 7.5\"\n            stroke=\"currentColor\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeWidth=\"1.25\"\n          />\n        </svg>\n        Open in new tab\n      </Button>\n\n      <div className=\"px-8 py-4\">\n        <div className=\"h-1 w-full bg-black-alpha-5\" />\n      </div>\n\n      <Button\n        onClick={() => {\n          copy(`<svg fill=\"none\" height=\"20\" viewBox=\"0 0 20 20\" width=\"20\" xmlns=\"http://www.w3.org/2000/svg\">\n  <path\n    d=\"M13.7605 6.61389C13.138 6.79867 12.6687 7.21667 12.3251 7.67073C12.2513 7.76819 12.0975 7.69495 12.1268 7.57552C12.7848 4.86978 11.9155 2.6209 9.20582 1.51393C9.06836 1.4576 8.92527 1.58097 8.96132 1.72519C10.1939 6.67417 5.00941 6.25673 5.66459 11.8671C5.67585 11.9634 5.56769 12.0293 5.48882 11.973C5.2432 11.7967 4.96885 11.4288 4.78069 11.1702C4.72548 11.0942 4.60605 11.1156 4.5807 11.2063C4.43085 11.7482 4.35986 12.2586 4.35986 12.7656C4.35986 14.7373 5.37333 16.473 6.90734 17.4791C6.99522 17.5366 7.10789 17.4543 7.07804 17.3535C6.99917 17.0887 6.95466 16.8093 6.95128 16.5203C6.95128 16.3429 6.96255 16.1615 6.99015 15.9925C7.05438 15.5677 7.20197 15.1632 7.44985 14.7948C8.29995 13.5188 10.0041 12.2862 9.73199 10.6125C9.71453 10.5066 9.83959 10.4368 9.91846 10.5094C11.119 11.6063 11.3567 13.0817 11.1595 14.405C11.1426 14.5199 11.2868 14.5813 11.3595 14.4912C11.5432 14.2613 11.7674 14.0596 12.0113 13.9081C12.0722 13.8703 12.1533 13.8991 12.1764 13.9667C12.3121 14.3616 12.5138 14.7323 12.7042 15.1029C12.9318 15.5485 13.0529 16.0573 13.0338 16.5958C13.0242 16.8578 12.9808 17.1113 12.9082 17.3524C12.8772 17.4543 12.9887 17.5394 13.0783 17.4808C14.6134 16.4747 15.6275 14.739 15.6275 12.7662C15.6275 12.0806 15.5075 11.4085 15.2804 10.7787C14.8044 9.45766 13.5966 8.46561 13.9019 6.74403C13.9166 6.66178 13.8405 6.59023 13.7605 6.61389Z\"\n    fill=\"#262626\"\n  />\n</svg>`);\n\n          setOpen(false);\n        }}\n        onMouseEnter={onMouseEnter}\n        onMouseLeave={onMouseLeave}\n      >\n        <Icon />\n        Copy logo as SVG\n      </Button>\n\n      <Button\n        onClick={() => {\n          setOpen(false);\n        }}\n        onMouseEnter={onMouseEnter}\n        onMouseLeave={onMouseLeave}\n      >\n        <Download />\n        Download brand assets\n      </Button>\n\n      <div className=\"px-8 py-4\">\n        <div className=\"h-1 w-full bg-black-alpha-5\" />\n      </div>\n\n      <Button\n        onClick={() => {\n          setOpen(false);\n        }}\n        onMouseEnter={onMouseEnter}\n        onMouseLeave={onMouseLeave}\n      >\n        <Guidelines />\n        Visit brand guidelines\n      </Button>\n    </motion.div>\n  );\n};\n\nconst Button = (attributes: React.ButtonHTMLAttributes<HTMLButtonElement>) => {\n  return (\n    <button\n      {...attributes}\n      className={cn(\n        \"flex gap-8 w-full items-center text-label-small group text-accent-black p-6\",\n        attributes.className,\n      )}\n    >\n      {attributes.children}\n    </button>\n  );\n};\n"
  },
  {
    "path": "components/shared/header/BrandKit/_svg/Download.tsx",
    "content": "export default function Download() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        className=\"group-hover:stroke-heat-100 duration-[200ms] transition-all\"\n        d=\"M12.8334 10.8334L10.4715 13.1953C10.2111 13.4557 9.78904 13.4557 9.52869 13.1953L7.16675 10.8334M10.0001 3.83337V13.1667M14.8334 16.1667H5.16675\"\n        stroke=\"#262626\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/BrandKit/_svg/Guidelines.tsx",
    "content": "export default function Guidelines() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        className=\"group-hover:stroke-heat-100 duration-[200ms] transition-all\"\n        d=\"M10.0001 7.16663C10.0001 6.06206 10.8955 5.16663 12.0001 5.16663H15.8334C16.3857 5.16663 16.8334 5.61434 16.8334 6.16663V13.8333C16.8334 14.3856 16.3857 14.8333 15.8334 14.8333H12.1847C11.7311 14.8333 11.2865 14.9427 10.9006 15.1812C10.5148 15.4197 10.2029 15.7609 10.0001 16.1666M10.0001 7.16663C10.0001 6.06206 9.10465 5.16663 8.00008 5.16663H4.16675C3.61446 5.16663 3.16675 5.61434 3.16675 6.16663V13.8333C3.16675 14.3856 3.61446 14.8333 4.16675 14.8333H7.81541C8.26902 14.8333 8.71367 14.9427 9.09953 15.1812C9.48539 15.4197 9.79722 15.7609 10.0001 16.1666M10.0001 7.16663V16.1666\"\n        stroke=\"#262626\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/BrandKit/_svg/Icon.tsx",
    "content": "export default function Icon() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        className=\"group-hover:fill-heat-100 duration-[200ms] transition-all\"\n        d=\"M13.7605 6.61389C13.138 6.79867 12.6687 7.21667 12.3251 7.67073C12.2513 7.76819 12.0975 7.69495 12.1268 7.57552C12.7848 4.86978 11.9155 2.6209 9.20582 1.51393C9.06836 1.4576 8.92527 1.58097 8.96132 1.72519C10.1939 6.67417 5.00941 6.25673 5.66459 11.8671C5.67585 11.9634 5.56769 12.0293 5.48882 11.973C5.2432 11.7967 4.96885 11.4288 4.78069 11.1702C4.72548 11.0942 4.60605 11.1156 4.5807 11.2063C4.43085 11.7482 4.35986 12.2586 4.35986 12.7656C4.35986 14.7373 5.37333 16.473 6.90734 17.4791C6.99522 17.5366 7.10789 17.4543 7.07804 17.3535C6.99917 17.0887 6.95466 16.8093 6.95128 16.5203C6.95128 16.3429 6.96255 16.1615 6.99015 15.9925C7.05438 15.5677 7.20197 15.1632 7.44985 14.7948C8.29995 13.5188 10.0041 12.2862 9.73199 10.6125C9.71453 10.5066 9.83959 10.4368 9.91846 10.5094C11.119 11.6063 11.3567 13.0817 11.1595 14.405C11.1426 14.5199 11.2868 14.5813 11.3595 14.4912C11.5432 14.2613 11.7674 14.0596 12.0113 13.9081C12.0722 13.8703 12.1533 13.8991 12.1764 13.9667C12.3121 14.3616 12.5138 14.7323 12.7042 15.1029C12.9318 15.5485 13.0529 16.0573 13.0338 16.5958C13.0242 16.8578 12.9808 17.1113 12.9082 17.3524C12.8772 17.4543 12.9887 17.5394 13.0783 17.4808C14.6134 16.4747 15.6275 14.739 15.6275 12.7662C15.6275 12.0806 15.5075 11.4085 15.2804 10.7787C14.8044 9.45766 13.5966 8.46561 13.9019 6.74403C13.9166 6.66178 13.8405 6.59023 13.7605 6.61389Z\"\n        fill=\"#262626\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Content/Content.tsx",
    "content": "import CurvyRect from \"@/components/shared/layout/curvy-rect\";\nimport { cn } from \"@/utils/cn\";\nimport { ArrowUpRight } from \"lucide-react\";\n\ninterface Props {\n  navigationItems: {\n    label: string;\n    items: {\n      icon: React.ReactNode;\n      label: string;\n      description: string;\n      href: string;\n      target?: string;\n      big?: boolean;\n      ctas?: { label: string; href: string; target?: string }[];\n      sectionLabel?: string;\n      iconClassName?: string;\n    }[];\n  }[];\n  sideLabel: string;\n  sideContent: React.ReactNode;\n  sideItem: {\n    icon: React.ReactNode;\n    label: string;\n    description: string;\n    href: string;\n    target?: string;\n  };\n}\n\nexport default function HeaderDropdownContent({\n  navigationItems,\n  sideLabel,\n  sideContent,\n  sideItem,\n}: Props) {\n  return (\n    <div className=\"lg-max:max-w-[unset] container lg:flex gap-16\">\n      {navigationItems.map((item, index) => (\n        <div className=\"flex-1\" key={index}>\n          <GroupLabel label={item.label} />\n\n          {/* Default section (items without sectionLabel) */}\n          <div\n            className={cn(\n              \"grid gap-x-16\",\n              navigationItems.length === 1 && \"lg:grid-cols-2\",\n            )}\n          >\n            {item.items\n              .filter((it) => !it.sectionLabel && !it.big)\n              .map((it) => (\n                <Item item={it} key={it.label} />\n              ))}\n            {item.items\n              .filter((it) => !it.sectionLabel && it.big)\n              .map((it) => (\n                <ItemBig item={it} key={it.label} />\n              ))}\n          </div>\n\n          {/* Additional sections within the same column */}\n          {Array.from(\n            new Set(\n              item.items\n                .map((it) => it.sectionLabel)\n                .filter(Boolean) as string[],\n            ),\n          ).map((section) => (\n            <div key={section}>\n              {/* <GroupLabel label={section} /> */}\n              <div\n                className={cn(\n                  \"grid gap-x-16\",\n                  navigationItems.length === 1 && \"lg:grid-cols-2\",\n                )}\n              >\n                {item.items\n                  .filter((it) => it.sectionLabel === section && !it.big)\n                  .map((it) => (\n                    <Item item={it} key={it.label} />\n                  ))}\n                {item.items\n                  .filter((it) => it.sectionLabel === section && it.big)\n                  .map((it) => (\n                    <ItemBig item={it} key={it.label} />\n                  ))}\n              </div>\n            </div>\n          ))}\n\n          <div className=\"h-42 border-t border-border-faint border-x -mt-1 relative lg-max:hidden\">\n            <CurvyRect\n              className=\"-top-1 absolute -left-1 w-[calc(100%+2px)]\"\n              top\n            />\n            <CurvyRect\n              className=\"bottom-full absolute -left-1 w-[calc(100%+2px)]\"\n              bottom\n            />\n          </div>\n        </div>\n      ))}\n\n      <div className=\"flex-1 max-w-360 relative\">\n        <div className=\"h-full w-1 absolute top-0 left-0 bg-border-faint\" />\n        <GroupLabel label={sideLabel} />\n\n        <div className=\"hidden lg:contents\">{sideContent}</div>\n\n        <Item item={sideItem} />\n\n        <div className=\"h-42 border-t border-border-faint border-r -mt-1 relative lg-max:hidden\">\n          <CurvyRect\n            className=\"-top-1 absolute left-0 w-[calc(100%+1px)]\"\n            top\n          />\n          <CurvyRect\n            className=\"bottom-full absolute left-0 w-[calc(100%+1px)]\"\n            bottom\n          />\n        </div>\n      </div>\n    </div>\n  );\n}\n\nconst GroupLabel = ({ label }: { label: string }) => {\n  return (\n    <div className=\"text-body-medium py-16 lg:py-20 lg:border-x border-b border-border-faint px-24 lg:px-44 text-black-alpha-64\">\n      {label}\n    </div>\n  );\n};\n\nconst Item = ({\n  item,\n}: {\n  item: {\n    icon: React.ReactNode;\n    label: string;\n    description: string;\n    href: string;\n    target?: string;\n    iconClassName?: string;\n  };\n}) => {\n  return (\n    <a\n      className=\"flex items-start gap-16 py-16 pl-24 lg-max:[&_svg]:size-24 lg:pl-44 group border-x hover:bg-black-alpha-2 border-b border-border-faint transition-all hover:text-heat-100\"\n      href={item.href}\n      key={item.label}\n      target={item.target}\n    >\n      <div className={item.iconClassName}>{item.icon}</div>\n\n      <div className=\"min-w-0 flex-1\">\n        <div className=\"text-label-medium\">{item.label}</div>\n\n        <div className=\"text-body-medium mt-4 text-black-alpha-64 lg-max:hidden\">\n          {item.description}\n        </div>\n      </div>\n    </a>\n  );\n};\n\nconst ItemBig = ({\n  item,\n}: {\n  item: {\n    icon: React.ReactNode;\n    label: string;\n    description: string;\n    href: string;\n    target?: string;\n    ctas?: { label: string; href: string; target?: string }[];\n    iconClassName?: string;\n  };\n}) => {\n  return (\n    <div\n      className=\"flex items-start gap-16 py-22 pl-24 lg-max:[&_svg]:size-24 lg:pl-44 group border-x border-b transition-colors border-border-faint\"\n      key={item.label}\n    >\n      <div className={item.iconClassName}>{item.icon}</div>\n\n      <div className=\"min-w-0 flex-1\">\n        <a\n          href={item.href}\n          target={item.target}\n          className=\"text-label-medium inline-block hover:text-heat-100 transition-colors\"\n        >\n          {item.label}\n        </a>\n\n        <div className=\"text-body-medium mt-4 text-black-alpha-64 lg-max:hidden\">\n          {item.description}\n        </div>\n\n        {item.ctas && item.ctas.length > 0 && (\n          <div className=\"mt-12 flex items-center gap-8 lg-max:hidden\">\n            {item.ctas.map((cta) => (\n              <a\n                key={cta.label}\n                href={cta.href}\n                target={cta.target}\n                className=\"inline-flex items-center gap-6 px-12 py-6 rounded-6 text-label-small text-heat-100 bg-heat-4 hover:bg-heat-8 transition-colors whitespace-nowrap shrink-0\"\n              >\n                <span>{cta.label}</span>\n                <ArrowUpRight className=\"size-14\" aria-hidden=\"true\" />\n              </a>\n            ))}\n          </div>\n        )}\n      </div>\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/shared/header/Dropdown/Content/NavItemRow.tsx",
    "content": "import { ArrowUpRight } from \"lucide-react\";\nimport { cn } from \"@/utils/cn\";\n\nexport interface NavItemRowProps {\n  icon: React.ReactNode;\n  label: string;\n  description: string;\n  href: string;\n  target?: string;\n  iconClassName?: string;\n  className?: string;\n}\n\nexport function NavItemRow({\n  icon,\n  label,\n  description,\n  href,\n  target,\n  iconClassName,\n  className,\n}: NavItemRowProps) {\n  return (\n    <a\n      className={cn(\n        \"flex items-start gap-16 py-16 pl-24 lg-max:[&_svg]:size-24 lg:pl-44 group border-x hover:bg-black-alpha-2 border-b border-border-faint transition-all hover:text-heat-100\",\n        className,\n      )}\n      href={href}\n      target={target}\n    >\n      <div className={iconClassName}>{icon}</div>\n\n      <div className=\"min-w-0 flex-1\">\n        <div className=\"text-label-medium\">{label}</div>\n\n        <div className=\"text-body-medium mt-4 text-black-alpha-64 lg-max:hidden\">\n          {description}\n        </div>\n      </div>\n    </a>\n  );\n}\n\nexport interface NavItemRowBigProps extends Omit<NavItemRowProps, \"target\"> {\n  ctas?: { label: string; href: string; target?: string }[];\n}\n\nexport function NavItemRowBig({\n  icon,\n  label,\n  description,\n  href,\n  iconClassName,\n  ctas,\n}: NavItemRowBigProps) {\n  return (\n    <div className=\"flex items-start gap-16 py-22 pl-24 lg-max:[&_svg]:size-24 lg:pl-44 group border-x border-b transition-colors border-border-faint\">\n      <div className={iconClassName}>{icon}</div>\n\n      <div className=\"min-w-0 flex-1\">\n        <a\n          href={href}\n          className=\"text-label-medium inline-block hover:text-heat-100 transition-colors\"\n        >\n          {label}\n        </a>\n\n        <div className=\"text-body-medium mt-4 text-black-alpha-64 lg-max:hidden\">\n          {description}\n        </div>\n\n        {ctas && ctas.length > 0 && (\n          <div className=\"mt-12 flex items-center gap-8 lg-max:hidden\">\n            {ctas.map((cta) => (\n              <a\n                key={cta.label}\n                href={cta.href}\n                target={cta.target}\n                className=\"inline-flex items-center gap-6 px-12 py-6 rounded-6 text-label-small text-heat-100 bg-heat-4 hover:bg-heat-8 transition-colors whitespace-nowrap shrink-0\"\n              >\n                <span>{cta.label}</span>\n                <ArrowUpRight className=\"size-14\" aria-hidden=\"true\" />\n              </a>\n            ))}\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Github/Flame/Flame.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nimport data from \"./data.json\";\n\nexport default function GithubFlame(attrs: HTMLAttributes<HTMLDivElement>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = 0;\n\n        const newStr = data[index];\n\n        if (!ref.current) return;\n\n        ref.current!.innerHTML = newStr;\n      },\n      interval: 60,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <div\n      className=\"absolute -top-20 left-180 w-194 h-192\"\n      style={{\n        maskImage: \"url('/assets-original/github-mask.png')\",\n        maskSize: \"100% 100%\",\n      }}\n    >\n      <div\n        ref={wrapperRef}\n        {...attrs}\n        className={cn(\n          \"w-308 h-380 -top-20 -left-40 absolute pointer-events-none select-none\",\n          attrs.className,\n        )}\n      >\n        <div\n          className=\"text-black-alpha-20 relative top-0 left-0 font-ascii fc-decoration\"\n          ref={ref}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: 8,\n            lineHeight: \"10px\",\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Github/Flame/data.json",
    "content": "[\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                           ''.-_,.''                            \\n                          '.:;==+^_.'                           \\n                           '-\\\";+;:,'                            \\n                              '''''                             \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                             '''                                \\n                           '-:\\\"\\\":,.'                            \\n                           .:;+++;^:-'                          \\n                          '-\\\"+===+;\\\"-'                          \\n                          ',^+==++;:.'                          \\n                           ',\\\"^^\\\":,.'                           \\n                             '''''                              \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                            .::,''                              \\n                          '-\\\";;^\\\"\\\":,'                           \\n                         '.:\\\";++;;;\\\"_-''                        \\n                          .:;+===++;\\\",'                         \\n                          '_;+====+;:,''                        \\n                          '_;++=++;\\\",.'                         \\n                          '-\\\"^^^\\\":_.''                          \\n                           '.--.'''                             \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                           '-::,'                               \\n                          ':;+;^^\\\",.'                           \\n                         .:\\\";+++;;^\\\":.                          \\n                        '-\\\"^;+====+;\\\":-'''                      \\n                        '-::;=====++;^:-''                      \\n                         ',\\\"+======+^:,-'                       \\n                         '-:;+=====;\\\",.''                       \\n                          ._^;++=+;\\\"-''                         \\n                          '-::::,.'''                           \\n                          ''-..''                               \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                           '-_:_'                               \\n                         -^;++++;;;.                            \\n                        .\\\"+======+^:,_'                         \\n                       .\\\";;+=====+;:__-                         \\n                        -:_^+=====+;\\\"::,'''                     \\n                        .-.\\\"+=======+^:__-.'                    \\n                        '.._\\\"+======+\\\",-.''                     \\n                         '..,;======;_''''                      \\n                         '.._;+===++:.'                         \\n                          '',::^\\\":.'''                          \\n                          '''..''                               \\n                           '''                                  \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                           -\\\"^++\\\".                              \\n                       ';++=====+;^:-                           \\n                      '\\\"+========+;;^'                          \\n                      -;;;;++====+;\\\",,,.                        \\n                     ':,__:;;;+===+^___-.                       \\n                      '...-^;++++==+;::^:,'                     \\n                        ''--,\\\"++=====;\\\"_,,-''                   \\n                         ''''_+++===++;-.,_-'                   \\n                         '''.\\\";;+;^\\\"^_-'''''                    \\n                          ''._;\\\"\\\":_--'                          \\n                           ''._:_-'  '                          \\n                           '''''''                              \\n                           '''                                  \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                            '-_,-'                              \\n                        '':^+=====^'                            \\n                     ':++========+;.                            \\n                    ^+============+^;;-                         \\n                    ,;;;;;+++====+^\\\";^:                         \\n                    ';;^\\\":\\\";++++++;;:::_'                       \\n                    ,,:_-,,\\\";^\\\"^;+=+;:::_-'                     \\n                     '-.'''..,--,:,-_:;;+;^_                    \\n                         ''''--.-..'._:\\\";\\\"_.'                   \\n                          '''..-,_-''.''..-.''                  \\n                           ''.-:,:_'''''''..'                   \\n                          ' ''.,_,-''                           \\n                            '''--.'                             \\n                              '..'                              \\n                               '                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                           '^+++\\\"::-                            \\n                      ''':^;+=======^                           \\n                    '++=============+                           \\n                  -;;++===+======++^:                           \\n                 .++++++++;;+++++++^\\\"\\\"\\\",                        \\n                 '_\\\";;;;++;;^;;^;++;;;;;.                       \\n                   ';;:_,_\\\"^\\\"_,_^++;;;;^:-                      \\n                    \\\"\\\":,--:+;_-,,---,__\\\"^::.'                   \\n                   '.-,.''..-.''''''''.-\\\";++^.                  \\n                       ''''-----,.'''''',:\\\"\\\"^,                  \\n                           '',--,-.'''''.-_,''                  \\n                              ''-.''''''''''  '                 \\n                              ''-.'''     ''                    \\n                              '.,'                              \\n                             '.--'                              \\n                             '''''                              \\n                                '                               \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                             ''''                               \\n                          '\\\"+====^;+\\\"-                          \\n                     ''-+=============+'                        \\n                   :+==========+=+====+-                        \\n                  '+========++++++++==+                         \\n                :^+++==++;;+;;+=====+;-                         \\n               '++++++++;^\\\"\\\"\\\";++;+;\\\"\\\"^\\\":-                       \\n                -^;;;;++;\\\"__:\\\";;^;;\\\":\\\";++:                      \\n                 '.\\\"^;^:::\\\"\\\"::\\\":::\\\"\\\":::\\\";+:.                    \\n                   .:\\\":_,,__:,--''--,___::;;:'                  \\n                    -_,,-,,__--.'''''..._:;++;-                 \\n                      ''-::::_::--....''-,:\\\"^;\\\"                 \\n                        '''':^\\\":__----...-,::^-                 \\n                            '''''--'''''.'-:-'                  \\n                               '.'      '''                     \\n                              '.-'                              \\n                             '.-''                              \\n                            '..-.'                              \\n                             '..''                              \\n                                ''                              \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                             '-:_'                              \\n                       '.' -;+++++:-\\\":'                         \\n                     ,+===++==++++=====+-                       \\n                  .:^+=========;+===+===='                      \\n                ';+=========++++;;++++==+-                      \\n                .;====++++++;;;;;+++++++.                       \\n              '-:;==++;^;;;;^;;+++==++=+                        \\n             '+++++++;;;;^^\\\"^^^^^;++^\\\"^^_''                     \\n              ,:;+;;;+;;\\\"_:::::\\\"\\\"::__::^;;+:                    \\n                .,:\\\"^;;^:,::_:,,_:\\\":_,__\\\"\\\";;-                   \\n                  ,:\\\"\\\":_,___,-...---_,,___::;\\\"'                 \\n                   .::_,,::::_-..,-.--,__,:^;+;'                \\n                     ''.,:\\\"\\\"\\\";:-,,---...,:^\\\";;;:'               \\n                         '-'\\\"^_\\\":_::_-----,,:\\\"^:                \\n                            ''''.....''.--,,-_:                 \\n                               '''      '-_-                    \\n                             '''''                              \\n                            '.-''                               \\n                           '.---.'                              \\n                             '---'                              \\n                             ''..'                              \\n                                '                               \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                              '-,.'                             \\n                     '..'  ':++++++_                            \\n                   '+====+;+++++;+;+;;;^'                       \\n                   +=====++=++=+;;++;+===+_                     \\n                '\\\";=======++++++;;++=++===+'                    \\n               ,++=======++++;;;;;;+++++=+:                     \\n              '++==++++++++;;^;;;;+++++++^-                     \\n              '\\\"==+++;;;;^^\\\":::^;+++;;++;'                      \\n            -;;+++;;;^^^\\\":::::\\\"^+++++\\\"^\\\"::-,.'                  \\n            _++;;;^;;;;;\\\"::_:\\\"\\\"\\\"::_:\\\":___:\\\"^;^                  \\n             -.,\\\"^^^^^\\\"::___::::__,--,,:::\\\"^\\\":'                 \\n                .-:\\\";\\\"::::_:::__,-,_,,-----_:_,                 \\n                 .:\\\"^\\\"::_::::::::,,--,,,---,:^^-                \\n                   .,_::__,_\\\"\\\":\\\"^:--_,,,,_:\\\"^;;^'               \\n                       '--.-,_\\\"\\\"::__,_,,-,::\\\"\\\"\\\"\\\",               \\n                            '''------,___,-,:_\\\"\\\"'               \\n                               ''    ''',,.''.'                 \\n                             '''                                \\n                            .--''                               \\n                           '..--'                               \\n                            '.--'                               \\n                             .---.                              \\n                             ''..'                              \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                               ''                               \\n                    '''    '-;;++;;\\\"'                           \\n                  .^+++++::;;;;;;;;;+^.'                        \\n                ';======++++++;+;;;;;;;^\\\"'                      \\n                .+====+++++++++++;;;^;;++=+\\\"'                   \\n               -:+==++=+==+++;;;;^;;++++===+:                   \\n              ,;+====+++++++;;;;;;;;++++++++,                   \\n             ,+++++++++;++++;;;;;;;;++++;;\\\"'                    \\n             :+==++;;+;;;;^^^\\\"^;;;;;;;;;;^:                     \\n            ':+++;;;;;;^^\\\"\\\"::_::\\\";;;^,:_,-_,:,-'                \\n           -;;;;;^^^;^\\\"\\\"\\\"::::___::^^:,,----,:^\\\":'               \\n           ';;^:::::\\\"\\\":::::::::_,,_::-,,__:\\\"\\\"::-'               \\n            '''-_:\\\"\\\"\\\"^\\\"::\\\"::__:::_-,,,,:----_:,'                \\n               '.-:\\\"^^^^\\\":::_:\\\":\\\":___,_:_-,-,:_.                \\n                 ._:^\\\"\\\"\\\":,,__::::____-----_:_:^_                \\n                    '''''.-.-::_,,--,---_::\\\"\\\"^^\\\"'               \\n                          ' ''---..-:::,____,,,_-               \\n                              ''    '''''.'.--,-                \\n                             ''                                 \\n                           '.-.'                                \\n                           ''.-'                                \\n                            '..''                               \\n                            '.-..'                              \\n                             ...-'                              \\n                             '''''                              \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                            .^^^;\\\".''                           \\n                 '_^;^-''',:^;;;+;;;;;,                         \\n               '\\\"+==++++++;;^\\\"\\\"^;;;;;;;\\\".                       \\n              '+======+++++;;;;^;^\\\"^;^^;^_'                     \\n              \\\"+++===++++++++++;++\\\"\\\"^;^;;;++\\\"                   \\n              -\\\"+++++++++=++++;;;;;;^;++++++++:                 \\n             :;+===++++++++++;;;;;;;;;+++++++\\\"'                 \\n            .^+++++++;;+++;;^;;^;;;;;;++;;;;^.                  \\n            _+++++;;+;;;;;;;;^^^^^;;;;;;^:,.                    \\n            _++++;;;;;;;^^^\\\"\\\"::::\\\"\\\"::\\\"\\\"::,..-,,''               \\n            ,++;;^^^^^\\\":::::______:_-------..-:::-              \\n           -^;;^::::::::\\\"\\\"\\\":_______,,---__,-_:::__'             \\n            :^:,,_::::\\\"\\\"^^^:_:::__,__,,-,,__:__.''              \\n               '.,::\\\"\\\"^^\\\"::_::\\\":::__,::_,_:_,,-'                \\n                '',:\\\"^^^:.--,::_____,,,__,_,,__-                \\n                 ''-,-.'''''',-----__,,____,_::-                \\n                             ''''''__---_,__:::-                \\n                                   '''''''.-..-.                \\n                            '''            ''''                 \\n                           ''''                                 \\n                            ''''                                \\n                            '''''                               \\n                           '''''''                              \\n                            ''''''                              \\n                             '''''                              \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                            .--.--'                             \\n                 ''''     ',\\\"^^;;;;:,-'                         \\n               ,;++;;\\\"\\\"..__\\\"\\\"\\\"\\\"^;;;^^^;\\\"'                       \\n              :+===++;;;;;;;\\\"\\\"\\\":::\\\"^^;^\\\"\\\"_'                     \\n            ';+====+++;;;++;;;^:::\\\"\\\"^^^^^\\\":'                    \\n            :++++++++++;;++++++^\\\";;\\\"^^^;;\\\"^;;\\\"'                 \\n            .;;+++++;;++++++;;;;;^^^^^^;;;;+++\\\"'                \\n            ,\\\"+++=+++;;++++;;;;;;;;;\\\"\\\"^;++;+++;;'               \\n            :;+++=++;;;;++;;;;^^;;;;;^;;;;;;;;-'                \\n           -^;++;;+;;^^;;^^\\\"^^^^^;;;;;;;^\\\"::_-                  \\n           '^+++;;;;;;;^^^\\\"^;\\\"\\\":\\\":::\\\"::,--'''''''               \\n            :++;^\\\"^^^\\\"\\\"\\\"\\\"\\\":::,,-,_,,------.'''.---.             \\n            _;^\\\"::__:::::\\\"::,,,--------''------,,_,             \\n           ':\\\"\\\":__,,:::\\\"::___:_,------..-,__,-,,,,-'            \\n            '--..-_:::\\\"\\\":---_:::,-,_:,----,,--.''               \\n                ''-_:\\\"\\\"\\\"_''.__::,,,,,,,--.-.---'                \\n                  '-_\\\"_.    '''''-_,---,-..--,,-                \\n                                 '--.'..----,,-'                \\n                                  '''''''''....'                \\n                                          '''''                 \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                          '_:::\\\"^^\\\"_                            \\n               '._-''     -\\\"\\\"\\\"\\\"\\\"^;;;:_-'                        \\n            '\\\"++;;^^\\\"\\\"\\\":_:\\\"^\\\"\\\"\\\":\\\"\\\"\\\"^^\\\"\\\"^:.                      \\n            -+===++;;;;;;;;^\\\"::::_:\\\"\\\"\\\"\\\"\\\"::-'                    \\n           ,+=====++;;;;;+;;^^::_:\\\"\\\"\\\"\\\"\\\"\\\"^^\\\":'                   \\n          '++==++=++;;;;+++;++;^_::::\\\"^^^^\\\":\\\":,-                \\n           \\\"++++++;;;;;++++;;;;;:\\\"\\\":\\\"\\\"\\\"^^^^\\\";++\\\"                \\n           ':++==+;;;;;++++;;;;;;\\\"\\\"^\\\"::^;+;^\\\";++_               \\n           _^++++=+;;;;++++;;;^^^^^^\\\"::\\\";;;;;;\\\"\\\"\\\"-              \\n           -^+++++++;;^;+;;^^;^\\\"^^^^;^^^\\\"\\\":\\\"\\\":.'                \\n           _;++;;;;;;;^^^\\\"\\\"\\\"\\\"\\\"^\\\"^^\\\"\\\"^^^\\\":_,-.''                 \\n           ':++;;^\\\"\\\"^^\\\"\\\"::_______,---,,.'''..'''''              \\n            .;;\\\"::::__:___,-,,--......''''...-.''''.            \\n            '-___----_:::_-,_-,-..-....''.-......-.'            \\n            '.__---,::::::,,_,-------.......''''.-.'            \\n               '..-,_::::-'-__-.--,-...'''..'..'                \\n                  '.--_:'  '.'''.--''''''''''..'                \\n                                 '--.'''''''..''                \\n                                   ''   ''''.''                 \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                                                                \\n                            ''''''''                            \\n                          ._::_:\\\"^^^,                           \\n            '...__.'     ',_\\\":::\\\"\\\"^^^:,'                        \\n          '_+++;;;\\\"::__::\\\"^\\\"\\\"::____:\\\"\\\":::_'                     \\n          -;==++;;;;;;^;;^^^\\\"\\\":_,,_:::::,_,.                    \\n          .;+=+++;;;^;^;;^^^:::_,_::::::::\\\":-                   \\n         ^+++=++=+;^^^^^++;^;;^\\\",---:\\\"\\\"\\\"^\\\"\\\":_.' '               \\n         :;;++++;;;;^\\\"\\\"^;+;^;^^\\\":_,,,::\\\"\\\":__,:\\\"^:'              \\n          -\\\"+++++;;;^\\\":\\\";;;^;;^;^::_:::\\\"^\\\"\\\"^-,\\\"^^'              \\n           -;+;++++;^^;;;;;;;;^;^\\\":::.-\\\"^^\\\"\\\"_:^^^:              \\n          -:;+;;;;;;^^^;;+;;\\\"^\\\"::::\\\":,-_\\\"^^^:\\\"_-,-'             \\n          '_^;;;;;;;;\\\"\\\"^;;;^\\\"\\\"\\\":::\\\"\\\"\\\"\\\"::::____'                 \\n           ,;;;;;\\\"::^^^\\\"\\\":_:_:______::\\\"_-.''''                  \\n            -;;^\\\":::::::_,----.'''''....''''''''                \\n             ,,--,,--,::,-,--..'''''''''''  ''''   '            \\n             ''.-...-_::,---..-.''..'''''''  ''''''             \\n              ''...--_--,-'-.''...''''' '''''' '''              \\n                '''''.'..  '.'''.'''''  '''''''                 \\n                                '''''''     '''                 \\n                                  ''     '''''                  \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                                                                \\n                          '.-,-'.,..'                           \\n                         '-,::__:\\\"\\\"\\\"\\\"-                          \\n           '..-\\\":.'      '_::::_::::::_.'                       \\n         .\\\";+;;;;;^\\\"\\\"\\\"::\\\"\\\"^^\\\"::_,-,:_:::_,-'                    \\n        -;+==+;;;;^^^^^^;^\\\":::_,-..-___,----'                   \\n         _;++;;;^^\\\"\\\"^\\\"\\\";^\\\"::,-.,-.--_:::,-__,'                  \\n        -\\\";;;;++;^^\\\"^\\\"\\\"\\\";;^:\\\"::__-'.,_::\\\"\\\":::.                  \\n       .;;;++++;;^^\\\":::^+;;^\\\"\\\"\\\"::,''---_::-,,..--..             \\n        -:\\\";;+;;^\\\"\\\"\\\"::_:\\\"^\\\"^^\\\":::,----,,_:,-.'.,_-              \\n         ',;;;;;;;^^\\\"::::^^^^^^^\\\":_--,::::-,.'-::^.             \\n          '_;;;;;^\\\"\\\":^;^\\\"^;;^^\\\"\\\"\\\"::,,._:::__--,__,'             \\n         '-_^;;+;;\\\"::::^;;;;^\\\":_:___-..,,::_,,-''.'             \\n          '-\\\"^;;;\\\"\\\"\\\"\\\"::\\\"\\\"^\\\"^\\\"\\\":_,__,,,_,-----.                  \\n          '_\\\":\\\"^\\\"::::\\\"\\\"\\\":,.-,-.'''..-,_.' ''''                  \\n           ''-:_--.--,_:-....''  '''''''     '                  \\n             ''...''.-_,-.'''.'''''''                           \\n               '''...-.''''''''                                 \\n                '''''''    ''''                                 \\n                               ''''                             \\n                                   '                            \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                                                                \\n                          '.,--.-_-.'                           \\n              '          '-_:__,_:::_,'                         \\n          ..._^\\\"-' '     .:;\\\"_,,,,_,---''                       \\n        -\\\";++;;;;^^^^\\\":^^^;^\\\",-.-..---,__.''                    \\n       \\\"+==++;;;;^\\\"\\\"^\\\"\\\"\\\"^^:_--.'''''.-,,-''''                   \\n      ':;++;;^^^^^\\\"::_\\\"^^:,-..''.'''.___-.''-.                  \\n        ,^^^^^;;\\\"\\\"\\\"\\\":_:\\\"\\\"\\\"::,---..''-,,__::::.'                 \\n      ':^;;;;;;;\\\"::::::;+;;^\\\":\\\"__-'''..-,_--_,'                 \\n      ':\\\"\\\"^;;;^\\\":,_:_,_\\\"\\\":\\\"^\\\":_,--''.''''..'.' '..''            \\n       '.-:;+;^\\\"\\\":___,--_:\\\"^^\\\":::_.'-_-.--.''  '.,.             \\n         ._\\\";;;;;\\\":::_:_::^^\\\"^\\\"\\\"\\\":-'._::,...' .,.,-'            \\n          ',^;;+;\\\"_,_:\\\"\\\":\\\";;^\\\":::_-.'-,---..'''.'''             \\n         '.-:\\\";+;^:-_,_:\\\"^;;^:_---..''''.--.''''''              \\n          '.-_\\\"\\\"\\\"::::___::_:\\\":_''...--.''''''                   \\n          ',-.,_...-,__:,.'''''     ''''                        \\n             '-.'''''..'''''                                    \\n              '''''''''   '                                     \\n                   ''                                           \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"                          '.,--.'-.''                           \\n             ''          ''_:,..-,__'-'                         \\n        '..'::^_''''    '-_\\\"^-..''..'''''                       \\n       '^;+++;;^\\\"\\\"^\\\":-:\\\"^^\\\"\\\":-'''''''''''''                     \\n     ':+==++;+;;;^\\\"\\\"^\\\":::_-.'''  '' ''.--'                      \\n     _+==+;\\\"^^^^^\\\"_,-,_:\\\"-..'''   '  '-,,'                      \\n     ',:^\\\":\\\"\\\"::::::,,___:,-_,' '' '''---.-,,.-'                 \\n       ,^^::\\\"^;:____,_^;^\\\"\\\"::,,..''''''''...--'                 \\n      ::\\\"^\\\"^^\\\"\\\"_-.----,\\\":::\\\":__..'' ''  '''''.'                 \\n      .,_,\\\";^^\\\"_-.'''..--_\\\"^:_,,-'''''   '' '    ''             \\n        '-^;+;;;\\\":-,_,--.,\\\"^:::::,''-,.''''      ''             \\n         .-\\\";;;;\\\"_-,_____::;^\\\"::_'''.,.'''''  ''''''            \\n          '':^;;;\\\"::,___,_:;^:_--''''''''''                     \\n          ''._:\\\"\\\"\\\"\\\":_,,,::\\\"^\\\":.'''''''   ''                     \\n           '.----.--..---''._-'                                 \\n           '''''''''''''                                        \\n              ''                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"            '-'           '.:,' ''''' '                         \\n        ''',::,'''''     '.-,.     ''                           \\n      '\\\";;+;;^\\\":::_,,'-,,,,-..                                  \\n     .\\\"++++;;;;;::,,_:,,,.''''                                  \\n    _+==;^\\\"\\\":::::,..-_---'''          '..'                      \\n    _^;;\\\":__-..--.'.'..--.''.'       ''''.'''                   \\n     '.__-,_,-......'-_.'..'.'''      ''' '''''                 \\n      ..---_-__-''.''-::---.-,.'                                \\n     '--,,::::,''''''''.'.,_-..''                               \\n      '''.\\\"^;;^:..'--.'''-::..--''''                            \\n         .:\\\";+;;:----..'.._::_:-''''''                          \\n         '.,:^^^^\\\":,,..-.--:\\\"_-.'   ''                          \\n           '.-_:_,,:_-.--.-::-'                                 \\n             '.-.'''''''.''--.                                  \\n             '.''''        '.'                                  \\n              ''                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"         '-__.' ''       '''''      '                           \\n      _;+++;^\\\"_--.''''''''''''                                  \\n     _;++++;;;\\\"_,..'..-,'''''''                                 \\n   ':++^\\\"\\\":-..'.'''.'.-''' '                                    \\n   :==+^:_-'  ''' ''''''''' '                                   \\n   '_\\\"^_.-.'     ''''''  '''''                                  \\n      '''''''''''''''..'''''''                                  \\n      ''''----''''''..'''''''''                                 \\n     ''''-\\\"^\\\"\\\"_.''..''''''--''''                                \\n         ':^;+;^-'.-.''''-,-...'                                \\n          -:;++;^::::-''''.-:_.'                                \\n          ''_:,,:,..__'''''':-'                                 \\n           ''''''''     '''.-'                                  \\n             '.''''        ''                                   \\n               '''                                              \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"     ':;;+\\\"::'                                                  \\n    .;+++=;:,.'''     ''                                        \\n    ,:\\\"\\\"^\\\",''   ' ''                                            \\n  ,\\\"=^:_--.       '.' '                                         \\n  :++;:-''        ''                                            \\n   '-:-'         '                                              \\n          ''  ''''''''                                          \\n        ',\\\":,-..'.'''         '                                 \\n         ._\\\"^\\\"_-'''-.-'  ''                                     \\n          ':;=++:.'.'.'  ''''-'                                 \\n           .\\\"+;;\\\"__,.-'    ',.                                  \\n            ''''''          ''                                  \\n              '''                                               \\n              ''                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \",\n  \"   '_;^;=;''                                                    \\n   '-,:^^,'                                                     \\n   '.'-_-'         ''                                           \\n '-+_.'          ''                                             \\n ,\\\"^^,'                                                         \\n    '.'       '''                                               \\n         ..''''''''                                             \\n          ',,''                                                 \\n           .._,,'                                               \\n           ';=+;.   '       '''                                 \\n            '''-,'''                                            \\n                                                                \\n               ''                                               \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \\n                                                                \"\n]\n"
  },
  {
    "path": "components/shared/header/Dropdown/Github/Github.tsx",
    "content": "import Image from \"@/components/shared/image/Image\";\n\nimport GithubFlame from \"./Flame/Flame\";\n\nexport default function HeaderDropdownGithub() {\n  return (\n    <div className=\"py-24 px-44 border-b border-border-faint relative overflow-clip\">\n      <div className=\"size-40 relative mb-17\">\n        <Image\n          alt=\"Firecrawl icon (blueprint)\"\n          className=\"cw-80 ch-80 absolute top-0 left-0 max-w-[unset]\"\n          height={80}\n          src=\"developer-os-icon\"\n          width={80}\n          raw\n        />\n      </div>\n\n      <div className=\"text-label-large\">\n        Firecrawl is open source. <br />\n        Star us to show your support!\n      </div>\n\n      <GithubFlame />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Mobile/Item/Item.tsx",
    "content": "\"use client\";\nimport { AnimatePresence, cubicBezier, motion } from \"motion/react\";\nimport { useState } from \"react\";\n\nimport {\n  ConnectorToLeft,\n  ConnectorToRight,\n} from \"@/components/shared/layout/curvy-rect\";\nimport { NAV_ITEMS } from \"@/components/shared/header/Nav/Nav\";\nimport { cn } from \"@/utils/cn\";\n\nexport default function HeaderDropdownMobileItem({\n  item,\n}: {\n  item: (typeof NAV_ITEMS)[number];\n}) {\n  const [open, setOpen] = useState(false);\n\n  return (\n    <>\n      <a\n        className=\"p-24 flex group relative\"\n        href={item.href}\n        onClick={() => {\n          setOpen((v) => !v);\n        }}\n      >\n        <div className=\"h-1 bottom-0 absolute left-0 w-full bg-border-faint\" />\n        <ConnectorToRight className=\"-top-11 left-0\" />\n        <ConnectorToRight className=\"-bottom-10 left-0\" />\n        <ConnectorToLeft className=\"-top-11 right-0\" />\n        <ConnectorToLeft className=\"-bottom-10 right-0\" />\n\n        <span className=\"px-4 flex-1 text-label-medium text-accent-black\">\n          {item.label}\n        </span>\n\n        {item.dropdown && (\n          <svg\n            className={cn(\n              \"transition-all duration-200\",\n              open ? \"rotate-180 text-accent-black\" : \"text-black-alpha-48\",\n            )}\n            fill=\"none\"\n            height=\"24\"\n            viewBox=\"0 0 24 24\"\n            width=\"24\"\n            xmlns=\"http://www.w3.org/2000/svg\"\n          >\n            <path\n              d=\"M8.4001 10.2L12.0001 13.8L15.6001 10.2\"\n              stroke=\"currentColor\"\n              strokeLinecap=\"round\"\n              strokeLinejoin=\"round\"\n              strokeWidth=\"1.25\"\n            />\n          </svg>\n        )}\n      </a>\n\n      <AnimatePresence>\n        {open && (\n          <motion.div\n            animate={{ height: \"auto\", opacity: 1, filter: \"blur(0px)\" }}\n            className=\"overflow-hidden\"\n            exit={{ height: 0, opacity: 0, filter: \"blur(4px)\" }}\n            initial={{ height: 0, opacity: 0, filter: \"blur(4px)\" }}\n            transition={{ duration: 0.3, ease: cubicBezier(0.4, 0, 0.2, 1) }}\n          >\n            {item.dropdown}\n\n            <div className=\"h-44 relative\">\n              <ConnectorToRight className=\"-top-11 left-0\" />\n              <ConnectorToRight className=\"-bottom-10 left-0\" />\n              <ConnectorToLeft className=\"-top-11 right-0\" />\n              <ConnectorToLeft className=\"-bottom-10 right-0\" />\n              <div className=\"h-1 bottom-0 absolute left-0 w-full bg-border-faint\" />\n            </div>\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Mobile/Mobile.tsx",
    "content": "import { Fragment } from \"react\";\n\nimport Button from \"@/components/ui/shadcn/button\";\nimport {\n  ConnectorToBottom,\n  ConnectorToLeft,\n  ConnectorToRight,\n} from \"@/components/shared/layout/curvy-rect\";\nimport HeaderGithubClient from \"@/components/shared/header/Github/GithubClient\";\nimport { NAV_ITEMS } from \"@/components/shared/header/Nav/Nav\";\n\nimport HeaderDropdownMobileItem from \"./Item/Item\";\nimport Link from \"next/link\";\n\nexport default function HeaderDropdownMobile({\n  ctaHref = \"/signin/signup\",\n  ctaLabel = \"Sign up\",\n}: {\n  ctaHref?: string;\n  ctaLabel?: string;\n}) {\n  return (\n    <div className=\"container relative\">\n      <div className=\"overlay border-x pointer-events-none border-border-faint\" />\n      <ConnectorToBottom className=\"-top-1 -left-10\" />\n      <ConnectorToBottom className=\"-top-1 -right-10\" />\n\n      <div>\n        {NAV_ITEMS.map((item) => (\n          <Fragment key={item.label}>\n            <HeaderDropdownMobileItem item={item} />\n          </Fragment>\n        ))}\n      </div>\n\n      <div className=\"p-24 flex flex-col gap-8 border-b border-border-faint relative -mt-1\">\n        <HeaderGithubClient />\n        <Link href={ctaHref}>\n          <Button variant=\"secondary\"> {ctaLabel} </Button>\n        </Link>\n\n        <ConnectorToRight className=\"left-0 -bottom-11\" />\n        <ConnectorToLeft className=\"right-0 -bottom-11\" />\n      </div>\n\n      <div className=\"h-36\" />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Stories/Flame/Flame.tsx",
    "content": "\"use client\";\n\nimport { HTMLAttributes, useEffect, useRef } from \"react\";\n\nimport data from \"@/components/app/(home)/sections/hero-flame/data.json\";\nimport { cn } from \"@/utils/cn\";\nimport { setIntervalOnVisible } from \"@/utils/set-timeout-on-visible\";\n\nexport default function StoriesFlame(attrs: HTMLAttributes<HTMLDivElement>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const wrapperRef = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    let index = 0;\n\n    const interval = setIntervalOnVisible({\n      element: wrapperRef.current,\n      callback: () => {\n        index++;\n        if (index >= data.length) index = 0;\n\n        const newStr = data[index];\n\n        if (!ref.current) return;\n\n        ref.current!.innerHTML = newStr;\n      },\n      interval: 60,\n    });\n\n    return () => interval?.();\n  }, []);\n\n  return (\n    <div\n      className=\"absolute right-10 bottom-10 w-194 h-165\"\n      style={{\n        maskImage: \"url('/assets-original/replit-mask.png')\",\n        maskSize: \"100% 100%\",\n      }}\n    >\n      <div\n        ref={wrapperRef}\n        {...attrs}\n        className={cn(\n          \"w-308 h-380 -top-20 -left-40 absolute pointer-events-none select-none\",\n          attrs.className,\n        )}\n      >\n        <div\n          className=\"text-black-alpha-20 relative top-0 left-0 font-ascii fc-decoration\"\n          ref={ref}\n          style={{\n            whiteSpace: \"pre\",\n            fontSize: 8,\n            lineHeight: \"10px\",\n          }}\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Stories/Stories.tsx",
    "content": "import ArrowUp from \"./_svg/ArrowUp\";\nimport Replit from \"./_svg/Replit\";\nimport StoriesFlame from \"./Flame/Flame\";\n\nexport default function HeaderDropdownStories() {\n  return (\n    <a\n      className=\"pt-32 pr-32 pl-44 pb-48 group block border-b border-border-faint relative overflow-clip\"\n      href=\"/blog/how-replit-uses-firecrawl-to-power-ai-agents\"\n    >\n      <div className=\"flex mb-40 justify-between items-center\">\n        <div className=\"py-4 px-8 text-heat-100 text-[12px]/[16px] font-[450] bg-heat-8 rounded-6\">\n          Customer story\n        </div>\n\n        <div className=\"p-2 text-black-alpha-56 group-hover:text-heat-100 transition-all group-hover:translate-x-1 group-hover:translate-y-[-1px]\">\n          <ArrowUp />\n        </div>\n      </div>\n\n      <Replit />\n\n      <div className=\"text-title-h5 mt-31 pr-32\">\n        How Replit uses <span className=\"text-heat-100\">Firecrawl</span> to\n        power Replit Agent\n      </div>\n\n      <StoriesFlame />\n    </a>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Stories/_svg/ArrowUp.tsx",
    "content": "export default function ArrowUp() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"24\"\n      viewBox=\"0 0 24 24\"\n      width=\"24\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M17.2083 14.7082V6.7915M17.2083 6.7915H9.29167M17.2083 6.7915L7 16.9998\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Stories/_svg/Replit.tsx",
    "content": "export default function Replit() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"32\"\n      viewBox=\"0 0 32 32\"\n      width=\"32\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M15.54 10.8196H5.27864C4.26819 10.8196 3.4668 10.0148 3.4668 9.03879V3.11427C3.4668 2.12115 4.28561 1.3335 5.27864 1.3335H13.7281C14.7386 1.3335 15.54 2.13827 15.54 3.11427V10.8196Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M26.5452 21.1531H15.5508V10.8047H26.5452C27.6091 10.8047 28.4864 11.6811 28.4864 12.7439V19.214C28.4864 20.2955 27.6091 21.1531 26.5452 21.1531Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M13.7281 30.6668H5.27864C4.28561 30.6668 3.4668 29.8635 3.4668 28.8892V22.9583C3.4668 21.9841 4.28561 21.1807 5.27864 21.1807H15.54V28.8892C15.54 29.8635 14.7212 30.6668 13.7281 30.6668Z\"\n        fill=\"#262626\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Dropdown/Wrapper/Wrapper.tsx",
    "content": "\"use client\";\n\nimport { AnimatePresence, cubicBezier, motion } from \"motion/react\";\nimport { useEffect } from \"react\";\n\nimport { Connector } from \"@/components/shared/layout/curvy-rect\";\nimport { useHeaderContext } from \"@/components/shared/header/HeaderContext\";\nimport { lockBody } from \"@/components/shared/lockBody\";\nimport AnimatedHeight from \"@/components/shared/layout/animated-height\";\nexport default function HeaderDropdownWrapper() {\n  const {\n    dropdownContent,\n    resetDropdownTimeout,\n    clearDropdown,\n    dropdownKey,\n    headerHeight,\n    headerTop,\n  } = useHeaderContext();\n\n  useEffect(() => {\n    lockBody(\"header-dropdown\", !!dropdownContent);\n  }, [dropdownContent]);\n\n  return (\n    <AnimatePresence>\n      {dropdownContent && (\n        <motion.div\n          animate={{ opacity: 1 }}\n          className=\"h-screen w-screen fixed left-0 z-[2000] bg-black-alpha-40\"\n          exit={{\n            opacity: 0,\n            transition: {\n              duration: 0.3,\n              delay: 0.1,\n              ease: cubicBezier(0.4, 0, 0.2, 1),\n            },\n          }}\n          initial={{ opacity: 0 }}\n          style={{\n            top: headerTop.current + headerHeight.current + 1,\n          }}\n          transition={{ duration: 0.3, ease: cubicBezier(0.4, 0, 0.2, 1) }}\n        >\n          <div\n            className=\"overlay\"\n            onClick={() => {\n              if (window.innerWidth < 996) {\n                clearDropdown(true);\n              }\n            }}\n            onMouseEnter={() => {\n              if (window.innerWidth > 996) {\n                clearDropdown(true);\n              }\n            }}\n          />\n\n          <AnimatedHeight\n            animate={{\n              transition: { duration: 0.5, ease: cubicBezier(0.4, 0, 0.2, 1) },\n            }}\n            className=\"overflow-clip relative\"\n            exit={{\n              height: 0,\n              transition: { duration: 0.3, ease: cubicBezier(0.4, 0, 0.2, 1) },\n            }}\n            initial={{ height: 0 }}\n          >\n            <AnimatePresence mode=\"popLayout\">\n              <motion.div\n                className=\"bg-background-base hide-scrollbar relative overflow-x-clip overflow-y-auto\"\n                key={dropdownKey}\n                style={{\n                  maxHeight: `calc(100vh - ${headerTop.current + headerHeight.current + 1}px)`,\n                }}\n                onMouseEnter={resetDropdownTimeout}\n                onMouseLeave={() => {\n                  if (window.innerWidth < 996) return;\n                  clearDropdown();\n                }}\n              >\n                <div className=\"cmw-[1112px] absolute h-full pointer-events-none top-0 border-x border-border-faint\">\n                  <Connector className=\"absolute -left-[11.5px] -top-11\" />\n                  <Connector className=\"absolute -right-[11.5px] -top-11\" />\n                </div>\n\n                <motion.div\n                  animate={{ opacity: 1 }}\n                  exit={{ opacity: 0, pointerEvents: \"none\" }}\n                  initial={{ opacity: 0 }}\n                  transition={{\n                    duration: 0.3,\n                    ease: cubicBezier(0.4, 0, 0.2, 1),\n                  }}\n                >\n                  {dropdownContent}\n                </motion.div>\n              </motion.div>\n            </AnimatePresence>\n          </AnimatedHeight>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Github/GithubClient.tsx",
    "content": "\"use client\";\n\nimport Button from \"@/components/ui/shadcn/button\";\nimport GithubIcon from \"./_svg/GithubIcon\";\n\nexport default function HeaderGithubClient() {\n  return (\n    <a\n      className=\"contents\"\n      href=\"https://github.com/firecrawl/firecrawl\"\n      target=\"_blank\"\n    >\n      <Button variant=\"tertiary\">\n        <GithubIcon />\n        21.5k\n      </Button>\n    </a>\n  );\n}"
  },
  {
    "path": "components/shared/header/Github/_svg/GithubIcon.tsx",
    "content": "export default function GithubIcon() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        clipRule=\"evenodd\"\n        d=\"M9.97616 2C5.56555 2 2 5.59184 2 10.0354C2 13.5874 4.28457 16.5941 7.45388 17.6583C7.85012 17.7383 7.99527 17.4854 7.99527 17.2727C7.99527 17.0864 7.9822 16.4478 7.9822 15.7825C5.76343 16.2616 5.30139 14.8247 5.30139 14.8247C4.94482 13.8934 4.41649 13.654 4.41649 13.654C3.69029 13.1618 4.46939 13.1618 4.46939 13.1618C5.27494 13.215 5.69763 13.9866 5.69763 13.9866C6.41061 15.2104 7.55951 14.8647 8.02171 14.6518C8.08767 14.1329 8.2991 13.7737 8.52359 13.5742C6.75396 13.3879 4.89208 12.6962 4.89208 9.60963C4.89208 8.73159 5.20882 8.01322 5.71069 7.45453C5.63151 7.25502 5.35412 6.43004 5.79004 5.32588C5.79004 5.32588 6.46351 5.11298 7.98204 6.15069C8.63218 5.9748 9.30265 5.88532 9.97616 5.88457C10.6496 5.88457 11.3362 5.9778 11.9701 6.15069C13.4888 5.11298 14.1623 5.32588 14.1623 5.32588C14.5982 6.43004 14.3207 7.25502 14.2415 7.45453C14.7566 8.01322 15.0602 8.73159 15.0602 9.60963C15.0602 12.6962 13.1984 13.3745 11.4155 13.5742C11.7061 13.8269 11.9569 14.3058 11.9569 15.0642C11.9569 16.1417 11.9438 17.0065 11.9438 17.2725C11.9438 17.4854 12.0891 17.7383 12.4852 17.6584C15.6545 16.594 17.9391 13.5874 17.9391 10.0354C17.9522 5.59184 14.3736 2 9.97616 2Z\"\n        fill=\"#262626\"\n        fillOpacity=\"0.48\"\n        fillRule=\"evenodd\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/HeaderContext.tsx",
    "content": "\"use client\";\n\nimport { usePathname } from \"next/navigation\";\nimport React, {\n  createContext,\n  useContext,\n  useEffect,\n  useRef,\n  useState,\n} from \"react\";\n\ninterface HeaderContextType {\n  dropdownContent: React.ReactNode;\n  setDropdownContent: (content: React.ReactNode) => void;\n  clearDropdown: (force?: boolean) => void;\n  resetDropdownTimeout: () => void;\n  dropdownKey: number;\n  headerHeight: React.RefObject<number>;\n  headerTop: React.RefObject<number>;\n}\n\nconst HeaderContext = createContext<HeaderContextType | undefined>(undefined);\n\nexport const HeaderProvider = ({ children }: { children: React.ReactNode }) => {\n  const [dropdownContent, setDropdownContent] = useState<React.ReactNode>(null);\n  const [dropdownKey, setDropdownKey] = useState(0);\n  const headerHeight = useRef(0);\n  const headerTop = useRef(0);\n  const pathname = usePathname();\n  const timeout = useRef<number | null>(null);\n\n  const clearDropdown = (force?: boolean) => {\n    if (force) {\n      setDropdownContent(null);\n\n      return;\n    }\n\n    if (timeout.current) {\n      clearTimeout(timeout.current);\n    }\n\n    timeout.current = window.setTimeout(() => {\n      setDropdownContent(null);\n    }, 500);\n  };\n\n  const resetDropdownTimeout = () => {\n    if (timeout.current) {\n      clearTimeout(timeout.current);\n    }\n  };\n\n  useEffect(() => {\n    const header = document.querySelector(\".header\") as HTMLElement;\n\n    if (header) {\n      const resizeObserver = new ResizeObserver((entries) => {\n        for (const entry of entries) {\n          headerHeight.current = entry.contentRect.height;\n        }\n      });\n\n      resizeObserver.observe(header);\n      headerHeight.current = header.clientHeight;\n      headerTop.current = header.getBoundingClientRect().top;\n\n      const onScroll = () => {\n        headerTop.current = header.getBoundingClientRect().top;\n      };\n\n      window.addEventListener(\"scroll\", onScroll, { passive: true });\n\n      return () => {\n        resizeObserver.disconnect();\n        window.removeEventListener(\"scroll\", onScroll);\n      };\n    }\n  }, [pathname]);\n\n  return (\n    <HeaderContext.Provider\n      value={{\n        dropdownContent,\n        setDropdownContent: (content) => {\n          resetDropdownTimeout();\n\n          if (content === dropdownContent) return;\n          setDropdownKey((prev) => prev + 1);\n          setDropdownContent(content);\n        },\n        clearDropdown,\n        resetDropdownTimeout,\n        dropdownKey,\n        headerHeight,\n        headerTop,\n      }}\n    >\n      {children}\n    </HeaderContext.Provider>\n  );\n};\n\nexport const useHeaderContext = () => {\n  const context = useContext(HeaderContext);\n\n  if (!context) {\n    throw new Error(\"useHeaderContext must be used within a HeaderProvider\");\n  }\n\n  return context;\n};\n\nexport const useHeaderHeight = () => {\n  const [headerHeight, setHeaderHeight] = useState(0);\n\n  useEffect(() => {\n    const header = document.querySelector(\".header\");\n\n    if (header) {\n      const resizeObserver = new ResizeObserver((entries) => {\n        for (const entry of entries) {\n          setHeaderHeight(entry.contentRect.height);\n        }\n      });\n\n      resizeObserver.observe(header);\n      setHeaderHeight(header.clientHeight);\n\n      return () => {\n        resizeObserver.disconnect();\n      };\n    }\n  }, []);\n\n  return { headerHeight };\n};\n"
  },
  {
    "path": "components/shared/header/Nav/Item/Item.tsx",
    "content": "\"use client\";\n\nimport { JSX } from \"react\";\n\nimport { useHeaderContext } from \"@/components/shared/header/HeaderContext\";\nimport { cn } from \"@/utils/cn\";\n\nimport ChevronDown from \"./_svg/ChevronDown\";\n\nexport default function HeaderNavItem({\n  label,\n  href,\n  dropdown,\n}: {\n  label: string;\n  href: string;\n  dropdown?: JSX.Element;\n}) {\n  const { dropdownContent, setDropdownContent, clearDropdown } =\n    useHeaderContext();\n\n  const active = dropdownContent === dropdown;\n\n  return (\n    <a\n      className=\"p-6 relative flex h-32 group rounded-8 active:scale-[0.98] transition-all duration-[50ms] active:duration-[100ms]\"\n      href={href}\n      onMouseEnter={() => {\n        if (dropdown) {\n          setDropdownContent(dropdown);\n        } else {\n          clearDropdown(true);\n        }\n      }}\n      onMouseLeave={() => {\n        if (!dropdown) return;\n\n        clearDropdown();\n      }}\n    >\n      <span\n        className={cn(\n          \"overlay pointer-events-none group-hover:bg-black-alpha-4 transition-all scale-95 group-active:duration-[100ms] duration-[150ms] group-hover:scale-100 group-active:bg-black-alpha-7\",\n          active && \"!scale-100 !bg-black-alpha-4\",\n        )}\n      />\n\n      <span className=\"px-4 text-label-medium text-accent-black\">{label}</span>\n\n      {dropdown && <ChevronDown />}\n    </a>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/Item/_svg/ChevronDown.tsx",
    "content": "export default function ChevronDown() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 18 20\"\n      width=\"18\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M6 9.5L9 12.5L12 9.5\"\n        stroke=\"#262626\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeOpacity=\"0.56\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/Nav.tsx",
    "content": "import EndpointsCrawl from \"@/components/app/(home)/sections/endpoints/EndpointsCrawl/EndpointsCrawl\";\nimport EndpointsScrape from \"@/components/app/(home)/sections/endpoints/EndpointsScrape/EndpointsScrape\";\nimport EndpointsSearch from \"@/components/app/(home)/sections/endpoints/EndpointsSearch/EndpointsSearch\";\nimport EndpointsExtract from \"@/components/app/(home)/sections/endpoints/Extract/Extract\";\nimport EndpointsMcp from \"@/components/app/(home)/sections/endpoints/Mcp/Mcp\";\nimport { RenderEndpointIcon } from \"@/components/shared/header/Nav/RenderEndpointIcon\";\nimport HeaderDropdownContent from \"@/components/shared/header/Dropdown/Content/Content\";\nimport HeaderDropdownGithub from \"@/components/shared/header/Dropdown/Github/Github\";\nimport HeaderDropdownStories from \"@/components/shared/header/Dropdown/Stories/Stories\";\n\nimport Affiliate from \"./_svg/Affiliate\";\nimport Api from \"./_svg/Api\";\nimport ArrowRight from \"./_svg/ArrowRight\";\nimport Careers from \"./_svg/Careers\";\nimport Changelog from \"./_svg/Changelog\";\nimport Chats from \"./_svg/Chats\";\nimport Lead from \"./_svg/Lead\";\nimport Platforms from \"./_svg/Platforms\";\nimport Research from \"./_svg/Research\";\nimport Student from \"./_svg/Student\";\nimport Templates from \"./_svg/Templates\";\nimport HeaderNavItem from \"./Item/Item\";\nimport MCPIcon from \"./_svg/MCP\";\nimport Image from \"@/components/shared/image/Image\";\nimport GithubFlame from \"@/components/shared/header/Dropdown/Github/Flame/Flame\";\nimport EndpointsMap from \"@/components/app/(home)/sections/endpoints/EndpointsMap/EndpointsMap\";\n\nexport default function HeaderNav() {\n  return (\n    <div className=\"flex gap-8 relative lg-max:hidden select-none\">\n      {NAV_ITEMS.map((item) => (\n        <HeaderNavItem key={item.label} {...item} />\n      ))}\n    </div>\n  );\n}\n\nexport const NAV_ITEMS = [\n  {\n    label: \"Products\",\n    href: \"#\",\n    dropdown: (\n      <HeaderDropdownContent\n        navigationItems={[\n          {\n            label: \"Endpoints\",\n            items: [\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsScrape}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"Scrape\",\n                description: \"Turn any url into clean data\",\n                href: \"https://docs.firecrawl.dev/features/scrape\",\n                iconClassName: \"-mt-1\",\n              },\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsCrawl}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"Crawl\",\n                description: \"Crawl entire websites\",\n                href: \"https://docs.firecrawl.dev/features/crawl\",\n                iconClassName: \"-mt-1\",\n              },\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsSearch}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"Search\",\n                description: \"Search and get page content\",\n                href: \"https://docs.firecrawl.dev/features/search\",\n                iconClassName: \"-mt-1\",\n              },\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsMap}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"Map\",\n                description: \"Get all links from a website\",\n                href: \"https://docs.firecrawl.dev/features/map\",\n                iconClassName: \"-mt-1\",\n              },\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsMcp}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"MCP\",\n                description: \"Connect Firecrawl to agents\",\n                href: \"https://docs.firecrawl.dev/features/mcp\",\n                iconClassName: \"-mt-1\",\n              },\n\n              // Extract section in the same column, highlighted as a separate product\n              // {\n              //   icon: <RenderEndpointIcon icon={EndpointsExtract} alwaysHeat triggerOnHover />,\n              //   label: 'Extract',\n              //   description: 'Get structured data from single pages or entire websites with AI.',\n              //   href: '/extract',\n              //   big: true,\n              //   sectionLabel: 'Extract Product',\n              //   iconClassName: 'mt-4',\n              //   ctas: [\n              //     { label: 'View Extract', href: '/extract' },\n              //     { label: 'Try it now', href: '/playground?mode=extract' }\n              //   ]\n              // },\n            ],\n          },\n          {\n            label: \"Use Cases\",\n            items: [\n              {\n                icon: <Chats />,\n                label: \"AI Platforms\",\n                description: \"Let customers build AI apps\",\n                href: \"https://docs.firecrawl.dev/use-cases/ai-platforms\",\n                target: \"_blank\",\n              },\n              {\n                icon: <Lead />,\n                label: \"Lead Enrichment\",\n                description: \"Enhance sales data\",\n                href: \"https://docs.firecrawl.dev/use-cases/lead-enrichment\",\n                target: \"_blank\",\n              },\n              {\n                icon: <Platforms />,\n                label: \"SEO Platforms\",\n                description: \"Power SEO/GEO tools\",\n                href: \"https://docs.firecrawl.dev/use-cases/seo-platforms\",\n                target: \"_blank\",\n              },\n              {\n                icon: <Research />,\n                label: \"Deep Research\",\n                description: \"Build research agents\",\n                href: \"https://docs.firecrawl.dev/use-cases/deep-research\",\n                target: \"_blank\",\n              },\n              {\n                icon: <ArrowRight />,\n                label: \"View more\",\n                description: \"Explore all use cases\",\n                href: \"https://docs.firecrawl.dev/use-cases/overview\",\n                target: \"_blank\",\n              },\n            ],\n          },\n        ]}\n        sideContent={<HeaderDropdownStories />}\n        sideItem={{\n          icon: <ArrowRight />,\n          label: \"Customer stories\",\n          description: \"Browse Firecrawl success stories\",\n          href: \"/blog/category/customer-stories\",\n        }}\n        sideLabel=\"Customer Stories\"\n      />\n    ),\n  },\n  {\n    label: \"Playground\",\n    href: \"/playground\",\n  },\n  {\n    label: \"Docs\",\n    href: \"https://docs.firecrawl.dev\",\n  },\n  {\n    label: \"Pricing\",\n    href: \"/pricing\",\n  },\n  {\n    label: \"Blog\",\n    href: \"/blog\",\n  },\n  {\n    label: \"Extract\",\n    href: \"#\",\n    dropdown: (\n      <HeaderDropdownContent\n        navigationItems={[\n          {\n            label: \"Extract API\",\n            items: [\n              // { icon: <Templates />, label: 'Templates', description: 'Jumpstart your web scraping', href: '/templates' },\n              {\n                icon: (\n                  <RenderEndpointIcon\n                    icon={EndpointsExtract}\n                    alwaysHeat\n                    triggerOnHover\n                  />\n                ),\n                label: \"Extract\",\n                description: \"Get structured data from entire websites\",\n                href: \"/extract\",\n              },\n              {\n                icon: (\n                  <div className=\"text-heat-100\">\n                    <Platforms />\n                  </div>\n                ),\n                label: \"Playground\",\n                description: \"Try it out in the /extract playground\",\n                href: \"/app/extract-playground\",\n              },\n              // { icon: <ArrowRight/>, label: 'Docs', description: 'Read the docs.', href: 'https://docs.firecrawl.dev/features/extract', target: '_blank' },\n            ],\n          },\n        ]}\n        sideContent={\n          <div className=\"py-24 px-44 border-b border-border-faint relative overflow-clip\">\n            {/* <div className=\"size-40 relative mb-17\"> */}\n            {/*  */}\n            {/* </div> */}\n\n            <div className=\"text-label-large\">\n              Get web data with a prompt. <br />\n              Collect structured data from any number of URLs or entire domains.\n            </div>\n\n            <GithubFlame />\n          </div>\n        }\n        sideItem={{\n          icon: <ArrowRight />,\n          label: \"See Docs\",\n          description: \"Read the docs.\",\n          href: \"https://docs.firecrawl.dev/features/extract\",\n        }}\n        sideLabel=\"/extract\"\n      />\n    ),\n  },\n  {\n    label: \"Resources\",\n    href: \"#\",\n    dropdown: (\n      <HeaderDropdownContent\n        navigationItems={[\n          {\n            label: \"Resources\",\n            items: [\n              // { icon: <Templates />, label: 'Templates', description: 'Jumpstart your web scraping', href: '/templates' },\n              {\n                icon: <Changelog />,\n                label: \"Changelog\",\n                description: \"Latest APl updates for Firecrawl\",\n                href: \"/changelog\",\n              },\n              {\n                icon: <Api />,\n                label: \"API Status\",\n                description: \"See maintenance, uptime and more\",\n                href: \"https://firecrawl.betteruptime.dev/\",\n                target: \"_blank\",\n              },\n              {\n                icon: <Careers />,\n                label: \"Careers\",\n                description: \"Join our team, we're hiring!\",\n                href: \"/careers\",\n              },\n              {\n                icon: <Affiliate />,\n                label: \"Creator & OSS Program\",\n                description: \"Earn rewards for referring customers\",\n                href: \"/creator-oss-program\",\n              },\n              {\n                icon: <Student />,\n                label: \"Student Program\",\n                description: \"Get free credits for your projects\",\n                href: \"/student-program\",\n              },\n              {\n                icon: <MCPIcon />,\n                label: \"MCP\",\n                description: \"Connect Firecrawl to agents\",\n                href: \"https://docs.firecrawl.dev/features/mcp\",\n              },\n            ],\n          },\n        ]}\n        sideContent={<HeaderDropdownGithub />}\n        sideItem={{\n          icon: <ArrowRight />,\n          label: \"See Github\",\n          description: \"View the repository\",\n          href: \"https://github.com/firecrawl/firecrawl\",\n        }}\n        sideLabel=\"Open Source\"\n      />\n    ),\n  },\n];\n"
  },
  {
    "path": "components/shared/header/Nav/RenderEndpointIcon.tsx",
    "content": "\"use client\";\n\nimport EndpointsScrape from \"@/components/app/(home)/sections/endpoints/EndpointsScrape/EndpointsScrape\";\nimport { ComponentProps } from \"react\";\nimport { useMediaQuery } from \"usehooks-ts\";\n\nexport const RenderEndpointIcon = ({\n  icon: Icon,\n  ...props\n}: { icon: typeof EndpointsScrape } & ComponentProps<\n  typeof EndpointsScrape\n>) => {\n  const isMobile = useMediaQuery(\"(max-width: 996px)\");\n\n  return <Icon {...props} size={isMobile ? 24 : 20} />;\n};\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Affiliate.tsx",
    "content": "export default function Affiliate() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M13.3332 6.6665L6.6665 13.3332M17.7082 9.99984C17.7082 14.257 14.257 17.7082 9.99984 17.7082C5.74265 17.7082 2.2915 14.257 2.2915 9.99984C2.2915 5.74265 5.74265 2.2915 9.99984 2.2915C14.257 2.2915 17.7082 5.74265 17.7082 9.99984Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M7.5 6.875C7.84517 6.875 8.125 7.15483 8.125 7.5C8.125 7.84517 7.84517 8.125 7.5 8.125C7.15483 8.125 6.875 7.84517 6.875 7.5C6.875 7.15483 7.15483 6.875 7.5 6.875Z\"\n        fill=\"currentColor\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M12.5 11.875C12.8452 11.875 13.125 12.1548 13.125 12.5C13.125 12.8452 12.8452 13.125 12.5 13.125C12.1548 13.125 11.875 12.8452 11.875 12.5C11.875 12.1548 12.1548 11.875 12.5 11.875Z\"\n        fill=\"currentColor\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Api.tsx",
    "content": "export default function Api() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M3.125 4.79167C3.125 3.87119 3.87119 3.125 4.79167 3.125H15.2083C16.1288 3.125 16.875 3.87119 16.875 4.79167V15.2083C16.875 16.1288 16.1288 16.875 15.2083 16.875H4.79167C3.87119 16.875 3.125 16.1288 3.125 15.2083V4.79167Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"square\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M3.125 10.0002H6.45833L8.33333 13.5418L11.6667 6.4585L13.5417 10.0002H16.875\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"square\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/ArrowRight.tsx",
    "content": "export default function ArrowRight() {\n  return (\n    <svg\n      className=\"text-black-alpha-48 group-hover:text-heat-100 transition-all\"\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M11.6667 4.7915L16.875 9.99982M16.875 9.99982L11.6667 15.2082M16.875 9.99982H3.125\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Careers.tsx",
    "content": "export default function Careers() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M17.4998 10.625H9.99984M9.99984 10.625H2.49984M9.99984 10.625L10.0017 12.7083M6.66834 6.45833V4.375C6.66834 3.68464 7.22798 3.125 7.91834 3.125H12.085C12.7753 3.125 13.335 3.68464 13.335 4.375V6.45833M16.0415 16.875H3.95817C3.0377 16.875 2.2915 16.1288 2.2915 15.2083V8.125C2.2915 7.20452 3.0377 6.45833 3.95817 6.45833H16.0415C16.962 6.45833 17.7082 7.20452 17.7082 8.125V15.2083C17.7082 16.1288 16.962 16.875 16.0415 16.875Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Changelog.tsx",
    "content": "export default function Changelog() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M7.2915 2.7085H5.20817C4.2877 2.7085 3.5415 3.45469 3.5415 4.37516V15.6252C3.5415 16.5457 4.2877 17.2918 5.20817 17.2918H7.2915M7.2915 2.7085H14.7915C15.712 2.7085 16.4582 3.45469 16.4582 4.37516V15.6252C16.4582 16.5457 15.712 17.2918 14.7915 17.2918H7.2915M7.2915 2.7085V17.2918M10.6248 6.4585H13.1248M10.6248 9.79183H13.1248\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Chats.tsx",
    "content": "export default function Ai() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        clipRule=\"evenodd\"\n        d=\"M1.45825 7.50016C5.65385 7.50016 7.49992 5.6541 7.49992 1.4585C7.49992 5.6541 9.34598 7.50016 13.5416 7.50016C9.34598 7.50016 7.49992 9.34623 7.49992 13.5418C7.49992 9.34623 5.65385 7.50016 1.45825 7.50016Z\"\n        fillRule=\"evenodd\"\n        stroke=\"currentColor\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        clipRule=\"evenodd\"\n        d=\"M10.6249 14.5835C13.3738 14.5835 14.5833 13.374 14.5833 10.6252C14.5833 13.374 15.7927 14.5835 18.5416 14.5835C15.7927 14.5835 14.5833 15.793 14.5833 18.5418C14.5833 15.793 13.3738 14.5835 10.6249 14.5835Z\"\n        fillRule=\"evenodd\"\n        stroke=\"currentColor\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Lead.tsx",
    "content": "export default function Lead() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M10.8333 16.0417H16.25C17.1705 16.0417 17.9167 15.2955 17.9167 14.375V7.29167C17.9167 6.37119 17.1705 5.625 16.25 5.625H11.1003C10.543 5.625 10.0227 5.3465 9.71355 4.88283L9.03644 3.86717C8.72733 3.4035 8.20695 3.125 7.64969 3.125H4.16666C3.24619 3.125 2.5 3.87119 2.5 4.79167V6.875M6.45833 10.4167C6.45833 11.2221 5.80541 11.875 5 11.875C4.19458 11.875 3.54166 11.2221 3.54166 10.4167C3.54166 9.61125 4.19458 8.95833 5 8.95833C5.80541 8.95833 6.45833 9.61125 6.45833 10.4167ZM1.93082 15.8928C2.5458 14.7359 3.69002 13.9583 5 13.9583C6.30997 13.9583 7.45419 14.7359 8.06918 15.8928C8.32136 16.3672 7.92297 16.875 7.38572 16.875H2.61427C2.07702 16.875 1.67864 16.3672 1.93082 15.8928Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/MCP.tsx",
    "content": "export default function MCPIcon() {\n  return (\n    <svg\n      fill=\"currentColor\"\n      fill-rule=\"evenodd\"\n      height=\"1em\"\n      viewBox=\"0 0 24 24\"\n      width=\"1em\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <title>ModelContextProtocol</title>\n      <path d=\"M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z\"></path>\n      <path d=\"M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z\"></path>\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Platforms.tsx",
    "content": "export default function Platforms() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M5.41667 7.49984C5.18655 7.49984 5 7.31329 5 7.08317C5 6.85305 5.18655 6.6665 5.41667 6.6665C5.64679 6.6665 5.83333 6.85305 5.83333 7.08317C5.83333 7.31329 5.64679 7.49984 5.41667 7.49984Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n      <path\n        d=\"M8.33333 7.49984C8.10321 7.49984 7.91667 7.31329 7.91667 7.08317C7.91667 6.85305 8.10321 6.6665 8.33333 6.6665C8.56345 6.6665 8.75 6.85305 8.75 7.08317C8.75 7.31329 8.56345 7.49984 8.33333 7.49984Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n      <path\n        d=\"M11.25 7.49984C11.0199 7.49984 10.8333 7.31329 10.8333 7.08317C10.8333 6.85305 11.0199 6.6665 11.25 6.6665C11.4801 6.6665 11.6667 6.85305 11.6667 7.08317C11.6667 7.31329 11.4801 7.49984 11.25 7.49984Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n      <path\n        d=\"M17.7084 10.2085V5.62516C17.7084 4.70469 16.9622 3.9585 16.0417 3.9585H3.95841C3.03794 3.9585 2.29175 4.70469 2.29175 5.62516V15.2085C2.29175 16.129 3.03794 16.8752 3.95841 16.8752H10.2084M18.3334 14.295L12.5001 12.5002L14.295 18.3335L15.6411 15.6412L18.3334 14.295Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Research.tsx",
    "content": "export default function Research() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M4.8956 8.9541L2.05646 9.98744C1.40773 10.2236 1.07325 10.9409 1.30937 11.5896L1.66563 12.5684C1.90175 13.2172 2.61906 13.5517 3.26778 13.3155L6.10693 12.2822\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M9.40608 6.36865L6.15568 7.55169C5.29072 7.86651 4.84474 8.82292 5.15956 9.68784L5.83647 11.5477C6.15129 12.4127 7.1077 12.8586 7.97266 12.5438L11.223 11.3608\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M11.062 4.82461L15.546 3.19257C15.9785 3.03516 16.4567 3.25815 16.6142 3.69063L18.4667 8.78066C18.6242 9.21316 18.4012 9.69132 17.9687 9.84874L13.4847 11.4807C12.4035 11.8743 11.208 11.3168 10.8144 10.2357L9.81691 7.49485C9.42332 6.41365 9.98082 5.21814 11.062 4.82461Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M8.95825 16.8748V12.2915\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M6.45825 16.875H11.4583\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Student.tsx",
    "content": "export default function Student() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M19.375 7.50417L10 11.8833L0.625 7.50417L10 3.125L19.375 7.50417ZM19.375 7.50417V12.7175M3.95835 9.14633V12.8756C3.95835 13.4922 4.29811 14.0585 4.84186 14.3482L9.21683 16.6793C9.70642 16.9403 10.2936 16.9403 10.7832 16.6793L15.1582 14.3482C15.7019 14.0585 16.0417 13.4922 16.0417 12.8756V9.14633\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Nav/_svg/Templates.tsx",
    "content": "export default function Templates() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M3.95817 16.0417C3.0377 16.0417 2.2915 15.2955 2.2915 14.375V7.29167C2.2915 6.37119 3.0377 5.625 3.95817 5.625H16.0415C16.962 5.625 17.7082 6.37119 17.7082 7.29167V14.375C17.7082 15.2955 16.962 16.0417 16.0415 16.0417H3.95817Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n      <path\n        d=\"M3.9585 3.125H16.0418\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Toggle/Toggle.tsx",
    "content": "\"use client\";\n\nimport Button from \"@/components/ui/shadcn/button\";\nimport { useHeaderContext } from \"@/components/shared/header/HeaderContext\";\nimport { cn } from \"@/utils/cn\";\n\nexport default function HeaderToggle({\n  dropdownContent,\n}: {\n  dropdownContent: React.ReactNode;\n}) {\n  const {\n    dropdownContent: headerDropdownContent,\n    clearDropdown,\n    setDropdownContent,\n  } = useHeaderContext();\n\n  return (\n    <Button\n      className=\"lg:hidden\"\n      variant=\"tertiary\"\n      onClick={() => {\n        if (dropdownContent === headerDropdownContent) {\n          clearDropdown(true);\n        } else {\n          setDropdownContent(dropdownContent);\n        }\n      }}\n    >\n      <svg\n        className=\"!size-20\"\n        fill=\"none\"\n        height=\"20\"\n        viewBox=\"0 0 20 20\"\n        width=\"20\"\n        xmlns=\"http://www.w3.org/2000/svg\"\n      >\n        <path\n          className={cn(\"transition-all origin-center\", {\n            \"rotate-45 -translate-y-4\": headerDropdownContent,\n          })}\n          d=\"M2.28906 13.9609H17.7057\"\n          stroke=\"#262626\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"1.25\"\n          style={{\n            transformBox: \"fill-box\",\n          }}\n        />\n        <path\n          className={cn(\"transition-all origin-center\", {\n            \"-rotate-45 translate-y-3 translate-x-[2.5px]\":\n              headerDropdownContent,\n          })}\n          d=\"M2.28906 6.03906H17.7057\"\n          stroke=\"#262626\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"1.25\"\n        />\n      </svg>\n    </Button>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/Wrapper/Wrapper.tsx",
    "content": "\"use client\";\n\nimport { usePathname } from \"next/navigation\";\nimport { useEffect, useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport default function HeaderWrapper({\n  children,\n}: {\n  children: React.ReactNode;\n}) {\n  const [shouldShrink, setShouldShrink] = useState(false);\n  const pathname = usePathname();\n\n  useEffect(() => {\n    const heroContentHeight =\n      document.getElementById(\"hero-content\")?.clientHeight;\n    const triggerTop = heroContentHeight ? heroContentHeight : 100;\n\n    const onScroll = () => {\n      setShouldShrink(window.scrollY > triggerTop);\n    };\n\n    onScroll();\n\n    window.addEventListener(\"scroll\", onScroll);\n  }, [pathname]);\n\n  return (\n    <div\n      className={cn(\n        \"container lg:px-56 px-16 flex justify-between transition-[padding] duration-[200ms] items-center\",\n        shouldShrink ? \"py-20\" : \"py-20 lg:py-34\",\n      )}\n    >\n      {children}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/header/_svg/Logo.tsx",
    "content": "export default function Logo() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"15\"\n      viewBox=\"0 0 79 15\"\n      width=\"79\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M0.599609 14.4311V0.576888H9.45474V2.59564H2.87778V6.61335H8.30575V8.57272H2.87778V14.4311H0.599609Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M11.9737 2.87272C11.2407 2.87272 10.6663 2.33835 10.6663 1.58626C10.6663 0.83418 11.2407 0.299805 11.9737 0.299805C12.7067 0.299805 13.2812 0.83418 13.2812 1.58626C13.2812 2.33835 12.7067 2.87272 11.9737 2.87272ZM10.8842 14.4311V4.29772H13.0237V14.4311H10.8842Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M20.1527 4.29772H20.6281V6.29668H19.6772C17.7755 6.29668 17.1613 7.78105 17.1613 9.3446V14.4311H15.0219V4.29772H16.9236L17.1613 5.82168C17.6764 4.97064 18.4886 4.29772 20.1527 4.29772Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M26.1788 14.5498C22.9894 14.5498 20.9886 12.4915 20.9886 9.38418C20.9886 6.2571 22.9894 4.17897 25.9807 4.17897C28.9126 4.17897 30.8738 6.03939 30.9333 9.00814C30.9333 9.26543 30.9135 9.54251 30.8738 9.8196H23.2271V9.95814C23.2865 11.68 24.3761 12.8081 26.06 12.8081C27.3674 12.8081 28.3183 12.155 28.6155 11.0269H30.755C30.3984 13.0258 28.6947 14.5498 26.1788 14.5498ZM23.3064 8.25605H28.7145C28.5362 6.75189 27.4863 5.90085 26.0005 5.90085C24.6336 5.90085 23.4648 6.81126 23.3064 8.25605Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M37.2193 14.5498C34.1487 14.5498 32.1875 12.5508 32.1875 9.38418C32.1875 6.2571 34.2081 4.17897 37.2787 4.17897C39.8936 4.17897 41.5181 5.62376 41.9341 7.9196H39.6955C39.4182 6.7321 38.5664 5.9998 37.2391 5.9998C35.5156 5.9998 34.3864 7.38522 34.3864 9.38418C34.3864 11.3633 35.5156 12.729 37.2391 12.729C38.5465 12.729 39.4182 11.9769 39.6757 10.8092H41.9341C41.5379 13.105 39.8144 14.5498 37.2193 14.5498Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M48.6034 4.29772H49.0789V6.29668H48.128C46.2262 6.29668 45.6121 7.78105 45.6121 9.3446V14.4311H43.4726V4.29772H45.3744L45.6121 5.82168C46.1272 4.97064 46.9394 4.29772 48.6034 4.29772Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M54.3679 4.17897C57.0621 4.17897 58.6073 5.46543 58.6073 7.86022V14.4311H56.7451L56.5668 12.9863C55.8735 13.8967 54.9028 14.5498 53.2981 14.5498C51.0794 14.5498 49.5936 13.4613 49.5936 11.5811C49.5936 9.50293 51.0992 8.33522 53.9519 8.33522H56.4876V7.72168C56.4876 6.59355 55.6754 5.90085 54.2688 5.90085C53.001 5.90085 52.1491 6.4946 51.9907 7.38522H49.8908C50.1087 5.40605 51.8124 4.17897 54.3679 4.17897ZM53.6547 12.8873C55.4376 12.8873 56.4678 11.8383 56.4876 10.2748V9.91855H53.833C52.5057 9.91855 51.7728 10.4133 51.7728 11.4425C51.7728 12.2936 52.4859 12.8873 53.6547 12.8873Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M62.7912 14.4311L59.4829 4.29772H61.7413L64.0591 12.0561L66.3768 4.29772H68.3381L70.5568 12.0561L72.9538 4.29772H75.1329L71.7652 14.4311H69.4672L67.3277 7.54355L65.109 14.4311H62.7912Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M76.1601 14.4311V0.576888H78.2996V14.4311H76.1601Z\"\n        fill=\"#262626\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/hero-flame.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\n// Sample of flame frames - using a subset for performance\nconst flameFrames = [\n  `\n       ▄▄▄       \n      ▄███▄      \n     ▄█████▄     \n    ▄███████▄    \n   ▄█████████▄   \n  ▄███████████▄  \n ▄█████████████▄ \n▄███████████████▄\n█████████████████\n███▀▀▀███▀▀▀█████\n██     ███    ███\n█       ▀      ██\n`,\n  `\n      ▄███▄      \n     ▄█████▄     \n    ▄███▀███▄    \n   ▄████▄████▄   \n  ▄███████████▄  \n ▄█████▀▀██████▄ \n▄██████▄▄███████▄\n█████████████████\n███▀▀█████▀▀█████\n██    ███     ███\n█      ▀       ██\n                 \n`,\n  `\n     ▄█████▄     \n    ▄███████▄    \n   ▄█████████▄   \n  ▄███▀███▀███▄  \n ▄████▄███▄████▄ \n▄██████████████▄ \n████▀▀█████▀▀████\n███    ███    ███\n██     ▀▀     ███\n█             ██ \n                 \n                 \n`,\n  `\n    ▄███████▄    \n   ▄█████████▄   \n  ▄███████████▄  \n ▄█████▀▀██████▄ \n▄███████▄▄██████▄\n██████████████████\n████▀▀▀████▀▀▀████\n███     ███    ███\n██      ▀▀      ██\n█               █ \n                  \n                  \n`,\n];\n\ninterface HeroFlameProps {\n  className?: string;\n  size?: \"small\" | \"medium\" | \"large\";\n}\n\nexport function HeroFlame({ className, size = \"medium\" }: HeroFlameProps) {\n  const [frameIndex, setFrameIndex] = useState(0);\n  const intervalRef = useRef<NodeJS.Timeout | null>(null);\n\n  useEffect(() => {\n    intervalRef.current = setInterval(() => {\n      setFrameIndex((prev) => (prev + 1) % flameFrames.length);\n    }, 85);\n\n    return () => {\n      if (intervalRef.current) {\n        clearInterval(intervalRef.current);\n      }\n    };\n  }, []);\n\n  const sizeClasses = {\n    small: \"text-[8px] leading-[10px]\",\n    medium: \"text-[12px] leading-[14px]\",\n    large: \"text-[16px] leading-[18px]\",\n  };\n\n  return (\n    <div\n      className={cn(\"flex gap-4 pointer-events-none select-none\", className)}\n    >\n      {/* Left flame */}\n      <div className=\"relative overflow-hidden\">\n        <pre\n          className={cn(\n            \"text-heat-100 font-mono whitespace-pre\",\n            sizeClasses[size],\n          )}\n        >\n          {flameFrames[frameIndex]}\n        </pre>\n      </div>\n\n      {/* Right flame (mirrored) */}\n      <div className=\"relative overflow-hidden -scale-x-100\">\n        <pre\n          className={cn(\n            \"text-heat-100 font-mono whitespace-pre\",\n            sizeClasses[size],\n          )}\n        >\n          {flameFrames[frameIndex]}\n        </pre>\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/GitHub.tsx",
    "content": "const GitHub = ({ ...props }) => {\n  return (\n    <svg\n      width=\"24\"\n      height=\"24\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n    >\n      <path\n        fillRule=\"evenodd\"\n        clipRule=\"evenodd\"\n        d=\"M12 0C5.37 0 0 5.50583 0 12.3035C0 17.7478 3.435 22.3463 8.205 23.9765C8.805 24.0842 9.03 23.715 9.03 23.3921C9.03 23.0999 9.015 22.131 9.015 21.1005C6 21.6696 5.22 20.347 4.98 19.6549C4.845 19.3012 4.26 18.2092 3.75 17.917C3.33 17.6863 2.73 17.1173 3.735 17.1019C4.68 17.0865 5.355 17.9939 5.58 18.363C6.66 20.2239 8.385 19.701 9.075 19.3781C9.18 18.5783 9.495 18.04 9.84 17.7325C7.17 17.4249 4.38 16.3637 4.38 11.6576C4.38 10.3196 4.845 9.21227 5.61 8.35102C5.49 8.04343 5.07 6.78232 5.73 5.09058C5.73 5.09058 6.735 4.76762 9.03 6.3517C9.99 6.07487 11.01 5.93645 12.03 5.93645C13.05 5.93645 14.07 6.07487 15.03 6.3517C17.325 4.75224 18.33 5.09058 18.33 5.09058C18.99 6.78232 18.57 8.04343 18.45 8.35102C19.215 9.21227 19.68 10.3042 19.68 11.6576C19.68 16.3791 16.875 17.4249 14.205 17.7325C14.64 18.1169 15.015 18.8552 15.015 20.0086C15.015 21.6542 15 22.9768 15 23.3921C15 23.715 15.225 24.0995 15.825 23.9765C18.2072 23.1519 20.2773 21.5822 21.7438 19.4882C23.2103 17.3942 23.9994 14.8814 24 12.3035C24 5.50583 18.63 0 12 0Z\"\n        fill=\"currentColor\"\n      />\n    </svg>\n  );\n};\n\nexport default GitHub;\n"
  },
  {
    "path": "components/shared/icons/Logo.tsx",
    "content": "const Logo = ({ ...props }) => (\n  // <svg\n  //   width=\"32\"\n  //   height=\"32\"\n  //   viewBox=\"0 0 32 32\"\n  //   fill=\"none\"\n  //   xmlns=\"http://www.w3.org/2000/svg\"\n  //   {...props}\n  // >\n  //   <rect width=\"100%\" height=\"100%\" rx=\"16\" fill=\"white\" />\n  //   <path\n  //     fillRule=\"evenodd\"\n  //     clipRule=\"evenodd\"\n  //     d=\"M17.6482 10.1305L15.8785 7.02583L7.02979 22.5499H10.5278L17.6482 10.1305ZM19.8798 14.0457L18.11 17.1983L19.394 19.4511H16.8453L15.1056 22.5499H24.7272L19.8798 14.0457Z\"\n  //     fill=\"black\"\n  //   />\n  // </svg>\n  <span className=\"text-2xl\" {...props}>\n    🔥\n  </span>\n);\nexport default Logo;\n"
  },
  {
    "path": "components/shared/icons/animated-chevron.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { ChevronDown, ChevronUp } from \"lucide-react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { cn } from \"@/utils/cn\";\n\ninterface AnimatedChevronProps {\n  isOpen: boolean;\n  className?: string;\n  size?: \"sm\" | \"md\" | \"lg\";\n}\n\nexport function AnimatedChevron({\n  isOpen,\n  className,\n  size = \"md\",\n}: AnimatedChevronProps) {\n  const sizeClasses = {\n    sm: \"h-12 w-12\",\n    md: \"h-16 w-16\",\n    lg: \"h-20 w-20\",\n  };\n\n  return (\n    <div className={cn(\"flex items-center justify-center\", sizeClasses[size])}>\n      <AnimatePresence mode=\"wait\" initial={false}>\n        {isOpen ? (\n          <motion.div\n            key=\"chevron-up\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            transition={{ duration: 0.2 }}\n          >\n            <ChevronUp\n              className={cn(\n                sizeClasses[size],\n                \"text-black-alpha-40\",\n                className,\n              )}\n            />\n          </motion.div>\n        ) : (\n          <motion.div\n            key=\"chevron-down\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            transition={{ duration: 0.2 }}\n          >\n            <ChevronDown\n              className={cn(\n                sizeClasses[size],\n                \"text-black-alpha-40\",\n                className,\n              )}\n            />\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/animated-icons.tsx",
    "content": "\"use client\";\n\nimport type { Transition, Variants } from \"framer-motion\";\nimport { motion, useAnimation } from \"framer-motion\";\nimport { useCallback, useEffect } from \"react\";\n\nconst playIconVariants: Variants = {\n  normal: {\n    x: 0,\n    rotate: 0,\n  },\n  animate: {\n    x: [0, -1, 2, 0],\n    rotate: [0, -10, 0, 0],\n    transition: {\n      duration: 0.5,\n      times: [0, 0.2, 0.5, 1],\n      stiffness: 260,\n      damping: 20,\n    },\n  },\n};\n\nconst defaultTransition: Transition = {\n  duration: 0.6,\n  opacity: { duration: 0.2 },\n};\n\nconst pathVariants: Variants = {\n  normal: {\n    pathLength: 1,\n    opacity: 1,\n  },\n  animate: {\n    opacity: [0, 1],\n    pathLength: [0.5, 1],\n  },\n};\n\n// Higher-order component for icon animation\nconst withIconAnimation = (IconComponent: React.ComponentType<any>) => {\n  const AnimatedIcon = ({\n    isHovered = false,\n    className,\n    ...props\n  }: {\n    isHovered?: boolean;\n    className?: string;\n  }) => {\n    const controls = useAnimation();\n\n    useEffect(() => {\n      if (isHovered) {\n        controls.start(\"animate\");\n      } else {\n        controls.start(\"normal\");\n      }\n    }, [isHovered, controls]);\n\n    return (\n      <div className={className}>\n        <IconComponent controls={controls} {...props} />\n      </div>\n    );\n  };\n  AnimatedIcon.displayName = `Animated${IconComponent.displayName || IconComponent.name || 'Icon'}`;\n  return AnimatedIcon;\n};\n\n// Higher-order component for icon animation\nconst withChartIconAnimation = (IconComponent: React.ComponentType<any>) => {\n  const AnimatedChartIcon = ({\n    isHovered = false,\n    className,\n    ...props\n  }: {\n    isHovered?: boolean;\n    className?: string;\n  }) => {\n    const controls = useAnimation();\n\n    const handleHoverStart = useCallback(async () => {\n      await controls.start((i) => ({\n        pathLength: 0,\n        opacity: 0,\n        transition: { delay: i * 0.1, duration: 0.3 },\n      }));\n      await controls.start((i) => ({\n        pathLength: 1,\n        opacity: 1,\n        transition: { delay: i * 0.1, duration: 0.3 },\n      }));\n    }, [controls]);\n\n    const handleHoverEnd = useCallback(() => {\n      controls.start(\"normal\");\n    }, [controls]);\n\n    useEffect(() => {\n      if (isHovered) {\n        handleHoverStart();\n      } else {\n        handleHoverEnd();\n      }\n    }, [isHovered, handleHoverStart, handleHoverEnd]);\n\n    return (\n      <div className={className}>\n        <IconComponent\n          onMouseEnter={handleHoverStart}\n          onMouseLeave={handleHoverEnd}\n          controls={controls}\n          {...props}\n        />\n      </div>\n    );\n  };\n  AnimatedChartIcon.displayName = `AnimatedChart${IconComponent.displayName || IconComponent.name || 'Icon'}`;\n  return AnimatedChartIcon;\n};\n\n// Base icon components\nconst HomeIconBase = ({ controls }: { controls: any }) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"16\"\n    height=\"16\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    strokeWidth=\"2\"\n    strokeLinecap=\"round\"\n    strokeLinejoin=\"round\"\n  >\n    <path d=\"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n    <motion.path\n      d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"\n      variants={pathVariants}\n      transition={defaultTransition}\n      animate={controls}\n    />\n  </svg>\n);\n\n// Example of another icon with animation\nconst PlayIconBase = ({ controls }: { controls: any }) => (\n  <svg\n    xmlns=\"http://www.w3.org/2000/svg\"\n    width=\"16\"\n    height=\"16\"\n    viewBox=\"0 0 24 24\"\n    fill=\"none\"\n    stroke=\"currentColor\"\n    strokeWidth=\"2\"\n    strokeLinecap=\"round\"\n    strokeLinejoin=\"round\"\n  >\n    <motion.path\n      d=\"M5 3l14 9-14 9V3z\"\n      variants={playIconVariants}\n      transition={defaultTransition}\n      animate={controls}\n    />\n  </svg>\n);\n\nconst SettingsGearIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <motion.svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      transition={{ type: \"spring\", stiffness: 50, damping: 10 }}\n      variants={{\n        normal: {\n          rotate: 0,\n        },\n        animate: {\n          rotate: 90,\n        },\n      }}\n      animate={controls}\n    >\n      <path d=\"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z\" />\n      <circle cx=\"12\" cy=\"12\" r=\"3\" />\n    </motion.svg>\n  );\n};\n\nconst lineChartVariants2: Variants = {\n  visible: { pathLength: 1, opacity: 1 },\n  hidden: { pathLength: 0, opacity: 0 },\n};\nconst ChartColumnIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.path\n        d=\"M13 17V9\"\n        variants={lineChartVariants2}\n        transition={defaultTransition}\n        animate={controls}\n        initial=\"visible\"\n        custom={1}\n      />\n      <motion.path\n        d=\"M18 17V5\"\n        variants={lineChartVariants2}\n        transition={defaultTransition}\n        animate={controls}\n        initial=\"visible\"\n        custom={2}\n      />\n      <path d=\"M3 3v16a2 2 0 0 0 2 2h16\" />\n      <motion.path\n        d=\"M8 17v-3\"\n        variants={lineChartVariants2}\n        transition={defaultTransition}\n        animate={controls}\n        initial=\"visible\"\n        custom={0}\n      />\n    </svg>\n  );\n};\n\n// const defaultTransition: Transition = {\n//   duration: 0.9,\n//   ease: 'easeInOut',\n// };\n\n// const pathVariants: Variants = {\n//   normal: {\n//     rotate: 0,\n//     x: 0,\n//     y: 0,\n//   },\n//   hover: {\n//     rotate: [0, 4, 2, -3, 1, 0],\n//     x: [0, 0.7, -0.3, 0.5, 0.2, 0],\n//     y: [0, -0.2, 0.3, -0.2, 0.4, 0],\n//   },\n// };\n\nconst transition = (custom: number): Transition => ({\n  duration: 0.25,\n  delay: custom * 0.1,\n});\n\nconst variants: Variants = {\n  default: {\n    pathLength: 1,\n    opacity: 1,\n  },\n  normal: (custom: number) => ({\n    pathLength: 1,\n    opacity: 1,\n    transition: transition(custom),\n  }),\n  animate: (custom: number) => ({\n    pathLength: 0.5,\n    opacity: 1,\n    transition: transition(custom),\n  }),\n};\n\nconst ActivityLogsIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <motion.rect\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={0}\n        x=\"3\"\n        y=\"3\"\n        width=\"3\"\n        height=\"3\"\n        fill=\"currentColor\"\n        stroke=\"none\"\n      />\n      <motion.path\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={0}\n        d=\"M8 4.5 L21 4.5\"\n        strokeWidth=\"2\"\n      />\n\n      <motion.rect\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={1}\n        x=\"3\"\n        y=\"10\"\n        width=\"3\"\n        height=\"3\"\n        fill=\"currentColor\"\n        stroke=\"none\"\n      />\n      <motion.path\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={1}\n        d=\"M8 11.5 L21 11.5\"\n        strokeWidth=\"2\"\n      />\n\n      <motion.rect\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={2}\n        x=\"3\"\n        y=\"17\"\n        width=\"3\"\n        height=\"3\"\n        fill=\"currentColor\"\n        stroke=\"none\"\n      />\n      <motion.path\n        variants={variants}\n        initial=\"normal\"\n        animate={controls}\n        custom={2}\n        d=\"M8 18.5 L21 18.5\"\n        strokeWidth=\"2\"\n      />\n    </svg>\n  );\n};\n\nconst defaultTransition2: Transition = {\n  type: \"spring\",\n  stiffness: 200,\n  damping: 10,\n};\n\nconst pathVariants2: Variants = {\n  normal: {\n    rotate: 0,\n  },\n  animate: {\n    rotate: -20,\n  },\n};\n\nconst KeyOneBase = ({ controls }: { controls: any }) => {\n  return (\n    <motion.svg\n      viewBox=\"0 0 24 24\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      fill=\"currentColor\"\n      aria-hidden=\"true\"\n      animate={controls}\n      initial=\"normal\"\n      variants={pathVariants2}\n      transition={defaultTransition2}\n    >\n      <path d=\"M10.7577 11.8281L18.6066 3.97919L20.0208 5.3934L18.6066 6.80761L21.0815 9.28249L19.6673 10.6967L17.1924 8.22183L15.7782 9.63604L17.8995 11.7574L16.4853 13.1716L14.364 11.0503L12.1719 13.2423C13.4581 15.1837 13.246 17.8251 11.5355 19.5355C9.58291 21.4882 6.41709 21.4882 4.46447 19.5355C2.51184 17.5829 2.51184 14.4171 4.46447 12.4645C6.17493 10.754 8.81633 10.5419 10.7577 11.8281ZM10.1213 18.1213C11.2929 16.9497 11.2929 15.0503 10.1213 13.8787C8.94975 12.7071 7.05025 12.7071 5.87868 13.8787C4.70711 15.0503 4.70711 16.9497 5.87868 18.1213C7.05025 19.2929 8.94975 19.2929 10.1213 18.1213Z\" />\n    </motion.svg>\n  );\n};\n\nconst frameVariants: Variants = {\n  normal: { opacity: 1 },\n  animate: { opacity: 1 },\n};\n\nconst lineVariants: Variants = {\n  normal: { pathLength: 1, opacity: 1 },\n  animate: { pathLength: 0, opacity: 0 },\n};\n\nconst ScanTextIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.path\n        d=\"M3 7V5a2 2 0 0 1 2-2h2\"\n        variants={frameVariants}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M17 3h2a2 2 0 0 1 2 2v2\"\n        variants={frameVariants}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M21 17v2a2 2 0 0 1-2 2h-2\"\n        variants={frameVariants}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M7 21H5a2 2 0 0 1-2-2v-2\"\n        variants={frameVariants}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M7 8h8\"\n        variants={lineVariants}\n        initial=\"animate\"\n        animate={controls}\n        custom={0}\n      />\n      <motion.path\n        d=\"M7 12h10\"\n        variants={lineVariants}\n        initial=\"animate\"\n        animate={controls}\n        custom={1}\n      />\n      <motion.path\n        d=\"M7 16h6\"\n        variants={lineVariants}\n        initial=\"animate\"\n        animate={controls}\n        custom={2}\n      />\n    </svg>\n  );\n};\n\n// Create animated versions of icons\nconst HomeIcon = withIconAnimation(HomeIconBase);\nconst PlayIcon = withIconAnimation(PlayIconBase);\nconst SettingsGearIcon = withIconAnimation(SettingsGearIconBase);\nconst ChartColumnIcon = withChartIconAnimation(ChartColumnIconBase);\nconst ActivityLogsIcon = withIconAnimation(ActivityLogsIconBase);\nconst ScanTextIcon = withIconAnimation(ScanTextIconBase);\nconst KeyIcon = withIconAnimation(KeyOneBase);\n\n// Logout icon with animation\nconst LogOutIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <motion.svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <path d=\"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" />\n      <motion.polyline\n        points=\"16 17 21 12 16 7\"\n        variants={{\n          normal: { x: 0 },\n          animate: { x: [0, 3, 0] },\n        }}\n        transition={{ duration: 0.5, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.line\n        x1=\"21\"\n        y1=\"12\"\n        x2=\"9\"\n        y2=\"12\"\n        variants={{\n          normal: { x1: 21, x2: 9 },\n          animate: { x1: [21, 24, 21], x2: [9, 12, 9] },\n        }}\n        transition={{ duration: 0.5, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n    </motion.svg>\n  );\n};\n\n// External link icon with animation\nconst ExternalLinkIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n      <motion.polyline\n        points=\"15 3 21 3 21 9\"\n        variants={{\n          normal: { rotate: 0, scale: 1 },\n          animate: { rotate: [0, -10, 0], scale: [1, 1.1, 1] },\n        }}\n        transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.line\n        x1=\"10\"\n        y1=\"14\"\n        x2=\"21\"\n        y2=\"3\"\n        variants={pathVariants}\n        transition={defaultTransition}\n        animate={controls}\n      />\n    </svg>\n  );\n};\n\n// File text icon with animation\nconst FileTextIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n      <motion.polyline\n        points=\"14 2 14 8 20 8\"\n        variants={{\n          normal: { pathLength: 1, opacity: 1 },\n          animate: { pathLength: [1, 0, 1], opacity: [1, 0.5, 1] },\n        }}\n        transition={{ duration: 0.6, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.line\n        x1=\"16\"\n        y1=\"13\"\n        x2=\"8\"\n        y2=\"13\"\n        variants={lineVariants}\n        initial=\"animate\"\n        animate={controls}\n        custom={0}\n      />\n      <motion.line\n        x1=\"16\"\n        y1=\"17\"\n        x2=\"8\"\n        y2=\"17\"\n        variants={lineVariants}\n        initial=\"animate\"\n        animate={controls}\n        custom={1}\n      />\n    </svg>\n  );\n};\n\n// Book open icon with animation\nconst BookOpenIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.path\n        d=\"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z\"\n        variants={{\n          normal: { rotate: 0 },\n          animate: { rotate: [-2, 2, -2] },\n        }}\n        transition={{ duration: 0.6, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z\"\n        variants={{\n          normal: { rotate: 0 },\n          animate: { rotate: [2, -2, 2] },\n        }}\n        transition={{ duration: 0.6, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n    </svg>\n  );\n};\n\n// Message square icon with animation\nconst MessageSquareIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <path d=\"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z\" />\n      <motion.circle\n        cx=\"8\"\n        cy=\"10\"\n        r=\"1\"\n        fill=\"currentColor\"\n        variants={{\n          normal: { scale: 1, opacity: 1 },\n          animate: { scale: [1, 1.5, 1], opacity: [1, 0.5, 1] },\n        }}\n        transition={{ duration: 0.4, delay: 0 }}\n        animate={controls}\n      />\n      <motion.circle\n        cx=\"12\"\n        cy=\"10\"\n        r=\"1\"\n        fill=\"currentColor\"\n        variants={{\n          normal: { scale: 1, opacity: 1 },\n          animate: { scale: [1, 1.5, 1], opacity: [1, 0.5, 1] },\n        }}\n        transition={{ duration: 0.4, delay: 0.1 }}\n        animate={controls}\n      />\n      <motion.circle\n        cx=\"16\"\n        cy=\"10\"\n        r=\"1\"\n        fill=\"currentColor\"\n        variants={{\n          normal: { scale: 1, opacity: 1 },\n          animate: { scale: [1, 1.5, 1], opacity: [1, 0.5, 1] },\n        }}\n        transition={{ duration: 0.4, delay: 0.2 }}\n        animate={controls}\n      />\n    </svg>\n  );\n};\n\nconst LogOutIcon = withIconAnimation(LogOutIconBase);\nconst ExternalLinkIcon = withIconAnimation(ExternalLinkIconBase);\nconst FileTextIcon = withIconAnimation(FileTextIconBase);\nconst BookOpenIcon = withIconAnimation(BookOpenIconBase);\nconst MessageSquareIcon = withIconAnimation(MessageSquareIconBase);\n\n// Bell icon with animation\nconst BellIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <motion.svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.path\n        d=\"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9\"\n        variants={{\n          normal: { rotate: 0 },\n          animate: { rotate: [-10, 10, -10, 10, 0] },\n        }}\n        transition={{ duration: 0.5, ease: \"easeInOut\" }}\n        animate={controls}\n        style={{ transformOrigin: \"50% 20%\" }}\n      />\n      <motion.path\n        d=\"M10.3 21a1.94 1.94 0 0 0 3.4 0\"\n        variants={{\n          normal: { scale: 1 },\n          animate: { scale: [1, 1.1, 1] },\n        }}\n        transition={{ duration: 0.5, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n    </motion.svg>\n  );\n};\n\n// Gift icon with animation\nconst GiftIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      {/* Gift box bottom */}\n      <polyline points=\"20 12 20 22 4 22 4 12\" />\n      <line x1=\"12\" y1=\"22\" x2=\"12\" y2=\"12\" />\n\n      {/* Gift lid with opening animation */}\n      <motion.g\n        variants={{\n          normal: { y: 0, rotate: 0 },\n          animate: { y: -3, rotate: -8 },\n        }}\n        transition={{ duration: 0.4, ease: \"easeOut\" }}\n        animate={controls}\n        style={{ transformOrigin: \"2px 9px\" }}\n      >\n        <rect x=\"2\" y=\"7\" width=\"20\" height=\"5\" />\n        <line x1=\"12\" y1=\"7\" x2=\"12\" y2=\"12\" />\n\n        {/* Left bow */}\n        <motion.path\n          d=\"M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z\"\n          variants={{\n            normal: { scale: 1 },\n            animate: { scale: [1, 1.1, 1] },\n          }}\n          transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        />\n\n        {/* Right bow */}\n        <motion.path\n          d=\"M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z\"\n          variants={{\n            normal: { scale: 1 },\n            animate: { scale: [1, 1.1, 1] },\n          }}\n          transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        />\n      </motion.g>\n    </svg>\n  );\n};\n\n// HelpCircle icon with animation\nconst HelpCircleIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.circle\n        cx=\"12\"\n        cy=\"12\"\n        r=\"10\"\n        variants={{\n          normal: { rotate: 0 },\n          animate: { rotate: 360 },\n        }}\n        transition={{ duration: 0.6, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\"\n        variants={{\n          normal: { opacity: 1 },\n          animate: { opacity: [1, 0.5, 1] },\n        }}\n        transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.line\n        x1=\"12\"\n        y1=\"17\"\n        x2=\"12.01\"\n        y2=\"17\"\n        variants={{\n          normal: { scale: 1 },\n          animate: { scale: [1, 1.5, 1] },\n        }}\n        transition={{ duration: 0.4, ease: \"easeInOut\", delay: 0.2 }}\n        animate={controls}\n      />\n    </svg>\n  );\n};\n\nconst BellIcon = withIconAnimation(BellIconBase);\nconst GiftIcon = withIconAnimation(GiftIconBase);\nconst HelpCircleIcon = withIconAnimation(HelpCircleIconBase);\n\n// SquareArrowUp icon with animation (for Upgrade button)\nconst SquareArrowUpIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" />\n      <motion.path\n        d=\"m8 12 4-4 4 4\"\n        variants={{\n          normal: { y: 0 },\n          animate: { y: [-2, 0] },\n        }}\n        transition={{ duration: 0.3, ease: \"easeOut\" }}\n        animate={controls}\n      />\n      <motion.path\n        d=\"M12 16V8\"\n        variants={{\n          normal: { scaleY: 1 },\n          animate: { scaleY: [0.8, 1] },\n        }}\n        transition={{ duration: 0.3, ease: \"easeOut\" }}\n        animate={controls}\n        style={{ transformOrigin: \"50% 100%\" }}\n      />\n    </svg>\n  );\n};\n\nconst SquareArrowUpIcon = withIconAnimation(SquareArrowUpIconBase);\n\n// Code icon with animation\nconst CodeIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n    >\n      <motion.polyline\n        points=\"16 18 22 12 16 6\"\n        variants={{\n          normal: { x: 0 },\n          animate: { x: [0, 2, 0] },\n        }}\n        transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n      <motion.polyline\n        points=\"8 6 2 12 8 18\"\n        variants={{\n          normal: { x: 0 },\n          animate: { x: [0, -2, 0] },\n        }}\n        transition={{ duration: 0.4, ease: \"easeInOut\" }}\n        animate={controls}\n      />\n    </svg>\n  );\n};\n\nconst CodeIcon = withIconAnimation(CodeIconBase);\n\n// TestTube icon for Extract Playground (Lucide TestTube2 icon without bubble)\nconst BeakerIconBase = ({ controls }: { controls: any }) => {\n  return (\n    <motion.svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"16\"\n      height=\"16\"\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      variants={{\n        normal: { rotate: 0 },\n        animate: { rotate: [-8, 8, -8] },\n      }}\n      transition={{\n        duration: 0.8,\n        ease: \"easeInOut\",\n        times: [0, 0.5, 1],\n      }}\n      animate={controls}\n    >\n      <path d=\"M21 7 6.82 21.18a2.83 2.83 0 0 1-3.99-.01v0a2.83 2.83 0 0 1 0-4L17 3\" />\n      <path d=\"m16 2 6 6\" />\n    </motion.svg>\n  );\n};\n\nconst BeakerIcon = withIconAnimation(BeakerIconBase);\n\nexport {\n  HomeIcon,\n  PlayIcon,\n  SettingsGearIcon,\n  ChartColumnIcon,\n  ActivityLogsIcon,\n  KeyIcon,\n  ScanTextIcon,\n  LogOutIcon,\n  ExternalLinkIcon,\n  FileTextIcon,\n  BookOpenIcon,\n  MessageSquareIcon,\n  BellIcon,\n  GiftIcon,\n  HelpCircleIcon,\n  SquareArrowUpIcon,\n  CodeIcon,\n  BeakerIcon,\n};\n"
  },
  {
    "path": "components/shared/icons/arrow-animated.tsx",
    "content": "import { cx } from \"class-variance-authority\";\n\nexport function ArrowAnimated({\n  className,\n  ...props\n}: React.HTMLAttributes<SVGElement>) {\n  return (\n    <svg\n      className={cx(\"-mr-1 ml-1.5 stroke-[1.5px]\", className)}\n      fill=\"none\"\n      stroke=\"currentColor\"\n      width=\"11\"\n      height=\"11\"\n      viewBox=\"0 0 10 10\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      <path\n        className=\"opacity-0 transition group-hover:opacity-100\"\n        d=\"M0 5h7\"\n      />\n      <path\n        className=\"transition group-hover:translate-x-[3px]\"\n        d=\"M1 1l4 4-4 4\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/check.tsx",
    "content": "export default function Check() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        clipRule=\"evenodd\"\n        d=\"M10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM12.8305 8.59995C13.0928 8.27937 13.0455 7.80685 12.7249 7.54455C12.4043 7.28226 11.9318 7.32951 11.6695 7.65009L8.81932 11.1337L7.90533 10.2197C7.61244 9.9268 7.13756 9.9268 6.84467 10.2197C6.55178 10.5126 6.55178 10.9875 6.84467 11.2804L8.34467 12.7804C8.4945 12.9302 8.70073 13.0096 8.91236 12.9991C9.12399 12.9885 9.32129 12.8889 9.45547 12.725L12.8305 8.59995Z\"\n        fill=\"#FA5D19\"\n        fillRule=\"evenodd\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/chevron-slide.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\n\ntype Direction = \"left\" | \"right\";\n\ninterface ChevronSlideProps extends React.SVGAttributes<SVGElement> {\n  direction?: Direction;\n  size?: number; // pixel size for width/height\n}\n\nexport function ChevronSlide({\n  direction = \"right\",\n  size = 16,\n  className,\n  ...props\n}: ChevronSlideProps) {\n  const translateClass =\n    direction === \"right\"\n      ? \"group-hover:translate-x-8\"\n      : \"group-hover:-translate-x-8\";\n  const orientationClass = direction === \"right\" ? \"\" : \"rotate-180\";\n\n  return (\n    <svg\n      className={cn(\n        \"transition-all\",\n        translateClass,\n        orientationClass,\n        className,\n      )}\n      fill=\"none\"\n      height={size}\n      width={size}\n      viewBox=\"0 0 20 20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      aria-hidden=\"true\"\n      {...props}\n    >\n      <path\n        d=\"M8.5 13L11.5 10L8.5 7\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n\nexport default ChevronSlide;\n"
  },
  {
    "path": "components/shared/icons/copied.tsx",
    "content": "export default function CopiedIcon() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M5.1875 10.974L8.075 13.8959L14.8125 6.10425\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/copy.tsx",
    "content": "export default function CopyIcon() {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"20\"\n      viewBox=\"0 0 20 20\"\n      width=\"20\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n    >\n      <path\n        d=\"M7.83333 7.83325V4.66659C7.83333 4.20635 8.20643 3.83325 8.66667 3.83325H15.3333C15.7936 3.83325 16.1667 4.20635 16.1667 4.66659V11.3333C16.1667 11.7935 15.7936 12.1666 15.3333 12.1666H12.1667M11.3333 7.83325H4.66667C4.20643 7.83325 3.83333 8.20635 3.83333 8.66659V15.3333C3.83333 15.7935 4.20643 16.1666 4.66667 16.1666H11.3333C11.7936 16.1666 12.1667 15.7935 12.1667 15.3333V8.66659C12.1667 8.20635 11.7936 7.83325 11.3333 7.83325Z\"\n        stroke=\"currentColor\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n        strokeWidth=\"1.25\"\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/curve.tsx",
    "content": "interface CurveProps extends React.SVGAttributes<SVGSVGElement> {\n  fill?: string;\n}\n\nexport default function Curve({\n  fill = \"var(--border-faint)\",\n  ...props\n}: CurveProps) {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"11\"\n      viewBox=\"0 0 11 11\"\n      width=\"11\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n    >\n      <path\n        d=\"M11 1L11 11L10 11L10 7C10 3.68629 7.31371 1 4 1L-4.37114e-08 1L0 -4.80825e-07L11 4.37114e-07L11 1Z\"\n        fill={fill}\n      />\n    </svg>\n  );\n}\n"
  },
  {
    "path": "components/shared/icons/fingerprint-icon.tsx",
    "content": "\"use client\";\n\nimport type { Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport {\n  forwardRef,\n  useCallback,\n  useEffect,\n  useImperativeHandle,\n  useRef,\n} from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nexport interface FingerprintIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface FingerprintIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n  autoAnimate?: boolean;\n  animationDelay?: number;\n}\n\nconst pathVariants: Variants = {\n  normal: { pathLength: 1, opacity: 1 },\n  animate: {\n    opacity: [0, 0, 1, 1, 1],\n    pathLength: [0.1, 0.3, 0.5, 0.7, 0.9, 1],\n    transition: {\n      opacity: { duration: 0.5 },\n      pathLength: {\n        duration: 2,\n      },\n    },\n  },\n};\n\nconst FingerprintIcon = forwardRef<FingerprintIconHandle, FingerprintIconProps>(\n  (\n    {\n      onMouseEnter,\n      onMouseLeave,\n      className,\n      size = 28,\n      autoAnimate = true,\n      animationDelay = 0,\n      ...props\n    },\n    ref,\n  ) => {\n    const controls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: () => controls.start(\"animate\"),\n        stopAnimation: () => controls.start(\"normal\"),\n      };\n    });\n\n    useEffect(() => {\n      if (autoAnimate && !isControlledRef.current) {\n        const timer = setTimeout(() => {\n          controls.start(\"animate\");\n        }, animationDelay);\n        return () => clearTimeout(timer);\n      }\n    }, [autoAnimate, animationDelay, controls]);\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (!isControlledRef.current) {\n          controls.start(\"animate\");\n        }\n        onMouseEnter?.(e);\n      },\n      [controls, onMouseEnter],\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (!isControlledRef.current) {\n          controls.start(\"normal\");\n        }\n        onMouseLeave?.(e);\n      },\n      [controls, onMouseLeave],\n    );\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <svg\n          xmlns=\"http://www.w3.org/2000/svg\"\n          width={size}\n          height={size}\n          viewBox=\"0 0 24 24\"\n          fill=\"none\"\n          stroke=\"currentColor\"\n          strokeWidth=\"2\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n        >\n          <path\n            d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M14 13.12c0 2.38 0 6.38-1 8.88\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M14 13.12c0 2.38 0 6.38-1 8.88\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M17.29 21.02c.12-.6.43-2.3.5-3.02\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M2 12a10 10 0 0 1 18-6\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M2 12a10 10 0 0 1 18-6\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path d=\"M2 16h.01\" strokeOpacity={0.4} strokeWidth=\"2\" fill=\"none\" />\n          <motion.path\n            d=\"M2 16h.01\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M21.8 16c.2-2 .131-5.354 0-6\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M21.8 16c.2-2 .131-5.354 0-6\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M8.65 22c.21-.66.45-1.32.57-2\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M8.65 22c.21-.66.45-1.32.57-2\"\n            variants={pathVariants}\n            animate={controls}\n          />\n\n          <path\n            d=\"M9 6.8a6 6 0 0 1 9 5.2v2\"\n            strokeOpacity={0.4}\n            strokeWidth=\"2\"\n            fill=\"none\"\n          />\n          <motion.path\n            d=\"M9 6.8a6 6 0 0 1 9 5.2v2\"\n            variants={pathVariants}\n            animate={controls}\n          />\n        </svg>\n      </div>\n    );\n  },\n);\n\nFingerprintIcon.displayName = \"FingerprintIcon\";\n\nexport { FingerprintIcon };\n"
  },
  {
    "path": "components/shared/icons/openai.tsx",
    "content": "import * as React from \"react\";\n\nfunction IconOpenai(props: React.SVGProps<SVGSVGElement>) {\n  return (\n    <svg\n      viewBox=\"0 0 24 24\"\n      fill=\"currentColor\"\n      height=\"1em\"\n      width=\"1em\"\n      {...props}\n    >\n      <title>OpenAI</title>\n      <path d=\"M22.282 9.821a5.985 5.985 0 00-.516-4.91 6.046 6.046 0 00-6.51-2.9A6.065 6.065 0 004.981 4.18a5.985 5.985 0 00-3.998 2.9 6.046 6.046 0 00.743 7.097 5.98 5.98 0 00.51 4.911 6.051 6.051 0 006.515 2.9A5.985 5.985 0 0013.26 24a6.056 6.056 0 005.772-4.206 5.99 5.99 0 003.997-2.9 6.056 6.056 0 00-.747-7.073zM13.26 22.43a4.476 4.476 0 01-2.876-1.04l.141-.081 4.779-2.758a.795.795 0 00.392-.681v-6.737l2.02 1.168a.071.071 0 01.038.052v5.583a4.504 4.504 0 01-4.494 4.494zM3.6 18.304a4.47 4.47 0 01-.535-3.014l.142.085 4.783 2.759a.771.771 0 00.78 0l5.843-3.369v2.332a.08.08 0 01-.033.062L9.74 19.95a4.5 4.5 0 01-6.14-1.646zM2.34 7.896a4.485 4.485 0 012.366-1.973V11.6a.766.766 0 00.388.676l5.815 3.355-2.02 1.168a.076.076 0 01-.071 0l-4.83-2.786A4.504 4.504 0 012.34 7.872zm16.597 3.855l-5.833-3.387L15.119 7.2a.076.076 0 01.071 0l4.83 2.791a4.494 4.494 0 01-.676 8.105v-5.678a.79.79 0 00-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776 0 00-.785 0L9.409 9.23V6.897a.066.066 0 01.028-.061l4.83-2.787a4.5 4.5 0 016.68 4.66zm-12.64 4.135l-2.02-1.164a.08.08 0 01-.038-.057V6.075a4.5 4.5 0 017.375-3.453l-.142.08-4.778 2.758a.795.795 0 00-.393.681zm1.097-2.365l2.602-1.5 2.607 1.5v2.999l-2.597 1.5-2.607-1.5z\" />\n    </svg>\n  );\n}\n\nexport default IconOpenai;\n"
  },
  {
    "path": "components/shared/icons/source-icon.tsx",
    "content": "import { JSXElementConstructor } from \"react\";\nimport Image from \"next/image\";\n\nexport const SourceIcon = ({ id }: { id: string }) => {\n  return (\n    <div className=\"relative\">\n      <div className=\"\">\n        {id && (\n          <Image\n            alt={id}\n            width={36}\n            height={36}\n            className=\"h-10 w-10 aspect-square\"\n            src={`/icons/${id}.svg`}\n          />\n        )}\n      </div>\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/shared/icons/symbol-colored.tsx",
    "content": "import React from \"react\";\n\nconst SymbolColored = ({ ...props }) => {\n  return (\n    <svg\n      width=\"50\"\n      height=\"72\"\n      viewBox=\"0 0 50 72\"\n      fill=\"none\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n    >\n      <path\n        d=\"M41.7154 23.1929C38.9531 24.0129 36.8707 25.8677 35.3457 27.8826C35.0182 28.3151 34.3358 27.9901 34.4658 27.4601C37.3856 15.4534 33.5283 5.47401 21.5039 0.561817C20.894 0.311833 20.259 0.859299 20.419 1.49926C25.8887 23.4604 2.88236 21.608 5.78971 46.504C5.83971 46.9314 5.35973 47.2239 5.00975 46.9739C3.9198 46.1915 2.70237 44.5591 1.86741 43.4116C1.62242 43.0742 1.09245 43.1692 0.979951 43.5716C0.314984 45.9765 0 48.2413 0 50.4912C0 59.2407 4.49727 66.9427 11.3044 71.4074C11.6944 71.6624 12.1944 71.2974 12.0619 70.8499C11.7119 69.675 11.5144 68.4351 11.4994 67.1527C11.4994 66.3652 11.5494 65.5603 11.6719 64.8103C11.9569 62.9254 12.6119 61.1306 13.7118 59.4957C17.4841 53.8335 25.0462 48.3638 23.8388 40.9368C23.7613 40.4668 24.3163 40.1569 24.6663 40.4793C29.9935 45.3465 31.0485 51.8936 30.1735 57.7658C30.0985 58.2757 30.7385 58.5482 31.061 58.1482C31.8759 57.1283 32.8709 56.2334 33.9533 55.5609C34.2233 55.3934 34.5833 55.5209 34.6858 55.8209C35.2882 57.5733 36.1832 59.2182 37.0281 60.8631C38.0381 62.8404 38.5756 65.0978 38.4906 67.4877C38.4481 68.6501 38.2556 69.775 37.9331 70.8449C37.7956 71.2974 38.2906 71.6749 38.6881 71.4149C45.5002 66.9502 50 59.2482 50 50.4937C50 47.4514 49.4675 44.4691 48.4601 41.6743C46.3477 35.8121 40.988 31.4099 42.3429 23.7704C42.4079 23.4054 42.0704 23.0879 41.7154 23.1929Z\"\n        fill=\"#FA5D19\"\n        style={{ fill: \"#FA5D19\", fillOpacity: 1 }}\n      />\n    </svg>\n  );\n};\n\nexport default SymbolColored;\n"
  },
  {
    "path": "components/shared/icons/symbol-white.tsx",
    "content": "import React from \"react\";\n\nconst SymbolWhite = ({ ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"50\"\n      height=\"72\"\n      viewBox=\"0 0 50 72\"\n      fill=\"none\"\n      {...props}\n    >\n      <path\n        d=\"M41.7154 23.1929C38.9531 24.0129 36.8707 25.8677 35.3457 27.8826C35.0182 28.3151 34.3358 27.9901 34.4658 27.4601C37.3856 15.4534 33.5283 5.47401 21.5039 0.561817C20.894 0.311833 20.259 0.859299 20.419 1.49926C25.8887 23.4604 2.88236 21.608 5.78971 46.504C5.83971 46.9314 5.35973 47.2239 5.00975 46.9739C3.9198 46.1915 2.70237 44.5591 1.86741 43.4116C1.62242 43.0742 1.09245 43.1692 0.979951 43.5716C0.314984 45.9765 0 48.2413 0 50.4912C0 59.2407 4.49727 66.9427 11.3044 71.4074C11.6944 71.6624 12.1944 71.2974 12.0619 70.8499C11.7119 69.675 11.5144 68.4351 11.4994 67.1527C11.4994 66.3652 11.5494 65.5603 11.6719 64.8103C11.9569 62.9254 12.6119 61.1306 13.7118 59.4957C17.4841 53.8335 25.0462 48.3638 23.8388 40.9368C23.7613 40.4668 24.3163 40.1569 24.6663 40.4793C29.9935 45.3465 31.0485 51.8936 30.1735 57.7658C30.0985 58.2757 30.7385 58.5482 31.061 58.1482C31.8759 57.1283 32.8709 56.2334 33.9533 55.5609C34.2233 55.3934 34.5833 55.5209 34.6858 55.8209C35.2882 57.5733 36.1832 59.2182 37.0281 60.8631C38.0381 62.8404 38.5756 65.0978 38.4906 67.4877C38.4481 68.6501 38.2556 69.775 37.9331 70.8449C37.7956 71.2974 38.2906 71.6749 38.6881 71.4149C45.5002 66.9502 50 59.2482 50 50.4937C50 47.4514 49.4675 44.4691 48.4601 41.6743C46.3477 35.8121 40.988 31.4099 42.3429 23.7704C42.4079 23.4054 42.0704 23.0879 41.7154 23.1929Z\"\n        fill=\"white\"\n      />\n    </svg>\n  );\n};\n\nexport default SymbolWhite;\n"
  },
  {
    "path": "components/shared/icons/tremor-placeholder.tsx",
    "content": "import type { SVGProps } from \"react\";\n\nexport const TremorPlaceholder = (props: SVGProps<SVGSVGElement>) => (\n  <svg className={props.className} fill=\"none\" viewBox=\"0 0 92 92\" {...props}>\n    <g clipPath=\"url(#clip0_10096_2462)\">\n      <mask\n        id=\"mask0_10096_2462\"\n        width={92}\n        height={92}\n        x={0}\n        y={0}\n        maskUnits=\"userSpaceOnUse\"\n        style={{\n          maskType: \"luminance\",\n        }}\n      >\n        <path fill=\"white\" d=\"M92 0H0V92H92V0Z\" />\n      </mask>\n      <g mask=\"url(#mask0_10096_2462)\">\n        <path\n          fill=\"#DEDEDE\"\n          d=\"M1.09521 20.809L19.7581 3.28516H72.2419L90.9047 20.809H1.09521Z\"\n        />\n        <path fill=\"#C9C9C9\" d=\"M2 20H89V88.5H2V20Z\" />\n        <path\n          stroke=\"#8C8C8C\"\n          strokeWidth={3.28571}\n          d=\"M17.8761 2.97375L3.49687 17.8023C2.30794 19.0283 1.64307 20.6691 1.64307 22.377V85.5C1.64307 87.7091 3.43392 89.5 5.64306 89.5H86.3574C88.5665 89.5 90.3574 87.7091 90.3574 85.5V22.8208C90.3574 20.8283 89.5817 18.9141 88.1945 17.4837L74.1244 2.97375C73.2992 2.12284 72.1646 1.64258 70.9793 1.64258H21.0211C19.8358 1.64258 18.7012 2.12284 17.8761 2.97375Z\"\n        />\n        <path\n          stroke=\"#8C8C8C\"\n          strokeWidth={3.28571}\n          d=\"M2.19043 19.7129H90.3571\"\n        />\n        <path\n          fill=\"#7D7D7D\"\n          fillOpacity={0.8}\n          d=\"M37.7855 3.28516H54.214L56.9521 19.7137V34.7564C56.9521 36.7315 55.3509 38.3328 53.3757 38.3328H38.6238C36.6486 38.3328 35.0474 36.7315 35.0474 34.7564V19.7137L37.7855 3.28516Z\"\n        />\n        <path\n          fill=\"white\"\n          d=\"M48.2744 63.3867H14.2329C12.9363 63.3867 11.8853 64.3853 11.8853 65.617V77.8837C11.8853 79.1155 12.9363 80.114 14.2329 80.114H48.2744C49.571 80.114 50.6221 79.1155 50.6221 77.8837V65.617C50.6221 64.3853 49.571 63.3867 48.2744 63.3867Z\"\n        />\n        <path\n          stroke=\"black\"\n          strokeOpacity={0.07}\n          strokeWidth={1.09524}\n          d=\"M48.1495 62.9473H14.3583C12.7495 62.9473 11.4453 64.179 11.4453 65.6985V77.8037C11.4453 79.3232 12.7495 80.5549 14.3583 80.5549H48.1495C49.7583 80.5549 51.0625 79.3232 51.0625 77.8037V65.6985C51.0625 64.179 49.7583 62.9473 48.1495 62.9473Z\"\n        />\n        <path\n          fill=\"#0F172A\"\n          d=\"M17.7102 75.4604C16.7747 75.4604 15.9759 74.9874 15.9759 73.7891V71.382H15.1034V70.1627H16.0284V68.7647L17.4474 68.2392V70.1627H18.5932V71.382H17.4474V73.4422C17.4474 73.9047 17.6787 74.136 18.1727 74.136C18.3304 74.136 18.4775 74.1045 18.5932 74.0729V75.3448C18.4565 75.3868 18.0781 75.4604 17.7102 75.4604ZM19.5597 75.3027V70.1627H21.0103V70.909C21.2625 70.3414 21.7355 69.9946 22.3872 69.9946C22.4923 69.9946 22.7026 70.0156 22.7656 70.0261V71.5187C22.5975 71.4766 22.4293 71.4661 22.2296 71.4661C21.6725 71.4661 21.1574 71.834 21.0313 72.3281V75.3027H19.5597ZM25.8567 75.4604C24.3746 75.4604 23.1553 74.4723 23.1553 72.6959C23.1553 71.0772 24.322 69.9946 25.7936 69.9946C27.4229 69.9946 28.3478 71.1298 28.3478 72.717C28.3478 72.8431 28.3373 73.0638 28.3268 73.1479H24.6899C24.7215 73.8522 25.3732 74.2411 26.0143 74.2411C26.7081 74.2411 27.2967 74.0519 27.9694 73.6104V74.8823C27.4964 75.1871 26.8868 75.4604 25.8567 75.4604ZM24.7215 72.1599H26.8658C26.8342 71.6764 26.4979 71.2139 25.7936 71.2139C25.1524 71.2139 24.753 71.6974 24.7215 72.1599ZM35.2192 69.9946C36.1862 69.9946 37.0586 70.6568 37.0586 71.8761V75.3027H35.587V72.244C35.587 71.6869 35.2822 71.34 34.7882 71.34C34.4203 71.34 34.126 71.5502 33.9158 71.8445V71.8761V75.3027H32.4442V72.244C32.4442 71.6869 32.1499 71.34 31.6558 71.34C31.2669 71.34 30.9726 71.5607 30.7624 71.8761V75.3027H29.2908V70.1627H30.7414V70.5727C31.0252 70.2468 31.4561 69.9946 32.1078 69.9946C32.707 69.9946 33.2641 70.2468 33.5899 70.7303C33.8527 70.4255 34.3677 69.9946 35.2192 69.9946ZM40.6916 75.4604C39.0309 75.4604 37.8957 74.2621 37.8957 72.717C37.8957 71.1823 39.0309 69.9946 40.6916 69.9946C42.3524 69.9946 43.4981 71.1823 43.4981 72.717C43.4981 74.2621 42.3524 75.4604 40.6916 75.4604ZM40.6916 74.0729C41.4064 74.0729 41.974 73.5684 41.974 72.717C41.974 71.8866 41.4064 71.3715 40.6916 71.3715C39.9874 71.3715 39.4198 71.8866 39.4198 72.717C39.4198 73.5684 39.9874 74.0729 40.6916 74.0729ZM44.4418 75.3027V70.1627H45.8923V70.909C46.1446 70.3414 46.6176 69.9946 47.2693 69.9946C47.3744 69.9946 47.5846 70.0156 47.6477 70.0261V71.5187C47.4795 71.4766 47.3113 71.4661 47.1116 71.4661C46.5545 71.4661 46.0395 71.834 45.9133 72.3281V75.3027H44.4418Z\"\n        />\n      </g>\n    </g>\n    <defs>\n      <clipPath id=\"clip0_10096_2462\">\n        <rect width={92} height={92} fill=\"white\" />\n      </clipPath>\n    </defs>\n  </svg>\n);\n"
  },
  {
    "path": "components/shared/icons/wordmark-colored.tsx",
    "content": "import React from \"react\";\n\nconst WordmarkColored = ({ ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"172\"\n      height=\"40\"\n      viewBox=\"0 0 172 40\"\n      fill=\"none\"\n      {...props}\n    >\n      <path\n        d=\"M23.3606 12.8281C21.8137 13.2873 20.6476 14.3261 19.7936 15.4544C19.6102 15.6966 19.228 15.5146 19.3008 15.2178C20.936 8.49401 18.7759 2.90556 12.0422 0.154735C11.7006 0.0147436 11.345 0.321324 11.4346 0.679702C14.4977 12.9779 1.61412 11.9406 3.24224 25.8823C3.27024 26.1217 3.00145 26.2855 2.80546 26.1455C2.19509 25.7073 1.51332 24.7932 1.04575 24.1506C0.908555 23.9616 0.611769 24.0148 0.548773 24.2402C0.176391 25.5869 0 26.8553 0 28.1152C0 33.0149 2.51847 37.328 6.33048 39.8283C6.54887 39.9711 6.82886 39.7667 6.75466 39.5161C6.55867 38.8581 6.44808 38.1638 6.43968 37.4456C6.43968 37.0046 6.46768 36.5539 6.53627 36.1339C6.69587 35.0784 7.06265 34.0732 7.67862 33.1577C9.79111 29.9869 14.0259 26.9239 13.3497 22.7647C13.3063 22.5015 13.6171 22.328 13.8131 22.5085C16.7964 25.2342 17.3871 28.9005 16.8972 32.1889C16.8552 32.4745 17.2135 32.6271 17.3941 32.4031C17.8505 31.832 18.4077 31.3308 19.0138 30.9542C19.165 30.8604 19.3666 30.9318 19.424 31.0998C19.7614 32.0811 20.2626 33.0023 20.7358 33.9234C21.3013 35.0308 21.6023 36.2949 21.5547 37.6332C21.5309 38.2842 21.4231 38.9141 21.2425 39.5133C21.1655 39.7667 21.4427 39.9781 21.6653 39.8325C25.4801 37.3322 28 33.0191 28 28.1166C28 26.4129 27.7018 24.7428 27.1376 23.1777C25.9547 19.8949 22.9533 17.4297 23.712 13.1515C23.7484 12.9471 23.5594 12.7693 23.3606 12.8281Z\"\n        fill=\"#FA5D19\"\n      />\n      <path\n        d=\"M41 34.0521V10.9618H55.7586V14.3264H44.7969V21.0226H53.8436V24.2882H44.7969V34.0521H41Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M59.9569 14.7882C58.7352 14.7882 57.7777 13.8976 57.7777 12.6441C57.7777 11.3906 58.7352 10.5 59.9569 10.5C61.1785 10.5 62.136 11.3906 62.136 12.6441C62.136 13.8976 61.1785 14.7882 59.9569 14.7882ZM58.1409 34.0521V17.1632H61.7068V34.0521H58.1409Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M73.5885 17.1632H74.3809V20.4948H72.796C69.6264 20.4948 68.6029 22.9687 68.6029 25.5747V34.0521H65.0371V17.1632H68.2067L68.6029 19.7031C69.4613 18.2847 70.815 17.1632 73.5885 17.1632Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M83.632 34.25C78.3163 34.25 74.9816 30.8194 74.9816 25.6406C74.9816 20.4288 78.3163 16.9653 83.3019 16.9653C88.1884 16.9653 91.457 20.066 91.5561 25.0139C91.5561 25.4427 91.5231 25.9045 91.457 26.3663H78.7125V26.5972C78.8116 29.467 80.6275 31.3472 83.4339 31.3472C85.613 31.3472 87.1979 30.2587 87.6931 28.3785H91.2589C90.6646 31.7101 87.8252 34.25 83.632 34.25ZM78.8446 23.7604H87.8582C87.561 21.2535 85.8112 19.8351 83.3349 19.8351C81.0567 19.8351 79.1087 21.3524 78.8446 23.7604Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M102.033 34.25C96.9151 34.25 93.6465 30.9184 93.6465 25.6406C93.6465 20.4288 97.0142 16.9653 102.132 16.9653C106.49 16.9653 109.197 19.3733 109.891 23.1997H106.16C105.698 21.2205 104.278 20 102.066 20C99.1933 20 97.3113 22.309 97.3113 25.6406C97.3113 28.9392 99.1933 31.2153 102.066 31.2153C104.245 31.2153 105.698 29.9618 106.127 28.0156H109.891C109.23 31.842 106.358 34.25 102.033 34.25Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M121.006 17.1632H121.799V20.4948H120.214C117.044 20.4948 116.021 22.9687 116.021 25.5747V34.0521H112.455V17.1632H115.625L116.021 19.7031C116.879 18.2847 118.233 17.1632 121.006 17.1632Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M130.614 16.9653C135.104 16.9653 137.679 19.1094 137.679 23.1007V34.0521H134.576L134.279 31.6441C133.123 33.1615 131.505 34.25 128.831 34.25C125.133 34.25 122.657 32.4358 122.657 29.3021C122.657 25.8385 125.166 23.8924 129.92 23.8924H134.147V22.8698C134.147 20.9896 132.793 19.8351 130.449 19.8351C128.336 19.8351 126.916 20.8247 126.652 22.309H123.152C123.515 19.0104 126.355 16.9653 130.614 16.9653ZM129.425 31.4792C132.397 31.4792 134.114 29.7309 134.147 27.125V26.5312H129.722C127.51 26.5312 126.289 27.3559 126.289 29.0712C126.289 30.4896 127.477 31.4792 129.425 31.4792Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M144.653 34.0521L139.139 17.1632H142.903L146.766 30.0937L150.629 17.1632H153.897L157.595 30.0937L161.59 17.1632H165.222L159.609 34.0521H155.779L152.214 22.5729L148.516 34.0521H144.653Z\"\n        fill=\"#262626\"\n      />\n      <path\n        d=\"M166.934 34.0521V10.9618H170.5V34.0521H166.934Z\"\n        fill=\"#262626\"\n      />\n    </svg>\n  );\n};\n\nexport default WordmarkColored;\n"
  },
  {
    "path": "components/shared/icons/wordmark-white.tsx",
    "content": "import React from \"react\";\n\nconst WordmarkWhite = ({ ...props }) => {\n  return (\n    <svg\n      xmlns=\"http://www.w3.org/2000/svg\"\n      width=\"172\"\n      height=\"40\"\n      viewBox=\"0 0 172 40\"\n      fill=\"none\"\n      {...props}\n    >\n      <path\n        d=\"M23.3606 12.8281C21.8137 13.2873 20.6476 14.3261 19.7936 15.4544C19.6102 15.6966 19.228 15.5146 19.3008 15.2178C20.936 8.49401 18.7759 2.90556 12.0422 0.154735C11.7006 0.0147436 11.345 0.321324 11.4346 0.679702C14.4977 12.9779 1.61412 11.9406 3.24224 25.8823C3.27024 26.1217 3.00145 26.2855 2.80546 26.1455C2.19509 25.7073 1.51332 24.7932 1.04575 24.1506C0.908555 23.9616 0.611769 24.0148 0.548773 24.2402C0.176391 25.5869 0 26.8553 0 28.1152C0 33.0149 2.51847 37.328 6.33048 39.8283C6.54887 39.9711 6.82886 39.7667 6.75466 39.5161C6.55867 38.8581 6.44808 38.1638 6.43968 37.4456C6.43968 37.0046 6.46768 36.5539 6.53627 36.1339C6.69587 35.0784 7.06265 34.0732 7.67862 33.1577C9.79111 29.9869 14.0259 26.9239 13.3497 22.7647C13.3063 22.5015 13.6171 22.328 13.8131 22.5085C16.7964 25.2342 17.3871 28.9005 16.8972 32.1889C16.8552 32.4745 17.2135 32.6271 17.3941 32.4031C17.8505 31.832 18.4077 31.3308 19.0138 30.9542C19.165 30.8604 19.3666 30.9318 19.424 31.0998C19.7614 32.0811 20.2626 33.0023 20.7358 33.9234C21.3013 35.0308 21.6023 36.2949 21.5547 37.6332C21.5309 38.2842 21.4231 38.9141 21.2425 39.5133C21.1655 39.7667 21.4427 39.9781 21.6653 39.8325C25.4801 37.3322 28 33.0191 28 28.1166C28 26.4129 27.7018 24.7428 27.1376 23.1777C25.9547 19.8949 22.9533 17.4297 23.712 13.1515C23.7484 12.9471 23.5594 12.7693 23.3606 12.8281Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M41 34.0521V10.9618H55.7586V14.3264H44.7969V21.0226H53.8436V24.2882H44.7969V34.0521H41Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M59.9569 14.7882C58.7352 14.7882 57.7777 13.8976 57.7777 12.6441C57.7777 11.3906 58.7352 10.5 59.9569 10.5C61.1785 10.5 62.136 11.3906 62.136 12.6441C62.136 13.8976 61.1785 14.7882 59.9569 14.7882ZM58.1409 34.0521V17.1632H61.7068V34.0521H58.1409Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M73.5885 17.1632H74.3809V20.4948H72.796C69.6264 20.4948 68.6029 22.9687 68.6029 25.5747V34.0521H65.0371V17.1632H68.2067L68.6029 19.7031C69.4613 18.2847 70.815 17.1632 73.5885 17.1632Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M83.632 34.25C78.3163 34.25 74.9816 30.8194 74.9816 25.6406C74.9816 20.4288 78.3163 16.9653 83.3019 16.9653C88.1884 16.9653 91.457 20.066 91.5561 25.0139C91.5561 25.4427 91.5231 25.9045 91.457 26.3663H78.7125V26.5972C78.8116 29.467 80.6275 31.3472 83.4339 31.3472C85.613 31.3472 87.1979 30.2587 87.6931 28.3785H91.2589C90.6646 31.7101 87.8252 34.25 83.632 34.25ZM78.8446 23.7604H87.8582C87.561 21.2535 85.8112 19.8351 83.3349 19.8351C81.0567 19.8351 79.1087 21.3524 78.8446 23.7604Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M102.033 34.25C96.9151 34.25 93.6465 30.9184 93.6465 25.6406C93.6465 20.4288 97.0142 16.9653 102.132 16.9653C106.49 16.9653 109.197 19.3733 109.891 23.1997H106.16C105.698 21.2205 104.278 20 102.066 20C99.1933 20 97.3113 22.309 97.3113 25.6406C97.3113 28.9392 99.1933 31.2153 102.066 31.2153C104.245 31.2153 105.698 29.9618 106.127 28.0156H109.891C109.23 31.842 106.358 34.25 102.033 34.25Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M121.006 17.1632H121.799V20.4948H120.214C117.044 20.4948 116.021 22.9687 116.021 25.5747V34.0521H112.455V17.1632H115.625L116.021 19.7031C116.879 18.2847 118.233 17.1632 121.006 17.1632Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M130.614 16.9653C135.104 16.9653 137.679 19.1094 137.679 23.1007V34.0521H134.576L134.279 31.6441C133.123 33.1615 131.505 34.25 128.831 34.25C125.133 34.25 122.657 32.4358 122.657 29.3021C122.657 25.8385 125.166 23.8924 129.92 23.8924H134.147V22.8698C134.147 20.9896 132.793 19.8351 130.449 19.8351C128.336 19.8351 126.916 20.8247 126.652 22.309H123.152C123.515 19.0104 126.355 16.9653 130.614 16.9653ZM129.425 31.4792C132.397 31.4792 134.114 29.7309 134.147 27.125V26.5312H129.722C127.51 26.5312 126.289 27.3559 126.289 29.0712C126.289 30.4896 127.477 31.4792 129.425 31.4792Z\"\n        fill=\"white\"\n      />\n      <path\n        d=\"M144.653 34.0521L139.139 17.1632H142.903L146.766 30.0937L150.629 17.1632H153.897L157.595 30.0937L161.59 17.1632H165.222L159.609 34.0521H155.779L152.214 22.5729L148.516 34.0521H144.653Z\"\n        fill=\"white\"\n      />\n      <path d=\"M166.934 34.0521V10.9618H170.5V34.0521H166.934Z\" fill=\"white\" />\n    </svg>\n  );\n};\n\nexport default WordmarkWhite;\n"
  },
  {
    "path": "components/shared/image/Image.tsx",
    "content": "/* eslint-disable @next/next/no-img-element */\nimport { ComponentProps } from \"react\";\n\nimport compressorConfig from \"@/public/compressor.json\";\n\ninterface Props extends ComponentProps<\"img\"> {\n  src: string;\n  alt: string;\n  raw?: boolean;\n}\n\nconst BASE_SRC = \"/assets/\";\nconst RAW_SRC = \"/assets-original/\";\n\nexport default function Image({ src, raw, ...attrs }: Props) {\n  if (raw) {\n    return (\n      <img\n        {...attrs}\n        alt={attrs.alt}\n        decoding=\"async\"\n        loading=\"lazy\"\n        src={RAW_SRC + src + \".png\"}\n      />\n    );\n  }\n\n  return (\n    <picture>\n      {compressorConfig.configs\n        .sort((a, b) => {\n          if (a.extension === \"avif\" && b.extension !== \"avif\") return -1;\n          if (b.extension === \"avif\" && a.extension !== \"avif\") return 1;\n\n          return a.scale - b.scale;\n        })\n        .map((c) => {\n          return (\n            <source\n              key={`${c.extension}_q${c.quality}@${c.scale}x`}\n              srcSet={`${BASE_SRC}${src}_q${c.quality}@${c.scale}x.${c.extension}`}\n              type={`image/${c.extension}`}\n            />\n          );\n        })}\n\n      <img\n        {...attrs}\n        alt={attrs.alt}\n        decoding=\"async\"\n        loading=\"lazy\"\n        src={`${BASE_SRC}${src}.png`}\n      />\n    </picture>\n  );\n}\n"
  },
  {
    "path": "components/shared/image/getImageSrc.ts",
    "content": "import compressorConfig from \"@/public/compressor.json\";\n\nconst avifConfig = compressorConfig.configs.find(\n  (c) => c.extension === \"avif\",\n)!;\nconst webpConfig = compressorConfig.configs.find(\n  (c) => c.extension === \"webp\",\n)!;\n\nexport async function getImageSrc(src: string) {\n  const BASE_SRC = \"/assets/\";\n\n  if (await supportsEncode()) {\n    return `${BASE_SRC}${src}_q${avifConfig.quality}@${avifConfig.scale}x.avif`;\n  }\n\n  return `${BASE_SRC}${src}_q${webpConfig.quality}@${webpConfig.scale}x.webp`;\n}\n\nlet promise: Promise<boolean> | null = null;\n\nasync function supportsEncode() {\n  if (promise) return promise;\n\n  const avifData =\n    \"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUEAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABYAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgSAAAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB5tZGF0EgAKBzgADlAgIGkyCR/wAABAAACvcA==\";\n\n  promise = fetch(avifData)\n    .then((r) => r.blob())\n    .then((b) => createImageBitmap(b))\n    .then(() => true)\n    .catch(() => false);\n\n  return promise;\n}\n"
  },
  {
    "path": "components/shared/layout/animated-height.tsx",
    "content": "\"use client\";\n\nimport { motion, MotionProps, TargetAndTransition } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\ntype AnimatedHeight = {\n  children: React.ReactNode;\n  animate?: TargetAndTransition;\n  initial?: TargetAndTransition;\n  exit?: TargetAndTransition;\n  className?: string;\n  transition?: MotionProps[\"transition\"];\n};\n\nexport default function AnimatedHeight({ children, ...attrs }: AnimatedHeight) {\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  const [height, setHeight] = useState<number | \"auto\">(\"auto\");\n\n  useEffect(() => {\n    const child = containerRef.current?.children[0] as Element;\n\n    const updateHeight = () => {\n      if (!child) return;\n\n      setHeight(child.clientHeight);\n    };\n\n    updateHeight();\n\n    const resizeObserver = new ResizeObserver(updateHeight);\n\n    resizeObserver.observe(child);\n\n    return () => resizeObserver.disconnect();\n  }, []);\n\n  return (\n    <motion.div\n      {...attrs}\n      animate={{\n        height,\n        ...attrs.animate,\n      }}\n      className={cn(attrs.className)}\n      initial={{\n        height,\n        ...attrs.initial,\n      }}\n      ref={containerRef}\n    >\n      <div className=\"h-max\">{children}</div>\n    </motion.div>\n  );\n}\n"
  },
  {
    "path": "components/shared/layout/animated-width.tsx",
    "content": "\"use client\";\n\nimport { motion, TargetAndTransition, Transition } from \"motion/react\";\nimport { useEffect, useRef, useState } from \"react\";\n\ntype AnimatedWidthProps = {\n  children: React.ReactNode;\n  animate?: TargetAndTransition;\n  initial?: TargetAndTransition;\n  transition?: Transition;\n};\n\nexport default function AnimatedWidth({\n  children,\n  ...attrs\n}: AnimatedWidthProps) {\n  const containerRef = useRef<HTMLDivElement>(null);\n\n  const [width, setWidth] = useState<number | \"auto\">(\"auto\");\n\n  useEffect(() => {\n    const child = containerRef.current?.children[0] as Element;\n\n    const updateWidth = () => {\n      if (!child) return;\n\n      setWidth(child.clientWidth);\n    };\n\n    updateWidth();\n\n    const resizeObserver = new ResizeObserver(updateWidth);\n\n    resizeObserver.observe(child);\n\n    return () => resizeObserver.disconnect();\n  }, []);\n\n  return (\n    <motion.div\n      {...attrs}\n      animate={{\n        width,\n        ...attrs.animate,\n      }}\n      className=\"overflow-hidden\"\n      initial={{\n        width,\n        ...attrs.initial,\n      }}\n      ref={containerRef}\n    >\n      <div className=\"w-max whitespace-nowrap\">{children}</div>\n    </motion.div>\n  );\n}\n"
  },
  {
    "path": "components/shared/layout/curvy-rect-divider.tsx",
    "content": "import React from \"react\";\n\nimport CurvyRect from \"./curvy-rect\";\n\nexport function CurvyRectDivider() {\n  return (\n    <div className=\"relative mx-1 my-1\">\n      <div className=\"relative h-px bg-zinc-200 border-x border-zinc-200\">\n        <CurvyRect\n          className=\"absolute -top-[0.5px] -left-[1px] w-[calc(100%+2px)]\"\n          top\n        />\n        <CurvyRect\n          className=\"absolute -bottom-[0.5px] -left-[1px] w-[calc(100%+2px)]\"\n          bottom\n        />\n        <CurvyRect\n          className=\"absolute -left-[0.5px] -top-[1px] h-[calc(100%+2px)]\"\n          left\n        />\n        <CurvyRect\n          className=\"absolute -right-[0.5px] -top-[1px] h-[calc(100%+2px)]\"\n          right\n        />\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/layout/curvy-rect.tsx",
    "content": "import { cn } from \"@/utils/cn\";\n\nimport Curve from \"@/components/shared/icons/curve\";\n\ninterface CurvyRectProps extends React.HTMLAttributes<HTMLDivElement> {\n  allSides?: boolean;\n\n  x?: boolean;\n  y?: boolean;\n\n  left?: boolean;\n  right?: boolean;\n  top?: boolean;\n  bottom?: boolean;\n\n  topLeft?: boolean;\n  topRight?: boolean;\n  bottomLeft?: boolean;\n  bottomRight?: boolean;\n}\n\nexport default function CurvyRect({\n  className,\n  allSides,\n  x,\n  y,\n  left,\n  right,\n  top,\n  bottom,\n  topLeft,\n  topRight,\n  bottomLeft,\n  bottomRight,\n  ...props\n}: CurvyRectProps) {\n  const hasTopLeft = topLeft || top || left || x || allSides;\n  const hasTopRight = topRight || top || right || x || allSides;\n  const hasBottomLeft = bottomLeft || bottom || left || y || allSides;\n  const hasBottomRight = bottomRight || bottom || right || y || allSides;\n\n  return (\n    <div\n      className={cn(\n        className,\n        \"pointer-events-none contain-[layout,paint] curvy-rect\",\n      )}\n      {...props}\n    >\n      {hasTopLeft && <Curve className=\"-rotate-90 absolute top-0 left-0\" />}\n      {hasTopRight && <Curve className=\"absolute top-0 right-0\" />}\n      {hasBottomLeft && (\n        <Curve className=\"rotate-180 absolute bottom-0 left-0\" />\n      )}\n      {hasBottomRight && (\n        <Curve className=\"rotate-90 absolute bottom-0 right-0\" />\n      )}\n    </div>\n  );\n}\n\nexport const Connector = ({\n  className,\n  ...props\n}: React.SVGProps<SVGSVGElement>) => {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"21\"\n      viewBox=\"0 0 22 21\"\n      width=\"22\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      className={cn(\n        \"pointer-events-none contain-[layout,paint] absolute\",\n        className,\n      )}\n    >\n      <path\n        d=\"M10.5 4C10.5 7.31371 7.81371 10 4.5 10H0.5V11H4.5C7.81371 11 10.5 13.6863 10.5 17V21H11.5V17C11.5 13.6863 14.1863 11 17.5 11H21.5V10H17.5C14.1863 10 11.5 7.31371 11.5 4V0H10.5V4Z\"\n        fill=\"#EDEDED\"\n      />\n    </svg>\n  );\n};\n\nexport const ConnectorToRight = ({\n  className,\n  ...props\n}: React.SVGProps<SVGSVGElement>) => {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"21\"\n      viewBox=\"0 0 11 21\"\n      width=\"11\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      className={cn(\n        \"pointer-events-none contain-[layout,paint] absolute\",\n        className,\n      )}\n    >\n      <path\n        d=\"M1 4C1 7.31371 3.68629 10 7 10H11V11H7C3.68629 11 1 13.6863 1 17V21H0V0H1V4Z\"\n        fill=\"#EDEDED\"\n      />\n    </svg>\n  );\n};\n\nexport const ConnectorToLeft = ({\n  className,\n  ...props\n}: React.SVGProps<SVGSVGElement>) => {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"21\"\n      viewBox=\"0 0 11 21\"\n      width=\"11\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      className={cn(\n        \"pointer-events-none contain-[layout,paint] absolute\",\n        className,\n      )}\n    >\n      <path\n        d=\"M11 21H10V17C10 13.6863 7.31371 11 4 11H0V10H4C7.31371 10 10 7.31371 10 4V0H11V21Z\"\n        fill=\"#EDEDED\"\n      />\n    </svg>\n  );\n};\n\nexport const ConnectorToTop = ({\n  className,\n  ...props\n}: React.SVGProps<SVGSVGElement>) => {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"11\"\n      viewBox=\"0 0 21 11\"\n      width=\"21\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      className={cn(\n        \"pointer-events-none contain-[layout,paint] absolute\",\n        className,\n      )}\n    >\n      <path\n        d=\"M11 4C11 7.31371 13.6863 10 17 10H21V11H0V10H4C7.31371 10 10 7.31371 10 4V0H11V4Z\"\n        fill=\"#EDEDED\"\n      />\n    </svg>\n  );\n};\n\nexport const ConnectorToBottom = ({\n  className,\n  ...props\n}: React.SVGProps<SVGSVGElement>) => {\n  return (\n    <svg\n      fill=\"none\"\n      height=\"11\"\n      viewBox=\"0 0 21 11\"\n      width=\"21\"\n      xmlns=\"http://www.w3.org/2000/svg\"\n      {...props}\n      className={cn(\n        \"pointer-events-none contain-[layout,paint] absolute\",\n        className,\n      )}\n    >\n      <path\n        d=\"M11 7C11 3.68629 13.6863 1 17 1H21V0H0V1H4C7.31371 1 10 3.68629 10 7V11H11V7Z\"\n        fill=\"#EDEDED\"\n      />\n    </svg>\n  );\n};\n"
  },
  {
    "path": "components/shared/loading/Shimmer.tsx",
    "content": "\"use client\";\n\nimport { cn } from \"@/utils/cn\";\nimport { useState, useEffect } from \"react\";\nimport ScrambleText from \"@/components/ui/motion/scramble-text\";\n\nexport const Shimmer = ({\n  className,\n  text = \"Loading...\",\n}: {\n  className?: string;\n  text?: string;\n}) => {\n  const [isInView, setIsInView] = useState(false);\n\n  useEffect(() => {\n    setIsInView(true);\n  }, []);\n\n  return (\n    <div className={cn(\"w-full\", className)}>\n      {text && (\n        <div className=\"mb-4 text-label-large text-black-alpha-56\">\n          <ScrambleText\n            text={text}\n            delay={0}\n            duration={1.2}\n            isInView={isInView}\n          />\n        </div>\n      )}\n      <div className=\"space-y-3\">\n        <div className=\"h-4 rounded-8 bg-gradient-to-r from-black-alpha-4 via-black-alpha-8 to-black-alpha-4 animate-shimmer mb-2 w-3/4\">\n          <span className=\"sr-only\">{text}</span>\n        </div>\n        <div className=\"h-4 rounded-8 bg-gradient-to-r from-black-alpha-4 via-black-alpha-8 to-black-alpha-4 animate-shimmer animation-delay-150 mb-2 w-1/2\"></div>\n        <div className=\"h-4 rounded-8 bg-gradient-to-r from-black-alpha-4 via-black-alpha-8 to-black-alpha-4 animate-shimmer animation-delay-300 mb-2 w-full\"></div>\n        <div className=\"h-4 rounded-8 bg-gradient-to-r from-black-alpha-4 via-black-alpha-8 to-black-alpha-4 animate-shimmer animation-delay-450 mb-2 w-1/2\"></div>\n      </div>\n    </div>\n  );\n};\n\nexport const ShimmerSingle = ({\n  className,\n  text,\n}: {\n  className?: string;\n  text?: string;\n}) => {\n  const [isInView, setIsInView] = useState(false);\n\n  useEffect(() => {\n    setIsInView(true);\n  }, []);\n\n  return (\n    <div className={cn(\"w-full\", className)}>\n      {text && (\n        <div className=\"mb-2 text-label-small text-black-alpha-56\">\n          <ScrambleText\n            text={text}\n            delay={0}\n            duration={1}\n            isInView={isInView}\n          />\n        </div>\n      )}\n      <div className=\"h-4 rounded-8 bg-gradient-to-r from-black-alpha-4 via-black-alpha-8 to-black-alpha-4 animate-shimmer w-full\"></div>\n    </div>\n  );\n};\n\n// Chart shimmer with fire glow effect\nexport const ChartShimmer = ({\n  className,\n  text = \"Loading chart data...\",\n}: {\n  className?: string;\n  text?: string;\n}) => {\n  const [isInView, setIsInView] = useState(false);\n\n  useEffect(() => {\n    setIsInView(true);\n  }, []);\n\n  return (\n    <div className={cn(\"w-full h-full relative overflow-hidden\", className)}>\n      {/* Subtle fire glow background */}\n      <div className=\"absolute inset-0 bg-gradient-to-br from-heat-4/10 via-transparent to-heat-4/10 animate-pulse\" />\n\n      {/* Loading text */}\n      {text && (\n        <div className=\"absolute top-4 left-4 text-label-small text-black-alpha-56 z-10\">\n          <ScrambleText\n            text={text}\n            delay={0}\n            duration={0.8}\n            isInView={isInView}\n          />\n        </div>\n      )}\n\n      {/* Chart bars */}\n      <div className=\"absolute bottom-0 left-0 right-0 flex items-end justify-between px-4 pb-4 gap-2\">\n        {Array.from({ length: 8 }, (_, i) => (\n          <div\n            key={i}\n            className=\"flex-1 bg-gradient-to-t from-black-alpha-8 to-transparent rounded-t-4 animate-shimmer\"\n            style={{\n              height: `${Math.random() * 60 + 20}%`,\n              animationDelay: `${i * 100}ms`,\n            }}\n          />\n        ))}\n      </div>\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/shared/loading/usage-loading.tsx",
    "content": "\"use client\";\n\nimport { useState, useEffect } from \"react\";\nimport ScrambleText from \"@/components/ui/motion/scramble-text\";\n\nexport function UsageLoadingText({ text = \"Loading...\" }: { text?: string }) {\n  const [isInView, setIsInView] = useState(false);\n\n  useEffect(() => {\n    setIsInView(true);\n  }, []);\n\n  return (\n    <div className=\"text-xs text-zinc-500\">\n      <ScrambleText text={text} delay={0} duration={1} isInView={isInView} />\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/lockBody.tsx",
    "content": "/**\n * Utility to lock/unlock the document body based on a set of keys.\n * Each key can \"lock\" the body (e.g., prevent scrolling), and the lock is only released when all keys are removed.\n *\n * @param {string} key - Unique identifier for the lock (e.g., component name or id)\n * @param {'lock'|'unlock'} action - Whether to lock or unlock\n * @param {(locked: boolean) => void} [onLockChange] - Optional callback when lock state changes\n */\nconst activeLocks = new Set<string>();\n\nexport function lockBody(\n  key: string,\n  action: boolean,\n  onLockChange?: (locked: boolean) => void,\n) {\n  if (action) {\n    activeLocks.add(key);\n  } else {\n    activeLocks.delete(key);\n  }\n\n  const shouldLock = activeLocks.size > 0;\n  document.body.classList.toggle(\"overflow-hidden\", shouldLock);\n  if (onLockChange) onLockChange(shouldLock);\n}\n"
  },
  {
    "path": "components/shared/logo-cloud/index.ts",
    "content": "export { default } from \"./logo-cloud\";\n"
  },
  {
    "path": "components/shared/logo-cloud/logo-cloud.tsx",
    "content": "export default function LogoCloud() {\n  return (\n    <div>\n      <p className=\"mt-24 text-xs uppercase text-zinc-400 text-center font-bold tracking-[0.3em]\">\n        Brought to you by\n      </p>\n      <div className=\"grid grid-cols-1 place-items-center\tmy-12 space-y-4 sm:mt-8 sm:space-y-0 md:mx-auto md:max-w-2xl sm:grid sm:gap-6 sm:grid-cols-5\">\n        {/* <div className=\"flex items-center justify-start h-12\">\n          <a href=\"https://nextjs.org\" aria-label=\"Next.js Link\">\n            <img\n              src=\"/nextjs.svg\"\n              alt=\"Next.js Logo\"\n              className=\"h-6 sm:h-12 text-white\"\n            />\n          </a>\n        </div>\n        <div className=\"flex items-center justify-start h-12\">\n          <a href=\"https://vercel.com\" aria-label=\"Vercel.com Link\">\n            <img\n              src=\"/vercel.svg\"\n              alt=\"Vercel.com Logo\"\n              className=\"h-6 text-white\"\n            />\n          </a>\n        </div>\n        <div className=\"flex items-center justify-start h-12\">\n          <a href=\"https://stripe.com\" aria-label=\"stripe.com Link\">\n            <img\n              src=\"/stripe.svg\"\n              alt=\"stripe.com Logo\"\n              className=\"h-12 text-white\"\n            />\n          </a>\n        </div>\n        <div className=\"flex items-center justify-start h-12\">\n          <a href=\"https://supabase.io\" aria-label=\"supabase.io Link\">\n            <img\n              src=\"/supabase.svg\"\n              alt=\"supabase.io Logo\"\n              className=\"h-10 text-white\"\n            />\n          </a>\n        </div>\n        <div className=\"flex items-center justify-start h-12\">\n          <a href=\"https://github.com\" aria-label=\"github.com Link\">\n            <img\n              src=\"/github.svg\"\n              alt=\"github.com Logo\"\n              className=\"h-8 text-white\"\n            />\n          </a>\n        </div> */}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/logo-cloud/logo-cloud2/Logocloud.css",
    "content": ".logocloud-items {\n  animation: logocloud-items 100s infinite linear;\n  will-change: transform;\n}\n\n@keyframes logocloud-items {\n  0% {\n    transform: translateX(0);\n  }\n  100% {\n    transform: translateX(-50%);\n  }\n}\n\n/* Allow this component to animate even when the user prefers reduced motion.\n   This is a narrowly scoped opt-in to avoid disabling all animations globally. */\n@media (prefers-reduced-motion: reduce) {\n  [data-allow-motion=\"true\"] .logocloud-items {\n    animation-duration: 100s !important;\n    animation-iteration-count: infinite !important;\n  }\n}\n"
  },
  {
    "path": "components/shared/logo-cloud/logo-cloud2/Logocloud.tsx",
    "content": "import { CurvyRect } from \"@/components/shared/ui\";\nimport Image from \"@/components/shared/image/Image\";\nimport \"./Logocloud.css\";\n\nexport default function Logocloud() {\n  // Create array starting from index 1, with 17-19 first, then 1-21\n  const logoIndices = [17, 18, ...Array.from({ length: 21 }, (_, i) => i + 1)];\n\n  return (\n    <div className=\"container relative -mt-1 lg:flex\" data-allow-motion=\"true\">\n      <div className=\"h-1 bottom-0 absolute left-0 w-full bg-border-faint\" />\n      <div className=\"p-16 lg-max:text-center lg:p-40 relative\">\n        <CurvyRect className=\"overlay\" allSides />\n\n        <div className=\"text-body-large text-accent-black\">\n          Trusted by{\" \"}\n          <span className=\"contents text-label-large text-heat-100\">\n            5000+ <br /> companies\n          </span>{\" \"}\n          of all sizes\n        </div>\n      </div>\n\n      <div className=\"flex-1 lg-max:h-96 min-w-0 relative lg:-ml-1 lg-max:-mt-1\">\n        <div className=\"h-full left-0 top-0 w-1 bg-border-faint absolute lg-max:w-full lg-max:h-1\" />\n\n        <CurvyRect className=\"overlay\" allSides />\n\n        <div className=\"w-full h-full overflow-x-clip\">\n          <div className=\"w-max flex h-full logocloud-items\">\n            {Array.from({ length: 2 }, (_, i) => (\n              <div className=\"flex h-full\" key={i}>\n                {logoIndices.map((logoIndex, i) => (\n                  <div\n                    className=\"h-full aspect-[204/96] lg:aspect-[204/128] -ml-1 relative w-max\"\n                    key={i}\n                  >\n                    <Image\n                      alt={`Logo ${logoIndex}`}\n                      className=\"absolute object-cover w-full h-full\"\n                      src={`logocloud/${logoIndex}`}\n                      raw\n                    />\n\n                    <div className=\"overlay border-x border-border-faint\" />\n                  </div>\n                ))}\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/notifications/slack-notification.tsx",
    "content": "\"use client\";\n\nimport Image from \"next/image\";\nimport { useEffect, useState } from \"react\";\n\nexport default function SlackNotification({\n  shouldNotify,\n  onClick,\n}: {\n  shouldNotify: boolean;\n  onClick: () => void;\n}) {\n  const [isOpen, setIsOpen] = useState(false);\n\n  const handleClick = async () => {\n    setIsOpen(false);\n    if (onClick) {\n      onClick();\n    }\n  };\n\n  useEffect(() => {\n    if (shouldNotify) {\n      setIsOpen(true);\n    }\n  }, [shouldNotify]);\n\n  return (\n    <>\n      <div\n        className={`fixed  z-[1000000] top-16 transition-transform duration-500 ease-in-out right-0 bg-white p-4 rounded-[18px] shadow mr-4  ${isOpen ? \"translate-x-0\" : \"translate-x-[400px]\"}`}\n        onClick={handleClick}\n      >\n        <div className=\"flex flex-row items-center max-w-xs cursor-pointer\">\n          <div className=\"flex min-w-16 mr-2 mt-1\">\n            <Image\n              className=\"w-16 h-16\"\n              src=\"/images/slack_logo_icon.png\"\n              alt=\"Slack Logo\"\n              width={64}\n              height={64}\n            />\n          </div>\n          <div className=\"flex flex-col\">\n            <h1 className=\"text-sm font-bold text-black\">\n              New message in: #coach-gtm\n            </h1>\n            <span className=\"text-sm text-black\">\n              {`@CoachGTM: Your meeting prep for Pied Piper < > WindFlow Dynamics is ready! Meeting starts in 30 minutes`}\n            </span>\n          </div>\n        </div>\n      </div>\n    </>\n  );\n}\n"
  },
  {
    "path": "components/shared/pixi/Pixi.tsx",
    "content": "\"use client\";\nimport { animate } from \"motion\";\nimport { nanoid } from \"nanoid\";\nimport { Application, ApplicationOptions } from \"pixi.js\";\nimport { HTMLAttributes, useMemo, useRef } from \"react\";\n\nimport useDebouncedEffect from \"@/hooks/useDebouncedEffect\";\nimport { cn } from \"@/utils/cn\";\n\nimport { isDestroyed } from \"./utils\";\n\ntype TickerResult = void;\n\nexport type Ticker = ({\n  app,\n  canvas,\n}: {\n  app: Application;\n  canvas: HTMLCanvasElement;\n}) => TickerResult | Promise<TickerResult>;\n\nexport interface PixiProps {\n  tickers: Ticker[];\n  onBeforeInitialized?: (props: { canvas: HTMLCanvasElement }) => void;\n  onInitialized?: (props: { canvas: HTMLCanvasElement }) => void;\n  canvasAttrs?: HTMLAttributes<HTMLCanvasElement>;\n  initOptions?: Partial<ApplicationOptions>;\n  fps?: number;\n  resolution?: number;\n  smartStop?: boolean;\n}\n\nexport default function Pixi({\n  tickers,\n  onInitialized,\n  onBeforeInitialized,\n  canvasAttrs,\n  initOptions,\n  fps = 60,\n  resolution: resolutionFromParams = 1,\n  smartStop = true,\n}: PixiProps) {\n  const canvasRef = useRef<HTMLCanvasElement>(null);\n\n  useDebouncedEffect(\n    () => {\n      const canvas = canvasRef.current!;\n\n      if (!canvas) return;\n\n      const cleanupFunctions: (() => void)[] = [];\n\n      canvas.style.opacity = \"0\";\n\n      onBeforeInitialized?.({ canvas });\n\n      const resolution = window.devicePixelRatio || 1;\n\n      const app = new Application();\n\n      cleanupFunctions.push(() => {\n        if (isDestroyed(app)) return;\n\n        app.destroy(\n          {},\n          {\n            children: true,\n            context: true,\n            style: true,\n          },\n        );\n\n        canvas.style.opacity = \"0\";\n      });\n\n      (async () => {\n        await app.init({\n          canvas: canvas,\n          resolution: resolution * resolutionFromParams,\n          width: canvas.clientWidth,\n          height: canvas.clientHeight,\n          antialias: false,\n          hello: false,\n\n          autoStart: true,\n          sharedTicker: false,\n          clearBeforeRender: true,\n\n          eventMode: \"passive\",\n\n          ...initOptions,\n        });\n\n        let tickerCount = 0;\n        const originalAdd = app.ticker.add;\n\n        if (fps !== Infinity) {\n          app.ticker.maxFPS = fps;\n        }\n\n        (app.ticker as any).safeAdd = function (...args: any[]) {\n          if (!app.ticker) return undefined as any;\n\n          tickerCount += 1;\n\n          if (tickerCount === 1 && smartStop) startTicker();\n\n          return originalAdd.apply(app.ticker, args as any);\n        };\n\n        const originalRemove = app.ticker.remove;\n\n        (app.ticker as any).safeRemove = function (...args: any[]) {\n          if (!app.ticker) return undefined as any;\n\n          tickerCount -= 1;\n\n          if (tickerCount === 0 && smartStop) stopTicker();\n\n          return originalRemove.apply(app.ticker, args as any);\n        };\n\n        const activeAnimations: ReturnType<typeof animate>[] = [];\n\n        const startTicker = () => {\n          app.ticker.start();\n\n          activeAnimations.forEach((animation) => {\n            animation.play();\n          });\n        };\n\n        const stopTicker = () => {\n          app.ticker.stop();\n\n          activeAnimations.forEach((animation) => {\n            animation.pause();\n          });\n        };\n\n        (app as any).animate = ((...args: any[]) => {\n          const animation = (animate as any)(...args);\n\n          activeAnimations.push(animation);\n\n          animation.finished.then(() => {\n            activeAnimations.splice(activeAnimations.indexOf(animation), 1);\n          });\n\n          return animation;\n        }) as typeof animate;\n\n        for (const ticker of tickers) {\n          ticker({\n            app,\n            canvas,\n          });\n        }\n\n        app.stage.interactive = false;\n        app.stage.cullable = true;\n        app.stage.sortableChildren = false;\n        app.stage.interactiveChildren = false;\n\n        app.render();\n\n        setTimeout(() => {\n          onInitialized?.({ canvas });\n          canvas.style.opacity = \"1\";\n        }, 100);\n\n        const observer = new IntersectionObserver(([entry]) => {\n          if (entry.isIntersecting) {\n            if (tickerCount !== 0 || !smartStop) startTicker();\n          } else {\n            stopTicker();\n          }\n        });\n\n        const resizeObserver = new ResizeObserver(() => {\n          app.renderer.resize(canvas.clientWidth, canvas.clientHeight);\n          app.renderer.render(app.stage);\n        });\n\n        observer.observe(canvas);\n        resizeObserver.observe(canvas);\n\n        cleanupFunctions.push(() => {\n          resizeObserver.disconnect();\n          observer.disconnect();\n        });\n      })();\n\n      return () => {\n        cleanupFunctions.forEach((fn) => fn());\n      };\n    },\n    {\n      timeout: 1,\n      ignoreInitialCall: false,\n    },\n    [],\n  );\n\n  const key = useMemo(() => {\n    return nanoid();\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [tickers]);\n\n  return (\n    <canvas\n      {...canvasAttrs}\n      className={cn(canvasAttrs?.className)}\n      key={key}\n      ref={canvasRef}\n      style={{\n        ...canvasAttrs?.style,\n        opacity: 0,\n      }}\n    />\n  );\n}\n"
  },
  {
    "path": "components/shared/pixi/PixiAssetManager.ts",
    "content": "import { Assets } from \"pixi.js\";\n\nclass PixiAssetManager {\n  /**\n   * Loads assets from the given sources\n   * @param sources The source URLs of the assets\n   * @returns A promise that resolves with the loaded asset(s)\n   */\n  public static load<T = any>(...sources: string[]): Promise<T> {\n    if (sources.length === 0) {\n      return Promise.reject(new Error(\"No sources provided\"));\n    }\n\n    if (sources.length === 1) {\n      const src = sources[0];\n\n      return Assets.load(src) as Promise<T>;\n    }\n\n    // Handle multiple sources\n    return Promise.all(\n      sources.map((src) => this.load(src)),\n    ) as unknown as Promise<T>;\n  }\n}\n\nexport default PixiAssetManager;\n"
  },
  {
    "path": "components/shared/pixi/utils.ts",
    "content": "// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck -- TODO: fix this\n\nimport { Application, Assets, Sprite, Texture } from \"pixi.js\";\n\nexport const isDestroyed = (app: Application) => {\n  if (!app.ticker || !app.renderer || !app.stage || !app.renderer.gl)\n    return true;\n\n  return app.renderer.gl.isContextLost();\n};\n\nexport const generateTexture = (app: Application, graphic: any) => {\n  const renderer = app.renderer;\n\n  if (!isDestroyed(app)) {\n    return renderer.generateTexture(graphic);\n  }\n\n  return Texture.WHITE;\n};\n\nexport const degreesToRadians = (degrees: number) => {\n  return degrees * (Math.PI / 180);\n};\n\nexport const imageToSprite = async (app: Application, path: string) => {\n  let texture;\n\n  if (Assets.cache.has(path)) {\n    texture = Assets.cache.get(path);\n  } else {\n    texture = await Assets.load(path);\n  }\n\n  const sprite = Sprite.from(texture);\n\n  return sprite;\n};\n\nexport const createRenderWithFPS = (app: Application, fps: number) => {\n  let lastUpdateTime = 0;\n\n  return () => {\n    const currentTime = performance.now();\n    const timeSinceLastUpdate = currentTime - lastUpdateTime;\n\n    if (timeSinceLastUpdate >= 1000 / fps) {\n      app.ticker.update();\n      app.render();\n      lastUpdateTime = currentTime;\n    }\n  };\n};\n\nexport const waitUntilPixiIsReady = (app: Application) => {\n  return new Promise((resolve) => {\n    app.canvas.addEventListener(\"pixi-initialized\", resolve);\n  });\n};\n"
  },
  {
    "path": "components/shared/portal-to-body/PortalToBody.tsx",
    "content": "import dynamic from \"next/dynamic\";\nimport { createPortal } from \"react-dom\";\n\nfunction PortalToBody({ children }: { children: React.ReactNode }) {\n  return createPortal(children, document.body);\n}\n\nexport default dynamic(() => Promise.resolve(PortalToBody), { ssr: false });\n"
  },
  {
    "path": "components/shared/preview/json-error-highlighter.tsx",
    "content": "import { cn } from \"@/utils/cn\";\nimport React, { useRef, useState, useEffect, useCallback } from \"react\";\n\nexport function JsonErrorHighlighter({\n  value,\n  error,\n  onChange,\n  onBlur,\n  className,\n  style,\n}: {\n  value: string;\n  error: { line?: number; column?: number; message: string } | null;\n  onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n  onBlur?: () => void;\n  className?: string;\n  style?: React.CSSProperties;\n}) {\n  const textareaRef = useRef<HTMLTextAreaElement>(null);\n  const preRef = useRef<HTMLPreElement>(null);\n  const lineNumbersRef = useRef<HTMLDivElement>(null);\n  const [scrollInfo, setScrollInfo] = useState({\n    firstVisible: 0,\n    lastVisible: 20,\n    scrollTop: 0,\n    lineHeight: 24,\n    clientHeight: 250,\n  });\n\n  const lines = value.split(\"\\n\");\n  const errorLineIdx = (error?.line ?? 1) - 1;\n\n  // Calculate visible lines on scroll or resize\n  const recalcVisibleLines = useCallback(() => {\n    const textarea = textareaRef.current;\n    if (!textarea) return;\n    const lineHeight = parseFloat(getComputedStyle(textarea).lineHeight) || 24;\n    const scrollTop = textarea.scrollTop;\n    const clientHeight = textarea.clientHeight;\n    const firstVisible = Math.floor(scrollTop / lineHeight);\n    const lastVisible = Math.min(\n      lines.length - 1,\n      Math.ceil((scrollTop + clientHeight) / lineHeight),\n    );\n    setScrollInfo({\n      firstVisible,\n      lastVisible,\n      scrollTop,\n      lineHeight,\n      clientHeight,\n    });\n  }, [lines.length]);\n\n  useEffect(() => {\n    recalcVisibleLines();\n    // Sync overlay height with textarea\n    const handleResize = () => recalcVisibleLines();\n    window.addEventListener(\"resize\", handleResize);\n    return () => window.removeEventListener(\"resize\", handleResize);\n  }, [value, recalcVisibleLines]);\n\n  // Attach scroll handler\n  const handleScroll = () => {\n    recalcVisibleLines();\n    if (textareaRef.current && preRef.current) {\n      preRef.current.scrollTop = textareaRef.current.scrollTop;\n      preRef.current.scrollLeft = textareaRef.current.scrollLeft;\n    }\n  };\n\n  // Only render visible lines in <pre>\n  const visibleLines = lines.slice(\n    scrollInfo.firstVisible,\n    scrollInfo.lastVisible + 1,\n  );\n\n  return (\n    <div\n      className={cn(\n        \"w-full h-full relative font-mono text-foreground text-sm min-h-[250px] overflow-hidden focus:border-none focus-visible:border-none focus-visible:outline-none\",\n        className,\n      )}\n      style={style}\n    >\n      {/* Highlight overlay */}\n      {error?.line && (\n        <pre\n          ref={preRef}\n          className=\"absolute inset-0 pointer-events-none select-none text-transparent whitespace-pre-wrap break-words focus-visible:outline-none shadow-none border-none rounded-md\"\n          aria-hidden=\"true\"\n          style={{\n            fontFamily: \"inherit\",\n            fontSize: \"inherit\",\n            lineHeight: \"1.5\",\n            margin: 0,\n            padding: \"8px 12px\",\n            paddingLeft: \"0\",\n            boxSizing: \"border-box\",\n            minHeight: \"250px\",\n            transform: `translateY(-${scrollInfo.scrollTop}px)`,\n          }}\n        >\n          <div style={{ height: scrollInfo.firstVisible * 1.5 + \"em\" }} />\n          {visibleLines.map((line, idx) => {\n            const globalIdx = idx + scrollInfo.firstVisible;\n            if (globalIdx === errorLineIdx) {\n              return (\n                <div\n                  key={globalIdx}\n                  className=\"bg-red-500/20\"\n                  style={{ display: \"block\" }}\n                >\n                  {line}\n                </div>\n              );\n            }\n            return <div key={globalIdx}>{line}</div>;\n          })}\n        </pre>\n      )}\n      {/* Line numbers overlay */}\n      <div\n        ref={lineNumbersRef}\n        className=\"absolute left-0 top-0 bottom-0 pointer-events-none select-none text-muted-foreground/60 text-xs border-r border-border/50 bg-muted/20 rounded-l-md h-fit\"\n        style={{\n          width: \"3rem\",\n          padding: \"11px 9px\",\n          boxSizing: \"border-box\",\n          fontFamily: \"inherit\",\n          fontSize: \"0.75em\",\n          lineHeight: \"1.5\",\n          transform: `translateY(-${scrollInfo.scrollTop}px)`,\n        }}\n      >\n        <div\n          style={{\n            height: scrollInfo.firstVisible * scrollInfo.lineHeight + \"px\",\n          }}\n        />\n        {visibleLines.map((_, idx) => {\n          const globalIdx = idx + scrollInfo.firstVisible;\n          return (\n            <div\n              key={globalIdx}\n              className=\"pr-2\"\n              style={{\n                height: \"16px\",\n                marginTop: idx === 0 ? 0 : \"5px\",\n                paddingTop: \"2px\",\n              }}\n            >\n              {globalIdx + 1}\n            </div>\n          );\n        })}\n      </div>\n      {/* Textarea */}\n      <textarea\n        ref={textareaRef}\n        className={cn(\n          \"absolute inset-0 resize-none bg-transparent border rounded-md text-black dark:text-white focus:overline-none focus:border-zinc-200 focus-visible:border-zinc-200 focus-visible:outline-none\",\n          error?.message ? \"!border-destructive\" : \"border-zinc-200\",\n        )}\n        value={value}\n        onChange={onChange}\n        onBlur={onBlur}\n        onScroll={handleScroll}\n        spellCheck={false}\n        style={{\n          fontFamily: \"inherit\",\n          fontSize: \"inherit\",\n          lineHeight: \"1.5\",\n          margin: 0,\n          padding: \"8px 12px 8px 4rem\", // Add left padding to account for line numbers\n          boxSizing: \"border-box\",\n          minHeight: \"250px\",\n          background: \"transparent\",\n          color: \"inherit\",\n          zIndex: 1,\n          outline: \"none\",\n          boxShadow: \"none\",\n        }}\n      />\n      {/* Error message overlay */}\n      {error?.message && (\n        <div\n          className=\"absolute left-0 right-0 bottom-0 px-3 py-1 text-xs text-white bg-red-500/90 z-10 pointer-events-none\"\n          style={{\n            fontFamily: \"inherit\",\n            fontSize: \"0.85em\",\n            borderBottomLeftRadius: 6,\n            borderBottomRightRadius: 6,\n          }}\n        >\n          {error.message}\n        </div>\n      )}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/preview/live-preview-frame.tsx",
    "content": "\"use client\";\n\nimport { useEffect, useRef, useState, useCallback } from \"react\";\n\nexport default function LivePreviewFrame({\n  sessionId,\n  onScrapeComplete,\n  children,\n}: {\n  sessionId: string;\n  children: React.ReactNode;\n  onScrapeComplete?: () => void;\n}) {\n  const imgRef = useRef<HTMLImageElement>(null);\n  const containerRef = useRef<HTMLDivElement>(null);\n  const wsRef = useRef<WebSocket | null>(null);\n  const reconnectTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n  const initialPositionSetRef = useRef(false);\n  const idleStartTimerRef = useRef<NodeJS.Timeout | null>(null);\n  const idleMoveTimerRef = useRef<NodeJS.Timeout | null>(null);\n  const [imageLoaded, setImageLoaded] = useState(false);\n  const [imageSrc, setImageSrc] = useState<string | null>(null);\n  const [isConnecting, setIsConnecting] = useState(true);\n  const [cursorPosition, setCursorPosition] = useState<{\n    x: number;\n    y: number;\n  }>({ x: 980, y: 54 });\n  const [targetPosition, setTargetPosition] = useState<{\n    x: number;\n    y: number;\n  }>({ x: 980, y: 54 });\n  const [isIdle, setIsIdle] = useState(false);\n\n  // Function to start the random idle movement sequence\n  const scheduleNextIdleMove = useCallback(() => {\n    if (idleMoveTimerRef.current) {\n      clearTimeout(idleMoveTimerRef.current);\n    }\n    const randomDelay = Math.random() * 500 + 500; // 500ms to 1000ms\n    idleMoveTimerRef.current = setTimeout(() => {\n      if (isIdle) {\n        // Check if still idle\n        const randomOffsetX = (Math.random() - 0.5) * 10; // -5 to +5 pixels\n        const randomOffsetY = (Math.random() - 0.5) * 10;\n        // Update target slightly - the main animation loop will handle the movement\n        setTargetPosition((prevTarget) => ({\n          x: prevTarget.x + randomOffsetX,\n          y: prevTarget.y + randomOffsetY,\n        }));\n        scheduleNextIdleMove(); // Schedule the next one\n      }\n    }, randomDelay);\n  }, [isIdle]);\n\n  // Effect to handle starting/stopping idle movement sequence\n  useEffect(() => {\n    if (isIdle) {\n      scheduleNextIdleMove();\n    } else {\n      if (idleMoveTimerRef.current) {\n        clearTimeout(idleMoveTimerRef.current);\n      }\n    }\n    // Cleanup function for this effect\n    return () => {\n      if (idleMoveTimerRef.current) {\n        clearTimeout(idleMoveTimerRef.current);\n      }\n    };\n  }, [isIdle, scheduleNextIdleMove]);\n\n  // Main Animation effect (runs continuously)\n  useEffect(() => {\n    let animationFrameId: number | null = null;\n    const step = () => {\n      setCursorPosition((currentPos) => {\n        const dx = targetPosition.x - currentPos.x;\n        const dy = targetPosition.y - currentPos.y;\n        const isClose = Math.abs(dx) < 0.1 && Math.abs(dy) < 0.1;\n\n        if (isClose) {\n          // Reached target\n          if (!isIdle && !idleStartTimerRef.current) {\n            // Only start the idle timer if not already idle and no timer is running\n            idleStartTimerRef.current = setTimeout(() => {\n              setIsIdle(true);\n              idleStartTimerRef.current = null; // Clear ref after timer runs\n            }, 5000);\n          }\n          if (animationFrameId) {\n            cancelAnimationFrame(animationFrameId);\n            animationFrameId = null;\n          }\n          return targetPosition; // Snap to final position\n        } else {\n          // Moving towards target\n          // If we were waiting to go idle, cancel it because we're moving again\n          if (idleStartTimerRef.current) {\n            clearTimeout(idleStartTimerRef.current);\n            idleStartTimerRef.current = null;\n          }\n          // Ensure idle state is false if we are moving significantly\n          if (isIdle) setIsIdle(false);\n\n          const nextX = currentPos.x + dx * 0.05; // Keep slow easing for now\n          const nextY = currentPos.y + dy * 0.05;\n          animationFrameId = requestAnimationFrame(step);\n          return { x: nextX, y: nextY };\n        }\n      });\n    };\n\n    // Start animation frame loop\n    animationFrameId = requestAnimationFrame(step);\n\n    // Cleanup function for main animation loop\n    return () => {\n      if (animationFrameId) {\n        cancelAnimationFrame(animationFrameId);\n      }\n      // Also clear idle start timer on unmount or if target changes causing effect re-run\n      if (idleStartTimerRef.current) {\n        clearTimeout(idleStartTimerRef.current);\n      }\n    };\n  }, [targetPosition, isIdle]); // Re-run main loop logic if targetPosition changes\n\n  const cleanupConnection = () => {\n    if (reconnectTimeoutRef.current) {\n      clearTimeout(reconnectTimeoutRef.current);\n      reconnectTimeoutRef.current = null;\n    }\n    if (wsRef.current) {\n      wsRef.current.close();\n      wsRef.current = null;\n    }\n    // Cancel animation frame (handled in effect cleanup, but good practice here too)\n    // Clear timers\n    if (idleStartTimerRef.current) clearTimeout(idleStartTimerRef.current);\n    if (idleMoveTimerRef.current) clearTimeout(idleMoveTimerRef.current);\n    // Reset state\n    setCursorPosition({ x: 0, y: 0 });\n    setTargetPosition({ x: 0, y: 0 });\n    setIsIdle(false);\n    initialPositionSetRef.current = false;\n  };\n\n  useEffect(() => {\n    if (onScrapeComplete) {\n      cleanupConnection();\n    }\n  }, [onScrapeComplete]);\n\n  const connect = useCallback(() => {\n    setIsConnecting(true);\n    // Clear any existing connection\n    if (wsRef.current) {\n      wsRef.current.close();\n      wsRef.current = null;\n    }\n\n    // Create new WebSocket connection\n    const wsUrl = `wss://api.firecrawl.dev/agent-livecast?userProvidedId=${sessionId}`;\n\n    try {\n      const ws = new WebSocket(wsUrl);\n      wsRef.current = ws;\n\n      ws.addEventListener(\"open\", () => {\n        console.log(\"Connected - Streaming frames...\");\n        setIsConnecting(false);\n        // Clear any pending reconnection attempts\n        if (reconnectTimeoutRef.current) {\n          clearTimeout(reconnectTimeoutRef.current);\n          reconnectTimeoutRef.current = null;\n        }\n      });\n\n      ws.addEventListener(\"message\", (event) => {\n        try {\n          // Try to handle as raw base64 first\n          if (\n            typeof event.data === \"string\" &&\n            event.data.startsWith(\"data:image\")\n          ) {\n            setImageSrc(event.data);\n            return;\n          }\n\n          // If not direct image data, try parsing as JSON\n          const data = JSON.parse(event.data);\n\n          if (data.mouseCoordinates) {\n            let { x, y } = data.mouseCoordinates;\n\n            // --- Interrupt Idle State ---\n            if (idleStartTimerRef.current) {\n              clearTimeout(idleStartTimerRef.current);\n              idleStartTimerRef.current = null;\n            }\n            if (isIdle) {\n              setIsIdle(false);\n              // idleMoveTimerRef is cleared by the isIdle effect cleanup\n            }\n            // --- End Interrupt Idle State ---\n\n            if (imgRef.current && containerRef.current) {\n              const rect = containerRef.current.getBoundingClientRect();\n              const imageRect = imgRef.current.getBoundingClientRect();\n\n              // Calculate the scale factor between the original coordinates and our container\n              const scaleX = imageRect.width / 1920;\n              const scaleY =\n                imageRect.height > 2000 ? 0 : imageRect.height / 1080;\n\n              if (x === 0 && y === 0) {\n                x = 1800;\n                y = 100;\n              }\n\n              // Scale the coordinates to match our container size\n              const scaledX = x * scaleX;\n              const scaledY = y * scaleY;\n\n              setTargetPosition({ x: scaledX, y: scaledY });\n\n              if (!initialPositionSetRef.current) {\n                setCursorPosition({ x: scaledX, y: scaledY });\n                initialPositionSetRef.current = true;\n              }\n            }\n          }\n\n          if (data.frame) {\n            const img = \"data:image/jpeg;base64,\" + data.frame;\n            localStorage.setItem(\"browserImageData\", img);\n            setImageSrc(img);\n          }\n        } catch (e) {\n          // Try to use raw data as fallback if JSON parsing fails\n          if (typeof event.data === \"string\") {\n            setImageSrc(event.data);\n          }\n        }\n      });\n\n      ws.addEventListener(\"close\", (event) => {\n        console.log(`Disconnected (Code: ${event.code})`);\n        wsRef.current = null;\n\n        // Attempt to reconnect after a delay for any unexpected closure\n        if (event.code !== 1000) {\n          reconnectTimeoutRef.current = setTimeout(() => {\n            if (sessionId) {\n              connect();\n            }\n          }, 3000); // Wait 3 seconds before reconnecting\n        }\n      });\n\n      ws.addEventListener(\"error\", (error) => {\n        console.error(\"Connection error - Will attempt to reconnect\");\n      });\n    } catch (error) {\n      console.error(\"Failed to create connection\");\n      setIsConnecting(false);\n    }\n  }, [sessionId, isIdle]);\n\n  useEffect(() => {\n    // Only connect if we have a sessionId\n    if (sessionId) {\n      connect();\n\n      return () => {\n        cleanupConnection();\n      };\n    } else {\n      // Clean up any existing connection\n      cleanupConnection();\n      console.log(\"Waiting for session ID...\");\n\n      return () => {\n        cleanupConnection();\n      };\n    }\n  }, [sessionId, connect]); // Re-run effect when sessionId changes\n\n  return (\n    <div\n      ref={containerRef}\n      className=\"relative w-full h-full flex items-center justify-center\"\n    >\n      {/* Cursor */}\n      {cursorPosition && cursorPosition.x !== 0 && cursorPosition.y !== 0 && (\n        <div\n          className=\"absolute pointer-events-none transform-gpu\"\n          style={{\n            left: `${cursorPosition.x}px`,\n            top: `${cursorPosition.y}px`,\n            width: \"50px\",\n            height: \"50px\",\n            backgroundImage: `url(\"/images/agent-cursor.svg\")`,\n            backgroundSize: \"contain\",\n            backgroundRepeat: \"no-repeat\",\n            transform: \"translate(-20%, -20%)\",\n            zIndex: 10,\n            transition: isIdle ? \"all 0.5s ease-out\" : \"all 0.1s linear\",\n          }}\n        />\n      )}\n\n      {/* Children fallback */}\n      {children && !imgRef.current?.src ? (\n        <div className=\"h-full w-full flex items-center justify-center\">\n          {children}\n        </div>\n      ) : null}\n\n      {/* Preview image - Using regular img tag for dynamic WebSocket stream */}\n      {imageSrc && (\n        <img\n          ref={imgRef}\n          id=\"live-frame\"\n          src={imageSrc}\n          alt=\"Live preview\"\n          onLoad={() => {\n            setImageLoaded(true);\n            if (onScrapeComplete) onScrapeComplete();\n          }}\n          className={`w-auto h-auto max-w-full max-h-full object-contain transform-gpu ${\n            !imageLoaded ? \"opacity-0 scale-95\" : \"opacity-100 scale-100\"\n          } transition-all duration-300 ease-out`}\n          style={{\n            backgroundColor: \"#f0f0f0\",\n          }}\n        />\n      )}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/preview/multiple-web-browsers.tsx",
    "content": "\"use client\";\nimport { useEffect, useState, useCallback } from \"react\";\nimport { motion } from \"framer-motion\";\nimport WebBrowser from \"./web-browser\";\n\nlet interval: NodeJS.Timeout;\n\ntype BrowserData = {\n  id: number;\n  sessionId: string;\n  isScrapeComplete: boolean;\n  children?: React.ReactNode;\n};\n\nexport default function MultipleWebBrowsers({\n  browsers,\n  offset,\n  scaleFactor,\n  autoRotate = true,\n  rotationInterval = 5000,\n}: {\n  browsers: BrowserData[];\n  offset?: number;\n  scaleFactor?: number;\n  autoRotate?: boolean;\n  rotationInterval?: number;\n}) {\n  const CARD_OFFSET = offset || 10;\n  const SCALE_FACTOR = scaleFactor || 0.06;\n  const [activeBrowsers, setActiveBrowsers] = useState<BrowserData[]>(browsers);\n\n  const startRotation = useCallback(() => {\n    interval = setInterval(() => {\n      setActiveBrowsers((prevBrowsers: BrowserData[]) => {\n        const newArray = [...prevBrowsers];\n        newArray.unshift(newArray.pop()!); // move the last element to the front\n        return newArray;\n      });\n    }, rotationInterval);\n  }, [rotationInterval]);\n\n  useEffect(() => {\n    if (autoRotate) {\n      startRotation();\n    }\n    return () => clearInterval(interval);\n  }, [autoRotate, startRotation]);\n\n  return (\n    <div className=\"relative h-[600px] w-full\">\n      {activeBrowsers.map((browser, index) => {\n        return (\n          <motion.div\n            key={browser.id}\n            className=\"absolute w-full rounded-xl overflow-hidden\"\n            style={{\n              transformOrigin: \"top center\",\n            }}\n            animate={{\n              top: index * -CARD_OFFSET,\n              scale: 1 - index * SCALE_FACTOR,\n              zIndex: activeBrowsers.length - index,\n            }}\n          >\n            <WebBrowser\n              sessionId={browser.sessionId}\n              isScrapeComplete={browser.isScrapeComplete}\n            >\n              {browser.children}\n            </WebBrowser>\n          </motion.div>\n        );\n      })}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/preview/web-browser.tsx",
    "content": "import { useEffect, useState } from \"react\";\nimport LivePreviewFrame from \"./live-preview-frame\";\n\nexport default function WebBrowser({\n  url,\n  sessionId,\n  isScrapeComplete,\n  children,\n}: {\n  url?: string;\n  sessionId: string;\n  isScrapeComplete: boolean;\n  children?: React.ReactNode;\n}) {\n  const [isLoading, setIsLoading] = useState(true);\n  const [isVisible, setIsVisible] = useState(false);\n\n  useEffect(() => {\n    // Add a slight delay before showing the browser to ensure smooth entrance\n    const timer = setTimeout(() => {\n      setIsVisible(true);\n      setIsLoading(false);\n    }, 100);\n\n    return () => clearTimeout(timer);\n  }, []);\n\n  return (\n    <main className=\"relative w-full h-full flex items-center justify-center bg-transparent\">\n      <div\n        className={`w-full h-full max-w-[95vw] max-h-[85vh] min-w-full sm:min-w-[700px] rounded-2xl shadow-lg border border-gray-100 bg-white overflow-hidden flex flex-col transform-gpu ${\n          isVisible ? \"opacity-100 translate-y-0\" : \"opacity-0 translate-y-4\"\n        } transition-all duration-300 ease-out`}\n      >\n        {/* macOS-style top bar with loading indicator */}\n        <div className=\"flex items-center justify-between px-4 py-2 border-b border-gray-100 bg-zinc-50 flex-shrink-0\">\n          <div className=\"flex gap-2\">\n            <div\n              className={`w-3 h-3 rounded-full transition-colors duration-200 ${\n                isLoading ? \"bg-yellow-500\" : \"bg-red-500\"\n              }`}\n            />\n            <div\n              className={`w-3 h-3 rounded-full transition-colors duration-200 ${\n                isLoading ? \"bg-yellow-500\" : \"bg-yellow-500\"\n              }`}\n            />\n            <div\n              className={`w-3 h-3 rounded-full transition-colors duration-200 ${\n                isLoading ? \"bg-yellow-500\" : \"bg-green-500\"\n              }`}\n            />\n          </div>\n\n          <div className=\"flex items-center gap-2\">\n            {/* Spinner */}\n            <div className=\"browser-spinner animate-spin w-4 h-4 border-2 border-zinc-300 border-t-zinc-600 rounded-full\" />\n          </div>\n        </div>\n\n        {/* Content area with fade transition */}\n        <div\n          className={`flex-1 overflow-hidden transition-opacity duration-300 ${\n            isLoading ? \"opacity-50\" : \"opacity-100\"\n          }`}\n        >\n          <LivePreviewFrame\n            sessionId={sessionId}\n            onScrapeComplete={\n              isScrapeComplete\n                ? () => {\n                    console.log(\"Scrape complete\");\n                    setIsLoading(false);\n                  }\n                : undefined\n            }\n          >\n            {children}\n          </LivePreviewFrame>\n        </div>\n      </div>\n    </main>\n  );\n}\n"
  },
  {
    "path": "components/shared/pylon.tsx",
    "content": "\"use client\";\n\nimport { useEffect } from \"react\";\nimport Script from \"next/script\";\n\nconst pylon_app_id = \"da167302-89d0-41fa-b794-0f8d19c70b68\";\n\ninterface PylonChatProps {\n  user: {\n    email?: string | undefined;\n  };\n  nonce: string;\n}\n\nconst PylonChat: React.FC<PylonChatProps> = ({ user, nonce }) => {\n  useEffect(() => {\n    // If there's no user.email, do nothing.\n    if (!user?.email) return;\n\n    // Mount/initialize Pylon\n    (window as any).pylon = {\n      chat_settings: {\n        app_id: pylon_app_id,\n        email: user.email,\n        name: user.email,\n      },\n    };\n\n    // The cleanup function to run when the user logs out\n    // or when this component unmounts.\n    return () => {\n      try {\n        console.log(\"Unmounting Pylon script...\");\n\n        // If Pylon provides a remove/destroy function, call it:\n        if (\n          (window as any).Pylon &&\n          typeof (window as any).Pylon.remove === \"function\"\n        ) {\n          (window as any).Pylon.remove();\n        }\n\n        // Remove the script tag from the DOM, if you wish:\n        const pylonScript = document.getElementById(\"pylon-script\");\n        if (pylonScript) {\n          pylonScript.remove();\n        }\n\n        // Also remove the global Pylon variables, if desired:\n        delete (window as any).Pylon;\n        delete (window as any).pylon;\n      } catch (error) {\n        console.error(\"Error unmounting Pylon script:\", error);\n      }\n    };\n  }, [user]);\n\n  // Only render the script if we have a user email\n  if (!user?.email) {\n    console.log(\"No user email found, not rendering Pylon chat\");\n    return null;\n  }\n\n  return (\n    <Script\n      id=\"pylon-script\"\n      nonce={nonce}\n      strategy=\"afterInteractive\"\n      onLoad={() => {}}\n      onError={(e) => {\n        console.error(\"Error loading Pylon script:\", e);\n      }}\n      dangerouslySetInnerHTML={{\n        __html: `\n          (function(){\n            var e=window;\n            var t=document;\n            var n=function(){n.e(arguments)};\n            n.q=[];\n            n.e=function(e){n.q.push(e)};\n            e.Pylon=n;\n            var r=function(){\n              var s=t.createElement(\"script\");\n              s.setAttribute(\"type\",\"text/javascript\");\n              s.setAttribute(\"async\",\"true\");\n              s.setAttribute(\"src\",\"https://widget.usepylon.com/widget/${pylon_app_id}\");\n              var o=t.getElementsByTagName(\"script\")[0];\n              o.parentNode.insertBefore(s,o)\n            };\n            if(t.readyState===\"complete\"){ \n              r()\n            } else if(e.addEventListener){\n              e.addEventListener(\"load\",r,false)\n            }\n          })();\n        `,\n      }}\n    />\n  );\n};\n\nexport default PylonChat;\n"
  },
  {
    "path": "components/shared/search-params-provider/search-params-provider.tsx",
    "content": "\"use client\";\n\nimport React, { createContext, useContext, ReactNode } from \"react\";\n\ntype SearchParamsContextType = { [key: string]: string | string[] | undefined };\n\nconst SearchParamsContext = createContext<SearchParamsContextType | null>(null);\n\nexport const SearchParamsProvider = ({\n  children,\n  params,\n}: {\n  children: ReactNode;\n  params: SearchParamsContextType;\n}) => {\n  return (\n    <SearchParamsContext.Provider value={params}>\n      {children}\n    </SearchParamsContext.Provider>\n  );\n};\n\nexport const useSearchParamsContext = () => {\n  const context = useContext(SearchParamsContext);\n\n  if (!context) {\n    throw new Error(\n      \"useSearchParamsContext must be used within a SearchParamsProvider\",\n    );\n  }\n\n  return context;\n};\n"
  },
  {
    "path": "components/shared/section-head/SectionHead.css",
    "content": ".section-head-shadow {\n  -webkit-text-stroke-color: var(--background-base);\n  -webkit-text-stroke-width: 24px;\n}\n"
  },
  {
    "path": "components/shared/section-head/SectionHead.tsx",
    "content": "import { HTMLAttributes } from \"react\";\n\nimport Badge from \"@/components/ui/shadcn/badge\";\nimport CurvyRect from \"@/components/shared/layout/curvy-rect\";\nimport { cn } from \"@/utils/cn\";\n\ntype SectionHeadProps = {\n  children: React.ReactNode;\n  title: string | React.ReactNode;\n  titleClassName?: string;\n  titleShadow?: boolean;\n  badgeContent?: React.ReactNode;\n  badgeClassName?: string;\n  description?: React.ReactNode | string;\n  descriptionClassName?: string;\n  containerClassName?: string;\n  action?: React.ReactNode;\n  smallerHeader?: boolean;\n};\n\nexport default function SectionHead({\n  children,\n  title,\n  titleClassName,\n  titleShadow = true,\n  badgeContent,\n  badgeClassName,\n  description,\n  descriptionClassName,\n  containerClassName,\n  action,\n  smallerHeader = false,\n  ...attrs\n}: SectionHeadProps &\n  Omit<HTMLAttributes<HTMLDivElement>, keyof SectionHeadProps>) {\n  return (\n    <div\n      {...attrs}\n      className={cn(\n        smallerHeader\n          ? \"relative py-64 lg:py-88 overflow-clip z-[1]\"\n          : \"relative py-88 lg:py-143 overflow-clip z-[1]\",\n        attrs.className,\n      )}\n    >\n      <CurvyRect allSides />\n      <div className=\"h-1 bg-border-faint bottom-0 left-0 w-full absolute\" />\n\n      <div className={cn(\"relative\", containerClassName)}>\n        {badgeContent && (\n          <Badge className={cn(\"mx-auto px-12 pt-16\", badgeClassName)}>\n            {badgeContent}\n          </Badge>\n        )}\n\n        <div>\n          <h2\n            className={cn(\n              \"lg:w-max relative mx-auto text-accent-black text-title-h2 pb-8 pt-12 px-20 text-center section-head-title\",\n              titleClassName,\n            )}\n          >\n            {titleShadow && (\n              <div\n                className=\"overlay -z-[1] p-[inherit] section-head-shadow\"\n                aria-hidden\n              >\n                {title}\n              </div>\n            )}\n\n            {title}\n          </h2>\n\n          {description && (\n            <div\n              className={cn(\n                \"section-head-title max-w-369 px-20 py-8 relative w-full mx-auto !text-black-alpha-72 text-body-large text-center mb-32 last:mb-0\",\n                descriptionClassName,\n              )}\n            >\n              {description}\n\n              <div\n                className=\"overlay -z-[1] p-[inherit] section-head-shadow\"\n                aria-hidden\n              >\n                {description}\n              </div>\n            </div>\n          )}\n\n          {action}\n        </div>\n      </div>\n\n      {children}\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/section-title/SectionTitle.tsx",
    "content": "import {\n  Connector,\n  ConnectorToLeft,\n  ConnectorToRight,\n} from \"@/components/shared/layout/curvy-rect\";\n\nexport default function SectionTitle({\n  index,\n  max,\n  title,\n}: {\n  index: number;\n  max: number;\n  title: string;\n}) {\n  return (\n    <div className=\"container -mt-1 pointer-events-none select-none relative\">\n      <Connector className=\"absolute right-[-10.5px] -top-10\" />\n      <Connector className=\"absolute left-[-10.5px] -top-10\" />\n      <Connector className=\"absolute right-[-10.5px] -bottom-10\" />\n      <Connector className=\"absolute left-[-10.5px] -bottom-10\" />\n\n      <div className=\"h-92 lg:h-140 relative\">\n        <div className=\"h-1 bottom-0 absolute left-0 w-full bg-border-faint\" />\n        <div className=\"h-1 top-0 absolute w-screen left-[calc(50%-50vw)] bg-border-faint\" />\n      </div>\n\n      <div className=\"relative grid lg:grid-cols-2 -mt-1\">\n        <div className=\"h-1 bottom-0 absolute w-screen left-[calc(50%-50vw)] bg-border-faint\" />\n\n        <ConnectorToRight className=\"absolute left-0 -top-10\" />\n        <ConnectorToLeft className=\"absolute right-0 -top-10\" />\n\n        <div className=\"flex gap-40 py-24 lg:py-45 relative\">\n          <div className=\"h-full w-1 right-0 top-0 bg-border-faint absolute lg-max:hidden\" />\n          <div className=\"w-2 h-16 bg-heat-100\" />\n\n          <div className=\"flex gap-12 items-center !text-mono-x-small text-black-alpha-16 font-mono\">\n            <div>\n              [{\" \"}\n              <span className=\"text-heat-100\">\n                {index.toString().padStart(2, \"0\")}\n              </span>{\" \"}\n              / {max.toString().padStart(2, \"0\")} ]\n            </div>\n\n            <div className=\"w-8 text-center\">·</div>\n\n            <div className=\"uppercase text-black-alpha-32\">{title}</div>\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/tabs/Tabs.tsx",
    "content": "import { animate } from \"motion\";\nimport { motion } from \"motion/react\";\nimport { useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type Props = {\n  tabs: {\n    value: string;\n    label: string;\n    description?: string;\n    icon?: React.ReactNode;\n    children?: React.ReactNode;\n  }[];\n  activeTab: string;\n  setActiveTab: (tab: string) => void;\n  position?: \"left\" | \"center\";\n  itemButtonClassName?: string;\n  itemClassName?: string;\n  noScroll?: boolean;\n};\n\nexport default function Tabs({\n  tabs,\n  activeTab,\n  setActiveTab,\n  position = \"left\",\n  itemButtonClassName,\n  itemClassName,\n  noScroll,\n}: Props) {\n  const backgroundRef = useRef<HTMLDivElement>(null);\n  const activeIndex = useMemo(\n    () => tabs.findIndex((tab) => tab.value === activeTab),\n    [tabs, activeTab],\n  );\n\n  const [styles, setStyles] = useState<{\n    x: number;\n    width: number;\n  }>({\n    x: 0,\n    width: 0,\n  });\n\n  return (\n    <div\n      className={cn(\n        \"overflow-x-scroll whitespace-nowrap hide-scrollbar lg:contents py-32 -my-32\",\n        noScroll && \"!contents\",\n      )}\n    >\n      <div\n        className={cn(\n          \"flex relative\",\n          position === \"center\" && \"lg:justify-center\",\n        )}\n      >\n        {styles.width !== 0 && (\n          <motion.div\n            animate={styles}\n            className=\"absolute top-12 left-0 z-[2] inset-y-12 bg-white-alpha-72 rounded-full backdrop-blur-4\"\n            initial={styles}\n            ref={backgroundRef}\n            style={{\n              boxShadow:\n                \"0px 24px 32px -12px rgba(0, 0, 0, 0.03), 0px 16px 24px -8px rgba(0, 0, 0, 0.03), 0px 8px 16px -4px rgba(0, 0, 0, 0.03), 0px 0px 0px 1px rgba(0, 0, 0, 0.03)\",\n            }}\n            transition={{\n              type: \"spring\",\n              stiffness: 250,\n              damping: 26,\n            }}\n          />\n        )}\n\n        {tabs.map((tab, index) => (\n          <div className={cn(\"relative p-12 group\", itemClassName)} key={index}>\n            <div className=\"h-full w-1 right-0 absolute bg-border-faint top-0\" />\n            {position === \"center\" && (\n              <div className=\"h-full w-1 -left-1 lg-max:hidden absolute bg-border-faint top-0\" />\n            )}\n\n            <button\n              className={cn(\n                \"py-12 px-24 flex gap-4 justify-center items-center w-full relative z-[3] transition-colors\",\n                activeTab === tab.value\n                  ? \"text-accent-black\"\n                  : \"text-black-alpha-64 hover:text-black-alpha-88 hover:before:opacity-100\",\n                \"inside-border before:border-border-faint before:opacity-0 rounded-full before:scale-[0.98] hover:before:scale-100\",\n                itemButtonClassName,\n              )}\n              data-active={activeTab === tab.value}\n              ref={(element) => {\n                if (element && index === activeIndex) {\n                  const target = element.closest(\".group\") as HTMLButtonElement;\n                  const width = target.offsetWidth;\n\n                  setStyles({\n                    x: target.offsetLeft + 12,\n                    width: width - 24,\n                  });\n                }\n              }}\n              onClick={(e) => {\n                setActiveTab(tab.value);\n\n                const t = e.target as HTMLElement;\n\n                let target =\n                  t instanceof HTMLButtonElement\n                    ? t\n                    : (t.closest(\"button\") as HTMLButtonElement);\n                target = target.closest(\".group\") as HTMLButtonElement;\n\n                if (backgroundRef.current) {\n                  animate(backgroundRef.current, { scale: 0.96 }).then(() =>\n                    animate(backgroundRef.current!, { scale: 1 }),\n                  );\n\n                  setStyles({\n                    x: target.offsetLeft + 12,\n                    width: target.offsetWidth - 24,\n                  });\n                }\n\n                if (window.innerWidth < 996) {\n                  const parent = backgroundRef.current!.parentElement!\n                    .parentElement as HTMLDivElement;\n\n                  parent.scrollTo({\n                    left: target.offsetLeft - target.clientWidth / 2,\n                    behavior: \"smooth\",\n                  });\n                }\n              }}\n            >\n              {tab.icon}\n\n              <div className=\"px-4 text-label-medium\">{tab.label}</div>\n\n              {tab.children}\n            </button>\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/ui/app-dialog.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { motion } from \"framer-motion\";\nimport CurvyRect from \"@/components/shared/layout/curvy-rect\";\nimport { cn } from \"@/utils/cn\";\nimport {\n  Dialog,\n  DialogTrigger,\n  DialogPortal,\n  DialogOverlay,\n  DialogClose,\n  DialogHeader,\n  DialogFooter,\n  DialogTitle,\n  DialogDescription,\n  DialogContent as ShadDialogContent,\n} from \"@/components/ui/shadcn/dialog\";\n\ntype AppDialogContentProps = React.ComponentPropsWithoutRef<\n  typeof ShadDialogContent\n> & {\n  withCurvyRect?: boolean;\n  bodyClassName?: string;\n};\n\nexport function AppDialogContent({\n  className,\n  children,\n  withCurvyRect = true,\n  bodyClassName,\n  ...props\n}: AppDialogContentProps) {\n  return (\n    <ShadDialogContent\n      className={cn(\n        \"sm:rounded-16 p-0 border border-border-faint bg-white relative overflow-hidden\",\n        className,\n      )}\n      {...props}\n    >\n      {withCurvyRect && (\n        <CurvyRect className=\"absolute inset-0 pointer-events-none\" allSides />\n      )}\n      <motion.div\n        initial={{ opacity: 0, scale: 0.985, y: 24 }}\n        animate={{ opacity: 1, scale: 1, y: 0 }}\n        transition={{ type: \"spring\", stiffness: 300, damping: 24, mass: 0.9 }}\n        className={cn(\"relative p-16 pb-12\", bodyClassName)}\n      >\n        {children}\n      </motion.div>\n    </ShadDialogContent>\n  );\n}\n\nexport {\n  Dialog,\n  DialogTrigger,\n  DialogPortal,\n  DialogOverlay,\n  DialogClose,\n  DialogHeader,\n  DialogFooter,\n  DialogTitle,\n  DialogDescription,\n};\n"
  },
  {
    "path": "components/shared/ui/ascii-dot-loader.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { AnimatedDotIcon } from \"@/components/shared/animated-dot-icon\";\n\ninterface AsciiDotLoaderProps {\n  size?: number;\n  animated?: boolean;\n  className?: string;\n  pattern?: Parameters<typeof AnimatedDotIcon>[0][\"pattern\"];\n}\n\n// Thin wrapper to reuse the exact ASCII pixel effect used on the home hero\nexport default function AsciiDotLoader({\n  size = 20,\n  animated = true,\n  className,\n  pattern = \"logs\",\n}: AsciiDotLoaderProps) {\n  return (\n    <AnimatedDotIcon\n      size={size}\n      active={animated}\n      alwaysHeat\n      className={className}\n      pattern={pattern}\n    />\n  );\n}\n"
  },
  {
    "path": "components/shared/ui/dot-grid-loader.tsx",
    "content": "\"use client\";\n\nimport { motion } from \"motion/react\";\nimport React from \"react\";\n\ninterface DotGridLoaderProps {\n  size?: number; // pixel size of each dot\n  cols?: number;\n  rows?: number;\n  className?: string;\n  animated?: boolean;\n  intensityMap?: number[]; // per-dot base opacity 0..1, length cols*rows\n}\n\nexport function DotGridLoader({\n  size = 10,\n  cols = 3,\n  rows = 3,\n  className,\n  animated = true,\n  intensityMap,\n}: DotGridLoaderProps) {\n  const total = cols * rows;\n  const defaultMap = Array.from({ length: total }).map((_, i) => {\n    // Row alphas tuned to hero prompt style: top=0.4, middle=1, bottom=0.12\n    const row = Math.floor(i / cols);\n    if (row === 0) return 0.4; // top\n    if (row === 1) return 1.0; // middle\n    return 0.12; // bottom\n  });\n  const bases =\n    intensityMap && intensityMap.length === total ? intensityMap : defaultMap;\n  return (\n    <div\n      className={className}\n      style={{\n        display: \"grid\",\n        gridTemplateColumns: `repeat(${cols}, ${size}px)`,\n        gap: Math.max(2, Math.round(size / 3)),\n      }}\n    >\n      {Array.from({ length: total }).map((_, i) => {\n        const base = bases[i] ?? 0.8;\n        return (\n          <motion.div\n            key={i}\n            initial={{ opacity: base }}\n            animate={\n              animated ? { opacity: [base, 1, base] } : { opacity: base }\n            }\n            transition={\n              animated\n                ? { duration: 1.1, repeat: Infinity, delay: i * 0.08 }\n                : undefined\n            }\n            style={{ width: size, height: size }}\n            className=\"rounded-[2px] bg-heat-100\"\n          />\n        );\n      })}\n    </div>\n  );\n}\n\nexport default DotGridLoader;\n"
  },
  {
    "path": "components/shared/ui/empty-state.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { AsciiExplosion } from \"@/components/shared/effects/flame\";\n\ninterface EmptyStateProps {\n  title?: string;\n  description?: string;\n  icon?: React.ReactNode;\n  action?: React.ReactNode;\n  showFlame?: boolean;\n  className?: string;\n}\n\nexport function EmptyState({\n  title = \"No data yet\",\n  description,\n  icon,\n  action,\n  showFlame = true,\n  className,\n}: EmptyStateProps) {\n  return (\n    <div\n      className={cn(\n        \"relative flex flex-col items-center justify-center py-12 px-4 text-center\",\n        \"min-h-[300px]\",\n        className,\n      )}\n    >\n      {/* Subtle flame background */}\n      {showFlame && (\n        <div className=\"absolute inset-0 opacity-5\">\n          <AsciiExplosion />\n        </div>\n      )}\n\n      <div className=\"relative z-10 space-y-4\">\n        {icon && (\n          <div className=\"w-12 h-12 mx-auto text-black-alpha-40\">{icon}</div>\n        )}\n\n        <div className=\"space-y-2\">\n          <h3 className=\"text-label-large text-black-alpha-72\">{title}</h3>\n          {description && (\n            <p className=\"text-body-medium text-black-alpha-56 max-w-md mx-auto\">\n              {description}\n            </p>\n          )}\n        </div>\n\n        {action && <div className=\"pt-2\">{action}</div>}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/ui/index.ts",
    "content": "// UI Components\nexport { StatCard } from \"./stat-card\";\nexport { LoadingState } from \"./loading-state\";\nexport { EmptyState } from \"./empty-state\";\nexport { default as CurvyRect } from \"@/components/shared/layout/curvy-rect\";\n"
  },
  {
    "path": "components/shared/ui/loading-state.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { CoreFlame } from \"@/components/shared/effects/flame\";\n\ninterface LoadingStateProps {\n  message?: string;\n  showFlame?: boolean;\n  size?: \"sm\" | \"md\" | \"lg\";\n  className?: string;\n}\n\nexport function LoadingState({\n  message = \"Loading...\",\n  showFlame = true,\n  size = \"md\",\n  className,\n}: LoadingStateProps) {\n  const sizeClasses = {\n    sm: \"min-h-[200px]\",\n    md: \"min-h-[300px]\",\n    lg: \"min-h-[400px]\",\n  };\n\n  const spinnerSizes = {\n    sm: \"w-6 h-6\",\n    md: \"w-8 h-8\",\n    lg: \"w-10 h-10\",\n  };\n\n  return (\n    <div\n      className={cn(\n        \"relative flex flex-col items-center justify-center\",\n        sizeClasses[size],\n        className,\n      )}\n    >\n      {/* Subtle pulsing flame */}\n      {showFlame && (\n        <div className=\"absolute inset-0\">\n          <CoreFlame className=\"opacity-10 animate-pulse\" />\n        </div>\n      )}\n\n      <div className=\"relative z-10 space-y-4\">\n        {/* Spinner */}\n        <div\n          className={cn(\n            \"mx-auto rounded-full border-2 border-black-alpha-20 border-t-heat-100 animate-spin\",\n            spinnerSizes[size],\n          )}\n        />\n\n        {/* Message */}\n        {message && (\n          <p className=\"text-body-medium text-black-alpha-64\">{message}</p>\n        )}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/ui/mobile-sheet.tsx",
    "content": "\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\nimport { X } from \"lucide-react\";\nimport { useAtom } from \"jotai\";\nimport { cn } from \"@/utils/cn\";\nimport { isMobileSheetOpenAtom } from \"@/atoms/sheets\";\n\ninterface MobileSheetProps {\n  isOpen: boolean;\n  onClose: () => void;\n  title?: React.ReactNode;\n  showCloseButton?: boolean;\n  position?: \"top\" | \"bottom\";\n  spacing?: \"sm\" | \"md\" | \"lg\"; // sm=16px, md=20px, lg=24px from all edges\n  children: React.ReactNode;\n  className?: string;\n  contentHeight?: \"auto\" | \"fill\" | \"full\"; // 'auto' for small content, 'fill' for lists, 'full' for nearly fullscreen\n  contentPadding?: boolean; // Whether to add default padding to content area (default: true)\n  closeOnOverlayClick?: boolean; // Whether clicking the overlay should close the sheet (default: true)\n}\n\n// Hook to auto-close mobile sheets when transitioning to desktop\nfunction useAutoCloseOnDesktop(isOpen: boolean, onClose: () => void) {\n  useEffect(() => {\n    if (!isOpen) return;\n\n    const handleResize = () => {\n      // Close immediately if screen becomes larger than mobile breakpoint (768px for lg:)\n      if (window.innerWidth >= 1024) {\n        onClose();\n      }\n    };\n\n    window.addEventListener(\"resize\", handleResize);\n\n    // Check immediately in case we're already on desktop\n    handleResize();\n\n    return () => {\n      window.removeEventListener(\"resize\", handleResize);\n    };\n  }, [isOpen, onClose]);\n}\n\nexport function MobileSheet({\n  isOpen,\n  onClose,\n  title,\n  showCloseButton = false,\n  position = \"bottom\",\n  spacing = \"sm\",\n  children,\n  className,\n  contentHeight = \"auto\",\n  contentPadding = true,\n  closeOnOverlayClick = true,\n}: MobileSheetProps) {\n  const [, setIsMobileSheetOpen] = useAtom(isMobileSheetOpenAtom);\n  const scrollRef = useRef<HTMLDivElement>(null);\n  const [showTopGradient, setShowTopGradient] = useState(false);\n  const [showBottomGradient, setShowBottomGradient] = useState(false);\n\n  // Handle global mobile sheet state changes (always reflect actual open state)\n  useEffect(() => {\n    setIsMobileSheetOpen(isOpen);\n    return () => setIsMobileSheetOpen(false);\n  }, [isOpen, setIsMobileSheetOpen]);\n\n  // Lock background scroll when sheet is open, restore when closed\n  useEffect(() => {\n    if (typeof document === \"undefined\") return;\n    if (isOpen) {\n      const previousOverflow = document.body.style.overflow;\n      document.body.style.overflow = \"hidden\";\n      return () => {\n        document.body.style.overflow = previousOverflow;\n      };\n    } else {\n      document.body.style.overflow = \"\";\n    }\n  }, [isOpen]);\n\n  // Auto-close when transitioning to desktop\n  useAutoCloseOnDesktop(isOpen, onClose);\n\n  // Check initial scroll state when sheet opens\n  useEffect(() => {\n    if (isOpen && scrollRef.current) {\n      // Small delay to ensure content is rendered\n      setTimeout(() => {\n        const target = scrollRef.current;\n        if (target) {\n          const isAtTop = target.scrollTop <= 5;\n          const isAtBottom =\n            target.scrollHeight - target.scrollTop - target.clientHeight <= 5;\n          const hasScroll = target.scrollHeight > target.clientHeight;\n\n          setShowTopGradient(hasScroll && !isAtTop);\n          setShowBottomGradient(hasScroll && !isAtBottom);\n        }\n      }, 50);\n    }\n  }, [isOpen]);\n\n  // Enhanced close handler\n  const handleClose = () => {\n    // Re-enable page scroll after closing sheet\n    document.body.style.overflow = \"\";\n    onClose();\n  };\n\n  // Define spacing values\n  const getSpacingClass = () => {\n    const horizontalSpacing =\n      spacing === \"sm\"\n        ? \"left-16 right-16\"\n        : spacing === \"md\"\n          ? \"left-20 right-20\"\n          : \"left-24 right-24\";\n\n    if (contentHeight === \"full\") {\n      if (spacing === \"sm\") return `${horizontalSpacing} top-16 bottom-16`;\n      if (spacing === \"md\") return `${horizontalSpacing} top-20 bottom-20`;\n      return `${horizontalSpacing} top-24 bottom-24`;\n    }\n\n    const verticalSpacing =\n      position === \"top\"\n        ? spacing === \"sm\"\n          ? \"top-16\"\n          : spacing === \"md\"\n            ? \"top-20\"\n            : \"top-24\"\n        : spacing === \"sm\"\n          ? \"bottom-16\"\n          : spacing === \"md\"\n            ? \"bottom-20\"\n            : \"bottom-24\";\n\n    return `${horizontalSpacing} ${verticalSpacing}`;\n  };\n\n  return (\n    <AnimatePresence>\n      {isOpen && (\n        <div\n          className=\"fixed inset-0 z-[120] lg:hidden\"\n          onClick={() => {\n            if (closeOnOverlayClick) {\n              handleClose();\n            }\n          }}\n        >\n          {/* Sheet content - positioned from top or bottom */}\n          <motion.div\n            initial={{\n              opacity: 0,\n              y: position === \"top\" ? -50 : 50,\n            }}\n            animate={{ opacity: 1, y: 0 }}\n            exit={{\n              opacity: 0,\n              y: position === \"top\" ? -50 : 50,\n            }}\n            transition={{\n              type: \"spring\",\n              stiffness: 300,\n              damping: 30,\n              mass: 0.8,\n            }}\n            className={cn(\"absolute\", getSpacingClass())}\n            onClick={(e) => e.stopPropagation()}\n          >\n            <div\n              className={cn(\n                \"bg-background-base border border-border-faint rounded-12 shadow-2xl overflow-hidden\",\n                className,\n              )}\n            >\n              {/* Header */}\n              {(title || showCloseButton) && (\n                <div className=\"px-24 py-16 border-b border-border-faint flex items-center justify-between\">\n                  {title && (\n                    <h2 className=\"text-label-large text-accent-black\">\n                      {title}\n                    </h2>\n                  )}\n                  {showCloseButton && (\n                    <button\n                      onClick={handleClose}\n                      className={cn(\n                        \"h-32 w-32 flex items-center justify-center transition-all rounded-6 border border-border-faint\",\n                        \"bg-black-alpha-4 hover:bg-black-alpha-6 active:scale-[0.98]\",\n                        \"text-black-alpha-64 hover:text-accent-black\",\n                      )}\n                      aria-label=\"Close\"\n                    >\n                      <X className=\"w-16 h-16\" />\n                    </button>\n                  )}\n                </div>\n              )}\n\n              {/* Content with gradient overlays */}\n              <div className=\"relative group\">\n                <div\n                  ref={scrollRef}\n                  className={cn(\n                    contentHeight === \"full\"\n                      ? \"h-full\"\n                      : contentHeight === \"fill\"\n                        ? \"h-[65vh]\"\n                        : \"max-h-[60vh]\",\n                    \"overflow-y-auto scrollbar-hide\",\n                    contentPadding && \"p-16\",\n                  )}\n                  onScroll={(e) => {\n                    const target = e.currentTarget;\n                    const isAtTop = target.scrollTop <= 5;\n                    const isAtBottom =\n                      target.scrollHeight -\n                        target.scrollTop -\n                        target.clientHeight <=\n                      5;\n                    const hasScroll = target.scrollHeight > target.clientHeight;\n\n                    // Update gradient visibility states\n                    setShowTopGradient(hasScroll && !isAtTop);\n                    setShowBottomGradient(hasScroll && !isAtBottom);\n                  }}\n                >\n                  {children}\n                </div>\n\n                {/* Animated fade gradients */}\n                <motion.div\n                  className=\"absolute top-0 left-0 right-0 h-24 bg-gradient-to-b from-white to-transparent pointer-events-none z-10\"\n                  initial={{ opacity: 0 }}\n                  animate={{ opacity: showTopGradient ? 1 : 0 }}\n                  transition={{ duration: 0.2, ease: \"easeInOut\" }}\n                />\n                <motion.div\n                  className=\"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white to-transparent pointer-events-none z-10\"\n                  initial={{ opacity: 0 }}\n                  animate={{ opacity: showBottomGradient ? 1 : 0 }}\n                  transition={{ duration: 0.2, ease: \"easeInOut\" }}\n                />\n              </div>\n            </div>\n          </motion.div>\n        </div>\n      )}\n    </AnimatePresence>\n  );\n}\n"
  },
  {
    "path": "components/shared/ui/stat-card.tsx",
    "content": "\"use client\";\n\nimport React from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport { TrendingUp, TrendingDown } from \"lucide-react\";\n\ninterface StatCardProps {\n  label: string;\n  value: string | number;\n  change?: number; // Percentage change\n  suffix?: string;\n  prefix?: string;\n  icon?: React.ReactNode;\n  trend?: \"up\" | \"down\" | \"neutral\";\n  className?: string;\n}\n\nexport function StatCard({\n  label,\n  value,\n  change,\n  suffix,\n  prefix,\n  icon,\n  trend,\n  className,\n}: StatCardProps) {\n  const trendColor =\n    trend === \"up\"\n      ? \"text-green-600\"\n      : trend === \"down\"\n        ? \"text-red-600\"\n        : \"text-black-alpha-64\";\n  const trendBg =\n    trend === \"up\"\n      ? \"bg-green-50\"\n      : trend === \"down\"\n        ? \"bg-red-50\"\n        : \"bg-black-alpha-4\";\n\n  return (\n    <div\n      className={cn(\n        \"p-5 lg:p-6 border border-border-faint rounded-12 bg-white\",\n        \"hover:border-black-alpha-16 transition-colors\",\n        className,\n      )}\n    >\n      <div className=\"flex items-start justify-between mb-3\">\n        <p className=\"text-label-small text-black-alpha-64\">{label}</p>\n        {icon && <div className=\"w-5 h-5 text-black-alpha-40\">{icon}</div>}\n      </div>\n\n      <div className=\"space-y-2\">\n        <div className=\"flex items-baseline gap-1\">\n          {prefix && (\n            <span className=\"text-body-large text-black-alpha-64\">\n              {prefix}\n            </span>\n          )}\n          <span className=\"text-h3 font-semibold text-accent-black\">\n            {value}\n          </span>\n          {suffix && (\n            <span className=\"text-body-large text-black-alpha-64\">\n              {suffix}\n            </span>\n          )}\n        </div>\n\n        {(change !== undefined || trend) && (\n          <div className=\"flex items-center gap-2\">\n            {trend && (\n              <div\n                className={cn(\n                  \"w-6 h-6 rounded-6 flex items-center justify-center\",\n                  trendBg,\n                )}\n              >\n                {trend === \"up\" ? (\n                  <TrendingUp className={cn(\"w-3.5 h-3.5\", trendColor)} />\n                ) : trend === \"down\" ? (\n                  <TrendingDown className={cn(\"w-3.5 h-3.5\", trendColor)} />\n                ) : null}\n              </div>\n            )}\n            {change !== undefined && (\n              <span className={cn(\"text-body-small \", trendColor)}>\n                {change > 0 && \"+\"}\n                {change}%\n              </span>\n            )}\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/shared/utils/portal-to-body.tsx",
    "content": "import dynamic from \"next/dynamic\";\nimport { createPortal } from \"react-dom\";\n\nfunction PortalToBody({ children }: { children: React.ReactNode }) {\n  return createPortal(children, document.body);\n}\n\nexport default dynamic(() => Promise.resolve(PortalToBody), { ssr: false });\n"
  },
  {
    "path": "components/ui/button.tsx",
    "content": "import * as React from \"react\"\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 whitespace-nowrap rounded-[10px] text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n  {\n    variants: {\n      variant: {\n        default: \"bg-zinc-900 text-white hover:bg-zinc-800 [box-shadow:inset_0px_-2px_0px_0px_#18181b,_0px_1px_6px_0px_rgba(24,_24,_27,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#18181b,_0px_1px_3px_0px_rgba(24,_24,_27,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#18181b,_0px_1px_2px_0px_rgba(24,_24,_27,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        secondary: \"bg-zinc-100 text-zinc-900 hover:bg-zinc-200 [box-shadow:inset_0px_-2px_0px_0px_#d4d4d8,_0px_1px_6px_0px_rgba(161,_161,_170,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#d4d4d8,_0px_1px_3px_0px_rgba(161,_161,_170,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#d4d4d8,_0px_1px_2px_0px_rgba(161,_161,_170,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        outline: \"border border-zinc-300 bg-transparent hover:bg-zinc-50 text-zinc-900 [box-shadow:inset_0px_-2px_0px_0px_#e4e4e7,_0px_1px_6px_0px_rgba(228,_228,_231,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#e4e4e7,_0px_1px_3px_0px_rgba(228,_228,_231,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#e4e4e7,_0px_1px_2px_0px_rgba(228,_228,_231,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        destructive: \"bg-red-500 text-white hover:bg-red-600 [box-shadow:inset_0px_-2px_0px_0px_#dc2626,_0px_1px_6px_0px_rgba(239,_68,_68,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#dc2626,_0px_1px_3px_0px_rgba(239,_68,_68,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#dc2626,_0px_1px_2px_0px_rgba(239,_68,_68,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        code: \"bg-[#36322F] text-white hover:bg-[#4a4542] [box-shadow:inset_0px_-2px_0px_0px_#171310,_0px_1px_6px_0px_rgba(58,_33,_8,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#171310,_0px_1px_3px_0px_rgba(58,_33,_8,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#171310,_0px_1px_2px_0px_rgba(58,_33,_8,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        orange: \"bg-orange-500 text-white hover:bg-orange-600 [box-shadow:inset_0px_-2px_0px_0px_#c2410c,_0px_1px_6px_0px_rgba(234,_88,_12,_58%)] hover:translate-y-[1px] hover:scale-[0.98] hover:[box-shadow:inset_0px_-1px_0px_0px_#c2410c,_0px_1px_3px_0px_rgba(234,_88,_12,_40%)] active:translate-y-[2px] active:scale-[0.97] active:[box-shadow:inset_0px_1px_1px_0px_#c2410c,_0px_1px_2px_0px_rgba(234,_88,_12,_30%)] disabled:shadow-none disabled:hover:translate-y-0 disabled:hover:scale-100\",\n        ghost: \"hover:bg-accent hover:text-accent-foreground\",\n      },\n      size: {\n        default: \"h-10 px-4 py-2\",\n        sm: \"h-8 px-3 py-1 text-sm\",\n        lg: \"h-12 px-6 py-3\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nexport interface ButtonProps\n  extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n    VariantProps<typeof buttonVariants> {\n  asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n  ({ className, variant, size, asChild = false, ...props }, ref) => {\n    const Comp = asChild ? \"button\" : \"button\"\n    return (\n      <Comp\n        className={cn(buttonVariants({ variant, size, className }))}\n        ref={ref}\n        {...props}\n      />\n    )\n  }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }"
  },
  {
    "path": "components/ui/checkbox.tsx",
    "content": "import * as React from \"react\"\nimport { Check } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface CheckboxProps {\n  label?: string\n  defaultChecked?: boolean\n  disabled?: boolean\n  className?: string\n  onChange?: (checked: boolean) => void\n}\n\nconst Checkbox = React.forwardRef<HTMLDivElement, CheckboxProps>(\n  ({ label, defaultChecked = false, disabled = false, className, onChange }, ref) => {\n    const [checked, setChecked] = React.useState(defaultChecked)\n\n    const handleToggle = () => {\n      if (!disabled) {\n        const newChecked = !checked\n        setChecked(newChecked)\n        onChange?.(newChecked)\n      }\n    }\n\n    return (\n      <div\n        ref={ref}\n        className={cn(\"flex items-center gap-2\", className)}\n      >\n        <button\n          type=\"button\"\n          onClick={handleToggle}\n          disabled={disabled}\n          className={cn(\n            \"h-4 w-4 rounded border border-zinc-300 flex items-center justify-center transition-all duration-200\",\n            \"[box-shadow:inset_0px_-1px_0px_0px_#e4e4e7,_0px_1px_3px_0px_rgba(228,_228,_231,_20%)]\",\n            !disabled && \"hover:[box-shadow:inset_0px_-1px_0px_0px_#d4d4d8,_0px_1px_3px_0px_rgba(212,_212,_216,_30%)]\",\n            checked && \"bg-orange-500 border-orange-500 [box-shadow:inset_0px_-1px_0px_0px_#c2410c,_0px_1px_3px_0px_rgba(234,_88,_12,_30%)]\",\n            disabled && \"opacity-50 cursor-not-allowed\"\n          )}\n        >\n          {checked && <Check className=\"h-3 w-3 text-white\" />}\n        </button>\n        {label && (\n          <label\n            onClick={handleToggle}\n            className={cn(\n              \"text-sm select-none\",\n              !disabled && \"cursor-pointer\",\n              disabled && \"opacity-50 cursor-not-allowed\"\n            )}\n          >\n            {label}\n          </label>\n        )}\n      </div>\n    )\n  }\n)\nCheckbox.displayName = \"Checkbox\"\n\nexport { Checkbox }"
  },
  {
    "path": "components/ui/code.tsx",
    "content": "import React from 'react';\n\ninterface CodeProps {\n  code: string;\n  language?: string;\n  className?: string;\n}\n\nexport default function Code({ code, language = 'json', className = '' }: CodeProps) {\n  return (\n    <pre className={`overflow-auto ${className}`}>\n      <code className={`language-${language}`}>\n        {code}\n      </code>\n    </pre>\n  );\n}"
  },
  {
    "path": "components/ui/input.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type InputProps = React.InputHTMLAttributes<HTMLInputElement>\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n  ({ className, type, ...props }, ref) => {\n    return (\n      <input\n        type={type}\n        className={cn(\n          \"flex h-10 w-full rounded-[10px] border border-zinc-300 bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [box-shadow:inset_0px_-2px_0px_0px_#e4e4e7,_0px_1px_6px_0px_rgba(228,_228,_231,_30%)] hover:[box-shadow:inset_0px_-2px_0px_0px_#d4d4d8,_0px_1px_6px_0px_rgba(212,_212,_216,_40%)] focus-visible:[box-shadow:inset_0px_-2px_0px_0px_#f97316,_0px_1px_6px_0px_rgba(249,_115,_22,_30%)] transition-all duration-200\",\n          className\n        )}\n        ref={ref}\n        {...props}\n      />\n    )\n  }\n)\nInput.displayName = \"Input\"\n\nexport { Input }"
  },
  {
    "path": "components/ui/label.tsx",
    "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst labelVariants = cva(\n  \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n  HTMLLabelElement,\n  React.ComponentPropsWithoutRef<\"label\"> &\n    VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n  <label\n    ref={ref}\n    className={cn(labelVariants(), className)}\n    {...props}\n  />\n))\nLabel.displayName = \"Label\"\n\nexport { Label }"
  },
  {
    "path": "components/ui/motion/scramble-text.tsx",
    "content": "import React, { useEffect, useState } from 'react';\n\ninterface ScrambleTextProps {\n  text: string;\n  className?: string;\n  duration?: number;\n  delay?: number;\n  isInView?: boolean;\n}\n\nexport default function ScrambleText({ text, className = '', duration = 1, delay = 0, isInView = true }: ScrambleTextProps) {\n  const [displayText, setDisplayText] = useState(text);\n  const [isScrambling, setIsScrambling] = useState(false);\n\n  useEffect(() => {\n    if (isScrambling) {\n      const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n      const durationMs = duration * 1000; // Convert seconds to milliseconds\n      const interval = setInterval(() => {\n        setDisplayText(\n          text\n            .split('')\n            .map((char) => (Math.random() > 0.5 ? chars[Math.floor(Math.random() * chars.length)] : char))\n            .join('')\n        );\n      }, 50);\n\n      setTimeout(() => {\n        clearInterval(interval);\n        setDisplayText(text);\n        setIsScrambling(false);\n      }, durationMs);\n\n      return () => clearInterval(interval);\n    }\n  }, [text, isScrambling, duration]);\n\n  useEffect(() => {\n    if (isInView) {\n      const timeout = setTimeout(() => {\n        setIsScrambling(true);\n      }, delay);\n      return () => clearTimeout(timeout);\n    }\n  }, [text, delay, isInView]);\n\n  return <span className={className}>{displayText}</span>;\n}"
  },
  {
    "path": "components/ui/select.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement>\n\nconst Select = React.forwardRef<HTMLSelectElement, SelectProps>(\n  ({ className, children, ...props }, ref) => {\n    return (\n      <select\n        className={cn(\n          \"flex h-10 w-full rounded-[10px] border border-zinc-300 bg-background px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [box-shadow:inset_0px_-2px_0px_0px_#e4e4e7,_0px_1px_6px_0px_rgba(228,_228,_231,_30%)] hover:[box-shadow:inset_0px_-2px_0px_0px_#d4d4d8,_0px_1px_6px_0px_rgba(212,_212,_216,_40%)] focus-visible:[box-shadow:inset_0px_-2px_0px_0px_#f97316,_0px_1px_6px_0px_rgba(249,_115,_22,_30%)] transition-all duration-200\",\n          className\n        )}\n        ref={ref}\n        {...props}\n      >\n        {children}\n      </select>\n    )\n  }\n)\nSelect.displayName = \"Select\"\n\nexport { Select }"
  },
  {
    "path": "components/ui/shadcn/accordion.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n  React.ElementRef<typeof AccordionPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n  <AccordionPrimitive.Item\n    ref={ref}\n    className={cn(\"border-b\", className)}\n    {...props}\n  />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n  React.ElementRef<typeof AccordionPrimitive.Trigger>,\n  React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n  <AccordionPrimitive.Header className=\"flex\">\n    <AccordionPrimitive.Trigger\n      ref={ref}\n      className={cn(\n        \"flex flex-1 items-center justify-between py-4  transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n        className,\n      )}\n      {...props}\n    >\n      {children}\n      <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-200\" />\n    </AccordionPrimitive.Trigger>\n  </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n  React.ElementRef<typeof AccordionPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n  <AccordionPrimitive.Content\n    ref={ref}\n    className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n    {...props}\n  >\n    <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n  </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"
  },
  {
    "path": "components/ui/shadcn/alert-dialog.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst AlertDialog = ({\n  children,\n  hideChatOnOpen = true,\n  ...props\n}: React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Root> & {\n  hideChatOnOpen?: boolean;\n}) => {\n  const handleOpenChange = (isOpen: boolean) => {\n    // Pass down `onOpenChange` if provided by the parent\n    props?.onOpenChange?.(isOpen);\n  };\n\n  return (\n    <AlertDialogPrimitive.Root {...props} onOpenChange={handleOpenChange}>\n      {children}\n    </AlertDialogPrimitive.Root>\n  );\n};\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n  <AlertDialogPrimitive.Overlay\n    className={cn(\n      \"fixed inset-0 z-[1000] bg-background-base/80 backdrop-blur-md data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n      className,\n    )}\n    {...props}\n    ref={ref}\n  />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n  <AlertDialogPortal>\n    <AlertDialogOverlay />\n    <div className=\"fixed z-[1001] inset-0 flex items-end sm:items-center justify-center p-16 sm:p-0\">\n      <AlertDialogPrimitive.Content\n        ref={ref}\n        className={cn(\n          \"relative w-full max-w-[520px] border border-border-faint bg-white p-0 duration-200 sm:rounded-16 shadow-2xl 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 data-[state=closed]:slide-out-to-bottom-10 data-[state=open]:slide-in-from-bottom-10 sm:data-[state=closed]:slide-out-to-left-1/2 sm:data-[state=closed]:slide-out-to-top-[-2%] sm:data-[state=open]:slide-in-from-left-1/2 sm:data-[state=open]:slide-in-from-top-[-2%]\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n      </AlertDialogPrimitive.Content>\n    </div>\n  </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col space-y-6 text-center sm:text-left\",\n      className,\n    )}\n    {...props}\n  />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-8\",\n      className,\n    )}\n    {...props}\n  />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Title>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n  <AlertDialogPrimitive.Title\n    ref={ref}\n    className={cn(\n      \"text-title-h5 font-semibold leading-none tracking-tight text-accent-black\",\n      className,\n    )}\n    {...props}\n  />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Description>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n  <AlertDialogPrimitive.Description\n    ref={ref}\n    className={cn(\"text-body-medium text-black-alpha-72\", className)}\n    {...props}\n  />\n));\nAlertDialogDescription.displayName =\n  AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Action>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n  <AlertDialogPrimitive.Action\n    ref={ref}\n    className={cn(\n      // Primary button styling aligned with design system\n      \"inline-flex items-center justify-center rounded-8 px-12 py-8 text-label-medium bg-heat-100 text-accent-white transition-colors hover:opacity-95 disabled:opacity-50 disabled:cursor-not-allowed\",\n      className,\n    )}\n    {...props}\n  />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n  React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n  React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n  <AlertDialogPrimitive.Cancel\n    ref={ref}\n    className={cn(\n      \"mt-2 sm:mt-0 inline-flex items-center justify-center rounded-8 px-12 py-8 text-label-medium text-accent-black hover:bg-black-alpha-4 transition-colors disabled:opacity-50 disabled:cursor-not-allowed\",\n      className,\n    )}\n    {...props}\n  />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n  AlertDialog,\n  AlertDialogPortal,\n  AlertDialogOverlay,\n  AlertDialogTrigger,\n  AlertDialogContent,\n  AlertDialogHeader,\n  AlertDialogFooter,\n  AlertDialogTitle,\n  AlertDialogDescription,\n  AlertDialogAction,\n  AlertDialogCancel,\n};\n"
  },
  {
    "path": "components/ui/shadcn/badge.tsx",
    "content": "/* eslint-disable react/jsx-no-comment-textnodes */\nimport { HTMLAttributes } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nfunction Badge({ ...attrs }: HTMLAttributes<HTMLDivElement>) {\n  return (\n    <div\n      {...attrs}\n      className={cn(\n        attrs.className,\n        \"flex gap-10 bg-background-base relative w-max pb-16 items-center text-label-x-small\",\n      )}\n    >\n      <div className=\"h-1 bottom-0 absolute w-full left-0 bg-border-faint\" />\n      <div className=\"text-black-alpha-16 pointer-events-none select-none\">\n        //\n      </div>\n      <div className=\"relative flex gap-10 items-center\">{attrs.children}</div>\n      <div className=\"text-black-alpha-16 pointer-events-none select-none -scale-x-100\">\n        //\n      </div>\n    </div>\n  );\n}\n\nexport default Badge;\nexport { Badge };\n"
  },
  {
    "path": "components/ui/shadcn/button.css",
    "content": ".button {\n  transition:\n    all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.1s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.1s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:active {\n  transition:\n    all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.05s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button-primary {\n  background: #ff4c00;\n  background: color(display-p3 0.9816 0.3634 0.0984);\n\n  box-shadow:\n    0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n\n  box-shadow:\n    0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:hover {\n  box-shadow:\n    0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 4px 8px 0px rgba(255, 77, 0, 0.16),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow:\n    0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 4px 8px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:active {\n  box-shadow:\n    0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow:\n    0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-background {\n  background: linear-gradient(to bottom, white, transparent);\n\n  opacity: 0.06;\n\n  transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:hover .button-background {\n  opacity: 0.08;\n}\n\n.button:active .button-background {\n  opacity: 0;\n\n  transition: opacity 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n"
  },
  {
    "path": "components/ui/shadcn/button.tsx",
    "content": "import { ButtonHTMLAttributes, forwardRef } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nimport \"./button.css\";\n\ninterface Props extends ButtonHTMLAttributes<HTMLButtonElement> {\n  variant?: \"primary\" | \"secondary\" | \"tertiary\" | \"playground\" | \"destructive\";\n  size?: \"default\" | \"large\";\n  disabled?: boolean;\n  loadingLabel?: string;\n  isLoading?: boolean;\n}\n\nconst Button = forwardRef<HTMLButtonElement, Props>(\n  (\n    {\n      variant = \"primary\",\n      size = \"default\",\n      disabled,\n      isLoading = false,\n      loadingLabel = \"Loading…\",\n      ...attrs\n    },\n    ref,\n  ) => {\n    const isNonInteractive = Boolean(disabled || isLoading);\n\n    // Focus ring adapts to light/dark variants\n    const focusRing =\n      variant === \"primary\" || variant === \"destructive\"\n        ? \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-white\"\n        : \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-black\";\n\n    return (\n      <button\n        {...attrs}\n        ref={ref}\n        type={attrs.type ?? \"button\"}\n        aria-disabled={isNonInteractive || undefined}\n        aria-busy={isLoading || undefined}\n        aria-live={isLoading ? \"polite\" : undefined}\n        data-state={\n          isLoading ? \"loading\" : isNonInteractive ? \"disabled\" : \"idle\"\n        }\n        className={cn(\n          attrs.className,\n          \"flex items-center justify-center button relative [&>*]:relative\",\n          \"text-label-medium lg-max:[&_svg]:size-24\",\n          `button-${variant} group/button`,\n          focusRing,\n\n          // Shared non-interactive styles\n          \"disabled:cursor-not-allowed\",\n          isNonInteractive && \"cursor-not-allowed\",\n\n          // Size\n          size === \"default\" && \"rounded-8 px-10 py-6 gap-4\",\n          size === \"large\" && \"rounded-10 px-12 py-8 gap-6\",\n\n          // Variant + interactive nuances\n          variant === \"primary\" && [\n            \"text-accent-white\",\n            // Hover/active only when interactive\n            !isNonInteractive &&\n              \"hover:bg-[color:var(--heat-90)] active:[scale:0.995]\",\n            // Disabled: dim a bit, no hover, dim overlay bg layer if present\n            \"disabled:opacity-80\",\n            \"disabled:[&_.button-background]:opacity-70\",\n          ],\n\n          [\"secondary\", \"tertiary\", \"playground\"].includes(variant) && [\n            \"text-accent-black\",\n            !isNonInteractive && \"active:[scale:0.99] active:bg-black-alpha-7\",\n          ],\n\n          variant === \"secondary\" && [\n            \"bg-black-alpha-4\",\n            !isNonInteractive && \"hover:bg-black-alpha-6\",\n            // Disabled: lighter fill + muted text, no hover\n            \"disabled:bg-black-alpha-3\",\n            \"disabled:text-black-alpha-48\",\n            \"disabled:hover:bg-black-alpha-3\",\n          ],\n\n          variant === \"tertiary\" && [\n            !isNonInteractive && \"hover:bg-black-alpha-4\",\n            // Disabled: no hover background, text muted\n            \"disabled:text-black-alpha-48\",\n            \"disabled:hover:bg-transparent\",\n          ],\n\n          variant === \"destructive\" && [\n            \"bg-red-600 text-accent-white\",\n            !isNonInteractive && \"hover:bg-red-700 active:scale-[0.98]\",\n            // Disabled: keep red but softer; soften text slightly\n            \"disabled:bg-red-600/70\",\n            \"disabled:text-white-alpha-72\",\n            \"disabled:hover:bg-red-600/70\",\n          ],\n\n          variant === \"playground\" && [\n            \"inside-border before:border-black-alpha-4\",\n            isNonInteractive\n              ? \"before:opacity-0 bg-black-alpha-4 text-black-alpha-24\"\n              : \"hover:bg-black-alpha-4 hover:before:opacity-0 active:before:opacity-0\",\n          ],\n        )}\n        disabled={isNonInteractive}\n      >\n        {variant === \"primary\" && (\n          <div className=\"overlay button-background !absolute\" />\n        )}\n\n        {/* loading state (spinner) */}\n        {isLoading && (\n          <div\n            className={cn(\n              \"w-16 h-16 border-2 rounded-full animate-spin\",\n              variant === \"primary\" || variant === \"destructive\"\n                ? \"border-white/30 border-t-white\"\n                : \"border-black/30 border-t-black\",\n            )}\n            aria-hidden\n          />\n        )}\n\n        {/* Screen reader-only loading label */}\n        {isLoading && <span className=\"sr-only\">{loadingLabel}</span>}\n\n        {attrs.children}\n      </button>\n    );\n  },\n);\n\nButton.displayName = \"Button\";\n\nexport default Button;\n"
  },
  {
    "path": "components/ui/shadcn/card.tsx",
    "content": "import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Card = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\n      \"rounded-12 border border-border-muted bg-background-base\",\n      className,\n    )}\n    {...props}\n  />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\"flex flex-col gap-4 p-16\", className)}\n    {...props}\n  />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n  <h3\n    ref={ref}\n    className={cn(\"text-heading-4 font-semibold text-foreground\", className)}\n    {...props}\n  />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n  <p\n    ref={ref}\n    className={cn(\"text-body-medium text-foreground-dimmer\", className)}\n    {...props}\n  />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div ref={ref} className={cn(\"p-16 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n  <div\n    ref={ref}\n    className={cn(\"flex items-center p-16 pt-0\", className)}\n    {...props}\n  />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport {\n  Card,\n  CardHeader,\n  CardFooter,\n  CardTitle,\n  CardDescription,\n  CardContent,\n};\n"
  },
  {
    "path": "components/ui/shadcn/checkbox.tsx",
    "content": "import { AnimatePresence, motion } from \"motion/react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport default function Checkbox({\n  checked,\n  onChange,\n}: {\n  checked: boolean;\n  onChange?: (checked: boolean) => void;\n}) {\n  return (\n    <button\n      className=\"size-20 p-3 relative\"\n      type=\"button\"\n      onClick={() => onChange?.(!checked)}\n    >\n      <div\n        className={cn(\n          \"w-full h-full rounded-3 group inside-border relative transition-all\",\n          checked\n            ? \"bg-heat-100 group-hover:bg-[#FA4500] before:border-transparent\"\n            : \"bg-black-alpha-3 group-hover:bg-black-alpha-6 before:border-black-alpha-10 group-hover:before:border-black-alpha-40\",\n        )}\n        style={{\n          boxShadow: checked\n            ? \"0px 2px 4px 0px rgba(255, 77, 0, 0.12), 0px 1px 1px 0px rgba(255, 77, 0, 0.12), 0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16), 0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.20)\"\n            : \"\",\n        }}\n      >\n        <AnimatePresence>\n          {checked && (\n            <motion.svg\n              animate={{ opacity: 1, scale: 1, y: 0 }}\n              className=\"absolute cs-10\"\n              exit={{ opacity: 0, scale: 0.9, y: 4 }}\n              fill=\"none\"\n              height=\"10\"\n              initial={{ opacity: 0, scale: 0.9, y: 4 }}\n              viewBox=\"0 0 10 10\"\n              width=\"10\"\n              xmlns=\"http://www.w3.org/2000/svg\"\n            >\n              <path\n                d=\"M2 5.98438L4.39062 8.375L8.375 2\"\n                stroke=\"white\"\n                strokeLinecap=\"round\"\n                strokeLinejoin=\"round\"\n                strokeWidth=\"1.25\"\n              />\n            </motion.svg>\n          )}\n        </AnimatePresence>\n      </div>\n    </button>\n  );\n}\n"
  },
  {
    "path": "components/ui/shadcn/collapsible.tsx",
    "content": "\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\n\nconst Collapsible = CollapsiblePrimitive.Root;\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"
  },
  {
    "path": "components/ui/shadcn/combobox.tsx",
    "content": "import { animate, AnimatePresence, cubicBezier, motion } from \"motion/react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\nimport { lockBody } from \"@/components/shared/lockBody\";\nimport PortalToBody from \"@/components/shared/utils/portal-to-body\";\n\nexport default function Combobox({\n  placeholder,\n  options,\n  value,\n  onChange,\n  className,\n}: {\n  placeholder?: string;\n  options: { label: string; value: string }[];\n  value: string;\n  onChange: (value: string) => void;\n  className?: string;\n}) {\n  const selected = useMemo(() => {\n    return options.find((option) => option.value === value);\n  }, [options, value]);\n  const [isOpen, setIsOpen] = useState(false);\n  const [bounds, setBounds] = useState<DOMRect | null>(null);\n  const ref = useRef<HTMLDivElement>(null);\n\n  useEffect(() => {\n    lockBody(\"combobox\", isOpen);\n  }, [isOpen]);\n\n  useEffect(() => {\n    document.addEventListener(\"click\", (e) => {\n      if (ref.current && e.composedPath().includes(ref.current)) {\n        return;\n      }\n\n      setIsOpen(false);\n    });\n  }, []);\n\n  return (\n    <div className={cn(\"w-full\", className)} ref={ref}>\n      <button\n        className={cn(\n          \"relative bg-accent-white flex w-full gap-4 rounded-8 p-6 pl-10\",\n          \"inside-border before:border-black-alpha-8 hover:before:border-black-alpha-12 hover:bg-black-alpha-2\",\n          \"text-body-medium\",\n          isOpen &&\n            \"!bg-accent-white before:!border-heat-100 before:!border-[1.25px]\",\n        )}\n        type=\"button\"\n        onClick={(e) => {\n          e.preventDefault();\n          setIsOpen(!isOpen);\n          setBounds(ref.current?.getBoundingClientRect() ?? null);\n        }}\n      >\n        <div className={cn(\"flex-1\", !selected && \"text-black-alpha-40\")}>\n          {selected?.label || placeholder}\n        </div>\n\n        <motion.svg\n          animate={{ rotate: isOpen ? 180 : 0 }}\n          fill=\"none\"\n          height=\"20\"\n          viewBox=\"0 0 20 20\"\n          width=\"20\"\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <path\n            d=\"M7 8.5L10 11.5L13 8.5\"\n            stroke=\"#262626\"\n            strokeLinecap=\"round\"\n            strokeLinejoin=\"round\"\n            strokeOpacity=\"0.56\"\n            strokeWidth=\"1.25\"\n          />\n        </motion.svg>\n      </button>\n\n      <PortalToBody>\n        <AnimatePresence initial={false}>\n          {isOpen && bounds && (\n            <motion.div\n              animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n              className=\"fixed bg-accent-white rounded-12 z-[401]\"\n              exit={{ opacity: 0, y: 0, filter: \"blur(4px)\" }}\n              initial={{ opacity: 0, y: -12, filter: \"blur(4px)\" }}\n              style={{\n                top: bounds.top + bounds.height + 8,\n                left: bounds.left,\n                width: bounds.width,\n                boxShadow:\n                  \"0px 32px 40px 6px rgba(0, 0, 0, 0.02), 0px 12px 32px 0px rgba(0, 0, 0, 0.02), 0px 24px 32px -8px rgba(0, 0, 0, 0.02), 0px 8px 16px -2px rgba(0, 0, 0, 0.02), 0px 0px 0px 1px rgba(0, 0, 0, 0.04)\",\n              }}\n              transition={{ duration: 0.2 }}\n            >\n              <div className=\"p-4\">\n                <Items\n                  options={options}\n                  onChange={(value) => {\n                    onChange(value);\n                    setIsOpen(false);\n                  }}\n                />\n              </div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </PortalToBody>\n    </div>\n  );\n}\n\nconst Items = ({\n  options,\n  onChange,\n}: {\n  options: { label: string; value: string }[];\n  onChange: (value: string) => void;\n}) => {\n  const backgroundRef = useRef<HTMLDivElement>(null);\n\n  return (\n    <div className=\"relative\">\n      <div\n        className=\"absolute top-0 opacity-0 left-0 bg-black-alpha-4 rounded-8 w-full h-32 pointer-events-none\"\n        ref={backgroundRef}\n      />\n\n      {options.map((option) => (\n        <button\n          className=\"w-full group py-6 px-10 text-label-small\"\n          key={option.value}\n          type=\"button\"\n          onClick={() => {\n            onChange(option.value);\n          }}\n          onMouseEnter={(e) => {\n            const t = e.target as HTMLElement;\n\n            let target =\n              t instanceof HTMLButtonElement\n                ? t\n                : (t.closest(\"button\") as HTMLButtonElement);\n            target = target.closest(\".group\") as HTMLButtonElement;\n\n            animate(backgroundRef.current!, { scale: 0.995 }).then(() =>\n              animate(backgroundRef.current!, { scale: 1 }),\n            );\n\n            animate(\n              backgroundRef.current!,\n              {\n                y: target.offsetTop,\n                opacity: 1,\n              },\n              {\n                ease: cubicBezier(0.165, 0.84, 0.44, 1),\n                duration: 0.2,\n              },\n            );\n          }}\n          onMouseLeave={() => {\n            animate(backgroundRef.current!, { opacity: 0 });\n          }}\n        >\n          {option.label}\n        </button>\n      ))}\n    </div>\n  );\n};\n"
  },
  {
    "path": "components/ui/shadcn/context-menu.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n    inset?: boolean;\n  }\n>(({ className, inset, children, ...props }, ref) => (\n  <ContextMenuPrimitive.SubTrigger\n    ref={ref}\n    className={cn(\n      \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n    <ChevronRight className=\"ml-auto h-4 w-4\" />\n  </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n  <ContextMenuPrimitive.SubContent\n    ref={ref}\n    className={cn(\n      \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n      className,\n    )}\n    {...props}\n  />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n  <ContextMenuPrimitive.Portal>\n    <ContextMenuPrimitive.Content\n      ref={ref}\n      className={cn(\n        \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n        className,\n      )}\n      {...props}\n    />\n  </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n    inset?: boolean;\n  }\n>(({ className, inset, ...props }, ref) => (\n  <ContextMenuPrimitive.Item\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n  <ContextMenuPrimitive.CheckboxItem\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n      className,\n    )}\n    checked={checked}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <ContextMenuPrimitive.ItemIndicator>\n        <Check className=\"h-4 w-4\" />\n      </ContextMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n  ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n  <ContextMenuPrimitive.RadioItem\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n      className,\n    )}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <ContextMenuPrimitive.ItemIndicator>\n        <Circle className=\"h-2 w-2 fill-current\" />\n      </ContextMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.Label>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n    inset?: boolean;\n  }\n>(({ className, inset, ...props }, ref) => (\n  <ContextMenuPrimitive.Label\n    ref={ref}\n    className={cn(\n      \"px-2 py-1.5 text-sm font-semibold text-foreground\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n  React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n  React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n  <ContextMenuPrimitive.Separator\n    ref={ref}\n    className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n    {...props}\n  />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n  return (\n    <span\n      className={cn(\n        \"ml-auto text-xs tracking-widest text-muted-foreground\",\n        className,\n      )}\n      {...props}\n    />\n  );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n  ContextMenu,\n  ContextMenuTrigger,\n  ContextMenuContent,\n  ContextMenuItem,\n  ContextMenuCheckboxItem,\n  ContextMenuRadioItem,\n  ContextMenuLabel,\n  ContextMenuSeparator,\n  ContextMenuShortcut,\n  ContextMenuGroup,\n  ContextMenuPortal,\n  ContextMenuSub,\n  ContextMenuSubContent,\n  ContextMenuSubTrigger,\n  ContextMenuRadioGroup,\n};\n"
  },
  {
    "path": "components/ui/shadcn/data-table.tsx",
    "content": "import * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Table = React.forwardRef<\n  HTMLTableElement,\n  React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n  <div className=\"relative w-full overflow-auto\">\n    <table\n      ref={ref}\n      className={cn(\"w-full caption-bottom text-sm\", className)}\n      {...props}\n    />\n  </div>\n));\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n));\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <tbody\n    ref={ref}\n    className={cn(\"[&_tr:last-child]:border-0\", className)}\n    {...props}\n  />\n));\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<\n  HTMLTableSectionElement,\n  React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n  <tfoot\n    ref={ref}\n    className={cn(\n      \"border-t bg-zinc-100/50  [&>tr]:last:border-b-0 dark:bg-zinc-800/50\",\n      className,\n    )}\n    {...props}\n  />\n));\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<\n  HTMLTableRowElement,\n  React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n  <tr\n    ref={ref}\n    className={cn(\n      \"border-b transition-colors hover:bg-zinc-100/50 data-[state=selected]:bg-zinc-100 dark:hover:bg-zinc-800/50 dark:data-[state=selected]:bg-zinc-800\",\n      className,\n    )}\n    {...props}\n  />\n));\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<\n  HTMLTableCellElement,\n  React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n  <th\n    ref={ref}\n    className={cn(\n      \"h-12 px-4 text-left align-middle  text-zinc-500 [&:has([role=checkbox])]:pr-0 dark:text-zinc-400\",\n      className,\n    )}\n    {...props}\n  />\n));\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<\n  HTMLTableCellElement,\n  React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n  <td\n    ref={ref}\n    className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n    {...props}\n  />\n));\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<\n  HTMLTableCaptionElement,\n  React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n  <caption\n    ref={ref}\n    className={cn(\"mt-4 text-sm text-zinc-500 dark:text-zinc-400\", className)}\n    {...props}\n  />\n));\nTableCaption.displayName = \"TableCaption\";\n\nexport {\n  Table,\n  TableHeader,\n  TableBody,\n  TableFooter,\n  TableHead,\n  TableRow,\n  TableCell,\n  TableCaption,\n};\n"
  },
  {
    "path": "components/ui/shadcn/dialog.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Overlay>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Overlay\n    ref={ref}\n    className={cn(\n      \"fixed inset-0 z-[1000] bg-background-base/80 backdrop-blur-md data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n      className,\n    )}\n    {...props}\n  />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n    hideCloseButton?: boolean;\n  }\n>(({ className, children, hideCloseButton = false, ...props }, ref) => (\n  <DialogPortal>\n    <DialogOverlay />\n    <div className=\"fixed z-[1001] inset-0 flex items-end sm:items-center justify-center p-16 sm:p-0\">\n      <DialogPrimitive.Content\n        ref={ref}\n        className={cn(\n          \"relative w-full max-w-[520px] border border-border-faint bg-white p-0 duration-200 sm:rounded-16 shadow-2xl 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 data-[state=closed]:slide-out-to-bottom-10 data-[state=open]:slide-in-from-bottom-10 sm:data-[state=closed]:slide-out-to-left-1/2 sm:data-[state=closed]:slide-out-to-top-[-2%] sm:data-[state=open]:slide-in-from-left-1/2 sm:data-[state=open]:slide-in-from-top-[-2%]\",\n          className,\n        )}\n        {...props}\n      >\n        {children}\n        {!hideCloseButton && (\n          <DialogPrimitive.Close className=\"absolute top-20 right-20 w-32 h-32 rounded-8 flex items-center justify-center hover:bg-black-alpha-4 transition-colors\">\n            <X className=\"h-16 w-16 text-black-alpha-56\" />\n            <span className=\"sr-only\">Close</span>\n          </DialogPrimitive.Close>\n        )}\n      </DialogPrimitive.Content>\n    </div>\n  </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col space-y-6 text-center sm:text-left\",\n      className,\n    )}\n    {...props}\n  />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-8\",\n      className,\n    )}\n    {...props}\n  />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Title>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Title\n    ref={ref}\n    className={cn(\n      \"text-title-h5 font-semibold leading-none tracking-tight text-accent-black\",\n      className,\n    )}\n    {...props}\n  />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n  React.ElementRef<typeof DialogPrimitive.Description>,\n  React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n  <DialogPrimitive.Description\n    ref={ref}\n    className={cn(\"text-body-medium text-black-alpha-72\", className)}\n    {...props}\n  />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n  Dialog,\n  DialogPortal,\n  DialogOverlay,\n  DialogClose,\n  DialogTrigger,\n  DialogContent,\n  DialogHeader,\n  DialogFooter,\n  DialogTitle,\n  DialogDescription,\n};\n"
  },
  {
    "path": "components/ui/shadcn/dropdown-menu.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n    inset?: boolean;\n  }\n>(({ className, inset, children, ...props }, ref) => (\n  <DropdownMenuPrimitive.SubTrigger\n    ref={ref}\n    className={cn(\n      \"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-zinc-100 data-[state=open]:bg-zinc-100 dark:focus:bg-zinc-800 dark:data-[state=open]:bg-zinc-800\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n    <ChevronRight className=\"ml-auto h-4 w-4\" />\n  </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n  DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n  <DropdownMenuPrimitive.SubContent\n    ref={ref}\n    className={cn(\n      \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-zinc-200 bg-white p-1 text-zinc-950 shadow-lg 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\",\n      className,\n    )}\n    {...props}\n  />\n));\nDropdownMenuSubContent.displayName =\n  DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n  <DropdownMenuPrimitive.Portal>\n    <DropdownMenuPrimitive.Content\n      ref={ref}\n      sideOffset={sideOffset}\n      className={cn(\n        \"z-50 min-w-[8rem] overflow-hidden rounded-12 border border-border-faint bg-white p-1 text-foreground shadow-md 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n        className,\n      )}\n      {...props}\n    />\n  </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n    inset?: boolean;\n  }\n>(({ className, inset, ...props }, ref) => (\n  <DropdownMenuPrimitive.Item\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-8 px-2 py-1.5 text-sm outline-none transition-all hover:bg-black-alpha-3 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n  <DropdownMenuPrimitive.CheckboxItem\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-zinc-100 focus:text-zinc-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-zinc-800 dark:focus:text-zinc-50\",\n      className,\n    )}\n    checked={checked}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <DropdownMenuPrimitive.ItemIndicator>\n        <Check className=\"h-4 w-4\" />\n      </DropdownMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n  DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n  <DropdownMenuPrimitive.RadioItem\n    ref={ref}\n    className={cn(\n      \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-zinc-100 focus:text-zinc-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-zinc-800 dark:focus:text-zinc-50\",\n      className,\n    )}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <DropdownMenuPrimitive.ItemIndicator>\n        <Circle className=\"h-2 w-2 fill-current\" />\n      </DropdownMenuPrimitive.ItemIndicator>\n    </span>\n    {children}\n  </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n    inset?: boolean;\n  }\n>(({ className, inset, ...props }, ref) => (\n  <DropdownMenuPrimitive.Label\n    ref={ref}\n    className={cn(\n      \"px-2 py-1.5 text-sm font-semibold\",\n      inset && \"pl-8\",\n      className,\n    )}\n    {...props}\n  />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n  React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n  React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n  <DropdownMenuPrimitive.Separator\n    ref={ref}\n    className={cn(\"-mx-1 my-1 h-px bg-zinc-100 dark:bg-zinc-800\", className)}\n    {...props}\n  />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n  return (\n    <span\n      className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n      {...props}\n    />\n  );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n  DropdownMenu,\n  DropdownMenuTrigger,\n  DropdownMenuContent,\n  DropdownMenuItem,\n  DropdownMenuCheckboxItem,\n  DropdownMenuRadioItem,\n  DropdownMenuLabel,\n  DropdownMenuSeparator,\n  DropdownMenuShortcut,\n  DropdownMenuGroup,\n  DropdownMenuPortal,\n  DropdownMenuSub,\n  DropdownMenuSubContent,\n  DropdownMenuSubTrigger,\n  DropdownMenuRadioGroup,\n};\n"
  },
  {
    "path": "components/ui/shadcn/form.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n  Controller,\n  ControllerProps,\n  FieldPath,\n  FieldValues,\n  FormProvider,\n  useFormContext,\n} from \"react-hook-form\";\n\nimport { cn } from \"@/utils/cn\";\nimport { Label } from \"./label\";\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n  TFieldValues extends FieldValues = FieldValues,\n  TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n  name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n  {} as FormFieldContextValue,\n);\n\nconst FormField = <\n  TFieldValues extends FieldValues = FieldValues,\n  TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n  ...props\n}: ControllerProps<TFieldValues, TName>) => {\n  return (\n    <FormFieldContext.Provider value={{ name: props.name }}>\n      <Controller {...props} />\n    </FormFieldContext.Provider>\n  );\n};\n\nconst useFormField = () => {\n  const fieldContext = React.useContext(FormFieldContext);\n  const itemContext = React.useContext(FormItemContext);\n  const { getFieldState, formState } = useFormContext();\n\n  const fieldState = getFieldState(fieldContext.name, formState);\n\n  if (!fieldContext) {\n    throw new Error(\"useFormField should be used within <FormField>\");\n  }\n\n  const { id } = itemContext;\n\n  return {\n    id,\n    name: fieldContext.name,\n    formItemId: `${id}-form-item`,\n    formDescriptionId: `${id}-form-item-description`,\n    formMessageId: `${id}-form-item-message`,\n    ...fieldState,\n  };\n};\n\ntype FormItemContextValue = {\n  id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n  {} as FormItemContextValue,\n);\n\nconst FormItem = React.forwardRef<\n  HTMLDivElement,\n  React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n  const id = React.useId();\n\n  return (\n    <FormItemContext.Provider value={{ id }}>\n      <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n    </FormItemContext.Provider>\n  );\n});\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n  React.ElementRef<typeof LabelPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>\n>(({ className, ...props }, ref) => {\n  const { error, formItemId } = useFormField();\n\n  return (\n    <Label\n      ref={ref}\n      className={cn(error && \"text-red-500 dark:text-red-900\", className)}\n      htmlFor={formItemId}\n      {...props}\n    />\n  );\n});\nFormLabel.displayName = \"FormLabel\";\n\nconst FormControl = React.forwardRef<\n  React.ElementRef<typeof Slot>,\n  React.ComponentPropsWithoutRef<typeof Slot>\n>(({ ...props }, ref) => {\n  const { error, formItemId, formDescriptionId, formMessageId } =\n    useFormField();\n\n  return (\n    <Slot\n      ref={ref}\n      id={formItemId}\n      aria-describedby={\n        !error\n          ? `${formDescriptionId}`\n          : `${formDescriptionId} ${formMessageId}`\n      }\n      aria-invalid={!!error}\n      {...props}\n    />\n  );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n  const { formDescriptionId } = useFormField();\n\n  return (\n    <p\n      ref={ref}\n      id={formDescriptionId}\n      className={cn(\"text-sm text-zinc-500 dark:text-zinc-400\", className)}\n      {...props}\n    />\n  );\n});\nFormDescription.displayName = \"FormDescription\";\n\nconst FormMessage = React.forwardRef<\n  HTMLParagraphElement,\n  React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, children, ...props }, ref) => {\n  const { error, formMessageId } = useFormField();\n  const body = error ? String(error?.message) : children;\n\n  if (!body) {\n    return null;\n  }\n\n  return (\n    <p\n      ref={ref}\n      id={formMessageId}\n      className={cn(\"text-sm  text-red-500 dark:text-red-900\", className)}\n      {...props}\n    >\n      {body}\n    </p>\n  );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n  useFormField,\n  Form,\n  FormItem,\n  FormLabel,\n  FormControl,\n  FormDescription,\n  FormMessage,\n  FormField,\n};\n"
  },
  {
    "path": "components/ui/shadcn/input.tsx",
    "content": "import { forwardRef } from \"react\";\nimport { cn } from \"@/utils/cn\";\n\nconst Input = forwardRef<\n  HTMLInputElement,\n  React.ComponentPropsWithoutRef<\"input\">\n>(({ className, ...props }, ref) => {\n  return (\n    <label\n      className={cn(\n        \"py-8 px-12 rounded-8 transition-all w-full block gap-4 cursor-text\",\n        \"relative bg-accent-white\",\n        \"inside-border before:border-black-alpha-8 hover:before:border-black-alpha-12 hover:bg-black-alpha-2 focus-within:!bg-accent-white focus-within:before:!border-heat-100 focus-within:before:!border-[1.25px]\",\n        \"text-body-medium\",\n        className,\n      )}\n    >\n      <input\n        ref={ref}\n        className=\"outline-none w-full resize-none bg-transparent\"\n        {...props}\n      />\n    </label>\n  );\n});\n\nInput.displayName = \"Input\";\n\nexport default Input;\n"
  },
  {
    "path": "components/ui/shadcn/label.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst labelVariants = cva(\n  \"text-sm  leading-tight peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nconst Label = React.forwardRef<\n  React.ElementRef<typeof LabelPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n    VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n  <LabelPrimitive.Root\n    ref={ref}\n    className={cn(labelVariants(), className)}\n    {...props}\n  />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n"
  },
  {
    "path": "components/ui/shadcn/navigation-menu.tsx",
    "content": "import * as React from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst NavigationMenu = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {\n    viewportProps?: React.ComponentPropsWithoutRef<\n      typeof NavigationMenuPrimitive.Viewport\n    >;\n  }\n>(({ className, children, viewportProps, ...props }, ref) => (\n  <NavigationMenuPrimitive.Root\n    ref={ref}\n    className={cn(\n      \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n    <NavigationMenuViewport {...viewportProps} />\n  </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.List>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n  <NavigationMenuPrimitive.List\n    ref={ref}\n    className={cn(\n      \"group flex flex-1 list-none items-center justify-center space-x-1\",\n      className,\n    )}\n    {...props}\n  />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\"\");\n\nconst NavigationMenuTrigger = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n  <NavigationMenuPrimitive.Trigger\n    ref={ref}\n    className={cn(\n      navigationMenuTriggerStyle(),\n      \"group items-center\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n    {\"\"}\n    <ChevronDown\n      className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n      aria-hidden=\"true\"\n    />\n  </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n  <NavigationMenuPrimitive.Content\n    ref={ref}\n    className={cn(\n      \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n      className,\n    )}\n    {...props}\n  />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n  <div className={cn(\"absolute right-0 top-full flex justify-center\")}>\n    <NavigationMenuPrimitive.Viewport\n      className={cn(\n        \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border border-zinc-200 bg-white text-zinc-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)] dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\",\n        className,\n      )}\n      ref={ref}\n      {...props}\n    />\n  </div>\n));\nNavigationMenuViewport.displayName =\n  NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n  React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n  React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n  <NavigationMenuPrimitive.Indicator\n    ref={ref}\n    className={cn(\n      \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n      className,\n    )}\n    {...props}\n  >\n    <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-zinc-200 shadow-md dark:bg-zinc-800\" />\n  </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n  NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n  navigationMenuTriggerStyle,\n  NavigationMenu,\n  NavigationMenuList,\n  NavigationMenuItem,\n  NavigationMenuContent,\n  NavigationMenuTrigger,\n  NavigationMenuLink,\n  NavigationMenuIndicator,\n  NavigationMenuViewport,\n};\n"
  },
  {
    "path": "components/ui/shadcn/popover.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n  React.ElementRef<typeof PopoverPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n  <PopoverPrimitive.Portal>\n    <PopoverPrimitive.Content\n      ref={ref}\n      align={align}\n      sideOffset={sideOffset}\n      className={cn(\n        \"z-50 w-72 rounded-md border border-zinc-200 bg-white p-4 text-zinc-950 shadow-md outline-none 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\",\n        className,\n      )}\n      {...props}\n    />\n  </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n"
  },
  {
    "path": "components/ui/shadcn/progress.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Progress = React.forwardRef<\n  React.ElementRef<typeof ProgressPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n  <ProgressPrimitive.Root\n    ref={ref}\n    className={cn(\n      \"relative h-4 w-full overflow-hidden rounded-full bg-zinc-100 dark:bg-zinc-800\",\n      className,\n    )}\n    {...props}\n  >\n    <ProgressPrimitive.Indicator\n      className=\"h-full w-full flex-1 bg-zinc-900 transition-all dark:bg-zinc-50\"\n      style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n    />\n  </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n"
  },
  {
    "path": "components/ui/shadcn/scroll-area.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst ScrollArea = React.forwardRef<\n  React.ElementRef<typeof ScrollAreaPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n  <ScrollAreaPrimitive.Root\n    ref={ref}\n    className={cn(\"relative overflow-hidden\", className)}\n    {...props}\n  >\n    <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n      {children}\n    </ScrollAreaPrimitive.Viewport>\n    <ScrollBar />\n    <ScrollAreaPrimitive.Corner />\n  </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n  React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n  React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n  <ScrollAreaPrimitive.ScrollAreaScrollbar\n    ref={ref}\n    orientation={orientation}\n    className={cn(\n      \"flex touch-none select-none transition-colors\",\n      orientation === \"vertical\" &&\n        \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n      orientation === \"horizontal\" &&\n        \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n      className,\n    )}\n    {...props}\n  >\n    <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-zinc-200 dark:bg-zinc-800\" />\n  </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n"
  },
  {
    "path": "components/ui/shadcn/select.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\";\nimport { cn } from \"@/utils/cn\";\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.Trigger>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n  <SelectPrimitive.Trigger\n    ref={ref}\n    className={cn(\n      \"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 dark:text-white\",\n      className,\n    )}\n    {...props}\n  >\n    {children}\n    <SelectPrimitive.Icon asChild>\n      <ChevronDown className=\"h-4 w-4 opacity-50\" />\n    </SelectPrimitive.Icon>\n  </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.ScrollUpButton\n    ref={ref}\n    className={cn(\n      \"flex cursor-default items-center justify-center py-1\",\n      className,\n    )}\n    {...props}\n  >\n    <ChevronUp className=\"h-4 w-4\" />\n  </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.ScrollDownButton\n    ref={ref}\n    className={cn(\n      \"flex cursor-default items-center justify-center py-1\",\n      className,\n    )}\n    {...props}\n  >\n    <ChevronDown className=\"h-4 w-4\" />\n  </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n  SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n  <SelectPrimitive.Portal>\n    <SelectPrimitive.Content\n      ref={ref}\n      className={cn(\n        \"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n        position === \"popper\" &&\n          \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n        className,\n      )}\n      position={position}\n      {...props}\n    >\n      <SelectScrollUpButton />\n      <SelectPrimitive.Viewport\n        className={cn(\n          \"p-1\",\n          position === \"popper\" &&\n            \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\",\n        )}\n      >\n        {children}\n      </SelectPrimitive.Viewport>\n      <SelectScrollDownButton />\n    </SelectPrimitive.Content>\n  </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.Label>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.Label\n    ref={ref}\n    className={cn(\"py-1.5 pl-8 pr-2 text-sm font-semibold\", className)}\n    {...props}\n  />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.Item>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n  <SelectPrimitive.Item\n    ref={ref}\n    className={cn(\n      \"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n      className,\n    )}\n    {...props}\n  >\n    <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n      <SelectPrimitive.ItemIndicator>\n        <Check className=\"h-4 w-4\" />\n      </SelectPrimitive.ItemIndicator>\n    </span>\n\n    <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n  </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n  React.ElementRef<typeof SelectPrimitive.Separator>,\n  React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n  <SelectPrimitive.Separator\n    ref={ref}\n    className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n    {...props}\n  />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n  Select,\n  SelectGroup,\n  SelectValue,\n  SelectTrigger,\n  SelectContent,\n  SelectLabel,\n  SelectItem,\n  SelectSeparator,\n  SelectScrollUpButton,\n  SelectScrollDownButton,\n};\n"
  },
  {
    "path": "components/ui/shadcn/separator.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Separator = React.forwardRef<\n  React.ElementRef<typeof SeparatorPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n  (\n    { className, orientation = \"horizontal\", decorative = true, ...props },\n    ref,\n  ) => (\n    <SeparatorPrimitive.Root\n      ref={ref}\n      decorative={decorative}\n      orientation={orientation}\n      className={cn(\n        \"shrink-0 bg-zinc-200 dark:bg-zinc-800\",\n        orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n        className,\n      )}\n      {...props}\n    />\n  ),\n);\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n"
  },
  {
    "path": "components/ui/shadcn/sheet.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Sheet = SheetPrimitive.Root;\n\nconst SheetTrigger = SheetPrimitive.Trigger;\n\nconst SheetClose = SheetPrimitive.Close;\n\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n  React.ElementRef<typeof SheetPrimitive.Overlay>,\n  React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n  <SheetPrimitive.Overlay\n    className={cn(\n      \"fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n      className,\n    )}\n    {...props}\n    ref={ref}\n  />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n  \"fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 dark:bg-zinc-950\",\n  {\n    variants: {\n      side: {\n        top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n        bottom:\n          \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n        left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n        right:\n          \"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n      },\n    },\n    defaultVariants: {\n      side: \"right\",\n    },\n  },\n);\n\ninterface SheetContentProps\n  extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n    VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n  React.ElementRef<typeof SheetPrimitive.Content>,\n  SheetContentProps\n>(({ side = \"right\", className, children, ...props }, ref) => (\n  <SheetPortal>\n    <SheetOverlay />\n    <SheetPrimitive.Content\n      ref={ref}\n      className={cn(sheetVariants({ side }), className)}\n      {...props}\n    >\n      {children}\n      <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-zinc-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-zinc-100 dark:ring-offset-zinc-950 dark:focus:ring-zinc-300 dark:data-[state=open]:bg-zinc-800\">\n        <X className=\"h-4 w-4\" />\n        <span className=\"sr-only\">Close</span>\n      </SheetPrimitive.Close>\n    </SheetPrimitive.Content>\n  </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col space-y-2 text-center sm:text-left\",\n      className,\n    )}\n    {...props}\n  />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n  <div\n    className={cn(\n      \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n      className,\n    )}\n    {...props}\n  />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n  React.ElementRef<typeof SheetPrimitive.Title>,\n  React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n  <SheetPrimitive.Title\n    ref={ref}\n    className={cn(\n      \"text-lg font-semibold text-zinc-950 dark:text-zinc-50\",\n      className,\n    )}\n    {...props}\n  />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n  React.ElementRef<typeof SheetPrimitive.Description>,\n  React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n  <SheetPrimitive.Description\n    ref={ref}\n    className={cn(\"text-sm text-zinc-500 dark:text-zinc-400\", className)}\n    {...props}\n  />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n  Sheet,\n  SheetPortal,\n  SheetOverlay,\n  SheetTrigger,\n  SheetClose,\n  SheetContent,\n  SheetHeader,\n  SheetFooter,\n  SheetTitle,\n  SheetDescription,\n};\n"
  },
  {
    "path": "components/ui/shadcn/slider.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport { cn } from \"@/utils/cn\";\n\nconst Slider = React.forwardRef<\n  React.ElementRef<typeof SliderPrimitive.Root>,\n  React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n  <SliderPrimitive.Root\n    ref={ref}\n    className={cn(\n      \"relative flex w-full touch-none select-none items-center\",\n      className,\n    )}\n    {...props}\n  >\n    <SliderPrimitive.Track className=\"relative h-8 w-full grow overflow-hidden rounded-full bg-black-alpha-8\">\n      <SliderPrimitive.Range className=\"absolute h-full bg-heat-100\" />\n    </SliderPrimitive.Track>\n    <SliderPrimitive.Thumb className=\"block h-20 w-20 rounded-full border-2 border-heat-100 bg-accent-white ring-offset-accent-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-heat-100 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\" />\n  </SliderPrimitive.Root>\n));\n\nSlider.displayName = \"Slider\";\n\nexport { Slider };\n"
  },
  {
    "path": "components/ui/shadcn/switch.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst switchVariants = cva(\n  \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-muted-foreground data-[state=unchecked]:bg-input\",\n  {\n    variants: {\n      size: {\n        default: \"h-5 w-9\",\n        sm: \"h-4 w-7\",\n      },\n    },\n    defaultVariants: {\n      size: \"default\",\n    },\n  },\n);\n\nconst thumbVariants = cva(\n  \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform\",\n  {\n    variants: {\n      size: {\n        default:\n          \"h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0\",\n        sm: \"h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0\",\n      },\n    },\n    defaultVariants: {\n      size: \"default\",\n    },\n  },\n);\n\ninterface SwitchProps\n  extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n    VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<\n  React.ElementRef<typeof SwitchPrimitives.Root>,\n  SwitchProps\n>(({ className, size, ...props }, ref) => (\n  <SwitchPrimitives.Root\n    className={cn(switchVariants({ size, className }))}\n    {...props}\n    ref={ref}\n  >\n    <SwitchPrimitives.Thumb className={cn(thumbVariants({ size }))} />\n  </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n"
  },
  {
    "path": "components/ui/shadcn/tabs.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst Tabs = TabsPrimitive.Root;\n\nconst TabsList = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.List>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.List\n    ref={ref}\n    className={cn(\n      \"inline-flex h-10 items-center justify-center rounded-md  p-1 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-400\",\n      className,\n    )}\n    {...props}\n  />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.Trigger>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.Trigger\n    ref={ref}\n    className={cn(\n      \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm  ring-offset-white transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-b-2 border-transparent data-[state=active]:border-zinc-950 dark:data-[state=active]:border-zinc-50 dark:text-zinc-100\",\n      className,\n    )}\n    {...props}\n  />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n  React.ElementRef<typeof TabsPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n  <TabsPrimitive.Content\n    ref={ref}\n    className={cn(\n      \"mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-950 focus-visible:ring-offset-2 dark:ring-offset-zinc-950 dark:focus-visible:ring-zinc-300\",\n      className,\n    )}\n    {...props}\n  />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"
  },
  {
    "path": "components/ui/shadcn/textarea.tsx",
    "content": "import { cn } from \"@/utils/cn\";\n\nexport default function Textarea(\n  textareaProps: React.ComponentPropsWithoutRef<\"textarea\">,\n) {\n  return (\n    <label\n      className={cn(\n        \"py-8 px-12 rounded-8 transition-all w-full block gap-4 cursor-text\",\n        \"relative bg-accent-white\",\n        \"inside-border before:border-black-alpha-8 hover:before:border-black-alpha-12 hover:bg-black-alpha-2 focus-within:!bg-accent-white focus-within:before:!border-heat-100 focus-within:before:!border-[1.25px]\",\n        \"text-body-medium\",\n      )}\n    >\n      <textarea\n        className=\"outline-none w-full resize-none bg-transparent\"\n        {...textareaProps}\n      />\n    </label>\n  );\n}\n"
  },
  {
    "path": "components/ui/shadcn/toast.tsx",
    "content": "\"use client\";\n\nimport { useTheme } from \"next-themes\";\nimport { Toaster as Sonner } from \"sonner\";\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n  const { theme = \"system\" } = useTheme();\n\n  return (\n    <Sonner\n      theme={theme as ToasterProps[\"theme\"]}\n      className=\"toaster group\"\n      toastOptions={{\n        classNames: {\n          toast:\n            \"group toast group-[.toaster]:bg-white group-[.toaster]:text-zinc-950 group-[.toaster]:border-zinc-200 group-[.toaster]:shadow-lg dark:group-[.toaster]:bg-zinc-950 dark:group-[.toaster]:text-zinc-50 dark:group-[.toaster]:border-zinc-800\",\n          description:\n            \"group-[.toast]:text-zinc-500 dark:group-[.toast]:text-zinc-400\",\n          actionButton:\n            \"group-[.toast]:bg-zinc-900 group-[.toast]:text-zinc-50 dark:group-[.toast]:bg-zinc-50 dark:group-[.toast]:text-zinc-900\",\n          cancelButton:\n            \"group-[.toast]:bg-zinc-100 group-[.toast]:text-zinc-500 dark:group-[.toast]:bg-zinc-800 dark:group-[.toast]:text-zinc-400\",\n        },\n      }}\n      {...props}\n    />\n  );\n};\n\nexport { Toaster };\n"
  },
  {
    "path": "components/ui/shadcn/toggle.tsx",
    "content": "import { motion } from \"motion/react\";\nimport { useState } from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport default function Toggle({\n  checked,\n  onChange,\n  disabled,\n}: {\n  checked: boolean;\n  onChange?: (checked: boolean) => void;\n  disabled?: boolean;\n}) {\n  const [isHovering, setIsHovering] = useState(false);\n\n  return (\n    <button\n      className={cn(\n        \"transition-all relative rounded-full group\",\n        checked ? \"bg-heat-100\" : \"bg-black-alpha-10\",\n      )}\n      style={{\n        width: \"50px\",\n        height: \"20px\",\n        boxShadow: checked\n          ? \"0px 6px 12px 0px rgba(174, 37, 0, 0.12) inset, 0px 0.75px 0.75px 0px rgba(174, 37, 0, 0.06) inset, 0px 0.25px 0.25px 0px rgba(174, 37, 0, 0.06) inset\"\n          : \"0px 6px 12px 0px rgba(0, 0, 0, 0.02) inset, 0px 0.75px 0.75px 0px rgba(0, 0, 0, 0.02) inset, 0px 0.25px 0.25px 0px rgba(0, 0, 0, 0.04) inset\",\n      }}\n      type=\"button\"\n      onClick={() => onChange?.(!checked)}\n      onMouseEnter={() => setIsHovering(true)}\n      onMouseLeave={() => setIsHovering(false)}\n      disabled={disabled}\n    >\n      <div\n        className={cn(\n          \"overlay bg-[#FA4500] transition-opacity\",\n          checked\n            ? \"opacity-0 group-hover:opacity-100\"\n            : \"opacity-0 group-hover:opacity-0\",\n        )}\n        style={{\n          background: \"color(display-p3 0.9059 0.3294 0.0784)\",\n        }}\n      />\n\n      <motion.div\n        animate={{\n          x: checked ? 18 : 0,\n        }}\n        className=\"top-[2px] left-[2px] transition-[box-shadow] absolute rounded-full bg-accent-white\"\n        initial={{\n          x: checked ? 18 : 0,\n        }}\n        style={{\n          width: \"28px\",\n          height: \"16px\",\n          boxShadow: (() => {\n            if (checked) {\n              if (isHovering) {\n                return \"0px 6px 12px -3px rgba(174, 36, 0, 0.30), 0px 3px 6px -1px rgba(174, 37, 0, 0.12), 0px 1px 2px 0px rgba(174, 37, 0, 0.12), 0px 0.5px 0.5px 0px rgba(174, 37, 0, 0.24)\";\n              }\n\n              return \"0px 6px 12px -3px rgba(174, 36, 0, 0.30), 0px 3px 6px -1px rgba(174, 37, 0, 0.12), 0px 1px 2px 0px rgba(174, 37, 0, 0.12), 0px 0.5px 0.5px 0px rgba(174, 37, 0, 0.24)\";\n            }\n\n            if (isHovering) {\n              return \"0px 6px 12px -3px rgba(0, 0, 0, 0.06), 0px 3px 6px -1px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 0.5px 0.5px 0px rgba(0, 0, 0, 0.08)\";\n            }\n\n            return \"0px 6px 12px -3px rgba(0, 0, 0, 0.06), 0px 3px 6px -1px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.04), 0px 0.5px 0.5px 0px rgba(0, 0, 0, 0.08)\";\n          })(),\n        }}\n      />\n    </button>\n  );\n}\n"
  },
  {
    "path": "components/ui/shadcn/tooltip-radix.tsx",
    "content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"@/utils/cn\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n  React.ElementRef<typeof TooltipPrimitive.Content>,\n  React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n  <TooltipPrimitive.Content\n    ref={ref}\n    sideOffset={sideOffset}\n    className={cn(\n      \"z-50 overflow-hidden rounded-md border border-zinc-200 bg-white px-3 py-1.5 text-sm text-zinc-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50\",\n      className,\n    )}\n    {...props}\n  />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"
  },
  {
    "path": "components/ui/shadcn/tooltip.tsx",
    "content": "\"use client\";\n\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { nanoid } from \"nanoid\";\nimport { useEffect, useRef, useState } from \"react\";\n\nimport PortalToBody from \"@/components/shared/utils/portal-to-body\";\nimport { cn } from \"@/utils/cn\";\n\nexport default function Tooltip({\n  delay = 0.5,\n  offset = 8,\n  wrapperClassName,\n  className,\n  ...props\n}: {\n  description?: string;\n  children?: React.ReactNode;\n  offset?: number;\n  delay?: number;\n  wrapperClassName?: string;\n  className?: string;\n}) {\n  const [hovering, setHovering] = useState(false);\n  const ref = useRef<HTMLDivElement>(null);\n\n  const [bounds, setBounds] = useState<{\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n  } | null>(null);\n\n  useEffect(() => {\n    if (ref.current) {\n      const element = ref.current;\n      const parent = element.parentElement!;\n\n      const onMouseEnter = () => {\n        setBounds(parent.getBoundingClientRect());\n        setHovering(true);\n      };\n      const onMouseLeave = () => setHovering(false);\n\n      if (!parent) return;\n\n      parent.addEventListener(\"mouseenter\", onMouseEnter);\n      parent.addEventListener(\"mouseleave\", onMouseLeave);\n\n      return () => {\n        parent.removeEventListener(\"mouseenter\", onMouseEnter);\n        parent.removeEventListener(\"mouseleave\", onMouseLeave);\n      };\n    }\n  }, []);\n\n  if (!props.description) return props.children;\n\n  return (\n    <div className=\"contents\" ref={ref}>\n      <PortalToBody>\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          {hovering && (\n            <div\n              className={cn(\n                \"fixed pointer-events-none flex-center z-[121]\",\n                wrapperClassName,\n              )}\n              style={{\n                left: bounds?.x,\n                top: bounds?.y,\n                width: bounds?.width,\n                height: bounds?.height,\n              }}\n            >\n              <motion.div\n                animate={{\n                  y: 0,\n                  opacity: 1,\n                  filter: \"blur(0px)\",\n                  transition: {\n                    type: \"spring\",\n                    stiffness: 240,\n                    damping: 16,\n                    filter: { duration: 0.4 },\n                    delay,\n                  },\n                }}\n                className={cn(\n                  \"py-10 px-16 rounded-12 max-w-248 absolute w-max text-body-medium text-accent-white bg-black-alpha-64 backdrop-blur-[6px] z-[121]\",\n                  className,\n                )}\n                dangerouslySetInnerHTML={{ __html: props.description }}\n                exit={{\n                  y: -8,\n                  opacity: 0,\n                  filter: \"blur(4px)\",\n                  transition: { type: \"spring\", stiffness: 300, damping: 16 },\n                }}\n                initial={{ y: 8, opacity: 0, filter: \"blur(4px)\" }}\n                key={nanoid()}\n                style={{\n                  boxShadow:\n                    \"0px 16px 24px -8px rgba(0, 0, 0, 0.06), 0px 8px 16px -4px rgba(0, 0, 0, 0.06)\",\n                  bottom: `calc(100% - ${offset}px)`,\n                }}\n                transition={{\n                  type: \"spring\",\n                  stiffness: 160,\n                  damping: 13,\n                  filter: { duration: 0.4 },\n                }}\n              />\n            </div>\n          )}\n        </AnimatePresence>\n      </PortalToBody>\n    </div>\n  );\n}\n"
  },
  {
    "path": "components/ui/spinner.tsx",
    "content": "import React from 'react';\n\ninterface SpinnerProps {\n  className?: string;\n  size?: 'sm' | 'md' | 'lg';\n  finished?: boolean;\n}\n\nexport default function Spinner({ className = '', size = 'md', finished = false }: SpinnerProps) {\n  if (finished) {\n    // Return a checkmark or completed state\n    return (\n      <div className={`${className}`}>\n        ✓\n      </div>\n    );\n  }\n  const sizeClasses = {\n    sm: 'h-4 w-4',\n    md: 'h-20 w-20',\n    lg: 'h-8 w-8'\n  };\n\n  return (\n    <div className={`${sizeClasses[size]} ${className}`}>\n      <svg\n        className=\"animate-spin\"\n        xmlns=\"http://www.w3.org/2000/svg\"\n        fill=\"none\"\n        viewBox=\"0 0 24 24\"\n      >\n        <circle\n          className=\"opacity-25\"\n          cx=\"12\"\n          cy=\"12\"\n          r=\"10\"\n          stroke=\"currentColor\"\n          strokeWidth=\"4\"\n        />\n        <path\n          className=\"opacity-75\"\n          fill=\"currentColor\"\n          d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n        />\n      </svg>\n    </div>\n  );\n}"
  },
  {
    "path": "components/ui/textarea.tsx",
    "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n  ({ className, ...props }, ref) => {\n    return (\n      <textarea\n        className={cn(\n          \"flex min-h-[80px] w-full rounded-[10px] border border-zinc-300 bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [box-shadow:inset_0px_-2px_0px_0px_#e4e4e7,_0px_1px_6px_0px_rgba(228,_228,_231,_30%)] hover:[box-shadow:inset_0px_-2px_0px_0px_#d4d4d8,_0px_1px_6px_0px_rgba(212,_212,_216,_40%)] focus-visible:[box-shadow:inset_0px_-2px_0px_0px_#f97316,_0px_1px_6px_0px_rgba(249,_115,_22,_30%)] transition-all duration-200\",\n          className\n        )}\n        ref={ref}\n        {...props}\n      />\n    )\n  }\n)\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }"
  },
  {
    "path": "config/app.config.ts",
    "content": "// Application Configuration\n// This file contains all configurable settings for the application\n\nexport const appConfig = {\n  // Vercel Sandbox Configuration\n  vercelSandbox: {\n    // Sandbox timeout in minutes\n    timeoutMinutes: 15,\n\n    // Convert to milliseconds for Vercel Sandbox API\n    get timeoutMs() {\n      return this.timeoutMinutes * 60 * 1000;\n    },\n\n    // Development server port (Vercel Sandbox typically uses 3000 for Next.js/React)\n    devPort: 3000,\n\n    // Time to wait for dev server to be ready (in milliseconds)\n    devServerStartupDelay: 7000,\n\n    // Time to wait for CSS rebuild (in milliseconds)\n    cssRebuildDelay: 2000,\n\n    // Working directory in sandbox\n    workingDirectory: '/app',\n\n    // Default runtime for sandbox\n    runtime: 'node22' // Available: node22, python3.13, v0-next-shadcn, cua-ubuntu-xfce\n  },\n\n  // E2B Sandbox Configuration\n  e2b: {\n    // Sandbox timeout in minutes\n    timeoutMinutes: 30,\n\n    // Convert to milliseconds for E2B API\n    get timeoutMs() {\n      return this.timeoutMinutes * 60 * 1000;\n    },\n\n    // Development server port (E2B uses 5173 for Vite)\n    vitePort: 5173,\n\n    // Time to wait for Vite dev server to be ready (in milliseconds)\n    viteStartupDelay: 10000,\n\n    // Working directory in sandbox\n    workingDirectory: '/home/user/app',\n  },\n  \n  // AI Model Configuration\n  ai: {\n    // Default AI model\n    defaultModel: 'google/gemini-3-pro-preview',\n    \n    // Available models\n    availableModels: [\n      'openai/gpt-5',\n      'moonshotai/kimi-k2-instruct-0905',\n      'anthropic/claude-sonnet-4-20250514',\n      'google/gemini-3-pro-preview'\n    ],\n    \n    // Model display names\n    modelDisplayNames: {\n      'openai/gpt-5': 'GPT-5',\n      'moonshotai/kimi-k2-instruct-0905': 'Kimi K2 (Groq)',\n      'anthropic/claude-sonnet-4-20250514': 'Sonnet 4',\n      'google/gemini-3-pro-preview': 'Gemini 3 Pro (Preview)'\n    } as Record<string, string>,\n    \n    // Model API configuration\n    modelApiConfig: {\n      'moonshotai/kimi-k2-instruct-0905': {\n        provider: 'groq',\n        model: 'moonshotai/kimi-k2-instruct-0905'\n      }\n    },\n    \n    // Temperature settings for non-reasoning models\n    defaultTemperature: 0.7,\n    \n    // Max tokens for code generation\n    maxTokens: 8000,\n    \n    // Max tokens for truncation recovery\n    truncationRecoveryMaxTokens: 4000,\n  },\n  \n  // Code Application Configuration\n  codeApplication: {\n    // Delay after applying code before refreshing iframe (milliseconds)\n    defaultRefreshDelay: 2000,\n    \n    // Delay when packages are installed (milliseconds)\n    packageInstallRefreshDelay: 5000,\n    \n    // Enable/disable automatic truncation recovery\n    enableTruncationRecovery: false, // Disabled - too many false positives\n    \n    // Maximum number of truncation recovery attempts per file\n    maxTruncationRecoveryAttempts: 1,\n  },\n  \n  // UI Configuration\n  ui: {\n    // Show/hide certain UI elements\n    showModelSelector: true,\n    showStatusIndicator: true,\n    \n    // Animation durations (milliseconds)\n    animationDuration: 200,\n    \n    // Toast notification duration (milliseconds)\n    toastDuration: 3000,\n    \n    // Maximum chat messages to keep in memory\n    maxChatMessages: 100,\n    \n    // Maximum recent messages to send as context\n    maxRecentMessagesContext: 20,\n  },\n  \n  // Development Configuration\n  dev: {\n    // Enable debug logging\n    enableDebugLogging: true,\n    \n    // Enable performance monitoring\n    enablePerformanceMonitoring: false,\n    \n    // Log API responses\n    logApiResponses: true,\n  },\n  \n  // Package Installation Configuration\n  packages: {\n    // Use --legacy-peer-deps flag for npm install\n    useLegacyPeerDeps: true,\n    \n    // Package installation timeout (milliseconds)\n    installTimeout: 60000,\n    \n    // Auto-restart Vite after package installation\n    autoRestartVite: true,\n  },\n  \n  // File Management Configuration\n  files: {\n    // Excluded file patterns (files to ignore)\n    excludePatterns: [\n      'node_modules/**',\n      '.git/**',\n      '.next/**',\n      'dist/**',\n      'build/**',\n      '*.log',\n      '.DS_Store'\n    ],\n    \n    // Maximum file size to read (bytes)\n    maxFileSize: 1024 * 1024, // 1MB\n    \n    // File extensions to treat as text\n    textFileExtensions: [\n      '.js', '.jsx', '.ts', '.tsx',\n      '.css', '.scss', '.sass',\n      '.html', '.xml', '.svg',\n      '.json', '.yml', '.yaml',\n      '.md', '.txt', '.env',\n      '.gitignore', '.dockerignore'\n    ],\n  },\n  \n  // API Endpoints Configuration (for external services)\n  api: {\n    // Retry configuration\n    maxRetries: 3,\n    retryDelay: 1000, // milliseconds\n    \n    // Request timeout (milliseconds)\n    requestTimeout: 30000,\n  }\n};\n\n// Type-safe config getter\nexport function getConfig<K extends keyof typeof appConfig>(key: K): typeof appConfig[K] {\n  return appConfig[key];\n}\n\n// Helper to get nested config values\nexport function getConfigValue(path: string): any {\n  return path.split('.').reduce((obj, key) => obj?.[key], appConfig as any);\n}\n\nexport default appConfig;"
  },
  {
    "path": "eslint.config.mjs",
    "content": "import { dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { FlatCompat } from \"@eslint/eslintrc\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\nconst compat = new FlatCompat({\n  baseDirectory: __dirname,\n});\n\nconst eslintConfig = [\n  ...compat.extends(\"next/core-web-vitals\", \"next/typescript\"),\n  {\n    rules: {\n      \"@typescript-eslint/no-explicit-any\": \"off\",\n      \"@typescript-eslint/no-unused-vars\": \"off\",\n      \"react-hooks/exhaustive-deps\": \"warn\",\n      \"react/no-unescaped-entities\": \"off\",\n      \"prefer-const\": \"warn\"\n    }\n  },\n  {\n    files: [\"**/live-preview-frame.tsx\"],\n    rules: {\n      \"@next/next/no-img-element\": \"off\" // Dynamic WebSocket stream images require regular img tag\n    }\n  }\n];\n\nexport default eslintConfig;\n"
  },
  {
    "path": "hooks/useDebouncedCallback.ts",
    "content": "import {\n  useCallback, useRef\n} from 'react';\n\nconst DEFAULT_CONFIG = { timeout: 0 };\n\nexport function useDebouncedCallback<T extends (...args: any[]) => any>(\n  callback: T,\n  config: number | { timeout?: number }\n): T {\n  const timeoutRef = useRef(0);\n  const callbackRef = useRef(callback);\n  callbackRef.current = callback;\n\n  const currentConfig = typeof config === 'object' ? {\n    ...DEFAULT_CONFIG,\n    ...config\n  } : {\n    ...DEFAULT_CONFIG,\n    timeout: config\n  };\n\n  return useCallback((...args: Parameters<T>) => {\n    if (timeoutRef.current) {\n      clearTimeout(timeoutRef.current);\n    }\n\n    timeoutRef.current = window.setTimeout(() => {\n      callbackRef.current(...args);\n    }, currentConfig.timeout);\n  }, [currentConfig.timeout]) as T;\n}\n\nexport default useDebouncedCallback;\n"
  },
  {
    "path": "hooks/useDebouncedEffect.ts",
    "content": "import {\n  useEffect, useRef\n} from 'react';\n\nconst DEFAULT_CONFIG = {\n  timeout: 0,\n  ignoreInitialCall: true\n};\n\nexport function useDebouncedEffect(\n  callback: () => (void | (() => void)),\n  config: number | {\n    timeout?: number;\n    ignoreInitialCall?: boolean;\n  },\n  deps: any[] = []\n): void {\n  let currentConfig;\n\n  if (typeof config === 'object') {\n    currentConfig = {\n      ...DEFAULT_CONFIG,\n      ...config\n    };\n  } else {\n    currentConfig = {\n      ...DEFAULT_CONFIG,\n      timeout: config\n    };\n  }\n  const {\n    timeout, ignoreInitialCall\n  } = currentConfig;\n\n  const data = useRef<{ firstTime: boolean }>({ firstTime: true });\n\n  useEffect(() => {\n    const { firstTime } = data.current;\n\n    if (firstTime && ignoreInitialCall) {\n      data.current.firstTime = false;\n\n      return;\n    }\n\n    let clearFunc: (() => void) | undefined;\n\n    const handler = setTimeout(() => {\n      clearFunc = callback() ?? undefined;\n    }, timeout);\n\n    return () => {\n      clearTimeout(handler);\n\n      if (clearFunc && typeof clearFunc === 'function') {\n        clearFunc();\n      }\n    };\n  }, [\n    callback,\n    ignoreInitialCall,\n    timeout,\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n    ...deps\n  ]);\n}\n\nexport default useDebouncedEffect;\n"
  },
  {
    "path": "hooks/useSwitchingCode.ts",
    "content": "import { useEffect, useRef, useState } from 'react';\nimport { encryptText } from '@/components/app/(home)/sections/hero/Title/Title';\n\n\n\nexport default function useSwitchingCode(code: string, ms = 20, progress = 1, fill = true) {\n  const [value, setValue] = useState(code);\n  const prevCode = useRef(value);\n\n  useEffect(() => {\n    if (code === prevCode.current) return;\n\n    let i = 0;\n\n    setValue(prevCode.current);\n\n    let timeout: number;\n\n    const tick = () => {\n      i += progress;\n\n      const prevLines = prevCode.current.split('\\n');\n      const currentLines = code.split('\\n');\n\n      const maxLines = fill ? 10 : Math.max(prevLines.length, currentLines.length);\n      while (prevLines.length < maxLines) prevLines.push('');\n      while (currentLines.length < maxLines) currentLines.push('');\n\n      const remainingLines = prevLines.map((line, index) => {\n        if (line === currentLines[index]) return line;\n\n        const charLength = Math.floor(line.length * (i / 30));\n\n        return (currentLines[index]?.slice(0, Math.floor(currentLines[index].length * (i / 30))) ?? '')\n         + encryptText(line.slice(charLength), 0, { randomizeChance: 0.5 });\n      });\n\n      setValue((fill ? remainingLines : remainingLines.filter((line, index, arr) => {\n        if (line === '' && arr[index - 1] === '') return false;\n\n        return true;\n      })).join('\\n'));\n\n      if (i < 30) {\n        timeout = window.setTimeout(tick, ms);\n      } else {\n        prevCode.current = code;\n      }\n    };\n\n    tick();\n\n    return () => {\n      window.clearTimeout(timeout);\n      prevCode.current = code;\n    };\n  }, [code, ms, progress, fill]);\n\n  return value;\n}"
  },
  {
    "path": "lib/ai/provider-manager.ts",
    "content": "import { appConfig } from '@/config/app.config';\nimport { createGroq } from '@ai-sdk/groq';\nimport { createAnthropic } from '@ai-sdk/anthropic';\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { createGoogleGenerativeAI } from '@ai-sdk/google';\n\ntype ProviderName = 'openai' | 'anthropic' | 'groq' | 'google';\n\n// Client function type returned by @ai-sdk providers\nexport type ProviderClient =\n  | ReturnType<typeof createOpenAI>\n  | ReturnType<typeof createAnthropic>\n  | ReturnType<typeof createGroq>\n  | ReturnType<typeof createGoogleGenerativeAI>;\n\nexport interface ProviderResolution {\n  client: ProviderClient;\n  actualModel: string;\n}\n\nconst aiGatewayApiKey = process.env.AI_GATEWAY_API_KEY;\nconst aiGatewayBaseURL = 'https://ai-gateway.vercel.sh/v1';\nconst isUsingAIGateway = !!aiGatewayApiKey;\n\n// Cache provider clients by a stable key to avoid recreating\nconst clientCache = new Map<string, ProviderClient>();\n\nfunction getEnvDefaults(provider: ProviderName): { apiKey?: string; baseURL?: string } {\n  if (isUsingAIGateway) {\n    return { apiKey: aiGatewayApiKey, baseURL: aiGatewayBaseURL };\n  }\n\n  switch (provider) {\n    case 'openai':\n      return { apiKey: process.env.OPENAI_API_KEY, baseURL: process.env.OPENAI_BASE_URL };\n    case 'anthropic':\n      // Default Anthropic base URL mirrors existing routes\n      return { apiKey: process.env.ANTHROPIC_API_KEY, baseURL: process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com/v1' };\n    case 'groq':\n      return { apiKey: process.env.GROQ_API_KEY, baseURL: process.env.GROQ_BASE_URL };\n    case 'google':\n      return { apiKey: process.env.GEMINI_API_KEY, baseURL: process.env.GEMINI_BASE_URL };\n    default:\n      return {};\n  }\n}\n\nfunction getOrCreateClient(provider: ProviderName, apiKey?: string, baseURL?: string): ProviderClient {\n  const effective = isUsingAIGateway\n    ? { apiKey: aiGatewayApiKey, baseURL: aiGatewayBaseURL }\n    : { apiKey, baseURL };\n\n  const cacheKey = `${provider}:${effective.apiKey || ''}:${effective.baseURL || ''}`;\n  const cached = clientCache.get(cacheKey);\n  if (cached) return cached;\n\n  let client: ProviderClient;\n  switch (provider) {\n    case 'openai':\n      client = createOpenAI({ apiKey: effective.apiKey || getEnvDefaults('openai').apiKey, baseURL: effective.baseURL ?? getEnvDefaults('openai').baseURL });\n      break;\n    case 'anthropic':\n      client = createAnthropic({ apiKey: effective.apiKey || getEnvDefaults('anthropic').apiKey, baseURL: effective.baseURL ?? getEnvDefaults('anthropic').baseURL });\n      break;\n    case 'groq':\n      client = createGroq({ apiKey: effective.apiKey || getEnvDefaults('groq').apiKey, baseURL: effective.baseURL ?? getEnvDefaults('groq').baseURL });\n      break;\n    case 'google':\n      client = createGoogleGenerativeAI({ apiKey: effective.apiKey || getEnvDefaults('google').apiKey, baseURL: effective.baseURL ?? getEnvDefaults('google').baseURL });\n      break;\n    default:\n      client = createGroq({ apiKey: effective.apiKey || getEnvDefaults('groq').apiKey, baseURL: effective.baseURL ?? getEnvDefaults('groq').baseURL });\n  }\n\n  clientCache.set(cacheKey, client);\n  return client;\n}\n\nexport function getProviderForModel(modelId: string): ProviderResolution {\n  // 1) Check explicit model configuration in app config (custom models)\n  const configured = appConfig.ai.modelApiConfig?.[modelId as keyof typeof appConfig.ai.modelApiConfig];\n  if (configured) {\n    const { provider, apiKey, baseURL, model } = configured as { provider: ProviderName; apiKey?: string; baseURL?: string; model: string };\n    const client = getOrCreateClient(provider, apiKey, baseURL);\n    return { client, actualModel: model };\n  }\n\n  // 2) Fallback logic based on prefixes and special cases\n  const isAnthropic = modelId.startsWith('anthropic/');\n  const isOpenAI = modelId.startsWith('openai/');\n  const isGoogle = modelId.startsWith('google/');\n  const isKimiGroq = modelId === 'moonshotai/kimi-k2-instruct-0905';\n\n  if (isKimiGroq) {\n    const client = getOrCreateClient('groq');\n    return { client, actualModel: 'moonshotai/kimi-k2-instruct-0905' };\n  }\n\n  if (isAnthropic) {\n    const client = getOrCreateClient('anthropic');\n    return { client, actualModel: modelId.replace('anthropic/', '') };\n  }\n\n  if (isOpenAI) {\n    const client = getOrCreateClient('openai');\n    return { client, actualModel: modelId.replace('openai/', '') };\n  }\n\n  if (isGoogle) {\n    const client = getOrCreateClient('google');\n    return { client, actualModel: modelId.replace('google/', '') };\n  }\n\n  // Default: use Groq with modelId as-is\n  const client = getOrCreateClient('groq');\n  return { client, actualModel: modelId };\n}\n\nexport default getProviderForModel;\n\n\n\n"
  },
  {
    "path": "lib/build-validator.ts",
    "content": "export interface BuildValidation {\n  success: boolean;\n  errors: string[];\n  isRendering: boolean;\n  warnings?: string[];\n}\n\n/**\n * Validates that the sandbox build was successful\n * Checks compilation status and verifies app is rendering\n */\nexport async function validateBuild(sandboxUrl: string, sandboxId: string): Promise<BuildValidation> {\n  try {\n    // Step 1: Wait for Vite to process files (give it time to compile)\n    await new Promise(resolve => setTimeout(resolve, 3000));\n\n    // Step 2: Check if the sandbox is actually serving content\n    const response = await fetch(sandboxUrl, {\n      headers: {\n        'User-Agent': 'OpenLovable-Validator',\n        'Cache-Control': 'no-cache'\n      }\n    });\n\n    if (!response.ok) {\n      return {\n        success: false,\n        errors: [`Sandbox returned ${response.status}`],\n        isRendering: false\n      };\n    }\n\n    const html = await response.text();\n\n    // Step 3: Check if it's the default page or actual app\n    const isDefaultPage =\n      html.includes('Vercel Sandbox Ready') ||\n      html.includes('Start building your React app with Vite') ||\n      html.includes('Vite + React') ||\n      !html.includes('id=\"root\"');\n\n    if (isDefaultPage) {\n      return {\n        success: false,\n        errors: ['Sandbox showing default page, app not rendered'],\n        isRendering: false\n      };\n    }\n\n    // Step 4: Check for Vite error overlay in HTML\n    const hasViteError = html.includes('vite-error-overlay');\n    if (hasViteError) {\n      // Try to extract error message\n      const errorMatch = html.match(/Failed to resolve import \"([^\"]+)\"/);\n      const error = errorMatch\n        ? `Missing package: ${errorMatch[1]}`\n        : 'Vite compilation error detected';\n\n      return {\n        success: false,\n        errors: [error],\n        isRendering: false\n      };\n    }\n\n    // Success! App is rendering\n    return {\n      success: true,\n      errors: [],\n      isRendering: true\n    };\n\n  } catch (error) {\n    console.error('[validateBuild] Error during validation:', error);\n    return {\n      success: false,\n      errors: [error instanceof Error ? error.message : 'Validation failed'],\n      isRendering: false\n    };\n  }\n}\n\n/**\n * Extracts missing package names from error messages\n */\nexport function extractMissingPackages(error: any): string[] {\n  const message = error?.message || String(error);\n  const packages: string[] = [];\n\n  // Pattern 1: \"Failed to resolve import 'package-name'\"\n  const importMatches = message.matchAll(/Failed to resolve import [\"']([^\"']+)[\"']/g);\n  for (const match of importMatches) {\n    packages.push(match[1]);\n  }\n\n  // Pattern 2: \"Cannot find module 'package-name'\"\n  const moduleMatches = message.matchAll(/Cannot find module [\"']([^\"']+)[\"']/g);\n  for (const match of moduleMatches) {\n    packages.push(match[1]);\n  }\n\n  // Pattern 3: \"Package 'package-name' not found\"\n  const packageMatches = message.matchAll(/Package [\"']([^\"']+)[\"'] not found/g);\n  for (const match of packageMatches) {\n    packages.push(match[1]);\n  }\n\n  return [...new Set(packages)]; // Remove duplicates\n}\n\n/**\n * Classifies error type for targeted recovery\n */\nexport type ErrorType = 'missing-package' | 'syntax-error' | 'sandbox-timeout' | 'not-rendered' | 'vite-error' | 'unknown';\n\nexport function classifyError(error: any): ErrorType {\n  const message = (error?.message || String(error)).toLowerCase();\n\n  if (message.includes('failed to resolve import') ||\n      message.includes('cannot find module') ||\n      message.includes('missing package')) {\n    return 'missing-package';\n  }\n\n  if (message.includes('syntax error') ||\n      message.includes('unexpected token') ||\n      message.includes('parsing error')) {\n    return 'syntax-error';\n  }\n\n  if (message.includes('timeout') ||\n      message.includes('not responding') ||\n      message.includes('timed out')) {\n    return 'sandbox-timeout';\n  }\n\n  if (message.includes('not rendered') ||\n      message.includes('sandbox ready') ||\n      message.includes('default page')) {\n    return 'not-rendered';\n  }\n\n  if (message.includes('vite') ||\n      message.includes('compilation')) {\n    return 'vite-error';\n  }\n\n  return 'unknown';\n}\n\n/**\n * Calculates retry delay based on attempt number and error type\n */\nexport function calculateRetryDelay(attempt: number, errorType: ErrorType): number {\n  const baseDelay = 2000; // 2 seconds\n\n  // Different strategies for different errors\n  switch (errorType) {\n    case 'missing-package':\n      // Packages need time to install\n      return baseDelay * 2 * attempt; // 4s, 8s, 12s\n\n    case 'not-rendered':\n      // Vite needs time to compile\n      return baseDelay * 3 * attempt; // 6s, 12s, 18s\n\n    case 'vite-error':\n      // Vite restart needed\n      return baseDelay * 2 * attempt;\n\n    case 'sandbox-timeout':\n      // Sandbox might be slow\n      return baseDelay * 4 * attempt; // 8s, 16s, 24s\n\n    default:\n      // Standard exponential backoff\n      return baseDelay * attempt;\n  }\n}\n"
  },
  {
    "path": "lib/context-selector.ts",
    "content": "import { FileManifest, EditIntent, EditType } from '@/types/file-manifest';\nimport { analyzeEditIntent } from '@/lib/edit-intent-analyzer';\nimport { getEditExamplesPrompt, getComponentPatternPrompt } from '@/lib/edit-examples';\n\nexport interface FileContext {\n  primaryFiles: string[]; // Files to edit\n  contextFiles: string[]; // Files to include for reference\n  systemPrompt: string;   // Enhanced prompt with file info\n  editIntent: EditIntent;\n}\n\n/**\n * Select files and build context based on user prompt\n */\nexport function selectFilesForEdit(\n  userPrompt: string,\n  manifest: FileManifest\n): FileContext {\n  // Analyze the edit intent\n  const editIntent = analyzeEditIntent(userPrompt, manifest);\n  \n  // Get the files based on intent - only edit target files, but provide all others as context\n  const primaryFiles = editIntent.targetFiles;\n  const allFiles = Object.keys(manifest.files);\n  let contextFiles = allFiles.filter(file => !primaryFiles.includes(file));\n  \n  // ALWAYS include key files in context if they exist and aren't already primary files\n  const keyFiles: string[] = [];\n  \n  // App.jsx is most important - shows component structure\n  const appFile = allFiles.find(f => f.endsWith('App.jsx') || f.endsWith('App.tsx'));\n  if (appFile && !primaryFiles.includes(appFile)) {\n    keyFiles.push(appFile);\n  }\n  \n  // Include design system files for style context\n  const tailwindConfig = allFiles.find(f => f.endsWith('tailwind.config.js') || f.endsWith('tailwind.config.ts'));\n  if (tailwindConfig && !primaryFiles.includes(tailwindConfig)) {\n    keyFiles.push(tailwindConfig);\n  }\n  \n  const indexCss = allFiles.find(f => f.endsWith('index.css') || f.endsWith('globals.css'));\n  if (indexCss && !primaryFiles.includes(indexCss)) {\n    keyFiles.push(indexCss);\n  }\n  \n  // Include package.json to understand dependencies\n  const packageJson = allFiles.find(f => f.endsWith('package.json'));\n  if (packageJson && !primaryFiles.includes(packageJson)) {\n    keyFiles.push(packageJson);\n  }\n  \n  // Put key files at the beginning of context for visibility\n  contextFiles = [...keyFiles, ...contextFiles.filter(f => !keyFiles.includes(f))];\n  \n  // Build enhanced system prompt\n  const systemPrompt = buildSystemPrompt(\n    userPrompt,\n    editIntent,\n    primaryFiles,\n    contextFiles,\n    manifest\n  );\n  \n  return {\n    primaryFiles,\n    contextFiles,\n    systemPrompt,\n    editIntent,\n  };\n}\n\n/**\n * Build an enhanced system prompt with file structure context\n */\nfunction buildSystemPrompt(\n  userPrompt: string,\n  editIntent: EditIntent,\n  primaryFiles: string[],\n  contextFiles: string[],\n  manifest: FileManifest\n): string {\n  const sections: string[] = [];\n  \n  // Add edit examples first for better understanding\n  if (editIntent.type !== EditType.FULL_REBUILD) {\n    sections.push(getEditExamplesPrompt());\n  }\n  \n  // Add edit intent section\n  sections.push(`## Edit Intent\nType: ${editIntent.type}\nDescription: ${editIntent.description}\nConfidence: ${(editIntent.confidence * 100).toFixed(0)}%\n\nUser Request: \"${userPrompt}\"`);\n  \n  // Add file structure overview\n  sections.push(buildFileStructureSection(manifest));\n  \n  // Add component patterns\n  const fileList = Object.keys(manifest.files).map(f => f.replace('/home/user/app/', '')).join('\\n');\n  sections.push(getComponentPatternPrompt(fileList));\n  \n  // Add primary files section\n  if (primaryFiles.length > 0) {\n    sections.push(`## Files to Edit\n${primaryFiles.map(f => {\n  const fileInfo = manifest.files[f];\n  return `- ${f}${fileInfo?.componentInfo ? ` (${fileInfo.componentInfo.name} component)` : ''}`;\n}).join('\\n')}`);\n  }\n  \n  // Add context files section\n  if (contextFiles.length > 0) {\n    sections.push(`## Context Files (for reference only)\n${contextFiles.map(f => {\n  const fileInfo = manifest.files[f];\n  return `- ${f}${fileInfo?.componentInfo ? ` (${fileInfo.componentInfo.name} component)` : ''}`;\n}).join('\\n')}`);\n  }\n  \n  // Add specific instructions based on edit type\n  sections.push(buildEditInstructions(editIntent.type));\n  \n  // Add component relationships if relevant\n  if (editIntent.type === EditType.UPDATE_COMPONENT || \n      editIntent.type === EditType.ADD_FEATURE) {\n    sections.push(buildComponentRelationships(primaryFiles, manifest));\n  }\n  \n  return sections.join('\\n\\n');\n}\n\n/**\n * Build file structure overview section\n */\nfunction buildFileStructureSection(manifest: FileManifest): string {\n  const allFiles = Object.entries(manifest.files)\n    .map(([path]) => path.replace('/home/user/app/', ''))\n    .filter(path => !path.includes('node_modules'))\n    .sort();\n  \n  const componentFiles = Object.entries(manifest.files)\n    .filter(([, info]) => info.type === 'component' || info.type === 'page')\n    .map(([path, info]) => ({\n      path: path.replace('/home/user/app/', ''),\n      name: info.componentInfo?.name || path.split('/').pop(),\n      type: info.type,\n    }));\n  \n  return `## 🚨 EXISTING PROJECT FILES - DO NOT CREATE NEW FILES WITH SIMILAR NAMES 🚨\n\n### ALL PROJECT FILES (${allFiles.length} files)\n\\`\\`\\`\n${allFiles.join('\\n')}\n\\`\\`\\`\n\n### Component Files (USE THESE EXACT NAMES)\n${componentFiles.map(f => \n  `- ${f.name} → ${f.path} (${f.type})`\n).join('\\n')}\n\n### CRITICAL: Component Relationships\n**ALWAYS CHECK App.jsx FIRST** to understand what components exist and how they're imported!\n\nCommon component overlaps to watch for:\n- \"nav\" or \"navigation\" → Often INSIDE Header.jsx, not a separate file\n- \"menu\" → Usually part of Header/Nav, not separate\n- \"logo\" → Typically in Header, not standalone\n\nWhen user says \"nav\" or \"navigation\":\n1. First check if Header.jsx exists\n2. Look inside Header.jsx for navigation elements\n3. Only create Nav.jsx if navigation doesn't exist anywhere\n\nEntry Point: ${manifest.entryPoint}\n\n### Routes\n${manifest.routes.map(r => \n  `- ${r.path} → ${r.component.split('/').pop()}`\n).join('\\n') || 'No routes detected'}`;\n}\n\n/**\n * Build edit-type specific instructions\n */\nfunction buildEditInstructions(editType: EditType): string {\n  const instructions: Record<EditType, string> = {\n    [EditType.UPDATE_COMPONENT]: `## SURGICAL EDIT INSTRUCTIONS\n- You MUST preserve 99% of the original code\n- ONLY edit the specific component(s) mentioned\n- Make ONLY the minimal change requested\n- DO NOT rewrite or refactor unless explicitly asked\n- DO NOT remove any existing code unless explicitly asked\n- DO NOT change formatting or structure\n- Preserve all imports and exports\n- Maintain the existing code style\n- Return the COMPLETE file with the surgical change applied\n- Think of yourself as a surgeon making a precise incision, not an artist repainting`,\n    \n    [EditType.ADD_FEATURE]: `## Instructions\n- Create new components in appropriate directories\n- IMPORTANT: Update parent components to import and use the new component\n- Update routing if adding new pages\n- Follow existing patterns and conventions\n- Add necessary styles to match existing design\n- Example workflow:\n  1. Create NewComponent.jsx\n  2. Import it in the parent: import NewComponent from './NewComponent'\n  3. Use it in the parent's render: <NewComponent />`,\n    \n    [EditType.FIX_ISSUE]: `## Instructions\n- Identify and fix the specific issue\n- Test the fix doesn't break other functionality\n- Preserve existing behavior except for the bug\n- Add error handling if needed`,\n    \n    [EditType.UPDATE_STYLE]: `## SURGICAL STYLE EDIT INSTRUCTIONS\n- Change ONLY the specific style/class mentioned\n- If user says \"change background to blue\", change ONLY the background class\n- DO NOT touch any other styles, classes, or attributes\n- DO NOT refactor or \"improve\" the styling\n- DO NOT change the component structure\n- Preserve ALL other classes and styles exactly as they are\n- Return the COMPLETE file with only the specific style change`,\n    \n    [EditType.REFACTOR]: `## Instructions\n- Improve code quality without changing functionality\n- Follow project conventions\n- Maintain all existing features\n- Improve readability and maintainability`,\n    \n    [EditType.FULL_REBUILD]: `## Instructions\n- You may rebuild the entire application\n- Keep the same core functionality\n- Improve upon the existing design\n- Use modern best practices`,\n    \n    [EditType.ADD_DEPENDENCY]: `## Instructions\n- Update package.json with new dependency\n- Add necessary import statements\n- Configure the dependency if needed\n- Update any build configuration`,\n  };\n  \n  return instructions[editType] || instructions[EditType.UPDATE_COMPONENT];\n}\n\n/**\n * Build component relationship information\n */\nfunction buildComponentRelationships(\n  files: string[],\n  manifest: FileManifest\n): string {\n  const relationships: string[] = ['## Component Relationships'];\n  \n  for (const file of files) {\n    const fileInfo = manifest.files[file];\n    if (!fileInfo?.componentInfo) continue;\n    \n    const componentName = fileInfo.componentInfo.name;\n    const treeNode = manifest.componentTree[componentName];\n    \n    if (treeNode) {\n      relationships.push(`\\n### ${componentName}`);\n      \n      if (treeNode.imports.length > 0) {\n        relationships.push(`Imports: ${treeNode.imports.join(', ')}`);\n      }\n      \n      if (treeNode.importedBy.length > 0) {\n        relationships.push(`Used by: ${treeNode.importedBy.join(', ')}`);\n      }\n      \n      if (fileInfo.componentInfo.childComponents?.length) {\n        relationships.push(`Renders: ${fileInfo.componentInfo.childComponents.join(', ')}`);\n      }\n    }\n  }\n  \n  return relationships.join('\\n');\n}\n\n/**\n * Get file content for selected files\n */\nexport async function getFileContents(\n  files: string[],\n  manifest: FileManifest\n): Promise<Record<string, string>> {\n  const contents: Record<string, string> = {};\n  \n  for (const file of files) {\n    const fileInfo = manifest.files[file];\n    if (fileInfo) {\n      contents[file] = fileInfo.content;\n    }\n  }\n  \n  return contents;\n}\n\n/**\n * Format files for AI context\n */\nexport function formatFilesForAI(\n  primaryFiles: Record<string, string>,\n  contextFiles: Record<string, string>\n): string {\n  const sections: string[] = [];\n  \n  // Add primary files\n  sections.push('## Files to Edit (ONLY OUTPUT THESE FILES)\\n');\n  sections.push('🚨 You MUST ONLY generate the files listed below. Do NOT generate any other files! 🚨\\n');\n  sections.push('⚠️ CRITICAL: Return the COMPLETE file - NEVER truncate with \"...\" or skip any lines! ⚠️\\n');\n  sections.push('The file MUST include ALL imports, ALL functions, ALL JSX, and ALL closing tags.\\n\\n');\n  for (const [path, content] of Object.entries(primaryFiles)) {\n    sections.push(`### ${path}\n**IMPORTANT: This is the COMPLETE file. Your output must include EVERY line shown below, modified only where necessary.**\n\\`\\`\\`${getFileExtension(path)}\n${content}\n\\`\\`\\`\n`);\n  }\n  \n  // Add context files if any - but truncate large files\n  if (Object.keys(contextFiles).length > 0) {\n    sections.push('\\n## Context Files (Reference Only - Do Not Edit)\\n');\n    for (const [path, content] of Object.entries(contextFiles)) {\n      // Truncate very large context files to save tokens\n      let truncatedContent = content;\n      if (content.length > 2000) {\n        truncatedContent = content.substring(0, 2000) + '\\n// ... [truncated for context length]';\n      }\n      \n      sections.push(`### ${path}\n\\`\\`\\`${getFileExtension(path)}\n${truncatedContent}\n\\`\\`\\`\n`);\n    }\n  }\n  \n  return sections.join('\\n');\n}\n\n/**\n * Get file extension for syntax highlighting\n */\nfunction getFileExtension(path: string): string {\n  const ext = path.split('.').pop() || '';\n  const mapping: Record<string, string> = {\n    'js': 'javascript',\n    'jsx': 'javascript',\n    'ts': 'typescript',\n    'tsx': 'typescript',\n    'css': 'css',\n    'json': 'json',\n  };\n  return mapping[ext] || ext;\n}"
  },
  {
    "path": "lib/edit-examples.ts",
    "content": "/**\n * Example-based prompts for teaching AI proper edit behavior\n */\n\nexport const EDIT_EXAMPLES = `\n## Edit Strategy Examples\n\n### Example 1: Update Header Color\nUSER: \"Make the header background black\"\n\nCORRECT APPROACH:\n1. Identify Header component location\n2. Edit ONLY Header.jsx\n3. Change background color class/style\n\nINCORRECT APPROACH:\n- Regenerating entire App.jsx\n- Creating new Header.jsx from scratch\n- Modifying unrelated files\n\nEXPECTED OUTPUT:\n<file path=\"src/components/Header.jsx\">\n// Only the Header component with updated background\n// Preserving all existing functionality\n</file>\n\n### Example 2: Add New Page\nUSER: \"Add a videos page\"\n\nCORRECT APPROACH:\n1. Create Videos.jsx component\n2. Update routing in App.jsx or Router component\n3. Add navigation link if needed\n\nINCORRECT APPROACH:\n- Regenerating entire application\n- Recreating all existing pages\n\nEXPECTED OUTPUT:\n<file path=\"src/components/Videos.jsx\">\n// New Videos component\n</file>\n\n<file path=\"src/App.jsx\">\n// ONLY the routing update, preserving everything else\n</file>\n\n### Example 3: Fix Styling Issue\nUSER: \"Fix the button styling on mobile\"\n\nCORRECT APPROACH:\n1. Identify which component has the button\n2. Update only that component's Tailwind classes\n3. Add responsive modifiers (sm:, md:, etc)\n\nINCORRECT APPROACH:\n- Regenerating all components\n- Creating new CSS files\n- Modifying global styles unnecessarily\n\n### Example 4: Add Feature to Component\nUSER: \"Add a search bar to the header\"\n\nCORRECT APPROACH:\n1. Modify Header.jsx to add search functionality\n2. Preserve all existing header content\n3. Integrate search seamlessly\n\nINCORRECT APPROACH:\n- Creating Header.jsx from scratch\n- Losing existing navigation/branding\n\n### Example 5: Add New Component\nUSER: \"Add a newsletter signup to the footer\"\n\nCORRECT APPROACH:\n1. Create Newsletter.jsx component\n2. UPDATE Footer.jsx to import Newsletter\n3. Add <Newsletter /> in the appropriate place in Footer\n\nEXPECTED OUTPUT:\n<file path=\"src/components/Newsletter.jsx\">\n// New Newsletter component\n</file>\n\n<file path=\"src/components/Footer.jsx\">\n// Updated Footer with Newsletter import and usage\nimport Newsletter from './Newsletter';\n// ... existing code ...\n// Add <Newsletter /> in the render\n</file>\n\n### Example 6: Add External Library\nUSER: \"Add animations with framer-motion to the hero\"\n\nCORRECT APPROACH:\n1. Import framer-motion in Hero.jsx\n2. Use motion components\n3. System will auto-install framer-motion\n\nEXPECTED OUTPUT:\n<file path=\"src/components/Hero.jsx\">\nimport { motion } from 'framer-motion';\n// ... rest of Hero with motion animations\n</file>\n\n### Example 7: Remove Element\nUSER: \"Remove start deploying button\"\n\nCORRECT APPROACH:\n1. Search for \"start deploying\" in all component files\n2. Find it in Hero.jsx\n3. Edit ONLY Hero.jsx to remove that button\n\nINCORRECT APPROACH:\n- Creating a new file\n- Editing multiple files\n- Redesigning the entire Hero\n\nEXPECTED OUTPUT:\n<file path=\"src/components/Hero.jsx\">\n// Hero component with \"start deploying\" button removed\n// All other content preserved\n</file>\n\n### Example 8: Delete Section\nUSER: \"Delete the testimonials section\"\n\nCORRECT APPROACH:\n1. Find which file contains testimonials\n2. Remove only that section from the file\n3. Keep all other content intact\n\nINCORRECT APPROACH:\n- Deleting the entire file\n- Recreating the page without testimonials\n\n### Example 9: Change a Single Style (CRITICAL EXAMPLE)\nUSER: \"update the hero to bg blue\"\n\nCORRECT APPROACH:\n1. Identify the Hero component file: 'src/components/Hero.jsx'.\n2. Locate the outermost 'div' or container element.\n3. Find the existing background color class (e.g., 'bg-gray-900').\n4. Replace ONLY that class with 'bg-blue-500'.\n5. Return the entire file, completely unchanged except for that single class modification.\n\n**Original File Content (BEFORE):**\n<file path=\"src/components/Hero.jsx\">\nimport React from 'react';\n\nexport default function Hero() {\n  return (\n    <div className=\"w-full bg-gray-900 text-white py-20 px-4\">\n      <h1 className=\"text-5xl font-bold\">Welcome to the App</h1>\n      <p className=\"mt-4 text-lg\">This is the original hero section.</p>\n      <button className=\"mt-6 px-6 py-3 bg-blue-600 hover:bg-blue-700 rounded-lg\">\n        Get Started\n      </button>\n    </div>\n  );\n}\n</file>\n\n**Expected Output (AFTER):**\n<file path=\"src/components/Hero.jsx\">\nimport React from 'react';\n\nexport default function Hero() {\n  return (\n    <div className=\"w-full bg-blue-500 text-white py-20 px-4\">\n      <h1 className=\"text-5xl font-bold\">Welcome to the App</h1>\n      <p className=\"mt-4 text-lg\">This is the original hero section.</p>\n      <button className=\"mt-6 px-6 py-3 bg-blue-600 hover:bg-blue-700 rounded-lg\">\n        Get Started\n      </button>\n    </div>\n  );\n}\n</file>\n\nNOTICE: Everything remains EXACTLY the same except 'bg-gray-900' → 'bg-blue-500'. \n- The button still has bg-blue-600 (unchanged)\n- All text, structure, imports are identical\n- No reformatting, no \"improvements\", no cleanup\n\n## Key Principles\n\n1. **Minimal Changes**: Only modify what's necessary\n2. **Preserve Functionality**: Keep all existing features\n3. **Respect Structure**: Follow existing patterns\n4. **Target Precision**: Edit specific files, not everything\n5. **Context Awareness**: Use imports/exports to understand relationships\n\n## File Identification Patterns\n\n- \"header\" → src/components/Header.jsx\n- \"navigation\" → src/components/Nav.jsx or Header.jsx\n- \"footer\" → src/components/Footer.jsx\n- \"home page\" → src/App.jsx or src/pages/Home.jsx\n- \"styling\" → Component files (Tailwind) or index.css\n- \"routing\" → App.jsx or Router component\n- \"layout\" → Layout components or App.jsx\n\n## Edit Intent Classification\n\nUPDATE_COMPONENT: Modify existing component\n- Keywords: update, change, modify, edit, fix\n- Action: Edit single file\n\nADD_FEATURE: Add new functionality\n- Keywords: add, create, implement, build\n- Action: Create new files + minimal edits\n\nFIX_ISSUE: Resolve problems\n- Keywords: fix, resolve, debug, repair\n- Action: Targeted fixes\n\nUPDATE_STYLE: Change appearance\n- Keywords: style, color, theme, design\n- Action: Update Tailwind classes\n\nREFACTOR: Improve code quality\n- Keywords: refactor, clean, optimize\n- Action: Restructure without changing behavior\n`;\n\nexport function getEditExamplesPrompt(): string {\n  return EDIT_EXAMPLES;\n}\n\nexport function getComponentPatternPrompt(fileStructure: string): string {\n  return `\n## Current Project Structure\n\n${fileStructure}\n\n## Component Naming Patterns\nBased on your file structure, here are the patterns to follow:\n\n1. Component files are in: src/components/\n2. Page components might be in: src/pages/ or src/components/\n3. Utility functions are in: src/utils/ or src/lib/\n4. Styles use Tailwind classes inline\n5. Main app entry is: src/App.jsx\n\nWhen the user mentions a component by name, look for:\n- Exact matches first (Header → Header.jsx)\n- Partial matches (nav → Navigation.jsx, NavBar.jsx)\n- Semantic matches (top bar → Header.jsx)\n`;\n}"
  },
  {
    "path": "lib/edit-intent-analyzer.ts",
    "content": "import { FileManifest, EditType, EditIntent, IntentPattern } from '@/types/file-manifest';\n\n/**\n * Analyze user prompts to determine edit intent and select relevant files\n */\nexport function analyzeEditIntent(\n  prompt: string,\n  manifest: FileManifest\n): EditIntent {\n  const lowerPrompt = prompt.toLowerCase();\n  \n  // Define intent patterns\n  const patterns: IntentPattern[] = [\n    {\n      patterns: [\n        /update\\s+(the\\s+)?(\\w+)\\s+(component|section|page)/i,\n        /change\\s+(the\\s+)?(\\w+)/i,\n        /modify\\s+(the\\s+)?(\\w+)/i,\n        /edit\\s+(the\\s+)?(\\w+)/i,\n        /fix\\s+(the\\s+)?(\\w+)\\s+(styling|style|css|layout)/i,\n        /remove\\s+.*\\s+(button|link|text|element|section)/i,\n        /delete\\s+.*\\s+(button|link|text|element|section)/i,\n        /hide\\s+.*\\s+(button|link|text|element|section)/i,\n      ],\n      type: EditType.UPDATE_COMPONENT,\n      fileResolver: (p, m) => findComponentByContent(p, m),\n    },\n    {\n      patterns: [\n        /add\\s+(a\\s+)?new\\s+(\\w+)\\s+(page|section|feature|component)/i,\n        /create\\s+(a\\s+)?(\\w+)\\s+(page|section|feature|component)/i,\n        /implement\\s+(a\\s+)?(\\w+)\\s+(page|section|feature)/i,\n        /build\\s+(a\\s+)?(\\w+)\\s+(page|section|feature)/i,\n        /add\\s+(\\w+)\\s+to\\s+(?:the\\s+)?(\\w+)/i,\n        /add\\s+(?:a\\s+)?(\\w+)\\s+(?:component|section)/i,\n        /include\\s+(?:a\\s+)?(\\w+)/i,\n      ],\n      type: EditType.ADD_FEATURE,\n      fileResolver: (p, m) => findFeatureInsertionPoints(p, m),\n    },\n    {\n      patterns: [\n        /fix\\s+(the\\s+)?(\\w+|\\w+\\s+\\w+)(?!\\s+styling|\\s+style)/i,\n        /resolve\\s+(the\\s+)?error/i,\n        /debug\\s+(the\\s+)?(\\w+)/i,\n        /repair\\s+(the\\s+)?(\\w+)/i,\n      ],\n      type: EditType.FIX_ISSUE,\n      fileResolver: (p, m) => findProblemFiles(p, m),\n    },\n    {\n      patterns: [\n        /change\\s+(the\\s+)?(color|theme|style|styling|css)/i,\n        /update\\s+(the\\s+)?(color|theme|style|styling|css)/i,\n        /make\\s+it\\s+(dark|light|blue|red|green)/i,\n        /style\\s+(the\\s+)?(\\w+)/i,\n      ],\n      type: EditType.UPDATE_STYLE,\n      fileResolver: (p, m) => findStyleFiles(p, m),\n    },\n    {\n      patterns: [\n        /refactor\\s+(the\\s+)?(\\w+)/i,\n        /clean\\s+up\\s+(the\\s+)?code/i,\n        /reorganize\\s+(the\\s+)?(\\w+)/i,\n        /optimize\\s+(the\\s+)?(\\w+)/i,\n      ],\n      type: EditType.REFACTOR,\n      fileResolver: (p, m) => findRefactorTargets(p, m),\n    },\n    {\n      patterns: [\n        /start\\s+over/i,\n        /recreate\\s+everything/i,\n        /rebuild\\s+(the\\s+)?app/i,\n        /new\\s+app/i,\n        /from\\s+scratch/i,\n      ],\n      type: EditType.FULL_REBUILD,\n      fileResolver: (p, m) => [m.entryPoint],\n    },\n    {\n      patterns: [\n        /install\\s+(\\w+)/i,\n        /add\\s+(\\w+)\\s+(package|library|dependency)/i,\n        /use\\s+(\\w+)\\s+(library|framework)/i,\n      ],\n      type: EditType.ADD_DEPENDENCY,\n      fileResolver: (p, m) => findPackageFiles(m),\n    },\n  ];\n  \n  // Find matching pattern\n  for (const pattern of patterns) {\n    for (const regex of pattern.patterns) {\n      if (regex.test(lowerPrompt)) {\n        const targetFiles = pattern.fileResolver(prompt, manifest);\n        const suggestedContext = getSuggestedContext(targetFiles, manifest);\n        \n        return {\n          type: pattern.type,\n          targetFiles,\n          confidence: calculateConfidence(prompt, pattern, targetFiles),\n          description: generateDescription(pattern.type, prompt, targetFiles),\n          suggestedContext,\n        };\n      }\n    }\n  }\n  \n  // Default to component update if no pattern matches\n  return {\n    type: EditType.UPDATE_COMPONENT,\n    targetFiles: [manifest.entryPoint],\n    confidence: 0.3,\n    description: 'General update to application',\n    suggestedContext: [],\n  };\n}\n\n/**\n * Find component files mentioned in the prompt\n */\nfunction findComponentFiles(prompt: string, manifest: FileManifest): string[] {\n  const files: string[] = [];\n  const lowerPrompt = prompt.toLowerCase();\n  \n  // Extract component names from prompt\n  const componentWords = extractComponentNames(prompt);\n  console.log('[findComponentFiles] Extracted words:', componentWords);\n  \n  // First pass: Look for exact component file matches\n  for (const [path, fileInfo] of Object.entries(manifest.files)) {\n    // Check if file name or component name matches\n    const fileName = path.split('/').pop()?.toLowerCase() || '';\n    const componentName = fileInfo.componentInfo?.name.toLowerCase();\n    \n    for (const word of componentWords) {\n      if (fileName.includes(word) || componentName?.includes(word)) {\n        console.log(`[findComponentFiles] Match found: word=\"${word}\" in file=\"${path}\"`);\n        files.push(path);\n        break; // Stop after first match to avoid duplicates\n      }\n    }\n  }\n  \n  // If no specific component found, check for common UI elements\n  if (files.length === 0) {\n    const uiElements = ['header', 'footer', 'nav', 'sidebar', 'button', 'card', 'modal', 'hero', 'banner', 'about', 'services', 'features', 'testimonials', 'gallery', 'contact', 'team', 'pricing'];\n    for (const element of uiElements) {\n      if (lowerPrompt.includes(element)) {\n        // Look for exact component file matches first\n        for (const [path, fileInfo] of Object.entries(manifest.files)) {\n          const fileName = path.split('/').pop()?.toLowerCase() || '';\n          // Only match if the filename contains the element name\n          if (fileName.includes(element + '.') || fileName === element) {\n            files.push(path);\n            console.log(`[findComponentFiles] UI element match: element=\"${element}\" in file=\"${path}\"`);\n            return files; // Return immediately with just this file\n          }\n        }\n        \n        // If no exact file match, look for the element in file names (but be more selective)\n        for (const [path, fileInfo] of Object.entries(manifest.files)) {\n          const fileName = path.split('/').pop()?.toLowerCase() || '';\n          if (fileName.includes(element)) {\n            files.push(path);\n            console.log(`[findComponentFiles] UI element partial match: element=\"${element}\" in file=\"${path}\"`);\n            return files; // Return immediately with just this file\n          }\n        }\n      }\n    }\n  }\n  \n  // Limit results to most specific matches\n  if (files.length > 1) {\n    console.log(`[findComponentFiles] Multiple files found (${files.length}), limiting to first match`);\n    return [files[0]]; // Only return the first match\n  }\n  \n  return files.length > 0 ? files : [manifest.entryPoint];\n}\n\n/**\n * Find where to add new features\n */\nfunction findFeatureInsertionPoints(prompt: string, manifest: FileManifest): string[] {\n  const files: string[] = [];\n  const lowerPrompt = prompt.toLowerCase();\n  \n  // For new pages, we need routing files and layout\n  if (lowerPrompt.includes('page')) {\n    // Find router configuration\n    for (const [path, fileInfo] of Object.entries(manifest.files)) {\n      if (fileInfo.content.includes('Route') || \n          fileInfo.content.includes('createBrowserRouter') ||\n          path.includes('router') ||\n          path.includes('routes')) {\n        files.push(path);\n      }\n    }\n    \n    // Also include App.jsx for navigation updates\n    if (manifest.entryPoint) {\n      files.push(manifest.entryPoint);\n    }\n  }\n  \n  // For new components, find the most appropriate parent\n  if (lowerPrompt.includes('component') || lowerPrompt.includes('section') || \n      lowerPrompt.includes('add') || lowerPrompt.includes('create')) {\n    // Extract where to add it (e.g., \"to the footer\", \"in header\")\n    const locationMatch = prompt.match(/(?:in|to|on|inside)\\s+(?:the\\s+)?(\\w+)/i);\n    if (locationMatch) {\n      const location = locationMatch[1];\n      const parentFiles = findComponentFiles(location, manifest);\n      files.push(...parentFiles);\n      console.log(`[findFeatureInsertionPoints] Adding to ${location}, parent files:`, parentFiles);\n    } else {\n      // Look for component mentions in the prompt\n      const componentWords = extractComponentNames(prompt);\n      for (const word of componentWords) {\n        const relatedFiles = findComponentFiles(word, manifest);\n        if (relatedFiles.length > 0 && relatedFiles[0] !== manifest.entryPoint) {\n          files.push(...relatedFiles);\n        }\n      }\n      \n      // Default to App.jsx if no specific location found\n      if (files.length === 0) {\n        files.push(manifest.entryPoint);\n      }\n    }\n  }\n  \n  // Remove duplicates\n  return [...new Set(files)];\n}\n\n/**\n * Find files that might have problems\n */\nfunction findProblemFiles(prompt: string, manifest: FileManifest): string[] {\n  const files: string[] = [];\n  \n  // Look for error keywords\n  if (prompt.match(/error|bug|issue|problem|broken|not working/i)) {\n    // Check recently modified files first\n    const sortedFiles = Object.entries(manifest.files)\n      .sort(([, a], [, b]) => b.lastModified - a.lastModified)\n      .slice(0, 5);\n    \n    files.push(...sortedFiles.map(([path]) => path));\n  }\n  \n  // Also check for specific component mentions\n  const componentFiles = findComponentFiles(prompt, manifest);\n  files.push(...componentFiles);\n  \n  return [...new Set(files)];\n}\n\n/**\n * Find style-related files\n */\nfunction findStyleFiles(prompt: string, manifest: FileManifest): string[] {\n  const files: string[] = [];\n  \n  // Add all CSS files\n  files.push(...manifest.styleFiles);\n  \n  // Check for Tailwind config\n  const tailwindConfig = Object.keys(manifest.files).find(\n    path => path.includes('tailwind.config')\n  );\n  if (tailwindConfig) files.push(tailwindConfig);\n  \n  // If specific component styling mentioned, include that component\n  const componentFiles = findComponentFiles(prompt, manifest);\n  files.push(...componentFiles);\n  \n  return files;\n}\n\n/**\n * Find files to refactor\n */\nfunction findRefactorTargets(prompt: string, manifest: FileManifest): string[] {\n  // Similar to findComponentFiles but broader\n  return findComponentFiles(prompt, manifest);\n}\n\n/**\n * Find package configuration files\n */\nfunction findPackageFiles(manifest: FileManifest): string[] {\n  const files: string[] = [];\n  \n  for (const path of Object.keys(manifest.files)) {\n    if (path.endsWith('package.json') || \n        path.endsWith('vite.config.js') ||\n        path.endsWith('tsconfig.json')) {\n      files.push(path);\n    }\n  }\n  \n  return files;\n}\n\n/**\n * Find component by searching for content mentioned in the prompt\n */\nfunction findComponentByContent(prompt: string, manifest: FileManifest): string[] {\n  const files: string[] = [];\n  const lowerPrompt = prompt.toLowerCase();\n  \n  console.log('[findComponentByContent] Searching for content in prompt:', prompt);\n  \n  // Extract quoted strings or specific button/link text\n  const quotedStrings = prompt.match(/[\"']([^\"']+)[\"']/g) || [];\n  const searchTerms: string[] = quotedStrings.map(s => s.replace(/[\"']/g, ''));\n  \n  // Also look for specific terms after 'remove', 'delete', 'hide'\n  const actionMatch = prompt.match(/(?:remove|delete|hide)\\s+(?:the\\s+)?(.+?)(?:\\s+button|\\s+link|\\s+text|\\s+element|\\s+section|$)/i);\n  if (actionMatch) {\n    searchTerms.push(actionMatch[1].trim());\n  }\n  \n  console.log('[findComponentByContent] Search terms:', searchTerms);\n  \n  // If we have search terms, look for them in file contents\n  if (searchTerms.length > 0) {\n    for (const [path, fileInfo] of Object.entries(manifest.files)) {\n      // Only search in component files\n      if (!path.includes('.jsx') && !path.includes('.tsx')) continue;\n      \n      const content = fileInfo.content.toLowerCase();\n      \n      for (const term of searchTerms) {\n        if (content.includes(term.toLowerCase())) {\n          console.log(`[findComponentByContent] Found \"${term}\" in ${path}`);\n          files.push(path);\n          break; // Only add file once\n        }\n      }\n    }\n  }\n  \n  // If no files found by content, fall back to component name search\n  if (files.length === 0) {\n    console.log('[findComponentByContent] No files found by content, falling back to component name search');\n    return findComponentFiles(prompt, manifest);\n  }\n  \n  // Return only the first match to avoid editing multiple files\n  return [files[0]];\n}\n\n/**\n * Extract component names from prompt\n */\nfunction extractComponentNames(prompt: string): string[] {\n  const words: string[] = [];\n  \n  // Remove common words but keep component-related words\n  const cleanPrompt = prompt\n    .replace(/\\b(the|a|an|in|on|to|from|update|change|modify|edit|fix|make)\\b/gi, '')\n    .toLowerCase();\n  \n  // Extract potential component names (words that might be components)\n  const matches = cleanPrompt.match(/\\b\\w+\\b/g) || [];\n  \n  for (const match of matches) {\n    if (match.length > 2) { // Skip very short words\n      words.push(match);\n    }\n  }\n  \n  return words;\n}\n\n/**\n * Get additional files for context - returns ALL files for comprehensive context\n */\nfunction getSuggestedContext(\n  targetFiles: string[],\n  manifest: FileManifest\n): string[] {\n  // Return all files except the ones being edited\n  const allFiles = Object.keys(manifest.files);\n  return allFiles.filter(file => !targetFiles.includes(file));\n}\n\n/**\n * Resolve import path to actual file path\n */\nfunction resolveImportPath(\n  fromFile: string,\n  importPath: string,\n  manifest: FileManifest\n): string | null {\n  // Handle relative imports\n  if (importPath.startsWith('./') || importPath.startsWith('../')) {\n    const fromDir = fromFile.substring(0, fromFile.lastIndexOf('/'));\n    const resolved = resolveRelativePath(fromDir, importPath);\n    \n    // Try with different extensions\n    const extensions = ['.jsx', '.js', '.tsx', '.ts', ''];\n    for (const ext of extensions) {\n      const fullPath = resolved + ext;\n      if (manifest.files[fullPath]) {\n        return fullPath;\n      }\n      \n      // Try index file\n      const indexPath = resolved + '/index' + ext;\n      if (manifest.files[indexPath]) {\n        return indexPath;\n      }\n    }\n  }\n  \n  // Handle @/ alias (common in Vite projects)\n  if (importPath.startsWith('@/')) {\n    const srcPath = importPath.replace('@/', '/home/user/app/src/');\n    return resolveImportPath(fromFile, srcPath, manifest);\n  }\n  \n  return null;\n}\n\n/**\n * Resolve relative path\n */\nfunction resolveRelativePath(fromDir: string, relativePath: string): string {\n  const parts = fromDir.split('/');\n  const relParts = relativePath.split('/');\n  \n  for (const part of relParts) {\n    if (part === '..') {\n      parts.pop();\n    } else if (part !== '.') {\n      parts.push(part);\n    }\n  }\n  \n  return parts.join('/');\n}\n\n/**\n * Calculate confidence score\n */\nfunction calculateConfidence(\n  prompt: string,\n  pattern: IntentPattern,\n  targetFiles: string[]\n): number {\n  let confidence = 0.5; // Base confidence\n  \n  // Higher confidence if we found specific files\n  if (targetFiles.length > 0 && targetFiles[0] !== '') {\n    confidence += 0.2;\n  }\n  \n  // Higher confidence for more specific prompts\n  if (prompt.split(' ').length > 5) {\n    confidence += 0.1;\n  }\n  \n  // Higher confidence for exact pattern matches\n  for (const regex of pattern.patterns) {\n    if (regex.test(prompt)) {\n      confidence += 0.2;\n      break;\n    }\n  }\n  \n  return Math.min(confidence, 1.0);\n}\n\n/**\n * Generate human-readable description\n */\nfunction generateDescription(\n  type: EditType,\n  prompt: string,\n  targetFiles: string[]\n): string {\n  const fileNames = targetFiles.map(f => f.split('/').pop()).join(', ');\n  \n  switch (type) {\n    case EditType.UPDATE_COMPONENT:\n      return `Updating component(s): ${fileNames}`;\n    case EditType.ADD_FEATURE:\n      return `Adding new feature to: ${fileNames}`;\n    case EditType.FIX_ISSUE:\n      return `Fixing issue in: ${fileNames}`;\n    case EditType.UPDATE_STYLE:\n      return `Updating styles in: ${fileNames}`;\n    case EditType.REFACTOR:\n      return `Refactoring: ${fileNames}`;\n    case EditType.FULL_REBUILD:\n      return 'Rebuilding entire application';\n    case EditType.ADD_DEPENDENCY:\n      return 'Adding new dependency';\n    default:\n      return `Editing: ${fileNames}`;\n  }\n}"
  },
  {
    "path": "lib/file-parser.ts",
    "content": "import { FileInfo, ImportInfo, ComponentInfo } from '@/types/file-manifest';\n\n/**\n * Parse a JavaScript/JSX file to extract imports, exports, and component info\n */\nexport function parseJavaScriptFile(content: string, filePath: string): Partial<FileInfo> {\n  const imports = extractImports(content);\n  const exports = extractExports(content);\n  const componentInfo = extractComponentInfo(content, filePath);\n  const fileType = determineFileType(filePath, content);\n  \n  return {\n    imports,\n    exports,\n    componentInfo,\n    type: fileType,\n  };\n}\n\n/**\n * Extract import statements from file content\n */\nfunction extractImports(content: string): ImportInfo[] {\n  const imports: ImportInfo[] = [];\n  \n  // Match import statements\n  const importRegex = /import\\s+(?:(.+?)\\s+from\\s+)?['\"](.+?)['\"]/g;\n  const matches = content.matchAll(importRegex);\n  \n  for (const match of matches) {\n    const [, importClause, source] = match;\n    const importInfo: ImportInfo = {\n      source,\n      imports: [],\n      isLocal: source.startsWith('./') || source.startsWith('../') || source.startsWith('@/'),\n    };\n    \n    if (importClause) {\n      // Handle default import\n      const defaultMatch = importClause.match(/^(\\w+)(?:,|$)/);\n      if (defaultMatch) {\n        importInfo.defaultImport = defaultMatch[1];\n      }\n      \n      // Handle named imports\n      const namedMatch = importClause.match(/\\{([^}]+)\\}/);\n      if (namedMatch) {\n        importInfo.imports = namedMatch[1]\n          .split(',')\n          .map(imp => imp.trim())\n          .map(imp => imp.split(/\\s+as\\s+/)[0].trim());\n      }\n    }\n    \n    imports.push(importInfo);\n  }\n  \n  return imports;\n}\n\n/**\n * Extract export statements from file content\n */\nfunction extractExports(content: string): string[] {\n  const exports: string[] = [];\n  \n  // Match default export\n  if (/export\\s+default\\s+/m.test(content)) {\n    // Try to find the name of the default export\n    const defaultExportMatch = content.match(/export\\s+default\\s+(?:function\\s+)?(\\w+)/);\n    if (defaultExportMatch) {\n      exports.push(`default:${defaultExportMatch[1]}`);\n    } else {\n      exports.push('default');\n    }\n  }\n  \n  // Match named exports\n  const namedExportRegex = /export\\s+(?:const|let|var|function|class)\\s+(\\w+)/g;\n  const namedMatches = content.matchAll(namedExportRegex);\n  \n  for (const match of namedMatches) {\n    exports.push(match[1]);\n  }\n  \n  // Match export { ... } statements\n  const exportBlockRegex = /export\\s+\\{([^}]+)\\}/g;\n  const blockMatches = content.matchAll(exportBlockRegex);\n  \n  for (const match of blockMatches) {\n    const names = match[1]\n      .split(',')\n      .map(exp => exp.trim())\n      .map(exp => exp.split(/\\s+as\\s+/)[0].trim());\n    exports.push(...names);\n  }\n  \n  return exports;\n}\n\n/**\n * Extract React component information\n */\nfunction extractComponentInfo(content: string, filePath: string): ComponentInfo | undefined {\n  // Check if this is likely a React component\n  const hasJSX = /<[A-Z]\\w*|<[a-z]+\\s+[^>]*\\/?>/.test(content);\n  if (!hasJSX && !content.includes('React')) return undefined;\n  \n  // Try to find component name\n  let componentName = '';\n  \n  // Check for function component\n  const funcComponentMatch = content.match(/(?:export\\s+)?(?:default\\s+)?function\\s+([A-Z]\\w*)\\s*\\(/);\n  if (funcComponentMatch) {\n    componentName = funcComponentMatch[1];\n  } else {\n    // Check for arrow function component\n    const arrowComponentMatch = content.match(/(?:export\\s+)?(?:default\\s+)?(?:const|let)\\s+([A-Z]\\w*)\\s*=\\s*(?:\\([^)]*\\)|[^=])*=>/);\n    if (arrowComponentMatch) {\n      componentName = arrowComponentMatch[1];\n    }\n  }\n  \n  // If no component name found, try to get from filename\n  if (!componentName) {\n    const fileName = filePath.split('/').pop()?.replace(/\\.(jsx?|tsx?)$/, '');\n    if (fileName && /^[A-Z]/.test(fileName)) {\n      componentName = fileName;\n    }\n  }\n  \n  if (!componentName) return undefined;\n  \n  // Extract hooks used\n  const hooks: string[] = [];\n  const hookRegex = /use[A-Z]\\w*/g;\n  const hookMatches = content.matchAll(hookRegex);\n  for (const match of hookMatches) {\n    if (!hooks.includes(match[0])) {\n      hooks.push(match[0]);\n    }\n  }\n  \n  // Check if component has state\n  const hasState = hooks.includes('useState') || hooks.includes('useReducer');\n  \n  // Extract child components (rough approximation)\n  const childComponents: string[] = [];\n  const componentRegex = /<([A-Z]\\w*)[^>]*(?:\\/?>|>)/g;\n  const componentMatches = content.matchAll(componentRegex);\n  \n  for (const match of componentMatches) {\n    const comp = match[1];\n    if (!childComponents.includes(comp) && comp !== componentName) {\n      childComponents.push(comp);\n    }\n  }\n  \n  return {\n    name: componentName,\n    hooks,\n    hasState,\n    childComponents,\n  };\n}\n\n/**\n * Determine file type based on path and content\n */\nfunction determineFileType(\n  filePath: string,\n  content: string\n): FileInfo['type'] {\n  const fileName = filePath.split('/').pop()?.toLowerCase() || '';\n  const dirPath = filePath.toLowerCase();\n  \n  // Style files\n  if (fileName.endsWith('.css')) return 'style';\n  \n  // Config files\n  if (fileName.includes('config') || \n      fileName === 'vite.config.js' ||\n      fileName === 'tailwind.config.js' ||\n      fileName === 'postcss.config.js') {\n    return 'config';\n  }\n  \n  // Hook files\n  if (dirPath.includes('/hooks/') || fileName.startsWith('use')) {\n    return 'hook';\n  }\n  \n  // Context files\n  if (dirPath.includes('/context/') || fileName.includes('context')) {\n    return 'context';\n  }\n  \n  // Layout components\n  if (fileName.includes('layout') || content.includes('children')) {\n    return 'layout';\n  }\n  \n  // Page components (in pages directory or have routing)\n  if (dirPath.includes('/pages/') || \n      content.includes('useRouter') ||\n      content.includes('useParams')) {\n    return 'page';\n  }\n  \n  // Utility files\n  if (dirPath.includes('/utils/') || \n      dirPath.includes('/lib/') ||\n      !content.includes('export default')) {\n    return 'utility';\n  }\n  \n  // Default to component\n  return 'component';\n}\n\n/**\n * Build component dependency tree\n */\nexport function buildComponentTree(files: Record<string, FileInfo>) {\n  const tree: Record<string, {\n    file: string;\n    imports: string[];\n    importedBy: string[];\n    type: 'page' | 'layout' | 'component';\n  }> = {};\n  \n  // First pass: collect all components\n  for (const [path, fileInfo] of Object.entries(files)) {\n    if (fileInfo.componentInfo) {\n      const componentName = fileInfo.componentInfo.name;\n      tree[componentName] = {\n        file: path,\n        imports: [],\n        importedBy: [],\n        type: fileInfo.type === 'page' ? 'page' : \n              fileInfo.type === 'layout' ? 'layout' : 'component',\n      };\n    }\n  }\n  \n  // Second pass: build relationships\n  for (const [path, fileInfo] of Object.entries(files)) {\n    if (fileInfo.componentInfo && fileInfo.imports) {\n      const componentName = fileInfo.componentInfo.name;\n      \n      // Find imported components\n      for (const imp of fileInfo.imports) {\n        if (imp.isLocal && imp.defaultImport) {\n          // Check if this import is a component we know about\n          if (tree[imp.defaultImport]) {\n            tree[componentName].imports.push(imp.defaultImport);\n            tree[imp.defaultImport].importedBy.push(componentName);\n          }\n        }\n      }\n    }\n  }\n  \n  return tree;\n}"
  },
  {
    "path": "lib/file-search-executor.ts",
    "content": "/**\n * Agentic file search executor\n * Executes search plans to find exact code locations before editing\n */\n\nexport interface SearchResult {\n  filePath: string;\n  lineNumber: number;\n  lineContent: string;\n  matchedTerm?: string;\n  matchedPattern?: string;\n  contextBefore: string[];\n  contextAfter: string[];\n  confidence: 'high' | 'medium' | 'low';\n}\n\nexport interface SearchPlan {\n  editType: string;\n  reasoning: string;\n  searchTerms: string[];\n  regexPatterns?: string[];\n  fileTypesToSearch?: string[];\n  expectedMatches?: number;\n  fallbackSearch?: {\n    terms: string[];\n    patterns?: string[];\n  };\n}\n\nexport interface SearchExecutionResult {\n  success: boolean;\n  results: SearchResult[];\n  filesSearched: number;\n  executionTime: number;\n  usedFallback: boolean;\n  error?: string;\n}\n\n/**\n * Execute a search plan against the codebase\n */\nexport function executeSearchPlan(\n  searchPlan: SearchPlan,\n  files: Record<string, string>\n): SearchExecutionResult {\n  const startTime = Date.now();\n  const results: SearchResult[] = [];\n  let filesSearched = 0;\n  let usedFallback = false;\n\n  const { \n    searchTerms = [], \n    regexPatterns = [], \n    fileTypesToSearch = ['.jsx', '.tsx', '.js', '.ts'],\n    fallbackSearch \n  } = searchPlan;\n\n  // Helper function to perform search\n  const performSearch = (terms: string[], patterns?: string[]): SearchResult[] => {\n    const searchResults: SearchResult[] = [];\n\n    for (const [filePath, content] of Object.entries(files)) {\n      // Skip files that don't match the desired extensions\n      const shouldSearch = fileTypesToSearch.some(ext => filePath.endsWith(ext));\n      if (!shouldSearch) continue;\n\n      filesSearched++;\n      const lines = content.split('\\n');\n\n      for (let i = 0; i < lines.length; i++) {\n        const line = lines[i];\n        let matched = false;\n        let matchedTerm: string | undefined;\n        let matchedPattern: string | undefined;\n\n        // Check simple search terms (case-insensitive)\n        for (const term of terms) {\n          if (line.toLowerCase().includes(term.toLowerCase())) {\n            matched = true;\n            matchedTerm = term;\n            break;\n          }\n        }\n\n        // Check regex patterns if no term match\n        if (!matched && patterns) {\n          for (const pattern of patterns) {\n            try {\n              const regex = new RegExp(pattern, 'i');\n              if (regex.test(line)) {\n                matched = true;\n                matchedPattern = pattern;\n                break;\n              }\n            } catch {\n              console.warn(`[file-search] Invalid regex pattern: ${pattern}`);\n            }\n          }\n        }\n\n        if (matched) {\n          // Get context lines (3 before, 3 after)\n          const contextBefore = lines.slice(Math.max(0, i - 3), i);\n          const contextAfter = lines.slice(i + 1, Math.min(lines.length, i + 4));\n\n          // Determine confidence based on match type and context\n          let confidence: 'high' | 'medium' | 'low' = 'medium';\n          \n          // High confidence if it's an exact match or in a component definition\n          if (matchedTerm && line.includes(matchedTerm)) {\n            confidence = 'high';\n          } else if (line.includes('function') || line.includes('export') || line.includes('return')) {\n            confidence = 'high';\n          } else if (matchedPattern) {\n            confidence = 'medium';\n          }\n\n          searchResults.push({\n            filePath,\n            lineNumber: i + 1,\n            lineContent: line.trim(),\n            matchedTerm,\n            matchedPattern,\n            contextBefore,\n            contextAfter,\n            confidence\n          });\n        }\n      }\n    }\n\n    return searchResults;\n  };\n\n  // Execute primary search\n  results.push(...performSearch(searchTerms, regexPatterns));\n\n  // If no results and we have a fallback, try it\n  if (results.length === 0 && fallbackSearch) {\n    console.log('[file-search] No results from primary search, trying fallback...');\n    usedFallback = true;\n    results.push(...performSearch(\n      fallbackSearch.terms,\n      fallbackSearch.patterns\n    ));\n  }\n\n  const executionTime = Date.now() - startTime;\n\n  // Sort results by confidence\n  results.sort((a, b) => {\n    const confidenceOrder = { high: 3, medium: 2, low: 1 };\n    return confidenceOrder[b.confidence] - confidenceOrder[a.confidence];\n  });\n\n  return {\n    success: results.length > 0,\n    results,\n    filesSearched,\n    executionTime,\n    usedFallback,\n    error: results.length === 0 ? 'No matches found for search terms' : undefined\n  };\n}\n\n/**\n * Format search results for AI consumption\n */\nexport function formatSearchResultsForAI(results: SearchResult[]): string {\n  if (results.length === 0) {\n    return 'No search results found.';\n  }\n\n  const sections: string[] = [];\n  \n  sections.push('🔍 SEARCH RESULTS - EXACT LOCATIONS FOUND:\\n');\n  \n  // Group by file for better readability\n  const resultsByFile = new Map<string, SearchResult[]>();\n  for (const result of results) {\n    if (!resultsByFile.has(result.filePath)) {\n      resultsByFile.set(result.filePath, []);\n    }\n    resultsByFile.get(result.filePath)!.push(result);\n  }\n\n  for (const [filePath, fileResults] of resultsByFile) {\n    sections.push(`\\n📄 FILE: ${filePath}`);\n    \n    for (const result of fileResults) {\n      sections.push(`\\n  📍 Line ${result.lineNumber} (${result.confidence} confidence)`);\n      \n      if (result.matchedTerm) {\n        sections.push(`     Matched: \"${result.matchedTerm}\"`);\n      } else if (result.matchedPattern) {\n        sections.push(`     Pattern: ${result.matchedPattern}`);\n      }\n      \n      sections.push(`     Code: ${result.lineContent}`);\n      \n      if (result.contextBefore.length > 0 || result.contextAfter.length > 0) {\n        sections.push(`     Context:`);\n        for (const line of result.contextBefore) {\n          sections.push(`       ${line}`);\n        }\n        sections.push(`     → ${result.lineContent}`);\n        for (const line of result.contextAfter) {\n          sections.push(`       ${line}`);\n        }\n      }\n    }\n  }\n\n  sections.push('\\n\\n🎯 RECOMMENDED ACTION:');\n  \n  // Recommend the highest confidence result\n  const bestResult = results[0];\n  sections.push(`Edit ${bestResult.filePath} at line ${bestResult.lineNumber}`);\n\n  return sections.join('\\n');\n}\n\n/**\n * Select the best file to edit based on search results\n */\nexport function selectTargetFile(\n  results: SearchResult[],\n  editType: string\n): { filePath: string; lineNumber: number; reason: string } | null {\n  if (results.length === 0) return null;\n\n  // For style updates, prefer components over CSS files\n  if (editType === 'UPDATE_STYLE') {\n    const componentResult = results.find(r => \n      r.filePath.endsWith('.jsx') || r.filePath.endsWith('.tsx')\n    );\n    if (componentResult) {\n      return {\n        filePath: componentResult.filePath,\n        lineNumber: componentResult.lineNumber,\n        reason: 'Found component with style to update'\n      };\n    }\n  }\n\n  // For remove operations, find the component that renders the element\n  if (editType === 'REMOVE_ELEMENT') {\n    const renderResult = results.find(r => \n      r.lineContent.includes('return') || \n      r.lineContent.includes('<')\n    );\n    if (renderResult) {\n      return {\n        filePath: renderResult.filePath,\n        lineNumber: renderResult.lineNumber,\n        reason: 'Found element to remove in render output'\n      };\n    }\n  }\n\n  // Default: use highest confidence result\n  const best = results[0];\n  return {\n    filePath: best.filePath,\n    lineNumber: best.lineNumber,\n    reason: `Highest confidence match (${best.confidence})`\n  };\n}"
  },
  {
    "path": "lib/icons.ts",
    "content": "// Centralized icon exports to avoid Turbopack chunk loading issues\n// This file pre-loads all icons to prevent dynamic import errors\n\nexport { \n  FiFile, \n  FiChevronRight, \n  FiChevronDown,\n  FiGithub \n} from 'react-icons/fi';\n\nexport { \n  BsFolderFill, \n  BsFolder2Open \n} from 'react-icons/bs';\n\nexport { \n  SiJavascript, \n  SiReact, \n  SiCss3, \n  SiJson \n} from 'react-icons/si';"
  },
  {
    "path": "lib/morph-fast-apply.ts",
    "content": "// Using direct fetch to Morph's OpenAI-compatible API to avoid SDK type issues\n\nexport interface MorphEditBlock {\n  targetFile: string;\n  instructions: string;\n  update: string;\n}\n\nexport interface MorphApplyResult {\n  success: boolean;\n  normalizedPath?: string;\n  mergedCode?: string;\n  error?: string;\n}\n\n// Normalize project-relative paths to sandbox layout\nexport function normalizeProjectPath(inputPath: string): { normalizedPath: string; fullPath: string } {\n  let normalizedPath = inputPath.trim();\n  if (normalizedPath.startsWith('/')) normalizedPath = normalizedPath.slice(1);\n\n  const configFiles = new Set([\n    'tailwind.config.js',\n    'vite.config.js',\n    'package.json',\n    'package-lock.json',\n    'tsconfig.json',\n    'postcss.config.js'\n  ]);\n\n  const fileName = normalizedPath.split('/').pop() || '';\n  if (!normalizedPath.startsWith('src/') &&\n      !normalizedPath.startsWith('public/') &&\n      normalizedPath !== 'index.html' &&\n      !configFiles.has(fileName)) {\n    normalizedPath = 'src/' + normalizedPath;\n  }\n\n  const fullPath = `/home/user/app/${normalizedPath}`;\n  return { normalizedPath, fullPath };\n}\n\nasync function morphChatCompletionsCreate(payload: any) {\n  if (!process.env.MORPH_API_KEY) throw new Error('MORPH_API_KEY is not set');\n  const res = await fetch('https://api.morphllm.com/v1/chat/completions', {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'Authorization': `Bearer ${process.env.MORPH_API_KEY}`\n    },\n    body: JSON.stringify(payload)\n  });\n  if (!res.ok) {\n    const text = await res.text();\n    throw new Error(`Morph API error ${res.status}: ${text}`);\n  }\n  return res.json();\n}\n\n// Parse <edit> blocks from LLM output\nexport function parseMorphEdits(text: string): MorphEditBlock[] {\n  const edits: MorphEditBlock[] = [];\n  const editRegex = /<edit\\s+target_file=\"([^\"]+)\">([\\s\\S]*?)<\\/edit>/g;\n  let match: RegExpExecArray | null;\n  while ((match = editRegex.exec(text)) !== null) {\n    const targetFile = match[1].trim();\n    const inner = match[2];\n    const instrMatch = inner.match(/<instructions>([\\s\\S]*?)<\\/instructions>/);\n    const updateMatch = inner.match(/<update>([\\s\\S]*?)<\\/update>/);\n    const instructions = instrMatch ? instrMatch[1].trim() : '';\n    const update = updateMatch ? updateMatch[1].trim() : '';\n    if (targetFile && update) {\n      edits.push({ targetFile, instructions, update });\n    }\n  }\n  return edits;\n}\n\n// Read a file from sandbox: prefers cache, then sandbox.files, then commands.run(\"cat ...\")\nasync function readFileFromSandbox(sandbox: any, normalizedPath: string, fullPath: string): Promise<string> {\n  // Try backend cache first\n  if ((global as any).sandboxState?.fileCache?.files?.[normalizedPath]?.content) {\n    return (global as any).sandboxState.fileCache.files[normalizedPath].content as string;\n  }\n\n  // Try E2B files API\n  if (sandbox?.files?.read) {\n    return await sandbox.files.read(fullPath);\n  }\n\n  // Try provider runCommand (preferred for provider pattern)\n  if (typeof sandbox?.runCommand === 'function') {\n    try {\n      const res = await sandbox.runCommand(`cat ${normalizedPath}`);\n      if (res && typeof res.stdout === 'string') {\n        return res.stdout as string;\n      }\n    } catch {}\n    // fallback to absolute path\n    try {\n      const resAbs = await sandbox.runCommand(`cat ${fullPath}`);\n      if (resAbs && typeof resAbs.stdout === 'string') {\n        return resAbs.stdout as string;\n      }\n    } catch {}\n  }\n\n  // Try shell cat via commands.run\n  if (sandbox?.commands?.run) {\n    const result = await sandbox.commands.run(`cat ${fullPath}`, { cwd: '/home/user/app', timeout: 30 });\n    if (result?.exitCode === 0 && typeof result?.stdout === 'string') {\n      return result.stdout as string;\n    }\n  }\n\n  throw new Error(`Unable to read file: ${normalizedPath}`);\n}\n\n// Write a file to sandbox and update cache\nasync function writeFileToSandbox(sandbox: any, normalizedPath: string, fullPath: string, content: string): Promise<void> {\n  // Provider pattern (writeFile)\n  if (typeof sandbox?.writeFile === 'function') {\n    await sandbox.writeFile(normalizedPath, content);\n    return;\n  }\n\n  // Provider pattern (runCommand redirect)\n  if (typeof sandbox?.runCommand === 'function') {\n    // Ensure directory exists\n    const dir = normalizedPath.includes('/') ? normalizedPath.substring(0, normalizedPath.lastIndexOf('/')) : '';\n    if (dir) {\n      try { await sandbox.runCommand(`mkdir -p ${dir}`); } catch {}\n    }\n    // Write via heredoc with proper escaping\n    const heredoc = `bash -lc 'cat > ${normalizedPath} <<\\\"EOF\\\"\\n${content.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\n').replace(/\\$/g, '\\$')}\\nEOF'`;\n    const result = await sandbox.runCommand(heredoc);\n    if (result?.stdout || result?.stderr) {\n      // no-op\n    }\n    return;\n  }\n\n  // Prefer E2B files API\n  if (sandbox?.files?.write) {\n    await sandbox.files.write(fullPath, content);\n  } else if (sandbox?.runCode) {\n    // Use Python to write safely\n    const escaped = content\n      .replace(/\\\\/g, '\\\\\\\\')\n      .replace(/\"\"\"/g, '\\\"\\\"\\\"');\n    await sandbox.runCode(`\nimport os\nos.makedirs(os.path.dirname(\"${fullPath}\"), exist_ok=True)\nwith open(\"${fullPath}\", 'w') as f:\n    f.write(\"\"\"${escaped}\"\"\")\nprint(\"WROTE:${fullPath}\")\n    `);\n  } else if (sandbox?.commands?.run) {\n    // Shell redirection (fallback)\n    // Note: beware of special chars; this is a last-resort path\n    const result = await sandbox.commands.run(`bash -lc 'mkdir -p \"$(dirname \"${fullPath}\")\" && cat > \"${fullPath}\" << \\EOF\\n${content}\\nEOF'`, { cwd: '/home/user/app', timeout: 60 });\n    if (result?.exitCode !== 0) {\n      throw new Error(`Failed to write file via shell: ${normalizedPath}`);\n    }\n  } else {\n    throw new Error('No available method to write files to sandbox');\n  }\n\n  // Update backend cache if available\n  if ((global as any).sandboxState?.fileCache) {\n    (global as any).sandboxState.fileCache.files[normalizedPath] = {\n      content,\n      lastModified: Date.now()\n    };\n  }\n  if ((global as any).existingFiles) {\n    (global as any).existingFiles.add(normalizedPath);\n  }\n}\n\nexport async function applyMorphEditToFile(params: {\n  sandbox: any;\n  targetPath: string;\n  instructions: string;\n  updateSnippet: string;\n}): Promise<MorphApplyResult> {\n  try {\n    if (!process.env.MORPH_API_KEY) {\n      return { success: false, error: 'MORPH_API_KEY not set' };\n    }\n\n    const { normalizedPath, fullPath } = normalizeProjectPath(params.targetPath);\n\n    // Read original code (existence validation happens here)\n    const initialCode = await readFileFromSandbox(params.sandbox, normalizedPath, fullPath);\n\n    const resp = await morphChatCompletionsCreate({\n      model: 'morph-v3-large',\n      messages: [\n        {\n          role: 'user',\n          content: `<instruction>${params.instructions || ''}</instruction>\\n<code>${initialCode}</code>\\n<update>${params.updateSnippet}</update>`\n        }\n      ]\n    });\n\n    const mergedCode = (resp as any)?.choices?.[0]?.message?.content || '';\n    if (!mergedCode) {\n      return { success: false, error: 'Morph returned empty content', normalizedPath };\n    }\n\n    await writeFileToSandbox(params.sandbox, normalizedPath, fullPath, mergedCode);\n\n    return { success: true, normalizedPath, mergedCode };\n  } catch (error) {\n    return { success: false, error: (error as Error).message };\n  }\n}\n\n\n"
  },
  {
    "path": "lib/sandbox/factory.ts",
    "content": "import { SandboxProvider, SandboxProviderConfig } from './types';\nimport { E2BProvider } from './providers/e2b-provider';\nimport { VercelProvider } from './providers/vercel-provider';\n\nexport class SandboxFactory {\n  static create(provider?: string, config?: SandboxProviderConfig): SandboxProvider {\n    // Use environment variable if provider not specified\n    const selectedProvider = provider || process.env.SANDBOX_PROVIDER || 'e2b';\n    \n    \n    switch (selectedProvider.toLowerCase()) {\n      case 'e2b':\n        return new E2BProvider(config || {});\n      \n      case 'vercel':\n        return new VercelProvider(config || {});\n      \n      default:\n        throw new Error(`Unknown sandbox provider: ${selectedProvider}. Supported providers: e2b, vercel`);\n    }\n  }\n  \n  static getAvailableProviders(): string[] {\n    return ['e2b', 'vercel'];\n  }\n  \n  static isProviderAvailable(provider: string): boolean {\n    switch (provider.toLowerCase()) {\n      case 'e2b':\n        return !!process.env.E2B_API_KEY;\n      \n      case 'vercel':\n        // Vercel can use OIDC (automatic) or PAT\n        return !!process.env.VERCEL_OIDC_TOKEN || \n               (!!process.env.VERCEL_TOKEN && !!process.env.VERCEL_TEAM_ID && !!process.env.VERCEL_PROJECT_ID);\n      \n      default:\n        return false;\n    }\n  }\n}"
  },
  {
    "path": "lib/sandbox/providers/e2b-provider.ts",
    "content": "import { Sandbox } from '@e2b/code-interpreter';\nimport { SandboxProvider, SandboxInfo, CommandResult } from '../types';\n// SandboxProviderConfig available through parent class\nimport { appConfig } from '@/config/app.config';\n\nexport class E2BProvider extends SandboxProvider {\n  private existingFiles: Set<string> = new Set();\n\n  /**\n   * Attempt to reconnect to an existing E2B sandbox\n   */\n  async reconnect(sandboxId: string): Promise<boolean> {\n    try {\n      \n      // Try to connect to existing sandbox\n      // Note: E2B SDK doesn't directly support reconnection, but we can try to recreate\n      // For now, return false to indicate reconnection isn't supported\n      // In the future, E2B may add this capability\n      \n      return false;\n    } catch (error) {\n      console.error(`[E2BProvider] Failed to reconnect to sandbox ${sandboxId}:`, error);\n      return false;\n    }\n  }\n\n  async createSandbox(): Promise<SandboxInfo> {\n    try {\n      \n      // Kill existing sandbox if any\n      if (this.sandbox) {\n        try {\n          await this.sandbox.kill();\n        } catch (e) {\n          console.error('Failed to close existing sandbox:', e);\n        }\n        this.sandbox = null;\n      }\n      \n      // Clear existing files tracking\n      this.existingFiles.clear();\n\n      // Create base sandbox\n      this.sandbox = await Sandbox.create({ \n        apiKey: this.config.e2b?.apiKey || process.env.E2B_API_KEY,\n        timeoutMs: this.config.e2b?.timeoutMs || appConfig.e2b.timeoutMs\n      });\n      \n      const sandboxId = (this.sandbox as any).sandboxId || Date.now().toString();\n      const host = (this.sandbox as any).getHost(appConfig.e2b.vitePort);\n      \n\n      this.sandboxInfo = {\n        sandboxId,\n        url: `https://${host}`,\n        provider: 'e2b',\n        createdAt: new Date()\n      };\n\n      // Set extended timeout on the sandbox instance if method available\n      if (typeof this.sandbox.setTimeout === 'function') {\n        this.sandbox.setTimeout(appConfig.e2b.timeoutMs);\n      }\n\n      return this.sandboxInfo;\n\n    } catch (error) {\n      console.error('[E2BProvider] Error creating sandbox:', error);\n      throw error;\n    }\n  }\n\n  async runCommand(command: string): Promise<CommandResult> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    \n    const result = await this.sandbox.runCode(`\n      import subprocess\n      import os\n\n      os.chdir('/home/user/app')\n      result = subprocess.run(${JSON.stringify(command.split(' '))}, \n                            capture_output=True, \n                            text=True, \n                            shell=False)\n\n      print(\"STDOUT:\")\n      print(result.stdout)\n      if result.stderr:\n          print(\"\\\\nSTDERR:\")\n          print(result.stderr)\n      print(f\"\\\\nReturn code: {result.returncode}\")\n    `);\n    \n    const output = result.logs.stdout.join('\\n');\n    const stderr = result.logs.stderr.join('\\n');\n    \n    return {\n      stdout: output,\n      stderr,\n      exitCode: result.error ? 1 : 0,\n      success: !result.error\n    };\n  }\n\n  async writeFile(path: string, content: string): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const fullPath = path.startsWith('/') ? path : `/home/user/app/${path}`;\n    \n    // Use the E2B filesystem API to write the file\n    // Note: E2B SDK uses files.write() method\n    if ((this.sandbox as any).files && typeof (this.sandbox as any).files.write === 'function') {\n      // Use the files.write API if available\n      await (this.sandbox as any).files.write(fullPath, Buffer.from(content));\n    } else {\n      // Fallback to Python code execution\n      await this.sandbox.runCode(`\n        import os\n\n        # Ensure directory exists\n        dir_path = os.path.dirname(\"${fullPath}\")\n        os.makedirs(dir_path, exist_ok=True)\n\n        # Write file\n        with open(\"${fullPath}\", 'w') as f:\n            f.write(${JSON.stringify(content)})\n        print(f\"✓ Written: ${fullPath}\")\n      `);\n    }\n    \n    this.existingFiles.add(path);\n  }\n\n  async readFile(path: string): Promise<string> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const fullPath = path.startsWith('/') ? path : `/home/user/app/${path}`;\n    \n    const result = await this.sandbox.runCode(`\n      with open(\"${fullPath}\", 'r') as f:\n          content = f.read()\n      print(content)\n    `);\n    \n    return result.logs.stdout.join('\\n');\n  }\n\n  async listFiles(directory: string = '/home/user/app'): Promise<string[]> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const result = await this.sandbox.runCode(`\n      import os\n      import json\n\n      def list_files(path):\n          files = []\n          for root, dirs, filenames in os.walk(path):\n              # Skip node_modules and .git\n              dirs[:] = [d for d in dirs if d not in ['node_modules', '.git', '.next', 'dist', 'build']]\n              for filename in filenames:\n                  rel_path = os.path.relpath(os.path.join(root, filename), path)\n                  files.append(rel_path)\n          return files\n\n      files = list_files(\"${directory}\")\n      print(json.dumps(files))\n    `);\n    \n    try {\n      return JSON.parse(result.logs.stdout.join(''));\n    } catch {\n      return [];\n    }\n  }\n\n  async installPackages(packages: string[]): Promise<CommandResult> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const packageList = packages.join(' ');\n    const flags = appConfig.packages.useLegacyPeerDeps ? '--legacy-peer-deps' : '';\n    \n    \n    const result = await this.sandbox.runCode(`\n      import subprocess\n      import os\n\n      os.chdir('/home/user/app')\n\n      # Install packages\n      result = subprocess.run(\n          ['npm', 'install', ${flags ? `'${flags}',` : ''} ${packages.map(p => `'${p}'`).join(', ')}],\n          capture_output=True,\n          text=True\n      )\n\n      print(\"STDOUT:\")\n      print(result.stdout)\n      if result.stderr:\n          print(\"\\\\nSTDERR:\")\n          print(result.stderr)\n      print(f\"\\\\nReturn code: {result.returncode}\")\n    `);\n    \n    const output = result.logs.stdout.join('\\n');\n    const stderr = result.logs.stderr.join('\\n');\n    \n    // Restart Vite if configured\n    if (appConfig.packages.autoRestartVite && !result.error) {\n      await this.restartViteServer();\n    }\n    \n    return {\n      stdout: output,\n      stderr,\n      exitCode: result.error ? 1 : 0,\n      success: !result.error\n    };\n  }\n\n  async setupViteApp(): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    \n    // Write all files in a single Python script\n    const setupScript = `\nimport os\nimport json\n\nprint('Setting up React app with Vite and Tailwind...')\n\n# Create directory structure\nos.makedirs('/home/user/app/src', exist_ok=True)\n\n# Package.json\npackage_json = {\n    \"name\": \"sandbox-app\",\n    \"version\": \"1.0.0\",\n    \"type\": \"module\",\n    \"scripts\": {\n        \"dev\": \"vite --host\",\n        \"build\": \"vite build\",\n        \"preview\": \"vite preview\"\n    },\n    \"dependencies\": {\n        \"react\": \"^18.2.0\",\n        \"react-dom\": \"^18.2.0\"\n    },\n    \"devDependencies\": {\n        \"@vitejs/plugin-react\": \"^4.0.0\",\n        \"vite\": \"^4.3.9\",\n        \"tailwindcss\": \"^3.3.0\",\n        \"postcss\": \"^8.4.31\",\n        \"autoprefixer\": \"^10.4.16\"\n    }\n}\n\nwith open('/home/user/app/package.json', 'w') as f:\n    json.dump(package_json, f, indent=2)\nprint('✓ package.json')\n\n# Vite config\nvite_config = \"\"\"import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n  plugins: [react()],\n  server: {\n    host: '0.0.0.0',\n    port: 5173,\n    strictPort: true,\n    hmr: false,\n    allowedHosts: ['.e2b.app', '.e2b.dev', '.vercel.run', 'localhost', '127.0.0.1']\n  }\n})\"\"\"\n\nwith open('/home/user/app/vite.config.js', 'w') as f:\n    f.write(vite_config)\nprint('✓ vite.config.js')\n\n# Tailwind config\ntailwind_config = \"\"\"/** @type {import('tailwindcss').Config} */\nexport default {\n  content: [\n    \"./index.html\",\n    \"./src/**/*.{js,ts,jsx,tsx}\",\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}\"\"\"\n\nwith open('/home/user/app/tailwind.config.js', 'w') as f:\n    f.write(tailwind_config)\nprint('✓ tailwind.config.js')\n\n# PostCSS config\npostcss_config = \"\"\"export default {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n}\"\"\"\n\nwith open('/home/user/app/postcss.config.js', 'w') as f:\n    f.write(postcss_config)\nprint('✓ postcss.config.js')\n\n# Index.html\nindex_html = \"\"\"<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Sandbox App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.jsx\"></script>\n  </body>\n</html>\"\"\"\n\nwith open('/home/user/app/index.html', 'w') as f:\n    f.write(index_html)\nprint('✓ index.html')\n\n# Main.jsx\nmain_jsx = \"\"\"import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n)\"\"\"\n\nwith open('/home/user/app/src/main.jsx', 'w') as f:\n    f.write(main_jsx)\nprint('✓ src/main.jsx')\n\n# App.jsx\napp_jsx = \"\"\"function App() {\n  return (\n    <div className=\"min-h-screen bg-gray-900 text-white flex items-center justify-center p-4\">\n      <div className=\"text-center max-w-2xl\">\n        <p className=\"text-lg text-gray-400\">\n          Sandbox Ready<br/>\n          Start building your React app with Vite and Tailwind CSS!\n        </p>\n      </div>\n    </div>\n  )\n}\n\nexport default App\"\"\"\n\nwith open('/home/user/app/src/App.jsx', 'w') as f:\n    f.write(app_jsx)\nprint('✓ src/App.jsx')\n\n# Index.css\nindex_css = \"\"\"@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\nbody {\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n  background-color: rgb(17 24 39);\n}\"\"\"\n\nwith open('/home/user/app/src/index.css', 'w') as f:\n    f.write(index_css)\nprint('✓ src/index.css')\n\nprint('\\\\nAll files created successfully!')\n`;\n\n    await this.sandbox.runCode(setupScript);\n    \n    // Install dependencies\n    await this.sandbox.runCode(`\nimport subprocess\n\nprint('Installing npm packages...')\nresult = subprocess.run(\n    ['npm', 'install'],\n    cwd='/home/user/app',\n    capture_output=True,\n    text=True\n)\n\nif result.returncode == 0:\n    print('✓ Dependencies installed successfully')\nelse:\n    print(f'⚠ Warning: npm install had issues: {result.stderr}')\n    `);\n    \n    // Start Vite dev server\n    await this.sandbox.runCode(`\nimport subprocess\nimport os\nimport time\n\nos.chdir('/home/user/app')\n\n# Kill any existing Vite processes\nsubprocess.run(['pkill', '-f', 'vite'], capture_output=True)\ntime.sleep(1)\n\n# Start Vite dev server\nenv = os.environ.copy()\nenv['FORCE_COLOR'] = '0'\n\nprocess = subprocess.Popen(\n    ['npm', 'run', 'dev'],\n    stdout=subprocess.PIPE,\n    stderr=subprocess.PIPE,\n    env=env\n)\n\nprint(f'✓ Vite dev server started with PID: {process.pid}')\nprint('Waiting for server to be ready...')\n    `);\n    \n    // Wait for Vite to be ready\n    await new Promise(resolve => setTimeout(resolve, appConfig.e2b.viteStartupDelay));\n    \n    // Track initial files\n    this.existingFiles.add('src/App.jsx');\n    this.existingFiles.add('src/main.jsx');\n    this.existingFiles.add('src/index.css');\n    this.existingFiles.add('index.html');\n    this.existingFiles.add('package.json');\n    this.existingFiles.add('vite.config.js');\n    this.existingFiles.add('tailwind.config.js');\n    this.existingFiles.add('postcss.config.js');\n  }\n\n  async restartViteServer(): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    \n    await this.sandbox.runCode(`\nimport subprocess\nimport time\nimport os\n\nos.chdir('/home/user/app')\n\n# Kill existing Vite process\nsubprocess.run(['pkill', '-f', 'vite'], capture_output=True)\ntime.sleep(2)\n\n# Start Vite dev server\nenv = os.environ.copy()\nenv['FORCE_COLOR'] = '0'\n\nprocess = subprocess.Popen(\n    ['npm', 'run', 'dev'],\n    stdout=subprocess.PIPE,\n    stderr=subprocess.PIPE,\n    env=env\n)\n\nprint(f'✓ Vite restarted with PID: {process.pid}')\n    `);\n    \n    // Wait for Vite to be ready\n    await new Promise(resolve => setTimeout(resolve, appConfig.e2b.viteStartupDelay));\n  }\n\n  getSandboxUrl(): string | null {\n    return this.sandboxInfo?.url || null;\n  }\n\n  getSandboxInfo(): SandboxInfo | null {\n    return this.sandboxInfo;\n  }\n\n  async terminate(): Promise<void> {\n    if (this.sandbox) {\n      try {\n        await this.sandbox.kill();\n      } catch (e) {\n        console.error('Failed to terminate sandbox:', e);\n      }\n      this.sandbox = null;\n      this.sandboxInfo = null;\n    }\n  }\n\n  isAlive(): boolean {\n    return !!this.sandbox;\n  }\n}"
  },
  {
    "path": "lib/sandbox/providers/vercel-provider.ts",
    "content": "import { Sandbox } from '@vercel/sandbox';\nimport { SandboxProvider, SandboxInfo, CommandResult } from '../types';\n// SandboxProviderConfig available through parent class\n\nexport class VercelProvider extends SandboxProvider {\n  private existingFiles: Set<string> = new Set();\n\n  async createSandbox(): Promise<SandboxInfo> {\n    try {\n      \n      // Kill existing sandbox if any\n      if (this.sandbox) {\n        try {\n          await this.sandbox.stop();\n        } catch (e) {\n          console.error('Failed to stop existing sandbox:', e);\n        }\n        this.sandbox = null;\n      }\n      \n      // Clear existing files tracking\n      this.existingFiles.clear();\n\n      // Create Vercel sandbox\n      \n      const sandboxConfig: any = {\n        timeout: 300000, // 5 minutes in ms\n        runtime: 'node22', // Use node22 runtime for Vercel sandboxes\n        ports: [5173] // Vite port\n      };\n\n      // Add authentication based on environment variables\n      if (process.env.VERCEL_TOKEN && process.env.VERCEL_TEAM_ID && process.env.VERCEL_PROJECT_ID) {\n        sandboxConfig.teamId = process.env.VERCEL_TEAM_ID;\n        sandboxConfig.projectId = process.env.VERCEL_PROJECT_ID;\n        sandboxConfig.token = process.env.VERCEL_TOKEN;\n      } else if (process.env.VERCEL_OIDC_TOKEN) {\n        sandboxConfig.oidcToken = process.env.VERCEL_OIDC_TOKEN;\n      }\n\n      this.sandbox = await Sandbox.create(sandboxConfig);\n      \n      const sandboxId = this.sandbox.sandboxId;\n      // Sandbox created successfully\n      \n      // Get the sandbox URL using the correct Vercel Sandbox API\n      const sandboxUrl = this.sandbox.domain(5173);\n\n      this.sandboxInfo = {\n        sandboxId,\n        url: sandboxUrl,\n        provider: 'vercel',\n        createdAt: new Date()\n      };\n\n      return this.sandboxInfo;\n\n    } catch (error) {\n      console.error('[VercelProvider] Error creating sandbox:', error);\n      throw error;\n    }\n  }\n\n  async runCommand(command: string): Promise<CommandResult> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    \n    try {\n      // Parse command into cmd and args (matching PR syntax)\n      const parts = command.split(' ');\n      const cmd = parts[0];\n      const args = parts.slice(1);\n      \n      // Vercel uses runCommand with cmd and args object (based on PR)\n      const result = await this.sandbox.runCommand({\n        cmd: cmd,\n        args: args,\n        cwd: '/vercel/sandbox',\n        env: {}\n      });\n      \n      // Handle stdout and stderr - they might be functions in Vercel SDK\n      let stdout = '';\n      let stderr = '';\n      \n      try {\n        if (typeof result.stdout === 'function') {\n          stdout = await result.stdout();\n        } else {\n          stdout = result.stdout || '';\n        }\n      } catch (e) {\n        stdout = '';\n      }\n      \n      try {\n        if (typeof result.stderr === 'function') {\n          stderr = await result.stderr();\n        } else {\n          stderr = result.stderr || '';\n        }\n      } catch (e) {\n        stderr = '';\n      }\n      \n      return {\n        stdout: stdout,\n        stderr: stderr,\n        exitCode: result.exitCode || 0,\n        success: result.exitCode === 0\n      };\n    } catch (error: any) {\n      return {\n        stdout: '',\n        stderr: error.message || 'Command failed',\n        exitCode: 1,\n        success: false\n      };\n    }\n  }\n\n  async writeFile(path: string, content: string): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    // Vercel sandbox default working directory is /vercel/sandbox\n    const fullPath = path.startsWith('/') ? path : `/vercel/sandbox/${path}`;\n    \n    // Writing file to sandbox\n    \n    // Based on Vercel SDK docs, writeFiles expects path and Buffer content\n    try {\n      const buffer = Buffer.from(content, 'utf-8');\n      // Writing file with buffer\n      \n      await this.sandbox.writeFiles([{\n        path: fullPath,\n        content: buffer\n      }]);\n      \n      this.existingFiles.add(path);\n    } catch (writeError: any) {\n      // Log detailed error information\n      console.error(`[VercelProvider] writeFiles failed for ${fullPath}:`, {\n        error: writeError,\n        message: writeError?.message,\n        response: writeError?.response,\n        statusCode: writeError?.response?.status,\n        responseData: writeError?.response?.data\n      });\n      \n      // Fallback to command-based approach if writeFiles fails\n      // Falling back to command-based file write\n      \n      // Ensure directory exists\n      const dir = fullPath.substring(0, fullPath.lastIndexOf('/'));\n      if (dir) {\n        const mkdirResult = await this.sandbox.runCommand({\n          cmd: 'mkdir',\n          args: ['-p', dir]\n        });\n        // Directory created\n      }\n      \n      // Write file using echo and redirection\n      const escapedContent = content\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\"/g, '\\\\\"')\n        .replace(/\\$/g, '\\\\$')\n        .replace(/`/g, '\\\\`')\n        .replace(/\\n/g, '\\\\n');\n      \n      const writeResult = await this.sandbox.runCommand({\n        cmd: 'sh',\n        args: ['-c', `echo \"${escapedContent}\" > \"${fullPath}\"`]\n      });\n      \n      // File written\n      \n      if (writeResult.exitCode === 0) {\n        this.existingFiles.add(path);\n      } else {\n        throw new Error(`Failed to write file via command: ${writeResult.stderr}`);\n      }\n    }\n  }\n\n  async readFile(path: string): Promise<string> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    // Vercel sandbox default working directory is /vercel/sandbox\n    const fullPath = path.startsWith('/') ? path : `/vercel/sandbox/${path}`;\n    \n    const result = await this.sandbox.runCommand({\n      cmd: 'cat',\n      args: [fullPath]\n    });\n    \n    // Handle stdout and stderr - they might be functions in Vercel SDK\n    let stdout = '';\n    let stderr = '';\n    \n    try {\n      if (typeof result.stdout === 'function') {\n        stdout = await result.stdout();\n      } else {\n        stdout = result.stdout || '';\n      }\n    } catch (e) {\n      stdout = '';\n    }\n    \n    try {\n      if (typeof result.stderr === 'function') {\n        stderr = await result.stderr();\n      } else {\n        stderr = result.stderr || '';\n      }\n    } catch (e) {\n      stderr = '';\n    }\n    \n    if (result.exitCode !== 0) {\n      throw new Error(`Failed to read file: ${stderr}`);\n    }\n    \n    return stdout;\n  }\n\n  async listFiles(directory: string = '/vercel/sandbox'): Promise<string[]> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const result = await this.sandbox.runCommand({\n      cmd: 'sh',\n      args: ['-c', `find ${directory} -type f -not -path \"*/node_modules/*\" -not -path \"*/.git/*\" -not -path \"*/.next/*\" -not -path \"*/dist/*\" -not -path \"*/build/*\" | sed \"s|^${directory}/||\"`],\n      cwd: '/'\n    });\n    \n    // Handle stdout - it might be a function in Vercel SDK\n    let stdout = '';\n    \n    try {\n      if (typeof result.stdout === 'function') {\n        stdout = await result.stdout();\n      } else {\n        stdout = result.stdout || '';\n      }\n    } catch (e) {\n      stdout = '';\n    }\n    \n    if (result.exitCode !== 0) {\n      return [];\n    }\n    \n    return stdout.split('\\n').filter((line: string) => line.trim() !== '');\n  }\n\n  async installPackages(packages: string[]): Promise<CommandResult> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    const flags = process.env.NPM_FLAGS || '';\n    \n    // Installing packages\n    \n    // Build args array\n    const args = ['install'];\n    if (flags) {\n      args.push(...flags.split(' '));\n    }\n    args.push(...packages);\n    \n    const result = await this.sandbox.runCommand({\n      cmd: 'npm',\n      args: args,\n      cwd: '/vercel/sandbox'\n    });\n    \n    // Handle stdout and stderr - they might be functions in Vercel SDK\n    let stdout = '';\n    let stderr = '';\n    \n    try {\n      if (typeof result.stdout === 'function') {\n        stdout = await result.stdout();\n      } else {\n        stdout = result.stdout || '';\n      }\n    } catch (e) {\n      stdout = '';\n    }\n    \n    try {\n      if (typeof result.stderr === 'function') {\n        stderr = await result.stderr();\n      } else {\n        stderr = result.stderr || '';\n      }\n    } catch (e) {\n      stderr = '';\n    }\n    \n    // Restart Vite if configured and successful\n    if (result.exitCode === 0 && process.env.AUTO_RESTART_VITE === 'true') {\n      await this.restartViteServer();\n    }\n    \n    return {\n      stdout: stdout,\n      stderr: stderr,\n      exitCode: result.exitCode || 0,\n      success: result.exitCode === 0\n    };\n  }\n\n  async setupViteApp(): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    // Setting up Vite app for sandbox\n    \n    // Create directory structure\n    const mkdirResult = await this.sandbox.runCommand({\n      cmd: 'mkdir',\n      args: ['-p', '/vercel/sandbox/src']\n    });\n    // Directory structure created\n    \n    // Create package.json\n    const packageJson = {\n      name: \"sandbox-app\",\n      version: \"1.0.0\",\n      type: \"module\",\n      scripts: {\n        dev: \"vite --host\",\n        build: \"vite build\",\n        preview: \"vite preview\"\n      },\n      dependencies: {\n        react: \"^18.2.0\",\n        \"react-dom\": \"^18.2.0\"\n      },\n      devDependencies: {\n        \"@vitejs/plugin-react\": \"^4.0.0\",\n        vite: \"^4.3.9\",\n        tailwindcss: \"^3.3.0\",\n        postcss: \"^8.4.31\",\n        autoprefixer: \"^10.4.16\"\n      }\n    };\n    \n    await this.writeFile('package.json', JSON.stringify(packageJson, null, 2));\n    \n    // Create vite.config.js\n    const viteConfig = `import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n  plugins: [react()],\n  server: {\n    host: '0.0.0.0',\n    port: 5173,\n    strictPort: true,\n    allowedHosts: [\n      '.vercel.run',  // Allow all Vercel sandbox domains\n      '.e2b.dev',     // Allow all E2B sandbox domains\n      'localhost'\n    ],\n    hmr: {\n      clientPort: 443,\n      protocol: 'wss'\n    }\n  }\n})`;\n    \n    await this.writeFile('vite.config.js', viteConfig);\n    \n    // Create tailwind.config.js\n    const tailwindConfig = `/** @type {import('tailwindcss').Config} */\nexport default {\n  content: [\n    \"./index.html\",\n    \"./src/**/*.{js,ts,jsx,tsx}\",\n  ],\n  theme: {\n    extend: {},\n  },\n  plugins: [],\n}`;\n    \n    await this.writeFile('tailwind.config.js', tailwindConfig);\n    \n    // Create postcss.config.js\n    const postcssConfig = `export default {\n  plugins: {\n    tailwindcss: {},\n    autoprefixer: {},\n  },\n}`;\n    \n    await this.writeFile('postcss.config.js', postcssConfig);\n    \n    // Create index.html\n    const indexHtml = `<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"UTF-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>Sandbox App</title>\n  </head>\n  <body>\n    <div id=\"root\"></div>\n    <script type=\"module\" src=\"/src/main.jsx\"></script>\n  </body>\n</html>`;\n    \n    await this.writeFile('index.html', indexHtml);\n    \n    // Create src/main.jsx\n    const mainJsx = `import React from 'react'\nimport ReactDOM from 'react-dom/client'\nimport App from './App.jsx'\nimport './index.css'\n\nReactDOM.createRoot(document.getElementById('root')).render(\n  <React.StrictMode>\n    <App />\n  </React.StrictMode>,\n)`;\n    \n    await this.writeFile('src/main.jsx', mainJsx);\n    \n    // Create src/App.jsx\n    const appJsx = `function App() {\n  return (\n    <div className=\"min-h-screen bg-gray-900 text-white flex items-center justify-center p-4\">\n      <div className=\"text-center max-w-2xl\">\n        <p className=\"text-lg text-gray-400\">\n          Vercel Sandbox Ready<br/>\n          Start building your React app with Vite and Tailwind CSS!\n        </p>\n      </div>\n    </div>\n  )\n}\n\nexport default App`;\n    \n    await this.writeFile('src/App.jsx', appJsx);\n    \n    // Create src/index.css\n    const indexCss = `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\nbody {\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n  background-color: rgb(17 24 39);\n}`;\n    \n    await this.writeFile('src/index.css', indexCss);\n    \n    // Installing npm dependencies\n    \n    // Install dependencies\n    try {\n      const installResult = await this.sandbox.runCommand({\n        cmd: 'npm',\n        args: ['install'],\n        cwd: '/vercel/sandbox'\n      });\n      \n      // npm install completed\n      \n      if (installResult.exitCode === 0) {\n        // Dependencies installed successfully\n      } else {\n        console.warn('[VercelProvider] npm install had issues:', installResult.stderr);\n      }\n    } catch (error: any) {\n      console.error('[VercelProvider] npm install error:', {\n        message: error?.message,\n        response: error?.response?.status,\n        responseText: error?.text\n      });\n      // Try alternative approach - run as shell command\n      try {\n        const altResult = await this.sandbox.runCommand({\n          cmd: 'sh',\n          args: ['-c', 'cd /vercel/sandbox && npm install'],\n          cwd: '/vercel/sandbox'\n        });\n        if (altResult.exitCode === 0) {\n          // Alternative npm install succeeded\n        } else {\n          console.warn('[VercelProvider] Alternative npm install also had issues:', altResult.stderr);\n        }\n      } catch (altError) {\n        console.error('[VercelProvider] Alternative npm install also failed:', altError);\n        console.warn('[VercelProvider] Continuing without npm install - packages may need to be installed manually');\n      }\n    }\n    \n    // Start Vite dev server\n    // Starting Vite dev server\n    \n    // Kill any existing Vite processes\n    await this.sandbox.runCommand({\n      cmd: 'sh',\n      args: ['-c', 'pkill -f vite || true'],\n      cwd: '/'\n    });\n    \n    // Start Vite in background\n    await this.sandbox.runCommand({\n      cmd: 'sh',\n      args: ['-c', 'nohup npm run dev > /tmp/vite.log 2>&1 &'],\n      cwd: '/vercel/sandbox'\n    });\n    \n    // Vite server started in background\n    \n    // Wait for Vite to be ready\n    await new Promise(resolve => setTimeout(resolve, 7000));\n    \n    // Track initial files\n    this.existingFiles.add('src/App.jsx');\n    this.existingFiles.add('src/main.jsx');\n    this.existingFiles.add('src/index.css');\n    this.existingFiles.add('index.html');\n    this.existingFiles.add('package.json');\n    this.existingFiles.add('vite.config.js');\n    this.existingFiles.add('tailwind.config.js');\n    this.existingFiles.add('postcss.config.js');\n  }\n\n  async restartViteServer(): Promise<void> {\n    if (!this.sandbox) {\n      throw new Error('No active sandbox');\n    }\n\n    // Restarting Vite server\n    \n    // Kill existing Vite process\n    await this.sandbox.runCommand({\n      cmd: 'sh',\n      args: ['-c', 'pkill -f vite || true'],\n      cwd: '/'\n    });\n    \n    // Wait a moment\n    await new Promise(resolve => setTimeout(resolve, 2000));\n    \n    // Start Vite in background\n    await this.sandbox.runCommand({\n      cmd: 'sh',\n      args: ['-c', 'nohup npm run dev > /tmp/vite.log 2>&1 &'],\n      cwd: '/vercel/sandbox'\n    });\n    \n    // Vite server started in background\n    \n    // Wait for Vite to be ready\n    await new Promise(resolve => setTimeout(resolve, 7000));\n  }\n\n  getSandboxUrl(): string | null {\n    return this.sandboxInfo?.url || null;\n  }\n\n  getSandboxInfo(): SandboxInfo | null {\n    return this.sandboxInfo;\n  }\n\n  async terminate(): Promise<void> {\n    if (this.sandbox) {\n      try {\n        await this.sandbox.stop();\n      } catch (e) {\n        console.error('Failed to terminate sandbox:', e);\n      }\n      this.sandbox = null;\n      this.sandboxInfo = null;\n    }\n  }\n\n  isAlive(): boolean {\n    return !!this.sandbox;\n  }\n}"
  },
  {
    "path": "lib/sandbox/sandbox-manager.ts",
    "content": "import { SandboxProvider } from './types';\nimport { SandboxFactory } from './factory';\n\ninterface SandboxInfo {\n  sandboxId: string;\n  provider: SandboxProvider;\n  createdAt: Date;\n  lastAccessed: Date;\n}\n\nclass SandboxManager {\n  private sandboxes: Map<string, SandboxInfo> = new Map();\n  private activeSandboxId: string | null = null;\n\n  /**\n   * Get or create a sandbox provider for the given sandbox ID\n   */\n  async getOrCreateProvider(sandboxId: string): Promise<SandboxProvider> {\n    // Check if we already have this sandbox\n    const existing = this.sandboxes.get(sandboxId);\n    if (existing) {\n      existing.lastAccessed = new Date();\n      return existing.provider;\n    }\n\n    // Try to reconnect to existing sandbox\n    \n    try {\n      const provider = SandboxFactory.create();\n      \n      // For E2B provider, try to reconnect\n      if (provider.constructor.name === 'E2BProvider') {\n        // E2B sandboxes can be reconnected using the sandbox ID\n        const reconnected = await (provider as any).reconnect(sandboxId);\n        if (reconnected) {\n          this.sandboxes.set(sandboxId, {\n            sandboxId,\n            provider,\n            createdAt: new Date(),\n            lastAccessed: new Date()\n          });\n          this.activeSandboxId = sandboxId;\n          return provider;\n        }\n      }\n      \n      // For Vercel or if reconnection failed, return the new provider\n      // The caller will need to handle creating a new sandbox\n      return provider;\n    } catch (error) {\n      console.error(`[SandboxManager] Error reconnecting to sandbox ${sandboxId}:`, error);\n      throw error;\n    }\n  }\n\n  /**\n   * Register a new sandbox\n   */\n  registerSandbox(sandboxId: string, provider: SandboxProvider): void {\n    this.sandboxes.set(sandboxId, {\n      sandboxId,\n      provider,\n      createdAt: new Date(),\n      lastAccessed: new Date()\n    });\n    this.activeSandboxId = sandboxId;\n  }\n\n  /**\n   * Get the active sandbox provider\n   */\n  getActiveProvider(): SandboxProvider | null {\n    if (!this.activeSandboxId) {\n      return null;\n    }\n    \n    const sandbox = this.sandboxes.get(this.activeSandboxId);\n    if (sandbox) {\n      sandbox.lastAccessed = new Date();\n      return sandbox.provider;\n    }\n    \n    return null;\n  }\n\n  /**\n   * Get a specific sandbox provider\n   */\n  getProvider(sandboxId: string): SandboxProvider | null {\n    const sandbox = this.sandboxes.get(sandboxId);\n    if (sandbox) {\n      sandbox.lastAccessed = new Date();\n      return sandbox.provider;\n    }\n    return null;\n  }\n\n  /**\n   * Set the active sandbox\n   */\n  setActiveSandbox(sandboxId: string): boolean {\n    if (this.sandboxes.has(sandboxId)) {\n      this.activeSandboxId = sandboxId;\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * Terminate a sandbox\n   */\n  async terminateSandbox(sandboxId: string): Promise<void> {\n    const sandbox = this.sandboxes.get(sandboxId);\n    if (sandbox) {\n      try {\n        await sandbox.provider.terminate();\n      } catch (error) {\n        console.error(`[SandboxManager] Error terminating sandbox ${sandboxId}:`, error);\n      }\n      this.sandboxes.delete(sandboxId);\n      \n      if (this.activeSandboxId === sandboxId) {\n        this.activeSandboxId = null;\n      }\n    }\n  }\n\n  /**\n   * Terminate all sandboxes\n   */\n  async terminateAll(): Promise<void> {\n    const promises = Array.from(this.sandboxes.values()).map(sandbox => \n      sandbox.provider.terminate().catch(err => \n        console.error(`[SandboxManager] Error terminating sandbox ${sandbox.sandboxId}:`, err)\n      )\n    );\n    \n    await Promise.all(promises);\n    this.sandboxes.clear();\n    this.activeSandboxId = null;\n  }\n\n  /**\n   * Clean up old sandboxes (older than maxAge milliseconds)\n   */\n  async cleanup(maxAge: number = 3600000): Promise<void> {\n    const now = new Date();\n    const toDelete: string[] = [];\n    \n    for (const [id, info] of this.sandboxes.entries()) {\n      const age = now.getTime() - info.lastAccessed.getTime();\n      if (age > maxAge) {\n        toDelete.push(id);\n      }\n    }\n    \n    for (const id of toDelete) {\n      await this.terminateSandbox(id);\n    }\n  }\n}\n\n// Export singleton instance\nexport const sandboxManager = new SandboxManager();\n\n// Also maintain backward compatibility with global state\ndeclare global {\n  var sandboxManager: SandboxManager;\n}\n\n// Ensure the global reference points to our singleton\nglobal.sandboxManager = sandboxManager;"
  },
  {
    "path": "lib/sandbox/types.ts",
    "content": "export interface SandboxFile {\n  path: string;\n  content: string;\n  lastModified?: number;\n}\n\nexport interface SandboxInfo {\n  sandboxId: string;\n  url: string;\n  provider: 'e2b' | 'vercel';\n  createdAt: Date;\n}\n\nexport interface CommandResult {\n  stdout: string;\n  stderr: string;\n  exitCode: number;\n  success: boolean;\n}\n\nexport interface SandboxProviderConfig {\n  e2b?: {\n    apiKey: string;\n    timeoutMs?: number;\n    template?: string;\n  };\n  vercel?: {\n    teamId?: string;\n    projectId?: string;\n    token?: string;\n    authMethod?: 'oidc' | 'pat';\n  };\n}\n\nexport abstract class SandboxProvider {\n  protected config: SandboxProviderConfig;\n  protected sandbox: any;\n  protected sandboxInfo: SandboxInfo | null = null;\n\n  constructor(config: SandboxProviderConfig) {\n    this.config = config;\n  }\n\n  abstract createSandbox(): Promise<SandboxInfo>;\n  abstract runCommand(command: string): Promise<CommandResult>;\n  abstract writeFile(path: string, content: string): Promise<void>;\n  abstract readFile(path: string): Promise<string>;\n  abstract listFiles(directory?: string): Promise<string[]>;\n  abstract installPackages(packages: string[]): Promise<CommandResult>;\n  abstract getSandboxUrl(): string | null;\n  abstract getSandboxInfo(): SandboxInfo | null;\n  abstract terminate(): Promise<void>;\n  abstract isAlive(): boolean;\n  \n  // Optional methods that providers can override\n  async setupViteApp(): Promise<void> {\n    // Default implementation for setting up a Vite React app\n    throw new Error('setupViteApp not implemented for this provider');\n  }\n  \n  async restartViteServer(): Promise<void> {\n    // Default implementation for restarting Vite\n    throw new Error('restartViteServer not implemented for this provider');\n  }\n}"
  },
  {
    "path": "lib/utils.ts",
    "content": "import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n"
  },
  {
    "path": "next.config.ts",
    "content": "import type { NextConfig } from \"next\";\n\nconst nextConfig: NextConfig = {\n  images: {\n    remotePatterns: [\n      {\n        protocol: 'https',\n        hostname: 'www.google.com',\n      },\n    ],\n  },\n};\n\nexport default nextConfig;\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"open-lovable\",\n  \"version\": \"0.1.0\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": {\n    \"dev\": \"next dev --turbopack\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"lint\": \"next lint\",\n    \"test:api\": \"node tests/api-endpoints.test.js\",\n    \"test:code\": \"node tests/code-execution.test.js\",\n    \"test:all\": \"npm run test:integration && npm run test:api && npm run test:code\"\n  },\n  \"dependencies\": {\n    \"@ai-sdk/anthropic\": \"^2.0.1\",\n    \"@ai-sdk/google\": \"^2.0.4\",\n    \"@ai-sdk/groq\": \"^2.0.0\",\n    \"@ai-sdk/openai\": \"^2.0.4\",\n    \"@anthropic-ai/sdk\": \"^0.57.0\",\n    \"@e2b/code-interpreter\": \"^2.0.0\",\n    \"@mendable/firecrawl-js\": \"^4.3.3\",\n    \"@radix-ui/react-accordion\": \"^1.2.12\",\n    \"@radix-ui/react-alert-dialog\": \"^1.1.15\",\n    \"@radix-ui/react-aspect-ratio\": \"^1.1.7\",\n    \"@radix-ui/react-avatar\": \"^1.1.10\",\n    \"@radix-ui/react-checkbox\": \"^1.3.3\",\n    \"@radix-ui/react-collapsible\": \"^1.1.12\",\n    \"@radix-ui/react-context-menu\": \"^2.2.16\",\n    \"@radix-ui/react-dialog\": \"^1.1.15\",\n    \"@radix-ui/react-dropdown-menu\": \"^2.1.16\",\n    \"@radix-ui/react-hover-card\": \"^1.1.15\",\n    \"@radix-ui/react-label\": \"^2.1.7\",\n    \"@radix-ui/react-menubar\": \"^1.1.16\",\n    \"@radix-ui/react-navigation-menu\": \"^1.2.14\",\n    \"@radix-ui/react-popover\": \"^1.1.15\",\n    \"@radix-ui/react-progress\": \"^1.1.7\",\n    \"@radix-ui/react-radio-group\": \"^1.3.8\",\n    \"@radix-ui/react-scroll-area\": \"^1.2.10\",\n    \"@radix-ui/react-select\": \"^2.2.6\",\n    \"@radix-ui/react-separator\": \"^1.1.7\",\n    \"@radix-ui/react-slider\": \"^1.3.6\",\n    \"@radix-ui/react-slot\": \"^1.2.3\",\n    \"@radix-ui/react-switch\": \"^1.2.5\",\n    \"@radix-ui/react-tabs\": \"^1.1.13\",\n    \"@radix-ui/react-toast\": \"^1.2.15\",\n    \"@radix-ui/react-toggle\": \"^1.1.10\",\n    \"@radix-ui/react-toggle-group\": \"^1.1.11\",\n    \"@radix-ui/react-tooltip\": \"^1.2.8\",\n    \"@tabler/icons-react\": \"^3.34.1\",\n    \"@tailwindcss/typography\": \"^0.5.16\",\n    \"@types/react-syntax-highlighter\": \"^15.5.13\",\n    \"@vercel/sandbox\": \"^0.0.17\",\n    \"ai\": \"^5.0.0\",\n    \"autoprefixer\": \"^10.4.21\",\n    \"class-variance-authority\": \"^0.7.1\",\n    \"classnames\": \"^2.5.1\",\n    \"clsx\": \"^2.1.1\",\n    \"copy-to-clipboard\": \"^3.3.3\",\n    \"cors\": \"^2.8.5\",\n    \"dotenv\": \"^17.2.1\",\n    \"framer-motion\": \"^12.23.12\",\n    \"groq-sdk\": \"^0.29.0\",\n    \"jotai\": \"^2.14.0\",\n    \"lodash-es\": \"^4.17.21\",\n    \"lucide-react\": \"^0.532.0\",\n    \"motion\": \"^12.23.12\",\n    \"nanoid\": \"^5.1.5\",\n    \"next\": \"15.4.3\",\n    \"next-themes\": \"^0.4.6\",\n    \"pixi.js\": \"^8.13.1\",\n    \"react\": \"19.1.0\",\n    \"react-dom\": \"19.1.0\",\n    \"react-hook-form\": \"^7.62.0\",\n    \"react-icons\": \"^5.5.0\",\n    \"react-syntax-highlighter\": \"^15.6.1\",\n    \"sonner\": \"^2.0.7\",\n    \"tailwind-gradient-mask-image\": \"^1.2.0\",\n    \"tailwind-merge\": \"^3.3.1\",\n    \"tailwindcss-animate\": \"^1.0.7\",\n    \"usehooks-ts\": \"^3.1.1\",\n    \"zod\": \"^3.25.76\"\n  },\n  \"devDependencies\": {\n    \"@eslint/eslintrc\": \"^3\",\n    \"@types/lodash-es\": \"^4.17.12\",\n    \"@types/node\": \"^20\",\n    \"@types/react\": \"^19\",\n    \"@types/react-dom\": \"^19\",\n    \"eslint\": \"^9\",\n    \"eslint-config-next\": \"15.4.3\",\n    \"postcss\": \"^8.5.6\",\n    \"postcss-import\": \"^16.1.1\",\n    \"postcss-nesting\": \"^13.0.2\",\n    \"tailwindcss\": \"^3.4.17\",\n    \"typescript\": \"^5\"\n  }\n}\n"
  },
  {
    "path": "packages/create-open-lovable/index.js",
    "content": "#!/usr/bin/env node\n\nimport { Command } from 'commander';\nimport inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { installer } from './lib/installer.js';\nimport { getPrompts } from './lib/prompts.js';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst program = new Command();\n\nprogram\n  .name('create-open-lovable')\n  .description('Create a new Open Lovable project with your choice of sandbox provider')\n  .version('1.0.0')\n  .option('-s, --sandbox <provider>', 'Sandbox provider (e2b or vercel)')\n  .option('-n, --name <name>', 'Project name')\n  .option('-p, --path <path>', 'Installation path (defaults to current directory)')\n  .option('--skip-install', 'Skip npm install')\n  .option('--dry-run', 'Run without making changes')\n  .parse(process.argv);\n\nconst options = program.opts();\n\nasync function main() {\n  console.log(chalk.cyan('\\n🚀 Welcome to Open Lovable Setup!\\n'));\n\n  let config = {\n    sandbox: options.sandbox,\n    name: options.name || 'my-open-lovable',\n    path: options.path || process.cwd(),\n    skipInstall: options.skipInstall || false,\n    dryRun: options.dryRun || false\n  };\n\n  // Interactive mode if sandbox not specified\n  if (!config.sandbox) {\n    const prompts = getPrompts(config);\n    const answers = await inquirer.prompt(prompts);\n    config = { ...config, ...answers };\n  }\n\n  // Validate sandbox provider\n  if (!['e2b', 'vercel'].includes(config.sandbox)) {\n    console.error(chalk.red(`\\n❌ Invalid sandbox provider: ${config.sandbox}`));\n    console.log(chalk.yellow('Valid options: e2b, vercel\\n'));\n    process.exit(1);\n  }\n\n  console.log(chalk.gray('\\nConfiguration:'));\n  console.log(chalk.gray(`  Project: ${config.name}`));\n  console.log(chalk.gray(`  Sandbox: ${config.sandbox}`));\n  console.log(chalk.gray(`  Path: ${path.resolve(config.path, config.name)}\\n`));\n\n  if (config.dryRun) {\n    console.log(chalk.yellow('🔍 Dry run mode - no files will be created\\n'));\n  }\n\n  const spinner = ora('Creating project...').start();\n\n  try {\n    await installer({\n      ...config,\n      templatesDir: path.join(__dirname, 'templates')\n    });\n\n    spinner.succeed('Project created successfully!');\n\n    console.log(chalk.green('\\n✅ Setup complete!\\n'));\n    console.log(chalk.white('Next steps:'));\n    console.log(chalk.gray(`  1. cd ${config.name}`));\n    console.log(chalk.gray(`  2. Copy .env.example to .env and add your API keys`));\n    console.log(chalk.gray(`  3. npm run dev`));\n    console.log(chalk.gray('\\nHappy coding! 🎉\\n'));\n\n  } catch (error) {\n    spinner.fail('Setup failed');\n    console.error(chalk.red('\\n❌ Error:'), error.message);\n    if (error.stack && process.env.DEBUG) {\n      console.error(chalk.gray(error.stack));\n    }\n    process.exit(1);\n  }\n}\n\nmain().catch(error => {\n  console.error(chalk.red('Unexpected error:'), error);\n  process.exit(1);\n});"
  },
  {
    "path": "packages/create-open-lovable/lib/installer.js",
    "content": "import fs from 'fs-extra';\nimport path from 'path';\nimport { execSync } from 'child_process';\nimport chalk from 'chalk';\nimport inquirer from 'inquirer';\nimport { getEnvPrompts } from './prompts.js';\n\nexport async function installer(config) {\n  const { name, sandbox, path: installPath, skipInstall, dryRun, templatesDir } = config;\n  const projectPath = path.join(installPath, name);\n\n  if (dryRun) {\n    console.log(chalk.blue('\\n📋 Dry run - would perform these actions:'));\n    console.log(chalk.gray(`  - Create directory: ${projectPath}`));\n    console.log(chalk.gray(`  - Copy base template files`));\n    console.log(chalk.gray(`  - Copy ${sandbox}-specific files`));\n    console.log(chalk.gray(`  - Create .env file`));\n    if (!skipInstall) {\n      console.log(chalk.gray(`  - Run npm install`));\n    }\n    return;\n  }\n\n  // Check if directory exists\n  if (await fs.pathExists(projectPath)) {\n    const { overwrite } = await inquirer.prompt([{\n      type: 'confirm',\n      name: 'overwrite',\n      message: `Directory ${name} already exists. Overwrite?`,\n      default: false\n    }]);\n\n    if (!overwrite) {\n      throw new Error('Installation cancelled');\n    }\n    await fs.remove(projectPath);\n  }\n\n  // Create project directory\n  await fs.ensureDir(projectPath);\n\n  // Copy base template (shared files)\n  const baseTemplatePath = path.join(templatesDir, 'base');\n  if (await fs.pathExists(baseTemplatePath)) {\n    await copyTemplate(baseTemplatePath, projectPath);\n  } else {\n    // If no base template exists yet, copy from the main project\n    await copyMainProject(path.dirname(templatesDir), projectPath, sandbox);\n  }\n\n  // Copy provider-specific template\n  const providerTemplatePath = path.join(templatesDir, sandbox);\n  if (await fs.pathExists(providerTemplatePath)) {\n    await copyTemplate(providerTemplatePath, projectPath);\n  }\n\n  // Configure environment variables\n  if (config.configureEnv) {\n    const envAnswers = await inquirer.prompt(getEnvPrompts(sandbox));\n    await createEnvFile(projectPath, sandbox, envAnswers);\n  } else {\n    // Create .env.example copy\n    await createEnvExample(projectPath, sandbox);\n  }\n\n  // Update package.json with project name\n  await updatePackageJson(projectPath, name);\n\n  // Update configuration to use the selected sandbox provider\n  await updateAppConfig(projectPath, sandbox);\n\n  // Install dependencies\n  if (!skipInstall) {\n    console.log(chalk.cyan('\\n📦 Installing dependencies...'));\n    execSync('npm install', {\n      cwd: projectPath,\n      stdio: 'inherit'\n    });\n  }\n}\n\nasync function copyTemplate(src, dest) {\n  const files = await fs.readdir(src);\n  \n  for (const file of files) {\n    const srcPath = path.join(src, file);\n    const destPath = path.join(dest, file);\n    \n    const stat = await fs.stat(srcPath);\n    \n    if (stat.isDirectory()) {\n      await fs.ensureDir(destPath);\n      await copyTemplate(srcPath, destPath);\n    } else {\n      await fs.copy(srcPath, destPath, { overwrite: true });\n    }\n  }\n}\n\nasync function copyMainProject(mainProjectPath, projectPath, sandbox) {\n  // Copy essential directories and files from the main project\n  const itemsToCopy = [\n    'app',\n    'components',\n    'config',\n    'lib',\n    'types',\n    'public',\n    'styles',\n    '.eslintrc.json',\n    '.gitignore',\n    'next.config.js',\n    'package.json',\n    'tailwind.config.ts',\n    'tsconfig.json',\n    'postcss.config.mjs'\n  ];\n\n  for (const item of itemsToCopy) {\n    const srcPath = path.join(mainProjectPath, '..', item);\n    const destPath = path.join(projectPath, item);\n    \n    if (await fs.pathExists(srcPath)) {\n      await fs.copy(srcPath, destPath, {\n        overwrite: true,\n        filter: (src) => {\n          // Skip node_modules and .next\n          if (src.includes('node_modules') || src.includes('.next')) {\n            return false;\n          }\n          return true;\n        }\n      });\n    }\n  }\n}\n\nasync function createEnvFile(projectPath, sandbox, answers) {\n  let envContent = '# Open Lovable Configuration\\n\\n';\n  \n  // Sandbox provider\n  envContent += `# Sandbox Provider\\n`;\n  envContent += `SANDBOX_PROVIDER=${sandbox}\\n\\n`;\n  \n  // Required keys\n  envContent += `# REQUIRED - Web scraping for cloning websites\\n`;\n  envContent += `FIRECRAWL_API_KEY=${answers.firecrawlApiKey || 'your_firecrawl_api_key_here'}\\n\\n`;\n  \n  if (sandbox === 'e2b') {\n    envContent += `# REQUIRED - E2B Sandboxes\\n`;\n    envContent += `E2B_API_KEY=${answers.e2bApiKey || 'your_e2b_api_key_here'}\\n\\n`;\n  } else if (sandbox === 'vercel') {\n    envContent += `# REQUIRED - Vercel Sandboxes\\n`;\n    if (answers.vercelAuthMethod === 'oidc') {\n      envContent += `# Using OIDC authentication (automatic in Vercel environment)\\n`;\n    } else {\n      envContent += `VERCEL_TEAM_ID=${answers.vercelTeamId || 'your_team_id'}\\n`;\n      envContent += `VERCEL_PROJECT_ID=${answers.vercelProjectId || 'your_project_id'}\\n`;\n      envContent += `VERCEL_TOKEN=${answers.vercelToken || 'your_access_token'}\\n`;\n    }\n    envContent += '\\n';\n  }\n  \n  // Optional AI provider keys\n  envContent += `# OPTIONAL - AI Providers\\n`;\n  \n  if (answers.anthropicApiKey) {\n    envContent += `ANTHROPIC_API_KEY=${answers.anthropicApiKey}\\n`;\n  } else {\n    envContent += `# ANTHROPIC_API_KEY=your_anthropic_api_key_here\\n`;\n  }\n  \n  if (answers.openaiApiKey) {\n    envContent += `OPENAI_API_KEY=${answers.openaiApiKey}\\n`;\n  } else {\n    envContent += `# OPENAI_API_KEY=your_openai_api_key_here\\n`;\n  }\n  \n  if (answers.geminiApiKey) {\n    envContent += `GEMINI_API_KEY=${answers.geminiApiKey}\\n`;\n  } else {\n    envContent += `# GEMINI_API_KEY=your_gemini_api_key_here\\n`;\n  }\n  \n  if (answers.groqApiKey) {\n    envContent += `GROQ_API_KEY=${answers.groqApiKey}\\n`;\n  } else {\n    envContent += `# GROQ_API_KEY=your_groq_api_key_here\\n`;\n  }\n  \n  await fs.writeFile(path.join(projectPath, '.env'), envContent);\n  await fs.writeFile(path.join(projectPath, '.env.example'), envContent.replace(/=.+/g, '=your_key_here'));\n}\n\nasync function createEnvExample(projectPath, sandbox) {\n  let envContent = '# Open Lovable Configuration\\n\\n';\n  \n  envContent += `# Sandbox Provider\\n`;\n  envContent += `SANDBOX_PROVIDER=${sandbox}\\n\\n`;\n  \n  envContent += `# REQUIRED - Web scraping for cloning websites\\n`;\n  envContent += `# Get yours at https://firecrawl.dev\\n`;\n  envContent += `FIRECRAWL_API_KEY=your_firecrawl_api_key_here\\n\\n`;\n  \n  if (sandbox === 'e2b') {\n    envContent += `# REQUIRED - Sandboxes for code execution\\n`;\n    envContent += `# Get yours at https://e2b.dev\\n`;\n    envContent += `E2B_API_KEY=your_e2b_api_key_here\\n\\n`;\n  } else if (sandbox === 'vercel') {\n    envContent += `# REQUIRED - Vercel Sandboxes\\n`;\n    envContent += `# Option 1: OIDC (automatic in Vercel environment)\\n`;\n    envContent += `# Option 2: Personal Access Token\\n`;\n    envContent += `VERCEL_TEAM_ID=your_team_id\\n`;\n    envContent += `VERCEL_PROJECT_ID=your_project_id\\n`;\n    envContent += `VERCEL_TOKEN=your_access_token\\n\\n`;\n  }\n  \n  envContent += `# OPTIONAL - AI Providers (need at least one)\\n`;\n  envContent += `# Get yours at https://console.anthropic.com\\n`;\n  envContent += `ANTHROPIC_API_KEY=your_anthropic_api_key_here\\n\\n`;\n  envContent += `# Get yours at https://platform.openai.com\\n`;\n  envContent += `OPENAI_API_KEY=your_openai_api_key_here\\n\\n`;\n  envContent += `# Get yours at https://aistudio.google.com/app/apikey\\n`;\n  envContent += `GEMINI_API_KEY=your_gemini_api_key_here\\n\\n`;\n  envContent += `# Get yours at https://console.groq.com\\n`;\n  envContent += `GROQ_API_KEY=your_groq_api_key_here\\n`;\n  \n  await fs.writeFile(path.join(projectPath, '.env.example'), envContent);\n}\n\nasync function updatePackageJson(projectPath, name) {\n  const packageJsonPath = path.join(projectPath, 'package.json');\n  \n  if (await fs.pathExists(packageJsonPath)) {\n    const packageJson = await fs.readJson(packageJsonPath);\n    packageJson.name = name;\n    await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });\n  }\n}\n\nasync function updateAppConfig(projectPath, sandbox) {\n  const configPath = path.join(projectPath, 'config', 'app.config.ts');\n  \n  if (await fs.pathExists(configPath)) {\n    let content = await fs.readFile(configPath, 'utf-8');\n    \n    // Add sandbox provider configuration\n    const sandboxConfig = `\n  // Sandbox Provider Configuration\n  sandboxProvider: process.env.SANDBOX_PROVIDER || '${sandbox}',\n`;\n    \n    // Insert after the opening of appConfig\n    content = content.replace(\n      'export const appConfig = {',\n      `export const appConfig = {${sandboxConfig}`\n    );\n    \n    await fs.writeFile(configPath, content);\n  }\n}"
  },
  {
    "path": "packages/create-open-lovable/lib/prompts.js",
    "content": "export function getPrompts(config) {\n  const prompts = [];\n\n  if (!config.name) {\n    prompts.push({\n      type: 'input',\n      name: 'name',\n      message: 'Project name:',\n      default: 'my-open-lovable',\n      validate: (input) => {\n        if (!input || input.trim() === '') {\n          return 'Project name is required';\n        }\n        if (!/^[a-z0-9-_]+$/i.test(input)) {\n          return 'Project name can only contain letters, numbers, hyphens, and underscores';\n        }\n        return true;\n      }\n    });\n  }\n\n  if (!config.sandbox) {\n    prompts.push({\n      type: 'list',\n      name: 'sandbox',\n      message: 'Choose your sandbox provider:',\n      choices: [\n        {\n          name: 'E2B - Full-featured development sandboxes',\n          value: 'e2b',\n          short: 'E2B'\n        },\n        {\n          name: 'Vercel - Lightweight ephemeral VMs',\n          value: 'vercel',\n          short: 'Vercel'\n        }\n      ],\n      default: 'e2b'\n    });\n  }\n\n  prompts.push({\n    type: 'confirm',\n    name: 'configureEnv',\n    message: 'Would you like to configure API keys now?',\n    default: true\n  });\n\n  return prompts;\n}\n\nexport function getEnvPrompts(provider) {\n  const prompts = [];\n\n  // Always include Firecrawl API key\n  prompts.push({\n    type: 'input',\n    name: 'firecrawlApiKey',\n    message: 'Firecrawl API key (for web scraping):',\n    validate: (input) => {\n      if (!input || input.trim() === '') {\n        return 'Firecrawl API key is required for web scraping functionality';\n      }\n      return true;\n    }\n  });\n\n  if (provider === 'e2b') {\n    prompts.push({\n      type: 'input',\n      name: 'e2bApiKey',\n      message: 'E2B API key:',\n      validate: (input) => {\n        if (!input || input.trim() === '') {\n          return 'E2B API key is required';\n        }\n        return true;\n      }\n    });\n  } else if (provider === 'vercel') {\n    prompts.push({\n      type: 'list',\n      name: 'vercelAuthMethod',\n      message: 'Vercel authentication method:',\n      choices: [\n        {\n          name: 'OIDC Token (automatic in Vercel environment)',\n          value: 'oidc',\n          short: 'OIDC'\n        },\n        {\n          name: 'Personal Access Token',\n          value: 'pat',\n          short: 'PAT'\n        }\n      ]\n    });\n\n    prompts.push({\n      type: 'input',\n      name: 'vercelTeamId',\n      message: 'Vercel Team ID:',\n      when: (answers) => answers.vercelAuthMethod === 'pat',\n      validate: (input) => {\n        if (!input || input.trim() === '') {\n          return 'Team ID is required for PAT authentication';\n        }\n        return true;\n      }\n    });\n\n    prompts.push({\n      type: 'input',\n      name: 'vercelProjectId',\n      message: 'Vercel Project ID:',\n      when: (answers) => answers.vercelAuthMethod === 'pat',\n      validate: (input) => {\n        if (!input || input.trim() === '') {\n          return 'Project ID is required for PAT authentication';\n        }\n        return true;\n      }\n    });\n\n    prompts.push({\n      type: 'input',\n      name: 'vercelToken',\n      message: 'Vercel Access Token:',\n      when: (answers) => answers.vercelAuthMethod === 'pat',\n      validate: (input) => {\n        if (!input || input.trim() === '') {\n          return 'Access token is required for PAT authentication';\n        }\n        return true;\n      }\n    });\n  }\n\n  // Optional AI provider keys\n  prompts.push({\n    type: 'confirm',\n    name: 'addAiKeys',\n    message: 'Would you like to add AI provider API keys?',\n    default: true\n  });\n\n  prompts.push({\n    type: 'checkbox',\n    name: 'aiProviders',\n    message: 'Select AI providers to configure:',\n    when: (answers) => answers.addAiKeys,\n    choices: [\n      { name: 'Anthropic (Claude)', value: 'anthropic' },\n      { name: 'OpenAI (GPT)', value: 'openai' },\n      { name: 'Google (Gemini)', value: 'gemini' },\n      { name: 'Groq', value: 'groq' }\n    ]\n  });\n\n  prompts.push({\n    type: 'input',\n    name: 'anthropicApiKey',\n    message: 'Anthropic API key:',\n    when: (answers) => answers.aiProviders && answers.aiProviders.includes('anthropic')\n  });\n\n  prompts.push({\n    type: 'input',\n    name: 'openaiApiKey',\n    message: 'OpenAI API key:',\n    when: (answers) => answers.aiProviders && answers.aiProviders.includes('openai')\n  });\n\n  prompts.push({\n    type: 'input',\n    name: 'geminiApiKey',\n    message: 'Gemini API key:',\n    when: (answers) => answers.aiProviders && answers.aiProviders.includes('gemini')\n  });\n\n  prompts.push({\n    type: 'input',\n    name: 'groqApiKey',\n    message: 'Groq API key:',\n    when: (answers) => answers.aiProviders && answers.aiProviders.includes('groq')\n  });\n\n  return prompts;\n}"
  },
  {
    "path": "packages/create-open-lovable/package.json",
    "content": "{\n  \"name\": \"create-open-lovable\",\n  \"version\": \"1.0.0\",\n  \"description\": \"CLI to bootstrap Open Lovable with your choice of sandbox provider\",\n  \"type\": \"module\",\n  \"main\": \"index.js\",\n  \"bin\": {\n    \"create-open-lovable\": \"./index.js\"\n  },\n  \"scripts\": {\n    \"test\": \"node index.js --dry-run\"\n  },\n  \"keywords\": [\n    \"lovable\",\n    \"sandbox\",\n    \"e2b\",\n    \"vercel\",\n    \"ai\",\n    \"code-generation\"\n  ],\n  \"author\": \"\",\n  \"license\": \"MIT\",\n  \"dependencies\": {\n    \"chalk\": \"^5.3.0\",\n    \"commander\": \"^11.1.0\",\n    \"fs-extra\": \"^11.2.0\",\n    \"inquirer\": \"^9.2.12\",\n    \"ora\": \"^7.0.1\"\n  },\n  \"engines\": {\n    \"node\": \">=16.0.0\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  }\n}"
  },
  {
    "path": "packages/create-open-lovable/templates/e2b/.env.example",
    "content": "# Open Lovable Configuration - E2B Provider\n\n# Sandbox Provider\nSANDBOX_PROVIDER=e2b\n\n# REQUIRED - Sandboxes for code execution\n# Get yours at https://e2b.dev\nE2B_API_KEY=your_e2b_api_key_here\n\n# REQUIRED - Web scraping for cloning websites\n# Get yours at https://firecrawl.dev\nFIRECRAWL_API_KEY=your_firecrawl_api_key_here\n\n# OPTIONAL - AI Providers (need at least one)\n# Get yours at https://console.anthropic.com\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Get yours at https://platform.openai.com\nOPENAI_API_KEY=your_openai_api_key_here\n\n# Get yours at https://aistudio.google.com/app/apikey\nGEMINI_API_KEY=your_gemini_api_key_here\n\n# Get yours at https://console.groq.com\nGROQ_API_KEY=your_groq_api_key_here"
  },
  {
    "path": "packages/create-open-lovable/templates/e2b/README.md",
    "content": "# Open Lovable - E2B Sandbox\n\nThis project is configured to use E2B sandboxes for code execution.\n\n## Setup\n\n1. Get your E2B API key from [https://e2b.dev](https://e2b.dev)\n2. Get your Firecrawl API key from [https://firecrawl.dev](https://firecrawl.dev)\n3. Copy `.env.example` to `.env` and add your API keys\n4. Run `npm install` to install dependencies\n5. Run `npm run dev` to start the development server\n\n## E2B Features\n\n- Full-featured development sandboxes\n- 15-minute default timeout (configurable)\n- Persistent file system during session\n- Support for complex package installations\n- Built-in Python runtime for code execution\n\n## Configuration\n\nYou can adjust E2B settings in `config/app.config.ts`:\n\n- `timeoutMinutes`: Sandbox session timeout (default: 15)\n- `vitePort`: Development server port (default: 5173)\n- `viteStartupDelay`: Time to wait for Vite to start (default: 7000ms)\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. Verify your E2B API key is valid\n2. Check the console for detailed error messages\n3. Ensure you have a stable internet connection\n4. Try refreshing the page and creating a new sandbox\n\nFor more help, visit the [E2B documentation](https://docs.e2b.dev)."
  },
  {
    "path": "packages/create-open-lovable/templates/vercel/.env.example",
    "content": "# Open Lovable Configuration - Vercel Provider\n\n# Sandbox Provider\nSANDBOX_PROVIDER=vercel\n\n# REQUIRED - Vercel Sandboxes\n# Option 1: OIDC Token (automatic in Vercel environment)\n# Option 2: Personal Access Token (configure below)\nVERCEL_TEAM_ID=your_team_id\nVERCEL_PROJECT_ID=your_project_id\nVERCEL_TOKEN=your_access_token\n\n# REQUIRED - Web scraping for cloning websites\n# Get yours at https://firecrawl.dev\nFIRECRAWL_API_KEY=your_firecrawl_api_key_here\n\n# OPTIONAL - AI Providers (need at least one)\n# Get yours at https://console.anthropic.com\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Get yours at https://platform.openai.com\nOPENAI_API_KEY=your_openai_api_key_here\n\n# Get yours at https://aistudio.google.com/app/apikey\nGEMINI_API_KEY=your_gemini_api_key_here\n\n# Get yours at https://console.groq.com\nGROQ_API_KEY=your_groq_api_key_here"
  },
  {
    "path": "packages/create-open-lovable/templates/vercel/README.md",
    "content": "# Open Lovable - Vercel Sandbox\n\nThis project is configured to use Vercel Sandboxes for code execution.\n\n## Setup\n\n1. Configure Vercel authentication (see below)\n2. Get your Firecrawl API key from [https://firecrawl.dev](https://firecrawl.dev)\n3. Copy `.env.example` to `.env` and add your credentials\n4. Run `npm install` to install dependencies\n5. Run `npm run dev` to start the development server\n\n## Vercel Authentication\n\n### Option 1: OIDC Token (Automatic for Vercel deployments)\nWhen running in a Vercel environment, authentication happens automatically via OIDC tokens. No configuration needed!\n\n### Option 2: Personal Access Token (For local development)\n1. Create a Personal Access Token in your [Vercel account settings](https://vercel.com/account/tokens)\n2. Get your Team ID from your [team settings](https://vercel.com/teams)\n3. Create a project and get the Project ID\n4. Add these to your `.env` file:\n   - `VERCEL_TOKEN`\n   - `VERCEL_TEAM_ID`\n   - `VERCEL_PROJECT_ID`\n\n## Vercel Sandbox Features\n\n- Lightweight ephemeral Linux VMs\n- Powered by Firecracker MicroVMs\n- 5-minute default timeout (max 45 minutes)\n- 8 vCPUs maximum\n- Root access for package installation\n- Node 22 runtime included\n\n## Configuration\n\nYou can adjust Vercel settings in `config/app.config.ts`:\n\n- `maxDuration`: Sandbox session timeout (default: 5 minutes)\n- Authentication method (OIDC or PAT)\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. Verify your authentication credentials\n2. Check if you're using the correct authentication method\n3. Ensure your Vercel account has sandbox access\n4. Check the console for detailed error messages\n\nFor more help, visit the [Vercel Sandbox documentation](https://vercel.com/docs/vercel-sandbox)."
  },
  {
    "path": "postcss.config.mjs",
    "content": "export default {\n  plugins: {\n    \"postcss-import\": {},\n    \"postcss-nesting\": {},\n    \"tailwindcss\": {},\n    \"autoprefixer\": {},\n  },\n};\n"
  },
  {
    "path": "public/compressor.json",
    "content": "{\n  \"configs\": [\n    {\n      \"extension\": \"avif\",\n      \"quality\": 80,\n      \"effort\": 4,\n      \"scale\": 2\n    },\n    {\n      \"extension\": \"webp\",\n      \"quality\": 85,\n      \"effort\": 4,\n      \"scale\": 2\n    }\n  ]\n}"
  },
  {
    "path": "styles/additional-styles/custom-fonts.css",
    "content": ""
  },
  {
    "path": "styles/additional-styles/theme.css",
    "content": ".form-input:focus,\n.form-textarea:focus,\n.form-multiselect:focus,\n.form-select:focus,\n.form-checkbox:focus,\n.form-radio:focus {\n  @apply ring-0;\n}\n\n/* Hamburger button */\n.hamburger svg > *:nth-child(1),\n.hamburger svg > *:nth-child(2),\n.hamburger svg > *:nth-child(3) {\n  transform-origin: center;\n  transform: rotate(0deg);\n}\n\n.hamburger svg > *:nth-child(1) {\n  transition:\n    y 0.1s 0.25s ease-in,\n    transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19),\n    opacity 0.1s ease-in;\n}\n\n.hamburger svg > *:nth-child(2) {\n  transition: transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);\n}\n\n.hamburger svg > *:nth-child(3) {\n  transition:\n    y 0.1s 0.25s ease-in,\n    transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19),\n    width 0.1s 0.25s ease-in;\n}\n\n.hamburger.active svg > *:nth-child(1) {\n  opacity: 0;\n  y: 11;\n  transform: rotate(225deg);\n  transition:\n    y 0.1s ease-out,\n    transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1),\n    opacity 0.1s 0.12s ease-out;\n}\n\n.hamburger.active svg > *:nth-child(2) {\n  transform: rotate(225deg);\n  transition: transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n\n.hamburger.active svg > *:nth-child(3) {\n  y: 11;\n  transform: rotate(135deg);\n  transition:\n    y 0.1s ease-out,\n    transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1),\n    width 0.1s ease-out;\n}\n"
  },
  {
    "path": "styles/additional-styles/utility-patterns.css",
    "content": "/* Typography */\n.h1 {\n  @apply text-5xl font-bold;\n}\n\n.h2 {\n  @apply text-4xl font-bold;\n}\n\n.h3 {\n  @apply text-3xl font-bold;\n}\n\n.h4 {\n  @apply text-2xl font-bold;\n}\n\n@screen md {\n  .h1 {\n    @apply text-6xl;\n  }\n\n  .h2 {\n    @apply text-5xl;\n  }\n\n  .h3 {\n    @apply text-4xl;\n  }\n}\n\n/* Buttons */\n.btn,\n.btn-sm {\n  @apply text-sm font-medium inline-flex items-center justify-center border border-transparent rounded-md tracking-normal transition;\n}\n\n.btn {\n  @apply px-4 py-2;\n}\n\n.btn-sm {\n  @apply px-2 py-1;\n}\n\n/* Forms */\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n  -webkit-appearance: none;\n}\n\n.form-input,\n.form-textarea,\n.form-multiselect,\n.form-select,\n.form-checkbox,\n.form-radio {\n  @apply bg-white border border-zinc-200 focus:border-zinc-400 shadow shadow-black/5;\n}\n\n.form-input,\n.form-textarea,\n.form-multiselect,\n.form-select,\n.form-checkbox {\n  @apply rounded;\n}\n\n.form-input,\n.form-textarea,\n.form-multiselect,\n.form-select {\n  @apply text-zinc-600 text-sm px-4 py-2;\n}\n\n.form-input,\n.form-textarea {\n  @apply placeholder-zinc-400;\n}\n\n.form-select {\n  @apply pr-10;\n}\n\n.form-checkbox,\n.form-radio {\n  @apply text-zinc-800;\n}\n\n.form-checkbox {\n  @apply rounded-sm;\n}\n\n/* Fix input cursor visibility on Windows Chrome */\ninput,\ntextarea {\n  caret-color: hsl(var(--foreground));\n}\n\n/* Chrome, Safari and Opera */\n.no-scrollbar::-webkit-scrollbar {\n  display: none;\n}\n\n.no-scrollbar {\n  -ms-overflow-style: none;\n  /* IE and Edge */\n  scrollbar-width: none;\n  /* Firefox */\n}\n"
  },
  {
    "path": "styles/chrome-bug.css",
    "content": "/**\n * Chrome has a bug with transitions on load since 2012!\n *\n * To prevent a \"pop\" of content, you have to disable all transitions until\n * the page is done loading.\n *\n * https://lab.laukstein.com/bug/input\n * https://twitter.com/timer150/status/1345217126680899584\n */\nbody.loading * {\n  transition: none !important;\n}\n"
  },
  {
    "path": "styles/colors.json",
    "content": "{\n  \"heat-4\": {\n    \"hex\": \"fa5d190a\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.039216\"\n  },\n  \"heat-8\": {\n    \"hex\": \"fa5d1914\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.078431\"\n  },\n  \"heat-12\": {\n    \"hex\": \"fa5d191f\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.121569\"\n  },\n  \"heat-16\": {\n    \"hex\": \"fa5d1929\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.160784\"\n  },\n  \"heat-20\": {\n    \"hex\": \"fa5d1933\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.200000\"\n  },\n  \"heat-40\": {\n    \"hex\": \"fa5d1966\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.400000\"\n  },\n  \"heat-90\": {\n    \"hex\": \"fa5d19e6\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 0.900000\"\n  },\n  \"heat-100\": {\n    \"hex\": \"fa5d19ff\",\n    \"p3\": \"0.980392 0.364706 0.098039 / 1.000000\"\n  },\n  \"accent-black\": {\n    \"hex\": \"262626ff\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 1.000000\"\n  },\n  \"accent-white\": {\n    \"hex\": \"ffffffff\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 1.000000\"\n  },\n  \"accent-amethyst\": {\n    \"hex\": \"9061ffff\",\n    \"p3\": \"0.564706 0.380392 1.000000 / 1.000000\"\n  },\n  \"accent-bluetron\": {\n    \"hex\": \"2a6dfbff\",\n    \"p3\": \"0.164706 0.427451 0.984314 / 1.000000\"\n  },\n  \"accent-crimson\": {\n    \"hex\": \"eb3424ff\",\n    \"p3\": \"0.921569 0.203922 0.141176 / 1.000000\"\n  },\n  \"accent-forest\": {\n    \"hex\": \"42c366ff\",\n    \"p3\": \"0.258824 0.764706 0.400000 / 1.000000\"\n  },\n  \"accent-honey\": {\n    \"hex\": \"ecb730ff\",\n    \"p3\": \"0.925490 0.717647 0.188235 / 1.000000\"\n  },\n  \"black-alpha-1\": {\n    \"hex\": \"00000003\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.011765\"\n  },\n  \"black-alpha-2\": {\n    \"hex\": \"00000005\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.019608\"\n  },\n  \"black-alpha-3\": {\n    \"hex\": \"00000008\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.031373\"\n  },\n  \"black-alpha-4\": {\n    \"hex\": \"0000000a\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.039216\"\n  },\n  \"black-alpha-5\": {\n    \"hex\": \"0000000d\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.050980\"\n  },\n  \"black-alpha-6\": {\n    \"hex\": \"0000000f\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.058824\"\n  },\n  \"black-alpha-7\": {\n    \"hex\": \"00000012\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.070588\"\n  },\n  \"black-alpha-8\": {\n    \"hex\": \"00000014\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.078431\"\n  },\n  \"black-alpha-10\": {\n    \"hex\": \"0000001a\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.101961\"\n  },\n  \"black-alpha-12\": {\n    \"hex\": \"0000001f\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.121569\"\n  },\n  \"black-alpha-16\": {\n    \"hex\": \"00000029\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.160784\"\n  },\n  \"black-alpha-20\": {\n    \"hex\": \"00000033\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.200000\"\n  },\n  \"black-alpha-24\": {\n    \"hex\": \"0000003d\",\n    \"p3\": \"0.000000 0.000000 0.000000 / 0.239216\"\n  },\n  \"black-alpha-32\": {\n    \"hex\": \"26262652\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.321569\"\n  },\n  \"black-alpha-40\": {\n    \"hex\": \"26262666\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.400000\"\n  },\n  \"black-alpha-48\": {\n    \"hex\": \"2626267a\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.478431\"\n  },\n  \"black-alpha-56\": {\n    \"hex\": \"2626268f\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.560784\"\n  },\n  \"black-alpha-64\": {\n    \"hex\": \"262626a3\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.639216\"\n  },\n  \"black-alpha-72\": {\n    \"hex\": \"262626b8\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.721569\"\n  },\n  \"black-alpha-88\": {\n    \"hex\": \"262626e0\",\n    \"p3\": \"0.149020 0.149020 0.149020 / 0.878431\"\n  },\n  \"white-alpha-56\": {\n    \"hex\": \"ffffff8f\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 0.560784\"\n  },\n  \"white-alpha-72\": {\n    \"hex\": \"ffffffb8\",\n    \"p3\": \"1.000000 1.000000 1.000000 / 0.721569\"\n  },\n  \"border-faint\": {\n    \"hex\": \"edededff\",\n    \"p3\": \"0.929412 0.929412 0.929412 / 1.000000\"\n  },\n  \"border-muted\": {\n    \"hex\": \"e8e8e8ff\",\n    \"p3\": \"0.909804 0.909804 0.909804 / 1.000000\"\n  },\n  \"border-loud\": {\n    \"hex\": \"e6e6e6ff\",\n    \"p3\": \"0.901961 0.901961 0.901961 / 1.000000\"\n  },\n  \"illustrations-faint\": {\n    \"hex\": \"edededff\",\n    \"p3\": \"0.929412 0.929412 0.929412 / 1.000000\"\n  },\n  \"illustrations-muted\": {\n    \"hex\": \"e6e6e6ff\",\n    \"p3\": \"0.901961 0.901961 0.901961 / 1.000000\"\n  },\n  \"illustrations-default\": {\n    \"hex\": \"dbdbdbff\",\n    \"p3\": \"0.858824 0.858824 0.858824 / 1.000000\"\n  },\n  \"background-lighter\": {\n    \"hex\": \"fbfbfbff\",\n    \"p3\": \"0.984314 0.984314 0.984314 / 1.000000\"\n  },\n  \"background-base\": {\n    \"hex\": \"f9f9f9ff\",\n    \"p3\": \"0.976471 0.976471 0.976471 / 1.000000\"\n  }\n}"
  },
  {
    "path": "styles/components/.cursor/rules/component-styles.md",
    "content": "# Component Styles Rules\n\nWhen working with component-specific CSS in styles/components:\n\n## Architecture\nEach component that requires custom CSS has a corresponding file:\n- `button.css` - Fire-inspired button shadows and effects\n- `modal.css` - Modal animations and backdrop effects\n- `spinner.css` - Custom loading animations\n\n## Import Strategy\nAll component CSS files are imported in `styles/main.css`:\n```css\n/* Component styles */\n@import \"./components/button.css\";\n@import \"./components/modal.css\";\n@import \"./components/spinner.css\";\n```\n\n## Guidelines\n1. **Only create CSS files for components that need them** - If Tailwind utilities suffice, don't create a CSS file\n2. **Use P3 colors with sRGB fallbacks** - Ensure wide gamut displays get enhanced colors\n3. **Keep animations performant** - Use transform and opacity for animations\n4. **Component classes should be prefixed** - e.g., `.button-primary`, `.modal-backdrop`\n\n## P3 Color Example\n```css\n.button-primary {\n  background: #fa5d19; /* sRGB fallback */\n  background: color(display-p3 0.9816 0.3634 0.0984); /* P3 color */\n}\n```"
  },
  {
    "path": "styles/components/button.css",
    "content": ".button {\n  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.1s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.1s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:active {\n  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1),\n    scale 0.05s cubic-bezier(0.25, 0.1, 0.25, 1),\n    box-shadow 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button-primary {\n  background: #ff4c00;\n  background: color(display-p3 0.9816 0.3634 0.0984);\n\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:hover {\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 4px 8px 0px rgba(255, 77, 0, 0.16),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 4px 8px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-primary:active {\n  box-shadow: 0px -6px 12px 0px rgba(255, 0, 0, 0.2) inset,\n    0px 2px 4px 0px rgba(255, 77, 0, 0.12),\n    0px 1px 1px 0px rgba(255, 77, 0, 0.12),\n    0px 0.5px 0.5px 0px rgba(255, 77, 0, 0.16),\n    0px 0.25px 0.25px 0px rgba(255, 77, 0, 0.2);\n  box-shadow: 0px -6px 12px 0px color(display-p3 0.9804 0.1127 0.098 / 0.2) inset,\n    0px 2px 4px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 1px 1px 0px color(display-p3 0.9804 0.3647 0.098 / 0.12),\n    0px 0.5px 0.5px 0px color(display-p3 0.9804 0.3647 0.098 / 0.16),\n    0px 0.25px 0.25px 0px color(display-p3 0.9804 0.3647 0.098 / 0.2);\n}\n\n.button-background {\n  background: linear-gradient(to bottom, white, transparent);\n\n  opacity: 0.06;\n\n  transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n\n.button:hover .button-background {\n  opacity: 0.08;\n}\n\n.button:active .button-background {\n  opacity: 0;\n\n  transition: opacity 0.05s cubic-bezier(0.25, 0.1, 0.25, 1);\n}\n"
  },
  {
    "path": "styles/components/code.css",
    "content": ".string,\n.language-html .tag:not(.punctuation, .attr-name, .attr-value, .special-attr) {\n  color: var(--heat-100) !important;\n}\n\n.punctuation,\n.operator {\n  color: #c2c2c2 !important;\n}\n\n.language-html .attr-name {\n  color: var(--black-alpha-64);\n}\n\n.comment {\n  color: #999999 !important;\n}\n\ncode:not(.language-html) .property:not(.literal-property),\n.class-name,\ncode:not(.language-html) .function,\n.language-json .boolean {\n  color: #9061ff;\n  color: color(display-p3 0.566 0.38 1);\n}\n\n.language-json .property {\n  color: inherit !important;\n}\n\n.prismjs {\n  padding-top: 20px;\n  @apply text-mono-medium font-mono;\n}\n\n.prismjs code {\n  color: var(--accent-black) !important;\n}\n\n.linenumber {\n  padding: 0;\n  color:white!important;\n  font-style: normal;\n}\n"
  },
  {
    "path": "styles/components/index.css",
    "content": "/* Component-specific styles from firecrawl-marketing */\n\n/* UI Components (for Dashboard v2) */\n@import \"./button.css\";\n@import \"./code.css\";\n\n/* Additional component CSS will be added as we migrate more components */\n/* @import \"./modal.css\"; */\n/* @import \"./spinner.css\"; */\n/* @import \"./input.css\"; */"
  },
  {
    "path": "styles/design-system/.cursor/rules/design-system.md",
    "content": "# Firecrawl Design System Rules\n\nWhen working with the fire-inspired design system:\n\n## Important Note\n- For existing pages: Continue using `styles/main.css`\n- For Dashboard v2 pages: Import `styles/dashboard.css` in the layout\n\n## Color System\nUse CSS custom properties with P3 color space for richer colors:\n- **Heat colors**: `--heat-4` through `--heat-100` (fire orange shades)\n- **Accent colors**: `--accent-black`, `--accent-amethyst`, `--accent-bluetron`, `--accent-crimson`\n- **Alpha variants**: Black and white with various opacity levels\n- **UI colors**: Borders, backgrounds, illustrations\n- All colors have sRGB fallbacks for browser compatibility\n\n## Typography\n**Font Families:**\n- Display: SuisseIntl (weights: 400, 450, 500, 600, 700)\n- Mono: System monospace stack (SF Mono, Monaco, Inconsolata, etc.)\n\n**Type Scale Classes:**\n- Headings: `.title-h1` through `.title-h5`\n- Body: `.body-small`, `.body-medium`, `.body-large`, `.body-x-large`\n- Labels: `.label-small`, `.label-medium`, `.label-large`, `.label-x-large`\n- Mono: `.mono-small`, `.mono-medium`, `.mono-large`\n\n## Utilities\n**Gradients:**\n- `.gradient-fire` - Heat gradient\n- `.gradient-heat` - Subtle heat gradient\n- `.gradient-sunset` - Heat to amethyst\n- `.gradient-ocean` - Blue gradient\n\n**Layout:**\n- `.container-prose` - Max 65ch width\n- `.center-absolute` - Absolute centering\n- `.stack-*` - Vertical spacing\n- `.layout-sidebar` - Sidebar layout pattern\n\n**Effects:**\n- `.blur-backdrop` - Backdrop blur\n- `.border-gradient` - Gradient border\n- `.mask-fade-*` - Fade masks\n- `.focus-ring` - Accessible focus states\n- `.dotted-underline` - SVG dotted underline\n\n## Animation Classes\n- `.cursor` - Blinking cursor\n- `.animate-spin-reverse` - Reverse rotation\n- `.animate-flicker` - Fire flicker effect\n- `.animate-glow` - Glowing effect\n- `.transition-*` - Smooth transitions\n\n## Usage Example\n```css\n.fire-button {\n  background: var(--heat-100);\n  color: var(--white);\n  padding: 0.75rem 1.5rem;\n  border-radius: 0.5rem;\n  transition: all 0.3s ease;\n}\n\n.fire-button:hover {\n  background: var(--accent-crimson);\n  box-shadow: 0 0 40px rgba(250, 93, 25, 0.8);\n}\n```\n\n## Component CSS Architecture\nComponent-specific styles go in `styles/components/`:\n- Button.css - Fire-inspired button styles\n- Input.css - Input with heat focus states\n- Modal.css - Modal with fire animations\n\n## Build Optimization\n- PostCSS handles optimization\n- Tailwind v3 purging via content paths in tailwind.config.js\n- P3 color space with automatic sRGB fallbacks\n- Font preloading for performance"
  },
  {
    "path": "styles/design-system/animations.css",
    "content": "/* Animation Utilities */\n\n/* Cursor blink animation */\n.cursor {\n  animation: cursor-blink 0.7s infinite;\n}\n\n@keyframes cursor-blink {\n  0%, 100% {\n    opacity: 0;\n  }\n  50% {\n    opacity: 1;\n  }\n}\n\n/* Reverse spin */\n.animate-spin-reverse {\n  animation: spin-reverse 1s linear infinite;\n}\n\n@keyframes spin-reverse {\n  from {\n    transform: rotate(360deg);\n  }\n}\n\n/* Fire-inspired animations */\n.animate-flicker {\n  animation: flicker 2s ease-in-out infinite;\n}\n\n@keyframes flicker {\n  0%, 100% {\n    opacity: 1;\n  }\n  50% {\n    opacity: 0.8;\n    transform: scale(0.98);\n  }\n}\n\n.animate-glow {\n  animation: glow 2s ease-in-out infinite;\n}\n\n@keyframes glow {\n  0%, 100% {\n    box-shadow: 0 0 20px rgba(250, 93, 25, 0.5);\n  }\n  50% {\n    box-shadow: 0 0 40px rgba(250, 93, 25, 0.8);\n  }\n}\n\n/* Smooth transitions */\n.transition-all {\n  transition: all 0.3s ease;\n}\n\n.transition-colors {\n  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;\n}\n\n.transition-transform {\n  transition: transform 0.3s ease;\n}\n\n.transition-opacity {\n  transition: opacity 0.3s ease;\n}\n\n/* Animation delays */\n.delay-100 {\n  animation-delay: 100ms;\n}\n\n.delay-200 {\n  animation-delay: 200ms;\n}\n\n.delay-300 {\n  animation-delay: 300ms;\n}\n\n.delay-400 {\n  animation-delay: 400ms;\n}\n\n.delay-500 {\n  animation-delay: 500ms;\n}"
  },
  {
    "path": "styles/design-system/base/body.css",
    "content": "/* Body and Global Styles */\n\n/* Hide scrollbars but keep functionality */\n::-webkit-scrollbar {\n  width: 0;\n  height: 0;\n}\n\n::-webkit-scrollbar-thumb:hover,\n::-webkit-scrollbar-thumb:active {\n  background-color: var(--black-alpha-12);\n}\n\n/* Global text rendering */\n* {\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n  text-rendering: optimizeLegibility;\n}\n\n/* Body defaults */\nbody {\n  font-family: var(--font-sans);\n  font-size: 1rem;\n  line-height: 1.5;\n  color: var(--accent-black);\n  background-color: var(--background-base);\n  overflow-anchor: none;\n}\n\n/* Prevent image dragging */\nimg,\nvideo {\n  max-width: unset;\n  user-select: none;\n  -webkit-user-drag: none;\n  -khtml-user-drag: none;\n  -moz-user-drag: none;\n  -o-user-drag: none;\n  user-drag: none;\n}\n\n/* Form elements */\ninput,\ninput:focus,\ntextarea,\ntextarea:focus,\nselect,\nselect:focus {\n  outline: 0;\n}\n\n/* Focus states handled by utilities */\n*:focus {\n  outline: 0;\n}\n\n/* Smooth scrolling */\nhtml {\n  scroll-behavior: smooth;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  html {\n    scroll-behavior: auto;\n  }\n}\n\n/* Section defaults */\nsection {\n  position: relative;\n}\n\n/* Text selection */\nh1, h2, h3, h4, h5, h6, p {\n  user-select: text;\n}\n\n/* Button defaults */\nbutton {\n  text-align: left;\n  user-select: none;\n}\n\n/* Selection color using design system colors */\n*::selection {\n  background-color: var(--heat-20);\n  color: var(--accent-black);\n}\n\n/* Links */\na {\n  color: inherit;\n  text-decoration: none;\n  transition: color 0.2s ease;\n}\n\na:hover {\n  color: var(--heat-100);\n}\n\n/* Code blocks */\ncode {\n  font-family: var(--font-mono);\n  font-size: 0.875em;\n  background-color: var(--black-alpha-4);\n  padding: 0.125rem 0.25rem;\n  border-radius: 0.25rem;\n}\n\npre code {\n  background-color: transparent;\n  padding: 0;\n}\n\n/* Prevent FOUC */\nhtml {\n  visibility: visible !important;\n}\n\n/* Responsive text sizing */\n@media (max-width: 768px) {\n  html {\n    font-size: 15px;\n  }\n}\n\n@media (min-width: 1536px) {\n  html {\n    font-size: 17px;\n  }\n}"
  },
  {
    "path": "styles/design-system/base/layout.css",
    "content": "/* Layout Utilities and Helpers */\n\n/* Container system */\n.container {\n  width: 100%;\n  margin-inline: auto;\n  padding-inline: var(--container-padding, 1rem);\n}\n\n@media (min-width: 640px) {\n  .container {\n    max-width: 640px;\n    padding-inline: 1.5rem;\n  }\n}\n\n@media (min-width: 768px) {\n  .container {\n    max-width: 768px;\n    padding-inline: 2rem;\n  }\n}\n\n@media (min-width: 1024px) {\n  .container {\n    max-width: 1024px;\n  }\n}\n\n@media (min-width: 1280px) {\n  .container {\n    max-width: 1280px;\n  }\n}\n\n@media (min-width: 1536px) {\n  .container {\n    max-width: 1536px;\n  }\n}\n\n/* Layout patterns */\n.layout-grid {\n  display: grid;\n  gap: var(--gap, 1rem);\n}\n\n.layout-flex {\n  display: flex;\n  gap: var(--gap, 1rem);\n}\n\n/* Common grid patterns */\n.grid-cols-auto-fit {\n  grid-template-columns: repeat(auto-fit, minmax(var(--min-width, 250px), 1fr));\n}\n\n.grid-cols-auto-fill {\n  grid-template-columns: repeat(auto-fill, minmax(var(--min-width, 250px), 1fr));\n}\n\n/* Sidebar layouts */\n.layout-sidebar {\n  display: grid;\n  grid-template-columns: var(--sidebar-width, 260px) 1fr;\n  gap: var(--gap, 2rem);\n  align-items: start;\n}\n\n@media (max-width: 1024px) {\n  .layout-sidebar {\n    grid-template-columns: 1fr;\n  }\n}\n\n/* Stack layouts */\n.stack {\n  display: flex;\n  flex-direction: column;\n  gap: var(--gap, 1rem);\n}\n\n.stack-horizontal {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  gap: var(--gap, 1rem);\n}\n\n/* Cluster layout */\n.cluster {\n  display: flex;\n  flex-wrap: wrap;\n  gap: var(--gap, 1rem);\n  align-items: center;\n}\n\n/* Center layout */\n.center {\n  display: grid;\n  place-items: center;\n  min-height: var(--min-height, 100vh);\n}\n\n/* Cover layout */\n.cover {\n  display: flex;\n  flex-direction: column;\n  min-height: var(--min-height, 100vh);\n}\n\n.cover > * {\n  margin-block: 1rem;\n}\n\n.cover > :first-child:not(.centered) {\n  margin-block-start: 0;\n}\n\n.cover > :last-child:not(.centered) {\n  margin-block-end: 0;\n}\n\n.cover > .centered {\n  margin-block: auto;\n}\n\n/* Switcher layout (switches from horizontal to vertical) */\n.switcher {\n  display: flex;\n  flex-wrap: wrap;\n  gap: var(--gap, 1rem);\n}\n\n.switcher > * {\n  flex-grow: 1;\n  flex-basis: calc((var(--threshold, 30rem) - 100%) * 999);\n}\n\n/* Frame layout (for aspect ratios) */\n.frame {\n  aspect-ratio: var(--ratio, 16 / 9);\n  overflow: hidden;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.frame > img,\n.frame > video {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n/* Reel layout (horizontal scroll) */\n.reel {\n  display: flex;\n  gap: var(--gap, 1rem);\n  overflow-x: auto;\n  overflow-y: hidden;\n  scrollbar-width: none;\n  -webkit-overflow-scrolling: touch;\n}\n\n.reel::-webkit-scrollbar {\n  display: none;\n}\n\n.reel > * {\n  flex: 0 0 auto;\n}\n\n/* Full bleed */\n.full-bleed {\n  width: 100vw;\n  margin-inline: calc(50% - 50vw);\n}\n\n/* Visually hidden but accessible */\n.sr-only {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  padding: 0;\n  margin: -1px;\n  overflow: hidden;\n  clip: rect(0, 0, 0, 0);\n  white-space: nowrap;\n  border-width: 0;\n}\n\n/* Skip to content link */\n.skip-link {\n  position: absolute;\n  top: 1rem;\n  left: 1rem;\n  z-index: 999;\n  padding: 0.5rem 1rem;\n  background-color: var(--accent-black);\n  color: var(--white);\n  text-decoration: none;\n  border-radius: 0.25rem;\n  opacity: 0;\n  transform: translateY(-100%);\n  transition: opacity 0.2s, transform 0.2s;\n}\n\n.skip-link:focus {\n  opacity: 1;\n  transform: translateY(0);\n}"
  },
  {
    "path": "styles/design-system/base/reset.css",
    "content": "/* Modern CSS Reset */\n\n/* Box sizing rules */\n*,\n*::before,\n*::after {\n  box-sizing: border-box;\n}\n\n/* Remove default margin */\nbody,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\np,\nfigure,\nblockquote,\ndl,\ndd {\n  margin: 0;\n}\n\n/* Remove list styles on ul, ol elements with a list role */\nul[role='list'],\nol[role='list'] {\n  list-style: none;\n  padding: 0;\n  margin: 0;\n}\n\n/* Set core root defaults */\nhtml:focus-within {\n  scroll-behavior: smooth;\n}\n\n/* Set core body defaults */\nbody {\n  min-height: 100vh;\n  text-rendering: optimizeSpeed;\n  line-height: 1.5;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\n/* A elements that don't have a class get default styles */\na:not([class]) {\n  text-decoration-skip-ink: auto;\n}\n\n/* Make images easier to work with */\nimg,\npicture,\nvideo,\ncanvas,\nsvg {\n  display: block;\n  max-width: 100%;\n}\n\n/* Inherit fonts for inputs and buttons */\ninput,\nbutton,\ntextarea,\nselect {\n  font: inherit;\n}\n\n/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */\n@media (prefers-reduced-motion: reduce) {\n  html:focus-within {\n    scroll-behavior: auto;\n  }\n  \n  *,\n  *::before,\n  *::after {\n    animation-duration: 0.01ms !important;\n    animation-iteration-count: 1 !important;\n    transition-duration: 0.01ms !important;\n    scroll-behavior: auto !important;\n  }\n}\n\n/* Reset button styles */\nbutton {\n  background: none;\n  border: none;\n  padding: 0;\n  cursor: pointer;\n  text-align: inherit;\n  color: inherit;\n}\n\n/* Form elements */\nfieldset {\n  margin: 0;\n  padding: 0;\n  border: 0;\n}\n\n/* Text area */\ntextarea {\n  resize: vertical;\n}\n\n/* Remove default focus styles and add custom ones */\n:focus {\n  outline: none;\n}\n\n:focus-visible {\n  outline: 2px solid var(--heat-100);\n  outline-offset: 2px;\n}\n\n/* Prevent iOS zoom on form focus */\n@media (hover: none) {\n  input[type=\"text\"],\n  input[type=\"email\"],\n  input[type=\"password\"],\n  input[type=\"number\"],\n  input[type=\"tel\"],\n  input[type=\"search\"],\n  input[type=\"url\"],\n  textarea,\n  select {\n    font-size: 16px !important;\n  }\n}"
  },
  {
    "path": "styles/design-system/colors.css",
    "content": "/* Fire Design System Colors */\n/* Define sRGB values first for maximum compatibility */\n:root {\n  /* Base colors */\n  --white: #ffffff;\n  --black: #000000;\n  \n  /* Fire-inspired heat colors */\n  --heat-4: rgba(250, 93, 25, 0.039);\n  --heat-8: rgba(250, 93, 25, 0.078);\n  --heat-12: rgba(250, 93, 25, 0.122);\n  --heat-16: rgba(250, 93, 25, 0.161);\n  --heat-20: rgba(250, 93, 25, 0.200);\n  --heat-40: rgba(250, 93, 25, 0.400);\n  --heat-100: #fa5d19;\n  --heat-200: #ff6600;\n  \n  /* Accent colors */\n  --accent-black: #262626;\n  --accent-white: #ffffff;\n  --accent-amethyst: #9061ff;\n  --accent-bluetron: #2a6dfb;\n  --accent-crimson: #eb3424;\n  \n  /* Black alpha variants */\n  --black-alpha-1: rgba(0, 0, 0, 0.012);\n  --black-alpha-2: rgba(0, 0, 0, 0.020);\n  --black-alpha-3: rgba(0, 0, 0, 0.031);\n  --black-alpha-4: rgba(0, 0, 0, 0.039);\n  --black-alpha-5: rgba(0, 0, 0, 0.051);\n  --black-alpha-6: rgba(0, 0, 0, 0.059);\n  --black-alpha-7: rgba(0, 0, 0, 0.071);\n  --black-alpha-8: rgba(0, 0, 0, 0.078);\n  --black-alpha-10: rgba(0, 0, 0, 0.102);\n  --black-alpha-12: rgba(0, 0, 0, 0.122);\n  --black-alpha-16: rgba(0, 0, 0, 0.161);\n  --black-alpha-20: rgba(0, 0, 0, 0.200);\n  --black-alpha-24: rgba(0, 0, 0, 0.239);\n  --black-alpha-32: rgba(38, 38, 38, 0.322);\n  --black-alpha-40: rgba(38, 38, 38, 0.400);\n  --black-alpha-48: rgba(38, 38, 38, 0.478);\n  --black-alpha-56: rgba(38, 38, 38, 0.561);\n  --black-alpha-64: rgba(38, 38, 38, 0.639);\n  --black-alpha-72: rgba(38, 38, 38, 0.722);\n  --black-alpha-88: rgba(38, 38, 38, 0.878);\n  \n  /* White alpha variants */\n  --white-alpha-56: rgba(255, 255, 255, 0.561);\n  --white-alpha-72: rgba(255, 255, 255, 0.722);\n  \n  /* Border colors */\n  --border-faint: #ededed;\n  --border-muted: #e8e8e8;\n  --border-loud: #e6e6e6;\n  \n  /* Illustration colors */\n  --illustrations-faint: #ededed;\n  --illustrations-muted: #e6e6e6;\n  --illustrations-default: #dbdbdb;\n  \n  /* Background colors */\n  --background-lighter: #fbfbfb;\n  --background-base: #f9f9f9;\n  \n  /* Foreground colors */\n  --foreground: #262626;\n  --foreground-dimmer: rgba(38, 38, 38, 0.722);\n}\n\n/* P3 color space enhancement for supported browsers */\n@supports (color: color(display-p3 1 1 1)) {\n  :root {\n    /* Base colors */\n    --white: color(display-p3 1 1 1);\n    --black: color(display-p3 0 0 0);\n    \n    /* Fire-inspired heat colors */\n    --heat-4: color(display-p3 0.980392 0.364706 0.098039 / 0.039216);\n    --heat-8: color(display-p3 0.980392 0.364706 0.098039 / 0.078431);\n    --heat-12: color(display-p3 0.980392 0.364706 0.098039 / 0.121569);\n    --heat-16: color(display-p3 0.980392 0.364706 0.098039 / 0.160784);\n    --heat-20: color(display-p3 0.980392 0.364706 0.098039 / 0.200000);\n    --heat-40: color(display-p3 0.980392 0.364706 0.098039 / 0.400000);\n    --heat-100: color(display-p3 0.980392 0.364706 0.098039 / 1.000000);\n    --heat-200: color(display-p3 1.000000 0.400000 0.000000 / 1.000000);\n    \n    /* Accent colors */\n    --accent-black: color(display-p3 0.149020 0.149020 0.149020 / 1.000000);\n    --accent-white: color(display-p3 1.000000 1.000000 1.000000 / 1.000000);\n    --accent-amethyst: color(display-p3 0.564706 0.380392 1.000000 / 1.000000);\n    --accent-bluetron: color(display-p3 0.164706 0.427451 0.984314 / 1.000000);\n    --accent-crimson: color(display-p3 0.921569 0.203922 0.141176 / 1.000000);\n    \n    /* Black alpha variants */\n    --black-alpha-1: color(display-p3 0.000000 0.000000 0.000000 / 0.011765);\n    --black-alpha-2: color(display-p3 0.000000 0.000000 0.000000 / 0.019608);\n    --black-alpha-3: color(display-p3 0.000000 0.000000 0.000000 / 0.031373);\n    --black-alpha-4: color(display-p3 0.000000 0.000000 0.000000 / 0.039216);\n    --black-alpha-5: color(display-p3 0.000000 0.000000 0.000000 / 0.050980);\n    --black-alpha-6: color(display-p3 0.000000 0.000000 0.000000 / 0.058824);\n    --black-alpha-7: color(display-p3 0.000000 0.000000 0.000000 / 0.070588);\n    --black-alpha-8: color(display-p3 0.000000 0.000000 0.000000 / 0.078431);\n    --black-alpha-10: color(display-p3 0.000000 0.000000 0.000000 / 0.101961);\n    --black-alpha-12: color(display-p3 0.000000 0.000000 0.000000 / 0.121569);\n    --black-alpha-16: color(display-p3 0.000000 0.000000 0.000000 / 0.160784);\n    --black-alpha-20: color(display-p3 0.000000 0.000000 0.000000 / 0.200000);\n    --black-alpha-24: color(display-p3 0.000000 0.000000 0.000000 / 0.239216);\n    --black-alpha-32: color(display-p3 0.149020 0.149020 0.149020 / 0.321569);\n    --black-alpha-40: color(display-p3 0.149020 0.149020 0.149020 / 0.400000);\n    --black-alpha-48: color(display-p3 0.149020 0.149020 0.149020 / 0.478431);\n    --black-alpha-56: color(display-p3 0.149020 0.149020 0.149020 / 0.560784);\n    --black-alpha-64: color(display-p3 0.149020 0.149020 0.149020 / 0.639216);\n    --black-alpha-72: color(display-p3 0.149020 0.149020 0.149020 / 0.721569);\n    --black-alpha-88: color(display-p3 0.149020 0.149020 0.149020 / 0.878431);\n    \n    /* White alpha variants */\n    --white-alpha-56: color(display-p3 1.000000 1.000000 1.000000 / 0.560784);\n    --white-alpha-72: color(display-p3 1.000000 1.000000 1.000000 / 0.721569);\n    \n    /* Border colors */\n    --border-faint: color(display-p3 0.929412 0.929412 0.929412 / 1.000000);\n    --border-muted: color(display-p3 0.909804 0.909804 0.909804 / 1.000000);\n    --border-loud: color(display-p3 0.901961 0.901961 0.901961 / 1.000000);\n    \n    /* Illustration colors */\n    --illustrations-faint: color(display-p3 0.929412 0.929412 0.929412 / 1.000000);\n    --illustrations-muted: color(display-p3 0.901961 0.901961 0.901961 / 1.000000);\n    --illustrations-default: color(display-p3 0.858824 0.858824 0.858824 / 1.000000);\n    \n    /* Background colors */\n    --background-lighter: color(display-p3 0.984314 0.984314 0.984314 / 1.000000);\n    --background-base: color(display-p3 0.976471 0.976471 0.976471 / 1.000000);\n  }\n}\n\n"
  },
  {
    "path": "styles/design-system/fonts.css",
    "content": "/* Custom Font Faces */\n/* Using Geist fonts via CSS variables from Next.js font loading */\n/* Fonts are loaded in app/layout.tsx and available as:\n   - var(--font-geist-sans)\n   - var(--font-geist-mono)\n   - var(--font-inter)\n   - var(--font-roboto-mono)\n*/"
  },
  {
    "path": "styles/design-system/typography.css",
    "content": "/* Typography System */\n\n/* Font Face Declarations - matching firecrawl-marketing exactly */\n@font-face {\n  font-family: 'SuisseIntl';\n  src: url('/fonts/SuisseIntl/400.woff2') format('woff2');\n  font-weight: 400;\n  font-style: normal;\n  font-display: swap;\n}\n\n@font-face {\n  font-family: 'SuisseIntl';\n  src: url('/fonts/SuisseIntl/450.woff2') format('woff2');\n  font-weight: 450;\n  font-style: normal;\n  font-display: swap;\n}\n\n@font-face {\n  font-family: 'SuisseIntl';\n  src: url('/fonts/SuisseIntl/500.woff2') format('woff2');\n  font-weight: 500;\n  font-style: normal;\n  font-display: swap;\n}\n\n@font-face {\n  font-family: 'SuisseIntl';\n  src: url('/fonts/SuisseIntl/600.woff2') format('woff2');\n  font-weight: 600;\n  font-style: normal;\n  font-display: swap;\n}\n\n@font-face {\n  font-family: 'SuisseIntl';\n  src: url('/fonts/SuisseIntl/700.woff2') format('woff2');\n  font-weight: 700;\n  font-style: normal;\n  font-display: swap;\n}\n\n/* Font Stack Variables */\n:root {\n  --font-sans: 'SuisseIntl', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Roboto Mono', Consolas, monospace;\n}\n\n/* Typography Classes - both semantic and utility variants */\n\n/* Text Utilities */\n.text-balance {\n  text-wrap: balance;\n}\n\n.text-pretty {\n  text-wrap: pretty;\n}\n\n/* Utility text classes matching firecrawl-marketing - extending base classes */\n.title-h1,\n.text-title-h1 {\n  font-size: 4rem; /* 64px */\n  line-height: 1.1;\n  letter-spacing: -0.02em;\n  font-weight: 600;\n}\n\n.title-h2,\n.text-title-h2 {\n  font-size: 2.25rem; /* 36px */\n  line-height: 1.2;\n  letter-spacing: -0.02em;\n  font-weight: 500;\n}\n\n.title-h3,\n.text-title-h3 {\n  font-size: 1.875rem; /* 30px */\n  line-height: 1.25;\n  letter-spacing: -0.02em;\n  font-weight: 500;\n}\n\n.title-h4,\n.text-title-h4 {\n  font-size: 1.375rem; /* 22px */\n  line-height: 1.3;\n  letter-spacing: -0.01em;\n  font-weight: 500;\n}\n\n.title-h5,\n.text-title-h5 {\n  font-size: 1.125rem; /* 18px */\n  line-height: 1.4;\n  letter-spacing: -0.01em;\n  font-weight: 500;\n}\n\n.body-small,\n.text-body-small {\n  font-size: 0.875rem; /* 14px */\n  line-height: 1.5;\n  font-weight: 400;\n}\n\n.body-medium,\n.text-body-medium {\n  font-size: 1rem; /* 16px */\n  line-height: 1.5;\n  font-weight: 400;\n}\n\n.body-large,\n.text-body-large {\n  font-size: 1.125rem; /* 18px */\n  line-height: 1.6;\n  font-weight: 400;\n}\n\n.body-x-large,\n.text-body-x-large {\n  font-size: 1.375rem; /* 22px */\n  line-height: 1.6;\n  font-weight: 400;\n}\n\n.label-small,\n.text-label-small {\n  font-size: 0.9375rem; /* 15px */\n  line-height: 1.4;\n  letter-spacing: 0.02em;\n  font-weight: 450;\n}\n\n.label-medium,\n.text-label-medium {\n  font-size: 1rem; /* 16px */\n  line-height: 1.4;\n  letter-spacing: 0.01em;\n  font-weight: 450;\n}\n\n.label-large,\n.text-label-large {\n  font-size: 1.125rem; /* 18px */\n  line-height: 1.4;\n  font-weight: 450;\n}\n\n.label-x-large,\n.text-label-x-large {\n  font-size: 1.375rem; /* 22px */\n  line-height: 1.4;\n  font-weight: 450;\n}\n\n.mono-small,\n.text-mono-small {\n  font-family: var(--font-mono);\n  font-size: 0.75rem; /* 12px */\n  line-height: 1.5;\n}\n\n.mono-medium,\n.text-mono-medium {\n  font-family: var(--font-mono);\n  font-size: 0.875rem; /* 14px */\n  line-height: 1.5;\n}\n\n.mono-large,\n.text-mono-large {\n  font-family: var(--font-mono);\n  font-size: 1rem; /* 16px */\n  line-height: 1.5;\n}\n\n/* Responsive Typography - matching firecrawl-marketing */\n@media (max-width: 1024px) {\n  .text-body-large {\n    font-size: 18px;\n    font-weight: 400;\n    line-height: 26px;\n    letter-spacing: -0.09px;\n  }\n\n  .text-body-medium {\n    font-size: 16px;\n    font-weight: 400;\n    line-height: 24px;\n    letter-spacing: 0.16px;\n  }\n\n  .text-title-h4 {\n    font-size: 22px;\n    font-weight: 500;\n    line-height: 26px;\n    letter-spacing: -0.22px;\n  }\n\n  .text-body-x-large {\n    font-size: 22px;\n    font-weight: 400;\n    line-height: 30px;\n    letter-spacing: -0.11px;\n  }\n\n  .text-label-small {\n    font-size: 15px;\n    font-weight: 450;\n    line-height: 22px;\n  }\n\n  .text-label-large {\n    font-size: 18px;\n    font-weight: 450;\n    line-height: 26px;\n    letter-spacing: -0.09px;\n  }\n\n  .text-label-x-large {\n    font-size: 22px;\n    font-weight: 450;\n    line-height: 30px;\n    letter-spacing: -0.11px;\n  }\n\n  .text-label-medium {\n    font-size: 16px;\n    font-weight: 450;\n    line-height: 24px;\n  }\n\n  .text-title-h2 {\n    font-size: 36px;\n    font-weight: 500;\n    line-height: 40px;\n    letter-spacing: -0.36px;\n  }\n}"
  },
  {
    "path": "styles/design-system/utilities.css",
    "content": "/* Custom Utility Classes */\n\n/* Gradient utilities */\n.gradient-fire {\n  background: linear-gradient(135deg, var(--heat-100) 0%, var(--accent-crimson) 100%);\n}\n\n.gradient-heat {\n  background: linear-gradient(135deg, var(--heat-20) 0%, var(--heat-100) 100%);\n}\n\n.gradient-sunset {\n  background: linear-gradient(135deg, var(--heat-100) 0%, var(--accent-amethyst) 100%);\n}\n\n.gradient-ocean {\n  background: linear-gradient(135deg, var(--accent-bluetron) 0%, var(--accent-amethyst) 100%);\n}\n\n/* Text gradient */\n.text-gradient {\n  background-clip: text;\n  -webkit-background-clip: text;\n  -webkit-text-fill-color: transparent;\n  background-color: var(--heat-100); /* Fallback */\n}\n\n/* Mask utilities */\n.mask-fade-bottom {\n  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);\n  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);\n}\n\n.mask-fade-edges {\n  mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);\n  -webkit-mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);\n}\n\n.mask-intersect {\n  -webkit-mask-composite: source-in; /* For Chrome */\n  mask-composite: intersect; /* For Firefox */\n}\n\n/* Blur utilities */\n.blur-backdrop {\n  backdrop-filter: blur(10px);\n  -webkit-backdrop-filter: blur(10px);\n}\n\n/* Border utilities */\n.border-gradient {\n  position: relative;\n  background: var(--white);\n  border: 1px solid transparent;\n}\n\n.border-gradient::before {\n  content: '';\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  padding: 1px;\n  background: linear-gradient(135deg, var(--heat-100), var(--accent-crimson));\n  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);\n  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);\n  mask-composite: xor;\n  -webkit-mask-composite: xor;\n  pointer-events: none;\n}\n\n/* Dotted underline - updated from marketing */\n.dotted-underline {\n  position: relative;\n  display: inline-block;\n  line-height: 1.1;\n}\n\n.dotted-underline::before {\n  content: \"\";\n  position: absolute;\n  bottom: -2px;\n  left: 0;\n  width: 100%;\n  height: 1.7px;\n  background-image: url(\"data:image/svg+xml,%3Csvg width='4' height='2' viewBox='0 0 4 2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1.7' height='1.7' rx='0.85' fill='%23D1D1D1' style='fill:%23D1D1D1;fill:color(display-p3 0.8196 0.8196 0.8196);fill-opacity:1;'/%3E%3C/svg%3E%0A\");\n  background-size: 3.4px 1.7px;\n  background-repeat: repeat-x;\n}\n\n/* Container utilities */\n.container-prose {\n  max-width: 65ch;\n  margin-inline: auto;\n}\n\n.container-narrow {\n  max-width: 48rem; /* 768px */\n  margin-inline: auto;\n}\n\n.container-wide {\n  max-width: 80rem; /* 1280px */\n  margin-inline: auto;\n}\n\n/* Centering helpers */\n.center-absolute {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.center-flex {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n/* Spacing utilities */\n.stack-sm > * + * {\n  margin-top: 0.5rem;\n}\n\n.stack-md > * + * {\n  margin-top: 1rem;\n}\n\n.stack-lg > * + * {\n  margin-top: 2rem;\n}\n\n.stack-xl > * + * {\n  margin-top: 3rem;\n}\n\n/* Aspect ratio utilities */\n.aspect-video {\n  aspect-ratio: 16 / 9;\n}\n\n.aspect-square {\n  aspect-ratio: 1 / 1;\n}\n\n.aspect-portrait {\n  aspect-ratio: 3 / 4;\n}\n\n/* Selection color */\n::selection {\n  background-color: var(--heat-20);\n  color: var(--accent-black);\n}\n\n/* Focus visible utilities */\n.focus-ring {\n  outline: 2px solid transparent;\n  outline-offset: 2px;\n}\n\n.focus-ring:focus-visible {\n  outline-color: var(--heat-100);\n}\n\n/* Scrollbar styling */\n.scrollbar-thin {\n  scrollbar-width: thin;\n  scrollbar-color: var(--border-muted) var(--background-lighter);\n}\n\n.scrollbar-thin::-webkit-scrollbar {\n  width: 8px;\n  height: 8px;\n}\n\n.scrollbar-thin::-webkit-scrollbar-track {\n  background: var(--background-lighter);\n}\n\n.scrollbar-thin::-webkit-scrollbar-thumb {\n  background-color: var(--border-muted);\n  border-radius: 4px;\n}\n\n.scrollbar-thin::-webkit-scrollbar-thumb:hover {\n  background-color: var(--border-loud);\n}\n\n/* Animation delay utilities */\n.animation-delay-150 {\n  animation-delay: 150ms;\n}\n\n.animation-delay-300 {\n  animation-delay: 300ms;\n}\n\n.animation-delay-450 {\n  animation-delay: 450ms;\n}\n\n.animation-delay-600 {\n  animation-delay: 600ms;\n}\n\n/* Loading animation helpers */\n.animate-shimmer {\n  background-size: 400% 100%;\n  animation: shimmer 2s ease-in-out infinite;\n}\n\n@keyframes shimmer {\n  0% {\n    background-position: -200% 0;\n  }\n  100% {\n    background-position: 200% 0;\n  }\n}\n\n/* Heat glow effect */\n.heat-glow {\n  box-shadow: 0 0 40px rgba(250, 93, 25, 0.3);\n  animation: heat-glow 3s ease-in-out infinite;\n}\n\n@keyframes heat-glow {\n  0%, 100% {\n    box-shadow: 0 0 20px rgba(250, 93, 25, 0.2);\n  }\n  50% {\n    box-shadow: 0 0 40px rgba(250, 93, 25, 0.4);\n  }\n}"
  },
  {
    "path": "styles/fire.css",
    "content": "/* Fire Design System - New Firecrawl Design System */\n/* This is the new fire-inspired design system used in app and brand pages */\n\n/* ALL @import statements must come FIRST before any other CSS */\n\n/* Fire Design System Base */\n@import \"./design-system/base/reset.css\";\n@import \"./design-system/base/body.css\";\n@import \"./design-system/base/layout.css\";\n\n/* Fire Design System Core */\n@import \"./design-system/fonts.css\";\n@import \"./design-system/colors.css\";\n@import \"./design-system/typography.css\";\n@import \"./design-system/animations.css\";\n@import \"./design-system/utilities.css\";\n\n/* Tailwind CSS - After all imports */\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n/* Container configuration from firecrawl-marketing */\n:root {\n  --container-width: 1112px;\n  --container-width-padding: 1144px;\n}\n\n/* Container implementation matching firecrawl-marketing */\n.container {\n  max-width: min(calc(100% - 32px), var(--container-width));\n  --padding: 16px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n/* Custom container width utilities */\n.cmw-container {\n  max-width: var(--container-width);\n  padding-left: 16px;\n  padding-right: 16px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n@media (max-width: 1024px) {\n  :root {\n    --container-width: 356px;\n    --container-width-padding: var(--container-width);\n  }\n\n  .container {\n    --padding: 0px;\n  }\n}\n\n/* Marketing pattern utilities */\n.overlay {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  border-radius: inherit;\n}\n\n.curvy-rect {\n  contain: layout paint;\n}\n\n/* Fire-specific utilities layer */\n@layer utilities {\n  /* Mask utilities */\n  .mask-intersect {\n    -webkit-mask-composite: source-in; /* For Chrome */\n    mask-composite: intersect; /* Standard */\n  }\n  \n  .mask-subtract {\n    -webkit-mask-composite: source-out; /* For Chrome */\n    mask-composite: subtract; /* Standard */\n  }\n  \n  .mask-union {\n    -webkit-mask-composite: source-over; /* For Chrome */\n    mask-composite: add; /* Standard */\n  }\n\n  /* Fire design pattern utilities */\n  .dotted-underline::before {\n    content: \"\";\n    position: absolute;\n    bottom: -3px;\n    left: 0;\n    width: 100%;\n    height: 1.7px;\n    background-image: url(\"data:image/svg+xml,%3Csvg width='4' height='2' viewBox='0 0 4 2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1.7' height='1.7' rx='0.85' fill='%23D1D1D1' style='fill:%23D1D1D1;fill:color(display-p3 0.8196 0.8196 0.8196);fill-opacity:1;'/%3E%3C/svg%3E%0A\");\n    background-size: 3.4px 1.7px;\n    background-repeat: repeat-x;\n  }\n  \n  /* inside-border styles moved to inside-border-fix.css to avoid conflicts */\n}"
  },
  {
    "path": "styles/inside-border-fix.css",
    "content": "/* Fix for inside-border utility */\n.inside-border {\n  position: relative;\n}\n\n.inside-border::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  border: 1px solid;\n  border-color: inherit;\n  transition: all 0.2s;\n  pointer-events: none;\n}\n\n.inside-border-x {\n  position: relative;\n}\n\n.inside-border-x::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  border-left: 1px solid;\n  border-right: 1px solid;\n  border-color: inherit;\n  transition: all 0.2s;\n  pointer-events: none;\n}\n\n.inside-border-y {\n  position: relative;\n}\n\n.inside-border-y::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  border-top: 1px solid;\n  border-bottom: 1px solid;\n  border-color: inherit;\n  transition: all 0.2s;\n  pointer-events: none;\n}"
  },
  {
    "path": "styles/main.css",
    "content": "/* Fire Design System - Must be imported first for color definitions */\n@import \"./fire.css\";\n@import \"./components/index.css\";\n@import \"./inside-border-fix.css\";\n\n/* Additional styles */\n@import \"additional-styles/utility-patterns.css\";\n@import \"additional-styles/theme.css\";\n\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n\n.animated {\n  -webkit-animation-duration: 1s;\n  animation-duration: 1s;\n  -webkit-animation-duration: 1s;\n  animation-duration: 1s;\n  -webkit-animation-fill-mode: both;\n  animation-fill-mode: both;\n}\n\n.height-screen-helper {\n  min-height: calc(100vh - 80px);\n}\n\n@layer base {\n  :root {\n    --background: 0 0% 100%;\n    --foreground: 240 10% 3.9%;\n\n    --card: 0 0% 100%;\n    --card-foreground: 240 10% 3.9%;\n\n    --popover: 0 0% 100%;\n    --popover-foreground: 240 10% 3.9%;\n\n    --primary: 240 5.9% 10%;\n    --primary-foreground: 0 0% 98%;\n\n    --secondary: 240 4.8% 95.9%;\n    --secondary-foreground: 240 5.9% 10%;\n\n    --muted: 240 4.8% 95.9%;\n    --muted-foreground: 240 3.8% 46.1%;\n\n    --accent: 240 4.8% 95.9%;\n    --accent-foreground: 240 5.9% 10%;\n\n    --destructive: 0 84.2% 60.2%;\n    --destructive-foreground: 0 0% 98%;\n\n    --border: 240 5.9% 90%;\n    --input: 240 5.9% 90%;\n    --ring: 240 10% 3.9%;\n\n    --radius: 0.5rem;\n  }\n\n  /* Temporarily disable dark mode until we migrate to semantic colors */\n  /* .dark {\n    --background: 240 10% 3.9%;\n    --foreground: 0 0% 98%;\n\n    --card: 240 10% 3.9%;\n    --card-foreground: 0 0% 98%;\n\n    --popover: 240 10% 3.9%;\n    --popover-foreground: 0 0% 98%;\n\n    --primary: 0 0% 98%;\n    --primary-foreground: 240 5.9% 10%;\n\n    --secondary: 240 3.7% 15.9%;\n    --secondary-foreground: 0 0% 98%;\n\n    --muted: 240 3.7% 15.9%;\n    --muted-foreground: 240 5% 64.9%;\n\n    --accent: 240 3.7% 15.9%;\n    --accent-foreground: 0 0% 98%;\n\n    --destructive: 0 62.8% 30.6%;\n    --destructive-foreground: 0 0% 98%;\n\n    --border: 240 3.7% 15.9%;\n    --input: 240 3.7% 15.9%;\n    --ring: 240 4.9% 83.9%;\n  } */\n}\n\n@layer utilities {\n  /* Hide scrollbar for Chrome, Safari and Opera */\n  .no-scrollbar::-webkit-scrollbar {\n    display: none;\n  }\n  /* Hide scrollbar for IE, Edge and Firefox */\n  .no-scrollbar {\n    -ms-overflow-style: none;  /* IE and Edge */\n    scrollbar-width: none;  /* Firefox */\n  }\n}\n\n.ReactModal__Overlay {\n  opacity: 0;\n  transition: opacity 300ms ease-in-out;\n}\n\n.ReactModal__Overlay--after-open {\n  opacity: 1;\n}\n\n.ReactModal__Overlay--before-close {\n  opacity: 0;\n}\n\n.DialogOverlay {\n  background-color: rgba(0, 0, 0, 0.5);\n  position: fixed;\n  inset: 0;\n  animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);\n  z-index: 100;\n}\n\n.DialogContent {\n  background-color: white;\n  border-radius: 6px;\n  box-shadow:\n    hsl(206 22% 7% / 35%) 0px 10px 38px -10px,\n    hsl(206 22% 7% / 20%) 0px 10px 20px -15px;\n  position: fixed;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n  width: 90vw;\n  max-width: 650px;\n  max-height: 85vh;\n  animation: contentShow 500ms cubic-bezier(0.16, 1, 0.3, 1);\n  z-index: 101;\n}\n.DialogContent:focus {\n  outline: none;\n}\n\n.DialogTitle {\n  margin: 0;\n  font-weight: 500;\n  color: #000;\n  font-size: 17px;\n}\n\n.DialogDescription {\n  margin: 10px 0 20px;\n  color: #000;\n  font-size: 15px;\n  line-height: 1.5;\n}\n.FireButton {\n  color: #f8fafc;\n  background-color: #111827;\n  width: 100%;\n  box-shadow:\n    0 1px 3px 0 rgba(0, 0, 0, 0.1),\n    0 1px 2px 0 rgba(0, 0, 0, 0.06);\n  transition: box-shadow 0.3s ease;\n}\n\n.FireButton:hover {\n  box-shadow: 0 0 8px 2px #ff5d22af;\n}\n\n@keyframes overlayShow {\n  from {\n    opacity: 0;\n  }\n  to {\n    opacity: 1;\n  }\n}\n\n@keyframes contentShow {\n  from {\n    opacity: 0;\n    transform: translate(-50%, -48%) scale(0.96);\n  }\n  to {\n    opacity: 1;\n    transform: translate(-50%, -50%) scale(1);\n  }\n}\n\n.blog-heading:target {\n  padding-bottom: 120px !important;\n}\n\n@layer utilities {\n  .extra-space {\n    position: relative;\n\n    &::after {\n      --target-size: 20px;\n\n      content: '';\n      position: absolute;\n      inset: var(--target-size);\n    }\n  }\n\n  .marquee-animation {\n    animation: marquee var(--speed, 10s) linear infinite\n      var(--direction, forwards);\n  }\n\n  @keyframes marquee {\n    to {\n      transform: translateX(-50%);\n    }\n  }\n\n  /* Loading state animations */\n  @keyframes fade-in-up {\n    from {\n      opacity: 0;\n      transform: translateY(20px);\n    }\n    to {\n      opacity: 1;\n      transform: translateY(0);\n    }\n  }\n\n  @keyframes pulse-subtle {\n    0%, 100% {\n      opacity: 1;\n    }\n    50% {\n      opacity: 0.95;\n    }\n  }\n\n  @keyframes text-shimmer {\n    0% {\n      background-position: -200% center;\n    }\n    100% {\n      background-position: 200% center;\n    }\n  }\n\n  .animate-fade-in-up {\n    animation: fade-in-up 0.6s ease-out forwards;\n    opacity: 0;\n  }\n\n  .animate-pulse-subtle {\n    animation: pulse-subtle 2s ease-in-out infinite;\n  }\n\n  .animate-text-shimmer {\n    background: linear-gradient(\n      90deg,\n      rgb(156 163 175) 0%,\n      rgb(229 231 235) 50%,\n      rgb(156 163 175) 100%\n    );\n    background-size: 200% auto;\n    -webkit-background-clip: text;\n    -webkit-text-fill-color: transparent;\n    background-clip: text;\n    animation: text-shimmer 3s linear infinite;\n  }\n}\n\n.grecaptcha-badge { visibility: hidden; }\n\n/* Remove all focus styles from hero input */\ninput[type=\"text\"]:focus,\ninput[type=\"text\"]:focus-visible {\n  outline: none !important;\n  box-shadow: none !important;\n  border-color: inherit !important;\n}"
  },
  {
    "path": "tailwind.config.ts",
    "content": "/* eslint-disable @typescript-eslint/no-require-imports */\nimport defaultTheme from \"tailwindcss/defaultTheme\";\nimport type { Config } from \"tailwindcss\";\n\nimport colorsJson from \"./colors.json\";\n\nconst colors = Object.keys(colorsJson).reduce(\n  (acc, key) => {\n    acc[key] = `var(--${key})`;\n\n    return acc;\n  },\n  {} as Record<string, string>\n);\n\nconst sizes = Array.from({ length: 1000 }, (_, i) => i).reduce(\n  (acc, curr) => {\n    acc[curr] = `${curr}px`;\n\n    return acc;\n  },\n  {\n    max: \"max-content\",\n    unset: \"unset\",\n    full: \"100%\",\n    inherit: \"inherit\",\n    \"1/2\": \"50%\",\n    \"1/3\": \"33.3%\",\n    \"2/3\": \"66.6%\",\n    \"1/4\": \"25%\",\n    \"1/6\": \"16.6%\",\n    \"2/6\": \"33.3%\",\n    \"3/6\": \"50%\",\n    \"4/6\": \"66.6%\",\n    \"5/6\": \"83.3%\"\n  } as Record<string, string>\n);\n\nconst opacities = Array.from({ length: 100 }, (_, i) => i).reduce(\n  (acc, curr) => {\n    acc[curr] = curr / 100 + \"\";\n\n    return acc;\n  },\n  {} as Record<string, string>\n);\n\nconst transitionDurations = Array.from({ length: 60 }, (_, i) => i).reduce(\n  (acc, curr) => {\n    acc[curr] = curr * 50 + \"\";\n\n    return acc;\n  },\n  {} as Record<string, string>\n);\n\nconst themeConfig: Config = {\n  darkMode: \"class\",\n  content: [\n    \"./pages/**/*.{js,ts,jsx,tsx,mdx}\",\n    \"./components/**/*.{js,ts,jsx,tsx,mdx}\",\n    \"./app/**/*.{js,ts,jsx,tsx,mdx}\",\n    \"./components-new/**/*.{js,ts,jsx,tsx,mdx}\",\n    \"./styling-reference/ai-ready-website/app/**/*.{ts,tsx}\",\n    \"./styling-reference/ai-ready-website/components/**/*.{ts,tsx}\",\n    \"./styling-reference/ai-ready-website/components-new/**/*.{ts,tsx}\",\n  ],\n  theme: {\n    container: {\n      center: true,\n      padding: \"2rem\",\n      screens: {\n        \"2xl\": \"1400px\",\n      },\n    },\n    extend: {\n      fontFamily: {\n        sans: [\"var(--font-geist-sans)\", \"var(--font-inter)\", ...defaultTheme.fontFamily.sans],\n        mono: [\"var(--font-geist-mono)\", ...defaultTheme.fontFamily.mono],\n        ascii: [\"var(--font-roboto-mono)\", ...defaultTheme.fontFamily.mono]\n      },\n      fontSize: {\n        \"title-h1\": [\n          \"60px\",\n          {\n            \"lineHeight\": \"64px\",\n            \"letterSpacing\": \"-0.3px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"title-h2\": [\n          \"52px\",\n          {\n            \"lineHeight\": \"56px\",\n            \"letterSpacing\": \"-0.52px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"title-h3\": [\n          \"40px\",\n          {\n            \"lineHeight\": \"44px\",\n            \"letterSpacing\": \"-0.4px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"title-h4\": [\n          \"32px\",\n          {\n            \"lineHeight\": \"36px\",\n            \"letterSpacing\": \"-0.32px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"title-h5\": [\n          \"24px\",\n          {\n            \"lineHeight\": \"32px\",\n            \"letterSpacing\": \"-0.24px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"body-x-large\": [\n          \"20px\",\n          {\n            \"lineHeight\": \"28px\",\n            \"letterSpacing\": \"-0.1px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"body-large\": [\n          \"16px\",\n          {\n            \"lineHeight\": \"24px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"body-medium\": [\n          \"14px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0.14px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"body-small\": [\n          \"13px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"body-input\": [\n          \"15px\",\n          {\n            \"lineHeight\": \"24px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"label-x-large\": [\n          \"20px\",\n          {\n            \"lineHeight\": \"28px\",\n            \"letterSpacing\": \"-0.1px\",\n            \"fontWeight\": \"450\"\n          }\n        ],\n        \"label-large\": [\n          \"16px\",\n          {\n            \"lineHeight\": \"24px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"450\"\n          }\n        ],\n        \"label-medium\": [\n          \"14px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"450\"\n          }\n        ],\n        \"label-small\": [\n          \"13px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"450\"\n          }\n        ],\n        \"label-x-small\": [\n          \"12px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"450\"\n          }\n        ],\n        \"mono-medium\": [\n          \"14px\",\n          {\n            \"lineHeight\": \"22px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"mono-small\": [\n          \"13px\",\n          {\n            \"lineHeight\": \"20px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"500\"\n          }\n        ],\n        \"mono-x-small\": [\n          \"12px\",\n          {\n            \"lineHeight\": \"16px\",\n            \"letterSpacing\": \"0px\",\n            \"fontWeight\": \"400\"\n          }\n        ],\n        \"title-blog\": [\n          \"28px\",\n          {\n            \"lineHeight\": \"36px\",\n            \"letterSpacing\": \"-0.28px\",\n            \"fontWeight\": \"500\"\n          }\n        ]\n      },\n      colors: {\n        transparent: \"transparent\",\n        current: \"currentColor\",\n        border: \"hsl(var(--border))\",\n        input: \"hsl(var(--input))\",\n        ring: \"hsl(var(--ring))\",\n        background: \"hsl(var(--background))\",\n        foreground: \"hsl(var(--foreground))\",\n        primary: {\n          DEFAULT: \"hsl(var(--primary))\",\n          foreground: \"hsl(var(--primary-foreground))\",\n        },\n        secondary: {\n          DEFAULT: \"hsl(var(--secondary))\",\n          foreground: \"hsl(var(--secondary-foreground))\",\n        },\n        destructive: {\n          DEFAULT: \"hsl(var(--destructive))\",\n          foreground: \"hsl(var(--destructive-foreground))\",\n        },\n        muted: {\n          DEFAULT: \"hsl(var(--muted))\",\n          foreground: \"hsl(var(--muted-foreground))\",\n        },\n        accent: {\n          DEFAULT: \"hsl(var(--accent))\",\n          foreground: \"hsl(var(--accent-foreground))\",\n        },\n        popover: {\n          DEFAULT: \"hsl(var(--popover))\",\n          foreground: \"hsl(var(--popover-foreground))\",\n        },\n        card: {\n          DEFAULT: \"hsl(var(--card))\",\n          foreground: \"hsl(var(--card-foreground))\",\n        },\n        ...colors\n      },\n      screens: {\n        xs: { min: \"390px\" },\n        \"xs-max\": { max: \"389px\" },\n        sm: { min: \"576px\" },\n        \"sm-max\": { max: \"575px\" },\n        md: { min: \"768px\" },\n        \"md-max\": { max: \"767px\" },\n        lg: { min: \"996px\" },\n        \"lg-max\": { max: \"995px\" },\n        xl: { min: \"1200px\" },\n        \"xl-max\": { max: \"1199px\" }\n      },\n      opacity: opacities,\n      spacing: {\n        ...sizes,\n        'root': 'var(--root-padding)'\n      },\n      width: sizes,\n      maxWidth: sizes,\n      height: sizes,\n      inset: sizes,\n      borderWidth: sizes,\n      backdropBlur: Array.from({ length: 20 }, (_, i) => i).reduce(\n        (acc, curr) => {\n          acc[curr] = curr + \"px\";\n\n          return acc;\n        },\n        {} as Record<string, string>\n      ),\n      transitionTimingFunction: { DEFAULT: \"cubic-bezier(0.25, 0.1, 0.25, 1)\" },\n      transitionDuration: {\n        DEFAULT: \"200ms\",\n        ...transitionDurations\n      },\n      transitionDelay: {\n        ...transitionDurations\n      },\n      borderRadius: (() => {\n        const radius: Record<string | number, string> = {\n          full: \"999px\",\n          inherit: \"inherit\",\n          0: \"0px\",\n          lg: \"var(--radius)\",\n          md: \"calc(var(--radius) - 2px)\",\n          sm: \"calc(var(--radius) - 4px)\",\n        };\n\n        for (let i = 1; i <= 32; i += 1) {\n          radius[i] = `${i}px`;\n        }\n\n        return radius;\n      })()\n    }\n  },\n  plugins: [\n    ({\n      addUtilities, matchUtilities\n    }: any) => {\n      addUtilities({\n        // Inside-border utilities are defined in inside-border-fix.css to avoid Tailwind variant conflicts\n        '.mask-border': {\n          \"mask\": \"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)\",\n          \"mask-composite\": \"exclude\",\n          \"pointer-events\": \"none\"\n        },\n        \".center-x\": { \"@apply absolute left-1/2 -translate-x-1/2\": {} },\n        \".center-y\": { \"@apply absolute top-1/2 -translate-y-1/2\": {} },\n        \".center\": { \"@apply absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2\": {} },\n        \".flex-center\": { \"@apply flex items-center justify-center\": {} },\n        \".overlay\": { \"@apply absolute top-0 left-0 w-full h-full rounded-inherit\": {} },\n        \".text-gradient\": { \"@apply !bg-clip-text !text-transparent\": {} }\n      });\n      matchUtilities(\n        {\n          'cw': (value: string) => {\n            const width = parseInt(value);\n\n            return {\n              width: value,\n              left: `calc(50% - ${width / 2}px)`\n            };\n          },\n          'ch': (value: string) => {\n            const height = parseInt(value);\n\n            return {\n              height: value,\n              top: `calc(50% - ${height / 2}px)`\n            };\n          },\n          'cs': (value: string) => {\n            const size = parseInt(value);\n\n            return {\n              width: size,\n              height: size,\n              left: `calc(50% - ${size / 2}px)`,\n              top: `calc(50% - ${size / 2}px)`\n            };\n          },\n          'cmw': (value: string) => {\n            const [maxWidth, paddingX] = value.split(',').map((v) => parseInt(v));\n\n            const width = paddingX ? `calc(100% - ${paddingX * 2}px)` : '100%';\n\n            return {\n              maxWidth: maxWidth,\n              width,\n              left: `calc(50% - (min(${maxWidth}px, ${width}) / 2))`\n            };\n          },\n          'mw': (value: string) => {\n            const [maxWidth, paddingX] = value.split(',').map((v) => parseInt(v));\n\n            const width = paddingX ? `calc(100% - ${paddingX * 2}px)` : '100%';\n\n            return {\n              maxWidth: maxWidth,\n              width\n            };\n          }\n        },\n        { values: sizes }\n      );\n    },\n    require(\"tailwind-gradient-mask-image\"),\n    require(\"@tailwindcss/typography\"),\n  ]\n};\n\nexport default themeConfig;"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"ES2017\",\n    \"lib\": [\"dom\", \"dom.iterable\", \"esnext\"],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"strict\": true,\n    \"noEmit\": true,\n    \"esModuleInterop\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"jsx\": \"preserve\",\n    \"incremental\": true,\n    \"plugins\": [\n      {\n        \"name\": \"next\"\n      }\n    ],\n    \"paths\": {\n      \"@/*\": [\"./*\"]\n    }\n  },\n  \"include\": [\"next-env.d.ts\", \"**/*.ts\", \"**/*.tsx\", \".next/types/**/*.ts\"],\n  \"exclude\": [\"node_modules\", \"examples\", \"tests\", \"lib/e2b-backends/archive\", \"styles\"]\n}\n"
  },
  {
    "path": "types/conversation.ts",
    "content": "// Conversation tracking types for maintaining context across interactions\n\nexport interface ConversationMessage {\n  id: string;\n  role: 'user' | 'assistant';\n  content: string;\n  timestamp: number;\n  metadata?: {\n    editedFiles?: string[]; // Files edited in this interaction\n    addedPackages?: string[]; // Packages added in this interaction\n    editType?: string; // Type of edit performed\n    sandboxId?: string; // Sandbox ID at time of message\n  };\n}\n\nexport interface ConversationEdit {\n  timestamp: number;\n  userRequest: string;\n  editType: string;\n  targetFiles: string[];\n  confidence: number;\n  outcome: 'success' | 'partial' | 'failed';\n  errorMessage?: string;\n}\n\nexport interface ConversationContext {\n  messages: ConversationMessage[];\n  edits: ConversationEdit[];\n  currentTopic?: string; // Current focus area (e.g., \"header styling\", \"hero section\")\n  projectEvolution: {\n    initialState?: string; // Description of initial project state\n    majorChanges: Array<{\n      timestamp: number;\n      description: string;\n      filesAffected: string[];\n    }>;\n  };\n  userPreferences: {\n    editStyle?: 'targeted' | 'comprehensive'; // How the user prefers edits\n    commonRequests?: string[]; // Common patterns in user requests\n    packagePreferences?: string[]; // Commonly used packages\n  };\n}\n\nexport interface ConversationState {\n  conversationId: string;\n  startedAt: number;\n  lastUpdated: number;\n  context: ConversationContext;\n}"
  },
  {
    "path": "types/file-manifest.ts",
    "content": "// File manifest types for enhanced edit tracking\n\nexport interface FileInfo {\n  content: string;\n  type: 'component' | 'page' | 'style' | 'config' | 'utility' | 'layout' | 'hook' | 'context';\n  exports?: string[]; // Named exports and default export\n  imports?: ImportInfo[]; // Dependencies\n  lastModified: number;\n  componentInfo?: ComponentInfo; // For React components\n  path: string;\n  relativePath: string; // Path relative to src/\n}\n\nexport interface ImportInfo {\n  source: string; // e.g., './Header', 'react', '@/components/Button'\n  imports: string[]; // Named imports\n  defaultImport?: string; // Default import name\n  isLocal: boolean; // true if starts with './' or '@/'\n}\n\nexport interface ComponentInfo {\n  name: string;\n  props?: string[]; // Prop names if detectable\n  hooks?: string[]; // Hooks used (useState, useEffect, etc)\n  hasState: boolean;\n  childComponents?: string[]; // Components rendered inside\n}\n\nexport interface RouteInfo {\n  path: string; // Route path (e.g., '/videos', '/about')\n  component: string; // Component file path\n  layout?: string; // Layout component if any\n}\n\nexport interface ComponentTree {\n  [componentName: string]: {\n    file: string;\n    imports: string[]; // Components it imports\n    importedBy: string[]; // Components that import it\n    type: 'page' | 'layout' | 'component';\n  }\n}\n\nexport interface FileManifest {\n  files: Record<string, FileInfo>;\n  routes: RouteInfo[];\n  componentTree: ComponentTree;\n  entryPoint: string; // Usually App.jsx or main.jsx\n  styleFiles: string[]; // All CSS files\n  timestamp: number;\n}\n\n// Edit classification types\nexport enum EditType {\n  UPDATE_COMPONENT = 'UPDATE_COMPONENT',    // \"update the header\", \"change button color\"\n  ADD_FEATURE = 'ADD_FEATURE',              // \"add a videos page\", \"create new component\"\n  FIX_ISSUE = 'FIX_ISSUE',                 // \"fix the styling\", \"resolve error\"\n  REFACTOR = 'REFACTOR',                   // \"reorganize\", \"clean up\"\n  FULL_REBUILD = 'FULL_REBUILD',           // \"start over\", \"recreate everything\"\n  UPDATE_STYLE = 'UPDATE_STYLE',           // \"change colors\", \"update theme\"\n  ADD_DEPENDENCY = 'ADD_DEPENDENCY'        // \"install package\", \"add library\"\n}\n\nexport interface EditIntent {\n  type: EditType;\n  targetFiles: string[]; // Predicted files to edit\n  confidence: number; // 0-1 confidence score\n  description: string; // Human-readable description\n  suggestedContext: string[]; // Additional files to include for context\n}\n\n// Patterns for intent detection\nexport interface IntentPattern {\n  patterns: RegExp[];\n  type: EditType;\n  fileResolver: (prompt: string, manifest: FileManifest) => string[];\n}"
  },
  {
    "path": "types/sandbox.ts",
    "content": "// Global types for sandbox file management\n\nexport interface SandboxFile {\n  content: string;\n  lastModified: number;\n}\n\nexport interface SandboxFileCache {\n  files: Record<string, SandboxFile>;\n  lastSync: number;\n  sandboxId: string;\n  manifest?: any; // FileManifest type from file-manifest.ts\n}\n\nexport interface SandboxState {\n  fileCache: SandboxFileCache | null;\n  sandbox: any; // E2B sandbox instance\n  sandboxData: {\n    sandboxId: string;\n    url: string;\n  } | null;\n}\n\n// Declare global types\ndeclare global {\n  var activeSandbox: any;\n  var sandboxState: SandboxState;\n  var existingFiles: Set<string>;\n}\n\nexport {};"
  },
  {
    "path": "utils/cn.ts",
    "content": "import classNames from \"classnames\";\n\nexport function cn(...classes: classNames.ArgumentArray) {\n  return classNames(...classes);\n}\n"
  },
  {
    "path": "utils/init-canvas.ts",
    "content": "import { debounce } from \"lodash-es\";\n\nexport default (canvas: HTMLCanvasElement) => {\n  const { width, height } = canvas.getBoundingClientRect();\n  const ctx = canvas.getContext(\"2d\")!;\n\n  canvas.style.width = `${width}px`;\n  canvas.style.height = `${height}px`;\n\n  const upscaleCanvas = () => {\n    const scale = window.visualViewport?.scale || 1;\n    const dpr = (window.devicePixelRatio || 1) * scale;\n\n    canvas.width = width * dpr;\n    canvas.height = height * dpr;\n\n    ctx.scale(dpr, dpr);\n\n    canvas.dispatchEvent(new Event(\"resize\"));\n  };\n\n  upscaleCanvas();\n\n  const handleResize = debounce(upscaleCanvas, 500);\n\n  window.addEventListener(\"resize\", handleResize);\n  window.visualViewport?.addEventListener(\"resize\", handleResize);\n\n  return ctx;\n};\n"
  },
  {
    "path": "utils/set-timeout-on-visible.ts",
    "content": "export function setTimeoutOnVisible({\n  element,\n  callback,\n  timeout,\n  threshold = 0.01,\n}: {\n  element?: HTMLElement;\n  callback: () => void;\n  timeout: number;\n  threshold?: number;\n}) {\n  if (!element) {\n    return;\n  }\n\n  let timeoutId: NodeJS.Timeout | null = null;\n  let finished = false;\n\n  // Check if element is already visible at the beginning\n  const rect = element.getBoundingClientRect();\n  const isVisible = rect.top < window.innerHeight && rect.bottom > 0;\n\n  const setupTimeout = () => {\n    if (finished) return;\n\n    timeoutId = setTimeout(() => {\n      if (finished) return;\n\n      callback();\n      timeoutId = null;\n      finished = true;\n    }, timeout);\n  };\n\n  if (isVisible && !timeoutId) setupTimeout();\n\n  const observer = new IntersectionObserver(\n    (entries) => {\n      entries.forEach((entry) => {\n        if (entry.isIntersecting) {\n          // Element is visible, start the timeout\n          if (!timeoutId) {\n            setupTimeout();\n            observer.disconnect();\n          }\n        } else {\n          // Element is no longer visible, clear the timeout\n          if (timeoutId) {\n            clearTimeout(timeoutId);\n            timeoutId = null;\n          }\n        }\n      });\n    },\n    { threshold },\n  );\n\n  observer.observe(element);\n\n  // Return a cleanup function\n  return () => {\n    if (timeoutId) {\n      clearTimeout(timeoutId);\n    }\n\n    observer.disconnect();\n  };\n}\n\nexport function setIntervalOnVisible({\n  element,\n  callback,\n  interval,\n  threshold = 0.01,\n}: {\n  element?: HTMLElement | null;\n  callback: () => void;\n  interval: number;\n  threshold?: number;\n}) {\n  if (!element) {\n    return;\n  }\n\n  let intervalId: NodeJS.Timeout | null = null;\n\n  // Check if element is already visible at the beginning\n  const rect = element.getBoundingClientRect();\n  const isVisible = rect.top < window.innerHeight && rect.bottom > 0;\n\n  const setupInterval = () => {\n    if (!intervalId) {\n      intervalId = setInterval(callback, interval);\n    }\n  };\n\n  const clearIntervalIfExists = () => {\n    if (intervalId) {\n      clearInterval(intervalId);\n      intervalId = null;\n    }\n  };\n\n  if (isVisible) setupInterval();\n\n  const observer = new IntersectionObserver(\n    (entries) => {\n      entries.forEach((entry) => {\n        if (entry.isIntersecting) {\n          // Element is visible, start the interval\n          setupInterval();\n        } else {\n          // Element is no longer visible, clear the interval\n          clearIntervalIfExists();\n        }\n      });\n    },\n    { threshold },\n  );\n\n  observer.observe(element);\n\n  // Return a cleanup function\n  return () => {\n    clearIntervalIfExists();\n    observer.disconnect();\n  };\n}\n\nexport default setTimeoutOnVisible;\n"
  },
  {
    "path": "utils/sleep.ts",
    "content": "export const sleep = (ms: number) =>\n  new Promise((resolve) => setTimeout(resolve, ms));\n"
  }
]