function installStyles({ invalidation }) {
let elements = new Set();
function detach(elements) {
for (let n of elements) {
n.remove();
elements.delete(n);
}
}
function attach(nodes) {
for (let n of nodes) {
document.head.prepend(n);
elements.add(n);
}
}
invalidation.then(() => detach(elements));
detach(elements);
const newStyleElements = new Set(
[html`<style>${reset}`, html`<style>${main}`].reverse()
);
attach(newStyleElements);
}