import { LOOKUP_MAX_LENGTH as c } from "./analyticsAnalysisUtils.js";
const l = /* @__PURE__ */ new Set(), d = (e, a) => {
  if (process.env.NODE_ENV === "production" || a.length <= c)
    return;
  const t = `${e}::${a}`;
  l.has(t) || (l.add(t), console.warn(
    `[Analytics] data-track-ga-event-label exceeds ${c} chars for action "${e}". Overlay mapping uses only the first ${c} chars.`
  ));
}, u = () => typeof window < "u" && Array.isArray(window.dataLayer), g = (e) => {
  if (!u())
    return;
  const a = {
    event: "ga_event",
    eventCategory: e.category,
    eventAction: e.action,
    eventLabel: e.label
  };
  e.value !== void 0 && e.value !== "" && (a.eventValue = e.value), window.dataLayer?.push(a);
}, y = (e, a) => (...t) => {
  const n = e(...t);
  return g(a), n;
}, A = {}, w = {}, L = (e) => {
  const { trigger: a, category: t, action: n, label: r, value: s } = e, i = n || `action_${a}`, o = {
    "data-track-ga-event-trigger": a,
    "data-track-ga-event-category": t,
    "data-track-ga-event-action": i
  };
  return r && (o["data-track-ga-event-label"] = r, d(i, r)), s && (o["data-track-ga-event-value"] = s), o;
};
export {
  A as TRACKING_ACTIONS,
  w as TRACKING_LABELS,
  y as executeAndTrack,
  g as gaPush,
  L as getTrackingAttributes
};
//# sourceMappingURL=googleAnalyticsUtils.js.map
