2026-03-02 14:15:39 +00:00
|
|
|
import { createApp } from 'vue'
|
|
|
|
|
import { createPinia } from 'pinia'
|
|
|
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
import './styles/main.css'
|
2026-03-03 20:37:00 +00:00
|
|
|
import { initializePlugins } from './plugins'
|
2026-03-02 14:15:39 +00:00
|
|
|
|
2026-03-04 12:41:26 +00:00
|
|
|
// Capture embedded flag before router init (survives SPA navigation)
|
|
|
|
|
// Only embedded when explicitly requested via ?embedded param
|
|
|
|
|
const _embeddedFlag = new URLSearchParams(window.location.search).has('embedded')
|
|
|
|
|
;(window as unknown as Record<string, unknown>).__AIUI_EMBEDDED__ = _embeddedFlag
|
|
|
|
|
|
2026-03-02 14:15:39 +00:00
|
|
|
const router = createRouter({
|
2026-03-04 12:41:26 +00:00
|
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
2026-03-02 14:15:39 +00:00
|
|
|
routes: [
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
name: 'chat',
|
|
|
|
|
component: () => import('./pages/ChatPage.vue'),
|
|
|
|
|
},
|
2026-03-02 14:20:34 +00:00
|
|
|
{
|
|
|
|
|
path: '/widget-demo',
|
|
|
|
|
name: 'widget-demo',
|
|
|
|
|
component: () => import('./pages/WidgetDemoPage.vue'),
|
|
|
|
|
},
|
2026-03-04 01:22:01 +00:00
|
|
|
{
|
|
|
|
|
path: '/view/:nostrAddr',
|
|
|
|
|
name: 'conversation-viewer',
|
|
|
|
|
component: () => import('./pages/ConversationViewerPage.vue'),
|
|
|
|
|
},
|
2026-03-02 14:15:39 +00:00
|
|
|
],
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const app = createApp(App)
|
|
|
|
|
app.use(createPinia())
|
|
|
|
|
app.use(router)
|
2026-03-03 20:37:00 +00:00
|
|
|
|
|
|
|
|
initializePlugins().catch((err) => {
|
|
|
|
|
console.error('[AIUI] Failed to initialize plugins:', err)
|
|
|
|
|
})
|
|
|
|
|
|
2026-03-02 14:15:39 +00:00
|
|
|
app.mount('#app')
|