const runtimeUrl = new URL('/cloud/runtime.js', location.origin); const assetVersion = new URL(import.meta.url).searchParams.get('v'); if (assetVersion) runtimeUrl.searchParams.set('v', assetVersion); const { bindPageCleanup, byId, initializeSession, openReinstall, reinstall, readBootstrap, selectVmByApiId, showError, } = await import(runtimeUrl.href); export async function initialize() { try { const bootstrap = readBootstrap('reinstall-bootstrap'); if (!await initializeSession('reinstall', bootstrap?.user)) return; bindPageCleanup(); const vm = await selectVmByApiId(document.body.dataset.vmId || '', bootstrap?.vm); byId('reinstall-form')?.addEventListener('submit', reinstall); await openReinstall(vm, bootstrap); } catch (error) { showError('cloud-page-error', error.message); } }