import { createApp } from 'vue'
import App from './App.vue'
import { initAuth } from './services/authService'
import DialogService from 'primevue/dialogservice'

import PrimeVue from 'primevue/config'
import ToastService from 'primevue/toastservice'
import ConfirmationService from 'primevue/confirmationservice'

import Aura from '@primeuix/themes/aura'
import { ru } from 'primelocale/js/ru.js'

import InputText from 'primevue/inputtext'
import Select from 'primevue/select'
import DatePicker from 'primevue/datepicker'
import InputNumber from 'primevue/inputnumber'
import Button from 'primevue/button'
import MultiSelect from 'primevue/multiselect'
import FileUpload from 'primevue/fileupload';

import '@/assets/css/main.css'

await initAuth()


const app = createApp(App)

// Подключаем PrimeVue
app.use(PrimeVue, {
    theme: {
        preset: Aura,
        options: {
            prefix: 'p',
            darkModeSelector: '.my-app-dark',
            cssLayer: false
        }
    },
    locale: {
        ...ru,
        emptyMessage: 'Нет доступных вариантов',
        dateFormat: 'dd.mm.yy'
    }
})

app.use(ToastService)
app.use(ConfirmationService)
app.use(DialogService)

app.component('InputText', InputText)
app.component('Select', Select)
app.component('DatePicker', DatePicker)
app.component('InputNumber', InputNumber)
app.component('Button', Button)
app.component('MultiSelect', MultiSelect)
app.component('FileUpload', FileUpload)

app.mount('#app_deal')
