// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  devtools: { enabled: false },
  ssr: true,
  routeRules: {
    "/api/**": {
      proxy: 'https://api-anahita.liara.run/**'
    },
    "/uploads/**": {
      proxy: 'https://api-anahita.liara.run/uploads/**'
    }
  },
  modules: [
    '@pinia/nuxt',
    '@nuxtjs/i18n',
    '@nuxtjs/device',
    'nuxt-viewport',
    'nuxt-swiper',
    'nuxt-lodash',
    'nuxt3-leaflet',
    'nuxt-icon',
    'nuxt-primevue',
  ],
  css: [
    '@/assets/css/fonts.css',
    '@/assets/css/main.css',
    '@/assets/css/theme.css',
  ],
  postcss: {
    plugins: {
      tailwindcss: {},
      autoprefixer: {},
    },
  },
  primevue: {
    options: {
      ripple: true,
      locale: {
        firstDayOfWeek: 6,
        dayNames: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'],
        dayNamesShort: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
        dayNamesMin: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'],
        monthNames: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
        monthNamesShort: ['فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'],
      }
    },
    directives: { include: ['Ripple', 'Tooltip'] },
    composables: { include: ['useDialog', 'useToast'] },
    cssLayerOrder: 'tailwind-base, primevue, tailwind-utilities, utilities'
  },
  components: {
    dirs: ['~/components']
  },
  pinia: {
    storesDirs: ['./stores/**'],
  },
  app: {
    rootId: 'app',
    rootTag: 'body',
    head: {
      htmlAttrs: { lang: 'fa', dir: 'rtl' },
      meta: [
        { name: 'theme-color', content: '#47B556' },
        { name: 'viewport', content: 'width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover' }
      ]
    }
  },
  vite: {
    vue: {
      script: {
        defineModel: true,
        propsDestructure: true
      }
    },
  },
  viewport: {
    breakpoints: {
      desktop: 1025,
      mobile: 390,
    },
    defaultBreakpoints: {
      desktop: 'desktop',
      mobile: 'mobile',
    },
    fallbackBreakpoint: undefined,
  },
  i18n: {
    locales: [{
      code: 'fa',
      file: 'fa.json'
    }],
    langDir: 'locales',
    defaultLocale: 'fa'
  }
})
