import './assets/styles/main.sass';
import { createApp } from 'vue';
import { WagmiPlugin } from '@wagmi/vue';
// VueQueryPlugin is required by @wagmi/vue — it provides the TanStack Query context
// that Wagmi uses internally for its reactive data hooks (useAccount, useConnect, etc.).
import { VueQueryPlugin } from '@tanstack/vue-query';
import { createHarbConfig } from '@harb/web3';
import { initAnalytics } from '@harb/analytics';
import App from './App.vue';
import router from './router';

initAnalytics(import.meta.env.VITE_UMAMI_URL, import.meta.env.VITE_UMAMI_WEBSITE_ID);

const rpcUrl = import.meta.env.VITE_LOCAL_RPC_URL ?? '/api/rpc';
const config = createHarbConfig({ rpcUrl });

const app = createApp(App);
app.use(VueQueryPlugin);
app.use(WagmiPlugin, { config });
app.use(router);
app.mount('#app');
