import { E as a } from "./FetchConfigsUtils-476a602b.mjs";
import { s as m } from "./starBgGradient-589e5185.mjs";
import e from "react";
import { Trans as t } from "react-i18next";
import { t as l } from "./CommonError-e27d39d7.mjs";
const c = (n) => {
  var i;
  const { error: r } = n;
  if (!r)
    return null;
  if (a.isAxiosNetworkError(r))
    return /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.networkError" }, "The server cannot be reached. Please try again.");
  const s = a.extractServiceErrorCode(r) || 0, o = l(s);
  return o ? /* @__PURE__ */ e.createElement(e.Fragment, null, o) : (a.isAxiosError(r) && ((i = r == null ? void 0 : r.response) == null ? void 0 : i.status)) === 403 ? /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.playerPortal.forbidden" }, "You cannot access this page. Please go back.") : a.isAxiosServerError(r) ? /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.serverError" }, "We are experiencing some technical issues right now. Please try again later.") : /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.unknownError" }, "Something went wrong. Please contact support for assistance.");
}, f = ({ error: n, appId: r, isWithBackground: s = !0 }) => {
  var o;
  return a.isAxiosError(n) && r && ((o = n.response) == null ? void 0 : o.status) === 404 ? /* @__PURE__ */ e.createElement("div", { className: "noMatchingGameError", style: { backgroundImage: s ? `url(${m})` : void 0 } }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement("h2", { className: "heading" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.noMatchingGame" }, 'Game "', { appId: r }, `" doesn't exist in the store.`)), /* @__PURE__ */ e.createElement("p", { className: "paragraph" }, /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.noMatchingGameResolution" }, "To fix this, do one of the following:")), /* @__PURE__ */ e.createElement("ol", { className: "list" }, /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.noMatchingGameResolutionEnsure" }, 'Ensure the game "', { appId: r }, '" exists in the store,')), /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.noMatchingGameResolutionChangeAppID" }, "Change the App ID to an existing game, or")), /* @__PURE__ */ e.createElement("li", null, /* @__PURE__ */ e.createElement(t, { i18nKey: "CommonError.noMatchingGameResolutionChangeTemplateConfig" }, "Change the Template Config to multiple game."))))) : /* @__PURE__ */ e.createElement(c, { error: n });
};
export {
  c as C,
  f as N
};
