import './assets/preflight.css'
import './assets/main.css'

import { createApp, markRaw } from 'vue'
import i18n from '@/i18n/i18n'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'
import { usePlayerStore } from './stores/player'
import { useApplicationStore } from './stores/application'

const app = createApp(App)
const pina = createPinia()

pina.use(({ store }) => {
    store.$router = markRaw(router)
});
pina.use(piniaPluginPersistedstate)

app.use(pina)
app.use(router)

const player = usePlayerStore()
player.init()

const application = useApplicationStore()
application.init()

i18n.global.locale.value = application.language

/*
const websocket = useWebsocketStore()
websocket.init()
*/
app.use(i18n)
app.mount('#app')

