const runtimeManifest = {
  i18n: {
    resources: ["en-US", "zh-CN", "ko-KR", "ru-RU"],
    fallbackLng: "zh-CN",
    detection: {
      order: ["querystring", "localStorage", "navigator"],
      lookupQuerystring: "lang",
      lookupLocalStorage: "i18nextLng",
      caches: ["localStorage"],
    },
  },
  request: {
    client: "axios.create",
    baseURL: "window.settings.base_url + /api/v2",
    timeoutMs: 30000,
    contentType: "application/json",
    authTokenSource: "Am() token store",
    securePathSource: "window.settings.secure_path",
    publicEndpoints: [
      "/passport/auth/login",
      "/passport/auth/token2Login",
      "/passport/auth/register",
      "/guest/comm/config",
      "/passport/comm/sendEmailVerify",
      "/passport/auth/forget",
    ],
    requestInterceptors: [
      "Attach Authorization for non-public endpoints",
      "Attach Content-Language from localStorage.i18nextLng or zh-CN",
    ],
    responseInterceptors: [
      "Unwrap response.data",
      "On 401 or 403 trigger logout flow",
      "Map common HTTP errors to i18n messages",
      "Show toast via hN.error on failed responses",
    ],
  },
};

module.exports = {
  runtimeManifest,
};
