// 37 FORGE — Shared components
const {
  useState,
  useEffect,
  useRef,
  useMemo
} = React;

// ============================================================
// Utility / status bar (top of every page)
// ============================================================
function UtilBar() {
  const [ts, setTs] = useState(() => formatStamp(new Date()));
  useEffect(() => {
    const id = setInterval(() => setTs(formatStamp(new Date())), 1000);
    return () => clearInterval(id);
  }, []);
  return /*#__PURE__*/React.createElement("div", {
    className: "util"
  }, /*#__PURE__*/React.createElement("div", {
    className: "grp"
  }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
    className: "pulse-dot"
  }), "STATUS \xB7 ALL SYSTEMS OPERATIONAL"), /*#__PURE__*/React.createElement("span", {
    style: {
      color: "#6c7d99"
    }
  }, "NOC (NETWORK OPERATIONS CENTER) \xB7 ", ts, " CT (CENTRAL TIME)")), /*#__PURE__*/React.createElement("div", {
    className: "grp"
  }, /*#__PURE__*/React.createElement("div", {
    style: {
      display: "flex",
      gap: "32px",
      overflow: "hidden",
      maxWidth: "540px"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "ticker"
  }, /*#__PURE__*/React.createElement("span", null, "UPTIME \xB7 ", /*#__PURE__*/React.createElement("b", null, "99.997%")), /*#__PURE__*/React.createElement("span", null, "TICKETS RESOLVED 24H \xB7 ", /*#__PURE__*/React.createElement("b", null, "87")), /*#__PURE__*/React.createElement("span", null, "AVG RESPONSE \xB7 ", /*#__PURE__*/React.createElement("b", null, "11 MIN")), /*#__PURE__*/React.createElement("span", null, "THREATS BLOCKED \xB7 THIS WEEK \xB7 ", /*#__PURE__*/React.createElement("b", null, "4,100")), /*#__PURE__*/React.createElement("span", null, "ENDPOINTS WATCHED \xB7 ", /*#__PURE__*/React.createElement("b", null, "1,432")), /*#__PURE__*/React.createElement("span", null, "UPTIME \xB7 ", /*#__PURE__*/React.createElement("b", null, "99.997%")), /*#__PURE__*/React.createElement("span", null, "TICKETS RESOLVED 24H \xB7 ", /*#__PURE__*/React.createElement("b", null, "87")), /*#__PURE__*/React.createElement("span", null, "AVG RESPONSE \xB7 ", /*#__PURE__*/React.createElement("b", null, "11 MIN")), /*#__PURE__*/React.createElement("span", null, "THREATS BLOCKED \xB7 THIS WEEK \xB7 ", /*#__PURE__*/React.createElement("b", null, "4,100")), /*#__PURE__*/React.createElement("span", null, "ENDPOINTS WATCHED \xB7 ", /*#__PURE__*/React.createElement("b", null, "1,432"))))));
}
function formatStamp(d) {
  const pad = n => String(n).padStart(2, "0");
  return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
}

// ============================================================
// Top navigation
// ============================================================
function Nav({
  route,
  go
}) {
  const [openDropdown, setOpenDropdown] = useState(null);
  const [mobileOpen, setMobileOpen] = useState(false);
  const closeTimer = useRef(null);

  const industries = [{
    slug: "industries/medical-offices",
    label: "Medical Offices"
  }, {
    slug: "industries/financial-services",
    label: "Financial Services"
  }, {
    slug: "industries/property-management",
    label: "Property Management"
  }];

  const services = [{
    slug: "our-services",
    label: "Managed IT"
  }, {
    slug: "co-managed",
    label: "Co-Managed IT"
  }, {
    slug: "automation",
    label: "Automation"
  }];

  const openServices = () => {
    if (closeTimer.current) clearTimeout(closeTimer.current);
    setOpenDropdown("services");
  };
  const closeServices = () => {
    closeTimer.current = setTimeout(() => setOpenDropdown(null), 180);
  };
  const goService = (slug) => {
    setOpenDropdown(null);
    setMobileOpen(false);
    go(slug);
  };
  const servicesActive = ["our-services", "co-managed", "automation"].includes(route);

  const openIndustries = () => {
    if (closeTimer.current) clearTimeout(closeTimer.current);
    setOpenDropdown("industries");
  };
  const closeIndustries = () => {
    closeTimer.current = setTimeout(() => setOpenDropdown(null), 180);
  };
  const goIndustry = (slug) => {
    setOpenDropdown(null);
    setMobileOpen(false);
    go(slug);
  };
  const goNav = (where) => {
    setMobileOpen(false);
    go(where);
  };
  const industriesActive = route.startsWith("industries/");

  const openResources = () => {
    if (closeTimer.current) clearTimeout(closeTimer.current);
    setOpenDropdown("resources");
  };
  const closeResources = () => {
    closeTimer.current = setTimeout(() => setOpenDropdown(null), 180);
  };
  const resourcesActive = route === "knowledge-base" || route === "resources/m365-audit";

  // Lock body scroll while the mobile menu is open
  useEffect(() => {
    if (!mobileOpen) return;
    let prev = "";
    try {
      prev = document.body.style.overflow;
      document.body.style.overflow = "hidden";
    } catch (e) { /* ignore */ }
    return () => {
      try { document.body.style.overflow = prev; } catch (e) {}
    };
  }, [mobileOpen]);

  return /*#__PURE__*/React.createElement("nav", {
    className: "nav"
  },
    /*#__PURE__*/React.createElement("div", {
      className: "brand",
      onClick: () => goNav("services")
    }, /*#__PURE__*/React.createElement("img", {
      src: (window.__resources && window.__resources.logoSvg) || "assets/logo.svg",
      alt: "37 Forge"
    })),

    // ───── desktop links ─────
    /*#__PURE__*/React.createElement("div", { className: "links" },
      /*#__PURE__*/React.createElement("div", {
        className: "has-dropdown" + (openDropdown === "services" ? " open" : ""),
        onMouseEnter: openServices,
        onMouseLeave: closeServices
      },
        /*#__PURE__*/React.createElement("a", {
          className: servicesActive ? "active dd-trigger" : "dd-trigger",
          onClick: () => setOpenDropdown(openDropdown === "services" ? null : "services"),
          "aria-haspopup": "true",
          "aria-expanded": openDropdown === "services"
        }, "Services", /*#__PURE__*/React.createElement("svg", {
          className: "dd-caret",
          width: "10", height: "6", viewBox: "0 0 10 6",
          "aria-hidden": "true"
        }, /*#__PURE__*/React.createElement("path", {
          d: "M1 1l4 4 4-4",
          stroke: "currentColor", strokeWidth: "1.5", fill: "none", strokeLinecap: "round"
        }))),
        /*#__PURE__*/React.createElement("div", { className: "dropdown", role: "menu" },
          /*#__PURE__*/React.createElement("div", { className: "dd-eyebrow" }, "WHAT WE DO · PICK ONE"),
          services.map((s, idx) => /*#__PURE__*/React.createElement("a", {
            key: s.slug,
            className: "dd-item" + (route === s.slug ? " active" : ""),
            onClick: () => goService(s.slug),
            role: "menuitem"
          }, /*#__PURE__*/React.createElement("span", { className: "dd-num" }, String(idx + 1).padStart(2, "0")),
             /*#__PURE__*/React.createElement("span", { className: "dd-label" }, s.label))),
          /*#__PURE__*/React.createElement("div", { className: "dd-sep" }),
          /*#__PURE__*/React.createElement("a", {
            className: "dd-other" + (route === "our-services" ? " active" : ""),
            onClick: () => goService("our-services"),
            role: "menuitem"
          }, /*#__PURE__*/React.createElement("span", { className: "dd-other-l" }, "All six disciplines + VoIP"),
             /*#__PURE__*/React.createElement("span", { className: "dd-other-s" }, "See the full catalog →"))
        )
      ),
      /*#__PURE__*/React.createElement("div", {
        className: "has-dropdown" + (openDropdown === "industries" ? " open" : ""),
        onMouseEnter: openIndustries,
        onMouseLeave: closeIndustries
      },
        /*#__PURE__*/React.createElement("a", {
          className: industriesActive ? "active dd-trigger" : "dd-trigger",
          onClick: () => setOpenDropdown(openDropdown === "industries" ? null : "industries"),
          "aria-haspopup": "true",
          "aria-expanded": openDropdown === "industries"
        }, "Industries", /*#__PURE__*/React.createElement("svg", {
          className: "dd-caret",
          width: "10", height: "6", viewBox: "0 0 10 6",
          "aria-hidden": "true"
        }, /*#__PURE__*/React.createElement("path", {
          d: "M1 1l4 4 4-4",
          stroke: "currentColor", strokeWidth: "1.5", fill: "none", strokeLinecap: "round"
        }))),
        /*#__PURE__*/React.createElement("div", { className: "dropdown", role: "menu" },
          /*#__PURE__*/React.createElement("div", { className: "dd-eyebrow" }, "VERTICALS · PICK YOURS"),
          industries.map((i, idx) => /*#__PURE__*/React.createElement("a", {
            key: i.slug,
            className: "dd-item" + (route === i.slug ? " active" : ""),
            onClick: () => goIndustry(i.slug),
            role: "menuitem"
          }, /*#__PURE__*/React.createElement("span", { className: "dd-num" }, String(idx + 1).padStart(2, "0")),
             /*#__PURE__*/React.createElement("span", { className: "dd-label" }, i.label))),
          /*#__PURE__*/React.createElement("div", { className: "dd-sep" }),
          /*#__PURE__*/React.createElement("a", {
            className: "dd-other" + (route === "industries/other" ? " active" : ""),
            onClick: () => goIndustry("industries/other"),
            role: "menuitem"
          }, /*#__PURE__*/React.createElement("span", { className: "dd-other-l" }, "Don't see your industry?"),
             /*#__PURE__*/React.createElement("span", { className: "dd-other-s" }, "Tell us what you do →"))
        )
      ),
      /*#__PURE__*/React.createElement("a", {
        className: route === "about" ? "active" : "",
        onClick: () => goNav("about")
      }, "About"),
      /*#__PURE__*/React.createElement("a", {
        className: route === "contact" ? "active" : "",
        onClick: () => goNav("contact")
      }, "Contact"),
      /*#__PURE__*/React.createElement("a", {
        className: "nav-download" + (resourcesActive ? " active" : ""),
        onClick: () => goNav("knowledge-base")
      }, /*#__PURE__*/React.createElement("i", {
        className: "fa-solid fa-download",
        style: { fontSize: "11px", marginRight: "6px" }
      }), "Resources")
    ),

    /*#__PURE__*/React.createElement("a", {
      className: "phone",
      href: "tel:2144320333",
      onClick: e => e.stopPropagation()
    }, /*#__PURE__*/React.createElement("i", {
      className: "fa-solid fa-phone",
      style: { color: "var(--accent-bright)", fontSize: "14px" }
    }), /*#__PURE__*/React.createElement("span", null,
      /*#__PURE__*/React.createElement("span", { className: "lab" }, "CALL OPS · 24/7"),
      /*#__PURE__*/React.createElement("span", { style: { fontSize: "15px" } }, "214-432-0333"))),

    /*#__PURE__*/React.createElement("button", {
      className: "btn-primary nav-book",
      onClick: () => goNav("contact")
    }, /*#__PURE__*/React.createElement("i", { className: "fa-solid fa-calendar-check" }), "Book Assessment"),

    // ───── mobile hamburger trigger ─────
    /*#__PURE__*/React.createElement("button", {
      className: "nav-hamburger" + (mobileOpen ? " open" : ""),
      onClick: () => setMobileOpen(o => !o),
      "aria-label": mobileOpen ? "Close menu" : "Open menu",
      "aria-expanded": mobileOpen
    },
      /*#__PURE__*/React.createElement("span", null),
      /*#__PURE__*/React.createElement("span", null),
      /*#__PURE__*/React.createElement("span", null)
    ),

    // ───── mobile menu overlay ─────
    mobileOpen && /*#__PURE__*/React.createElement("div", {
      className: "nav-mobile",
      onClick: (e) => { if (e.target.classList.contains("nav-mobile")) setMobileOpen(false); }
    },
      /*#__PURE__*/React.createElement("div", { className: "nav-mobile-inner" },
        /*#__PURE__*/React.createElement("a", {
          className: "nav-mobile-link" + (route === "services" ? " active" : ""),
          onClick: () => goNav("services")
        }, "Managed IT"),
        /*#__PURE__*/React.createElement("div", { className: "nav-mobile-eye" }, "SERVICES"),
        services.map(s => /*#__PURE__*/React.createElement("a", {
          key: s.slug,
          className: "nav-mobile-link nav-mobile-sub" + (route === s.slug ? " active" : ""),
          onClick: () => goService(s.slug)
        }, s.label)),
        /*#__PURE__*/React.createElement("div", { className: "nav-mobile-eye" }, "INDUSTRIES"),
        industries.map(i => /*#__PURE__*/React.createElement("a", {
          key: i.slug,
          className: "nav-mobile-link nav-mobile-sub" + (route === i.slug ? " active" : ""),
          onClick: () => goIndustry(i.slug)
        }, i.label)),
        /*#__PURE__*/React.createElement("a", {
          className: "nav-mobile-link nav-mobile-sub" + (route === "industries/other" ? " active" : ""),
          onClick: () => goIndustry("industries/other"),
          style: { color: "var(--accent-bright)" }
        }, "Don't see yours? →"),
        /*#__PURE__*/React.createElement("a", {
          className: "nav-mobile-link" + (route === "about" ? " active" : ""),
          onClick: () => goNav("about")
        }, "About"),
        /*#__PURE__*/React.createElement("a", {
          className: "nav-mobile-link" + (route === "contact" ? " active" : ""),
          onClick: () => goNav("contact")
        }, "Contact"),
        /*#__PURE__*/React.createElement("a", {
          className: "nav-mobile-link nav-mobile-resource" + (route === "knowledge-base" ? " active" : ""),
          onClick: () => goNav("knowledge-base")
        }, /*#__PURE__*/React.createElement("i", { className: "fa-solid fa-download", style: { marginRight: "8px" } }), "Resources"),

        /*#__PURE__*/React.createElement("div", { className: "nav-mobile-foot" },
          /*#__PURE__*/React.createElement("a", {
            href: "tel:2144320333",
            className: "nav-mobile-phone"
          }, /*#__PURE__*/React.createElement("i", { className: "fa-solid fa-phone" }), "214-432-0333"),
          /*#__PURE__*/React.createElement("button", {
            className: "btn-primary",
            onClick: () => goNav("contact"),
            style: { width: "100%", justifyContent: "center" }
          }, /*#__PURE__*/React.createElement("i", { className: "fa-solid fa-calendar-check" }), "Book Assessment")
        )
      )
    )
  );
}

// ============================================================
// Footer (shared)
// ============================================================
function Footer({
  go
}) {
  return /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement("div", {
    className: "foot-grid"
  },
    // Brand
    /*#__PURE__*/React.createElement("div", {
      className: "foot-col"
    }, /*#__PURE__*/React.createElement("img", {
      src: (window.__resources && window.__resources.logoSvg) || "assets/logo.svg",
      alt: "37 Forge"
    }), /*#__PURE__*/React.createElement("p", null, "Managed IT, cybersecurity, and cloud for Dallas–Fort Worth small & mid-sized businesses. Local engineers, fixed monthly bill."), /*#__PURE__*/React.createElement("p", {
      style: { marginTop: "20px" }
    }, /*#__PURE__*/React.createElement("span", {
      className: "badge-status"
    }, "SYSTEMS OPERATIONAL"))),

    // Services
    /*#__PURE__*/React.createElement("div", {
      className: "foot-col"
    }, /*#__PURE__*/React.createElement("h5", null, "Services"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("our-services")
    }, "Managed IT"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("co-managed")
    }, "Co-Managed IT"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("automation")
    }, "Automation"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("our-services", "svc-04")
    }, "Cloud Services"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("our-services", "svc-06")
    }, "VoIP & Phone Systems"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("our-services", "svc-05")
    }, "Help Desk Support")),

    // Industries (NEW)
    /*#__PURE__*/React.createElement("div", {
      className: "foot-col"
    }, /*#__PURE__*/React.createElement("h5", null, "Industries"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("industries/medical-offices")
    }, "Medical Offices"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("industries/financial-services")
    }, "Financial Services"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("industries/property-management")
    }, "Property Management"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("industries/other"),
      style: { color: "var(--accent-bright)", opacity: 0.85 }
    }, "Don't see yours? →")),

    // Company (now includes Resources sub-section)
    /*#__PURE__*/React.createElement("div", {
      className: "foot-col"
    }, /*#__PURE__*/React.createElement("h5", null, "Company"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("about")
    }, "About Us"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("about", "coverage-map")
    }, "Coverage Area"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("contact")
    }, "Contact"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("contact")
    }, "Book Assessment"), /*#__PURE__*/React.createElement("h5", {
      style: { marginTop: "32px" }
    }, "Free Resources"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("knowledge-base")
    }, "Knowledge Base"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("resources/m365-audit"),
      style: { color: "var(--accent-bright)" }
    }, /*#__PURE__*/React.createElement("i", {
      className: "fa-solid fa-download",
      style: { fontSize: "10px", marginRight: "6px" }
    }), "M365 Audit Worksheet")),

    // Direct
    /*#__PURE__*/React.createElement("div", {
      className: "foot-col"
    }, /*#__PURE__*/React.createElement("h5", null, "Direct"), /*#__PURE__*/React.createElement("a", {
      href: "tel:2144320333",
      style: { fontFamily: '"JetBrains Mono", monospace' }
    }, "214-432-0333"), /*#__PURE__*/React.createElement("a", {
      href: "mailto:ops@37forge.com"
    }, "ops@37forge.com"), /*#__PURE__*/React.createElement("a", {
      onClick: () => go("about", "coverage-map")
    }, "Dallas–Fort Worth, TX"), /*#__PURE__*/React.createElement("a", null, "24/7 · 365 days"))
  ),
  /*#__PURE__*/React.createElement("div", {
    className: "foot-bot"
  }, /*#__PURE__*/React.createElement("span", null, "© 2026 37 FORGE LLC · ALL RIGHTS RESERVED"), /*#__PURE__*/React.createElement("span", null, "BUILD 0421 · LAST DEPLOY 0942 CT (CENTRAL TIME)")));
}

// ============================================================
// Live ops console (hero right side)
// ============================================================
function LiveConsole() {
  // Persist threats counter across visits — but reset it every Monday at 00:00 local.
  // endpoints / response are static credibility figures and no longer drift.
  const STORAGE_KEY = "37forge.networkReadout.v3";
  const TICK_MS = 1800;

  // Most-recent-Monday 00:00 local, as ms timestamp
  function weekStart(d = new Date()) {
    const start = new Date(d);
    start.setHours(0, 0, 0, 0);
    const day = start.getDay(); // 0=Sun, 1=Mon, ...
    const offset = (day + 6) % 7; // Mon=0, Tue=1, ..., Sun=6
    start.setDate(start.getDate() - offset);
    return start.getTime();
  }

  const endpoints = 1432;
  const response = 11;
  const initial = useMemo(() => {
    const baseline = 4100; // starting threats count each Monday
    const thisWeek = weekStart();
    try {
      const raw = localStorage.getItem(STORAGE_KEY);
      if (!raw) return { threats: baseline, week: thisWeek };
      const saved = JSON.parse(raw);
      // If saved data is from an earlier week, reset.
      if (!saved.week || saved.week < thisWeek) {
        return { threats: baseline, week: thisWeek };
      }
      // Same week — catch up the counter for elapsed ticks.
      const elapsedMs = Math.max(0, Date.now() - (saved.savedAt || Date.now()));
      const ticksAway = Math.min(Math.floor(elapsedMs / TICK_MS), 4000);
      return {
        threats: (saved.threats || baseline) + Math.round(ticksAway * 0.75),
        week: thisWeek
      };
    } catch (e) {
      return { threats: baseline, week: thisWeek };
    }
  }, []);

  const [tick, setTick] = useState(0);
  const [threats, setThreats] = useState(initial.threats);
  const weekRef = useRef(initial.week);

  useEffect(() => {
    const id = setInterval(() => {
      setTick(t => t + 1);
      // If we've crossed into a new week mid-session, reset the counter.
      const currentWeek = weekStart();
      if (currentWeek > weekRef.current) {
        weekRef.current = currentWeek;
        setThreats(4100);
        return;
      }
      setThreats(t => t + (Math.random() < 0.5 ? Math.floor(Math.random() * 4) : 0));
    }, TICK_MS);
    return () => clearInterval(id);
  }, []);

  // Persist on every change + on pagehide as a backstop.
  useEffect(() => {
    try {
      localStorage.setItem(STORAGE_KEY, JSON.stringify({
        threats,
        week: weekRef.current,
        savedAt: Date.now()
      }));
    } catch (e) {}
  }, [threats]);
  useEffect(() => {
    const onLeave = () => {
      try {
        localStorage.setItem(STORAGE_KEY, JSON.stringify({
          threats,
          week: weekRef.current,
          savedAt: Date.now()
        }));
      } catch (e) {}
    };
    window.addEventListener("pagehide", onLeave);
    return () => window.removeEventListener("pagehide", onLeave);
  }, [threats]);

  const ts = useMemo(() => {
    const d = new Date();
    return `${String(d.getHours()).padStart(2, '0')}${String(d.getMinutes()).padStart(2, '0')}`;
  }, [tick]);

  return /*#__PURE__*/React.createElement("div", {
    className: "console"
  }, /*#__PURE__*/React.createElement("div", {
    className: "console-head"
  }, /*#__PURE__*/React.createElement("div", {
    className: "t"
  }, "NETWORK READOUT · LIVE"), /*#__PURE__*/React.createElement("div", {
    className: "ts"
  }, "SESSION · ", ts, " · 0042")), /*#__PURE__*/React.createElement("div", {
    className: "console-body"
  }, /*#__PURE__*/React.createElement("div", {
    className: "console-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-server"
  }), "ENDPOINTS WATCHED"), /*#__PURE__*/React.createElement("span", {
    className: "v"
  }, endpoints.toLocaleString())), /*#__PURE__*/React.createElement("div", {
    className: "console-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-circle-exclamation"
  }), "OPEN P1 (PRIORITY 1) INCIDENTS"), /*#__PURE__*/React.createElement("span", {
    className: "v ok"
  }, "0")), /*#__PURE__*/React.createElement("div", {
    className: "console-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-stopwatch"
  }), "AVG RESPONSE (30D)"), /*#__PURE__*/React.createElement("span", {
    className: "v"
  }, response.toFixed(0), " MIN")), /*#__PURE__*/React.createElement("div", {
    className: "console-row",
    style: { background: "rgba(176,136,40,0.06)" }
  }, /*#__PURE__*/React.createElement("span", {
    className: "k",
    style: { color: "var(--accent-bright)" }
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-shield-halved"
  }), "THREATS BLOCKED · THIS WEEK"), /*#__PURE__*/React.createElement("span", {
    className: "v",
    style: { color: "var(--accent-bright)" }
  }, threats.toLocaleString())), /*#__PURE__*/React.createElement("div", {
    className: "console-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-rotate"
  }), "PATCH COMPLIANCE"), /*#__PURE__*/React.createElement("span", {
    className: "v ok"
  }, "98.7%")), /*#__PURE__*/React.createElement("div", {
    className: "console-row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-database"
  }), "BACKUP · LAST VERIFIED"), /*#__PURE__*/React.createElement("span", {
    className: "v ok"
  }, "04:12 CT (Central Time) ✓"))));
}

// ============================================================
// Section Head — eyebrow + title + side description
// ============================================================
function SectionHead({
  eyebrow,
  title,
  accent,
  desc
}) {
  return /*#__PURE__*/React.createElement("div", {
    className: "section-head"
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
    className: "eyebrow"
  }, eyebrow), /*#__PURE__*/React.createElement("h2", null, title, accent && /*#__PURE__*/React.createElement(React.Fragment, null, " ", /*#__PURE__*/React.createElement("span", {
    className: "accent"
  }, accent)))), desc && /*#__PURE__*/React.createElement("div", {
    className: "desc"
  }, desc));
}

// ============================================================
// Animated stat cell — counts up + bar fills when in view
// ============================================================
function StatCell({
  eyebrow,
  value,
  unit,
  label,
  desc,
  barWidth,
  animateNum,
  suffix = ""
}) {
  const ref = useRef(null);
  const [inView, setInView] = useState(false);
  const [n, setN] = useState(animateNum ? 0 : value);
  useEffect(() => {
    if (!ref.current) return;
    const obs = new IntersectionObserver(entries => {
      entries.forEach(e => {
        if (e.isIntersecting) setInView(true);
      });
    }, {
      threshold: 0.3
    });
    obs.observe(ref.current);
    return () => obs.disconnect();
  }, []);
  useEffect(() => {
    if (!inView || !animateNum) return;
    const start = performance.now();
    const dur = 1400;
    const from = 0;
    const to = value;
    let raf;
    const step = now => {
      const t = Math.min(1, (now - start) / dur);
      const eased = 1 - Math.pow(1 - t, 3);
      setN(from + (to - from) * eased);
      if (t < 1) raf = requestAnimationFrame(step);
    };
    raf = requestAnimationFrame(step);
    return () => cancelAnimationFrame(raf);
  }, [inView, value, animateNum]);
  const display = animateNum ? Math.round(n).toLocaleString() : value;
  return /*#__PURE__*/React.createElement("div", {
    ref: ref,
    className: `stat-cell ${inView ? "in-view" : ""}`,
    style: {
      "--w": barWidth || "75%"
    }
  }, /*#__PURE__*/React.createElement("div", {
    className: "stat-eyebrow"
  }, eyebrow), /*#__PURE__*/React.createElement("div", {
    className: "n"
  }, display, suffix, unit && /*#__PURE__*/React.createElement("span", {
    className: "unit"
  }, unit)), /*#__PURE__*/React.createElement("div", {
    className: "l"
  }, label), desc && /*#__PURE__*/React.createElement("div", {
    className: "d"
  }, desc), /*#__PURE__*/React.createElement("div", {
    className: "bar"
  }, /*#__PURE__*/React.createElement("span", null)));
}

// ============================================================
// DFW Coverage Map (SVG, abstract tactical look)
// ============================================================
function DFWMap({
  readout = "ALL ZONES OPERATIONAL",
  showOverlay = true
}) {
  // Cities at near-real geographic positions in viewBox 0 0 900 380.
  // Listed (primary) cities render at full brightness; secondary cities at ~50% opacity.
  const cities = [{
    name: "Fort Worth",
    x: 90,
    y: 322,
    labelAnchor: "start"
  }, {
    name: "Arlington",
    x: 290,
    y: 330,
    labelAnchor: "start"
  }, {
    name: "Grand Prairie",
    x: 390,
    y: 322,
    labelAnchor: "start"
  }, {
    name: "Irving",
    x: 450,
    y: 290,
    labelAnchor: "start"
  }, {
    name: "Dallas",
    x: 580,
    y: 308,
    hq: true,
    labelAnchor: "start"
  }, {
    name: "Plano",
    x: 690,
    y: 168,
    labelAnchor: "start"
  }, {
    name: "Frisco",
    x: 570,
    y: 96,
    labelAnchor: "start"
  }, {
    name: "McKinney",
    x: 760,
    y: 70,
    labelAnchor: "end"
  }, {
    name: "Garland",
    x: 745,
    y: 232,
    labelAnchor: "start"
  }, {
    name: "Mesquite",
    x: 775,
    y: 314,
    labelAnchor: "end"
  }, {
    name: "Denton",
    x: 260,
    y: 56,
    labelAnchor: "start"
  }, {
    name: "Lewisville",
    x: 405,
    y: 150,
    labelAnchor: "start"
  }, {
    name: "Richardson",
    x: 660,
    y: 210,
    labelAnchor: "start"
  }, {
    name: "Carrollton",
    x: 500,
    y: 208,
    labelAnchor: "end"
  }, {
    name: "Southlake",
    x: 280,
    y: 216,
    labelAnchor: "start"
  }, {
    name: "DFW Airport",
    x: 360,
    y: 240,
    labelAnchor: "start"
  }];
  // Secondary suburbs / surrounding zones (50% opacity)
  const secondary = [{
    name: "Keller",
    x: 160,
    y: 226
  }, {
    name: "Bedford",
    x: 258,
    y: 274
  }, {
    name: "Euless",
    x: 318,
    y: 274
  }, {
    name: "Hurst",
    x: 218,
    y: 286
  }, {
    name: "Grapevine",
    x: 320,
    y: 236
  }, {
    name: "Flower Mound",
    x: 300,
    y: 162
  }, {
    name: "Coppell",
    x: 412,
    y: 224
  }, {
    name: "The Colony",
    x: 500,
    y: 134
  }, {
    name: "Little Elm",
    x: 460,
    y: 86
  }, {
    name: "Addison",
    x: 568,
    y: 202
  }, {
    name: "Farmers Branch",
    x: 510,
    y: 228
  }, {
    name: "Prosper",
    x: 612,
    y: 36
  }, {
    name: "Allen",
    x: 720,
    y: 122
  }, {
    name: "Sachse",
    x: 800,
    y: 192
  }, {
    name: "Rowlett",
    x: 830,
    y: 240
  }, {
    name: "Wylie",
    x: 850,
    y: 168
  }];
  const HQ = cities.find(c => c.hq) || {
    x: 580,
    y: 308
  };
  const RADAR_R = 360; // sweep radius from HQ (Dallas)

  return /*#__PURE__*/React.createElement("div", {
    className: "map-wrap"
  }, /*#__PURE__*/React.createElement("div", {
    className: "map-grid"
  }), /*#__PURE__*/React.createElement("svg", {
    viewBox: "0 0 900 380",
    preserveAspectRatio: "xMidYMid meet"
  }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("radialGradient", {
    id: "radarGrad",
    cx: "0",
    cy: "0",
    r: RADAR_R,
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/React.createElement("stop", {
    offset: "0",
    stopColor: "#4ade80",
    stopOpacity: "0.55"
  }), /*#__PURE__*/React.createElement("stop", {
    offset: "0.45",
    stopColor: "#4ade80",
    stopOpacity: "0.18"
  }), /*#__PURE__*/React.createElement("stop", {
    offset: "1",
    stopColor: "#4ade80",
    stopOpacity: "0"
  })), /*#__PURE__*/React.createElement("radialGradient", {
    id: "radarEdge",
    cx: "0",
    cy: "0",
    r: RADAR_R,
    gradientUnits: "userSpaceOnUse"
  }, /*#__PURE__*/React.createElement("stop", {
    offset: "0",
    stopColor: "#4ade80",
    stopOpacity: "1"
  }), /*#__PURE__*/React.createElement("stop", {
    offset: "1",
    stopColor: "#4ade80",
    stopOpacity: "0"
  })), /*#__PURE__*/React.createElement("clipPath", {
    id: "mapClip"
  }, /*#__PURE__*/React.createElement("rect", {
    x: "0",
    y: "0",
    width: "900",
    height: "380"
  }))), /*#__PURE__*/React.createElement("g", {
    transform: `translate(${HQ.x} ${HQ.y})`,
    clipPath: "url(#mapClip)",
    pointerEvents: "none"
  }, [90, 180, 270, 360].map((r, i) => /*#__PURE__*/React.createElement("circle", {
    key: r,
    cx: "0",
    cy: "0",
    r: r,
    fill: "none",
    stroke: "rgba(74,222,128,0.18)",
    strokeWidth: "0.6",
    strokeDasharray: i === 3 ? "2 6" : "0"
  })), /*#__PURE__*/React.createElement("line", {
    x1: -RADAR_R,
    y1: "0",
    x2: RADAR_R,
    y2: "0",
    stroke: "rgba(74,222,128,0.10)",
    strokeWidth: "0.5",
    strokeDasharray: "1 5"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "0",
    y1: -RADAR_R,
    x2: "0",
    y2: RADAR_R,
    stroke: "rgba(74,222,128,0.10)",
    strokeWidth: "0.5",
    strokeDasharray: "1 5"
  })), /*#__PURE__*/React.createElement("g", {
    transform: `translate(${HQ.x} ${HQ.y})`,
    pointerEvents: "none"
  }, /*#__PURE__*/React.createElement("g", {
    className: "radar-sweep"
  }, /*#__PURE__*/React.createElement("path", {
    d: `M 0 0 L ${RADAR_R * 0.940} ${-RADAR_R * 0.342} A ${RADAR_R} ${RADAR_R} 0 0 1 ${RADAR_R} 0 Z`,
    fill: "rgba(74,222,128,0.25)",
    opacity: "0.4"
  }), /*#__PURE__*/React.createElement("path", {
    d: `M 0 0 L ${RADAR_R * 0.996} ${-RADAR_R * 0.087} A ${RADAR_R} ${RADAR_R} 0 0 1 ${RADAR_R} 0 Z`,
    fill: "url(#radarGrad)",
    opacity: "0.65"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "0",
    y1: "0",
    x2: RADAR_R,
    y2: "0",
    stroke: "#4ade80",
    strokeWidth: "1.4",
    strokeLinecap: "round",
    style: {
      filter: "drop-shadow(0 0 4px rgba(74,222,128,0.85))"
    }
  }), /*#__PURE__*/React.createElement("circle", {
    cx: RADAR_R - 4,
    cy: "0",
    r: "3",
    fill: "#4ade80",
    style: {
      filter: "drop-shadow(0 0 6px rgba(74,222,128,0.9))"
    }
  }))), /*#__PURE__*/React.createElement("g", null, [{
    d: "M 340 96 Q 380 78 420 92 Q 432 115 410 135 Q 380 142 358 128 Q 338 118 340 96 Z"
  }, {
    d: "M 270 198 Q 310 188 348 200 Q 354 214 330 222 Q 300 224 274 214 Z"
  }, {
    d: "M 800 246 Q 832 244 850 264 Q 854 290 836 304 Q 816 308 802 290 Q 794 268 800 246 Z"
  }, {
    d: "M 18 200 Q 36 196 50 210 Q 52 230 38 240 Q 22 240 16 224 Z"
  }].map((l, i) => /*#__PURE__*/React.createElement("path", {
    key: i,
    d: l.d,
    fill: "rgba(44,70,117,0.55)",
    stroke: "rgba(124,156,210,0.5)",
    strokeWidth: "0.8",
    strokeDasharray: "1.5 2"
  }))), /*#__PURE__*/React.createElement("g", {
    fontFamily: "JetBrains Mono, monospace",
    fontSize: "6",
    fill: "rgba(124,156,210,0.7)",
    letterSpacing: "0.14em",
    pointerEvents: "none"
  }, /*#__PURE__*/React.createElement("text", {
    x: "350",
    y: "116"
  }, "LAKE LEWISVILLE"), /*#__PURE__*/React.createElement("text", {
    x: "276",
    y: "218"
  }, "L. GRAPEVINE"), /*#__PURE__*/React.createElement("text", {
    x: "804",
    y: "278"
  }, "L. RAY HUBBARD")), /*#__PURE__*/React.createElement("circle", {
    cx: HQ.x,
    cy: HQ.y,
    r: "110",
    fill: "none",
    stroke: "rgba(74,222,128,0.30)",
    strokeWidth: "1",
    strokeDasharray: "3 3"
  }), /*#__PURE__*/React.createElement("circle", {
    cx: HQ.x,
    cy: HQ.y,
    r: "200",
    fill: "none",
    stroke: "rgba(74,222,128,0.18)",
    strokeWidth: "1",
    strokeDasharray: "3 6"
  }), /*#__PURE__*/React.createElement("g", {
    opacity: "0.5"
  }, secondary.map(c => /*#__PURE__*/React.createElement("g", {
    key: c.name
  }, /*#__PURE__*/React.createElement("circle", {
    cx: c.x,
    cy: c.y,
    r: "2.5",
    fill: "rgba(212,167,58,0.85)"
  }), /*#__PURE__*/React.createElement("text", {
    x: c.x + 5,
    y: c.y + 3,
    fontFamily: "JetBrains Mono, monospace",
    fontSize: "7",
    fontWeight: "500",
    fill: "rgba(164,179,204,0.95)",
    letterSpacing: "0.06em"
  }, c.name.toUpperCase())))), cities.map((c, i) => {
    const anchor = c.labelAnchor || "start";
    const dx = anchor === "end" ? -(c.hq ? 12 : 8) : c.hq ? 12 : 8;
    return /*#__PURE__*/React.createElement("g", {
      key: c.name
    }, /*#__PURE__*/React.createElement("circle", {
      className: `city-pulse ${c.hq ? "hq" : ""}`,
      cx: c.x,
      cy: c.y,
      style: {
        animationDelay: `${i * 0.18}s`
      }
    }), /*#__PURE__*/React.createElement("circle", {
      className: `city-dot ${c.hq ? "hq" : ""}`,
      cx: c.x,
      cy: c.y,
      r: c.hq ? 6 : 4
    }), /*#__PURE__*/React.createElement("text", {
      x: c.x + dx,
      y: c.y + 4,
      fontFamily: "JetBrains Mono, monospace",
      fontSize: c.hq ? 11 : 9,
      fontWeight: c.hq ? 700 : 500,
      fill: c.hq ? "#4ade80" : "#eef2f8",
      letterSpacing: "0.06em",
      textAnchor: anchor
    }, c.name.toUpperCase(), c.hq && " · HQ"));
  }), /*#__PURE__*/React.createElement("g", {
    transform: "translate(50, 50)",
    fill: "none",
    stroke: "rgba(212,167,58,0.5)",
    strokeWidth: "1"
  }, /*#__PURE__*/React.createElement("circle", {
    cx: "0",
    cy: "0",
    r: "16"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "0",
    y1: "-18",
    x2: "0",
    y2: "18"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "-18",
    y1: "0",
    x2: "18",
    y2: "0"
  }), /*#__PURE__*/React.createElement("text", {
    fontFamily: "JetBrains Mono, monospace",
    fontSize: "8",
    fontWeight: "700",
    fill: "rgba(212,167,58,0.75)",
    textAnchor: "middle",
    y: "-22"
  }, "N")), /*#__PURE__*/React.createElement("g", {
    transform: "translate(50, 348)",
    pointerEvents: "none"
  }, /*#__PURE__*/React.createElement("line", {
    x1: "0",
    y1: "0",
    x2: "100",
    y2: "0",
    stroke: "rgba(212,167,58,0.55)",
    strokeWidth: "1"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "0",
    y1: "-4",
    x2: "0",
    y2: "4",
    stroke: "rgba(212,167,58,0.55)"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "50",
    y1: "-3",
    x2: "50",
    y2: "3",
    stroke: "rgba(212,167,58,0.55)"
  }), /*#__PURE__*/React.createElement("line", {
    x1: "100",
    y1: "-4",
    x2: "100",
    y2: "4",
    stroke: "rgba(212,167,58,0.55)"
  }), /*#__PURE__*/React.createElement("text", {
    fontFamily: "JetBrains Mono, monospace",
    fontSize: "8",
    fill: "rgba(212,167,58,0.65)",
    y: "-8",
    letterSpacing: "0.14em"
  }, "~20 MI"))), showOverlay && /*#__PURE__*/React.createElement("div", {
    className: "map-overlay"
  }, /*#__PURE__*/React.createElement("h4", null, "COVERAGE \xB7 DFW METROPLEX"), /*#__PURE__*/React.createElement("div", {
    className: "row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, "ZONES"), /*#__PURE__*/React.createElement("span", {
    className: "v"
  }, "16 / 16")), /*#__PURE__*/React.createElement("div", {
    className: "row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, "RADIUS"), /*#__PURE__*/React.createElement("span", {
    className: "v"
  }, "~45 MI")), /*#__PURE__*/React.createElement("div", {
    className: "row"
  }, /*#__PURE__*/React.createElement("span", {
    className: "k"
  }, "STATUS"), /*#__PURE__*/React.createElement("span", {
    className: "v ok"
  }, "\u25CF ACTIVE"))), /*#__PURE__*/React.createElement("div", {
    className: "map-readout"
  }, /*#__PURE__*/React.createElement("span", {
    className: "pulse-dot"
  }), readout));
}

// ============================================================
// CTA strip (used at bottom of pages)
// ============================================================
function CTAStrip({
  go,
  title,
  accent,
  primary = "Book Assessment",
  secondary
}) {
  return /*#__PURE__*/React.createElement("section", {
    className: "cta-strip"
  }, /*#__PURE__*/React.createElement("div", {
    className: "container"
  }, /*#__PURE__*/React.createElement("h2", null, title, " ", accent && /*#__PURE__*/React.createElement("span", {
    className: "accent"
  }, accent)), /*#__PURE__*/React.createElement("div", {
    className: "actions"
  }, /*#__PURE__*/React.createElement("button", {
    className: "btn-primary",
    onClick: () => go("contact")
  }, /*#__PURE__*/React.createElement("i", {
    className: "fa-solid fa-calendar-check"
  }), primary), secondary && /*#__PURE__*/React.createElement("button", {
    className: "btn-outline",
    onClick: () => go("services")
  }, secondary))));
}

// Expose to other scripts
Object.assign(window, {
  UtilBar,
  Nav,
  Footer,
  LiveConsole,
  SectionHead,
  StatCell,
  DFWMap,
  CTAStrip
});