{"version":3,"sources":["webpack:///../node_modules/get-user-locale/dist/esm/index.js"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,uDAAuD,4BAA4B;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,qBAAqB,0CAAG,0BAA0B,2BAA2B;AACpF;AACA;AACA;AACO,oBAAoB,0CAAG,yBAAyB,2BAA2B;AACnE,sEAAa,EAAC","file":"vendor.get-user-locale.50721e56b2b256110583.js","sourcesContent":["import mem from 'mem';\nfunction isString(el) {\n return typeof el === 'string';\n}\nfunction isUnique(el, index, arr) {\n return arr.indexOf(el) === index;\n}\nfunction isAllLowerCase(el) {\n return el.toLowerCase() === el;\n}\nfunction fixCommas(el) {\n return el.indexOf(',') === -1 ? el : el.split(',');\n}\nfunction normalizeLocale(locale) {\n if (!locale) {\n return locale;\n }\n if (locale === 'C' || locale === 'posix' || locale === 'POSIX') {\n return 'en-US';\n }\n // If there's a dot (.) in the locale, it's likely in the format of \"en-US.UTF-8\", so we only take the first part\n if (locale.indexOf('.') !== -1) {\n var _a = locale.split('.')[0], actualLocale = _a === void 0 ? '' : _a;\n return normalizeLocale(actualLocale);\n }\n // If there's an at sign (@) in the locale, it's likely in the format of \"en-US@posix\", so we only take the first part\n if (locale.indexOf('@') !== -1) {\n var _b = locale.split('@')[0], actualLocale = _b === void 0 ? '' : _b;\n return normalizeLocale(actualLocale);\n }\n // If there's a dash (-) in the locale and it's not all lower case, it's already in the format of \"en-US\", so we return it\n if (locale.indexOf('-') === -1 || !isAllLowerCase(locale)) {\n return locale;\n }\n var _c = locale.split('-'), splitEl1 = _c[0], _d = _c[1], splitEl2 = _d === void 0 ? '' : _d;\n return \"\".concat(splitEl1, \"-\").concat(splitEl2.toUpperCase());\n}\nfunction getUserLocalesInternal(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.useFallbackLocale, useFallbackLocale = _c === void 0 ? true : _c, _d = _b.fallbackLocale, fallbackLocale = _d === void 0 ? 'en-US' : _d;\n var languageList = [];\n if (typeof navigator !== 'undefined') {\n var rawLanguages = navigator.languages || [];\n var languages = [];\n for (var _i = 0, rawLanguages_1 = rawLanguages; _i < rawLanguages_1.length; _i++) {\n var rawLanguagesItem = rawLanguages_1[_i];\n languages = languages.concat(fixCommas(rawLanguagesItem));\n }\n var rawLanguage = navigator.language;\n var language = rawLanguage ? fixCommas(rawLanguage) : rawLanguage;\n languageList = languageList.concat(languages, language);\n }\n if (useFallbackLocale) {\n languageList.push(fallbackLocale);\n }\n return languageList.filter(isString).map(normalizeLocale).filter(isUnique);\n}\nexport var getUserLocales = mem(getUserLocalesInternal, { cacheKey: JSON.stringify });\nfunction getUserLocaleInternal(options) {\n return getUserLocales(options)[0] || null;\n}\nexport var getUserLocale = mem(getUserLocaleInternal, { cacheKey: JSON.stringify });\nexport default getUserLocale;\n"],"sourceRoot":""}