// prep.mjs concern module — capture media + brand fonts → the HyperFrames
// project's public/ tree, plus the @font-face block extraction. Pure file I/O;
// no section_plan / group_spec knowledge. Split out of prep.mjs (Steps 2/2b/2c)
// to keep the orchestrator lean.
import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
import { extname, join } from "node:path";
// `.bin` is the capture-stage fallback name for images with unrecognized MIME
// (typically image/* with a missing or CDN-rewritten Content-Type). Downstream
// Phase 4b workers reference them as
; browsers render by magic bytes
// and almost all display correctly. Include it in the allowlist to avoid orphaning files.
const ASSET_EXTS = new Set([
".png",
".jpg",
".jpeg",
".webp",
".svg",
".bin",
// Video extensions — Phase 3 frequently quotes hero/demo .mp4 from the
// capture. Forgetting these forces Phase 4b workers to substitute poster
// .webp, losing motion fidelity. Keep in sync with the playable formats
// hyperframes-core accepts in