safely inside the JSON literal
const safeData = JSON.stringify(state).replace(/<\/script/gi, "<\\/script");
// Replace the two configuration lines — these are unique
html = html.replace(/const READ_ONLY = false;/, "const READ_ONLY = true;");
html = html.replace(/const EMBEDDED_DATA = null;/, "const EMBEDDED_DATA = " + safeData + ";");
const date = new Date().toISOString().slice(0, 10);
const blob = new Blob([html], { type: "text/html;charset=utf-8" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `3dts-install-structure-readonly-${date}.html`;
a.click();
URL.revokeObjectURL(url);
toast("Read-only snapshot downloaded — email it to your PMs");
}
renderHeaderActions();
render();