<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/Rounded.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
    <title>EHS Suite</title>
    
    <!-- PWA Meta Tags (BrandingProvider updates title and theme-color at runtime) -->
    <meta name="theme-color" content="#3b82f6" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-mobile-web-app-title" content="EHS Suite" />
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="application-name" content="EHS Suite" />
    
    <!-- Additional iOS PWA Meta Tags -->
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-TileColor" content="#3b82f6" />
    <meta name="msapplication-config" content="/browserconfig.xml" />
    
    <!-- PWA Manifest -->
    <link rel="manifest" href="/manifest.json" />
    
    <!-- Apple Touch Icons -->
    <link rel="apple-touch-icon" href="/Rounded.svg" />
    <link rel="apple-touch-icon" sizes="152x152" href="/Rounded.svg" />
    <link rel="apple-touch-icon" sizes="180x180" href="/Rounded.svg" />
    <link rel="apple-touch-icon" sizes="167x167" href="/Rounded.svg" />
    
    <!-- Deep Link Meta Tags -->
    <meta property="og:title" content="EHS Inspection System" />
    <meta property="og:description" content="Mobile inspection management system with QR code scanning" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="/" />
    <script type="module" crossorigin src="/assets/index-26a38fda.js"></script>
    <link rel="stylesheet" href="/assets/index-19452ca0.css">
  </head>
  <body>
    <div id="root"></div>
    
    <!-- Immediately unregister all service workers to fix dev server issues -->
    <script>
      (async function() {
        if ('serviceWorker' in navigator) {
          try {
            const registrations = await navigator.serviceWorker.getRegistrations();
            for (const registration of registrations) {
              await registration.unregister();
              console.log('Unregistered service worker:', registration.scope);
            }
            // Clear all caches
            if ('caches' in window) {
              const cacheNames = await caches.keys();
              await Promise.all(cacheNames.map(name => caches.delete(name)));
              console.log('Cleared all caches');
            }
          } catch (error) {
            console.error('Error unregistering service workers:', error);
          }
        }
      })();
    </script>
    
    
    
    <!-- PWA disabled: only unregister any existing service workers (no registration). -->
    <script>
      if ('serviceWorker' in navigator) {
        window.addEventListener('load', async () => {
          try {
            const registrations = await navigator.serviceWorker.getRegistrations();
            for (const registration of registrations) await registration.unregister();
            if ('caches' in window) {
              const names = await caches.keys();
              await Promise.all(names.map(function (n) { return caches.delete(n); }));
            }
          } catch (error) {
            console.error('Service worker cleanup failed:', error);
          }
        });
      }
    </script>
  </body>
</html>
