// Runs in , before the first frame (#203): this browser's theme and font (#359), from their // cookies, and whether the last visit here was an admin's, so the link to Admin is there from the // start. The server wrote both into the page while it served it; the page is a static file now. // A script of its own, not part of app.js, which loads after the markup (web/build.mts). (() => { const r = document.documentElement; const cookie = (re: RegExp) => re.exec(document.cookie); const theme = cookie(/(?:^|; )ipx_theme=([a-z]{1,20})\.(light|dark|auto)(?:;|$)/); if (theme) { r.dataset.theme = theme[1]; r.dataset.choice = theme[2]; if (theme[2] !== 'auto') r.dataset.mode = theme[2]; } const font = cookie(/(?:^|; )ipx_font=([a-z]{1,10})(?:;|$)/); if (font) r.dataset.font = font[1]; const rfont = cookie(/(?:^|; )ipx_rfont=([a-z]{1,10})(?:;|$)/); if (rfont) r.dataset.rfont = rfont[1]; try { if (localStorage.getItem('ipx.admin') === '1') r.dataset.admin = ''; } catch { /* storage refused */ } })();