lkd-web-kit 0.0.0 → 0.0.2
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/README.md +6 -11
- package/dist/components.cjs.js +3402 -0
- package/dist/components.d.ts +116 -0
- package/dist/components.es.js +3395 -0
- package/dist/consts.cjs.js +80 -0
- package/dist/consts.d.ts +73 -0
- package/dist/consts.es.js +75 -0
- package/dist/contexts.cjs.js +78 -0
- package/dist/contexts.d.ts +39 -0
- package/dist/contexts.es.js +70 -0
- package/dist/{index.cjs → form.cjs.js} +21 -3
- package/dist/{index.d.ts → form.d.ts} +6 -0
- package/dist/{index.js → form.es.js} +17 -1
- package/dist/hocs.cjs.js +76 -0
- package/dist/hocs.d.ts +34 -0
- package/dist/hocs.es.js +71 -0
- package/dist/hooks.cjs.js +12 -0
- package/dist/hooks.d.ts +11 -0
- package/dist/hooks.es.js +3 -0
- package/dist/mantine.cjs.js +29 -0
- package/dist/mantine.d.ts +16 -0
- package/dist/mantine.es.js +24 -0
- package/dist/navigation-DnFkn_t2.cjs +2518 -0
- package/dist/navigation-sZaWnl2V.js +2513 -0
- package/dist/types.cjs.js +2 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.es.js +1 -0
- package/dist/useFetchNextPageOnScroll-08q9N5OE.js +49 -0
- package/dist/useFetchNextPageOnScroll-Fqj7Vp-O.cjs +52 -0
- package/dist/utils.cjs.js +83 -0
- package/dist/utils.d.ts +29 -0
- package/dist/utils.es.js +74 -0
- package/dist/zodValidator-Bx6RMGoL.cjs +13 -0
- package/dist/zodValidator-ChEQ3cmF.js +11 -0
- package/package.json +50 -18
|
@@ -0,0 +1,2513 @@
|
|
|
1
|
+
import require$$0 from 'react';
|
|
2
|
+
|
|
3
|
+
var _interop_require_wildcard = {};
|
|
4
|
+
|
|
5
|
+
var hasRequired_interop_require_wildcard;
|
|
6
|
+
|
|
7
|
+
function require_interop_require_wildcard () {
|
|
8
|
+
if (hasRequired_interop_require_wildcard) return _interop_require_wildcard;
|
|
9
|
+
hasRequired_interop_require_wildcard = 1;
|
|
10
|
+
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
12
|
+
if (typeof WeakMap !== "function") return null;
|
|
13
|
+
|
|
14
|
+
var cacheBabelInterop = new WeakMap();
|
|
15
|
+
var cacheNodeInterop = new WeakMap();
|
|
16
|
+
|
|
17
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
18
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
19
|
+
})(nodeInterop);
|
|
20
|
+
}
|
|
21
|
+
function _interop_require_wildcard$1(obj, nodeInterop) {
|
|
22
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
23
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj };
|
|
24
|
+
|
|
25
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
26
|
+
|
|
27
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
28
|
+
|
|
29
|
+
var newObj = { __proto__: null };
|
|
30
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
31
|
+
|
|
32
|
+
for (var key in obj) {
|
|
33
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
34
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
35
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
36
|
+
else newObj[key] = obj[key];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
newObj.default = obj;
|
|
41
|
+
|
|
42
|
+
if (cache) cache.set(obj, newObj);
|
|
43
|
+
|
|
44
|
+
return newObj;
|
|
45
|
+
}
|
|
46
|
+
_interop_require_wildcard._ = _interop_require_wildcard$1;
|
|
47
|
+
return _interop_require_wildcard;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var segment = {};
|
|
51
|
+
|
|
52
|
+
var hasRequiredSegment;
|
|
53
|
+
|
|
54
|
+
function requireSegment () {
|
|
55
|
+
if (hasRequiredSegment) return segment;
|
|
56
|
+
hasRequiredSegment = 1;
|
|
57
|
+
(function (exports) {
|
|
58
|
+
Object.defineProperty(exports, "__esModule", {
|
|
59
|
+
value: true
|
|
60
|
+
});
|
|
61
|
+
function _export(target, all) {
|
|
62
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: all[name]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
_export(exports, {
|
|
68
|
+
DEFAULT_SEGMENT_KEY: function() {
|
|
69
|
+
return DEFAULT_SEGMENT_KEY;
|
|
70
|
+
},
|
|
71
|
+
PAGE_SEGMENT_KEY: function() {
|
|
72
|
+
return PAGE_SEGMENT_KEY;
|
|
73
|
+
},
|
|
74
|
+
addSearchParamsIfPageSegment: function() {
|
|
75
|
+
return addSearchParamsIfPageSegment;
|
|
76
|
+
},
|
|
77
|
+
isGroupSegment: function() {
|
|
78
|
+
return isGroupSegment;
|
|
79
|
+
},
|
|
80
|
+
isParallelRouteSegment: function() {
|
|
81
|
+
return isParallelRouteSegment;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
function isGroupSegment(segment) {
|
|
85
|
+
// Use array[0] for performant purpose
|
|
86
|
+
return segment[0] === '(' && segment.endsWith(')');
|
|
87
|
+
}
|
|
88
|
+
function isParallelRouteSegment(segment) {
|
|
89
|
+
return segment.startsWith('@') && segment !== '@children';
|
|
90
|
+
}
|
|
91
|
+
function addSearchParamsIfPageSegment(segment, searchParams) {
|
|
92
|
+
const isPageSegment = segment.includes(PAGE_SEGMENT_KEY);
|
|
93
|
+
if (isPageSegment) {
|
|
94
|
+
const stringifiedQuery = JSON.stringify(searchParams);
|
|
95
|
+
return stringifiedQuery !== '{}' ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery : PAGE_SEGMENT_KEY;
|
|
96
|
+
}
|
|
97
|
+
return segment;
|
|
98
|
+
}
|
|
99
|
+
const PAGE_SEGMENT_KEY = '__PAGE__';
|
|
100
|
+
const DEFAULT_SEGMENT_KEY = '__DEFAULT__';
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
} (segment));
|
|
104
|
+
return segment;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
var _interop_require_default = {};
|
|
108
|
+
|
|
109
|
+
var hasRequired_interop_require_default;
|
|
110
|
+
|
|
111
|
+
function require_interop_require_default () {
|
|
112
|
+
if (hasRequired_interop_require_default) return _interop_require_default;
|
|
113
|
+
hasRequired_interop_require_default = 1;
|
|
114
|
+
|
|
115
|
+
function _interop_require_default$1(obj) {
|
|
116
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
117
|
+
}
|
|
118
|
+
_interop_require_default._ = _interop_require_default$1;
|
|
119
|
+
return _interop_require_default;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var navigation$1 = {exports: {}};
|
|
123
|
+
|
|
124
|
+
var appRouterContext_sharedRuntime = {};
|
|
125
|
+
|
|
126
|
+
var hasRequiredAppRouterContext_sharedRuntime;
|
|
127
|
+
|
|
128
|
+
function requireAppRouterContext_sharedRuntime () {
|
|
129
|
+
if (hasRequiredAppRouterContext_sharedRuntime) return appRouterContext_sharedRuntime;
|
|
130
|
+
hasRequiredAppRouterContext_sharedRuntime = 1;
|
|
131
|
+
(function (exports) {
|
|
132
|
+
'use client';
|
|
133
|
+
Object.defineProperty(exports, "__esModule", {
|
|
134
|
+
value: true
|
|
135
|
+
});
|
|
136
|
+
function _export(target, all) {
|
|
137
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: all[name]
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
_export(exports, {
|
|
143
|
+
AppRouterContext: function() {
|
|
144
|
+
return AppRouterContext;
|
|
145
|
+
},
|
|
146
|
+
GlobalLayoutRouterContext: function() {
|
|
147
|
+
return GlobalLayoutRouterContext;
|
|
148
|
+
},
|
|
149
|
+
LayoutRouterContext: function() {
|
|
150
|
+
return LayoutRouterContext;
|
|
151
|
+
},
|
|
152
|
+
MissingSlotContext: function() {
|
|
153
|
+
return MissingSlotContext;
|
|
154
|
+
},
|
|
155
|
+
TemplateContext: function() {
|
|
156
|
+
return TemplateContext;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
const _interop_require_default = /*@__PURE__*/ require_interop_require_default();
|
|
160
|
+
const _react = /*#__PURE__*/ _interop_require_default._(require$$0);
|
|
161
|
+
const AppRouterContext = _react.default.createContext(null);
|
|
162
|
+
const LayoutRouterContext = _react.default.createContext(null);
|
|
163
|
+
const GlobalLayoutRouterContext = _react.default.createContext(null);
|
|
164
|
+
const TemplateContext = _react.default.createContext(null);
|
|
165
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
166
|
+
AppRouterContext.displayName = 'AppRouterContext';
|
|
167
|
+
LayoutRouterContext.displayName = 'LayoutRouterContext';
|
|
168
|
+
GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext';
|
|
169
|
+
TemplateContext.displayName = 'TemplateContext';
|
|
170
|
+
}
|
|
171
|
+
const MissingSlotContext = _react.default.createContext(new Set());
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
} (appRouterContext_sharedRuntime));
|
|
175
|
+
return appRouterContext_sharedRuntime;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
var hooksClientContext_sharedRuntime = {};
|
|
179
|
+
|
|
180
|
+
var hasRequiredHooksClientContext_sharedRuntime;
|
|
181
|
+
|
|
182
|
+
function requireHooksClientContext_sharedRuntime () {
|
|
183
|
+
if (hasRequiredHooksClientContext_sharedRuntime) return hooksClientContext_sharedRuntime;
|
|
184
|
+
hasRequiredHooksClientContext_sharedRuntime = 1;
|
|
185
|
+
(function (exports) {
|
|
186
|
+
'use client';
|
|
187
|
+
Object.defineProperty(exports, "__esModule", {
|
|
188
|
+
value: true
|
|
189
|
+
});
|
|
190
|
+
function _export(target, all) {
|
|
191
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
get: all[name]
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
_export(exports, {
|
|
197
|
+
PathParamsContext: function() {
|
|
198
|
+
return PathParamsContext;
|
|
199
|
+
},
|
|
200
|
+
PathnameContext: function() {
|
|
201
|
+
return PathnameContext;
|
|
202
|
+
},
|
|
203
|
+
SearchParamsContext: function() {
|
|
204
|
+
return SearchParamsContext;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const _react = require$$0;
|
|
208
|
+
const SearchParamsContext = (0, _react.createContext)(null);
|
|
209
|
+
const PathnameContext = (0, _react.createContext)(null);
|
|
210
|
+
const PathParamsContext = (0, _react.createContext)(null);
|
|
211
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
212
|
+
SearchParamsContext.displayName = 'SearchParamsContext';
|
|
213
|
+
PathnameContext.displayName = 'PathnameContext';
|
|
214
|
+
PathParamsContext.displayName = 'PathParamsContext';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
} (hooksClientContext_sharedRuntime));
|
|
219
|
+
return hooksClientContext_sharedRuntime;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
var getSegmentValue = {exports: {}};
|
|
223
|
+
|
|
224
|
+
var hasRequiredGetSegmentValue;
|
|
225
|
+
|
|
226
|
+
function requireGetSegmentValue () {
|
|
227
|
+
if (hasRequiredGetSegmentValue) return getSegmentValue.exports;
|
|
228
|
+
hasRequiredGetSegmentValue = 1;
|
|
229
|
+
(function (module, exports) {
|
|
230
|
+
Object.defineProperty(exports, "__esModule", {
|
|
231
|
+
value: true
|
|
232
|
+
});
|
|
233
|
+
Object.defineProperty(exports, "getSegmentValue", {
|
|
234
|
+
enumerable: true,
|
|
235
|
+
get: function() {
|
|
236
|
+
return getSegmentValue;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
function getSegmentValue(segment) {
|
|
240
|
+
return Array.isArray(segment) ? segment[1] : segment;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
244
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
245
|
+
Object.assign(exports.default, exports);
|
|
246
|
+
module.exports = exports.default;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
} (getSegmentValue, getSegmentValue.exports));
|
|
251
|
+
return getSegmentValue.exports;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
var navigation_reactServer = {exports: {}};
|
|
255
|
+
|
|
256
|
+
var redirect = {exports: {}};
|
|
257
|
+
|
|
258
|
+
var redirectStatusCode = {exports: {}};
|
|
259
|
+
|
|
260
|
+
var hasRequiredRedirectStatusCode;
|
|
261
|
+
|
|
262
|
+
function requireRedirectStatusCode () {
|
|
263
|
+
if (hasRequiredRedirectStatusCode) return redirectStatusCode.exports;
|
|
264
|
+
hasRequiredRedirectStatusCode = 1;
|
|
265
|
+
(function (module, exports) {
|
|
266
|
+
Object.defineProperty(exports, "__esModule", {
|
|
267
|
+
value: true
|
|
268
|
+
});
|
|
269
|
+
Object.defineProperty(exports, "RedirectStatusCode", {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
get: function() {
|
|
272
|
+
return RedirectStatusCode;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
var RedirectStatusCode = /*#__PURE__*/ function(RedirectStatusCode) {
|
|
276
|
+
RedirectStatusCode[RedirectStatusCode["SeeOther"] = 303] = "SeeOther";
|
|
277
|
+
RedirectStatusCode[RedirectStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect";
|
|
278
|
+
RedirectStatusCode[RedirectStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect";
|
|
279
|
+
return RedirectStatusCode;
|
|
280
|
+
}({});
|
|
281
|
+
|
|
282
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
283
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
284
|
+
Object.assign(exports.default, exports);
|
|
285
|
+
module.exports = exports.default;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
} (redirectStatusCode, redirectStatusCode.exports));
|
|
290
|
+
return redirectStatusCode.exports;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
var redirectError = {exports: {}};
|
|
294
|
+
|
|
295
|
+
var hasRequiredRedirectError;
|
|
296
|
+
|
|
297
|
+
function requireRedirectError () {
|
|
298
|
+
if (hasRequiredRedirectError) return redirectError.exports;
|
|
299
|
+
hasRequiredRedirectError = 1;
|
|
300
|
+
(function (module, exports) {
|
|
301
|
+
Object.defineProperty(exports, "__esModule", {
|
|
302
|
+
value: true
|
|
303
|
+
});
|
|
304
|
+
function _export(target, all) {
|
|
305
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
306
|
+
enumerable: true,
|
|
307
|
+
get: all[name]
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
_export(exports, {
|
|
311
|
+
REDIRECT_ERROR_CODE: function() {
|
|
312
|
+
return REDIRECT_ERROR_CODE;
|
|
313
|
+
},
|
|
314
|
+
RedirectType: function() {
|
|
315
|
+
return RedirectType;
|
|
316
|
+
},
|
|
317
|
+
isRedirectError: function() {
|
|
318
|
+
return isRedirectError;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
const _redirectstatuscode = requireRedirectStatusCode();
|
|
322
|
+
const REDIRECT_ERROR_CODE = 'NEXT_REDIRECT';
|
|
323
|
+
var RedirectType = /*#__PURE__*/ function(RedirectType) {
|
|
324
|
+
RedirectType["push"] = "push";
|
|
325
|
+
RedirectType["replace"] = "replace";
|
|
326
|
+
return RedirectType;
|
|
327
|
+
}({});
|
|
328
|
+
function isRedirectError(error) {
|
|
329
|
+
if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
const digest = error.digest.split(';');
|
|
333
|
+
const [errorCode, type] = digest;
|
|
334
|
+
const destination = digest.slice(2, -2).join(';');
|
|
335
|
+
const status = digest.at(-2);
|
|
336
|
+
const statusCode = Number(status);
|
|
337
|
+
return errorCode === REDIRECT_ERROR_CODE && (type === 'replace' || type === 'push') && typeof destination === 'string' && !isNaN(statusCode) && statusCode in _redirectstatuscode.RedirectStatusCode;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
341
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
342
|
+
Object.assign(exports.default, exports);
|
|
343
|
+
module.exports = exports.default;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
} (redirectError, redirectError.exports));
|
|
348
|
+
return redirectError.exports;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
var actionAsyncStorage_external = {};
|
|
352
|
+
|
|
353
|
+
var actionAsyncStorageInstance = {};
|
|
354
|
+
|
|
355
|
+
var asyncLocalStorage = {};
|
|
356
|
+
|
|
357
|
+
var hasRequiredAsyncLocalStorage;
|
|
358
|
+
|
|
359
|
+
function requireAsyncLocalStorage () {
|
|
360
|
+
if (hasRequiredAsyncLocalStorage) return asyncLocalStorage;
|
|
361
|
+
hasRequiredAsyncLocalStorage = 1;
|
|
362
|
+
(function (exports) {
|
|
363
|
+
Object.defineProperty(exports, "__esModule", {
|
|
364
|
+
value: true
|
|
365
|
+
});
|
|
366
|
+
function _export(target, all) {
|
|
367
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
368
|
+
enumerable: true,
|
|
369
|
+
get: all[name]
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
_export(exports, {
|
|
373
|
+
bindSnapshot: function() {
|
|
374
|
+
return bindSnapshot;
|
|
375
|
+
},
|
|
376
|
+
createAsyncLocalStorage: function() {
|
|
377
|
+
return createAsyncLocalStorage;
|
|
378
|
+
},
|
|
379
|
+
createSnapshot: function() {
|
|
380
|
+
return createSnapshot;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", {
|
|
384
|
+
value: "E504",
|
|
385
|
+
enumerable: false,
|
|
386
|
+
configurable: true
|
|
387
|
+
});
|
|
388
|
+
class FakeAsyncLocalStorage {
|
|
389
|
+
disable() {
|
|
390
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
391
|
+
}
|
|
392
|
+
getStore() {
|
|
393
|
+
// This fake implementation of AsyncLocalStorage always returns `undefined`.
|
|
394
|
+
return undefined;
|
|
395
|
+
}
|
|
396
|
+
run() {
|
|
397
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
398
|
+
}
|
|
399
|
+
exit() {
|
|
400
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
401
|
+
}
|
|
402
|
+
enterWith() {
|
|
403
|
+
throw sharedAsyncLocalStorageNotAvailableError;
|
|
404
|
+
}
|
|
405
|
+
static bind(fn) {
|
|
406
|
+
return fn;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage;
|
|
410
|
+
function createAsyncLocalStorage() {
|
|
411
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
412
|
+
return new maybeGlobalAsyncLocalStorage();
|
|
413
|
+
}
|
|
414
|
+
return new FakeAsyncLocalStorage();
|
|
415
|
+
}
|
|
416
|
+
function bindSnapshot(fn) {
|
|
417
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
418
|
+
return maybeGlobalAsyncLocalStorage.bind(fn);
|
|
419
|
+
}
|
|
420
|
+
return FakeAsyncLocalStorage.bind(fn);
|
|
421
|
+
}
|
|
422
|
+
function createSnapshot() {
|
|
423
|
+
if (maybeGlobalAsyncLocalStorage) {
|
|
424
|
+
return maybeGlobalAsyncLocalStorage.snapshot();
|
|
425
|
+
}
|
|
426
|
+
return function(fn, ...args) {
|
|
427
|
+
return fn(...args);
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
} (asyncLocalStorage));
|
|
433
|
+
return asyncLocalStorage;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
var hasRequiredActionAsyncStorageInstance;
|
|
437
|
+
|
|
438
|
+
function requireActionAsyncStorageInstance () {
|
|
439
|
+
if (hasRequiredActionAsyncStorageInstance) return actionAsyncStorageInstance;
|
|
440
|
+
hasRequiredActionAsyncStorageInstance = 1;
|
|
441
|
+
(function (exports) {
|
|
442
|
+
Object.defineProperty(exports, "__esModule", {
|
|
443
|
+
value: true
|
|
444
|
+
});
|
|
445
|
+
Object.defineProperty(exports, "actionAsyncStorageInstance", {
|
|
446
|
+
enumerable: true,
|
|
447
|
+
get: function() {
|
|
448
|
+
return actionAsyncStorageInstance;
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
const _asynclocalstorage = requireAsyncLocalStorage();
|
|
452
|
+
const actionAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
} (actionAsyncStorageInstance));
|
|
456
|
+
return actionAsyncStorageInstance;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
var hasRequiredActionAsyncStorage_external;
|
|
460
|
+
|
|
461
|
+
function requireActionAsyncStorage_external () {
|
|
462
|
+
if (hasRequiredActionAsyncStorage_external) return actionAsyncStorage_external;
|
|
463
|
+
hasRequiredActionAsyncStorage_external = 1;
|
|
464
|
+
(function (exports) {
|
|
465
|
+
Object.defineProperty(exports, "__esModule", {
|
|
466
|
+
value: true
|
|
467
|
+
});
|
|
468
|
+
Object.defineProperty(exports, "actionAsyncStorage", {
|
|
469
|
+
enumerable: true,
|
|
470
|
+
get: function() {
|
|
471
|
+
return _actionasyncstorageinstance.actionAsyncStorageInstance;
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
const _actionasyncstorageinstance = requireActionAsyncStorageInstance();
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
} (actionAsyncStorage_external));
|
|
478
|
+
return actionAsyncStorage_external;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
var hasRequiredRedirect;
|
|
482
|
+
|
|
483
|
+
function requireRedirect () {
|
|
484
|
+
if (hasRequiredRedirect) return redirect.exports;
|
|
485
|
+
hasRequiredRedirect = 1;
|
|
486
|
+
(function (module, exports) {
|
|
487
|
+
Object.defineProperty(exports, "__esModule", {
|
|
488
|
+
value: true
|
|
489
|
+
});
|
|
490
|
+
function _export(target, all) {
|
|
491
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
492
|
+
enumerable: true,
|
|
493
|
+
get: all[name]
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
_export(exports, {
|
|
497
|
+
getRedirectError: function() {
|
|
498
|
+
return getRedirectError;
|
|
499
|
+
},
|
|
500
|
+
getRedirectStatusCodeFromError: function() {
|
|
501
|
+
return getRedirectStatusCodeFromError;
|
|
502
|
+
},
|
|
503
|
+
getRedirectTypeFromError: function() {
|
|
504
|
+
return getRedirectTypeFromError;
|
|
505
|
+
},
|
|
506
|
+
getURLFromRedirectError: function() {
|
|
507
|
+
return getURLFromRedirectError;
|
|
508
|
+
},
|
|
509
|
+
permanentRedirect: function() {
|
|
510
|
+
return permanentRedirect;
|
|
511
|
+
},
|
|
512
|
+
redirect: function() {
|
|
513
|
+
return redirect;
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
const _redirectstatuscode = requireRedirectStatusCode();
|
|
517
|
+
const _redirecterror = requireRedirectError();
|
|
518
|
+
const actionAsyncStorage = typeof window === 'undefined' ? requireActionAsyncStorage_external().actionAsyncStorage : undefined;
|
|
519
|
+
function getRedirectError(url, type, statusCode) {
|
|
520
|
+
if (statusCode === void 0) statusCode = _redirectstatuscode.RedirectStatusCode.TemporaryRedirect;
|
|
521
|
+
const error = Object.defineProperty(new Error(_redirecterror.REDIRECT_ERROR_CODE), "__NEXT_ERROR_CODE", {
|
|
522
|
+
value: "E394",
|
|
523
|
+
enumerable: false,
|
|
524
|
+
configurable: true
|
|
525
|
+
});
|
|
526
|
+
error.digest = _redirecterror.REDIRECT_ERROR_CODE + ";" + type + ";" + url + ";" + statusCode + ";";
|
|
527
|
+
return error;
|
|
528
|
+
}
|
|
529
|
+
function redirect(/** The URL to redirect to */ url, type) {
|
|
530
|
+
var _actionAsyncStorage_getStore;
|
|
531
|
+
type != null ? type : type = (actionAsyncStorage == null ? void 0 : (_actionAsyncStorage_getStore = actionAsyncStorage.getStore()) == null ? void 0 : _actionAsyncStorage_getStore.isAction) ? _redirecterror.RedirectType.push : _redirecterror.RedirectType.replace;
|
|
532
|
+
throw getRedirectError(url, type, _redirectstatuscode.RedirectStatusCode.TemporaryRedirect);
|
|
533
|
+
}
|
|
534
|
+
function permanentRedirect(/** The URL to redirect to */ url, type) {
|
|
535
|
+
if (type === void 0) type = _redirecterror.RedirectType.replace;
|
|
536
|
+
throw getRedirectError(url, type, _redirectstatuscode.RedirectStatusCode.PermanentRedirect);
|
|
537
|
+
}
|
|
538
|
+
function getURLFromRedirectError(error) {
|
|
539
|
+
if (!(0, _redirecterror.isRedirectError)(error)) return null;
|
|
540
|
+
// Slices off the beginning of the digest that contains the code and the
|
|
541
|
+
// separating ';'.
|
|
542
|
+
return error.digest.split(';').slice(2, -2).join(';');
|
|
543
|
+
}
|
|
544
|
+
function getRedirectTypeFromError(error) {
|
|
545
|
+
if (!(0, _redirecterror.isRedirectError)(error)) {
|
|
546
|
+
throw Object.defineProperty(new Error('Not a redirect error'), "__NEXT_ERROR_CODE", {
|
|
547
|
+
value: "E260",
|
|
548
|
+
enumerable: false,
|
|
549
|
+
configurable: true
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
return error.digest.split(';', 2)[1];
|
|
553
|
+
}
|
|
554
|
+
function getRedirectStatusCodeFromError(error) {
|
|
555
|
+
if (!(0, _redirecterror.isRedirectError)(error)) {
|
|
556
|
+
throw Object.defineProperty(new Error('Not a redirect error'), "__NEXT_ERROR_CODE", {
|
|
557
|
+
value: "E260",
|
|
558
|
+
enumerable: false,
|
|
559
|
+
configurable: true
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
return Number(error.digest.split(';').at(-2));
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
566
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
567
|
+
Object.assign(exports.default, exports);
|
|
568
|
+
module.exports = exports.default;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
} (redirect, redirect.exports));
|
|
573
|
+
return redirect.exports;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
var notFound = {exports: {}};
|
|
577
|
+
|
|
578
|
+
var httpAccessFallback = {exports: {}};
|
|
579
|
+
|
|
580
|
+
var hasRequiredHttpAccessFallback;
|
|
581
|
+
|
|
582
|
+
function requireHttpAccessFallback () {
|
|
583
|
+
if (hasRequiredHttpAccessFallback) return httpAccessFallback.exports;
|
|
584
|
+
hasRequiredHttpAccessFallback = 1;
|
|
585
|
+
(function (module, exports) {
|
|
586
|
+
Object.defineProperty(exports, "__esModule", {
|
|
587
|
+
value: true
|
|
588
|
+
});
|
|
589
|
+
function _export(target, all) {
|
|
590
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
591
|
+
enumerable: true,
|
|
592
|
+
get: all[name]
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
_export(exports, {
|
|
596
|
+
HTTPAccessErrorStatus: function() {
|
|
597
|
+
return HTTPAccessErrorStatus;
|
|
598
|
+
},
|
|
599
|
+
HTTP_ERROR_FALLBACK_ERROR_CODE: function() {
|
|
600
|
+
return HTTP_ERROR_FALLBACK_ERROR_CODE;
|
|
601
|
+
},
|
|
602
|
+
getAccessFallbackErrorTypeByStatus: function() {
|
|
603
|
+
return getAccessFallbackErrorTypeByStatus;
|
|
604
|
+
},
|
|
605
|
+
getAccessFallbackHTTPStatus: function() {
|
|
606
|
+
return getAccessFallbackHTTPStatus;
|
|
607
|
+
},
|
|
608
|
+
isHTTPAccessFallbackError: function() {
|
|
609
|
+
return isHTTPAccessFallbackError;
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
const HTTPAccessErrorStatus = {
|
|
613
|
+
NOT_FOUND: 404,
|
|
614
|
+
FORBIDDEN: 403,
|
|
615
|
+
UNAUTHORIZED: 401
|
|
616
|
+
};
|
|
617
|
+
const ALLOWED_CODES = new Set(Object.values(HTTPAccessErrorStatus));
|
|
618
|
+
const HTTP_ERROR_FALLBACK_ERROR_CODE = 'NEXT_HTTP_ERROR_FALLBACK';
|
|
619
|
+
function isHTTPAccessFallbackError(error) {
|
|
620
|
+
if (typeof error !== 'object' || error === null || !('digest' in error) || typeof error.digest !== 'string') {
|
|
621
|
+
return false;
|
|
622
|
+
}
|
|
623
|
+
const [prefix, httpStatus] = error.digest.split(';');
|
|
624
|
+
return prefix === HTTP_ERROR_FALLBACK_ERROR_CODE && ALLOWED_CODES.has(Number(httpStatus));
|
|
625
|
+
}
|
|
626
|
+
function getAccessFallbackHTTPStatus(error) {
|
|
627
|
+
const httpStatus = error.digest.split(';')[1];
|
|
628
|
+
return Number(httpStatus);
|
|
629
|
+
}
|
|
630
|
+
function getAccessFallbackErrorTypeByStatus(status) {
|
|
631
|
+
switch(status){
|
|
632
|
+
case 401:
|
|
633
|
+
return 'unauthorized';
|
|
634
|
+
case 403:
|
|
635
|
+
return 'forbidden';
|
|
636
|
+
case 404:
|
|
637
|
+
return 'not-found';
|
|
638
|
+
default:
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
644
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
645
|
+
Object.assign(exports.default, exports);
|
|
646
|
+
module.exports = exports.default;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
} (httpAccessFallback, httpAccessFallback.exports));
|
|
651
|
+
return httpAccessFallback.exports;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
var hasRequiredNotFound;
|
|
655
|
+
|
|
656
|
+
function requireNotFound () {
|
|
657
|
+
if (hasRequiredNotFound) return notFound.exports;
|
|
658
|
+
hasRequiredNotFound = 1;
|
|
659
|
+
(function (module, exports) {
|
|
660
|
+
Object.defineProperty(exports, "__esModule", {
|
|
661
|
+
value: true
|
|
662
|
+
});
|
|
663
|
+
Object.defineProperty(exports, "notFound", {
|
|
664
|
+
enumerable: true,
|
|
665
|
+
get: function() {
|
|
666
|
+
return notFound;
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
const _httpaccessfallback = requireHttpAccessFallback();
|
|
670
|
+
/**
|
|
671
|
+
* This function allows you to render the [not-found.js file](https://nextjs.org/docs/app/api-reference/file-conventions/not-found)
|
|
672
|
+
* within a route segment as well as inject a tag.
|
|
673
|
+
*
|
|
674
|
+
* `notFound()` can be used in
|
|
675
|
+
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
|
676
|
+
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
|
|
677
|
+
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
|
|
678
|
+
*
|
|
679
|
+
* - In a Server Component, this will insert a `<meta name="robots" content="noindex" />` meta tag and set the status code to 404.
|
|
680
|
+
* - In a Route Handler or Server Action, it will serve a 404 to the caller.
|
|
681
|
+
*
|
|
682
|
+
* Read more: [Next.js Docs: `notFound`](https://nextjs.org/docs/app/api-reference/functions/not-found)
|
|
683
|
+
*/ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";404";
|
|
684
|
+
function notFound() {
|
|
685
|
+
// eslint-disable-next-line no-throw-literal
|
|
686
|
+
const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
|
|
687
|
+
value: "E394",
|
|
688
|
+
enumerable: false,
|
|
689
|
+
configurable: true
|
|
690
|
+
});
|
|
691
|
+
error.digest = DIGEST;
|
|
692
|
+
throw error;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
696
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
697
|
+
Object.assign(exports.default, exports);
|
|
698
|
+
module.exports = exports.default;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
} (notFound, notFound.exports));
|
|
703
|
+
return notFound.exports;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
var forbidden = {exports: {}};
|
|
707
|
+
|
|
708
|
+
var hasRequiredForbidden;
|
|
709
|
+
|
|
710
|
+
function requireForbidden () {
|
|
711
|
+
if (hasRequiredForbidden) return forbidden.exports;
|
|
712
|
+
hasRequiredForbidden = 1;
|
|
713
|
+
(function (module, exports) {
|
|
714
|
+
Object.defineProperty(exports, "__esModule", {
|
|
715
|
+
value: true
|
|
716
|
+
});
|
|
717
|
+
Object.defineProperty(exports, "forbidden", {
|
|
718
|
+
enumerable: true,
|
|
719
|
+
get: function() {
|
|
720
|
+
return forbidden;
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
const _httpaccessfallback = requireHttpAccessFallback();
|
|
724
|
+
// TODO: Add `forbidden` docs
|
|
725
|
+
/**
|
|
726
|
+
* @experimental
|
|
727
|
+
* This function allows you to render the [forbidden.js file](https://nextjs.org/docs/app/api-reference/file-conventions/forbidden)
|
|
728
|
+
* within a route segment as well as inject a tag.
|
|
729
|
+
*
|
|
730
|
+
* `forbidden()` can be used in
|
|
731
|
+
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
|
732
|
+
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
|
|
733
|
+
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
|
|
734
|
+
*
|
|
735
|
+
* Read more: [Next.js Docs: `forbidden`](https://nextjs.org/docs/app/api-reference/functions/forbidden)
|
|
736
|
+
*/ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";403";
|
|
737
|
+
function forbidden() {
|
|
738
|
+
if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {
|
|
739
|
+
throw Object.defineProperty(new Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
|
|
740
|
+
value: "E488",
|
|
741
|
+
enumerable: false,
|
|
742
|
+
configurable: true
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
// eslint-disable-next-line no-throw-literal
|
|
746
|
+
const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
|
|
747
|
+
value: "E394",
|
|
748
|
+
enumerable: false,
|
|
749
|
+
configurable: true
|
|
750
|
+
});
|
|
751
|
+
error.digest = DIGEST;
|
|
752
|
+
throw error;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
756
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
757
|
+
Object.assign(exports.default, exports);
|
|
758
|
+
module.exports = exports.default;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
} (forbidden, forbidden.exports));
|
|
763
|
+
return forbidden.exports;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
var unauthorized = {exports: {}};
|
|
767
|
+
|
|
768
|
+
var hasRequiredUnauthorized;
|
|
769
|
+
|
|
770
|
+
function requireUnauthorized () {
|
|
771
|
+
if (hasRequiredUnauthorized) return unauthorized.exports;
|
|
772
|
+
hasRequiredUnauthorized = 1;
|
|
773
|
+
(function (module, exports) {
|
|
774
|
+
Object.defineProperty(exports, "__esModule", {
|
|
775
|
+
value: true
|
|
776
|
+
});
|
|
777
|
+
Object.defineProperty(exports, "unauthorized", {
|
|
778
|
+
enumerable: true,
|
|
779
|
+
get: function() {
|
|
780
|
+
return unauthorized;
|
|
781
|
+
}
|
|
782
|
+
});
|
|
783
|
+
const _httpaccessfallback = requireHttpAccessFallback();
|
|
784
|
+
// TODO: Add `unauthorized` docs
|
|
785
|
+
/**
|
|
786
|
+
* @experimental
|
|
787
|
+
* This function allows you to render the [unauthorized.js file](https://nextjs.org/docs/app/api-reference/file-conventions/unauthorized)
|
|
788
|
+
* within a route segment as well as inject a tag.
|
|
789
|
+
*
|
|
790
|
+
* `unauthorized()` can be used in
|
|
791
|
+
* [Server Components](https://nextjs.org/docs/app/building-your-application/rendering/server-components),
|
|
792
|
+
* [Route Handlers](https://nextjs.org/docs/app/building-your-application/routing/route-handlers), and
|
|
793
|
+
* [Server Actions](https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions-and-mutations).
|
|
794
|
+
*
|
|
795
|
+
*
|
|
796
|
+
* Read more: [Next.js Docs: `unauthorized`](https://nextjs.org/docs/app/api-reference/functions/unauthorized)
|
|
797
|
+
*/ const DIGEST = "" + _httpaccessfallback.HTTP_ERROR_FALLBACK_ERROR_CODE + ";401";
|
|
798
|
+
function unauthorized() {
|
|
799
|
+
if (!process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS) {
|
|
800
|
+
throw Object.defineProperty(new Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."), "__NEXT_ERROR_CODE", {
|
|
801
|
+
value: "E411",
|
|
802
|
+
enumerable: false,
|
|
803
|
+
configurable: true
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
// eslint-disable-next-line no-throw-literal
|
|
807
|
+
const error = Object.defineProperty(new Error(DIGEST), "__NEXT_ERROR_CODE", {
|
|
808
|
+
value: "E394",
|
|
809
|
+
enumerable: false,
|
|
810
|
+
configurable: true
|
|
811
|
+
});
|
|
812
|
+
error.digest = DIGEST;
|
|
813
|
+
throw error;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
817
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
818
|
+
Object.assign(exports.default, exports);
|
|
819
|
+
module.exports = exports.default;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
} (unauthorized, unauthorized.exports));
|
|
824
|
+
return unauthorized.exports;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
var unstableRethrow = {exports: {}};
|
|
828
|
+
|
|
829
|
+
var unstableRethrow_server = {exports: {}};
|
|
830
|
+
|
|
831
|
+
var dynamicRenderingUtils = {};
|
|
832
|
+
|
|
833
|
+
var hasRequiredDynamicRenderingUtils;
|
|
834
|
+
|
|
835
|
+
function requireDynamicRenderingUtils () {
|
|
836
|
+
if (hasRequiredDynamicRenderingUtils) return dynamicRenderingUtils;
|
|
837
|
+
hasRequiredDynamicRenderingUtils = 1;
|
|
838
|
+
(function (exports) {
|
|
839
|
+
Object.defineProperty(exports, "__esModule", {
|
|
840
|
+
value: true
|
|
841
|
+
});
|
|
842
|
+
function _export(target, all) {
|
|
843
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
844
|
+
enumerable: true,
|
|
845
|
+
get: all[name]
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
_export(exports, {
|
|
849
|
+
isHangingPromiseRejectionError: function() {
|
|
850
|
+
return isHangingPromiseRejectionError;
|
|
851
|
+
},
|
|
852
|
+
makeHangingPromise: function() {
|
|
853
|
+
return makeHangingPromise;
|
|
854
|
+
}
|
|
855
|
+
});
|
|
856
|
+
function isHangingPromiseRejectionError(err) {
|
|
857
|
+
if (typeof err !== 'object' || err === null || !('digest' in err)) {
|
|
858
|
+
return false;
|
|
859
|
+
}
|
|
860
|
+
return err.digest === HANGING_PROMISE_REJECTION;
|
|
861
|
+
}
|
|
862
|
+
const HANGING_PROMISE_REJECTION = 'HANGING_PROMISE_REJECTION';
|
|
863
|
+
class HangingPromiseRejectionError extends Error {
|
|
864
|
+
constructor(expression){
|
|
865
|
+
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.expression = expression, this.digest = HANGING_PROMISE_REJECTION;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
const abortListenersBySignal = new WeakMap();
|
|
869
|
+
function makeHangingPromise(signal, expression) {
|
|
870
|
+
if (signal.aborted) {
|
|
871
|
+
return Promise.reject(new HangingPromiseRejectionError(expression));
|
|
872
|
+
} else {
|
|
873
|
+
const hangingPromise = new Promise((_, reject)=>{
|
|
874
|
+
const boundRejection = reject.bind(null, new HangingPromiseRejectionError(expression));
|
|
875
|
+
let currentListeners = abortListenersBySignal.get(signal);
|
|
876
|
+
if (currentListeners) {
|
|
877
|
+
currentListeners.push(boundRejection);
|
|
878
|
+
} else {
|
|
879
|
+
const listeners = [
|
|
880
|
+
boundRejection
|
|
881
|
+
];
|
|
882
|
+
abortListenersBySignal.set(signal, listeners);
|
|
883
|
+
signal.addEventListener('abort', ()=>{
|
|
884
|
+
for(let i = 0; i < listeners.length; i++){
|
|
885
|
+
listeners[i]();
|
|
886
|
+
}
|
|
887
|
+
}, {
|
|
888
|
+
once: true
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
// We are fine if no one actually awaits this promise. We shouldn't consider this an unhandled rejection so
|
|
893
|
+
// we attach a noop catch handler here to suppress this warning. If you actually await somewhere or construct
|
|
894
|
+
// your own promise out of it you'll need to ensure you handle the error when it rejects.
|
|
895
|
+
hangingPromise.catch(ignoreReject);
|
|
896
|
+
return hangingPromise;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
function ignoreReject() {}
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
} (dynamicRenderingUtils));
|
|
903
|
+
return dynamicRenderingUtils;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
var isPostpone = {};
|
|
907
|
+
|
|
908
|
+
var hasRequiredIsPostpone;
|
|
909
|
+
|
|
910
|
+
function requireIsPostpone () {
|
|
911
|
+
if (hasRequiredIsPostpone) return isPostpone;
|
|
912
|
+
hasRequiredIsPostpone = 1;
|
|
913
|
+
(function (exports) {
|
|
914
|
+
Object.defineProperty(exports, "__esModule", {
|
|
915
|
+
value: true
|
|
916
|
+
});
|
|
917
|
+
Object.defineProperty(exports, "isPostpone", {
|
|
918
|
+
enumerable: true,
|
|
919
|
+
get: function() {
|
|
920
|
+
return isPostpone;
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
const REACT_POSTPONE_TYPE = Symbol.for('react.postpone');
|
|
924
|
+
function isPostpone(error) {
|
|
925
|
+
return typeof error === 'object' && error !== null && error.$$typeof === REACT_POSTPONE_TYPE;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
} (isPostpone));
|
|
930
|
+
return isPostpone;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
var bailoutToCsr = {};
|
|
934
|
+
|
|
935
|
+
var hasRequiredBailoutToCsr;
|
|
936
|
+
|
|
937
|
+
function requireBailoutToCsr () {
|
|
938
|
+
if (hasRequiredBailoutToCsr) return bailoutToCsr;
|
|
939
|
+
hasRequiredBailoutToCsr = 1;
|
|
940
|
+
(function (exports) {
|
|
941
|
+
Object.defineProperty(exports, "__esModule", {
|
|
942
|
+
value: true
|
|
943
|
+
});
|
|
944
|
+
function _export(target, all) {
|
|
945
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
946
|
+
enumerable: true,
|
|
947
|
+
get: all[name]
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
_export(exports, {
|
|
951
|
+
BailoutToCSRError: function() {
|
|
952
|
+
return BailoutToCSRError;
|
|
953
|
+
},
|
|
954
|
+
isBailoutToCSRError: function() {
|
|
955
|
+
return isBailoutToCSRError;
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
const BAILOUT_TO_CSR = 'BAILOUT_TO_CLIENT_SIDE_RENDERING';
|
|
959
|
+
class BailoutToCSRError extends Error {
|
|
960
|
+
constructor(reason){
|
|
961
|
+
super("Bail out to client-side rendering: " + reason), this.reason = reason, this.digest = BAILOUT_TO_CSR;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
function isBailoutToCSRError(err) {
|
|
965
|
+
if (typeof err !== 'object' || err === null || !('digest' in err)) {
|
|
966
|
+
return false;
|
|
967
|
+
}
|
|
968
|
+
return err.digest === BAILOUT_TO_CSR;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
} (bailoutToCsr));
|
|
973
|
+
return bailoutToCsr;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
var isNextRouterError = {exports: {}};
|
|
977
|
+
|
|
978
|
+
var hasRequiredIsNextRouterError;
|
|
979
|
+
|
|
980
|
+
function requireIsNextRouterError () {
|
|
981
|
+
if (hasRequiredIsNextRouterError) return isNextRouterError.exports;
|
|
982
|
+
hasRequiredIsNextRouterError = 1;
|
|
983
|
+
(function (module, exports) {
|
|
984
|
+
Object.defineProperty(exports, "__esModule", {
|
|
985
|
+
value: true
|
|
986
|
+
});
|
|
987
|
+
Object.defineProperty(exports, "isNextRouterError", {
|
|
988
|
+
enumerable: true,
|
|
989
|
+
get: function() {
|
|
990
|
+
return isNextRouterError;
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
const _httpaccessfallback = requireHttpAccessFallback();
|
|
994
|
+
const _redirecterror = requireRedirectError();
|
|
995
|
+
function isNextRouterError(error) {
|
|
996
|
+
return (0, _redirecterror.isRedirectError)(error) || (0, _httpaccessfallback.isHTTPAccessFallbackError)(error);
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
1000
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
1001
|
+
Object.assign(exports.default, exports);
|
|
1002
|
+
module.exports = exports.default;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
} (isNextRouterError, isNextRouterError.exports));
|
|
1007
|
+
return isNextRouterError.exports;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
var dynamicRendering = {};
|
|
1011
|
+
|
|
1012
|
+
var hooksServerContext = {exports: {}};
|
|
1013
|
+
|
|
1014
|
+
var hasRequiredHooksServerContext;
|
|
1015
|
+
|
|
1016
|
+
function requireHooksServerContext () {
|
|
1017
|
+
if (hasRequiredHooksServerContext) return hooksServerContext.exports;
|
|
1018
|
+
hasRequiredHooksServerContext = 1;
|
|
1019
|
+
(function (module, exports) {
|
|
1020
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1021
|
+
value: true
|
|
1022
|
+
});
|
|
1023
|
+
function _export(target, all) {
|
|
1024
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1025
|
+
enumerable: true,
|
|
1026
|
+
get: all[name]
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
_export(exports, {
|
|
1030
|
+
DynamicServerError: function() {
|
|
1031
|
+
return DynamicServerError;
|
|
1032
|
+
},
|
|
1033
|
+
isDynamicServerError: function() {
|
|
1034
|
+
return isDynamicServerError;
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
const DYNAMIC_ERROR_CODE = 'DYNAMIC_SERVER_USAGE';
|
|
1038
|
+
class DynamicServerError extends Error {
|
|
1039
|
+
constructor(description){
|
|
1040
|
+
super("Dynamic server usage: " + description), this.description = description, this.digest = DYNAMIC_ERROR_CODE;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
function isDynamicServerError(err) {
|
|
1044
|
+
if (typeof err !== 'object' || err === null || !('digest' in err) || typeof err.digest !== 'string') {
|
|
1045
|
+
return false;
|
|
1046
|
+
}
|
|
1047
|
+
return err.digest === DYNAMIC_ERROR_CODE;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
1051
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
1052
|
+
Object.assign(exports.default, exports);
|
|
1053
|
+
module.exports = exports.default;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
} (hooksServerContext, hooksServerContext.exports));
|
|
1058
|
+
return hooksServerContext.exports;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
var staticGenerationBailout = {exports: {}};
|
|
1062
|
+
|
|
1063
|
+
var hasRequiredStaticGenerationBailout;
|
|
1064
|
+
|
|
1065
|
+
function requireStaticGenerationBailout () {
|
|
1066
|
+
if (hasRequiredStaticGenerationBailout) return staticGenerationBailout.exports;
|
|
1067
|
+
hasRequiredStaticGenerationBailout = 1;
|
|
1068
|
+
(function (module, exports) {
|
|
1069
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1070
|
+
value: true
|
|
1071
|
+
});
|
|
1072
|
+
function _export(target, all) {
|
|
1073
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1074
|
+
enumerable: true,
|
|
1075
|
+
get: all[name]
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
_export(exports, {
|
|
1079
|
+
StaticGenBailoutError: function() {
|
|
1080
|
+
return StaticGenBailoutError;
|
|
1081
|
+
},
|
|
1082
|
+
isStaticGenBailoutError: function() {
|
|
1083
|
+
return isStaticGenBailoutError;
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
const NEXT_STATIC_GEN_BAILOUT = 'NEXT_STATIC_GEN_BAILOUT';
|
|
1087
|
+
class StaticGenBailoutError extends Error {
|
|
1088
|
+
constructor(...args){
|
|
1089
|
+
super(...args), this.code = NEXT_STATIC_GEN_BAILOUT;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function isStaticGenBailoutError(error) {
|
|
1093
|
+
if (typeof error !== 'object' || error === null || !('code' in error)) {
|
|
1094
|
+
return false;
|
|
1095
|
+
}
|
|
1096
|
+
return error.code === NEXT_STATIC_GEN_BAILOUT;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
1100
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
1101
|
+
Object.assign(exports.default, exports);
|
|
1102
|
+
module.exports = exports.default;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
} (staticGenerationBailout, staticGenerationBailout.exports));
|
|
1107
|
+
return staticGenerationBailout.exports;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
var workUnitAsyncStorage_external = {};
|
|
1111
|
+
|
|
1112
|
+
var workUnitAsyncStorageInstance = {};
|
|
1113
|
+
|
|
1114
|
+
var hasRequiredWorkUnitAsyncStorageInstance;
|
|
1115
|
+
|
|
1116
|
+
function requireWorkUnitAsyncStorageInstance () {
|
|
1117
|
+
if (hasRequiredWorkUnitAsyncStorageInstance) return workUnitAsyncStorageInstance;
|
|
1118
|
+
hasRequiredWorkUnitAsyncStorageInstance = 1;
|
|
1119
|
+
(function (exports) {
|
|
1120
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1121
|
+
value: true
|
|
1122
|
+
});
|
|
1123
|
+
Object.defineProperty(exports, "workUnitAsyncStorageInstance", {
|
|
1124
|
+
enumerable: true,
|
|
1125
|
+
get: function() {
|
|
1126
|
+
return workUnitAsyncStorageInstance;
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1129
|
+
const _asynclocalstorage = requireAsyncLocalStorage();
|
|
1130
|
+
const workUnitAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
} (workUnitAsyncStorageInstance));
|
|
1134
|
+
return workUnitAsyncStorageInstance;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
var appRouterHeaders = {exports: {}};
|
|
1138
|
+
|
|
1139
|
+
var hasRequiredAppRouterHeaders;
|
|
1140
|
+
|
|
1141
|
+
function requireAppRouterHeaders () {
|
|
1142
|
+
if (hasRequiredAppRouterHeaders) return appRouterHeaders.exports;
|
|
1143
|
+
hasRequiredAppRouterHeaders = 1;
|
|
1144
|
+
(function (module, exports) {
|
|
1145
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1146
|
+
value: true
|
|
1147
|
+
});
|
|
1148
|
+
function _export(target, all) {
|
|
1149
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1150
|
+
enumerable: true,
|
|
1151
|
+
get: all[name]
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
_export(exports, {
|
|
1155
|
+
ACTION_HEADER: function() {
|
|
1156
|
+
return ACTION_HEADER;
|
|
1157
|
+
},
|
|
1158
|
+
FLIGHT_HEADERS: function() {
|
|
1159
|
+
return FLIGHT_HEADERS;
|
|
1160
|
+
},
|
|
1161
|
+
NEXT_DID_POSTPONE_HEADER: function() {
|
|
1162
|
+
return NEXT_DID_POSTPONE_HEADER;
|
|
1163
|
+
},
|
|
1164
|
+
NEXT_HMR_REFRESH_HASH_COOKIE: function() {
|
|
1165
|
+
return NEXT_HMR_REFRESH_HASH_COOKIE;
|
|
1166
|
+
},
|
|
1167
|
+
NEXT_HMR_REFRESH_HEADER: function() {
|
|
1168
|
+
return NEXT_HMR_REFRESH_HEADER;
|
|
1169
|
+
},
|
|
1170
|
+
NEXT_IS_PRERENDER_HEADER: function() {
|
|
1171
|
+
return NEXT_IS_PRERENDER_HEADER;
|
|
1172
|
+
},
|
|
1173
|
+
NEXT_REWRITTEN_PATH_HEADER: function() {
|
|
1174
|
+
return NEXT_REWRITTEN_PATH_HEADER;
|
|
1175
|
+
},
|
|
1176
|
+
NEXT_REWRITTEN_QUERY_HEADER: function() {
|
|
1177
|
+
return NEXT_REWRITTEN_QUERY_HEADER;
|
|
1178
|
+
},
|
|
1179
|
+
NEXT_ROUTER_PREFETCH_HEADER: function() {
|
|
1180
|
+
return NEXT_ROUTER_PREFETCH_HEADER;
|
|
1181
|
+
},
|
|
1182
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER: function() {
|
|
1183
|
+
return NEXT_ROUTER_SEGMENT_PREFETCH_HEADER;
|
|
1184
|
+
},
|
|
1185
|
+
NEXT_ROUTER_STALE_TIME_HEADER: function() {
|
|
1186
|
+
return NEXT_ROUTER_STALE_TIME_HEADER;
|
|
1187
|
+
},
|
|
1188
|
+
NEXT_ROUTER_STATE_TREE_HEADER: function() {
|
|
1189
|
+
return NEXT_ROUTER_STATE_TREE_HEADER;
|
|
1190
|
+
},
|
|
1191
|
+
NEXT_RSC_UNION_QUERY: function() {
|
|
1192
|
+
return NEXT_RSC_UNION_QUERY;
|
|
1193
|
+
},
|
|
1194
|
+
NEXT_URL: function() {
|
|
1195
|
+
return NEXT_URL;
|
|
1196
|
+
},
|
|
1197
|
+
RSC_CONTENT_TYPE_HEADER: function() {
|
|
1198
|
+
return RSC_CONTENT_TYPE_HEADER;
|
|
1199
|
+
},
|
|
1200
|
+
RSC_HEADER: function() {
|
|
1201
|
+
return RSC_HEADER;
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
const RSC_HEADER = 'RSC';
|
|
1205
|
+
const ACTION_HEADER = 'Next-Action';
|
|
1206
|
+
const NEXT_ROUTER_STATE_TREE_HEADER = 'Next-Router-State-Tree';
|
|
1207
|
+
const NEXT_ROUTER_PREFETCH_HEADER = 'Next-Router-Prefetch';
|
|
1208
|
+
const NEXT_ROUTER_SEGMENT_PREFETCH_HEADER = 'Next-Router-Segment-Prefetch';
|
|
1209
|
+
const NEXT_HMR_REFRESH_HEADER = 'Next-HMR-Refresh';
|
|
1210
|
+
const NEXT_HMR_REFRESH_HASH_COOKIE = '__next_hmr_refresh_hash__';
|
|
1211
|
+
const NEXT_URL = 'Next-Url';
|
|
1212
|
+
const RSC_CONTENT_TYPE_HEADER = 'text/x-component';
|
|
1213
|
+
const FLIGHT_HEADERS = [
|
|
1214
|
+
RSC_HEADER,
|
|
1215
|
+
NEXT_ROUTER_STATE_TREE_HEADER,
|
|
1216
|
+
NEXT_ROUTER_PREFETCH_HEADER,
|
|
1217
|
+
NEXT_HMR_REFRESH_HEADER,
|
|
1218
|
+
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER
|
|
1219
|
+
];
|
|
1220
|
+
const NEXT_RSC_UNION_QUERY = '_rsc';
|
|
1221
|
+
const NEXT_ROUTER_STALE_TIME_HEADER = 'x-nextjs-stale-time';
|
|
1222
|
+
const NEXT_DID_POSTPONE_HEADER = 'x-nextjs-postponed';
|
|
1223
|
+
const NEXT_REWRITTEN_PATH_HEADER = 'x-nextjs-rewritten-path';
|
|
1224
|
+
const NEXT_REWRITTEN_QUERY_HEADER = 'x-nextjs-rewritten-query';
|
|
1225
|
+
const NEXT_IS_PRERENDER_HEADER = 'x-nextjs-prerender';
|
|
1226
|
+
|
|
1227
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
1228
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
1229
|
+
Object.assign(exports.default, exports);
|
|
1230
|
+
module.exports = exports.default;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
} (appRouterHeaders, appRouterHeaders.exports));
|
|
1235
|
+
return appRouterHeaders.exports;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
var hasRequiredWorkUnitAsyncStorage_external;
|
|
1239
|
+
|
|
1240
|
+
function requireWorkUnitAsyncStorage_external () {
|
|
1241
|
+
if (hasRequiredWorkUnitAsyncStorage_external) return workUnitAsyncStorage_external;
|
|
1242
|
+
hasRequiredWorkUnitAsyncStorage_external = 1;
|
|
1243
|
+
(function (exports) {
|
|
1244
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1245
|
+
value: true
|
|
1246
|
+
});
|
|
1247
|
+
function _export(target, all) {
|
|
1248
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1249
|
+
enumerable: true,
|
|
1250
|
+
get: all[name]
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
_export(exports, {
|
|
1254
|
+
getDraftModeProviderForCacheScope: function() {
|
|
1255
|
+
return getDraftModeProviderForCacheScope;
|
|
1256
|
+
},
|
|
1257
|
+
getExpectedRequestStore: function() {
|
|
1258
|
+
return getExpectedRequestStore;
|
|
1259
|
+
},
|
|
1260
|
+
getHmrRefreshHash: function() {
|
|
1261
|
+
return getHmrRefreshHash;
|
|
1262
|
+
},
|
|
1263
|
+
getPrerenderResumeDataCache: function() {
|
|
1264
|
+
return getPrerenderResumeDataCache;
|
|
1265
|
+
},
|
|
1266
|
+
getRenderResumeDataCache: function() {
|
|
1267
|
+
return getRenderResumeDataCache;
|
|
1268
|
+
},
|
|
1269
|
+
throwForMissingRequestStore: function() {
|
|
1270
|
+
return throwForMissingRequestStore;
|
|
1271
|
+
},
|
|
1272
|
+
workUnitAsyncStorage: function() {
|
|
1273
|
+
return _workunitasyncstorageinstance.workUnitAsyncStorageInstance;
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1276
|
+
const _workunitasyncstorageinstance = requireWorkUnitAsyncStorageInstance();
|
|
1277
|
+
const _approuterheaders = requireAppRouterHeaders();
|
|
1278
|
+
function getExpectedRequestStore(callingExpression) {
|
|
1279
|
+
const workUnitStore = _workunitasyncstorageinstance.workUnitAsyncStorageInstance.getStore();
|
|
1280
|
+
if (!workUnitStore) {
|
|
1281
|
+
throwForMissingRequestStore(callingExpression);
|
|
1282
|
+
}
|
|
1283
|
+
switch(workUnitStore.type){
|
|
1284
|
+
case 'request':
|
|
1285
|
+
return workUnitStore;
|
|
1286
|
+
case 'prerender':
|
|
1287
|
+
case 'prerender-ppr':
|
|
1288
|
+
case 'prerender-legacy':
|
|
1289
|
+
// This should not happen because we should have checked it already.
|
|
1290
|
+
throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside a prerender. This is a bug in Next.js.`), "__NEXT_ERROR_CODE", {
|
|
1291
|
+
value: "E401",
|
|
1292
|
+
enumerable: false,
|
|
1293
|
+
configurable: true
|
|
1294
|
+
});
|
|
1295
|
+
case 'cache':
|
|
1296
|
+
throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside "use cache". Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/messages/next-request-in-use-cache`), "__NEXT_ERROR_CODE", {
|
|
1297
|
+
value: "E37",
|
|
1298
|
+
enumerable: false,
|
|
1299
|
+
configurable: true
|
|
1300
|
+
});
|
|
1301
|
+
case 'unstable-cache':
|
|
1302
|
+
throw Object.defineProperty(new Error(`\`${callingExpression}\` cannot be called inside unstable_cache. Call it outside and pass an argument instead. Read more: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`), "__NEXT_ERROR_CODE", {
|
|
1303
|
+
value: "E69",
|
|
1304
|
+
enumerable: false,
|
|
1305
|
+
configurable: true
|
|
1306
|
+
});
|
|
1307
|
+
default:
|
|
1308
|
+
const _exhaustiveCheck = workUnitStore;
|
|
1309
|
+
return _exhaustiveCheck;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
function throwForMissingRequestStore(callingExpression) {
|
|
1313
|
+
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", {
|
|
1314
|
+
value: "E251",
|
|
1315
|
+
enumerable: false,
|
|
1316
|
+
configurable: true
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
function getPrerenderResumeDataCache(workUnitStore) {
|
|
1320
|
+
if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-ppr') {
|
|
1321
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
1322
|
+
}
|
|
1323
|
+
return null;
|
|
1324
|
+
}
|
|
1325
|
+
function getRenderResumeDataCache(workUnitStore) {
|
|
1326
|
+
if (workUnitStore.type !== 'prerender-legacy' && workUnitStore.type !== 'cache' && workUnitStore.type !== 'unstable-cache') {
|
|
1327
|
+
if (workUnitStore.type === 'request') {
|
|
1328
|
+
return workUnitStore.renderResumeDataCache;
|
|
1329
|
+
}
|
|
1330
|
+
// We return the mutable resume data cache here as an immutable version of
|
|
1331
|
+
// the cache as it can also be used for reading.
|
|
1332
|
+
return workUnitStore.prerenderResumeDataCache;
|
|
1333
|
+
}
|
|
1334
|
+
return null;
|
|
1335
|
+
}
|
|
1336
|
+
function getHmrRefreshHash(workStore, workUnitStore) {
|
|
1337
|
+
var _workUnitStore_cookies_get;
|
|
1338
|
+
if (!workStore.dev) {
|
|
1339
|
+
return undefined;
|
|
1340
|
+
}
|
|
1341
|
+
return workUnitStore.type === 'cache' || workUnitStore.type === 'prerender' ? workUnitStore.hmrRefreshHash : workUnitStore.type === 'request' ? (_workUnitStore_cookies_get = workUnitStore.cookies.get(_approuterheaders.NEXT_HMR_REFRESH_HASH_COOKIE)) == null ? void 0 : _workUnitStore_cookies_get.value : undefined;
|
|
1342
|
+
}
|
|
1343
|
+
function getDraftModeProviderForCacheScope(workStore, workUnitStore) {
|
|
1344
|
+
if (workStore.isDraftMode) {
|
|
1345
|
+
switch(workUnitStore.type){
|
|
1346
|
+
case 'cache':
|
|
1347
|
+
case 'unstable-cache':
|
|
1348
|
+
case 'request':
|
|
1349
|
+
return workUnitStore.draftMode;
|
|
1350
|
+
default:
|
|
1351
|
+
return undefined;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
return undefined;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
} (workUnitAsyncStorage_external));
|
|
1359
|
+
return workUnitAsyncStorage_external;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
var workAsyncStorage_external = {};
|
|
1363
|
+
|
|
1364
|
+
var workAsyncStorageInstance = {};
|
|
1365
|
+
|
|
1366
|
+
var hasRequiredWorkAsyncStorageInstance;
|
|
1367
|
+
|
|
1368
|
+
function requireWorkAsyncStorageInstance () {
|
|
1369
|
+
if (hasRequiredWorkAsyncStorageInstance) return workAsyncStorageInstance;
|
|
1370
|
+
hasRequiredWorkAsyncStorageInstance = 1;
|
|
1371
|
+
(function (exports) {
|
|
1372
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1373
|
+
value: true
|
|
1374
|
+
});
|
|
1375
|
+
Object.defineProperty(exports, "workAsyncStorageInstance", {
|
|
1376
|
+
enumerable: true,
|
|
1377
|
+
get: function() {
|
|
1378
|
+
return workAsyncStorageInstance;
|
|
1379
|
+
}
|
|
1380
|
+
});
|
|
1381
|
+
const _asynclocalstorage = requireAsyncLocalStorage();
|
|
1382
|
+
const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)();
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
} (workAsyncStorageInstance));
|
|
1386
|
+
return workAsyncStorageInstance;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
var hasRequiredWorkAsyncStorage_external;
|
|
1390
|
+
|
|
1391
|
+
function requireWorkAsyncStorage_external () {
|
|
1392
|
+
if (hasRequiredWorkAsyncStorage_external) return workAsyncStorage_external;
|
|
1393
|
+
hasRequiredWorkAsyncStorage_external = 1;
|
|
1394
|
+
(function (exports) {
|
|
1395
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1396
|
+
value: true
|
|
1397
|
+
});
|
|
1398
|
+
Object.defineProperty(exports, "workAsyncStorage", {
|
|
1399
|
+
enumerable: true,
|
|
1400
|
+
get: function() {
|
|
1401
|
+
return _workasyncstorageinstance.workAsyncStorageInstance;
|
|
1402
|
+
}
|
|
1403
|
+
});
|
|
1404
|
+
const _workasyncstorageinstance = requireWorkAsyncStorageInstance();
|
|
1405
|
+
|
|
1406
|
+
|
|
1407
|
+
} (workAsyncStorage_external));
|
|
1408
|
+
return workAsyncStorage_external;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
var metadataConstants = {};
|
|
1412
|
+
|
|
1413
|
+
var hasRequiredMetadataConstants;
|
|
1414
|
+
|
|
1415
|
+
function requireMetadataConstants () {
|
|
1416
|
+
if (hasRequiredMetadataConstants) return metadataConstants;
|
|
1417
|
+
hasRequiredMetadataConstants = 1;
|
|
1418
|
+
(function (exports) {
|
|
1419
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1420
|
+
value: true
|
|
1421
|
+
});
|
|
1422
|
+
function _export(target, all) {
|
|
1423
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1424
|
+
enumerable: true,
|
|
1425
|
+
get: all[name]
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
_export(exports, {
|
|
1429
|
+
METADATA_BOUNDARY_NAME: function() {
|
|
1430
|
+
return METADATA_BOUNDARY_NAME;
|
|
1431
|
+
},
|
|
1432
|
+
OUTLET_BOUNDARY_NAME: function() {
|
|
1433
|
+
return OUTLET_BOUNDARY_NAME;
|
|
1434
|
+
},
|
|
1435
|
+
VIEWPORT_BOUNDARY_NAME: function() {
|
|
1436
|
+
return VIEWPORT_BOUNDARY_NAME;
|
|
1437
|
+
}
|
|
1438
|
+
});
|
|
1439
|
+
const METADATA_BOUNDARY_NAME = '__next_metadata_boundary__';
|
|
1440
|
+
const VIEWPORT_BOUNDARY_NAME = '__next_viewport_boundary__';
|
|
1441
|
+
const OUTLET_BOUNDARY_NAME = '__next_outlet_boundary__';
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
} (metadataConstants));
|
|
1445
|
+
return metadataConstants;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
var scheduler = {};
|
|
1449
|
+
|
|
1450
|
+
var hasRequiredScheduler;
|
|
1451
|
+
|
|
1452
|
+
function requireScheduler () {
|
|
1453
|
+
if (hasRequiredScheduler) return scheduler;
|
|
1454
|
+
hasRequiredScheduler = 1;
|
|
1455
|
+
(function (exports) {
|
|
1456
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1457
|
+
value: true
|
|
1458
|
+
});
|
|
1459
|
+
function _export(target, all) {
|
|
1460
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1461
|
+
enumerable: true,
|
|
1462
|
+
get: all[name]
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
_export(exports, {
|
|
1466
|
+
atLeastOneTask: function() {
|
|
1467
|
+
return atLeastOneTask;
|
|
1468
|
+
},
|
|
1469
|
+
scheduleImmediate: function() {
|
|
1470
|
+
return scheduleImmediate;
|
|
1471
|
+
},
|
|
1472
|
+
scheduleOnNextTick: function() {
|
|
1473
|
+
return scheduleOnNextTick;
|
|
1474
|
+
},
|
|
1475
|
+
waitAtLeastOneReactRenderTask: function() {
|
|
1476
|
+
return waitAtLeastOneReactRenderTask;
|
|
1477
|
+
}
|
|
1478
|
+
});
|
|
1479
|
+
const scheduleOnNextTick = (cb)=>{
|
|
1480
|
+
// We use Promise.resolve().then() here so that the operation is scheduled at
|
|
1481
|
+
// the end of the promise job queue, we then add it to the next process tick
|
|
1482
|
+
// to ensure it's evaluated afterwards.
|
|
1483
|
+
//
|
|
1484
|
+
// This was inspired by the implementation of the DataLoader interface: https://github.com/graphql/dataloader/blob/d336bd15282664e0be4b4a657cb796f09bafbc6b/src/index.js#L213-L255
|
|
1485
|
+
//
|
|
1486
|
+
Promise.resolve().then(()=>{
|
|
1487
|
+
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
1488
|
+
setTimeout(cb, 0);
|
|
1489
|
+
} else {
|
|
1490
|
+
process.nextTick(cb);
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
};
|
|
1494
|
+
const scheduleImmediate = (cb)=>{
|
|
1495
|
+
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
1496
|
+
setTimeout(cb, 0);
|
|
1497
|
+
} else {
|
|
1498
|
+
setImmediate(cb);
|
|
1499
|
+
}
|
|
1500
|
+
};
|
|
1501
|
+
function atLeastOneTask() {
|
|
1502
|
+
return new Promise((resolve)=>scheduleImmediate(resolve));
|
|
1503
|
+
}
|
|
1504
|
+
function waitAtLeastOneReactRenderTask() {
|
|
1505
|
+
if (process.env.NEXT_RUNTIME === 'edge') {
|
|
1506
|
+
return new Promise((r)=>setTimeout(r, 0));
|
|
1507
|
+
} else {
|
|
1508
|
+
return new Promise((r)=>setImmediate(r));
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
} (scheduler));
|
|
1514
|
+
return scheduler;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
/**
|
|
1518
|
+
* The functions provided by this module are used to communicate certain properties
|
|
1519
|
+
* about the currently running code so that Next.js can make decisions on how to handle
|
|
1520
|
+
* the current execution in different rendering modes such as pre-rendering, resuming, and SSR.
|
|
1521
|
+
*
|
|
1522
|
+
* Today Next.js treats all code as potentially static. Certain APIs may only make sense when dynamically rendering.
|
|
1523
|
+
* Traditionally this meant deopting the entire render to dynamic however with PPR we can now deopt parts
|
|
1524
|
+
* of a React tree as dynamic while still keeping other parts static. There are really two different kinds of
|
|
1525
|
+
* Dynamic indications.
|
|
1526
|
+
*
|
|
1527
|
+
* The first is simply an intention to be dynamic. unstable_noStore is an example of this where
|
|
1528
|
+
* the currently executing code simply declares that the current scope is dynamic but if you use it
|
|
1529
|
+
* inside unstable_cache it can still be cached. This type of indication can be removed if we ever
|
|
1530
|
+
* make the default dynamic to begin with because the only way you would ever be static is inside
|
|
1531
|
+
* a cache scope which this indication does not affect.
|
|
1532
|
+
*
|
|
1533
|
+
* The second is an indication that a dynamic data source was read. This is a stronger form of dynamic
|
|
1534
|
+
* because it means that it is inappropriate to cache this at all. using a dynamic data source inside
|
|
1535
|
+
* unstable_cache should error. If you want to use some dynamic data inside unstable_cache you should
|
|
1536
|
+
* read that data outside the cache and pass it in as an argument to the cached function.
|
|
1537
|
+
*/
|
|
1538
|
+
|
|
1539
|
+
var hasRequiredDynamicRendering;
|
|
1540
|
+
|
|
1541
|
+
function requireDynamicRendering () {
|
|
1542
|
+
if (hasRequiredDynamicRendering) return dynamicRendering;
|
|
1543
|
+
hasRequiredDynamicRendering = 1;
|
|
1544
|
+
(function (exports) {
|
|
1545
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1546
|
+
value: true
|
|
1547
|
+
});
|
|
1548
|
+
function _export(target, all) {
|
|
1549
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
1550
|
+
enumerable: true,
|
|
1551
|
+
get: all[name]
|
|
1552
|
+
});
|
|
1553
|
+
}
|
|
1554
|
+
_export(exports, {
|
|
1555
|
+
Postpone: function() {
|
|
1556
|
+
return Postpone;
|
|
1557
|
+
},
|
|
1558
|
+
abortAndThrowOnSynchronousRequestDataAccess: function() {
|
|
1559
|
+
return abortAndThrowOnSynchronousRequestDataAccess;
|
|
1560
|
+
},
|
|
1561
|
+
abortOnSynchronousPlatformIOAccess: function() {
|
|
1562
|
+
return abortOnSynchronousPlatformIOAccess;
|
|
1563
|
+
},
|
|
1564
|
+
accessedDynamicData: function() {
|
|
1565
|
+
return accessedDynamicData;
|
|
1566
|
+
},
|
|
1567
|
+
annotateDynamicAccess: function() {
|
|
1568
|
+
return annotateDynamicAccess;
|
|
1569
|
+
},
|
|
1570
|
+
consumeDynamicAccess: function() {
|
|
1571
|
+
return consumeDynamicAccess;
|
|
1572
|
+
},
|
|
1573
|
+
createDynamicTrackingState: function() {
|
|
1574
|
+
return createDynamicTrackingState;
|
|
1575
|
+
},
|
|
1576
|
+
createDynamicValidationState: function() {
|
|
1577
|
+
return createDynamicValidationState;
|
|
1578
|
+
},
|
|
1579
|
+
createHangingInputAbortSignal: function() {
|
|
1580
|
+
return createHangingInputAbortSignal;
|
|
1581
|
+
},
|
|
1582
|
+
createPostponedAbortSignal: function() {
|
|
1583
|
+
return createPostponedAbortSignal;
|
|
1584
|
+
},
|
|
1585
|
+
formatDynamicAPIAccesses: function() {
|
|
1586
|
+
return formatDynamicAPIAccesses;
|
|
1587
|
+
},
|
|
1588
|
+
getFirstDynamicReason: function() {
|
|
1589
|
+
return getFirstDynamicReason;
|
|
1590
|
+
},
|
|
1591
|
+
isDynamicPostpone: function() {
|
|
1592
|
+
return isDynamicPostpone;
|
|
1593
|
+
},
|
|
1594
|
+
isPrerenderInterruptedError: function() {
|
|
1595
|
+
return isPrerenderInterruptedError;
|
|
1596
|
+
},
|
|
1597
|
+
markCurrentScopeAsDynamic: function() {
|
|
1598
|
+
return markCurrentScopeAsDynamic;
|
|
1599
|
+
},
|
|
1600
|
+
postponeWithTracking: function() {
|
|
1601
|
+
return postponeWithTracking;
|
|
1602
|
+
},
|
|
1603
|
+
throwIfDisallowedDynamic: function() {
|
|
1604
|
+
return throwIfDisallowedDynamic;
|
|
1605
|
+
},
|
|
1606
|
+
throwToInterruptStaticGeneration: function() {
|
|
1607
|
+
return throwToInterruptStaticGeneration;
|
|
1608
|
+
},
|
|
1609
|
+
trackAllowedDynamicAccess: function() {
|
|
1610
|
+
return trackAllowedDynamicAccess;
|
|
1611
|
+
},
|
|
1612
|
+
trackDynamicDataInDynamicRender: function() {
|
|
1613
|
+
return trackDynamicDataInDynamicRender;
|
|
1614
|
+
},
|
|
1615
|
+
trackFallbackParamAccessed: function() {
|
|
1616
|
+
return trackFallbackParamAccessed;
|
|
1617
|
+
},
|
|
1618
|
+
trackSynchronousPlatformIOAccessInDev: function() {
|
|
1619
|
+
return trackSynchronousPlatformIOAccessInDev;
|
|
1620
|
+
},
|
|
1621
|
+
trackSynchronousRequestDataAccessInDev: function() {
|
|
1622
|
+
return trackSynchronousRequestDataAccessInDev;
|
|
1623
|
+
},
|
|
1624
|
+
useDynamicRouteParams: function() {
|
|
1625
|
+
return useDynamicRouteParams;
|
|
1626
|
+
}
|
|
1627
|
+
});
|
|
1628
|
+
const _react = /*#__PURE__*/ _interop_require_default(require$$0);
|
|
1629
|
+
const _hooksservercontext = requireHooksServerContext();
|
|
1630
|
+
const _staticgenerationbailout = requireStaticGenerationBailout();
|
|
1631
|
+
const _workunitasyncstorageexternal = requireWorkUnitAsyncStorage_external();
|
|
1632
|
+
const _workasyncstorageexternal = requireWorkAsyncStorage_external();
|
|
1633
|
+
const _dynamicrenderingutils = requireDynamicRenderingUtils();
|
|
1634
|
+
const _metadataconstants = requireMetadataConstants();
|
|
1635
|
+
const _scheduler = requireScheduler();
|
|
1636
|
+
function _interop_require_default(obj) {
|
|
1637
|
+
return obj && obj.__esModule ? obj : {
|
|
1638
|
+
default: obj
|
|
1639
|
+
};
|
|
1640
|
+
}
|
|
1641
|
+
const hasPostpone = typeof _react.default.unstable_postpone === 'function';
|
|
1642
|
+
function createDynamicTrackingState(isDebugDynamicAccesses) {
|
|
1643
|
+
return {
|
|
1644
|
+
isDebugDynamicAccesses,
|
|
1645
|
+
dynamicAccesses: [],
|
|
1646
|
+
syncDynamicExpression: undefined,
|
|
1647
|
+
syncDynamicErrorWithStack: null
|
|
1648
|
+
};
|
|
1649
|
+
}
|
|
1650
|
+
function createDynamicValidationState() {
|
|
1651
|
+
return {
|
|
1652
|
+
hasSuspendedDynamic: false,
|
|
1653
|
+
hasDynamicMetadata: false,
|
|
1654
|
+
hasDynamicViewport: false,
|
|
1655
|
+
hasSyncDynamicErrors: false,
|
|
1656
|
+
dynamicErrors: []
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
function getFirstDynamicReason(trackingState) {
|
|
1660
|
+
var _trackingState_dynamicAccesses_;
|
|
1661
|
+
return (_trackingState_dynamicAccesses_ = trackingState.dynamicAccesses[0]) == null ? void 0 : _trackingState_dynamicAccesses_.expression;
|
|
1662
|
+
}
|
|
1663
|
+
function markCurrentScopeAsDynamic(store, workUnitStore, expression) {
|
|
1664
|
+
if (workUnitStore) {
|
|
1665
|
+
if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {
|
|
1666
|
+
// inside cache scopes marking a scope as dynamic has no effect because the outer cache scope
|
|
1667
|
+
// creates a cache boundary. This is subtly different from reading a dynamic data source which is
|
|
1668
|
+
// forbidden inside a cache scope.
|
|
1669
|
+
return;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
// If we're forcing dynamic rendering or we're forcing static rendering, we
|
|
1673
|
+
// don't need to do anything here because the entire page is already dynamic
|
|
1674
|
+
// or it's static and it should not throw or postpone here.
|
|
1675
|
+
if (store.forceDynamic || store.forceStatic) return;
|
|
1676
|
+
if (store.dynamicShouldError) {
|
|
1677
|
+
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", {
|
|
1678
|
+
value: "E553",
|
|
1679
|
+
enumerable: false,
|
|
1680
|
+
configurable: true
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
if (workUnitStore) {
|
|
1684
|
+
if (workUnitStore.type === 'prerender-ppr') {
|
|
1685
|
+
postponeWithTracking(store.route, expression, workUnitStore.dynamicTracking);
|
|
1686
|
+
} else if (workUnitStore.type === 'prerender-legacy') {
|
|
1687
|
+
workUnitStore.revalidate = 0;
|
|
1688
|
+
// We aren't prerendering but we are generating a static page. We need to bail out of static generation
|
|
1689
|
+
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", {
|
|
1690
|
+
value: "E550",
|
|
1691
|
+
enumerable: false,
|
|
1692
|
+
configurable: true
|
|
1693
|
+
});
|
|
1694
|
+
store.dynamicUsageDescription = expression;
|
|
1695
|
+
store.dynamicUsageStack = err.stack;
|
|
1696
|
+
throw err;
|
|
1697
|
+
} else if (process.env.NODE_ENV === 'development' && workUnitStore && workUnitStore.type === 'request') {
|
|
1698
|
+
workUnitStore.usedDynamic = true;
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
function trackFallbackParamAccessed(store, expression) {
|
|
1703
|
+
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
1704
|
+
if (!prerenderStore || prerenderStore.type !== 'prerender-ppr') return;
|
|
1705
|
+
postponeWithTracking(store.route, expression, prerenderStore.dynamicTracking);
|
|
1706
|
+
}
|
|
1707
|
+
function throwToInterruptStaticGeneration(expression, store, prerenderStore) {
|
|
1708
|
+
// We aren't prerendering but we are generating a static page. We need to bail out of static generation
|
|
1709
|
+
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", {
|
|
1710
|
+
value: "E558",
|
|
1711
|
+
enumerable: false,
|
|
1712
|
+
configurable: true
|
|
1713
|
+
});
|
|
1714
|
+
prerenderStore.revalidate = 0;
|
|
1715
|
+
store.dynamicUsageDescription = expression;
|
|
1716
|
+
store.dynamicUsageStack = err.stack;
|
|
1717
|
+
throw err;
|
|
1718
|
+
}
|
|
1719
|
+
function trackDynamicDataInDynamicRender(_store, workUnitStore) {
|
|
1720
|
+
if (workUnitStore) {
|
|
1721
|
+
if (workUnitStore.type === 'cache' || workUnitStore.type === 'unstable-cache') {
|
|
1722
|
+
// inside cache scopes marking a scope as dynamic has no effect because the outer cache scope
|
|
1723
|
+
// creates a cache boundary. This is subtly different from reading a dynamic data source which is
|
|
1724
|
+
// forbidden inside a cache scope.
|
|
1725
|
+
return;
|
|
1726
|
+
}
|
|
1727
|
+
if (workUnitStore.type === 'prerender' || workUnitStore.type === 'prerender-legacy') {
|
|
1728
|
+
workUnitStore.revalidate = 0;
|
|
1729
|
+
}
|
|
1730
|
+
if (process.env.NODE_ENV === 'development' && workUnitStore.type === 'request') {
|
|
1731
|
+
workUnitStore.usedDynamic = true;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
// Despite it's name we don't actually abort unless we have a controller to call abort on
|
|
1736
|
+
// There are times when we let a prerender run long to discover caches where we want the semantics
|
|
1737
|
+
// of tracking dynamic access without terminating the prerender early
|
|
1738
|
+
function abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore) {
|
|
1739
|
+
const reason = `Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`;
|
|
1740
|
+
const error = createPrerenderInterruptedError(reason);
|
|
1741
|
+
prerenderStore.controller.abort(error);
|
|
1742
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1743
|
+
if (dynamicTracking) {
|
|
1744
|
+
dynamicTracking.dynamicAccesses.push({
|
|
1745
|
+
// When we aren't debugging, we don't need to create another error for the
|
|
1746
|
+
// stack trace.
|
|
1747
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
|
|
1748
|
+
expression
|
|
1749
|
+
});
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
function abortOnSynchronousPlatformIOAccess(route, expression, errorWithStack, prerenderStore) {
|
|
1753
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1754
|
+
if (dynamicTracking) {
|
|
1755
|
+
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
1756
|
+
dynamicTracking.syncDynamicExpression = expression;
|
|
1757
|
+
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1761
|
+
}
|
|
1762
|
+
function trackSynchronousPlatformIOAccessInDev(requestStore) {
|
|
1763
|
+
// We don't actually have a controller to abort but we do the semantic equivalent by
|
|
1764
|
+
// advancing the request store out of prerender mode
|
|
1765
|
+
requestStore.prerenderPhase = false;
|
|
1766
|
+
}
|
|
1767
|
+
function abortAndThrowOnSynchronousRequestDataAccess(route, expression, errorWithStack, prerenderStore) {
|
|
1768
|
+
const prerenderSignal = prerenderStore.controller.signal;
|
|
1769
|
+
if (prerenderSignal.aborted === false) {
|
|
1770
|
+
// TODO it would be better to move this aborted check into the callsite so we can avoid making
|
|
1771
|
+
// the error object when it isn't relevant to the aborting of the prerender however
|
|
1772
|
+
// since we need the throw semantics regardless of whether we abort it is easier to land
|
|
1773
|
+
// this way. See how this was handled with `abortOnSynchronousPlatformIOAccess` for a closer
|
|
1774
|
+
// to ideal implementation
|
|
1775
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1776
|
+
if (dynamicTracking) {
|
|
1777
|
+
if (dynamicTracking.syncDynamicErrorWithStack === null) {
|
|
1778
|
+
dynamicTracking.syncDynamicExpression = expression;
|
|
1779
|
+
dynamicTracking.syncDynamicErrorWithStack = errorWithStack;
|
|
1780
|
+
if (prerenderStore.validating === true) {
|
|
1781
|
+
// We always log Request Access in dev at the point of calling the function
|
|
1782
|
+
// So we mark the dynamic validation as not requiring it to be printed
|
|
1783
|
+
dynamicTracking.syncDynamicLogged = true;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
abortOnSynchronousDynamicDataAccess(route, expression, prerenderStore);
|
|
1788
|
+
}
|
|
1789
|
+
throw createPrerenderInterruptedError(`Route ${route} needs to bail out of prerendering at this point because it used ${expression}.`);
|
|
1790
|
+
}
|
|
1791
|
+
const trackSynchronousRequestDataAccessInDev = trackSynchronousPlatformIOAccessInDev;
|
|
1792
|
+
function Postpone({ reason, route }) {
|
|
1793
|
+
const prerenderStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
1794
|
+
const dynamicTracking = prerenderStore && prerenderStore.type === 'prerender-ppr' ? prerenderStore.dynamicTracking : null;
|
|
1795
|
+
postponeWithTracking(route, reason, dynamicTracking);
|
|
1796
|
+
}
|
|
1797
|
+
function postponeWithTracking(route, expression, dynamicTracking) {
|
|
1798
|
+
assertPostpone();
|
|
1799
|
+
if (dynamicTracking) {
|
|
1800
|
+
dynamicTracking.dynamicAccesses.push({
|
|
1801
|
+
// When we aren't debugging, we don't need to create another error for the
|
|
1802
|
+
// stack trace.
|
|
1803
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
|
|
1804
|
+
expression
|
|
1805
|
+
});
|
|
1806
|
+
}
|
|
1807
|
+
_react.default.unstable_postpone(createPostponeReason(route, expression));
|
|
1808
|
+
}
|
|
1809
|
+
function createPostponeReason(route, expression) {
|
|
1810
|
+
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`;
|
|
1811
|
+
}
|
|
1812
|
+
function isDynamicPostpone(err) {
|
|
1813
|
+
if (typeof err === 'object' && err !== null && typeof err.message === 'string') {
|
|
1814
|
+
return isDynamicPostponeReason(err.message);
|
|
1815
|
+
}
|
|
1816
|
+
return false;
|
|
1817
|
+
}
|
|
1818
|
+
function isDynamicPostponeReason(reason) {
|
|
1819
|
+
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');
|
|
1820
|
+
}
|
|
1821
|
+
if (isDynamicPostponeReason(createPostponeReason('%%%', '^^^')) === false) {
|
|
1822
|
+
throw Object.defineProperty(new Error('Invariant: isDynamicPostpone misidentified a postpone reason. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
|
|
1823
|
+
value: "E296",
|
|
1824
|
+
enumerable: false,
|
|
1825
|
+
configurable: true
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
const NEXT_PRERENDER_INTERRUPTED = 'NEXT_PRERENDER_INTERRUPTED';
|
|
1829
|
+
function createPrerenderInterruptedError(message) {
|
|
1830
|
+
const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
1831
|
+
value: "E394",
|
|
1832
|
+
enumerable: false,
|
|
1833
|
+
configurable: true
|
|
1834
|
+
});
|
|
1835
|
+
error.digest = NEXT_PRERENDER_INTERRUPTED;
|
|
1836
|
+
return error;
|
|
1837
|
+
}
|
|
1838
|
+
function isPrerenderInterruptedError(error) {
|
|
1839
|
+
return typeof error === 'object' && error !== null && error.digest === NEXT_PRERENDER_INTERRUPTED && 'name' in error && 'message' in error && error instanceof Error;
|
|
1840
|
+
}
|
|
1841
|
+
function accessedDynamicData(dynamicAccesses) {
|
|
1842
|
+
return dynamicAccesses.length > 0;
|
|
1843
|
+
}
|
|
1844
|
+
function consumeDynamicAccess(serverDynamic, clientDynamic) {
|
|
1845
|
+
// We mutate because we only call this once we are no longer writing
|
|
1846
|
+
// to the dynamicTrackingState and it's more efficient than creating a new
|
|
1847
|
+
// array.
|
|
1848
|
+
serverDynamic.dynamicAccesses.push(...clientDynamic.dynamicAccesses);
|
|
1849
|
+
return serverDynamic.dynamicAccesses;
|
|
1850
|
+
}
|
|
1851
|
+
function formatDynamicAPIAccesses(dynamicAccesses) {
|
|
1852
|
+
return dynamicAccesses.filter((access)=>typeof access.stack === 'string' && access.stack.length > 0).map(({ expression, stack })=>{
|
|
1853
|
+
stack = stack.split('\n')// Remove the "Error: " prefix from the first line of the stack trace as
|
|
1854
|
+
// well as the first 4 lines of the stack trace which is the distance
|
|
1855
|
+
// from the user code and the `new Error().stack` call.
|
|
1856
|
+
.slice(4).filter((line)=>{
|
|
1857
|
+
// Exclude Next.js internals from the stack trace.
|
|
1858
|
+
if (line.includes('node_modules/next/')) {
|
|
1859
|
+
return false;
|
|
1860
|
+
}
|
|
1861
|
+
// Exclude anonymous functions from the stack trace.
|
|
1862
|
+
if (line.includes(' (<anonymous>)')) {
|
|
1863
|
+
return false;
|
|
1864
|
+
}
|
|
1865
|
+
// Exclude Node.js internals from the stack trace.
|
|
1866
|
+
if (line.includes(' (node:')) {
|
|
1867
|
+
return false;
|
|
1868
|
+
}
|
|
1869
|
+
return true;
|
|
1870
|
+
}).join('\n');
|
|
1871
|
+
return `Dynamic API Usage Debug - ${expression}:\n${stack}`;
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
function assertPostpone() {
|
|
1875
|
+
if (!hasPostpone) {
|
|
1876
|
+
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", {
|
|
1877
|
+
value: "E224",
|
|
1878
|
+
enumerable: false,
|
|
1879
|
+
configurable: true
|
|
1880
|
+
});
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
function createPostponedAbortSignal(reason) {
|
|
1884
|
+
assertPostpone();
|
|
1885
|
+
const controller = new AbortController();
|
|
1886
|
+
// We get our hands on a postpone instance by calling postpone and catching the throw
|
|
1887
|
+
try {
|
|
1888
|
+
_react.default.unstable_postpone(reason);
|
|
1889
|
+
} catch (x) {
|
|
1890
|
+
controller.abort(x);
|
|
1891
|
+
}
|
|
1892
|
+
return controller.signal;
|
|
1893
|
+
}
|
|
1894
|
+
function createHangingInputAbortSignal(workUnitStore) {
|
|
1895
|
+
const controller = new AbortController();
|
|
1896
|
+
if (workUnitStore.cacheSignal) {
|
|
1897
|
+
// If we have a cacheSignal it means we're in a prospective render. If the input
|
|
1898
|
+
// we're waiting on is coming from another cache, we do want to wait for it so that
|
|
1899
|
+
// we can resolve this cache entry too.
|
|
1900
|
+
workUnitStore.cacheSignal.inputReady().then(()=>{
|
|
1901
|
+
controller.abort();
|
|
1902
|
+
});
|
|
1903
|
+
} else {
|
|
1904
|
+
// Otherwise we're in the final render and we should already have all our caches
|
|
1905
|
+
// filled. We might still be waiting on some microtasks so we wait one tick before
|
|
1906
|
+
// giving up. When we give up, we still want to render the content of this cache
|
|
1907
|
+
// as deeply as we can so that we can suspend as deeply as possible in the tree
|
|
1908
|
+
// or not at all if we don't end up waiting for the input.
|
|
1909
|
+
(0, _scheduler.scheduleOnNextTick)(()=>controller.abort());
|
|
1910
|
+
}
|
|
1911
|
+
return controller.signal;
|
|
1912
|
+
}
|
|
1913
|
+
function annotateDynamicAccess(expression, prerenderStore) {
|
|
1914
|
+
const dynamicTracking = prerenderStore.dynamicTracking;
|
|
1915
|
+
if (dynamicTracking) {
|
|
1916
|
+
dynamicTracking.dynamicAccesses.push({
|
|
1917
|
+
stack: dynamicTracking.isDebugDynamicAccesses ? new Error().stack : undefined,
|
|
1918
|
+
expression
|
|
1919
|
+
});
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
function useDynamicRouteParams(expression) {
|
|
1923
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
1924
|
+
if (workStore && workStore.isStaticGeneration && workStore.fallbackRouteParams && workStore.fallbackRouteParams.size > 0) {
|
|
1925
|
+
// There are fallback route params, we should track these as dynamic
|
|
1926
|
+
// accesses.
|
|
1927
|
+
const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
|
|
1928
|
+
if (workUnitStore) {
|
|
1929
|
+
// We're prerendering with dynamicIO or PPR or both
|
|
1930
|
+
if (workUnitStore.type === 'prerender') {
|
|
1931
|
+
// We are in a prerender with dynamicIO semantics
|
|
1932
|
+
// We are going to hang here and never resolve. This will cause the currently
|
|
1933
|
+
// rendering component to effectively be a dynamic hole
|
|
1934
|
+
_react.default.use((0, _dynamicrenderingutils.makeHangingPromise)(workUnitStore.renderSignal, expression));
|
|
1935
|
+
} else if (workUnitStore.type === 'prerender-ppr') {
|
|
1936
|
+
// We're prerendering with PPR
|
|
1937
|
+
postponeWithTracking(workStore.route, expression, workUnitStore.dynamicTracking);
|
|
1938
|
+
} else if (workUnitStore.type === 'prerender-legacy') {
|
|
1939
|
+
throwToInterruptStaticGeneration(expression, workStore, workUnitStore);
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
const hasSuspenseRegex = /\n\s+at Suspense \(<anonymous>\)/;
|
|
1945
|
+
const hasMetadataRegex = new RegExp(`\\n\\s+at ${_metadataconstants.METADATA_BOUNDARY_NAME}[\\n\\s]`);
|
|
1946
|
+
const hasViewportRegex = new RegExp(`\\n\\s+at ${_metadataconstants.VIEWPORT_BOUNDARY_NAME}[\\n\\s]`);
|
|
1947
|
+
const hasOutletRegex = new RegExp(`\\n\\s+at ${_metadataconstants.OUTLET_BOUNDARY_NAME}[\\n\\s]`);
|
|
1948
|
+
function trackAllowedDynamicAccess(route, componentStack, dynamicValidation, serverDynamic, clientDynamic) {
|
|
1949
|
+
if (hasOutletRegex.test(componentStack)) {
|
|
1950
|
+
// We don't need to track that this is dynamic. It is only so when something else is also dynamic.
|
|
1951
|
+
return;
|
|
1952
|
+
} else if (hasMetadataRegex.test(componentStack)) {
|
|
1953
|
+
dynamicValidation.hasDynamicMetadata = true;
|
|
1954
|
+
return;
|
|
1955
|
+
} else if (hasViewportRegex.test(componentStack)) {
|
|
1956
|
+
dynamicValidation.hasDynamicViewport = true;
|
|
1957
|
+
return;
|
|
1958
|
+
} else if (hasSuspenseRegex.test(componentStack)) {
|
|
1959
|
+
dynamicValidation.hasSuspendedDynamic = true;
|
|
1960
|
+
return;
|
|
1961
|
+
} else if (serverDynamic.syncDynamicErrorWithStack || clientDynamic.syncDynamicErrorWithStack) {
|
|
1962
|
+
dynamicValidation.hasSyncDynamicErrors = true;
|
|
1963
|
+
return;
|
|
1964
|
+
} else {
|
|
1965
|
+
const message = `Route "${route}": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense`;
|
|
1966
|
+
const error = createErrorWithComponentStack(message, componentStack);
|
|
1967
|
+
dynamicValidation.dynamicErrors.push(error);
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
function createErrorWithComponentStack(message, componentStack) {
|
|
1972
|
+
const error = Object.defineProperty(new Error(message), "__NEXT_ERROR_CODE", {
|
|
1973
|
+
value: "E394",
|
|
1974
|
+
enumerable: false,
|
|
1975
|
+
configurable: true
|
|
1976
|
+
});
|
|
1977
|
+
error.stack = 'Error: ' + message + componentStack;
|
|
1978
|
+
return error;
|
|
1979
|
+
}
|
|
1980
|
+
function throwIfDisallowedDynamic(route, dynamicValidation, serverDynamic, clientDynamic) {
|
|
1981
|
+
let syncError;
|
|
1982
|
+
let syncExpression;
|
|
1983
|
+
let syncLogged;
|
|
1984
|
+
if (serverDynamic.syncDynamicErrorWithStack) {
|
|
1985
|
+
syncError = serverDynamic.syncDynamicErrorWithStack;
|
|
1986
|
+
syncExpression = serverDynamic.syncDynamicExpression;
|
|
1987
|
+
syncLogged = serverDynamic.syncDynamicLogged === true;
|
|
1988
|
+
} else if (clientDynamic.syncDynamicErrorWithStack) {
|
|
1989
|
+
syncError = clientDynamic.syncDynamicErrorWithStack;
|
|
1990
|
+
syncExpression = clientDynamic.syncDynamicExpression;
|
|
1991
|
+
syncLogged = clientDynamic.syncDynamicLogged === true;
|
|
1992
|
+
} else {
|
|
1993
|
+
syncError = null;
|
|
1994
|
+
syncExpression = undefined;
|
|
1995
|
+
syncLogged = false;
|
|
1996
|
+
}
|
|
1997
|
+
if (dynamicValidation.hasSyncDynamicErrors && syncError) {
|
|
1998
|
+
if (!syncLogged) {
|
|
1999
|
+
// In dev we already log errors about sync dynamic access. But during builds we need to ensure
|
|
2000
|
+
// the offending sync error is logged before we exit the build
|
|
2001
|
+
console.error(syncError);
|
|
2002
|
+
}
|
|
2003
|
+
// The actual error should have been logged when the sync access ocurred
|
|
2004
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
2005
|
+
}
|
|
2006
|
+
const dynamicErrors = dynamicValidation.dynamicErrors;
|
|
2007
|
+
if (dynamicErrors.length) {
|
|
2008
|
+
for(let i = 0; i < dynamicErrors.length; i++){
|
|
2009
|
+
console.error(dynamicErrors[i]);
|
|
2010
|
+
}
|
|
2011
|
+
throw new _staticgenerationbailout.StaticGenBailoutError();
|
|
2012
|
+
}
|
|
2013
|
+
if (!dynamicValidation.hasSuspendedDynamic) {
|
|
2014
|
+
if (dynamicValidation.hasDynamicMetadata) {
|
|
2015
|
+
if (syncError) {
|
|
2016
|
+
console.error(syncError);
|
|
2017
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateMetadata\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`), "__NEXT_ERROR_CODE", {
|
|
2018
|
+
value: "E608",
|
|
2019
|
+
enumerable: false,
|
|
2020
|
+
configurable: true
|
|
2021
|
+
});
|
|
2022
|
+
}
|
|
2023
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateMetadata\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateMetadata\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`), "__NEXT_ERROR_CODE", {
|
|
2024
|
+
value: "E534",
|
|
2025
|
+
enumerable: false,
|
|
2026
|
+
configurable: true
|
|
2027
|
+
});
|
|
2028
|
+
} else if (dynamicValidation.hasDynamicViewport) {
|
|
2029
|
+
if (syncError) {
|
|
2030
|
+
console.error(syncError);
|
|
2031
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateViewport\` that could not finish rendering before ${syncExpression} was used. Follow the instructions in the error for this expression to resolve.`), "__NEXT_ERROR_CODE", {
|
|
2032
|
+
value: "E573",
|
|
2033
|
+
enumerable: false,
|
|
2034
|
+
configurable: true
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
2037
|
+
throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError(`Route "${route}" has a \`generateViewport\` that depends on Request data (\`cookies()\`, etc...) or external data (\`fetch(...)\`, etc...) but the rest of the route was static or only used cached data (\`"use cache"\`). If you expected this route to be prerenderable update your \`generateViewport\` to not use Request data and only use cached external data. Otherwise, add \`await connection()\` somewhere within this route to indicate explicitly it should not be prerendered.`), "__NEXT_ERROR_CODE", {
|
|
2038
|
+
value: "E590",
|
|
2039
|
+
enumerable: false,
|
|
2040
|
+
configurable: true
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
|
|
2047
|
+
} (dynamicRendering));
|
|
2048
|
+
return dynamicRendering;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
var hasRequiredUnstableRethrow_server;
|
|
2052
|
+
|
|
2053
|
+
function requireUnstableRethrow_server () {
|
|
2054
|
+
if (hasRequiredUnstableRethrow_server) return unstableRethrow_server.exports;
|
|
2055
|
+
hasRequiredUnstableRethrow_server = 1;
|
|
2056
|
+
(function (module, exports) {
|
|
2057
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2058
|
+
value: true
|
|
2059
|
+
});
|
|
2060
|
+
Object.defineProperty(exports, "unstable_rethrow", {
|
|
2061
|
+
enumerable: true,
|
|
2062
|
+
get: function() {
|
|
2063
|
+
return unstable_rethrow;
|
|
2064
|
+
}
|
|
2065
|
+
});
|
|
2066
|
+
const _dynamicrenderingutils = requireDynamicRenderingUtils();
|
|
2067
|
+
const _ispostpone = requireIsPostpone();
|
|
2068
|
+
const _bailouttocsr = requireBailoutToCsr();
|
|
2069
|
+
const _isnextroutererror = requireIsNextRouterError();
|
|
2070
|
+
const _dynamicrendering = requireDynamicRendering();
|
|
2071
|
+
const _hooksservercontext = requireHooksServerContext();
|
|
2072
|
+
function unstable_rethrow(error) {
|
|
2073
|
+
if ((0, _isnextroutererror.isNextRouterError)(error) || (0, _bailouttocsr.isBailoutToCSRError)(error) || (0, _hooksservercontext.isDynamicServerError)(error) || (0, _dynamicrendering.isDynamicPostpone)(error) || (0, _ispostpone.isPostpone)(error) || (0, _dynamicrenderingutils.isHangingPromiseRejectionError)(error)) {
|
|
2074
|
+
throw error;
|
|
2075
|
+
}
|
|
2076
|
+
if (error instanceof Error && 'cause' in error) {
|
|
2077
|
+
unstable_rethrow(error.cause);
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2082
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2083
|
+
Object.assign(exports.default, exports);
|
|
2084
|
+
module.exports = exports.default;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
|
|
2088
|
+
} (unstableRethrow_server, unstableRethrow_server.exports));
|
|
2089
|
+
return unstableRethrow_server.exports;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
var unstableRethrow_browser = {exports: {}};
|
|
2093
|
+
|
|
2094
|
+
var hasRequiredUnstableRethrow_browser;
|
|
2095
|
+
|
|
2096
|
+
function requireUnstableRethrow_browser () {
|
|
2097
|
+
if (hasRequiredUnstableRethrow_browser) return unstableRethrow_browser.exports;
|
|
2098
|
+
hasRequiredUnstableRethrow_browser = 1;
|
|
2099
|
+
(function (module, exports) {
|
|
2100
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2101
|
+
value: true
|
|
2102
|
+
});
|
|
2103
|
+
Object.defineProperty(exports, "unstable_rethrow", {
|
|
2104
|
+
enumerable: true,
|
|
2105
|
+
get: function() {
|
|
2106
|
+
return unstable_rethrow;
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
const _bailouttocsr = requireBailoutToCsr();
|
|
2110
|
+
const _isnextroutererror = requireIsNextRouterError();
|
|
2111
|
+
function unstable_rethrow(error) {
|
|
2112
|
+
if ((0, _isnextroutererror.isNextRouterError)(error) || (0, _bailouttocsr.isBailoutToCSRError)(error)) {
|
|
2113
|
+
throw error;
|
|
2114
|
+
}
|
|
2115
|
+
if (error instanceof Error && 'cause' in error) {
|
|
2116
|
+
unstable_rethrow(error.cause);
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2121
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2122
|
+
Object.assign(exports.default, exports);
|
|
2123
|
+
module.exports = exports.default;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
} (unstableRethrow_browser, unstableRethrow_browser.exports));
|
|
2128
|
+
return unstableRethrow_browser.exports;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* This function should be used to rethrow internal Next.js errors so that they can be handled by the framework.
|
|
2133
|
+
* When wrapping an API that uses errors to interrupt control flow, you should use this function before you do any error handling.
|
|
2134
|
+
* This function will rethrow the error if it is a Next.js error so it can be handled, otherwise it will do nothing.
|
|
2135
|
+
*
|
|
2136
|
+
* Read more: [Next.js Docs: `unstable_rethrow`](https://nextjs.org/docs/app/api-reference/functions/unstable_rethrow)
|
|
2137
|
+
*/
|
|
2138
|
+
|
|
2139
|
+
var hasRequiredUnstableRethrow;
|
|
2140
|
+
|
|
2141
|
+
function requireUnstableRethrow () {
|
|
2142
|
+
if (hasRequiredUnstableRethrow) return unstableRethrow.exports;
|
|
2143
|
+
hasRequiredUnstableRethrow = 1;
|
|
2144
|
+
(function (module, exports) {
|
|
2145
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2146
|
+
value: true
|
|
2147
|
+
});
|
|
2148
|
+
Object.defineProperty(exports, "unstable_rethrow", {
|
|
2149
|
+
enumerable: true,
|
|
2150
|
+
get: function() {
|
|
2151
|
+
return unstable_rethrow;
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
2154
|
+
const unstable_rethrow = typeof window === 'undefined' ? requireUnstableRethrow_server().unstable_rethrow : requireUnstableRethrow_browser().unstable_rethrow;
|
|
2155
|
+
|
|
2156
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2157
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2158
|
+
Object.assign(exports.default, exports);
|
|
2159
|
+
module.exports = exports.default;
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
} (unstableRethrow, unstableRethrow.exports));
|
|
2164
|
+
return unstableRethrow.exports;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
/** @internal */
|
|
2168
|
+
|
|
2169
|
+
var hasRequiredNavigation_reactServer;
|
|
2170
|
+
|
|
2171
|
+
function requireNavigation_reactServer () {
|
|
2172
|
+
if (hasRequiredNavigation_reactServer) return navigation_reactServer.exports;
|
|
2173
|
+
hasRequiredNavigation_reactServer = 1;
|
|
2174
|
+
(function (module, exports) {
|
|
2175
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2176
|
+
value: true
|
|
2177
|
+
});
|
|
2178
|
+
function _export(target, all) {
|
|
2179
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
2180
|
+
enumerable: true,
|
|
2181
|
+
get: all[name]
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
_export(exports, {
|
|
2185
|
+
ReadonlyURLSearchParams: function() {
|
|
2186
|
+
return ReadonlyURLSearchParams;
|
|
2187
|
+
},
|
|
2188
|
+
RedirectType: function() {
|
|
2189
|
+
return _redirecterror.RedirectType;
|
|
2190
|
+
},
|
|
2191
|
+
forbidden: function() {
|
|
2192
|
+
return _forbidden.forbidden;
|
|
2193
|
+
},
|
|
2194
|
+
notFound: function() {
|
|
2195
|
+
return _notfound.notFound;
|
|
2196
|
+
},
|
|
2197
|
+
permanentRedirect: function() {
|
|
2198
|
+
return _redirect.permanentRedirect;
|
|
2199
|
+
},
|
|
2200
|
+
redirect: function() {
|
|
2201
|
+
return _redirect.redirect;
|
|
2202
|
+
},
|
|
2203
|
+
unauthorized: function() {
|
|
2204
|
+
return _unauthorized.unauthorized;
|
|
2205
|
+
},
|
|
2206
|
+
unstable_rethrow: function() {
|
|
2207
|
+
return _unstablerethrow.unstable_rethrow;
|
|
2208
|
+
}
|
|
2209
|
+
});
|
|
2210
|
+
const _redirect = requireRedirect();
|
|
2211
|
+
const _redirecterror = requireRedirectError();
|
|
2212
|
+
const _notfound = requireNotFound();
|
|
2213
|
+
const _forbidden = requireForbidden();
|
|
2214
|
+
const _unauthorized = requireUnauthorized();
|
|
2215
|
+
const _unstablerethrow = requireUnstableRethrow();
|
|
2216
|
+
class ReadonlyURLSearchParamsError extends Error {
|
|
2217
|
+
constructor(){
|
|
2218
|
+
super('Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams');
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
class ReadonlyURLSearchParams extends URLSearchParams {
|
|
2222
|
+
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ append() {
|
|
2223
|
+
throw new ReadonlyURLSearchParamsError();
|
|
2224
|
+
}
|
|
2225
|
+
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ delete() {
|
|
2226
|
+
throw new ReadonlyURLSearchParamsError();
|
|
2227
|
+
}
|
|
2228
|
+
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ set() {
|
|
2229
|
+
throw new ReadonlyURLSearchParamsError();
|
|
2230
|
+
}
|
|
2231
|
+
/** @deprecated Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams */ sort() {
|
|
2232
|
+
throw new ReadonlyURLSearchParamsError();
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2237
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2238
|
+
Object.assign(exports.default, exports);
|
|
2239
|
+
module.exports = exports.default;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
} (navigation_reactServer, navigation_reactServer.exports));
|
|
2244
|
+
return navigation_reactServer.exports;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
var serverInsertedHtml_sharedRuntime = {};
|
|
2248
|
+
|
|
2249
|
+
var hasRequiredServerInsertedHtml_sharedRuntime;
|
|
2250
|
+
|
|
2251
|
+
function requireServerInsertedHtml_sharedRuntime () {
|
|
2252
|
+
if (hasRequiredServerInsertedHtml_sharedRuntime) return serverInsertedHtml_sharedRuntime;
|
|
2253
|
+
hasRequiredServerInsertedHtml_sharedRuntime = 1;
|
|
2254
|
+
(function (exports) {
|
|
2255
|
+
'use client';
|
|
2256
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2257
|
+
value: true
|
|
2258
|
+
});
|
|
2259
|
+
function _export(target, all) {
|
|
2260
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
2261
|
+
enumerable: true,
|
|
2262
|
+
get: all[name]
|
|
2263
|
+
});
|
|
2264
|
+
}
|
|
2265
|
+
_export(exports, {
|
|
2266
|
+
ServerInsertedHTMLContext: function() {
|
|
2267
|
+
return ServerInsertedHTMLContext;
|
|
2268
|
+
},
|
|
2269
|
+
useServerInsertedHTML: function() {
|
|
2270
|
+
return useServerInsertedHTML;
|
|
2271
|
+
}
|
|
2272
|
+
});
|
|
2273
|
+
const _interop_require_wildcard = /*@__PURE__*/ require_interop_require_wildcard();
|
|
2274
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require$$0);
|
|
2275
|
+
const ServerInsertedHTMLContext = /*#__PURE__*/ _react.default.createContext(null);
|
|
2276
|
+
function useServerInsertedHTML(callback) {
|
|
2277
|
+
const addInsertedServerHTMLCallback = (0, _react.useContext)(ServerInsertedHTMLContext);
|
|
2278
|
+
// Should have no effects on client where there's no flush effects provider
|
|
2279
|
+
if (addInsertedServerHTMLCallback) {
|
|
2280
|
+
addInsertedServerHTMLCallback(callback);
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
|
|
2285
|
+
} (serverInsertedHtml_sharedRuntime));
|
|
2286
|
+
return serverInsertedHtml_sharedRuntime;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
var bailoutToClientRendering = {exports: {}};
|
|
2290
|
+
|
|
2291
|
+
var hasRequiredBailoutToClientRendering;
|
|
2292
|
+
|
|
2293
|
+
function requireBailoutToClientRendering () {
|
|
2294
|
+
if (hasRequiredBailoutToClientRendering) return bailoutToClientRendering.exports;
|
|
2295
|
+
hasRequiredBailoutToClientRendering = 1;
|
|
2296
|
+
(function (module, exports) {
|
|
2297
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2298
|
+
value: true
|
|
2299
|
+
});
|
|
2300
|
+
Object.defineProperty(exports, "bailoutToClientRendering", {
|
|
2301
|
+
enumerable: true,
|
|
2302
|
+
get: function() {
|
|
2303
|
+
return bailoutToClientRendering;
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
const _bailouttocsr = requireBailoutToCsr();
|
|
2307
|
+
const _workasyncstorageexternal = requireWorkAsyncStorage_external();
|
|
2308
|
+
function bailoutToClientRendering(reason) {
|
|
2309
|
+
const workStore = _workasyncstorageexternal.workAsyncStorage.getStore();
|
|
2310
|
+
if (workStore == null ? void 0 : workStore.forceStatic) return;
|
|
2311
|
+
if (workStore == null ? void 0 : workStore.isStaticGeneration) throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", {
|
|
2312
|
+
value: "E394",
|
|
2313
|
+
enumerable: false,
|
|
2314
|
+
configurable: true
|
|
2315
|
+
});
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2319
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2320
|
+
Object.assign(exports.default, exports);
|
|
2321
|
+
module.exports = exports.default;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
|
|
2325
|
+
} (bailoutToClientRendering, bailoutToClientRendering.exports));
|
|
2326
|
+
return bailoutToClientRendering.exports;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
var hasRequiredNavigation$1;
|
|
2330
|
+
|
|
2331
|
+
function requireNavigation$1 () {
|
|
2332
|
+
if (hasRequiredNavigation$1) return navigation$1.exports;
|
|
2333
|
+
hasRequiredNavigation$1 = 1;
|
|
2334
|
+
(function (module, exports) {
|
|
2335
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2336
|
+
value: true
|
|
2337
|
+
});
|
|
2338
|
+
function _export(target, all) {
|
|
2339
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
2340
|
+
enumerable: true,
|
|
2341
|
+
get: all[name]
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
_export(exports, {
|
|
2345
|
+
ReadonlyURLSearchParams: function() {
|
|
2346
|
+
return _navigationreactserver.ReadonlyURLSearchParams;
|
|
2347
|
+
},
|
|
2348
|
+
RedirectType: function() {
|
|
2349
|
+
return _navigationreactserver.RedirectType;
|
|
2350
|
+
},
|
|
2351
|
+
ServerInsertedHTMLContext: function() {
|
|
2352
|
+
return _serverinsertedhtmlsharedruntime.ServerInsertedHTMLContext;
|
|
2353
|
+
},
|
|
2354
|
+
forbidden: function() {
|
|
2355
|
+
return _navigationreactserver.forbidden;
|
|
2356
|
+
},
|
|
2357
|
+
notFound: function() {
|
|
2358
|
+
return _navigationreactserver.notFound;
|
|
2359
|
+
},
|
|
2360
|
+
permanentRedirect: function() {
|
|
2361
|
+
return _navigationreactserver.permanentRedirect;
|
|
2362
|
+
},
|
|
2363
|
+
redirect: function() {
|
|
2364
|
+
return _navigationreactserver.redirect;
|
|
2365
|
+
},
|
|
2366
|
+
unauthorized: function() {
|
|
2367
|
+
return _navigationreactserver.unauthorized;
|
|
2368
|
+
},
|
|
2369
|
+
unstable_rethrow: function() {
|
|
2370
|
+
return _navigationreactserver.unstable_rethrow;
|
|
2371
|
+
},
|
|
2372
|
+
useParams: function() {
|
|
2373
|
+
return useParams;
|
|
2374
|
+
},
|
|
2375
|
+
usePathname: function() {
|
|
2376
|
+
return usePathname;
|
|
2377
|
+
},
|
|
2378
|
+
useRouter: function() {
|
|
2379
|
+
return useRouter;
|
|
2380
|
+
},
|
|
2381
|
+
useSearchParams: function() {
|
|
2382
|
+
return useSearchParams;
|
|
2383
|
+
},
|
|
2384
|
+
useSelectedLayoutSegment: function() {
|
|
2385
|
+
return useSelectedLayoutSegment;
|
|
2386
|
+
},
|
|
2387
|
+
useSelectedLayoutSegments: function() {
|
|
2388
|
+
return useSelectedLayoutSegments;
|
|
2389
|
+
},
|
|
2390
|
+
useServerInsertedHTML: function() {
|
|
2391
|
+
return _serverinsertedhtmlsharedruntime.useServerInsertedHTML;
|
|
2392
|
+
}
|
|
2393
|
+
});
|
|
2394
|
+
const _react = require$$0;
|
|
2395
|
+
const _approutercontextsharedruntime = requireAppRouterContext_sharedRuntime();
|
|
2396
|
+
const _hooksclientcontextsharedruntime = requireHooksClientContext_sharedRuntime();
|
|
2397
|
+
const _getsegmentvalue = requireGetSegmentValue();
|
|
2398
|
+
const _segment = requireSegment();
|
|
2399
|
+
const _navigationreactserver = requireNavigation_reactServer();
|
|
2400
|
+
const _serverinsertedhtmlsharedruntime = requireServerInsertedHtml_sharedRuntime();
|
|
2401
|
+
const useDynamicRouteParams = typeof window === 'undefined' ? requireDynamicRendering().useDynamicRouteParams : undefined;
|
|
2402
|
+
function useSearchParams() {
|
|
2403
|
+
const searchParams = (0, _react.useContext)(_hooksclientcontextsharedruntime.SearchParamsContext);
|
|
2404
|
+
// In the case where this is `null`, the compat types added in
|
|
2405
|
+
// `next-env.d.ts` will add a new overload that changes the return type to
|
|
2406
|
+
// include `null`.
|
|
2407
|
+
const readonlySearchParams = (0, _react.useMemo)(()=>{
|
|
2408
|
+
if (!searchParams) {
|
|
2409
|
+
// When the router is not ready in pages, we won't have the search params
|
|
2410
|
+
// available.
|
|
2411
|
+
return null;
|
|
2412
|
+
}
|
|
2413
|
+
return new _navigationreactserver.ReadonlyURLSearchParams(searchParams);
|
|
2414
|
+
}, [
|
|
2415
|
+
searchParams
|
|
2416
|
+
]);
|
|
2417
|
+
if (typeof window === 'undefined') {
|
|
2418
|
+
// AsyncLocalStorage should not be included in the client bundle.
|
|
2419
|
+
const { bailoutToClientRendering } = requireBailoutToClientRendering();
|
|
2420
|
+
// TODO-APP: handle dynamic = 'force-static' here and on the client
|
|
2421
|
+
bailoutToClientRendering('useSearchParams()');
|
|
2422
|
+
}
|
|
2423
|
+
return readonlySearchParams;
|
|
2424
|
+
}
|
|
2425
|
+
function usePathname() {
|
|
2426
|
+
useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('usePathname()');
|
|
2427
|
+
// In the case where this is `null`, the compat types added in `next-env.d.ts`
|
|
2428
|
+
// will add a new overload that changes the return type to include `null`.
|
|
2429
|
+
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathnameContext);
|
|
2430
|
+
}
|
|
2431
|
+
function useRouter() {
|
|
2432
|
+
const router = (0, _react.useContext)(_approutercontextsharedruntime.AppRouterContext);
|
|
2433
|
+
if (router === null) {
|
|
2434
|
+
throw Object.defineProperty(new Error('invariant expected app router to be mounted'), "__NEXT_ERROR_CODE", {
|
|
2435
|
+
value: "E238",
|
|
2436
|
+
enumerable: false,
|
|
2437
|
+
configurable: true
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
return router;
|
|
2441
|
+
}
|
|
2442
|
+
function useParams() {
|
|
2443
|
+
useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useParams()');
|
|
2444
|
+
return (0, _react.useContext)(_hooksclientcontextsharedruntime.PathParamsContext);
|
|
2445
|
+
}
|
|
2446
|
+
/** Get the canonical parameters from the current level to the leaf node. */ // Client components API
|
|
2447
|
+
function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first, segmentPath) {
|
|
2448
|
+
if (first === void 0) first = true;
|
|
2449
|
+
if (segmentPath === void 0) segmentPath = [];
|
|
2450
|
+
let node;
|
|
2451
|
+
if (first) {
|
|
2452
|
+
// Use the provided parallel route key on the first parallel route
|
|
2453
|
+
node = tree[1][parallelRouteKey];
|
|
2454
|
+
} else {
|
|
2455
|
+
// After first parallel route prefer children, if there's no children pick the first parallel route.
|
|
2456
|
+
const parallelRoutes = tree[1];
|
|
2457
|
+
var _parallelRoutes_children;
|
|
2458
|
+
node = (_parallelRoutes_children = parallelRoutes.children) != null ? _parallelRoutes_children : Object.values(parallelRoutes)[0];
|
|
2459
|
+
}
|
|
2460
|
+
if (!node) return segmentPath;
|
|
2461
|
+
const segment = node[0];
|
|
2462
|
+
let segmentValue = (0, _getsegmentvalue.getSegmentValue)(segment);
|
|
2463
|
+
if (!segmentValue || segmentValue.startsWith(_segment.PAGE_SEGMENT_KEY)) {
|
|
2464
|
+
return segmentPath;
|
|
2465
|
+
}
|
|
2466
|
+
segmentPath.push(segmentValue);
|
|
2467
|
+
return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);
|
|
2468
|
+
}
|
|
2469
|
+
function useSelectedLayoutSegments(parallelRouteKey) {
|
|
2470
|
+
if (parallelRouteKey === void 0) parallelRouteKey = 'children';
|
|
2471
|
+
useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useSelectedLayoutSegments()');
|
|
2472
|
+
const context = (0, _react.useContext)(_approutercontextsharedruntime.LayoutRouterContext);
|
|
2473
|
+
// @ts-expect-error This only happens in `pages`. Type is overwritten in navigation.d.ts
|
|
2474
|
+
if (!context) return null;
|
|
2475
|
+
return getSelectedLayoutSegmentPath(context.parentTree, parallelRouteKey);
|
|
2476
|
+
}
|
|
2477
|
+
function useSelectedLayoutSegment(parallelRouteKey) {
|
|
2478
|
+
if (parallelRouteKey === void 0) parallelRouteKey = 'children';
|
|
2479
|
+
useDynamicRouteParams == null ? void 0 : useDynamicRouteParams('useSelectedLayoutSegment()');
|
|
2480
|
+
const selectedLayoutSegments = useSelectedLayoutSegments(parallelRouteKey);
|
|
2481
|
+
if (!selectedLayoutSegments || selectedLayoutSegments.length === 0) {
|
|
2482
|
+
return null;
|
|
2483
|
+
}
|
|
2484
|
+
const selectedLayoutSegment = parallelRouteKey === 'children' ? selectedLayoutSegments[0] : selectedLayoutSegments[selectedLayoutSegments.length - 1];
|
|
2485
|
+
// if the default slot is showing, we return null since it's not technically "selected" (it's a fallback)
|
|
2486
|
+
// and returning an internal value like `__DEFAULT__` would be confusing.
|
|
2487
|
+
return selectedLayoutSegment === _segment.DEFAULT_SEGMENT_KEY ? null : selectedLayoutSegment;
|
|
2488
|
+
}
|
|
2489
|
+
|
|
2490
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
2491
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
2492
|
+
Object.assign(exports.default, exports);
|
|
2493
|
+
module.exports = exports.default;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
|
|
2497
|
+
} (navigation$1, navigation$1.exports));
|
|
2498
|
+
return navigation$1.exports;
|
|
2499
|
+
}
|
|
2500
|
+
|
|
2501
|
+
var navigation;
|
|
2502
|
+
var hasRequiredNavigation;
|
|
2503
|
+
|
|
2504
|
+
function requireNavigation () {
|
|
2505
|
+
if (hasRequiredNavigation) return navigation;
|
|
2506
|
+
hasRequiredNavigation = 1;
|
|
2507
|
+
navigation = requireNavigation$1();
|
|
2508
|
+
return navigation;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
var navigationExports = requireNavigation();
|
|
2512
|
+
|
|
2513
|
+
export { requireSegment as a, require_interop_require_default as b, navigationExports as n, require_interop_require_wildcard as r };
|