authmi 1.0.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/LICENSE +21 -0
- package/README.md +425 -0
- package/dist/chunk-UNKK6FP4.mjs +609 -0
- package/dist/client-D6JiIhlU.d.mts +332 -0
- package/dist/client-D6JiIhlU.d.ts +332 -0
- package/dist/index.d.mts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +609 -0
- package/dist/index.mjs +18 -0
- package/dist/next.d.mts +109 -0
- package/dist/next.d.ts +109 -0
- package/dist/next.js +5148 -0
- package/dist/next.mjs +4545 -0
- package/dist/react.d.mts +68 -0
- package/dist/react.d.ts +68 -0
- package/dist/react.js +812 -0
- package/dist/react.mjs +220 -0
- package/package.json +97 -0
package/dist/next.mjs
ADDED
|
@@ -0,0 +1,4545 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthMiClient,
|
|
3
|
+
AuthMiError,
|
|
4
|
+
LocalStorageTokenStorage,
|
|
5
|
+
MemoryTokenStorage,
|
|
6
|
+
ScopeError,
|
|
7
|
+
__commonJS,
|
|
8
|
+
__require,
|
|
9
|
+
__toESM
|
|
10
|
+
} from "./chunk-UNKK6FP4.mjs";
|
|
11
|
+
|
|
12
|
+
// ../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js
|
|
13
|
+
var require_detect_domain_locale = __commonJS({
|
|
14
|
+
"../../node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js"(exports) {
|
|
15
|
+
"use strict";
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "detectDomainLocale", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return detectDomainLocale;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
|
26
|
+
if (!domainItems) return;
|
|
27
|
+
if (detectedLocale) {
|
|
28
|
+
detectedLocale = detectedLocale.toLowerCase();
|
|
29
|
+
}
|
|
30
|
+
for (const item of domainItems) {
|
|
31
|
+
const domainHostname = item.domain?.split(":", 1)[0].toLowerCase();
|
|
32
|
+
if (hostname === domainHostname || detectedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale) => locale.toLowerCase() === detectedLocale)) {
|
|
33
|
+
return item;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js
|
|
41
|
+
var require_remove_trailing_slash = __commonJS({
|
|
42
|
+
"../../node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js"(exports) {
|
|
43
|
+
"use strict";
|
|
44
|
+
Object.defineProperty(exports, "__esModule", {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "removeTrailingSlash", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function() {
|
|
50
|
+
return removeTrailingSlash;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
function removeTrailingSlash(route) {
|
|
54
|
+
return route.replace(/\/$/, "") || "/";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/parse-path.js
|
|
60
|
+
var require_parse_path = __commonJS({
|
|
61
|
+
"../../node_modules/next/dist/shared/lib/router/utils/parse-path.js"(exports) {
|
|
62
|
+
"use strict";
|
|
63
|
+
Object.defineProperty(exports, "__esModule", {
|
|
64
|
+
value: true
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "parsePath", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function() {
|
|
69
|
+
return parsePath;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
function parsePath(path) {
|
|
73
|
+
const hashIndex = path.indexOf("#");
|
|
74
|
+
const queryIndex = path.indexOf("?");
|
|
75
|
+
const hasQuery = queryIndex > -1 && (hashIndex < 0 || queryIndex < hashIndex);
|
|
76
|
+
if (hasQuery || hashIndex > -1) {
|
|
77
|
+
return {
|
|
78
|
+
pathname: path.substring(0, hasQuery ? queryIndex : hashIndex),
|
|
79
|
+
query: hasQuery ? path.substring(queryIndex, hashIndex > -1 ? hashIndex : void 0) : "",
|
|
80
|
+
hash: hashIndex > -1 ? path.slice(hashIndex) : ""
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
pathname: path,
|
|
85
|
+
query: "",
|
|
86
|
+
hash: ""
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js
|
|
93
|
+
var require_add_path_prefix = __commonJS({
|
|
94
|
+
"../../node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js"(exports) {
|
|
95
|
+
"use strict";
|
|
96
|
+
Object.defineProperty(exports, "__esModule", {
|
|
97
|
+
value: true
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, "addPathPrefix", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function() {
|
|
102
|
+
return addPathPrefix;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
var _parsepath = require_parse_path();
|
|
106
|
+
function addPathPrefix(path, prefix) {
|
|
107
|
+
if (!path.startsWith("/") || !prefix) {
|
|
108
|
+
return path;
|
|
109
|
+
}
|
|
110
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
111
|
+
return `${prefix}${pathname}${query}${hash}`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js
|
|
117
|
+
var require_add_path_suffix = __commonJS({
|
|
118
|
+
"../../node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js"(exports) {
|
|
119
|
+
"use strict";
|
|
120
|
+
Object.defineProperty(exports, "__esModule", {
|
|
121
|
+
value: true
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, "addPathSuffix", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function() {
|
|
126
|
+
return addPathSuffix;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
var _parsepath = require_parse_path();
|
|
130
|
+
function addPathSuffix(path, suffix) {
|
|
131
|
+
if (!path.startsWith("/") || !suffix) {
|
|
132
|
+
return path;
|
|
133
|
+
}
|
|
134
|
+
const { pathname, query, hash } = (0, _parsepath.parsePath)(path);
|
|
135
|
+
return `${pathname}${suffix}${query}${hash}`;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js
|
|
141
|
+
var require_path_has_prefix = __commonJS({
|
|
142
|
+
"../../node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js"(exports) {
|
|
143
|
+
"use strict";
|
|
144
|
+
Object.defineProperty(exports, "__esModule", {
|
|
145
|
+
value: true
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "pathHasPrefix", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return pathHasPrefix;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
var _parsepath = require_parse_path();
|
|
154
|
+
function pathHasPrefix(path, prefix) {
|
|
155
|
+
if (typeof path !== "string") {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
159
|
+
return pathname === prefix || pathname.startsWith(prefix + "/");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/add-locale.js
|
|
165
|
+
var require_add_locale = __commonJS({
|
|
166
|
+
"../../node_modules/next/dist/shared/lib/router/utils/add-locale.js"(exports) {
|
|
167
|
+
"use strict";
|
|
168
|
+
Object.defineProperty(exports, "__esModule", {
|
|
169
|
+
value: true
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "addLocale", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return addLocale;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
var _addpathprefix = require_add_path_prefix();
|
|
178
|
+
var _pathhasprefix = require_path_has_prefix();
|
|
179
|
+
function addLocale(path, locale, defaultLocale, ignorePrefix) {
|
|
180
|
+
if (!locale || locale === defaultLocale) return path;
|
|
181
|
+
const lower = path.toLowerCase();
|
|
182
|
+
if (!ignorePrefix) {
|
|
183
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, "/api")) return path;
|
|
184
|
+
if ((0, _pathhasprefix.pathHasPrefix)(lower, `/${locale.toLowerCase()}`)) return path;
|
|
185
|
+
}
|
|
186
|
+
return (0, _addpathprefix.addPathPrefix)(path, `/${locale}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js
|
|
192
|
+
var require_format_next_pathname_info = __commonJS({
|
|
193
|
+
"../../node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js"(exports) {
|
|
194
|
+
"use strict";
|
|
195
|
+
Object.defineProperty(exports, "__esModule", {
|
|
196
|
+
value: true
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "formatNextPathnameInfo", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function() {
|
|
201
|
+
return formatNextPathnameInfo;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
var _removetrailingslash = require_remove_trailing_slash();
|
|
205
|
+
var _addpathprefix = require_add_path_prefix();
|
|
206
|
+
var _addpathsuffix = require_add_path_suffix();
|
|
207
|
+
var _addlocale = require_add_locale();
|
|
208
|
+
function formatNextPathnameInfo(info) {
|
|
209
|
+
let pathname = (0, _addlocale.addLocale)(info.pathname, info.locale, info.buildId ? void 0 : info.defaultLocale, info.ignorePrefix);
|
|
210
|
+
if (info.buildId || !info.trailingSlash) {
|
|
211
|
+
pathname = (0, _removetrailingslash.removeTrailingSlash)(pathname);
|
|
212
|
+
}
|
|
213
|
+
if (info.buildId) {
|
|
214
|
+
pathname = (0, _addpathsuffix.addPathSuffix)((0, _addpathprefix.addPathPrefix)(pathname, `/_next/data/${info.buildId}`), info.pathname === "/" ? "index.json" : ".json");
|
|
215
|
+
}
|
|
216
|
+
pathname = (0, _addpathprefix.addPathPrefix)(pathname, info.basePath);
|
|
217
|
+
return !info.buildId && info.trailingSlash ? !pathname.endsWith("/") ? (0, _addpathsuffix.addPathSuffix)(pathname, "/") : pathname : (0, _removetrailingslash.removeTrailingSlash)(pathname);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// ../../node_modules/next/dist/shared/lib/get-hostname.js
|
|
223
|
+
var require_get_hostname = __commonJS({
|
|
224
|
+
"../../node_modules/next/dist/shared/lib/get-hostname.js"(exports) {
|
|
225
|
+
"use strict";
|
|
226
|
+
Object.defineProperty(exports, "__esModule", {
|
|
227
|
+
value: true
|
|
228
|
+
});
|
|
229
|
+
Object.defineProperty(exports, "getHostname", {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function() {
|
|
232
|
+
return getHostname;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
function getHostname(parsed, headers) {
|
|
236
|
+
let hostname;
|
|
237
|
+
if (headers?.host && !Array.isArray(headers.host)) {
|
|
238
|
+
hostname = headers.host.toString().split(":", 1)[0];
|
|
239
|
+
} else if (parsed.hostname) {
|
|
240
|
+
hostname = parsed.hostname;
|
|
241
|
+
} else return;
|
|
242
|
+
return hostname.toLowerCase();
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// ../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js
|
|
248
|
+
var require_normalize_locale_path = __commonJS({
|
|
249
|
+
"../../node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js"(exports) {
|
|
250
|
+
"use strict";
|
|
251
|
+
Object.defineProperty(exports, "__esModule", {
|
|
252
|
+
value: true
|
|
253
|
+
});
|
|
254
|
+
Object.defineProperty(exports, "normalizeLocalePath", {
|
|
255
|
+
enumerable: true,
|
|
256
|
+
get: function() {
|
|
257
|
+
return normalizeLocalePath;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
261
|
+
function normalizeLocalePath(pathname, locales) {
|
|
262
|
+
if (!locales) return {
|
|
263
|
+
pathname
|
|
264
|
+
};
|
|
265
|
+
let lowercasedLocales = cache.get(locales);
|
|
266
|
+
if (!lowercasedLocales) {
|
|
267
|
+
lowercasedLocales = locales.map((locale) => locale.toLowerCase());
|
|
268
|
+
cache.set(locales, lowercasedLocales);
|
|
269
|
+
}
|
|
270
|
+
let detectedLocale;
|
|
271
|
+
const segments = pathname.split("/", 2);
|
|
272
|
+
if (!segments[1]) return {
|
|
273
|
+
pathname
|
|
274
|
+
};
|
|
275
|
+
const segment = segments[1].toLowerCase();
|
|
276
|
+
const index = lowercasedLocales.indexOf(segment);
|
|
277
|
+
if (index < 0) return {
|
|
278
|
+
pathname
|
|
279
|
+
};
|
|
280
|
+
detectedLocale = locales[index];
|
|
281
|
+
pathname = pathname.slice(detectedLocale.length + 1) || "/";
|
|
282
|
+
return {
|
|
283
|
+
pathname,
|
|
284
|
+
detectedLocale
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js
|
|
291
|
+
var require_remove_path_prefix = __commonJS({
|
|
292
|
+
"../../node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js"(exports) {
|
|
293
|
+
"use strict";
|
|
294
|
+
Object.defineProperty(exports, "__esModule", {
|
|
295
|
+
value: true
|
|
296
|
+
});
|
|
297
|
+
Object.defineProperty(exports, "removePathPrefix", {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
get: function() {
|
|
300
|
+
return removePathPrefix;
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
var _pathhasprefix = require_path_has_prefix();
|
|
304
|
+
function removePathPrefix(path, prefix) {
|
|
305
|
+
if (!(0, _pathhasprefix.pathHasPrefix)(path, prefix)) {
|
|
306
|
+
return path;
|
|
307
|
+
}
|
|
308
|
+
const withoutPrefix = path.slice(prefix.length);
|
|
309
|
+
if (withoutPrefix.startsWith("/")) {
|
|
310
|
+
return withoutPrefix;
|
|
311
|
+
}
|
|
312
|
+
return `/${withoutPrefix}`;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
// ../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js
|
|
318
|
+
var require_get_next_pathname_info = __commonJS({
|
|
319
|
+
"../../node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js"(exports) {
|
|
320
|
+
"use strict";
|
|
321
|
+
Object.defineProperty(exports, "__esModule", {
|
|
322
|
+
value: true
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, "getNextPathnameInfo", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function() {
|
|
327
|
+
return getNextPathnameInfo;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
var _normalizelocalepath = require_normalize_locale_path();
|
|
331
|
+
var _removepathprefix = require_remove_path_prefix();
|
|
332
|
+
var _pathhasprefix = require_path_has_prefix();
|
|
333
|
+
function getNextPathnameInfo(pathname, options) {
|
|
334
|
+
const { basePath, i18n, trailingSlash } = options.nextConfig ?? {};
|
|
335
|
+
const info = {
|
|
336
|
+
pathname,
|
|
337
|
+
trailingSlash: pathname !== "/" ? pathname.endsWith("/") : trailingSlash
|
|
338
|
+
};
|
|
339
|
+
if (basePath && (0, _pathhasprefix.pathHasPrefix)(info.pathname, basePath)) {
|
|
340
|
+
info.pathname = (0, _removepathprefix.removePathPrefix)(info.pathname, basePath);
|
|
341
|
+
info.basePath = basePath;
|
|
342
|
+
}
|
|
343
|
+
let pathnameNoDataPrefix = info.pathname;
|
|
344
|
+
if (info.pathname.startsWith("/_next/data/") && info.pathname.endsWith(".json")) {
|
|
345
|
+
const paths = info.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/");
|
|
346
|
+
const buildId = paths[0];
|
|
347
|
+
info.buildId = buildId;
|
|
348
|
+
pathnameNoDataPrefix = paths[1] !== "index" ? `/${paths.slice(1).join("/")}` : "/";
|
|
349
|
+
if (options.parseData === true) {
|
|
350
|
+
info.pathname = pathnameNoDataPrefix;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (i18n) {
|
|
354
|
+
let result = options.i18nProvider ? options.i18nProvider.analyze(info.pathname) : (0, _normalizelocalepath.normalizeLocalePath)(info.pathname, i18n.locales);
|
|
355
|
+
info.locale = result.detectedLocale;
|
|
356
|
+
info.pathname = result.pathname ?? info.pathname;
|
|
357
|
+
if (!result.detectedLocale && info.buildId) {
|
|
358
|
+
result = options.i18nProvider ? options.i18nProvider.analyze(pathnameNoDataPrefix) : (0, _normalizelocalepath.normalizeLocalePath)(pathnameNoDataPrefix, i18n.locales);
|
|
359
|
+
if (result.detectedLocale) {
|
|
360
|
+
info.locale = result.detectedLocale;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return info;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
// ../../node_modules/next/dist/server/web/next-url.js
|
|
370
|
+
var require_next_url = __commonJS({
|
|
371
|
+
"../../node_modules/next/dist/server/web/next-url.js"(exports) {
|
|
372
|
+
"use strict";
|
|
373
|
+
Object.defineProperty(exports, "__esModule", {
|
|
374
|
+
value: true
|
|
375
|
+
});
|
|
376
|
+
Object.defineProperty(exports, "NextURL", {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
get: function() {
|
|
379
|
+
return NextURL;
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
var _detectdomainlocale = require_detect_domain_locale();
|
|
383
|
+
var _formatnextpathnameinfo = require_format_next_pathname_info();
|
|
384
|
+
var _gethostname = require_get_hostname();
|
|
385
|
+
var _getnextpathnameinfo = require_get_next_pathname_info();
|
|
386
|
+
var REGEX_LOCALHOST_HOSTNAME = /^(?:127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)$/;
|
|
387
|
+
function parseURL(url, base) {
|
|
388
|
+
const parsed = new URL(String(url), base && String(base));
|
|
389
|
+
if (REGEX_LOCALHOST_HOSTNAME.test(parsed.hostname)) {
|
|
390
|
+
parsed.hostname = "localhost";
|
|
391
|
+
}
|
|
392
|
+
return parsed;
|
|
393
|
+
}
|
|
394
|
+
var Internal = /* @__PURE__ */ Symbol("NextURLInternal");
|
|
395
|
+
var NextURL = class _NextURL {
|
|
396
|
+
constructor(input, baseOrOpts, opts) {
|
|
397
|
+
let base;
|
|
398
|
+
let options;
|
|
399
|
+
if (typeof baseOrOpts === "object" && "pathname" in baseOrOpts || typeof baseOrOpts === "string") {
|
|
400
|
+
base = baseOrOpts;
|
|
401
|
+
options = opts || {};
|
|
402
|
+
} else {
|
|
403
|
+
options = opts || baseOrOpts || {};
|
|
404
|
+
}
|
|
405
|
+
this[Internal] = {
|
|
406
|
+
url: parseURL(input, base ?? options.base),
|
|
407
|
+
options,
|
|
408
|
+
basePath: ""
|
|
409
|
+
};
|
|
410
|
+
this.analyze();
|
|
411
|
+
}
|
|
412
|
+
analyze() {
|
|
413
|
+
var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig, _this_Internal_domainLocale, _this_Internal_options_nextConfig_i18n1, _this_Internal_options_nextConfig1;
|
|
414
|
+
const info = (0, _getnextpathnameinfo.getNextPathnameInfo)(this[Internal].url.pathname, {
|
|
415
|
+
nextConfig: this[Internal].options.nextConfig,
|
|
416
|
+
parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
|
|
417
|
+
i18nProvider: this[Internal].options.i18nProvider
|
|
418
|
+
});
|
|
419
|
+
const hostname = (0, _gethostname.getHostname)(this[Internal].url, this[Internal].options.headers);
|
|
420
|
+
this[Internal].domainLocale = this[Internal].options.i18nProvider ? this[Internal].options.i18nProvider.detectDomainLocale(hostname) : (0, _detectdomainlocale.detectDomainLocale)((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.domains, hostname);
|
|
421
|
+
const defaultLocale = ((_this_Internal_domainLocale = this[Internal].domainLocale) == null ? void 0 : _this_Internal_domainLocale.defaultLocale) || ((_this_Internal_options_nextConfig1 = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n1 = _this_Internal_options_nextConfig1.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n1.defaultLocale);
|
|
422
|
+
this[Internal].url.pathname = info.pathname;
|
|
423
|
+
this[Internal].defaultLocale = defaultLocale;
|
|
424
|
+
this[Internal].basePath = info.basePath ?? "";
|
|
425
|
+
this[Internal].buildId = info.buildId;
|
|
426
|
+
this[Internal].locale = info.locale ?? defaultLocale;
|
|
427
|
+
this[Internal].trailingSlash = info.trailingSlash;
|
|
428
|
+
}
|
|
429
|
+
formatPathname() {
|
|
430
|
+
return (0, _formatnextpathnameinfo.formatNextPathnameInfo)({
|
|
431
|
+
basePath: this[Internal].basePath,
|
|
432
|
+
buildId: this[Internal].buildId,
|
|
433
|
+
defaultLocale: !this[Internal].options.forceLocale ? this[Internal].defaultLocale : void 0,
|
|
434
|
+
locale: this[Internal].locale,
|
|
435
|
+
pathname: this[Internal].url.pathname,
|
|
436
|
+
trailingSlash: this[Internal].trailingSlash
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
formatSearch() {
|
|
440
|
+
return this[Internal].url.search;
|
|
441
|
+
}
|
|
442
|
+
get buildId() {
|
|
443
|
+
return this[Internal].buildId;
|
|
444
|
+
}
|
|
445
|
+
set buildId(buildId) {
|
|
446
|
+
this[Internal].buildId = buildId;
|
|
447
|
+
}
|
|
448
|
+
get locale() {
|
|
449
|
+
return this[Internal].locale ?? "";
|
|
450
|
+
}
|
|
451
|
+
set locale(locale) {
|
|
452
|
+
var _this_Internal_options_nextConfig_i18n, _this_Internal_options_nextConfig;
|
|
453
|
+
if (!this[Internal].locale || !((_this_Internal_options_nextConfig = this[Internal].options.nextConfig) == null ? void 0 : (_this_Internal_options_nextConfig_i18n = _this_Internal_options_nextConfig.i18n) == null ? void 0 : _this_Internal_options_nextConfig_i18n.locales.includes(locale))) {
|
|
454
|
+
throw Object.defineProperty(new TypeError(`The NextURL configuration includes no locale "${locale}"`), "__NEXT_ERROR_CODE", {
|
|
455
|
+
value: "E597",
|
|
456
|
+
enumerable: false,
|
|
457
|
+
configurable: true
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
this[Internal].locale = locale;
|
|
461
|
+
}
|
|
462
|
+
get defaultLocale() {
|
|
463
|
+
return this[Internal].defaultLocale;
|
|
464
|
+
}
|
|
465
|
+
get domainLocale() {
|
|
466
|
+
return this[Internal].domainLocale;
|
|
467
|
+
}
|
|
468
|
+
get searchParams() {
|
|
469
|
+
return this[Internal].url.searchParams;
|
|
470
|
+
}
|
|
471
|
+
get host() {
|
|
472
|
+
return this[Internal].url.host;
|
|
473
|
+
}
|
|
474
|
+
set host(value) {
|
|
475
|
+
this[Internal].url.host = value;
|
|
476
|
+
}
|
|
477
|
+
get hostname() {
|
|
478
|
+
return this[Internal].url.hostname;
|
|
479
|
+
}
|
|
480
|
+
set hostname(value) {
|
|
481
|
+
this[Internal].url.hostname = value;
|
|
482
|
+
}
|
|
483
|
+
get port() {
|
|
484
|
+
return this[Internal].url.port;
|
|
485
|
+
}
|
|
486
|
+
set port(value) {
|
|
487
|
+
this[Internal].url.port = value;
|
|
488
|
+
}
|
|
489
|
+
get protocol() {
|
|
490
|
+
return this[Internal].url.protocol;
|
|
491
|
+
}
|
|
492
|
+
set protocol(value) {
|
|
493
|
+
this[Internal].url.protocol = value;
|
|
494
|
+
}
|
|
495
|
+
get href() {
|
|
496
|
+
const pathname = this.formatPathname();
|
|
497
|
+
const search = this.formatSearch();
|
|
498
|
+
return `${this.protocol}//${this.host}${pathname}${search}${this.hash}`;
|
|
499
|
+
}
|
|
500
|
+
set href(url) {
|
|
501
|
+
this[Internal].url = parseURL(url);
|
|
502
|
+
this.analyze();
|
|
503
|
+
}
|
|
504
|
+
get origin() {
|
|
505
|
+
return this[Internal].url.origin;
|
|
506
|
+
}
|
|
507
|
+
get pathname() {
|
|
508
|
+
return this[Internal].url.pathname;
|
|
509
|
+
}
|
|
510
|
+
set pathname(value) {
|
|
511
|
+
this[Internal].url.pathname = value;
|
|
512
|
+
}
|
|
513
|
+
get hash() {
|
|
514
|
+
return this[Internal].url.hash;
|
|
515
|
+
}
|
|
516
|
+
set hash(value) {
|
|
517
|
+
this[Internal].url.hash = value;
|
|
518
|
+
}
|
|
519
|
+
get search() {
|
|
520
|
+
return this[Internal].url.search;
|
|
521
|
+
}
|
|
522
|
+
set search(value) {
|
|
523
|
+
this[Internal].url.search = value;
|
|
524
|
+
}
|
|
525
|
+
get password() {
|
|
526
|
+
return this[Internal].url.password;
|
|
527
|
+
}
|
|
528
|
+
set password(value) {
|
|
529
|
+
this[Internal].url.password = value;
|
|
530
|
+
}
|
|
531
|
+
get username() {
|
|
532
|
+
return this[Internal].url.username;
|
|
533
|
+
}
|
|
534
|
+
set username(value) {
|
|
535
|
+
this[Internal].url.username = value;
|
|
536
|
+
}
|
|
537
|
+
get basePath() {
|
|
538
|
+
return this[Internal].basePath;
|
|
539
|
+
}
|
|
540
|
+
set basePath(value) {
|
|
541
|
+
this[Internal].basePath = value.startsWith("/") ? value : `/${value}`;
|
|
542
|
+
}
|
|
543
|
+
toString() {
|
|
544
|
+
return this.href;
|
|
545
|
+
}
|
|
546
|
+
toJSON() {
|
|
547
|
+
return this.href;
|
|
548
|
+
}
|
|
549
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
550
|
+
return {
|
|
551
|
+
href: this.href,
|
|
552
|
+
origin: this.origin,
|
|
553
|
+
protocol: this.protocol,
|
|
554
|
+
username: this.username,
|
|
555
|
+
password: this.password,
|
|
556
|
+
host: this.host,
|
|
557
|
+
hostname: this.hostname,
|
|
558
|
+
port: this.port,
|
|
559
|
+
pathname: this.pathname,
|
|
560
|
+
search: this.search,
|
|
561
|
+
searchParams: this.searchParams,
|
|
562
|
+
hash: this.hash
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
clone() {
|
|
566
|
+
return new _NextURL(String(this), this[Internal].options);
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
// ../../node_modules/next/dist/lib/constants.js
|
|
573
|
+
var require_constants = __commonJS({
|
|
574
|
+
"../../node_modules/next/dist/lib/constants.js"(exports) {
|
|
575
|
+
"use strict";
|
|
576
|
+
Object.defineProperty(exports, "__esModule", {
|
|
577
|
+
value: true
|
|
578
|
+
});
|
|
579
|
+
function _export(target, all) {
|
|
580
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
581
|
+
enumerable: true,
|
|
582
|
+
get: all[name]
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
_export(exports, {
|
|
586
|
+
ACTION_SUFFIX: function() {
|
|
587
|
+
return ACTION_SUFFIX;
|
|
588
|
+
},
|
|
589
|
+
APP_DIR_ALIAS: function() {
|
|
590
|
+
return APP_DIR_ALIAS;
|
|
591
|
+
},
|
|
592
|
+
CACHE_ONE_YEAR_SECONDS: function() {
|
|
593
|
+
return CACHE_ONE_YEAR_SECONDS;
|
|
594
|
+
},
|
|
595
|
+
DOT_NEXT_ALIAS: function() {
|
|
596
|
+
return DOT_NEXT_ALIAS;
|
|
597
|
+
},
|
|
598
|
+
ESLINT_DEFAULT_DIRS: function() {
|
|
599
|
+
return ESLINT_DEFAULT_DIRS;
|
|
600
|
+
},
|
|
601
|
+
GSP_NO_RETURNED_VALUE: function() {
|
|
602
|
+
return GSP_NO_RETURNED_VALUE;
|
|
603
|
+
},
|
|
604
|
+
GSSP_COMPONENT_MEMBER_ERROR: function() {
|
|
605
|
+
return GSSP_COMPONENT_MEMBER_ERROR;
|
|
606
|
+
},
|
|
607
|
+
GSSP_NO_RETURNED_VALUE: function() {
|
|
608
|
+
return GSSP_NO_RETURNED_VALUE;
|
|
609
|
+
},
|
|
610
|
+
HTML_CONTENT_TYPE_HEADER: function() {
|
|
611
|
+
return HTML_CONTENT_TYPE_HEADER;
|
|
612
|
+
},
|
|
613
|
+
INFINITE_CACHE: function() {
|
|
614
|
+
return INFINITE_CACHE;
|
|
615
|
+
},
|
|
616
|
+
INSTRUMENTATION_HOOK_FILENAME: function() {
|
|
617
|
+
return INSTRUMENTATION_HOOK_FILENAME;
|
|
618
|
+
},
|
|
619
|
+
JSON_CONTENT_TYPE_HEADER: function() {
|
|
620
|
+
return JSON_CONTENT_TYPE_HEADER;
|
|
621
|
+
},
|
|
622
|
+
MATCHED_PATH_HEADER: function() {
|
|
623
|
+
return MATCHED_PATH_HEADER;
|
|
624
|
+
},
|
|
625
|
+
MIDDLEWARE_FILENAME: function() {
|
|
626
|
+
return MIDDLEWARE_FILENAME;
|
|
627
|
+
},
|
|
628
|
+
MIDDLEWARE_LOCATION_REGEXP: function() {
|
|
629
|
+
return MIDDLEWARE_LOCATION_REGEXP;
|
|
630
|
+
},
|
|
631
|
+
NEXT_BODY_SUFFIX: function() {
|
|
632
|
+
return NEXT_BODY_SUFFIX;
|
|
633
|
+
},
|
|
634
|
+
NEXT_CACHE_IMPLICIT_TAG_ID: function() {
|
|
635
|
+
return NEXT_CACHE_IMPLICIT_TAG_ID;
|
|
636
|
+
},
|
|
637
|
+
NEXT_CACHE_REVALIDATED_TAGS_HEADER: function() {
|
|
638
|
+
return NEXT_CACHE_REVALIDATED_TAGS_HEADER;
|
|
639
|
+
},
|
|
640
|
+
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER: function() {
|
|
641
|
+
return NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER;
|
|
642
|
+
},
|
|
643
|
+
NEXT_CACHE_ROOT_PARAM_TAG_ID: function() {
|
|
644
|
+
return NEXT_CACHE_ROOT_PARAM_TAG_ID;
|
|
645
|
+
},
|
|
646
|
+
NEXT_CACHE_SOFT_TAG_MAX_LENGTH: function() {
|
|
647
|
+
return NEXT_CACHE_SOFT_TAG_MAX_LENGTH;
|
|
648
|
+
},
|
|
649
|
+
NEXT_CACHE_TAGS_HEADER: function() {
|
|
650
|
+
return NEXT_CACHE_TAGS_HEADER;
|
|
651
|
+
},
|
|
652
|
+
NEXT_CACHE_TAG_MAX_ITEMS: function() {
|
|
653
|
+
return NEXT_CACHE_TAG_MAX_ITEMS;
|
|
654
|
+
},
|
|
655
|
+
NEXT_CACHE_TAG_MAX_LENGTH: function() {
|
|
656
|
+
return NEXT_CACHE_TAG_MAX_LENGTH;
|
|
657
|
+
},
|
|
658
|
+
NEXT_DATA_SUFFIX: function() {
|
|
659
|
+
return NEXT_DATA_SUFFIX;
|
|
660
|
+
},
|
|
661
|
+
NEXT_INTERCEPTION_MARKER_PREFIX: function() {
|
|
662
|
+
return NEXT_INTERCEPTION_MARKER_PREFIX;
|
|
663
|
+
},
|
|
664
|
+
NEXT_META_SUFFIX: function() {
|
|
665
|
+
return NEXT_META_SUFFIX;
|
|
666
|
+
},
|
|
667
|
+
NEXT_NAV_DEPLOYMENT_ID_HEADER: function() {
|
|
668
|
+
return NEXT_NAV_DEPLOYMENT_ID_HEADER;
|
|
669
|
+
},
|
|
670
|
+
NEXT_QUERY_PARAM_PREFIX: function() {
|
|
671
|
+
return NEXT_QUERY_PARAM_PREFIX;
|
|
672
|
+
},
|
|
673
|
+
NEXT_RESUME_HEADER: function() {
|
|
674
|
+
return NEXT_RESUME_HEADER;
|
|
675
|
+
},
|
|
676
|
+
NEXT_RESUME_STATE_LENGTH_HEADER: function() {
|
|
677
|
+
return NEXT_RESUME_STATE_LENGTH_HEADER;
|
|
678
|
+
},
|
|
679
|
+
NON_STANDARD_NODE_ENV: function() {
|
|
680
|
+
return NON_STANDARD_NODE_ENV;
|
|
681
|
+
},
|
|
682
|
+
PAGES_DIR_ALIAS: function() {
|
|
683
|
+
return PAGES_DIR_ALIAS;
|
|
684
|
+
},
|
|
685
|
+
PRERENDER_REVALIDATE_HEADER: function() {
|
|
686
|
+
return PRERENDER_REVALIDATE_HEADER;
|
|
687
|
+
},
|
|
688
|
+
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER: function() {
|
|
689
|
+
return PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER;
|
|
690
|
+
},
|
|
691
|
+
PROXY_FILENAME: function() {
|
|
692
|
+
return PROXY_FILENAME;
|
|
693
|
+
},
|
|
694
|
+
PROXY_LOCATION_REGEXP: function() {
|
|
695
|
+
return PROXY_LOCATION_REGEXP;
|
|
696
|
+
},
|
|
697
|
+
PUBLIC_DIR_MIDDLEWARE_CONFLICT: function() {
|
|
698
|
+
return PUBLIC_DIR_MIDDLEWARE_CONFLICT;
|
|
699
|
+
},
|
|
700
|
+
ROOT_DIR_ALIAS: function() {
|
|
701
|
+
return ROOT_DIR_ALIAS;
|
|
702
|
+
},
|
|
703
|
+
RSC_ACTION_CLIENT_WRAPPER_ALIAS: function() {
|
|
704
|
+
return RSC_ACTION_CLIENT_WRAPPER_ALIAS;
|
|
705
|
+
},
|
|
706
|
+
RSC_ACTION_ENCRYPTION_ALIAS: function() {
|
|
707
|
+
return RSC_ACTION_ENCRYPTION_ALIAS;
|
|
708
|
+
},
|
|
709
|
+
RSC_ACTION_PROXY_ALIAS: function() {
|
|
710
|
+
return RSC_ACTION_PROXY_ALIAS;
|
|
711
|
+
},
|
|
712
|
+
RSC_ACTION_VALIDATE_ALIAS: function() {
|
|
713
|
+
return RSC_ACTION_VALIDATE_ALIAS;
|
|
714
|
+
},
|
|
715
|
+
RSC_CACHE_WRAPPER_ALIAS: function() {
|
|
716
|
+
return RSC_CACHE_WRAPPER_ALIAS;
|
|
717
|
+
},
|
|
718
|
+
RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS: function() {
|
|
719
|
+
return RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS;
|
|
720
|
+
},
|
|
721
|
+
RSC_MOD_REF_PROXY_ALIAS: function() {
|
|
722
|
+
return RSC_MOD_REF_PROXY_ALIAS;
|
|
723
|
+
},
|
|
724
|
+
RSC_SEGMENTS_DIR_SUFFIX: function() {
|
|
725
|
+
return RSC_SEGMENTS_DIR_SUFFIX;
|
|
726
|
+
},
|
|
727
|
+
RSC_SEGMENT_SUFFIX: function() {
|
|
728
|
+
return RSC_SEGMENT_SUFFIX;
|
|
729
|
+
},
|
|
730
|
+
RSC_SUFFIX: function() {
|
|
731
|
+
return RSC_SUFFIX;
|
|
732
|
+
},
|
|
733
|
+
SERVER_PROPS_EXPORT_ERROR: function() {
|
|
734
|
+
return SERVER_PROPS_EXPORT_ERROR;
|
|
735
|
+
},
|
|
736
|
+
SERVER_PROPS_GET_INIT_PROPS_CONFLICT: function() {
|
|
737
|
+
return SERVER_PROPS_GET_INIT_PROPS_CONFLICT;
|
|
738
|
+
},
|
|
739
|
+
SERVER_PROPS_SSG_CONFLICT: function() {
|
|
740
|
+
return SERVER_PROPS_SSG_CONFLICT;
|
|
741
|
+
},
|
|
742
|
+
SERVER_RUNTIME: function() {
|
|
743
|
+
return SERVER_RUNTIME;
|
|
744
|
+
},
|
|
745
|
+
SSG_FALLBACK_EXPORT_ERROR: function() {
|
|
746
|
+
return SSG_FALLBACK_EXPORT_ERROR;
|
|
747
|
+
},
|
|
748
|
+
SSG_GET_INITIAL_PROPS_CONFLICT: function() {
|
|
749
|
+
return SSG_GET_INITIAL_PROPS_CONFLICT;
|
|
750
|
+
},
|
|
751
|
+
STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR: function() {
|
|
752
|
+
return STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR;
|
|
753
|
+
},
|
|
754
|
+
TEXT_PLAIN_CONTENT_TYPE_HEADER: function() {
|
|
755
|
+
return TEXT_PLAIN_CONTENT_TYPE_HEADER;
|
|
756
|
+
},
|
|
757
|
+
UNSTABLE_REVALIDATE_RENAME_ERROR: function() {
|
|
758
|
+
return UNSTABLE_REVALIDATE_RENAME_ERROR;
|
|
759
|
+
},
|
|
760
|
+
WEBPACK_LAYERS: function() {
|
|
761
|
+
return WEBPACK_LAYERS;
|
|
762
|
+
},
|
|
763
|
+
WEBPACK_RESOURCE_QUERIES: function() {
|
|
764
|
+
return WEBPACK_RESOURCE_QUERIES;
|
|
765
|
+
},
|
|
766
|
+
WEB_SOCKET_MAX_RECONNECTIONS: function() {
|
|
767
|
+
return WEB_SOCKET_MAX_RECONNECTIONS;
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
var TEXT_PLAIN_CONTENT_TYPE_HEADER = "text/plain";
|
|
771
|
+
var HTML_CONTENT_TYPE_HEADER = "text/html; charset=utf-8";
|
|
772
|
+
var JSON_CONTENT_TYPE_HEADER = "application/json; charset=utf-8";
|
|
773
|
+
var NEXT_QUERY_PARAM_PREFIX = "nxtP";
|
|
774
|
+
var NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
|
|
775
|
+
var MATCHED_PATH_HEADER = "x-matched-path";
|
|
776
|
+
var PRERENDER_REVALIDATE_HEADER = "x-prerender-revalidate";
|
|
777
|
+
var PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER = "x-prerender-revalidate-if-generated";
|
|
778
|
+
var RSC_SEGMENTS_DIR_SUFFIX = ".segments";
|
|
779
|
+
var RSC_SEGMENT_SUFFIX = ".segment.rsc";
|
|
780
|
+
var RSC_SUFFIX = ".rsc";
|
|
781
|
+
var ACTION_SUFFIX = ".action";
|
|
782
|
+
var NEXT_DATA_SUFFIX = ".json";
|
|
783
|
+
var NEXT_META_SUFFIX = ".meta";
|
|
784
|
+
var NEXT_BODY_SUFFIX = ".body";
|
|
785
|
+
var NEXT_NAV_DEPLOYMENT_ID_HEADER = "x-nextjs-deployment-id";
|
|
786
|
+
var NEXT_CACHE_TAGS_HEADER = "x-next-cache-tags";
|
|
787
|
+
var NEXT_CACHE_REVALIDATED_TAGS_HEADER = "x-next-revalidated-tags";
|
|
788
|
+
var NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER = "x-next-revalidate-tag-token";
|
|
789
|
+
var NEXT_RESUME_HEADER = "next-resume";
|
|
790
|
+
var NEXT_RESUME_STATE_LENGTH_HEADER = "x-next-resume-state-length";
|
|
791
|
+
var NEXT_CACHE_TAG_MAX_ITEMS = 128;
|
|
792
|
+
var NEXT_CACHE_TAG_MAX_LENGTH = 256;
|
|
793
|
+
var NEXT_CACHE_SOFT_TAG_MAX_LENGTH = 1024;
|
|
794
|
+
var NEXT_CACHE_IMPLICIT_TAG_ID = "_N_T_";
|
|
795
|
+
var NEXT_CACHE_ROOT_PARAM_TAG_ID = "_N_RP_";
|
|
796
|
+
var CACHE_ONE_YEAR_SECONDS = 31536e3;
|
|
797
|
+
var INFINITE_CACHE = 4294967294;
|
|
798
|
+
var MIDDLEWARE_FILENAME = "middleware";
|
|
799
|
+
var MIDDLEWARE_LOCATION_REGEXP = `(?:src/)?${MIDDLEWARE_FILENAME}`;
|
|
800
|
+
var PROXY_FILENAME = "proxy";
|
|
801
|
+
var PROXY_LOCATION_REGEXP = `(?:src/)?${PROXY_FILENAME}`;
|
|
802
|
+
var INSTRUMENTATION_HOOK_FILENAME = "instrumentation";
|
|
803
|
+
var PAGES_DIR_ALIAS = "private-next-pages";
|
|
804
|
+
var DOT_NEXT_ALIAS = "private-dot-next";
|
|
805
|
+
var ROOT_DIR_ALIAS = "private-next-root-dir";
|
|
806
|
+
var APP_DIR_ALIAS = "private-next-app-dir";
|
|
807
|
+
var RSC_MOD_REF_PROXY_ALIAS = "private-next-rsc-mod-ref-proxy";
|
|
808
|
+
var RSC_ACTION_VALIDATE_ALIAS = "private-next-rsc-action-validate";
|
|
809
|
+
var RSC_ACTION_PROXY_ALIAS = "private-next-rsc-server-reference";
|
|
810
|
+
var RSC_CACHE_WRAPPER_ALIAS = "private-next-rsc-cache-wrapper";
|
|
811
|
+
var RSC_DYNAMIC_IMPORT_WRAPPER_ALIAS = "private-next-rsc-track-dynamic-import";
|
|
812
|
+
var RSC_ACTION_ENCRYPTION_ALIAS = "private-next-rsc-action-encryption";
|
|
813
|
+
var RSC_ACTION_CLIENT_WRAPPER_ALIAS = "private-next-rsc-action-client-wrapper";
|
|
814
|
+
var PUBLIC_DIR_MIDDLEWARE_CONFLICT = `You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://nextjs.org/docs/messages/public-next-folder-conflict`;
|
|
815
|
+
var SSG_GET_INITIAL_PROPS_CONFLICT = `You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps`;
|
|
816
|
+
var SERVER_PROPS_GET_INIT_PROPS_CONFLICT = `You can not use getInitialProps with getServerSideProps. Please remove getInitialProps.`;
|
|
817
|
+
var SERVER_PROPS_SSG_CONFLICT = `You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps`;
|
|
818
|
+
var STATIC_STATUS_PAGE_GET_INITIAL_PROPS_ERROR = `can not have getInitialProps/getServerSideProps, https://nextjs.org/docs/messages/404-get-initial-props`;
|
|
819
|
+
var SERVER_PROPS_EXPORT_ERROR = `pages with \`getServerSideProps\` can not be exported. See more info here: https://nextjs.org/docs/messages/gssp-export`;
|
|
820
|
+
var GSP_NO_RETURNED_VALUE = "Your `getStaticProps` function did not return an object. Did you forget to add a `return`?";
|
|
821
|
+
var GSSP_NO_RETURNED_VALUE = "Your `getServerSideProps` function did not return an object. Did you forget to add a `return`?";
|
|
822
|
+
var UNSTABLE_REVALIDATE_RENAME_ERROR = "The `unstable_revalidate` property is available for general use.\nPlease use `revalidate` instead.";
|
|
823
|
+
var GSSP_COMPONENT_MEMBER_ERROR = `can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member`;
|
|
824
|
+
var NON_STANDARD_NODE_ENV = `You are using a non-standard "NODE_ENV" value in your environment. This creates inconsistencies in the project and is strongly advised against. Read more: https://nextjs.org/docs/messages/non-standard-node-env`;
|
|
825
|
+
var SSG_FALLBACK_EXPORT_ERROR = `Pages with \`fallback\` enabled in \`getStaticPaths\` can not be exported. See more info here: https://nextjs.org/docs/messages/ssg-fallback-true-export`;
|
|
826
|
+
var ESLINT_DEFAULT_DIRS = [
|
|
827
|
+
"app",
|
|
828
|
+
"pages",
|
|
829
|
+
"components",
|
|
830
|
+
"lib",
|
|
831
|
+
"src"
|
|
832
|
+
];
|
|
833
|
+
var SERVER_RUNTIME = {
|
|
834
|
+
edge: "edge",
|
|
835
|
+
experimentalEdge: "experimental-edge",
|
|
836
|
+
nodejs: "nodejs"
|
|
837
|
+
};
|
|
838
|
+
var WEB_SOCKET_MAX_RECONNECTIONS = 12;
|
|
839
|
+
var WEBPACK_LAYERS_NAMES = {
|
|
840
|
+
/**
|
|
841
|
+
* The layer for the shared code between the client and server bundles.
|
|
842
|
+
*/
|
|
843
|
+
shared: "shared",
|
|
844
|
+
/**
|
|
845
|
+
* The layer for server-only runtime and picking up `react-server` export conditions.
|
|
846
|
+
* Including app router RSC pages and app router custom routes and metadata routes.
|
|
847
|
+
*/
|
|
848
|
+
reactServerComponents: "rsc",
|
|
849
|
+
/**
|
|
850
|
+
* Server Side Rendering layer for app (ssr).
|
|
851
|
+
*/
|
|
852
|
+
serverSideRendering: "ssr",
|
|
853
|
+
/**
|
|
854
|
+
* The browser client bundle layer for actions.
|
|
855
|
+
*/
|
|
856
|
+
actionBrowser: "action-browser",
|
|
857
|
+
/**
|
|
858
|
+
* The Node.js bundle layer for the API routes.
|
|
859
|
+
*/
|
|
860
|
+
apiNode: "api-node",
|
|
861
|
+
/**
|
|
862
|
+
* The Edge Lite bundle layer for the API routes.
|
|
863
|
+
*/
|
|
864
|
+
apiEdge: "api-edge",
|
|
865
|
+
/**
|
|
866
|
+
* The layer for the middleware code.
|
|
867
|
+
*/
|
|
868
|
+
middleware: "middleware",
|
|
869
|
+
/**
|
|
870
|
+
* The layer for the instrumentation hooks.
|
|
871
|
+
*/
|
|
872
|
+
instrument: "instrument",
|
|
873
|
+
/**
|
|
874
|
+
* The layer for assets on the edge.
|
|
875
|
+
*/
|
|
876
|
+
edgeAsset: "edge-asset",
|
|
877
|
+
/**
|
|
878
|
+
* The browser client bundle layer for App directory.
|
|
879
|
+
*/
|
|
880
|
+
appPagesBrowser: "app-pages-browser",
|
|
881
|
+
/**
|
|
882
|
+
* The browser client bundle layer for Pages directory.
|
|
883
|
+
*/
|
|
884
|
+
pagesDirBrowser: "pages-dir-browser",
|
|
885
|
+
/**
|
|
886
|
+
* The Edge Lite bundle layer for Pages directory.
|
|
887
|
+
*/
|
|
888
|
+
pagesDirEdge: "pages-dir-edge",
|
|
889
|
+
/**
|
|
890
|
+
* The Node.js bundle layer for Pages directory.
|
|
891
|
+
*/
|
|
892
|
+
pagesDirNode: "pages-dir-node"
|
|
893
|
+
};
|
|
894
|
+
var WEBPACK_LAYERS = {
|
|
895
|
+
...WEBPACK_LAYERS_NAMES,
|
|
896
|
+
GROUP: {
|
|
897
|
+
builtinReact: [
|
|
898
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
899
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
900
|
+
],
|
|
901
|
+
serverOnly: [
|
|
902
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
903
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
904
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
905
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
906
|
+
],
|
|
907
|
+
neutralTarget: [
|
|
908
|
+
// pages api
|
|
909
|
+
WEBPACK_LAYERS_NAMES.apiNode,
|
|
910
|
+
WEBPACK_LAYERS_NAMES.apiEdge
|
|
911
|
+
],
|
|
912
|
+
clientOnly: [
|
|
913
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
914
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser
|
|
915
|
+
],
|
|
916
|
+
bundled: [
|
|
917
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
918
|
+
WEBPACK_LAYERS_NAMES.actionBrowser,
|
|
919
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
920
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
921
|
+
WEBPACK_LAYERS_NAMES.shared,
|
|
922
|
+
WEBPACK_LAYERS_NAMES.instrument,
|
|
923
|
+
WEBPACK_LAYERS_NAMES.middleware
|
|
924
|
+
],
|
|
925
|
+
appPages: [
|
|
926
|
+
// app router pages and layouts
|
|
927
|
+
WEBPACK_LAYERS_NAMES.reactServerComponents,
|
|
928
|
+
WEBPACK_LAYERS_NAMES.serverSideRendering,
|
|
929
|
+
WEBPACK_LAYERS_NAMES.appPagesBrowser,
|
|
930
|
+
WEBPACK_LAYERS_NAMES.actionBrowser
|
|
931
|
+
]
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
var WEBPACK_RESOURCE_QUERIES = {
|
|
935
|
+
edgeSSREntry: "__next_edge_ssr_entry__",
|
|
936
|
+
metadata: "__next_metadata__",
|
|
937
|
+
metadataRoute: "__next_metadata_route__",
|
|
938
|
+
metadataImageMeta: "__next_metadata_image_meta__"
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// ../../node_modules/next/dist/server/web/utils.js
|
|
944
|
+
var require_utils = __commonJS({
|
|
945
|
+
"../../node_modules/next/dist/server/web/utils.js"(exports) {
|
|
946
|
+
"use strict";
|
|
947
|
+
Object.defineProperty(exports, "__esModule", {
|
|
948
|
+
value: true
|
|
949
|
+
});
|
|
950
|
+
function _export(target, all) {
|
|
951
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
952
|
+
enumerable: true,
|
|
953
|
+
get: all[name]
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
_export(exports, {
|
|
957
|
+
fromNodeOutgoingHttpHeaders: function() {
|
|
958
|
+
return fromNodeOutgoingHttpHeaders;
|
|
959
|
+
},
|
|
960
|
+
normalizeNextQueryParam: function() {
|
|
961
|
+
return normalizeNextQueryParam;
|
|
962
|
+
},
|
|
963
|
+
splitCookiesString: function() {
|
|
964
|
+
return splitCookiesString;
|
|
965
|
+
},
|
|
966
|
+
toNodeOutgoingHttpHeaders: function() {
|
|
967
|
+
return toNodeOutgoingHttpHeaders;
|
|
968
|
+
},
|
|
969
|
+
validateURL: function() {
|
|
970
|
+
return validateURL;
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
var _constants = require_constants();
|
|
974
|
+
function fromNodeOutgoingHttpHeaders(nodeHeaders) {
|
|
975
|
+
const headers = new Headers();
|
|
976
|
+
for (let [key, value] of Object.entries(nodeHeaders)) {
|
|
977
|
+
const values = Array.isArray(value) ? value : [
|
|
978
|
+
value
|
|
979
|
+
];
|
|
980
|
+
for (let v of values) {
|
|
981
|
+
if (typeof v === "undefined") continue;
|
|
982
|
+
if (typeof v === "number") {
|
|
983
|
+
v = v.toString();
|
|
984
|
+
}
|
|
985
|
+
headers.append(key, v);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
return headers;
|
|
989
|
+
}
|
|
990
|
+
function splitCookiesString(cookiesString) {
|
|
991
|
+
var cookiesStrings = [];
|
|
992
|
+
var pos = 0;
|
|
993
|
+
var start;
|
|
994
|
+
var ch;
|
|
995
|
+
var lastComma;
|
|
996
|
+
var nextStart;
|
|
997
|
+
var cookiesSeparatorFound;
|
|
998
|
+
function skipWhitespace() {
|
|
999
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
1000
|
+
pos += 1;
|
|
1001
|
+
}
|
|
1002
|
+
return pos < cookiesString.length;
|
|
1003
|
+
}
|
|
1004
|
+
function notSpecialChar() {
|
|
1005
|
+
ch = cookiesString.charAt(pos);
|
|
1006
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
1007
|
+
}
|
|
1008
|
+
while (pos < cookiesString.length) {
|
|
1009
|
+
start = pos;
|
|
1010
|
+
cookiesSeparatorFound = false;
|
|
1011
|
+
while (skipWhitespace()) {
|
|
1012
|
+
ch = cookiesString.charAt(pos);
|
|
1013
|
+
if (ch === ",") {
|
|
1014
|
+
lastComma = pos;
|
|
1015
|
+
pos += 1;
|
|
1016
|
+
skipWhitespace();
|
|
1017
|
+
nextStart = pos;
|
|
1018
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
1019
|
+
pos += 1;
|
|
1020
|
+
}
|
|
1021
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
1022
|
+
cookiesSeparatorFound = true;
|
|
1023
|
+
pos = nextStart;
|
|
1024
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
1025
|
+
start = pos;
|
|
1026
|
+
} else {
|
|
1027
|
+
pos = lastComma + 1;
|
|
1028
|
+
}
|
|
1029
|
+
} else {
|
|
1030
|
+
pos += 1;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
1034
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
return cookiesStrings;
|
|
1038
|
+
}
|
|
1039
|
+
function toNodeOutgoingHttpHeaders(headers) {
|
|
1040
|
+
const nodeHeaders = {};
|
|
1041
|
+
const cookies = [];
|
|
1042
|
+
if (headers) {
|
|
1043
|
+
for (const [key, value] of headers.entries()) {
|
|
1044
|
+
if (key.toLowerCase() === "set-cookie") {
|
|
1045
|
+
cookies.push(...splitCookiesString(value));
|
|
1046
|
+
nodeHeaders[key] = cookies.length === 1 ? cookies[0] : cookies;
|
|
1047
|
+
} else {
|
|
1048
|
+
nodeHeaders[key] = value;
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
return nodeHeaders;
|
|
1053
|
+
}
|
|
1054
|
+
function validateURL(url) {
|
|
1055
|
+
try {
|
|
1056
|
+
return String(new URL(String(url)));
|
|
1057
|
+
} catch (error) {
|
|
1058
|
+
throw Object.defineProperty(new Error(`URL is malformed "${String(url)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
|
|
1059
|
+
cause: error
|
|
1060
|
+
}), "__NEXT_ERROR_CODE", {
|
|
1061
|
+
value: "E61",
|
|
1062
|
+
enumerable: false,
|
|
1063
|
+
configurable: true
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
function normalizeNextQueryParam(key) {
|
|
1068
|
+
const prefixes = [
|
|
1069
|
+
_constants.NEXT_QUERY_PARAM_PREFIX,
|
|
1070
|
+
_constants.NEXT_INTERCEPTION_MARKER_PREFIX
|
|
1071
|
+
];
|
|
1072
|
+
for (const prefix of prefixes) {
|
|
1073
|
+
if (key !== prefix && key.startsWith(prefix)) {
|
|
1074
|
+
return key.substring(prefix.length);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return null;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
// ../../node_modules/next/dist/server/web/error.js
|
|
1083
|
+
var require_error = __commonJS({
|
|
1084
|
+
"../../node_modules/next/dist/server/web/error.js"(exports) {
|
|
1085
|
+
"use strict";
|
|
1086
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1087
|
+
value: true
|
|
1088
|
+
});
|
|
1089
|
+
function _export(target, all) {
|
|
1090
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
1091
|
+
enumerable: true,
|
|
1092
|
+
get: all[name]
|
|
1093
|
+
});
|
|
1094
|
+
}
|
|
1095
|
+
_export(exports, {
|
|
1096
|
+
PageSignatureError: function() {
|
|
1097
|
+
return PageSignatureError;
|
|
1098
|
+
},
|
|
1099
|
+
RemovedPageError: function() {
|
|
1100
|
+
return RemovedPageError;
|
|
1101
|
+
},
|
|
1102
|
+
RemovedUAError: function() {
|
|
1103
|
+
return RemovedUAError;
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
var PageSignatureError = class extends Error {
|
|
1107
|
+
constructor({ page }) {
|
|
1108
|
+
super(`The middleware "${page}" accepts an async API directly with the form:
|
|
1109
|
+
|
|
1110
|
+
export function middleware(request, event) {
|
|
1111
|
+
return NextResponse.redirect('/new-location')
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
Read more: https://nextjs.org/docs/messages/middleware-new-signature
|
|
1115
|
+
`);
|
|
1116
|
+
}
|
|
1117
|
+
};
|
|
1118
|
+
var RemovedPageError = class extends Error {
|
|
1119
|
+
constructor() {
|
|
1120
|
+
super(`The request.page has been deprecated in favour of \`URLPattern\`.
|
|
1121
|
+
Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
1122
|
+
`);
|
|
1123
|
+
}
|
|
1124
|
+
};
|
|
1125
|
+
var RemovedUAError = class extends Error {
|
|
1126
|
+
constructor() {
|
|
1127
|
+
super(`The request.ua has been removed in favour of \`userAgent\` function.
|
|
1128
|
+
Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
1129
|
+
`);
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
1134
|
+
|
|
1135
|
+
// ../../node_modules/next/dist/compiled/@edge-runtime/cookies/index.js
|
|
1136
|
+
var require_cookies = __commonJS({
|
|
1137
|
+
"../../node_modules/next/dist/compiled/@edge-runtime/cookies/index.js"(exports, module) {
|
|
1138
|
+
"use strict";
|
|
1139
|
+
var __defProp = Object.defineProperty;
|
|
1140
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1141
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1142
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1143
|
+
var __export2 = (target, all) => {
|
|
1144
|
+
for (var name in all)
|
|
1145
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
1146
|
+
};
|
|
1147
|
+
var __copyProps = (to, from, except, desc) => {
|
|
1148
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
1149
|
+
for (let key of __getOwnPropNames(from))
|
|
1150
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
1151
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
1152
|
+
}
|
|
1153
|
+
return to;
|
|
1154
|
+
};
|
|
1155
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1156
|
+
var src_exports = {};
|
|
1157
|
+
__export2(src_exports, {
|
|
1158
|
+
RequestCookies: () => RequestCookies,
|
|
1159
|
+
ResponseCookies: () => ResponseCookies,
|
|
1160
|
+
parseCookie: () => parseCookie,
|
|
1161
|
+
parseSetCookie: () => parseSetCookie,
|
|
1162
|
+
stringifyCookie: () => stringifyCookie
|
|
1163
|
+
});
|
|
1164
|
+
module.exports = __toCommonJS(src_exports);
|
|
1165
|
+
function stringifyCookie(c) {
|
|
1166
|
+
var _a;
|
|
1167
|
+
const attrs = [
|
|
1168
|
+
"path" in c && c.path && `Path=${c.path}`,
|
|
1169
|
+
"expires" in c && (c.expires || c.expires === 0) && `Expires=${(typeof c.expires === "number" ? new Date(c.expires) : c.expires).toUTCString()}`,
|
|
1170
|
+
"maxAge" in c && typeof c.maxAge === "number" && `Max-Age=${c.maxAge}`,
|
|
1171
|
+
"domain" in c && c.domain && `Domain=${c.domain}`,
|
|
1172
|
+
"secure" in c && c.secure && "Secure",
|
|
1173
|
+
"httpOnly" in c && c.httpOnly && "HttpOnly",
|
|
1174
|
+
"sameSite" in c && c.sameSite && `SameSite=${c.sameSite}`,
|
|
1175
|
+
"partitioned" in c && c.partitioned && "Partitioned",
|
|
1176
|
+
"priority" in c && c.priority && `Priority=${c.priority}`
|
|
1177
|
+
].filter(Boolean);
|
|
1178
|
+
const stringified = `${c.name}=${encodeURIComponent((_a = c.value) != null ? _a : "")}`;
|
|
1179
|
+
return attrs.length === 0 ? stringified : `${stringified}; ${attrs.join("; ")}`;
|
|
1180
|
+
}
|
|
1181
|
+
function parseCookie(cookie) {
|
|
1182
|
+
const map = /* @__PURE__ */ new Map();
|
|
1183
|
+
for (const pair of cookie.split(/; */)) {
|
|
1184
|
+
if (!pair)
|
|
1185
|
+
continue;
|
|
1186
|
+
const splitAt = pair.indexOf("=");
|
|
1187
|
+
if (splitAt === -1) {
|
|
1188
|
+
map.set(pair, "true");
|
|
1189
|
+
continue;
|
|
1190
|
+
}
|
|
1191
|
+
const [key, value] = [pair.slice(0, splitAt), pair.slice(splitAt + 1)];
|
|
1192
|
+
try {
|
|
1193
|
+
map.set(key, decodeURIComponent(value != null ? value : "true"));
|
|
1194
|
+
} catch {
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
return map;
|
|
1198
|
+
}
|
|
1199
|
+
function parseSetCookie(setCookie) {
|
|
1200
|
+
if (!setCookie) {
|
|
1201
|
+
return void 0;
|
|
1202
|
+
}
|
|
1203
|
+
const [[name, value], ...attributes] = parseCookie(setCookie);
|
|
1204
|
+
const {
|
|
1205
|
+
domain,
|
|
1206
|
+
expires,
|
|
1207
|
+
httponly,
|
|
1208
|
+
maxage,
|
|
1209
|
+
path,
|
|
1210
|
+
samesite,
|
|
1211
|
+
secure,
|
|
1212
|
+
partitioned,
|
|
1213
|
+
priority
|
|
1214
|
+
} = Object.fromEntries(
|
|
1215
|
+
attributes.map(([key, value2]) => [
|
|
1216
|
+
key.toLowerCase().replace(/-/g, ""),
|
|
1217
|
+
value2
|
|
1218
|
+
])
|
|
1219
|
+
);
|
|
1220
|
+
const cookie = {
|
|
1221
|
+
name,
|
|
1222
|
+
value: decodeURIComponent(value),
|
|
1223
|
+
domain,
|
|
1224
|
+
...expires && { expires: new Date(expires) },
|
|
1225
|
+
...httponly && { httpOnly: true },
|
|
1226
|
+
...typeof maxage === "string" && { maxAge: Number(maxage) },
|
|
1227
|
+
path,
|
|
1228
|
+
...samesite && { sameSite: parseSameSite(samesite) },
|
|
1229
|
+
...secure && { secure: true },
|
|
1230
|
+
...priority && { priority: parsePriority(priority) },
|
|
1231
|
+
...partitioned && { partitioned: true }
|
|
1232
|
+
};
|
|
1233
|
+
return compact(cookie);
|
|
1234
|
+
}
|
|
1235
|
+
function compact(t) {
|
|
1236
|
+
const newT = {};
|
|
1237
|
+
for (const key in t) {
|
|
1238
|
+
if (t[key]) {
|
|
1239
|
+
newT[key] = t[key];
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
return newT;
|
|
1243
|
+
}
|
|
1244
|
+
var SAME_SITE = ["strict", "lax", "none"];
|
|
1245
|
+
function parseSameSite(string) {
|
|
1246
|
+
string = string.toLowerCase();
|
|
1247
|
+
return SAME_SITE.includes(string) ? string : void 0;
|
|
1248
|
+
}
|
|
1249
|
+
var PRIORITY = ["low", "medium", "high"];
|
|
1250
|
+
function parsePriority(string) {
|
|
1251
|
+
string = string.toLowerCase();
|
|
1252
|
+
return PRIORITY.includes(string) ? string : void 0;
|
|
1253
|
+
}
|
|
1254
|
+
function splitCookiesString(cookiesString) {
|
|
1255
|
+
if (!cookiesString)
|
|
1256
|
+
return [];
|
|
1257
|
+
var cookiesStrings = [];
|
|
1258
|
+
var pos = 0;
|
|
1259
|
+
var start;
|
|
1260
|
+
var ch;
|
|
1261
|
+
var lastComma;
|
|
1262
|
+
var nextStart;
|
|
1263
|
+
var cookiesSeparatorFound;
|
|
1264
|
+
function skipWhitespace() {
|
|
1265
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
1266
|
+
pos += 1;
|
|
1267
|
+
}
|
|
1268
|
+
return pos < cookiesString.length;
|
|
1269
|
+
}
|
|
1270
|
+
function notSpecialChar() {
|
|
1271
|
+
ch = cookiesString.charAt(pos);
|
|
1272
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
1273
|
+
}
|
|
1274
|
+
while (pos < cookiesString.length) {
|
|
1275
|
+
start = pos;
|
|
1276
|
+
cookiesSeparatorFound = false;
|
|
1277
|
+
while (skipWhitespace()) {
|
|
1278
|
+
ch = cookiesString.charAt(pos);
|
|
1279
|
+
if (ch === ",") {
|
|
1280
|
+
lastComma = pos;
|
|
1281
|
+
pos += 1;
|
|
1282
|
+
skipWhitespace();
|
|
1283
|
+
nextStart = pos;
|
|
1284
|
+
while (pos < cookiesString.length && notSpecialChar()) {
|
|
1285
|
+
pos += 1;
|
|
1286
|
+
}
|
|
1287
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
1288
|
+
cookiesSeparatorFound = true;
|
|
1289
|
+
pos = nextStart;
|
|
1290
|
+
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
1291
|
+
start = pos;
|
|
1292
|
+
} else {
|
|
1293
|
+
pos = lastComma + 1;
|
|
1294
|
+
}
|
|
1295
|
+
} else {
|
|
1296
|
+
pos += 1;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
1300
|
+
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
return cookiesStrings;
|
|
1304
|
+
}
|
|
1305
|
+
var RequestCookies = class {
|
|
1306
|
+
constructor(requestHeaders) {
|
|
1307
|
+
this._parsed = /* @__PURE__ */ new Map();
|
|
1308
|
+
this._headers = requestHeaders;
|
|
1309
|
+
const header = requestHeaders.get("cookie");
|
|
1310
|
+
if (header) {
|
|
1311
|
+
const parsed = parseCookie(header);
|
|
1312
|
+
for (const [name, value] of parsed) {
|
|
1313
|
+
this._parsed.set(name, { name, value });
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
[Symbol.iterator]() {
|
|
1318
|
+
return this._parsed[Symbol.iterator]();
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* The amount of cookies received from the client
|
|
1322
|
+
*/
|
|
1323
|
+
get size() {
|
|
1324
|
+
return this._parsed.size;
|
|
1325
|
+
}
|
|
1326
|
+
get(...args) {
|
|
1327
|
+
const name = typeof args[0] === "string" ? args[0] : args[0].name;
|
|
1328
|
+
return this._parsed.get(name);
|
|
1329
|
+
}
|
|
1330
|
+
getAll(...args) {
|
|
1331
|
+
var _a;
|
|
1332
|
+
const all = Array.from(this._parsed);
|
|
1333
|
+
if (!args.length) {
|
|
1334
|
+
return all.map(([_, value]) => value);
|
|
1335
|
+
}
|
|
1336
|
+
const name = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;
|
|
1337
|
+
return all.filter(([n]) => n === name).map(([_, value]) => value);
|
|
1338
|
+
}
|
|
1339
|
+
has(name) {
|
|
1340
|
+
return this._parsed.has(name);
|
|
1341
|
+
}
|
|
1342
|
+
set(...args) {
|
|
1343
|
+
const [name, value] = args.length === 1 ? [args[0].name, args[0].value] : args;
|
|
1344
|
+
const map = this._parsed;
|
|
1345
|
+
map.set(name, { name, value });
|
|
1346
|
+
this._headers.set(
|
|
1347
|
+
"cookie",
|
|
1348
|
+
Array.from(map).map(([_, value2]) => stringifyCookie(value2)).join("; ")
|
|
1349
|
+
);
|
|
1350
|
+
return this;
|
|
1351
|
+
}
|
|
1352
|
+
/**
|
|
1353
|
+
* Delete the cookies matching the passed name or names in the request.
|
|
1354
|
+
*/
|
|
1355
|
+
delete(names) {
|
|
1356
|
+
const map = this._parsed;
|
|
1357
|
+
const result = !Array.isArray(names) ? map.delete(names) : names.map((name) => map.delete(name));
|
|
1358
|
+
this._headers.set(
|
|
1359
|
+
"cookie",
|
|
1360
|
+
Array.from(map).map(([_, value]) => stringifyCookie(value)).join("; ")
|
|
1361
|
+
);
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
/**
|
|
1365
|
+
* Delete all the cookies in the cookies in the request.
|
|
1366
|
+
*/
|
|
1367
|
+
clear() {
|
|
1368
|
+
this.delete(Array.from(this._parsed.keys()));
|
|
1369
|
+
return this;
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Format the cookies in the request as a string for logging
|
|
1373
|
+
*/
|
|
1374
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1375
|
+
return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
1376
|
+
}
|
|
1377
|
+
toString() {
|
|
1378
|
+
return [...this._parsed.values()].map((v) => `${v.name}=${encodeURIComponent(v.value)}`).join("; ");
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
var ResponseCookies = class {
|
|
1382
|
+
constructor(responseHeaders) {
|
|
1383
|
+
this._parsed = /* @__PURE__ */ new Map();
|
|
1384
|
+
var _a, _b, _c;
|
|
1385
|
+
this._headers = responseHeaders;
|
|
1386
|
+
const setCookie = (_c = (_b = (_a = responseHeaders.getSetCookie) == null ? void 0 : _a.call(responseHeaders)) != null ? _b : responseHeaders.get("set-cookie")) != null ? _c : [];
|
|
1387
|
+
const cookieStrings = Array.isArray(setCookie) ? setCookie : splitCookiesString(setCookie);
|
|
1388
|
+
for (const cookieString of cookieStrings) {
|
|
1389
|
+
const parsed = parseSetCookie(cookieString);
|
|
1390
|
+
if (parsed)
|
|
1391
|
+
this._parsed.set(parsed.name, parsed);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
|
1396
|
+
*/
|
|
1397
|
+
get(...args) {
|
|
1398
|
+
const key = typeof args[0] === "string" ? args[0] : args[0].name;
|
|
1399
|
+
return this._parsed.get(key);
|
|
1400
|
+
}
|
|
1401
|
+
/**
|
|
1402
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
|
1403
|
+
*/
|
|
1404
|
+
getAll(...args) {
|
|
1405
|
+
var _a;
|
|
1406
|
+
const all = Array.from(this._parsed.values());
|
|
1407
|
+
if (!args.length) {
|
|
1408
|
+
return all;
|
|
1409
|
+
}
|
|
1410
|
+
const key = typeof args[0] === "string" ? args[0] : (_a = args[0]) == null ? void 0 : _a.name;
|
|
1411
|
+
return all.filter((c) => c.name === key);
|
|
1412
|
+
}
|
|
1413
|
+
has(name) {
|
|
1414
|
+
return this._parsed.has(name);
|
|
1415
|
+
}
|
|
1416
|
+
/**
|
|
1417
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
|
1418
|
+
*/
|
|
1419
|
+
set(...args) {
|
|
1420
|
+
const [name, value, cookie] = args.length === 1 ? [args[0].name, args[0].value, args[0]] : args;
|
|
1421
|
+
const map = this._parsed;
|
|
1422
|
+
map.set(name, normalizeCookie({ name, value, ...cookie }));
|
|
1423
|
+
replace(map, this._headers);
|
|
1424
|
+
return this;
|
|
1425
|
+
}
|
|
1426
|
+
/**
|
|
1427
|
+
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
|
1428
|
+
*/
|
|
1429
|
+
delete(...args) {
|
|
1430
|
+
const [name, options] = typeof args[0] === "string" ? [args[0]] : [args[0].name, args[0]];
|
|
1431
|
+
return this.set({ ...options, name, value: "", expires: /* @__PURE__ */ new Date(0) });
|
|
1432
|
+
}
|
|
1433
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1434
|
+
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
|
1435
|
+
}
|
|
1436
|
+
toString() {
|
|
1437
|
+
return [...this._parsed.values()].map(stringifyCookie).join("; ");
|
|
1438
|
+
}
|
|
1439
|
+
};
|
|
1440
|
+
function replace(bag, headers) {
|
|
1441
|
+
headers.delete("set-cookie");
|
|
1442
|
+
for (const [, value] of bag) {
|
|
1443
|
+
const serialized = stringifyCookie(value);
|
|
1444
|
+
headers.append("set-cookie", serialized);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
function normalizeCookie(cookie = { name: "", value: "" }) {
|
|
1448
|
+
if (typeof cookie.expires === "number") {
|
|
1449
|
+
cookie.expires = new Date(cookie.expires);
|
|
1450
|
+
}
|
|
1451
|
+
if (cookie.maxAge) {
|
|
1452
|
+
cookie.expires = new Date(Date.now() + cookie.maxAge * 1e3);
|
|
1453
|
+
}
|
|
1454
|
+
if (cookie.path === null || cookie.path === void 0) {
|
|
1455
|
+
cookie.path = "/";
|
|
1456
|
+
}
|
|
1457
|
+
return cookie;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
|
|
1462
|
+
// ../../node_modules/next/dist/server/web/spec-extension/cookies.js
|
|
1463
|
+
var require_cookies2 = __commonJS({
|
|
1464
|
+
"../../node_modules/next/dist/server/web/spec-extension/cookies.js"(exports) {
|
|
1465
|
+
"use strict";
|
|
1466
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1467
|
+
value: true
|
|
1468
|
+
});
|
|
1469
|
+
function _export(target, all) {
|
|
1470
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
1471
|
+
enumerable: true,
|
|
1472
|
+
get: all[name]
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
_export(exports, {
|
|
1476
|
+
RequestCookies: function() {
|
|
1477
|
+
return _cookies.RequestCookies;
|
|
1478
|
+
},
|
|
1479
|
+
ResponseCookies: function() {
|
|
1480
|
+
return _cookies.ResponseCookies;
|
|
1481
|
+
},
|
|
1482
|
+
stringifyCookie: function() {
|
|
1483
|
+
return _cookies.stringifyCookie;
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
var _cookies = require_cookies();
|
|
1487
|
+
}
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
// ../../node_modules/next/dist/server/web/spec-extension/request.js
|
|
1491
|
+
var require_request = __commonJS({
|
|
1492
|
+
"../../node_modules/next/dist/server/web/spec-extension/request.js"(exports) {
|
|
1493
|
+
"use strict";
|
|
1494
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1495
|
+
value: true
|
|
1496
|
+
});
|
|
1497
|
+
function _export(target, all) {
|
|
1498
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
1499
|
+
enumerable: true,
|
|
1500
|
+
get: all[name]
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
_export(exports, {
|
|
1504
|
+
INTERNALS: function() {
|
|
1505
|
+
return INTERNALS;
|
|
1506
|
+
},
|
|
1507
|
+
NextRequest: function() {
|
|
1508
|
+
return NextRequest2;
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
var _nexturl = require_next_url();
|
|
1512
|
+
var _utils = require_utils();
|
|
1513
|
+
var _error = require_error();
|
|
1514
|
+
var _cookies = require_cookies2();
|
|
1515
|
+
var INTERNALS = /* @__PURE__ */ Symbol("internal request");
|
|
1516
|
+
var NextRequest2 = class extends Request {
|
|
1517
|
+
constructor(input, init = {}) {
|
|
1518
|
+
const url = typeof input !== "string" && "url" in input ? input.url : String(input);
|
|
1519
|
+
(0, _utils.validateURL)(url);
|
|
1520
|
+
if (process.env.NEXT_RUNTIME !== "edge") {
|
|
1521
|
+
if (init.body && init.duplex !== "half") {
|
|
1522
|
+
init.duplex = "half";
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
if (input instanceof Request) super(input, init);
|
|
1526
|
+
else super(url, init);
|
|
1527
|
+
const nextUrl = new _nexturl.NextURL(url, {
|
|
1528
|
+
headers: (0, _utils.toNodeOutgoingHttpHeaders)(this.headers),
|
|
1529
|
+
nextConfig: init.nextConfig
|
|
1530
|
+
});
|
|
1531
|
+
this[INTERNALS] = {
|
|
1532
|
+
cookies: new _cookies.RequestCookies(this.headers),
|
|
1533
|
+
nextUrl,
|
|
1534
|
+
url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? url : nextUrl.toString()
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1538
|
+
return {
|
|
1539
|
+
cookies: this.cookies,
|
|
1540
|
+
nextUrl: this.nextUrl,
|
|
1541
|
+
url: this.url,
|
|
1542
|
+
// rest of props come from Request
|
|
1543
|
+
bodyUsed: this.bodyUsed,
|
|
1544
|
+
cache: this.cache,
|
|
1545
|
+
credentials: this.credentials,
|
|
1546
|
+
destination: this.destination,
|
|
1547
|
+
headers: Object.fromEntries(this.headers),
|
|
1548
|
+
integrity: this.integrity,
|
|
1549
|
+
keepalive: this.keepalive,
|
|
1550
|
+
method: this.method,
|
|
1551
|
+
mode: this.mode,
|
|
1552
|
+
redirect: this.redirect,
|
|
1553
|
+
referrer: this.referrer,
|
|
1554
|
+
referrerPolicy: this.referrerPolicy,
|
|
1555
|
+
signal: this.signal
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
get cookies() {
|
|
1559
|
+
return this[INTERNALS].cookies;
|
|
1560
|
+
}
|
|
1561
|
+
get nextUrl() {
|
|
1562
|
+
return this[INTERNALS].nextUrl;
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* @deprecated
|
|
1566
|
+
* `page` has been deprecated in favour of `URLPattern`.
|
|
1567
|
+
* Read more: https://nextjs.org/docs/messages/middleware-request-page
|
|
1568
|
+
*/
|
|
1569
|
+
get page() {
|
|
1570
|
+
throw new _error.RemovedPageError();
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* @deprecated
|
|
1574
|
+
* `ua` has been removed in favour of \`userAgent\` function.
|
|
1575
|
+
* Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
|
|
1576
|
+
*/
|
|
1577
|
+
get ua() {
|
|
1578
|
+
throw new _error.RemovedUAError();
|
|
1579
|
+
}
|
|
1580
|
+
get url() {
|
|
1581
|
+
return this[INTERNALS].url;
|
|
1582
|
+
}
|
|
1583
|
+
};
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1587
|
+
// ../../node_modules/next/dist/server/web/spec-extension/adapters/reflect.js
|
|
1588
|
+
var require_reflect = __commonJS({
|
|
1589
|
+
"../../node_modules/next/dist/server/web/spec-extension/adapters/reflect.js"(exports) {
|
|
1590
|
+
"use strict";
|
|
1591
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1592
|
+
value: true
|
|
1593
|
+
});
|
|
1594
|
+
Object.defineProperty(exports, "ReflectAdapter", {
|
|
1595
|
+
enumerable: true,
|
|
1596
|
+
get: function() {
|
|
1597
|
+
return ReflectAdapter;
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
var ReflectAdapter = class {
|
|
1601
|
+
static get(target, prop, receiver) {
|
|
1602
|
+
const value = Reflect.get(target, prop, receiver);
|
|
1603
|
+
if (typeof value === "function") {
|
|
1604
|
+
return value.bind(target);
|
|
1605
|
+
}
|
|
1606
|
+
return value;
|
|
1607
|
+
}
|
|
1608
|
+
static set(target, prop, value, receiver) {
|
|
1609
|
+
return Reflect.set(target, prop, value, receiver);
|
|
1610
|
+
}
|
|
1611
|
+
static has(target, prop) {
|
|
1612
|
+
return Reflect.has(target, prop);
|
|
1613
|
+
}
|
|
1614
|
+
static deleteProperty(target, prop) {
|
|
1615
|
+
return Reflect.deleteProperty(target, prop);
|
|
1616
|
+
}
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
|
|
1621
|
+
// ../../node_modules/next/dist/server/web/spec-extension/response.js
|
|
1622
|
+
var require_response = __commonJS({
|
|
1623
|
+
"../../node_modules/next/dist/server/web/spec-extension/response.js"(exports) {
|
|
1624
|
+
"use strict";
|
|
1625
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1626
|
+
value: true
|
|
1627
|
+
});
|
|
1628
|
+
Object.defineProperty(exports, "NextResponse", {
|
|
1629
|
+
enumerable: true,
|
|
1630
|
+
get: function() {
|
|
1631
|
+
return NextResponse2;
|
|
1632
|
+
}
|
|
1633
|
+
});
|
|
1634
|
+
var _cookies = require_cookies2();
|
|
1635
|
+
var _nexturl = require_next_url();
|
|
1636
|
+
var _utils = require_utils();
|
|
1637
|
+
var _reflect = require_reflect();
|
|
1638
|
+
var _cookies1 = require_cookies2();
|
|
1639
|
+
var INTERNALS = /* @__PURE__ */ Symbol("internal response");
|
|
1640
|
+
var REDIRECTS = /* @__PURE__ */ new Set([
|
|
1641
|
+
301,
|
|
1642
|
+
302,
|
|
1643
|
+
303,
|
|
1644
|
+
307,
|
|
1645
|
+
308
|
|
1646
|
+
]);
|
|
1647
|
+
function handleMiddlewareField(init, headers) {
|
|
1648
|
+
var _init_request;
|
|
1649
|
+
if (init == null ? void 0 : (_init_request = init.request) == null ? void 0 : _init_request.headers) {
|
|
1650
|
+
if (!(init.request.headers instanceof Headers)) {
|
|
1651
|
+
throw Object.defineProperty(new Error("request.headers must be an instance of Headers"), "__NEXT_ERROR_CODE", {
|
|
1652
|
+
value: "E119",
|
|
1653
|
+
enumerable: false,
|
|
1654
|
+
configurable: true
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
const keys = [];
|
|
1658
|
+
for (const [key, value] of init.request.headers) {
|
|
1659
|
+
headers.set("x-middleware-request-" + key, value);
|
|
1660
|
+
keys.push(key);
|
|
1661
|
+
}
|
|
1662
|
+
headers.set("x-middleware-override-headers", keys.join(","));
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
var NextResponse2 = class _NextResponse extends Response {
|
|
1666
|
+
constructor(body, init = {}) {
|
|
1667
|
+
super(body, init);
|
|
1668
|
+
const headers = this.headers;
|
|
1669
|
+
const cookies = new _cookies1.ResponseCookies(headers);
|
|
1670
|
+
const cookiesProxy = new Proxy(cookies, {
|
|
1671
|
+
get(target, prop, receiver) {
|
|
1672
|
+
switch (prop) {
|
|
1673
|
+
case "delete":
|
|
1674
|
+
case "set": {
|
|
1675
|
+
return (...args) => {
|
|
1676
|
+
const result = Reflect.apply(target[prop], target, args);
|
|
1677
|
+
const newHeaders = new Headers(headers);
|
|
1678
|
+
if (result instanceof _cookies1.ResponseCookies) {
|
|
1679
|
+
headers.set("x-middleware-set-cookie", result.getAll().map((cookie) => (0, _cookies.stringifyCookie)(cookie)).join(","));
|
|
1680
|
+
}
|
|
1681
|
+
handleMiddlewareField(init, newHeaders);
|
|
1682
|
+
return result;
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
default:
|
|
1686
|
+
return _reflect.ReflectAdapter.get(target, prop, receiver);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
this[INTERNALS] = {
|
|
1691
|
+
cookies: cookiesProxy,
|
|
1692
|
+
url: init.url ? new _nexturl.NextURL(init.url, {
|
|
1693
|
+
headers: (0, _utils.toNodeOutgoingHttpHeaders)(headers),
|
|
1694
|
+
nextConfig: init.nextConfig
|
|
1695
|
+
}) : void 0
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
[/* @__PURE__ */ Symbol.for("edge-runtime.inspect.custom")]() {
|
|
1699
|
+
return {
|
|
1700
|
+
cookies: this.cookies,
|
|
1701
|
+
url: this.url,
|
|
1702
|
+
// rest of props come from Response
|
|
1703
|
+
body: this.body,
|
|
1704
|
+
bodyUsed: this.bodyUsed,
|
|
1705
|
+
headers: Object.fromEntries(this.headers),
|
|
1706
|
+
ok: this.ok,
|
|
1707
|
+
redirected: this.redirected,
|
|
1708
|
+
status: this.status,
|
|
1709
|
+
statusText: this.statusText,
|
|
1710
|
+
type: this.type
|
|
1711
|
+
};
|
|
1712
|
+
}
|
|
1713
|
+
get cookies() {
|
|
1714
|
+
return this[INTERNALS].cookies;
|
|
1715
|
+
}
|
|
1716
|
+
static json(body, init) {
|
|
1717
|
+
const response = Response.json(body, init);
|
|
1718
|
+
return new _NextResponse(response.body, response);
|
|
1719
|
+
}
|
|
1720
|
+
static redirect(url, init) {
|
|
1721
|
+
const status = typeof init === "number" ? init : (init == null ? void 0 : init.status) ?? 307;
|
|
1722
|
+
if (!REDIRECTS.has(status)) {
|
|
1723
|
+
throw Object.defineProperty(new RangeError('Failed to execute "redirect" on "response": Invalid status code'), "__NEXT_ERROR_CODE", {
|
|
1724
|
+
value: "E529",
|
|
1725
|
+
enumerable: false,
|
|
1726
|
+
configurable: true
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
const initObj = typeof init === "object" ? init : {};
|
|
1730
|
+
const headers = new Headers(initObj == null ? void 0 : initObj.headers);
|
|
1731
|
+
headers.set("Location", (0, _utils.validateURL)(url));
|
|
1732
|
+
return new _NextResponse(null, {
|
|
1733
|
+
...initObj,
|
|
1734
|
+
headers,
|
|
1735
|
+
status
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
static rewrite(destination, init) {
|
|
1739
|
+
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
1740
|
+
headers.set("x-middleware-rewrite", (0, _utils.validateURL)(destination));
|
|
1741
|
+
handleMiddlewareField(init, headers);
|
|
1742
|
+
return new _NextResponse(null, {
|
|
1743
|
+
...init,
|
|
1744
|
+
headers
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
static next(init) {
|
|
1748
|
+
const headers = new Headers(init == null ? void 0 : init.headers);
|
|
1749
|
+
headers.set("x-middleware-next", "1");
|
|
1750
|
+
handleMiddlewareField(init, headers);
|
|
1751
|
+
return new _NextResponse(null, {
|
|
1752
|
+
...init,
|
|
1753
|
+
headers
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
|
|
1760
|
+
// ../../node_modules/next/dist/server/web/spec-extension/image-response.js
|
|
1761
|
+
var require_image_response = __commonJS({
|
|
1762
|
+
"../../node_modules/next/dist/server/web/spec-extension/image-response.js"(exports) {
|
|
1763
|
+
"use strict";
|
|
1764
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1765
|
+
value: true
|
|
1766
|
+
});
|
|
1767
|
+
Object.defineProperty(exports, "ImageResponse", {
|
|
1768
|
+
enumerable: true,
|
|
1769
|
+
get: function() {
|
|
1770
|
+
return ImageResponse;
|
|
1771
|
+
}
|
|
1772
|
+
});
|
|
1773
|
+
function ImageResponse() {
|
|
1774
|
+
throw Object.defineProperty(new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead'), "__NEXT_ERROR_CODE", {
|
|
1775
|
+
value: "E183",
|
|
1776
|
+
enumerable: false,
|
|
1777
|
+
configurable: true
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
|
|
1783
|
+
// ../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js
|
|
1784
|
+
var require_ua_parser = __commonJS({
|
|
1785
|
+
"../../node_modules/next/dist/compiled/ua-parser-js/ua-parser.js"(exports, module) {
|
|
1786
|
+
"use strict";
|
|
1787
|
+
(() => {
|
|
1788
|
+
var i = { 226: function(i2, e2) {
|
|
1789
|
+
(function(o2, a) {
|
|
1790
|
+
"use strict";
|
|
1791
|
+
var r = "1.0.35", t = "", n = "?", s = "function", b = "undefined", w = "object", l = "string", d = "major", c = "model", u = "name", p = "type", m = "vendor", f = "version", h = "architecture", v = "console", g = "mobile", k = "tablet", x = "smarttv", _ = "wearable", y = "embedded", q = 350;
|
|
1792
|
+
var T = "Amazon", S = "Apple", z = "ASUS", N = "BlackBerry", A = "Browser", C = "Chrome", E = "Edge", O = "Firefox", U = "Google", j = "Huawei", P = "LG", R = "Microsoft", M = "Motorola", B = "Opera", V = "Samsung", D = "Sharp", I = "Sony", W = "Viera", F = "Xiaomi", G = "Zebra", H = "Facebook", L = "Chromium OS", Z = "Mac OS";
|
|
1793
|
+
var extend = function(i3, e3) {
|
|
1794
|
+
var o3 = {};
|
|
1795
|
+
for (var a2 in i3) {
|
|
1796
|
+
if (e3[a2] && e3[a2].length % 2 === 0) {
|
|
1797
|
+
o3[a2] = e3[a2].concat(i3[a2]);
|
|
1798
|
+
} else {
|
|
1799
|
+
o3[a2] = i3[a2];
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
return o3;
|
|
1803
|
+
}, enumerize = function(i3) {
|
|
1804
|
+
var e3 = {};
|
|
1805
|
+
for (var o3 = 0; o3 < i3.length; o3++) {
|
|
1806
|
+
e3[i3[o3].toUpperCase()] = i3[o3];
|
|
1807
|
+
}
|
|
1808
|
+
return e3;
|
|
1809
|
+
}, has = function(i3, e3) {
|
|
1810
|
+
return typeof i3 === l ? lowerize(e3).indexOf(lowerize(i3)) !== -1 : false;
|
|
1811
|
+
}, lowerize = function(i3) {
|
|
1812
|
+
return i3.toLowerCase();
|
|
1813
|
+
}, majorize = function(i3) {
|
|
1814
|
+
return typeof i3 === l ? i3.replace(/[^\d\.]/g, t).split(".")[0] : a;
|
|
1815
|
+
}, trim = function(i3, e3) {
|
|
1816
|
+
if (typeof i3 === l) {
|
|
1817
|
+
i3 = i3.replace(/^\s\s*/, t);
|
|
1818
|
+
return typeof e3 === b ? i3 : i3.substring(0, q);
|
|
1819
|
+
}
|
|
1820
|
+
};
|
|
1821
|
+
var rgxMapper = function(i3, e3) {
|
|
1822
|
+
var o3 = 0, r2, t2, n2, b2, l2, d2;
|
|
1823
|
+
while (o3 < e3.length && !l2) {
|
|
1824
|
+
var c2 = e3[o3], u2 = e3[o3 + 1];
|
|
1825
|
+
r2 = t2 = 0;
|
|
1826
|
+
while (r2 < c2.length && !l2) {
|
|
1827
|
+
if (!c2[r2]) {
|
|
1828
|
+
break;
|
|
1829
|
+
}
|
|
1830
|
+
l2 = c2[r2++].exec(i3);
|
|
1831
|
+
if (!!l2) {
|
|
1832
|
+
for (n2 = 0; n2 < u2.length; n2++) {
|
|
1833
|
+
d2 = l2[++t2];
|
|
1834
|
+
b2 = u2[n2];
|
|
1835
|
+
if (typeof b2 === w && b2.length > 0) {
|
|
1836
|
+
if (b2.length === 2) {
|
|
1837
|
+
if (typeof b2[1] == s) {
|
|
1838
|
+
this[b2[0]] = b2[1].call(this, d2);
|
|
1839
|
+
} else {
|
|
1840
|
+
this[b2[0]] = b2[1];
|
|
1841
|
+
}
|
|
1842
|
+
} else if (b2.length === 3) {
|
|
1843
|
+
if (typeof b2[1] === s && !(b2[1].exec && b2[1].test)) {
|
|
1844
|
+
this[b2[0]] = d2 ? b2[1].call(this, d2, b2[2]) : a;
|
|
1845
|
+
} else {
|
|
1846
|
+
this[b2[0]] = d2 ? d2.replace(b2[1], b2[2]) : a;
|
|
1847
|
+
}
|
|
1848
|
+
} else if (b2.length === 4) {
|
|
1849
|
+
this[b2[0]] = d2 ? b2[3].call(this, d2.replace(b2[1], b2[2])) : a;
|
|
1850
|
+
}
|
|
1851
|
+
} else {
|
|
1852
|
+
this[b2] = d2 ? d2 : a;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
o3 += 2;
|
|
1858
|
+
}
|
|
1859
|
+
}, strMapper = function(i3, e3) {
|
|
1860
|
+
for (var o3 in e3) {
|
|
1861
|
+
if (typeof e3[o3] === w && e3[o3].length > 0) {
|
|
1862
|
+
for (var r2 = 0; r2 < e3[o3].length; r2++) {
|
|
1863
|
+
if (has(e3[o3][r2], i3)) {
|
|
1864
|
+
return o3 === n ? a : o3;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
} else if (has(e3[o3], i3)) {
|
|
1868
|
+
return o3 === n ? a : o3;
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
return i3;
|
|
1872
|
+
};
|
|
1873
|
+
var $ = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, X = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" };
|
|
1874
|
+
var K = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [u, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [u, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [u, f], [/opios[\/ ]+([\w\.]+)/i], [f, [u, B + " Mini"]], [/\bopr\/([\w\.]+)/i], [f, [u, B]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [u, f], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [f, [u, "UC" + A]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i], [f, [u, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [u, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [u, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [f, [u, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [f, [u, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[u, /(.+)/, "$1 Secure " + A], f], [/\bfocus\/([\w\.]+)/i], [f, [u, O + " Focus"]], [/\bopt\/([\w\.]+)/i], [f, [u, B + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [f, [u, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [u, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [u, B + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [f, [u, "MIUI " + A]], [/fxios\/([-\w\.]+)/i], [f, [u, O]], [/\bqihu|(qi?ho?o?|360)browser/i], [[u, "360 " + A]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[u, /(.+)/, "$1 " + A], f], [/(comodo_dragon)\/([\w\.]+)/i], [[u, /_/g, " "], f], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i], [u, f], [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i], [u], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[u, H], f], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i], [u, f], [/\bgsa\/([\w\.]+) .*safari\//i], [f, [u, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [f, [u, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [f, [u, C + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[u, C + " WebView"], f], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [f, [u, "Android " + A]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [u, f], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i], [f, [u, "Mobile Safari"]], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i], [f, u], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [u, [f, strMapper, $]], [/(webkit|khtml)\/([\w\.]+)/i], [u, f], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[u, "Netscape"], f], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [f, [u, O + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i], [u, f], [/(cobalt)\/([\w\.]+)/i], [u, [f, /master.|lts./, ""]]], cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i], [[h, "amd64"]], [/(ia32(?=;))/i], [[h, lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[h, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[h, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[h, "armhf"]], [/windows (ce|mobile); ppc;/i], [[h, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[h, /ower/, t, lowerize]], [/(sun4\w)[;\)]/i], [[h, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[h, lowerize]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [c, [m, V], [p, k]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [c, [m, V], [p, g]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [c, [m, S], [p, g]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [c, [m, S], [p, k]], [/(macintosh);/i], [c, [m, S]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [c, [m, D], [p, g]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [c, [m, j], [p, k]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [c, [m, j], [p, g]], [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i], [[c, /_/g, " "], [m, F], [p, g]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[c, /_/g, " "], [m, F], [p, k]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [c, [m, "OPPO"], [p, g]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [c, [m, "Vivo"], [p, g]], [/\b(rmx[12]\d{3})(?: bui|;|\))/i], [c, [m, "Realme"], [p, g]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [c, [m, M], [p, g]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [c, [m, M], [p, k]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [c, [m, P], [p, k]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [c, [m, P], [p, g]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [c, [m, "Lenovo"], [p, k]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[c, /_/g, " "], [m, "Nokia"], [p, g]], [/(pixel c)\b/i], [c, [m, U], [p, k]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [c, [m, U], [p, g]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [c, [m, I], [p, g]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[c, "Xperia Tablet"], [m, I], [p, k]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [c, [m, "OnePlus"], [p, g]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [c, [m, T], [p, k]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[c, /(.+)/g, "Fire Phone $1"], [m, T], [p, g]], [/(playbook);[-\w\),; ]+(rim)/i], [c, m, [p, k]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [c, [m, N], [p, g]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [c, [m, z], [p, k]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [c, [m, z], [p, g]], [/(nexus 9)/i], [c, [m, "HTC"], [p, k]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [m, [c, /_/g, " "], [p, g]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [c, [m, "Acer"], [p, k]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [c, [m, "Meizu"], [p, g]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [m, c, [p, g]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i], [m, c, [p, k]], [/(surface duo)/i], [c, [m, R], [p, k]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [c, [m, "Fairphone"], [p, g]], [/(u304aa)/i], [c, [m, "AT&T"], [p, g]], [/\bsie-(\w*)/i], [c, [m, "Siemens"], [p, g]], [/\b(rct\w+) b/i], [c, [m, "RCA"], [p, k]], [/\b(venue[\d ]{2,7}) b/i], [c, [m, "Dell"], [p, k]], [/\b(q(?:mv|ta)\w+) b/i], [c, [m, "Verizon"], [p, k]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i], [c, [m, "Barnes & Noble"], [p, k]], [/\b(tm\d{3}\w+) b/i], [c, [m, "NuVision"], [p, k]], [/\b(k88) b/i], [c, [m, "ZTE"], [p, k]], [/\b(nx\d{3}j) b/i], [c, [m, "ZTE"], [p, g]], [/\b(gen\d{3}) b.+49h/i], [c, [m, "Swiss"], [p, g]], [/\b(zur\d{3}) b/i], [c, [m, "Swiss"], [p, k]], [/\b((zeki)?tb.*\b) b/i], [c, [m, "Zeki"], [p, k]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i], [[m, "Dragon Touch"], c, [p, k]], [/\b(ns-?\w{0,9}) b/i], [c, [m, "Insignia"], [p, k]], [/\b((nxa|next)-?\w{0,9}) b/i], [c, [m, "NextBook"], [p, k]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i], [[m, "Voice"], c, [p, g]], [/\b(lvtel\-)?(v1[12]) b/i], [[m, "LvTel"], c, [p, g]], [/\b(ph-1) /i], [c, [m, "Essential"], [p, g]], [/\b(v(100md|700na|7011|917g).*\b) b/i], [c, [m, "Envizen"], [p, k]], [/\b(trio[-\w\. ]+) b/i], [c, [m, "MachSpeed"], [p, k]], [/\btu_(1491) b/i], [c, [m, "Rotor"], [p, k]], [/(shield[\w ]+) b/i], [c, [m, "Nvidia"], [p, k]], [/(sprint) (\w+)/i], [m, c, [p, g]], [/(kin\.[onetw]{3})/i], [[c, /\./g, " "], [m, R], [p, g]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [c, [m, G], [p, k]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [c, [m, G], [p, g]], [/smart-tv.+(samsung)/i], [m, [p, x]], [/hbbtv.+maple;(\d+)/i], [[c, /^/, "SmartTV"], [m, V], [p, x]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[m, P], [p, x]], [/(apple) ?tv/i], [m, [c, S + " TV"], [p, x]], [/crkey/i], [[c, C + "cast"], [m, U], [p, x]], [/droid.+aft(\w)( bui|\))/i], [c, [m, T], [p, x]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [c, [m, D], [p, x]], [/(bravia[\w ]+)( bui|\))/i], [c, [m, I], [p, x]], [/(mitv-\w{5}) bui/i], [c, [m, F], [p, x]], [/Hbbtv.*(technisat) (.*);/i], [m, c, [p, x]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[m, trim], [c, trim], [p, x]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[p, x]], [/(ouya)/i, /(nintendo) ([wids3utch]+)/i], [m, c, [p, v]], [/droid.+; (shield) bui/i], [c, [m, "Nvidia"], [p, v]], [/(playstation [345portablevi]+)/i], [c, [m, I], [p, v]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [c, [m, R], [p, v]], [/((pebble))app/i], [m, c, [p, _]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [c, [m, S], [p, _]], [/droid.+; (glass) \d/i], [c, [m, U], [p, _]], [/droid.+; (wt63?0{2,3})\)/i], [c, [m, G], [p, _]], [/(quest( 2| pro)?)/i], [c, [m, H], [p, _]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [m, [p, y]], [/(aeobc)\b/i], [c, [m, T], [p, y]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i], [c, [p, g]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [c, [p, k]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[p, k]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[p, g]], [/(android[-\w\. ]{0,9});.+buil/i], [c, [m, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [f, [u, E + "HTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [u, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [u, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, u]], os: [[/microsoft (windows) (vista|xp)/i], [u, f], [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [u, [f, strMapper, X]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[u, "Windows"], [f, strMapper, X]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [u, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[u, Z], [f, /_/g, "."]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [f, u], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [u, f], [/\(bb(10);/i], [f, [u, N]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [f, [u, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [f, [u, O + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [u, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [f, [u, "watchOS"]], [/crkey\/([\d\.]+)/i], [f, [u, C + "cast"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[u, L], f], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [u, f], [/(sunos) ?([\w\.\d]*)/i], [[u, "Solaris"], f], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [u, f]] };
|
|
1875
|
+
var UAParser = function(i3, e3) {
|
|
1876
|
+
if (typeof i3 === w) {
|
|
1877
|
+
e3 = i3;
|
|
1878
|
+
i3 = a;
|
|
1879
|
+
}
|
|
1880
|
+
if (!(this instanceof UAParser)) {
|
|
1881
|
+
return new UAParser(i3, e3).getResult();
|
|
1882
|
+
}
|
|
1883
|
+
var r2 = typeof o2 !== b && o2.navigator ? o2.navigator : a;
|
|
1884
|
+
var n2 = i3 || (r2 && r2.userAgent ? r2.userAgent : t);
|
|
1885
|
+
var v2 = r2 && r2.userAgentData ? r2.userAgentData : a;
|
|
1886
|
+
var x2 = e3 ? extend(K, e3) : K;
|
|
1887
|
+
var _2 = r2 && r2.userAgent == n2;
|
|
1888
|
+
this.getBrowser = function() {
|
|
1889
|
+
var i4 = {};
|
|
1890
|
+
i4[u] = a;
|
|
1891
|
+
i4[f] = a;
|
|
1892
|
+
rgxMapper.call(i4, n2, x2.browser);
|
|
1893
|
+
i4[d] = majorize(i4[f]);
|
|
1894
|
+
if (_2 && r2 && r2.brave && typeof r2.brave.isBrave == s) {
|
|
1895
|
+
i4[u] = "Brave";
|
|
1896
|
+
}
|
|
1897
|
+
return i4;
|
|
1898
|
+
};
|
|
1899
|
+
this.getCPU = function() {
|
|
1900
|
+
var i4 = {};
|
|
1901
|
+
i4[h] = a;
|
|
1902
|
+
rgxMapper.call(i4, n2, x2.cpu);
|
|
1903
|
+
return i4;
|
|
1904
|
+
};
|
|
1905
|
+
this.getDevice = function() {
|
|
1906
|
+
var i4 = {};
|
|
1907
|
+
i4[m] = a;
|
|
1908
|
+
i4[c] = a;
|
|
1909
|
+
i4[p] = a;
|
|
1910
|
+
rgxMapper.call(i4, n2, x2.device);
|
|
1911
|
+
if (_2 && !i4[p] && v2 && v2.mobile) {
|
|
1912
|
+
i4[p] = g;
|
|
1913
|
+
}
|
|
1914
|
+
if (_2 && i4[c] == "Macintosh" && r2 && typeof r2.standalone !== b && r2.maxTouchPoints && r2.maxTouchPoints > 2) {
|
|
1915
|
+
i4[c] = "iPad";
|
|
1916
|
+
i4[p] = k;
|
|
1917
|
+
}
|
|
1918
|
+
return i4;
|
|
1919
|
+
};
|
|
1920
|
+
this.getEngine = function() {
|
|
1921
|
+
var i4 = {};
|
|
1922
|
+
i4[u] = a;
|
|
1923
|
+
i4[f] = a;
|
|
1924
|
+
rgxMapper.call(i4, n2, x2.engine);
|
|
1925
|
+
return i4;
|
|
1926
|
+
};
|
|
1927
|
+
this.getOS = function() {
|
|
1928
|
+
var i4 = {};
|
|
1929
|
+
i4[u] = a;
|
|
1930
|
+
i4[f] = a;
|
|
1931
|
+
rgxMapper.call(i4, n2, x2.os);
|
|
1932
|
+
if (_2 && !i4[u] && v2 && v2.platform != "Unknown") {
|
|
1933
|
+
i4[u] = v2.platform.replace(/chrome os/i, L).replace(/macos/i, Z);
|
|
1934
|
+
}
|
|
1935
|
+
return i4;
|
|
1936
|
+
};
|
|
1937
|
+
this.getResult = function() {
|
|
1938
|
+
return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
|
|
1939
|
+
};
|
|
1940
|
+
this.getUA = function() {
|
|
1941
|
+
return n2;
|
|
1942
|
+
};
|
|
1943
|
+
this.setUA = function(i4) {
|
|
1944
|
+
n2 = typeof i4 === l && i4.length > q ? trim(i4, q) : i4;
|
|
1945
|
+
return this;
|
|
1946
|
+
};
|
|
1947
|
+
this.setUA(n2);
|
|
1948
|
+
return this;
|
|
1949
|
+
};
|
|
1950
|
+
UAParser.VERSION = r;
|
|
1951
|
+
UAParser.BROWSER = enumerize([u, f, d]);
|
|
1952
|
+
UAParser.CPU = enumerize([h]);
|
|
1953
|
+
UAParser.DEVICE = enumerize([c, m, p, v, g, x, k, _, y]);
|
|
1954
|
+
UAParser.ENGINE = UAParser.OS = enumerize([u, f]);
|
|
1955
|
+
if (typeof e2 !== b) {
|
|
1956
|
+
if ("object" !== b && i2.exports) {
|
|
1957
|
+
e2 = i2.exports = UAParser;
|
|
1958
|
+
}
|
|
1959
|
+
e2.UAParser = UAParser;
|
|
1960
|
+
} else {
|
|
1961
|
+
if (typeof define === s && define.amd) {
|
|
1962
|
+
define((function() {
|
|
1963
|
+
return UAParser;
|
|
1964
|
+
}));
|
|
1965
|
+
} else if (typeof o2 !== b) {
|
|
1966
|
+
o2.UAParser = UAParser;
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
var Q = typeof o2 !== b && (o2.jQuery || o2.Zepto);
|
|
1970
|
+
if (Q && !Q.ua) {
|
|
1971
|
+
var Y = new UAParser();
|
|
1972
|
+
Q.ua = Y.getResult();
|
|
1973
|
+
Q.ua.get = function() {
|
|
1974
|
+
return Y.getUA();
|
|
1975
|
+
};
|
|
1976
|
+
Q.ua.set = function(i3) {
|
|
1977
|
+
Y.setUA(i3);
|
|
1978
|
+
var e3 = Y.getResult();
|
|
1979
|
+
for (var o3 in e3) {
|
|
1980
|
+
Q.ua[o3] = e3[o3];
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
})(typeof window === "object" ? window : this);
|
|
1985
|
+
} };
|
|
1986
|
+
var e = {};
|
|
1987
|
+
function __nccwpck_require__(o2) {
|
|
1988
|
+
var a = e[o2];
|
|
1989
|
+
if (a !== void 0) {
|
|
1990
|
+
return a.exports;
|
|
1991
|
+
}
|
|
1992
|
+
var r = e[o2] = { exports: {} };
|
|
1993
|
+
var t = true;
|
|
1994
|
+
try {
|
|
1995
|
+
i[o2].call(r.exports, r, r.exports, __nccwpck_require__);
|
|
1996
|
+
t = false;
|
|
1997
|
+
} finally {
|
|
1998
|
+
if (t) delete e[o2];
|
|
1999
|
+
}
|
|
2000
|
+
return r.exports;
|
|
2001
|
+
}
|
|
2002
|
+
if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = __dirname + "/";
|
|
2003
|
+
var o = __nccwpck_require__(226);
|
|
2004
|
+
module.exports = o;
|
|
2005
|
+
})();
|
|
2006
|
+
}
|
|
2007
|
+
});
|
|
2008
|
+
|
|
2009
|
+
// ../../node_modules/next/dist/server/web/spec-extension/user-agent.js
|
|
2010
|
+
var require_user_agent = __commonJS({
|
|
2011
|
+
"../../node_modules/next/dist/server/web/spec-extension/user-agent.js"(exports) {
|
|
2012
|
+
"use strict";
|
|
2013
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2014
|
+
value: true
|
|
2015
|
+
});
|
|
2016
|
+
function _export(target, all) {
|
|
2017
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2018
|
+
enumerable: true,
|
|
2019
|
+
get: all[name]
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
_export(exports, {
|
|
2023
|
+
isBot: function() {
|
|
2024
|
+
return isBot;
|
|
2025
|
+
},
|
|
2026
|
+
userAgent: function() {
|
|
2027
|
+
return userAgent;
|
|
2028
|
+
},
|
|
2029
|
+
userAgentFromString: function() {
|
|
2030
|
+
return userAgentFromString;
|
|
2031
|
+
}
|
|
2032
|
+
});
|
|
2033
|
+
var _uaparserjs = /* @__PURE__ */ _interop_require_default(require_ua_parser());
|
|
2034
|
+
function _interop_require_default(obj) {
|
|
2035
|
+
return obj && obj.__esModule ? obj : {
|
|
2036
|
+
default: obj
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
function isBot(input) {
|
|
2040
|
+
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver|GPTBot/i.test(input);
|
|
2041
|
+
}
|
|
2042
|
+
function userAgentFromString(input) {
|
|
2043
|
+
return {
|
|
2044
|
+
...(0, _uaparserjs.default)(input),
|
|
2045
|
+
isBot: input === void 0 ? false : isBot(input)
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
function userAgent({ headers }) {
|
|
2049
|
+
return userAgentFromString(headers.get("user-agent") || void 0);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
|
|
2054
|
+
// ../../node_modules/next/dist/server/web/spec-extension/url-pattern.js
|
|
2055
|
+
var require_url_pattern = __commonJS({
|
|
2056
|
+
"../../node_modules/next/dist/server/web/spec-extension/url-pattern.js"(exports) {
|
|
2057
|
+
"use strict";
|
|
2058
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2059
|
+
value: true
|
|
2060
|
+
});
|
|
2061
|
+
Object.defineProperty(exports, "URLPattern", {
|
|
2062
|
+
enumerable: true,
|
|
2063
|
+
get: function() {
|
|
2064
|
+
return GlobalURLPattern;
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
var GlobalURLPattern = (
|
|
2068
|
+
// @ts-expect-error: URLPattern is not available in Node.js
|
|
2069
|
+
typeof URLPattern === "undefined" ? void 0 : URLPattern
|
|
2070
|
+
);
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
|
|
2074
|
+
// ../../node_modules/next/dist/server/app-render/async-local-storage.js
|
|
2075
|
+
var require_async_local_storage = __commonJS({
|
|
2076
|
+
"../../node_modules/next/dist/server/app-render/async-local-storage.js"(exports) {
|
|
2077
|
+
"use strict";
|
|
2078
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2079
|
+
value: true
|
|
2080
|
+
});
|
|
2081
|
+
function _export(target, all) {
|
|
2082
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2083
|
+
enumerable: true,
|
|
2084
|
+
get: all[name]
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
_export(exports, {
|
|
2088
|
+
bindSnapshot: function() {
|
|
2089
|
+
return bindSnapshot;
|
|
2090
|
+
},
|
|
2091
|
+
createAsyncLocalStorage: function() {
|
|
2092
|
+
return createAsyncLocalStorage;
|
|
2093
|
+
},
|
|
2094
|
+
createSnapshot: function() {
|
|
2095
|
+
return createSnapshot;
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
var sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"), "__NEXT_ERROR_CODE", {
|
|
2099
|
+
value: "E504",
|
|
2100
|
+
enumerable: false,
|
|
2101
|
+
configurable: true
|
|
2102
|
+
});
|
|
2103
|
+
var FakeAsyncLocalStorage = class {
|
|
2104
|
+
disable() {
|
|
2105
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
2106
|
+
}
|
|
2107
|
+
getStore() {
|
|
2108
|
+
return void 0;
|
|
2109
|
+
}
|
|
2110
|
+
run() {
|
|
2111
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
2112
|
+
}
|
|
2113
|
+
exit() {
|
|
2114
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
2115
|
+
}
|
|
2116
|
+
enterWith() {
|
|
2117
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
2118
|
+
}
|
|
2119
|
+
static bind(fn) {
|
|
2120
|
+
return fn;
|
|
2121
|
+
}
|
|
2122
|
+
};
|
|
2123
|
+
var maybeGlobalAsyncLocalStorage = typeof globalThis !== "undefined" && globalThis.AsyncLocalStorage;
|
|
2124
|
+
function createAsyncLocalStorage() {
|
|
2125
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
2126
|
+
return new maybeGlobalAsyncLocalStorage();
|
|
2127
|
+
}
|
|
2128
|
+
return new FakeAsyncLocalStorage();
|
|
2129
|
+
}
|
|
2130
|
+
function bindSnapshot(fn) {
|
|
2131
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
2132
|
+
return maybeGlobalAsyncLocalStorage.bind(fn);
|
|
2133
|
+
}
|
|
2134
|
+
return FakeAsyncLocalStorage.bind(fn);
|
|
2135
|
+
}
|
|
2136
|
+
function createSnapshot() {
|
|
2137
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
2138
|
+
return maybeGlobalAsyncLocalStorage.snapshot();
|
|
2139
|
+
}
|
|
2140
|
+
return function(fn, ...args) {
|
|
2141
|
+
return fn(...args);
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
});
|
|
2146
|
+
|
|
2147
|
+
// ../../node_modules/next/dist/server/app-render/work-async-storage-instance.js
|
|
2148
|
+
var require_work_async_storage_instance = __commonJS({
|
|
2149
|
+
"../../node_modules/next/dist/server/app-render/work-async-storage-instance.js"(exports) {
|
|
2150
|
+
"use strict";
|
|
2151
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2152
|
+
value: true
|
|
2153
|
+
});
|
|
2154
|
+
Object.defineProperty(exports, "workAsyncStorageInstance", {
|
|
2155
|
+
enumerable: true,
|
|
2156
|
+
get: function() {
|
|
2157
|
+
return workAsyncStorageInstance;
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2160
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
2161
|
+
var workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
2162
|
+
}
|
|
2163
|
+
});
|
|
2164
|
+
|
|
2165
|
+
// ../../node_modules/next/dist/server/app-render/work-async-storage.external.js
|
|
2166
|
+
var require_work_async_storage_external = __commonJS({
|
|
2167
|
+
"../../node_modules/next/dist/server/app-render/work-async-storage.external.js"(exports) {
|
|
2168
|
+
"use strict";
|
|
2169
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2170
|
+
value: true
|
|
2171
|
+
});
|
|
2172
|
+
Object.defineProperty(exports, "workAsyncStorage", {
|
|
2173
|
+
enumerable: true,
|
|
2174
|
+
get: function() {
|
|
2175
|
+
return _workasyncstorageinstance.workAsyncStorageInstance;
|
|
2176
|
+
}
|
|
2177
|
+
});
|
|
2178
|
+
var _workasyncstorageinstance = require_work_async_storage_instance();
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
|
|
2182
|
+
// ../../node_modules/next/dist/server/after/after.js
|
|
2183
|
+
var require_after = __commonJS({
|
|
2184
|
+
"../../node_modules/next/dist/server/after/after.js"(exports) {
|
|
2185
|
+
"use strict";
|
|
2186
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2187
|
+
value: true
|
|
2188
|
+
});
|
|
2189
|
+
Object.defineProperty(exports, "after", {
|
|
2190
|
+
enumerable: true,
|
|
2191
|
+
get: function() {
|
|
2192
|
+
return after;
|
|
2193
|
+
}
|
|
2194
|
+
});
|
|
2195
|
+
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
2196
|
+
function after(task) {
|
|
2197
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
2198
|
+
if (!workStore) {
|
|
2199
|
+
throw Object.defineProperty(new Error("`after` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context"), "__NEXT_ERROR_CODE", {
|
|
2200
|
+
value: "E468",
|
|
2201
|
+
enumerable: false,
|
|
2202
|
+
configurable: true
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
const { afterContext } = workStore;
|
|
2206
|
+
return afterContext.after(task);
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
});
|
|
2210
|
+
|
|
2211
|
+
// ../../node_modules/next/dist/server/after/index.js
|
|
2212
|
+
var require_after2 = __commonJS({
|
|
2213
|
+
"../../node_modules/next/dist/server/after/index.js"(exports) {
|
|
2214
|
+
"use strict";
|
|
2215
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2216
|
+
value: true
|
|
2217
|
+
});
|
|
2218
|
+
_export_star(require_after(), exports);
|
|
2219
|
+
function _export_star(from, to) {
|
|
2220
|
+
Object.keys(from).forEach(function(k) {
|
|
2221
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
2222
|
+
Object.defineProperty(to, k, {
|
|
2223
|
+
enumerable: true,
|
|
2224
|
+
get: function() {
|
|
2225
|
+
return from[k];
|
|
2226
|
+
}
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
});
|
|
2230
|
+
return from;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
});
|
|
2234
|
+
|
|
2235
|
+
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js
|
|
2236
|
+
var require_work_unit_async_storage_instance = __commonJS({
|
|
2237
|
+
"../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js"(exports) {
|
|
2238
|
+
"use strict";
|
|
2239
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2240
|
+
value: true
|
|
2241
|
+
});
|
|
2242
|
+
Object.defineProperty(exports, "workUnitAsyncStorageInstance", {
|
|
2243
|
+
enumerable: true,
|
|
2244
|
+
get: function() {
|
|
2245
|
+
return workUnitAsyncStorageInstance;
|
|
2246
|
+
}
|
|
2247
|
+
});
|
|
2248
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
2249
|
+
var workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
2250
|
+
}
|
|
2251
|
+
});
|
|
2252
|
+
|
|
2253
|
+
// ../../node_modules/next/dist/client/components/app-router-headers.js
|
|
2254
|
+
var require_app_router_headers = __commonJS({
|
|
2255
|
+
"../../node_modules/next/dist/client/components/app-router-headers.js"(exports, module) {
|
|
2256
|
+
"use strict";
|
|
2257
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2258
|
+
value: true
|
|
2259
|
+
});
|
|
2260
|
+
function _export(target, all) {
|
|
2261
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2262
|
+
enumerable: true,
|
|
2263
|
+
get: all[name]
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
_export(exports, {
|
|
2267
|
+
ACTION_HEADER: function() {
|
|
2268
|
+
return ACTION_HEADER;
|
|
2269
|
+
},
|
|
2270
|
+
FLIGHT_HEADERS: function() {
|
|
2271
|
+
return FLIGHT_HEADERS;
|
|
2272
|
+
},
|
|
2273
|
+
NEXT_ACTION_NOT_FOUND_HEADER: function() {
|
|
2274
|
+
return NEXT_ACTION_NOT_FOUND_HEADER;
|
|
2275
|
+
},
|
|
2276
|
+
NEXT_ACTION_REVALIDATED_HEADER: function() {
|
|
2277
|
+
return NEXT_ACTION_REVALIDATED_HEADER;
|
|
2278
|
+
},
|
|
2279
|
+
NEXT_DID_POSTPONE_HEADER: function() {
|
|
2280
|
+
return NEXT_DID_POSTPONE_HEADER;
|
|
2281
|
+
},
|
|
2282
|
+
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
2283
|
+
return NEXT_HMR_REFRESH_HASH_COOKIE;
|
|
2284
|
+
},
|
|
2285
|
+
NEXT_HMR_REFRESH_HEADER: function() {
|
|
2286
|
+
return NEXT_HMR_REFRESH_HEADER;
|
|
2287
|
+
},
|
|
2288
|
+
NEXT_HTML_REQUEST_ID_HEADER: function() {
|
|
2289
|
+
return NEXT_HTML_REQUEST_ID_HEADER;
|
|
2290
|
+
},
|
|
2291
|
+
NEXT_INSTANT_PREFETCH_HEADER: function() {
|
|
2292
|
+
return NEXT_INSTANT_PREFETCH_HEADER;
|
|
2293
|
+
},
|
|
2294
|
+
NEXT_INSTANT_TEST_COOKIE: function() {
|
|
2295
|
+
return NEXT_INSTANT_TEST_COOKIE;
|
|
2296
|
+
},
|
|
2297
|
+
NEXT_IS_PRERENDER_HEADER: function() {
|
|
2298
|
+
return NEXT_IS_PRERENDER_HEADER;
|
|
2299
|
+
},
|
|
2300
|
+
NEXT_REQUEST_ID_HEADER: function() {
|
|
2301
|
+
return NEXT_REQUEST_ID_HEADER;
|
|
2302
|
+
},
|
|
2303
|
+
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
2304
|
+
return NEXT_REWRITTEN_PATH_HEADER;
|
|
2305
|
+
},
|
|
2306
|
+
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
2307
|
+
return NEXT_REWRITTEN_QUERY_HEADER;
|
|
2308
|
+
},
|
|
2309
|
+
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
2310
|
+
return NEXT_ROUTER_PREFETCH_HEADER;
|
|
2311
|
+
},
|
|
2312
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
2313
|
+
return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
|
|
2314
|
+
},
|
|
2315
|
+
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
2316
|
+
return NEXT_ROUTER_STALE_TIME_HEADER;
|
|
2317
|
+
},
|
|
2318
|
+
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
2319
|
+
return NEXT_ROUTER_STATE_TREE_HEADER;
|
|
2320
|
+
},
|
|
2321
|
+
NEXT_RSC_UNION_QUERY: function() {
|
|
2322
|
+
return NEXT_RSC_UNION_QUERY;
|
|
2323
|
+
},
|
|
2324
|
+
NEXT_URL: function() {
|
|
2325
|
+
return NEXT_URL;
|
|
2326
|
+
},
|
|
2327
|
+
RSC_CONTENT_TYPE_HEADER: function() {
|
|
2328
|
+
return RSC_CONTENT_TYPE_HEADER;
|
|
2329
|
+
},
|
|
2330
|
+
RSC_HEADER: function() {
|
|
2331
|
+
return RSC_HEADER;
|
|
2332
|
+
}
|
|
2333
|
+
});
|
|
2334
|
+
var RSC_HEADER = "rsc";
|
|
2335
|
+
var ACTION_HEADER = "next-action";
|
|
2336
|
+
var NEXT_ROUTER_STATE_TREE_HEADER = "next-router-state-tree";
|
|
2337
|
+
var NEXT_ROUTER_PREFETCH_HEADER = "next-router-prefetch";
|
|
2338
|
+
var NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = "next-router-segment-prefetch";
|
|
2339
|
+
var NEXT_HMR_REFRESH_HEADER = "next-hmr-refresh";
|
|
2340
|
+
var NEXT_HMR_REFRESH_HASH_COOKIE = "__next_hmr_refresh_hash__";
|
|
2341
|
+
var NEXT_URL = "next-url";
|
|
2342
|
+
var RSC_CONTENT_TYPE_HEADER = "text/x-component";
|
|
2343
|
+
var NEXT_INSTANT_PREFETCH_HEADER = "next-instant-navigation-testing-prefetch";
|
|
2344
|
+
var NEXT_INSTANT_TEST_COOKIE = "next-instant-navigation-testing";
|
|
2345
|
+
var FLIGHT_HEADERS = [
|
|
2346
|
+
RSC_HEADER,
|
|
2347
|
+
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
2348
|
+
NEXT_ROUTER_PREFETCH_HEADER,
|
|
2349
|
+
NEXT_HMR_REFRESH_HEADER,
|
|
2350
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
2351
|
+
];
|
|
2352
|
+
var NEXT_RSC_UNION_QUERY = "_rsc";
|
|
2353
|
+
var NEXT_ROUTER_STALE_TIME_HEADER = "x-nextjs-stale-time";
|
|
2354
|
+
var NEXT_DID_POSTPONE_HEADER = "x-nextjs-postponed";
|
|
2355
|
+
var NEXT_REWRITTEN_PATH_HEADER = "x-nextjs-rewritten-path";
|
|
2356
|
+
var NEXT_REWRITTEN_QUERY_HEADER = "x-nextjs-rewritten-query";
|
|
2357
|
+
var NEXT_IS_PRERENDER_HEADER = "x-nextjs-prerender";
|
|
2358
|
+
var NEXT_ACTION_NOT_FOUND_HEADER = "x-nextjs-action-not-found";
|
|
2359
|
+
var NEXT_REQUEST_ID_HEADER = "x-nextjs-request-id";
|
|
2360
|
+
var NEXT_HTML_REQUEST_ID_HEADER = "x-nextjs-html-request-id";
|
|
2361
|
+
var NEXT_ACTION_REVALIDATED_HEADER = "x-action-revalidated";
|
|
2362
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
2363
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
2364
|
+
Object.assign(exports.default, exports);
|
|
2365
|
+
module.exports = exports.default;
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
});
|
|
2369
|
+
|
|
2370
|
+
// ../../node_modules/next/dist/shared/lib/invariant-error.js
|
|
2371
|
+
var require_invariant_error = __commonJS({
|
|
2372
|
+
"../../node_modules/next/dist/shared/lib/invariant-error.js"(exports) {
|
|
2373
|
+
"use strict";
|
|
2374
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2375
|
+
value: true
|
|
2376
|
+
});
|
|
2377
|
+
Object.defineProperty(exports, "InvariantError", {
|
|
2378
|
+
enumerable: true,
|
|
2379
|
+
get: function() {
|
|
2380
|
+
return InvariantError;
|
|
2381
|
+
}
|
|
2382
|
+
});
|
|
2383
|
+
var InvariantError = class extends Error {
|
|
2384
|
+
constructor(message, options) {
|
|
2385
|
+
super(`Invariant: ${message.endsWith(".") ? message : message + "."} This is a bug in Next.js.`, options);
|
|
2386
|
+
this.name = "InvariantError";
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
}
|
|
2390
|
+
});
|
|
2391
|
+
|
|
2392
|
+
// ../../node_modules/next/dist/shared/lib/promise-with-resolvers.js
|
|
2393
|
+
var require_promise_with_resolvers = __commonJS({
|
|
2394
|
+
"../../node_modules/next/dist/shared/lib/promise-with-resolvers.js"(exports) {
|
|
2395
|
+
"use strict";
|
|
2396
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2397
|
+
value: true
|
|
2398
|
+
});
|
|
2399
|
+
Object.defineProperty(exports, "createPromiseWithResolvers", {
|
|
2400
|
+
enumerable: true,
|
|
2401
|
+
get: function() {
|
|
2402
|
+
return createPromiseWithResolvers;
|
|
2403
|
+
}
|
|
2404
|
+
});
|
|
2405
|
+
function createPromiseWithResolvers() {
|
|
2406
|
+
let resolve;
|
|
2407
|
+
let reject;
|
|
2408
|
+
const promise = new Promise((res, rej) => {
|
|
2409
|
+
resolve = res;
|
|
2410
|
+
reject = rej;
|
|
2411
|
+
});
|
|
2412
|
+
return {
|
|
2413
|
+
resolve,
|
|
2414
|
+
reject,
|
|
2415
|
+
promise
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
});
|
|
2420
|
+
|
|
2421
|
+
// ../../node_modules/next/dist/server/app-render/staged-rendering.js
|
|
2422
|
+
var require_staged_rendering = __commonJS({
|
|
2423
|
+
"../../node_modules/next/dist/server/app-render/staged-rendering.js"(exports) {
|
|
2424
|
+
"use strict";
|
|
2425
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2426
|
+
value: true
|
|
2427
|
+
});
|
|
2428
|
+
function _export(target, all) {
|
|
2429
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2430
|
+
enumerable: true,
|
|
2431
|
+
get: all[name]
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
_export(exports, {
|
|
2435
|
+
RenderStage: function() {
|
|
2436
|
+
return RenderStage;
|
|
2437
|
+
},
|
|
2438
|
+
StagedRenderingController: function() {
|
|
2439
|
+
return StagedRenderingController;
|
|
2440
|
+
}
|
|
2441
|
+
});
|
|
2442
|
+
var _invarianterror = require_invariant_error();
|
|
2443
|
+
var _promisewithresolvers = require_promise_with_resolvers();
|
|
2444
|
+
var RenderStage = /* @__PURE__ */ (function(RenderStage2) {
|
|
2445
|
+
RenderStage2[RenderStage2["Before"] = 1] = "Before";
|
|
2446
|
+
RenderStage2[RenderStage2["EarlyStatic"] = 2] = "EarlyStatic";
|
|
2447
|
+
RenderStage2[RenderStage2["Static"] = 3] = "Static";
|
|
2448
|
+
RenderStage2[RenderStage2["EarlyRuntime"] = 4] = "EarlyRuntime";
|
|
2449
|
+
RenderStage2[RenderStage2["Runtime"] = 5] = "Runtime";
|
|
2450
|
+
RenderStage2[RenderStage2["Dynamic"] = 6] = "Dynamic";
|
|
2451
|
+
RenderStage2[RenderStage2["Abandoned"] = 7] = "Abandoned";
|
|
2452
|
+
return RenderStage2;
|
|
2453
|
+
})({});
|
|
2454
|
+
var StagedRenderingController = class {
|
|
2455
|
+
constructor(abortSignal, abandonController, shouldTrackSyncIO) {
|
|
2456
|
+
this.abortSignal = abortSignal;
|
|
2457
|
+
this.abandonController = abandonController;
|
|
2458
|
+
this.shouldTrackSyncIO = shouldTrackSyncIO;
|
|
2459
|
+
this.currentStage = 1;
|
|
2460
|
+
this.syncInterruptReason = null;
|
|
2461
|
+
this.staticStageEndTime = Infinity;
|
|
2462
|
+
this.runtimeStageEndTime = Infinity;
|
|
2463
|
+
this.staticStageListeners = [];
|
|
2464
|
+
this.earlyRuntimeStageListeners = [];
|
|
2465
|
+
this.runtimeStageListeners = [];
|
|
2466
|
+
this.dynamicStageListeners = [];
|
|
2467
|
+
this.staticStagePromise = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
2468
|
+
this.earlyRuntimeStagePromise = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
2469
|
+
this.runtimeStagePromise = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
2470
|
+
this.dynamicStagePromise = (0, _promisewithresolvers.createPromiseWithResolvers)();
|
|
2471
|
+
if (abortSignal) {
|
|
2472
|
+
abortSignal.addEventListener("abort", () => {
|
|
2473
|
+
const { reason } = abortSignal;
|
|
2474
|
+
this.staticStagePromise.promise.catch(ignoreReject);
|
|
2475
|
+
this.staticStagePromise.reject(reason);
|
|
2476
|
+
this.earlyRuntimeStagePromise.promise.catch(ignoreReject);
|
|
2477
|
+
this.earlyRuntimeStagePromise.reject(reason);
|
|
2478
|
+
this.runtimeStagePromise.promise.catch(ignoreReject);
|
|
2479
|
+
this.runtimeStagePromise.reject(reason);
|
|
2480
|
+
this.dynamicStagePromise.promise.catch(ignoreReject);
|
|
2481
|
+
this.dynamicStagePromise.reject(reason);
|
|
2482
|
+
}, {
|
|
2483
|
+
once: true
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
if (abandonController) {
|
|
2487
|
+
abandonController.signal.addEventListener("abort", () => {
|
|
2488
|
+
this.abandonRender();
|
|
2489
|
+
}, {
|
|
2490
|
+
once: true
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
onStage(stage, callback) {
|
|
2495
|
+
if (this.currentStage >= stage) {
|
|
2496
|
+
callback();
|
|
2497
|
+
} else if (stage === 3) {
|
|
2498
|
+
this.staticStageListeners.push(callback);
|
|
2499
|
+
} else if (stage === 4) {
|
|
2500
|
+
this.earlyRuntimeStageListeners.push(callback);
|
|
2501
|
+
} else if (stage === 5) {
|
|
2502
|
+
this.runtimeStageListeners.push(callback);
|
|
2503
|
+
} else if (stage === 6) {
|
|
2504
|
+
this.dynamicStageListeners.push(callback);
|
|
2505
|
+
} else {
|
|
2506
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${stage}`), "__NEXT_ERROR_CODE", {
|
|
2507
|
+
value: "E881",
|
|
2508
|
+
enumerable: false,
|
|
2509
|
+
configurable: true
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
}
|
|
2513
|
+
shouldTrackSyncInterrupt() {
|
|
2514
|
+
if (!this.shouldTrackSyncIO) {
|
|
2515
|
+
return false;
|
|
2516
|
+
}
|
|
2517
|
+
switch (this.currentStage) {
|
|
2518
|
+
case 1:
|
|
2519
|
+
return false;
|
|
2520
|
+
case 2:
|
|
2521
|
+
case 3:
|
|
2522
|
+
return true;
|
|
2523
|
+
case 4:
|
|
2524
|
+
return true;
|
|
2525
|
+
case 5:
|
|
2526
|
+
return false;
|
|
2527
|
+
case 6:
|
|
2528
|
+
case 7:
|
|
2529
|
+
return false;
|
|
2530
|
+
default:
|
|
2531
|
+
return false;
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
syncInterruptCurrentStageWithReason(reason) {
|
|
2535
|
+
if (this.currentStage === 1) {
|
|
2536
|
+
return;
|
|
2537
|
+
}
|
|
2538
|
+
if (this.currentStage === 7) {
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
if (this.abandonController) {
|
|
2542
|
+
this.abandonController.abort();
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2545
|
+
if (this.abortSignal) {
|
|
2546
|
+
this.syncInterruptReason = reason;
|
|
2547
|
+
this.currentStage = 7;
|
|
2548
|
+
return;
|
|
2549
|
+
}
|
|
2550
|
+
switch (this.currentStage) {
|
|
2551
|
+
case 2:
|
|
2552
|
+
case 3:
|
|
2553
|
+
case 4: {
|
|
2554
|
+
this.syncInterruptReason = reason;
|
|
2555
|
+
this.advanceStage(6);
|
|
2556
|
+
return;
|
|
2557
|
+
}
|
|
2558
|
+
case 5: {
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
case 6:
|
|
2562
|
+
default:
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
getSyncInterruptReason() {
|
|
2566
|
+
return this.syncInterruptReason;
|
|
2567
|
+
}
|
|
2568
|
+
getStaticStageEndTime() {
|
|
2569
|
+
return this.staticStageEndTime;
|
|
2570
|
+
}
|
|
2571
|
+
getRuntimeStageEndTime() {
|
|
2572
|
+
return this.runtimeStageEndTime;
|
|
2573
|
+
}
|
|
2574
|
+
abandonRender() {
|
|
2575
|
+
const { currentStage } = this;
|
|
2576
|
+
switch (currentStage) {
|
|
2577
|
+
case 2: {
|
|
2578
|
+
this.resolveStaticStage();
|
|
2579
|
+
}
|
|
2580
|
+
// intentional fallthrough
|
|
2581
|
+
case 3: {
|
|
2582
|
+
this.resolveEarlyRuntimeStage();
|
|
2583
|
+
}
|
|
2584
|
+
// intentional fallthrough
|
|
2585
|
+
case 4: {
|
|
2586
|
+
this.resolveRuntimeStage();
|
|
2587
|
+
}
|
|
2588
|
+
// intentional fallthrough
|
|
2589
|
+
case 5: {
|
|
2590
|
+
this.currentStage = 7;
|
|
2591
|
+
return;
|
|
2592
|
+
}
|
|
2593
|
+
case 6:
|
|
2594
|
+
case 1:
|
|
2595
|
+
case 7:
|
|
2596
|
+
break;
|
|
2597
|
+
default: {
|
|
2598
|
+
currentStage;
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
advanceStage(stage) {
|
|
2603
|
+
if (stage <= this.currentStage) {
|
|
2604
|
+
return;
|
|
2605
|
+
}
|
|
2606
|
+
let currentStage = this.currentStage;
|
|
2607
|
+
this.currentStage = stage;
|
|
2608
|
+
if (currentStage < 3 && stage >= 3) {
|
|
2609
|
+
this.resolveStaticStage();
|
|
2610
|
+
}
|
|
2611
|
+
if (currentStage < 4 && stage >= 4) {
|
|
2612
|
+
this.resolveEarlyRuntimeStage();
|
|
2613
|
+
}
|
|
2614
|
+
if (currentStage < 5 && stage >= 5) {
|
|
2615
|
+
this.staticStageEndTime = performance.now() + performance.timeOrigin;
|
|
2616
|
+
this.resolveRuntimeStage();
|
|
2617
|
+
}
|
|
2618
|
+
if (currentStage < 6 && stage >= 6) {
|
|
2619
|
+
this.runtimeStageEndTime = performance.now() + performance.timeOrigin;
|
|
2620
|
+
this.resolveDynamicStage();
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
/** Fire the `onStage` listeners for the static stage and unblock any promises waiting for it. */
|
|
2625
|
+
resolveStaticStage() {
|
|
2626
|
+
const staticListeners = this.staticStageListeners;
|
|
2627
|
+
for (let i = 0; i < staticListeners.length; i++) {
|
|
2628
|
+
staticListeners[i]();
|
|
2629
|
+
}
|
|
2630
|
+
staticListeners.length = 0;
|
|
2631
|
+
this.staticStagePromise.resolve();
|
|
2632
|
+
}
|
|
2633
|
+
/** Fire the `onStage` listeners for the early runtime stage and unblock any promises waiting for it. */
|
|
2634
|
+
resolveEarlyRuntimeStage() {
|
|
2635
|
+
const earlyRuntimeListeners = this.earlyRuntimeStageListeners;
|
|
2636
|
+
for (let i = 0; i < earlyRuntimeListeners.length; i++) {
|
|
2637
|
+
earlyRuntimeListeners[i]();
|
|
2638
|
+
}
|
|
2639
|
+
earlyRuntimeListeners.length = 0;
|
|
2640
|
+
this.earlyRuntimeStagePromise.resolve();
|
|
2641
|
+
}
|
|
2642
|
+
/** Fire the `onStage` listeners for the runtime stage and unblock any promises waiting for it. */
|
|
2643
|
+
resolveRuntimeStage() {
|
|
2644
|
+
const runtimeListeners = this.runtimeStageListeners;
|
|
2645
|
+
for (let i = 0; i < runtimeListeners.length; i++) {
|
|
2646
|
+
runtimeListeners[i]();
|
|
2647
|
+
}
|
|
2648
|
+
runtimeListeners.length = 0;
|
|
2649
|
+
this.runtimeStagePromise.resolve();
|
|
2650
|
+
}
|
|
2651
|
+
/** Fire the `onStage` listeners for the dynamic stage and unblock any promises waiting for it. */
|
|
2652
|
+
resolveDynamicStage() {
|
|
2653
|
+
const dynamicListeners = this.dynamicStageListeners;
|
|
2654
|
+
for (let i = 0; i < dynamicListeners.length; i++) {
|
|
2655
|
+
dynamicListeners[i]();
|
|
2656
|
+
}
|
|
2657
|
+
dynamicListeners.length = 0;
|
|
2658
|
+
this.dynamicStagePromise.resolve();
|
|
2659
|
+
}
|
|
2660
|
+
getStagePromise(stage) {
|
|
2661
|
+
switch (stage) {
|
|
2662
|
+
case 3: {
|
|
2663
|
+
return this.staticStagePromise.promise;
|
|
2664
|
+
}
|
|
2665
|
+
case 4: {
|
|
2666
|
+
return this.earlyRuntimeStagePromise.promise;
|
|
2667
|
+
}
|
|
2668
|
+
case 5: {
|
|
2669
|
+
return this.runtimeStagePromise.promise;
|
|
2670
|
+
}
|
|
2671
|
+
case 6: {
|
|
2672
|
+
return this.dynamicStagePromise.promise;
|
|
2673
|
+
}
|
|
2674
|
+
default: {
|
|
2675
|
+
stage;
|
|
2676
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${stage}`), "__NEXT_ERROR_CODE", {
|
|
2677
|
+
value: "E881",
|
|
2678
|
+
enumerable: false,
|
|
2679
|
+
configurable: true
|
|
2680
|
+
});
|
|
2681
|
+
}
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
waitForStage(stage) {
|
|
2685
|
+
return this.getStagePromise(stage);
|
|
2686
|
+
}
|
|
2687
|
+
delayUntilStage(stage, displayName, resolvedValue) {
|
|
2688
|
+
const ioTriggerPromise = this.getStagePromise(stage);
|
|
2689
|
+
const promise = makeDevtoolsIOPromiseFromIOTrigger(ioTriggerPromise, displayName, resolvedValue);
|
|
2690
|
+
if (this.abortSignal) {
|
|
2691
|
+
promise.catch(ignoreReject);
|
|
2692
|
+
}
|
|
2693
|
+
return promise;
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
function ignoreReject() {
|
|
2697
|
+
}
|
|
2698
|
+
function makeDevtoolsIOPromiseFromIOTrigger(ioTrigger, displayName, resolvedValue) {
|
|
2699
|
+
const promise = new Promise((resolve, reject) => {
|
|
2700
|
+
ioTrigger.then(resolve.bind(null, resolvedValue), reject);
|
|
2701
|
+
});
|
|
2702
|
+
if (displayName !== void 0) {
|
|
2703
|
+
promise.displayName = displayName;
|
|
2704
|
+
}
|
|
2705
|
+
return promise;
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
});
|
|
2709
|
+
|
|
2710
|
+
// ../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js
|
|
2711
|
+
var require_work_unit_async_storage_external = __commonJS({
|
|
2712
|
+
"../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js"(exports) {
|
|
2713
|
+
"use strict";
|
|
2714
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2715
|
+
value: true
|
|
2716
|
+
});
|
|
2717
|
+
function _export(target, all) {
|
|
2718
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2719
|
+
enumerable: true,
|
|
2720
|
+
get: all[name]
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
_export(exports, {
|
|
2724
|
+
getCacheSignal: function() {
|
|
2725
|
+
return getCacheSignal;
|
|
2726
|
+
},
|
|
2727
|
+
getDraftModeProviderForCacheScope: function() {
|
|
2728
|
+
return getDraftModeProviderForCacheScope;
|
|
2729
|
+
},
|
|
2730
|
+
getHmrRefreshHash: function() {
|
|
2731
|
+
return getHmrRefreshHash;
|
|
2732
|
+
},
|
|
2733
|
+
getPrerenderResumeDataCache: function() {
|
|
2734
|
+
return getPrerenderResumeDataCache;
|
|
2735
|
+
},
|
|
2736
|
+
getRenderResumeDataCache: function() {
|
|
2737
|
+
return getRenderResumeDataCache;
|
|
2738
|
+
},
|
|
2739
|
+
getServerComponentsHmrCache: function() {
|
|
2740
|
+
return getServerComponentsHmrCache;
|
|
2741
|
+
},
|
|
2742
|
+
getStagedRenderingController: function() {
|
|
2743
|
+
return getStagedRenderingController;
|
|
2744
|
+
},
|
|
2745
|
+
isHmrRefresh: function() {
|
|
2746
|
+
return isHmrRefresh;
|
|
2747
|
+
},
|
|
2748
|
+
isInEarlyRenderStage: function() {
|
|
2749
|
+
return isInEarlyRenderStage;
|
|
2750
|
+
},
|
|
2751
|
+
throwForMissingRequestStore: function() {
|
|
2752
|
+
return throwForMissingRequestStore;
|
|
2753
|
+
},
|
|
2754
|
+
throwInvariantForMissingStore: function() {
|
|
2755
|
+
return throwInvariantForMissingStore;
|
|
2756
|
+
},
|
|
2757
|
+
workUnitAsyncStorage: function() {
|
|
2758
|
+
return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
var _workunitasyncstorageinstance = require_work_unit_async_storage_instance();
|
|
2762
|
+
var _approuterheaders = require_app_router_headers();
|
|
2763
|
+
var _invarianterror = require_invariant_error();
|
|
2764
|
+
var _stagedrendering = require_staged_rendering();
|
|
2765
|
+
function isInEarlyRenderStage(requestStore) {
|
|
2766
|
+
const stagedRendering = requestStore.stagedRendering;
|
|
2767
|
+
if (stagedRendering) {
|
|
2768
|
+
return stagedRendering.currentStage === _stagedrendering.RenderStage.EarlyStatic || stagedRendering.currentStage === _stagedrendering.RenderStage.EarlyRuntime;
|
|
2769
|
+
}
|
|
2770
|
+
return false;
|
|
2771
|
+
}
|
|
2772
|
+
function throwForMissingRequestStore(callingExpression) {
|
|
2773
|
+
throw Object.defineProperty(new Error(`\`${callingExpression}\` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), "__NEXT_ERROR_CODE", {
|
|
2774
|
+
value: "E251",
|
|
2775
|
+
enumerable: false,
|
|
2776
|
+
configurable: true
|
|
2777
|
+
});
|
|
2778
|
+
}
|
|
2779
|
+
function throwInvariantForMissingStore() {
|
|
2780
|
+
throw Object.defineProperty(new _invarianterror.InvariantError("Expected workUnitAsyncStorage to have a store."), "__NEXT_ERROR_CODE", {
|
|
2781
|
+
value: "E696",
|
|
2782
|
+
enumerable: false,
|
|
2783
|
+
configurable: true
|
|
2784
|
+
});
|
|
2785
|
+
}
|
|
2786
|
+
function getPrerenderResumeDataCache(workUnitStore) {
|
|
2787
|
+
switch (workUnitStore.type) {
|
|
2788
|
+
case "prerender":
|
|
2789
|
+
case "prerender-runtime":
|
|
2790
|
+
case "prerender-ppr":
|
|
2791
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
2792
|
+
case "prerender-client":
|
|
2793
|
+
case "validation-client":
|
|
2794
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
2795
|
+
case "request": {
|
|
2796
|
+
if (workUnitStore.prerenderResumeDataCache) {
|
|
2797
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
case "prerender-legacy":
|
|
2801
|
+
case "cache":
|
|
2802
|
+
case "private-cache":
|
|
2803
|
+
case "unstable-cache":
|
|
2804
|
+
case "generate-static-params":
|
|
2805
|
+
return null;
|
|
2806
|
+
default:
|
|
2807
|
+
return workUnitStore;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
function getRenderResumeDataCache(workUnitStore) {
|
|
2811
|
+
switch (workUnitStore.type) {
|
|
2812
|
+
case "request":
|
|
2813
|
+
case "prerender":
|
|
2814
|
+
case "prerender-runtime":
|
|
2815
|
+
case "prerender-client":
|
|
2816
|
+
case "validation-client":
|
|
2817
|
+
if (workUnitStore.renderResumeDataCache) {
|
|
2818
|
+
return workUnitStore.renderResumeDataCache;
|
|
2819
|
+
}
|
|
2820
|
+
// fallthrough
|
|
2821
|
+
case "prerender-ppr":
|
|
2822
|
+
return workUnitStore.prerenderResumeDataCache ?? null;
|
|
2823
|
+
case "cache":
|
|
2824
|
+
case "private-cache":
|
|
2825
|
+
case "unstable-cache":
|
|
2826
|
+
case "prerender-legacy":
|
|
2827
|
+
case "generate-static-params":
|
|
2828
|
+
return null;
|
|
2829
|
+
default:
|
|
2830
|
+
return workUnitStore;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
function getHmrRefreshHash(workUnitStore) {
|
|
2834
|
+
if (process.env.__NEXT_DEV_SERVER) {
|
|
2835
|
+
switch (workUnitStore.type) {
|
|
2836
|
+
case "cache":
|
|
2837
|
+
case "private-cache":
|
|
2838
|
+
case "prerender":
|
|
2839
|
+
case "prerender-runtime":
|
|
2840
|
+
return workUnitStore.hmrRefreshHash;
|
|
2841
|
+
case "request":
|
|
2842
|
+
var _workUnitStore_cookies_get;
|
|
2843
|
+
return (_workUnitStore_cookies_get = workUnitStore.cookies.get(_approuterheaders.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _workUnitStore_cookies_get.value;
|
|
2844
|
+
case "prerender-client":
|
|
2845
|
+
case "validation-client":
|
|
2846
|
+
case "prerender-ppr":
|
|
2847
|
+
case "prerender-legacy":
|
|
2848
|
+
case "unstable-cache":
|
|
2849
|
+
case "generate-static-params":
|
|
2850
|
+
break;
|
|
2851
|
+
default:
|
|
2852
|
+
workUnitStore;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
return void 0;
|
|
2856
|
+
}
|
|
2857
|
+
function isHmrRefresh(workUnitStore) {
|
|
2858
|
+
if (process.env.__NEXT_DEV_SERVER) {
|
|
2859
|
+
switch (workUnitStore.type) {
|
|
2860
|
+
case "cache":
|
|
2861
|
+
case "private-cache":
|
|
2862
|
+
case "request":
|
|
2863
|
+
return workUnitStore.isHmrRefresh ?? false;
|
|
2864
|
+
case "prerender":
|
|
2865
|
+
case "prerender-client":
|
|
2866
|
+
case "validation-client":
|
|
2867
|
+
case "prerender-runtime":
|
|
2868
|
+
case "prerender-ppr":
|
|
2869
|
+
case "prerender-legacy":
|
|
2870
|
+
case "unstable-cache":
|
|
2871
|
+
case "generate-static-params":
|
|
2872
|
+
break;
|
|
2873
|
+
default:
|
|
2874
|
+
workUnitStore;
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
return false;
|
|
2878
|
+
}
|
|
2879
|
+
function getServerComponentsHmrCache(workUnitStore) {
|
|
2880
|
+
if (process.env.__NEXT_DEV_SERVER) {
|
|
2881
|
+
switch (workUnitStore.type) {
|
|
2882
|
+
case "cache":
|
|
2883
|
+
case "private-cache":
|
|
2884
|
+
case "request":
|
|
2885
|
+
return workUnitStore.serverComponentsHmrCache;
|
|
2886
|
+
case "prerender":
|
|
2887
|
+
case "prerender-client":
|
|
2888
|
+
case "validation-client":
|
|
2889
|
+
case "prerender-runtime":
|
|
2890
|
+
case "prerender-ppr":
|
|
2891
|
+
case "prerender-legacy":
|
|
2892
|
+
case "unstable-cache":
|
|
2893
|
+
case "generate-static-params":
|
|
2894
|
+
break;
|
|
2895
|
+
default:
|
|
2896
|
+
workUnitStore;
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
return void 0;
|
|
2900
|
+
}
|
|
2901
|
+
function getDraftModeProviderForCacheScope(workStore, workUnitStore) {
|
|
2902
|
+
if (workStore.isDraftMode) {
|
|
2903
|
+
switch (workUnitStore.type) {
|
|
2904
|
+
case "cache":
|
|
2905
|
+
case "private-cache":
|
|
2906
|
+
case "unstable-cache":
|
|
2907
|
+
case "prerender-runtime":
|
|
2908
|
+
case "request":
|
|
2909
|
+
return workUnitStore.draftMode;
|
|
2910
|
+
case "prerender":
|
|
2911
|
+
case "prerender-client":
|
|
2912
|
+
case "validation-client":
|
|
2913
|
+
case "prerender-ppr":
|
|
2914
|
+
case "prerender-legacy":
|
|
2915
|
+
case "generate-static-params":
|
|
2916
|
+
break;
|
|
2917
|
+
default:
|
|
2918
|
+
workUnitStore;
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
return void 0;
|
|
2922
|
+
}
|
|
2923
|
+
function getStagedRenderingController(workUnitStore) {
|
|
2924
|
+
switch (workUnitStore.type) {
|
|
2925
|
+
case "request":
|
|
2926
|
+
case "prerender-runtime":
|
|
2927
|
+
return workUnitStore.stagedRendering ?? null;
|
|
2928
|
+
case "prerender":
|
|
2929
|
+
case "prerender-client":
|
|
2930
|
+
case "validation-client":
|
|
2931
|
+
case "prerender-ppr":
|
|
2932
|
+
case "prerender-legacy":
|
|
2933
|
+
case "cache":
|
|
2934
|
+
case "private-cache":
|
|
2935
|
+
case "unstable-cache":
|
|
2936
|
+
case "generate-static-params":
|
|
2937
|
+
return null;
|
|
2938
|
+
default:
|
|
2939
|
+
return workUnitStore;
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
function getCacheSignal(workUnitStore) {
|
|
2943
|
+
switch (workUnitStore.type) {
|
|
2944
|
+
case "prerender":
|
|
2945
|
+
case "prerender-client":
|
|
2946
|
+
case "validation-client":
|
|
2947
|
+
case "prerender-runtime":
|
|
2948
|
+
return workUnitStore.cacheSignal;
|
|
2949
|
+
case "request": {
|
|
2950
|
+
if (workUnitStore.cacheSignal) {
|
|
2951
|
+
return workUnitStore.cacheSignal;
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
case "prerender-ppr":
|
|
2955
|
+
case "prerender-legacy":
|
|
2956
|
+
case "cache":
|
|
2957
|
+
case "private-cache":
|
|
2958
|
+
case "unstable-cache":
|
|
2959
|
+
case "generate-static-params":
|
|
2960
|
+
return null;
|
|
2961
|
+
default:
|
|
2962
|
+
return workUnitStore;
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
});
|
|
2967
|
+
|
|
2968
|
+
// ../../node_modules/next/dist/client/components/hooks-server-context.js
|
|
2969
|
+
var require_hooks_server_context = __commonJS({
|
|
2970
|
+
"../../node_modules/next/dist/client/components/hooks-server-context.js"(exports, module) {
|
|
2971
|
+
"use strict";
|
|
2972
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2973
|
+
value: true
|
|
2974
|
+
});
|
|
2975
|
+
function _export(target, all) {
|
|
2976
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
2977
|
+
enumerable: true,
|
|
2978
|
+
get: all[name]
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
_export(exports, {
|
|
2982
|
+
DynamicServerError: function() {
|
|
2983
|
+
return DynamicServerError;
|
|
2984
|
+
},
|
|
2985
|
+
isDynamicServerError: function() {
|
|
2986
|
+
return isDynamicServerError;
|
|
2987
|
+
}
|
|
2988
|
+
});
|
|
2989
|
+
var DYNAMIC_ERROR_CODE = "DYNAMIC_SERVER_USAGE";
|
|
2990
|
+
var DynamicServerError = class extends Error {
|
|
2991
|
+
constructor(description) {
|
|
2992
|
+
super(`Dynamic server usage: ${description}`), this.description = description, this.digest = DYNAMIC_ERROR_CODE;
|
|
2993
|
+
}
|
|
2994
|
+
};
|
|
2995
|
+
function isDynamicServerError(err) {
|
|
2996
|
+
if (typeof err !== "object" || err === null || !("digest" in err) || typeof err.digest !== "string") {
|
|
2997
|
+
return false;
|
|
2998
|
+
}
|
|
2999
|
+
return err.digest === DYNAMIC_ERROR_CODE;
|
|
3000
|
+
}
|
|
3001
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
3002
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
3003
|
+
Object.assign(exports.default, exports);
|
|
3004
|
+
module.exports = exports.default;
|
|
3005
|
+
}
|
|
3006
|
+
}
|
|
3007
|
+
});
|
|
3008
|
+
|
|
3009
|
+
// ../../node_modules/next/dist/client/components/static-generation-bailout.js
|
|
3010
|
+
var require_static_generation_bailout = __commonJS({
|
|
3011
|
+
"../../node_modules/next/dist/client/components/static-generation-bailout.js"(exports, module) {
|
|
3012
|
+
"use strict";
|
|
3013
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3014
|
+
value: true
|
|
3015
|
+
});
|
|
3016
|
+
function _export(target, all) {
|
|
3017
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3018
|
+
enumerable: true,
|
|
3019
|
+
get: all[name]
|
|
3020
|
+
});
|
|
3021
|
+
}
|
|
3022
|
+
_export(exports, {
|
|
3023
|
+
StaticGenBailoutError: function() {
|
|
3024
|
+
return StaticGenBailoutError;
|
|
3025
|
+
},
|
|
3026
|
+
isStaticGenBailoutError: function() {
|
|
3027
|
+
return isStaticGenBailoutError;
|
|
3028
|
+
}
|
|
3029
|
+
});
|
|
3030
|
+
var NEXT_STATIC_GEN_BAILOUT = "NEXT_STATIC_GEN_BAILOUT";
|
|
3031
|
+
var StaticGenBailoutError = class extends Error {
|
|
3032
|
+
constructor(...args) {
|
|
3033
|
+
super(...args), this.code = NEXT_STATIC_GEN_BAILOUT;
|
|
3034
|
+
}
|
|
3035
|
+
};
|
|
3036
|
+
function isStaticGenBailoutError(error) {
|
|
3037
|
+
if (typeof error !== "object" || error === null || !("code" in error)) {
|
|
3038
|
+
return false;
|
|
3039
|
+
}
|
|
3040
|
+
return error.code === NEXT_STATIC_GEN_BAILOUT;
|
|
3041
|
+
}
|
|
3042
|
+
if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
|
|
3043
|
+
Object.defineProperty(exports.default, "__esModule", { value: true });
|
|
3044
|
+
Object.assign(exports.default, exports);
|
|
3045
|
+
module.exports = exports.default;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
});
|
|
3049
|
+
|
|
3050
|
+
// ../../node_modules/next/dist/server/dynamic-rendering-utils.js
|
|
3051
|
+
var require_dynamic_rendering_utils = __commonJS({
|
|
3052
|
+
"../../node_modules/next/dist/server/dynamic-rendering-utils.js"(exports) {
|
|
3053
|
+
"use strict";
|
|
3054
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3055
|
+
value: true
|
|
3056
|
+
});
|
|
3057
|
+
function _export(target, all) {
|
|
3058
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3059
|
+
enumerable: true,
|
|
3060
|
+
get: all[name]
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
_export(exports, {
|
|
3064
|
+
delayUntilRuntimeStage: function() {
|
|
3065
|
+
return delayUntilRuntimeStage;
|
|
3066
|
+
},
|
|
3067
|
+
getRuntimeStage: function() {
|
|
3068
|
+
return getRuntimeStage;
|
|
3069
|
+
},
|
|
3070
|
+
isHangingPromiseRejectionError: function() {
|
|
3071
|
+
return isHangingPromiseRejectionError;
|
|
3072
|
+
},
|
|
3073
|
+
makeDevtoolsIOAwarePromise: function() {
|
|
3074
|
+
return makeDevtoolsIOAwarePromise;
|
|
3075
|
+
},
|
|
3076
|
+
makeHangingPromise: function() {
|
|
3077
|
+
return makeHangingPromise;
|
|
3078
|
+
}
|
|
3079
|
+
});
|
|
3080
|
+
var _stagedrendering = require_staged_rendering();
|
|
3081
|
+
function isHangingPromiseRejectionError(err) {
|
|
3082
|
+
if (typeof err !== "object" || err === null || !("digest" in err)) {
|
|
3083
|
+
return false;
|
|
3084
|
+
}
|
|
3085
|
+
return err.digest === HANGING_PROMISE_REJECTION;
|
|
3086
|
+
}
|
|
3087
|
+
var HANGING_PROMISE_REJECTION = "HANGING_PROMISE_REJECTION";
|
|
3088
|
+
var HangingPromiseRejectionError = class extends Error {
|
|
3089
|
+
constructor(route, expression) {
|
|
3090
|
+
super(`During prerendering, ${expression} rejects when the prerender is complete. Typically these errors are handled by React but if you move ${expression} to a different context by using \`setTimeout\`, \`after\`, or similar functions you may observe this error and you should handle it in that context. This occurred at route "${route}".`), this.route = route, this.expression = expression, this.digest = HANGING_PROMISE_REJECTION;
|
|
3091
|
+
}
|
|
3092
|
+
};
|
|
3093
|
+
var abortListenersBySignal = /* @__PURE__ */ new WeakMap();
|
|
3094
|
+
function makeHangingPromise(signal, route, expression) {
|
|
3095
|
+
if (signal.aborted) {
|
|
3096
|
+
return Promise.reject(new HangingPromiseRejectionError(route, expression));
|
|
3097
|
+
} else {
|
|
3098
|
+
const hangingPromise = new Promise((_, reject) => {
|
|
3099
|
+
const boundRejection = reject.bind(null, new HangingPromiseRejectionError(route, expression));
|
|
3100
|
+
let currentListeners = abortListenersBySignal.get(signal);
|
|
3101
|
+
if (currentListeners) {
|
|
3102
|
+
currentListeners.push(boundRejection);
|
|
3103
|
+
} else {
|
|
3104
|
+
const listeners = [
|
|
3105
|
+
boundRejection
|
|
3106
|
+
];
|
|
3107
|
+
abortListenersBySignal.set(signal, listeners);
|
|
3108
|
+
signal.addEventListener("abort", () => {
|
|
3109
|
+
for (let i = 0; i < listeners.length; i++) {
|
|
3110
|
+
listeners[i]();
|
|
3111
|
+
}
|
|
3112
|
+
}, {
|
|
3113
|
+
once: true
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
hangingPromise.catch(ignoreReject);
|
|
3118
|
+
return hangingPromise;
|
|
3119
|
+
}
|
|
3120
|
+
}
|
|
3121
|
+
function ignoreReject() {
|
|
3122
|
+
}
|
|
3123
|
+
function makeDevtoolsIOAwarePromise(underlying, requestStore, stage) {
|
|
3124
|
+
if (requestStore.stagedRendering) {
|
|
3125
|
+
return requestStore.stagedRendering.delayUntilStage(stage, void 0, underlying);
|
|
3126
|
+
}
|
|
3127
|
+
return new Promise((resolve) => {
|
|
3128
|
+
setTimeout(() => {
|
|
3129
|
+
resolve(underlying);
|
|
3130
|
+
}, 0);
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
function getRuntimeStage(stagedRendering) {
|
|
3134
|
+
if (stagedRendering.currentStage === _stagedrendering.RenderStage.EarlyStatic || stagedRendering.currentStage === _stagedrendering.RenderStage.EarlyRuntime) {
|
|
3135
|
+
return _stagedrendering.RenderStage.EarlyRuntime;
|
|
3136
|
+
}
|
|
3137
|
+
return _stagedrendering.RenderStage.Runtime;
|
|
3138
|
+
}
|
|
3139
|
+
function delayUntilRuntimeStage(prerenderStore, result) {
|
|
3140
|
+
const { stagedRendering } = prerenderStore;
|
|
3141
|
+
if (!stagedRendering) {
|
|
3142
|
+
return result;
|
|
3143
|
+
}
|
|
3144
|
+
return stagedRendering.waitForStage(getRuntimeStage(stagedRendering)).then(() => result);
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
});
|
|
3148
|
+
|
|
3149
|
+
// ../../node_modules/next/dist/lib/framework/boundary-constants.js
|
|
3150
|
+
var require_boundary_constants = __commonJS({
|
|
3151
|
+
"../../node_modules/next/dist/lib/framework/boundary-constants.js"(exports) {
|
|
3152
|
+
"use strict";
|
|
3153
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3154
|
+
value: true
|
|
3155
|
+
});
|
|
3156
|
+
function _export(target, all) {
|
|
3157
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3158
|
+
enumerable: true,
|
|
3159
|
+
get: all[name]
|
|
3160
|
+
});
|
|
3161
|
+
}
|
|
3162
|
+
_export(exports, {
|
|
3163
|
+
METADATA_BOUNDARY_NAME: function() {
|
|
3164
|
+
return METADATA_BOUNDARY_NAME;
|
|
3165
|
+
},
|
|
3166
|
+
OUTLET_BOUNDARY_NAME: function() {
|
|
3167
|
+
return OUTLET_BOUNDARY_NAME;
|
|
3168
|
+
},
|
|
3169
|
+
ROOT_LAYOUT_BOUNDARY_NAME: function() {
|
|
3170
|
+
return ROOT_LAYOUT_BOUNDARY_NAME;
|
|
3171
|
+
},
|
|
3172
|
+
VIEWPORT_BOUNDARY_NAME: function() {
|
|
3173
|
+
return VIEWPORT_BOUNDARY_NAME;
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
var METADATA_BOUNDARY_NAME = "__next_metadata_boundary__";
|
|
3177
|
+
var VIEWPORT_BOUNDARY_NAME = "__next_viewport_boundary__";
|
|
3178
|
+
var OUTLET_BOUNDARY_NAME = "__next_outlet_boundary__";
|
|
3179
|
+
var ROOT_LAYOUT_BOUNDARY_NAME = "__next_root_layout_boundary__";
|
|
3180
|
+
}
|
|
3181
|
+
});
|
|
3182
|
+
|
|
3183
|
+
// ../../node_modules/next/dist/lib/scheduler.js
|
|
3184
|
+
var require_scheduler = __commonJS({
|
|
3185
|
+
"../../node_modules/next/dist/lib/scheduler.js"(exports) {
|
|
3186
|
+
"use strict";
|
|
3187
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3188
|
+
value: true
|
|
3189
|
+
});
|
|
3190
|
+
function _export(target, all) {
|
|
3191
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3192
|
+
enumerable: true,
|
|
3193
|
+
get: all[name]
|
|
3194
|
+
});
|
|
3195
|
+
}
|
|
3196
|
+
_export(exports, {
|
|
3197
|
+
atLeastOneTask: function() {
|
|
3198
|
+
return atLeastOneTask;
|
|
3199
|
+
},
|
|
3200
|
+
scheduleImmediate: function() {
|
|
3201
|
+
return scheduleImmediate;
|
|
3202
|
+
},
|
|
3203
|
+
scheduleOnNextTick: function() {
|
|
3204
|
+
return scheduleOnNextTick;
|
|
3205
|
+
},
|
|
3206
|
+
waitAtLeastOneReactRenderTask: function() {
|
|
3207
|
+
return waitAtLeastOneReactRenderTask;
|
|
3208
|
+
}
|
|
3209
|
+
});
|
|
3210
|
+
var scheduleOnNextTick = (cb) => {
|
|
3211
|
+
Promise.resolve().then(() => {
|
|
3212
|
+
if (process.env.NEXT_RUNTIME === "edge") {
|
|
3213
|
+
setTimeout(cb, 0);
|
|
3214
|
+
} else {
|
|
3215
|
+
process.nextTick(cb);
|
|
3216
|
+
}
|
|
3217
|
+
});
|
|
3218
|
+
};
|
|
3219
|
+
var scheduleImmediate = (cb) => {
|
|
3220
|
+
if (process.env.NEXT_RUNTIME === "edge") {
|
|
3221
|
+
setTimeout(cb, 0);
|
|
3222
|
+
} else {
|
|
3223
|
+
setImmediate(cb);
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
function atLeastOneTask() {
|
|
3227
|
+
return new Promise((resolve) => scheduleImmediate(resolve));
|
|
3228
|
+
}
|
|
3229
|
+
function waitAtLeastOneReactRenderTask() {
|
|
3230
|
+
if (process.env.NEXT_RUNTIME === "edge") {
|
|
3231
|
+
return new Promise((r) => setTimeout(r, 0));
|
|
3232
|
+
} else {
|
|
3233
|
+
return new Promise((r) => setImmediate(r));
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
3236
|
+
}
|
|
3237
|
+
});
|
|
3238
|
+
|
|
3239
|
+
// ../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js
|
|
3240
|
+
var require_bailout_to_csr = __commonJS({
|
|
3241
|
+
"../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js"(exports) {
|
|
3242
|
+
"use strict";
|
|
3243
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3244
|
+
value: true
|
|
3245
|
+
});
|
|
3246
|
+
function _export(target, all) {
|
|
3247
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3248
|
+
enumerable: true,
|
|
3249
|
+
get: all[name]
|
|
3250
|
+
});
|
|
3251
|
+
}
|
|
3252
|
+
_export(exports, {
|
|
3253
|
+
BailoutToCSRError: function() {
|
|
3254
|
+
return BailoutToCSRError;
|
|
3255
|
+
},
|
|
3256
|
+
isBailoutToCSRError: function() {
|
|
3257
|
+
return isBailoutToCSRError;
|
|
3258
|
+
}
|
|
3259
|
+
});
|
|
3260
|
+
var BAILOUT_TO_CSR = "BAILOUT_TO_CLIENT_SIDE_RENDERING";
|
|
3261
|
+
var BailoutToCSRError = class extends Error {
|
|
3262
|
+
constructor(reason) {
|
|
3263
|
+
super(`Bail out to client-side rendering: ${reason}`), this.reason = reason, this.digest = BAILOUT_TO_CSR;
|
|
3264
|
+
}
|
|
3265
|
+
};
|
|
3266
|
+
function isBailoutToCSRError(err) {
|
|
3267
|
+
if (typeof err !== "object" || err === null || !("digest" in err)) {
|
|
3268
|
+
return false;
|
|
3269
|
+
}
|
|
3270
|
+
return err.digest === BAILOUT_TO_CSR;
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
});
|
|
3274
|
+
|
|
3275
|
+
// ../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js
|
|
3276
|
+
var require_boundary_constants2 = __commonJS({
|
|
3277
|
+
"../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js"(exports) {
|
|
3278
|
+
"use strict";
|
|
3279
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3280
|
+
value: true
|
|
3281
|
+
});
|
|
3282
|
+
Object.defineProperty(exports, "INSTANT_VALIDATION_BOUNDARY_NAME", {
|
|
3283
|
+
enumerable: true,
|
|
3284
|
+
get: function() {
|
|
3285
|
+
return INSTANT_VALIDATION_BOUNDARY_NAME;
|
|
3286
|
+
}
|
|
3287
|
+
});
|
|
3288
|
+
var INSTANT_VALIDATION_BOUNDARY_NAME = "__next_instant_validation_boundary__";
|
|
3289
|
+
}
|
|
3290
|
+
});
|
|
3291
|
+
|
|
3292
|
+
// ../../node_modules/next/dist/server/app-render/dynamic-rendering.js
|
|
3293
|
+
var require_dynamic_rendering = __commonJS({
|
|
3294
|
+
"../../node_modules/next/dist/server/app-render/dynamic-rendering.js"(exports) {
|
|
3295
|
+
"use strict";
|
|
3296
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3297
|
+
value: true
|
|
3298
|
+
});
|
|
3299
|
+
function _export(target, all) {
|
|
3300
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
3301
|
+
enumerable: true,
|
|
3302
|
+
get: all[name]
|
|
3303
|
+
});
|
|
3304
|
+
}
|
|
3305
|
+
_export(exports, {
|
|
3306
|
+
DynamicHoleKind: function() {
|
|
3307
|
+
return DynamicHoleKind;
|
|
3308
|
+
},
|
|
3309
|
+
Postpone: function() {
|
|
3310
|
+
return Postpone;
|
|
3311
|
+
},
|
|
3312
|
+
PreludeState: function() {
|
|
3313
|
+
return PreludeState;
|
|
3314
|
+
},
|
|
3315
|
+
abortAndThrowOnSynchronousRequestDataAccess: function() {
|
|
3316
|
+
return abortAndThrowOnSynchronousRequestDataAccess;
|
|
3317
|
+
},
|
|
3318
|
+
abortOnSynchronousPlatformIOAccess: function() {
|
|
3319
|
+
return abortOnSynchronousPlatformIOAccess;
|
|
3320
|
+
},
|
|
3321
|
+
accessedDynamicData: function() {
|
|
3322
|
+
return accessedDynamicData;
|
|
3323
|
+
},
|
|
3324
|
+
annotateDynamicAccess: function() {
|
|
3325
|
+
return annotateDynamicAccess;
|
|
3326
|
+
},
|
|
3327
|
+
consumeDynamicAccess: function() {
|
|
3328
|
+
return consumeDynamicAccess;
|
|
3329
|
+
},
|
|
3330
|
+
createDynamicTrackingState: function() {
|
|
3331
|
+
return createDynamicTrackingState;
|
|
3332
|
+
},
|
|
3333
|
+
createDynamicValidationState: function() {
|
|
3334
|
+
return createDynamicValidationState;
|
|
3335
|
+
},
|
|
3336
|
+
createHangingInputAbortSignal: function() {
|
|
3337
|
+
return createHangingInputAbortSignal;
|
|
3338
|
+
},
|
|
3339
|
+
createInstantValidationState: function() {
|
|
3340
|
+
return createInstantValidationState;
|
|
3341
|
+
},
|
|
3342
|
+
createRenderInBrowserAbortSignal: function() {
|
|
3343
|
+
return createRenderInBrowserAbortSignal;
|
|
3344
|
+
},
|
|
3345
|
+
formatDynamicAPIAccesses: function() {
|
|
3346
|
+
return formatDynamicAPIAccesses;
|
|
3347
|
+
},
|
|
3348
|
+
getFirstDynamicReason: function() {
|
|
3349
|
+
return getFirstDynamicReason;
|
|
3350
|
+
},
|
|
3351
|
+
getNavigationDisallowedDynamicReasons: function() {
|
|
3352
|
+
return getNavigationDisallowedDynamicReasons;
|
|
3353
|
+
},
|
|
3354
|
+
getStaticShellDisallowedDynamicReasons: function() {
|
|
3355
|
+
return getStaticShellDisallowedDynamicReasons;
|
|
3356
|
+
},
|
|
3357
|
+
isDynamicPostpone: function() {
|
|
3358
|
+
return isDynamicPostpone;
|
|
3359
|
+
},
|
|
3360
|
+
isPrerenderInterruptedError: function() {
|
|
3361
|
+
return isPrerenderInterruptedError;
|
|
3362
|
+
},
|
|
3363
|
+
logDisallowedDynamicError: function() {
|
|
3364
|
+
return logDisallowedDynamicError;
|
|
3365
|
+
},
|
|
3366
|
+
markCurrentScopeAsDynamic: function() {
|
|
3367
|
+
return markCurrentScopeAsDynamic;
|
|
3368
|
+
},
|
|
3369
|
+
postponeWithTracking: function() {
|
|
3370
|
+
return postponeWithTracking;
|
|
3371
|
+
},
|
|
3372
|
+
throwIfDisallowedDynamic: function() {
|
|
3373
|
+
return throwIfDisallowedDynamic;
|
|
3374
|
+
},
|
|
3375
|
+
throwToInterruptStaticGeneration: function() {
|
|
3376
|
+
return throwToInterruptStaticGeneration;
|
|
3377
|
+
},
|
|
3378
|
+
trackAllowedDynamicAccess: function() {
|
|
3379
|
+
return trackAllowedDynamicAccess;
|
|
3380
|
+
},
|
|
3381
|
+
trackDynamicDataInDynamicRender: function() {
|
|
3382
|
+
return trackDynamicDataInDynamicRender;
|
|
3383
|
+
},
|
|
3384
|
+
trackDynamicHoleInNavigation: function() {
|
|
3385
|
+
return trackDynamicHoleInNavigation;
|
|
3386
|
+
},
|
|
3387
|
+
trackDynamicHoleInRuntimeShell: function() {
|
|
3388
|
+
return trackDynamicHoleInRuntimeShell;
|
|
3389
|
+
},
|
|
3390
|
+
trackDynamicHoleInStaticShell: function() {
|
|
3391
|
+
return trackDynamicHoleInStaticShell;
|
|
3392
|
+
},
|
|
3393
|
+
trackThrownErrorInNavigation: function() {
|
|
3394
|
+
return trackThrownErrorInNavigation;
|
|
3395
|
+
},
|
|
3396
|
+
useDynamicRouteParams: function() {
|
|
3397
|
+
return useDynamicRouteParams;
|
|
3398
|
+
},
|
|
3399
|
+
useDynamicSearchParams: function() {
|
|
3400
|
+
return useDynamicSearchParams;
|
|
3401
|
+
}
|
|
3402
|
+
});
|
|
3403
|
+
var _react = /* @__PURE__ */ _interop_require_default(__require("react"));
|
|
3404
|
+
var _hooksservercontext = require_hooks_server_context();
|
|
3405
|
+
var _staticgenerationbailout = require_static_generation_bailout();
|
|
3406
|
+
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
3407
|
+
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
3408
|
+
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
3409
|
+
var _boundaryconstants = require_boundary_constants();
|
|
3410
|
+
var _scheduler = require_scheduler();
|
|
3411
|
+
var _bailouttocsr = require_bailout_to_csr();
|
|
3412
|
+
var _invarianterror = require_invariant_error();
|
|
3413
|
+
var _boundaryconstants1 = require_boundary_constants2();
|
|
3414
|
+
function _interop_require_default(obj) {
|
|
3415
|
+
return obj && obj.__esModule ? obj : {
|
|
3416
|
+
default: obj
|
|
3417
|
+
};
|
|
3418
|
+
}
|
|
3419
|
+
var hasPostpone = typeof _react.default.unstable_postpone === "function";
|
|
3420
|
+
function createDynamicTrackingState(isDebugDynamicAccesses) {
|
|
3421
|
+
return {
|
|
3422
|
+
isDebugDynamicAccesses,
|
|
3423
|
+
dynamicAccesses: [],
|
|
3424
|
+
syncDynamicErrorWithStack: null
|
|
3425
|
+
};
|
|
3426
|
+
}
|
|
3427
|
+
function createDynamicValidationState() {
|
|
3428
|
+
return {
|
|
3429
|
+
hasSuspenseAboveBody: false,
|
|
3430
|
+
hasDynamicMetadata: false,
|
|
3431
|
+
dynamicMetadata: null,
|
|
3432
|
+
hasDynamicViewport: false,
|
|
3433
|
+
hasAllowedDynamic: false,
|
|
3434
|
+
dynamicErrors: []
|
|
3435
|
+
};
|
|
3436
|
+
}
|
|
3437
|
+
function getFirstDynamicReason(trackingState) {
|
|
3438
|
+
var _trackingState_dynamicAccesses_;
|
|
3439
|
+
return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;
|
|
3440
|
+
}
|
|
3441
|
+
function markCurrentScopeAsDynamic(store, workUnitStore, expression) {
|
|
3442
|
+
if (workUnitStore) {
|
|
3443
|
+
switch (workUnitStore.type) {
|
|
3444
|
+
case "cache":
|
|
3445
|
+
case "unstable-cache":
|
|
3446
|
+
return;
|
|
3447
|
+
case "private-cache":
|
|
3448
|
+
return;
|
|
3449
|
+
case "prerender-legacy":
|
|
3450
|
+
case "prerender-ppr":
|
|
3451
|
+
case "request":
|
|
3452
|
+
case "generate-static-params":
|
|
3453
|
+
break;
|
|
3454
|
+
default:
|
|
3455
|
+
workUnitStore;
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
if (store.forceDynamic || store.forceStatic) return;
|
|
3459
|
+
if (store.dynamicShouldError) {
|
|
3460
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${store.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
3461
|
+
value: "E553",
|
|
3462
|
+
enumerable: false,
|
|
3463
|
+
configurable: true
|
|
3464
|
+
});
|
|
3465
|
+
}
|
|
3466
|
+
if (workUnitStore) {
|
|
3467
|
+
switch (workUnitStore.type) {
|
|
3468
|
+
case "prerender-ppr":
|
|
3469
|
+
return postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);
|
|
3470
|
+
case "prerender-legacy":
|
|
3471
|
+
workUnitStore.revalidate = 0;
|
|
3472
|
+
const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
|
|
3473
|
+
value: "E550",
|
|
3474
|
+
enumerable: false,
|
|
3475
|
+
configurable: true
|
|
3476
|
+
});
|
|
3477
|
+
store.dynamicUsageDescription = expression;
|
|
3478
|
+
store.dynamicUsageStack = err.stack;
|
|
3479
|
+
throw err;
|
|
3480
|
+
case "request":
|
|
3481
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3482
|
+
workUnitStore.usedDynamic = true;
|
|
3483
|
+
}
|
|
3484
|
+
break;
|
|
3485
|
+
case "generate-static-params":
|
|
3486
|
+
break;
|
|
3487
|
+
default:
|
|
3488
|
+
workUnitStore;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
function throwToInterruptStaticGeneration(expression, store, prerenderStore) {
|
|
3493
|
+
const err = Object.defineProperty(new _hooksservercontext.DynamicServerError(`Route ${store.route} couldn't be rendered statically because it used \`${expression}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`), "__NEXT_ERROR_CODE", {
|
|
3494
|
+
value: "E558",
|
|
3495
|
+
enumerable: false,
|
|
3496
|
+
configurable: true
|
|
3497
|
+
});
|
|
3498
|
+
prerenderStore.revalidate = 0;
|
|
3499
|
+
store.dynamicUsageDescription = expression;
|
|
3500
|
+
store.dynamicUsageStack = err.stack;
|
|
3501
|
+
throw err;
|
|
3502
|
+
}
|
|
3503
|
+
function trackDynamicDataInDynamicRender(workUnitStore) {
|
|
3504
|
+
switch (workUnitStore.type) {
|
|
3505
|
+
case "cache":
|
|
3506
|
+
case "unstable-cache":
|
|
3507
|
+
return;
|
|
3508
|
+
case "private-cache":
|
|
3509
|
+
return;
|
|
3510
|
+
case "prerender":
|
|
3511
|
+
case "prerender-runtime":
|
|
3512
|
+
case "prerender-legacy":
|
|
3513
|
+
case "prerender-ppr":
|
|
3514
|
+
case "prerender-client":
|
|
3515
|
+
case "validation-client":
|
|
3516
|
+
case "generate-static-params":
|
|
3517
|
+
break;
|
|
3518
|
+
case "request":
|
|
3519
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3520
|
+
workUnitStore.usedDynamic = true;
|
|
3521
|
+
}
|
|
3522
|
+
break;
|
|
3523
|
+
default:
|
|
3524
|
+
workUnitStore;
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
function abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {
|
|
3528
|
+
const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;
|
|
3529
|
+
const error = createPrerenderInterruptedError(reason);
|
|
3530
|
+
prerenderStore.controller.abort(error);
|
|
3531
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
3532
|
+
if (dynamicTracking) {
|
|
3533
|
+
dynamicTracking.dynamicAccesses.push({
|
|
3534
|
+
// When we aren't debugging, we don't need to create another error for the
|
|
3535
|
+
// stack trace.
|
|
3536
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
3537
|
+
expression
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {
|
|
3542
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
3543
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
3544
|
+
if (dynamicTracking) {
|
|
3545
|
+
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
3546
|
+
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
}
|
|
3550
|
+
function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {
|
|
3551
|
+
const prerenderSignal = prerenderStore.controller.signal;
|
|
3552
|
+
if (prerenderSignal.aborted === false) {
|
|
3553
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
3554
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
3555
|
+
if (dynamicTracking) {
|
|
3556
|
+
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
3557
|
+
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);
|
|
3562
|
+
}
|
|
3563
|
+
function Postpone({ reason, route }) {
|
|
3564
|
+
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
3565
|
+
const dynamicTracking = prerenderStore && prerenderStore.type === "prerender-ppr" ? prerenderStore.dynamicTracking : null;
|
|
3566
|
+
postponeWithTracking(route, reason, dynamicTracking);
|
|
3567
|
+
}
|
|
3568
|
+
function postponeWithTracking(route, expression, dynamicTracking) {
|
|
3569
|
+
assertPostpone();
|
|
3570
|
+
if (dynamicTracking) {
|
|
3571
|
+
dynamicTracking.dynamicAccesses.push({
|
|
3572
|
+
// When we aren't debugging, we don't need to create another error for the
|
|
3573
|
+
// stack trace.
|
|
3574
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
3575
|
+
expression
|
|
3576
|
+
});
|
|
3577
|
+
}
|
|
3578
|
+
_react.default.unstable_postpone(createPostponeReason(route, expression));
|
|
3579
|
+
}
|
|
3580
|
+
function createPostponeReason(route, expression) {
|
|
3581
|
+
return `Route ${route} needs to bail out of prerendering at this point because it used ${expression}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;
|
|
3582
|
+
}
|
|
3583
|
+
function isDynamicPostpone(err) {
|
|
3584
|
+
if (typeof err === "object" && err !== null && typeof err.message === "string") {
|
|
3585
|
+
return isDynamicPostponeReason(err.message);
|
|
3586
|
+
}
|
|
3587
|
+
return false;
|
|
3588
|
+
}
|
|
3589
|
+
function isDynamicPostponeReason(reason) {
|
|
3590
|
+
return reason.includes("needs to bail out of prerendering at this point because it used") && reason.includes("Learn more: https://nextjs.org/docs/messages/ppr-caught-error");
|
|
3591
|
+
}
|
|
3592
|
+
if (isDynamicPostponeReason(createPostponeReason("%%%", "^^^")) === false) {
|
|
3593
|
+
throw Object.defineProperty(new Error("Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js"), "__NEXT_ERROR_CODE", {
|
|
3594
|
+
value: "E296",
|
|
3595
|
+
enumerable: false,
|
|
3596
|
+
configurable: true
|
|
3597
|
+
});
|
|
3598
|
+
}
|
|
3599
|
+
var NEXT_PRERENDER_INTERRUPTED = "NEXT_PRERENDER_INTERRUPTED";
|
|
3600
|
+
function createPrerenderInterruptedError(message) {
|
|
3601
|
+
const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
3602
|
+
value: "E394",
|
|
3603
|
+
enumerable: false,
|
|
3604
|
+
configurable: true
|
|
3605
|
+
});
|
|
3606
|
+
error.digest = NEXT_PRERENDER_INTERRUPTED;
|
|
3607
|
+
return error;
|
|
3608
|
+
}
|
|
3609
|
+
function isPrerenderInterruptedError(error) {
|
|
3610
|
+
return typeof error === "object" && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && "name" in error && "message" in error && error instanceof Error;
|
|
3611
|
+
}
|
|
3612
|
+
function accessedDynamicData(dynamicAccesses) {
|
|
3613
|
+
return dynamicAccesses.length > 0;
|
|
3614
|
+
}
|
|
3615
|
+
function consumeDynamicAccess(serverDynamic, clientDynamic) {
|
|
3616
|
+
serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);
|
|
3617
|
+
return serverDynamic.dynamicAccesses;
|
|
3618
|
+
}
|
|
3619
|
+
function formatDynamicAPIAccesses(dynamicAccesses) {
|
|
3620
|
+
return dynamicAccesses.filter((access) => typeof access.stack === "string" && access.stack.length > 0).map(({ expression, stack }) => {
|
|
3621
|
+
stack = stack.split("\n").slice(4).filter((line) => {
|
|
3622
|
+
if (line.includes("node_modules/next/")) {
|
|
3623
|
+
return false;
|
|
3624
|
+
}
|
|
3625
|
+
if (line.includes(" (<anonymous>)")) {
|
|
3626
|
+
return false;
|
|
3627
|
+
}
|
|
3628
|
+
if (line.includes(" (node:")) {
|
|
3629
|
+
return false;
|
|
3630
|
+
}
|
|
3631
|
+
return true;
|
|
3632
|
+
}).join("\n");
|
|
3633
|
+
return `Dynamic API Usage Debug - ${expression}:
|
|
3634
|
+
${stack}`;
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
3637
|
+
function assertPostpone() {
|
|
3638
|
+
if (!hasPostpone) {
|
|
3639
|
+
throw Object.defineProperty(new Error(`Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js`), "__NEXT_ERROR_CODE", {
|
|
3640
|
+
value: "E224",
|
|
3641
|
+
enumerable: false,
|
|
3642
|
+
configurable: true
|
|
3643
|
+
});
|
|
3644
|
+
}
|
|
3645
|
+
}
|
|
3646
|
+
function createRenderInBrowserAbortSignal() {
|
|
3647
|
+
const controller = new AbortController();
|
|
3648
|
+
controller.abort(Object.defineProperty(new _bailouttocsr.BailoutToCSRError("Render in Browser"), "__NEXT_ERROR_CODE", {
|
|
3649
|
+
value: "E721",
|
|
3650
|
+
enumerable: false,
|
|
3651
|
+
configurable: true
|
|
3652
|
+
}));
|
|
3653
|
+
return controller.signal;
|
|
3654
|
+
}
|
|
3655
|
+
function createHangingInputAbortSignal(workUnitStore) {
|
|
3656
|
+
switch (workUnitStore.type) {
|
|
3657
|
+
case "prerender":
|
|
3658
|
+
case "prerender-runtime":
|
|
3659
|
+
const controller = new AbortController();
|
|
3660
|
+
if (workUnitStore.cacheSignal) {
|
|
3661
|
+
workUnitStore.cacheSignal.inputReady().then(() => {
|
|
3662
|
+
controller.abort();
|
|
3663
|
+
});
|
|
3664
|
+
} else {
|
|
3665
|
+
if (
|
|
3666
|
+
// eslint-disable-next-line no-restricted-syntax -- We are discriminating between two different refined types and don't need an addition exhaustive switch here
|
|
3667
|
+
workUnitStore.type === "prerender-runtime" && workUnitStore.stagedRendering
|
|
3668
|
+
) {
|
|
3669
|
+
const { stagedRendering } = workUnitStore;
|
|
3670
|
+
stagedRendering.waitForStage((0, _dynamicrenderingutils.getRuntimeStage)(stagedRendering)).then(() => (0, _scheduler.scheduleOnNextTick)(() => controller.abort()));
|
|
3671
|
+
} else {
|
|
3672
|
+
(0, _scheduler.scheduleOnNextTick)(() => controller.abort());
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
return controller.signal;
|
|
3676
|
+
case "prerender-client":
|
|
3677
|
+
case "validation-client":
|
|
3678
|
+
case "prerender-ppr":
|
|
3679
|
+
case "prerender-legacy":
|
|
3680
|
+
case "request":
|
|
3681
|
+
case "cache":
|
|
3682
|
+
case "private-cache":
|
|
3683
|
+
case "unstable-cache":
|
|
3684
|
+
case "generate-static-params":
|
|
3685
|
+
return void 0;
|
|
3686
|
+
default:
|
|
3687
|
+
workUnitStore;
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
function annotateDynamicAccess(expression, prerenderStore) {
|
|
3691
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
3692
|
+
if (dynamicTracking) {
|
|
3693
|
+
dynamicTracking.dynamicAccesses.push({
|
|
3694
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : void 0,
|
|
3695
|
+
expression
|
|
3696
|
+
});
|
|
3697
|
+
}
|
|
3698
|
+
}
|
|
3699
|
+
function useDynamicRouteParams(expression) {
|
|
3700
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
3701
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
3702
|
+
if (workStore && workUnitStore) {
|
|
3703
|
+
switch (workUnitStore.type) {
|
|
3704
|
+
case "prerender-client":
|
|
3705
|
+
case "prerender": {
|
|
3706
|
+
const fallbackParams = workUnitStore.fallbackRouteParams;
|
|
3707
|
+
if (fallbackParams && fallbackParams.size > 0) {
|
|
3708
|
+
_react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, workStore.route, expression));
|
|
3709
|
+
}
|
|
3710
|
+
break;
|
|
3711
|
+
}
|
|
3712
|
+
case "prerender-ppr": {
|
|
3713
|
+
const fallbackParams = workUnitStore.fallbackRouteParams;
|
|
3714
|
+
if (fallbackParams && fallbackParams.size > 0) {
|
|
3715
|
+
return postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);
|
|
3716
|
+
}
|
|
3717
|
+
break;
|
|
3718
|
+
}
|
|
3719
|
+
case "validation-client": {
|
|
3720
|
+
break;
|
|
3721
|
+
}
|
|
3722
|
+
case "prerender-runtime":
|
|
3723
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called during a runtime prerender. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3724
|
+
value: "E771",
|
|
3725
|
+
enumerable: false,
|
|
3726
|
+
configurable: true
|
|
3727
|
+
});
|
|
3728
|
+
case "cache":
|
|
3729
|
+
case "private-cache":
|
|
3730
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3731
|
+
value: "E745",
|
|
3732
|
+
enumerable: false,
|
|
3733
|
+
configurable: true
|
|
3734
|
+
});
|
|
3735
|
+
case "generate-static-params":
|
|
3736
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called in \`generateStaticParams\`. Next.js should be preventing ${expression} from being included in server component files statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3737
|
+
value: "E1130",
|
|
3738
|
+
enumerable: false,
|
|
3739
|
+
configurable: true
|
|
3740
|
+
});
|
|
3741
|
+
case "prerender-legacy":
|
|
3742
|
+
case "request":
|
|
3743
|
+
case "unstable-cache":
|
|
3744
|
+
break;
|
|
3745
|
+
default:
|
|
3746
|
+
workUnitStore;
|
|
3747
|
+
}
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
function useDynamicSearchParams(expression) {
|
|
3751
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
3752
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
3753
|
+
if (!workStore) {
|
|
3754
|
+
return;
|
|
3755
|
+
}
|
|
3756
|
+
if (!workUnitStore) {
|
|
3757
|
+
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(expression);
|
|
3758
|
+
}
|
|
3759
|
+
switch (workUnitStore.type) {
|
|
3760
|
+
case "validation-client":
|
|
3761
|
+
return;
|
|
3762
|
+
case "prerender-client": {
|
|
3763
|
+
_react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, workStore.route, expression));
|
|
3764
|
+
break;
|
|
3765
|
+
}
|
|
3766
|
+
case "prerender-legacy":
|
|
3767
|
+
case "prerender-ppr": {
|
|
3768
|
+
if (workStore.forceStatic) {
|
|
3769
|
+
return;
|
|
3770
|
+
}
|
|
3771
|
+
throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(expression), "__NEXT_ERROR_CODE", {
|
|
3772
|
+
value: "E394",
|
|
3773
|
+
enumerable: false,
|
|
3774
|
+
configurable: true
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3777
|
+
case "prerender":
|
|
3778
|
+
case "prerender-runtime":
|
|
3779
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called from a Server Component. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3780
|
+
value: "E795",
|
|
3781
|
+
enumerable: false,
|
|
3782
|
+
configurable: true
|
|
3783
|
+
});
|
|
3784
|
+
case "cache":
|
|
3785
|
+
case "unstable-cache":
|
|
3786
|
+
case "private-cache":
|
|
3787
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called inside a cache scope. Next.js should be preventing ${expression} from being included in server components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3788
|
+
value: "E745",
|
|
3789
|
+
enumerable: false,
|
|
3790
|
+
configurable: true
|
|
3791
|
+
});
|
|
3792
|
+
case "generate-static-params":
|
|
3793
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`\`${expression}\` was called in \`generateStaticParams\`. Next.js should be preventing ${expression} from being included in server component files statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
3794
|
+
value: "E1130",
|
|
3795
|
+
enumerable: false,
|
|
3796
|
+
configurable: true
|
|
3797
|
+
});
|
|
3798
|
+
case "request":
|
|
3799
|
+
return;
|
|
3800
|
+
default:
|
|
3801
|
+
workUnitStore;
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
var hasSuspenseRegex = /\n\s+at Suspense \(<anonymous>\)/;
|
|
3805
|
+
var bodyAndImplicitTags = "body|div|main|section|article|aside|header|footer|nav|form|p|span|h1|h2|h3|h4|h5|h6";
|
|
3806
|
+
var hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex = new RegExp(`\\n\\s+at Suspense \\(<anonymous>\\)(?:(?!\\n\\s+at (?:${bodyAndImplicitTags}) \\(<anonymous>\\))[\\s\\S])*?\\n\\s+at ${_boundaryconstants.ROOT_LAYOUT_BOUNDARY_NAME} \\([^\\n]*\\)`);
|
|
3807
|
+
var hasMetadataRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.METADATA_BOUNDARY_NAME}[\\n\\s]`);
|
|
3808
|
+
var hasViewportRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`);
|
|
3809
|
+
var hasOutletRegex = new RegExp(`\\n\\s+at ${_boundaryconstants.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
|
|
3810
|
+
var hasInstantValidationBoundaryRegex = new RegExp(`\\n\\s+at ${_boundaryconstants1.INSTANT_VALIDATION_BOUNDARY_NAME}[\\n\\s]`);
|
|
3811
|
+
function trackAllowedDynamicAccess(workStore, componentStack, dynamicValidation, clientDynamic) {
|
|
3812
|
+
if (hasOutletRegex.test(componentStack)) {
|
|
3813
|
+
return;
|
|
3814
|
+
} else if (hasMetadataRegex.test(componentStack)) {
|
|
3815
|
+
dynamicValidation.hasDynamicMetadata = true;
|
|
3816
|
+
return;
|
|
3817
|
+
} else if (hasViewportRegex.test(componentStack)) {
|
|
3818
|
+
dynamicValidation.hasDynamicViewport = true;
|
|
3819
|
+
return;
|
|
3820
|
+
} else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {
|
|
3821
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3822
|
+
dynamicValidation.hasSuspenseAboveBody = true;
|
|
3823
|
+
return;
|
|
3824
|
+
} else if (hasSuspenseRegex.test(componentStack)) {
|
|
3825
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3826
|
+
return;
|
|
3827
|
+
} else if (clientDynamic.syncDynamicErrorWithStack) {
|
|
3828
|
+
dynamicValidation.dynamicErrors.push(clientDynamic.syncDynamicErrorWithStack);
|
|
3829
|
+
return;
|
|
3830
|
+
} else {
|
|
3831
|
+
const message = `Route "${workStore.route}": Uncached data was accessed outside of <Suspense>. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`;
|
|
3832
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
3833
|
+
value: "E1079",
|
|
3834
|
+
enumerable: false,
|
|
3835
|
+
configurable: true
|
|
3836
|
+
}), componentStack, null);
|
|
3837
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
3838
|
+
return;
|
|
3839
|
+
}
|
|
3840
|
+
}
|
|
3841
|
+
var DynamicHoleKind = /* @__PURE__ */ (function(DynamicHoleKind2) {
|
|
3842
|
+
DynamicHoleKind2[DynamicHoleKind2["Runtime"] = 1] = "Runtime";
|
|
3843
|
+
DynamicHoleKind2[DynamicHoleKind2["Dynamic"] = 2] = "Dynamic";
|
|
3844
|
+
return DynamicHoleKind2;
|
|
3845
|
+
})({});
|
|
3846
|
+
function createInstantValidationState(createInstantStack) {
|
|
3847
|
+
return {
|
|
3848
|
+
hasDynamicMetadata: false,
|
|
3849
|
+
hasAllowedClientDynamicAboveBoundary: false,
|
|
3850
|
+
dynamicMetadata: null,
|
|
3851
|
+
hasDynamicViewport: false,
|
|
3852
|
+
hasAllowedDynamic: false,
|
|
3853
|
+
dynamicErrors: [],
|
|
3854
|
+
validationPreventingErrors: [],
|
|
3855
|
+
thrownErrorsOutsideBoundary: [],
|
|
3856
|
+
createInstantStack
|
|
3857
|
+
};
|
|
3858
|
+
}
|
|
3859
|
+
function trackDynamicHoleInNavigation(workStore, componentStack, dynamicValidation, clientDynamic, kind, boundaryState) {
|
|
3860
|
+
if (hasOutletRegex.test(componentStack)) {
|
|
3861
|
+
return;
|
|
3862
|
+
}
|
|
3863
|
+
if (hasMetadataRegex.test(componentStack)) {
|
|
3864
|
+
const usageDescription2 = kind === 1 ? `Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments.` : `Uncached data or \`connection()\` was accessed inside \`generateMetadata\`.`;
|
|
3865
|
+
const message2 = `Route "${workStore.route}": ${usageDescription2} Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`;
|
|
3866
|
+
const error2 = addErrorContext(Object.defineProperty(new Error(message2), "__NEXT_ERROR_CODE", {
|
|
3867
|
+
value: "E1076",
|
|
3868
|
+
enumerable: false,
|
|
3869
|
+
configurable: true
|
|
3870
|
+
}), componentStack, dynamicValidation.createInstantStack);
|
|
3871
|
+
dynamicValidation.dynamicMetadata = error2;
|
|
3872
|
+
return;
|
|
3873
|
+
}
|
|
3874
|
+
if (hasViewportRegex.test(componentStack)) {
|
|
3875
|
+
const usageDescription2 = kind === 1 ? `Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`.` : `Uncached data or \`connection()\` was accessed inside \`generateViewport\`.`;
|
|
3876
|
+
const message2 = `Route "${workStore.route}": ${usageDescription2} This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`;
|
|
3877
|
+
const error2 = addErrorContext(Object.defineProperty(new Error(message2), "__NEXT_ERROR_CODE", {
|
|
3878
|
+
value: "E1086",
|
|
3879
|
+
enumerable: false,
|
|
3880
|
+
configurable: true
|
|
3881
|
+
}), componentStack, dynamicValidation.createInstantStack);
|
|
3882
|
+
dynamicValidation.dynamicErrors.push(error2);
|
|
3883
|
+
return;
|
|
3884
|
+
}
|
|
3885
|
+
const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack);
|
|
3886
|
+
if (!boundaryLocation) {
|
|
3887
|
+
if (boundaryState.expectedIds.size === boundaryState.renderedIds.size) {
|
|
3888
|
+
dynamicValidation.hasAllowedClientDynamicAboveBoundary = true;
|
|
3889
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3890
|
+
return;
|
|
3891
|
+
} else {
|
|
3892
|
+
const message2 = `Route "${workStore.route}": Could not validate \`unstable_instant\` because a Client Component in a parent segment prevented the page from rendering.`;
|
|
3893
|
+
const error2 = addErrorContext(Object.defineProperty(new Error(message2), "__NEXT_ERROR_CODE", {
|
|
3894
|
+
value: "E1082",
|
|
3895
|
+
enumerable: false,
|
|
3896
|
+
configurable: true
|
|
3897
|
+
}), componentStack, dynamicValidation.createInstantStack);
|
|
3898
|
+
dynamicValidation.validationPreventingErrors.push(error2);
|
|
3899
|
+
return;
|
|
3900
|
+
}
|
|
3901
|
+
} else {
|
|
3902
|
+
const suspenseLocation = hasSuspenseRegex.exec(componentStack);
|
|
3903
|
+
if (suspenseLocation) {
|
|
3904
|
+
if (suspenseLocation.index < boundaryLocation.index) {
|
|
3905
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3906
|
+
return;
|
|
3907
|
+
} else {
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3911
|
+
if (clientDynamic.syncDynamicErrorWithStack) {
|
|
3912
|
+
const syncError = clientDynamic.syncDynamicErrorWithStack;
|
|
3913
|
+
if (dynamicValidation.createInstantStack !== null && syncError.cause === void 0) {
|
|
3914
|
+
syncError.cause = dynamicValidation.createInstantStack();
|
|
3915
|
+
}
|
|
3916
|
+
dynamicValidation.dynamicErrors.push(syncError);
|
|
3917
|
+
return;
|
|
3918
|
+
}
|
|
3919
|
+
const usageDescription = kind === 1 ? `Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`.` : `Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`.`;
|
|
3920
|
+
const message = `Route "${workStore.route}": ${usageDescription} This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`;
|
|
3921
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
3922
|
+
value: "E1078",
|
|
3923
|
+
enumerable: false,
|
|
3924
|
+
configurable: true
|
|
3925
|
+
}), componentStack, dynamicValidation.createInstantStack);
|
|
3926
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
3927
|
+
return;
|
|
3928
|
+
}
|
|
3929
|
+
function trackThrownErrorInNavigation(workStore, dynamicValidation, thrownValue, componentStack) {
|
|
3930
|
+
const boundaryLocation = hasInstantValidationBoundaryRegex.exec(componentStack);
|
|
3931
|
+
if (!boundaryLocation) {
|
|
3932
|
+
const error = addErrorContext(Object.defineProperty(new Error("An error occurred while attempting to validate instant UI. This error may be preventing the validation from completing.", {
|
|
3933
|
+
cause: thrownValue
|
|
3934
|
+
}), "__NEXT_ERROR_CODE", {
|
|
3935
|
+
value: "E1118",
|
|
3936
|
+
enumerable: false,
|
|
3937
|
+
configurable: true
|
|
3938
|
+
}), componentStack, null);
|
|
3939
|
+
dynamicValidation.thrownErrorsOutsideBoundary.push(error);
|
|
3940
|
+
} else {
|
|
3941
|
+
const suspenseLocation = hasSuspenseRegex.exec(componentStack);
|
|
3942
|
+
if (suspenseLocation) {
|
|
3943
|
+
if (suspenseLocation.index < boundaryLocation.index) {
|
|
3944
|
+
return;
|
|
3945
|
+
} else {
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
const message = `Route "${workStore.route}": Could not validate \`unstable_instant\` because an error prevented the target segment from rendering.`;
|
|
3949
|
+
const error = addErrorContext(
|
|
3950
|
+
Object.defineProperty(new Error(message, {
|
|
3951
|
+
cause: thrownValue
|
|
3952
|
+
}), "__NEXT_ERROR_CODE", {
|
|
3953
|
+
value: "E1112",
|
|
3954
|
+
enumerable: false,
|
|
3955
|
+
configurable: true
|
|
3956
|
+
}),
|
|
3957
|
+
componentStack,
|
|
3958
|
+
null
|
|
3959
|
+
// TODO(instant-validation-build): conflicting use of cause
|
|
3960
|
+
);
|
|
3961
|
+
dynamicValidation.validationPreventingErrors.push(error);
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
function trackDynamicHoleInRuntimeShell(workStore, componentStack, dynamicValidation, clientDynamic) {
|
|
3965
|
+
if (hasOutletRegex.test(componentStack)) {
|
|
3966
|
+
return;
|
|
3967
|
+
} else if (hasMetadataRegex.test(componentStack)) {
|
|
3968
|
+
const message2 = `Route "${workStore.route}": Uncached data or \`connection()\` was accessed inside \`generateMetadata\`. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`;
|
|
3969
|
+
const error2 = addErrorContext(Object.defineProperty(new Error(message2), "__NEXT_ERROR_CODE", {
|
|
3970
|
+
value: "E1080",
|
|
3971
|
+
enumerable: false,
|
|
3972
|
+
configurable: true
|
|
3973
|
+
}), componentStack, null);
|
|
3974
|
+
dynamicValidation.dynamicMetadata = error2;
|
|
3975
|
+
return;
|
|
3976
|
+
} else if (hasViewportRegex.test(componentStack)) {
|
|
3977
|
+
const message2 = `Route "${workStore.route}": Uncached data or \`connection()\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`;
|
|
3978
|
+
const error2 = addErrorContext(Object.defineProperty(new Error(message2), "__NEXT_ERROR_CODE", {
|
|
3979
|
+
value: "E1077",
|
|
3980
|
+
enumerable: false,
|
|
3981
|
+
configurable: true
|
|
3982
|
+
}), componentStack, null);
|
|
3983
|
+
dynamicValidation.dynamicErrors.push(error2);
|
|
3984
|
+
return;
|
|
3985
|
+
} else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {
|
|
3986
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3987
|
+
dynamicValidation.hasSuspenseAboveBody = true;
|
|
3988
|
+
return;
|
|
3989
|
+
} else if (hasSuspenseRegex.test(componentStack)) {
|
|
3990
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
3991
|
+
return;
|
|
3992
|
+
} else if (clientDynamic.syncDynamicErrorWithStack) {
|
|
3993
|
+
dynamicValidation.dynamicErrors.push(clientDynamic.syncDynamicErrorWithStack);
|
|
3994
|
+
return;
|
|
3995
|
+
}
|
|
3996
|
+
const message = `Route "${workStore.route}": Uncached data or \`connection()\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`;
|
|
3997
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
3998
|
+
value: "E1084",
|
|
3999
|
+
enumerable: false,
|
|
4000
|
+
configurable: true
|
|
4001
|
+
}), componentStack, null);
|
|
4002
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
4003
|
+
return;
|
|
4004
|
+
}
|
|
4005
|
+
function trackDynamicHoleInStaticShell(workStore, componentStack, dynamicValidation, clientDynamic) {
|
|
4006
|
+
if (hasOutletRegex.test(componentStack)) {
|
|
4007
|
+
return;
|
|
4008
|
+
} else if (hasMetadataRegex.test(componentStack)) {
|
|
4009
|
+
const message = `Route "${workStore.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateMetadata\` or you have file-based metadata such as icons that depend on dynamic params segments. Except for this instance, the page would have been entirely prerenderable which may have been the intended behavior. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`;
|
|
4010
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
4011
|
+
value: "E1085",
|
|
4012
|
+
enumerable: false,
|
|
4013
|
+
configurable: true
|
|
4014
|
+
}), componentStack, null);
|
|
4015
|
+
dynamicValidation.dynamicMetadata = error;
|
|
4016
|
+
return;
|
|
4017
|
+
} else if (hasViewportRegex.test(componentStack)) {
|
|
4018
|
+
const message = `Route "${workStore.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed inside \`generateViewport\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`;
|
|
4019
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
4020
|
+
value: "E1081",
|
|
4021
|
+
enumerable: false,
|
|
4022
|
+
configurable: true
|
|
4023
|
+
}), componentStack, null);
|
|
4024
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
4025
|
+
return;
|
|
4026
|
+
} else if (hasSuspenseBeforeRootLayoutWithoutBodyOrImplicitBodyRegex.test(componentStack)) {
|
|
4027
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
4028
|
+
dynamicValidation.hasSuspenseAboveBody = true;
|
|
4029
|
+
return;
|
|
4030
|
+
} else if (hasSuspenseRegex.test(componentStack)) {
|
|
4031
|
+
dynamicValidation.hasAllowedDynamic = true;
|
|
4032
|
+
return;
|
|
4033
|
+
} else if (clientDynamic.syncDynamicErrorWithStack) {
|
|
4034
|
+
dynamicValidation.dynamicErrors.push(clientDynamic.syncDynamicErrorWithStack);
|
|
4035
|
+
return;
|
|
4036
|
+
} else {
|
|
4037
|
+
const message = `Route "${workStore.route}": Runtime data such as \`cookies()\`, \`headers()\`, \`params\`, or \`searchParams\` was accessed outside of \`<Suspense>\`. This delays the entire page from rendering, resulting in a slow user experience. Learn more: https://nextjs.org/docs/messages/blocking-route`;
|
|
4038
|
+
const error = addErrorContext(Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
4039
|
+
value: "E1083",
|
|
4040
|
+
enumerable: false,
|
|
4041
|
+
configurable: true
|
|
4042
|
+
}), componentStack, null);
|
|
4043
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
4044
|
+
return;
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
function addErrorContext(error, componentStack, createInstantStack) {
|
|
4048
|
+
const ownerStack = process.env.NODE_ENV !== "production" && _react.default.captureOwnerStack ? _react.default.captureOwnerStack() : null;
|
|
4049
|
+
if (createInstantStack !== null) {
|
|
4050
|
+
error.cause = createInstantStack();
|
|
4051
|
+
}
|
|
4052
|
+
error.stack = error.name + ": " + error.message + (ownerStack || componentStack);
|
|
4053
|
+
return error;
|
|
4054
|
+
}
|
|
4055
|
+
var PreludeState = /* @__PURE__ */ (function(PreludeState2) {
|
|
4056
|
+
PreludeState2[PreludeState2["Full"] = 0] = "Full";
|
|
4057
|
+
PreludeState2[PreludeState2["Empty"] = 1] = "Empty";
|
|
4058
|
+
PreludeState2[PreludeState2["Errored"] = 2] = "Errored";
|
|
4059
|
+
return PreludeState2;
|
|
4060
|
+
})({});
|
|
4061
|
+
function logDisallowedDynamicError(workStore, error) {
|
|
4062
|
+
console.error(error);
|
|
4063
|
+
if (process.env.NODE_ENV !== "development") {
|
|
4064
|
+
console.error(`To get a more detailed stack trace and pinpoint the issue, try one of the following:
|
|
4065
|
+
- Start the app in development mode by running \`next dev\`, then open "${workStore.route}" in your browser to investigate the error.
|
|
4066
|
+
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.`);
|
|
4067
|
+
} else if (!process.env.__NEXT_DEV_SERVER) {
|
|
4068
|
+
console.error(`To debug the issue, start the app in development mode by running \`next dev\`, then open "${workStore.route}" in your browser to investigate the error.`);
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
function throwIfDisallowedDynamic(workStore, prelude, dynamicValidation, serverDynamic) {
|
|
4072
|
+
if (serverDynamic.syncDynamicErrorWithStack) {
|
|
4073
|
+
logDisallowedDynamicError(workStore, serverDynamic.syncDynamicErrorWithStack);
|
|
4074
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
4075
|
+
}
|
|
4076
|
+
if (prelude !== 0) {
|
|
4077
|
+
if (dynamicValidation.hasSuspenseAboveBody) {
|
|
4078
|
+
return;
|
|
4079
|
+
}
|
|
4080
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
4081
|
+
if (dynamicErrors.length > 0) {
|
|
4082
|
+
for (let i = 0; i < dynamicErrors.length; i++) {
|
|
4083
|
+
logDisallowedDynamicError(workStore, dynamicErrors[i]);
|
|
4084
|
+
}
|
|
4085
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
4086
|
+
}
|
|
4087
|
+
if (dynamicValidation.hasDynamicViewport) {
|
|
4088
|
+
console.error(`Route "${workStore.route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) without explicitly allowing fully dynamic rendering. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-viewport`);
|
|
4089
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
4090
|
+
}
|
|
4091
|
+
if (prelude === 1) {
|
|
4092
|
+
console.error(`Route "${workStore.route}" did not produce a static shell and Next.js was unable to determine a reason. This is a bug in Next.js.`);
|
|
4093
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
4094
|
+
}
|
|
4095
|
+
} else {
|
|
4096
|
+
if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.hasDynamicMetadata) {
|
|
4097
|
+
console.error(`Route "${workStore.route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or uncached external data (\`fetch(...)\`, etc...) when the rest of the route does not. See more info here: https://nextjs.org/docs/messages/next-prerender-dynamic-metadata`);
|
|
4098
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
4099
|
+
}
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
function getStaticShellDisallowedDynamicReasons(workStore, prelude, dynamicValidation, configAllowsBlocking) {
|
|
4103
|
+
if (configAllowsBlocking || dynamicValidation.hasSuspenseAboveBody) {
|
|
4104
|
+
return [];
|
|
4105
|
+
}
|
|
4106
|
+
if (prelude !== 0) {
|
|
4107
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
4108
|
+
if (dynamicErrors.length > 0) {
|
|
4109
|
+
return dynamicErrors;
|
|
4110
|
+
}
|
|
4111
|
+
if (prelude === 1) {
|
|
4112
|
+
return [
|
|
4113
|
+
Object.defineProperty(new _invarianterror.InvariantError(`Route "${workStore.route}" did not produce a static shell and Next.js was unable to determine a reason.`), "__NEXT_ERROR_CODE", {
|
|
4114
|
+
value: "E936",
|
|
4115
|
+
enumerable: false,
|
|
4116
|
+
configurable: true
|
|
4117
|
+
})
|
|
4118
|
+
];
|
|
4119
|
+
}
|
|
4120
|
+
} else {
|
|
4121
|
+
if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicErrors.length === 0 && dynamicValidation.dynamicMetadata) {
|
|
4122
|
+
return [
|
|
4123
|
+
dynamicValidation.dynamicMetadata
|
|
4124
|
+
];
|
|
4125
|
+
}
|
|
4126
|
+
}
|
|
4127
|
+
return [];
|
|
4128
|
+
}
|
|
4129
|
+
function getNavigationDisallowedDynamicReasons(workStore, prelude, dynamicValidation, validationSampleTracking, boundaryState) {
|
|
4130
|
+
if (validationSampleTracking) {
|
|
4131
|
+
const { missingSampleErrors } = validationSampleTracking;
|
|
4132
|
+
if (missingSampleErrors.length > 0) {
|
|
4133
|
+
return missingSampleErrors;
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
const { validationPreventingErrors } = dynamicValidation;
|
|
4137
|
+
if (validationPreventingErrors.length > 0) {
|
|
4138
|
+
return validationPreventingErrors;
|
|
4139
|
+
}
|
|
4140
|
+
if (boundaryState.renderedIds.size < boundaryState.expectedIds.size) {
|
|
4141
|
+
const { thrownErrorsOutsideBoundary, createInstantStack } = dynamicValidation;
|
|
4142
|
+
if (thrownErrorsOutsideBoundary.length === 0) {
|
|
4143
|
+
const message = `Route "${workStore.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering for an unknown reason.`;
|
|
4144
|
+
const error = createInstantStack !== null ? createInstantStack() : new Error();
|
|
4145
|
+
error.name = "Error";
|
|
4146
|
+
error.message = message;
|
|
4147
|
+
return [
|
|
4148
|
+
error
|
|
4149
|
+
];
|
|
4150
|
+
} else if (thrownErrorsOutsideBoundary.length === 1) {
|
|
4151
|
+
const message = `Route "${workStore.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering, likely due to the following error.`;
|
|
4152
|
+
const error = createInstantStack !== null ? createInstantStack() : new Error();
|
|
4153
|
+
error.name = "Error";
|
|
4154
|
+
error.message = message;
|
|
4155
|
+
return [
|
|
4156
|
+
error,
|
|
4157
|
+
thrownErrorsOutsideBoundary[0]
|
|
4158
|
+
];
|
|
4159
|
+
} else {
|
|
4160
|
+
const message = `Route "${workStore.route}": Could not validate \`unstable_instant\` because the target segment was prevented from rendering, likely due to one of the following errors.`;
|
|
4161
|
+
const error = createInstantStack !== null ? createInstantStack() : new Error();
|
|
4162
|
+
error.name = "Error";
|
|
4163
|
+
error.message = message;
|
|
4164
|
+
return [
|
|
4165
|
+
error,
|
|
4166
|
+
...thrownErrorsOutsideBoundary
|
|
4167
|
+
];
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
if (prelude !== 0) {
|
|
4171
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
4172
|
+
if (dynamicErrors.length > 0) {
|
|
4173
|
+
return dynamicErrors;
|
|
4174
|
+
}
|
|
4175
|
+
if (prelude === 1) {
|
|
4176
|
+
if (dynamicValidation.hasAllowedClientDynamicAboveBoundary) {
|
|
4177
|
+
return [];
|
|
4178
|
+
}
|
|
4179
|
+
return [
|
|
4180
|
+
Object.defineProperty(new _invarianterror.InvariantError(`Route "${workStore.route}" failed to render during instant validation and Next.js was unable to determine a reason.`), "__NEXT_ERROR_CODE", {
|
|
4181
|
+
value: "E1055",
|
|
4182
|
+
enumerable: false,
|
|
4183
|
+
configurable: true
|
|
4184
|
+
})
|
|
4185
|
+
];
|
|
4186
|
+
}
|
|
4187
|
+
} else {
|
|
4188
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
4189
|
+
if (dynamicErrors.length > 0) {
|
|
4190
|
+
return dynamicErrors;
|
|
4191
|
+
}
|
|
4192
|
+
if (dynamicValidation.hasAllowedDynamic === false && dynamicValidation.dynamicMetadata) {
|
|
4193
|
+
return [
|
|
4194
|
+
dynamicValidation.dynamicMetadata
|
|
4195
|
+
];
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
return [];
|
|
4199
|
+
}
|
|
4200
|
+
}
|
|
4201
|
+
});
|
|
4202
|
+
|
|
4203
|
+
// ../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js
|
|
4204
|
+
var require_after_task_async_storage_instance = __commonJS({
|
|
4205
|
+
"../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js"(exports) {
|
|
4206
|
+
"use strict";
|
|
4207
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4208
|
+
value: true
|
|
4209
|
+
});
|
|
4210
|
+
Object.defineProperty(exports, "afterTaskAsyncStorageInstance", {
|
|
4211
|
+
enumerable: true,
|
|
4212
|
+
get: function() {
|
|
4213
|
+
return afterTaskAsyncStorageInstance;
|
|
4214
|
+
}
|
|
4215
|
+
});
|
|
4216
|
+
var _asynclocalstorage = require_async_local_storage();
|
|
4217
|
+
var afterTaskAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
4218
|
+
}
|
|
4219
|
+
});
|
|
4220
|
+
|
|
4221
|
+
// ../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js
|
|
4222
|
+
var require_after_task_async_storage_external = __commonJS({
|
|
4223
|
+
"../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js"(exports) {
|
|
4224
|
+
"use strict";
|
|
4225
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4226
|
+
value: true
|
|
4227
|
+
});
|
|
4228
|
+
Object.defineProperty(exports, "afterTaskAsyncStorage", {
|
|
4229
|
+
enumerable: true,
|
|
4230
|
+
get: function() {
|
|
4231
|
+
return _aftertaskasyncstorageinstance.afterTaskAsyncStorageInstance;
|
|
4232
|
+
}
|
|
4233
|
+
});
|
|
4234
|
+
var _aftertaskasyncstorageinstance = require_after_task_async_storage_instance();
|
|
4235
|
+
}
|
|
4236
|
+
});
|
|
4237
|
+
|
|
4238
|
+
// ../../node_modules/next/dist/server/request/utils.js
|
|
4239
|
+
var require_utils2 = __commonJS({
|
|
4240
|
+
"../../node_modules/next/dist/server/request/utils.js"(exports) {
|
|
4241
|
+
"use strict";
|
|
4242
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4243
|
+
value: true
|
|
4244
|
+
});
|
|
4245
|
+
function _export(target, all) {
|
|
4246
|
+
for (var name in all) Object.defineProperty(target, name, {
|
|
4247
|
+
enumerable: true,
|
|
4248
|
+
get: all[name]
|
|
4249
|
+
});
|
|
4250
|
+
}
|
|
4251
|
+
_export(exports, {
|
|
4252
|
+
isRequestAPICallableInsideAfter: function() {
|
|
4253
|
+
return isRequestAPICallableInsideAfter;
|
|
4254
|
+
},
|
|
4255
|
+
throwForSearchParamsAccessInUseCache: function() {
|
|
4256
|
+
return throwForSearchParamsAccessInUseCache;
|
|
4257
|
+
},
|
|
4258
|
+
throwWithStaticGenerationBailoutErrorWithDynamicError: function() {
|
|
4259
|
+
return throwWithStaticGenerationBailoutErrorWithDynamicError;
|
|
4260
|
+
}
|
|
4261
|
+
});
|
|
4262
|
+
var _staticgenerationbailout = require_static_generation_bailout();
|
|
4263
|
+
var _aftertaskasyncstorageexternal = require_after_task_async_storage_external();
|
|
4264
|
+
function throwWithStaticGenerationBailoutErrorWithDynamicError(route, expression) {
|
|
4265
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${route} with \`dynamic = "error"\` couldn't be rendered statically because it used ${expression}. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
4266
|
+
value: "E543",
|
|
4267
|
+
enumerable: false,
|
|
4268
|
+
configurable: true
|
|
4269
|
+
});
|
|
4270
|
+
}
|
|
4271
|
+
function throwForSearchParamsAccessInUseCache(workStore, constructorOpt) {
|
|
4272
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used \`searchParams\` inside "use cache". Accessing dynamic request data inside a cache scope is not supported. If you need some search params inside a cached function await \`searchParams\` outside of the cached function and pass only the required search params as arguments to the cached function. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
4273
|
+
value: "E842",
|
|
4274
|
+
enumerable: false,
|
|
4275
|
+
configurable: true
|
|
4276
|
+
});
|
|
4277
|
+
Error.captureStackTrace(error, constructorOpt);
|
|
4278
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
4279
|
+
throw error;
|
|
4280
|
+
}
|
|
4281
|
+
function isRequestAPICallableInsideAfter() {
|
|
4282
|
+
const afterTaskStore = _aftertaskasyncstorageexternal.afterTaskAsyncStorage.getStore();
|
|
4283
|
+
return (afterTaskStore == null ? void 0 : afterTaskStore.rootTaskSpawnPhase) === "action";
|
|
4284
|
+
}
|
|
4285
|
+
}
|
|
4286
|
+
});
|
|
4287
|
+
|
|
4288
|
+
// ../../node_modules/next/dist/server/request/connection.js
|
|
4289
|
+
var require_connection = __commonJS({
|
|
4290
|
+
"../../node_modules/next/dist/server/request/connection.js"(exports) {
|
|
4291
|
+
"use strict";
|
|
4292
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4293
|
+
value: true
|
|
4294
|
+
});
|
|
4295
|
+
Object.defineProperty(exports, "connection", {
|
|
4296
|
+
enumerable: true,
|
|
4297
|
+
get: function() {
|
|
4298
|
+
return connection;
|
|
4299
|
+
}
|
|
4300
|
+
});
|
|
4301
|
+
var _workasyncstorageexternal = require_work_async_storage_external();
|
|
4302
|
+
var _workunitasyncstorageexternal = require_work_unit_async_storage_external();
|
|
4303
|
+
var _dynamicrendering = require_dynamic_rendering();
|
|
4304
|
+
var _staticgenerationbailout = require_static_generation_bailout();
|
|
4305
|
+
var _dynamicrenderingutils = require_dynamic_rendering_utils();
|
|
4306
|
+
var _utils = require_utils2();
|
|
4307
|
+
var _stagedrendering = require_staged_rendering();
|
|
4308
|
+
var _invarianterror = require_invariant_error();
|
|
4309
|
+
function connection() {
|
|
4310
|
+
const callingExpression = "connection";
|
|
4311
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
4312
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
4313
|
+
if (workStore) {
|
|
4314
|
+
if (workUnitStore && workUnitStore.phase === "after" && !(0, _utils.isRequestAPICallableInsideAfter)()) {
|
|
4315
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`after()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but \`after()\` executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after`), "__NEXT_ERROR_CODE", {
|
|
4316
|
+
value: "E827",
|
|
4317
|
+
enumerable: false,
|
|
4318
|
+
configurable: true
|
|
4319
|
+
});
|
|
4320
|
+
}
|
|
4321
|
+
if (workStore.forceStatic) {
|
|
4322
|
+
return Promise.resolve(void 0);
|
|
4323
|
+
}
|
|
4324
|
+
if (workStore.dynamicShouldError) {
|
|
4325
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route ${workStore.route} with \`dynamic = "error"\` couldn't be rendered statically because it used \`connection()\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`), "__NEXT_ERROR_CODE", {
|
|
4326
|
+
value: "E847",
|
|
4327
|
+
enumerable: false,
|
|
4328
|
+
configurable: true
|
|
4329
|
+
});
|
|
4330
|
+
}
|
|
4331
|
+
if (workUnitStore) {
|
|
4332
|
+
switch (workUnitStore.type) {
|
|
4333
|
+
case "cache": {
|
|
4334
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside "use cache". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual request, but caches must be able to be produced before a request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
4335
|
+
value: "E841",
|
|
4336
|
+
enumerable: false,
|
|
4337
|
+
configurable: true
|
|
4338
|
+
});
|
|
4339
|
+
Error.captureStackTrace(error, connection);
|
|
4340
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
4341
|
+
throw error;
|
|
4342
|
+
}
|
|
4343
|
+
case "private-cache": {
|
|
4344
|
+
const error = Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside "use cache: private". The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual navigation request, but caches must be able to be produced before a navigation request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
4345
|
+
value: "E837",
|
|
4346
|
+
enumerable: false,
|
|
4347
|
+
configurable: true
|
|
4348
|
+
});
|
|
4349
|
+
Error.captureStackTrace(error, connection);
|
|
4350
|
+
workStore.invalidDynamicUsageError ?? (workStore.invalidDynamicUsageError = error);
|
|
4351
|
+
throw error;
|
|
4352
|
+
}
|
|
4353
|
+
case "unstable-cache":
|
|
4354
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside a function cached with \`unstable_cache()\`. The \`connection()\` function is used to indicate the subsequent code must only run when there is an actual Request, but caches must be able to be produced before a Request so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
4355
|
+
value: "E840",
|
|
4356
|
+
enumerable: false,
|
|
4357
|
+
configurable: true
|
|
4358
|
+
});
|
|
4359
|
+
case "generate-static-params":
|
|
4360
|
+
throw Object.defineProperty(new Error(`Route ${workStore.route} used \`connection()\` inside \`generateStaticParams\`. This is not supported because \`generateStaticParams\` runs at build time without an HTTP request. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context`), "__NEXT_ERROR_CODE", {
|
|
4361
|
+
value: "E1125",
|
|
4362
|
+
enumerable: false,
|
|
4363
|
+
configurable: true
|
|
4364
|
+
});
|
|
4365
|
+
case "prerender":
|
|
4366
|
+
case "prerender-client":
|
|
4367
|
+
case "prerender-runtime":
|
|
4368
|
+
return (0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, workStore.route, "`connection()`");
|
|
4369
|
+
case "validation-client": {
|
|
4370
|
+
const exportName = "`connection`";
|
|
4371
|
+
throw Object.defineProperty(new _invarianterror.InvariantError(`${exportName} must not be used within a Client Component. Next.js should be preventing ${exportName} from being included in Client Components statically, but did not in this case.`), "__NEXT_ERROR_CODE", {
|
|
4372
|
+
value: "E1063",
|
|
4373
|
+
enumerable: false,
|
|
4374
|
+
configurable: true
|
|
4375
|
+
});
|
|
4376
|
+
}
|
|
4377
|
+
case "prerender-ppr":
|
|
4378
|
+
return (0, _dynamicrendering.postponeWithTracking)(workStore.route, "connection", workUnitStore.dynamicTracking);
|
|
4379
|
+
case "prerender-legacy":
|
|
4380
|
+
return (0, _dynamicrendering.throwToInterruptStaticGeneration)("connection", workStore, workUnitStore);
|
|
4381
|
+
case "request":
|
|
4382
|
+
(0, _dynamicrendering.trackDynamicDataInDynamicRender)(workUnitStore);
|
|
4383
|
+
if (process.env.NODE_ENV === "development") {
|
|
4384
|
+
if (workUnitStore.asyncApiPromises) {
|
|
4385
|
+
return workUnitStore.asyncApiPromises.connection;
|
|
4386
|
+
}
|
|
4387
|
+
return (0, _dynamicrenderingutils.makeDevtoolsIOAwarePromise)(void 0, workUnitStore, _stagedrendering.RenderStage.Dynamic);
|
|
4388
|
+
} else if (workUnitStore.asyncApiPromises) {
|
|
4389
|
+
return workUnitStore.asyncApiPromises.connection;
|
|
4390
|
+
} else {
|
|
4391
|
+
return Promise.resolve(void 0);
|
|
4392
|
+
}
|
|
4393
|
+
default:
|
|
4394
|
+
workUnitStore;
|
|
4395
|
+
}
|
|
4396
|
+
}
|
|
4397
|
+
}
|
|
4398
|
+
(0, _workunitasyncstorageexternal.throwForMissingRequestStore)(callingExpression);
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
});
|
|
4402
|
+
|
|
4403
|
+
// ../../node_modules/next/server.js
|
|
4404
|
+
var require_server = __commonJS({
|
|
4405
|
+
"../../node_modules/next/server.js"(exports, module) {
|
|
4406
|
+
"use strict";
|
|
4407
|
+
var serverExports = {
|
|
4408
|
+
NextRequest: require_request().NextRequest,
|
|
4409
|
+
NextResponse: require_response().NextResponse,
|
|
4410
|
+
ImageResponse: require_image_response().ImageResponse,
|
|
4411
|
+
userAgentFromString: require_user_agent().userAgentFromString,
|
|
4412
|
+
userAgent: require_user_agent().userAgent,
|
|
4413
|
+
URLPattern: require_url_pattern().URLPattern,
|
|
4414
|
+
after: require_after2().after,
|
|
4415
|
+
connection: require_connection().connection
|
|
4416
|
+
};
|
|
4417
|
+
module.exports = serverExports;
|
|
4418
|
+
exports.NextRequest = serverExports.NextRequest;
|
|
4419
|
+
exports.NextResponse = serverExports.NextResponse;
|
|
4420
|
+
exports.ImageResponse = serverExports.ImageResponse;
|
|
4421
|
+
exports.userAgentFromString = serverExports.userAgentFromString;
|
|
4422
|
+
exports.userAgent = serverExports.userAgent;
|
|
4423
|
+
exports.URLPattern = serverExports.URLPattern;
|
|
4424
|
+
exports.after = serverExports.after;
|
|
4425
|
+
exports.connection = serverExports.connection;
|
|
4426
|
+
}
|
|
4427
|
+
});
|
|
4428
|
+
|
|
4429
|
+
// src/next.tsx
|
|
4430
|
+
var import_server = __toESM(require_server());
|
|
4431
|
+
import { jsx } from "react/jsx-runtime";
|
|
4432
|
+
function createAuthMiMiddleware(options) {
|
|
4433
|
+
return async function middleware(request) {
|
|
4434
|
+
const {
|
|
4435
|
+
baseUrl,
|
|
4436
|
+
apiKey,
|
|
4437
|
+
protectedPaths = [],
|
|
4438
|
+
scopedPaths = {},
|
|
4439
|
+
publicPaths = [],
|
|
4440
|
+
loginPath = "/login",
|
|
4441
|
+
forbiddenPath = "/forbidden"
|
|
4442
|
+
} = options;
|
|
4443
|
+
const pathname = request.nextUrl.pathname;
|
|
4444
|
+
if (publicPaths.some((p) => pathname.startsWith(p))) {
|
|
4445
|
+
return import_server.NextResponse.next();
|
|
4446
|
+
}
|
|
4447
|
+
const token = request.cookies.get("authmi_token")?.value || request.headers.get("Authorization")?.replace("Bearer ", "");
|
|
4448
|
+
if (!token) {
|
|
4449
|
+
if (protectedPaths.some((p) => pathname.startsWith(p))) {
|
|
4450
|
+
return import_server.NextResponse.redirect(new URL(loginPath, request.url));
|
|
4451
|
+
}
|
|
4452
|
+
if (Object.keys(scopedPaths).some((p) => pathname.startsWith(p))) {
|
|
4453
|
+
return import_server.NextResponse.redirect(new URL(loginPath, request.url));
|
|
4454
|
+
}
|
|
4455
|
+
return import_server.NextResponse.next();
|
|
4456
|
+
}
|
|
4457
|
+
const client = new AuthMiClient({ baseUrl, apiKey });
|
|
4458
|
+
try {
|
|
4459
|
+
const introspectResult = await client.introspect({
|
|
4460
|
+
serviceId: options.serviceId,
|
|
4461
|
+
token
|
|
4462
|
+
});
|
|
4463
|
+
if (!introspectResult.valid) {
|
|
4464
|
+
if (protectedPaths.some((p) => pathname.startsWith(p)) || Object.keys(scopedPaths).some((p) => pathname.startsWith(p))) {
|
|
4465
|
+
return import_server.NextResponse.redirect(new URL(loginPath, request.url));
|
|
4466
|
+
}
|
|
4467
|
+
return import_server.NextResponse.next();
|
|
4468
|
+
}
|
|
4469
|
+
for (const [pathPattern, requiredScopes] of Object.entries(scopedPaths)) {
|
|
4470
|
+
if (pathname.startsWith(pathPattern)) {
|
|
4471
|
+
const hasScopes = requiredScopes.every(
|
|
4472
|
+
(scope) => introspectResult.scopes?.includes(scope)
|
|
4473
|
+
);
|
|
4474
|
+
if (!hasScopes) {
|
|
4475
|
+
return import_server.NextResponse.redirect(new URL(forbiddenPath, request.url));
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
const requestHeaders = new Headers(request.headers);
|
|
4480
|
+
requestHeaders.set("x-user-id", introspectResult.userId || "");
|
|
4481
|
+
requestHeaders.set("x-user-email", introspectResult.email || "");
|
|
4482
|
+
requestHeaders.set("x-user-scopes", JSON.stringify(introspectResult.scopes || []));
|
|
4483
|
+
return import_server.NextResponse.next({
|
|
4484
|
+
request: {
|
|
4485
|
+
headers: requestHeaders
|
|
4486
|
+
}
|
|
4487
|
+
});
|
|
4488
|
+
} catch (error) {
|
|
4489
|
+
console.error("Auth middleware error:", error);
|
|
4490
|
+
if (protectedPaths.some((p) => pathname.startsWith(p)) || Object.keys(scopedPaths).some((p) => pathname.startsWith(p))) {
|
|
4491
|
+
return import_server.NextResponse.redirect(new URL(loginPath, request.url));
|
|
4492
|
+
}
|
|
4493
|
+
return import_server.NextResponse.next();
|
|
4494
|
+
}
|
|
4495
|
+
};
|
|
4496
|
+
}
|
|
4497
|
+
function withScope(Component, _requiredScopes, _config) {
|
|
4498
|
+
return function WithScopeWrapper(props) {
|
|
4499
|
+
return /* @__PURE__ */ jsx(Component, { ...props });
|
|
4500
|
+
};
|
|
4501
|
+
}
|
|
4502
|
+
async function validateScopes(request, options) {
|
|
4503
|
+
const { baseUrl, apiKey, requiredScopes, serviceId } = options;
|
|
4504
|
+
const authHeader = request.headers.get("Authorization");
|
|
4505
|
+
const token = authHeader?.replace("Bearer ", "");
|
|
4506
|
+
if (!token) {
|
|
4507
|
+
return { valid: false, error: "No token provided", status: 401 };
|
|
4508
|
+
}
|
|
4509
|
+
const client = new AuthMiClient({ baseUrl, apiKey, serviceId });
|
|
4510
|
+
if (!serviceId) {
|
|
4511
|
+
return { valid: false, error: "Service ID not configured", status: 500 };
|
|
4512
|
+
}
|
|
4513
|
+
try {
|
|
4514
|
+
const result = await client.introspect({
|
|
4515
|
+
serviceId: options.serviceId,
|
|
4516
|
+
token,
|
|
4517
|
+
requiredScopes
|
|
4518
|
+
});
|
|
4519
|
+
if (!result.valid) {
|
|
4520
|
+
return {
|
|
4521
|
+
valid: false,
|
|
4522
|
+
error: result.error || "Invalid token",
|
|
4523
|
+
status: result.error?.includes("scope") ? 403 : 401
|
|
4524
|
+
};
|
|
4525
|
+
}
|
|
4526
|
+
return {
|
|
4527
|
+
valid: true,
|
|
4528
|
+
userId: result.userId,
|
|
4529
|
+
email: result.email,
|
|
4530
|
+
scopes: result.scopes
|
|
4531
|
+
};
|
|
4532
|
+
} catch (error) {
|
|
4533
|
+
return { valid: false, error: "Validation failed", status: 500 };
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
export {
|
|
4537
|
+
AuthMiClient,
|
|
4538
|
+
AuthMiError,
|
|
4539
|
+
LocalStorageTokenStorage,
|
|
4540
|
+
MemoryTokenStorage,
|
|
4541
|
+
ScopeError,
|
|
4542
|
+
createAuthMiMiddleware,
|
|
4543
|
+
validateScopes,
|
|
4544
|
+
withScope
|
|
4545
|
+
};
|