|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function bootstrap() { |
|
|
try { |
|
|
|
|
|
const { loadArtifacts } = await import('./init.js'); |
|
|
await loadArtifacts(); |
|
|
|
|
|
|
|
|
const { router } = await import('./utils/router.js'); |
|
|
|
|
|
|
|
|
|
|
|
const { initializeUI } = await import('./main.js'); |
|
|
await initializeUI(); |
|
|
} catch (error) { |
|
|
console.error('Bootstrap failed:', error); |
|
|
|
|
|
const mainContent = document.getElementById('main-content'); |
|
|
if (mainContent) { |
|
|
mainContent.innerHTML = ` |
|
|
<div class="p-8 text-center"> |
|
|
<h2 class="text-2xl font-bold text-red-600 mb-4">Failed to Load Application</h2> |
|
|
<p class="text-gray-700 mb-4">Please refresh the page. If the problem persists, contact support.</p> |
|
|
<pre class="text-left text-sm bg-gray-100 p-4 rounded overflow-auto">${error.stack || error.message}</pre> |
|
|
</div> |
|
|
`; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bootstrap(); |
|
|
|
|
|
|