import PrimeVue from 'primevue/config'
import Aura from '@primeuix/themes/aura'
import ToastService from 'primevue/toastservice'
import ConfirmationService from 'primevue/confirmationservice'
import Tooltip from 'primevue/tooltip'
import StyleClass from 'primevue/styleclass'
import Button from 'primevue/button'
import InputText from 'primevue/inputtext'
import Password from 'primevue/password'
import Message from 'primevue/message'
import Badge from 'primevue/badge'
import Avatar from 'primevue/avatar'
import Tag from 'primevue/tag'

import BaseTitle from './components/base/BaseTitle.vue'
import BaseSubtitle from './components/base/BaseSubtitle.vue'
import BaseButton from './components/base/BaseButton.vue'
import BaseCard from './components/base/BaseCard.vue'
import BaseModal from './components/base/BaseModal.vue'
import BaseIcon from './components/base/BaseIcon.vue'
import BaseKpiCard from './components/base/BaseKpiCard.vue'
import BaseTextButton from './components/base/BaseTextButton.vue'
import BaseToast from './components/base/BaseToast.vue'
import BaseUserIcon from './components/base/BaseUserIcon.vue'
import BaseSearch from './components/base/BaseSearch.vue'
import BaseInputText from './components/base/BaseInputText.vue'
import BaseSelect from './components/base/BaseSelect.vue'
import BaseMultiSelect from './components/base/BaseMultiSelect.vue'
import BaseDatePicker from './components/base/BaseDatePicker.vue'
import BaseInputNumber from './components/base/BaseInputNumber.vue'
import BaseCheckbox from './components/base/BaseCheckbox.vue'
import BaseTextarea from './components/base/BaseTextarea.vue'
import BaseAlert from './components/base/BaseAlert.vue'
import BaseStatusBadge from './components/base/BaseStatusBadge.vue'
import BaseSectionHeader from './components/base/BaseSectionHeader.vue'
import BaseIndex from './components/base/BaseIndex.vue'
import BaseForm from './components/base/BaseForm.vue'
import BasePrimaryButton from './components/base/BasePrimaryButton.vue'
import BaseSecondaryButton from './components/base/BaseSecondaryButton.vue'
import BaseOutlinedButton from './components/base/BaseOutlinedButton.vue'
import BaseTab from './components/base/BaseTab.vue'
import BaseStepper from './components/base/BaseStepper.vue'
import BaseEditor from './components/base/BaseEditor.vue'
import BaseDataTable from './components/base/BaseDataTable.vue'
import BaseColumn from './components/base/BaseColumn.vue'
import BaseProgressSpinner from './components/base/BaseProgressSpinner.vue'
import BaseLoadingMessage from './components/base/BaseLoadingMessage.vue'
import BaseConfirmDeleteModal from './components/base/BaseConfirmDeleteModal.vue'
import BaseAccordion from './components/base/BaseAccordion.vue'
import BaseDraggable from './components/base/BaseDraggable.vue'
import BaseTimeline from './components/base/BaseTimeline.vue'
import BaseInfoMassage from './components/base/BaseInfoMassage.vue'
import BaseSuccessCheckbox from './components/base/BaseSuccessCheckbox.vue'
import BaseOrganizationChart from './components/base/BaseOrganizationChart.vue'

export { default as App } from './App.vue'
export { default as router } from './router/index.js'

export { default as LoginPage } from './pages/auth/LoginPage.vue'
export { default as DashboardPage } from './pages/dashboard/DashboardPage.vue'
export { default as NotFound } from './pages/pages/NotFound.vue'
export { default as Oops } from './pages/pages/Oops.vue'
export { default as AccessDenied } from './pages/pages/AccessDenied.vue'

export { default as AppLayout } from './layout/AppLayout.vue'
export { default as AuthLayout } from './layout/AuthLayout.vue'

export { useAuth } from './composables/useAuth.js'
export { useLayout } from './composables/layout/layout.js'
export { usePermissions } from './composables/usePermissions.js'
export { useNavigation } from './composables/useNavigation.js'

export { applyThemeFromLayoutConfig } from './themeBootstrap.js'

export function installMaestro(app) {
    app.use(PrimeVue, {
        theme: {
            preset: Aura,
            options: {
                darkModeSelector: '.app-dark',
                cssLayer: {
                    name: 'primevue',
                    order: 'tailwind-base, primevue, tailwind-utilities',
                },
            },
        },
    })
    app.use(ToastService)
    app.use(ConfirmationService)
    app.directive('tooltip', Tooltip)
    app.directive('styleclass', StyleClass)
    app.component('Button', Button)
    app.component('InputText', InputText)
    app.component('Password', Password)
    app.component('Message', Message)
    app.component('Badge', Badge)
    app.component('Avatar', Avatar)
    app.component('Tag', Tag)

    app.component('BaseTitle', BaseTitle)
    app.component('BaseSubtitle', BaseSubtitle)
    app.component('BaseButton', BaseButton)
    app.component('BaseCard', BaseCard)
    app.component('BaseModal', BaseModal)
    app.component('BaseIcon', BaseIcon)
    app.component('BaseKpiCard', BaseKpiCard)
    app.component('BaseTextButton', BaseTextButton)
    app.component('BaseToast', BaseToast)
    app.component('BaseUserIcon', BaseUserIcon)
    app.component('BaseSearch', BaseSearch)
    app.component('BaseInputText', BaseInputText)
    app.component('BaseSelect', BaseSelect)
    app.component('BaseMultiSelect', BaseMultiSelect)
    app.component('BaseDatePicker', BaseDatePicker)
    app.component('BaseInputNumber', BaseInputNumber)
    app.component('BaseCheckbox', BaseCheckbox)
    app.component('BaseTextarea', BaseTextarea)
    app.component('BaseAlert', BaseAlert)
    app.component('BaseStatusBadge', BaseStatusBadge)
    app.component('BaseSectionHeader', BaseSectionHeader)
    app.component('BaseIndex', BaseIndex)
    app.component('BaseForm', BaseForm)
    app.component('BasePrimaryButton', BasePrimaryButton)
    app.component('BaseSecondaryButton', BaseSecondaryButton)
    app.component('BaseOutlinedButton', BaseOutlinedButton)
    app.component('BaseTab', BaseTab)
    app.component('BaseStepper', BaseStepper)
    app.component('BaseEditor', BaseEditor)
    app.component('BaseDataTable', BaseDataTable)
    app.component('BaseColumn', BaseColumn)
    app.component('BaseProgressSpinner', BaseProgressSpinner)
    app.component('BaseLoadingMessage', BaseLoadingMessage)
    app.component('BaseConfirmDeleteModal', BaseConfirmDeleteModal)
    app.component('BaseAccordion', BaseAccordion)
    app.component('BaseDraggable', BaseDraggable)
    app.component('BaseTimeline', BaseTimeline)
    app.component('BaseInfoMassage', BaseInfoMassage)
    app.component('BaseSuccessCheckbox', BaseSuccessCheckbox)
    app.component('BaseOrganizationChart', BaseOrganizationChart)
}
