"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/ChoroplethMap/ChoroplethMap.tsx
var ChoroplethMap_exports = {};
__export(ChoroplethMap_exports, {
  default: () => ChoroplethMap_default
});
module.exports = __toCommonJS(ChoroplethMap_exports);
var import_react2 = require("react");
var import_api = require("@react-google-maps/api");
var import_union = __toESM(require("@turf/union"));

// src/utils/utils.ts
var import_clsx = require("clsx");
var import_tailwind_merge = require("tailwind-merge");
function cn(...inputs) {
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
}

// src/hooks/useTheme.ts
var import_react = require("react");

// src/store/themeStore.ts
var import_zustand = require("zustand");
var import_middleware = require("zustand/middleware");
var DARK_THEME_MAP = {
  "base-light": "base-dark",
  "enem-parana-light": "enem-parana-dark",
  "enem-paraiba-light": "enem-paraiba-dark",
  "analytica-light": "analytica-dark"
};
var resolveDarkTheme = (originalTheme) => {
  if (!originalTheme) return "base-dark";
  return DARK_THEME_MAP[originalTheme] ?? "base-dark";
};
var applyThemeToDOM = (mode) => {
  const htmlElement = document.documentElement;
  const originalTheme = htmlElement.dataset.originalTheme;
  if (mode === "dark") {
    htmlElement.dataset.theme = resolveDarkTheme(originalTheme);
    return true;
  } else if (mode === "light") {
    if (originalTheme) {
      htmlElement.dataset.theme = originalTheme;
    }
    return false;
  } else if (mode === "system") {
    const isSystemDark = window.matchMedia(
      "(prefers-color-scheme: dark)"
    ).matches;
    if (isSystemDark) {
      htmlElement.dataset.theme = resolveDarkTheme(originalTheme);
      return true;
    } else if (originalTheme) {
      htmlElement.dataset.theme = originalTheme;
      return false;
    }
  }
  return false;
};
var saveOriginalTheme = () => {
  const htmlElement = document.documentElement;
  const currentTheme = htmlElement.dataset.theme || document.querySelector('meta[name="theme"]')?.getAttribute("content");
  if (currentTheme && !htmlElement.dataset.originalTheme) {
    htmlElement.dataset.originalTheme = currentTheme;
  }
};
var useThemeStore = (0, import_zustand.create)()(
  (0, import_middleware.devtools)(
    (0, import_middleware.persist)(
      (set, get) => ({
        // Initial state
        themeMode: "system",
        isDark: false,
        // Actions
        applyTheme: (mode) => {
          const isDark = applyThemeToDOM(mode);
          set({ isDark });
        },
        toggleTheme: () => {
          const { themeMode, applyTheme } = get();
          let newMode;
          if (themeMode === "light") {
            newMode = "dark";
          } else if (themeMode === "dark") {
            newMode = "light";
          } else {
            newMode = "dark";
          }
          set({ themeMode: newMode });
          applyTheme(newMode);
        },
        setTheme: (mode) => {
          const { applyTheme } = get();
          set({ themeMode: mode });
          applyTheme(mode);
        },
        setWhiteLabelTheme: (theme) => {
          const htmlElement = document.documentElement;
          if (theme) {
            htmlElement.dataset.originalTheme = theme;
            const { themeMode, applyTheme } = get();
            if (themeMode === "light" || themeMode === "system") {
              htmlElement.dataset.theme = theme;
            }
            applyTheme(themeMode);
          }
        },
        clearWhiteLabelTheme: () => {
          const htmlElement = document.documentElement;
          delete htmlElement.dataset.originalTheme;
          delete htmlElement.dataset.theme;
          saveOriginalTheme();
          const { themeMode, applyTheme } = get();
          applyTheme(themeMode);
        },
        initializeTheme: () => {
          const { themeMode, applyTheme } = get();
          saveOriginalTheme();
          applyTheme(themeMode);
        },
        handleSystemThemeChange: () => {
          const { themeMode, applyTheme } = get();
          if (themeMode === "system") {
            applyTheme("system");
          }
        }
      }),
      {
        name: "theme-store",
        // Nome da chave no localStorage
        partialize: (state) => ({
          themeMode: state.themeMode
        })
        // Só persiste o themeMode, não o isDark
      }
    ),
    {
      name: "theme-store"
    }
  )
);

// src/hooks/useTheme.ts
var useTheme = () => {
  const {
    themeMode,
    isDark,
    toggleTheme,
    setTheme,
    initializeTheme,
    handleSystemThemeChange
  } = useThemeStore();
  const branding = (0, import_react.useMemo)(() => {
    if (typeof document === "undefined") {
      return {
        theme: null,
        favicon: null,
        icon: null,
        mainLogo: null,
        internalLogo: null,
        loginImage: null
      };
    }
    return {
      theme: document.querySelector('meta[name="theme"]')?.getAttribute("content") ?? null,
      favicon: document.querySelector('link[rel="icon"]')?.getAttribute("href") ?? null,
      icon: document.querySelector('link[rel="apple-touch-icon"]')?.getAttribute("href") ?? null,
      mainLogo: document.querySelector('meta[name="main-logo"]')?.getAttribute("content") ?? null,
      internalLogo: document.querySelector('meta[name="internal-logo"]')?.getAttribute("content") ?? null,
      loginImage: document.querySelector('meta[name="login-image"]')?.getAttribute("content") ?? null
    };
  }, []);
  (0, import_react.useEffect)(() => {
    initializeTheme();
    const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
    mediaQuery.addEventListener("change", handleSystemThemeChange);
    return () => {
      mediaQuery.removeEventListener("change", handleSystemThemeChange);
    };
  }, [initializeTheme, handleSystemThemeChange]);
  return {
    themeMode,
    isDark,
    toggleTheme,
    setTheme,
    branding
  };
};

// src/components/Text/Text.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Text = ({
  children,
  size = "md",
  weight = "normal",
  color = "text-text-950",
  as,
  className = "",
  ...props
}) => {
  let sizeClasses;
  let weightClasses;
  const sizeClassMap = {
    "2xs": "text-2xs",
    xs: "text-xs",
    sm: "text-sm",
    md: "text-md",
    lg: "text-lg",
    xl: "text-xl",
    "2xl": "text-2xl",
    "3xl": "text-3xl",
    "4xl": "text-4xl",
    "5xl": "text-5xl",
    "6xl": "text-6xl"
  };
  sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
  const weightClassMap = {
    hairline: "font-hairline",
    light: "font-light",
    normal: "font-normal",
    medium: "font-medium",
    semibold: "font-semibold",
    bold: "font-bold",
    extrabold: "font-extrabold",
    black: "font-black"
  };
  weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
  const baseClasses = "font-primary";
  const Component = as ?? "p";
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    Component,
    {
      className: cn(baseClasses, sizeClasses, weightClasses, color, className),
      ...props,
      children
    }
  );
};
var Text_default = Text;

// src/components/ChoroplethMap/ChoroplethMap.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var GOOGLE_MAPS_LOADER_ID = "google-maps-script";
var FADE_DURATION = 400;
var HOVER_DURATION = 200;
var TARGET_OPACITY = 0.8;
var getCssVar = (name, fallback = "") => {
  if (typeof document === "undefined") return fallback;
  return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || fallback;
};
var getColorClasses = () => [
  {
    min: 0.75,
    max: 1.01,
    fillColor: getCssVar("--color-map-highlight", "#2c7bb6"),
    strokeColor: getCssVar("--color-map-highlight", "#2c7bb6"),
    label: "Destaque"
  },
  {
    min: 0.5,
    max: 0.75,
    fillColor: getCssVar("--color-map-above-avg", "#abd9e9"),
    strokeColor: getCssVar("--color-map-above-avg", "#abd9e9"),
    label: "Acima da m\xE9dia"
  },
  {
    min: 0.25,
    max: 0.5,
    fillColor: getCssVar("--color-map-below-avg", "#fdae61"),
    strokeColor: getCssVar("--color-map-below-avg", "#fdae61"),
    label: "Abaixo da m\xE9dia"
  },
  {
    min: 0,
    max: 0.25,
    fillColor: getCssVar("--color-map-attention", "#d7191c"),
    strokeColor: getCssVar("--color-map-attention", "#d7191c"),
    label: "Ponto de aten\xE7\xE3o"
  }
];
var getColorClass = (value, colorClasses) => {
  for (const colorClass of colorClasses) {
    if (value >= colorClass.min && value < colorClass.max) {
      return colorClass;
    }
  }
  return colorClasses[0];
};
var computeNREBoundaries = (data) => {
  const groups = /* @__PURE__ */ new Map();
  data.forEach((region) => {
    const existing = groups.get(region.name) ?? [];
    existing.push(region);
    groups.set(region.name, existing);
  });
  const boundaries = [];
  groups.forEach((regions) => {
    let merged = null;
    for (const region of regions) {
      if (region.geoJson.type !== "Feature") continue;
      const feature = region.geoJson;
      if (merged) {
        const result = (0, import_union.default)({
          type: "FeatureCollection",
          features: [merged, feature]
        });
        if (result) merged = result;
      } else {
        merged = feature;
      }
    }
    if (merged) boundaries.push(merged);
  });
  return boundaries;
};
var createStyleFunction = (opacity, colorClasses, strokeCityColor) => {
  return (feature) => {
    const value = feature.getProperty("regionValue");
    const colorClass = getColorClass(value ?? 0, colorClasses);
    return {
      fillColor: colorClass.fillColor,
      fillOpacity: opacity,
      strokeColor: strokeCityColor,
      strokeWeight: 0.3,
      cursor: "pointer"
    };
  };
};
var containerStyle = {
  width: "100%",
  height: "415px",
  borderRadius: "0.5rem"
};
var defaultCenter = {
  lat: -24.7,
  lng: -51.5
};
var LegendItem = ({
  color,
  label,
  borderColor,
  active = true,
  onClick
}) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
  Text_default,
  {
    as: "button",
    type: "button",
    "aria-pressed": active,
    className: "flex items-center gap-2 cursor-pointer transition-opacity duration-200",
    style: { opacity: active ? 1 : 0.4 },
    onClick,
    children: [
      /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
        "div",
        {
          className: "w-3 h-3 rounded-full",
          style: {
            backgroundColor: color,
            border: borderColor ? `1px solid ${borderColor}` : "none"
          }
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { as: "span", size: "sm", weight: "medium", color: "text-text-600", children: label })
    ]
  }
);
var LoadingSkeleton = () => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full h-full flex items-center justify-center bg-background-50 rounded-lg animate-pulse", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { size: "sm", color: "text-text-400", children: "Carregando mapa..." }) });
var ChoroplethMap = ({
  data,
  apiKey,
  title = "Performance por regi\xE3o",
  countLabel = "Acessos",
  loading = false,
  bounds,
  onRegionClick,
  className
}) => {
  const mapId = GOOGLE_MAPS_LOADER_ID;
  const [map, setMap] = (0, import_react2.useState)(null);
  const [hoveredRegion, setHoveredRegion] = (0, import_react2.useState)(null);
  const [infoPosition, setInfoPosition] = (0, import_react2.useState)(null);
  const [activeClasses, setActiveClasses] = (0, import_react2.useState)(
    /* @__PURE__ */ new Set([0, 1, 2, 3])
  );
  const fadeAnimationRef = (0, import_react2.useRef)(null);
  const hoverAnimationRef = (0, import_react2.useRef)(null);
  const nreBoundaryLayerRef = (0, import_react2.useRef)(null);
  const onRegionClickRef = (0, import_react2.useRef)(onRegionClick);
  onRegionClickRef.current = onRegionClick;
  const { isDark } = useTheme();
  const dataSignature = (0, import_react2.useMemo)(
    () => data.map((d) => `${d.id}:${d.value}:${d.name}:${d.accessCount}`).join("|"),
    [data]
  );
  const stableData = (0, import_react2.useMemo)(() => data, [dataSignature]);
  const colorClasses = (0, import_react2.useMemo)(() => getColorClasses(), [isDark]);
  const mapOptions = (0, import_react2.useMemo)(() => {
    const bgColor = getCssVar("--color-background-50", "#F6F6F6");
    return {
      disableDefaultUI: true,
      zoomControl: true,
      scrollwheel: true,
      draggable: true,
      backgroundColor: bgColor,
      styles: [
        {
          stylers: [{ color: bgColor }]
        },
        {
          elementType: "labels",
          stylers: [{ visibility: "off" }]
        },
        {
          elementType: "geometry.stroke",
          stylers: [{ visibility: "off" }]
        }
      ]
    };
  }, [isDark]);
  const { isLoaded, loadError } = (0, import_api.useJsApiLoader)({
    id: mapId,
    googleMapsApiKey: apiKey
  });
  const onLoad = (0, import_react2.useCallback)(
    (mapInstance) => {
      setMap(mapInstance);
      if (bounds) {
        const googleBounds = new google.maps.LatLngBounds(
          { lat: bounds.south, lng: bounds.west },
          { lat: bounds.north, lng: bounds.east }
        );
        mapInstance.fitBounds(googleBounds, 0);
        google.maps.event.addListenerOnce(mapInstance, "idle", () => {
          const currentZoom = mapInstance.getZoom();
          if (currentZoom) {
            mapInstance.setZoom(currentZoom + 0.8);
          }
        });
      }
    },
    [bounds]
  );
  const onUnmount = (0, import_react2.useCallback)(() => {
    if (nreBoundaryLayerRef.current) {
      nreBoundaryLayerRef.current.setMap(null);
    }
    setMap(null);
  }, []);
  const nreBoundaries = (0, import_react2.useMemo)(
    () => computeNREBoundaries(stableData),
    [stableData]
  );
  (0, import_react2.useEffect)(() => {
    if (!map || !stableData.length) return;
    const strokeCityColor = getCssVar("--color-map-stroke-city", "#9ca3af");
    const strokeNreColor = getCssVar("--color-map-stroke-nre", "#4b5563");
    map.data.forEach((feature) => {
      map.data.remove(feature);
    });
    if (nreBoundaryLayerRef.current) {
      nreBoundaryLayerRef.current.setMap(null);
      nreBoundaryLayerRef.current = null;
    }
    stableData.forEach((region) => {
      try {
        const feature = map.data.addGeoJson(region.geoJson);
        if (feature && feature.length > 0) {
          feature.forEach((f) => {
            f.setProperty("regionId", region.id);
            f.setProperty("regionName", region.name);
            f.setProperty("regionValue", region.value);
            f.setProperty("regionAccessCount", region.accessCount);
          });
        }
      } catch (error) {
        console.error(
          `Failed to add GeoJSON for region ${region.name}:`,
          error
        );
      }
    });
    const nreFeatureIndex = /* @__PURE__ */ new Map();
    map.data.forEach((f) => {
      const name = f.getProperty("regionName");
      if (name) {
        const list = nreFeatureIndex.get(name) ?? [];
        list.push(f);
        nreFeatureIndex.set(name, list);
      }
    });
    map.data.setStyle(createStyleFunction(0, colorClasses, strokeCityColor));
    const nreLayer = new google.maps.Data();
    nreBoundaries.forEach((boundary) => {
      nreLayer.addGeoJson(boundary);
    });
    nreLayer.setStyle({
      fillOpacity: 0,
      strokeColor: strokeNreColor,
      strokeWeight: 1.5,
      clickable: false
    });
    nreLayer.setMap(map);
    nreBoundaryLayerRef.current = nreLayer;
    const startTime = performance.now();
    const animateFadeIn = (currentTime) => {
      const elapsed = currentTime - startTime;
      const progress = Math.min(elapsed / FADE_DURATION, 1);
      const currentOpacity = progress * TARGET_OPACITY;
      map.data.setStyle(
        createStyleFunction(currentOpacity, colorClasses, strokeCityColor)
      );
      if (progress < 1) {
        fadeAnimationRef.current = requestAnimationFrame(animateFadeIn);
      } else {
        fadeAnimationRef.current = null;
      }
    };
    fadeAnimationRef.current = requestAnimationFrame(animateFadeIn);
    const applyHoverStyle = (features, opacity, weight) => {
      features.forEach((f) => {
        map.data.overrideStyle(f, {
          fillOpacity: opacity,
          strokeColor: strokeCityColor,
          strokeWeight: weight
        });
      });
    };
    const animateHover = (features, from, to, fromWeight, toWeight) => {
      if (hoverAnimationRef.current) {
        cancelAnimationFrame(hoverAnimationRef.current);
      }
      const start = performance.now();
      const animate = (now) => {
        const progress = Math.min((now - start) / HOVER_DURATION, 1);
        const opacity = from + (to - from) * progress;
        const weight = fromWeight + (toWeight - fromWeight) * progress;
        applyHoverStyle(features, opacity, weight);
        if (progress < 1) {
          hoverAnimationRef.current = requestAnimationFrame(animate);
        } else {
          hoverAnimationRef.current = null;
        }
      };
      hoverAnimationRef.current = requestAnimationFrame(animate);
    };
    let currentNRE = null;
    let revertTimeout = null;
    const collectNREFeatures = (nreName) => {
      return nreFeatureIndex.get(nreName) ?? [];
    };
    const mouseoverListener = map.data.addListener(
      "mouseover",
      (event) => {
        if (revertTimeout) {
          clearTimeout(revertTimeout);
          revertTimeout = null;
        }
        const regionId = event.feature.getProperty("regionId");
        const regionName = event.feature.getProperty("regionName");
        const region = stableData.find((r) => r.id === regionId);
        if (region) {
          setHoveredRegion(region);
          if (event.domEvent) {
            setInfoPosition({
              x: event.domEvent.clientX,
              y: event.domEvent.clientY
            });
          }
        }
        if (currentNRE !== regionName) {
          if (currentNRE) {
            const prevFeatures = collectNREFeatures(currentNRE);
            animateHover(prevFeatures, 1, TARGET_OPACITY, 1.5, 0.5);
          }
          currentNRE = regionName;
          const nreFeatures = collectNREFeatures(regionName);
          animateHover(nreFeatures, TARGET_OPACITY, 1, 0.5, 1.5);
        }
      }
    );
    const mouseoutListener = map.data.addListener("mouseout", () => {
      revertTimeout = setTimeout(() => {
        setHoveredRegion(null);
        setInfoPosition(null);
        if (currentNRE) {
          const prevFeatures = collectNREFeatures(currentNRE);
          animateHover(prevFeatures, 1, TARGET_OPACITY, 1.5, 0.5);
          currentNRE = null;
        }
      }, 50);
    });
    const mousemoveListener = map.data.addListener(
      "mousemove",
      (event) => {
        if (event.domEvent) {
          setInfoPosition({
            x: event.domEvent.clientX,
            y: event.domEvent.clientY
          });
        }
      }
    );
    const computeNREBounds = (nreName) => {
      const nreBounds = new google.maps.LatLngBounds();
      for (const f of collectNREFeatures(nreName)) {
        f.getGeometry()?.forEachLatLng((latLng) => {
          nreBounds.extend(latLng);
        });
      }
      return nreBounds;
    };
    const clickListener = map.data.addListener(
      "click",
      (event) => {
        const regionId = event.feature.getProperty("regionId");
        const regionName = event.feature.getProperty("regionName");
        const region = stableData.find((r) => r.id === regionId);
        if (region) {
          onRegionClickRef.current?.(region);
        }
        const nreBounds = computeNREBounds(regionName);
        if (!nreBounds.isEmpty()) {
          map.fitBounds(nreBounds, 20);
        }
      }
    );
    return () => {
      if (fadeAnimationRef.current)
        cancelAnimationFrame(fadeAnimationRef.current);
      if (hoverAnimationRef.current)
        cancelAnimationFrame(hoverAnimationRef.current);
      if (revertTimeout) clearTimeout(revertTimeout);
      if (nreBoundaryLayerRef.current) {
        nreBoundaryLayerRef.current.setMap(null);
        nreBoundaryLayerRef.current = null;
      }
      google.maps.event.removeListener(mouseoverListener);
      google.maps.event.removeListener(mouseoutListener);
      google.maps.event.removeListener(mousemoveListener);
      google.maps.event.removeListener(clickListener);
    };
  }, [map, stableData, colorClasses, nreBoundaries]);
  (0, import_react2.useEffect)(() => {
    if (!map || !stableData.length) return;
    const visibleBounds = new google.maps.LatLngBounds();
    let hasVisibleFeatures = false;
    map.data.forEach((feature) => {
      const value = feature.getProperty("regionValue");
      const colorClass = getColorClass(value ?? 0, colorClasses);
      const classIndex = colorClasses.indexOf(colorClass);
      if (activeClasses.has(classIndex)) {
        map.data.overrideStyle(feature, { visible: true });
        feature.getGeometry()?.forEachLatLng((latLng) => {
          visibleBounds.extend(latLng);
        });
        hasVisibleFeatures = true;
      } else {
        map.data.overrideStyle(feature, { visible: false });
      }
    });
    if (hasVisibleFeatures && !visibleBounds.isEmpty()) {
      map.fitBounds(visibleBounds, 20);
    }
  }, [map, stableData, activeClasses, colorClasses]);
  const toggleClass = (index) => {
    setActiveClasses((prev) => {
      const next = new Set(prev);
      if (next.has(index)) {
        next.delete(index);
      } else {
        next.add(index);
      }
      return next;
    });
  };
  if (loadError) {
    return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "p-5 bg-background border border-border-50 rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { color: "text-error-700", children: "Erro ao carregar o mapa" }) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
    "div",
    {
      className: cn(
        "p-5 bg-background border border-border-50 rounded-xl flex flex-col gap-4",
        className
      ),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex flex-col gap-4", children: [
          /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
            Text_default,
            {
              as: "h2",
              size: "lg",
              weight: "bold",
              className: "leading-[21px] tracking-[0.2px]",
              children: title
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex flex-wrap gap-8", children: colorClasses.map((colorClass, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
            LegendItem,
            {
              color: colorClass.fillColor,
              borderColor: colorClass.fillColor === colorClass.strokeColor ? void 0 : colorClass.strokeColor,
              label: colorClass.label,
              active: activeClasses.has(index),
              onClick: () => toggleClass(index)
            },
            colorClass.label
          )) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "bg-background-50 rounded-lg h-[415px] relative overflow-hidden", children: [
          loading || !isLoaded ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LoadingSkeleton, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
            import_api.GoogleMap,
            {
              mapContainerStyle: containerStyle,
              center: defaultCenter,
              zoom: 7,
              onLoad,
              onUnmount,
              options: mapOptions
            }
          ),
          hoveredRegion && infoPosition && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
            "div",
            {
              className: "fixed z-50 bg-background border border-border-50 shadow-lg rounded-lg p-3 pointer-events-none",
              style: {
                left: Math.min(infoPosition.x + 10, window.innerWidth - 220),
                top: Math.min(infoPosition.y + 10, window.innerHeight - 80)
              },
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text_default, { size: "sm", weight: "semibold", children: hoveredRegion.name }),
                /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text_default, { size: "xs", color: "text-text-700", children: [
                  countLabel,
                  ": ",
                  hoveredRegion.accessCount.toLocaleString("pt-BR")
                ] })
              ]
            }
          )
        ] })
      ]
    }
  );
};
var ChoroplethMap_default = ChoroplethMap;
//# sourceMappingURL=index.js.map