function c() {
  if (console && console.warn) {
    for (var a = arguments.length, e = new Array(a), n = 0; n < a; n++)
      e[n] = arguments[n];
    typeof e[0] == "string" && (e[0] = `react-i18next:: ${e[0]}`), console.warn(...e);
  }
}
const u = {};
function f() {
  for (var a = arguments.length, e = new Array(a), n = 0; n < a; n++)
    e[n] = arguments[n];
  typeof e[0] == "string" && u[e[0]] || (typeof e[0] == "string" && (u[e[0]] = /* @__PURE__ */ new Date()), c(...e));
}
const i = (a, e) => () => {
  if (a.isInitialized)
    e();
  else {
    const n = () => {
      setTimeout(() => {
        a.off("initialized", n);
      }, 0), e();
    };
    a.on("initialized", n);
  }
};
function h(a, e, n) {
  a.loadNamespaces(e, i(a, n));
}
function m(a, e, n, o) {
  typeof n == "string" && (n = [n]), n.forEach((t) => {
    a.options.ns.indexOf(t) < 0 && a.options.ns.push(t);
  }), a.loadLanguages(e, i(a, o));
}
function p(a, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  const o = e.languages[0], t = e.options ? e.options.fallbackLng : !1, r = e.languages[e.languages.length - 1];
  if (o.toLowerCase() === "cimode")
    return !0;
  const s = (d, l) => {
    const g = e.services.backendConnector.state[`${d}|${l}`];
    return g === -1 || g === 2;
  };
  return n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && e.services.backendConnector.backend && e.isLanguageChangingTo && !s(e.isLanguageChangingTo, a) ? !1 : !!(e.hasResourceBundle(o, a) || !e.services.backendConnector.backend || e.options.resources && !e.options.partialBundledLanguages || s(o, a) && (!t || s(r, a)));
}
function L(a, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
  return !e.languages || !e.languages.length ? (f("i18n.languages were undefined or empty", e.languages), !0) : e.options.ignoreJSONStructure !== void 0 ? e.hasLoadedNamespace(a, {
    lng: n.lng,
    precheck: (t, r) => {
      if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && t.services.backendConnector.backend && t.isLanguageChangingTo && !r(t.isLanguageChangingTo, a))
        return !1;
    }
  }) : p(a, e, n);
}
export {
  L as hasLoadedNamespace,
  m as loadLanguages,
  h as loadNamespaces,
  c as warn,
  f as warnOnce
};
