/**
 * WAHRB Booking Wizard — Entry Point
 *
 * Mounts the React wizard application into the #wahrb-wizard-root element.
 * Sets up React Query, MUI Theme, and i18n providers.
 */
import React, { StrictMode } from 'react';
import ReactDOM from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ThemeProvider, CssBaseline } from '@mui/material';
import WizardApp from './App';
import theme from './theme';
import './i18n';

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 5 * 60 * 1000,
      retry: 1,
      refetchOnWindowFocus: false,
    },
  },
});

const rootElement = document.getElementById('wahrb-wizard-root');

if (rootElement) {
  ReactDOM.createRoot(rootElement).render(
    <StrictMode>
      <QueryClientProvider client={queryClient}>
        <ThemeProvider theme={theme}>
          <CssBaseline />
          <WizardApp />
        </ThemeProvider>
      </QueryClientProvider>
    </StrictMode>
  );
}
