import type { WalkthroughDiagram } from "./types.ts"; interface ViewerOptions { mode?: "local" | "server"; shareServerUrl?: string; diagramId?: string; existingShareUrl?: string; baseUrl?: string; } export function generateViewerHTML(diagram: WalkthroughDiagram, gitHash: string = "dev", projectRoot: string = "", options: ViewerOptions = {}): string { const diagramJSON = JSON.stringify(diagram).replace(/<\//g, "<\\/"); const { mode = "local", shareServerUrl = "", diagramId = "", existingShareUrl = "", baseUrl = "" } = options; return `
${escapeHTML(diagram.code)}