next-intl 3.22.0-canary.0 → 3.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/middleware/getAlternateLinksHeaderValue.js +1 -1
- package/dist/development/middleware/middleware.js +17 -20
- package/dist/development/middleware/resolveLocale.js +21 -30
- package/dist/development/middleware/syncCookie.js +7 -7
- package/dist/development/middleware/utils.js +4 -1
- package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +4 -2
- package/dist/development/navigation/react-client/createNavigation.js +1 -1
- package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +4 -2
- package/dist/development/navigation/react-client/useBaseRouter.js +3 -3
- package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -0
- package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +2 -0
- package/dist/development/navigation/shared/BaseLink.js +2 -1
- package/dist/development/navigation/shared/LegacyBaseLink.js +3 -1
- package/dist/development/navigation/shared/createSharedNavigationFns.js +2 -1
- package/dist/development/navigation/shared/syncLocaleCookie.js +26 -5
- package/dist/development/plugin.js +16 -6
- package/dist/development/react-client/index.js +3 -1
- package/dist/development/routing/config.js +18 -1
- package/dist/development/server/react-client/index.js +2 -0
- package/dist/development/server/react-server/RequestLocale.js +1 -1
- package/dist/development/server/react-server/RequestLocaleLegacy.js +1 -1
- package/dist/development/server/react-server/createRequestConfig.js +1 -1
- package/dist/development/server.react-client.js +1 -0
- package/dist/development/server.react-server.js +1 -0
- package/dist/development/shared/constants.js +0 -9
- package/dist/development/shared/utils.js +2 -2
- package/dist/esm/middleware/getAlternateLinksHeaderValue.js +1 -1
- package/dist/esm/middleware/middleware.js +1 -1
- package/dist/esm/middleware/resolveLocale.js +1 -1
- package/dist/esm/middleware/syncCookie.js +1 -1
- package/dist/esm/middleware/utils.js +1 -1
- package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/createNavigation.js +1 -1
- package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/shared/BaseLink.js +1 -1
- package/dist/esm/navigation/shared/LegacyBaseLink.js +1 -1
- package/dist/esm/navigation/shared/createSharedNavigationFns.js +1 -1
- package/dist/esm/navigation/shared/syncLocaleCookie.js +1 -1
- package/dist/esm/plugin.js +1 -1
- package/dist/esm/routing/config.js +1 -1
- package/dist/esm/server/react-client/index.js +1 -1
- package/dist/esm/server/react-server/RequestLocale.js +1 -1
- package/dist/esm/server/react-server/RequestLocaleLegacy.js +1 -1
- package/dist/esm/server.react-client.js +1 -1
- package/dist/esm/server.react-server.js +1 -1
- package/dist/esm/shared/constants.js +1 -1
- package/dist/production/middleware/getAlternateLinksHeaderValue.js +1 -1
- package/dist/production/middleware/middleware.js +1 -1
- package/dist/production/middleware/resolveLocale.js +1 -1
- package/dist/production/middleware/syncCookie.js +1 -1
- package/dist/production/middleware/utils.js +1 -1
- package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/createNavigation.js +1 -1
- package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/shared/BaseLink.js +1 -1
- package/dist/production/navigation/shared/LegacyBaseLink.js +1 -1
- package/dist/production/navigation/shared/createSharedNavigationFns.js +1 -1
- package/dist/production/navigation/shared/syncLocaleCookie.js +1 -1
- package/dist/production/plugin.js +1 -1
- package/dist/production/routing/config.js +1 -1
- package/dist/production/server/react-client/index.js +1 -1
- package/dist/production/server/react-server/RequestLocale.js +1 -1
- package/dist/production/server/react-server/RequestLocaleLegacy.js +1 -1
- package/dist/production/server.react-client.js +1 -1
- package/dist/production/server.react-server.js +1 -1
- package/dist/production/shared/constants.js +1 -1
- package/dist/types/src/middleware/middleware.d.ts +10 -2
- package/dist/types/src/middleware/resolveLocale.d.ts +2 -3
- package/dist/types/src/middleware/syncCookie.d.ts +2 -2
- package/dist/types/src/middleware/utils.d.ts +1 -1
- package/dist/types/src/navigation/react-client/ClientLink.d.ts +1 -1
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +5 -4
- package/dist/types/src/navigation/react-client/createNavigation.d.ts +14 -13
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +5 -4
- package/dist/types/src/navigation/react-client/index.d.ts +1 -1
- package/dist/types/src/navigation/react-client/useBasePathname.d.ts +1 -1
- package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +3 -2
- package/dist/types/src/navigation/react-server/ServerLink.d.ts +1 -1
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +4 -3
- package/dist/types/src/navigation/react-server/createNavigation.d.ts +14 -13
- package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +1 -1
- package/dist/types/src/navigation/shared/BaseLink.d.ts +2 -0
- package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +2 -0
- package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +18 -14
- package/dist/types/src/navigation/shared/redirects.d.ts +1 -1
- package/dist/types/src/navigation/shared/syncLocaleCookie.d.ts +2 -1
- package/dist/types/src/react-client/index.d.ts +1 -1
- package/dist/types/src/react-server/getTranslator.d.ts +1 -1
- package/dist/types/src/routing/config.d.ts +30 -3
- package/dist/types/src/server/react-client/index.d.ts +2 -1
- package/dist/types/src/server/react-server/getRequestConfig.d.ts +1 -1
- package/dist/types/src/server/react-server/getTranslations.d.ts +1 -1
- package/dist/types/src/server/react-server/index.d.ts +4 -1
- package/dist/types/src/shared/constants.d.ts +0 -3
- package/dist/types/src/shared/utils.d.ts +4 -4
- package/package.json +5 -4
- package/dist/types/src/middleware/config.d.ts +0 -21
|
@@ -20,4 +20,5 @@ exports.getNow = getNow.default;
|
|
|
20
20
|
exports.getTimeZone = getTimeZone.default;
|
|
21
21
|
exports.getTranslations = getTranslations.default;
|
|
22
22
|
exports.getLocale = getLocale.default;
|
|
23
|
+
exports.setRequestLocale = RequestLocaleCache.setCachedRequestLocale;
|
|
23
24
|
exports.unstable_setRequestLocale = RequestLocaleCache.setCachedRequestLocale;
|
|
@@ -2,20 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
// Reuse the legacy cookie name
|
|
6
|
-
// https://nextjs.org/docs/advanced-features/i18n-routing#leveraging-the-next_locale-cookie
|
|
7
|
-
const COOKIE_LOCALE_NAME = 'NEXT_LOCALE';
|
|
8
|
-
const COOKIE_MAX_AGE = 31536000; // 1 year
|
|
9
|
-
const COOKIE_SAME_SITE = 'lax';
|
|
10
|
-
|
|
11
5
|
// Should take precedence over the cookie
|
|
12
6
|
const HEADER_LOCALE_NAME = 'X-NEXT-INTL-LOCALE';
|
|
13
7
|
|
|
14
8
|
// In a URL like "/en-US/about", the locale segment is "en-US"
|
|
15
9
|
const LOCALE_SEGMENT_NAME = 'locale';
|
|
16
10
|
|
|
17
|
-
exports.COOKIE_LOCALE_NAME = COOKIE_LOCALE_NAME;
|
|
18
|
-
exports.COOKIE_MAX_AGE = COOKIE_MAX_AGE;
|
|
19
|
-
exports.COOKIE_SAME_SITE = COOKIE_SAME_SITE;
|
|
20
11
|
exports.HEADER_LOCALE_NAME = HEADER_LOCALE_NAME;
|
|
21
12
|
exports.LOCALE_SEGMENT_NAME = LOCALE_SEGMENT_NAME;
|
|
@@ -66,7 +66,7 @@ function hasTrailingSlash() {
|
|
|
66
66
|
try {
|
|
67
67
|
// Provided via `env` setting in `next.config.js` via the plugin
|
|
68
68
|
return process.env._next_intl_trailing_slash === 'true';
|
|
69
|
-
} catch (
|
|
69
|
+
} catch (_unused) {
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -82,7 +82,7 @@ function normalizeTrailingSlash(pathname) {
|
|
|
82
82
|
}
|
|
83
83
|
return pathname;
|
|
84
84
|
}
|
|
85
|
-
function matchesPathname(
|
|
85
|
+
function matchesPathname(/** E.g. `/users/[userId]-[userName]` */
|
|
86
86
|
template, /** E.g. `/users/23-jane` */
|
|
87
87
|
pathname) {
|
|
88
88
|
const normalizedTemplate = normalizeTrailingSlash(template);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeTrailingSlash as e}from"../shared/utils.js";import{getHost as a,getNormalizedPathname as t,getLocalePrefixes as o,isLocaleSupportedOnDomain as n,applyBasePath as l,formatTemplatePathname as r}from"./utils.js";function c(c){var m;let{localizedPathnames:p,request:s,resolvedLocale:i,routing:f}=c;const h=s.nextUrl.clone(),u=a(s.headers);function d(a,t){return a.pathname=e(a.pathname),s.nextUrl.basePath&&((a=new URL(a)).pathname=l(a.pathname,s.nextUrl.basePath)),"<".concat(a.toString(),'>; rel="alternate"; hreflang="').concat(t,'"')}function x(e,a){return p&&"object"==typeof p?r(e,p[i],p[a]):e}u&&(h.port="",h.host=u),h.protocol=null!==(m=s.headers.get("x-forwarded-proto"))&&void 0!==m?m:h.protocol,h.pathname=t(h.pathname,f.locales,f.localePrefix);const w=o(f.locales,f.localePrefix,!1).flatMap((e=>{let a,[t,o]=e;function l(e){return"/"===e?o:o+e}if(f.domains){return
|
|
1
|
+
import{normalizeTrailingSlash as e}from"../shared/utils.js";import{getHost as a,getNormalizedPathname as t,getLocalePrefixes as o,isLocaleSupportedOnDomain as n,applyBasePath as l,formatTemplatePathname as r}from"./utils.js";function c(c){var m;let{localizedPathnames:p,request:s,resolvedLocale:i,routing:f}=c;const h=s.nextUrl.clone(),u=a(s.headers);function d(a,t){return a.pathname=e(a.pathname),s.nextUrl.basePath&&((a=new URL(a)).pathname=l(a.pathname,s.nextUrl.basePath)),"<".concat(a.toString(),'>; rel="alternate"; hreflang="').concat(t,'"')}function x(e,a){return p&&"object"==typeof p?r(e,p[i],p[a]):e}u&&(h.port="",h.host=u),h.protocol=null!==(m=s.headers.get("x-forwarded-proto"))&&void 0!==m?m:h.protocol,h.pathname=t(h.pathname,f.locales,f.localePrefix);const w=o(f.locales,f.localePrefix,!1).flatMap((e=>{let a,[t,o]=e;function l(e){return"/"===e?o:o+e}if(f.domains){return f.domains.filter((e=>n(t,e))).map((e=>(a=new URL(h),a.port="",a.host=e.domain,a.pathname=x(h.pathname,t),t===e.defaultLocale&&"always"!==f.localePrefix.mode||(a.pathname=l(a.pathname)),d(a,t))))}{let e;e=p&&"object"==typeof p?x(h.pathname,t):h.pathname,t===f.defaultLocale&&"always"!==f.localePrefix.mode||(e=l(e)),a=new URL(e,h)}return d(a,t)}));if(!f.domains&&("always"!==f.localePrefix.mode||"/"===h.pathname)){const e=new URL(x(h.pathname,f.defaultLocale),h);w.push(d(e,"x-default"))}return w.join(", ")}export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as
|
|
1
|
+
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as o}from"../routing/config.js";import{HEADER_LOCALE_NAME as l}from"../shared/constants.js";import{matchesPathname as t,normalizeTrailingSlash as r,getLocalePrefix as a}from"../shared/utils.js";import n from"./getAlternateLinksHeaderValue.js";import i from"./resolveLocale.js";import s from"./syncCookie.js";import{sanitizePathname as c,isLocaleSupportedOnDomain as d,getNormalizedPathname as f,getPathnameMatch as m,getInternalTemplate as u,formatTemplatePathname as h,formatPathname as x,getBestMatchingDomain as v,applyBasePath as p,getLocaleAsPrefix as U}from"./utils.js";function P(P,k){var L,g,j;const w=o({...P,alternateLinks:null!==(L=null==k?void 0:k.alternateLinks)&&void 0!==L?L:P.alternateLinks,localeDetection:null!==(g=null==k?void 0:k.localeDetection)&&void 0!==g?g:P.localeDetection,localeCookie:null!==(j=null==k?void 0:k.localeCookie)&&void 0!==j?j:P.localeCookie});return function(o){var P;let k;try{k=decodeURI(o.nextUrl.pathname)}catch(o){return e.next()}const L=c(k),{domain:g,locale:j}=i(w,o.headers,o.cookies,L),C=g?g.defaultLocale===j:j===w.defaultLocale,b=(null===(P=w.domains)||void 0===P?void 0:P.filter((e=>d(j,e))))||[],y=null!=w.domains&&!g;function D(t){const r=new URL(t,o.url);o.nextUrl.basePath&&(r.pathname=p(r.pathname,o.nextUrl.basePath));const a=new Headers(o.headers);return a.set(l,j),e.rewrite(r,{request:{headers:a}})}function R(l,t){const a=new URL(r(l),o.url);if(b.length>0&&!t&&g){const e=v(g,j,b);e&&(t=e.domain,e.defaultLocale===j&&"as-needed"===w.localePrefix.mode&&(a.pathname=f(a.pathname,w.locales,w.localePrefix)))}var n,i;t&&(a.host=t,o.headers.get("x-forwarded-host")&&(a.protocol=null!==(n=o.headers.get("x-forwarded-proto"))&&void 0!==n?n:o.nextUrl.protocol,a.port=null!==(i=o.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return o.nextUrl.basePath&&(a.pathname=p(a.pathname,o.nextUrl.basePath)),e.redirect(a.toString())}const q=f(L,w.locales,w.localePrefix),H=m(L,w.locales,w.localePrefix),z=null!=H,A="never"===w.localePrefix.mode||C&&"as-needed"===w.localePrefix.mode;let I,S,V=q;const B=w.pathnames;if(B){let e;if([e,S]=u(B,q,j),S){const l=B[S],r="string"==typeof l?l:l[j];if(t(r,q))V=h(q,r,S);else{let t;t=e?"string"==typeof l?l:l[e]:S;const n=A?void 0:a(j,w.localePrefix),i=h(q,t,r);I=R(x(i,n,o.nextUrl.search))}}}if(!I)if("/"!==V||z){const e=x(V,U(j),o.nextUrl.search);if(z){const l=x(q,H.prefix,o.nextUrl.search);if("never"===w.localePrefix.mode)I=R(x(q,void 0,o.nextUrl.search));else if(H.exact)if(C&&A)I=R(x(q,void 0,o.nextUrl.search));else if(w.domains){const o=v(g,H.locale,b);I=(null==g?void 0:g.domain)===(null==o?void 0:o.domain)||y?D(e):R(l,null==o?void 0:o.domain)}else I=D(e);else I=R(l)}else I=A?D(e):R(x(q,a(j,w.localePrefix),o.nextUrl.search))}else I=A?D(x(V,U(j),o.nextUrl.search)):R(x(q,a(j,w.localePrefix),o.nextUrl.search));return w.localeDetection&&w.localeCookie&&s(o,I,j,w.localeCookie),"never"!==w.localePrefix.mode&&w.alternateLinks&&w.locales.length>1&&I.headers.set("Link",n({routing:w,localizedPathnames:null!=S&&B?B[S]:void 0,request:o,resolvedLocale:j})),I}}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{match as
|
|
1
|
+
import{match as e}from"@formatjs/intl-localematcher";import o from"negotiator";import{getPathnameMatch as l,isLocaleSupportedOnDomain as t,getHost as a}from"./utils.js";function n(l,t,a){let n;const c=new o({headers:{"accept-language":l.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(t);n=e(c,o,a)}catch(e){}return n}function c(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){var l;const t=null===(l=o.get(e.localeCookie.name))||void 0===l?void 0:l.value;if(t&&e.locales.includes(t))return t}}function i(e,o,t,a){let i;var r;a&&(i=null===(r=l(a,e.locales,e.localePrefix))||void 0===r?void 0:r.locale);return!i&&e.localeDetection&&(i=c(e,t)),!i&&e.localeDetection&&(i=n(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,r,u){const f=function(e,o){const l=a(e);if(l)return o.find((e=>e.domain===l))}(o,e.domains);if(!f)return{locale:i(e,o,r,u)};let s;if(u){var d;const o=null===(d=l(u,e.locales,e.localePrefix))||void 0===d?void 0:d.locale;if(o){if(!t(o,f))return{locale:o,domain:f};s=o}}if(!s&&e.localeDetection){const o=c(e,r);o&&t(o,f)&&(s=o)}if(!s&&e.localeDetection){const l=n(o,f.locales||e.locales,f.defaultLocale);l&&(s=l)}return s||(s=f.defaultLocale),{locale:s,domain:f}}function u(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}}export{u as default,n as getAcceptLanguageLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function e(e,o,t,a){var i;const{name:n,...s}=a;(null===(i=e.cookies.get(n))||void 0===i?void 0:i.value)!==t&&o.cookies.set(n,t,{path:e.nextUrl.basePath||void 0,...s})}export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getSortedPathnames as
|
|
1
|
+
import{getSortedPathnames as t,matchesPathname as e,normalizeTrailingSlash as n,getLocalePrefix as r,templateToRegex as o,prefixPathname as c}from"../shared/utils.js";function l(n,r,o){const c=t(Object.keys(n));for(const t of c){const c=n[t];if("string"==typeof c){if(e(c,r))return[void 0,t]}else{const n=Object.entries(c),l=n.findIndex((t=>{let[e]=t;return e===o}));l>0&&n.unshift(n.splice(l,1)[0]);for(const[o,c]of n)if(e(c,r))return[o,t]}}for(const t of Object.keys(n))if(e(t,r))return[void 0,t];return[void 0,void 0]}function i(t,e,r,o){let c="";return c+=d(r,a(e,t)),c=n(c),c}function u(t,e,r){t.endsWith("/")||(t+="/");const o=f(e,r),c=new RegExp("^(".concat(o.map((t=>{let[,e]=t;return e.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),l=t.match(c);let i=l?"/"+l[2]:t;return"/"!==i&&(i=n(i)),i}function f(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.map((t=>[t,r(t,e)]));return n&&o.sort(((t,e)=>e[1].length-t[1].length)),o}function s(t,e,n){const r=f(e,n);for(const[e,n]of r){let r,o;if(t===n||t.startsWith(n+"/"))r=o=!0;else{const e=t.toLowerCase(),c=n.toLowerCase();(e===c||e.startsWith(c+"/"))&&(r=!1,o=!0)}if(o)return{locale:e,prefix:n,matchedPrefix:t.slice(0,n.length),exact:r}}}function a(t,e){const r=n(e),c=n(t),l=o(c).exec(r);if(!l)return;const i={};for(let t=1;t<l.length;t++){var u;const e=null===(u=c.match(/\[([^\]]+)\]/g))||void 0===u?void 0:u[t-1].replace(/[[\]]/g,"");e&&(i[e]=l[t])}return i}function d(t,e){if(!e)return t;let n=t=t.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(e).forEach((t=>{let[e,r]=t;n=n.replace("[".concat(e,"]"),r)})),n}function h(t,e,n){let r=t;return e&&(r=c(e,r)),n&&(r+=n),r}function v(t){var e,n;return null!==(e=null!==(n=t.get("x-forwarded-host"))&&void 0!==n?n:t.get("host"))&&void 0!==e?e:void 0}function g(t,e){return e.defaultLocale===t||!e.locales||e.locales.includes(t)}function p(t,e,n){let r;return t&&g(e,t)&&(r=t),r||(r=n.find((t=>t.defaultLocale===e))),r||(r=n.find((t=>{var n;return null===(n=t.locales)||void 0===n?void 0:n.includes(e)}))),r||null!=(null==t?void 0:t.locales)||(r=t),r||(r=n.find((t=>!t.locales))),r}function x(t,e){return n(e+t)}function m(t){return"/".concat(t)}function j(t){return t.replace(/\\/g,"%5C").replace(/\/+/g,"/")}export{x as applyBasePath,h as formatPathname,d as formatPathnameTemplate,i as formatTemplatePathname,p as getBestMatchingDomain,v as getHost,l as getInternalTemplate,m as getLocaleAsPrefix,f as getLocalePrefixes,u as getNormalizedPathname,s as getPathnameMatch,a as getRouteParams,g as isLocaleSupportedOnDomain,j as sanitizePathname};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o,useMemo as t}from"react";import n from"../../react-client/useLocale.js";import{receiveRoutingConfig as a}from"../../routing/config.js";import{getRoute as
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o,useMemo as t}from"react";import n from"../../react-client/useLocale.js";import{receiveRoutingConfig as a,receiveLocaleCookie as l}from"../../routing/config.js";import{getRoute as c,compileLocalizedPathname as i,normalizeNameOrNameWithParams as s}from"../shared/utils.js";import f from"./ClientLink.js";import{clientRedirect as u,clientPermanentRedirect as m}from"./redirects.js";import h from"./useBasePathname.js";import p from"./useBaseRouter.js";function d(d){const v=a(d),P=l(d.localeCookie);function x(){const e=n();if(!v.locales.includes(e))throw new Error('Unknown locale encountered: "'.concat(e,'". Make sure to validate the locale in `i18n.ts`.'));return e}function g(o,t){let{href:n,locale:a,...l}=o;const c=x(),s=a||c;return r.createElement(f,e({ref:t,href:i({locale:s,pathname:n,params:"object"==typeof n?n.params:void 0,pathnames:v.pathnames}),locale:a,localeCookie:P,localePrefix:v.localePrefix},l))}const j=o(g);function w(e){let{href:r,locale:o}=e;return i({...s(r),locale:o,pathnames:v.pathnames})}return j.displayName="Link",{Link:j,redirect:function(e){const r=w({href:e,locale:x()});for(var o=arguments.length,t=new Array(o>1?o-1:0),n=1;n<o;n++)t[n-1]=arguments[n];return u({pathname:r,localePrefix:v.localePrefix},...t)},permanentRedirect:function(e){const r=w({href:e,locale:x()});for(var o=arguments.length,t=new Array(o>1?o-1:0),n=1;n<o;n++)t[n-1]=arguments[n];return m({pathname:r,localePrefix:v.localePrefix},...t)},usePathname:function(){const e=h(v.localePrefix),r=x();return t((()=>e?c(r,e,v.pathnames):e),[r,e])},useRouter:function(){const e=p(v.localePrefix,P),r=x();return t((()=>({...e,push(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.push(c,...a)},replace(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.replace(c,...a)},prefetch(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...a)}})),[e,r])},getPathname:w}}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRouter as e,usePathname as t}from"next/navigation";import{useMemo as
|
|
1
|
+
import{useRouter as e,usePathname as t}from"next/navigation";import{useMemo as o}from"react";import n from"../../react-client/useLocale.js";import r from"../shared/createSharedNavigationFns.js";import a from"../shared/syncLocaleCookie.js";import{getRoute as c}from"../shared/utils.js";import i from"./useBasePathname.js";function s(s){function u(){return n()}const{Link:m,config:f,getPathname:h,...l}=r(u,s);return{...l,Link:m,usePathname:function(){const e=i(f.localePrefix),t=u();return o((()=>e&&f.pathnames?c(t,e,f.pathnames):e),[t,e])},useRouter:function(){const n=e(),r=u(),c=t();return o((()=>{function e(e){return function(t,o){const{locale:n,...i}=o||{},s=[h({href:t,locale:n||r,domain:window.location.host})];Object.keys(i).length>0&&s.push(i),e(...s),a(f.localeCookie,c,r,n)}}return{...n,push:e(n.push),replace:e(n.replace),prefetch:e(n.prefetch)}}),[r,c,n])},getPathname:h}}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o}from"react";import{receiveLocalePrefixConfig as t,receiveLocaleCookie as n}from"../../routing/config.js";import i from"./ClientLink.js";import{clientRedirect as a,clientPermanentRedirect as l}from"./redirects.js";import u from"./useBasePathname.js";import f from"./useBaseRouter.js";function m(m){const c=t(null==m?void 0:m.localePrefix),s=n(null==m?void 0:m.localeCookie);function p(o,t){return r.createElement(i,e({ref:t,localeCookie:s,localePrefix:c},o))}const d=o(p);return d.displayName="Link",{Link:d,redirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),t=1;t<r;t++)o[t-1]=arguments[t];return a({pathname:e,localePrefix:c},...o)},permanentRedirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),t=1;t<r;t++)o[t-1]=arguments[t];return l({pathname:e,localePrefix:c},...o)},usePathname:function(){return u(c)},useRouter:function(){return f(c,s)}}}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useRouter as t,usePathname as e}from"next/navigation";import{useMemo as r}from"react";import o from"../../react-client/useLocale.js";import{getLocalePrefix as n,localizeHref as c}from"../../shared/utils.js";import s from"../shared/syncLocaleCookie.js";import{getBasePath as a}from"../shared/utils.js";function i(i){const
|
|
1
|
+
import{useRouter as t,usePathname as e}from"next/navigation";import{useMemo as r}from"react";import o from"../../react-client/useLocale.js";import{getLocalePrefix as n,localizeHref as c}from"../../shared/utils.js";import s from"../shared/syncLocaleCookie.js";import{getBasePath as a}from"../shared/utils.js";function i(i,p){const u=t(),l=o(),f=e();return r((()=>{function t(t,e){let r=window.location.pathname;const o=a(f);o&&(r=r.replace(o,""));const s=e||l,p=n(s,i);return c(t,s,l,r,p)}function e(e){return function(r,o){const{locale:n,...c}=o||{};s(p,f,l,n);const a=[t(r,n)];return Object.keys(c).length>0&&a.push(c),e(...a)}}return{...u,push:e(u.push),replace:e(u.replace),prefetch:e(u.prefetch)}}),[l,p,i,f,u])}export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveRoutingConfig as
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveRoutingConfig as o}from"../../routing/config.js";import{getRequestLocale as t}from"../../server/react-server/RequestLocaleLegacy.js";import{compileLocalizedPathname as a,normalizeNameOrNameWithParams as n}from"../shared/utils.js";import l from"./ServerLink.js";import{serverRedirect as c,serverPermanentRedirect as i}from"./redirects.js";function s(s){const m=o(s);function f(e){let{href:r,locale:o}=e;return a({...n(r),locale:o,pathnames:m.pathnames})}function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(o){let{href:n,locale:c,...i}=o;const s=t(),f=c||s;return r.createElement(l,e({href:a({locale:f,pathname:n,params:"object"==typeof n?n.params:void 0,pathnames:m.pathnames}),locale:c,localeCookie:m.localeCookie,localePrefix:m.localePrefix},i))},redirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,a=new Array(o>1?o-1:0),n=1;n<o;n++)a[n-1]=arguments[n];return c({localePrefix:m.localePrefix,pathname:r},...a)},permanentRedirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,a=new Array(o>1?o-1:0),n=1;n<o;n++)a[n-1]=arguments[n];return i({localePrefix:m.localePrefix,pathname:r},...a)},getPathname:f,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveLocalePrefixConfig as
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveLocalePrefixConfig as o,receiveLocaleCookie as n}from"../../routing/config.js";import t from"./ServerLink.js";import{serverRedirect as i,serverPermanentRedirect as a}from"./redirects.js";function l(l){const u=o(null==l?void 0:l.localePrefix),c=n(null==l?void 0:l.localeCookie);function f(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(o){return r.createElement(t,e({localeCookie:c,localePrefix:u},o))},redirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return i({pathname:e,localePrefix:u},...o)},permanentRedirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return a({pathname:e,localePrefix:u},...o)},usePathname:f("usePathname"),useRouter:f("useRouter")}}export{l as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as t}from"next/navigation";import r,{forwardRef as n,useState as i,useEffect as
|
|
2
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as t}from"next/navigation";import r,{forwardRef as n,useState as i,useEffect as l}from"react";import c from"../../react-client/useLocale.js";import a from"./syncLocaleCookie.js";function s(n,s){let{defaultLocale:p,href:f,locale:m,localeCookie:u,onClick:h,prefetch:d,unprefixed:k,...x}=n;const L=c(),g=m!==L,j=m||L,v=function(){const[e,o]=i();return l((()=>{o(window.location.host)}),[]),e}(),w=v&&k&&(k.domains[v]===j||!Object.keys(k.domains).includes(v)&&L===p&&!m)?k.pathname:f,C=t();return g&&(d&&console.error("The `prefetch` prop is currently not supported when using the `locale` prop on `Link` to switch the locale.`"),d=!1),r.createElement(o,e({ref:s,href:w,hrefLang:g?m:void 0,onClick:function(e){a(u,C,L,m),h&&h(e)},prefetch:d},x))}var p=n(s);export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{usePathname as
|
|
2
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{usePathname as o}from"next/navigation";import r,{forwardRef as l,useState as t,useEffect as i}from"react";import a from"../../react-client/useLocale.js";import{isLocalizableHref as n,prefixHref as s,localizeHref as m}from"../../shared/utils.js";import c from"./BaseLink.js";function f(l,f){let{href:p,locale:u,localeCookie:d,localePrefixMode:x,prefix:j,...k}=l;const h=o(),v=a(),C=u!==v,[L,g]=t((()=>n(p)&&("never"!==x||C)?s(p,j):p));return i((()=>{h&&g(m(p,u,v,h,j))}),[v,p,u,h,j]),r.createElement(c,e({ref:f,href:L,locale:u,localeCookie:d},k))}const p=l(f);p.displayName="ClientLink";export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{redirect as
|
|
1
|
+
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{redirect as o,permanentRedirect as a}from"next/navigation";import t,{forwardRef as n,use as r}from"react";import{receiveRoutingConfig as l}from"../../routing/config.js";import{isLocalizableHref as i}from"../../shared/utils.js";import m from"./BaseLink.js";import{validateReceivedConfig as c,serializeSearchParams as f,compileLocalizedPathname as s,applyPathnamePrefix as u,normalizeNameOrNameWithParams as p}from"./utils.js";function d(d,h){const j=l(h||{});c(j);const g=j.pathnames,v="as-needed"===j.localePrefix.mode&&j.domains||void 0;function y(o,a){let n,l,{href:c,locale:f,...s}=o;"object"==typeof c?(n=c.pathname,l=c.params):n=c;const u=i(c),p=d(),h=p instanceof Promise?r(p):p,y=u?L({locale:f||h,href:null==g?n:{pathname:n,params:l}},null!=f||v||void 0):n;return t.createElement(m,e({ref:a,defaultLocale:j.defaultLocale,href:{..."object"==typeof c&&c,pathname:y},locale:f,localeCookie:j.localeCookie,unprefixed:v&&u?{domains:j.domains.reduce(((e,o)=>(e[o.domain]=o.defaultLocale,e)),{}),pathname:L({locale:h,href:null==g?n:{pathname:n,params:l}},!1)}:void 0},s))}const x=n(y);function L(e,o){const{href:a,locale:t}=e;let n;return null==g?"object"==typeof a?(n=a.pathname,a.query&&(n+=f(a.query))):n=a:n=s({locale:t,...p(a),pathnames:j.pathnames}),u(n,t,j,e.domain,o)}function b(e){return function(o){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];return e(L(o,o.domain?void 0:v),...t)}}const k=b(o),P=b(a);return{config:j,Link:x,redirect:k,permanentRedirect:P,getPathname:L}}export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getBasePath as t}from"./utils.js";function o(o,e,n,a){if(!o||!(a!==n&&null!=a)||!e)return;const c=t(e),f=""!==c?c:"/",{name:r,...i}=o;i.path||(i.path=f);let l="".concat(r,"=").concat(a,";");for(const[t,o]of Object.entries(i)){l+="".concat("maxAge"===t?"max-age":t),"boolean"!=typeof o&&(l+="="+o),l+=";"}document.cookie=l}export{o as default};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import n from"fs";import
|
|
1
|
+
import n from"fs";import t from"path";function e(n){return["".concat(n,".ts"),"".concat(n,".tsx"),"".concat(n,".js"),"".concat(n,".jsx")]}let o=!1;function r(r,i){function s(e){return n.existsSync(function(n){const e=[];return i&&e.push(i),e.push(n),t.resolve(...e)}(e))}if(r){if(!s(r))throw new Error("[next-intl] Could not find i18n config at ".concat(r,", please provide a valid path."));return r}for(const n of[...e("./i18n/request"),...e("./src/i18n/request")])if(s(n))return n;for(const n of[...e("./i18n"),...e("./src/i18n")])if(s(n))return o||(console.warn("\n[next-intl] Reading request configuration from ".concat(n," is deprecated, please see https://next-intl-docs.vercel.app/blog/next-intl-3-22#i18n-request — you can either move your configuration to ./i18n/request.ts or provide a custom path in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")),o=!0),n;throw new Error("\n[next-intl] Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")}module.exports=function(n){return function(e){return function(n,e){null!=(null==e?void 0:e.i18n)&&console.warn("\n[next-intl] An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl-docs.vercel.app/examples#app-router-migration\n");const o={};if(null!=process.env.TURBOPACK){var i,s;if(null!=n&&n.startsWith("/"))throw new Error("[next-intl] Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+n+"\n");o.experimental={...null==e?void 0:e.experimental,turbo:{...null==e||null===(i=e.experimental)||void 0===i?void 0:i.turbo,resolveAlias:{...null==e||null===(s=e.experimental)||void 0===s||null===(s=s.turbo)||void 0===s?void 0:s.resolveAlias,"next-intl/config":r(n)}}}}else o.webpack=function(){for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];let[l,u]=i;return l.resolve.alias["next-intl/config"]=t.resolve(l.context,r(n,l.context)),"function"==typeof(null==e?void 0:e.webpack)?e.webpack(l,u):l};return o.env={...null==e?void 0:e.env,_next_intl_trailing_slash:null!=e&&e.trailingSlash?"true":void 0},Object.assign({},e,o)}(n,e)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return{...e,localePrefix:o(null
|
|
1
|
+
function e(e){var t,n;return{...e,localePrefix:l(e.localePrefix),localeCookie:o(e.localeCookie),localeDetection:null===(t=e.localeDetection)||void 0===t||t,alternateLinks:null===(n=e.alternateLinks)||void 0===n||n}}function o(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function l(e){return"object"==typeof e?e:{mode:e||"always"}}export{o as receiveLocaleCookie,l as receiveLocalePrefixConfig,e as receiveRoutingConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return()=>{throw new Error("`".concat(e,"` is not supported in Client Components."))}}function t(){return e("getRequestConfig")}const n=e("getFormatter"),o=e("getNow"),
|
|
1
|
+
function e(e){return()=>{throw new Error("`".concat(e,"` is not supported in Client Components."))}}function t(){return e("getRequestConfig")}const n=e("getFormatter"),o=e("getNow"),s=e("getTimeZone"),r=e("getMessages"),a=e("getLocale"),g=e("getTranslations"),u=e("unstable_setRequestLocale"),c=e("setRequestLocale");export{n as getFormatter,a as getLocale,r as getMessages,o as getNow,t as getRequestConfig,s as getTimeZone,g as getTranslations,c as setRequestLocale,u as unstable_setRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const o=e((async function(){const e=t();return e instanceof Promise?await e:e}));const
|
|
1
|
+
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const o=e((async function(){const e=t();return e instanceof Promise?await e:e}));const i=e((async function(){let t;try{t=(await o()).get(n)||void 0}catch(t){if(t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest){const e=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:t});throw e.digest=t.digest,e}throw t}return t}));async function s(){return r()||await i()}export{s as getRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as e}from"next/headers";import{notFound as t}from"next/navigation";import{cache as n}from"react";import{HEADER_LOCALE_NAME as o}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const i=n((function(){let n;try{n=e().get(o)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `
|
|
1
|
+
import{headers as e}from"next/headers";import{notFound as t}from"next/navigation";import{cache as n}from"react";import{HEADER_LOCALE_NAME as o}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const i=n((function(){let n;try{n=e().get(o)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:e}):e}return n||(console.error("\nUnable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.\n"),t()),n}));function s(){return r()||i()}export{s as getRequestLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{getFormatter,getLocale,getMessages,getNow,getRequestConfig,getTimeZone,getTranslations,unstable_setRequestLocale}from"./server/react-client/index.js";
|
|
1
|
+
export{getFormatter,getLocale,getMessages,getNow,getRequestConfig,getTimeZone,getTranslations,setRequestLocale,unstable_setRequestLocale}from"./server/react-client/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{default as getRequestConfig}from"./server/react-server/getRequestConfig.js";export{default as getFormatter}from"./server/react-server/getFormatter.js";export{default as getMessages}from"./server/react-server/getMessages.js";export{default as getNow}from"./server/react-server/getNow.js";export{default as getTimeZone}from"./server/react-server/getTimeZone.js";export{default as getTranslations}from"./server/react-server/getTranslations.js";export{default as getLocale}from"./server/react-server/getLocale.js";export{setCachedRequestLocale as unstable_setRequestLocale}from"./server/react-server/RequestLocaleCache.js";
|
|
1
|
+
export{default as getRequestConfig}from"./server/react-server/getRequestConfig.js";export{default as getFormatter}from"./server/react-server/getFormatter.js";export{default as getMessages}from"./server/react-server/getMessages.js";export{default as getNow}from"./server/react-server/getNow.js";export{default as getTimeZone}from"./server/react-server/getTimeZone.js";export{default as getTranslations}from"./server/react-server/getTranslations.js";export{default as getLocale}from"./server/react-server/getLocale.js";export{setCachedRequestLocale as setRequestLocale,setCachedRequestLocale as unstable_setRequestLocale}from"./server/react-server/RequestLocaleCache.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o="X-NEXT-INTL-LOCALE",L="locale";export{o as HEADER_LOCALE_NAME,L as LOCALE_SEGMENT_NAME};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js"),a=require("./utils.js");exports.default=function(t){var o;let{localizedPathnames:n,request:l,resolvedLocale:r,routing:s}=t;const i=l.nextUrl.clone(),c=a.getHost(l.headers);function p(t,o){return t.pathname=e.normalizeTrailingSlash(t.pathname),l.nextUrl.basePath&&((t=new URL(t)).pathname=a.applyBasePath(t.pathname,l.nextUrl.basePath)),"<".concat(t.toString(),'>; rel="alternate"; hreflang="').concat(o,'"')}function m(e,t){return n&&"object"==typeof n?a.formatTemplatePathname(e,n[r],n[t]):e}c&&(i.port="",i.host=c),i.protocol=null!==(o=l.headers.get("x-forwarded-proto"))&&void 0!==o?o:i.protocol,i.pathname=a.getNormalizedPathname(i.pathname,s.locales,s.localePrefix);const h=a.getLocalePrefixes(s.locales,s.localePrefix,!1).flatMap((e=>{let t,[o,l]=e;function r(e){return"/"===e?l:l+e}if(s.domains){return
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js"),a=require("./utils.js");exports.default=function(t){var o;let{localizedPathnames:n,request:l,resolvedLocale:r,routing:s}=t;const i=l.nextUrl.clone(),c=a.getHost(l.headers);function p(t,o){return t.pathname=e.normalizeTrailingSlash(t.pathname),l.nextUrl.basePath&&((t=new URL(t)).pathname=a.applyBasePath(t.pathname,l.nextUrl.basePath)),"<".concat(t.toString(),'>; rel="alternate"; hreflang="').concat(o,'"')}function m(e,t){return n&&"object"==typeof n?a.formatTemplatePathname(e,n[r],n[t]):e}c&&(i.port="",i.host=c),i.protocol=null!==(o=l.headers.get("x-forwarded-proto"))&&void 0!==o?o:i.protocol,i.pathname=a.getNormalizedPathname(i.pathname,s.locales,s.localePrefix);const h=a.getLocalePrefixes(s.locales,s.localePrefix,!1).flatMap((e=>{let t,[o,l]=e;function r(e){return"/"===e?l:l+e}if(s.domains){return s.domains.filter((e=>a.isLocaleSupportedOnDomain(o,e))).map((e=>(t=new URL(i),t.port="",t.host=e.domain,t.pathname=m(i.pathname,o),o===e.defaultLocale&&"always"!==s.localePrefix.mode||(t.pathname=r(t.pathname)),p(t,o))))}{let e;e=n&&"object"==typeof n?m(i.pathname,o):i.pathname,o===s.defaultLocale&&"always"!==s.localePrefix.mode||(e=r(e)),t=new URL(e,i)}return p(t,o)}));if(!s.domains&&("always"!==s.localePrefix.mode||"/"===i.pathname)){const e=new URL(m(i.pathname,s.defaultLocale),i);h.push(p(e,"x-default"))}return h.join(", ")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,f,h;const m=a.receiveRoutingConfig({...s,alternateLinks:null!==(d=null==c?void 0:c.alternateLinks)&&void 0!==d?d:s.alternateLinks,localeDetection:null!==(f=null==c?void 0:c.localeDetection)&&void 0!==f?f:s.localeDetection,localeCookie:null!==(h=null==c?void 0:c.localeCookie)&&void 0!==h?h:s.localeCookie});return function(a){var s;let c;try{c=decodeURI(a.nextUrl.pathname)}catch(a){return e.NextResponse.next()}const d=i.sanitizePathname(c),{domain:f,locale:h}=n.default(m,a.headers,a.cookies,d),u=f?f.defaultLocale===h:h===m.defaultLocale,x=(null===(s=m.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(h,e))))||[],P=null!=m.domains&&!f;function p(l){const o=new URL(l,a.url);a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath));const n=new Headers(a.headers);return n.set(t.HEADER_LOCALE_NAME,h),e.NextResponse.rewrite(o,{request:{headers:n}})}function v(t,o){const n=new URL(l.normalizeTrailingSlash(t),a.url);if(x.length>0&&!o&&f){const e=i.getBestMatchingDomain(f,h,x);e&&(o=e.domain,e.defaultLocale===h&&"as-needed"===m.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,m.locales,m.localePrefix)))}var r,s;o&&(n.host=o,a.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,n.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const g=i.getNormalizedPathname(d,m.locales,m.localePrefix),L=i.getPathnameMatch(d,m.locales,m.localePrefix),U=null!=L,k="never"===m.localePrefix.mode||u&&"as-needed"===m.localePrefix.mode;let q,j,C=g;const D=m.pathnames;if(D){let e;if([e,j]=i.getInternalTemplate(D,g,h),j){const t=D[j],o="string"==typeof t?t:t[h];if(l.matchesPathname(o,g))C=i.formatTemplatePathname(g,o,j);else{let n;n=e?"string"==typeof t?t:t[e]:j;const r=k?void 0:l.getLocalePrefix(h,m.localePrefix),s=i.formatTemplatePathname(g,n,o);q=v(i.formatPathname(s,r,a.nextUrl.search))}}}if(!q)if("/"!==C||U){const e=i.formatPathname(C,i.getLocaleAsPrefix(h),a.nextUrl.search);if(U){const t=i.formatPathname(g,L.prefix,a.nextUrl.search);if("never"===m.localePrefix.mode)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(L.exact)if(u&&k)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(m.domains){const a=i.getBestMatchingDomain(f,L.locale,x);q=(null==f?void 0:f.domain)===(null==a?void 0:a.domain)||P?p(e):v(t,null==a?void 0:a.domain)}else q=p(e);else q=v(t)}else q=k?p(e):v(i.formatPathname(g,l.getLocalePrefix(h,m.localePrefix),a.nextUrl.search))}else q=k?p(i.formatPathname(C,i.getLocaleAsPrefix(h),a.nextUrl.search)):v(i.formatPathname(g,l.getLocalePrefix(h,m.localePrefix),a.nextUrl.search));return m.localeDetection&&m.localeCookie&&r.default(a,q,h,m.localeCookie),"never"!==m.localePrefix.mode&&m.alternateLinks&&m.locales.length>1&&q.headers.set("Link",o.default({routing:m,localizedPathnames:null!=j&&D?D[j]:void 0,request:a,resolvedLocale:h})),q}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),o=require("negotiator"),l=require("./utils.js");function t(e){return e&&e.__esModule?e:{default:e}}var a=t(o);function n(o,l,t){let n;const c=new a.default({headers:{"accept-language":o.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(l);n=e.match(c,o,t)}catch(e){}return n}function c(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){var l;const t=null===(l=o.get(e.localeCookie.name))||void 0===l?void 0:l.value;if(t&&e.locales.includes(t))return t}}function i(e,o,t,a){let i;var r;a&&(i=null===(r=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===r?void 0:r.locale);return!i&&e.localeDetection&&(i=c(e,t)),!i&&e.localeDetection&&(i=n(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,t,a){const r=function(e,o){const t=l.getHost(e);if(t)return o.find((e=>e.domain===t))}(o,e.domains);if(!r)return{locale:i(e,o,t,a)};let u;if(a){var s;const o=null===(s=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===s?void 0:s.locale;if(o){if(!l.isLocaleSupportedOnDomain(o,r))return{locale:o,domain:r};u=o}}if(!u&&e.localeDetection){const o=c(e,t);o&&l.isLocaleSupportedOnDomain(o,r)&&(u=o)}if(!u&&e.localeDetection){const l=n(o,r.locales||e.locales,r.defaultLocale);l&&(u=l)}return u||(u=r.defaultLocale),{locale:u,domain:r}}exports.default=function(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}},exports.getAcceptLanguageLocale=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(e,t,o,s){var a;const{name:i,...l}=s;(null===(a=e.cookies.get(i))||void 0===a?void 0:a.value)!==o&&t.cookies.set(i,o,{path:e.nextUrl.basePath||void 0,...l})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.map((t=>[t,e.getLocalePrefix(t,n)]));return r&&o.sort(((e,t)=>t[1].length-e[1].length)),o}function n(t,n){const r=e.normalizeTrailingSlash(n),o=e.normalizeTrailingSlash(t),a=e.templateToRegex(o).exec(r);if(!a)return;const l={};for(let e=1;e<a.length;e++){var i;const t=null===(i=o.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[e-1].replace(/[[\]]/g,"");t&&(l[t]=a[e])}return l}function r(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function o(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}exports.applyBasePath=function(t,n){return e.normalizeTrailingSlash(n+t)},exports.formatPathname=function(t,n,r){let o=t;return n&&(o=e.prefixPathname(n,o)),r&&(o+=r),o},exports.formatPathnameTemplate=r,exports.formatTemplatePathname=function(t,o,a,l){let i="";return i+=r(a,n(o,t)),i=e.normalizeTrailingSlash(i),i},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&o(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>null
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.map((t=>[t,e.getLocalePrefix(t,n)]));return r&&o.sort(((e,t)=>t[1].length-e[1].length)),o}function n(t,n){const r=e.normalizeTrailingSlash(n),o=e.normalizeTrailingSlash(t),a=e.templateToRegex(o).exec(r);if(!a)return;const l={};for(let e=1;e<a.length;e++){var i;const t=null===(i=o.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[e-1].replace(/[[\]]/g,"");t&&(l[t]=a[e])}return l}function r(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function o(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}exports.applyBasePath=function(t,n){return e.normalizeTrailingSlash(n+t)},exports.formatPathname=function(t,n,r){let o=t;return n&&(o=e.prefixPathname(n,o)),r&&(o+=r),o},exports.formatPathnameTemplate=r,exports.formatTemplatePathname=function(t,o,a,l){let i="";return i+=r(a,n(o,t)),i=e.normalizeTrailingSlash(i),i},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&o(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>{var n;return null===(n=e.locales)||void 0===n?void 0:n.includes(t)}))),r||null!=(null==e?void 0:e.locales)||(r=e),r||(r=n.find((e=>!e.locales))),r},exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,r){const o=e.getSortedPathnames(Object.keys(t));for(const a of o){const o=t[a];if("string"==typeof o){const t=o;if(e.matchesPathname(t,n))return[void 0,a]}else{const t=Object.entries(o),l=t.findIndex((e=>{let[t]=e;return t===r}));l>0&&t.unshift(t.splice(l,1)[0]);for(const[r,o]of t)if(e.matchesPathname(o,n))return[r,a]}}for(const r of Object.keys(t))if(e.matchesPathname(r,n))return[void 0,r];return[void 0,void 0]},exports.getLocaleAsPrefix=function(e){return"/".concat(e)},exports.getLocalePrefixes=t,exports.getNormalizedPathname=function(n,r,o){n.endsWith("/")||(n+="/");const a=t(r,o),l=new RegExp("^(".concat(a.map((e=>{let[,t]=e;return t.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),i=n.match(l);let s=i?"/"+i[2]:n;return"/"!==s&&(s=e.normalizeTrailingSlash(s)),s},exports.getPathnameMatch=function(e,n,r){const o=t(n,r);for(const[t,n]of o){let r,o;if(e===n||e.startsWith(n+"/"))r=o=!0;else{const t=e.toLowerCase(),a=n.toLowerCase();(t===a||t.startsWith(a+"/"))&&(r=!1,o=!0)}if(o)return{locale:t,prefix:n,matchedPrefix:e.slice(0,n.length),exact:r}}},exports.getRouteParams=n,exports.isLocaleSupportedOnDomain=o,exports.sanitizePathname=function(e){return e.replace(/\\/g,"%5C").replace(/\/+/g,"/")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),a=require("../../react-client/useLocale.js"),t=require("../../routing/config.js"),l=require("../shared/utils.js"),o=require("./ClientLink.js"),n=require("./redirects.js"),c=require("./useBasePathname.js"),i=require("./useBaseRouter.js");function u(e){return e&&e.__esModule?e:{default:e}}var s=u(r);exports.default=function(u){const f=t.receiveRoutingConfig(u),h=t.receiveLocaleCookie(u.localeCookie);function d(){const e=a.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function m(r,a){let{href:t,locale:n,...c}=r;const i=d(),u=n||i;return s.default.createElement(o.default,e.extends({ref:a,href:l.compileLocalizedPathname({locale:u,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:f.pathnames}),locale:n,localeCookie:h,localePrefix:f.localePrefix},c))}const p=r.forwardRef(m);function v(e){let{href:r,locale:a}=e;return l.compileLocalizedPathname({...l.normalizeNameOrNameWithParams(r),locale:a,pathnames:f.pathnames})}return p.displayName="Link",{Link:p,redirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,t=new Array(a>1?a-1:0),l=1;l<a;l++)t[l-1]=arguments[l];return n.clientRedirect({pathname:r,localePrefix:f.localePrefix},...t)},permanentRedirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,t=new Array(a>1?a-1:0),l=1;l<a;l++)t[l-1]=arguments[l];return n.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...t)},usePathname:function(){const e=c.default(f.localePrefix),a=d();return r.useMemo((()=>e?l.getRoute(a,e,f.pathnames):e),[a,e])},useRouter:function(){const e=i.default(f.localePrefix,h),a=d();return r.useMemo((()=>({...e,push(r){for(var t,l=arguments.length,o=new Array(l>1?l-1:0),n=1;n<l;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(t=o[0])||void 0===t?void 0:t.locale)||a});return e.push(c,...o)},replace(r){for(var t,l=arguments.length,o=new Array(l>1?l-1:0),n=1;n<l;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(t=o[0])||void 0===t?void 0:t.locale)||a});return e.replace(c,...o)},prefetch(r){for(var t,l=arguments.length,o=new Array(l>1?l-1:0),n=1;n<l;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(t=o[0])||void 0===t?void 0:t.locale)||a});return e.prefetch(c,...o)}})),[e,a])},getPathname:v}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),n=require("../shared/createSharedNavigationFns.js"),a=require("../shared/syncLocaleCookie.js"),u=require("../shared/utils.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),n=require("../shared/createSharedNavigationFns.js"),a=require("../shared/syncLocaleCookie.js"),u=require("../shared/utils.js"),o=require("./useBasePathname.js");exports.default=function(s){function c(){return r.default()}const{Link:i,config:l,getPathname:h,...f}=n.default(c,s);return{...f,Link:i,usePathname:function(){const e=o.default(l.localePrefix),r=c();return t.useMemo((()=>e&&l.pathnames?u.getRoute(r,e,l.pathnames):e),[r,e])},useRouter:function(){const r=e.useRouter(),n=c(),u=e.usePathname();return t.useMemo((()=>{function e(e){return function(t,r){const{locale:o,...s}=r||{},c=[h({href:t,locale:o||n,domain:window.location.host})];Object.keys(s).length>0&&c.push(s),e(...c),a.default(l.localeCookie,u,n,o)}}return{...r,push:e(r.push),replace:e(r.replace),prefetch:e(r.prefetch)}}),[n,u,r])},getPathname:h}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),i=require("./redirects.js"),u=require("./useBasePathname.js"),a=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(r);exports.default=function(l){const c=t.receiveLocalePrefixConfig(null==l?void 0:l.localePrefix),f=t.receiveLocaleCookie(null==l?void 0:l.localeCookie);function s(r,t){return o.default.createElement(n.default,e.extends({ref:t,localeCookie:f,localePrefix:c},r))}const d=r.forwardRef(s);return d.displayName="Link",{Link:d,redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientRedirect({pathname:e,localePrefix:c},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientPermanentRedirect({pathname:e,localePrefix:c},...t)},usePathname:function(){return u.default(c)},useRouter:function(){return a.default(c,f)}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a,c){const o=e.useRouter(),i=r.default(),l=e.usePathname();return t.useMemo((()=>{function e(e,t){let r=window.location.pathname;const n=s.getBasePath(l);n&&(r=r.replace(n,""));const c=t||i,o=u.getLocalePrefix(c,a);return u.localizeHref(e,c,i,r,o)}function t(t){return function(r,u){const{locale:s,...a}=u||{};n.default(c,l,i,s);const o=[e(r,s)];return Object.keys(a).length>0&&o.push(a),t(...o)}}return{...o,push:t(o.push),replace:t(o.replace),prefetch:t(o.prefetch)}}),[i,c,a,l,o])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/RequestLocaleLegacy.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/RequestLocaleLegacy.js"),o=require("../shared/utils.js"),n=require("./ServerLink.js"),l=require("./redirects.js");function c(e){return e&&e.__esModule?e:{default:e}}var i=c(r);exports.default=function(r){const c=t.receiveRoutingConfig(r);function u(e){let{href:r,locale:t}=e;return o.compileLocalizedPathname({...o.normalizeNameOrNameWithParams(r),locale:t,pathnames:c.pathnames})}function s(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){let{href:t,locale:l,...u}=r;const s=a.getRequestLocale(),f=l||s;return i.default.createElement(n.default,e.extends({href:o.compileLocalizedPathname({locale:f,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:c.pathnames}),locale:l,localeCookie:c.localeCookie,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...o)},permanentRedirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...o)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=i(r);exports.default=function(r){const i=t.receiveLocalePrefixConfig(null==r?void 0:r.localePrefix),a=t.receiveLocaleCookie(null==r?void 0:r.localeCookie);function l(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(r){return u.default.createElement(n.default,e.extends({localeCookie:a,localePrefix:i},r))},redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverRedirect({pathname:e,localePrefix:i},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverPermanentRedirect({pathname:e,localePrefix:i},...t)},usePathname:l("usePathname"),useRouter:l("useRouter")}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),a=require("../../react-client/useLocale.js"),u=require("./syncLocaleCookie.js");function o(e){return e&&e.__esModule?e:{default:e}}var l=o(t),i=o(n);function c(t,o){let{defaultLocale:c,href:f,locale:s,localeCookie:d,onClick:p,prefetch:h,unprefixed:v,...k}=t;const q=a.default(),x=s!==q,_=s||q,j=function(){const[e,t]=n.useState();return n.useEffect((()=>{t(window.location.host)}),[]),e}(),m=j&&v&&(v.domains[j]===_||!Object.keys(v.domains).includes(j)&&q===c&&!s)?v.pathname:f,C=r.usePathname();return x&&(h=!1),i.default.createElement(l.default,e.extends({ref:o,href:m,hrefLang:x?s:void 0,onClick:function(e){u.default(d,C,q,s),p&&p(e)},prefetch:h},k))}var f=n.forwardRef(c);exports.default=f;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next/navigation"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next/navigation"),l=require("react"),t=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js"),i=require("./BaseLink.js");function u(e){return e&&e.__esModule?e:{default:e}}var o=u(l);function s(u,s){let{href:f,locale:n,localeCookie:c,localePrefixMode:d,prefix:p,...x}=u;const q=r.usePathname(),v=t.default(),_=n!==v,[j,h]=l.useState((()=>a.isLocalizableHref(f)&&("never"!==d||_)?a.prefixHref(f,p):f));return l.useEffect((()=>{q&&h(a.localizeHref(f,n,v,q,p))}),[v,f,n,q,p]),o.default.createElement(i.default,e.extends({ref:s,href:j,locale:n,localeCookie:c},x))}const f=l.forwardRef(s);f.displayName="ClientLink",exports.default=f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),f=s.pathnames,d="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,{href:m,locale:p,...v}=a;"object"==typeof m?(i=m.pathname,c=m.params):i=m;const P=n.isLocalizableHref(m),g=l(),j=g instanceof Promise?r.use(g):g,q=P?h({locale:p||j,href:null==f?i:{pathname:i,params:c}},null!=p||d||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:{..."object"==typeof m&&m,pathname:q},locale:p,unprefixed:d&&P?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:j,href:null==f?i:{pathname:i,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==f?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function v(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:d),...t)}}const P=v(a.redirect),g=v(a.permanentRedirect);return{config:s,Link:p,redirect:P,permanentRedirect:g,getPathname:h}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),f=s.pathnames,d="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,{href:m,locale:p,...v}=a;"object"==typeof m?(i=m.pathname,c=m.params):i=m;const P=n.isLocalizableHref(m),g=l(),j=g instanceof Promise?r.use(g):g,q=P?h({locale:p||j,href:null==f?i:{pathname:i,params:c}},null!=p||d||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:{..."object"==typeof m&&m,pathname:q},locale:p,localeCookie:s.localeCookie,unprefixed:d&&P?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:j,href:null==f?i:{pathname:i,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==f?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function v(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:d),...t)}}const P=v(a.redirect),g=v(a.permanentRedirect);return{config:s,Link:p,redirect:P,permanentRedirect:g,getPathname:h}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js");exports.default=function(t,o,a,c){if(!t||!(c!==a&&null!=c)||!o)return;const n=e.getBasePath(o),r=""!==n?n:"/",{name:s,...u}=t;u.path||(u.path=r);let i="".concat(s,"=").concat(c,";");for(const[e,t]of Object.entries(u)){i+="".concat("maxAge"===e?"max-age":e),"boolean"!=typeof t&&(i+="="+t),i+=";"}document.cookie=i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("fs"),e=require("path");function t(n){return n&&n.__esModule?n:{default:n}}var
|
|
1
|
+
"use strict";var n=require("fs"),e=require("path");function t(n){return n&&n.__esModule?n:{default:n}}var o=t(n),r=t(e);function i(n){return["".concat(n,".ts"),"".concat(n,".tsx"),"".concat(n,".js"),"".concat(n,".jsx")]}let l=!1;function s(n,e){function t(n){return o.default.existsSync(function(n){const t=[];return e&&t.push(e),t.push(n),r.default.resolve(...t)}(n))}if(n){if(!t(n))throw new Error("[next-intl] Could not find i18n config at ".concat(n,", please provide a valid path."));return n}for(const n of[...i("./i18n/request"),...i("./src/i18n/request")])if(t(n))return n;for(const n of[...i("./i18n"),...i("./src/i18n")])if(t(n))return l||(console.warn("\n[next-intl] Reading request configuration from ".concat(n," is deprecated, please see https://next-intl-docs.vercel.app/blog/next-intl-3-22#i18n-request — you can either move your configuration to ./i18n/request.ts or provide a custom path in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")),l=!0),n;throw new Error("\n[next-intl] Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")}module.exports=function(n){return function(e){return function(n,e){null!=(null==e?void 0:e.i18n)&&console.warn("\n[next-intl] An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl-docs.vercel.app/examples#app-router-migration\n");const t={};if(null!=process.env.TURBOPACK){var o,i;if(null!=n&&n.startsWith("/"))throw new Error("[next-intl] Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+n+"\n");t.experimental={...null==e?void 0:e.experimental,turbo:{...null==e||null===(o=e.experimental)||void 0===o?void 0:o.turbo,resolveAlias:{...null==e||null===(i=e.experimental)||void 0===i||null===(i=i.turbo)||void 0===i?void 0:i.resolveAlias,"next-intl/config":s(n)}}}}else t.webpack=function(){for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];let[l,u]=o;return l.resolve.alias["next-intl/config"]=r.default.resolve(l.context,s(n,l.context)),"function"==typeof(null==e?void 0:e.webpack)?e.webpack(l,u):l};return t.env={...null==e?void 0:e.env,_next_intl_trailing_slash:null!=e&&e.trailingSlash?"true":void 0},Object.assign({},e,t)}(n,e)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";function e(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.receiveLocaleCookie=e,exports.receiveLocalePrefixConfig=o,exports.receiveRoutingConfig=function(t){var l,i;return{...t,localePrefix:o(t.localePrefix),localeCookie:e(t.localeCookie),localeDetection:null===(l=t.localeDetection)||void 0===l||l,alternateLinks:null===(i=t.alternateLinks)||void 0===i||i}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return()=>{throw new Error("`".concat(e,"` is not supported in Client Components."))}}Object.defineProperty(exports,"__esModule",{value:!0});const t=e("getFormatter"),
|
|
1
|
+
"use strict";function e(e){return()=>{throw new Error("`".concat(e,"` is not supported in Client Components."))}}Object.defineProperty(exports,"__esModule",{value:!0});const t=e("getFormatter"),s=e("getNow"),o=e("getTimeZone"),r=e("getMessages"),n=e("getLocale"),a=e("getTranslations"),g=e("unstable_setRequestLocale"),u=e("setRequestLocale");exports.getFormatter=t,exports.getLocale=n,exports.getMessages=r,exports.getNow=s,exports.getRequestConfig=function(){return e("getRequestConfig")},exports.getTimeZone=o,exports.getTranslations=a,exports.setRequestLocale=u,exports.unstable_setRequestLocale=g;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("react"),n=require("../../shared/constants.js"),r=require("./RequestLocaleCache.js");const s=t.cache((async function(){const t=e.headers();return t instanceof Promise?await t:t}));const a=t.cache((async function(){let e;try{e=(await s()).get(n.HEADER_LOCALE_NAME)||void 0}catch(e){if(e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest){const t=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("react"),n=require("../../shared/constants.js"),r=require("./RequestLocaleCache.js");const s=t.cache((async function(){const t=e.headers();return t instanceof Promise?await t:t}));const a=t.cache((async function(){let e;try{e=(await s()).get(n.HEADER_LOCALE_NAME)||void 0}catch(e){if(e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest){const t=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:e});throw t.digest=e.digest,t}throw e}return e}));exports.getRequestLocale=async function(){return r.getCachedRequestLocale()||await a()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("next/navigation"),r=require("react"),n=require("../../shared/constants.js"),s=require("./RequestLocaleCache.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("next/navigation"),r=require("react"),n=require("../../shared/constants.js"),s=require("./RequestLocaleCache.js");const i=r.cache((function(){let r;try{r=e.headers().get(n.HEADER_LOCALE_NAME)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:e}):e}return r||t.notFound(),r}));exports.getRequestLocale=function(){return s.getCachedRequestLocale()||i()};
|