import { createApp } from 'vue'
import { addCollection } from '@iconify/vue'

import App from './App.vue'
import { setupPlugins } from './plugins'

// 使用本地图标数据，避免远程 API 调用
import mdiIcons from '@iconify/json/json/mdi.json'
import lucideIcons from '@iconify/json/json/lucide.json'
import flagIcons from '@iconify/json/json/flag.json'
import carbonIcons from '@iconify/json/json/carbon.json'

addCollection(mdiIcons)
addCollection(lucideIcons)
addCollection(flagIcons)
addCollection(carbonIcons)

import '@/assets/index.css'
import '@/assets/scrollbar.css'
import '@/assets/themes.css'
import '@/assets/chart-theme.css'
import 'vue-sonner/style.css' // vue sonner style

import '@/utils/env'

function bootstrap() {
  const app = createApp(App)

  setupPlugins(app)

  app.mount('#app')
}

bootstrap()
