import { env } from "cloudflare:workers";
import { hostKey, isForgeHost, manifestKey, objectKey, pagesDomain, slotKey } from "./config";
import type { Manifest, ManifestFile, SitePointer } from "./config";
const POINTER_CACHE_SECONDS = 60;
const MANIFEST_CACHE_SECONDS = 3600;
const HTTP_OK = 200;
const PREVIEW_PREFIX = /^\/_pr\/(\d+)(\/.*)?$/;
const CONTENT_TYPES: Record<string, string> = {
html: "text/html; charset=utf-8",
htm: "text/html; charset=utf-8",
css: "text/css; charset=utf-8",
js: "text/javascript; charset=utf-8",
mjs: "text/javascript; charset=utf-8",
json: "application/json",
map: "application/json",
webmanifest: "application/manifest+json",
txt: "text/plain; charset=utf-8",
md: "text/plain; charset=utf-8",
xml: "application/xml",
svg: "image/svg+xml",
png: "image/png",
jpg: "image/jpeg",
jpeg: "image/jpeg",
gif: "image/gif",
webp: "image/webp",
avif: "image/avif",
ico: "image/x-icon",
woff: "font/woff",
woff2: "font/woff2",
ttf: "font/ttf",
otf: "font/otf",
wasm: "application/wasm",
pdf: "application/pdf",
mp4: "video/mp4",
webm: "video/webm",
mp3: "audio/mpeg",
wav: "audio/wav",
};