luaMinifier = {
const html = await FileAttachment("https __mothereff.in_lua-minifier.html").html();
const script = html.querySelector('script');
const text = script.textContent;
const blob = new Blob([text], { type: 'text/javascript' });
const url = URL.createObjectURL(blob);
const proxy = htl.html`<iframe style="display:none">`;
document.body.appendChild(proxy)
invalidation.then(() => proxy.remove())
const before = new Set();
for (const key of Object.keys(proxy.contentWindow)) {
before.add(key);
}
await new Promise((resolve) => {
proxy.contentWindow.__resolve = resolve;
proxy.contentWindow.document.write(`
<script src="${url}"></script>
<script>__resolve()</script>
`);
});
delete proxy.contentWindow['__resolve'];
const after = new Set();
for (const key of Object.keys(proxy.contentWindow)) {
if (before.has(key)) continue;
after.add(key);
}
const lib = {};
for (const key of after) {
const value = proxy.contentWindow[key];
delete proxy.contentWindow[key];
lib[key] = value;
}
return lib;
}