framer-export 4.4.2 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/cli/index.js +2344 -464
- package/dist/cli/index.js.map +1 -1
- package/package.json +13 -5
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../package.json","../../src/cli/theme.ts","../../src/cli/banner.ts","../../src/cli/cooking.ts","../../src/cli/box.ts","../../src/cli/select.ts","../../src/assets/asset-map.ts","../../src/config/index.ts","../../src/network/download.ts","../../src/logger/index.ts","../../src/platforms/framer.ts","../../src/platforms/webflow.ts","../../src/platforms/wix.ts","../../src/platforms/detect.ts","../../src/platforms/index.ts","../../src/exporter/capture.ts","../../src/network/pool.ts","../../src/exporter/download.ts","../../src/formatter/prettify.ts","../../src/server/template.ts","../../src/exporter/output.ts","../../src/exporter/summary.ts","../../src/ai/prompt-assistant.ts","../../src/exporter/index.ts","../../src/cli/setup.ts","../../src/cli/index.ts","../../src/cli/help.ts","../../src/cli/update-check.ts"],"sourcesContent":["{\n \"name\": \"framer-export\",\n \"version\": \"4.4.2\",\n \"description\": \"Export any Framer, Webflow, or Wix site into a fully working local mirror. Downloads all assets, strips badges, rewrites URLs, and pretty-prints JS.\",\n \"type\": \"module\",\n \"main\": \"dist/cli/index.js\",\n \"types\": \"dist/cli/index.d.ts\",\n \"bin\": {\n \"framer-export\": \"./bin/framer-export.js\",\n \"fexport\": \"./bin/fexport.js\",\n \"framerexport\": \"./bin/framerexport.js\"\n },\n \"files\": [\n \"dist/\",\n \"bin/\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"scripts\": {\n \"start\": \"tsx src/cli/index.ts\",\n \"dev\": \"tsx src/cli/index.ts\",\n \"build\": \"tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"format\": \"prettier --write \\\"src/**/*.ts\\\"\",\n \"prepublishOnly\": \"npm run build\",\n \"prepack\": \"npm run build\"\n },\n \"keywords\": [\n \"framer\",\n \"webflow\",\n \"wix\",\n \"exporter\",\n \"export\",\n \"scraper\",\n \"mirror\",\n \"site-downloader\",\n \"site-export\",\n \"cli\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/danbenba/FramerExport.git\"\n },\n \"homepage\": \"https://github.com/danbenba/FramerExport#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/danbenba/FramerExport/issues\"\n },\n \"license\": \"MIT\",\n \"author\": \"Dany (danbenba)\",\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"ora\": \"^8.0.0\",\n \"prettier\": \"^3.2.0\",\n \"puppeteer\": \"^22.0.0\",\n \"readline-promise\": \"^1.0.5\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.0.0\",\n \"tsup\": \"^8.5.1\",\n \"tsx\": \"^4.7.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n","import chalk from 'chalk';\n\nexport const THEME = {\n background: '#0A0A0A',\n panel: '#141414',\n element: '#1E1E1E',\n border: '#484848',\n borderActive: '#606060',\n text: '#EEEEEE',\n muted: '#808080',\n primary: '#FAB283',\n primarySoft: '#FFC09F',\n secondary: '#5C9CF5',\n accent: '#9D7CD8',\n success: '#7FD88F',\n warning: '#F5A742',\n error: '#E06C75',\n info: '#56B6C2',\n};\n\nexport const ui = {\n text: chalk.hex(THEME.text),\n muted: chalk.hex(THEME.muted),\n primary: chalk.hex(THEME.primary),\n primarySoft: chalk.hex(THEME.primarySoft),\n secondary: chalk.hex(THEME.secondary),\n accent: chalk.hex(THEME.accent),\n success: chalk.hex(THEME.success),\n warning: chalk.hex(THEME.warning),\n error: chalk.hex(THEME.error),\n info: chalk.hex(THEME.info),\n border: chalk.hex(THEME.border),\n borderActive: chalk.hex(THEME.borderActive),\n panel: chalk.hex(THEME.panel),\n};\n\nexport function stripAnsi(s: string): string {\n return s.replace(/\\x1B\\[[0-9;]*[a-zA-Z]/g, '');\n}\n\nexport function softGradient(text: string): string {\n const colors = [THEME.primary, THEME.primarySoft, THEME.text, THEME.primarySoft, THEME.primary];\n let cursor = 0;\n return text\n .split('')\n .map((char) => {\n if (char === ' ') return char;\n const color = colors[cursor % colors.length];\n cursor++;\n return chalk.hex(color).bold(char);\n })\n .join('');\n}\n\nexport function chip(label: string): string {\n return `${ui.border('[')}${ui.primary(label)}${ui.border(']')}`;\n}\n\nexport function bullet(label: string = '•'): string {\n return ui.primary(label);\n}\n\nexport function centerText(text: string, width: number): string {\n const visible = stripAnsi(text).length;\n if (visible >= width) return text;\n const left = Math.floor((width - visible) / 2);\n return ' '.repeat(left) + text + ' '.repeat(width - visible - left);\n}\n\nexport function truncatePlain(text: string, max: number): string {\n if (text.length <= max) return text;\n return text.slice(0, Math.max(0, max - 2)) + '..';\n}\n","import pkg from '../../package.json';\nimport { chip, softGradient, ui } from './theme.js';\n\nfunction getWidth(): number {\n return process.stdout.columns || 80;\n}\n\nconst ASCII_ART = [\n '███████╗██████╗ █████╗ ███╗ ███╗███████╗██████╗ ',\n '██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██╔══██╗',\n '█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██████╔╝',\n '██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██╔══██╗',\n '██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗██║ ██║',\n '╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝',\n '███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ████████╗',\n '██╔════╝╚██╗██╔╝██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝',\n '█████╗ ╚███╔╝ ██████╔╝██║ ██║██████╔╝ ██║ ',\n '██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║██╔══██╗ ██║ ',\n '███████╗██╔╝ ██╗██║ ╚██████╔╝██║ ██║ ██║ ',\n '╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ',\n];\n\nexport function showBanner(): void {\n const width = getWidth();\n const isSmall = width < 65;\n\n if (isSmall) {\n console.log(\n `\\n ${ui.primary.bold('f-export')} ${ui.muted(`v${pkg.version}`)} ${chip('beta ui')}`\n );\n console.log(` ${ui.text.bold('Framer Export')} ${ui.muted('for Framer, Webflow, and Wix')}\\n`);\n return;\n }\n\n console.log('');\n ASCII_ART.forEach((line) => {\n console.log(' ' + softGradient(line));\n });\n console.log('');\n console.log(\n ` ${ui.muted(`v${pkg.version}`)} ${ui.text.bold('Framer Export')} ${chip('fexport')} ${ui.muted('local mirror exporter')}`\n );\n console.log(\n ` ${ui.muted('Framer')} ${ui.border('/')} ${ui.muted('Webflow')} ${ui.border('/')} ${ui.muted('Wix')} ${ui.border('·')} ${ui.primary('clean assets')} ${ui.border('·')} ${ui.secondary('local serve')}\\n`\n );\n}\n","import chalk from 'chalk';\nimport { ui } from './theme.js';\n\nconst SHINE_WIDTH = 14;\nconst FRAME_INTERVAL = 70;\nconst INTRO_DURATION = 1400;\nconst SHINE_SPEED = 0.55;\n\nconst SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n\nexport async function showLoadingIntro(version: string): Promise<void> {\n if (!process.stdout.isTTY || process.env.CI) return;\n\n await new Promise<void>((resolve) => {\n let frame = 0;\n\n const draw = (): void => {\n const spinner = SPINNER_FRAMES[frame % SPINNER_FRAMES.length];\n const title = renderShinyText(`Framer Export v${version}`, frame, {\n baseColor: '#969696',\n shineColor: '#ffffff',\n shineWidth: 18,\n });\n const dots = '.'.repeat(frame % 4).padEnd(3, ' ');\n process.stdout.write(\n `\\r\\x1B[2K ${ui.primary(spinner)} ${title} ${ui.muted(`Loading${dots}`)}`\n );\n frame++;\n };\n\n process.stdout.write('\\x1B[?25l');\n draw();\n const interval = setInterval(draw, FRAME_INTERVAL);\n setTimeout(() => {\n clearInterval(interval);\n process.stdout.write('\\r\\x1B[2K\\x1B[?25h');\n resolve();\n }, INTRO_DURATION);\n });\n}\n\nexport class CookingSpinner {\n private interval: NodeJS.Timeout | null = null;\n private frame = 0;\n private phase = '';\n private active = false;\n\n start(phase: string = ''): void {\n this.phase = phase;\n this.frame = 0;\n this.active = true;\n this.draw();\n this.interval = setInterval(() => {\n this.frame++;\n this.draw();\n }, FRAME_INTERVAL);\n }\n\n update(phase: string): void {\n this.phase = phase;\n }\n\n log(message: string): void {\n if (this.active) {\n process.stdout.write('\\r\\x1B[2K');\n }\n process.stdout.write(message + '\\n');\n if (this.active) {\n this.draw();\n }\n }\n\n stop(): void {\n this.active = false;\n if (this.interval) {\n clearInterval(this.interval);\n this.interval = null;\n }\n process.stdout.write('\\r\\x1B[2K');\n }\n\n private draw(): void {\n if (!this.active) return;\n\n const spinner = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];\n const shimmer = renderShinyText('Exporting', this.frame);\n const frameStr = ui.primary(spinner);\n const phaseStr = this.phase ? ` ${ui.muted(this.limitLen(this.phase, 52))}` : '';\n\n process.stdout.write(`\\r\\x1B[2K ${frameStr} ${shimmer}${phaseStr}`);\n }\n\n private limitLen(s: string, max: number): string {\n if (s.length <= max) return s;\n return s.slice(0, max - 1) + '…';\n }\n}\n\nfunction renderShinyText(\n text: string,\n frame: number,\n options: { baseColor?: string; shineColor?: string; shineWidth?: number } = {}\n): string {\n const baseColor = options.baseColor || '#808080';\n const shineColor = options.shineColor || '#ffffff';\n const shineWidth = options.shineWidth || SHINE_WIDTH;\n const travel = text.length + shineWidth * 2;\n const pos = ((frame * SHINE_SPEED) % travel) - shineWidth;\n const base = hexToRgb(baseColor);\n const shine = hexToRgb(shineColor);\n\n let result = '';\n for (let i = 0; i < text.length; i++) {\n const dist = Math.abs(i - pos);\n const intensity = smoothstep(0, 1, 1 - Math.min(1, dist / shineWidth));\n const color = mixRgb(base, shine, intensity);\n const paint =\n intensity > 0.82\n ? chalk.rgb(color.r, color.g, color.b).bold\n : chalk.rgb(color.r, color.g, color.b);\n result += paint(text[i]);\n }\n return result;\n}\n\nfunction smoothstep(edge0: number, edge1: number, value: number): number {\n const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));\n return t * t * (3 - 2 * t);\n}\n\nfunction hexToRgb(hex: string): { r: number; g: number; b: number } {\n const clean = hex.replace('#', '');\n const normalized =\n clean.length === 3\n ? clean\n .split('')\n .map((char) => char + char)\n .join('')\n : clean.padEnd(6, '0').slice(0, 6);\n\n return {\n r: Number.parseInt(normalized.slice(0, 2), 16),\n g: Number.parseInt(normalized.slice(2, 4), 16),\n b: Number.parseInt(normalized.slice(4, 6), 16),\n };\n}\n\nfunction mixRgb(\n from: { r: number; g: number; b: number },\n to: { r: number; g: number; b: number },\n amount: number\n): { r: number; g: number; b: number } {\n return {\n r: Math.round(from.r + (to.r - from.r) * amount),\n g: Math.round(from.g + (to.g - from.g) * amount),\n b: Math.round(from.b + (to.b - from.b) * amount),\n };\n}\n","import chalk from 'chalk';\nimport { stripAnsi, ui } from './theme.js';\n\nexport function maxWidth(): number {\n return Math.min(process.stdout.columns || 80, 76);\n}\n\nfunction padRight(text: string, w: number): string {\n const visible = stripAnsi(text).length;\n if (visible >= w) return text;\n return text + ' '.repeat(w - visible);\n}\n\nexport function boxTop(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('╭─') + ui.border('─'.repeat(inner)) + ui.border('─╮');\n}\n\nexport function panelTop(w: number): string {\n const inner = w - 4;\n return ui.border('╭─') + ui.border('─'.repeat(inner)) + ui.border('─╮');\n}\n\nexport function boxBot(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('╰─') + ui.border('─'.repeat(inner)) + ui.border('─╯');\n}\n\nexport function panelBot(w: number): string {\n const inner = w - 4;\n return ui.border('╰─') + ui.border('─'.repeat(inner)) + ui.border('─╯');\n}\n\nexport function boxLine(w: number, text: string): string {\n const inner = w - 4;\n const padded = padRight(text, inner);\n return ' ' + ui.border('│ ') + padded + ui.border(' │');\n}\n\nexport function panelLine(w: number, text: string): string {\n const inner = w - 4;\n const padded = padRight(text, inner);\n return ui.border('│ ') + padded + ui.border(' │');\n}\n\nexport function boxSep(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('├─') + ui.border('─'.repeat(inner)) + ui.border('─┤');\n}\n\nexport function panelSep(w: number): string {\n const inner = w - 4;\n return ui.border('├─') + ui.border('─'.repeat(inner)) + ui.border('─┤');\n}\n\nexport function boxRow(w: number, label: string, value: string): string {\n const inner = w - 4;\n const labelPlain = stripAnsi(chalk.bold(label));\n const visible = labelPlain.length + 1 + value.length;\n if (visible > inner) {\n const avail = inner - labelPlain.length - 2;\n const truncated = value.length > avail ? value.slice(0, avail - 1) + '..' : value;\n return (\n ' ' +\n ui.border('│ ') +\n chalk.bold(label) +\n ': ' +\n ui.primary(truncated) +\n ' '.repeat(Math.max(0, inner - labelPlain.length - 1 - truncated.length)) +\n ui.border(' │')\n );\n }\n const right = inner - labelPlain.length - 1 - value.length;\n return (\n ' ' +\n ui.border('│ ') +\n chalk.bold(label) +\n ': ' +\n ui.primary(value) +\n ' '.repeat(right) +\n ui.border(' │')\n );\n}\n","import readline from 'node:readline';\nimport { stdin, stdout } from 'node:process';\nimport { maxWidth, panelBot, panelLine, panelSep, panelTop } from './box.js';\nimport { centerText, stripAnsi, truncatePlain, ui } from './theme.js';\n\nexport interface SelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectAction {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectConfig {\n headerLines?: string[];\n actions?: SelectAction[];\n footer?: string;\n}\n\nlet pipedLinesPromise: Promise<string[]> | null = null;\nlet pipedLineIndex = 0;\n\nexport async function select(\n question: string,\n options: SelectOption[],\n defaultIndex: number = 0,\n config: SelectConfig = {}\n): Promise<string> {\n const isTTY = stdin.isTTY && stdout.isTTY;\n\n if (!isTTY) {\n return fallbackPrompt(question, options, defaultIndex, config);\n }\n\n return arrowSelect(question, options, defaultIndex, config);\n}\n\nexport async function promptInput(\n question: string,\n defaultValue: string = '',\n config: Omit<SelectConfig, 'actions'> = {}\n): Promise<string> {\n if (!stdin.isTTY || !stdout.isTTY) {\n return fallbackInput(question, defaultValue);\n }\n\n return fullscreenInput(question, defaultValue, config);\n}\n\nasync function arrowSelect(\n question: string,\n options: SelectOption[],\n defaultIndex: number,\n config: SelectConfig\n): Promise<string> {\n const actions = config.actions ?? [];\n const headerLines = config.headerLines ?? [];\n const width = Math.max(44, Math.min(maxWidth(), 72));\n const inner = width - 4;\n const actionLineOffset = 2 + headerLines.length;\n const hasActions = actions.length > 0;\n const optionStartOffset = 3 + headerLines.length + (hasActions ? 1 : 0);\n const lineCount = options.length + 4 + headerLines.length + (hasActions ? 1 : 0);\n const rows = process.stdout.rows || 24;\n const columns = process.stdout.columns || 80;\n const panelTopRow = Math.max(2, Math.floor((rows - lineCount) / 2) + 1);\n const panelLeftCol = Math.max(1, Math.floor((columns - width) / 2) + 1);\n const footerRow = Math.min(rows, panelTopRow + lineCount + 1);\n\n return new Promise((resolve) => {\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n let selected: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n let selectedAction: number | null = null;\n if (selected < 0) selected = 0;\n\n const move = (direction: -1 | 1): void => {\n let next = selected + direction;\n while (next >= 0 && next < options.length) {\n if (!options[next].disabled) {\n selected = next;\n return;\n }\n next += direction;\n }\n };\n\n const render = (initial: boolean = false): void => {\n if (!initial) {\n stdout.write('\\x1B[2J');\n }\n const lines: string[] = [];\n lines.push(panelTop(width));\n lines.push(\n panelLine(width, centerText(`${ui.primary('●')} ${ui.text.bold(question)}`, inner))\n );\n for (const header of headerLines) {\n lines.push(panelLine(width, centerText(ui.muted(header), inner)));\n }\n if (hasActions) {\n lines.push(\n panelLine(width, centerText(renderActions(actions, selectedAction, inner), inner))\n );\n }\n lines.push(panelSep(width));\n for (let i = 0; i < options.length; i++) {\n lines.push(\n panelLine(\n width,\n centerText(\n renderOption(options[i], selectedAction === null && i === selected, inner),\n inner\n )\n )\n );\n }\n lines.push(panelBot(width));\n\n lines.forEach((line, index) => writeAt(panelTopRow + index, panelLeftCol, line));\n writeAt(\n footerRow,\n panelLeftCol,\n centerText(\n ui.muted(config.footer || '↑↓ move · enter select · mouse hover/click · esc close'),\n width\n )\n );\n };\n\n const choose = (value: string = options[selected].value): void => {\n cleanup();\n console.log(\n ` ${ui.success('✓')} ${ui.text.bold(question)} ${ui.primary(labelForValue(value, options, actions))}\\n`\n );\n\n resolve(value);\n };\n\n const onMouseData = (chunk: Buffer): void => {\n const mouse = parseMouseEvent(chunk);\n if (!mouse) return;\n\n if (mouse.kind === 'wheel-up') {\n move(-1);\n render();\n return;\n }\n\n if (mouse.kind === 'wheel-down') {\n move(1);\n render();\n return;\n }\n\n if (hasActions && mouse.y === panelTopRow + actionLineOffset) {\n const actionIdx = actionIndexAtX(actions, mouse.x, panelLeftCol, inner);\n if (actionIdx === null || actions[actionIdx].disabled) return;\n if (selectedAction !== actionIdx) {\n selectedAction = actionIdx;\n render();\n }\n if (mouse.kind === 'click') choose(actions[actionIdx].value);\n return;\n }\n\n const idx = mouse.y - panelTopRow - optionStartOffset;\n if (idx < 0 || idx >= options.length || options[idx].disabled) return;\n\n if (selected !== idx) {\n selected = idx;\n selectedAction = null;\n render();\n }\n\n if (mouse.kind === 'click') {\n choose();\n }\n };\n\n const cleanup = (): void => {\n leaveInteractiveScreen();\n stdin.setRawMode(false);\n stdin.removeListener('keypress', onKeypress);\n stdin.removeListener('data', onMouseData);\n stdin.pause();\n };\n\n readline.emitKeypressEvents(stdin);\n stdin.setRawMode(true);\n enterInteractiveScreen(true);\n render(true);\n\n const onKeypress = (_str: string | undefined, key: readline.Key): void => {\n if (!key) return;\n\n if (key.name === 'up' && selected > 0) {\n move(-1);\n selectedAction = null;\n render();\n } else if (key.name === 'down' && selected < options.length - 1) {\n move(1);\n selectedAction = null;\n render();\n } else if (key.name === 'tab' && hasActions) {\n selectedAction = selectedAction === null ? 0 : null;\n render();\n } else if (key.name === 'return') {\n choose(selectedAction === null ? options[selected].value : actions[selectedAction].value);\n } else if ((key.ctrl && key.name === 'c') || key.name === 'escape') {\n cleanup();\n process.exit(0);\n }\n };\n\n stdin.resume();\n stdin.on('data', onMouseData);\n stdin.on('keypress', onKeypress);\n });\n}\n\nasync function fallbackPrompt(\n question: string,\n options: SelectOption[],\n defaultIndex: number,\n config: SelectConfig\n): Promise<string> {\n if (!stdin.isTTY) {\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n const enabledDefault: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n const def = String(enabledDefault + 1);\n\n printFallbackOptions(question, options, enabledDefault, config);\n\n while (true) {\n const trimmed = (await readPipedLine()).trim();\n if (trimmed.toLowerCase() === 'a') {\n const action = config.actions?.find((item) => !item.disabled);\n if (action) return action.value;\n }\n if (!trimmed) {\n const label = stripAnsi(options[enabledDefault].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n return options[enabledDefault].value;\n }\n const idx = parseInt(trimmed, 10);\n if (idx >= 1 && idx <= options.length && !options[idx - 1].disabled) {\n const label = stripAnsi(options[idx - 1].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n return options[idx - 1].value;\n }\n console.log(` ${ui.error('✗')} ${ui.warning(`Enter 1-${options.length} or ${def}`)}\\n`);\n }\n }\n\n return new Promise((resolve) => {\n const rl = readline.createInterface({ input: stdin, output: stdout });\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n const enabledDefault: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n\n printFallbackOptions(question, options, enabledDefault, config);\n const def = String(enabledDefault + 1);\n\n const ask = (): void => {\n rl.question(\n ` ${ui.primary('>')} ${ui.muted(`Choose [1-${options.length}] (${def})`)}: `,\n (answer) => {\n const trimmed = answer.trim();\n if (trimmed.toLowerCase() === 'a') {\n const action = config.actions?.find((item) => !item.disabled);\n if (action) {\n rl.close();\n resolve(action.value);\n return;\n }\n }\n if (!trimmed) {\n rl.close();\n const label = stripAnsi(options[enabledDefault].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n resolve(options[enabledDefault].value);\n return;\n }\n const idx = parseInt(trimmed, 10);\n if (idx >= 1 && idx <= options.length && !options[idx - 1].disabled) {\n rl.close();\n const label = stripAnsi(options[idx - 1].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n resolve(options[idx - 1].value);\n } else if (idx >= 1 && idx <= options.length && options[idx - 1].disabled) {\n console.log(` ${ui.error('✗')} ${ui.warning('Option unavailable for now')}\\n`);\n ask();\n } else {\n console.log(` ${ui.error('✗')} ${ui.warning(`Enter 1-${options.length}`)}\\n`);\n ask();\n }\n }\n );\n };\n ask();\n });\n}\n\nfunction fullscreenInput(\n question: string,\n defaultValue: string,\n config: Omit<SelectConfig, 'actions'>\n): Promise<string> {\n const headerLines = config.headerLines ?? [];\n const width = Math.max(44, Math.min(maxWidth(), 72));\n const inner = width - 4;\n const lineCount = 6 + headerLines.length;\n const rows = process.stdout.rows || 24;\n const columns = process.stdout.columns || 80;\n const panelTopRow = Math.max(2, Math.floor((rows - lineCount) / 2) + 1);\n const panelLeftCol = Math.max(1, Math.floor((columns - width) / 2) + 1);\n const footerRow = Math.min(rows, panelTopRow + lineCount + 1);\n\n return new Promise((resolve) => {\n let value = defaultValue;\n\n const render = (): void => {\n stdout.write('\\x1B[2J');\n const shown = value || '';\n const clipped = truncatePlain(shown, Math.max(12, inner - 10));\n const input = `${ui.primary('>')} ${ui.text(clipped)}${ui.primary('▌')}`;\n const lines: string[] = [];\n lines.push(panelTop(width));\n lines.push(\n panelLine(width, centerText(`${ui.primary('●')} ${ui.text.bold(question)}`, inner))\n );\n for (const header of headerLines) {\n lines.push(panelLine(width, centerText(ui.muted(header), inner)));\n }\n lines.push(panelSep(width));\n lines.push(panelLine(width, centerText(input, inner)));\n lines.push(panelBot(width));\n\n lines.forEach((line, index) => writeAt(panelTopRow + index, panelLeftCol, line));\n writeAt(\n footerRow,\n panelLeftCol,\n centerText(ui.muted(config.footer || 'type value · enter confirm · esc close'), width)\n );\n };\n\n const cleanup = (): void => {\n leaveInteractiveScreen();\n stdin.setRawMode(false);\n stdin.removeListener('keypress', onKeypress);\n stdin.pause();\n };\n\n const submit = (): void => {\n const output = cleanInputValue(value.trim() || defaultValue);\n cleanup();\n resolve(output);\n };\n\n const onKeypress = (str: string | undefined, key: readline.Key): void => {\n if ((key.ctrl && key.name === 'c') || key.name === 'escape') {\n cleanup();\n process.exit(0);\n }\n if (key.name === 'return') {\n submit();\n return;\n }\n if (key.name === 'backspace') {\n value = value.slice(0, -1);\n render();\n return;\n }\n if (key.name === 'delete') {\n value = '';\n render();\n return;\n }\n if (str && !key.ctrl && !key.meta && str >= ' ' && !isTerminalSequence(str, key)) {\n value += cleanInputValue(str.replace(/[\\r\\n]/g, ''));\n render();\n }\n };\n\n readline.emitKeypressEvents(stdin);\n stdin.setRawMode(true);\n enterInteractiveScreen(false);\n render();\n stdin.resume();\n stdin.on('keypress', onKeypress);\n });\n}\n\nasync function fallbackInput(question: string, defaultValue: string): Promise<string> {\n if (!stdin.isTTY) {\n const suffix = defaultValue ? ui.muted(` (${defaultValue})`) : '';\n console.log(` ${ui.primary('>')} ${ui.text.bold(question)}${suffix}: `);\n const answer = await readPipedLine();\n return cleanInputValue(answer.trim() || defaultValue);\n }\n\n return new Promise((resolve) => {\n const rl = readline.createInterface({ input: stdin, output: stdout });\n const suffix = defaultValue ? ui.muted(` (${defaultValue})`) : '';\n rl.question(` ${ui.primary('>')} ${ui.text.bold(question)}${suffix}: `, (answer) => {\n rl.close();\n resolve(cleanInputValue(answer.trim() || defaultValue));\n });\n });\n}\n\nfunction printFallbackOptions(\n question: string,\n options: SelectOption[],\n enabledDefault: number,\n config: SelectConfig\n): void {\n console.log(` ${ui.primary('●')} ${ui.text.bold(question)}\\n`);\n for (const header of config.headerLines ?? []) {\n console.log(` ${ui.muted(header)}`);\n }\n for (const action of config.actions ?? []) {\n console.log(\n ` ${ui.muted('[A]')} ${action.disabled ? ui.muted(action.label) : ui.text(action.label)}`\n );\n }\n if ((config.headerLines?.length || 0) > 0 || (config.actions?.length || 0) > 0) {\n console.log('');\n }\n for (let i = 0; i < options.length; i++) {\n const marker = i === enabledDefault ? ui.success(' ◆') : ' ';\n const label = options[i].disabled\n ? ui.muted(stripAnsi(options[i].label))\n : ui.text(options[i].label);\n console.log(` ${ui.muted(`[${i + 1}]`)}${marker} ${label}`);\n }\n console.log('');\n}\n\nfunction readPipedLine(): Promise<string> {\n if (!pipedLinesPromise) {\n pipedLinesPromise = new Promise((resolve) => {\n let data = '';\n stdin.setEncoding('utf8');\n stdin.on('data', (chunk) => {\n data += chunk;\n });\n stdin.on('end', () => {\n resolve(data.split(/\\r?\\n/));\n });\n stdin.on('error', () => {\n resolve([]);\n });\n });\n }\n\n return pipedLinesPromise.then((lines) => lines[pipedLineIndex++] ?? '');\n}\n\nfunction renderActions(actions: SelectAction[], active: number | null, width: number): string {\n return actions\n .map((action, index) => {\n const label = truncatePlain(\n stripAnsi(action.label),\n Math.max(8, Math.floor(width / actions.length) - 8)\n );\n if (action.disabled) return `${ui.border('[')} ${ui.muted(label)} ${ui.border(']')}`;\n if (active === index)\n return `${ui.primary('›')} ${ui.primary('[')} ${ui.text.bold(label)} ${ui.primary(']')} ${ui.primary('‹')}`;\n return `${ui.border('[')} ${ui.primary(label)} ${ui.border(']')}`;\n })\n .join(` ${ui.muted('·')} `);\n}\n\nfunction actionIndexAtX(\n actions: SelectAction[],\n mouseX: number,\n panelLeftCol: number,\n inner: number\n): number | null {\n if (actions.length === 0) return null;\n const contentStart = panelLeftCol + 2;\n const relative = mouseX - contentStart;\n if (relative < 0 || relative > inner) return null;\n return Math.min(actions.length - 1, Math.floor((relative / Math.max(1, inner)) * actions.length));\n}\n\nfunction labelForValue(value: string, options: SelectOption[], actions: SelectAction[]): string {\n return stripAnsi(\n options.find((option) => option.value === value)?.label ||\n actions.find((action) => action.value === value)?.label ||\n value\n );\n}\n\ntype MouseEventInfo =\n | { kind: 'click'; x: number; y: number }\n | { kind: 'hover'; x: number; y: number }\n | { kind: 'wheel-up'; x: number; y: number }\n | { kind: 'wheel-down'; x: number; y: number };\n\nfunction renderOption(option: SelectOption, selected: boolean, width: number): string {\n const plain = truncatePlain(stripAnsi(option.label), Math.max(10, width - 12));\n if (option.disabled) {\n return `${ui.border('[')} ${ui.muted(plain)} ${ui.border(']')}`;\n }\n if (selected) {\n return `${ui.primary('›')} ${ui.primary('[')} ${ui.text.bold(plain)} ${ui.primary(']')} ${ui.primary('‹')}`;\n }\n return `${ui.muted(' ')} ${ui.border('[')} ${ui.muted(plain)} ${ui.border(']')} ${ui.muted(' ')}`;\n}\n\nfunction enterInteractiveScreen(enableMouse: boolean): void {\n stdout.write('\\x1B[?1049h' + '\\x1B[2J' + '\\x1B[H' + '\\x1B[?25l');\n if (enableMouse) {\n stdout.write('\\x1B[?1006h' + '\\x1B[?1000h' + '\\x1B[?1002h' + '\\x1B[?1003h');\n }\n}\n\nfunction leaveInteractiveScreen(): void {\n stdout.write(\n '\\x1B[?1003l' + '\\x1B[?1002l' + '\\x1B[?1000l' + '\\x1B[?1006l' + '\\x1B[?25h' + '\\x1B[?1049l'\n );\n}\n\nfunction parseMouseEvent(chunk: Buffer): MouseEventInfo | null {\n const text = chunk.toString('utf-8');\n const match = text.match(/\\x1B\\[<(\\d+);(\\d+);(\\d+)([mM])/);\n if (!match) return parseLegacyMouseEvent(text);\n\n const code = Number(match[1]);\n const x = Number(match[2]);\n const y = Number(match[3]);\n const state = match[4];\n if (code === 64) return { kind: 'wheel-up', x, y };\n if (code === 65) return { kind: 'wheel-down', x, y };\n if (state === 'm') return { kind: 'click', x, y };\n if ((code & 32) === 32 || code === 35) return { kind: 'hover', x, y };\n if ((code & 3) === 0) return { kind: 'hover', x, y };\n return null;\n}\n\nfunction parseLegacyMouseEvent(text: string): MouseEventInfo | null {\n const match = text.match(/\\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])/);\n if (!match) return null;\n\n const code = match[1].charCodeAt(0) - 32;\n const x = match[2].charCodeAt(0) - 32;\n const y = match[3].charCodeAt(0) - 32;\n\n if (code === 64) return { kind: 'wheel-up', x, y };\n if (code === 65) return { kind: 'wheel-down', x, y };\n if ((code & 3) === 3) return { kind: 'click', x, y };\n if ((code & 32) === 32) return { kind: 'hover', x, y };\n return { kind: 'hover', x, y };\n}\n\nfunction writeAt(row: number, col: number, text: string): void {\n stdout.write(`\\x1B[${row};${col}H${text}`);\n}\n\nfunction isTerminalSequence(str: string, key: readline.Key): boolean {\n return (\n str.includes('\\x1B') || !!key.sequence?.includes('\\x1B') || /^(?:\\d+;){2}\\d+[mM]$/.test(str)\n );\n}\n\nfunction cleanInputValue(value: string): string {\n return value\n .replace(/\\x1B\\[<\\d+;\\d+;\\d+[mM]/g, '')\n .replace(/\\x1B\\[[0-?]*[ -/]*[@-~]/g, '')\n .replace(/(?:\\d+;){2}\\d+[mM]/g, '')\n .replace(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]/g, '');\n}\n","import path from 'path';\nimport crypto from 'crypto';\nimport { URL } from 'url';\nimport type { PlatformHandler } from '../platforms/types.js';\n\ninterface AssetEntry {\n localPath: string;\n}\n\nexport class AssetMap {\n entries: Map<string, AssetEntry> = new Map();\n buffers: Map<string, Buffer> = new Map();\n\n localPathFor(urlStr: string, platform?: PlatformHandler): string | null {\n if (this.entries.has(urlStr)) return this.entries.get(urlStr)!.localPath;\n\n let parsed: URL;\n try {\n parsed = new URL(urlStr);\n } catch {\n return null;\n }\n\n const host: string = parsed.hostname;\n const pathname: string = parsed.pathname;\n const ext: string = path.extname(pathname.split('?')[0]).toLowerCase();\n\n let dir: string | null = null;\n\n if (platform) {\n dir = platform.mapAssetDir(host, pathname, ext);\n }\n\n if (!dir) {\n dir = this.fallbackDir(host, ext);\n }\n\n let filename: string;\n const baseName: string = path.basename(pathname.split('?')[0]);\n const hash: string = crypto.createHash('md5').update(urlStr).digest('hex').slice(0, 6);\n\n if (baseName && baseName.length > 1 && baseName !== '/') {\n const clean: string = baseName.replace(/[^a-zA-Z0-9._-]/g, '_');\n filename = clean.includes('.') ? clean : `${clean}-${hash}`;\n } else {\n filename = `asset-${hash}${ext || ''}`;\n }\n\n if (ext === '.mjs' || ext === '.js') {\n filename = baseName.replace(/[^a-zA-Z0-9._-]/g, '_');\n }\n\n const localPath: string = `${dir}/${filename}`;\n this.entries.set(urlStr, { localPath });\n\n const base: string = urlStr.split('?')[0];\n if (base !== urlStr && !this.entries.has(base)) {\n this.entries.set(base, { localPath });\n }\n\n return localPath;\n }\n\n rewrite(text: string, fromDir: string = ''): string {\n const sorted = [...this.entries.entries()].sort((a, b) => b[0].length - a[0].length);\n let out: string = text;\n for (const [url, { localPath }] of sorted) {\n const rel: string = fromDir ? path.posix.relative(fromDir, localPath) : localPath;\n out = out.split(url).join(rel);\n if (url.includes('&')) {\n out = out.split(url.replace(/&/g, '&')).join(rel);\n }\n }\n return out;\n }\n\n private fallbackDir(host: string, ext: string): string {\n if (host.includes('fonts.gstatic.com') || host.includes('fonts.googleapis.com')) {\n return 'assets/fonts';\n }\n return ext === '.mjs' || ext === '.js' ? 'scripts/vendor' : 'assets/misc';\n }\n}\n","import type { Config } from '../types.js';\n\nexport const CFG: Config = {\n viewport: { width: 1440, height: 900 },\n timeout: 90000,\n scrollStep: 250,\n scrollDelay: 60,\n concurrency: 12,\n retries: 3,\n dlTimeout: 30000,\n sharedStripDomains: [\n 'sentry.io', 'www.googletagmanager.com', 'connect.facebook.net',\n 'stats.g.doubleclick.net',\n 'google-analytics.com',\n ],\n};\n","import https from 'https';\nimport http from 'http';\nimport { URL } from 'url';\nimport { CFG } from '../config/index.js';\n\nexport function dlBuffer(url: string, retries: number = CFG.retries): Promise<Buffer> {\n return new Promise((resolve, reject) => {\n const proto = url.startsWith('https') ? https : http;\n const go = (left: number): void => {\n const req = proto.get(url, { timeout: CFG.dlTimeout }, (res) => {\n if (res.statusCode! >= 300 && res.statusCode! < 400 && res.headers.location) {\n return dlBuffer(new URL(res.headers.location, url).href, left).then(resolve, reject);\n }\n if (res.statusCode !== 200) {\n return left > 1\n ? setTimeout(() => go(left - 1), 500)\n : reject(new Error(`HTTP ${res.statusCode}`));\n }\n const ch: Buffer[] = [];\n res.on('data', (c: Buffer) => ch.push(c));\n res.on('end', () => resolve(Buffer.concat(ch)));\n res.on('error', (e: Error) => (left > 1 ? setTimeout(() => go(left - 1), 500) : reject(e)));\n });\n req.on('error', (e: Error) => (left > 1 ? setTimeout(() => go(left - 1), 500) : reject(e)));\n req.on('timeout', () => {\n req.destroy();\n left > 1 ? setTimeout(() => go(left - 1), 500) : reject(new Error('Timeout'));\n });\n };\n go(retries);\n });\n}\n","import chalk from 'chalk';\nimport type { CookingSpinner } from '../cli/cooking.js';\nimport { THEME } from '../cli/theme.js';\n\nlet _cooking: CookingSpinner | null = null;\n\nexport function setCooking(spinner: CookingSpinner | null): void {\n _cooking = spinner;\n}\n\nconst T = (): string => new Date().toISOString().slice(11, 19);\n\nfunction trunc(text: string, max: number): string {\n if (text.length <= max) return text;\n return text.slice(0, max - 2) + '..';\n}\n\nfunction output(line: string): void {\n if (_cooking) _cooking.log(line);\n else console.log(line);\n}\n\nconst LOG_PALETTE: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.primary)(s),\n (s) => chalk.hex(THEME.primarySoft)(s),\n (s) => chalk.hex(THEME.secondary)(s),\n (s) => chalk.hex(THEME.accent)(s),\n (s) => chalk.hex(THEME.info)(s),\n (s) => chalk.hex(THEME.text)(s),\n];\nlet _li = 0;\n\nexport const log = (m: string): void => {\n _li++;\n const c = LOG_PALETTE[_li % LOG_PALETTE.length];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.primary)('[log]')} ${c(trunc(m, 120))}`\n );\n};\n\nconst INFO_PALETTE: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.info)(s),\n (s) => chalk.hex(THEME.secondary)(s),\n (s) => chalk.hex(THEME.primarySoft)(s),\n];\nlet _ii = 0;\n\nexport const info = (m: string): void => {\n _ii++;\n const c = INFO_PALETTE[_ii % INFO_PALETTE.length];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.info).bold('[info]')} ${c(trunc(m, 120))}`\n );\n};\n\nexport const warn = (m: string): void => {\n const colors: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.warning)(s),\n (s) => chalk.hex(THEME.primary)(s),\n ];\n const c = colors[Math.floor(Math.random() * colors.length)];\n const line = `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.warning).bold('[warn]')} ${c(trunc(m, 120))}`;\n if (_cooking) _cooking.log(line);\n else console.warn(line);\n};\n\nexport const success = (m: string): void => {\n const colors: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.success)(s),\n (s) => chalk.hex(THEME.info)(s),\n ];\n const c = colors[Math.floor(Math.random() * colors.length)];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.success)('[ok]')} ${c(trunc(m, 120))}`\n );\n};\n\nexport const error = (m: string): void => {\n const colors: Array<(s: string) => string> = [(s) => chalk.hex(THEME.error)(s)];\n const c = colors[Math.floor(Math.random() * colors.length)];\n const line = `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.error)('[error]')} ${c(trunc(m, 120))}`;\n if (_cooking) _cooking.log(line);\n else console.error(line);\n};\n","import type { PlatformHandler } from './types.js';\n\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf'];\n\nexport const framer: PlatformHandler = {\n name: 'framer',\n displayName: 'Framer',\n\n detectByUrl(url: string): boolean {\n return /\\.framer\\.(app|website)|framercanvas\\.com/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('id=\"main\"') &&\n (html.includes('framerstatic.com') || html.includes('framerusercontent.com'))\n );\n },\n\n stripDomains: ['events.framer.com', 'api.framer.com', 'collect.frameranalytics.com'],\n\n stripSelectors: [\n 'script[src*=\"events.framer.com\"]',\n '#__framer-badge-container',\n '#__framer-badge',\n 'link[href*=\"canvas-sandbox\"]',\n 'script[src*=\"framer.com/bootstrap\"]',\n ],\n\n stripPatterns: [\n /<div id=\"__framer-badge-container\"[^>]*><\\/div>/g,\n /<script>try\\{if\\(localStorage\\.get\\(\"__framer_force_showing_editorbar_since\"\\)\\)[^<]*<\\/script>/g,\n ],\n\n hydrationTimeout: 10000,\n needsHydrationCheck: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host.includes('framerusercontent.com')) {\n if (pathname.startsWith('/images/')) return 'assets/images';\n if (pathname.startsWith('/assets/')) {\n return FONT_EXTS.includes(ext) ? 'assets/fonts' : 'assets/misc';\n }\n if (pathname.startsWith('/sites/')) {\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.json') return 'data';\n if (ext === '.css') return 'styles';\n if (ext === '.framercms') return 'data';\n return 'assets/misc';\n }\n if (pathname.startsWith('/modules/')) {\n return ext === '.framercms' ? 'data' : 'scripts/modules';\n }\n return 'assets/misc';\n }\n\n if (host.includes('app.framerstatic.com')) {\n if (ext === '.css') return 'styles';\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.woff2' || ext === '.woff') return 'assets/fonts';\n if (ext === '.png' || ext === '.svg') return 'assets/images';\n return 'assets/misc';\n }\n\n if (host.includes('framercanvas.com') || host.includes('framer.com')) {\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from './types.js';\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const webflow: PlatformHandler = {\n name: 'webflow',\n displayName: 'Webflow',\n\n detectByUrl(url: string): boolean {\n return /\\.webflow\\.(io|com)/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('data-wf-site') ||\n html.includes('w-webflow-badge') ||\n html.includes('Webflow') ||\n html.includes('webflow.js')\n );\n },\n\n stripDomains: ['js-agent.newrelic.com', 'cdn.heapanalytics.com', 'tr.snapchat.com'],\n\n stripSelectors: ['.w-webflow-badge', 'link[href*=\"editorbar\"]'],\n\n stripPatterns: [\n /<a[^>]*class=\"[^\"]*w-webflow-badge[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n /<a[^>]*href=\"[^\"]*webflow\\.com\\?utm_campaign=brandjs[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n /<style>[^<]*\\.w-webflow-badge[^<]*<\\/style>/g,\n /Powered by <a[^>]*href=\"[^\"]*webflow\\.com\"[^>]*>[^<]*<\\/a>/g,\n /<!-- This site was created in Webflow\\.[^>]*-->/g,\n /<html([^>]*) data-wf-domain=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-page=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-site=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-status=\"[^\"]*\"/g,\n /<meta[^>]*content=\"Webflow\"[^>]*>/g,\n ],\n\n hydrationTimeout: 2000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (\n host.includes('website-files.com') ||\n host.includes('webflow.com') ||\n host.includes('uploads-ssl.webflow.com')\n ) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (pathname.includes('/css/') || ext === '.css') return 'styles';\n if (pathname.includes('/js/') || ext === '.js') return 'scripts/vendor';\n if (pathname.includes('/gsap/') || pathname.includes('/plugins/')) return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n if (host.includes('d3e54v103j8qbb.cloudfront.net')) {\n if (ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from './types.js';\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const wix: PlatformHandler = {\n name: 'wix',\n displayName: 'Wix',\n\n detectByUrl(url: string): boolean {\n return /\\.wixsite\\.com|\\.wix\\.com/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('wix-viewer-model') ||\n html.includes('id=\"WIX_ADS\"') ||\n html.includes('X-Wix-') ||\n html.includes('Wix.com') ||\n html.includes('wixcode-sdk') ||\n html.includes('data-wix') ||\n html.includes('wix-code') ||\n html.includes('WixCode') ||\n /\\bwix\\.com\\b/.test(html) ||\n /meta\\s+name=[\"']generator[\"']\\s+content=[\"'][^\"']*Wix[^\"']*[\"']/i.test(html) ||\n /_wix_/i.test(html) ||\n /wix-ecom/i.test(html)\n );\n },\n\n stripDomains: [\n 'frog.wix.com',\n 'bi.wixapi.com',\n 'fed.wixcodescheduler.com',\n 'editor.wix.com',\n 'panorama.wixapps.net',\n ],\n\n stripSelectors: ['#WIX_ADS', '.wix-ads', '#wix-badge', '#SCROLL_TO_TOP'],\n\n stripPatterns: [\n /<div[^>]*class=\"[^\"]*wix-ads[^\"]*\"[^>]*>[\\s\\S]*?<\\/div>/g,\n ],\n\n hydrationTimeout: 3000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host === 'video.wixstatic.com') {\n return 'assets/videos';\n }\n\n if (host.includes('wixstatic.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n if (host.includes('parastorage.com')) {\n if (ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler, PlatformType } from './types.js';\nimport type { Page } from 'puppeteer';\nimport { framer } from './framer.js';\nimport { webflow } from './webflow.js';\nimport { wix } from './wix.js';\n\nconst ALL_PLATFORMS: PlatformHandler[] = [framer, webflow, wix];\n\nexport function detectByUrl(url: string): PlatformHandler | null {\n for (const platform of ALL_PLATFORMS) {\n if (platform.detectByUrl(url)) return platform;\n }\n return null;\n}\n\nexport function detectByHtml(html: string): PlatformHandler | null {\n for (const platform of ALL_PLATFORMS) {\n if (platform.detectByHtml(html)) return platform;\n }\n return null;\n}\n\nexport function detectPlatform(url: string, html?: string): PlatformHandler {\n const byUrl = detectByUrl(url);\n if (byUrl) return byUrl;\n\n if (html) {\n const byHtml = detectByHtml(html);\n if (byHtml) return byHtml;\n }\n\n return framer;\n}\n\nexport async function detectByDom(page: Page): Promise<PlatformHandler | null> {\n try {\n const signal: string = await page.evaluate(() => {\n const html: string = document.documentElement.outerHTML || '';\n\n if (/wix-viewer-model|_wix_|wix-ecom/i.test(html)) return 'wix';\n if (/data-wf-|w-webflow-badge|webflow\\.js/i.test(html)) return 'webflow';\n if (/framerusercontent|framercanvas|framerstatic/i.test(html)) return 'framer';\n\n const srcs: string[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.querySelectorAll('script[src]');\n scripts.forEach((s) => { if (s.src) srcs.push(s.src); });\n const allSrcs: string = srcs.join(' ');\n if (/wixstatic\\.com|parastorage\\.com/.test(allSrcs)) return 'wix';\n if (/website-files\\.com|webflow\\.com/.test(allSrcs)) return 'webflow';\n if (/framerusercontent\\.com|framerstatic\\.com|framer\\.app/.test(allSrcs)) return 'framer';\n\n return '';\n });\n\n if (signal === 'wix') return wix;\n if (signal === 'webflow') return webflow;\n if (signal === 'framer') return framer;\n } catch {}\n return null;\n}\n\nexport function getPlatformByName(name: PlatformType): PlatformHandler {\n const map: Record<string, PlatformHandler> = { framer, webflow, wix };\n return map[name] || framer;\n}\n","export type { PlatformHandler, PlatformType } from './types.js';\nexport { framer } from './framer.js';\nexport { webflow } from './webflow.js';\nexport { wix } from './wix.js';\nexport { detectPlatform, detectByUrl, detectByHtml, detectByDom, getPlatformByName } from './detect.js';\n","import puppeteer, { type Page } from 'puppeteer';\nimport { CFG } from '../config/index.js';\nimport { log, success, info } from '../logger/index.js';\nimport { detectByDom } from '../platforms/index.js';\nimport type { ExporterContext } from '../types.js';\n\nexport async function launchAndCapture(exporter: ExporterContext): Promise<void> {\n exporter.cooking?.update('Launching browser...');\n log('Launching headless Chromium...');\n\n exporter.browser = await puppeteer.launch({\n headless: true,\n args: ['--no-sandbox', '--disable-setuid-sandbox'],\n });\n success('Chromium launched');\n\n exporter.page = await exporter.browser.newPage();\n await exporter.page.setViewport(CFG.viewport);\n log('Viewport set to ' + CFG.viewport.width + 'x' + CFG.viewport.height);\n\n await exporter.page.setUserAgent(\n 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +\n '(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'\n );\n log('User agent set to Chrome 131');\n\n const allStripDomains: string[] = [\n ...CFG.sharedStripDomains,\n ...exporter.platform.stripDomains,\n ];\n log('Blocking ' + allStripDomains.length + ' tracking domains:');\n for (const domain of allStripDomains) {\n log(' - ' + domain);\n }\n\n let intercepted = 0;\n let blocked = 0;\n\n exporter.page.on('response', async (res) => {\n const url: string = res.url();\n if (url.startsWith('data:') || url.startsWith('blob:')) return;\n\n try {\n const host: string = new URL(url).hostname;\n if (allStripDomains.some((d) => host.includes(d))) {\n blocked++;\n return;\n }\n } catch {\n return;\n }\n\n exporter.assets.localPathFor(url, exporter.platform);\n try {\n exporter.assets.buffers.set(url, await res.buffer());\n intercepted++;\n } catch {}\n });\n\n log('Network interception enabled');\n\n exporter.cooking?.update('Navigating to site...');\n info('Navigating to ' + exporter.siteUrl);\n await exporter.page.goto(exporter.siteUrl, {\n waitUntil: 'networkidle2',\n timeout: CFG.timeout,\n });\n success('Page loaded (networkidle2)');\n log('Intercepted ' + intercepted + ' resources, blocked ' + blocked + ' tracking requests');\n\n log('Checking DOM-based platform detection...');\n const domDetected = await detectByDom(exporter.page);\n if (domDetected && domDetected.name !== exporter.platform.name) {\n log('Platform refined from DOM: ' + domDetected.displayName + ' (override: ' + exporter.platform.name + ')');\n exporter.platform = domDetected;\n }\n\n exporter.cooking?.update('Waiting for ' + exporter.platform.displayName + ' hydration...');\n\n if (exporter.platform.needsHydrationCheck) {\n log('Checking for #main element hydration...');\n log('Hydration timeout: ' + exporter.platform.hydrationTimeout + 'ms');\n const timeout = exporter.platform.hydrationTimeout;\n await exporter.page.evaluate(`\n new Promise(function(r) {\n var start = Date.now();\n var tick = function() {\n var m = document.getElementById('main') || document.body;\n if (m && m.children.length > 0) setTimeout(r, 2000);\n else if (Date.now() - start > ${timeout}) r();\n else setTimeout(tick, 200);\n };\n tick();\n })\n `);\n success('Hydration complete (SPA rendered)');\n } else {\n log('Static site detected, waiting ' + exporter.platform.hydrationTimeout + 'ms for render...');\n await new Promise<void>((r) => setTimeout(r, exporter.platform.hydrationTimeout));\n success(exporter.platform.displayName + ' page rendered');\n }\n\n exporter.cooking?.update('Scrolling page...');\n log('Starting full-page scroll (step: ' + CFG.scrollStep + 'px, delay: ' + CFG.scrollDelay + 'ms)');\n\n const scrollStep = CFG.scrollStep;\n const scrollDelay = CFG.scrollDelay;\n\n const pageHeight: number = await exporter.page.evaluate(`\n Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)\n `) as number;\n log('Page height: ' + pageHeight + 'px (' + Math.ceil(pageHeight / scrollStep) + ' scroll steps)');\n\n await exporter.page.evaluate(`\n new Promise(function(r) {\n var y = 0;\n var max = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n var step = function() {\n y += ${scrollStep};\n window.scrollTo({ top: y, behavior: 'instant' });\n y < max + 500 ? setTimeout(step, ${scrollDelay}) : (window.scrollTo(0, 0), r());\n };\n step();\n })\n `);\n success('Full-page scroll complete');\n\n exporter.cooking?.update('Waiting for lazy resources...');\n log('Waiting 2s for lazy-loaded resources...');\n await new Promise<void>((r) => setTimeout(r, 2000));\n\n log('Checking network idle (1.5s quiet, 8s timeout)...');\n try {\n await exporter.page.waitForNetworkIdle({ idleTime: 1500, timeout: 8000 });\n success('Network idle confirmed');\n } catch {\n log('Network idle timeout reached (continuing anyway)');\n }\n\n const totalCaptured: number = exporter.assets.buffers.size;\n success('Captured ' + totalCaptured + ' network resources total');\n\n const cssCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.endsWith('.css')).length;\n const jsCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.endsWith('.js') || e.localPath.endsWith('.mjs')).length;\n const imgCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.startsWith('assets/images')).length;\n const fontCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.startsWith('assets/fonts')).length;\n log(' CSS: ' + cssCount + ' | JS: ' + jsCount + ' | Images: ' + imgCount + ' | Fonts: ' + fontCount);\n}\n\nexport async function closeBrowser(exporter: { browser: import('puppeteer').Browser | null }): Promise<void> {\n if (exporter.browser) {\n await exporter.browser.close();\n exporter.browser = null;\n log('Browser closed');\n }\n}\n\nexport async function captureSubpage(\n page: Page,\n url: string,\n platform: { needsHydrationCheck: boolean; hydrationTimeout: number }\n): Promise<string> {\n log(' Navigating to sub-page: ' + url);\n await page.goto(url, { waitUntil: 'networkidle2', timeout: CFG.timeout });\n\n if (platform.needsHydrationCheck) {\n await page.evaluate(\n `new Promise(function(r) {\n var t = Date.now();\n (function tick() {\n var m = document.getElementById('main') || document.body;\n if (m && m.children.length > 0) setTimeout(r, 500);\n else if (Date.now() - t > ${platform.hydrationTimeout}) r();\n else setTimeout(tick, 200);\n })();\n })`\n );\n } else {\n await new Promise<void>((r) => setTimeout(r, 1000));\n }\n\n const html: string = await page.evaluate(() => document.documentElement.outerHTML || document.body.innerHTML);\n log(' Sub-page fetched: ' + (html.length / 1024).toFixed(1) + ' KB');\n return html;\n}\n","export async function pool(tasks: Array<() => Promise<void>>, n: number): Promise<void> {\n let i = 0;\n const run = async (): Promise<void> => {\n while (i < tasks.length) {\n const j = i++;\n await tasks[j]();\n }\n };\n await Promise.all(Array.from({ length: Math.min(n, tasks.length) }, () => run()));\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { CFG } from '../config/index.js';\nimport { log, warn, success } from '../logger/index.js';\nimport { dlBuffer } from '../network/download.js';\nimport { pool } from '../network/pool.js';\nimport type { ExporterContext } from '../types.js';\n\nexport async function downloadAll(exporter: ExporterContext): Promise<void> {\n const seen: Set<string> = new Set();\n const toDownload: Array<{ url: string; localPath: string }> = [];\n for (const [url, { localPath }] of exporter.assets.entries) {\n if (seen.has(localPath)) continue;\n seen.add(localPath);\n toDownload.push({ url, localPath });\n }\n\n const total: number = toDownload.length;\n log('Starting download of ' + total + ' unique assets');\n log('Concurrency: ' + CFG.concurrency + ' parallel downloads');\n log('Retry policy: ' + CFG.retries + ' attempts, ' + CFG.dlTimeout + 'ms timeout');\n\n let ok = 0;\n let cached = 0;\n let fail = 0;\n let completed = 0;\n let lastReported = 0;\n\n const tasks: Array<() => Promise<void>> = toDownload.map(\n ({ url, localPath }) =>\n async (): Promise<void> => {\n const dest: string = path.join(exporter.outDir, localPath);\n await fs.mkdir(path.dirname(dest), { recursive: true });\n\n try {\n const buf: Buffer | undefined =\n exporter.assets.buffers.get(url) ||\n exporter.assets.buffers.get(url.split('?')[0]);\n if (buf) {\n await fs.writeFile(dest, buf);\n cached++;\n ok++;\n } else {\n const data: Buffer = await dlBuffer(url);\n await fs.writeFile(dest, data);\n ok++;\n }\n } catch (e) {\n fail++;\n if (\n !url.includes('framer.com/edit') &&\n !url.includes('framerstatic.com/editorbar')\n ) {\n warn('Download failed: ' + path.basename(localPath) + ' - ' + (e as Error).message);\n }\n }\n\n completed++;\n const pct: number = Math.floor((completed / total) * 100);\n if (pct >= lastReported + 10 || completed === total) {\n exporter.cooking?.update('Downloading... ' + completed + '/' + total + ' (' + pct + '%)');\n log('Download progress: ' + completed + '/' + total + ' (' + pct + '%)');\n lastReported = pct;\n }\n }\n );\n\n await pool(tasks, CFG.concurrency);\n\n success('Downloads complete: ' + ok + ' succeeded, ' + cached + ' from cache, ' + fail + ' failed');\n\n const totalBytes: number = [...exporter.assets.entries.values()].length;\n log('Total unique assets written to disk: ' + totalBytes);\n\n exporter.assets.buffers.clear();\n log('Network buffer cache cleared');\n}\n","import prettier from 'prettier';\n\nexport async function prettifyJS(src: string): Promise<string> {\n try {\n return await prettier.format(src, {\n parser: 'babel',\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n semi: true,\n singleQuote: false,\n trailingComma: 'es5',\n bracketSpacing: true,\n arrowParens: 'always',\n });\n } catch {\n return src;\n }\n}\n","export const SERVE_SCRIPT: string = `#!/usr/bin/env node\nimport http from 'node:http';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst PORT = process.env.PORT || 3000;\nconst ROOT = path.dirname(fileURLToPath(import.meta.url));\n\nconst MIME = {\n '.html': 'text/html; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.webp': 'image/webp',\n '.avif': 'image/avif',\n '.ico': 'image/x-icon',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n '.ttf': 'font/ttf',\n '.otf': 'font/otf',\n '.mp4': 'video/mp4',\n '.webm': 'video/webm',\n '.ogg': 'video/ogg',\n '.framercms': 'application/octet-stream',\n};\n\nconst server = http.createServer((req, res) => {\n let url = decodeURIComponent(req.url.split('?')[0]);\n if (url === '/') url = '/index.html';\n\n let filePath = path.join(ROOT, url);\n if (!filePath.startsWith(ROOT)) {\n res.writeHead(403);\n res.end('Forbidden');\n return;\n }\n\n const serveFile = (pathToFile) => {\n fs.readFile(pathToFile, (err, data) => {\n if (err) {\n // SPA Fallback: if it's not a file, serve index.html\n if (url !== '/index.html' && !path.extname(url)) {\n return serveFile(path.join(ROOT, 'index.html'));\n }\n res.writeHead(404);\n res.end('Not found');\n return;\n }\n const ext = path.extname(pathToFile).toLowerCase();\n const mime = MIME[ext] || 'application/octet-stream';\n res.writeHead(200, {\n 'Content-Type': mime,\n 'Access-Control-Allow-Origin': '*',\n 'Cache-Control': 'public, max-age=3600',\n });\n res.end(data);\n });\n };\n\n serveFile(filePath);\n});\n\nconst ANSI = {\n reset: '\\\\x1b[0m',\n primary: '\\\\x1b[38;2;250;178;131m',\n soft: '\\\\x1b[38;2;255;192;159m',\n text: '\\\\x1b[38;2;238;238;238m',\n muted: '\\\\x1b[38;2;128;128;128m',\n border: '\\\\x1b[38;2;72;72;72m',\n success: '\\\\x1b[38;2;127;216;143m',\n info: '\\\\x1b[38;2;86;182;194m',\n error: '\\\\x1b[38;2;224;108;117m',\n};\n\nfunction color(name, value) {\n return ANSI[name] + value + ANSI.reset;\n}\n\nfunction frameLine(label, value) {\n const text = ' ' + label.padEnd(10) + value;\n const pad = Math.max(0, 56 - text.length);\n console.log(' ' + color('border', '│ ') + color('muted', label.padEnd(10)) + color('text', value) + ' '.repeat(pad) + color('border', ' │'));\n}\n\nfunction drawServerUi() {\n console.log('');\n console.log(' ' + color('border', '╭─' + '─'.repeat(56) + '─╮'));\n console.log(' ' + color('border', '│ ') + color('text', ' Framer Export preview server') + ' '.repeat(26) + color('border', ' │'));\n console.log(' ' + color('border', '├─' + '─'.repeat(56) + '─┤'));\n frameLine('URL', 'http://localhost:' + PORT);\n frameLine('Root', ROOT);\n frameLine('Run', 'node serve.js');\n frameLine('Mode', 'static mirror + SPA fallback');\n console.log(' ' + color('border', '╰─' + '─'.repeat(56) + '─╯'));\n console.log('');\n console.log(' ' + color('success', 'ready') + color('muted', ' press Ctrl+C to stop') + '\\\\n');\n}\n\nserver.listen(PORT, () => {\n const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n const steps = ['Preparing server', 'Checking exported files', 'Binding local port', 'Serving static mirror'];\n let i = 0;\n const timer = setInterval(() => {\n const step = steps[Math.min(steps.length - 1, Math.floor(i / 6))];\n const dots = color('error', '.'.repeat(i % 4).padEnd(3, ' '));\n process.stdout.write('\\\\r\\\\x1B[2K ' + color('primary', frames[i % frames.length]) + ' ' + color('text', step) + dots);\n i++;\n }, 80);\n\n setTimeout(() => {\n clearInterval(timer);\n process.stdout.write('\\\\r\\\\x1B[2K');\n drawServerUi();\n }, 1280);\n});\n`;\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { log, warn, success } from '../logger/index.js';\nimport { prettifyJS } from '../formatter/prettify.js';\nimport { SERVE_SCRIPT } from '../server/template.js';\nimport type { ExporterContext } from '../types.js';\n\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction stripBySelector(html: string, sel: string): string {\n if (sel.includes('[src*=\"')) {\n const match = sel.match(/\\[src\\*=\"([^\"]+)\"\\]/);\n if (match) {\n const domain: string = escapeRegex(match[1]);\n html = html.replace(new RegExp(`<script[^>]*${domain}[^>]*>[^<]*<\\\\/script>`, 'g'), '');\n html = html.replace(new RegExp(`<script[^>]*${domain}[^>]*><\\\\/script>`, 'g'), '');\n }\n } else if (sel.includes('[href*=\"')) {\n const match = sel.match(/\\[href\\*=\"([^\"]+)\"\\]/);\n if (match) {\n const href: string = escapeRegex(match[1]);\n html = html.replace(new RegExp(`<link[^>]*${href}[^>]*>`, 'g'), '');\n }\n } else if (sel.startsWith('.')) {\n const cls: string = escapeRegex(sel.slice(1));\n html = html.replace(\n new RegExp(`<[^>]*class=\"[^\"]*${cls}[^\"]*\"[^>]*>[\\\\s\\\\S]*?<\\\\/[^>]*>`, 'g'),\n ''\n );\n } else if (sel.startsWith('#')) {\n const id: string = sel.slice(1);\n html = removeElementById(html, id);\n }\n return html;\n}\n\nfunction removeElementById(html: string, id: string): string {\n const marker: string = `id=\"${id}\"`;\n let idx: number = html.indexOf(marker);\n while (idx !== -1) {\n const tagStart: number = html.lastIndexOf('<', idx);\n if (tagStart === -1) break;\n\n const tagNameEnd: number = html.indexOf(' ', tagStart + 1);\n const tagName: string = html.slice(tagStart + 1, tagNameEnd).toLowerCase();\n\n let depth = 0;\n let i: number = tagStart;\n while (i < html.length) {\n if (\n html.startsWith(`<${tagName}`, i) &&\n (html[i + tagName.length + 1] === ' ' || html[i + tagName.length + 1] === '>')\n ) {\n depth++;\n i += tagName.length + 1;\n } else if (html.startsWith(`</${tagName}>`, i)) {\n depth--;\n if (depth === 0) {\n html = html.slice(0, tagStart) + html.slice(i + tagName.length + 3);\n break;\n }\n i += tagName.length + 3;\n } else {\n i++;\n }\n }\n\n idx = html.indexOf(marker);\n }\n return html;\n}\n\nfunction processSEO(html: string, url: string): string {\n const canonical = url.split('?')[0].replace(/\\/$/, '');\n\n // Inject Canonical\n if (!html.includes('rel=\"canonical\"')) {\n html = html.replace('</head>', ` <link rel=\"canonical\" href=\"${canonical}\">\\n </head>`);\n }\n\n // Inject Meta Description if missing\n if (!html.includes('name=\"description\"')) {\n html = html.replace(\n '</head>',\n ` <meta name=\"description\" content=\"Exported with Framer Export - Fast, SEO-optimized, and clean.\">\\n </head>`\n );\n }\n\n // Inject OG Tags if missing\n if (!html.includes('property=\"og:')) {\n html = html.replace(\n '</head>',\n ` <meta property=\"og:type\" content=\"website\">\\n <meta property=\"og:url\" content=\"${canonical}\">\\n <meta property=\"og:title\" content=\"Exported Site\">\\n <meta property=\"og:description\" content=\"A fast, clean version of this site, exported for performance.\">\\n </head>`\n );\n }\n\n // Inject Robot tags\n if (!html.includes('name=\"robots\"')) {\n html = html.replace('</head>', ` <meta name=\"robots\" content=\"index, follow\">\\n </head>`);\n }\n\n return html;\n}\n\nfunction stripIntegrityAndCors(html: string): string {\n html = html.replace(/\\s+integrity=\"[^\"]*\"/g, '');\n html = html.replace(/\\s+crossorigin=\"[^\"]*\"/g, '');\n html = html.replace(/\\s+crossorigin/g, '');\n html = html.replace(/<link[^>]*rel=\"preconnect\"[^>]*>/g, '');\n html = html.replace(/<link[^>]*rel=\"dns-prefetch\"[^>]*>/g, '');\n html = html.replace(/<meta[^>]*content-security-policy[^>]*>/gi, '');\n return html;\n}\n\nfunction stripSrcsetCdnUrls(html: string): string {\n html = html.replace(/srcset=\"([^\"]*)\"/g, (_match: string, srcset: string) => {\n const cleaned: string = srcset\n .split(',')\n .map((entry: string) => entry.trim())\n .filter((entry: string) => !entry.startsWith('http'))\n .join(', ');\n return cleaned ? 'srcset=\"' + cleaned + '\"' : '';\n });\n return html;\n}\n\nexport async function buildOutput(exporter: ExporterContext): Promise<void> {\n exporter.cooking?.update('Stripping platform badges...');\n log('Starting HTML post-processing...');\n log('HTML size: ' + (exporter.ssrHTML.length / 1024).toFixed(1) + ' KB');\n\n let html: string = exporter.ssrHTML;\n if (!html) {\n warn('No SSR HTML available, cannot build output');\n return;\n }\n\n exporter.cooking?.update('Removing integrity checks...');\n const beforeIntegrity: number = html.length;\n html = stripIntegrityAndCors(html);\n log('Stripped integrity/crossorigin/preconnect (' + (beforeIntegrity - html.length) + ' chars)');\n success('Integrity and CORS restrictions removed');\n\n if (typeof processSEO === 'function') {\n exporter.cooking?.update('Optimizing SEO...');\n html = processSEO(html, exporter.siteUrl);\n success('SEO meta tags optimized');\n }\n\n log('Stripping ' + exporter.platform.stripSelectors.length + ' selectors:');\n for (const sel of exporter.platform.stripSelectors) {\n const before: number = html.length;\n html = stripBySelector(html, sel);\n const removed: number = before - html.length;\n if (removed > 0) {\n log(' Stripped ' + sel + ' (' + removed + ' chars removed)');\n }\n }\n\n log('Applying ' + exporter.platform.stripPatterns.length + ' regex patterns...');\n for (const pattern of exporter.platform.stripPatterns) {\n const before: number = html.length;\n html = html.replace(new RegExp(pattern.source, pattern.flags), '');\n const removed: number = before - html.length;\n if (removed > 0) {\n log(' Pattern removed ' + removed + ' chars');\n }\n }\n success('Platform badges and tracking stripped');\n\n exporter.cooking?.update('Rewriting asset URLs...');\n log('Rewriting ' + exporter.assets.entries.size + ' CDN URLs to local paths...');\n const beforeRewrite: number = html.length;\n html = exporter.assets.rewrite(html, '');\n log('HTML rewrite delta: ' + (html.length - beforeRewrite) + ' chars');\n\n exporter.cooking?.update('Cleaning srcset references...');\n html = stripSrcsetCdnUrls(html);\n log('Cleaned remaining CDN URLs from srcset attributes');\n\n await rewriteDownloadedFiles(exporter);\n success('All URLs rewritten to local paths');\n\n exporter.cooking?.update('Pretty-printing JS files...');\n await prettifyDownloadedJS(exporter);\n\n exporter.cooking?.update('Writing final output...');\n log('Writing index.html (' + (html.length / 1024).toFixed(1) + ' KB)...');\n await fs.writeFile(path.join(exporter.outDir, 'index.html'), html);\n success('index.html written');\n\n await fs.writeFile(path.join(exporter.outDir, 'serve.js'), SERVE_SCRIPT);\n log('serve.js written');\n await fs.writeFile(\n path.join(exporter.outDir, 'package.json'),\n JSON.stringify({ type: 'module', scripts: { serve: 'node serve.js' } }, null, 2) + '\\n'\n );\n log('package.json written for serve.js');\n success('Output build complete');\n}\n\nasync function rewriteDownloadedFiles(exporter: ExporterContext): Promise<void> {\n const dirs: string[] = ['scripts/vendor', 'scripts/modules', 'styles'];\n let rewritten = 0;\n\n for (const dir of dirs) {\n const fullDir: string = path.join(exporter.outDir, dir);\n let files: string[];\n try {\n files = await fs.readdir(fullDir);\n } catch {\n continue;\n }\n\n for (const file of files) {\n const ext: string = path.extname(file).toLowerCase();\n if (!['.mjs', '.js', '.css'].includes(ext)) continue;\n\n const filePath: string = path.join(fullDir, file);\n try {\n let content: string = await fs.readFile(filePath, 'utf-8');\n const before: string = content;\n content = exporter.assets.rewrite(content, dir);\n if (content !== before) {\n await fs.writeFile(filePath, content);\n rewritten++;\n }\n } catch {}\n }\n }\n log('Rewrote URLs in ' + rewritten + ' JS/CSS files');\n}\n\nasync function prettifyDownloadedJS(exporter: ExporterContext): Promise<void> {\n const dirs: string[] = ['scripts/vendor', 'scripts/modules'];\n let count = 0;\n let total = 0;\n\n for (const dir of dirs) {\n const fullDir: string = path.join(exporter.outDir, dir);\n let files: string[];\n try {\n files = await fs.readdir(fullDir);\n } catch {\n continue;\n }\n\n const jsFiles: string[] = files.filter((f) => {\n const ext: string = path.extname(f).toLowerCase();\n return ext === '.mjs' || ext === '.js';\n });\n total += jsFiles.length;\n\n for (const file of jsFiles) {\n const filePath: string = path.join(fullDir, file);\n try {\n const raw: string = await fs.readFile(filePath, 'utf-8');\n\n const nlRatio: number = (raw.match(/\\n/g) || []).length / raw.length;\n if (nlRatio > 0.05) {\n count++;\n continue;\n }\n\n const pretty: string = await prettifyJS(raw);\n await fs.writeFile(filePath, pretty, 'utf-8');\n count++;\n\n if (count % 5 === 0) {\n exporter.cooking?.update('Pretty-printing... (' + count + '/' + total + ')');\n }\n } catch (e) {\n warn('Pretty-print skipped: ' + file + ' - ' + (e as Error).message);\n count++;\n }\n }\n }\n\n success('Formatted ' + count + '/' + total + ' JS/MJS files');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport type { ExporterContext } from '../types.js';\nimport { boxTop, boxLine, boxBot, boxSep, boxRow, maxWidth } from '../cli/box.js';\nimport { chip, ui } from '../cli/theme.js';\n\nexport async function printSummary(exporter: ExporterContext): Promise<void> {\n const w = maxWidth();\n const isSmall = w < 50;\n\n const count = async (d: string): Promise<number> => {\n try {\n return (await fs.readdir(path.join(exporter.outDir, d))).length;\n } catch {\n return 0;\n }\n };\n const [imgs, fonts, videos, misc, scripts, vendor, styles, data, subpages] = await Promise.all([\n count('assets/images'),\n count('assets/fonts'),\n count('assets/videos'),\n count('assets/misc'),\n count('scripts/modules'),\n count('scripts/vendor'),\n count('styles'),\n count('data'),\n count('subpages'),\n ]);\n\n const G = ui.primary;\n const G2 = ui.primarySoft;\n const C2 = ui.secondary;\n const Y = ui.accent;\n const O = ui.warning;\n const Br = ui.info;\n const Gr = ui.muted;\n const Gn = ui.success;\n\n const entries: Array<[string, number, string, (s: string) => string]> = [\n ['styles/', styles, 'CSS', G],\n ['scripts/vendor/', vendor, 'JS vendor', G2],\n ['scripts/modules/', scripts, 'JS modules', C2],\n ['assets/images/', imgs, 'images', Y],\n ['assets/videos/', videos, 'videos', O],\n ['assets/fonts/', fonts, 'fonts', Br],\n ['assets/misc/', misc, 'misc', Gr],\n ['data/', data, 'data', Gr],\n ['subpages/', subpages, 'pages', Gn],\n ];\n\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, `${ui.text.bold(' Export Summary')} ${chip('done')}`));\n console.log(boxSep(w));\n } else {\n console.log(ui.text.bold(' Export Summary:'));\n }\n\n for (const [label, cnt, type, color] of entries) {\n if (cnt === 0) continue;\n const inner = w - 4;\n const l = label.padEnd(16);\n const c = String(cnt).padStart(3);\n const rowText = `${color(l)}${ui.text(c)} ${ui.muted(type)}`;\n const visible = 16 + 3 + 2 + type.length;\n const pad = Math.max(0, inner - visible);\n if (isSmall) {\n console.log(` ${color(label)} ${ui.text(String(cnt))} ${ui.muted(type)}`);\n } else {\n console.log(' ' + ui.border('│ ') + rowText + ' '.repeat(pad) + ui.border(' │'));\n }\n }\n\n if (!isSmall) {\n console.log(boxBot(w));\n }\n\n console.log('');\n const cdCmd = 'cd ' + path.basename(exporter.outDir);\n const runCmd = 'node serve.js';\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' To serve locally')));\n console.log(boxSep(w));\n console.log(boxRow(w, 'Open', cdCmd));\n console.log(boxRow(w, 'Run', runCmd));\n console.log(boxBot(w));\n } else {\n console.log(ui.text.bold(' To serve locally:'));\n console.log(` ${G(cdCmd)}`);\n console.log(` ${G(runCmd)}`);\n }\n\n console.log('');\n console.log(ui.muted(' note: must be served via HTTP for JS modules to work.'));\n console.log('');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { stdin, stdout } from 'node:process';\nimport { spawn } from 'node:child_process';\nimport type { ExporterContext } from '../types.js';\nimport { select, type SelectOption } from '../cli/select.js';\nimport { boxTop, boxLine, boxSep, boxBot, maxWidth } from '../cli/box.js';\nimport { stripAnsi, ui } from '../cli/theme.js';\n\ninterface ConversionTarget {\n id: string;\n label: string;\n stack: string;\n projectDir: string;\n staticDir: string;\n scaffold: string;\n entryFiles: string;\n routing: string;\n}\n\ninterface AiTool {\n id: string;\n label: string;\n displayName: string;\n agentName: string;\n}\n\ninterface ConversionGoal {\n id: string;\n label: string;\n instruction: string;\n priority: string;\n}\n\ninterface ExportFacts {\n sourceUrl: string;\n outputDir: string;\n platformName: string;\n rootEntries: string[];\n counts: Record<string, number>;\n}\n\nconst IMPORTANT_DIRS = [\n 'index.html',\n 'styles',\n 'scripts/vendor',\n 'scripts/modules',\n 'assets/images',\n 'assets/videos',\n 'assets/fonts',\n 'assets/misc',\n 'data',\n 'subpages',\n];\n\nconst AI_TOOLS: AiTool[] = [\n {\n id: 'claude-code',\n label: 'Claude Code',\n displayName: 'Claude Code',\n agentName: 'Claude Code',\n },\n {\n id: 'codex',\n label: 'Codex',\n displayName: 'Codex',\n agentName: 'Codex coding agent',\n },\n {\n id: 'opencode',\n label: 'OpenCode',\n displayName: 'OpenCode',\n agentName: 'OpenCode',\n },\n {\n id: 'other-ai',\n label: 'Other AI coding agent',\n displayName: 'Other AI',\n agentName: 'AI coding agent',\n },\n];\n\nconst TARGETS: ConversionTarget[] = [\n {\n id: 'react-vite',\n label: 'React + Vite + TypeScript',\n stack: 'React 18/19, TypeScript, Vite, CSS modules or plain CSS',\n projectDir: 'converted-react-vite',\n staticDir: 'public',\n scaffold: 'npm create vite@latest converted-react-vite -- --template react-ts',\n entryFiles: 'src/main.tsx, src/App.tsx, src/components/*, src/styles/*',\n routing: 'Use React Router only if multiple exported pages exist in subpages/.',\n },\n {\n id: 'nextjs-app-router',\n label: 'Next.js App Router',\n stack: 'Next.js App Router, TypeScript, React Server Components where useful',\n projectDir: 'converted-nextjs',\n staticDir: 'public',\n scaffold: 'npx create-next-app@latest converted-nextjs --ts --app --eslint',\n entryFiles: 'app/page.tsx, app/layout.tsx, components/*, public/*',\n routing: 'Map exported subpages to app routes and keep shared layout code reusable.',\n },\n {\n id: 'vue-vite',\n label: 'Vue + Vite + TypeScript',\n stack: 'Vue 3, TypeScript, Vite, single-file components',\n projectDir: 'converted-vue-vite',\n staticDir: 'public',\n scaffold: 'npm create vite@latest converted-vue-vite -- --template vue-ts',\n entryFiles: 'src/main.ts, src/App.vue, src/components/*.vue, src/styles/*',\n routing: 'Use Vue Router only if multiple exported pages exist in subpages/.',\n },\n {\n id: 'sveltekit',\n label: 'SvelteKit',\n stack: 'SvelteKit, TypeScript, componentized routes and assets',\n projectDir: 'converted-sveltekit',\n staticDir: 'static',\n scaffold: 'npm create svelte@latest converted-sveltekit',\n entryFiles: 'src/routes/+page.svelte, src/lib/components/*, static/*',\n routing: 'Create SvelteKit routes for meaningful exported pages when subpages/ exists.',\n },\n {\n id: 'astro',\n label: 'Astro',\n stack: 'Astro, TypeScript, island components only where interactivity is needed',\n projectDir: 'converted-astro',\n staticDir: 'public',\n scaffold: 'npm create astro@latest converted-astro',\n entryFiles: 'src/pages/index.astro, src/components/*, public/*',\n routing: 'Use Astro pages for exported subpages and avoid unnecessary client JavaScript.',\n },\n];\n\nconst GOALS: ConversionGoal[] = [\n {\n id: 'clean-rebuild',\n label: 'Clean professional rebuild',\n instruction:\n 'Rebuild the export as clean production code, not as a one-file HTML clone, while preserving the full page experience.',\n priority: 'Readable structure, maintainability, complete pages, and faithful visual result.',\n },\n {\n id: 'pixel-perfect',\n label: 'Pixel-perfect visual migration',\n instruction:\n 'Prioritize pixel-perfect fidelity before refactoring anything aggressively, even when the layout is difficult.',\n priority:\n 'Spacing, typography, responsive behavior, colors, media, animations, and page-by-page fidelity.',\n },\n {\n id: 'component-system',\n label: 'Reusable component system',\n instruction:\n 'Extract repeated UI blocks into reusable components with clean props without simplifying the original pages.',\n priority:\n 'Components, layout primitives, naming, future editability, and complete section coverage.',\n },\n {\n id: 'performance-seo',\n label: 'Performance and SEO rebuild',\n instruction:\n 'Rebuild the site while reducing unused vendor code and improving SEO basics without losing visual fidelity.',\n priority:\n 'Fast loading, semantic markup, metadata, accessibility, asset hygiene, and faithful pages.',\n },\n];\n\nexport async function runAiPromptAssistant(exporter: ExporterContext): Promise<void> {\n if (!stdin.isTTY || !stdout.isTTY) return;\n\n const serveCommand = buildServeCommand(exporter);\n const shouldConvert = await runExportCompletePrompt(exporter, serveCommand);\n if (!shouldConvert) return;\n\n printAssistantModal(`${ui.text.bold('AI conversion prompt')} ${ui.error('BETA')}`, [\n 'Choose a target stack, AI tool, and conversion situation.',\n 'Mouse clicks are supported in the terminal when available.',\n 'A detailed prompt file will be generated inside the export folder.',\n ]);\n\n const targetOptions: SelectOption[] = [\n ...TARGETS.map((target) => ({ label: target.label, value: target.id })),\n { label: 'Customize with AI - BETA in development', value: 'custom-ai', disabled: true },\n ];\n\n const targetId = await select('Choose target stack', targetOptions, 0);\n\n const aiToolId = await select(\n 'Choose the AI coding tool',\n AI_TOOLS.map((tool) => ({ label: tool.label, value: tool.id })),\n 0\n );\n\n const goalId = await select(\n 'Choose the conversion situation',\n GOALS.map((goal) => ({ label: goal.label, value: goal.id })),\n 0\n );\n\n const target = TARGETS.find((item) => item.id === targetId) || TARGETS[0];\n const aiTool = AI_TOOLS.find((item) => item.id === aiToolId) || AI_TOOLS[0];\n const goal = GOALS.find((item) => item.id === goalId) || GOALS[0];\n const facts = await collectExportFacts(exporter);\n const prompt = buildConversionPrompt(target, aiTool, goal, facts);\n const aiDir = path.join(exporter.outDir, 'ai');\n const promptPath = path.join(aiDir, `${aiTool.id}-${target.id}-${goal.id}-prompt.md`);\n\n await fs.mkdir(aiDir, { recursive: true });\n await fs.writeFile(promptPath, prompt, 'utf-8');\n\n const copyPrompt = await runPromptReadyPrompt(promptPath, target, aiTool, goal);\n if (copyPrompt) {\n try {\n await copyToClipboard(prompt);\n console.log(` ${ui.success('✓')} ${ui.text.bold('Prompt copied to clipboard')}\\n`);\n } catch (error) {\n console.log(\n ` ${ui.warning('!')} ${ui.warning('Clipboard copy unavailable:')} ${ui.muted((error as Error).message)}\\n`\n );\n }\n }\n}\n\nasync function collectExportFacts(exporter: ExporterContext): Promise<ExportFacts> {\n const counts: Record<string, number> = {};\n const rootEntries = await safeReadDir(exporter.outDir);\n\n for (const item of IMPORTANT_DIRS) {\n counts[item] =\n item === 'index.html'\n ? (await exists(path.join(exporter.outDir, item)))\n ? 1\n : 0\n : await countEntries(path.join(exporter.outDir, item));\n }\n\n return {\n sourceUrl: exporter.siteUrl,\n outputDir: exporter.outDir,\n platformName: exporter.platform.displayName,\n rootEntries,\n counts,\n };\n}\n\nasync function exists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function safeReadDir(dir: string): Promise<string[]> {\n try {\n return (await fs.readdir(dir)).sort();\n } catch {\n return [];\n }\n}\n\nasync function countEntries(dir: string): Promise<number> {\n try {\n return (await fs.readdir(dir)).length;\n } catch {\n return 0;\n }\n}\n\nfunction buttonLabel(label: string): string {\n return `${ui.border('[')} ${ui.text.bold(label)} ${ui.border(']')}`;\n}\n\nfunction centerText(text: string, width: number): string {\n const visible = stripAnsi(text).length;\n if (visible >= width) return text;\n const left = Math.floor((width - visible) / 2);\n return ' '.repeat(left) + text + ' '.repeat(width - visible - left);\n}\n\nfunction buildServeCommand(exporter: ExporterContext): string {\n return `cd ${path.basename(exporter.outDir)} && node serve.js`;\n}\n\nasync function runExportCompletePrompt(\n exporter: ExporterContext,\n serveCommand: string\n): Promise<boolean> {\n let copyServeCommand = false;\n\n while (true) {\n const action = await select(\n 'Export complete',\n [\n {\n label: `${checkboxLabel(copyServeCommand)} Copy serve command when finishing`,\n value: 'toggle-copy',\n },\n {\n label: `${buttonLabel('Convert to AI code')} ${ui.error('BETA')}`,\n value: 'convert',\n },\n { label: buttonLabel('Finish'), value: 'finish' },\n ],\n 2,\n {\n headerLines: [\n `Output: ${path.basename(exporter.outDir)}`,\n `Run: ${serveCommand}`,\n 'Use Convert to open the AI conversion assistant.',\n ],\n footer: 'enter select · checkbox toggles copy · mouse hover/click',\n }\n );\n\n if (action === 'toggle-copy') {\n copyServeCommand = !copyServeCommand;\n continue;\n }\n\n if (action === 'finish') {\n if (copyServeCommand) {\n try {\n await copyToClipboard(serveCommand);\n console.log(` ${ui.success('✓')} ${ui.text.bold('Serve command copied')}\\n`);\n } catch (error) {\n console.log(\n ` ${ui.warning('!')} ${ui.warning('Clipboard copy unavailable:')} ${ui.muted((error as Error).message)}\\n`\n );\n }\n }\n return false;\n }\n\n return true;\n }\n}\n\nasync function runPromptReadyPrompt(\n promptPath: string,\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal\n): Promise<boolean> {\n const relPath = path.relative(process.cwd(), promptPath) || promptPath;\n let copyPrompt = false;\n\n while (true) {\n const action = await select(\n `AI Prompt Ready ${ui.error('BETA')}`,\n [\n {\n label: `${checkboxLabel(copyPrompt)} Copy prompt when finishing`,\n value: 'toggle-copy',\n },\n { label: buttonLabel('Finish'), value: 'finish' },\n ],\n 1,\n {\n headerLines: [\n `Tool: ${aiTool.displayName}`,\n `Stack: ${target.label}`,\n `Mode: ${goal.label}`,\n `File: ${relPath}`,\n ],\n footer: 'enter finish · checkbox toggles copy · mouse hover/click',\n }\n );\n\n if (action === 'toggle-copy') {\n copyPrompt = !copyPrompt;\n continue;\n }\n\n return copyPrompt;\n }\n}\n\nfunction checkboxLabel(checked: boolean): string {\n return checked ? ui.success('☑') : ui.muted('☐');\n}\n\nfunction printConvertPanel(exporter: ExporterContext): void {\n const w = maxWidth();\n const inner = w - 4;\n const rows = [\n centerText(`${ui.text.bold('AI Convert')} ${ui.error('BETA')}`, inner),\n centerText(ui.muted('Generate a conversion prompt after the export.'), inner),\n centerText(`${buttonLabel('Convert')} ${ui.muted('or')} ${buttonLabel('Skip')}`, inner),\n centerText(ui.muted(path.basename(exporter.outDir)), inner),\n ];\n\n console.log('');\n console.log(boxTop(w));\n for (const row of rows) console.log(boxLine(w, row));\n console.log(boxBot(w));\n console.log('');\n}\n\nfunction printAssistantModal(title: string, lines: string[]): void {\n const w = maxWidth();\n const inner = w - 4;\n\n console.log('');\n console.log(boxTop(w));\n console.log(boxLine(w, centerText(`${ui.primary('◆')} ${title}`, inner)));\n console.log(boxSep(w));\n for (const line of lines) {\n console.log(boxLine(w, centerText(ui.muted(line), inner)));\n }\n console.log(boxBot(w));\n console.log('');\n}\n\nfunction buildConversionPrompt(\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal,\n facts: ExportFacts\n): string {\n const rootEntries = facts.rootEntries.length\n ? facts.rootEntries.join(', ')\n : 'No root entries detected';\n const exportDir = quoteForPrompt(facts.outputDir);\n const projectDir = quoteForPrompt(path.join(facts.outputDir, target.projectDir));\n const scaffoldCommand = `cd ${exportDir}; ${target.scaffold}`;\n const sourceAssets = quoteForPrompt(path.join(facts.outputDir, 'assets', '*'));\n const destinationAssets = quoteForPrompt(\n path.join(facts.outputDir, target.projectDir, target.staticDir, 'assets')\n );\n const windowsAssetCopyCommand = `New-Item -ItemType Directory -Force -Path ${destinationAssets}; Copy-Item -Path ${sourceAssets} -Destination ${destinationAssets} -Recurse -Force`;\n const unixSourceAssets = quoteForPrompt(toPosixPath(path.join(facts.outputDir, 'assets')));\n const unixDestinationParent = quoteForPrompt(\n toPosixPath(path.join(facts.outputDir, target.projectDir, target.staticDir))\n );\n const unixAssetCopyCommand = `mkdir -p ${unixDestinationParent} && cp -R ${unixSourceAssets} ${unixDestinationParent}/assets`;\n const directoryLines = IMPORTANT_DIRS.map(\n (dir) => `Inspect ${dir}: ${facts.counts[dir]} item(s) detected in the export.`\n );\n const promptLines = [\n `You are ${aiTool.agentName} working inside a local export created by Framer Export.`,\n 'This brief was generated by the Framer Export AI Prompt Assistant BETA.',\n 'Treat this beta prompt as a strict conversion checklist, not as permission to skip inspection.',\n 'Your mission is to convert this exported static mirror into a clean production project.',\n `Target stack: ${target.stack}.`,\n `Selected AI coding tool: ${aiTool.displayName}.`,\n `Selected conversion situation: ${goal.label}.`,\n `Primary instruction for this situation: ${goal.instruction}`,\n `Main priority: ${goal.priority}`,\n `Source URL from the real export: ${facts.sourceUrl}`,\n `Detected platform from the real export: ${facts.platformName}`,\n `Export folder to inspect first: ${facts.outputDir}`,\n `Root entries actually present: ${rootEntries}`,\n `Create the converted project in: ${projectDir}`,\n `Recommended scaffold command: ${scaffoldCommand}`,\n `Expected important target files: ${target.entryFiles}`,\n `Routing guidance: ${target.routing}`,\n `Static assets destination for this stack: ${target.staticDir}/assets inside the converted project.`,\n `PowerShell command to copy exported assets after scaffolding: ${windowsAssetCopyCommand}`,\n `macOS/Linux command to copy exported assets after scaffolding: ${unixAssetCopyCommand}`,\n 'Run the asset copy command; do not recreate, redownload, rename randomly, or replace real exported assets with placeholders.',\n 'After copying assets, update every image, video, font, CSS url(), and script reference to the new local asset path.',\n 'Do not rush. Take time to inspect the export before writing the final implementation.',\n 'Do not invent brand names, copy, images, links, animations, colors, or sections.',\n 'Use only real information found in index.html, CSS files, JavaScript files, data files, and assets.',\n 'If a detail is missing, inspect more files instead of guessing.',\n 'If a vendor script is minified or hard to understand, identify what behavior it provides before replacing it.',\n 'Keep the final result professional, clean, responsive, and maintainable.',\n 'Do not simplify the site because a section, animation, page, or layout is difficult.',\n 'If something is hard, break it into smaller components and keep working until the result matches closely.',\n 'For every exported page, aim for the closest possible pixel-perfect result: spacing, typography, images, viewport behavior, and motion.',\n 'Do not merge multiple pages into one generic page unless the export proves they are duplicate routes.',\n 'Do not replace complex exported sections with summaries, cards, screenshots, or placeholder blocks.',\n 'If a page has visual depth, overlapping layers, sticky sections, galleries, or scroll effects, recreate those behaviors instead of flattening them.',\n 'Start by listing the files and directories that matter for the conversion.',\n ...directoryLines,\n 'Read index.html fully enough to understand page structure, metadata, linked assets, and scripts.',\n 'Read the CSS files that define layout, typography, responsive rules, and visual details.',\n 'Inspect scripts/vendor only to understand required interactions; do not blindly copy huge vendor bundles.',\n 'Inspect scripts/modules for page-specific logic, animations, sliders, menus, and dynamic behavior.',\n 'Inspect data files for CMS-like content, page data, configuration, or serialized props.',\n 'Inspect assets/images and preserve the real image files that are actually used.',\n 'Inspect assets/fonts and preserve font loading if the design depends on custom fonts.',\n 'Inspect subpages if it contains exported pages; map them to routes only when they represent real pages.',\n 'If subpages contains pages, convert each meaningful page with its own route and page component.',\n 'For each converted page, compare against the original exported HTML route and adjust until it is visually close.',\n 'Create a clean project structure instead of dumping everything into one component.',\n 'Separate global layout, page sections, shared components, data helpers, and styles.',\n 'Use semantic HTML for headings, navigation, buttons, forms, sections, and footer content.',\n 'Preserve the original hierarchy of visible content unless there is a clear bug to fix.',\n 'Preserve real URLs and links, but convert local asset paths to the new project structure.',\n 'Move static assets into the target framework public/static asset location when appropriate.',\n 'Do not keep broken CDN references if a local exported asset already exists.',\n 'Do not hardcode absolute machine paths into source files; use framework-relative public asset paths after copying.',\n 'Keep original filenames when possible so CSS and content references remain traceable.',\n 'Do not leave unused analytics, editor badges, platform badges, or export-only scripts in the new app.',\n 'Replace platform-specific runtime code with native framework components when possible.',\n 'Keep interactions that users can see: menus, hover states, forms, sliders, animations, and scroll effects.',\n 'If an interaction is too complex, implement a clean equivalent and document the difference briefly.',\n 'Keep responsive behavior for desktop, tablet, and mobile.',\n 'Check layout at small widths and avoid fixed desktop-only dimensions unless the original requires them.',\n 'Use CSS variables or a clear theme file for colors, spacing, radius, shadows, and typography.',\n 'Name components after their role: Hero, Header, FeatureGrid, Gallery, Pricing, Footer, and similar real sections.',\n 'Avoid generic placeholder components if the exported site has specific section meaning.',\n 'Use TypeScript types where they make the content or component props clearer.',\n 'Do not add unnecessary libraries unless they replace a real exported behavior cleanly.',\n 'If you add a library, explain why it is needed and where it is used.',\n 'Keep package.json scripts standard: dev, build, preview, lint when available.',\n 'Keep the build reproducible from a fresh install.',\n 'After implementing, run the install/build/typecheck commands available for the target project.',\n 'Fix any build errors instead of leaving TODOs.',\n 'Open the generated app locally if possible and compare against the exported index.html visually.',\n 'When there are subpages, compare every generated route against its matching exported file.',\n 'Verify that every visible image loads from the new project.',\n 'Verify that font rendering is close to the export.',\n 'Verify that navigation and internal links work.',\n 'Verify that responsive breakpoints do not overlap or hide important content.',\n 'Verify that there are no console errors caused by missing assets or copied platform scripts.',\n 'Keep accessibility basics: alt text when inferable, keyboard-reachable controls, visible focus states.',\n 'Keep SEO basics: title, meta description if present, canonical only if it is correct, Open Graph when present.',\n 'Do not fabricate SEO copy; reuse existing metadata or ask for missing copy if necessary.',\n 'Commit to a small number of high-quality files rather than many noisy fragments.',\n 'If a section repeats, extract a reusable component and data array.',\n 'If a section is unique, keep it simple and local to the page.',\n 'Document important migration decisions in a short README inside the converted project.',\n 'The README must mention the source export folder, target stack, setup command, and known limitations.',\n 'Do not delete the original export folder.',\n 'Do not modify unrelated files outside the new converted project unless required for setup.',\n 'If the worktree has existing changes, avoid reverting or overwriting them.',\n 'Before large edits, inspect first and explain the conversion plan briefly.',\n 'Then implement the conversion step by step until the app builds.',\n 'Final answer must summarize what was converted, where the new project lives, and which checks passed.',\n 'If something could not be converted, state the exact file or behavior and the reason.',\n 'Quality bar: the result should feel like a real hand-built production app, not an automated scrape or simplified demo.',\n ];\n\n return [\n `# ${aiTool.displayName} Conversion Prompt - ${target.label}`,\n '',\n 'Status: BETA assistant output. Review the export carefully and follow the real files.',\n `Generated from real export: ${facts.outputDir}`,\n `AI tool: ${aiTool.displayName}`,\n `Target: ${target.label}`,\n `Situation: ${goal.label}`,\n '',\n promptLines.map((line, index) => `${String(index + 1).padStart(2, '0')}. ${line}`).join('\\n'),\n '',\n ].join('\\n');\n}\n\nfunction quoteForPrompt(value: string): string {\n return `\"${value.replace(/\"/g, '\\\\\"')}\"`;\n}\n\nfunction toPosixPath(value: string): string {\n return value.replace(/\\\\/g, '/');\n}\n\nasync function copyToClipboard(text: string): Promise<void> {\n const commands =\n process.platform === 'win32'\n ? [{ command: 'clip', args: [] }]\n : process.platform === 'darwin'\n ? [{ command: 'pbcopy', args: [] }]\n : [\n { command: 'wl-copy', args: [] },\n { command: 'xclip', args: ['-selection', 'clipboard'] },\n { command: 'xsel', args: ['--clipboard', '--input'] },\n ];\n\n let lastError: Error | null = null;\n for (const item of commands) {\n try {\n await pipeToCommand(item.command, item.args, text);\n return;\n } catch (error) {\n lastError = error as Error;\n }\n }\n\n throw lastError || new Error('No clipboard command found');\n}\n\nfunction pipeToCommand(command: string, args: string[], input: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, { stdio: ['pipe', 'ignore', 'pipe'] });\n let stderr = '';\n let settled = false;\n\n const finish = (error?: Error): void => {\n if (settled) return;\n settled = true;\n if (error) reject(error);\n else resolve();\n };\n\n child.stderr?.on('data', (chunk: Buffer) => {\n stderr += chunk.toString();\n });\n child.on('error', finish);\n child.on('close', (code) => {\n if (code === 0) {\n finish();\n } else {\n finish(new Error(`${command} exited with ${code}${stderr ? `: ${stderr.trim()}` : ''}`));\n }\n });\n child.stdin?.end(input);\n });\n}\n\nfunction printPromptResult(\n promptPath: string,\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal\n): void {\n const w = maxWidth();\n const isSmall = w < 50;\n const inner = w - 4;\n const relPath = path.relative(process.cwd(), promptPath) || promptPath;\n\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(\n boxLine(\n w,\n centerText(\n `${ui.success('✓')} ${ui.text.bold('AI Prompt Ready')} ${ui.error('BETA')}`,\n inner\n )\n )\n );\n console.log(boxSep(w));\n console.log(\n boxLine(w, centerText(`${ui.muted('Tool')} ${ui.primary(aiTool.displayName)}`, inner))\n );\n console.log(boxLine(w, centerText(`${ui.muted('Stack')} ${ui.primary(target.label)}`, inner)));\n console.log(boxLine(w, centerText(`${ui.muted('Mode')} ${ui.primary(goal.label)}`, inner)));\n console.log(boxLine(w, centerText(`${ui.muted('File')} ${ui.primary(relPath)}`, inner)));\n console.log(boxSep(w));\n console.log(\n boxLine(w, centerText(`${buttonLabel('Copy prompt')} ${buttonLabel('Done')}`, inner))\n );\n console.log(boxBot(w));\n } else {\n console.log(ui.text.bold(' AI Prompt Ready - BETA'));\n console.log(` Tool: ${ui.primary(aiTool.displayName)}`);\n console.log(` Stack: ${ui.primary(target.label)}`);\n console.log(` Situation: ${ui.primary(goal.label)}`);\n console.log(` File: ${ui.primary(relPath)}`);\n }\n console.log('');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport chalk from 'chalk';\nimport type { Browser, Page } from 'puppeteer';\nimport { AssetMap } from '../assets/asset-map.js';\nimport { dlBuffer } from '../network/download.js';\nimport { info, log, success, setCooking } from '../logger/index.js';\nimport { launchAndCapture, captureSubpage, closeBrowser } from './capture.js';\nimport { downloadAll } from './download.js';\nimport { buildOutput } from './output.js';\nimport { printSummary } from './summary.js';\nimport { runAiPromptAssistant } from '../ai/prompt-assistant.js';\nimport { detectPlatform, getPlatformByName } from '../platforms/index.js';\nimport type { PlatformHandler, PlatformType } from '../platforms/types.js';\nimport type { ExporterContext } from '../types.js';\nimport { CookingSpinner } from '../cli/cooking.js';\nimport { chip, ui } from '../cli/theme.js';\n\nexport function deriveOutputName(url: string, platformName: PlatformType): string {\n try {\n const parsed = new URL(url);\n const hostname: string = parsed.hostname;\n\n let siteName: string;\n if (hostname.endsWith('.webflow.io')) {\n siteName = hostname.replace('.webflow.io', '');\n } else if (hostname.includes('.wixsite.com')) {\n const parts: string[] = parsed.pathname.split('/').filter(Boolean);\n siteName = parts[0] || hostname.split('.')[0];\n } else if (hostname.match(/\\.framer\\.(app|website|ai)$/)) {\n siteName = hostname.split('.framer.')[0];\n } else {\n siteName = hostname.replace(/\\./g, '-');\n }\n\n const cleanName =\n siteName\n .toLowerCase()\n .replace(/[^a-z0-9_-]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '') || 'site';\n\n return `${platformName}-${cleanName}-${randomOutputSuffix()}`;\n } catch {\n return `framer-export-output-${randomOutputSuffix()}`;\n }\n}\n\nfunction randomOutputSuffix(): string {\n const adjectives = ['clean', 'bright', 'swift', 'sharp', 'fresh', 'solid', 'tidy', 'prime'];\n const nouns = ['mirror', 'export', 'site', 'build', 'copy', 'page', 'stack', 'bundle'];\n const adjective = adjectives[Math.floor(Math.random() * adjectives.length)];\n const noun = nouns[Math.floor(Math.random() * nouns.length)];\n const id = Math.random().toString(36).slice(2, 6);\n return `${adjective}-${noun}-${id}`;\n}\n\nexport class FramerExporter implements ExporterContext {\n siteUrl: string;\n outDir: string;\n assets: AssetMap;\n browser: Browser | null;\n page: Page | null;\n ssrHTML: string;\n prettyPrint: boolean;\n platform: PlatformHandler;\n cooking?: CookingSpinner;\n\n constructor(siteUrl: string, outDir: string, platformOverride?: PlatformType) {\n this.siteUrl = siteUrl;\n this.outDir = outDir;\n this.assets = new AssetMap();\n this.browser = null;\n this.page = null;\n this.ssrHTML = '';\n this.prettyPrint = true;\n\n if (platformOverride && platformOverride !== 'unknown') {\n this.platform = getPlatformByName(platformOverride);\n } else {\n this.platform = detectPlatform(siteUrl);\n }\n }\n\n async run(includeSubpages: boolean = false): Promise<void> {\n console.log(\n `\\n ${ui.text.bold('Framer Export')} ${chip('mirror')} ${ui.muted('v4 pipeline')}\\n`\n );\n info('Source : ' + chalk.underline(this.siteUrl));\n info('Output : ' + ui.primary(this.outDir));\n info('Platform : ' + ui.primary(this.platform.displayName));\n if (includeSubpages) {\n info('Subpages : ' + ui.success('enabled'));\n }\n console.log('');\n\n this.cooking = new CookingSpinner();\n setCooking(this.cooking);\n this.cooking.start('Preparing directories...');\n\n for (const d of [\n '',\n 'assets/images',\n 'assets/fonts',\n 'assets/videos',\n 'assets/misc',\n 'styles',\n 'scripts/vendor',\n 'scripts/modules',\n 'data',\n 'subpages',\n ]) {\n await fs.mkdir(path.join(this.outDir, d), { recursive: true });\n }\n log('Output directory structure created');\n\n this.cooking.update('Fetching SSR HTML...');\n log('Fetching SSR HTML from ' + this.siteUrl);\n try {\n const buf: Buffer = await dlBuffer(this.siteUrl);\n this.ssrHTML = buf.toString('utf-8');\n success('SSR HTML fetched (' + (this.ssrHTML.length / 1024).toFixed(1) + ' KB)');\n } catch (e) {\n log(chalk.red('Could not fetch SSR HTML: ' + (e as Error).message));\n }\n\n const htmlDetected = detectPlatform(this.siteUrl, this.ssrHTML);\n if (htmlDetected.name !== this.platform.name) {\n this.platform = htmlDetected;\n log('Platform refined: ' + ui.primary(this.platform.displayName) + ' (from HTML analysis)');\n }\n\n await launchAndCapture(this);\n\n if (includeSubpages && this.page) {\n await this.crawlSubpages();\n }\n\n await closeBrowser(this);\n\n this.cooking.update('Downloading assets...');\n await downloadAll(this);\n\n this.cooking.update('Building output...');\n await buildOutput(this);\n\n this.cooking.stop();\n setCooking(null);\n\n console.log('');\n success('Export complete!');\n await printSummary(this);\n await runAiPromptAssistant(this);\n }\n\n private async crawlSubpages(): Promise<void> {\n this.cooking?.update('Discovering sub-pages...');\n log('Scanning page for internal links...');\n\n const page = this.page!;\n const baseUrl = new URL(this.siteUrl);\n const baseHost = baseUrl.hostname.replace(/^www\\./, '');\n\n const links: string[] = await page.evaluate((host: string) => {\n const anchors = Array.from(document.querySelectorAll('a[href]'));\n const hrefs = new Set<string>();\n for (const a of anchors) {\n const href = (a as HTMLAnchorElement).href;\n if (\n !href ||\n href.startsWith('javascript:') ||\n href.startsWith('mailto:') ||\n href.startsWith('tel:') ||\n href.startsWith('#')\n )\n continue;\n try {\n const u = new URL(href);\n const h = u.hostname.replace(/^www\\./, '');\n if (\n h === host &&\n u.pathname !== '/' &&\n u.pathname !== '' &&\n !u.pathname.startsWith('/#')\n ) {\n hrefs.add(href.split('#')[0]);\n }\n } catch {}\n }\n return Array.from(hrefs);\n }, baseHost);\n\n log('Found ' + links.length + ' sub-page links');\n const uniqueLinks = [...new Set(links)].slice(0, 50);\n\n if (uniqueLinks.length === 0) {\n log('No sub-pages to crawl');\n return;\n }\n\n for (let i = 0; i < uniqueLinks.length; i++) {\n const link = uniqueLinks[i];\n this.cooking?.update('Crawling sub-page ' + (i + 1) + '/' + uniqueLinks.length);\n try {\n const html = await captureSubpage(page, link, {\n needsHydrationCheck: this.platform.needsHydrationCheck,\n hydrationTimeout: this.platform.hydrationTimeout,\n });\n\n const slug = this.deriveSlug(link, baseUrl);\n const filename = slug + '.html';\n const filepath = path.join(this.outDir, 'subpages', filename);\n\n await fs.writeFile(filepath, html, 'utf-8');\n log(' Saved: subpages/' + filename);\n } catch (e) {\n log(' Skipped ' + link + ': ' + (e as Error).message);\n }\n }\n\n success('Sub-pages crawled: ' + uniqueLinks.length);\n }\n\n private deriveSlug(link: string, baseUrl: URL): string {\n try {\n const u = new URL(link);\n let pathname = u.pathname.replace(/\\/+$/, '').replace(/^\\//, '');\n if (!pathname) return 'index';\n return pathname.replace(/[^a-zA-Z0-9_-]/g, '_').replace(/_+/g, '_') || 'page';\n } catch {\n return 'page';\n }\n }\n}\n","import readline from 'node:readline/promises';\nimport { stdin, stdout } from 'node:process';\nimport path from 'node:path';\nimport { URL } from 'node:url';\nimport chalk from 'chalk';\nimport { showBanner } from './banner.js';\nimport { FramerExporter, deriveOutputName } from '../exporter/index.js';\nimport { detectPlatform } from '../platforms/index.js';\nimport { promptInput, select } from './select.js';\nimport type { PlatformType } from '../platforms/types.js';\nimport { boxTop, boxLine, boxSep, boxBot, boxRow, maxWidth } from './box.js';\nimport { bullet, chip, ui } from './theme.js';\n\nfunction drawHeader(title: string): void {\n const w = maxWidth();\n if (w < 50) {\n console.log(`\\n ${bullet('●')} ${ui.text.bold(title)}`);\n return;\n }\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' ' + title)));\n console.log(boxBot(w));\n console.log('');\n}\n\nexport async function runSetup(legacyMode: boolean = false): Promise<void> {\n showBanner();\n\n console.log(` ${ui.text.bold('Framer Export setup')} ${chip('interactive')}`);\n console.log(\n ` ${ui.muted('Export Framer, Webflow, and Wix sites into a clean local mirror.')}\\n`\n );\n\n const rl = legacyMode ? readline.createInterface({ input: stdin, output: stdout }) : null;\n\n const ask = async (\n question: string,\n defaultVal?: string,\n headerLines: string[] = []\n ): Promise<string> => {\n if (!legacyMode) {\n return promptInput(question, defaultVal || '', { headerLines });\n }\n\n const suffix: string = defaultVal ? chalk.gray(` (${defaultVal})`) : '';\n const prompt: string = ` ${ui.primary('●')} ${ui.text.bold(question)}${suffix} ${ui.muted('>')} `;\n const answer: string = await rl!.question(prompt);\n return answer.trim() || defaultVal || '';\n };\n\n if (legacyMode) drawHeader('Step 1 : Site URL');\n\n let siteUrl = '';\n let urlError = '';\n while (!siteUrl) {\n const input: string = await ask(\n 'Enter the site URL',\n '',\n ['Step 1 : Site URL', urlError].filter(Boolean)\n );\n try {\n new URL(input);\n siteUrl = input;\n urlError = '';\n } catch {\n urlError = 'Invalid URL. Enter a valid URL (https://...)';\n if (legacyMode) {\n console.log(` ${ui.error('✗')} ${ui.error(urlError)}\\n`);\n }\n }\n }\n if (legacyMode) {\n console.log(` ${ui.success('✓')} ${ui.success('URL:')} ${chalk.underline(siteUrl)}\\n`);\n }\n\n let platformName: PlatformType | null = null;\n\n if (legacyMode) {\n drawHeader('Step 2 : Platform');\n const detected = detectPlatform(siteUrl);\n console.log(` ${ui.info('i')} Auto-detected: ${ui.primary(detected.displayName)}`);\n const platformInput: string = await ask('Platform (framer/webflow/wix)', detected.name);\n platformName = (\n ['framer', 'webflow', 'wix'].includes(platformInput) ? platformInput : detected.name\n ) as PlatformType;\n console.log(` ${ui.success('✓')} ${ui.success('Platform:')} ${ui.primary(platformName)}\\n`);\n } else {\n while (!platformName) {\n const detected = detectPlatform(siteUrl);\n const platforms = [\n {\n label: `Framer${detected.name === 'framer' ? chalk.gray(' (detected)') : ''}`,\n value: 'framer',\n },\n {\n label: `Webflow${detected.name === 'webflow' ? chalk.gray(' (detected)') : ''}`,\n value: 'webflow',\n },\n { label: `Wix${detected.name === 'wix' ? chalk.gray(' (detected)') : ''}`, value: 'wix' },\n ];\n const defaultIdx = ['framer', 'webflow', 'wix'].indexOf(detected.name);\n const platformChoice = await select('Select platform', platforms, Math.max(0, defaultIdx), {\n headerLines: [`URL: ${siteUrl}`],\n actions: [{ label: 'Modify URL', value: 'modify-url' }],\n footer: 'tab focus button · mouse hover/click · enter select',\n });\n\n if (platformChoice === 'modify-url') {\n siteUrl = '';\n urlError = '';\n while (!siteUrl) {\n const input = await ask(\n 'Modify site URL',\n '',\n ['Step 1 : Site URL', urlError].filter(Boolean)\n );\n try {\n new URL(input);\n siteUrl = input;\n urlError = '';\n } catch {\n urlError = 'Invalid URL. Enter a valid URL (https://...)';\n }\n }\n continue;\n }\n\n platformName = platformChoice as PlatformType;\n }\n }\n\n if (!platformName) {\n throw new Error('Platform selection failed');\n }\n\n const rl2 = legacyMode ? rl! : null;\n\n const ask2 = async (\n question: string,\n defaultVal?: string,\n headerLines: string[] = []\n ): Promise<string> => {\n if (!legacyMode) {\n return promptInput(question, defaultVal || '', { headerLines });\n }\n\n const suffix: string = defaultVal ? chalk.gray(` (${defaultVal})`) : '';\n const prompt: string = ` ${ui.primary('●')} ${ui.text.bold(question)}${suffix} ${ui.muted('>')} `;\n const answer: string = await rl2!.question(prompt);\n return answer.trim() || defaultVal || '';\n };\n\n const derivedName: string = deriveOutputName(siteUrl, platformName);\n\n if (legacyMode) drawHeader('Step 3 : Output Directory');\n\n const outDir: string = await ask2('Output directory', './' + derivedName, [\n 'Step 3 : Output Directory',\n `URL: ${siteUrl}`,\n `Platform: ${platformName}`,\n ]);\n if (legacyMode) {\n console.log(` ${ui.success('✓')} ${ui.success('Output:')} ${ui.primary(outDir)}\\n`);\n }\n\n if (legacyMode) drawHeader('Step 4 : Options');\n\n let prettyPrint: boolean;\n let concurrency: number;\n let includeSubpages: boolean;\n\n if (legacyMode) {\n const prettyAnswer: string = await ask2('Pretty-print JS files? (y/n)', 'y');\n prettyPrint = prettyAnswer.toLowerCase().startsWith('y');\n console.log(\n ` ${ui.success('✓')} Pretty-print: ${prettyPrint ? ui.success('yes') : ui.error('no')}\\n`\n );\n\n const subpagesAnswer: string = await ask2('Export sub-pages? (y/n)', 'n');\n includeSubpages = subpagesAnswer.toLowerCase().startsWith('y');\n console.log(\n ` ${ui.success('✓')} Sub-pages: ${includeSubpages ? ui.success('yes') : ui.error('no')}\\n`\n );\n\n const concurrencyAnswer: string = await ask2('Download concurrency', '12');\n concurrency = parseInt(concurrencyAnswer, 10) || 12;\n console.log(` ${ui.success('✓')} Concurrency: ${ui.primary(String(concurrency))}\\n`);\n } else {\n const prettyVal = await select('Pretty-print JS files?', [\n { label: 'Yes', value: 'yes' },\n { label: 'No', value: 'no' },\n ]);\n prettyPrint = prettyVal === 'yes';\n\n const subpagesVal = await select(\n 'Export sub-pages?',\n [\n { label: 'No', value: 'no' },\n { label: 'Yes, crawl and export', value: 'yes' },\n ],\n 0\n );\n includeSubpages = subpagesVal === 'yes';\n\n const concurrencyVal = await select(\n 'Download concurrency',\n [\n { label: '6 (slow connection)', value: '6' },\n { label: '12 (default)', value: '12' },\n { label: '20 (fast connection)', value: '20' },\n ],\n 1\n );\n concurrency = parseInt(concurrencyVal, 10);\n }\n\n const w = maxWidth();\n const isSmall = w < 50;\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' Summary')));\n console.log(boxSep(w));\n } else {\n console.log(ui.text.bold(' Summary:'));\n }\n\n for (const [label, value] of [\n ['URL', siteUrl],\n ['Platform', platformName],\n ['Output', path.resolve(outDir)],\n ['Pretty-print', prettyPrint ? 'yes' : 'no'],\n ['Sub-pages', includeSubpages ? 'yes' : 'no'],\n ['Concurrency', String(concurrency)],\n ]) {\n console.log(boxRow(w, label, value));\n }\n\n if (!isSmall) {\n console.log(boxBot(w));\n }\n console.log('');\n\n let startExport: boolean;\n\n if (legacyMode) {\n const confirm: string = await ask2('Start export? (y/n)', 'y');\n startExport = confirm.toLowerCase().startsWith('y');\n rl2!.close();\n } else {\n const confirmVal = await select('Start export?', [\n { label: 'Yes, start now', value: 'yes' },\n { label: 'Cancel', value: 'no' },\n ]);\n startExport = confirmVal === 'yes';\n }\n\n if (!startExport) {\n console.log(`\\n ${ui.warning('Export cancelled.')}\\n`);\n return;\n }\n\n console.log('');\n\n const { CFG } = await import('../config/index.js');\n CFG.concurrency = concurrency;\n\n const exporter = new FramerExporter(siteUrl, path.resolve(outDir), platformName);\n exporter.prettyPrint = prettyPrint;\n await exporter.run(includeSubpages);\n}\n","import path from 'path';\nimport { URL } from 'url';\nimport { spawnSync } from 'child_process';\nimport pkg from '../../package.json';\nimport { showHelp } from './help.js';\nimport { showBanner } from './banner.js';\nimport { showLoadingIntro } from './cooking.js';\nimport { checkForUpdates } from './update-check.js';\nimport { select } from './select.js';\nimport { ui } from './theme.js';\nimport type { PlatformType } from '../platforms/types.js';\n\nconst VERSION = pkg.version;\n\nfunction extractFlag(args: string[], flag: string): string | null {\n const idx: number = args.indexOf(flag);\n if (idx === -1 || idx + 1 >= args.length) return null;\n const value: string = args[idx + 1];\n args.splice(idx, 2);\n return value;\n}\n\nfunction hasFlag(args: string[], flag: string): boolean {\n const idx: number = args.indexOf(flag);\n if (idx === -1) return false;\n args.splice(idx, 1);\n return true;\n}\n\nasync function showUpdateNotice(): Promise<void> {\n const latest = await checkForUpdates(VERSION);\n if (!latest) return;\n\n if (!process.stdin.isTTY || !process.stdout.isTTY) {\n console.log('');\n console.log(\n ` ${ui.warning('↳')} Update available: ${ui.muted(VERSION)} -> ${ui.success(latest)}`\n );\n console.log(` ${ui.primary(' Run:')} ${ui.primarySoft('npm i -g framer-export@latest')}`);\n console.log('');\n return;\n }\n\n const action = await select(\n 'Update available',\n [\n { label: 'Continue without updating', value: 'continue' },\n { label: 'Update now', value: 'update' },\n ],\n 0,\n {\n headerLines: [\n `Current version: ${VERSION}`,\n `Latest version: ${latest}`,\n 'You can continue now and update later.',\n ],\n footer: 'enter continue · mouse hover/click',\n }\n );\n\n if (action === 'update') {\n console.log(\n ` ${ui.primary('Updating:')} ${ui.primarySoft('npm i -g framer-export@latest')}\\n`\n );\n const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n const result = spawnSync(npmCommand, ['i', '-g', 'framer-export@latest'], {\n stdio: 'inherit',\n });\n\n if (result.status === 0) {\n console.log(`\\n ${ui.success('✓')} Updated. Re-run your command to use the new version.\\n`);\n process.exit(0);\n }\n\n console.log(\n `\\n ${ui.error('✗')} Update failed. Run manually: ${ui.primarySoft('npm i -g framer-export@latest')}\\n`\n );\n }\n}\n\nasync function main(): Promise<void> {\n const args: string[] = process.argv.slice(2);\n\n if (args.includes('--version') || args.includes('-v')) {\n console.log(VERSION);\n process.exit(0);\n }\n\n if (args.includes('--about')) {\n const chalk = (await import('chalk')).default;\n showBanner();\n console.log(` ${ui.text.bold('Framer Export')} ${ui.muted(`v${pkg.version}`)}`);\n console.log(` ${ui.text(pkg.description)}\\n`);\n console.log(` ${ui.text.bold('Author')} ${ui.primary('Dany (danbenba)')}`);\n console.log(\n ` ${ui.text.bold('Portfolio')} ${chalk.underline.hex('#FAB283')('https://github.com/danbenba')}`\n );\n console.log(\n ` ${ui.text.bold('GitHub')} ${chalk.underline.hex('#FAB283')(pkg.repository.url.replace('git+', '').replace('.git', ''))}`\n );\n console.log(\n ` ${ui.text.bold('npm')} ${chalk.underline.hex('#FAB283')(`https://www.npmjs.com/package/${pkg.name}`)}`\n );\n console.log(` ${ui.text.bold('License')} ${ui.success(pkg.license)}`);\n console.log(` ${ui.text.bold('Node')} ${ui.muted(`>=${pkg.engines.node}`)}`);\n console.log('');\n process.exit(0);\n }\n\n if (args.includes('--help') || args.includes('-h')) {\n showHelp();\n process.exit(0);\n }\n\n await showLoadingIntro(VERSION);\n await showUpdateNotice();\n\n if (args.includes('--setup')) {\n hasFlag(args, '--setup');\n const legacyMode: boolean = hasFlag(args, '--legacy-mode');\n const { runSetup } = await import('./setup.js');\n await runSetup(legacyMode);\n return;\n }\n\n if (!args.length) {\n const { runSetup } = await import('./setup.js');\n await runSetup(false);\n return;\n }\n\n const platformOverride = extractFlag(args, '--platform') as PlatformType | null;\n const includeSubpages: boolean = hasFlag(args, '--subpages');\n\n showBanner();\n\n const url: string = args[0];\n\n try {\n new URL(url);\n } catch {\n console.log(` ${ui.error('✗')} ${ui.error.bold('Invalid URL:')} ${ui.text(url)}`);\n console.log(` ${ui.muted('Expected: https://yoursite.framer.app')}\\n`);\n process.exit(1);\n }\n\n const { FramerExporter, deriveOutputName } = await import('../exporter/index.js');\n const { detectPlatform } = await import('../platforms/index.js');\n\n const detected = platformOverride || detectPlatform(url).name;\n const defaultDir: string = deriveOutputName(url, detected as PlatformType);\n const out: string = args[1] || `./${defaultDir}`;\n\n try {\n await new FramerExporter(url, path.resolve(out), platformOverride || undefined).run(\n includeSubpages\n );\n } catch (e) {\n const chalk = (await import('chalk')).default;\n console.log(\n `\\n ${ui.error('✗')} ${ui.error.bold('FAILED:')} ${ui.text((e as Error).message)}`\n );\n console.log(chalk.gray((e as Error).stack || ''));\n process.exit(1);\n }\n}\n\nmain();\n","import { showBanner } from './banner.js';\nimport { chip, ui } from './theme.js';\n\nexport function showHelp(): void {\n showBanner();\n\n console.log(`${ui.text.bold(' USAGE')} ${chip('cli')}\\n`);\n console.log(\n ` ${ui.primary('framer-export')} ${ui.warning('<url>')} ${ui.muted('[output-dir]')}`\n );\n console.log(\n ` ${ui.primary('fexport')} ${ui.warning('<url>')} ${ui.muted('[output-dir]')}`\n );\n\n console.log('');\n console.log(ui.text.bold(' OPTIONS\\n'));\n\n const opts: Array<[string, string]> = [\n ['--setup', 'Launch the interactive setup assistant'],\n ['--platform <p>', 'Force platform: framer, webflow, wix'],\n ['--subpages', 'Crawl and export sub-pages'],\n ['--legacy-mode', 'Use text input instead of arrow selection'],\n ['--help, -h', 'Show this help message'],\n ];\n\n for (const [flag, desc] of opts) {\n console.log(` ${ui.success(flag.padEnd(18))} ${ui.text(desc)}`);\n }\n\n console.log('');\n console.log(ui.text.bold(' SUPPORTED PLATFORMS\\n'));\n\n const platforms: Array<[string, string]> = [\n ['Framer', 'Auto-detected via .framer.app / .framer.website URLs'],\n ['Webflow', 'Auto-detected via .webflow.io URLs'],\n ['Wix', 'Auto-detected via .wixsite.com URLs + HTML analysis'],\n ];\n\n for (const [name, desc] of platforms) {\n console.log(` ${ui.primary(name.padEnd(12))} ${ui.muted(desc)}`);\n }\n\n console.log('');\n console.log(ui.text.bold(' EXAMPLES\\n'));\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://mysite.framer.app')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://mysite.webflow.io')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://user.wixsite.com/my-site')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--platform webflow')} ${ui.warning('https://custom.com')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--subpages')} ${ui.warning('https://mysite.com')}`\n );\n console.log(` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--setup')}`);\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--setup --legacy-mode')}`\n );\n console.log('');\n}\n","import https from 'https';\n\nexport async function checkForUpdates(currentVersion: string): Promise<string | null> {\n return new Promise((resolve) => {\n const req = https.get(\n 'https://registry.npmjs.org/framer-export/latest',\n { timeout: 3000 },\n (res) => {\n let data = '';\n res.on('data', (chunk) => (data += chunk));\n res.on('end', () => {\n try {\n const json = JSON.parse(data);\n const latest = json.version;\n if (!latest) return resolve(null);\n if (isNewerVersion(latest, currentVersion)) return resolve(latest);\n resolve(null);\n } catch {\n resolve(null);\n }\n });\n }\n );\n req.on('error', () => resolve(null));\n req.on('timeout', () => {\n req.destroy();\n resolve(null);\n });\n });\n}\n\nfunction isNewerVersion(latest: string, current: string): boolean {\n const latestParts = parseVersion(latest);\n const currentParts = parseVersion(current);\n\n for (let i = 0; i < Math.max(latestParts.length, currentParts.length); i++) {\n const latestPart = latestParts[i] ?? 0;\n const currentPart = currentParts[i] ?? 0;\n if (latestPart > currentPart) return true;\n if (latestPart < currentPart) return false;\n }\n\n return false;\n}\n\nfunction parseVersion(version: string): number[] {\n return version\n .replace(/^v/, '')\n .split(/[.-]/)\n .map((part) => Number.parseInt(part, 10))\n .filter((part) => Number.isFinite(part));\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,KAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,SAAW;AAAA,QACX,cAAgB;AAAA,MAClB;AAAA,MACA,OAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,KAAO;AAAA,QACP,OAAS;AAAA,QACT,WAAa;AAAA,QACb,QAAU;AAAA,QACV,gBAAkB;AAAA,QAClB,SAAW;AAAA,MACb;AAAA,MACA,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,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AAKG,MAAK,QAAQ,GAAG,GAAG,oBAAoB,MAAS,EAAE;AAAA,MAC9E;AAAA,IACF;AAAA,EACF,SAAS,GAAG;AACV,UAAMN,UAAS,MAAM,OAAO,OAAO,GAAG;AACtC,YAAQ;AAAA,MACN;AAAA,IAAO,GAAG,MAAM,QAAG,CAAC,IAAI,GAAG,MAAM,KAAK,SAAS,CAAC,IAAI,GAAG,KAAM,EAAY,OAAO,CAAC;AAAA,IACnF;AACA,YAAQ,IAAIA,OAAM,KAAM,EAAY,SAAS,EAAE,CAAC;AAChD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,KAAK;","names":["chalk","chalk","output","URL","https","URL","chalk","FONT_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","path","init_download","fs","path","fs","path","fs","path","stdin","stdout","target","goal","centerText","fs","path","chalk","init_download","readline","stdin","stdout","path","URL","chalk","CFG","path","URL","chalk","runSetup","URL","FramerExporter","deriveOutputName","detectPlatform","path"]}
|
|
1
|
+
{"version":3,"sources":["../../package.json","../../src/cli/theme.ts","../../src/cli/banner.ts","../../src/platforms/framer.ts","../../src/platforms/webflow.ts","../../src/platforms/wix.ts","../../src/platforms/builder/bubble.ts","../../src/platforms/builder/carrd.ts","../../src/platforms/builder/duda.ts","../../src/platforms/builder/squarespace.ts","../../src/platforms/builder/strikingly.ts","../../src/platforms/builder/tilda.ts","../../src/platforms/builder/weebly.ts","../../src/platforms/landing/clickfunnels.ts","../../src/platforms/landing/elementor.ts","../../src/platforms/landing/instapage.ts","../../src/platforms/landing/systemeio.ts","../../src/platforms/landing/unbounce.ts","../../src/platforms/cms/ghost.ts","../../src/platforms/cms/notion.ts","../../src/platforms/cms/wordpress.ts","../../src/platforms/course/kajabi.ts","../../src/platforms/course/podia.ts","../../src/platforms/course/teachable.ts","../../src/platforms/course/thinkific.ts","../../src/platforms/ecommerce/gumroad.ts","../../src/platforms/ecommerce/shopify.ts","../../src/platforms/ai/gamma.ts","../../src/platforms/registry.ts","../../src/platforms/detect.ts","../../src/platforms/index.ts","../../src/cli/cooking.ts","../../src/cli/box.ts","../../src/cli/select.ts","../../src/assets/asset-map.ts","../../src/config/index.ts","../../src/network/download.ts","../../src/logger/index.ts","../../src/exporter/anti-bot.ts","../../src/exporter/capture.ts","../../src/network/pool.ts","../../src/exporter/download.ts","../../src/formatter/prettify.ts","../../src/server/template.ts","../../src/exporter/output.ts","../../src/exporter/summary.ts","../../src/ai/prompt-assistant.ts","../../src/exporter/index.ts","../../src/cli/select-grouped.ts","../../src/cli/setup.ts","../../src/cli/index.ts","../../src/cli/help.ts","../../src/cli/update-check.ts"],"sourcesContent":["{\n \"name\": \"framer-export\",\n \"version\": \"5.0.0-beta.1\",\n \"description\": \"Export 25+ website platforms (Framer, Webflow, Wix, Shopify, Notion, WordPress, Squarespace, Ghost, and more) into a fully working local mirror. Downloads all assets, strips badges, rewrites URLs, and pretty-prints JS.\",\n \"type\": \"module\",\n \"main\": \"dist/cli/index.js\",\n \"types\": \"dist/cli/index.d.ts\",\n \"bin\": {\n \"framer-export\": \"bin/framer-export.js\",\n \"fexport\": \"bin/fexport.js\",\n \"framerexport\": \"bin/framerexport.js\"\n },\n \"files\": [\n \"dist/\",\n \"bin/\",\n \"LICENSE\",\n \"README.md\"\n ],\n \"scripts\": {\n \"start\": \"tsx src/cli/index.ts\",\n \"dev\": \"tsx src/cli/index.ts\",\n \"build\": \"tsup\",\n \"typecheck\": \"tsc --noEmit\",\n \"format\": \"prettier --write \\\"src/**/*.ts\\\"\",\n \"prepublishOnly\": \"npm run build\",\n \"prepack\": \"npm run build\"\n },\n \"keywords\": [\n \"framer\",\n \"webflow\",\n \"wix\",\n \"shopify\",\n \"notion\",\n \"wordpress\",\n \"squarespace\",\n \"ghost\",\n \"carrd\",\n \"bubble\",\n \"gumroad\",\n \"exporter\",\n \"export\",\n \"scraper\",\n \"mirror\",\n \"site-downloader\",\n \"site-export\",\n \"cli\"\n ],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/danbenba/FramerExport.git\"\n },\n \"homepage\": \"https://github.com/danbenba/FramerExport#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/danbenba/FramerExport/issues\"\n },\n \"license\": \"MIT\",\n \"author\": \"Dany (danbenba)\",\n \"engines\": {\n \"node\": \">=18.0.0\"\n },\n \"dependencies\": {\n \"chalk\": \"^5.3.0\",\n \"ora\": \"^8.0.0\",\n \"prettier\": \"^3.2.0\",\n \"puppeteer\": \"^22.0.0\",\n \"readline-promise\": \"^1.0.5\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.0.0\",\n \"tsup\": \"^8.5.1\",\n \"tsx\": \"^4.7.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n","import chalk from 'chalk';\n\nexport const THEME = {\n background: '#0A0A0A',\n panel: '#141414',\n element: '#1E1E1E',\n border: '#484848',\n borderActive: '#606060',\n text: '#EEEEEE',\n muted: '#808080',\n primary: '#FAB283',\n primarySoft: '#FFC09F',\n secondary: '#5C9CF5',\n accent: '#9D7CD8',\n success: '#7FD88F',\n warning: '#F5A742',\n error: '#E06C75',\n info: '#56B6C2',\n};\n\nexport const ui = {\n text: chalk.hex(THEME.text),\n muted: chalk.hex(THEME.muted),\n primary: chalk.hex(THEME.primary),\n primarySoft: chalk.hex(THEME.primarySoft),\n secondary: chalk.hex(THEME.secondary),\n accent: chalk.hex(THEME.accent),\n success: chalk.hex(THEME.success),\n warning: chalk.hex(THEME.warning),\n error: chalk.hex(THEME.error),\n info: chalk.hex(THEME.info),\n border: chalk.hex(THEME.border),\n borderActive: chalk.hex(THEME.borderActive),\n panel: chalk.hex(THEME.panel),\n};\n\nexport function stripAnsi(s: string): string {\n return s.replace(/\\x1B\\[[0-9;]*[a-zA-Z]/g, '');\n}\n\nexport function softGradient(text: string): string {\n const colors = [THEME.primary, THEME.primarySoft, THEME.text, THEME.primarySoft, THEME.primary];\n let cursor = 0;\n return text\n .split('')\n .map((char) => {\n if (char === ' ') return char;\n const color = colors[cursor % colors.length];\n cursor++;\n return chalk.hex(color).bold(char);\n })\n .join('');\n}\n\nexport function chip(label: string): string {\n return `${ui.border('[')}${ui.primary(label)}${ui.border(']')}`;\n}\n\nexport function bullet(label: string = '•'): string {\n return ui.primary(label);\n}\n\nexport function centerText(text: string, width: number): string {\n const visible = stripAnsi(text).length;\n if (visible >= width) return text;\n const left = Math.floor((width - visible) / 2);\n return ' '.repeat(left) + text + ' '.repeat(width - visible - left);\n}\n\nexport function truncatePlain(text: string, max: number): string {\n if (text.length <= max) return text;\n return text.slice(0, Math.max(0, max - 2)) + '..';\n}\n","import pkg from '../../package.json';\nimport { chip, softGradient, ui } from './theme.js';\n\nfunction getWidth(): number {\n return process.stdout.columns || 80;\n}\n\nconst ASCII_ART = [\n '███████╗██████╗ █████╗ ███╗ ███╗███████╗██████╗ ',\n '██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██╔══██╗',\n '█████╗ ██████╔╝███████║██╔████╔██║█████╗ ██████╔╝',\n '██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██╔══██╗',\n '██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗██║ ██║',\n '╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝',\n '███████╗██╗ ██╗██████╗ ██████╗ ██████╗ ████████╗',\n '██╔════╝╚██╗██╔╝██╔══██╗██╔═══██╗██╔══██╗╚══██╔══╝',\n '█████╗ ╚███╔╝ ██████╔╝██║ ██║██████╔╝ ██║ ',\n '██╔══╝ ██╔██╗ ██╔═══╝ ██║ ██║██╔══██╗ ██║ ',\n '███████╗██╔╝ ██╗██║ ╚██████╔╝██║ ██║ ██║ ',\n '╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ',\n];\n\nexport function showBanner(): void {\n const width = getWidth();\n const isSmall = width < 65;\n\n if (isSmall) {\n console.log(\n `\\n ${ui.primary.bold('f-export')} ${ui.muted(`v${pkg.version}`)} ${chip('beta ui')}`\n );\n console.log(` ${ui.text.bold('Framer Export')} ${ui.muted('25+ platforms · local mirror')}\\n`);\n return;\n }\n\n console.log('');\n ASCII_ART.forEach((line) => {\n console.log(' ' + softGradient(line));\n });\n console.log('');\n console.log(\n ` ${ui.muted(`v${pkg.version}`)} ${ui.text.bold('Framer Export')} ${chip('fexport')} ${ui.muted('local mirror exporter')}`\n );\n console.log(\n ` ${ui.muted('Framer')} ${ui.border('/')} ${ui.muted('Webflow')} ${ui.border('/')} ${ui.muted('Wix')} ${ui.border('/')} ${ui.muted('+22 more')} ${ui.border('·')} ${ui.primary('clean assets')} ${ui.border('·')} ${ui.secondary('local serve')}\\n`\n );\n}\n","import type { PlatformHandler } from './types.js';\n\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf'];\n\nexport const framer: PlatformHandler = {\n name: 'framer',\n displayName: 'Framer',\n category: 'builder',\n priority: 95,\n\n detectByUrl(url: string): boolean {\n return /\\.framer\\.(app|website)|framercanvas\\.com/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('id=\"main\"') &&\n (html.includes('framerstatic.com') || html.includes('framerusercontent.com'))\n );\n },\n\n stripDomains: ['events.framer.com', 'api.framer.com', 'collect.frameranalytics.com'],\n\n stripSelectors: [\n 'script[src*=\"events.framer.com\"]',\n '#__framer-badge-container',\n '#__framer-badge',\n 'link[href*=\"canvas-sandbox\"]',\n 'script[src*=\"framer.com/bootstrap\"]',\n ],\n\n stripPatterns: [\n /<div id=\"__framer-badge-container\"[^>]*><\\/div>/g,\n /<script>try\\{if\\(localStorage\\.get\\(\"__framer_force_showing_editorbar_since\"\\)\\)[^<]*<\\/script>/g,\n ],\n\n hydrationTimeout: 10000,\n needsHydrationCheck: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host.includes('framerusercontent.com')) {\n if (pathname.startsWith('/images/')) return 'assets/images';\n if (pathname.startsWith('/assets/')) {\n return FONT_EXTS.includes(ext) ? 'assets/fonts' : 'assets/misc';\n }\n if (pathname.startsWith('/sites/')) {\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.json') return 'data';\n if (ext === '.css') return 'styles';\n if (ext === '.framercms') return 'data';\n return 'assets/misc';\n }\n if (pathname.startsWith('/modules/')) {\n return ext === '.framercms' ? 'data' : 'scripts/modules';\n }\n return 'assets/misc';\n }\n\n if (host.includes('app.framerstatic.com')) {\n if (ext === '.css') return 'styles';\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.woff2' || ext === '.woff') return 'assets/fonts';\n if (ext === '.png' || ext === '.svg') return 'assets/images';\n return 'assets/misc';\n }\n\n if (host.includes('framercanvas.com') || host.includes('framer.com')) {\n if (ext === '.mjs' || ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from './types.js';\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const webflow: PlatformHandler = {\n name: 'webflow',\n displayName: 'Webflow',\n category: 'builder',\n priority: 90,\n\n detectByUrl(url: string): boolean {\n return /\\.webflow\\.(io|com)/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('data-wf-site') ||\n html.includes('w-webflow-badge') ||\n html.includes('Webflow') ||\n html.includes('webflow.js')\n );\n },\n\n stripDomains: ['js-agent.newrelic.com', 'cdn.heapanalytics.com', 'tr.snapchat.com'],\n\n stripSelectors: ['.w-webflow-badge', 'link[href*=\"editorbar\"]'],\n\n stripPatterns: [\n /<a[^>]*class=\"[^\"]*w-webflow-badge[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n /<a[^>]*href=\"[^\"]*webflow\\.com\\?utm_campaign=brandjs[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n /<style>[^<]*\\.w-webflow-badge[^<]*<\\/style>/g,\n /Powered by <a[^>]*href=\"[^\"]*webflow\\.com\"[^>]*>[^<]*<\\/a>/g,\n /<!-- This site was created in Webflow\\.[^>]*-->/g,\n /<html([^>]*) data-wf-domain=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-page=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-site=\"[^\"]*\"/g,\n /<html([^>]*) data-wf-status=\"[^\"]*\"/g,\n /<meta[^>]*content=\"Webflow\"[^>]*>/g,\n ],\n\n hydrationTimeout: 2000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (\n host.includes('website-files.com') ||\n host.includes('webflow.com') ||\n host.includes('uploads-ssl.webflow.com')\n ) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (pathname.includes('/css/') || ext === '.css') return 'styles';\n if (pathname.includes('/js/') || ext === '.js') return 'scripts/vendor';\n if (pathname.includes('/gsap/') || pathname.includes('/plugins/')) return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n if (host.includes('d3e54v103j8qbb.cloudfront.net')) {\n if (ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from './types.js';\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const wix: PlatformHandler = {\n name: 'wix',\n displayName: 'Wix',\n category: 'builder',\n priority: 88,\n\n detectByUrl(url: string): boolean {\n return /\\.wixsite\\.com|\\.wix\\.com/.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('wix-viewer-model') ||\n html.includes('id=\"WIX_ADS\"') ||\n html.includes('X-Wix-') ||\n html.includes('Wix.com') ||\n html.includes('wixcode-sdk') ||\n html.includes('data-wix') ||\n html.includes('wix-code') ||\n html.includes('WixCode') ||\n /\\bwix\\.com\\b/.test(html) ||\n /meta\\s+name=[\"']generator[\"']\\s+content=[\"'][^\"']*Wix[^\"']*[\"']/i.test(html) ||\n /_wix_/i.test(html) ||\n /wix-ecom/i.test(html)\n );\n },\n\n stripDomains: [\n 'frog.wix.com',\n 'bi.wixapi.com',\n 'fed.wixcodescheduler.com',\n 'editor.wix.com',\n 'panorama.wixapps.net',\n ],\n\n stripSelectors: ['#WIX_ADS', '.wix-ads', '#wix-badge', '#SCROLL_TO_TOP'],\n\n stripPatterns: [\n /<div[^>]*class=\"[^\"]*wix-ads[^\"]*\"[^>]*>[\\s\\S]*?<\\/div>/g,\n ],\n\n hydrationTimeout: 3000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host === 'video.wixstatic.com') {\n return 'assets/videos';\n }\n\n if (host.includes('wixstatic.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n if (host.includes('parastorage.com')) {\n if (ext === '.js') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Bubble — v5 production handler.\n *\n * Interface: PlatformHandler (src/platforms/types.ts).\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n *\n * Bubble apps are client-rendered SPAs: the raw SSR <body> is essentially empty\n * (JS error-fallback overlays only), so captureRenderedDom is required and the\n * exporter must run a headless browser (needsHydrationCheck=true). The rendered\n * app roots at #main-page and content nodes carry class \"bubble-element\" — both\n * runtime-only, absent from static HTML.\n *\n * Detection: the default hosting subdomain *.bubbleapps.io is the primary URL\n * tell (priority 85). Custom-domain Bubble apps are caught by HTML/JS markers:\n * window.appquery = make_proxy(...), the window.bubble_* / _bubble_page_load_data\n * globals, and the /package/{early_js,run_js,dynamic_js,static_js,run_css,\n * pre_run_jquery_js}/<hash>/ bundle paths. No <meta name=\"generator\"> is emitted.\n *\n * Verified July 2026 against raw HTML of bubble.io and demo-app-72f8k.bubbleapps.io.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const bubble: PlatformHandler = {\n name: 'bubble',\n displayName: 'Bubble',\n category: 'builder',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.bubbleapps\\.io/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // Distinctive, stable inline markers found verbatim in every Bubble <head>.\n // None collide with Framer / Webflow / Wix.\n return (\n html.includes('window.appquery = make_proxy(') ||\n html.includes('window._bubble_page_load_data') ||\n html.includes('window.bubble_session_uid') ||\n html.includes('/package/pre_run_jquery_js/')\n );\n },\n\n // Telemetry only (Plausible-based, on standard-plan apps). NEVER the asset CDN.\n stripDomains: ['pluginpul.se'],\n\n // Post-process removal of any telemetry <script> that survived into the DOM.\n stripSelectors: ['script[src*=\"pluginpul.se\"]'],\n\n stripPatterns: [\n // \"Made with Bubble\" badge — injected at runtime by run.js and gated by\n // window._p.no_branding, so it never appears in the raw SSR HTML (only in\n // the captured rendered DOM). Best-effort strip anchored on its bubble.io\n // target: matches an <a> pointing at the bubble.io ROOT (optionally with a\n // tracking query), which is tight enough to spare normal deep-links to\n // bubble.io content pages.\n /<a\\b[^>]*href=\"https?:\\/\\/(?:www\\.)?bubble\\.io\\/?(?:\\?[^\"]*)?\"[^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n needsHydrationCheck: true,\n hydrationTimeout: 8000,\n hydrationSelector: '#main-page',\n captureRenderedDom: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Platform font bucket (also fed by the Google WebFont loader).\n if (host.includes('meta-fonts.cdn.bubble.io')) {\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n // Per-app uploads (<32-hex>.cdn.bubble.io) plus the platform buckets\n // meta.cdn.bubble.io / meta-q.cdn.bubble.io / base cdn.bubble.io. The\n // substring match catches all *.cdn.bubble.io subdomains.\n if (host.includes('cdn.bubble.io')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // Bubble's CloudFront distributions serve the /package JS + CSS bundles.\n if (\n host.includes('d3dqmih97rcqmh.cloudfront.net') ||\n host.includes('d1muf25xaso8hp.cloudfront.net')\n ) {\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Carrd — v5 production handler.\n *\n * Signatures (verified live across 5 reference sites):\n * detectByUrl: host matches \\.carrd\\.co (covers *.carrd.co and *.demo.carrd.co)\n * detectByHtml: inline IIFE runtime hallmark `$inner = $('.inner')`, the\n * `…-component` class scheme, the \"( Made with Carrd )\" badge\n * anchor, and the current-gen `.site-wrapper > .site-main` nesting\n * badge: free-plan <p id=\"credits\"><a href=\"https://carrd.co\">( Made with Carrd )</a></p>\n * render: ssr-static — full text/images live in the raw HTML; a `.deferred`\n * + @keyframes loading-spinner only fades content in, so no\n * hydration wait and no rendered-DOM capture are required\n * assets: no dedicated CDN — assets are SAME-ORIGIN relative paths under\n * /assets/{images,css,js}/ with ?v=<hash>; the only cross-origin\n * host referenced statically is fonts.googleapis.com (CSS)\n *\n * Carrd emits NO <meta name=\"generator\">, so detectGenerator is intentionally omitted.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const carrd: PlatformHandler = {\n name: 'carrd',\n displayName: 'Carrd',\n category: 'builder',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.carrd\\.co/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n // Hallmark inline runtime IIFE, present on every Carrd site (new and old).\n html.includes(\"$inner = $('.inner')\") ||\n // Free-plan \"( Made with Carrd )\" badge anchor.\n html.includes('href=\"https://carrd.co\"') ||\n // Carrd's component-class scheme (…-component). Webflow uses w-* prefixes and\n // Wix uses random ids, so this family does not collide with the frozen trio.\n /class=\"[^\"]*\\b(?:text|image|container|buttons|icons|divider|links)-component\\b/.test(html) ||\n // Current-gen structural nesting: .site-wrapper > .site-main (both required, so\n // neither generic-sounding class triggers detection on its own).\n (html.includes('class=\"site-wrapper\"') && html.includes('class=\"site-main\"'))\n );\n },\n\n // No third-party analytics/telemetry is injected by default (profile\n // analyticsScripts is empty), and fonts.googleapis.com is a needed asset host,\n // so nothing is blocked during capture.\n stripDomains: [],\n\n // The badge id sits directly on the <p> (there is no wrapper div and no\n // class=\"credits\"); removing #credits drops the whole \"Made with Carrd\" line.\n stripSelectors: ['#credits'],\n\n stripPatterns: [\n // Free-plan badge paragraph: <p id=\"credits\"><a href=\"https://carrd.co\">…</a></p>\n /<p[^>]*id=\"credits\"[^>]*>[\\s\\S]*?<\\/p>/gi,\n // Belt-and-suspenders: the branded badge anchor itself (anchored on the exact\n // \"( Made with Carrd )\" text so a genuine user link to carrd.co is never removed).\n /<a[^>]*href=\"https:\\/\\/carrd\\.co\"[^>]*>\\s*\\(\\s*Made with Carrd\\s*\\)\\s*<\\/a>/gi,\n ],\n\n // ssr-static: the raw SSR HTML is complete, so no hydration wait is required\n // (profile needsHydrationCheck=false, hydrationTimeoutMs=0). antiBot is Cloudflare\n // but the pages fetched cleanly in research; per the authoring guide we keep a\n // small capture buffer instead of the literal 0 ms.\n hydrationTimeout: 2000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Google Fonts stylesheet — the only cross-origin CDN Carrd references in the\n // raw HTML (a <link> to the @font-face CSS, present only on sites using\n // non-system fonts). The font files load at runtime from fonts.gstatic.com and\n // are not part of the static export.\n if (host.includes('fonts.googleapis.com')) {\n return 'styles';\n }\n\n // Carrd serves all of its own assets same-origin under /assets/{images,css,js}/\n // with ?v=<hash> cache-busting; the host is the page's *.carrd.co. Pro sites on\n // custom domains fall through to null and are handled by the generic fallback.\n if (host.includes('carrd.co')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/assets/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (pathname.includes('/assets/css/') || ext === '.css') return 'styles';\n if (pathname.includes('/assets/js/') || ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Duda — v5 production handler (category: builder).\n *\n * Detection (verified verbatim on two live Duda sites):\n * - Strongest, custom-domain-proof signal: the inline\n * `window.Parameters` config carrying `SiteType: atob('RFVEQU9ORQ==')`\n * (base64 → 'DUDAONE'), `productId: 'DM_DIRECT'`.\n * - DOM tell: `<body id=\"dmRoot\" ...>` wrapper.\n * - First-party tracking script `id=\"d_track_campaign\"`.\n * These do not collide with Framer / Webflow / Wix markup.\n *\n * Render: ssr-static — the full ~200KB page ships in the raw HTML, so no\n * hydration wait and no rendered-DOM capture is required.\n *\n * Badge: \"Made with Duda\" → https://www.duda.co/inspiration (free/reseller\n * tier only). Removed via a stripPatterns regex anchored on that href, since\n * the anchor carries no stable id/class (its font-size-* classes are per-site).\n *\n * Interface: mapAssetDir(host: string, pathname: string, ext: string) => string | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const duda: PlatformHandler = {\n name: 'duda',\n displayName: 'Duda',\n category: 'builder',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.(?:multiscreensite|dudaone)\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes(\"atob('RFVEQU9ORQ==')\") || // window.Parameters SiteType → 'DUDAONE'\n html.includes('id=\"dmRoot\"') ||\n html.includes('DM_DIRECT') || // window.Parameters productId\n html.includes('d_track_campaign') // first-party tracking script id\n );\n },\n\n // No external telemetry/analytics hosts on Duda (tracking is inline, first-party).\n stripDomains: [],\n\n // Inline first-party tracking <script id=\"...\"> elements (removed by id).\n stripSelectors: ['#d_track_campaign', '#d_track_personalization', '#d_track_sp'],\n\n stripPatterns: [\n // \"Made with Duda\" badge → https://www.duda.co/inspiration\n /<a[^>]*href=\"[^\"]*duda\\.co\\/inspiration[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Only Duda's own CDN hosts are owned here. This tightly covers all five\n // profile.cdnDomains and nothing else:\n // irp.cdn-website.com, lirp.cdn-website.com, static.cdn-website.com → *.cdn-website.com\n // ms-cdn.multiscreensite.com, irp-cdn.multiscreensite.com → explicit\n // The bare page host (<site>.multiscreensite.com) and any foreign host\n // (e.g. irp.foreign.com, mycdn-website.com) fall through to null so the\n // generic pipeline handles them.\n const isCdnWebsite = host.endsWith('.cdn-website.com');\n const isMsCdn =\n host === 'ms-cdn.multiscreensite.com' || host === 'irp-cdn.multiscreensite.com';\n if (!isCdnWebsite && !isMsCdn) return null;\n\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n\n // Image-resize proxies (irp.* / lirp.* / irp-cdn.*) serve images and are\n // frequently extensionless (resize params live in the path); the static\n // hosts default their unknown/extensionless assets to misc.\n const isResizeProxy = host.startsWith('irp') || host.startsWith('lirp');\n return isResizeProxy ? 'assets/images' : 'assets/misc';\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Squarespace — v5 handler (7.1, verified).\n *\n * PlatformHandler: name/displayName/category/priority + detectByUrl(url:string),\n * detectByHtml(html:string), mapAssetDir(host,pathname,ext) → folder|null.\n *\n * Verified against 3 live 7.1 sites (nerine-floral.squarespace.com plus two\n * CUSTOM domains: samfresquez.com, notcrispyenough.com) via raw curl. Content is\n * fully server-rendered (ssr-static), so we mirror the raw HTML — no rendered-DOM\n * capture needed. detectUrlRegex `\\.squarespace\\.com` only matches the default\n * subdomain, so detection leans primarily on the raw-HTML markers below, which\n * survive custom-domain hosting.\n *\n * No `detectGenerator`: 7.1 sites emit NO `<meta name=\"generator\">` (confirmed\n * absent on all three). No badge: paid/template sites carry no \"Made with\n * Squarespace\" badge in the DOM (badgePresent=false). Analytics are first-party\n * only (no default third-party telemetry host), so stripDomains stays empty.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\n/** Numbered static edges (static1..staticN.squarespace.com) are interchangeable. */\nconst STATIC_EDGE_RE = /^static\\d+\\.squarespace\\.com$/i;\n\nexport const squarespace: PlatformHandler = {\n name: 'squarespace',\n displayName: 'Squarespace',\n category: 'builder',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.squarespace\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('<!-- This is Squarespace. -->') ||\n html.includes('Static.SQUARESPACE_CONTEXT') ||\n html.includes('<!-- End of Squarespace Headers -->') ||\n html.includes('images.squarespace-cdn.com')\n );\n },\n\n // First-party analytics only; no default third-party telemetry host to block.\n stripDomains: [],\n\n // No editor chrome / badge in public SSR HTML on paid or template sites.\n stripSelectors: [],\n stripPatterns: [],\n\n hydrationTimeout: 3000,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Uploaded imagery. Image URLs are frequently extensionless (resized via\n // ?format=), so default this host to images.\n if (host.includes('images.squarespace-cdn.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/images';\n }\n\n // File downloads (PDFs, docs, zips, image originals). Classify by extension\n // and default UNKNOWN/extensionless downloads to misc — NOT images.\n if (host.includes('file.squarespace-cdn.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // Shared framework bundles (assets.squarespace.com/universal/...) and the\n // versioned per-site static edges (static1..N.squarespace.com): CSS/JS/fonts.\n if (host.includes('assets.squarespace.com') || STATIC_EDGE_RE.test(host)) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n return 'assets/misc';\n }\n\n // Config / definition payloads.\n if (host.includes('definitions.sqspcdn.com')) {\n if (ext === '.json') return 'data';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Strikingly — website builder (Airbnb Hypernova SSR + Emotion, React-hydrated).\n *\n * Verified against raw HTML of a real *.mystrikingly.com site:\n * - Detection: hosting subdomain `*.mystrikingly.com`; no <meta generator>;\n * `<meta name=\"strikingly-host-suffix\">`, `<meta name=\"asset-url\" content=\"…strikinglycdn.com\">`,\n * containers `#s-page-client-container` / `#s-content` / `#s-footer-section-container`,\n * Hypernova markers `data-hypernova-key=\"SiteBootstrapper\"`.\n * - Assets: five strikinglycdn.com subdomains (static-assets = JS/CSS,\n * static-fonts-css = fonts, user-images/custom-images/uploads = user media)\n * plus jQuery from cdnjs.cloudflare.com.\n * - Badge: \"Powered by Strikingly\" footer, container class `.show-strikingly-logo`\n * inside `#s-footer-section-container`; its visible anchor\n * (href https://www.strikingly.com/?ref=logo&…&utm_campaign=footer_pbs&…)\n * is hydration-rendered, so we also strip it from the captured rendered DOM.\n *\n * PlatformHandler signature: see ../types.ts.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const strikingly: PlatformHandler = {\n name: 'strikingly',\n displayName: 'Strikingly',\n category: 'builder',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.mystrikingly\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('strikingly-host-suffix') ||\n html.includes('data-hypernova-key=\"SiteBootstrapper\"') ||\n html.includes('id=\"s-page-client-container\"') ||\n html.includes('strikinglycdn.com')\n );\n },\n\n // Telemetry / error-monitoring only — NEVER the strikinglycdn asset CDN.\n stripDomains: [\n 'google-analytics.com',\n 'www.google-analytics.com',\n 'notify.bugsnag.com',\n 'sessions.bugsnag.com',\n ],\n\n // The \"Powered by Strikingly\" footer section carries the unique class\n // `.show-strikingly-logo` (inside #s-footer-section-container).\n stripSelectors: ['.show-strikingly-logo'],\n\n stripPatterns: [\n // Hydration-rendered badge anchor → https://www.strikingly.com/?ref=logo…&utm_campaign=footer_pbs\n /<a[^>]*href=\"[^\"]*strikingly\\.com\\/\\?ref=logo[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n // renderStrategy: react-hydration → use the rendered DOM as the HTML source.\n hydrationTimeout: 3000,\n needsHydrationCheck: false,\n hydrationSelector: '#s-page-client-container',\n captureRenderedDom: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Strikingly's own CDN — all *.strikinglycdn.com subdomains.\n if (host.includes('strikinglycdn.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n\n // static-fonts-css.strikinglycdn.com → font files + font CSS.\n if (host.includes('static-fonts-css')) {\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n }\n\n // static-assets.strikinglycdn.com → JS/CSS bundles (+ occasional assets).\n if (host.includes('static-assets')) {\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n return 'assets/misc';\n }\n\n // user-images / custom-images / uploads → user-uploaded media.\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n // Public CDN Strikingly loads jQuery (and a few libs) from.\n if (host.includes('cdnjs.cloudflare.com')) {\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Tilda — v5 handler (verified, high confidence).\n *\n * PlatformHandler: name/displayName/category/priority + detectByUrl(url:string),\n * detectByHtml(html:string), mapAssetDir(host,pathname,ext) → folder|null.\n *\n * Verified against two independent real Tilda HTML sources (bioinf.me project\n * 29135 and spbnodejs.org project 87822 GitHub backups) plus a live .pro-hosted\n * render. Pages are fully server-rendered (renderStrategy: ssr-static) — we mirror\n * the raw HTML, so NO rendered-DOM capture is needed. There is NO\n * `<meta name=\"generator\">` on Tilda output, so there is no `detectGenerator`.\n *\n * Detection: the `*.tilda.ws` free-hosting subdomain is unambiguous (URL match);\n * paid custom-domain sites are recognised only by the tildacdn asset hosts and the\n * `t-body` / `allrecords` / `data-tilda-*` markup, so detectByHtml leans on those.\n *\n * Badge: the \"Made on Tilda\" label is `<div id=\"tildacopy\" class=\"t-tildalabel\"\n * data-tilda-sign=\"PROJECTID#PAGEID\"><a href=\"https://tilda.cc/?upm=<projectId>\">…`\n * — present on free-plan sites, absent on white-label/paid plans. Removed via the\n * `#tildacopy` / `.t-tildalabel` selectors plus a tilda.cc anchor stripPattern.\n *\n * Telemetry: Google Analytics (www.google-analytics.com) is blocked at the domain\n * level; the Tilda stat script lives ON the asset CDN (static.tildacdn.com/js/\n * tilda-stat-*.js), so it is removed by a `script[src*=\"tilda-stat\"]` selector\n * rather than by blocking the CDN host (which would delete needed assets).\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const tilda: PlatformHandler = {\n name: 'tilda',\n displayName: 'Tilda',\n category: 'builder',\n priority: 80,\n\n detectByUrl(url: string): boolean {\n return /\\.tilda\\.ws/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('data-tilda-project-id') ||\n html.includes('data-tilda-page-id') ||\n html.includes('tildacdn') ||\n html.includes('id=\"allrecords\"')\n );\n },\n\n // Third-party telemetry only. NEVER the tildacdn asset hosts (they carry the\n // page's real images/CSS/JS); the Tilda stat script is stripped by selector.\n stripDomains: ['www.google-analytics.com', 'google-analytics.com'],\n\n stripSelectors: ['#tildacopy', '.t-tildalabel', 'script[src*=\"tilda-stat\"]'],\n\n stripPatterns: [\n // \"Made on Tilda\" badge link (free-plan only). No nested <a>, so the\n // non-greedy </a> match is safe even though the anchor wraps inner <div>s.\n /<a[^>]*href=\"[^\"]*tilda\\.cc[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Covers static/ws/neo/thb .tildacdn.com and .tildacdn.pro edges.\n if (host.includes('tildacdn')) {\n // Thumbnail edges (thb.tildacdn.*) only serve resized imagery, frequently\n // with a /-/resize/ suffix and no real file extension.\n if (host.startsWith('thb.')) return 'assets/images';\n\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (ext === '.css' || pathname.includes('/css/')) return 'styles';\n if (ext === '.js' || ext === '.mjs' || pathname.includes('/js/')) return 'scripts/vendor';\n if (FONT_EXTS.includes(ext) || pathname.includes('/fonts/')) return 'assets/fonts';\n if (ext === '.json') return 'data';\n if (\n IMG_EXTS.includes(ext) ||\n pathname.includes('/img/') ||\n pathname.includes('/images/') ||\n pathname.includes('/tild')\n ) {\n return 'assets/images';\n }\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Weebly — v5 handler.\n *\n * Interface: PlatformHandler (src/platforms/types.ts):\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n *\n * Render model: ssr-static — full nav/content/meta is present in the raw HTML;\n * JS only enhances (badge injection, analytics, forms). So we do NOT capture the\n * rendered DOM and do NOT wait for hydration.\n *\n * Detection: default hosting subdomain <name>.weebly.com (URL) plus content\n * signals that persist on custom domains — the ubiquitous `wsite-` class/id\n * prefix, the `window._W` config object, and `Weebly.footer.setupContainer`.\n * The editmysite.com CDN is deliberately NOT used as a detectByHtml marker: it is\n * shared with Square Online, so matching the host would misclassify Square sites\n * as Weebly. We rely only on Weebly-specific `wsite-`/`_W`/`Weebly.footer` markers.\n * No `<meta name=\"generator\">` is emitted (confirmed on both new- and old-template\n * sites), so there is no detectGenerator.\n *\n * Assets: platform CSS/JS/images live on cdn1/cdn2/cdn11.editmysite.com; per-site\n * theme + uploads are served path-relative under /files/ and /uploads/ on the\n * site's own domain (foreign host → null → generic fallback handles them).\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const weebly: PlatformHandler = {\n name: 'weebly',\n displayName: 'Weebly',\n category: 'builder',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.weebly\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // Weebly-specific markers only. `editmysite.com` is intentionally NOT used\n // here — it is the shared Square Online / Weebly asset CDN and would produce\n // false positives on Square sites.\n return (\n html.includes('Weebly.footer.setupContainer') ||\n html.includes('weebly-footer-signup-container-v3') ||\n html.includes('wsite-content') ||\n html.includes('window._W')\n );\n },\n\n // Third-party telemetry only. NEVER list editmysite.com here — that host serves\n // the platform CSS/JS/images (cdn1/cdn2/cdn11) and blocking it deletes assets.\n // The Weebly _W.Analytics trackers (main.js, stl.js) also live on that CDN, so\n // they are intentionally not blocked (blocking the host would kill assets too).\n stripDomains: ['google-analytics.com'],\n\n // Footer \"Made with Weebly\" signup badge: unique container id (empty in SSR\n // HTML, populated client-side) plus the script that injects it.\n stripSelectors: ['#weebly-footer-signup-container-v3', 'script[src*=\"footerSignup.js\"]'],\n\n // Best-effort removal of the rendered badge anchor should it appear inline.\n stripPatterns: [/<a[^>]*href=\"[^\"]*weebly\\.com\\/signup[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Covers cdn1/cdn2/cdn11.editmysite.com and the bare editmysite.com origin.\n if (host.includes('editmysite.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (pathname.includes('/css/') || ext === '.css') return 'styles';\n if (pathname.includes('/js/') || ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * ClickFunnels 2.0 (\"CF2\") — v5 production handler.\n *\n * Server-rendered Rails/Shakapacker landing pages. Detection, stripping and\n * asset mapping were verified against raw HTML of academy.myclickfunnels.com\n * and www.clickfunnels.com (both 200 OK, no anti-bot interstitial, ssr-static).\n *\n * PlatformHandler signatures (see src/platforms/types.ts):\n * detectByUrl(url): boolean\n * detectByHtml(html): boolean\n * mapAssetDir(host, pathname, ext): string | null\n *\n * Strongest tells (all confirmed verbatim on both samples):\n * - inline <script id=\"cf-head-scripts\"> defining window.cfRootDomain\n * - the cf-lander-* serialized script ids\n * - the pervasive data-page-element attribute (655/1772 occurrences)\n * - root div class=\"pageRoot id-<token>\" inside elPageContentWrapper.\n *\n * Assets live on statics.myclickfunnels.com + images.clickfunnels.com (localize).\n * events.myclickfunnels.com is a telemetry beacon (NOT a CDN) — blocked, not mapped.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const clickfunnels: PlatformHandler = {\n name: 'clickfunnels',\n displayName: 'ClickFunnels (2.0 / \"CF2\")',\n category: 'landing',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n // Default workspace subdomains (e.g. academy.myclickfunnels.com). Custom-domain\n // funnels are not caught here and must rely on the HTML signatures below.\n return /\\.myclickfunnels\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // OR the four most distinctive, stable CF2 markers. Each is unique to the\n // ClickFunnels renderer and does not appear on Framer/Webflow/Wix pages.\n return (\n html.includes('cf-head-scripts') ||\n html.includes('window.cfRootDomain') ||\n html.includes('cf-lander-serialized-custom-fonts') ||\n html.includes('data-page-element')\n );\n },\n\n // Telemetry / analytics hosts blocked during capture. NOT the asset CDNs\n // (statics.myclickfunnels.com / images.clickfunnels.com) and NOT the functional\n // third-party libs (cdnjs / code.jquery.com / fontawesome) or Turnstile.\n stripDomains: ['bam.nr-data.net', 'js-agent.newrelic.com', 'events.myclickfunnels.com'],\n\n // No CF-specific badge/editor container has a static id/class in the delivered\n // HTML, so there is nothing selector-strippable here.\n stripSelectors: [],\n\n // BADGE: The \"Powered by ClickFunnels\" badge is default-on per docs but was\n // toggled OFF/HIDDEN on both verified samples (0 occurrences in the SSR HTML),\n // and this handler does not capture the rendered DOM. No reliable static markup\n // exists to anchor a regex on, so no badge stripPattern is emitted (a loose match\n // on clickfunnels.com would risk removing legitimate links). If a future sample\n // exposes the badge anchor, add a tight /<a[^>]*href=\"[^\"]*clickfunnels\\.com[^\"]*\"...>/ here.\n stripPatterns: [],\n\n // ssr-static: SSR body is complete, no hydration wait needed.\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Primary asset CDN: statics.myclickfunnels.com serves images\n // (/image/<id>/file/<md5>.<ext>), css, js and fonts.\n if (host.includes('statics.myclickfunnels.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/image/') || pathname.includes('/images/') || IMG_EXTS.includes(ext))\n return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n // Image-only CDN.\n if (host.includes('images.clickfunnels.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n // Everything else on this host is imagery (bare-path transforms included).\n return 'assets/images';\n }\n\n // Foreign host — let the generic fallback handle it.\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Elementor — v5 production handler.\n *\n * Elementor is a WordPress page-builder PLUGIN, not a hosting platform. Sites run\n * on the owner's own domain and serve EVERY Elementor asset same-origin under\n * /wp-content/plugins/elementor(-pro)/ and per-page compiled CSS under\n * /wp-content/uploads/elementor/. There is no front-end asset CDN (cdnDomains: []),\n * so mapAssetDir keys off the canonical WordPress path tree rather than a host.\n * Only Elementor Cloud/Hosting sites sit on a *.elementor.cloud subdomain (which\n * still serves WordPress assets same-origin).\n *\n * Verified live (headless Chrome, raw DOM + asset hosts) against brandonli.com\n * (legacy section/column layout, Elementor 3.31.3) and notarity.com (Flexbox\n * containers, Elementor 3.21.6). Fully server-rendered PHP → renderStrategy\n * \"ssr-static\": the complete DOM is in the raw HTML, so no hydration wait and no\n * rendered-DOM capture.\n *\n * Detection priority (verified):\n * 1. <meta name=\"generator\" content=\"Elementor <version>; ...\"> — strongest signal,\n * but NOT reliably the FIRST generator tag (WordPress / Site Kit emit their own,\n * and the pipeline's readGenerator only reads the first). detectGenerator covers\n * the case where Elementor's is the first/only generator meta; detectByHtml scans\n * the whole document for the resilient markers below so optimization-plugin\n * generator stripping cannot hide the platform.\n * 2. body class elementor-kit-{id} + root div data-elementor-type=... (both survive a\n * stripped generator).\n * 3. /wp-content/plugins/elementor/ asset path.\n * 4. window.elementorFrontendConfig bootstrap global.\n *\n * Badge/analytics: verified NO \"Made with Elementor\" badge and NO default analytics\n * on the front end (badgePresent:false, analyticsScripts:[]); googletagmanager /\n * cdn.usefathom.com seen on samples are site-owner additions → all strip lists empty.\n *\n * PlatformHandler signatures (see src/platforms/types.ts):\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const elementor: PlatformHandler = {\n name: 'elementor',\n displayName: 'Elementor',\n category: 'landing',\n priority: 42,\n\n // Only Elementor Cloud/Hosting uses a platform subdomain; self-hosted sites live\n // on the owner's own domain and are caught by detectByHtml / detectGenerator.\n detectByUrl(url: string): boolean {\n return /\\.elementor\\.cloud/i.test(url);\n },\n\n // OR of four independent, Elementor-specific markers (none match Framer/Webflow/Wix,\n // and #2/#3 survive optimization plugins that strip the generator meta):\n // - Elementor plugin asset directory\n // - Elementor \"kit\" body class\n // - root wrapper data-attribute\n // - frontend bootstrap JS global\n detectByHtml(html: string): boolean {\n return (\n html.includes('/wp-content/plugins/elementor/') ||\n html.includes('elementor-kit-') ||\n html.includes('data-elementor-type=') ||\n html.includes('elementorFrontendConfig')\n );\n },\n\n // Matched against the <meta name=\"generator\"> content only, e.g.\n // \"Elementor 3.31.3; features: ...\". Anchored so it fires solely on Elementor's own\n // generator string, never on the \"WordPress 6.7.5\" / \"Site Kit by Google\" siblings.\n detectGenerator: /^Elementor\\s+\\d+\\.\\d+/i,\n\n // No default third-party telemetry: googletagmanager / cdn.usefathom.com hosts seen\n // on sample sites are site-owner additions, not an Elementor platform default.\n stripDomains: [],\n\n // No front-end editor chrome or badge element to remove.\n stripSelectors: [],\n\n // Verified: no \"Made with Elementor\" badge in the front-end DOM → nothing to strip.\n stripPatterns: [],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Elementor ships no asset CDN — everything is same-origin on the owner's own\n // (variable) domain, so classify by the canonical WordPress path tree instead of\n // by host. Anything outside /wp-content|/wp-includes is left to the generic fallback.\n if (!pathname.includes('/wp-content/') && !pathname.includes('/wp-includes/')) {\n return null;\n }\n\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n // Per-page compiled CSS lives at /wp-content/uploads/elementor/css/post-{id}.css and\n // plugin/theme CSS under /wp-content/plugins|themes — test ext before images so the\n // .css files under /uploads/ are not swept into assets/images.\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Instapage — landing-page / funnel builder.\n *\n * Interface: PlatformHandler (see ../types.ts).\n * detectByUrl(url): boolean\n * detectByHtml(html): boolean\n * mapAssetDir(host, pathname, ext): string | null\n *\n * Detection notes (verified across injurylaw.pagedemo.co, solutions.docbyte.com,\n * www.linktek.com):\n * - Emits NO <meta name=\"generator\"> and NO \"Made with Instapage\" badge, so\n * detection relies on URL (default *.pagedemo.co host) plus asset-domain and\n * inline JS-global fingerprints. Custom-domain sites (CNAME to\n * secure.pageserve.co) reveal nothing in the URL and are caught by detectByHtml.\n * - Page runtime bundle is served from c.fastcdn.co as\n * pageserver.page2.es5.<hash>.bundle.js (verbatim on linktek). Images come from\n * v.fastcdn.co/u/<accountHash>/..., and beacons hit anthill.instapage.com.\n * - Inline globals instapageSp / _instapageSnowplow are present in the raw HTML.\n *\n * Render strategy: ssr-static — full content is present in the raw server HTML, so\n * no headless hydration is required (captureRenderedDom intentionally unset).\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const instapage: PlatformHandler = {\n name: 'instapage',\n displayName: 'Instapage',\n category: 'landing',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.(?:pagedemo|pageserve)\\.co/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('instapageSp') ||\n html.includes('_instapageSnowplow') ||\n html.includes('anthill.instapage.com') ||\n html.includes('pageserver.page2')\n );\n },\n\n // Telemetry / analytics hosts only — blocked during capture. The fastcdn.co\n // asset CDN is deliberately NOT listed here (those assets are mirrored).\n stripDomains: [\n 'anthill.instapage.com',\n 'cdn.instapagemetrics.com',\n 'heatmap-events-collector.instapage.com',\n 'heatmap.services',\n ],\n\n stripSelectors: [\n 'script[src*=\"instapagemetrics.com\"]',\n 'script[src*=\"anthill.instapage.com\"]',\n 'script[src*=\"heatmap.services\"]',\n ],\n\n stripPatterns: [\n // Hidden local-storage helper iframe (runtime-injected on live pages; stripped\n // here best-effort in case it appears in the captured markup).\n /<iframe[^>]*d3mwhxgzltpnyp\\.cloudfront\\.net[^>]*>[\\s\\S]*?<\\/iframe>/g,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Covers the fastcdn.co apex plus the v. (images), c. (CSS/JS bundles) and\n // d. (form endpoint) subdomains.\n if (host.includes('fastcdn.co')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/u/')) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // CloudFront distribution serving the local-storage helper.\n if (host.includes('d3mwhxgzltpnyp.cloudfront.net')) {\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Systeme.io — v5 production handler.\n *\n * Verified against RAW HTML of two live pages (risefunnels.systeme.io/izzy/free,\n * freetemplates.systeme.io/landing-page). Both HTTP 200, no anti-bot.\n *\n * Stack: React SSR + react-helmet (`data-react-helmet=\"true\"`) + server-rendered\n * styled-components (`<style data-styled data-styled-version=\"6.x\">`). Content is\n * present in the SSR body (not client-only) → renderStrategy \"hybrid\" but we do\n * NOT capture the rendered DOM. Hydrates via `window.__PRELOADED_STATE__`.\n *\n * Strongest, byte-for-byte confirmed marker: `<!-- Created with https://systeme.io -->`\n * sits immediately after `<!DOCTYPE html>` on every page (custom CNAME domains too).\n *\n * CDN roles (all cloudfront.net, confirmed):\n * d3fit27i5nzkqh — JS/CSS webpack bundles (/default/runtime|page|vendors.*.js)\n * d1yei2z3i6k35z — user-uploaded images / favicons\n * d2543nuuc0wvdg — system assets (serves /favicon.ico)\n * d3syewzhvzylbl — self-hosted Google Fonts (/fonts/google-fonts/*.woff2)\n *\n * PlatformHandler signatures (see src/platforms/types.ts):\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const systemeio: PlatformHandler = {\n name: 'systemeio',\n displayName: 'Systeme.io',\n category: 'landing',\n priority: 80,\n\n detectByUrl(url: string): boolean {\n return /\\.systeme\\.io/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // All four markers are systeme.io-account-specific: the byte-for-byte branding\n // comment, the two account-specific CloudFront distribution hosts, and the\n // affiliate badge href. (Deliberately NOT `window.initialI18nStore` /\n // `window.__PRELOADED_STATE__` — those are generic i18next/React-SSR globals\n // emitted by unrelated sites and would produce false positives.)\n return (\n html.includes('<!-- Created with https://systeme.io -->') ||\n html.includes('d3fit27i5nzkqh.cloudfront.net') ||\n html.includes('systeme.io/?sa=') ||\n html.includes('d3syewzhvzylbl.cloudfront.net')\n );\n },\n\n // First-party click/funnel telemetry — blocked during capture, never downloaded.\n stripDomains: ['log.systeme.io'],\n\n stripSelectors: ['script[src*=\"log.systeme.io\"]'],\n\n stripPatterns: [\n // Footer credit/affiliate badge: <a href=\"https://systeme.io/?sa=<code>\" ...>SITE CREDIT</a>.\n // Match on the `systeme.io/?sa=` href affiliate param (visible label is owner-editable).\n /<a[^>]*href=\"[^\"]*systeme\\.io\\/\\?sa=[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n // Branding comment injected right after <!DOCTYPE html>.\n /<!--\\s*Created with https:\\/\\/systeme\\.io\\s*-->/g,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // JS/CSS webpack bundles (runtime/page/vendors.*.js under /default/).\n if (host.includes('d3fit27i5nzkqh.cloudfront.net')) {\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // Self-hosted Google Fonts (/fonts/google-fonts/*.woff2).\n if (host.includes('d3syewzhvzylbl.cloudfront.net')) {\n if (FONT_EXTS.includes(ext) || pathname.includes('/fonts/')) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n // User-uploaded images / favicons.\n if (host.includes('d1yei2z3i6k35z.cloudfront.net')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n // System assets (serves /favicon.ico and other platform static files).\n if (host.includes('d2543nuuc0wvdg.cloudfront.net')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Unbounce — v5 production handler (category: landing, id: \"unbounce\").\n *\n * Detection (verified across 3 real Classic-Builder pages, a urlscan.io capture\n * and Unbounce's own community docs):\n * • URL → default-hosted pages live at *.unbouncepages.com / *.ubpages.com\n * (custom CNAME'd domains are caught by the HTML signals below).\n * • HTML → root container id=\"lp-pom-root\", inline `window.ub.page` global,\n * and assets served from builder-assets.unbounce.com / *.ubembed.com.\n * • Generator→ none (the <meta name=\"generator\" content=\"Unbounce\"> tag is NOT\n * emitted on real pages — do not rely on it).\n *\n * Render: ssr-static — the fully positioned lp-pom-* markup is present in the raw\n * server HTML, so no hydration wait and no rendered-DOM capture are required.\n *\n * Badge: free/trial pages carry an Unbounce-branded footer that links to\n * unbounce.com. The exact markup is UNVERIFIED, and its selector\n * (`#lp-pom-root a[href*=\"unbounce.com\"]`) uses a descendant combinator that the\n * post-processor does not support, so it is removed via a best-effort\n * `stripPatterns` regex anchored on the brand href instead.\n *\n * Assets: images/CSS/JS come from builder-assets.unbounce.com, assets.unbounce.com\n * and Amazon CloudFront (the cloudfront subdomain ROTATES per account/deploy, so\n * we match the shared cloudfront.net host). Popups/sticky-bars/convertables load\n * from *.ubembed.com.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const unbounce: PlatformHandler = {\n name: 'unbounce',\n displayName: 'Unbounce',\n category: 'landing',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.(?:unbouncepages|ubpages)\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('lp-pom-root') ||\n html.includes('window.ub.page') ||\n html.includes('builder-assets.unbounce.com') ||\n html.includes('ubembed.com')\n );\n },\n\n // No first-party telemetry/analytics hosts to block (profile analyticsScripts: []).\n // The asset CDNs (builder-assets / cloudfront / ubembed) must NOT be listed here.\n stripDomains: [],\n\n // The badge selector (#lp-pom-root a[href*=\"unbounce.com\"]) is a descendant\n // combinator, unsupported by stripSelectors — handled via stripPatterns below.\n stripSelectors: [],\n\n stripPatterns: [\n // Best-effort removal of the \"Made with Unbounce\" branded footer link.\n // Anchored on the exact brand host so it never matches *.unbouncepages.com /\n // *.ubpages.com hosting links. Markup is approximate (badge markup UNVERIFIED).\n /<a[^>]*href=\"https?:\\/\\/(?:www\\.)?unbounce\\.com[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // First-party Unbounce asset hosts (Classic-Builder blocks, images, CSS, JS).\n if (host.includes('builder-assets.unbounce.com') || host.includes('assets.unbounce.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/lp-image')) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // Popups / sticky-bars / convertables embed CDN (assets.ubembed.com,\n // <hash>.js.ubembed.com, ubembed.com).\n if (host.includes('ubembed.com')) {\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n // Amazon CloudFront — Unbounce image/asset delivery. The subdomain rotates\n // per account/deploy (d9hhrg4mnvzow, d2xxq4ijfwetlm, doug1izaerwt3, ...), so\n // match the shared cloudfront.net host rather than a fixed subdomain.\n if (host.includes('cloudfront.net')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Ghost (open-source publishing / CMS) handler.\n *\n * PlatformHandler shape (see ../types.ts):\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * detectGenerator?: RegExp // tested against <meta name=\"generator\"> content\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n *\n * Verified against live raw HTML from demo.ghost.io (Ghost Pro, generator\n * \"Ghost 6.51\") and self-hosted spreadprivacy.com (generator \"Ghost 6.39\"):\n * - Render is ssr-static: the full post-card feed and article bodies ship in the\n * server HTML. Portal / sodo-search / comments / stats are deferred iframe\n * add-ons that do not gate content — so no rendered-DOM capture is needed.\n * - Generator string \"Ghost X.Y\" + the cdn.jsdelivr.net/ghost/ script path is the\n * definitive combined fingerprint; the literal version drifts between sites, so\n * detectGenerator matches /Ghost [0-9.]+/, not a fixed version.\n * - Analytics (/public/ghost-stats.min.js) is first-party (POSTs to the site's own\n * /.ghost/analytics/), so there is no third-party telemetry host to block.\n * - The gh-powered-by badge and Portal script are optional (absent when membership\n * is off), so they are used only as extra OR'd detection signals, never alone.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const ghost: PlatformHandler = {\n name: 'ghost',\n displayName: 'Ghost',\n category: 'cms',\n priority: 78,\n\n detectByUrl(url: string): boolean {\n return /\\.ghost\\.io/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('/assets/built/screen.css') ||\n html.includes('/public/cards.min.css') ||\n html.includes('cdn.jsdelivr.net/ghost/') ||\n html.includes('gh-powered-by')\n );\n },\n\n // Matched against <meta name=\"generator\"> content only. Version drifts per site\n // (observed 6.51 and 6.39), so match the pattern rather than a literal version.\n detectGenerator: /Ghost [0-9.]+/i,\n\n // First-party ghost-stats is the only analytics; it POSTs to the site's own\n // origin, so there is no third-party telemetry host to block during capture.\n stripDomains: [],\n\n // The \"Powered by Ghost\" badge's unique class sits on the WRAPPER <div>, whose\n // only child is the <a>. The post-processor's naive `.class` stripper is\n // non-greedy to the first close tag, so `.gh-powered-by` would delete only up to\n // the inner </a> and orphan a dangling </div>. Since selectors run before\n // patterns, that orphan cannot be cleaned up afterwards. The badge is therefore\n // removed cleanly (both tags) by the wrapper-div stripPattern below instead.\n stripSelectors: [],\n\n stripPatterns: [\n // <div class=\"gh-powered-by\"><a href=\"https://ghost.org/\" ...>Powered by Ghost</a></div>\n /<div[^>]*class=\"[^\"]*gh-powered-by[^\"]*\"[^>]*>[\\s\\S]*?<\\/div>/g,\n // Bare <a href=\"…ghost.org…\">Powered by Ghost</a> fallback if the wrapper drops.\n /<a[^>]*href=\"[^\"]*ghost\\.org[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n // Identifying <meta name=\"generator\" content=\"Ghost X.Y\">.\n /<meta[^>]*name=\"generator\"[^>]*content=\"Ghost[^\"]*\"[^>]*>/gi,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n scrollStrategy: 'paginated',\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Ghost Pro asset/image storage (images, and occasionally other media).\n if (host.includes('storage.ghost.io')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n // Ghost front-end packages (Portal, Sodo search, comments) served from jsDelivr\n // under /ghost/. Classify by extension.\n if (host.includes('cdn.jsdelivr.net')) {\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.css') return 'styles';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Notion — Notion Sites (published <workspace>.notion.site pages).\n *\n * Pure client-side SPA: the raw response is a generic ~17.5KB shell\n * (`<html class=\"notion-html\" data-notion-html=\"web\" data-notion-version=\"…\">`,\n * an empty `<div id=\"notion-app\"></div>`, `window.__notion_boot_data=null`, and\n * repeated `__notion_html_async.push(...)` hydration calls). All real content is\n * rendered into `#notion-app` after hydration, so we MUST capture the rendered\n * DOM. Assets come from AWS-signed S3 URLs that expire ~1h, hence the mandatory\n * download-at-export-time behaviour the pipeline already provides.\n *\n * Interface: see src/platforms/types.ts\n * detectByUrl(url) / detectByHtml(html) → boolean\n * mapAssetDir(host, pathname, ext) → folder | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const notion: PlatformHandler = {\n name: 'notion',\n displayName: 'Notion (Notion Sites)',\n category: 'cms',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.notion\\.site/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // All four are Notion-only, verified verbatim in the raw shell, and do not\n // collide with Framer / Webflow / Wix markers.\n return (\n html.includes('data-notion-html=\"web\"') ||\n html.includes('id=\"notion-app\"') ||\n html.includes('__notion_html_async') ||\n html.includes('window.__notion_boot_data')\n );\n },\n\n // Notion's own Splunk telemetry collector — blocked during capture. NEVER add\n // the asset hosts (www.notion.so / *.amazonaws.com) here; they serve real files.\n stripDomains: ['http-inputs-notion.splunkcloud.com'],\n\n // Pre-hydration loading chrome. captureRenderedDom normally replaces these once\n // #notion-app hydrates; stripping them is a defensive no-content cleanup in case\n // hydration is partial.\n stripSelectors: ['#initial-loading-spinner', '#skeleton', '#skeleton-sidebar'],\n\n stripPatterns: [\n // \"Built with Notion\" watermark is React-injected post-hydration (ABSENT from\n // raw HTML — selector/href unverified). Best-effort removal from the captured\n // rendered DOM: an <a> pointing at notion.so/notion.com that also carries the\n // badge's signature text. Both conditions keep this from matching real content.\n /<a[^>]*href=\"[^\"]*notion\\.(so|com)[^\"]*\"[^>]*>[\\s\\S]*?Built with Notion[\\s\\S]*?<\\/a>/gi,\n ],\n\n hydrationTimeout: 8000,\n needsHydrationCheck: true,\n hydrationSelector: '#notion-app',\n captureRenderedDom: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Notion image proxy / app image host — serves optimized/resized images\n // (often extension-less proxy URLs), so default to images.\n if (host.includes('img.notionusercontent.com') || host.includes('app.notion.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext) || pathname.includes('/image')) return 'assets/images';\n return 'assets/images';\n }\n\n // Signed S3 upload stores (user files: images, video, fonts, docs). URLs are\n // AWS-signed and expire ~1h — the pipeline downloads them at export time.\n if (\n host.includes('prod-files-secure.s3.us-west-2.amazonaws.com') ||\n host === 's3.us-west-2.amazonaws.com'\n ) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n // Notion app origin — hashed /_assets/*.js bundles, /print.*.css, JSON data\n // (loadPageChunk / recordMap) and fonts served same-origin from www.notion.so.\n if (host.includes('www.notion.so') || host.includes('notion.so')) {\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * WordPress — v5 production handler.\n *\n * Server-rendered PHP: the full page (nav, articles, footer) is present in the\n * first-byte HTML, so no JS hydration is required (renderStrategy: ssr-static →\n * captureRenderedDom is intentionally NOT set).\n *\n * Detection is generator/path based rather than a single hosting domain, hence\n * the mid-range priority (40). Two deployment shapes are covered:\n * 1. Self-hosted (custom domain, WordPress VIP): generator \"WordPress <version>\",\n * same-origin assets under /wp-content/ + /wp-includes/, REST link rel=api.w.org.\n * 2. WordPress.com hosted: generator exactly \"WordPress.com\", static assets on\n * s0/s1/s2.wp.com + c0.wp.com, fonts on fonts.wp.com, images via Jetpack Photon\n * (i0/i1/i2.wp.com), core shared assets on s.w.org, avatars on gravatar.com.\n *\n * Key interface signatures (src/platforms/types.ts):\n * detectByUrl(url): boolean · detectByHtml(html): boolean · detectGenerator: RegExp\n * mapAssetDir(host, pathname, ext): string | null\n *\n * No \"Made with WordPress\" core badge exists (badgePresent=false); only some free\n * WordPress.com themes append a footer credit, which is theme content and left intact.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const wordpress: PlatformHandler = {\n name: 'wordpress',\n displayName: 'WordPress',\n category: 'cms',\n priority: 40,\n\n detectByUrl(url: string): boolean {\n return /\\.wordpress\\.com|\\/wp-(content|includes|json)\\//i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('/wp-includes/') ||\n html.includes('/wp-content/') ||\n html.includes('api.w.org') ||\n html.includes('_wpemojiSettings')\n );\n },\n\n // Matched against the <meta name=\"generator\"> content only. Covers both\n // \"WordPress <version>\" (self-hosted) and exact \"WordPress.com\" (hosted).\n detectGenerator: /WordPress/i,\n\n // Jetpack / WP.com Stats trackers only — never the asset CDN.\n stripDomains: ['stats.wp.com', 'pixel.wp.com'],\n\n // Remove the leftover tracker <script> tags after their requests are blocked.\n stripSelectors: ['script[src*=\"stats.wp.com\"]', 'script[src*=\"pixel.wp.com\"]'],\n\n // No badge to strip; drop the generator meta as an attribution cleanup\n // (shape mirrors webflow.ts). Matches \"WordPress 6.9.4\" and \"WordPress.com\".\n stripPatterns: [\n /<meta[^>]*name=[\"']generator[\"'][^>]*content=[\"'][^\"']*WordPress[^\"']*[\"'][^>]*>/gi,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Jetpack Photon image proxy — always images (rewrites <origin>/<path>?fit=..&ssl=1).\n if (host.includes('i0.wp.com') || host.includes('i1.wp.com') || host.includes('i2.wp.com')) {\n return 'assets/images';\n }\n\n // Gravatar avatars.\n if (host.includes('gravatar.com')) {\n return 'assets/images';\n }\n\n // Dedicated WP.com font host.\n if (host.includes('fonts.wp.com')) {\n if (ext === '.css') return 'styles';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/fonts';\n }\n\n // WP.com concatenated/static CDNs (s0/s1/s2/c0.wp.com) and WordPress.org\n // core shared assets (s.w.org: emoji sprites, images, scripts).\n if (\n host.includes('s0.wp.com') ||\n host.includes('s1.wp.com') ||\n host.includes('s2.wp.com') ||\n host.includes('c0.wp.com') ||\n host.includes('s.w.org')\n ) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Kajabi — v5 production handler (course category).\n *\n * Kajabi is a Ruby-on-Rails, fully server-rendered course / membership platform\n * (renderStrategy: ssr-static), so the raw SSR HTML is the source of truth — no\n * rendered-DOM capture is required. Signatures re-verified live (2026-07-06)\n * against glendz.mykajabi.com and idolcourses.mykajabi.com.\n *\n * Interface: PlatformHandler (src/platforms/types.ts)\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * stripDomains / stripSelectors / stripPatterns\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const kajabi: PlatformHandler = {\n name: 'kajabi',\n displayName: 'Kajabi',\n category: 'course',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.mykajabi\\.com/i.test(url);\n },\n\n // Four Kajabi-only, tier-independent tells. Badge markers are deliberately NOT\n // used here (the \"Powered by Kajabi\" badge is absent on paid plans). None of\n // these strings appear on Framer / Webflow / Wix output.\n detectByHtml(html: string): boolean {\n return (\n html.includes('var Kajabi = Kajabi') || // inline bootstrap: `var Kajabi = Kajabi || {};`\n html.includes('Kajabi.currentSiteUser') || // inline theme bootstrap global\n html.includes('kjb-settings-id=') || // Kajabi theme-editor data attribute\n html.includes('kajabi-cdn.com') // storefront/app asset CDN host\n );\n },\n\n // Telemetry / analytics hosts only — NEVER the kajabi-cdn.com asset hosts.\n stripDomains: ['rs-dp.kajabi.com', 'cdn.rudderlabs.com'],\n\n // The \"Powered by Kajabi\" badge wrapper carries a unique class — remove it via\n // selector (first-match). stripPatterns below covers repeats / rendered markup.\n stripSelectors: ['.footer__powered-by'],\n\n stripPatterns: [\n // Whole badge wrapper: <div class=\"footer__powered-by\"> … </div>\n // (real markup has indentation/newlines between the div and the anchor).\n /<div[^>]*class=\"[^\"]*footer__powered-by[^\"]*\"[^>]*>[\\s\\S]*?<\\/div>/g,\n // Belt-and-suspenders: the branded referral anchor itself.\n /<a[^>]*href=\"[^\"]*app\\.kajabi\\.com\\/r\\/[^\"]*powered_by=true[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n ],\n\n // ssr-static: the raw SSR HTML is complete, so no hydration wait is needed\n // (profile needsHydrationCheck=false, hydrationTimeoutMs=0). antiBot is\n // Cloudflare but the pages fetched cleanly in research; per the authoring\n // guide we keep a small capture buffer instead of the literal 0 ms.\n hydrationTimeout: 2000,\n needsHydrationCheck: false,\n\n // Both cdnDomains live under *.kajabi-cdn.com\n // - kajabi-storefronts-production.kajabi-cdn.com\n // - kajabi-app-assets.kajabi-cdn.com\n // so a single host match covers every declared CDN host; classify by ext/path.\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host.includes('kajabi-cdn.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Podia — Ruby-on-Rails + Hotwire (Turbo/Stimulus) storefront whose page\n * sections render as React islands. The raw SSR body contains only empty\n * `<div class=\"react-page-section\" data-react-component=\"creator_ui/section_adapters/…\"\n * data-props=\"{escaped JSON}\">` shells; all copy/colours/links/media hydrate\n * client-side. Therefore we capture the RENDERED DOM.\n *\n * PlatformHandler signature (see ../types.ts):\n * detectByUrl(url), detectByHtml(html), detectGenerator?, stripDomains,\n * stripSelectors, stripPatterns, hydrationTimeout, needsHydrationCheck,\n * hydrationSelector?, scrollStrategy?, captureRenderedDom?,\n * mapAssetDir(host, pathname, ext) → folder | null.\n *\n * Framework CSS/JS live on cdn.podia.com; user media lives on the SITE'S OWN\n * domain under /content-assets/public/<JWT>. Verified across demo.podia.com,\n * examples.podia.com and the custom domain thecreativebodega.com.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const podia: PlatformHandler = {\n name: 'podia',\n displayName: 'Podia',\n category: 'course',\n priority: 80,\n\n detectByUrl(url: string): boolean {\n // Coarse hint: also matches app/cdn/www.podia.com, so detectByHtml must corroborate.\n return /\\.podia\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n // Constant Turnstile site-key present on every Podia storefront (incl. custom domains).\n html.includes('0x4AAAAAAAJ5kwYW6AH1ybLx') ||\n // Shared framework asset host (storefront-<hash>.css/.js, user-site-<hash>.js).\n html.includes('cdn.podia.com') ||\n // React section-adapter islands unique to Podia's creator UI.\n html.includes('data-react-component=\"creator_ui/section_adapters/') ||\n // Stimulus controller wiring the editable page sections.\n html.includes('data-controller=\"editor--page-section\"')\n );\n },\n\n // Telemetry only — NEVER the asset CDN. Podia's default analytics is Google Tag Manager.\n stripDomains: ['www.googletagmanager.com'],\n\n stripSelectors: ['script[src*=\"googletagmanager.com\"]'],\n\n stripPatterns: [\n // \"Powered by Podia\" footer badge — React-rendered anchor in the captured DOM.\n // Its href is https://www.podia.com?utm_medium=poweredby&utm_source=footer\n // (the \"&\" may serialize as \"&\"). Anchor on the stable brand host + the\n // badge-unique utm_medium=poweredby token; tolerate single/double quotes and any\n // chars between host and token (e.g. a \"/\" before the query string).\n /<a[^>]*href=['\"][^'\"]*podia\\.com[^'\"]*utm_medium=poweredby[^'\"]*['\"][^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n hydrationTimeout: 4000,\n needsHydrationCheck: true,\n // Content lives in these React islands rather than a #main root.\n hydrationSelector: '.react-page-section',\n captureRenderedDom: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Shared framework assets: storefront-<hash>.css/.js, user-site-<hash>.js, fonts, images.\n if (host.includes('cdn.podia.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (IMG_EXTS.includes(ext) || pathname.includes('/images/')) return 'assets/images';\n return 'assets/misc';\n }\n\n // User-uploaded media on Podia-hosted subdomains: /content-assets/public/<JWT>.\n // Custom domains fall through to null so the generic fallback handles them.\n if (host.includes('.podia.com') && pathname.includes('/content-assets/')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Teachable (course platform, server-rendered Rails app, codename \"fedora\").\n *\n * Detection keys on the asset CDN `teachablecdn.com` — present in raw HTML on\n * both default `*.teachable.com` subdomains and custom-domain schools (verified\n * on intent.teachable.com and courses.stationx.net). The strongest single tell\n * is `<meta name=\"asset_host\" content=\"https://fedora.teachablecdn.com\">`.\n *\n * Render is `ssr-static`: `.course-block.block.<type>` divs with `id=block-<n>`\n * ship in the initial HTML, so we do NOT capture the rendered DOM.\n *\n * Badge: footer `<a class='powered-by' href='https://teachable.com/...?src=school_footer'>`\n * with `span.powered-by-text` \"Teach Online with\" + a branding logomark SVG.\n * The href varies per school (/teach-online/?src=school_footer vs /?src=school_footer);\n * the stable anchors are the `powered-by` class and the `teachable.com` href.\n * Removed via stripPatterns (NOT a `.powered-by` stripSelector): the selector\n * engine only matches double-quoted class attrs and cuts to the first `</…>`,\n * which would mangle this single-quoted multi-child anchor. The regexes below\n * grab the whole `<a>…</a>` for both `'` and `\"` quoting.\n *\n * CDN hosts: fedora.teachablecdn.com (page CSS/JS — /assets/*.css sprockets,\n * /packs/*.js webpacker), assets.teachablecdn.com (fonts/branding),\n * uploads.teachablecdn.com (user media). All share the `teachablecdn.com` suffix.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const teachable: PlatformHandler = {\n name: 'teachable',\n displayName: 'Teachable',\n category: 'course',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.teachable\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n return (\n html.includes('teachablecdn.com') ||\n html.includes('eventable.internal.teachable.com') ||\n html.includes('Teach Online with') ||\n html.includes('src=school_footer')\n );\n },\n\n stripDomains: [\n 'cdn.heapanalytics.com',\n 'bam.nr-data.net',\n 'www.recaptcha.net',\n 'fast.wistia.com',\n ],\n\n stripSelectors: [\n // Analytics <script src> tags left in the HTML (hosts also blocked at capture\n // via stripDomains). The powered-by badge is handled by stripPatterns instead\n // — a `.class` selector can't match its single-quoted, multi-child anchor.\n 'script[src*=\"heapanalytics.com\"]',\n 'script[src*=\"nr-data.net\"]',\n ],\n\n stripPatterns: [\n // Footer \"Teach Online with\" badge — anchored on its unique powered-by class.\n /<a[^>]*class=['\"][^'\"]*powered-by[^'\"]*['\"][^>]*>[\\s\\S]*?<\\/a>/gi,\n // Fallback: anchored on the teachable.com ?src=school_footer badge href.\n /<a[^>]*href=['\"][^'\"]*teachable\\.com[^'\"]*src=school_footer[^'\"]*['\"][^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n hydrationTimeout: 0,\n needsHydrationCheck: false,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // fedora / assets / uploads .teachablecdn.com all share this suffix.\n if (host.includes('teachablecdn.com')) {\n // Extension-first: Teachable's Rails/sprockets pipeline serves CSS, JS,\n // fonts and images all under /assets/, so a /assets/ path check must never\n // pre-empt the font/js/json classification.\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.json') return 'data';\n // Fallback for hashed / extensionless asset URLs.\n if (pathname.includes('/images/')) return 'assets/images';\n if (pathname.includes('/packs/')) return 'scripts/vendor';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Thinkific — v5 production handler (course category).\n *\n * Thinkific is a Ruby-on-Rails + Liquid course/membership platform that renders\n * every page server-side (renderStrategy: ssr-static): the raw HTML already\n * contains all course cards, the footer and the copyright, so no rendered-DOM\n * capture is required. Default tenant hosting is {subdomain}.thinkific.com, but\n * many production sites run on custom domains (e.g. courses.winefolly.com) where\n * the URL regex fails and detection MUST fall back to the HTML signatures.\n * Signatures verified against colormatters.thinkific.com (subdomain) and\n * courses.winefolly.com (custom domain).\n *\n * Interface: PlatformHandler (src/platforms/types.ts)\n * detectByUrl(url: string): boolean\n * detectByHtml(html: string): boolean\n * stripDomains / stripSelectors / stripPatterns\n * mapAssetDir(host: string, pathname: string, ext: string): string | null\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const thinkific: PlatformHandler = {\n name: 'thinkific',\n displayName: 'Thinkific',\n category: 'course',\n priority: 82,\n\n detectByUrl(url: string): boolean {\n return /\\.thinkific\\.com/i.test(url);\n },\n\n // Four Thinkific-only tells that hold on both subdomain and custom-domain\n // sites. The \"Powered by Thinkific\" badge is deliberately NOT used here (it is\n // removable on paid plans). None of these strings appear on Framer / Webflow /\n // Wix output.\n detectByHtml(html: string): boolean {\n return (\n html.includes('window.Thinkific') || // inline bootstrap: `window.Thinkific = window.Thinkific || {}`\n html.includes('assets.thinkific.com') || // theme CSS/JS bundle host\n html.includes('cdn.thinkific.com') || // toga-css icon-font host\n html.includes('thnc.current_user-initialized') // custom JS event fired after user bootstrap\n );\n },\n\n // Telemetry / third-party embed hosts only (profile.analyticsScripts) — NEVER\n // the *.thinkific.com asset CDN. These are matched against the request HOSTNAME\n // only (capture.ts: `host.includes(d)`), so each entry MUST be a bare hostname —\n // a path such as \"www.google.com/recaptcha\" can never match and would be dead.\n // `fast.wistia.net` = Wistia video player; `www.google.com` = sign-in reCAPTCHA\n // (api.js served from www.google.com/recaptcha; the whole host is safe to block\n // on a static mirror — no legit Thinkific asset is served from it).\n stripDomains: ['fast.wistia.net', 'www.google.com'],\n\n // The badge is removed via stripPatterns (below), NOT a `.class` stripSelector.\n // The class-based stripper (output.ts) is a non-greedy `…>[\\s\\S]*?<\\/[^>]*>` that\n // stops at the FIRST closing tag, so on the nested badge markup\n // (<div class=\"footer__white-label\"><a><svg><title>…</title>…</svg></a></div>) it\n // would cut at </title>, leaving orphan </svg></a></div> AND deleting the opening\n // <div>/<a> tags that the stripPatterns regexes anchor on (stripSelectors run\n // before stripPatterns). So no stripSelectors are used here.\n stripSelectors: [],\n\n stripPatterns: [\n // Whole badge wrapper: <div class=\"footer__white-label\"> … </div>\n // (inner anchor + inline SVG titled \"Teach online with Thinkific\").\n /<div[^>]*class=\"[^\"]*footer__white-label[^\"]*\"[^>]*>[\\s\\S]*?<\\/div>/g,\n // Belt-and-suspenders: the branded powered-by referral anchor itself.\n /<a[^>]*href=\"[^\"]*thinkific\\.com[^\"]*utm_medium=powered-by[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/g,\n ],\n\n // ssr-static: the raw SSR HTML is complete, so no hydration wait is needed\n // (profile needsHydrationCheck=false, hydrationTimeoutMs=0). antiBot is\n // Cloudflare (rocket-loader observed) but pages fetched cleanly in research;\n // per the authoring guide we keep a small capture buffer instead of literal 0.\n hydrationTimeout: 2000,\n needsHydrationCheck: false,\n\n // cdnDomains: assets.thinkific.com, cdn.thinkific.com, cdn-themes.thinkific.com,\n // import.cdn.thinkific.com, files.cdn.thinkific.com (all *.thinkific.com), plus\n // the bare s3.amazonaws.com upload host. Theme bundles/fonts live on the\n // thinkific.com hosts; uploaded media on import.cdn / files.cdn (front S3).\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (host.includes('thinkific.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // Bare S3 bucket fronting Thinkific uploads (declared cdnDomain).\n if (host.includes('s3.amazonaws.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Gumroad — Ruby on Rails + Inertia.js + Vite + React, fronted by Cloudflare.\n *\n * Detection anchors (all verified verbatim in raw HTML, 2026-07-06):\n * - <meta name=\"action-cable-url\" content=\"wss://cable.gumroad.com/cable\" />\n * - <head prefix=\"… gumroad: http://ogp.me/ns/fb/gumroad#\">\n * - Vite bundles / fonts / favicon under https://assets.gumroad.com/…\n * - <meta property=\"og:type\" content=\"gumroad:product\"> (product pages)\n *\n * Render: <div id=\"app\" data-page=\"…\"> is an Inertia root whose SSR DOM is empty;\n * the real content is HTML-entity-encoded JSON in data-page, populated by React on\n * the client. => react-hydration, captureRenderedDom = true, hydrationSelector = #app.\n *\n * Badge: none server-rendered (\"Powered by Gumroad\" grep returns nothing); any footer\n * attribution is client-side React, so there is nothing to strip statically.\n *\n * CDN hosts (from profile.cdnDomains):\n * - assets.gumroad.com (Vite JS/CSS entrypoints, /fonts/*.woff2, /images/*) — active\n * - public-files.gumroad.com (og/twitter images, favicon, user uploads) — active\n * - static-2.gumroad.com (dns-prefetch only; weak/secondary hint) — real host\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const gumroad: PlatformHandler = {\n name: 'gumroad',\n displayName: 'Gumroad',\n category: 'ecommerce',\n priority: 80,\n\n detectByUrl(url: string): boolean {\n return /\\.gumroad\\.com|\\bgum\\.co\\b/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // Custom domains defeat the URL regex; these HTML markers are the reliable tell.\n return (\n html.includes('cable.gumroad.com') ||\n html.includes('assets.gumroad.com') ||\n html.includes('ns/fb/gumroad#') ||\n html.includes('gumroad:product')\n );\n },\n\n // Telemetry / analytics hosts only — never the asset CDN.\n // gumroad-analytics.com is Gumroad's first-party analytics proxy\n // (domain_settings.third_party_analytics_domain); GA / FB Pixel / TikTok Pixel\n // are injected client-side only when the creator enables them.\n stripDomains: [\n 'gumroad-analytics.com',\n 'www.googletagmanager.com',\n 'connect.facebook.net',\n 'analytics.tiktok.com',\n ],\n\n // Defensively drop any surviving analytics <script> tags from the rendered DOM\n // (stripDomains already blocks them at the network layer during capture).\n stripSelectors: [\n 'script[src*=\"gumroad-analytics.com\"]',\n 'script[src*=\"googletagmanager.com\"]',\n 'script[src*=\"connect.facebook.net\"]',\n 'script[src*=\"analytics.tiktok.com\"]',\n ],\n\n // No server-rendered badge to remove (badgePresent = false, confirmed).\n stripPatterns: [],\n\n hydrationTimeout: 8000,\n needsHydrationCheck: true,\n hydrationSelector: '#app',\n captureRenderedDom: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n if (\n host.includes('assets.gumroad.com') ||\n host.includes('public-files.gumroad.com') ||\n host.includes('static-2.gumroad.com')\n ) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (pathname.includes('/fonts/') || FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (pathname.includes('/stylesheets/') || ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (pathname.includes('/images/') || IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n // cable.gumroad.com (wss), api.gumroad.com and gumroad-analytics.com are not\n // asset CDNs — let the generic fallback handle any foreign host.\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Shopify — SSR-static Liquid storefronts (category: ecommerce).\n *\n * Signatures (verified live Jul 2026 on allbirds / deathwishcoffee / gymshark):\n * - Inline bootstrap `var Shopify = Shopify || {}` then `Shopify.shop = \"<store>.myshopify.com\"`.\n * - First-party `ShopifyAnalytics` + `trekkie` objects beaconing to monorail-edge.shopifysvc.com.\n * - Assets on `cdn.shopify.com/s/files/...` (legacy/headless) or same-origin `/cdn/shop/files|t/...`\n * (modern themes, served from the store's own custom domain).\n * - `.myshopify.com` is the canonical dedicated backend subdomain (revealed even on custom domains).\n * - No `<meta name=\"generator\">` on modern themes — do NOT rely on it.\n *\n * PlatformHandler contract: detectByUrl(url)/detectByHtml(html)/mapAssetDir(host, pathname, ext).\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const shopify: PlatformHandler = {\n name: 'shopify',\n displayName: 'Shopify',\n category: 'ecommerce',\n priority: 80,\n\n detectByUrl(url: string): boolean {\n return /\\.myshopify\\.com/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // OR of Shopify-only markers. `cdn.shopify.com` catches headless/Hydrogen stores\n // (gymshark) that ship no inline window.Shopify; the others catch standard themes.\n return (\n html.includes('cdn.shopify.com') ||\n html.includes('/cdn/shop/') ||\n html.includes('Shopify.shop') ||\n html.includes('ShopifyAnalytics')\n );\n },\n\n // Telemetry only — never the asset CDN.\n stripDomains: ['monorail-edge.shopifysvc.com'],\n\n // The \"Powered by Shopify\" badge is a NESTED <span class=\"shopify-powered-by\">\n // <a …>…</a></span>. The post-processor's `.class` strip only deletes up to the\n // FIRST closing tag (the inner </a>), which would leave an orphan </span>; worse,\n // stripSelectors run BEFORE stripPatterns, so it would consume the opening <span>\n // and stop the clean span regex below from matching. So the badge is removed\n // purely via stripPatterns — no `.class` selector.\n stripSelectors: [],\n\n stripPatterns: [\n // Whole badge container: <span class=\"shopify-powered-by\" data-shopify=\"powered-by\"><a href=\"…shopify.com?utm_campaign=poweredby…\">Powered by Shopify</a></span>\n /<span[^>]*class=\"[^\"]*shopify-powered-by[^\"]*\"[^>]*>[\\s\\S]*?<\\/span>/gi,\n // Fallback: the brand anchor itself (href carries ?utm_campaign=poweredby), in case the <span> wrapper is absent or customised.\n /<a[^>]*href=\"[^\"]*shopify\\.com\\?utm_campaign=poweredby[^\"]*\"[^>]*>[\\s\\S]*?<\\/a>/gi,\n ],\n\n hydrationTimeout: 3500,\n needsHydrationCheck: true,\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Modern themes serve /cdn/shop/files/ and /cdn/shop/t/ from the store's OWN\n // (custom) domain, so the host is unknown — classify these by path + ext.\n const isShopifyAssetPath: boolean = pathname.includes('/cdn/shop/');\n\n if (host.includes('cdn.shopify.com') || isShopifyAssetPath) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.json') return 'data';\n return 'assets/misc';\n }\n\n if (host.includes('fonts.shopifycdn.com')) {\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n if (host.includes('extensions.shopifycdn.com')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n return 'assets/misc';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler } from '../types.js';\n\n/**\n * Gamma (gamma.app) — AI presentation / site builder.\n *\n * Verified signatures (tests/research/gamma.json):\n * - URL: *.gamma.site (free tier); Pro sites use custom domains.\n * - HTML: Next.js SSR app — `<div id=\"__next\">`, `<script id=\"__NEXT_DATA__\">`,\n * ProseMirror/TipTap node-view markup (data-node-view-wrapper,\n * gamma-moveable-wrapper), Chakra-UI/emotion classes.\n * - Assets: JS/CSS chunks on assets.gammahosted.com/<siteId>/_next/static/,\n * user media on cdn.gamma.app wrapped through imgproxy.gamma.app,\n * OG/preview screenshots on assets.api.gamma.app/<siteId>/screenshots/.\n * - Header X-Super-Powered-By: gamma is the strongest tell but is invisible to\n * detectByHtml, so we lean on the unique asset hosts + Gamma-only class,\n * which also catch Pro custom-domain sites (assets.gammahosted.com).\n *\n * renderStrategy is \"hybrid\": content is server-rendered then React/Chakra\n * hydrated, so the SSR body already carries the content — captureRenderedDom is\n * intentionally NOT set (per authoring guide, true only for spa/react-hydration).\n * No \"Made with Gamma\" site badge exists on published sites (toggleable /\n * export-watermark only), and no analytics hosts were observed, so all strip\n * fields stay empty.\n */\n\nconst IMG_EXTS: string[] = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.webp', '.avif', '.ico'];\nconst FONT_EXTS: string[] = ['.woff2', '.woff', '.ttf', '.otf', '.eot'];\nconst VIDEO_EXTS: string[] = ['.mp4', '.webm', '.ogg'];\n\nexport const gamma: PlatformHandler = {\n name: 'gamma',\n displayName: 'Gamma',\n category: 'ai',\n priority: 85,\n\n detectByUrl(url: string): boolean {\n return /\\.gamma\\.site/i.test(url);\n },\n\n detectByHtml(html: string): boolean {\n // Gamma-unique asset hosts + node-view class. Deliberately avoids generic\n // Next.js markers (#__next, __NEXT_DATA__) that appear on unrelated sites.\n return (\n html.includes('assets.gammahosted.com') ||\n html.includes('imgproxy.gamma.app') ||\n html.includes('cdn.gamma.app') ||\n html.includes('gamma-moveable-wrapper')\n );\n },\n\n // No telemetry/analytics hosts observed in the profile.\n stripDomains: [],\n\n // No site badge and no editor chrome to strip on published Gamma sites.\n stripSelectors: [],\n stripPatterns: [],\n\n hydrationTimeout: 8000,\n needsHydrationCheck: true,\n hydrationSelector: '#__next',\n scrollStrategy: 'standard',\n\n mapAssetDir(host: string, pathname: string, ext: string): string | null {\n // Next.js build output: JS/CSS chunks, fonts, static images under _next/static.\n if (host.includes('assets.gammahosted.com')) {\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (ext === '.json') return 'data';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n return 'assets/misc';\n }\n\n // Image resize proxy — every URL resolves to an image regardless of ext.\n if (host.includes('imgproxy.gamma.app')) {\n return 'assets/images';\n }\n\n // OG / social-preview screenshots.\n if (host.includes('assets.api.gamma.app')) {\n return 'assets/images';\n }\n\n // Raw user media (original / optimized) — mostly images, some video.\n if (host.includes('cdn.gamma.app')) {\n if (VIDEO_EXTS.includes(ext)) return 'assets/videos';\n if (FONT_EXTS.includes(ext)) return 'assets/fonts';\n if (ext === '.css') return 'styles';\n if (ext === '.js' || ext === '.mjs') return 'scripts/vendor';\n if (IMG_EXTS.includes(ext)) return 'assets/images';\n // cdn.gamma.app is a media host; default unknown ext to images.\n return 'assets/images';\n }\n\n return null;\n },\n};\n","import type { PlatformHandler, PlatformCategory } from './types.js';\n\n// ── frozen trio (v4) ─────────────────────────────────────────────────────────\nimport { framer } from './framer.js';\nimport { webflow } from './webflow.js';\nimport { wix } from './wix.js';\n\n// ── website builders ─────────────────────────────────────────────────────────\nimport { bubble } from './builder/bubble.js';\nimport { carrd } from './builder/carrd.js';\nimport { duda } from './builder/duda.js';\nimport { squarespace } from './builder/squarespace.js';\nimport { strikingly } from './builder/strikingly.js';\nimport { tilda } from './builder/tilda.js';\nimport { weebly } from './builder/weebly.js';\n\n// ── landing pages & funnels ──────────────────────────────────────────────────\nimport { clickfunnels } from './landing/clickfunnels.js';\nimport { elementor } from './landing/elementor.js';\nimport { instapage } from './landing/instapage.js';\nimport { systemeio } from './landing/systemeio.js';\nimport { unbounce } from './landing/unbounce.js';\n\n// ── cms & blogs ──────────────────────────────────────────────────────────────\nimport { ghost } from './cms/ghost.js';\nimport { notion } from './cms/notion.js';\nimport { wordpress } from './cms/wordpress.js';\n\n// ── courses & membership ─────────────────────────────────────────────────────\nimport { kajabi } from './course/kajabi.js';\nimport { podia } from './course/podia.js';\nimport { teachable } from './course/teachable.js';\nimport { thinkific } from './course/thinkific.js';\n\n// ── e-commerce ───────────────────────────────────────────────────────────────\nimport { gumroad } from './ecommerce/gumroad.js';\nimport { shopify } from './ecommerce/shopify.js';\n\n// ── ai & presentations ───────────────────────────────────────────────────────\nimport { gamma } from './ai/gamma.js';\n\n/**\n * Single source of truth: every handler the exporter knows about.\n * Detection and the CLI selector both consume this list.\n */\nexport const PLATFORM_REGISTRY: PlatformHandler[] = [\n // frozen trio first (highest priority, unchanged behaviour)\n framer,\n webflow,\n wix,\n // builders\n bubble,\n carrd,\n duda,\n squarespace,\n strikingly,\n tilda,\n weebly,\n // landing\n clickfunnels,\n elementor,\n instapage,\n systemeio,\n unbounce,\n // cms\n ghost,\n notion,\n wordpress,\n // course\n kajabi,\n podia,\n teachable,\n thinkific,\n // ecommerce\n gumroad,\n shopify,\n // ai\n gamma,\n];\n\nexport const CATEGORY_LABELS: Record<PlatformCategory, string> = {\n builder: 'Website Builders',\n landing: 'Landing Pages & Funnels',\n cms: 'CMS & Blogs',\n course: 'Courses & Membership',\n ecommerce: 'E-commerce',\n ai: 'AI & Presentations',\n};\n\nexport const CATEGORY_ORDER: PlatformCategory[] = [\n 'builder',\n 'landing',\n 'cms',\n 'course',\n 'ecommerce',\n 'ai',\n];\n\n/** Handlers sorted by detection priority (desc). Used by detect.ts. */\nexport function sortedByPriority(): PlatformHandler[] {\n return [...PLATFORM_REGISTRY].sort((a, b) => b.priority - a.priority);\n}\n\n/** Handlers grouped by category (each group sorted by priority desc). */\nexport function platformsByCategory(): Record<PlatformCategory, PlatformHandler[]> {\n const out = {} as Record<PlatformCategory, PlatformHandler[]>;\n for (const cat of CATEGORY_ORDER) out[cat] = [];\n for (const handler of PLATFORM_REGISTRY) {\n if (!out[handler.category]) out[handler.category] = [];\n out[handler.category].push(handler);\n }\n for (const cat of CATEGORY_ORDER) {\n out[cat].sort((a, b) => b.priority - a.priority);\n }\n return out;\n}\n","import type { PlatformHandler, PlatformType } from './types.js';\nimport type { Page } from 'puppeteer';\nimport { PLATFORM_REGISTRY, sortedByPriority } from './registry.js';\nimport { framer } from './framer.js';\n\n/** Extract the `<meta name=\"generator\">` content, if any. */\nexport function readGenerator(html: string): string {\n const m =\n html.match(/<meta[^>]+name=[\"']generator[\"'][^>]*content=[\"']([^\"']*)[\"']/i) ||\n html.match(/<meta[^>]+content=[\"']([^\"']*)[\"'][^>]+name=[\"']generator[\"']/i);\n return m ? m[1] : '';\n}\n\nexport function detectByUrl(url: string): PlatformHandler | null {\n for (const platform of sortedByPriority()) {\n try {\n if (platform.detectByUrl(url)) return platform;\n } catch {}\n }\n return null;\n}\n\nexport function detectByGenerator(html: string): PlatformHandler | null {\n const gen = readGenerator(html);\n if (!gen) return null;\n for (const platform of sortedByPriority()) {\n if (platform.detectGenerator && platform.detectGenerator.test(gen)) return platform;\n }\n return null;\n}\n\nexport function detectByHtml(html: string): PlatformHandler | null {\n // Generator meta is the most reliable HTML signal, so try it first.\n const byGen = detectByGenerator(html);\n if (byGen) return byGen;\n\n for (const platform of sortedByPriority()) {\n try {\n if (platform.detectByHtml(html)) return platform;\n } catch {}\n }\n return null;\n}\n\nexport function detectPlatform(url: string, html?: string): PlatformHandler {\n const byUrl = detectByUrl(url);\n if (byUrl) return byUrl;\n\n if (html) {\n const byHtml = detectByHtml(html);\n if (byHtml) return byHtml;\n }\n\n return framer;\n}\n\nexport async function detectByDom(page: Page): Promise<PlatformHandler | null> {\n // 1. Legacy signal scan — kept byte-identical to v4 so the frozen trio's\n // DOM refinement never changes.\n try {\n const signal: string = await page.evaluate(() => {\n const html: string = document.documentElement.outerHTML || '';\n\n if (/wix-viewer-model|_wix_|wix-ecom/i.test(html)) return 'wix';\n if (/data-wf-|w-webflow-badge|webflow\\.js/i.test(html)) return 'webflow';\n if (/framerusercontent|framercanvas|framerstatic/i.test(html)) return 'framer';\n\n const srcs: string[] = [];\n const scripts: NodeListOf<HTMLScriptElement> = document.querySelectorAll('script[src]');\n scripts.forEach((s) => {\n if (s.src) srcs.push(s.src);\n });\n const allSrcs: string = srcs.join(' ');\n if (/wixstatic\\.com|parastorage\\.com/.test(allSrcs)) return 'wix';\n if (/website-files\\.com|webflow\\.com/.test(allSrcs)) return 'webflow';\n if (/framerusercontent\\.com|framerstatic\\.com|framer\\.app/.test(allSrcs)) return 'framer';\n\n return '';\n });\n\n if (signal) return getPlatformByName(signal as PlatformType);\n } catch {}\n\n // 2. Per-platform live-DOM probes (new platforms only), in priority order.\n for (const platform of sortedByPriority()) {\n if (!platform.detectByDom) continue;\n try {\n if (await platform.detectByDom(page)) return platform;\n } catch {}\n }\n\n return null;\n}\n\nexport function getPlatformByName(name: PlatformType): PlatformHandler {\n const found = PLATFORM_REGISTRY.find((platform) => platform.name === name);\n return found || framer;\n}\n","export type { PlatformHandler, PlatformType, PlatformCategory, ScrollStrategy } from './types.js';\nexport { framer } from './framer.js';\nexport { webflow } from './webflow.js';\nexport { wix } from './wix.js';\nexport {\n PLATFORM_REGISTRY,\n CATEGORY_LABELS,\n CATEGORY_ORDER,\n sortedByPriority,\n platformsByCategory,\n} from './registry.js';\nexport {\n detectPlatform,\n detectByUrl,\n detectByHtml,\n detectByGenerator,\n detectByDom,\n readGenerator,\n getPlatformByName,\n} from './detect.js';\n","import chalk from 'chalk';\nimport { ui } from './theme.js';\n\nconst SHINE_WIDTH = 14;\nconst FRAME_INTERVAL = 70;\nconst INTRO_DURATION = 1400;\nconst SHINE_SPEED = 0.55;\n\nconst SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n\nexport async function showLoadingIntro(version: string): Promise<void> {\n if (!process.stdout.isTTY || process.env.CI) return;\n\n await new Promise<void>((resolve) => {\n let frame = 0;\n\n const draw = (): void => {\n const spinner = SPINNER_FRAMES[frame % SPINNER_FRAMES.length];\n const title = renderShinyText(`Framer Export v${version}`, frame, {\n baseColor: '#969696',\n shineColor: '#ffffff',\n shineWidth: 18,\n speed: 1.2,\n });\n const dots = '.'.repeat(frame % 4).padEnd(3, ' ');\n process.stdout.write(\n `\\r\\x1B[2K ${ui.primary(spinner)} ${title} ${ui.muted(`Loading${dots}`)}`\n );\n frame++;\n };\n\n process.stdout.write('\\x1B[?25l');\n draw();\n const interval = setInterval(draw, FRAME_INTERVAL);\n setTimeout(() => {\n clearInterval(interval);\n process.stdout.write('\\r\\x1B[2K\\x1B[?25h');\n resolve();\n }, INTRO_DURATION);\n });\n}\n\nexport class CookingSpinner {\n private interval: NodeJS.Timeout | null = null;\n private frame = 0;\n private phase = '';\n private active = false;\n\n start(phase: string = ''): void {\n this.phase = phase;\n this.frame = 0;\n this.active = true;\n this.draw();\n this.interval = setInterval(() => {\n this.frame++;\n this.draw();\n }, FRAME_INTERVAL);\n }\n\n update(phase: string): void {\n this.phase = phase;\n }\n\n log(message: string): void {\n if (this.active) {\n process.stdout.write('\\r\\x1B[2K');\n }\n process.stdout.write(message + '\\n');\n if (this.active) {\n this.draw();\n }\n }\n\n stop(): void {\n this.active = false;\n if (this.interval) {\n clearInterval(this.interval);\n this.interval = null;\n }\n process.stdout.write('\\r\\x1B[2K');\n }\n\n private draw(): void {\n if (!this.active) return;\n\n const spinner = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];\n const shimmer = renderShinyText('Exporting', this.frame);\n const frameStr = ui.primary(spinner);\n const phaseStr = this.phase ? ` ${ui.muted(this.limitLen(this.phase, 52))}` : '';\n\n process.stdout.write(`\\r\\x1B[2K ${frameStr} ${shimmer}${phaseStr}`);\n }\n\n private limitLen(s: string, max: number): string {\n if (s.length <= max) return s;\n return s.slice(0, max - 1) + '…';\n }\n}\n\nfunction renderShinyText(\n text: string,\n frame: number,\n options: { baseColor?: string; shineColor?: string; shineWidth?: number; speed?: number } = {}\n): string {\n const baseColor = options.baseColor || '#808080';\n const shineColor = options.shineColor || '#ffffff';\n const shineWidth = options.shineWidth || SHINE_WIDTH;\n const speed = options.speed ?? SHINE_SPEED;\n const travel = text.length + shineWidth * 2;\n const pos = ((frame * speed) % travel) - shineWidth;\n const base = hexToRgb(baseColor);\n const shine = hexToRgb(shineColor);\n\n let result = '';\n for (let i = 0; i < text.length; i++) {\n const dist = Math.abs(i - pos);\n const intensity = smoothstep(0, 1, 1 - Math.min(1, dist / shineWidth));\n const color = mixRgb(base, shine, intensity);\n const paint =\n intensity > 0.82\n ? chalk.rgb(color.r, color.g, color.b).bold\n : chalk.rgb(color.r, color.g, color.b);\n result += paint(text[i]);\n }\n return result;\n}\n\nfunction smoothstep(edge0: number, edge1: number, value: number): number {\n const t = Math.max(0, Math.min(1, (value - edge0) / (edge1 - edge0)));\n return t * t * (3 - 2 * t);\n}\n\nfunction hexToRgb(hex: string): { r: number; g: number; b: number } {\n const clean = hex.replace('#', '');\n const normalized =\n clean.length === 3\n ? clean\n .split('')\n .map((char) => char + char)\n .join('')\n : clean.padEnd(6, '0').slice(0, 6);\n\n return {\n r: Number.parseInt(normalized.slice(0, 2), 16),\n g: Number.parseInt(normalized.slice(2, 4), 16),\n b: Number.parseInt(normalized.slice(4, 6), 16),\n };\n}\n\nfunction mixRgb(\n from: { r: number; g: number; b: number },\n to: { r: number; g: number; b: number },\n amount: number\n): { r: number; g: number; b: number } {\n return {\n r: Math.round(from.r + (to.r - from.r) * amount),\n g: Math.round(from.g + (to.g - from.g) * amount),\n b: Math.round(from.b + (to.b - from.b) * amount),\n };\n}\n","import chalk from 'chalk';\nimport { stripAnsi, ui } from './theme.js';\n\nexport function maxWidth(): number {\n return Math.min(process.stdout.columns || 80, 76);\n}\n\nfunction padRight(text: string, w: number): string {\n const fitted = fitAnsi(text, w);\n const visible = stripAnsi(fitted).length;\n if (visible >= w) return fitted;\n return fitted + ' '.repeat(w - visible);\n}\n\nfunction fitAnsi(text: string, width: number): string {\n if (stripAnsi(text).length <= width) return text;\n if (width <= 2) return '.'.repeat(Math.max(0, width));\n\n let out = '';\n let visible = 0;\n let i = 0;\n const limit = width - 2;\n\n while (i < text.length && visible < limit) {\n if (text[i] === '\\x1B') {\n const match = text.slice(i).match(/^\\x1B\\[[0-9;]*[a-zA-Z]/);\n if (match) {\n out += match[0];\n i += match[0].length;\n continue;\n }\n }\n\n out += text[i];\n visible++;\n i++;\n }\n\n return out + '..' + '\\x1B[0m';\n}\n\nfunction fitValue(value: string, width: number): string {\n if (value.length <= width) return value;\n\n const pathLike = value.includes('\\\\') || value.includes('/');\n if (pathLike) {\n const shortened = shortenPath(value, width);\n if (shortened.length <= width) return shortened;\n }\n\n if (width <= 3) return '.'.repeat(Math.max(0, width));\n return value.slice(0, width - 2) + '..';\n}\n\nfunction shortenPath(value: string, width: number): string {\n if (width <= 12) {\n return width <= 3 ? '.'.repeat(Math.max(0, width)) : value.slice(0, width - 2) + '..';\n }\n\n const separator = value.includes('\\\\') ? '\\\\' : '/';\n const parts = value.split(/[\\\\/]+/).filter(Boolean);\n const prefix = value.startsWith(separator) ? separator : '';\n const shortened = parts\n .map((part, index) => {\n const isLast = index === parts.length - 1;\n if (isLast) return part;\n if (/^[A-Za-z]:$/.test(part)) return part;\n return part.length > 5 ? part.slice(0, 3) + '..' : part;\n })\n .join(separator);\n\n const withPrefix = prefix + shortened;\n if (withPrefix.length <= width) return withPrefix;\n\n const last = parts.at(-1) || value;\n const first = parts\n .slice(0, -1)\n .map((part) => (/^[A-Za-z]:$/.test(part) ? part : part.slice(0, 3) + '..'));\n const compact = prefix + [...first, last].join(separator);\n if (compact.length <= width) return compact;\n\n const tailSpace = Math.max(8, Math.floor(width * 0.45));\n const headSpace = Math.max(0, width - tailSpace - 4);\n const middle =\n compact.slice(0, headSpace) + separator + '..' + separator + compact.slice(-tailSpace);\n return middle.length <= width ? middle : compact.slice(0, width - 2) + '..';\n}\n\nexport function boxTop(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('╭─') + ui.border('─'.repeat(inner)) + ui.border('─╮');\n}\n\nexport function panelTop(w: number): string {\n const inner = w - 4;\n return ui.border('╭─') + ui.border('─'.repeat(inner)) + ui.border('─╮');\n}\n\nexport function boxBot(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('╰─') + ui.border('─'.repeat(inner)) + ui.border('─╯');\n}\n\nexport function panelBot(w: number): string {\n const inner = w - 4;\n return ui.border('╰─') + ui.border('─'.repeat(inner)) + ui.border('─╯');\n}\n\nexport function boxLine(w: number, text: string): string {\n const inner = w - 4;\n const padded = padRight(text, inner);\n return ' ' + ui.border('│ ') + padded + ui.border(' │');\n}\n\nexport function panelLine(w: number, text: string): string {\n const inner = w - 4;\n const padded = padRight(text, inner);\n return ui.border('│ ') + padded + ui.border(' │');\n}\n\nexport function boxSep(w: number): string {\n const inner = w - 4;\n return ' ' + ui.border('├─') + ui.border('─'.repeat(inner)) + ui.border('─┤');\n}\n\nexport function panelSep(w: number): string {\n const inner = w - 4;\n return ui.border('├─') + ui.border('─'.repeat(inner)) + ui.border('─┤');\n}\n\nexport function boxRow(w: number, label: string, value: string): string {\n const inner = w - 4;\n const labelPlain = stripAnsi(chalk.bold(label));\n const avail = Math.max(0, inner - labelPlain.length - 2);\n const fittedValue = fitValue(value, avail);\n const right = Math.max(0, inner - labelPlain.length - 2 - fittedValue.length);\n return (\n ' ' +\n ui.border('│ ') +\n chalk.bold(label) +\n ': ' +\n ui.primary(fittedValue) +\n ' '.repeat(right) +\n ui.border(' │')\n );\n}\n","import readline from 'node:readline';\nimport { stdin, stdout } from 'node:process';\nimport { maxWidth, panelBot, panelLine, panelSep, panelTop } from './box.js';\nimport { centerText, stripAnsi, truncatePlain, ui } from './theme.js';\n\nexport interface SelectOption {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectAction {\n label: string;\n value: string;\n disabled?: boolean;\n}\n\nexport interface SelectConfig {\n headerLines?: string[];\n actions?: SelectAction[];\n footer?: string;\n}\n\nlet pipedLinesPromise: Promise<string[]> | null = null;\nlet pipedLineIndex = 0;\n\nexport async function select(\n question: string,\n options: SelectOption[],\n defaultIndex: number = 0,\n config: SelectConfig = {}\n): Promise<string> {\n const isTTY = stdin.isTTY && stdout.isTTY;\n\n if (!isTTY) {\n return fallbackPrompt(question, options, defaultIndex, config);\n }\n\n return arrowSelect(question, options, defaultIndex, config);\n}\n\nexport async function promptInput(\n question: string,\n defaultValue: string = '',\n config: Omit<SelectConfig, 'actions'> = {}\n): Promise<string> {\n if (!stdin.isTTY || !stdout.isTTY) {\n return fallbackInput(question, defaultValue);\n }\n\n return fullscreenInput(question, defaultValue, config);\n}\n\nasync function arrowSelect(\n question: string,\n options: SelectOption[],\n defaultIndex: number,\n config: SelectConfig\n): Promise<string> {\n const actions = config.actions ?? [];\n const headerLines = config.headerLines ?? [];\n const width = Math.max(44, Math.min(maxWidth(), 72));\n const inner = width - 4;\n const actionLineOffset = 2 + headerLines.length;\n const hasActions = actions.length > 0;\n const optionStartOffset = 3 + headerLines.length + (hasActions ? 1 : 0);\n const lineCount = options.length + 4 + headerLines.length + (hasActions ? 1 : 0);\n const rows = process.stdout.rows || 24;\n const columns = process.stdout.columns || 80;\n const panelTopRow = Math.max(2, Math.floor((rows - lineCount) / 2) + 1);\n const panelLeftCol = Math.max(1, Math.floor((columns - width) / 2) + 1);\n const footerRow = Math.min(rows, panelTopRow + lineCount + 1);\n\n return new Promise((resolve) => {\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n let selected: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n let selectedAction: number | null = null;\n if (selected < 0) selected = 0;\n\n const move = (direction: -1 | 1): void => {\n let next = selected + direction;\n while (next >= 0 && next < options.length) {\n if (!options[next].disabled) {\n selected = next;\n return;\n }\n next += direction;\n }\n };\n\n const render = (initial: boolean = false): void => {\n if (!initial) {\n stdout.write('\\x1B[2J');\n }\n const lines: string[] = [];\n lines.push(panelTop(width));\n lines.push(\n panelLine(width, centerText(`${ui.primary('●')} ${ui.text.bold(question)}`, inner))\n );\n for (const header of headerLines) {\n lines.push(panelLine(width, centerText(ui.muted(header), inner)));\n }\n if (hasActions) {\n lines.push(\n panelLine(width, centerText(renderActions(actions, selectedAction, inner), inner))\n );\n }\n lines.push(panelSep(width));\n for (let i = 0; i < options.length; i++) {\n lines.push(\n panelLine(\n width,\n centerText(\n renderOption(options[i], selectedAction === null && i === selected, inner),\n inner\n )\n )\n );\n }\n lines.push(panelBot(width));\n\n lines.forEach((line, index) => writeAt(panelTopRow + index, panelLeftCol, line));\n writeAt(\n footerRow,\n panelLeftCol,\n centerText(\n ui.muted(config.footer || '↑↓ move · enter select · mouse hover/click · esc close'),\n width\n )\n );\n };\n\n const choose = (value: string = options[selected].value): void => {\n cleanup();\n console.log(\n ` ${ui.success('✓')} ${ui.text.bold(question)} ${ui.primary(labelForValue(value, options, actions))}\\n`\n );\n\n resolve(value);\n };\n\n const onMouseData = (chunk: Buffer): void => {\n const mouse = parseMouseEvent(chunk);\n if (!mouse) return;\n\n if (mouse.kind === 'wheel-up') {\n move(-1);\n render();\n return;\n }\n\n if (mouse.kind === 'wheel-down') {\n move(1);\n render();\n return;\n }\n\n if (hasActions && mouse.y === panelTopRow + actionLineOffset) {\n const actionIdx = actionIndexAtX(actions, mouse.x, panelLeftCol, inner);\n if (actionIdx === null || actions[actionIdx].disabled) return;\n if (selectedAction !== actionIdx) {\n selectedAction = actionIdx;\n render();\n }\n if (mouse.kind === 'click') choose(actions[actionIdx].value);\n return;\n }\n\n const idx = mouse.y - panelTopRow - optionStartOffset;\n if (idx < 0 || idx >= options.length || options[idx].disabled) return;\n\n if (selected !== idx) {\n selected = idx;\n selectedAction = null;\n render();\n }\n\n if (mouse.kind === 'click') {\n choose();\n }\n };\n\n const cleanup = (): void => {\n leaveInteractiveScreen();\n stdin.setRawMode(false);\n stdin.removeListener('keypress', onKeypress);\n stdin.removeListener('data', onMouseData);\n stdin.pause();\n };\n\n readline.emitKeypressEvents(stdin);\n stdin.setRawMode(true);\n enterInteractiveScreen(true);\n render(true);\n\n const onKeypress = (_str: string | undefined, key: readline.Key): void => {\n if (!key) return;\n\n if (key.name === 'up' && selected > 0) {\n move(-1);\n selectedAction = null;\n render();\n } else if (key.name === 'down' && selected < options.length - 1) {\n move(1);\n selectedAction = null;\n render();\n } else if (key.name === 'tab' && hasActions) {\n selectedAction = selectedAction === null ? 0 : null;\n render();\n } else if (key.name === 'return') {\n choose(selectedAction === null ? options[selected].value : actions[selectedAction].value);\n } else if ((key.ctrl && key.name === 'c') || key.name === 'escape') {\n cleanup();\n process.exit(0);\n }\n };\n\n stdin.resume();\n stdin.on('data', onMouseData);\n stdin.on('keypress', onKeypress);\n });\n}\n\nasync function fallbackPrompt(\n question: string,\n options: SelectOption[],\n defaultIndex: number,\n config: SelectConfig\n): Promise<string> {\n if (!stdin.isTTY) {\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n const enabledDefault: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n const def = String(enabledDefault + 1);\n\n printFallbackOptions(question, options, enabledDefault, config);\n\n while (true) {\n const trimmed = (await readPipedLine()).trim();\n if (trimmed.toLowerCase() === 'a') {\n const action = config.actions?.find((item) => !item.disabled);\n if (action) return action.value;\n }\n if (!trimmed) {\n const label = stripAnsi(options[enabledDefault].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n return options[enabledDefault].value;\n }\n const idx = parseInt(trimmed, 10);\n if (idx >= 1 && idx <= options.length && !options[idx - 1].disabled) {\n const label = stripAnsi(options[idx - 1].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n return options[idx - 1].value;\n }\n console.log(` ${ui.error('✗')} ${ui.warning(`Enter 1-${options.length} or ${def}`)}\\n`);\n }\n }\n\n return new Promise((resolve) => {\n const rl = readline.createInterface({ input: stdin, output: stdout });\n const firstEnabled: number = options.findIndex((option) => !option.disabled);\n const enabledDefault: number = options[defaultIndex]?.disabled ? firstEnabled : defaultIndex;\n\n printFallbackOptions(question, options, enabledDefault, config);\n const def = String(enabledDefault + 1);\n\n const ask = (): void => {\n rl.question(\n ` ${ui.primary('>')} ${ui.muted(`Choose [1-${options.length}] (${def})`)}: `,\n (answer) => {\n const trimmed = answer.trim();\n if (trimmed.toLowerCase() === 'a') {\n const action = config.actions?.find((item) => !item.disabled);\n if (action) {\n rl.close();\n resolve(action.value);\n return;\n }\n }\n if (!trimmed) {\n rl.close();\n const label = stripAnsi(options[enabledDefault].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n resolve(options[enabledDefault].value);\n return;\n }\n const idx = parseInt(trimmed, 10);\n if (idx >= 1 && idx <= options.length && !options[idx - 1].disabled) {\n rl.close();\n const label = stripAnsi(options[idx - 1].label);\n console.log(` ${ui.success('✓')} ${ui.primary(label)}\\n`);\n resolve(options[idx - 1].value);\n } else if (idx >= 1 && idx <= options.length && options[idx - 1].disabled) {\n console.log(` ${ui.error('✗')} ${ui.warning('Option unavailable for now')}\\n`);\n ask();\n } else {\n console.log(` ${ui.error('✗')} ${ui.warning(`Enter 1-${options.length}`)}\\n`);\n ask();\n }\n }\n );\n };\n ask();\n });\n}\n\nfunction fullscreenInput(\n question: string,\n defaultValue: string,\n config: Omit<SelectConfig, 'actions'>\n): Promise<string> {\n const headerLines = config.headerLines ?? [];\n const width = Math.max(44, Math.min(maxWidth(), 72));\n const inner = width - 4;\n const lineCount = 6 + headerLines.length;\n const rows = process.stdout.rows || 24;\n const columns = process.stdout.columns || 80;\n const panelTopRow = Math.max(2, Math.floor((rows - lineCount) / 2) + 1);\n const panelLeftCol = Math.max(1, Math.floor((columns - width) / 2) + 1);\n const footerRow = Math.min(rows, panelTopRow + lineCount + 1);\n\n return new Promise((resolve) => {\n let value = defaultValue;\n\n const render = (): void => {\n stdout.write('\\x1B[2J');\n const shown = value || '';\n const clipped = truncatePlain(shown, Math.max(12, inner - 10));\n const input = `${ui.primary('>')} ${ui.text(clipped)}${ui.primary('▌')}`;\n const lines: string[] = [];\n lines.push(panelTop(width));\n lines.push(\n panelLine(width, centerText(`${ui.primary('●')} ${ui.text.bold(question)}`, inner))\n );\n for (const header of headerLines) {\n lines.push(panelLine(width, centerText(ui.muted(header), inner)));\n }\n lines.push(panelSep(width));\n lines.push(panelLine(width, centerText(input, inner)));\n lines.push(panelBot(width));\n\n lines.forEach((line, index) => writeAt(panelTopRow + index, panelLeftCol, line));\n writeAt(\n footerRow,\n panelLeftCol,\n centerText(ui.muted(config.footer || 'type value · enter confirm · esc close'), width)\n );\n };\n\n const cleanup = (): void => {\n leaveInteractiveScreen();\n stdin.setRawMode(false);\n stdin.removeListener('keypress', onKeypress);\n stdin.pause();\n };\n\n const submit = (): void => {\n const output = cleanInputValue(value.trim() || defaultValue);\n cleanup();\n resolve(output);\n };\n\n const onKeypress = (str: string | undefined, key: readline.Key): void => {\n if ((key.ctrl && key.name === 'c') || key.name === 'escape') {\n cleanup();\n process.exit(0);\n }\n if (key.name === 'return') {\n submit();\n return;\n }\n if (key.name === 'backspace') {\n value = value.slice(0, -1);\n render();\n return;\n }\n if (key.name === 'delete') {\n value = '';\n render();\n return;\n }\n if (str && !key.ctrl && !key.meta && str >= ' ' && !isTerminalSequence(str, key)) {\n value += cleanInputValue(str.replace(/[\\r\\n]/g, ''));\n render();\n }\n };\n\n readline.emitKeypressEvents(stdin);\n stdin.setRawMode(true);\n enterInteractiveScreen(false);\n render();\n stdin.resume();\n stdin.on('keypress', onKeypress);\n });\n}\n\nasync function fallbackInput(question: string, defaultValue: string): Promise<string> {\n if (!stdin.isTTY) {\n const suffix = defaultValue ? ui.muted(` (${defaultValue})`) : '';\n console.log(` ${ui.primary('>')} ${ui.text.bold(question)}${suffix}: `);\n const answer = await readPipedLine();\n return cleanInputValue(answer.trim() || defaultValue);\n }\n\n return new Promise((resolve) => {\n const rl = readline.createInterface({ input: stdin, output: stdout });\n const suffix = defaultValue ? ui.muted(` (${defaultValue})`) : '';\n rl.question(` ${ui.primary('>')} ${ui.text.bold(question)}${suffix}: `, (answer) => {\n rl.close();\n resolve(cleanInputValue(answer.trim() || defaultValue));\n });\n });\n}\n\nfunction printFallbackOptions(\n question: string,\n options: SelectOption[],\n enabledDefault: number,\n config: SelectConfig\n): void {\n console.log(` ${ui.primary('●')} ${ui.text.bold(question)}\\n`);\n for (const header of config.headerLines ?? []) {\n console.log(` ${ui.muted(header)}`);\n }\n for (const action of config.actions ?? []) {\n console.log(\n ` ${ui.muted('[A]')} ${action.disabled ? ui.muted(action.label) : ui.text(action.label)}`\n );\n }\n if ((config.headerLines?.length || 0) > 0 || (config.actions?.length || 0) > 0) {\n console.log('');\n }\n for (let i = 0; i < options.length; i++) {\n const marker = i === enabledDefault ? ui.success(' ◆') : ' ';\n const label = options[i].disabled\n ? ui.muted(stripAnsi(options[i].label))\n : ui.text(options[i].label);\n console.log(` ${ui.muted(`[${i + 1}]`)}${marker} ${label}`);\n }\n console.log('');\n}\n\nfunction readPipedLine(): Promise<string> {\n if (!pipedLinesPromise) {\n pipedLinesPromise = new Promise((resolve) => {\n let data = '';\n stdin.setEncoding('utf8');\n stdin.on('data', (chunk) => {\n data += chunk;\n });\n stdin.on('end', () => {\n resolve(data.split(/\\r?\\n/));\n });\n stdin.on('error', () => {\n resolve([]);\n });\n });\n }\n\n return pipedLinesPromise.then((lines) => lines[pipedLineIndex++] ?? '');\n}\n\nfunction renderActions(actions: SelectAction[], active: number | null, width: number): string {\n return actions\n .map((action, index) => {\n const label = truncatePlain(\n stripAnsi(action.label),\n Math.max(8, Math.floor(width / actions.length) - 8)\n );\n if (action.disabled) return `${ui.border('[')} ${ui.muted(label)} ${ui.border(']')}`;\n if (active === index)\n return `${ui.primary('›')} ${ui.primary('[')} ${ui.text.bold(label)} ${ui.primary(']')} ${ui.primary('‹')}`;\n return `${ui.border('[')} ${ui.primary(label)} ${ui.border(']')}`;\n })\n .join(` ${ui.muted('·')} `);\n}\n\nfunction actionIndexAtX(\n actions: SelectAction[],\n mouseX: number,\n panelLeftCol: number,\n inner: number\n): number | null {\n if (actions.length === 0) return null;\n const contentStart = panelLeftCol + 2;\n const relative = mouseX - contentStart;\n if (relative < 0 || relative > inner) return null;\n return Math.min(actions.length - 1, Math.floor((relative / Math.max(1, inner)) * actions.length));\n}\n\nfunction labelForValue(value: string, options: SelectOption[], actions: SelectAction[]): string {\n return stripAnsi(\n options.find((option) => option.value === value)?.label ||\n actions.find((action) => action.value === value)?.label ||\n value\n );\n}\n\ntype MouseEventInfo =\n | { kind: 'click'; x: number; y: number }\n | { kind: 'hover'; x: number; y: number }\n | { kind: 'wheel-up'; x: number; y: number }\n | { kind: 'wheel-down'; x: number; y: number };\n\nfunction renderOption(option: SelectOption, selected: boolean, width: number): string {\n const plain = truncatePlain(stripAnsi(option.label), Math.max(10, width - 12));\n if (option.disabled) {\n return `${ui.border('[')} ${ui.muted(plain)} ${ui.border(']')}`;\n }\n if (selected) {\n return `${ui.primary('›')} ${ui.primary('[')} ${ui.text.bold(plain)} ${ui.primary(']')} ${ui.primary('‹')}`;\n }\n return `${ui.muted(' ')} ${ui.border('[')} ${ui.muted(plain)} ${ui.border(']')} ${ui.muted(' ')}`;\n}\n\nfunction enterInteractiveScreen(enableMouse: boolean): void {\n stdout.write('\\x1B[?1049h' + '\\x1B[2J' + '\\x1B[H' + '\\x1B[?25l');\n if (enableMouse) {\n stdout.write('\\x1B[?1006h' + '\\x1B[?1000h' + '\\x1B[?1002h' + '\\x1B[?1003h');\n }\n}\n\nfunction leaveInteractiveScreen(): void {\n stdout.write(\n '\\x1B[?1003l' + '\\x1B[?1002l' + '\\x1B[?1000l' + '\\x1B[?1006l' + '\\x1B[?25h' + '\\x1B[?1049l'\n );\n}\n\nfunction parseMouseEvent(chunk: Buffer): MouseEventInfo | null {\n const text = chunk.toString('utf-8');\n const match = text.match(/\\x1B\\[<(\\d+);(\\d+);(\\d+)([mM])/);\n if (!match) return parseLegacyMouseEvent(text);\n\n const code = Number(match[1]);\n const x = Number(match[2]);\n const y = Number(match[3]);\n const state = match[4];\n if (code === 64) return { kind: 'wheel-up', x, y };\n if (code === 65) return { kind: 'wheel-down', x, y };\n if (state === 'm') return { kind: 'click', x, y };\n if ((code & 32) === 32 || code === 35) return { kind: 'hover', x, y };\n if ((code & 3) === 0) return { kind: 'hover', x, y };\n return null;\n}\n\nfunction parseLegacyMouseEvent(text: string): MouseEventInfo | null {\n const match = text.match(/\\x1B\\[M([\\s\\S])([\\s\\S])([\\s\\S])/);\n if (!match) return null;\n\n const code = match[1].charCodeAt(0) - 32;\n const x = match[2].charCodeAt(0) - 32;\n const y = match[3].charCodeAt(0) - 32;\n\n if (code === 64) return { kind: 'wheel-up', x, y };\n if (code === 65) return { kind: 'wheel-down', x, y };\n if ((code & 3) === 3) return { kind: 'click', x, y };\n if ((code & 32) === 32) return { kind: 'hover', x, y };\n return { kind: 'hover', x, y };\n}\n\nfunction writeAt(row: number, col: number, text: string): void {\n stdout.write(`\\x1B[${row};${col}H${text}`);\n}\n\nfunction isTerminalSequence(str: string, key: readline.Key): boolean {\n return (\n str.includes('\\x1B') || !!key.sequence?.includes('\\x1B') || /^(?:\\d+;){2}\\d+[mM]$/.test(str)\n );\n}\n\nfunction cleanInputValue(value: string): string {\n return value\n .replace(/\\x1B\\[<\\d+;\\d+;\\d+[mM]/g, '')\n .replace(/\\x1B\\[[0-?]*[ -/]*[@-~]/g, '')\n .replace(/(?:\\d+;){2}\\d+[mM]/g, '')\n .replace(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]/g, '');\n}\n","import path from 'path';\nimport crypto from 'crypto';\nimport { URL } from 'url';\nimport type { PlatformHandler } from '../platforms/types.js';\n\ninterface AssetEntry {\n localPath: string;\n}\n\nexport class AssetMap {\n entries: Map<string, AssetEntry> = new Map();\n buffers: Map<string, Buffer> = new Map();\n\n localPathFor(urlStr: string, platform?: PlatformHandler): string | null {\n if (this.entries.has(urlStr)) return this.entries.get(urlStr)!.localPath;\n\n let parsed: URL;\n try {\n parsed = new URL(urlStr);\n } catch {\n return null;\n }\n\n const host: string = parsed.hostname;\n const pathname: string = parsed.pathname;\n const ext: string = path.extname(pathname.split('?')[0]).toLowerCase();\n\n let dir: string | null = null;\n\n if (platform) {\n dir = platform.mapAssetDir(host, pathname, ext);\n }\n\n if (!dir) {\n dir = this.fallbackDir(host, ext);\n }\n\n let filename: string;\n const baseName: string = path.basename(pathname.split('?')[0]);\n const hash: string = crypto.createHash('md5').update(urlStr).digest('hex').slice(0, 6);\n\n if (baseName && baseName.length > 1 && baseName !== '/') {\n const clean: string = baseName.replace(/[^a-zA-Z0-9._-]/g, '_');\n filename = clean.includes('.') ? clean : `${clean}-${hash}`;\n } else {\n filename = `asset-${hash}${ext || ''}`;\n }\n\n if (ext === '.mjs' || ext === '.js') {\n filename = baseName.replace(/[^a-zA-Z0-9._-]/g, '_');\n }\n\n const localPath: string = `${dir}/${filename}`;\n this.entries.set(urlStr, { localPath });\n\n const base: string = urlStr.split('?')[0];\n if (base !== urlStr && !this.entries.has(base)) {\n this.entries.set(base, { localPath });\n }\n\n return localPath;\n }\n\n rewrite(text: string, fromDir: string = ''): string {\n const sorted = [...this.entries.entries()].sort((a, b) => b[0].length - a[0].length);\n let out: string = text;\n for (const [url, { localPath }] of sorted) {\n const rel: string = fromDir ? path.posix.relative(fromDir, localPath) : localPath;\n out = out.split(url).join(rel);\n if (url.includes('&')) {\n out = out.split(url.replace(/&/g, '&')).join(rel);\n }\n }\n return out;\n }\n\n private fallbackDir(host: string, ext: string): string {\n if (host.includes('fonts.gstatic.com') || host.includes('fonts.googleapis.com')) {\n return 'assets/fonts';\n }\n return ext === '.mjs' || ext === '.js' ? 'scripts/vendor' : 'assets/misc';\n }\n}\n","import type { Config } from '../types.js';\n\nexport const CFG: Config = {\n viewport: { width: 1440, height: 900 },\n timeout: 90000,\n scrollStep: 250,\n scrollDelay: 60,\n concurrency: 12,\n retries: 3,\n dlTimeout: 30000,\n sharedStripDomains: [\n 'sentry.io', 'www.googletagmanager.com', 'connect.facebook.net',\n 'stats.g.doubleclick.net',\n 'google-analytics.com',\n ],\n};\n","import https from 'https';\nimport http from 'http';\nimport { URL } from 'url';\nimport { CFG } from '../config/index.js';\n\nexport function dlBuffer(url: string, retries: number = CFG.retries): Promise<Buffer> {\n return new Promise((resolve, reject) => {\n const proto = url.startsWith('https') ? https : http;\n const go = (left: number): void => {\n const req = proto.get(url, { timeout: CFG.dlTimeout }, (res) => {\n if (res.statusCode! >= 300 && res.statusCode! < 400 && res.headers.location) {\n return dlBuffer(new URL(res.headers.location, url).href, left).then(resolve, reject);\n }\n if (res.statusCode !== 200) {\n return left > 1\n ? setTimeout(() => go(left - 1), 500)\n : reject(new Error(`HTTP ${res.statusCode}`));\n }\n const ch: Buffer[] = [];\n res.on('data', (c: Buffer) => ch.push(c));\n res.on('end', () => resolve(Buffer.concat(ch)));\n res.on('error', (e: Error) => (left > 1 ? setTimeout(() => go(left - 1), 500) : reject(e)));\n });\n req.on('error', (e: Error) => (left > 1 ? setTimeout(() => go(left - 1), 500) : reject(e)));\n req.on('timeout', () => {\n req.destroy();\n left > 1 ? setTimeout(() => go(left - 1), 500) : reject(new Error('Timeout'));\n });\n };\n go(retries);\n });\n}\n","import chalk from 'chalk';\nimport type { CookingSpinner } from '../cli/cooking.js';\nimport { THEME } from '../cli/theme.js';\n\nlet _cooking: CookingSpinner | null = null;\n\nexport function setCooking(spinner: CookingSpinner | null): void {\n _cooking = spinner;\n}\n\nconst T = (): string => new Date().toISOString().slice(11, 19);\n\nfunction trunc(text: string, max: number): string {\n if (text.length <= max) return text;\n return text.slice(0, max - 2) + '..';\n}\n\nfunction output(line: string): void {\n if (_cooking) _cooking.log(line);\n else console.log(line);\n}\n\nconst LOG_PALETTE: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.primary)(s),\n (s) => chalk.hex(THEME.primarySoft)(s),\n (s) => chalk.hex(THEME.secondary)(s),\n (s) => chalk.hex(THEME.accent)(s),\n (s) => chalk.hex(THEME.info)(s),\n (s) => chalk.hex(THEME.text)(s),\n];\nlet _li = 0;\n\nexport const log = (m: string): void => {\n _li++;\n const c = LOG_PALETTE[_li % LOG_PALETTE.length];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.primary)('[log]')} ${c(trunc(m, 120))}`\n );\n};\n\nconst INFO_PALETTE: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.info)(s),\n (s) => chalk.hex(THEME.secondary)(s),\n (s) => chalk.hex(THEME.primarySoft)(s),\n];\nlet _ii = 0;\n\nexport const info = (m: string): void => {\n _ii++;\n const c = INFO_PALETTE[_ii % INFO_PALETTE.length];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.info).bold('[info]')} ${c(trunc(m, 120))}`\n );\n};\n\nexport const warn = (m: string): void => {\n const colors: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.warning)(s),\n (s) => chalk.hex(THEME.primary)(s),\n ];\n const c = colors[Math.floor(Math.random() * colors.length)];\n const line = `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.warning).bold('[warn]')} ${c(trunc(m, 120))}`;\n if (_cooking) _cooking.log(line);\n else console.warn(line);\n};\n\nexport const success = (m: string): void => {\n const colors: Array<(s: string) => string> = [\n (s) => chalk.hex(THEME.success)(s),\n (s) => chalk.hex(THEME.info)(s),\n ];\n const c = colors[Math.floor(Math.random() * colors.length)];\n output(\n `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.success)('[ok]')} ${c(trunc(m, 120))}`\n );\n};\n\nexport const error = (m: string): void => {\n const colors: Array<(s: string) => string> = [(s) => chalk.hex(THEME.error)(s)];\n const c = colors[Math.floor(Math.random() * colors.length)];\n const line = `${chalk.hex(THEME.muted)(`[${T()}]`)} ${chalk.hex(THEME.error)('[error]')} ${c(trunc(m, 120))}`;\n if (_cooking) _cooking.log(line);\n else console.error(line);\n};\n","import type { Page } from 'puppeteer';\nimport { ui } from '../cli/theme.js';\n\nexport type AntiBotType = 'cloudflare' | 'captcha' | 'waf';\n\n/**\n * Thrown when a bot-protection challenge (Cloudflare, captcha, WAF) prevents a\n * clean export. Never fail silently: the CLI catches this and prints a clear,\n * actionable message, and the partial output directory is removed.\n */\nexport class AntiBotError extends Error {\n readonly type: AntiBotType;\n readonly platform: string;\n readonly url: string;\n\n constructor(type: AntiBotType, platform: string, url: string, message?: string) {\n super(message || `Anti-bot protection detected (${type})`);\n this.name = 'AntiBotError';\n this.type = type;\n this.platform = platform;\n this.url = url;\n }\n}\n\n/**\n * Detect a challenge from a raw HTML string (SSR response). This is advisory\n * only — a plain fetch is often challenged even when headless Chromium passes,\n * so we never hard-fail on this alone.\n */\nexport function detectAntiBotHtml(html: string): AntiBotType | null {\n if (!html) return null;\n\n if (\n /<title>\\s*Just a moment/i.test(html) ||\n /cf-browser-verification|cf-challenge-running|cf_chl_opt|challenge-platform/i.test(html) ||\n /Attention Required!\\s*\\|\\s*Cloudflare/i.test(html) ||\n /Checking if the site connection is secure/i.test(html)\n ) {\n return 'cloudflare';\n }\n\n if (/class=\"g-recaptcha\"|h-captcha|hcaptcha\\.com|challenges\\.cloudflare\\.com\\/turnstile/i.test(html)) {\n return 'captcha';\n }\n\n return null;\n}\n\n/**\n * Authoritative check on the live Puppeteer page after navigation + settle.\n * If headless Chromium is *also* blocked, the export genuinely cannot proceed.\n */\nexport async function detectAntiBotPage(page: Page): Promise<AntiBotType | null> {\n try {\n const title = await page.title();\n if (/just a moment/i.test(title) || /attention required/i.test(title)) {\n return 'cloudflare';\n }\n\n const flagged: string = await page.evaluate(() => {\n if (document.querySelector('iframe[src*=\"challenges.cloudflare.com\"]')) return 'cloudflare';\n if (\n document.querySelector(\n '.g-recaptcha, .h-captcha, iframe[src*=\"hcaptcha.com\"], iframe[src*=\"recaptcha\"]'\n )\n ) {\n return 'captcha';\n }\n const body = document.body ? document.body.innerText || '' : '';\n const outer = document.documentElement.outerHTML || '';\n if (body.trim().length < 120 && /cf-chl|cloudflare|cf-browser-verification/i.test(outer)) {\n return 'cloudflare';\n }\n return '';\n });\n\n return (flagged as AntiBotType) || null;\n } catch {\n return null;\n }\n}\n\n/** Build the user-facing CLI message for an AntiBotError. */\nexport function formatAntiBotError(err: AntiBotError): string {\n const label =\n err.type === 'cloudflare'\n ? 'Cloudflare (browser challenge)'\n : err.type === 'captcha'\n ? 'a captcha challenge'\n : 'a WAF / bot filter';\n\n const lines: string[] = [\n '',\n ` ${ui.error('✗')} ${ui.error.bold('EXPORT BLOCKED')} — ${err.platform} is protected by ${label}.`,\n '',\n ` ${ui.muted('The headless browser could not pass the verification, so nothing was exported.')}`,\n '',\n ` ${ui.text.bold(' What you can try:')}`,\n ` ${ui.muted(' 1.')} Retry in a few minutes — the challenge often expires.`,\n ` ${ui.muted(' 2.')} Use an alternative, non-protected canonical URL if one exists.`,\n ` ${ui.muted(' 3.')} Export from a network/IP the site trusts more.`,\n '',\n ` ${ui.muted('No files were written.')} ${ui.muted('(A stealth-browser mode is on the roadmap.)')}`,\n '',\n ];\n return lines.join('\\n');\n}\n","import puppeteer, { type Page } from 'puppeteer';\nimport { CFG } from '../config/index.js';\nimport { log, success, info } from '../logger/index.js';\nimport { detectByDom } from '../platforms/index.js';\nimport { detectAntiBotPage, AntiBotError } from './anti-bot.js';\nimport type { ExporterContext } from '../types.js';\n\nexport async function launchAndCapture(exporter: ExporterContext): Promise<void> {\n exporter.cooking?.update('Launching browser...');\n log('Launching headless Chromium...');\n\n exporter.browser = await puppeteer.launch({\n headless: true,\n args: ['--no-sandbox', '--disable-setuid-sandbox'],\n });\n success('Chromium launched');\n\n exporter.page = await exporter.browser.newPage();\n await exporter.page.setViewport(CFG.viewport);\n log('Viewport set to ' + CFG.viewport.width + 'x' + CFG.viewport.height);\n\n await exporter.page.setUserAgent(\n 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +\n '(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'\n );\n log('User agent set to Chrome 131');\n\n const allStripDomains: string[] = [\n ...CFG.sharedStripDomains,\n ...exporter.platform.stripDomains,\n ];\n log('Blocking ' + allStripDomains.length + ' tracking domains:');\n for (const domain of allStripDomains) {\n log(' - ' + domain);\n }\n\n let intercepted = 0;\n let blocked = 0;\n\n exporter.page.on('response', async (res) => {\n const url: string = res.url();\n if (url.startsWith('data:') || url.startsWith('blob:')) return;\n\n try {\n const host: string = new URL(url).hostname;\n if (allStripDomains.some((d) => host.includes(d))) {\n blocked++;\n return;\n }\n } catch {\n return;\n }\n\n exporter.assets.localPathFor(url, exporter.platform);\n try {\n exporter.assets.buffers.set(url, await res.buffer());\n intercepted++;\n } catch {}\n });\n\n log('Network interception enabled');\n\n exporter.cooking?.update('Navigating to site...');\n info('Navigating to ' + exporter.siteUrl);\n await exporter.page.goto(exporter.siteUrl, {\n waitUntil: 'networkidle2',\n timeout: CFG.timeout,\n });\n success('Page loaded (networkidle2)');\n log('Intercepted ' + intercepted + ' resources, blocked ' + blocked + ' tracking requests');\n\n log('Checking DOM-based platform detection...');\n const domDetected = await detectByDom(exporter.page);\n if (domDetected && domDetected.name !== exporter.platform.name) {\n log('Platform refined from DOM: ' + domDetected.displayName + ' (override: ' + exporter.platform.name + ')');\n exporter.platform = domDetected;\n }\n\n // Fail fast and loudly if a bot-protection challenge is blocking the page.\n const antiBot = await detectAntiBotPage(exporter.page);\n if (antiBot) {\n throw new AntiBotError(antiBot, exporter.platform.displayName, exporter.siteUrl);\n }\n\n if (exporter.platform.preCapture) {\n try {\n exporter.cooking?.update('Preparing ' + exporter.platform.displayName + ' page...');\n await exporter.platform.preCapture(exporter.page);\n log('preCapture hook completed');\n } catch (e) {\n log('preCapture hook error (continuing): ' + (e as Error).message);\n }\n }\n\n exporter.cooking?.update('Waiting for ' + exporter.platform.displayName + ' hydration...');\n\n if (exporter.platform.needsHydrationCheck) {\n const sel: string = exporter.platform.hydrationSelector || '#main';\n log('Checking for ' + sel + ' element hydration...');\n log('Hydration timeout: ' + exporter.platform.hydrationTimeout + 'ms');\n const timeout = exporter.platform.hydrationTimeout;\n await exporter.page.evaluate(`\n new Promise(function(r) {\n var start = Date.now();\n var tick = function() {\n var m = document.querySelector(${JSON.stringify(sel)}) || document.body;\n if (m && m.children.length > 0) setTimeout(r, 2000);\n else if (Date.now() - start > ${timeout}) r();\n else setTimeout(tick, 200);\n };\n tick();\n })\n `);\n success('Hydration complete (SPA rendered)');\n } else {\n log('Static site detected, waiting ' + exporter.platform.hydrationTimeout + 'ms for render...');\n await new Promise<void>((r) => setTimeout(r, exporter.platform.hydrationTimeout));\n success(exporter.platform.displayName + ' page rendered');\n }\n\n const scrollStrategy = exporter.platform.scrollStrategy || 'standard';\n if (scrollStrategy === 'none') {\n log('Scroll skipped (scrollStrategy: none)');\n } else {\n exporter.cooking?.update('Scrolling page...');\n log('Starting full-page scroll (step: ' + CFG.scrollStep + 'px, delay: ' + CFG.scrollDelay + 'ms)');\n\n const scrollStep = CFG.scrollStep;\n const scrollDelay = CFG.scrollDelay;\n\n const pageHeight: number = (await exporter.page.evaluate(`\n Math.max(document.body.scrollHeight, document.documentElement.scrollHeight)\n `)) as number;\n log('Page height: ' + pageHeight + 'px (' + Math.ceil(pageHeight / scrollStep) + ' scroll steps)');\n\n const passes = scrollStrategy === 'infinite' ? 3 : 1;\n for (let pass = 0; pass < passes; pass++) {\n await exporter.page.evaluate(`\n new Promise(function(r) {\n var y = 0;\n var max = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n var step = function() {\n y += ${scrollStep};\n window.scrollTo({ top: y, behavior: 'instant' });\n y < max + 500 ? setTimeout(step, ${scrollDelay}) : (window.scrollTo(0, 0), r());\n };\n step();\n })\n `);\n if (scrollStrategy === 'infinite' && pass < passes - 1) {\n await new Promise<void>((r) => setTimeout(r, 1000));\n }\n }\n success('Full-page scroll complete');\n }\n\n exporter.cooking?.update('Waiting for lazy resources...');\n log('Waiting 2s for lazy-loaded resources...');\n await new Promise<void>((r) => setTimeout(r, 2000));\n\n log('Checking network idle (1.5s quiet, 8s timeout)...');\n try {\n await exporter.page.waitForNetworkIdle({ idleTime: 1500, timeout: 8000 });\n success('Network idle confirmed');\n } catch {\n log('Network idle timeout reached (continuing anyway)');\n }\n\n // SPA/React platforms have an empty SSR body — use the rendered DOM instead.\n if (exporter.platform.captureRenderedDom) {\n try {\n const rendered: string = await exporter.page.evaluate(\n () => '<!DOCTYPE html>\\n' + document.documentElement.outerHTML\n );\n if (rendered && rendered.length > 200) {\n exporter.ssrHTML = rendered;\n log('Captured rendered DOM as HTML source (' + (rendered.length / 1024).toFixed(1) + ' KB)');\n }\n } catch (e) {\n log('Rendered DOM capture failed (keeping SSR HTML): ' + (e as Error).message);\n }\n }\n\n const totalCaptured: number = exporter.assets.buffers.size;\n success('Captured ' + totalCaptured + ' network resources total');\n\n const cssCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.endsWith('.css')).length;\n const jsCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.endsWith('.js') || e.localPath.endsWith('.mjs')).length;\n const imgCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.startsWith('assets/images')).length;\n const fontCount: number = [...exporter.assets.entries.values()].filter((e) => e.localPath.startsWith('assets/fonts')).length;\n log(' CSS: ' + cssCount + ' | JS: ' + jsCount + ' | Images: ' + imgCount + ' | Fonts: ' + fontCount);\n}\n\nexport async function closeBrowser(exporter: { browser: import('puppeteer').Browser | null }): Promise<void> {\n if (exporter.browser) {\n await exporter.browser.close();\n exporter.browser = null;\n log('Browser closed');\n }\n}\n\nexport async function captureSubpage(\n page: Page,\n url: string,\n platform: { needsHydrationCheck: boolean; hydrationTimeout: number }\n): Promise<string> {\n log(' Navigating to sub-page: ' + url);\n await page.goto(url, { waitUntil: 'networkidle2', timeout: CFG.timeout });\n\n if (platform.needsHydrationCheck) {\n await page.evaluate(\n `new Promise(function(r) {\n var t = Date.now();\n (function tick() {\n var m = document.getElementById('main') || document.body;\n if (m && m.children.length > 0) setTimeout(r, 500);\n else if (Date.now() - t > ${platform.hydrationTimeout}) r();\n else setTimeout(tick, 200);\n })();\n })`\n );\n } else {\n await new Promise<void>((r) => setTimeout(r, 1000));\n }\n\n const html: string = await page.evaluate(() => document.documentElement.outerHTML || document.body.innerHTML);\n log(' Sub-page fetched: ' + (html.length / 1024).toFixed(1) + ' KB');\n return html;\n}\n","export async function pool(tasks: Array<() => Promise<void>>, n: number): Promise<void> {\n let i = 0;\n const run = async (): Promise<void> => {\n while (i < tasks.length) {\n const j = i++;\n await tasks[j]();\n }\n };\n await Promise.all(Array.from({ length: Math.min(n, tasks.length) }, () => run()));\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { CFG } from '../config/index.js';\nimport { log, warn, success } from '../logger/index.js';\nimport { dlBuffer } from '../network/download.js';\nimport { pool } from '../network/pool.js';\nimport type { ExporterContext } from '../types.js';\n\nexport async function downloadAll(exporter: ExporterContext): Promise<void> {\n const seen: Set<string> = new Set();\n const toDownload: Array<{ url: string; localPath: string }> = [];\n for (const [url, { localPath }] of exporter.assets.entries) {\n if (seen.has(localPath)) continue;\n seen.add(localPath);\n toDownload.push({ url, localPath });\n }\n\n const total: number = toDownload.length;\n log('Starting download of ' + total + ' unique assets');\n log('Concurrency: ' + CFG.concurrency + ' parallel downloads');\n log('Retry policy: ' + CFG.retries + ' attempts, ' + CFG.dlTimeout + 'ms timeout');\n\n let ok = 0;\n let cached = 0;\n let fail = 0;\n let completed = 0;\n let lastReported = 0;\n\n const tasks: Array<() => Promise<void>> = toDownload.map(\n ({ url, localPath }) =>\n async (): Promise<void> => {\n const dest: string = path.join(exporter.outDir, localPath);\n await fs.mkdir(path.dirname(dest), { recursive: true });\n\n try {\n const buf: Buffer | undefined =\n exporter.assets.buffers.get(url) ||\n exporter.assets.buffers.get(url.split('?')[0]);\n if (buf) {\n await fs.writeFile(dest, buf);\n cached++;\n ok++;\n } else {\n const data: Buffer = await dlBuffer(url);\n await fs.writeFile(dest, data);\n ok++;\n }\n } catch (e) {\n fail++;\n if (\n !url.includes('framer.com/edit') &&\n !url.includes('framerstatic.com/editorbar')\n ) {\n warn('Download failed: ' + path.basename(localPath) + ' - ' + (e as Error).message);\n }\n }\n\n completed++;\n const pct: number = Math.floor((completed / total) * 100);\n if (pct >= lastReported + 10 || completed === total) {\n exporter.cooking?.update('Downloading... ' + completed + '/' + total + ' (' + pct + '%)');\n log('Download progress: ' + completed + '/' + total + ' (' + pct + '%)');\n lastReported = pct;\n }\n }\n );\n\n await pool(tasks, CFG.concurrency);\n\n success('Downloads complete: ' + ok + ' succeeded, ' + cached + ' from cache, ' + fail + ' failed');\n\n const totalBytes: number = [...exporter.assets.entries.values()].length;\n log('Total unique assets written to disk: ' + totalBytes);\n\n exporter.assets.buffers.clear();\n log('Network buffer cache cleared');\n}\n","import prettier from 'prettier';\n\nexport async function prettifyJS(src: string): Promise<string> {\n try {\n return await prettier.format(src, {\n parser: 'babel',\n printWidth: 100,\n tabWidth: 2,\n useTabs: false,\n semi: true,\n singleQuote: false,\n trailingComma: 'es5',\n bracketSpacing: true,\n arrowParens: 'always',\n });\n } catch {\n return src;\n }\n}\n","export const SERVE_SCRIPT: string = `#!/usr/bin/env node\nimport http from 'node:http';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst PORT = process.env.PORT || 3000;\nconst ROOT = path.dirname(fileURLToPath(import.meta.url));\n\nconst MIME = {\n '.html': 'text/html; charset=utf-8',\n '.css': 'text/css; charset=utf-8',\n '.js': 'application/javascript; charset=utf-8',\n '.mjs': 'application/javascript; charset=utf-8',\n '.json': 'application/json; charset=utf-8',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.webp': 'image/webp',\n '.avif': 'image/avif',\n '.ico': 'image/x-icon',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n '.ttf': 'font/ttf',\n '.otf': 'font/otf',\n '.mp4': 'video/mp4',\n '.webm': 'video/webm',\n '.ogg': 'video/ogg',\n '.framercms': 'application/octet-stream',\n};\n\nconst server = http.createServer((req, res) => {\n let url = decodeURIComponent(req.url.split('?')[0]);\n if (url === '/') url = '/index.html';\n\n let filePath = path.join(ROOT, url);\n if (!filePath.startsWith(ROOT)) {\n res.writeHead(403);\n res.end('Forbidden');\n return;\n }\n\n const serveFile = (pathToFile) => {\n fs.readFile(pathToFile, (err, data) => {\n if (err) {\n // SPA Fallback: if it's not a file, serve index.html\n if (url !== '/index.html' && !path.extname(url)) {\n return serveFile(path.join(ROOT, 'index.html'));\n }\n res.writeHead(404);\n res.end('Not found');\n return;\n }\n const ext = path.extname(pathToFile).toLowerCase();\n const mime = MIME[ext] || 'application/octet-stream';\n res.writeHead(200, {\n 'Content-Type': mime,\n 'Access-Control-Allow-Origin': '*',\n 'Cache-Control': 'public, max-age=3600',\n });\n res.end(data);\n });\n };\n\n serveFile(filePath);\n});\n\nconst ANSI = {\n reset: '\\\\x1b[0m',\n primary: '\\\\x1b[38;2;250;178;131m',\n soft: '\\\\x1b[38;2;255;192;159m',\n text: '\\\\x1b[38;2;238;238;238m',\n muted: '\\\\x1b[38;2;128;128;128m',\n border: '\\\\x1b[38;2;72;72;72m',\n success: '\\\\x1b[38;2;127;216;143m',\n info: '\\\\x1b[38;2;86;182;194m',\n accent: '\\\\x1b[38;2;157;124;216m',\n warning: '\\\\x1b[38;2;245;167;66m',\n command: '\\\\x1b[38;2;255;192;159m',\n error: '\\\\x1b[38;2;224;108;117m',\n};\n\nfunction color(name, value) {\n return ANSI[name] + value + ANSI.reset;\n}\n\nfunction fitValue(value, width) {\n const text = String(value);\n if (text.length <= width) return text;\n if ((text.includes('\\\\\\\\') || text.includes('/')) && width > 12) {\n const separator = text.includes('\\\\\\\\') ? '\\\\\\\\' : '/';\n const prefix = text.startsWith(separator) ? separator : '';\n const parts = text.split(/[\\\\\\\\/]+/).filter(Boolean);\n const compact = prefix + parts.map((part, index) => {\n if (index === parts.length - 1) return part;\n if (/^[A-Za-z]:$/.test(part)) return part;\n return part.length > 5 ? part.slice(0, 3) + '..' : part;\n }).join(separator);\n if (compact.length <= width) return compact;\n const tail = Math.max(8, Math.floor(width * 0.45));\n const head = Math.max(0, width - tail - 4);\n return compact.slice(0, head) + separator + '..' + separator + compact.slice(-tail);\n }\n return width <= 3 ? '.'.repeat(Math.max(0, width)) : text.slice(0, width - 2) + '..';\n}\n\nfunction frameLine(label, value, colorName = 'text') {\n const labelText = label.padEnd(10);\n const valueWidth = Math.max(0, 56 - labelText.length);\n const shown = fitValue(value, valueWidth);\n const pad = Math.max(0, 56 - labelText.length - shown.length);\n console.log(' ' + color('border', '│ ') + color('muted', labelText) + color(colorName, shown) + ' '.repeat(pad) + color('border', ' │'));\n}\n\nfunction drawServerUi() {\n console.log('');\n console.log(' ' + color('border', '╭─' + '─'.repeat(56) + '─╮'));\n console.log(' ' + color('border', '│ ') + color('text', ' Framer Export preview server') + ' '.repeat(26) + color('border', ' │'));\n console.log(' ' + color('border', '├─' + '─'.repeat(56) + '─┤'));\n frameLine('URL', 'http://localhost:' + PORT, 'primary');\n frameLine('Root', ROOT, 'soft');\n frameLine('Run', 'node serve.js', 'command');\n frameLine('Mode', 'static mirror + SPA fallback', 'accent');\n console.log(' ' + color('border', '╰─' + '─'.repeat(56) + '─╯'));\n console.log('');\n console.log(' ' + color('success', 'ready') + color('muted', ' press Ctrl+C to stop') + '\\\\n');\n}\n\nserver.listen(PORT, () => {\n const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];\n const steps = ['Preparing server', 'Checking exported files', 'Binding local port', 'Serving static mirror'];\n const stepColors = ['text', 'info', 'warning', 'success'];\n let i = 0;\n const timer = setInterval(() => {\n const stepIndex = Math.min(steps.length - 1, Math.floor(i / 6));\n const step = steps[stepIndex];\n const dots = color('error', '.'.repeat(i % 4).padEnd(3, ' '));\n process.stdout.write('\\\\r\\\\x1B[2K ' + color('primary', frames[i % frames.length]) + ' ' + color(stepColors[stepIndex], step) + dots);\n i++;\n }, 80);\n\n setTimeout(() => {\n clearInterval(timer);\n process.stdout.write('\\\\r\\\\x1B[2K');\n drawServerUi();\n }, 1280);\n});\n`;\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { log, warn, success } from '../logger/index.js';\nimport { prettifyJS } from '../formatter/prettify.js';\nimport { SERVE_SCRIPT } from '../server/template.js';\nimport type { ExporterContext } from '../types.js';\n\nfunction escapeRegex(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nfunction stripBySelector(html: string, sel: string): string {\n if (sel.includes('[src*=\"')) {\n const match = sel.match(/\\[src\\*=\"([^\"]+)\"\\]/);\n if (match) {\n const domain: string = escapeRegex(match[1]);\n html = html.replace(new RegExp(`<script[^>]*${domain}[^>]*>[^<]*<\\\\/script>`, 'g'), '');\n html = html.replace(new RegExp(`<script[^>]*${domain}[^>]*><\\\\/script>`, 'g'), '');\n }\n } else if (sel.includes('[href*=\"')) {\n const match = sel.match(/\\[href\\*=\"([^\"]+)\"\\]/);\n if (match) {\n const href: string = escapeRegex(match[1]);\n html = html.replace(new RegExp(`<link[^>]*${href}[^>]*>`, 'g'), '');\n }\n } else if (sel.startsWith('.')) {\n const cls: string = escapeRegex(sel.slice(1));\n html = html.replace(\n new RegExp(`<[^>]*class=\"[^\"]*${cls}[^\"]*\"[^>]*>[\\\\s\\\\S]*?<\\\\/[^>]*>`, 'g'),\n ''\n );\n } else if (sel.startsWith('#')) {\n const id: string = sel.slice(1);\n html = removeElementById(html, id);\n }\n return html;\n}\n\nfunction removeElementById(html: string, id: string): string {\n const marker: string = `id=\"${id}\"`;\n let idx: number = html.indexOf(marker);\n while (idx !== -1) {\n const tagStart: number = html.lastIndexOf('<', idx);\n if (tagStart === -1) break;\n\n const tagNameEnd: number = html.indexOf(' ', tagStart + 1);\n const tagName: string = html.slice(tagStart + 1, tagNameEnd).toLowerCase();\n\n let depth = 0;\n let i: number = tagStart;\n while (i < html.length) {\n if (\n html.startsWith(`<${tagName}`, i) &&\n (html[i + tagName.length + 1] === ' ' || html[i + tagName.length + 1] === '>')\n ) {\n depth++;\n i += tagName.length + 1;\n } else if (html.startsWith(`</${tagName}>`, i)) {\n depth--;\n if (depth === 0) {\n html = html.slice(0, tagStart) + html.slice(i + tagName.length + 3);\n break;\n }\n i += tagName.length + 3;\n } else {\n i++;\n }\n }\n\n idx = html.indexOf(marker);\n }\n return html;\n}\n\nfunction processSEO(html: string, url: string): string {\n const canonical = url.split('?')[0].replace(/\\/$/, '');\n\n // Inject Canonical\n if (!html.includes('rel=\"canonical\"')) {\n html = html.replace('</head>', ` <link rel=\"canonical\" href=\"${canonical}\">\\n </head>`);\n }\n\n // Inject Meta Description if missing\n if (!html.includes('name=\"description\"')) {\n html = html.replace(\n '</head>',\n ` <meta name=\"description\" content=\"Exported with Framer Export - Fast, SEO-optimized, and clean.\">\\n </head>`\n );\n }\n\n // Inject OG Tags if missing\n if (!html.includes('property=\"og:')) {\n html = html.replace(\n '</head>',\n ` <meta property=\"og:type\" content=\"website\">\\n <meta property=\"og:url\" content=\"${canonical}\">\\n <meta property=\"og:title\" content=\"Exported Site\">\\n <meta property=\"og:description\" content=\"A fast, clean version of this site, exported for performance.\">\\n </head>`\n );\n }\n\n // Inject Robot tags\n if (!html.includes('name=\"robots\"')) {\n html = html.replace('</head>', ` <meta name=\"robots\" content=\"index, follow\">\\n </head>`);\n }\n\n return html;\n}\n\nfunction stripIntegrityAndCors(html: string): string {\n html = html.replace(/\\s+integrity=\"[^\"]*\"/g, '');\n html = html.replace(/\\s+crossorigin=\"[^\"]*\"/g, '');\n html = html.replace(/\\s+crossorigin/g, '');\n html = html.replace(/<link[^>]*rel=\"preconnect\"[^>]*>/g, '');\n html = html.replace(/<link[^>]*rel=\"dns-prefetch\"[^>]*>/g, '');\n html = html.replace(/<meta[^>]*content-security-policy[^>]*>/gi, '');\n return html;\n}\n\nfunction stripSrcsetCdnUrls(html: string): string {\n html = html.replace(/srcset=\"([^\"]*)\"/g, (_match: string, srcset: string) => {\n const cleaned: string = srcset\n .split(',')\n .map((entry: string) => entry.trim())\n .filter((entry: string) => !entry.startsWith('http'))\n .join(', ');\n return cleaned ? 'srcset=\"' + cleaned + '\"' : '';\n });\n return html;\n}\n\nexport async function buildOutput(exporter: ExporterContext): Promise<void> {\n exporter.cooking?.update('Stripping platform badges...');\n log('Starting HTML post-processing...');\n log('HTML size: ' + (exporter.ssrHTML.length / 1024).toFixed(1) + ' KB');\n\n let html: string = exporter.ssrHTML;\n if (!html) {\n warn('No SSR HTML available, cannot build output');\n return;\n }\n\n exporter.cooking?.update('Removing integrity checks...');\n const beforeIntegrity: number = html.length;\n html = stripIntegrityAndCors(html);\n log('Stripped integrity/crossorigin/preconnect (' + (beforeIntegrity - html.length) + ' chars)');\n success('Integrity and CORS restrictions removed');\n\n if (typeof processSEO === 'function') {\n exporter.cooking?.update('Optimizing SEO...');\n html = processSEO(html, exporter.siteUrl);\n success('SEO meta tags optimized');\n }\n\n log('Stripping ' + exporter.platform.stripSelectors.length + ' selectors:');\n for (const sel of exporter.platform.stripSelectors) {\n const before: number = html.length;\n html = stripBySelector(html, sel);\n const removed: number = before - html.length;\n if (removed > 0) {\n log(' Stripped ' + sel + ' (' + removed + ' chars removed)');\n }\n }\n\n log('Applying ' + exporter.platform.stripPatterns.length + ' regex patterns...');\n for (const pattern of exporter.platform.stripPatterns) {\n const before: number = html.length;\n html = html.replace(new RegExp(pattern.source, pattern.flags), '');\n const removed: number = before - html.length;\n if (removed > 0) {\n log(' Pattern removed ' + removed + ' chars');\n }\n }\n if (exporter.platform.stripScripts && exporter.platform.stripScripts.length > 0) {\n log('Applying ' + exporter.platform.stripScripts.length + ' script-strip patterns...');\n for (const pattern of exporter.platform.stripScripts) {\n const before: number = html.length;\n html = html.replace(new RegExp(pattern.source, pattern.flags), '');\n const removed: number = before - html.length;\n if (removed > 0) log(' Script pattern removed ' + removed + ' chars');\n }\n }\n\n success('Platform badges and tracking stripped');\n\n if (exporter.platform.postCapture) {\n try {\n const before: number = html.length;\n html = exporter.platform.postCapture(html, exporter);\n log('postCapture hook applied (delta ' + (html.length - before) + ' chars)');\n } catch (e) {\n warn('postCapture hook failed: ' + (e as Error).message);\n }\n }\n\n exporter.cooking?.update('Rewriting asset URLs...');\n log('Rewriting ' + exporter.assets.entries.size + ' CDN URLs to local paths...');\n const beforeRewrite: number = html.length;\n html = exporter.assets.rewrite(html, '');\n log('HTML rewrite delta: ' + (html.length - beforeRewrite) + ' chars');\n\n if (exporter.platform.rewriteUrlPatterns && exporter.platform.rewriteUrlPatterns.length > 0) {\n for (const { from, to } of exporter.platform.rewriteUrlPatterns) {\n html = html.replace(new RegExp(from.source, from.flags), to);\n }\n log('Applied ' + exporter.platform.rewriteUrlPatterns.length + ' custom URL rewrites');\n }\n\n exporter.cooking?.update('Cleaning srcset references...');\n html = stripSrcsetCdnUrls(html);\n log('Cleaned remaining CDN URLs from srcset attributes');\n\n await rewriteDownloadedFiles(exporter);\n success('All URLs rewritten to local paths');\n\n exporter.cooking?.update('Pretty-printing JS files...');\n await prettifyDownloadedJS(exporter);\n\n exporter.cooking?.update('Writing final output...');\n log('Writing index.html (' + (html.length / 1024).toFixed(1) + ' KB)...');\n await fs.writeFile(path.join(exporter.outDir, 'index.html'), html);\n success('index.html written');\n\n await fs.writeFile(path.join(exporter.outDir, 'serve.js'), SERVE_SCRIPT);\n log('serve.js written');\n await fs.writeFile(\n path.join(exporter.outDir, 'package.json'),\n JSON.stringify({ type: 'module', scripts: { serve: 'node serve.js' } }, null, 2) + '\\n'\n );\n log('package.json written for serve.js');\n success('Output build complete');\n}\n\nasync function rewriteDownloadedFiles(exporter: ExporterContext): Promise<void> {\n const dirs: string[] = ['scripts/vendor', 'scripts/modules', 'styles'];\n let rewritten = 0;\n\n for (const dir of dirs) {\n const fullDir: string = path.join(exporter.outDir, dir);\n let files: string[];\n try {\n files = await fs.readdir(fullDir);\n } catch {\n continue;\n }\n\n for (const file of files) {\n const ext: string = path.extname(file).toLowerCase();\n if (!['.mjs', '.js', '.css'].includes(ext)) continue;\n\n const filePath: string = path.join(fullDir, file);\n try {\n let content: string = await fs.readFile(filePath, 'utf-8');\n const before: string = content;\n content = exporter.assets.rewrite(content, dir);\n if (content !== before) {\n await fs.writeFile(filePath, content);\n rewritten++;\n }\n } catch {}\n }\n }\n log('Rewrote URLs in ' + rewritten + ' JS/CSS files');\n}\n\nasync function prettifyDownloadedJS(exporter: ExporterContext): Promise<void> {\n const dirs: string[] = ['scripts/vendor', 'scripts/modules'];\n let count = 0;\n let total = 0;\n\n for (const dir of dirs) {\n const fullDir: string = path.join(exporter.outDir, dir);\n let files: string[];\n try {\n files = await fs.readdir(fullDir);\n } catch {\n continue;\n }\n\n const jsFiles: string[] = files.filter((f) => {\n const ext: string = path.extname(f).toLowerCase();\n return ext === '.mjs' || ext === '.js';\n });\n total += jsFiles.length;\n\n for (const file of jsFiles) {\n const filePath: string = path.join(fullDir, file);\n try {\n const raw: string = await fs.readFile(filePath, 'utf-8');\n\n const nlRatio: number = (raw.match(/\\n/g) || []).length / raw.length;\n if (nlRatio > 0.05) {\n count++;\n continue;\n }\n\n const pretty: string = await prettifyJS(raw);\n await fs.writeFile(filePath, pretty, 'utf-8');\n count++;\n\n if (count % 5 === 0) {\n exporter.cooking?.update('Pretty-printing... (' + count + '/' + total + ')');\n }\n } catch (e) {\n warn('Pretty-print skipped: ' + file + ' - ' + (e as Error).message);\n count++;\n }\n }\n }\n\n success('Formatted ' + count + '/' + total + ' JS/MJS files');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport type { ExporterContext } from '../types.js';\nimport { boxTop, boxLine, boxBot, boxSep, boxRow, maxWidth } from '../cli/box.js';\nimport { chip, ui } from '../cli/theme.js';\n\nexport async function printSummary(exporter: ExporterContext): Promise<void> {\n const w = maxWidth();\n const isSmall = w < 50;\n\n const count = async (d: string): Promise<number> => {\n try {\n return (await fs.readdir(path.join(exporter.outDir, d))).length;\n } catch {\n return 0;\n }\n };\n const [imgs, fonts, videos, misc, scripts, vendor, styles, data, subpages] = await Promise.all([\n count('assets/images'),\n count('assets/fonts'),\n count('assets/videos'),\n count('assets/misc'),\n count('scripts/modules'),\n count('scripts/vendor'),\n count('styles'),\n count('data'),\n count('subpages'),\n ]);\n\n const G = ui.primary;\n const G2 = ui.primarySoft;\n const C2 = ui.secondary;\n const Y = ui.accent;\n const O = ui.warning;\n const Br = ui.info;\n const Gr = ui.muted;\n const Gn = ui.success;\n\n const entries: Array<[string, number, string, (s: string) => string]> = [\n ['styles/', styles, 'CSS', G],\n ['scripts/vendor/', vendor, 'JS vendor', G2],\n ['scripts/modules/', scripts, 'JS modules', C2],\n ['assets/images/', imgs, 'images', Y],\n ['assets/videos/', videos, 'videos', O],\n ['assets/fonts/', fonts, 'fonts', Br],\n ['assets/misc/', misc, 'misc', Gr],\n ['data/', data, 'data', Gr],\n ['subpages/', subpages, 'pages', Gn],\n ];\n\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, `${ui.text.bold(' Export Summary')} ${chip('done')}`));\n console.log(boxSep(w));\n } else {\n console.log(ui.text.bold(' Export Summary:'));\n }\n\n for (const [label, cnt, type, color] of entries) {\n if (cnt === 0) continue;\n const inner = w - 4;\n const l = label.padEnd(16);\n const c = String(cnt).padStart(3);\n const rowText = `${color(l)}${ui.text(c)} ${ui.muted(type)}`;\n const visible = 16 + 3 + 2 + type.length;\n const pad = Math.max(0, inner - visible);\n if (isSmall) {\n console.log(` ${color(label)} ${ui.text(String(cnt))} ${ui.muted(type)}`);\n } else {\n console.log(' ' + ui.border('│ ') + rowText + ' '.repeat(pad) + ui.border(' │'));\n }\n }\n\n if (!isSmall) {\n console.log(boxBot(w));\n }\n\n console.log('');\n const cdCmd = 'cd ' + path.basename(exporter.outDir);\n const runCmd = 'node serve.js';\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' To serve locally')));\n console.log(boxSep(w));\n console.log(boxRow(w, 'Open', cdCmd));\n console.log(boxRow(w, 'Run', runCmd));\n console.log(boxBot(w));\n } else {\n console.log(ui.text.bold(' To serve locally:'));\n console.log(` ${G(cdCmd)}`);\n console.log(` ${G(runCmd)}`);\n }\n\n console.log('');\n console.log(ui.muted(' note: must be served via HTTP for JS modules to work.'));\n console.log('');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport { stdin, stdout } from 'node:process';\nimport { spawn } from 'node:child_process';\nimport type { ExporterContext } from '../types.js';\nimport { select, type SelectOption } from '../cli/select.js';\nimport { boxTop, boxLine, boxSep, boxBot, maxWidth } from '../cli/box.js';\nimport { stripAnsi, ui } from '../cli/theme.js';\n\ninterface ConversionTarget {\n id: string;\n label: string;\n stack: string;\n projectDir: string;\n staticDir: string;\n scaffold: string;\n entryFiles: string;\n routing: string;\n}\n\ninterface AiTool {\n id: string;\n label: string;\n displayName: string;\n agentName: string;\n}\n\ninterface ConversionGoal {\n id: string;\n label: string;\n instruction: string;\n priority: string;\n}\n\ninterface ExportFacts {\n sourceUrl: string;\n outputDir: string;\n platformName: string;\n rootEntries: string[];\n counts: Record<string, number>;\n}\n\nconst IMPORTANT_DIRS = [\n 'index.html',\n 'styles',\n 'scripts/vendor',\n 'scripts/modules',\n 'assets/images',\n 'assets/videos',\n 'assets/fonts',\n 'assets/misc',\n 'data',\n 'subpages',\n];\n\nconst AI_TOOLS: AiTool[] = [\n {\n id: 'claude-code',\n label: 'Claude Code',\n displayName: 'Claude Code',\n agentName: 'Claude Code',\n },\n {\n id: 'codex',\n label: 'Codex',\n displayName: 'Codex',\n agentName: 'Codex coding agent',\n },\n {\n id: 'opencode',\n label: 'OpenCode',\n displayName: 'OpenCode',\n agentName: 'OpenCode',\n },\n {\n id: 'other-ai',\n label: 'Other AI coding agent',\n displayName: 'Other AI',\n agentName: 'AI coding agent',\n },\n];\n\nconst TARGETS: ConversionTarget[] = [\n {\n id: 'react-vite',\n label: 'React + Vite + TypeScript',\n stack: 'React 18/19, TypeScript, Vite, CSS modules or plain CSS',\n projectDir: 'converted-react-vite',\n staticDir: 'public',\n scaffold: 'npm create vite@latest converted-react-vite -- --template react-ts',\n entryFiles: 'src/main.tsx, src/App.tsx, src/components/*, src/styles/*',\n routing: 'Use React Router only if multiple exported pages exist in subpages/.',\n },\n {\n id: 'nextjs-app-router',\n label: 'Next.js App Router',\n stack: 'Next.js App Router, TypeScript, React Server Components where useful',\n projectDir: 'converted-nextjs',\n staticDir: 'public',\n scaffold: 'npx create-next-app@latest converted-nextjs --ts --app --eslint',\n entryFiles: 'app/page.tsx, app/layout.tsx, components/*, public/*',\n routing: 'Map exported subpages to app routes and keep shared layout code reusable.',\n },\n {\n id: 'vue-vite',\n label: 'Vue + Vite + TypeScript',\n stack: 'Vue 3, TypeScript, Vite, single-file components',\n projectDir: 'converted-vue-vite',\n staticDir: 'public',\n scaffold: 'npm create vite@latest converted-vue-vite -- --template vue-ts',\n entryFiles: 'src/main.ts, src/App.vue, src/components/*.vue, src/styles/*',\n routing: 'Use Vue Router only if multiple exported pages exist in subpages/.',\n },\n {\n id: 'sveltekit',\n label: 'SvelteKit',\n stack: 'SvelteKit, TypeScript, componentized routes and assets',\n projectDir: 'converted-sveltekit',\n staticDir: 'static',\n scaffold: 'npm create svelte@latest converted-sveltekit',\n entryFiles: 'src/routes/+page.svelte, src/lib/components/*, static/*',\n routing: 'Create SvelteKit routes for meaningful exported pages when subpages/ exists.',\n },\n {\n id: 'astro',\n label: 'Astro',\n stack: 'Astro, TypeScript, island components only where interactivity is needed',\n projectDir: 'converted-astro',\n staticDir: 'public',\n scaffold: 'npm create astro@latest converted-astro',\n entryFiles: 'src/pages/index.astro, src/components/*, public/*',\n routing: 'Use Astro pages for exported subpages and avoid unnecessary client JavaScript.',\n },\n];\n\nconst GOALS: ConversionGoal[] = [\n {\n id: 'clean-rebuild',\n label: 'Clean professional rebuild',\n instruction:\n 'Rebuild the export as clean production code, not as a one-file HTML clone, while preserving the full page experience.',\n priority: 'Readable structure, maintainability, complete pages, and faithful visual result.',\n },\n {\n id: 'pixel-perfect',\n label: 'Pixel-perfect visual migration',\n instruction:\n 'Prioritize pixel-perfect fidelity before refactoring anything aggressively, even when the layout is difficult.',\n priority:\n 'Spacing, typography, responsive behavior, colors, media, animations, and page-by-page fidelity.',\n },\n {\n id: 'component-system',\n label: 'Reusable component system',\n instruction:\n 'Extract repeated UI blocks into reusable components with clean props without simplifying the original pages.',\n priority:\n 'Components, layout primitives, naming, future editability, and complete section coverage.',\n },\n {\n id: 'performance-seo',\n label: 'Performance and SEO rebuild',\n instruction:\n 'Rebuild the site while reducing unused vendor code and improving SEO basics without losing visual fidelity.',\n priority:\n 'Fast loading, semantic markup, metadata, accessibility, asset hygiene, and faithful pages.',\n },\n];\n\nexport async function runAiPromptAssistant(exporter: ExporterContext): Promise<void> {\n if (!stdin.isTTY || !stdout.isTTY) return;\n\n const serveCommand = buildServeCommand(exporter);\n const shouldConvert = await runExportCompletePrompt(exporter, serveCommand);\n if (!shouldConvert) return;\n\n printAssistantModal(`${ui.text.bold('AI conversion prompt')} ${ui.error('BETA')}`, [\n 'Choose a target stack, AI tool, and conversion situation.',\n 'Mouse clicks are supported in the terminal when available.',\n 'A detailed prompt file will be generated inside the export folder.',\n ]);\n\n const targetOptions: SelectOption[] = [\n ...TARGETS.map((target) => ({ label: target.label, value: target.id })),\n { label: 'Customize with AI - BETA in development', value: 'custom-ai', disabled: true },\n ];\n\n const targetId = await select('Choose target stack', targetOptions, 0);\n\n const aiToolId = await select(\n 'Choose the AI coding tool',\n AI_TOOLS.map((tool) => ({ label: tool.label, value: tool.id })),\n 0\n );\n\n const goalId = await select(\n 'Choose the conversion situation',\n GOALS.map((goal) => ({ label: goal.label, value: goal.id })),\n 0\n );\n\n const target = TARGETS.find((item) => item.id === targetId) || TARGETS[0];\n const aiTool = AI_TOOLS.find((item) => item.id === aiToolId) || AI_TOOLS[0];\n const goal = GOALS.find((item) => item.id === goalId) || GOALS[0];\n const facts = await collectExportFacts(exporter);\n const prompt = buildConversionPrompt(target, aiTool, goal, facts);\n const aiDir = path.join(exporter.outDir, 'ai');\n const promptPath = path.join(aiDir, `${aiTool.id}-${target.id}-${goal.id}-prompt.md`);\n\n await fs.mkdir(aiDir, { recursive: true });\n await fs.writeFile(promptPath, prompt, 'utf-8');\n\n const copyPrompt = await runPromptReadyPrompt(promptPath, target, aiTool, goal);\n if (copyPrompt) {\n try {\n await copyToClipboard(prompt);\n console.log(` ${ui.success('✓')} ${ui.text.bold('Prompt copied to clipboard')}\\n`);\n } catch (error) {\n console.log(\n ` ${ui.warning('!')} ${ui.warning('Clipboard copy unavailable:')} ${ui.muted((error as Error).message)}\\n`\n );\n }\n }\n}\n\nasync function collectExportFacts(exporter: ExporterContext): Promise<ExportFacts> {\n const counts: Record<string, number> = {};\n const rootEntries = await safeReadDir(exporter.outDir);\n\n for (const item of IMPORTANT_DIRS) {\n counts[item] =\n item === 'index.html'\n ? (await exists(path.join(exporter.outDir, item)))\n ? 1\n : 0\n : await countEntries(path.join(exporter.outDir, item));\n }\n\n return {\n sourceUrl: exporter.siteUrl,\n outputDir: exporter.outDir,\n platformName: exporter.platform.displayName,\n rootEntries,\n counts,\n };\n}\n\nasync function exists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function safeReadDir(dir: string): Promise<string[]> {\n try {\n return (await fs.readdir(dir)).sort();\n } catch {\n return [];\n }\n}\n\nasync function countEntries(dir: string): Promise<number> {\n try {\n return (await fs.readdir(dir)).length;\n } catch {\n return 0;\n }\n}\n\nfunction buttonLabel(label: string): string {\n return `${ui.border('[')} ${ui.text.bold(label)} ${ui.border(']')}`;\n}\n\nfunction centerText(text: string, width: number): string {\n const visible = stripAnsi(text).length;\n if (visible >= width) return text;\n const left = Math.floor((width - visible) / 2);\n return ' '.repeat(left) + text + ' '.repeat(width - visible - left);\n}\n\nfunction buildServeCommand(exporter: ExporterContext): string {\n return `cd ${path.basename(exporter.outDir)} && node serve.js`;\n}\n\nasync function runExportCompletePrompt(\n exporter: ExporterContext,\n serveCommand: string\n): Promise<boolean> {\n let copyServeCommand = true;\n\n while (true) {\n const action = await select(\n 'Export complete',\n [\n {\n label: `${checkboxLabel(copyServeCommand)} Copy serve command when finishing`,\n value: 'toggle-copy',\n },\n {\n label: `${buttonLabel('Convert to AI code')} ${ui.error('BETA')}`,\n value: 'convert',\n },\n { label: buttonLabel('Finish'), value: 'finish' },\n ],\n 2,\n {\n headerLines: [\n `Output: ${path.basename(exporter.outDir)}`,\n `Run: ${serveCommand}`,\n 'Use Convert to open the AI conversion assistant.',\n ],\n footer: 'enter select · checkbox toggles copy · mouse hover/click',\n }\n );\n\n if (action === 'toggle-copy') {\n copyServeCommand = !copyServeCommand;\n continue;\n }\n\n if (action === 'finish') {\n if (copyServeCommand) {\n try {\n await copyToClipboard(serveCommand);\n console.log(` ${ui.success('✓')} ${ui.text.bold('Serve command copied')}\\n`);\n } catch (error) {\n console.log(\n ` ${ui.warning('!')} ${ui.warning('Clipboard copy unavailable:')} ${ui.muted((error as Error).message)}\\n`\n );\n }\n }\n return false;\n }\n\n return true;\n }\n}\n\nasync function runPromptReadyPrompt(\n promptPath: string,\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal\n): Promise<boolean> {\n const relPath = path.relative(process.cwd(), promptPath) || promptPath;\n let copyPrompt = false;\n\n while (true) {\n const action = await select(\n `AI Prompt Ready ${ui.error('BETA')}`,\n [\n {\n label: `${checkboxLabel(copyPrompt)} Copy prompt when finishing`,\n value: 'toggle-copy',\n },\n { label: buttonLabel('Finish'), value: 'finish' },\n ],\n 1,\n {\n headerLines: [\n `Tool: ${aiTool.displayName}`,\n `Stack: ${target.label}`,\n `Mode: ${goal.label}`,\n `File: ${relPath}`,\n ],\n footer: 'enter finish · checkbox toggles copy · mouse hover/click',\n }\n );\n\n if (action === 'toggle-copy') {\n copyPrompt = !copyPrompt;\n continue;\n }\n\n return copyPrompt;\n }\n}\n\nfunction checkboxLabel(checked: boolean): string {\n return checked ? ui.success('☑') : ui.muted('☐');\n}\n\nfunction printConvertPanel(exporter: ExporterContext): void {\n const w = maxWidth();\n const inner = w - 4;\n const rows = [\n centerText(`${ui.text.bold('AI Convert')} ${ui.error('BETA')}`, inner),\n centerText(ui.muted('Generate a conversion prompt after the export.'), inner),\n centerText(`${buttonLabel('Convert')} ${ui.muted('or')} ${buttonLabel('Skip')}`, inner),\n centerText(ui.muted(path.basename(exporter.outDir)), inner),\n ];\n\n console.log('');\n console.log(boxTop(w));\n for (const row of rows) console.log(boxLine(w, row));\n console.log(boxBot(w));\n console.log('');\n}\n\nfunction printAssistantModal(title: string, lines: string[]): void {\n const w = maxWidth();\n const inner = w - 4;\n\n console.log('');\n console.log(boxTop(w));\n console.log(boxLine(w, centerText(`${ui.primary('◆')} ${title}`, inner)));\n console.log(boxSep(w));\n for (const line of lines) {\n console.log(boxLine(w, centerText(ui.muted(line), inner)));\n }\n console.log(boxBot(w));\n console.log('');\n}\n\nfunction buildConversionPrompt(\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal,\n facts: ExportFacts\n): string {\n const rootEntries = facts.rootEntries.length\n ? facts.rootEntries.join(', ')\n : 'No root entries detected';\n const exportDir = quoteForPrompt(facts.outputDir);\n const projectDir = quoteForPrompt(path.join(facts.outputDir, target.projectDir));\n const scaffoldCommand = `cd ${exportDir}; ${target.scaffold}`;\n const sourceAssets = quoteForPrompt(path.join(facts.outputDir, 'assets', '*'));\n const destinationAssets = quoteForPrompt(\n path.join(facts.outputDir, target.projectDir, target.staticDir, 'assets')\n );\n const windowsAssetCopyCommand = `New-Item -ItemType Directory -Force -Path ${destinationAssets}; Copy-Item -Path ${sourceAssets} -Destination ${destinationAssets} -Recurse -Force`;\n const unixSourceAssets = quoteForPrompt(toPosixPath(path.join(facts.outputDir, 'assets')));\n const unixDestinationParent = quoteForPrompt(\n toPosixPath(path.join(facts.outputDir, target.projectDir, target.staticDir))\n );\n const unixAssetCopyCommand = `mkdir -p ${unixDestinationParent} && cp -R ${unixSourceAssets} ${unixDestinationParent}/assets`;\n const directoryLines = IMPORTANT_DIRS.map(\n (dir) => `Inspect ${dir}: ${facts.counts[dir]} item(s) detected in the export.`\n );\n const promptLines = [\n `You are ${aiTool.agentName} working inside a local export created by Framer Export.`,\n 'This brief was generated by the Framer Export AI Prompt Assistant BETA.',\n 'Treat this beta prompt as a strict conversion checklist, not as permission to skip inspection.',\n 'Your mission is to convert this exported static mirror into a clean production project.',\n `Target stack: ${target.stack}.`,\n `Selected AI coding tool: ${aiTool.displayName}.`,\n `Selected conversion situation: ${goal.label}.`,\n `Primary instruction for this situation: ${goal.instruction}`,\n `Main priority: ${goal.priority}`,\n `Source URL from the real export: ${facts.sourceUrl}`,\n `Detected platform from the real export: ${facts.platformName}`,\n `Export folder to inspect first: ${facts.outputDir}`,\n `Root entries actually present: ${rootEntries}`,\n `Create the converted project in: ${projectDir}`,\n `Recommended scaffold command: ${scaffoldCommand}`,\n `Expected important target files: ${target.entryFiles}`,\n `Routing guidance: ${target.routing}`,\n `Static assets destination for this stack: ${target.staticDir}/assets inside the converted project.`,\n `PowerShell command to copy exported assets after scaffolding: ${windowsAssetCopyCommand}`,\n `macOS/Linux command to copy exported assets after scaffolding: ${unixAssetCopyCommand}`,\n 'Run the asset copy command; do not recreate, redownload, rename randomly, or replace real exported assets with placeholders.',\n 'After copying assets, update every image, video, font, CSS url(), and script reference to the new local asset path.',\n 'Do not rush. Take time to inspect the export before writing the final implementation.',\n 'Do not invent brand names, copy, images, links, animations, colors, or sections.',\n 'Use only real information found in index.html, CSS files, JavaScript files, data files, and assets.',\n 'If a detail is missing, inspect more files instead of guessing.',\n 'If a vendor script is minified or hard to understand, identify what behavior it provides before replacing it.',\n 'Keep the final result professional, clean, responsive, and maintainable.',\n 'Do not simplify the site because a section, animation, page, or layout is difficult.',\n 'If something is hard, break it into smaller components and keep working until the result matches closely.',\n 'For every exported page, aim for the closest possible pixel-perfect result: spacing, typography, images, viewport behavior, and motion.',\n 'Do not merge multiple pages into one generic page unless the export proves they are duplicate routes.',\n 'Do not replace complex exported sections with summaries, cards, screenshots, or placeholder blocks.',\n 'If a page has visual depth, overlapping layers, sticky sections, galleries, or scroll effects, recreate those behaviors instead of flattening them.',\n 'Start by listing the files and directories that matter for the conversion.',\n ...directoryLines,\n 'Read index.html fully enough to understand page structure, metadata, linked assets, and scripts.',\n 'Read the CSS files that define layout, typography, responsive rules, and visual details.',\n 'Inspect scripts/vendor only to understand required interactions; do not blindly copy huge vendor bundles.',\n 'Inspect scripts/modules for page-specific logic, animations, sliders, menus, and dynamic behavior.',\n 'Inspect data files for CMS-like content, page data, configuration, or serialized props.',\n 'Inspect assets/images and preserve the real image files that are actually used.',\n 'Inspect assets/fonts and preserve font loading if the design depends on custom fonts.',\n 'Inspect subpages if it contains exported pages; map them to routes only when they represent real pages.',\n 'If subpages contains pages, convert each meaningful page with its own route and page component.',\n 'For each converted page, compare against the original exported HTML route and adjust until it is visually close.',\n 'Create a clean project structure instead of dumping everything into one component.',\n 'Separate global layout, page sections, shared components, data helpers, and styles.',\n 'Use semantic HTML for headings, navigation, buttons, forms, sections, and footer content.',\n 'Preserve the original hierarchy of visible content unless there is a clear bug to fix.',\n 'Preserve real URLs and links, but convert local asset paths to the new project structure.',\n 'Move static assets into the target framework public/static asset location when appropriate.',\n 'Do not keep broken CDN references if a local exported asset already exists.',\n 'Do not hardcode absolute machine paths into source files; use framework-relative public asset paths after copying.',\n 'Keep original filenames when possible so CSS and content references remain traceable.',\n 'Do not leave unused analytics, editor badges, platform badges, or export-only scripts in the new app.',\n 'Replace platform-specific runtime code with native framework components when possible.',\n 'Keep interactions that users can see: menus, hover states, forms, sliders, animations, and scroll effects.',\n 'If an interaction is too complex, implement a clean equivalent and document the difference briefly.',\n 'Keep responsive behavior for desktop, tablet, and mobile.',\n 'Check layout at small widths and avoid fixed desktop-only dimensions unless the original requires them.',\n 'Use CSS variables or a clear theme file for colors, spacing, radius, shadows, and typography.',\n 'Name components after their role: Hero, Header, FeatureGrid, Gallery, Pricing, Footer, and similar real sections.',\n 'Avoid generic placeholder components if the exported site has specific section meaning.',\n 'Use TypeScript types where they make the content or component props clearer.',\n 'Do not add unnecessary libraries unless they replace a real exported behavior cleanly.',\n 'If you add a library, explain why it is needed and where it is used.',\n 'Keep package.json scripts standard: dev, build, preview, lint when available.',\n 'Keep the build reproducible from a fresh install.',\n 'After implementing, run the install/build/typecheck commands available for the target project.',\n 'Fix any build errors instead of leaving TODOs.',\n 'Open the generated app locally if possible and compare against the exported index.html visually.',\n 'When there are subpages, compare every generated route against its matching exported file.',\n 'Verify that every visible image loads from the new project.',\n 'Verify that font rendering is close to the export.',\n 'Verify that navigation and internal links work.',\n 'Verify that responsive breakpoints do not overlap or hide important content.',\n 'Verify that there are no console errors caused by missing assets or copied platform scripts.',\n 'Keep accessibility basics: alt text when inferable, keyboard-reachable controls, visible focus states.',\n 'Keep SEO basics: title, meta description if present, canonical only if it is correct, Open Graph when present.',\n 'Do not fabricate SEO copy; reuse existing metadata or ask for missing copy if necessary.',\n 'Commit to a small number of high-quality files rather than many noisy fragments.',\n 'If a section repeats, extract a reusable component and data array.',\n 'If a section is unique, keep it simple and local to the page.',\n 'Document important migration decisions in a short README inside the converted project.',\n 'The README must mention the source export folder, target stack, setup command, and known limitations.',\n 'Do not delete the original export folder.',\n 'Do not modify unrelated files outside the new converted project unless required for setup.',\n 'If the worktree has existing changes, avoid reverting or overwriting them.',\n 'Before large edits, inspect first and explain the conversion plan briefly.',\n 'Then implement the conversion step by step until the app builds.',\n 'Final answer must summarize what was converted, where the new project lives, and which checks passed.',\n 'If something could not be converted, state the exact file or behavior and the reason.',\n 'Quality bar: the result should feel like a real hand-built production app, not an automated scrape or simplified demo.',\n ];\n\n return [\n `# ${aiTool.displayName} Conversion Prompt - ${target.label}`,\n '',\n 'Status: BETA assistant output. Review the export carefully and follow the real files.',\n `Generated from real export: ${facts.outputDir}`,\n `AI tool: ${aiTool.displayName}`,\n `Target: ${target.label}`,\n `Situation: ${goal.label}`,\n '',\n promptLines.map((line, index) => `${String(index + 1).padStart(2, '0')}. ${line}`).join('\\n'),\n '',\n ].join('\\n');\n}\n\nfunction quoteForPrompt(value: string): string {\n return `\"${value.replace(/\"/g, '\\\\\"')}\"`;\n}\n\nfunction toPosixPath(value: string): string {\n return value.replace(/\\\\/g, '/');\n}\n\nasync function copyToClipboard(text: string): Promise<void> {\n const commands =\n process.platform === 'win32'\n ? [{ command: 'clip', args: [] }]\n : process.platform === 'darwin'\n ? [{ command: 'pbcopy', args: [] }]\n : [\n { command: 'wl-copy', args: [] },\n { command: 'xclip', args: ['-selection', 'clipboard'] },\n { command: 'xsel', args: ['--clipboard', '--input'] },\n ];\n\n let lastError: Error | null = null;\n for (const item of commands) {\n try {\n await pipeToCommand(item.command, item.args, text);\n return;\n } catch (error) {\n lastError = error as Error;\n }\n }\n\n throw lastError || new Error('No clipboard command found');\n}\n\nfunction pipeToCommand(command: string, args: string[], input: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, { stdio: ['pipe', 'ignore', 'pipe'] });\n let stderr = '';\n let settled = false;\n\n const finish = (error?: Error): void => {\n if (settled) return;\n settled = true;\n if (error) reject(error);\n else resolve();\n };\n\n child.stderr?.on('data', (chunk: Buffer) => {\n stderr += chunk.toString();\n });\n child.on('error', finish);\n child.on('close', (code) => {\n if (code === 0) {\n finish();\n } else {\n finish(new Error(`${command} exited with ${code}${stderr ? `: ${stderr.trim()}` : ''}`));\n }\n });\n child.stdin?.end(input);\n });\n}\n\nfunction printPromptResult(\n promptPath: string,\n target: ConversionTarget,\n aiTool: AiTool,\n goal: ConversionGoal\n): void {\n const w = maxWidth();\n const isSmall = w < 50;\n const inner = w - 4;\n const relPath = path.relative(process.cwd(), promptPath) || promptPath;\n\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(\n boxLine(\n w,\n centerText(\n `${ui.success('✓')} ${ui.text.bold('AI Prompt Ready')} ${ui.error('BETA')}`,\n inner\n )\n )\n );\n console.log(boxSep(w));\n console.log(\n boxLine(w, centerText(`${ui.muted('Tool')} ${ui.primary(aiTool.displayName)}`, inner))\n );\n console.log(boxLine(w, centerText(`${ui.muted('Stack')} ${ui.primary(target.label)}`, inner)));\n console.log(boxLine(w, centerText(`${ui.muted('Mode')} ${ui.primary(goal.label)}`, inner)));\n console.log(boxLine(w, centerText(`${ui.muted('File')} ${ui.primary(relPath)}`, inner)));\n console.log(boxSep(w));\n console.log(\n boxLine(w, centerText(`${buttonLabel('Copy prompt')} ${buttonLabel('Done')}`, inner))\n );\n console.log(boxBot(w));\n } else {\n console.log(ui.text.bold(' AI Prompt Ready - BETA'));\n console.log(` Tool: ${ui.primary(aiTool.displayName)}`);\n console.log(` Stack: ${ui.primary(target.label)}`);\n console.log(` Situation: ${ui.primary(goal.label)}`);\n console.log(` File: ${ui.primary(relPath)}`);\n }\n console.log('');\n}\n","import fs from 'fs/promises';\nimport path from 'path';\nimport chalk from 'chalk';\nimport type { Browser, Page } from 'puppeteer';\nimport { AssetMap } from '../assets/asset-map.js';\nimport { dlBuffer } from '../network/download.js';\nimport { info, log, success, setCooking } from '../logger/index.js';\nimport { launchAndCapture, captureSubpage, closeBrowser } from './capture.js';\nimport { AntiBotError } from './anti-bot.js';\nimport { downloadAll } from './download.js';\nimport { buildOutput } from './output.js';\nimport { printSummary } from './summary.js';\nimport { runAiPromptAssistant } from '../ai/prompt-assistant.js';\nimport { detectPlatform, getPlatformByName } from '../platforms/index.js';\nimport type { PlatformHandler, PlatformType } from '../platforms/types.js';\nimport type { ExporterContext } from '../types.js';\nimport { CookingSpinner } from '../cli/cooking.js';\nimport { chip, ui } from '../cli/theme.js';\n\nexport function deriveOutputName(url: string, platformName: PlatformType): string {\n try {\n const parsed = new URL(url);\n const hostname: string = parsed.hostname;\n\n let siteName: string;\n if (hostname.endsWith('.webflow.io')) {\n siteName = hostname.replace('.webflow.io', '');\n } else if (hostname.includes('.wixsite.com')) {\n const parts: string[] = parsed.pathname.split('/').filter(Boolean);\n siteName = parts[0] || hostname.split('.')[0];\n } else if (hostname.match(/\\.framer\\.(app|website|ai)$/)) {\n siteName = hostname.split('.framer.')[0];\n } else {\n siteName = hostname.replace(/\\./g, '-');\n }\n\n const cleanName =\n siteName\n .toLowerCase()\n .replace(/[^a-z0-9_-]/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '') || 'site';\n\n return `${platformName}-${cleanName}-${randomOutputSuffix()}`;\n } catch {\n return `framer-export-output-${randomOutputSuffix()}`;\n }\n}\n\nfunction randomOutputSuffix(): string {\n const adjectives = ['clean', 'bright', 'swift', 'sharp', 'fresh', 'solid', 'tidy', 'prime'];\n const nouns = ['mirror', 'export', 'site', 'build', 'copy', 'page', 'stack', 'bundle'];\n const adjective = adjectives[Math.floor(Math.random() * adjectives.length)];\n const noun = nouns[Math.floor(Math.random() * nouns.length)];\n const id = Math.random().toString(36).slice(2, 6);\n return `${adjective}-${noun}-${id}`;\n}\n\nexport class FramerExporter implements ExporterContext {\n siteUrl: string;\n outDir: string;\n assets: AssetMap;\n browser: Browser | null;\n page: Page | null;\n ssrHTML: string;\n prettyPrint: boolean;\n platform: PlatformHandler;\n cooking?: CookingSpinner;\n\n constructor(siteUrl: string, outDir: string, platformOverride?: PlatformType) {\n this.siteUrl = siteUrl;\n this.outDir = outDir;\n this.assets = new AssetMap();\n this.browser = null;\n this.page = null;\n this.ssrHTML = '';\n this.prettyPrint = true;\n\n if (platformOverride && platformOverride !== 'unknown') {\n this.platform = getPlatformByName(platformOverride);\n } else {\n this.platform = detectPlatform(siteUrl);\n }\n }\n\n async run(includeSubpages: boolean = false): Promise<void> {\n console.log(\n `\\n ${ui.text.bold('Framer Export')} ${chip('mirror')} ${ui.muted('v4 pipeline')}\\n`\n );\n info('Source : ' + chalk.underline(this.siteUrl));\n info('Output : ' + ui.primary(this.outDir));\n info('Platform : ' + ui.primary(this.platform.displayName));\n if (includeSubpages) {\n info('Subpages : ' + ui.success('enabled'));\n }\n console.log('');\n\n this.cooking = new CookingSpinner();\n setCooking(this.cooking);\n this.cooking.start('Preparing directories...');\n\n for (const d of [\n '',\n 'assets/images',\n 'assets/fonts',\n 'assets/videos',\n 'assets/misc',\n 'styles',\n 'scripts/vendor',\n 'scripts/modules',\n 'data',\n 'subpages',\n ]) {\n await fs.mkdir(path.join(this.outDir, d), { recursive: true });\n }\n log('Output directory structure created');\n\n this.cooking.update('Fetching SSR HTML...');\n log('Fetching SSR HTML from ' + this.siteUrl);\n try {\n const buf: Buffer = await dlBuffer(this.siteUrl);\n this.ssrHTML = buf.toString('utf-8');\n success('SSR HTML fetched (' + (this.ssrHTML.length / 1024).toFixed(1) + ' KB)');\n } catch (e) {\n log(chalk.red('Could not fetch SSR HTML: ' + (e as Error).message));\n }\n\n const htmlDetected = detectPlatform(this.siteUrl, this.ssrHTML);\n if (htmlDetected.name !== this.platform.name) {\n this.platform = htmlDetected;\n log('Platform refined: ' + ui.primary(this.platform.displayName) + ' (from HTML analysis)');\n }\n\n try {\n await launchAndCapture(this);\n\n if (includeSubpages && this.page) {\n await this.crawlSubpages();\n }\n\n await closeBrowser(this);\n\n this.cooking.update('Downloading assets...');\n await downloadAll(this);\n\n this.cooking.update('Building output...');\n await buildOutput(this);\n\n if (this.platform.postProcess) {\n this.cooking.update('Running ' + this.platform.displayName + ' post-processing...');\n try {\n await this.platform.postProcess(this);\n log('postProcess hook completed');\n } catch (e) {\n log('postProcess hook error (continuing): ' + (e as Error).message);\n }\n }\n } catch (e) {\n this.cooking?.stop();\n setCooking(null);\n await closeBrowser(this);\n // On a bot-protection block, leave no empty/partial export behind.\n if (e instanceof AntiBotError) {\n await fs.rm(this.outDir, { recursive: true, force: true }).catch(() => {});\n }\n throw e;\n }\n\n this.cooking.stop();\n setCooking(null);\n\n console.log('');\n success('Export complete!');\n await printSummary(this);\n await runAiPromptAssistant(this);\n }\n\n private async crawlSubpages(): Promise<void> {\n this.cooking?.update('Discovering sub-pages...');\n log('Scanning page for internal links...');\n\n const page = this.page!;\n const baseUrl = new URL(this.siteUrl);\n const baseHost = baseUrl.hostname.replace(/^www\\./, '');\n\n const links: string[] = await page.evaluate((host: string) => {\n const anchors = Array.from(document.querySelectorAll('a[href]'));\n const hrefs = new Set<string>();\n for (const a of anchors) {\n const href = (a as HTMLAnchorElement).href;\n if (\n !href ||\n href.startsWith('javascript:') ||\n href.startsWith('mailto:') ||\n href.startsWith('tel:') ||\n href.startsWith('#')\n )\n continue;\n try {\n const u = new URL(href);\n const h = u.hostname.replace(/^www\\./, '');\n if (\n h === host &&\n u.pathname !== '/' &&\n u.pathname !== '' &&\n !u.pathname.startsWith('/#')\n ) {\n hrefs.add(href.split('#')[0]);\n }\n } catch {}\n }\n return Array.from(hrefs);\n }, baseHost);\n\n log('Found ' + links.length + ' sub-page links');\n const uniqueLinks = [...new Set(links)].slice(0, 50);\n\n if (uniqueLinks.length === 0) {\n log('No sub-pages to crawl');\n return;\n }\n\n for (let i = 0; i < uniqueLinks.length; i++) {\n const link = uniqueLinks[i];\n this.cooking?.update('Crawling sub-page ' + (i + 1) + '/' + uniqueLinks.length);\n try {\n const html = await captureSubpage(page, link, {\n needsHydrationCheck: this.platform.needsHydrationCheck,\n hydrationTimeout: this.platform.hydrationTimeout,\n });\n\n const slug = this.deriveSlug(link, baseUrl);\n const filename = slug + '.html';\n const filepath = path.join(this.outDir, 'subpages', filename);\n\n await fs.writeFile(filepath, html, 'utf-8');\n log(' Saved: subpages/' + filename);\n } catch (e) {\n log(' Skipped ' + link + ': ' + (e as Error).message);\n }\n }\n\n success('Sub-pages crawled: ' + uniqueLinks.length);\n }\n\n private deriveSlug(link: string, baseUrl: URL): string {\n try {\n const u = new URL(link);\n let pathname = u.pathname.replace(/\\/+$/, '').replace(/^\\//, '');\n if (!pathname) return 'index';\n return pathname.replace(/[^a-zA-Z0-9_-]/g, '_').replace(/_+/g, '_') || 'page';\n } catch {\n return 'page';\n }\n }\n}\n","import chalk from 'chalk';\nimport { select, type SelectOption } from './select.js';\nimport {\n platformsByCategory,\n CATEGORY_LABELS,\n CATEGORY_ORDER,\n detectByUrl,\n} from '../platforms/index.js';\nimport type { PlatformType, PlatformCategory } from '../platforms/types.js';\n\nexport type PlatformSelection = { platform: PlatformType } | { modifyUrl: true };\n\nconst MODIFY_URL = '__modify_url__';\nconst BROWSE = '__browse__';\nconst USE_DETECTED = '__use_detected__';\nconst BACK = '__back__';\n\n/**\n * Registry-driven platform picker. Two steps (category → platform) so the\n * list never overflows the terminal, with the auto-detected platform surfaced\n * up front. Returns either a chosen platform or a request to edit the URL.\n */\nexport async function selectPlatform(siteUrl: string): Promise<PlatformSelection> {\n const grouped = platformsByCategory();\n const detected = detectByUrl(siteUrl); // null when detection is not confident\n\n // ── Step 0: offer the detected platform directly ──────────────────────────\n if (detected) {\n const choice = await select(\n 'Platform detected',\n [\n { label: `Use ${detected.displayName}`, value: USE_DETECTED },\n { label: 'Browse all platforms', value: BROWSE },\n ],\n 0,\n {\n headerLines: [`URL: ${siteUrl}`, `Detected: ${detected.displayName}`],\n actions: [{ label: 'Modify URL', value: MODIFY_URL }],\n footer: 'tab focus button · enter select · mouse hover/click',\n }\n );\n if (choice === MODIFY_URL) return { modifyUrl: true };\n if (choice === USE_DETECTED) return { platform: detected.name };\n // else fall through to browse\n }\n\n // ── Step 1 + 2: category → platform (with back navigation) ────────────────\n let categoryDefault = detected\n ? Math.max(0, CATEGORY_ORDER.indexOf(detected.category))\n : 0;\n\n while (true) {\n const categoryOptions: SelectOption[] = CATEGORY_ORDER.map((cat) => ({\n label: `${CATEGORY_LABELS[cat]} ${chalk.gray(`(${grouped[cat].length})`)}`,\n value: cat,\n }));\n\n const category = await select('Select a category', categoryOptions, categoryDefault, {\n headerLines: [`URL: ${siteUrl}`],\n actions: [{ label: 'Modify URL', value: MODIFY_URL }],\n footer: 'tab focus button · enter next · mouse hover/click',\n });\n\n if (category === MODIFY_URL) return { modifyUrl: true };\n\n const cat = category as PlatformCategory;\n categoryDefault = CATEGORY_ORDER.indexOf(cat);\n const handlers = grouped[cat];\n\n const platformOptions: SelectOption[] = handlers.map((handler) => ({\n label:\n detected && handler.name === detected.name\n ? `${handler.displayName}${chalk.gray(' (detected)')}`\n : handler.displayName,\n value: handler.name,\n }));\n\n const platformDefault =\n detected && detected.category === cat\n ? Math.max(0, handlers.findIndex((handler) => handler.name === detected.name))\n : 0;\n\n const platform = await select('Select platform', platformOptions, platformDefault, {\n headerLines: [`Category: ${CATEGORY_LABELS[cat]}`],\n actions: [{ label: 'Back to categories', value: BACK }],\n footer: 'tab focus button · enter select · mouse hover/click',\n });\n\n if (platform === BACK) continue;\n return { platform: platform as PlatformType };\n }\n}\n","import readline from 'node:readline/promises';\nimport { stdin, stdout } from 'node:process';\nimport path from 'node:path';\nimport { URL } from 'node:url';\nimport chalk from 'chalk';\nimport { showBanner } from './banner.js';\nimport { FramerExporter, deriveOutputName } from '../exporter/index.js';\nimport { detectPlatform, PLATFORM_REGISTRY } from '../platforms/index.js';\nimport { promptInput, select } from './select.js';\nimport { selectPlatform } from './select-grouped.js';\nimport type { PlatformType } from '../platforms/types.js';\nimport { boxTop, boxLine, boxSep, boxBot, boxRow, maxWidth } from './box.js';\nimport { bullet, chip, ui } from './theme.js';\n\nfunction drawHeader(title: string): void {\n const w = maxWidth();\n if (w < 50) {\n console.log(`\\n ${bullet('●')} ${ui.text.bold(title)}`);\n return;\n }\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' ' + title)));\n console.log(boxBot(w));\n console.log('');\n}\n\nexport async function runSetup(legacyMode: boolean = false): Promise<void> {\n showBanner();\n\n console.log(` ${ui.text.bold('Framer Export setup')} ${chip('interactive')}`);\n console.log(\n ` ${ui.muted('Export 25+ website platforms into a clean, self-hosted local mirror.')}\\n`\n );\n\n const rl = legacyMode ? readline.createInterface({ input: stdin, output: stdout }) : null;\n\n const ask = async (\n question: string,\n defaultVal?: string,\n headerLines: string[] = []\n ): Promise<string> => {\n if (!legacyMode) {\n return promptInput(question, defaultVal || '', { headerLines });\n }\n\n const suffix: string = defaultVal ? chalk.gray(` (${defaultVal})`) : '';\n const prompt: string = ` ${ui.primary('●')} ${ui.text.bold(question)}${suffix} ${ui.muted('>')} `;\n const answer: string = await rl!.question(prompt);\n return answer.trim() || defaultVal || '';\n };\n\n if (legacyMode) drawHeader('Step 1 : Site URL');\n\n let siteUrl = '';\n let urlError = '';\n while (!siteUrl) {\n const input: string = await ask(\n 'Enter the site URL',\n '',\n ['Step 1 : Site URL', urlError].filter(Boolean)\n );\n try {\n new URL(input);\n siteUrl = input;\n urlError = '';\n } catch {\n urlError = 'Invalid URL. Enter a valid URL (https://...)';\n if (legacyMode) {\n console.log(` ${ui.error('✗')} ${ui.error(urlError)}\\n`);\n }\n }\n }\n if (legacyMode) {\n console.log(` ${ui.success('✓')} ${ui.success('URL:')} ${chalk.underline(siteUrl)}\\n`);\n }\n\n let platformName: PlatformType | null = null;\n\n if (legacyMode) {\n drawHeader('Step 2 : Platform');\n const detected = detectPlatform(siteUrl);\n console.log(` ${ui.info('i')} Auto-detected: ${ui.primary(detected.displayName)}`);\n const platformInput: string = await ask('Platform name', detected.name);\n const known = PLATFORM_REGISTRY.some((platform) => platform.name === platformInput);\n platformName = (known ? platformInput : detected.name) as PlatformType;\n console.log(` ${ui.success('✓')} ${ui.success('Platform:')} ${ui.primary(platformName)}\\n`);\n } else {\n while (!platformName) {\n const selection = await selectPlatform(siteUrl);\n\n if ('modifyUrl' in selection) {\n siteUrl = '';\n urlError = '';\n while (!siteUrl) {\n const input = await ask(\n 'Modify site URL',\n '',\n ['Step 1 : Site URL', urlError].filter(Boolean)\n );\n try {\n new URL(input);\n siteUrl = input;\n urlError = '';\n } catch {\n urlError = 'Invalid URL. Enter a valid URL (https://...)';\n }\n }\n continue;\n }\n\n platformName = selection.platform;\n }\n }\n\n if (!platformName) {\n throw new Error('Platform selection failed');\n }\n\n const rl2 = legacyMode ? rl! : null;\n\n const ask2 = async (\n question: string,\n defaultVal?: string,\n headerLines: string[] = []\n ): Promise<string> => {\n if (!legacyMode) {\n return promptInput(question, defaultVal || '', { headerLines });\n }\n\n const suffix: string = defaultVal ? chalk.gray(` (${defaultVal})`) : '';\n const prompt: string = ` ${ui.primary('●')} ${ui.text.bold(question)}${suffix} ${ui.muted('>')} `;\n const answer: string = await rl2!.question(prompt);\n return answer.trim() || defaultVal || '';\n };\n\n const derivedName: string = deriveOutputName(siteUrl, platformName);\n let outDir = './' + derivedName;\n\n if (legacyMode) {\n drawHeader('Step 3 : Output Directory');\n outDir = await ask2('Output directory', outDir, [\n 'Step 3 : Output Directory',\n `URL: ${siteUrl}`,\n `Platform: ${platformName}`,\n ]);\n console.log(` ${ui.success('✓')} ${ui.success('Output:')} ${ui.primary(outDir)}\\n`);\n drawHeader('Step 4 : Options');\n } else {\n outDir = await ask2('Output directory', outDir, [\n 'Step 3 : Output Directory',\n `URL: ${siteUrl}`,\n `Platform: ${platformName}`,\n ]);\n }\n\n let prettyPrint = true;\n let concurrency = 12;\n let includeSubpages = false;\n let startExport = false;\n\n const summaryRows = (): Array<[string, string]> => [\n ['URL', siteUrl],\n ['Platform', platformName],\n ['Output', path.resolve(outDir)],\n ['Pretty-print', prettyPrint ? 'yes' : 'no'],\n ['Sub-pages', includeSubpages ? 'yes' : 'no'],\n ['Concurrency', String(concurrency)],\n ];\n\n const summaryLines = (): string[] => summaryRows().map(([label, value]) => `${label}: ${value}`);\n\n const printSummary = (): void => {\n const w = maxWidth();\n const isSmall = w < 50;\n console.log('');\n if (!isSmall) {\n console.log(boxTop(w));\n console.log(boxLine(w, ui.text.bold(' Summary')));\n console.log(boxSep(w));\n } else {\n console.log(ui.text.bold(' Summary:'));\n }\n\n for (const [label, value] of summaryRows()) {\n console.log(boxRow(w, label, value));\n }\n\n if (!isSmall) {\n console.log(boxBot(w));\n }\n console.log('');\n };\n\n if (legacyMode) {\n const prettyAnswer: string = await ask2('Pretty-print JS files? (y/n)', 'y');\n prettyPrint = prettyAnswer.toLowerCase().startsWith('y');\n console.log(\n ` ${ui.success('✓')} Pretty-print: ${prettyPrint ? ui.success('yes') : ui.error('no')}\\n`\n );\n\n const subpagesAnswer: string = await ask2('Export sub-pages? (y/n)', 'n');\n includeSubpages = subpagesAnswer.toLowerCase().startsWith('y');\n console.log(\n ` ${ui.success('✓')} Sub-pages: ${includeSubpages ? ui.success('yes') : ui.error('no')}\\n`\n );\n\n const concurrencyAnswer: string = await ask2('Download concurrency', '12');\n concurrency = parseInt(concurrencyAnswer, 10) || 12;\n console.log(` ${ui.success('✓')} Concurrency: ${ui.primary(String(concurrency))}\\n`);\n\n printSummary();\n\n const confirm: string = await ask2('Start export? (y/n)', 'y');\n startExport = confirm.toLowerCase().startsWith('y');\n rl2!.close();\n } else {\n let optionStep = 0;\n\n while (true) {\n while (optionStep < 3) {\n if (optionStep === 0) {\n const prettyVal = await select(\n 'Pretty-print JS files?',\n [\n { label: 'Yes', value: 'yes' },\n { label: 'No', value: 'no' },\n ],\n prettyPrint ? 0 : 1,\n {\n headerLines: ['Step 4 : Options'],\n actions: [{ label: 'Previous: output directory', value: 'previous' }],\n footer: 'previous go back · enter next · mouse hover/click',\n }\n );\n\n if (prettyVal === 'previous') {\n outDir = await ask2('Output directory', outDir, [\n 'Step 3 : Output Directory',\n `URL: ${siteUrl}`,\n `Platform: ${platformName}`,\n ]);\n optionStep = 0;\n continue;\n }\n\n prettyPrint = prettyVal === 'yes';\n optionStep = 1;\n continue;\n }\n\n if (optionStep === 1) {\n const subpagesVal = await select(\n 'Export sub-pages?',\n [\n { label: 'No', value: 'no' },\n { label: 'Yes, crawl and export', value: 'yes' },\n ],\n includeSubpages ? 1 : 0,\n {\n headerLines: ['Step 4 : Options'],\n actions: [{ label: 'Previous: pretty-print', value: 'previous' }],\n footer: 'previous go back · enter next · mouse hover/click',\n }\n );\n\n if (subpagesVal === 'previous') {\n optionStep = 0;\n continue;\n }\n\n includeSubpages = subpagesVal === 'yes';\n optionStep = 2;\n continue;\n }\n\n const concurrencyVal = await select(\n 'Download concurrency',\n [\n { label: '6 (slow connection)', value: '6' },\n { label: '12 (default)', value: '12' },\n { label: '20 (fast connection)', value: '20' },\n ],\n concurrency === 6 ? 0 : concurrency === 20 ? 2 : 1,\n {\n headerLines: ['Step 4 : Options'],\n actions: [{ label: 'Previous: sub-pages', value: 'previous' }],\n footer: 'previous go back · enter next · mouse hover/click',\n }\n );\n\n if (concurrencyVal === 'previous') {\n optionStep = 1;\n continue;\n }\n\n concurrency = parseInt(concurrencyVal, 10);\n optionStep = 3;\n }\n\n const confirmVal = await select(\n 'Ready to export?',\n [\n { label: 'Previous: edit options', value: 'previous' },\n { label: 'Next: start now', value: 'next' },\n { label: 'Cancel', value: 'cancel' },\n ],\n 1,\n {\n headerLines: ['Summary', ...summaryLines()],\n footer: 'previous edit options · next start export · mouse hover/click',\n }\n );\n\n if (confirmVal === 'previous') {\n optionStep = 2;\n continue;\n }\n startExport = confirmVal === 'next';\n break;\n }\n }\n\n if (!startExport) {\n console.log(`\\n ${ui.warning('Export cancelled.')}\\n`);\n return;\n }\n\n console.log('');\n\n const { CFG } = await import('../config/index.js');\n CFG.concurrency = concurrency;\n\n const exporter = new FramerExporter(siteUrl, path.resolve(outDir), platformName);\n exporter.prettyPrint = prettyPrint;\n try {\n await exporter.run(includeSubpages);\n } catch (e) {\n const { AntiBotError, formatAntiBotError } = await import('../exporter/anti-bot.js');\n if (e instanceof AntiBotError) {\n console.log(formatAntiBotError(e));\n process.exit(1);\n }\n throw e;\n }\n}\n","import path from 'path';\nimport { URL } from 'url';\nimport { spawnSync } from 'child_process';\nimport pkg from '../../package.json';\nimport { showHelp } from './help.js';\nimport { showBanner } from './banner.js';\nimport { showLoadingIntro } from './cooking.js';\nimport { checkForUpdates } from './update-check.js';\nimport { select } from './select.js';\nimport { ui } from './theme.js';\nimport type { PlatformType } from '../platforms/types.js';\n\nconst VERSION = pkg.version;\n\nfunction extractFlag(args: string[], flag: string): string | null {\n const idx: number = args.indexOf(flag);\n if (idx === -1 || idx + 1 >= args.length) return null;\n const value: string = args[idx + 1];\n args.splice(idx, 2);\n return value;\n}\n\nfunction hasFlag(args: string[], flag: string): boolean {\n const idx: number = args.indexOf(flag);\n if (idx === -1) return false;\n args.splice(idx, 1);\n return true;\n}\n\nasync function showUpdateNotice(): Promise<void> {\n const latest = await checkForUpdates(VERSION);\n if (!latest) return;\n\n if (!process.stdin.isTTY || !process.stdout.isTTY) {\n console.log('');\n console.log(\n ` ${ui.warning('↳')} Update available: ${ui.muted(VERSION)} -> ${ui.success(latest)}`\n );\n console.log(` ${ui.primary(' Run:')} ${ui.primarySoft('npm i -g framer-export@latest')}`);\n console.log('');\n return;\n }\n\n const action = await select(\n 'Update available',\n [\n { label: 'Continue without updating', value: 'continue' },\n { label: 'Update now', value: 'update' },\n ],\n 0,\n {\n headerLines: [\n `Current version: ${VERSION}`,\n `Latest version: ${latest}`,\n 'You can continue now and update later.',\n ],\n footer: 'enter continue · mouse hover/click',\n }\n );\n\n if (action === 'update') {\n console.log(\n ` ${ui.primary('Updating:')} ${ui.primarySoft('npm i -g framer-export@latest')}\\n`\n );\n const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';\n const result = spawnSync(npmCommand, ['i', '-g', 'framer-export@latest'], {\n stdio: 'inherit',\n });\n\n if (result.status === 0) {\n console.log(`\\n ${ui.success('✓')} Updated. Re-run your command to use the new version.\\n`);\n process.exit(0);\n }\n\n console.log(\n `\\n ${ui.error('✗')} Update failed. Run manually: ${ui.primarySoft('npm i -g framer-export@latest')}\\n`\n );\n }\n}\n\nasync function main(): Promise<void> {\n const args: string[] = process.argv.slice(2);\n\n if (args.includes('--version') || args.includes('-v')) {\n console.log(VERSION);\n process.exit(0);\n }\n\n if (args.includes('--about')) {\n const chalk = (await import('chalk')).default;\n showBanner();\n console.log(` ${ui.text.bold('Framer Export')} ${ui.muted(`v${pkg.version}`)}`);\n console.log(` ${ui.text(pkg.description)}\\n`);\n console.log(` ${ui.text.bold('Author')} ${ui.primary('Dany (danbenba)')}`);\n console.log(\n ` ${ui.text.bold('Portfolio')} ${chalk.underline.hex('#FAB283')('https://github.com/danbenba')}`\n );\n console.log(\n ` ${ui.text.bold('GitHub')} ${chalk.underline.hex('#FAB283')(pkg.repository.url.replace('git+', '').replace('.git', ''))}`\n );\n console.log(\n ` ${ui.text.bold('npm')} ${chalk.underline.hex('#FAB283')(`https://www.npmjs.com/package/${pkg.name}`)}`\n );\n console.log(` ${ui.text.bold('License')} ${ui.success(pkg.license)}`);\n console.log(` ${ui.text.bold('Node')} ${ui.muted(`>=${pkg.engines.node}`)}`);\n console.log('');\n process.exit(0);\n }\n\n if (args.includes('--help') || args.includes('-h')) {\n showHelp();\n process.exit(0);\n }\n\n await showLoadingIntro(VERSION);\n await showUpdateNotice();\n\n if (args.includes('--setup')) {\n hasFlag(args, '--setup');\n const legacyMode: boolean = hasFlag(args, '--legacy-mode');\n const { runSetup } = await import('./setup.js');\n await runSetup(legacyMode);\n return;\n }\n\n if (!args.length) {\n const { runSetup } = await import('./setup.js');\n await runSetup(false);\n return;\n }\n\n const platformOverride = extractFlag(args, '--platform') as PlatformType | null;\n const includeSubpages: boolean = hasFlag(args, '--subpages');\n\n showBanner();\n\n const url: string = args[0];\n\n try {\n new URL(url);\n } catch {\n console.log(` ${ui.error('✗')} ${ui.error.bold('Invalid URL:')} ${ui.text(url)}`);\n console.log(` ${ui.muted('Expected: https://yoursite.framer.app')}\\n`);\n process.exit(1);\n }\n\n const { FramerExporter, deriveOutputName } = await import('../exporter/index.js');\n const { detectPlatform } = await import('../platforms/index.js');\n\n const detected = platformOverride || detectPlatform(url).name;\n const defaultDir: string = deriveOutputName(url, detected as PlatformType);\n const out: string = args[1] || `./${defaultDir}`;\n\n try {\n await new FramerExporter(url, path.resolve(out), platformOverride || undefined).run(\n includeSubpages\n );\n } catch (e) {\n const { AntiBotError, formatAntiBotError } = await import('../exporter/anti-bot.js');\n if (e instanceof AntiBotError) {\n console.log(formatAntiBotError(e));\n process.exit(1);\n }\n const chalk = (await import('chalk')).default;\n console.log(\n `\\n ${ui.error('✗')} ${ui.error.bold('FAILED:')} ${ui.text((e as Error).message)}`\n );\n console.log(chalk.gray((e as Error).stack || ''));\n process.exit(1);\n }\n}\n\nmain();\n","import { showBanner } from './banner.js';\nimport { chip, ui } from './theme.js';\nimport { platformsByCategory, CATEGORY_LABELS, CATEGORY_ORDER } from '../platforms/index.js';\n\nexport function showHelp(): void {\n showBanner();\n\n console.log(`${ui.text.bold(' USAGE')} ${chip('cli')}\\n`);\n console.log(\n ` ${ui.primary('framer-export')} ${ui.warning('<url>')} ${ui.muted('[output-dir]')}`\n );\n console.log(\n ` ${ui.primary('fexport')} ${ui.warning('<url>')} ${ui.muted('[output-dir]')}`\n );\n\n console.log('');\n console.log(ui.text.bold(' OPTIONS\\n'));\n\n const opts: Array<[string, string]> = [\n ['--setup', 'Launch the interactive setup assistant'],\n ['--platform <p>', 'Force platform by id (e.g. framer, shopify, notion)'],\n ['--subpages', 'Crawl and export sub-pages'],\n ['--legacy-mode', 'Use text input instead of arrow selection'],\n ['--help, -h', 'Show this help message'],\n ];\n\n for (const [flag, desc] of opts) {\n console.log(` ${ui.success(flag.padEnd(18))} ${ui.text(desc)}`);\n }\n\n console.log('');\n console.log(ui.text.bold(' SUPPORTED PLATFORMS\\n'));\n\n const grouped = platformsByCategory();\n for (const cat of CATEGORY_ORDER) {\n const names = grouped[cat].map((handler) => handler.displayName).join(', ');\n console.log(` ${ui.primary(CATEGORY_LABELS[cat].padEnd(22))} ${ui.muted(names)}`);\n }\n\n console.log('');\n console.log(ui.text.bold(' EXAMPLES\\n'));\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://mysite.framer.app')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://mysite.webflow.io')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.warning('https://user.wixsite.com/my-site')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--platform webflow')} ${ui.warning('https://custom.com')}`\n );\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--subpages')} ${ui.warning('https://mysite.com')}`\n );\n console.log(` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--setup')}`);\n console.log(\n ` ${ui.muted('$')} ${ui.primary('framer-export')} ${ui.success('--setup --legacy-mode')}`\n );\n console.log('');\n}\n","import https from 'https';\n\nexport async function checkForUpdates(currentVersion: string): Promise<string | null> {\n return new Promise((resolve) => {\n const req = https.get(\n 'https://registry.npmjs.org/framer-export/latest',\n { timeout: 3000 },\n (res) => {\n let data = '';\n res.on('data', (chunk) => (data += chunk));\n res.on('end', () => {\n try {\n const json = JSON.parse(data);\n const latest = json.version;\n if (!latest) return resolve(null);\n if (isNewerVersion(latest, currentVersion)) return resolve(latest);\n resolve(null);\n } catch {\n resolve(null);\n }\n });\n }\n );\n req.on('error', () => resolve(null));\n req.on('timeout', () => {\n req.destroy();\n resolve(null);\n });\n });\n}\n\nfunction isNewerVersion(latest: string, current: string): boolean {\n const latestParts = parseVersion(latest);\n const currentParts = parseVersion(current);\n\n for (let i = 0; i < Math.max(latestParts.length, currentParts.length); i++) {\n const latestPart = latestParts[i] ?? 0;\n const currentPart = currentParts[i] ?? 0;\n if (latestPart > currentPart) return true;\n if (latestPart < currentPart) return false;\n }\n\n return false;\n}\n\nfunction parseVersion(version: string): number[] {\n return version\n .replace(/^v/, '')\n .split(/[.-]/)\n .map((part) => Number.parseInt(part, 10))\n .filter((part) => Number.isFinite(part));\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,aAAe;AAAA,MACf,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,KAAO;AAAA,QACL,iBAAiB;AAAA,QACjB,SAAW;AAAA,QACX,cAAgB;AAAA,MAClB;AAAA,MACA,OAAS;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,OAAS;AAAA,QACT,KAAO;AAAA,QACP,OAAS;AAAA,QACT,WAAa;AAAA,QACb,QAAU;AAAA,QACV,g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AAEjC,QAAM,WAAW,oBAAoBA,gBAAe,GAAG,EAAE;AACzD,QAAM,aAAqBD,kBAAiB,KAAK,QAAwB;AACzE,QAAM,MAAc,KAAK,CAAC,KAAK,KAAK,UAAU;AAE9C,MAAI;AACF,UAAM,IAAID,gBAAe,KAAKG,MAAK,QAAQ,GAAG,GAAG,oBAAoB,MAAS,EAAE;AAAA,MAC9E;AAAA,IACF;AAAA,EACF,SAAS,GAAG;AACV,UAAM,EAAE,cAAAC,eAAc,oBAAAC,oBAAmB,IAAI,MAAM;AACnD,QAAI,aAAaD,eAAc;AAC7B,cAAQ,IAAIC,oBAAmB,CAAC,CAAC;AACjC,cAAQ,KAAK,CAAC;AAAA,IAChB;AACA,UAAMR,UAAS,MAAM,OAAO,OAAO,GAAG;AACtC,YAAQ;AAAA,MACN;AAAA,IAAO,GAAG,MAAM,QAAG,CAAC,IAAI,GAAG,MAAM,KAAK,SAAS,CAAC,IAAI,GAAG,KAAM,EAAY,OAAO,CAAC;AAAA,IACnF;AACA,YAAQ,IAAIA,OAAM,KAAM,EAAY,SAAS,EAAE,CAAC;AAChD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAEA,KAAK;","names":["FONT_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","IMG_EXTS","FONT_EXTS","VIDEO_EXTS","chalk","chalk","output","URL","https","URL","chalk","path","init_download","fs","path","fs","path","fs","path","stdin","stdout","target","goal","centerText","fs","path","chalk","init_download","chalk","cat","readline","stdin","stdout","path","URL","chalk","printSummary","CFG","AntiBotError","formatAntiBotError","path","URL","chalk","runSetup","URL","FramerExporter","deriveOutputName","detectPlatform","path","AntiBotError","formatAntiBotError"]}
|