"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";


var _chunkVRHGVLSLcjs = require('./chunk-VRHGVLSL.cjs');

// src/utils/cn.ts
var _clsx = require('clsx');
var _tailwindmerge = require('tailwind-merge');
function cn(...inputs) {
  return twMerge(_clsx.clsx.call(void 0, inputs));
}
function getPlatformProductionUrl(platform) {
  switch (platform) {
    // *-hub platforms — env var convention: NEXT_PUBLIC_<NAME>_HUB_URL
    case "marketing-hub":
      return process.env.NEXT_PUBLIC_MARKETING_HUB_URL || "https://marketing-hub.flamingo.so";
    case "company-hub":
      return process.env.NEXT_PUBLIC_COMPANY_HUB_URL || "https://company-hub.flamingo.so";
    case "product-hub":
      return process.env.NEXT_PUBLIC_PRODUCT_HUB_URL || "https://product-hub.flamingo.so";
    case "revenue-hub":
      return process.env.NEXT_PUBLIC_REVENUE_HUB_URL || "https://revenue-hub.flamingo.so";
    case "people-hub":
      return process.env.NEXT_PUBLIC_PEOPLE_HUB_URL || "https://people-hub.flamingo.so";
    // Standalone platforms — env var convention: NEXT_PUBLIC_<NAME>_URL
    case "openmsp":
      return process.env.NEXT_PUBLIC_OPENMSP_URL || "https://www.openmsp.ai";
    case "flamingo":
      return process.env.NEXT_PUBLIC_FLAMINGO_URL || "https://www.flamingo.run";
    case "tmcg":
      return process.env.NEXT_PUBLIC_TMCG_URL || "https://www.tmcg.miami";
    case "flamingo-teaser":
      return process.env.NEXT_PUBLIC_FLAMINGO_URL || "https://www.flamingo.run";
    case "openframe":
      return process.env.NEXT_PUBLIC_OPENFRAME_URL || "https://openframe.ai";
    case "universal":
      return process.env.NEXT_PUBLIC_FLAMINGO_URL || "https://www.flamingo.run";
    default:
      return process.env.NEXT_PUBLIC_FLAMINGO_URL || "https://www.flamingo.run";
  }
}
function getAllPlatformBaseDomains() {
  if (typeof window === "undefined") return [];
  const hostname = window.location.hostname;
  if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("127.")) {
    return [];
  }
  const isVercelPreview = process.env.VERCEL_ENV === "preview" || process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" || hostname.includes(".vercel.app");
  if (isVercelPreview) {
    return [".vercel.app", "vercel.app"];
  }
  const platformIdentifiers = [
    "marketing-hub",
    "company-hub",
    "product-hub",
    "revenue-hub",
    "people-hub",
    "openmsp",
    "flamingo",
    "tmcg",
    "flamingo-teaser",
    "openframe",
    "universal"
  ];
  const baseDomains = /* @__PURE__ */ new Set();
  platformIdentifiers.forEach((platform) => {
    try {
      const url = getPlatformProductionUrl(platform);
      const urlHostname = new URL(url).hostname;
      const parts = urlHostname.split(".");
      if (parts.length >= 2) {
        const baseDomain = parts.slice(-2).join(".");
        baseDomains.add(`.${baseDomain}`);
        baseDomains.add(baseDomain);
      }
    } catch (error) {
      console.warn("[Platform Domains] Failed to parse URL for platform:", platform, error);
    }
  });
  return Array.from(baseDomains);
}
function getBaseUrl(platform) {
  if (process.env.NODE_ENV !== "production") {
    return process.env.NEXT_PUBLIC_DEV_URL || "http://localhost:3000";
  }
  if (platform) {
    return getPlatformProductionUrl(platform);
  }
  if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
    return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`;
  }
  return "https://www.openmsp.ai";
}
var twMerge;
var init_cn = _chunkVRHGVLSLcjs.__esm.call(void 0, {
  "src/utils/cn.ts"() {
    "use strict";
    twMerge = _tailwindmerge.extendTailwindMerge.call(void 0, {
      extend: {
        classGroups: {
          "ods-typography": ["text-h1", "text-h2", "text-h3", "text-h4", "text-h5", "text-h6"]
        }
      }
    });
  }
});







exports.cn = cn; exports.getPlatformProductionUrl = getPlatformProductionUrl; exports.getAllPlatformBaseDomains = getAllPlatformBaseDomains; exports.getBaseUrl = getBaseUrl; exports.init_cn = init_cn;
//# sourceMappingURL=chunk-664KA5FI.cjs.map