// Bootstrap the Dioxus WASM UI (external file so CSP can stay strict). function showError(err) { console.error("[nx9-auth-ui]", err); const el = document.getElementById("main"); if (!el) return; const msg = err && err.stack ? err.stack : String(err); el.innerHTML = "
" + "

UI failed to start

" + "
" +
    msg +
    "
"; } function setStatus(text) { const el = document.getElementById("boot-loader"); if (el) { el.innerHTML = "

" + text + "

"; } } setStatus("Loading nx9-auth UI…"); import init from "/nx9_auth_ui.js"; // Call with no args: wasm-bindgen resolves nx9_auth_ui_bg.wasm next to // nx9_auth_ui.js via import.meta.url (avoids the deprecated string form). init() .then(() => { console.info("[nx9-auth-ui] WASM started"); const el = document.getElementById("main"); if (el) el.dataset.dioxusMounted = "1"; const loader = document.getElementById("boot-loader"); if (loader) loader.remove(); }) .catch(showError);