"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getLanguage = exports.default = void 0;
var _utils = require("../../utils");
var _zhCN = _interopRequireDefault(require("./zh-CN"));
var _zhTW = _interopRequireDefault(require("./zh-TW"));
var _enUS = _interopRequireDefault(require("./en-US"));
var _itIT = _interopRequireDefault(require("./it-IT"));
const locales = {
  'zh-CN': _zhCN.default,
  'zh-TW': _zhTW.default,
  'en-US': _enUS.default,
  'it-IT': _itIT.default
};
const getLanguage = () => {
  // support ssr
  if (!(0, _utils.isBrowser)()) {
    return '';
  }
  const lang = window.localStorage.getItem('wau_locale');
  return lang || window.g_locale || navigator.language;
};
exports.getLanguage = getLanguage;
var _default = () => {
  const gLocale = getLanguage();
  if (locales[gLocale]) {
    return locales[gLocale];
  }
  return locales['zh-CN'];
};
exports.default = _default;