fixed version control heatmap and activity
This commit is contained in:
26
.next/standalone/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
generated
vendored
Normal file
26
.next/standalone/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "detectDomainLocale", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return detectDomainLocale;
|
||||
}
|
||||
});
|
||||
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
||||
if (!domainItems) return;
|
||||
if (detectedLocale) {
|
||||
detectedLocale = detectedLocale.toLowerCase();
|
||||
}
|
||||
for (const item of domainItems){
|
||||
var _item_domain, _item_locales;
|
||||
// remove port if present
|
||||
const domainHostname = (_item_domain = item.domain) == null ? void 0 : _item_domain.split(":", 1)[0].toLowerCase();
|
||||
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || ((_item_locales = item.locales) == null ? void 0 : _item_locales.some((locale)=>locale.toLowerCase() === detectedLocale))) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=detect-domain-locale.js.map
|
||||
63
.next/standalone/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js
generated
vendored
Normal file
63
.next/standalone/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getLocaleRedirect", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getLocaleRedirect;
|
||||
}
|
||||
});
|
||||
const _acceptheader = require("../../../server/accept-header");
|
||||
const _denormalizepagepath = require("../page-path/denormalize-page-path");
|
||||
const _detectdomainlocale = require("./detect-domain-locale");
|
||||
const _formaturl = require("../router/utils/format-url");
|
||||
const _getcookieparser = require("../../../server/api-utils/get-cookie-parser");
|
||||
function getLocaleFromCookie(i18n, headers) {
|
||||
if (headers === void 0) headers = {};
|
||||
var _getCookieParser_NEXT_LOCALE, _getCookieParser;
|
||||
const nextLocale = (_getCookieParser = (0, _getcookieparser.getCookieParser)(headers || {})()) == null ? void 0 : (_getCookieParser_NEXT_LOCALE = _getCookieParser.NEXT_LOCALE) == null ? void 0 : _getCookieParser_NEXT_LOCALE.toLowerCase();
|
||||
return nextLocale ? i18n.locales.find((locale)=>nextLocale === locale.toLowerCase()) : undefined;
|
||||
}
|
||||
function detectLocale(param) {
|
||||
let { i18n, headers, domainLocale, preferredLocale, pathLocale } = param;
|
||||
return pathLocale || (domainLocale == null ? void 0 : domainLocale.defaultLocale) || getLocaleFromCookie(i18n, headers) || preferredLocale || i18n.defaultLocale;
|
||||
}
|
||||
function getAcceptPreferredLocale(i18n, headers) {
|
||||
if ((headers == null ? void 0 : headers["accept-language"]) && !Array.isArray(headers["accept-language"])) {
|
||||
try {
|
||||
return (0, _acceptheader.acceptLanguage)(headers["accept-language"], i18n.locales);
|
||||
} catch (err) {}
|
||||
}
|
||||
}
|
||||
function getLocaleRedirect(param) {
|
||||
let { defaultLocale, domainLocale, pathLocale, headers, nextConfig, urlParsed } = param;
|
||||
if (nextConfig.i18n && nextConfig.i18n.localeDetection !== false && (0, _denormalizepagepath.denormalizePagePath)(urlParsed.pathname) === "/") {
|
||||
const preferredLocale = getAcceptPreferredLocale(nextConfig.i18n, headers);
|
||||
const detectedLocale = detectLocale({
|
||||
i18n: nextConfig.i18n,
|
||||
preferredLocale,
|
||||
headers,
|
||||
pathLocale,
|
||||
domainLocale
|
||||
});
|
||||
const preferredDomain = (0, _detectdomainlocale.detectDomainLocale)(nextConfig.i18n.domains, undefined, preferredLocale);
|
||||
if (domainLocale && preferredDomain) {
|
||||
const isPDomain = preferredDomain.domain === domainLocale.domain;
|
||||
const isPLocale = preferredDomain.defaultLocale === preferredLocale;
|
||||
if (!isPDomain || !isPLocale) {
|
||||
const scheme = "http" + (preferredDomain.http ? "" : "s");
|
||||
const rlocale = isPLocale ? "" : preferredLocale;
|
||||
return scheme + "://" + preferredDomain.domain + "/" + rlocale;
|
||||
}
|
||||
}
|
||||
if (detectedLocale.toLowerCase() !== defaultLocale.toLowerCase()) {
|
||||
return (0, _formaturl.formatUrl)({
|
||||
...urlParsed,
|
||||
pathname: (nextConfig.basePath || "") + "/" + detectedLocale + (nextConfig.trailingSlash ? "/" : "")
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-locale-redirect.js.map
|
||||
30
.next/standalone/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
generated
vendored
Normal file
30
.next/standalone/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "normalizeLocalePath", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return normalizeLocalePath;
|
||||
}
|
||||
});
|
||||
function normalizeLocalePath(pathname, locales) {
|
||||
let detectedLocale;
|
||||
// first item will be empty string from splitting at first char
|
||||
const pathnameParts = pathname.split("/");
|
||||
(locales || []).some((locale)=>{
|
||||
if (pathnameParts[1] && pathnameParts[1].toLowerCase() === locale.toLowerCase()) {
|
||||
detectedLocale = locale;
|
||||
pathnameParts.splice(1, 1);
|
||||
pathname = pathnameParts.join("/") || "/";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return {
|
||||
pathname,
|
||||
detectedLocale
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=normalize-locale-path.js.map
|
||||
Reference in New Issue
Block a user