/* Regenerate standalone.html by inlining style.css + engine.js + app.js into
index.html (README: standalone.html must never be edited directly). */
'use strict';
const fs = require('fs');
const path = require('path');
const here = (f) => path.join(__dirname, f);
const read = (f) => fs.readFileSync(here(f), 'utf8');
let html = read('index.html');
const inline = (needle, replacement) => {
if (!html.includes(needle)) throw new Error('index.html missing: ' + needle);
html = html.replace(needle, () => replacement);
};
inline('',
'');
inline('',
'');
inline('',
'');
inline('',
'');
inline('',
'');
inline('',
'');
fs.writeFileSync(here('standalone.html'), html);
console.log('standalone.html regenerated (' + html.length + ' bytes)');