import { Env as s } from "./accelbyte-widgets108.mjs";
import { DesktopChecker as u } from "@accelbyte/sdk";
function m() {
  try {
    return window.ga;
  } catch {
    return null;
  }
}
function E({
  eventCategory: r,
  eventAction: n = `${location.pathname}${location.search}`,
  eventLabel: o,
  eventValue: c = 0,
  maxRetry: a = 3
}) {
  const t = m(), e = s.TELEMETRY_GOOGLE_ANALYTICS_TRACKING_ID === "true", i = a - 1;
  if (u.isDesktopApp() || !e)
    return;
  const p = () => {
    window.setTimeout(
      () => E({
        eventCategory: r,
        eventAction: n,
        eventLabel: o,
        eventValue: c,
        maxRetry: i
      }),
      1e3
    );
  };
  !t && e && i > 0 && p(), t && t("send", {
    hitType: "event",
    eventCategory: r,
    eventAction: n,
    eventLabel: o
  });
}
export {
  E as gaSendErrorEvent
};
