import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import { loadThirdPartyScripts } from "./utils/deferThirdParty";
import { initWebVitals } from "./utils/webVitals";

// Load third-party scripts after page is interactive (production only)
if (import.meta.env.PROD) {
  loadThirdPartyScripts();
}

// Real-user Core Web Vitals monitoring (LCP, CLS, INP, FCP, TTFB) — pushed to
// the GTM dataLayer as `web_vitals` events so any analytics destination wired
// up in Tag Manager can verify deploy-time improvements.
initWebVitals();

createRoot(document.getElementById("root")!).render(<App />);
