@modern-js/utils 2.65.1 → 2.65.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/dist/compiled/react-server-dom-webpack/LICENSE +21 -0
- package/dist/compiled/react-server-dom-webpack/README.md +5 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +2553 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +1637 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +2709 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +1800 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +2752 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +1849 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +2714 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +1814 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +69 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +399 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +3782 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +2777 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +3812 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +2779 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +3869 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +2871 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +3832 -0
- package/dist/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +2837 -0
- package/dist/compiled/react-server-dom-webpack/client.browser.js +7 -0
- package/dist/compiled/react-server-dom-webpack/client.edge.js +7 -0
- package/dist/compiled/react-server-dom-webpack/client.js +3 -0
- package/dist/compiled/react-server-dom-webpack/client.node.js +7 -0
- package/dist/compiled/react-server-dom-webpack/client.node.unbundled.js +7 -0
- package/dist/compiled/react-server-dom-webpack/index.js +12 -0
- package/dist/compiled/react-server-dom-webpack/package.json +111 -0
- package/dist/compiled/react-server-dom-webpack/server.browser.js +17 -0
- package/dist/compiled/react-server-dom-webpack/server.edge.js +17 -0
- package/dist/compiled/react-server-dom-webpack/server.js +6 -0
- package/dist/compiled/react-server-dom-webpack/server.node.js +18 -0
- package/dist/compiled/react-server-dom-webpack/server.node.unbundled.js +18 -0
- package/package.json +34 -5
@@ -0,0 +1,2777 @@
|
|
1
|
+
/**
|
2
|
+
* @license React
|
3
|
+
* react-server-dom-webpack-server.browser.production.js
|
4
|
+
*
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
"use strict";
|
12
|
+
var ReactDOM = require("react-dom"),
|
13
|
+
React = require("react"),
|
14
|
+
channel = new MessageChannel(),
|
15
|
+
taskQueue = [];
|
16
|
+
channel.port1.onmessage = function () {
|
17
|
+
var task = taskQueue.shift();
|
18
|
+
task && task();
|
19
|
+
};
|
20
|
+
function scheduleWork(callback) {
|
21
|
+
taskQueue.push(callback);
|
22
|
+
channel.port2.postMessage(null);
|
23
|
+
}
|
24
|
+
function handleErrorInNextTick(error) {
|
25
|
+
setTimeout(function () {
|
26
|
+
throw error;
|
27
|
+
});
|
28
|
+
}
|
29
|
+
var LocalPromise = Promise,
|
30
|
+
scheduleMicrotask =
|
31
|
+
"function" === typeof queueMicrotask
|
32
|
+
? queueMicrotask
|
33
|
+
: function (callback) {
|
34
|
+
LocalPromise.resolve(null)
|
35
|
+
.then(callback)
|
36
|
+
.catch(handleErrorInNextTick);
|
37
|
+
},
|
38
|
+
currentView = null,
|
39
|
+
writtenBytes = 0;
|
40
|
+
function writeChunkAndReturn(destination, chunk) {
|
41
|
+
if (0 !== chunk.byteLength)
|
42
|
+
if (2048 < chunk.byteLength)
|
43
|
+
0 < writtenBytes &&
|
44
|
+
(destination.enqueue(
|
45
|
+
new Uint8Array(currentView.buffer, 0, writtenBytes)
|
46
|
+
),
|
47
|
+
(currentView = new Uint8Array(2048)),
|
48
|
+
(writtenBytes = 0)),
|
49
|
+
destination.enqueue(chunk);
|
50
|
+
else {
|
51
|
+
var allowableBytes = currentView.length - writtenBytes;
|
52
|
+
allowableBytes < chunk.byteLength &&
|
53
|
+
(0 === allowableBytes
|
54
|
+
? destination.enqueue(currentView)
|
55
|
+
: (currentView.set(chunk.subarray(0, allowableBytes), writtenBytes),
|
56
|
+
destination.enqueue(currentView),
|
57
|
+
(chunk = chunk.subarray(allowableBytes))),
|
58
|
+
(currentView = new Uint8Array(2048)),
|
59
|
+
(writtenBytes = 0));
|
60
|
+
currentView.set(chunk, writtenBytes);
|
61
|
+
writtenBytes += chunk.byteLength;
|
62
|
+
}
|
63
|
+
return !0;
|
64
|
+
}
|
65
|
+
var textEncoder = new TextEncoder();
|
66
|
+
function stringToChunk(content) {
|
67
|
+
return textEncoder.encode(content);
|
68
|
+
}
|
69
|
+
function byteLengthOfChunk(chunk) {
|
70
|
+
return chunk.byteLength;
|
71
|
+
}
|
72
|
+
function closeWithError(destination, error) {
|
73
|
+
"function" === typeof destination.error
|
74
|
+
? destination.error(error)
|
75
|
+
: destination.close();
|
76
|
+
}
|
77
|
+
var CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
|
78
|
+
SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
|
79
|
+
function registerClientReferenceImpl(proxyImplementation, id, async) {
|
80
|
+
return Object.defineProperties(proxyImplementation, {
|
81
|
+
$$typeof: { value: CLIENT_REFERENCE_TAG$1 },
|
82
|
+
$$id: { value: id },
|
83
|
+
$$async: { value: async }
|
84
|
+
});
|
85
|
+
}
|
86
|
+
var FunctionBind = Function.prototype.bind,
|
87
|
+
ArraySlice = Array.prototype.slice;
|
88
|
+
function bind() {
|
89
|
+
var newFn = FunctionBind.apply(this, arguments);
|
90
|
+
if (this.$$typeof === SERVER_REFERENCE_TAG) {
|
91
|
+
var args = ArraySlice.call(arguments, 1),
|
92
|
+
$$typeof = { value: SERVER_REFERENCE_TAG },
|
93
|
+
$$id = { value: this.$$id };
|
94
|
+
args = { value: this.$$bound ? this.$$bound.concat(args) : args };
|
95
|
+
return Object.defineProperties(newFn, {
|
96
|
+
$$typeof: $$typeof,
|
97
|
+
$$id: $$id,
|
98
|
+
$$bound: args,
|
99
|
+
bind: { value: bind, configurable: !0 }
|
100
|
+
});
|
101
|
+
}
|
102
|
+
return newFn;
|
103
|
+
}
|
104
|
+
var PROMISE_PROTOTYPE = Promise.prototype,
|
105
|
+
deepProxyHandlers = {
|
106
|
+
get: function (target, name) {
|
107
|
+
switch (name) {
|
108
|
+
case "$$typeof":
|
109
|
+
return target.$$typeof;
|
110
|
+
case "$$id":
|
111
|
+
return target.$$id;
|
112
|
+
case "$$async":
|
113
|
+
return target.$$async;
|
114
|
+
case "name":
|
115
|
+
return target.name;
|
116
|
+
case "displayName":
|
117
|
+
return;
|
118
|
+
case "defaultProps":
|
119
|
+
return;
|
120
|
+
case "toJSON":
|
121
|
+
return;
|
122
|
+
case Symbol.toPrimitive:
|
123
|
+
return Object.prototype[Symbol.toPrimitive];
|
124
|
+
case Symbol.toStringTag:
|
125
|
+
return Object.prototype[Symbol.toStringTag];
|
126
|
+
case "Provider":
|
127
|
+
throw Error(
|
128
|
+
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
129
|
+
);
|
130
|
+
case "then":
|
131
|
+
throw Error(
|
132
|
+
"Cannot await or return from a thenable. You cannot await a client module from a server component."
|
133
|
+
);
|
134
|
+
}
|
135
|
+
throw Error(
|
136
|
+
"Cannot access " +
|
137
|
+
(String(target.name) + "." + String(name)) +
|
138
|
+
" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
|
139
|
+
);
|
140
|
+
},
|
141
|
+
set: function () {
|
142
|
+
throw Error("Cannot assign to a client module from a server module.");
|
143
|
+
}
|
144
|
+
};
|
145
|
+
function getReference(target, name) {
|
146
|
+
switch (name) {
|
147
|
+
case "$$typeof":
|
148
|
+
return target.$$typeof;
|
149
|
+
case "$$id":
|
150
|
+
return target.$$id;
|
151
|
+
case "$$async":
|
152
|
+
return target.$$async;
|
153
|
+
case "name":
|
154
|
+
return target.name;
|
155
|
+
case "defaultProps":
|
156
|
+
return;
|
157
|
+
case "toJSON":
|
158
|
+
return;
|
159
|
+
case Symbol.toPrimitive:
|
160
|
+
return Object.prototype[Symbol.toPrimitive];
|
161
|
+
case Symbol.toStringTag:
|
162
|
+
return Object.prototype[Symbol.toStringTag];
|
163
|
+
case "__esModule":
|
164
|
+
var moduleId = target.$$id;
|
165
|
+
target.default = registerClientReferenceImpl(
|
166
|
+
function () {
|
167
|
+
throw Error(
|
168
|
+
"Attempted to call the default export of " +
|
169
|
+
moduleId +
|
170
|
+
" from the server but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
|
171
|
+
);
|
172
|
+
},
|
173
|
+
target.$$id + "#",
|
174
|
+
target.$$async
|
175
|
+
);
|
176
|
+
return !0;
|
177
|
+
case "then":
|
178
|
+
if (target.then) return target.then;
|
179
|
+
if (target.$$async) return;
|
180
|
+
var clientReference = registerClientReferenceImpl({}, target.$$id, !0),
|
181
|
+
proxy = new Proxy(clientReference, proxyHandlers$1);
|
182
|
+
target.status = "fulfilled";
|
183
|
+
target.value = proxy;
|
184
|
+
return (target.then = registerClientReferenceImpl(
|
185
|
+
function (resolve) {
|
186
|
+
return Promise.resolve(resolve(proxy));
|
187
|
+
},
|
188
|
+
target.$$id + "#then",
|
189
|
+
!1
|
190
|
+
));
|
191
|
+
}
|
192
|
+
if ("symbol" === typeof name)
|
193
|
+
throw Error(
|
194
|
+
"Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
|
195
|
+
);
|
196
|
+
clientReference = target[name];
|
197
|
+
clientReference ||
|
198
|
+
((clientReference = registerClientReferenceImpl(
|
199
|
+
function () {
|
200
|
+
throw Error(
|
201
|
+
"Attempted to call " +
|
202
|
+
String(name) +
|
203
|
+
"() from the server but " +
|
204
|
+
String(name) +
|
205
|
+
" is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
|
206
|
+
);
|
207
|
+
},
|
208
|
+
target.$$id + "#" + name,
|
209
|
+
target.$$async
|
210
|
+
)),
|
211
|
+
Object.defineProperty(clientReference, "name", { value: name }),
|
212
|
+
(clientReference = target[name] =
|
213
|
+
new Proxy(clientReference, deepProxyHandlers)));
|
214
|
+
return clientReference;
|
215
|
+
}
|
216
|
+
var proxyHandlers$1 = {
|
217
|
+
get: function (target, name) {
|
218
|
+
return getReference(target, name);
|
219
|
+
},
|
220
|
+
getOwnPropertyDescriptor: function (target, name) {
|
221
|
+
var descriptor = Object.getOwnPropertyDescriptor(target, name);
|
222
|
+
descriptor ||
|
223
|
+
((descriptor = {
|
224
|
+
value: getReference(target, name),
|
225
|
+
writable: !1,
|
226
|
+
configurable: !1,
|
227
|
+
enumerable: !1
|
228
|
+
}),
|
229
|
+
Object.defineProperty(target, name, descriptor));
|
230
|
+
return descriptor;
|
231
|
+
},
|
232
|
+
getPrototypeOf: function () {
|
233
|
+
return PROMISE_PROTOTYPE;
|
234
|
+
},
|
235
|
+
set: function () {
|
236
|
+
throw Error("Cannot assign to a client module from a server module.");
|
237
|
+
}
|
238
|
+
},
|
239
|
+
ReactDOMSharedInternals =
|
240
|
+
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
241
|
+
previousDispatcher = ReactDOMSharedInternals.d;
|
242
|
+
ReactDOMSharedInternals.d = {
|
243
|
+
f: previousDispatcher.f,
|
244
|
+
r: previousDispatcher.r,
|
245
|
+
D: prefetchDNS,
|
246
|
+
C: preconnect,
|
247
|
+
L: preload,
|
248
|
+
m: preloadModule$1,
|
249
|
+
X: preinitScript,
|
250
|
+
S: preinitStyle,
|
251
|
+
M: preinitModuleScript
|
252
|
+
};
|
253
|
+
function prefetchDNS(href) {
|
254
|
+
if ("string" === typeof href && href) {
|
255
|
+
var request = currentRequest ? currentRequest : null;
|
256
|
+
if (request) {
|
257
|
+
var hints = request.hints,
|
258
|
+
key = "D|" + href;
|
259
|
+
hints.has(key) || (hints.add(key), emitHint(request, "D", href));
|
260
|
+
} else previousDispatcher.D(href);
|
261
|
+
}
|
262
|
+
}
|
263
|
+
function preconnect(href, crossOrigin) {
|
264
|
+
if ("string" === typeof href) {
|
265
|
+
var request = currentRequest ? currentRequest : null;
|
266
|
+
if (request) {
|
267
|
+
var hints = request.hints,
|
268
|
+
key = "C|" + (null == crossOrigin ? "null" : crossOrigin) + "|" + href;
|
269
|
+
hints.has(key) ||
|
270
|
+
(hints.add(key),
|
271
|
+
"string" === typeof crossOrigin
|
272
|
+
? emitHint(request, "C", [href, crossOrigin])
|
273
|
+
: emitHint(request, "C", href));
|
274
|
+
} else previousDispatcher.C(href, crossOrigin);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
function preload(href, as, options) {
|
278
|
+
if ("string" === typeof href) {
|
279
|
+
var request = currentRequest ? currentRequest : null;
|
280
|
+
if (request) {
|
281
|
+
var hints = request.hints,
|
282
|
+
key = "L";
|
283
|
+
if ("image" === as && options) {
|
284
|
+
var imageSrcSet = options.imageSrcSet,
|
285
|
+
imageSizes = options.imageSizes,
|
286
|
+
uniquePart = "";
|
287
|
+
"string" === typeof imageSrcSet && "" !== imageSrcSet
|
288
|
+
? ((uniquePart += "[" + imageSrcSet + "]"),
|
289
|
+
"string" === typeof imageSizes &&
|
290
|
+
(uniquePart += "[" + imageSizes + "]"))
|
291
|
+
: (uniquePart += "[][]" + href);
|
292
|
+
key += "[image]" + uniquePart;
|
293
|
+
} else key += "[" + as + "]" + href;
|
294
|
+
hints.has(key) ||
|
295
|
+
(hints.add(key),
|
296
|
+
(options = trimOptions(options))
|
297
|
+
? emitHint(request, "L", [href, as, options])
|
298
|
+
: emitHint(request, "L", [href, as]));
|
299
|
+
} else previousDispatcher.L(href, as, options);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
function preloadModule$1(href, options) {
|
303
|
+
if ("string" === typeof href) {
|
304
|
+
var request = currentRequest ? currentRequest : null;
|
305
|
+
if (request) {
|
306
|
+
var hints = request.hints,
|
307
|
+
key = "m|" + href;
|
308
|
+
if (hints.has(key)) return;
|
309
|
+
hints.add(key);
|
310
|
+
return (options = trimOptions(options))
|
311
|
+
? emitHint(request, "m", [href, options])
|
312
|
+
: emitHint(request, "m", href);
|
313
|
+
}
|
314
|
+
previousDispatcher.m(href, options);
|
315
|
+
}
|
316
|
+
}
|
317
|
+
function preinitStyle(href, precedence, options) {
|
318
|
+
if ("string" === typeof href) {
|
319
|
+
var request = currentRequest ? currentRequest : null;
|
320
|
+
if (request) {
|
321
|
+
var hints = request.hints,
|
322
|
+
key = "S|" + href;
|
323
|
+
if (hints.has(key)) return;
|
324
|
+
hints.add(key);
|
325
|
+
return (options = trimOptions(options))
|
326
|
+
? emitHint(request, "S", [
|
327
|
+
href,
|
328
|
+
"string" === typeof precedence ? precedence : 0,
|
329
|
+
options
|
330
|
+
])
|
331
|
+
: "string" === typeof precedence
|
332
|
+
? emitHint(request, "S", [href, precedence])
|
333
|
+
: emitHint(request, "S", href);
|
334
|
+
}
|
335
|
+
previousDispatcher.S(href, precedence, options);
|
336
|
+
}
|
337
|
+
}
|
338
|
+
function preinitScript(src, options) {
|
339
|
+
if ("string" === typeof src) {
|
340
|
+
var request = currentRequest ? currentRequest : null;
|
341
|
+
if (request) {
|
342
|
+
var hints = request.hints,
|
343
|
+
key = "X|" + src;
|
344
|
+
if (hints.has(key)) return;
|
345
|
+
hints.add(key);
|
346
|
+
return (options = trimOptions(options))
|
347
|
+
? emitHint(request, "X", [src, options])
|
348
|
+
: emitHint(request, "X", src);
|
349
|
+
}
|
350
|
+
previousDispatcher.X(src, options);
|
351
|
+
}
|
352
|
+
}
|
353
|
+
function preinitModuleScript(src, options) {
|
354
|
+
if ("string" === typeof src) {
|
355
|
+
var request = currentRequest ? currentRequest : null;
|
356
|
+
if (request) {
|
357
|
+
var hints = request.hints,
|
358
|
+
key = "M|" + src;
|
359
|
+
if (hints.has(key)) return;
|
360
|
+
hints.add(key);
|
361
|
+
return (options = trimOptions(options))
|
362
|
+
? emitHint(request, "M", [src, options])
|
363
|
+
: emitHint(request, "M", src);
|
364
|
+
}
|
365
|
+
previousDispatcher.M(src, options);
|
366
|
+
}
|
367
|
+
}
|
368
|
+
function trimOptions(options) {
|
369
|
+
if (null == options) return null;
|
370
|
+
var hasProperties = !1,
|
371
|
+
trimmed = {},
|
372
|
+
key;
|
373
|
+
for (key in options)
|
374
|
+
null != options[key] &&
|
375
|
+
((hasProperties = !0), (trimmed[key] = options[key]));
|
376
|
+
return hasProperties ? trimmed : null;
|
377
|
+
}
|
378
|
+
var TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
379
|
+
proxyHandlers = {
|
380
|
+
get: function (target, name) {
|
381
|
+
switch (name) {
|
382
|
+
case "$$typeof":
|
383
|
+
return target.$$typeof;
|
384
|
+
case "name":
|
385
|
+
return;
|
386
|
+
case "displayName":
|
387
|
+
return;
|
388
|
+
case "defaultProps":
|
389
|
+
return;
|
390
|
+
case "toJSON":
|
391
|
+
return;
|
392
|
+
case Symbol.toPrimitive:
|
393
|
+
return Object.prototype[Symbol.toPrimitive];
|
394
|
+
case Symbol.toStringTag:
|
395
|
+
return Object.prototype[Symbol.toStringTag];
|
396
|
+
case "Provider":
|
397
|
+
throw Error(
|
398
|
+
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
399
|
+
);
|
400
|
+
}
|
401
|
+
throw Error(
|
402
|
+
"Cannot access " +
|
403
|
+
String(name) +
|
404
|
+
" on the server. You cannot dot into a temporary client reference from a server component. You can only pass the value through to the client."
|
405
|
+
);
|
406
|
+
},
|
407
|
+
set: function () {
|
408
|
+
throw Error(
|
409
|
+
"Cannot assign to a temporary client reference from a server module."
|
410
|
+
);
|
411
|
+
}
|
412
|
+
};
|
413
|
+
function createTemporaryReference(temporaryReferences, id) {
|
414
|
+
var reference = Object.defineProperties(
|
415
|
+
function () {
|
416
|
+
throw Error(
|
417
|
+
"Attempted to call a temporary Client Reference from the server but it is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."
|
418
|
+
);
|
419
|
+
},
|
420
|
+
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
|
421
|
+
);
|
422
|
+
reference = new Proxy(reference, proxyHandlers);
|
423
|
+
temporaryReferences.set(reference, id);
|
424
|
+
return reference;
|
425
|
+
}
|
426
|
+
var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
427
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
428
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
429
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
430
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
431
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
432
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
433
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
434
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
435
|
+
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
436
|
+
Symbol.for("react.postpone");
|
437
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
438
|
+
function getIteratorFn(maybeIterable) {
|
439
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
440
|
+
maybeIterable =
|
441
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
442
|
+
maybeIterable["@@iterator"];
|
443
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
444
|
+
}
|
445
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
446
|
+
SuspenseException = Error(
|
447
|
+
"Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
|
448
|
+
);
|
449
|
+
function noop$1() {}
|
450
|
+
function trackUsedThenable(thenableState, thenable, index) {
|
451
|
+
index = thenableState[index];
|
452
|
+
void 0 === index
|
453
|
+
? thenableState.push(thenable)
|
454
|
+
: index !== thenable && (thenable.then(noop$1, noop$1), (thenable = index));
|
455
|
+
switch (thenable.status) {
|
456
|
+
case "fulfilled":
|
457
|
+
return thenable.value;
|
458
|
+
case "rejected":
|
459
|
+
throw thenable.reason;
|
460
|
+
default:
|
461
|
+
"string" === typeof thenable.status
|
462
|
+
? thenable.then(noop$1, noop$1)
|
463
|
+
: ((thenableState = thenable),
|
464
|
+
(thenableState.status = "pending"),
|
465
|
+
thenableState.then(
|
466
|
+
function (fulfilledValue) {
|
467
|
+
if ("pending" === thenable.status) {
|
468
|
+
var fulfilledThenable = thenable;
|
469
|
+
fulfilledThenable.status = "fulfilled";
|
470
|
+
fulfilledThenable.value = fulfilledValue;
|
471
|
+
}
|
472
|
+
},
|
473
|
+
function (error) {
|
474
|
+
if ("pending" === thenable.status) {
|
475
|
+
var rejectedThenable = thenable;
|
476
|
+
rejectedThenable.status = "rejected";
|
477
|
+
rejectedThenable.reason = error;
|
478
|
+
}
|
479
|
+
}
|
480
|
+
));
|
481
|
+
switch (thenable.status) {
|
482
|
+
case "fulfilled":
|
483
|
+
return thenable.value;
|
484
|
+
case "rejected":
|
485
|
+
throw thenable.reason;
|
486
|
+
}
|
487
|
+
suspendedThenable = thenable;
|
488
|
+
throw SuspenseException;
|
489
|
+
}
|
490
|
+
}
|
491
|
+
var suspendedThenable = null;
|
492
|
+
function getSuspendedThenable() {
|
493
|
+
if (null === suspendedThenable)
|
494
|
+
throw Error(
|
495
|
+
"Expected a suspended thenable. This is a bug in React. Please file an issue."
|
496
|
+
);
|
497
|
+
var thenable = suspendedThenable;
|
498
|
+
suspendedThenable = null;
|
499
|
+
return thenable;
|
500
|
+
}
|
501
|
+
var currentRequest$1 = null,
|
502
|
+
thenableIndexCounter = 0,
|
503
|
+
thenableState = null;
|
504
|
+
function getThenableStateAfterSuspending() {
|
505
|
+
var state = thenableState || [];
|
506
|
+
thenableState = null;
|
507
|
+
return state;
|
508
|
+
}
|
509
|
+
var HooksDispatcher = {
|
510
|
+
useMemo: function (nextCreate) {
|
511
|
+
return nextCreate();
|
512
|
+
},
|
513
|
+
useCallback: function (callback) {
|
514
|
+
return callback;
|
515
|
+
},
|
516
|
+
useDebugValue: function () {},
|
517
|
+
useDeferredValue: unsupportedHook,
|
518
|
+
useTransition: unsupportedHook,
|
519
|
+
readContext: unsupportedContext,
|
520
|
+
useContext: unsupportedContext,
|
521
|
+
useReducer: unsupportedHook,
|
522
|
+
useRef: unsupportedHook,
|
523
|
+
useState: unsupportedHook,
|
524
|
+
useInsertionEffect: unsupportedHook,
|
525
|
+
useLayoutEffect: unsupportedHook,
|
526
|
+
useImperativeHandle: unsupportedHook,
|
527
|
+
useEffect: unsupportedHook,
|
528
|
+
useId: useId,
|
529
|
+
useSyncExternalStore: unsupportedHook,
|
530
|
+
useCacheRefresh: function () {
|
531
|
+
return unsupportedRefresh;
|
532
|
+
},
|
533
|
+
useMemoCache: function (size) {
|
534
|
+
for (var data = Array(size), i = 0; i < size; i++)
|
535
|
+
data[i] = REACT_MEMO_CACHE_SENTINEL;
|
536
|
+
return data;
|
537
|
+
},
|
538
|
+
use: use
|
539
|
+
};
|
540
|
+
function unsupportedHook() {
|
541
|
+
throw Error("This Hook is not supported in Server Components.");
|
542
|
+
}
|
543
|
+
function unsupportedRefresh() {
|
544
|
+
throw Error("Refreshing the cache is not supported in Server Components.");
|
545
|
+
}
|
546
|
+
function unsupportedContext() {
|
547
|
+
throw Error("Cannot read a Client Context from a Server Component.");
|
548
|
+
}
|
549
|
+
function useId() {
|
550
|
+
if (null === currentRequest$1)
|
551
|
+
throw Error("useId can only be used while React is rendering");
|
552
|
+
var id = currentRequest$1.identifierCount++;
|
553
|
+
return ":" + currentRequest$1.identifierPrefix + "S" + id.toString(32) + ":";
|
554
|
+
}
|
555
|
+
function use(usable) {
|
556
|
+
if (
|
557
|
+
(null !== usable && "object" === typeof usable) ||
|
558
|
+
"function" === typeof usable
|
559
|
+
) {
|
560
|
+
if ("function" === typeof usable.then) {
|
561
|
+
var index = thenableIndexCounter;
|
562
|
+
thenableIndexCounter += 1;
|
563
|
+
null === thenableState && (thenableState = []);
|
564
|
+
return trackUsedThenable(thenableState, usable, index);
|
565
|
+
}
|
566
|
+
usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext();
|
567
|
+
}
|
568
|
+
if (usable.$$typeof === CLIENT_REFERENCE_TAG$1) {
|
569
|
+
if (null != usable.value && usable.value.$$typeof === REACT_CONTEXT_TYPE)
|
570
|
+
throw Error("Cannot read a Client Context from a Server Component.");
|
571
|
+
throw Error("Cannot use() an already resolved Client Reference.");
|
572
|
+
}
|
573
|
+
throw Error("An unsupported type was passed to use(): " + String(usable));
|
574
|
+
}
|
575
|
+
var DefaultAsyncDispatcher = {
|
576
|
+
getCacheForType: function (resourceType) {
|
577
|
+
var JSCompiler_inline_result = (JSCompiler_inline_result = currentRequest
|
578
|
+
? currentRequest
|
579
|
+
: null)
|
580
|
+
? JSCompiler_inline_result.cache
|
581
|
+
: new Map();
|
582
|
+
var entry = JSCompiler_inline_result.get(resourceType);
|
583
|
+
void 0 === entry &&
|
584
|
+
((entry = resourceType()),
|
585
|
+
JSCompiler_inline_result.set(resourceType, entry));
|
586
|
+
return entry;
|
587
|
+
}
|
588
|
+
},
|
589
|
+
ReactSharedInternalsServer =
|
590
|
+
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
591
|
+
if (!ReactSharedInternalsServer)
|
592
|
+
throw Error(
|
593
|
+
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
|
594
|
+
);
|
595
|
+
var isArrayImpl = Array.isArray,
|
596
|
+
getPrototypeOf = Object.getPrototypeOf;
|
597
|
+
function objectName(object) {
|
598
|
+
return Object.prototype.toString
|
599
|
+
.call(object)
|
600
|
+
.replace(/^\[object (.*)\]$/, function (m, p0) {
|
601
|
+
return p0;
|
602
|
+
});
|
603
|
+
}
|
604
|
+
function describeValueForErrorMessage(value) {
|
605
|
+
switch (typeof value) {
|
606
|
+
case "string":
|
607
|
+
return JSON.stringify(
|
608
|
+
10 >= value.length ? value : value.slice(0, 10) + "..."
|
609
|
+
);
|
610
|
+
case "object":
|
611
|
+
if (isArrayImpl(value)) return "[...]";
|
612
|
+
if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)
|
613
|
+
return "client";
|
614
|
+
value = objectName(value);
|
615
|
+
return "Object" === value ? "{...}" : value;
|
616
|
+
case "function":
|
617
|
+
return value.$$typeof === CLIENT_REFERENCE_TAG
|
618
|
+
? "client"
|
619
|
+
: (value = value.displayName || value.name)
|
620
|
+
? "function " + value
|
621
|
+
: "function";
|
622
|
+
default:
|
623
|
+
return String(value);
|
624
|
+
}
|
625
|
+
}
|
626
|
+
function describeElementType(type) {
|
627
|
+
if ("string" === typeof type) return type;
|
628
|
+
switch (type) {
|
629
|
+
case REACT_SUSPENSE_TYPE:
|
630
|
+
return "Suspense";
|
631
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
632
|
+
return "SuspenseList";
|
633
|
+
}
|
634
|
+
if ("object" === typeof type)
|
635
|
+
switch (type.$$typeof) {
|
636
|
+
case REACT_FORWARD_REF_TYPE:
|
637
|
+
return describeElementType(type.render);
|
638
|
+
case REACT_MEMO_TYPE:
|
639
|
+
return describeElementType(type.type);
|
640
|
+
case REACT_LAZY_TYPE:
|
641
|
+
var payload = type._payload;
|
642
|
+
type = type._init;
|
643
|
+
try {
|
644
|
+
return describeElementType(type(payload));
|
645
|
+
} catch (x) {}
|
646
|
+
}
|
647
|
+
return "";
|
648
|
+
}
|
649
|
+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
|
650
|
+
function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
651
|
+
var objKind = objectName(objectOrArray);
|
652
|
+
if ("Object" !== objKind && "Array" !== objKind) return objKind;
|
653
|
+
objKind = -1;
|
654
|
+
var length = 0;
|
655
|
+
if (isArrayImpl(objectOrArray)) {
|
656
|
+
var str = "[";
|
657
|
+
for (var i = 0; i < objectOrArray.length; i++) {
|
658
|
+
0 < i && (str += ", ");
|
659
|
+
var value = objectOrArray[i];
|
660
|
+
value =
|
661
|
+
"object" === typeof value && null !== value
|
662
|
+
? describeObjectForErrorMessage(value)
|
663
|
+
: describeValueForErrorMessage(value);
|
664
|
+
"" + i === expandedName
|
665
|
+
? ((objKind = str.length), (length = value.length), (str += value))
|
666
|
+
: (str =
|
667
|
+
10 > value.length && 40 > str.length + value.length
|
668
|
+
? str + value
|
669
|
+
: str + "...");
|
670
|
+
}
|
671
|
+
str += "]";
|
672
|
+
} else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)
|
673
|
+
str = "<" + describeElementType(objectOrArray.type) + "/>";
|
674
|
+
else {
|
675
|
+
if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client";
|
676
|
+
str = "{";
|
677
|
+
i = Object.keys(objectOrArray);
|
678
|
+
for (value = 0; value < i.length; value++) {
|
679
|
+
0 < value && (str += ", ");
|
680
|
+
var name = i[value],
|
681
|
+
encodedKey = JSON.stringify(name);
|
682
|
+
str += ('"' + name + '"' === encodedKey ? name : encodedKey) + ": ";
|
683
|
+
encodedKey = objectOrArray[name];
|
684
|
+
encodedKey =
|
685
|
+
"object" === typeof encodedKey && null !== encodedKey
|
686
|
+
? describeObjectForErrorMessage(encodedKey)
|
687
|
+
: describeValueForErrorMessage(encodedKey);
|
688
|
+
name === expandedName
|
689
|
+
? ((objKind = str.length),
|
690
|
+
(length = encodedKey.length),
|
691
|
+
(str += encodedKey))
|
692
|
+
: (str =
|
693
|
+
10 > encodedKey.length && 40 > str.length + encodedKey.length
|
694
|
+
? str + encodedKey
|
695
|
+
: str + "...");
|
696
|
+
}
|
697
|
+
str += "}";
|
698
|
+
}
|
699
|
+
return void 0 === expandedName
|
700
|
+
? str
|
701
|
+
: -1 < objKind && 0 < length
|
702
|
+
? ((objectOrArray = " ".repeat(objKind) + "^".repeat(length)),
|
703
|
+
"\n " + str + "\n " + objectOrArray)
|
704
|
+
: "\n " + str;
|
705
|
+
}
|
706
|
+
var ObjectPrototype = Object.prototype,
|
707
|
+
stringify = JSON.stringify;
|
708
|
+
function defaultErrorHandler(error) {
|
709
|
+
console.error(error);
|
710
|
+
}
|
711
|
+
function defaultPostponeHandler() {}
|
712
|
+
function RequestInstance(
|
713
|
+
type,
|
714
|
+
model,
|
715
|
+
bundlerConfig,
|
716
|
+
onError,
|
717
|
+
identifierPrefix,
|
718
|
+
onPostpone,
|
719
|
+
temporaryReferences,
|
720
|
+
environmentName,
|
721
|
+
filterStackFrame,
|
722
|
+
onAllReady,
|
723
|
+
onFatalError
|
724
|
+
) {
|
725
|
+
if (
|
726
|
+
null !== ReactSharedInternalsServer.A &&
|
727
|
+
ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
|
728
|
+
)
|
729
|
+
throw Error("Currently React only supports one RSC renderer at a time.");
|
730
|
+
ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
|
731
|
+
filterStackFrame = new Set();
|
732
|
+
environmentName = [];
|
733
|
+
var hints = new Set();
|
734
|
+
this.type = type;
|
735
|
+
this.status = 10;
|
736
|
+
this.flushScheduled = !1;
|
737
|
+
this.destination = this.fatalError = null;
|
738
|
+
this.bundlerConfig = bundlerConfig;
|
739
|
+
this.cache = new Map();
|
740
|
+
this.pendingChunks = this.nextChunkId = 0;
|
741
|
+
this.hints = hints;
|
742
|
+
this.abortListeners = new Set();
|
743
|
+
this.abortableTasks = filterStackFrame;
|
744
|
+
this.pingedTasks = environmentName;
|
745
|
+
this.completedImportChunks = [];
|
746
|
+
this.completedHintChunks = [];
|
747
|
+
this.completedRegularChunks = [];
|
748
|
+
this.completedErrorChunks = [];
|
749
|
+
this.writtenSymbols = new Map();
|
750
|
+
this.writtenClientReferences = new Map();
|
751
|
+
this.writtenServerReferences = new Map();
|
752
|
+
this.writtenObjects = new WeakMap();
|
753
|
+
this.temporaryReferences = temporaryReferences;
|
754
|
+
this.identifierPrefix = identifierPrefix || "";
|
755
|
+
this.identifierCount = 1;
|
756
|
+
this.taintCleanupQueue = [];
|
757
|
+
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
758
|
+
this.onPostpone = void 0 === onPostpone ? defaultPostponeHandler : onPostpone;
|
759
|
+
this.onAllReady = onAllReady;
|
760
|
+
this.onFatalError = onFatalError;
|
761
|
+
type = createTask(this, model, null, !1, filterStackFrame);
|
762
|
+
environmentName.push(type);
|
763
|
+
}
|
764
|
+
function noop() {}
|
765
|
+
var currentRequest = null;
|
766
|
+
function serializeThenable(request, task, thenable) {
|
767
|
+
var newTask = createTask(
|
768
|
+
request,
|
769
|
+
null,
|
770
|
+
task.keyPath,
|
771
|
+
task.implicitSlot,
|
772
|
+
request.abortableTasks
|
773
|
+
);
|
774
|
+
switch (thenable.status) {
|
775
|
+
case "fulfilled":
|
776
|
+
return (
|
777
|
+
(newTask.model = thenable.value), pingTask(request, newTask), newTask.id
|
778
|
+
);
|
779
|
+
case "rejected":
|
780
|
+
return (
|
781
|
+
(task = logRecoverableError(request, thenable.reason, null)),
|
782
|
+
emitErrorChunk(request, newTask.id, task),
|
783
|
+
(newTask.status = 4),
|
784
|
+
request.abortableTasks.delete(newTask),
|
785
|
+
newTask.id
|
786
|
+
);
|
787
|
+
default:
|
788
|
+
if (12 === request.status)
|
789
|
+
return (
|
790
|
+
request.abortableTasks.delete(newTask),
|
791
|
+
(newTask.status = 3),
|
792
|
+
(task = stringify(serializeByValueID(request.fatalError))),
|
793
|
+
emitModelChunk(request, newTask.id, task),
|
794
|
+
newTask.id
|
795
|
+
);
|
796
|
+
"string" !== typeof thenable.status &&
|
797
|
+
((thenable.status = "pending"),
|
798
|
+
thenable.then(
|
799
|
+
function (fulfilledValue) {
|
800
|
+
"pending" === thenable.status &&
|
801
|
+
((thenable.status = "fulfilled"),
|
802
|
+
(thenable.value = fulfilledValue));
|
803
|
+
},
|
804
|
+
function (error) {
|
805
|
+
"pending" === thenable.status &&
|
806
|
+
((thenable.status = "rejected"), (thenable.reason = error));
|
807
|
+
}
|
808
|
+
));
|
809
|
+
}
|
810
|
+
thenable.then(
|
811
|
+
function (value) {
|
812
|
+
newTask.model = value;
|
813
|
+
pingTask(request, newTask);
|
814
|
+
},
|
815
|
+
function (reason) {
|
816
|
+
0 === newTask.status &&
|
817
|
+
((reason = logRecoverableError(request, reason, newTask)),
|
818
|
+
emitErrorChunk(request, newTask.id, reason),
|
819
|
+
(newTask.status = 4),
|
820
|
+
request.abortableTasks.delete(newTask),
|
821
|
+
enqueueFlush(request));
|
822
|
+
}
|
823
|
+
);
|
824
|
+
return newTask.id;
|
825
|
+
}
|
826
|
+
function serializeReadableStream(request, task, stream) {
|
827
|
+
function progress(entry) {
|
828
|
+
if (!aborted)
|
829
|
+
if (entry.done)
|
830
|
+
request.abortListeners.delete(abortStream),
|
831
|
+
(entry = streamTask.id.toString(16) + ":C\n"),
|
832
|
+
request.completedRegularChunks.push(stringToChunk(entry)),
|
833
|
+
enqueueFlush(request),
|
834
|
+
(aborted = !0);
|
835
|
+
else
|
836
|
+
try {
|
837
|
+
(streamTask.model = entry.value),
|
838
|
+
request.pendingChunks++,
|
839
|
+
emitChunk(request, streamTask, streamTask.model),
|
840
|
+
enqueueFlush(request),
|
841
|
+
reader.read().then(progress, error);
|
842
|
+
} catch (x$8) {
|
843
|
+
error(x$8);
|
844
|
+
}
|
845
|
+
}
|
846
|
+
function error(reason) {
|
847
|
+
if (!aborted) {
|
848
|
+
aborted = !0;
|
849
|
+
request.abortListeners.delete(abortStream);
|
850
|
+
var digest = logRecoverableError(request, reason, streamTask);
|
851
|
+
emitErrorChunk(request, streamTask.id, digest);
|
852
|
+
enqueueFlush(request);
|
853
|
+
reader.cancel(reason).then(error, error);
|
854
|
+
}
|
855
|
+
}
|
856
|
+
function abortStream(reason) {
|
857
|
+
if (!aborted) {
|
858
|
+
aborted = !0;
|
859
|
+
request.abortListeners.delete(abortStream);
|
860
|
+
var digest = logRecoverableError(request, reason, streamTask);
|
861
|
+
emitErrorChunk(request, streamTask.id, digest);
|
862
|
+
enqueueFlush(request);
|
863
|
+
reader.cancel(reason).then(error, error);
|
864
|
+
}
|
865
|
+
}
|
866
|
+
var supportsBYOB = stream.supportsBYOB;
|
867
|
+
if (void 0 === supportsBYOB)
|
868
|
+
try {
|
869
|
+
stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
|
870
|
+
} catch (x) {
|
871
|
+
supportsBYOB = !1;
|
872
|
+
}
|
873
|
+
var reader = stream.getReader(),
|
874
|
+
streamTask = createTask(
|
875
|
+
request,
|
876
|
+
task.model,
|
877
|
+
task.keyPath,
|
878
|
+
task.implicitSlot,
|
879
|
+
request.abortableTasks
|
880
|
+
);
|
881
|
+
request.abortableTasks.delete(streamTask);
|
882
|
+
request.pendingChunks++;
|
883
|
+
task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
|
884
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
885
|
+
var aborted = !1;
|
886
|
+
request.abortListeners.add(abortStream);
|
887
|
+
reader.read().then(progress, error);
|
888
|
+
return serializeByValueID(streamTask.id);
|
889
|
+
}
|
890
|
+
function serializeAsyncIterable(request, task, iterable, iterator) {
|
891
|
+
function progress(entry) {
|
892
|
+
if (!aborted)
|
893
|
+
if (entry.done) {
|
894
|
+
request.abortListeners.delete(abortIterable);
|
895
|
+
if (void 0 === entry.value)
|
896
|
+
var endStreamRow = streamTask.id.toString(16) + ":C\n";
|
897
|
+
else
|
898
|
+
try {
|
899
|
+
var chunkId = outlineModel(request, entry.value);
|
900
|
+
endStreamRow =
|
901
|
+
streamTask.id.toString(16) +
|
902
|
+
":C" +
|
903
|
+
stringify(serializeByValueID(chunkId)) +
|
904
|
+
"\n";
|
905
|
+
} catch (x) {
|
906
|
+
error(x);
|
907
|
+
return;
|
908
|
+
}
|
909
|
+
request.completedRegularChunks.push(stringToChunk(endStreamRow));
|
910
|
+
enqueueFlush(request);
|
911
|
+
aborted = !0;
|
912
|
+
} else
|
913
|
+
try {
|
914
|
+
(streamTask.model = entry.value),
|
915
|
+
request.pendingChunks++,
|
916
|
+
emitChunk(request, streamTask, streamTask.model),
|
917
|
+
enqueueFlush(request),
|
918
|
+
iterator.next().then(progress, error);
|
919
|
+
} catch (x$9) {
|
920
|
+
error(x$9);
|
921
|
+
}
|
922
|
+
}
|
923
|
+
function error(reason) {
|
924
|
+
if (!aborted) {
|
925
|
+
aborted = !0;
|
926
|
+
request.abortListeners.delete(abortIterable);
|
927
|
+
var digest = logRecoverableError(request, reason, streamTask);
|
928
|
+
emitErrorChunk(request, streamTask.id, digest);
|
929
|
+
enqueueFlush(request);
|
930
|
+
"function" === typeof iterator.throw &&
|
931
|
+
iterator.throw(reason).then(error, error);
|
932
|
+
}
|
933
|
+
}
|
934
|
+
function abortIterable(reason) {
|
935
|
+
if (!aborted) {
|
936
|
+
aborted = !0;
|
937
|
+
request.abortListeners.delete(abortIterable);
|
938
|
+
var digest = logRecoverableError(request, reason, streamTask);
|
939
|
+
emitErrorChunk(request, streamTask.id, digest);
|
940
|
+
enqueueFlush(request);
|
941
|
+
"function" === typeof iterator.throw &&
|
942
|
+
iterator.throw(reason).then(error, error);
|
943
|
+
}
|
944
|
+
}
|
945
|
+
iterable = iterable === iterator;
|
946
|
+
var streamTask = createTask(
|
947
|
+
request,
|
948
|
+
task.model,
|
949
|
+
task.keyPath,
|
950
|
+
task.implicitSlot,
|
951
|
+
request.abortableTasks
|
952
|
+
);
|
953
|
+
request.abortableTasks.delete(streamTask);
|
954
|
+
request.pendingChunks++;
|
955
|
+
task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
|
956
|
+
request.completedRegularChunks.push(stringToChunk(task));
|
957
|
+
var aborted = !1;
|
958
|
+
request.abortListeners.add(abortIterable);
|
959
|
+
iterator.next().then(progress, error);
|
960
|
+
return serializeByValueID(streamTask.id);
|
961
|
+
}
|
962
|
+
function emitHint(request, code, model) {
|
963
|
+
model = stringify(model);
|
964
|
+
var id = request.nextChunkId++;
|
965
|
+
code = "H" + code;
|
966
|
+
code = id.toString(16) + ":" + code;
|
967
|
+
model = stringToChunk(code + model + "\n");
|
968
|
+
request.completedHintChunks.push(model);
|
969
|
+
enqueueFlush(request);
|
970
|
+
}
|
971
|
+
function readThenable(thenable) {
|
972
|
+
if ("fulfilled" === thenable.status) return thenable.value;
|
973
|
+
if ("rejected" === thenable.status) throw thenable.reason;
|
974
|
+
throw thenable;
|
975
|
+
}
|
976
|
+
function createLazyWrapperAroundWakeable(wakeable) {
|
977
|
+
switch (wakeable.status) {
|
978
|
+
case "fulfilled":
|
979
|
+
case "rejected":
|
980
|
+
break;
|
981
|
+
default:
|
982
|
+
"string" !== typeof wakeable.status &&
|
983
|
+
((wakeable.status = "pending"),
|
984
|
+
wakeable.then(
|
985
|
+
function (fulfilledValue) {
|
986
|
+
"pending" === wakeable.status &&
|
987
|
+
((wakeable.status = "fulfilled"),
|
988
|
+
(wakeable.value = fulfilledValue));
|
989
|
+
},
|
990
|
+
function (error) {
|
991
|
+
"pending" === wakeable.status &&
|
992
|
+
((wakeable.status = "rejected"), (wakeable.reason = error));
|
993
|
+
}
|
994
|
+
));
|
995
|
+
}
|
996
|
+
return { $$typeof: REACT_LAZY_TYPE, _payload: wakeable, _init: readThenable };
|
997
|
+
}
|
998
|
+
function voidHandler() {}
|
999
|
+
function renderFunctionComponent(request, task, key, Component, props) {
|
1000
|
+
var prevThenableState = task.thenableState;
|
1001
|
+
task.thenableState = null;
|
1002
|
+
thenableIndexCounter = 0;
|
1003
|
+
thenableState = prevThenableState;
|
1004
|
+
Component = Component(props, void 0);
|
1005
|
+
if (12 === request.status)
|
1006
|
+
throw (
|
1007
|
+
("object" === typeof Component &&
|
1008
|
+
null !== Component &&
|
1009
|
+
"function" === typeof Component.then &&
|
1010
|
+
Component.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
|
1011
|
+
Component.then(voidHandler, voidHandler),
|
1012
|
+
null)
|
1013
|
+
);
|
1014
|
+
if (
|
1015
|
+
"object" === typeof Component &&
|
1016
|
+
null !== Component &&
|
1017
|
+
Component.$$typeof !== CLIENT_REFERENCE_TAG$1
|
1018
|
+
) {
|
1019
|
+
if ("function" === typeof Component.then) {
|
1020
|
+
props = Component;
|
1021
|
+
if ("fulfilled" === props.status) return props.value;
|
1022
|
+
Component = createLazyWrapperAroundWakeable(Component);
|
1023
|
+
}
|
1024
|
+
var iteratorFn = getIteratorFn(Component);
|
1025
|
+
if (iteratorFn) {
|
1026
|
+
var iterableChild = Component;
|
1027
|
+
Component = {};
|
1028
|
+
Component =
|
1029
|
+
((Component[Symbol.iterator] = function () {
|
1030
|
+
return iteratorFn.call(iterableChild);
|
1031
|
+
}),
|
1032
|
+
Component);
|
1033
|
+
} else if (
|
1034
|
+
!(
|
1035
|
+
"function" !== typeof Component[ASYNC_ITERATOR] ||
|
1036
|
+
("function" === typeof ReadableStream &&
|
1037
|
+
Component instanceof ReadableStream)
|
1038
|
+
)
|
1039
|
+
) {
|
1040
|
+
var iterableChild$10 = Component;
|
1041
|
+
Component = {};
|
1042
|
+
Component =
|
1043
|
+
((Component[ASYNC_ITERATOR] = function () {
|
1044
|
+
return iterableChild$10[ASYNC_ITERATOR]();
|
1045
|
+
}),
|
1046
|
+
Component);
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
props = task.keyPath;
|
1050
|
+
prevThenableState = task.implicitSlot;
|
1051
|
+
null !== key
|
1052
|
+
? (task.keyPath = null === props ? key : props + "," + key)
|
1053
|
+
: null === props && (task.implicitSlot = !0);
|
1054
|
+
request = renderModelDestructive(request, task, emptyRoot, "", Component);
|
1055
|
+
task.keyPath = props;
|
1056
|
+
task.implicitSlot = prevThenableState;
|
1057
|
+
return request;
|
1058
|
+
}
|
1059
|
+
function renderFragment(request, task, children) {
|
1060
|
+
return null !== task.keyPath
|
1061
|
+
? ((request = [
|
1062
|
+
REACT_ELEMENT_TYPE,
|
1063
|
+
REACT_FRAGMENT_TYPE,
|
1064
|
+
task.keyPath,
|
1065
|
+
{ children: children }
|
1066
|
+
]),
|
1067
|
+
task.implicitSlot ? [request] : request)
|
1068
|
+
: children;
|
1069
|
+
}
|
1070
|
+
function renderElement(request, task, type, key, ref, props) {
|
1071
|
+
if (null !== ref && void 0 !== ref)
|
1072
|
+
throw Error(
|
1073
|
+
"Refs cannot be used in Server Components, nor passed to Client Components."
|
1074
|
+
);
|
1075
|
+
if (
|
1076
|
+
"function" === typeof type &&
|
1077
|
+
type.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
|
1078
|
+
type.$$typeof !== TEMPORARY_REFERENCE_TAG
|
1079
|
+
)
|
1080
|
+
return renderFunctionComponent(request, task, key, type, props);
|
1081
|
+
if (type === REACT_FRAGMENT_TYPE && null === key)
|
1082
|
+
return (
|
1083
|
+
(type = task.implicitSlot),
|
1084
|
+
null === task.keyPath && (task.implicitSlot = !0),
|
1085
|
+
(props = renderModelDestructive(
|
1086
|
+
request,
|
1087
|
+
task,
|
1088
|
+
emptyRoot,
|
1089
|
+
"",
|
1090
|
+
props.children
|
1091
|
+
)),
|
1092
|
+
(task.implicitSlot = type),
|
1093
|
+
props
|
1094
|
+
);
|
1095
|
+
if (
|
1096
|
+
null != type &&
|
1097
|
+
"object" === typeof type &&
|
1098
|
+
type.$$typeof !== CLIENT_REFERENCE_TAG$1
|
1099
|
+
)
|
1100
|
+
switch (type.$$typeof) {
|
1101
|
+
case REACT_LAZY_TYPE:
|
1102
|
+
var init = type._init;
|
1103
|
+
type = init(type._payload);
|
1104
|
+
if (12 === request.status) throw null;
|
1105
|
+
return renderElement(request, task, type, key, ref, props);
|
1106
|
+
case REACT_FORWARD_REF_TYPE:
|
1107
|
+
return renderFunctionComponent(request, task, key, type.render, props);
|
1108
|
+
case REACT_MEMO_TYPE:
|
1109
|
+
return renderElement(request, task, type.type, key, ref, props);
|
1110
|
+
}
|
1111
|
+
request = key;
|
1112
|
+
key = task.keyPath;
|
1113
|
+
null === request
|
1114
|
+
? (request = key)
|
1115
|
+
: null !== key && (request = key + "," + request);
|
1116
|
+
props = [REACT_ELEMENT_TYPE, type, request, props];
|
1117
|
+
task = task.implicitSlot && null !== request ? [props] : props;
|
1118
|
+
return task;
|
1119
|
+
}
|
1120
|
+
function pingTask(request, task) {
|
1121
|
+
var pingedTasks = request.pingedTasks;
|
1122
|
+
pingedTasks.push(task);
|
1123
|
+
1 === pingedTasks.length &&
|
1124
|
+
((request.flushScheduled = null !== request.destination),
|
1125
|
+
21 === request.type || 10 === request.status
|
1126
|
+
? scheduleMicrotask(function () {
|
1127
|
+
return performWork(request);
|
1128
|
+
})
|
1129
|
+
: scheduleWork(function () {
|
1130
|
+
return performWork(request);
|
1131
|
+
}));
|
1132
|
+
}
|
1133
|
+
function createTask(request, model, keyPath, implicitSlot, abortSet) {
|
1134
|
+
request.pendingChunks++;
|
1135
|
+
var id = request.nextChunkId++;
|
1136
|
+
"object" !== typeof model ||
|
1137
|
+
null === model ||
|
1138
|
+
null !== keyPath ||
|
1139
|
+
implicitSlot ||
|
1140
|
+
request.writtenObjects.set(model, serializeByValueID(id));
|
1141
|
+
var task = {
|
1142
|
+
id: id,
|
1143
|
+
status: 0,
|
1144
|
+
model: model,
|
1145
|
+
keyPath: keyPath,
|
1146
|
+
implicitSlot: implicitSlot,
|
1147
|
+
ping: function () {
|
1148
|
+
return pingTask(request, task);
|
1149
|
+
},
|
1150
|
+
toJSON: function (parentPropertyName, value) {
|
1151
|
+
var prevKeyPath = task.keyPath,
|
1152
|
+
prevImplicitSlot = task.implicitSlot;
|
1153
|
+
try {
|
1154
|
+
var JSCompiler_inline_result = renderModelDestructive(
|
1155
|
+
request,
|
1156
|
+
task,
|
1157
|
+
this,
|
1158
|
+
parentPropertyName,
|
1159
|
+
value
|
1160
|
+
);
|
1161
|
+
} catch (thrownValue) {
|
1162
|
+
if (
|
1163
|
+
((parentPropertyName = task.model),
|
1164
|
+
(parentPropertyName =
|
1165
|
+
"object" === typeof parentPropertyName &&
|
1166
|
+
null !== parentPropertyName &&
|
1167
|
+
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
1168
|
+
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
1169
|
+
12 === request.status)
|
1170
|
+
)
|
1171
|
+
(task.status = 3),
|
1172
|
+
(prevKeyPath = request.fatalError),
|
1173
|
+
(JSCompiler_inline_result = parentPropertyName
|
1174
|
+
? "$L" + prevKeyPath.toString(16)
|
1175
|
+
: serializeByValueID(prevKeyPath));
|
1176
|
+
else if (
|
1177
|
+
((value =
|
1178
|
+
thrownValue === SuspenseException
|
1179
|
+
? getSuspendedThenable()
|
1180
|
+
: thrownValue),
|
1181
|
+
"object" === typeof value &&
|
1182
|
+
null !== value &&
|
1183
|
+
"function" === typeof value.then)
|
1184
|
+
) {
|
1185
|
+
JSCompiler_inline_result = createTask(
|
1186
|
+
request,
|
1187
|
+
task.model,
|
1188
|
+
task.keyPath,
|
1189
|
+
task.implicitSlot,
|
1190
|
+
request.abortableTasks
|
1191
|
+
);
|
1192
|
+
var ping = JSCompiler_inline_result.ping;
|
1193
|
+
value.then(ping, ping);
|
1194
|
+
JSCompiler_inline_result.thenableState =
|
1195
|
+
getThenableStateAfterSuspending();
|
1196
|
+
task.keyPath = prevKeyPath;
|
1197
|
+
task.implicitSlot = prevImplicitSlot;
|
1198
|
+
JSCompiler_inline_result = parentPropertyName
|
1199
|
+
? "$L" + JSCompiler_inline_result.id.toString(16)
|
1200
|
+
: serializeByValueID(JSCompiler_inline_result.id);
|
1201
|
+
} else
|
1202
|
+
(task.keyPath = prevKeyPath),
|
1203
|
+
(task.implicitSlot = prevImplicitSlot),
|
1204
|
+
request.pendingChunks++,
|
1205
|
+
(prevKeyPath = request.nextChunkId++),
|
1206
|
+
(prevImplicitSlot = logRecoverableError(request, value, task)),
|
1207
|
+
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
1208
|
+
(JSCompiler_inline_result = parentPropertyName
|
1209
|
+
? "$L" + prevKeyPath.toString(16)
|
1210
|
+
: serializeByValueID(prevKeyPath));
|
1211
|
+
}
|
1212
|
+
return JSCompiler_inline_result;
|
1213
|
+
},
|
1214
|
+
thenableState: null
|
1215
|
+
};
|
1216
|
+
abortSet.add(task);
|
1217
|
+
return task;
|
1218
|
+
}
|
1219
|
+
function serializeByValueID(id) {
|
1220
|
+
return "$" + id.toString(16);
|
1221
|
+
}
|
1222
|
+
function encodeReferenceChunk(request, id, reference) {
|
1223
|
+
request = stringify(reference);
|
1224
|
+
id = id.toString(16) + ":" + request + "\n";
|
1225
|
+
return stringToChunk(id);
|
1226
|
+
}
|
1227
|
+
function serializeClientReference(
|
1228
|
+
request,
|
1229
|
+
parent,
|
1230
|
+
parentPropertyName,
|
1231
|
+
clientReference
|
1232
|
+
) {
|
1233
|
+
var clientReferenceKey = clientReference.$$async
|
1234
|
+
? clientReference.$$id + "#async"
|
1235
|
+
: clientReference.$$id,
|
1236
|
+
writtenClientReferences = request.writtenClientReferences,
|
1237
|
+
existingId = writtenClientReferences.get(clientReferenceKey);
|
1238
|
+
if (void 0 !== existingId)
|
1239
|
+
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
1240
|
+
? "$L" + existingId.toString(16)
|
1241
|
+
: serializeByValueID(existingId);
|
1242
|
+
try {
|
1243
|
+
var config = request.bundlerConfig,
|
1244
|
+
modulePath = clientReference.$$id;
|
1245
|
+
existingId = "";
|
1246
|
+
var resolvedModuleData = config[modulePath];
|
1247
|
+
if (resolvedModuleData) existingId = resolvedModuleData.name;
|
1248
|
+
else {
|
1249
|
+
var idx = modulePath.lastIndexOf("#");
|
1250
|
+
-1 !== idx &&
|
1251
|
+
((existingId = modulePath.slice(idx + 1)),
|
1252
|
+
(resolvedModuleData = config[modulePath.slice(0, idx)]));
|
1253
|
+
if (!resolvedModuleData)
|
1254
|
+
throw Error(
|
1255
|
+
'Could not find the module "' +
|
1256
|
+
modulePath +
|
1257
|
+
'" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
|
1258
|
+
);
|
1259
|
+
}
|
1260
|
+
if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
|
1261
|
+
throw Error(
|
1262
|
+
'The module "' +
|
1263
|
+
modulePath +
|
1264
|
+
'" is marked as an async ESM module but was loaded as a CJS proxy. This is probably a bug in the React Server Components bundler.'
|
1265
|
+
);
|
1266
|
+
var JSCompiler_inline_result =
|
1267
|
+
!0 === resolvedModuleData.async || !0 === clientReference.$$async
|
1268
|
+
? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
|
1269
|
+
: [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
|
1270
|
+
request.pendingChunks++;
|
1271
|
+
var importId = request.nextChunkId++,
|
1272
|
+
json = stringify(JSCompiler_inline_result),
|
1273
|
+
row = importId.toString(16) + ":I" + json + "\n",
|
1274
|
+
processedChunk = stringToChunk(row);
|
1275
|
+
request.completedImportChunks.push(processedChunk);
|
1276
|
+
writtenClientReferences.set(clientReferenceKey, importId);
|
1277
|
+
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
1278
|
+
? "$L" + importId.toString(16)
|
1279
|
+
: serializeByValueID(importId);
|
1280
|
+
} catch (x) {
|
1281
|
+
return (
|
1282
|
+
request.pendingChunks++,
|
1283
|
+
(parent = request.nextChunkId++),
|
1284
|
+
(parentPropertyName = logRecoverableError(request, x, null)),
|
1285
|
+
emitErrorChunk(request, parent, parentPropertyName),
|
1286
|
+
serializeByValueID(parent)
|
1287
|
+
);
|
1288
|
+
}
|
1289
|
+
}
|
1290
|
+
function outlineModel(request, value) {
|
1291
|
+
value = createTask(request, value, null, !1, request.abortableTasks);
|
1292
|
+
retryTask(request, value);
|
1293
|
+
return value.id;
|
1294
|
+
}
|
1295
|
+
function serializeTypedArray(request, tag, typedArray) {
|
1296
|
+
request.pendingChunks++;
|
1297
|
+
var bufferId = request.nextChunkId++;
|
1298
|
+
emitTypedArrayChunk(request, bufferId, tag, typedArray);
|
1299
|
+
return serializeByValueID(bufferId);
|
1300
|
+
}
|
1301
|
+
function serializeBlob(request, blob) {
|
1302
|
+
function progress(entry) {
|
1303
|
+
if (!aborted)
|
1304
|
+
if (entry.done)
|
1305
|
+
request.abortListeners.delete(abortBlob),
|
1306
|
+
(aborted = !0),
|
1307
|
+
pingTask(request, newTask);
|
1308
|
+
else
|
1309
|
+
return (
|
1310
|
+
model.push(entry.value), reader.read().then(progress).catch(error)
|
1311
|
+
);
|
1312
|
+
}
|
1313
|
+
function error(reason) {
|
1314
|
+
if (!aborted) {
|
1315
|
+
aborted = !0;
|
1316
|
+
request.abortListeners.delete(abortBlob);
|
1317
|
+
var digest = logRecoverableError(request, reason, newTask);
|
1318
|
+
emitErrorChunk(request, newTask.id, digest);
|
1319
|
+
enqueueFlush(request);
|
1320
|
+
reader.cancel(reason).then(error, error);
|
1321
|
+
}
|
1322
|
+
}
|
1323
|
+
function abortBlob(reason) {
|
1324
|
+
if (!aborted) {
|
1325
|
+
aborted = !0;
|
1326
|
+
request.abortListeners.delete(abortBlob);
|
1327
|
+
var digest = logRecoverableError(request, reason, newTask);
|
1328
|
+
emitErrorChunk(request, newTask.id, digest);
|
1329
|
+
enqueueFlush(request);
|
1330
|
+
reader.cancel(reason).then(error, error);
|
1331
|
+
}
|
1332
|
+
}
|
1333
|
+
var model = [blob.type],
|
1334
|
+
newTask = createTask(request, model, null, !1, request.abortableTasks),
|
1335
|
+
reader = blob.stream().getReader(),
|
1336
|
+
aborted = !1;
|
1337
|
+
request.abortListeners.add(abortBlob);
|
1338
|
+
reader.read().then(progress).catch(error);
|
1339
|
+
return "$B" + newTask.id.toString(16);
|
1340
|
+
}
|
1341
|
+
var modelRoot = !1;
|
1342
|
+
function renderModelDestructive(
|
1343
|
+
request,
|
1344
|
+
task,
|
1345
|
+
parent,
|
1346
|
+
parentPropertyName,
|
1347
|
+
value
|
1348
|
+
) {
|
1349
|
+
task.model = value;
|
1350
|
+
if (value === REACT_ELEMENT_TYPE) return "$";
|
1351
|
+
if (null === value) return null;
|
1352
|
+
if ("object" === typeof value) {
|
1353
|
+
switch (value.$$typeof) {
|
1354
|
+
case REACT_ELEMENT_TYPE:
|
1355
|
+
var elementReference = null,
|
1356
|
+
writtenObjects = request.writtenObjects;
|
1357
|
+
if (null === task.keyPath && !task.implicitSlot) {
|
1358
|
+
var existingReference = writtenObjects.get(value);
|
1359
|
+
if (void 0 !== existingReference)
|
1360
|
+
if (modelRoot === value) modelRoot = null;
|
1361
|
+
else return existingReference;
|
1362
|
+
else
|
1363
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1364
|
+
((parent = writtenObjects.get(parent)),
|
1365
|
+
void 0 !== parent &&
|
1366
|
+
((elementReference = parent + ":" + parentPropertyName),
|
1367
|
+
writtenObjects.set(value, elementReference)));
|
1368
|
+
}
|
1369
|
+
parentPropertyName = value.props;
|
1370
|
+
parent = parentPropertyName.ref;
|
1371
|
+
request = renderElement(
|
1372
|
+
request,
|
1373
|
+
task,
|
1374
|
+
value.type,
|
1375
|
+
value.key,
|
1376
|
+
void 0 !== parent ? parent : null,
|
1377
|
+
parentPropertyName
|
1378
|
+
);
|
1379
|
+
"object" === typeof request &&
|
1380
|
+
null !== request &&
|
1381
|
+
null !== elementReference &&
|
1382
|
+
(writtenObjects.has(request) ||
|
1383
|
+
writtenObjects.set(request, elementReference));
|
1384
|
+
return request;
|
1385
|
+
case REACT_LAZY_TYPE:
|
1386
|
+
task.thenableState = null;
|
1387
|
+
parentPropertyName = value._init;
|
1388
|
+
value = parentPropertyName(value._payload);
|
1389
|
+
if (12 === request.status) throw null;
|
1390
|
+
return renderModelDestructive(request, task, emptyRoot, "", value);
|
1391
|
+
case REACT_LEGACY_ELEMENT_TYPE:
|
1392
|
+
throw Error(
|
1393
|
+
'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.'
|
1394
|
+
);
|
1395
|
+
}
|
1396
|
+
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
1397
|
+
return serializeClientReference(
|
1398
|
+
request,
|
1399
|
+
parent,
|
1400
|
+
parentPropertyName,
|
1401
|
+
value
|
1402
|
+
);
|
1403
|
+
if (
|
1404
|
+
void 0 !== request.temporaryReferences &&
|
1405
|
+
((elementReference = request.temporaryReferences.get(value)),
|
1406
|
+
void 0 !== elementReference)
|
1407
|
+
)
|
1408
|
+
return "$T" + elementReference;
|
1409
|
+
elementReference = request.writtenObjects;
|
1410
|
+
writtenObjects = elementReference.get(value);
|
1411
|
+
if ("function" === typeof value.then) {
|
1412
|
+
if (void 0 !== writtenObjects) {
|
1413
|
+
if (null !== task.keyPath || task.implicitSlot)
|
1414
|
+
return "$@" + serializeThenable(request, task, value).toString(16);
|
1415
|
+
if (modelRoot === value) modelRoot = null;
|
1416
|
+
else return writtenObjects;
|
1417
|
+
}
|
1418
|
+
request = "$@" + serializeThenable(request, task, value).toString(16);
|
1419
|
+
elementReference.set(value, request);
|
1420
|
+
return request;
|
1421
|
+
}
|
1422
|
+
if (void 0 !== writtenObjects)
|
1423
|
+
if (modelRoot === value) modelRoot = null;
|
1424
|
+
else return writtenObjects;
|
1425
|
+
else if (
|
1426
|
+
-1 === parentPropertyName.indexOf(":") &&
|
1427
|
+
((writtenObjects = elementReference.get(parent)),
|
1428
|
+
void 0 !== writtenObjects)
|
1429
|
+
) {
|
1430
|
+
existingReference = parentPropertyName;
|
1431
|
+
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
1432
|
+
switch (parentPropertyName) {
|
1433
|
+
case "1":
|
1434
|
+
existingReference = "type";
|
1435
|
+
break;
|
1436
|
+
case "2":
|
1437
|
+
existingReference = "key";
|
1438
|
+
break;
|
1439
|
+
case "3":
|
1440
|
+
existingReference = "props";
|
1441
|
+
break;
|
1442
|
+
case "4":
|
1443
|
+
existingReference = "_owner";
|
1444
|
+
}
|
1445
|
+
elementReference.set(value, writtenObjects + ":" + existingReference);
|
1446
|
+
}
|
1447
|
+
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
1448
|
+
if (value instanceof Map)
|
1449
|
+
return (
|
1450
|
+
(value = Array.from(value)),
|
1451
|
+
"$Q" + outlineModel(request, value).toString(16)
|
1452
|
+
);
|
1453
|
+
if (value instanceof Set)
|
1454
|
+
return (
|
1455
|
+
(value = Array.from(value)),
|
1456
|
+
"$W" + outlineModel(request, value).toString(16)
|
1457
|
+
);
|
1458
|
+
if ("function" === typeof FormData && value instanceof FormData)
|
1459
|
+
return (
|
1460
|
+
(value = Array.from(value.entries())),
|
1461
|
+
"$K" + outlineModel(request, value).toString(16)
|
1462
|
+
);
|
1463
|
+
if (value instanceof Error) return "$Z";
|
1464
|
+
if (value instanceof ArrayBuffer)
|
1465
|
+
return serializeTypedArray(request, "A", new Uint8Array(value));
|
1466
|
+
if (value instanceof Int8Array)
|
1467
|
+
return serializeTypedArray(request, "O", value);
|
1468
|
+
if (value instanceof Uint8Array)
|
1469
|
+
return serializeTypedArray(request, "o", value);
|
1470
|
+
if (value instanceof Uint8ClampedArray)
|
1471
|
+
return serializeTypedArray(request, "U", value);
|
1472
|
+
if (value instanceof Int16Array)
|
1473
|
+
return serializeTypedArray(request, "S", value);
|
1474
|
+
if (value instanceof Uint16Array)
|
1475
|
+
return serializeTypedArray(request, "s", value);
|
1476
|
+
if (value instanceof Int32Array)
|
1477
|
+
return serializeTypedArray(request, "L", value);
|
1478
|
+
if (value instanceof Uint32Array)
|
1479
|
+
return serializeTypedArray(request, "l", value);
|
1480
|
+
if (value instanceof Float32Array)
|
1481
|
+
return serializeTypedArray(request, "G", value);
|
1482
|
+
if (value instanceof Float64Array)
|
1483
|
+
return serializeTypedArray(request, "g", value);
|
1484
|
+
if (value instanceof BigInt64Array)
|
1485
|
+
return serializeTypedArray(request, "M", value);
|
1486
|
+
if (value instanceof BigUint64Array)
|
1487
|
+
return serializeTypedArray(request, "m", value);
|
1488
|
+
if (value instanceof DataView)
|
1489
|
+
return serializeTypedArray(request, "V", value);
|
1490
|
+
if ("function" === typeof Blob && value instanceof Blob)
|
1491
|
+
return serializeBlob(request, value);
|
1492
|
+
if ((elementReference = getIteratorFn(value)))
|
1493
|
+
return (
|
1494
|
+
(parentPropertyName = elementReference.call(value)),
|
1495
|
+
parentPropertyName === value
|
1496
|
+
? "$i" +
|
1497
|
+
outlineModel(request, Array.from(parentPropertyName)).toString(16)
|
1498
|
+
: renderFragment(request, task, Array.from(parentPropertyName))
|
1499
|
+
);
|
1500
|
+
if ("function" === typeof ReadableStream && value instanceof ReadableStream)
|
1501
|
+
return serializeReadableStream(request, task, value);
|
1502
|
+
elementReference = value[ASYNC_ITERATOR];
|
1503
|
+
if ("function" === typeof elementReference)
|
1504
|
+
return (
|
1505
|
+
null !== task.keyPath
|
1506
|
+
? ((request = [
|
1507
|
+
REACT_ELEMENT_TYPE,
|
1508
|
+
REACT_FRAGMENT_TYPE,
|
1509
|
+
task.keyPath,
|
1510
|
+
{ children: value }
|
1511
|
+
]),
|
1512
|
+
(request = task.implicitSlot ? [request] : request))
|
1513
|
+
: ((parentPropertyName = elementReference.call(value)),
|
1514
|
+
(request = serializeAsyncIterable(
|
1515
|
+
request,
|
1516
|
+
task,
|
1517
|
+
value,
|
1518
|
+
parentPropertyName
|
1519
|
+
))),
|
1520
|
+
request
|
1521
|
+
);
|
1522
|
+
if (value instanceof Date) return "$D" + value.toJSON();
|
1523
|
+
request = getPrototypeOf(value);
|
1524
|
+
if (
|
1525
|
+
request !== ObjectPrototype &&
|
1526
|
+
(null === request || null !== getPrototypeOf(request))
|
1527
|
+
)
|
1528
|
+
throw Error(
|
1529
|
+
"Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." +
|
1530
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
1531
|
+
);
|
1532
|
+
return value;
|
1533
|
+
}
|
1534
|
+
if ("string" === typeof value) {
|
1535
|
+
if (
|
1536
|
+
"Z" === value[value.length - 1] &&
|
1537
|
+
parent[parentPropertyName] instanceof Date
|
1538
|
+
)
|
1539
|
+
return "$D" + value;
|
1540
|
+
if (1024 <= value.length && null !== byteLengthOfChunk)
|
1541
|
+
return (
|
1542
|
+
request.pendingChunks++,
|
1543
|
+
(task = request.nextChunkId++),
|
1544
|
+
emitTextChunk(request, task, value),
|
1545
|
+
serializeByValueID(task)
|
1546
|
+
);
|
1547
|
+
request = "$" === value[0] ? "$" + value : value;
|
1548
|
+
return request;
|
1549
|
+
}
|
1550
|
+
if ("boolean" === typeof value) return value;
|
1551
|
+
if ("number" === typeof value)
|
1552
|
+
return Number.isFinite(value)
|
1553
|
+
? 0 === value && -Infinity === 1 / value
|
1554
|
+
? "$-0"
|
1555
|
+
: value
|
1556
|
+
: Infinity === value
|
1557
|
+
? "$Infinity"
|
1558
|
+
: -Infinity === value
|
1559
|
+
? "$-Infinity"
|
1560
|
+
: "$NaN";
|
1561
|
+
if ("undefined" === typeof value) return "$undefined";
|
1562
|
+
if ("function" === typeof value) {
|
1563
|
+
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
1564
|
+
return serializeClientReference(
|
1565
|
+
request,
|
1566
|
+
parent,
|
1567
|
+
parentPropertyName,
|
1568
|
+
value
|
1569
|
+
);
|
1570
|
+
if (value.$$typeof === SERVER_REFERENCE_TAG)
|
1571
|
+
return (
|
1572
|
+
(task = request.writtenServerReferences),
|
1573
|
+
(parentPropertyName = task.get(value)),
|
1574
|
+
void 0 !== parentPropertyName
|
1575
|
+
? (request = "$F" + parentPropertyName.toString(16))
|
1576
|
+
: ((parentPropertyName = value.$$bound),
|
1577
|
+
(parentPropertyName =
|
1578
|
+
null === parentPropertyName
|
1579
|
+
? null
|
1580
|
+
: Promise.resolve(parentPropertyName)),
|
1581
|
+
(request = outlineModel(request, {
|
1582
|
+
id: value.$$id,
|
1583
|
+
bound: parentPropertyName
|
1584
|
+
})),
|
1585
|
+
task.set(value, request),
|
1586
|
+
(request = "$F" + request.toString(16))),
|
1587
|
+
request
|
1588
|
+
);
|
1589
|
+
if (
|
1590
|
+
void 0 !== request.temporaryReferences &&
|
1591
|
+
((request = request.temporaryReferences.get(value)), void 0 !== request)
|
1592
|
+
)
|
1593
|
+
return "$T" + request;
|
1594
|
+
if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
|
1595
|
+
throw Error(
|
1596
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
1597
|
+
);
|
1598
|
+
if (/^on[A-Z]/.test(parentPropertyName))
|
1599
|
+
throw Error(
|
1600
|
+
"Event handlers cannot be passed to Client Component props." +
|
1601
|
+
describeObjectForErrorMessage(parent, parentPropertyName) +
|
1602
|
+
"\nIf you need interactivity, consider converting part of this to a Client Component."
|
1603
|
+
);
|
1604
|
+
throw Error(
|
1605
|
+
'Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.' +
|
1606
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
1607
|
+
);
|
1608
|
+
}
|
1609
|
+
if ("symbol" === typeof value) {
|
1610
|
+
task = request.writtenSymbols;
|
1611
|
+
elementReference = task.get(value);
|
1612
|
+
if (void 0 !== elementReference)
|
1613
|
+
return serializeByValueID(elementReference);
|
1614
|
+
elementReference = value.description;
|
1615
|
+
if (Symbol.for(elementReference) !== value)
|
1616
|
+
throw Error(
|
1617
|
+
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
1618
|
+
(value.description + ") cannot be found among global symbols.") +
|
1619
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
1620
|
+
);
|
1621
|
+
request.pendingChunks++;
|
1622
|
+
parentPropertyName = request.nextChunkId++;
|
1623
|
+
parent = encodeReferenceChunk(
|
1624
|
+
request,
|
1625
|
+
parentPropertyName,
|
1626
|
+
"$S" + elementReference
|
1627
|
+
);
|
1628
|
+
request.completedImportChunks.push(parent);
|
1629
|
+
task.set(value, parentPropertyName);
|
1630
|
+
return serializeByValueID(parentPropertyName);
|
1631
|
+
}
|
1632
|
+
if ("bigint" === typeof value) return "$n" + value.toString(10);
|
1633
|
+
throw Error(
|
1634
|
+
"Type " +
|
1635
|
+
typeof value +
|
1636
|
+
" is not supported in Client Component props." +
|
1637
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
1638
|
+
);
|
1639
|
+
}
|
1640
|
+
function logRecoverableError(request, error) {
|
1641
|
+
var prevRequest = currentRequest;
|
1642
|
+
currentRequest = null;
|
1643
|
+
try {
|
1644
|
+
var onError = request.onError;
|
1645
|
+
var errorDigest = onError(error);
|
1646
|
+
} finally {
|
1647
|
+
currentRequest = prevRequest;
|
1648
|
+
}
|
1649
|
+
if (null != errorDigest && "string" !== typeof errorDigest)
|
1650
|
+
throw Error(
|
1651
|
+
'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' +
|
1652
|
+
typeof errorDigest +
|
1653
|
+
'" instead'
|
1654
|
+
);
|
1655
|
+
return errorDigest || "";
|
1656
|
+
}
|
1657
|
+
function fatalError(request, error) {
|
1658
|
+
var onFatalError = request.onFatalError;
|
1659
|
+
onFatalError(error);
|
1660
|
+
null !== request.destination
|
1661
|
+
? ((request.status = 14), closeWithError(request.destination, error))
|
1662
|
+
: ((request.status = 13), (request.fatalError = error));
|
1663
|
+
}
|
1664
|
+
function emitErrorChunk(request, id, digest) {
|
1665
|
+
digest = { digest: digest };
|
1666
|
+
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
1667
|
+
id = stringToChunk(id);
|
1668
|
+
request.completedErrorChunks.push(id);
|
1669
|
+
}
|
1670
|
+
function emitModelChunk(request, id, json) {
|
1671
|
+
id = id.toString(16) + ":" + json + "\n";
|
1672
|
+
id = stringToChunk(id);
|
1673
|
+
request.completedRegularChunks.push(id);
|
1674
|
+
}
|
1675
|
+
function emitTypedArrayChunk(request, id, tag, typedArray) {
|
1676
|
+
request.pendingChunks++;
|
1677
|
+
var buffer = new Uint8Array(
|
1678
|
+
typedArray.buffer,
|
1679
|
+
typedArray.byteOffset,
|
1680
|
+
typedArray.byteLength
|
1681
|
+
);
|
1682
|
+
typedArray = 2048 < typedArray.byteLength ? buffer.slice() : buffer;
|
1683
|
+
buffer = typedArray.byteLength;
|
1684
|
+
id = id.toString(16) + ":" + tag + buffer.toString(16) + ",";
|
1685
|
+
id = stringToChunk(id);
|
1686
|
+
request.completedRegularChunks.push(id, typedArray);
|
1687
|
+
}
|
1688
|
+
function emitTextChunk(request, id, text) {
|
1689
|
+
if (null === byteLengthOfChunk)
|
1690
|
+
throw Error(
|
1691
|
+
"Existence of byteLengthOfChunk should have already been checked. This is a bug in React."
|
1692
|
+
);
|
1693
|
+
request.pendingChunks++;
|
1694
|
+
text = stringToChunk(text);
|
1695
|
+
var binaryLength = text.byteLength;
|
1696
|
+
id = id.toString(16) + ":T" + binaryLength.toString(16) + ",";
|
1697
|
+
id = stringToChunk(id);
|
1698
|
+
request.completedRegularChunks.push(id, text);
|
1699
|
+
}
|
1700
|
+
function emitChunk(request, task, value) {
|
1701
|
+
var id = task.id;
|
1702
|
+
"string" === typeof value && null !== byteLengthOfChunk
|
1703
|
+
? emitTextChunk(request, id, value)
|
1704
|
+
: value instanceof ArrayBuffer
|
1705
|
+
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value))
|
1706
|
+
: value instanceof Int8Array
|
1707
|
+
? emitTypedArrayChunk(request, id, "O", value)
|
1708
|
+
: value instanceof Uint8Array
|
1709
|
+
? emitTypedArrayChunk(request, id, "o", value)
|
1710
|
+
: value instanceof Uint8ClampedArray
|
1711
|
+
? emitTypedArrayChunk(request, id, "U", value)
|
1712
|
+
: value instanceof Int16Array
|
1713
|
+
? emitTypedArrayChunk(request, id, "S", value)
|
1714
|
+
: value instanceof Uint16Array
|
1715
|
+
? emitTypedArrayChunk(request, id, "s", value)
|
1716
|
+
: value instanceof Int32Array
|
1717
|
+
? emitTypedArrayChunk(request, id, "L", value)
|
1718
|
+
: value instanceof Uint32Array
|
1719
|
+
? emitTypedArrayChunk(request, id, "l", value)
|
1720
|
+
: value instanceof Float32Array
|
1721
|
+
? emitTypedArrayChunk(request, id, "G", value)
|
1722
|
+
: value instanceof Float64Array
|
1723
|
+
? emitTypedArrayChunk(request, id, "g", value)
|
1724
|
+
: value instanceof BigInt64Array
|
1725
|
+
? emitTypedArrayChunk(request, id, "M", value)
|
1726
|
+
: value instanceof BigUint64Array
|
1727
|
+
? emitTypedArrayChunk(request, id, "m", value)
|
1728
|
+
: value instanceof DataView
|
1729
|
+
? emitTypedArrayChunk(request, id, "V", value)
|
1730
|
+
: ((value = stringify(value, task.toJSON)),
|
1731
|
+
emitModelChunk(request, task.id, value));
|
1732
|
+
}
|
1733
|
+
var emptyRoot = {};
|
1734
|
+
function retryTask(request, task) {
|
1735
|
+
if (0 === task.status) {
|
1736
|
+
task.status = 5;
|
1737
|
+
try {
|
1738
|
+
modelRoot = task.model;
|
1739
|
+
var resolvedModel = renderModelDestructive(
|
1740
|
+
request,
|
1741
|
+
task,
|
1742
|
+
emptyRoot,
|
1743
|
+
"",
|
1744
|
+
task.model
|
1745
|
+
);
|
1746
|
+
modelRoot = resolvedModel;
|
1747
|
+
task.keyPath = null;
|
1748
|
+
task.implicitSlot = !1;
|
1749
|
+
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
1750
|
+
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
1751
|
+
emitChunk(request, task, resolvedModel);
|
1752
|
+
else {
|
1753
|
+
var json = stringify(resolvedModel);
|
1754
|
+
emitModelChunk(request, task.id, json);
|
1755
|
+
}
|
1756
|
+
request.abortableTasks.delete(task);
|
1757
|
+
task.status = 1;
|
1758
|
+
} catch (thrownValue) {
|
1759
|
+
if (12 === request.status) {
|
1760
|
+
request.abortableTasks.delete(task);
|
1761
|
+
task.status = 3;
|
1762
|
+
var model = stringify(serializeByValueID(request.fatalError));
|
1763
|
+
emitModelChunk(request, task.id, model);
|
1764
|
+
} else {
|
1765
|
+
var x =
|
1766
|
+
thrownValue === SuspenseException
|
1767
|
+
? getSuspendedThenable()
|
1768
|
+
: thrownValue;
|
1769
|
+
if (
|
1770
|
+
"object" === typeof x &&
|
1771
|
+
null !== x &&
|
1772
|
+
"function" === typeof x.then
|
1773
|
+
) {
|
1774
|
+
task.status = 0;
|
1775
|
+
task.thenableState = getThenableStateAfterSuspending();
|
1776
|
+
var ping = task.ping;
|
1777
|
+
x.then(ping, ping);
|
1778
|
+
} else {
|
1779
|
+
request.abortableTasks.delete(task);
|
1780
|
+
task.status = 4;
|
1781
|
+
var digest = logRecoverableError(request, x, task);
|
1782
|
+
emitErrorChunk(request, task.id, digest);
|
1783
|
+
}
|
1784
|
+
}
|
1785
|
+
} finally {
|
1786
|
+
}
|
1787
|
+
}
|
1788
|
+
}
|
1789
|
+
function performWork(request) {
|
1790
|
+
var prevDispatcher = ReactSharedInternalsServer.H;
|
1791
|
+
ReactSharedInternalsServer.H = HooksDispatcher;
|
1792
|
+
var prevRequest = currentRequest;
|
1793
|
+
currentRequest$1 = currentRequest = request;
|
1794
|
+
var hadAbortableTasks = 0 < request.abortableTasks.size;
|
1795
|
+
try {
|
1796
|
+
var pingedTasks = request.pingedTasks;
|
1797
|
+
request.pingedTasks = [];
|
1798
|
+
for (var i = 0; i < pingedTasks.length; i++)
|
1799
|
+
retryTask(request, pingedTasks[i]);
|
1800
|
+
null !== request.destination &&
|
1801
|
+
flushCompletedChunks(request, request.destination);
|
1802
|
+
if (hadAbortableTasks && 0 === request.abortableTasks.size) {
|
1803
|
+
var onAllReady = request.onAllReady;
|
1804
|
+
onAllReady();
|
1805
|
+
}
|
1806
|
+
} catch (error) {
|
1807
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
1808
|
+
} finally {
|
1809
|
+
(ReactSharedInternalsServer.H = prevDispatcher),
|
1810
|
+
(currentRequest$1 = null),
|
1811
|
+
(currentRequest = prevRequest);
|
1812
|
+
}
|
1813
|
+
}
|
1814
|
+
function flushCompletedChunks(request, destination) {
|
1815
|
+
currentView = new Uint8Array(2048);
|
1816
|
+
writtenBytes = 0;
|
1817
|
+
try {
|
1818
|
+
for (
|
1819
|
+
var importsChunks = request.completedImportChunks, i = 0;
|
1820
|
+
i < importsChunks.length;
|
1821
|
+
i++
|
1822
|
+
)
|
1823
|
+
request.pendingChunks--,
|
1824
|
+
writeChunkAndReturn(destination, importsChunks[i]);
|
1825
|
+
importsChunks.splice(0, i);
|
1826
|
+
var hintChunks = request.completedHintChunks;
|
1827
|
+
for (i = 0; i < hintChunks.length; i++)
|
1828
|
+
writeChunkAndReturn(destination, hintChunks[i]);
|
1829
|
+
hintChunks.splice(0, i);
|
1830
|
+
var regularChunks = request.completedRegularChunks;
|
1831
|
+
for (i = 0; i < regularChunks.length; i++)
|
1832
|
+
request.pendingChunks--,
|
1833
|
+
writeChunkAndReturn(destination, regularChunks[i]);
|
1834
|
+
regularChunks.splice(0, i);
|
1835
|
+
var errorChunks = request.completedErrorChunks;
|
1836
|
+
for (i = 0; i < errorChunks.length; i++)
|
1837
|
+
request.pendingChunks--, writeChunkAndReturn(destination, errorChunks[i]);
|
1838
|
+
errorChunks.splice(0, i);
|
1839
|
+
} finally {
|
1840
|
+
(request.flushScheduled = !1),
|
1841
|
+
currentView &&
|
1842
|
+
0 < writtenBytes &&
|
1843
|
+
(destination.enqueue(
|
1844
|
+
new Uint8Array(currentView.buffer, 0, writtenBytes)
|
1845
|
+
),
|
1846
|
+
(currentView = null),
|
1847
|
+
(writtenBytes = 0));
|
1848
|
+
}
|
1849
|
+
0 === request.pendingChunks &&
|
1850
|
+
((request.status = 14), destination.close(), (request.destination = null));
|
1851
|
+
}
|
1852
|
+
function startWork(request) {
|
1853
|
+
request.flushScheduled = null !== request.destination;
|
1854
|
+
scheduleMicrotask(function () {
|
1855
|
+
return performWork(request);
|
1856
|
+
});
|
1857
|
+
scheduleWork(function () {
|
1858
|
+
10 === request.status && (request.status = 11);
|
1859
|
+
});
|
1860
|
+
}
|
1861
|
+
function enqueueFlush(request) {
|
1862
|
+
!1 === request.flushScheduled &&
|
1863
|
+
0 === request.pingedTasks.length &&
|
1864
|
+
null !== request.destination &&
|
1865
|
+
((request.flushScheduled = !0),
|
1866
|
+
scheduleWork(function () {
|
1867
|
+
request.flushScheduled = !1;
|
1868
|
+
var destination = request.destination;
|
1869
|
+
destination && flushCompletedChunks(request, destination);
|
1870
|
+
}));
|
1871
|
+
}
|
1872
|
+
function abort(request, reason) {
|
1873
|
+
try {
|
1874
|
+
11 >= request.status && (request.status = 12);
|
1875
|
+
var abortableTasks = request.abortableTasks;
|
1876
|
+
if (0 < abortableTasks.size) {
|
1877
|
+
var error =
|
1878
|
+
void 0 === reason
|
1879
|
+
? Error("The render was aborted by the server without a reason.")
|
1880
|
+
: "object" === typeof reason &&
|
1881
|
+
null !== reason &&
|
1882
|
+
"function" === typeof reason.then
|
1883
|
+
? Error("The render was aborted by the server with a promise.")
|
1884
|
+
: reason,
|
1885
|
+
digest = logRecoverableError(request, error, null),
|
1886
|
+
errorId = request.nextChunkId++;
|
1887
|
+
request.fatalError = errorId;
|
1888
|
+
request.pendingChunks++;
|
1889
|
+
emitErrorChunk(request, errorId, digest, error);
|
1890
|
+
abortableTasks.forEach(function (task) {
|
1891
|
+
if (5 !== task.status) {
|
1892
|
+
task.status = 3;
|
1893
|
+
var ref = serializeByValueID(errorId);
|
1894
|
+
task = encodeReferenceChunk(request, task.id, ref);
|
1895
|
+
request.completedErrorChunks.push(task);
|
1896
|
+
}
|
1897
|
+
});
|
1898
|
+
abortableTasks.clear();
|
1899
|
+
var onAllReady = request.onAllReady;
|
1900
|
+
onAllReady();
|
1901
|
+
}
|
1902
|
+
var abortListeners = request.abortListeners;
|
1903
|
+
if (0 < abortListeners.size) {
|
1904
|
+
var error$23 =
|
1905
|
+
void 0 === reason
|
1906
|
+
? Error("The render was aborted by the server without a reason.")
|
1907
|
+
: "object" === typeof reason &&
|
1908
|
+
null !== reason &&
|
1909
|
+
"function" === typeof reason.then
|
1910
|
+
? Error("The render was aborted by the server with a promise.")
|
1911
|
+
: reason;
|
1912
|
+
abortListeners.forEach(function (callback) {
|
1913
|
+
return callback(error$23);
|
1914
|
+
});
|
1915
|
+
abortListeners.clear();
|
1916
|
+
}
|
1917
|
+
null !== request.destination &&
|
1918
|
+
flushCompletedChunks(request, request.destination);
|
1919
|
+
} catch (error$24) {
|
1920
|
+
logRecoverableError(request, error$24, null), fatalError(request, error$24);
|
1921
|
+
}
|
1922
|
+
}
|
1923
|
+
function resolveServerReference(bundlerConfig, id) {
|
1924
|
+
var name = "",
|
1925
|
+
resolvedModuleData = bundlerConfig[id];
|
1926
|
+
if (resolvedModuleData) name = resolvedModuleData.name;
|
1927
|
+
else {
|
1928
|
+
var idx = id.lastIndexOf("#");
|
1929
|
+
-1 !== idx &&
|
1930
|
+
((name = id.slice(idx + 1)),
|
1931
|
+
(resolvedModuleData = bundlerConfig[id.slice(0, idx)]));
|
1932
|
+
if (!resolvedModuleData)
|
1933
|
+
throw Error(
|
1934
|
+
'Could not find the module "' +
|
1935
|
+
id +
|
1936
|
+
'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'
|
1937
|
+
);
|
1938
|
+
}
|
1939
|
+
return resolvedModuleData.async
|
1940
|
+
? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
|
1941
|
+
: [resolvedModuleData.id, resolvedModuleData.chunks, name];
|
1942
|
+
}
|
1943
|
+
var chunkCache = new Map();
|
1944
|
+
function requireAsyncModule(id) {
|
1945
|
+
var promise = __webpack_require__(id);
|
1946
|
+
if ("function" !== typeof promise.then || "fulfilled" === promise.status)
|
1947
|
+
return null;
|
1948
|
+
promise.then(
|
1949
|
+
function (value) {
|
1950
|
+
promise.status = "fulfilled";
|
1951
|
+
promise.value = value;
|
1952
|
+
},
|
1953
|
+
function (reason) {
|
1954
|
+
promise.status = "rejected";
|
1955
|
+
promise.reason = reason;
|
1956
|
+
}
|
1957
|
+
);
|
1958
|
+
return promise;
|
1959
|
+
}
|
1960
|
+
function ignoreReject() {}
|
1961
|
+
function preloadModule(metadata) {
|
1962
|
+
for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {
|
1963
|
+
var chunkId = chunks[i++],
|
1964
|
+
chunkFilename = chunks[i++],
|
1965
|
+
entry = chunkCache.get(chunkId);
|
1966
|
+
void 0 === entry
|
1967
|
+
? (chunkMap.set(chunkId, chunkFilename),
|
1968
|
+
(chunkFilename = __webpack_chunk_load__(chunkId)),
|
1969
|
+
promises.push(chunkFilename),
|
1970
|
+
(entry = chunkCache.set.bind(chunkCache, chunkId, null)),
|
1971
|
+
chunkFilename.then(entry, ignoreReject),
|
1972
|
+
chunkCache.set(chunkId, chunkFilename))
|
1973
|
+
: null !== entry && promises.push(entry);
|
1974
|
+
}
|
1975
|
+
return 4 === metadata.length
|
1976
|
+
? 0 === promises.length
|
1977
|
+
? requireAsyncModule(metadata[0])
|
1978
|
+
: Promise.all(promises).then(function () {
|
1979
|
+
return requireAsyncModule(metadata[0]);
|
1980
|
+
})
|
1981
|
+
: 0 < promises.length
|
1982
|
+
? Promise.all(promises)
|
1983
|
+
: null;
|
1984
|
+
}
|
1985
|
+
function requireModule(metadata) {
|
1986
|
+
var moduleExports = __webpack_require__(metadata[0]);
|
1987
|
+
if (4 === metadata.length && "function" === typeof moduleExports.then)
|
1988
|
+
if ("fulfilled" === moduleExports.status)
|
1989
|
+
moduleExports = moduleExports.value;
|
1990
|
+
else throw moduleExports.reason;
|
1991
|
+
return "*" === metadata[2]
|
1992
|
+
? moduleExports
|
1993
|
+
: "" === metadata[2]
|
1994
|
+
? moduleExports.__esModule
|
1995
|
+
? moduleExports.default
|
1996
|
+
: moduleExports
|
1997
|
+
: moduleExports[metadata[2]];
|
1998
|
+
}
|
1999
|
+
var chunkMap = new Map(),
|
2000
|
+
webpackGetChunkFilename = __webpack_require__.u;
|
2001
|
+
__webpack_require__.u = function (chunkId) {
|
2002
|
+
var flightChunk = chunkMap.get(chunkId);
|
2003
|
+
return void 0 !== flightChunk
|
2004
|
+
? flightChunk
|
2005
|
+
: webpackGetChunkFilename(chunkId);
|
2006
|
+
};
|
2007
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
2008
|
+
function Chunk(status, value, reason, response) {
|
2009
|
+
this.status = status;
|
2010
|
+
this.value = value;
|
2011
|
+
this.reason = reason;
|
2012
|
+
this._response = response;
|
2013
|
+
}
|
2014
|
+
Chunk.prototype = Object.create(Promise.prototype);
|
2015
|
+
Chunk.prototype.then = function (resolve, reject) {
|
2016
|
+
switch (this.status) {
|
2017
|
+
case "resolved_model":
|
2018
|
+
initializeModelChunk(this);
|
2019
|
+
}
|
2020
|
+
switch (this.status) {
|
2021
|
+
case "fulfilled":
|
2022
|
+
resolve(this.value);
|
2023
|
+
break;
|
2024
|
+
case "pending":
|
2025
|
+
case "blocked":
|
2026
|
+
case "cyclic":
|
2027
|
+
resolve &&
|
2028
|
+
(null === this.value && (this.value = []), this.value.push(resolve));
|
2029
|
+
reject &&
|
2030
|
+
(null === this.reason && (this.reason = []), this.reason.push(reject));
|
2031
|
+
break;
|
2032
|
+
default:
|
2033
|
+
reject(this.reason);
|
2034
|
+
}
|
2035
|
+
};
|
2036
|
+
function createPendingChunk(response) {
|
2037
|
+
return new Chunk("pending", null, null, response);
|
2038
|
+
}
|
2039
|
+
function wakeChunk(listeners, value) {
|
2040
|
+
for (var i = 0; i < listeners.length; i++) (0, listeners[i])(value);
|
2041
|
+
}
|
2042
|
+
function triggerErrorOnChunk(chunk, error) {
|
2043
|
+
if ("pending" !== chunk.status && "blocked" !== chunk.status)
|
2044
|
+
chunk.reason.error(error);
|
2045
|
+
else {
|
2046
|
+
var listeners = chunk.reason;
|
2047
|
+
chunk.status = "rejected";
|
2048
|
+
chunk.reason = error;
|
2049
|
+
null !== listeners && wakeChunk(listeners, error);
|
2050
|
+
}
|
2051
|
+
}
|
2052
|
+
function resolveModelChunk(chunk, value, id) {
|
2053
|
+
if ("pending" !== chunk.status)
|
2054
|
+
(chunk = chunk.reason),
|
2055
|
+
"C" === value[0]
|
2056
|
+
? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
|
2057
|
+
: chunk.enqueueModel(value);
|
2058
|
+
else {
|
2059
|
+
var resolveListeners = chunk.value,
|
2060
|
+
rejectListeners = chunk.reason;
|
2061
|
+
chunk.status = "resolved_model";
|
2062
|
+
chunk.value = value;
|
2063
|
+
chunk.reason = id;
|
2064
|
+
if (null !== resolveListeners)
|
2065
|
+
switch ((initializeModelChunk(chunk), chunk.status)) {
|
2066
|
+
case "fulfilled":
|
2067
|
+
wakeChunk(resolveListeners, chunk.value);
|
2068
|
+
break;
|
2069
|
+
case "pending":
|
2070
|
+
case "blocked":
|
2071
|
+
case "cyclic":
|
2072
|
+
if (chunk.value)
|
2073
|
+
for (value = 0; value < resolveListeners.length; value++)
|
2074
|
+
chunk.value.push(resolveListeners[value]);
|
2075
|
+
else chunk.value = resolveListeners;
|
2076
|
+
if (chunk.reason) {
|
2077
|
+
if (rejectListeners)
|
2078
|
+
for (value = 0; value < rejectListeners.length; value++)
|
2079
|
+
chunk.reason.push(rejectListeners[value]);
|
2080
|
+
} else chunk.reason = rejectListeners;
|
2081
|
+
break;
|
2082
|
+
case "rejected":
|
2083
|
+
rejectListeners && wakeChunk(rejectListeners, chunk.reason);
|
2084
|
+
}
|
2085
|
+
}
|
2086
|
+
}
|
2087
|
+
function createResolvedIteratorResultChunk(response, value, done) {
|
2088
|
+
return new Chunk(
|
2089
|
+
"resolved_model",
|
2090
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
2091
|
+
-1,
|
2092
|
+
response
|
2093
|
+
);
|
2094
|
+
}
|
2095
|
+
function resolveIteratorResultChunk(chunk, value, done) {
|
2096
|
+
resolveModelChunk(
|
2097
|
+
chunk,
|
2098
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
2099
|
+
-1
|
2100
|
+
);
|
2101
|
+
}
|
2102
|
+
function loadServerReference$1(
|
2103
|
+
response,
|
2104
|
+
id,
|
2105
|
+
bound,
|
2106
|
+
parentChunk,
|
2107
|
+
parentObject,
|
2108
|
+
key
|
2109
|
+
) {
|
2110
|
+
var serverReference = resolveServerReference(response._bundlerConfig, id);
|
2111
|
+
id = preloadModule(serverReference);
|
2112
|
+
if (bound)
|
2113
|
+
bound = Promise.all([bound, id]).then(function (_ref) {
|
2114
|
+
_ref = _ref[0];
|
2115
|
+
var fn = requireModule(serverReference);
|
2116
|
+
return fn.bind.apply(fn, [null].concat(_ref));
|
2117
|
+
});
|
2118
|
+
else if (id)
|
2119
|
+
bound = Promise.resolve(id).then(function () {
|
2120
|
+
return requireModule(serverReference);
|
2121
|
+
});
|
2122
|
+
else return requireModule(serverReference);
|
2123
|
+
bound.then(
|
2124
|
+
createModelResolver(
|
2125
|
+
parentChunk,
|
2126
|
+
parentObject,
|
2127
|
+
key,
|
2128
|
+
!1,
|
2129
|
+
response,
|
2130
|
+
createModel,
|
2131
|
+
[]
|
2132
|
+
),
|
2133
|
+
createModelReject(parentChunk)
|
2134
|
+
);
|
2135
|
+
return null;
|
2136
|
+
}
|
2137
|
+
function reviveModel(response, parentObj, parentKey, value, reference) {
|
2138
|
+
if ("string" === typeof value)
|
2139
|
+
return parseModelString(response, parentObj, parentKey, value, reference);
|
2140
|
+
if ("object" === typeof value && null !== value)
|
2141
|
+
if (
|
2142
|
+
(void 0 !== reference &&
|
2143
|
+
void 0 !== response._temporaryReferences &&
|
2144
|
+
response._temporaryReferences.set(value, reference),
|
2145
|
+
Array.isArray(value))
|
2146
|
+
)
|
2147
|
+
for (var i = 0; i < value.length; i++)
|
2148
|
+
value[i] = reviveModel(
|
2149
|
+
response,
|
2150
|
+
value,
|
2151
|
+
"" + i,
|
2152
|
+
value[i],
|
2153
|
+
void 0 !== reference ? reference + ":" + i : void 0
|
2154
|
+
);
|
2155
|
+
else
|
2156
|
+
for (i in value)
|
2157
|
+
hasOwnProperty.call(value, i) &&
|
2158
|
+
((parentObj =
|
2159
|
+
void 0 !== reference && -1 === i.indexOf(":")
|
2160
|
+
? reference + ":" + i
|
2161
|
+
: void 0),
|
2162
|
+
(parentObj = reviveModel(response, value, i, value[i], parentObj)),
|
2163
|
+
void 0 !== parentObj ? (value[i] = parentObj) : delete value[i]);
|
2164
|
+
return value;
|
2165
|
+
}
|
2166
|
+
var initializingChunk = null,
|
2167
|
+
initializingChunkBlockedModel = null;
|
2168
|
+
function initializeModelChunk(chunk) {
|
2169
|
+
var prevChunk = initializingChunk,
|
2170
|
+
prevBlocked = initializingChunkBlockedModel;
|
2171
|
+
initializingChunk = chunk;
|
2172
|
+
initializingChunkBlockedModel = null;
|
2173
|
+
var rootReference = -1 === chunk.reason ? void 0 : chunk.reason.toString(16),
|
2174
|
+
resolvedModel = chunk.value;
|
2175
|
+
chunk.status = "cyclic";
|
2176
|
+
chunk.value = null;
|
2177
|
+
chunk.reason = null;
|
2178
|
+
try {
|
2179
|
+
var rawModel = JSON.parse(resolvedModel),
|
2180
|
+
value = reviveModel(
|
2181
|
+
chunk._response,
|
2182
|
+
{ "": rawModel },
|
2183
|
+
"",
|
2184
|
+
rawModel,
|
2185
|
+
rootReference
|
2186
|
+
);
|
2187
|
+
if (
|
2188
|
+
null !== initializingChunkBlockedModel &&
|
2189
|
+
0 < initializingChunkBlockedModel.deps
|
2190
|
+
)
|
2191
|
+
(initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
|
2192
|
+
else {
|
2193
|
+
var resolveListeners = chunk.value;
|
2194
|
+
chunk.status = "fulfilled";
|
2195
|
+
chunk.value = value;
|
2196
|
+
null !== resolveListeners && wakeChunk(resolveListeners, value);
|
2197
|
+
}
|
2198
|
+
} catch (error) {
|
2199
|
+
(chunk.status = "rejected"), (chunk.reason = error);
|
2200
|
+
} finally {
|
2201
|
+
(initializingChunk = prevChunk),
|
2202
|
+
(initializingChunkBlockedModel = prevBlocked);
|
2203
|
+
}
|
2204
|
+
}
|
2205
|
+
function reportGlobalError(response, error) {
|
2206
|
+
response._chunks.forEach(function (chunk) {
|
2207
|
+
"pending" === chunk.status && triggerErrorOnChunk(chunk, error);
|
2208
|
+
});
|
2209
|
+
}
|
2210
|
+
function getChunk(response, id) {
|
2211
|
+
var chunks = response._chunks,
|
2212
|
+
chunk = chunks.get(id);
|
2213
|
+
chunk ||
|
2214
|
+
((chunk = response._formData.get(response._prefix + id)),
|
2215
|
+
(chunk =
|
2216
|
+
null != chunk
|
2217
|
+
? new Chunk("resolved_model", chunk, id, response)
|
2218
|
+
: createPendingChunk(response)),
|
2219
|
+
chunks.set(id, chunk));
|
2220
|
+
return chunk;
|
2221
|
+
}
|
2222
|
+
function createModelResolver(
|
2223
|
+
chunk,
|
2224
|
+
parentObject,
|
2225
|
+
key,
|
2226
|
+
cyclic,
|
2227
|
+
response,
|
2228
|
+
map,
|
2229
|
+
path
|
2230
|
+
) {
|
2231
|
+
if (initializingChunkBlockedModel) {
|
2232
|
+
var blocked = initializingChunkBlockedModel;
|
2233
|
+
cyclic || blocked.deps++;
|
2234
|
+
} else
|
2235
|
+
blocked = initializingChunkBlockedModel = {
|
2236
|
+
deps: cyclic ? 0 : 1,
|
2237
|
+
value: null
|
2238
|
+
};
|
2239
|
+
return function (value) {
|
2240
|
+
for (var i = 1; i < path.length; i++) value = value[path[i]];
|
2241
|
+
parentObject[key] = map(response, value);
|
2242
|
+
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
|
2243
|
+
blocked.deps--;
|
2244
|
+
0 === blocked.deps &&
|
2245
|
+
"blocked" === chunk.status &&
|
2246
|
+
((value = chunk.value),
|
2247
|
+
(chunk.status = "fulfilled"),
|
2248
|
+
(chunk.value = blocked.value),
|
2249
|
+
null !== value && wakeChunk(value, blocked.value));
|
2250
|
+
};
|
2251
|
+
}
|
2252
|
+
function createModelReject(chunk) {
|
2253
|
+
return function (error) {
|
2254
|
+
return triggerErrorOnChunk(chunk, error);
|
2255
|
+
};
|
2256
|
+
}
|
2257
|
+
function getOutlinedModel(response, reference, parentObject, key, map) {
|
2258
|
+
reference = reference.split(":");
|
2259
|
+
var id = parseInt(reference[0], 16);
|
2260
|
+
id = getChunk(response, id);
|
2261
|
+
switch (id.status) {
|
2262
|
+
case "resolved_model":
|
2263
|
+
initializeModelChunk(id);
|
2264
|
+
}
|
2265
|
+
switch (id.status) {
|
2266
|
+
case "fulfilled":
|
2267
|
+
parentObject = id.value;
|
2268
|
+
for (key = 1; key < reference.length; key++)
|
2269
|
+
parentObject = parentObject[reference[key]];
|
2270
|
+
return map(response, parentObject);
|
2271
|
+
case "pending":
|
2272
|
+
case "blocked":
|
2273
|
+
case "cyclic":
|
2274
|
+
var parentChunk = initializingChunk;
|
2275
|
+
id.then(
|
2276
|
+
createModelResolver(
|
2277
|
+
parentChunk,
|
2278
|
+
parentObject,
|
2279
|
+
key,
|
2280
|
+
"cyclic" === id.status,
|
2281
|
+
response,
|
2282
|
+
map,
|
2283
|
+
reference
|
2284
|
+
),
|
2285
|
+
createModelReject(parentChunk)
|
2286
|
+
);
|
2287
|
+
return null;
|
2288
|
+
default:
|
2289
|
+
throw id.reason;
|
2290
|
+
}
|
2291
|
+
}
|
2292
|
+
function createMap(response, model) {
|
2293
|
+
return new Map(model);
|
2294
|
+
}
|
2295
|
+
function createSet(response, model) {
|
2296
|
+
return new Set(model);
|
2297
|
+
}
|
2298
|
+
function extractIterator(response, model) {
|
2299
|
+
return model[Symbol.iterator]();
|
2300
|
+
}
|
2301
|
+
function createModel(response, model) {
|
2302
|
+
return model;
|
2303
|
+
}
|
2304
|
+
function parseTypedArray(
|
2305
|
+
response,
|
2306
|
+
reference,
|
2307
|
+
constructor,
|
2308
|
+
bytesPerElement,
|
2309
|
+
parentObject,
|
2310
|
+
parentKey
|
2311
|
+
) {
|
2312
|
+
reference = parseInt(reference.slice(2), 16);
|
2313
|
+
reference = response._formData.get(response._prefix + reference);
|
2314
|
+
reference =
|
2315
|
+
constructor === ArrayBuffer
|
2316
|
+
? reference.arrayBuffer()
|
2317
|
+
: reference.arrayBuffer().then(function (buffer) {
|
2318
|
+
return new constructor(buffer);
|
2319
|
+
});
|
2320
|
+
bytesPerElement = initializingChunk;
|
2321
|
+
reference.then(
|
2322
|
+
createModelResolver(
|
2323
|
+
bytesPerElement,
|
2324
|
+
parentObject,
|
2325
|
+
parentKey,
|
2326
|
+
!1,
|
2327
|
+
response,
|
2328
|
+
createModel,
|
2329
|
+
[]
|
2330
|
+
),
|
2331
|
+
createModelReject(bytesPerElement)
|
2332
|
+
);
|
2333
|
+
return null;
|
2334
|
+
}
|
2335
|
+
function resolveStream(response, id, stream, controller) {
|
2336
|
+
var chunks = response._chunks;
|
2337
|
+
stream = new Chunk("fulfilled", stream, controller, response);
|
2338
|
+
chunks.set(id, stream);
|
2339
|
+
response = response._formData.getAll(response._prefix + id);
|
2340
|
+
for (id = 0; id < response.length; id++)
|
2341
|
+
(chunks = response[id]),
|
2342
|
+
"C" === chunks[0]
|
2343
|
+
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
2344
|
+
: controller.enqueueModel(chunks);
|
2345
|
+
}
|
2346
|
+
function parseReadableStream(response, reference, type) {
|
2347
|
+
reference = parseInt(reference.slice(2), 16);
|
2348
|
+
var controller = null;
|
2349
|
+
type = new ReadableStream({
|
2350
|
+
type: type,
|
2351
|
+
start: function (c) {
|
2352
|
+
controller = c;
|
2353
|
+
}
|
2354
|
+
});
|
2355
|
+
var previousBlockedChunk = null;
|
2356
|
+
resolveStream(response, reference, type, {
|
2357
|
+
enqueueModel: function (json) {
|
2358
|
+
if (null === previousBlockedChunk) {
|
2359
|
+
var chunk = new Chunk("resolved_model", json, -1, response);
|
2360
|
+
initializeModelChunk(chunk);
|
2361
|
+
"fulfilled" === chunk.status
|
2362
|
+
? controller.enqueue(chunk.value)
|
2363
|
+
: (chunk.then(
|
2364
|
+
function (v) {
|
2365
|
+
return controller.enqueue(v);
|
2366
|
+
},
|
2367
|
+
function (e) {
|
2368
|
+
return controller.error(e);
|
2369
|
+
}
|
2370
|
+
),
|
2371
|
+
(previousBlockedChunk = chunk));
|
2372
|
+
} else {
|
2373
|
+
chunk = previousBlockedChunk;
|
2374
|
+
var chunk$27 = createPendingChunk(response);
|
2375
|
+
chunk$27.then(
|
2376
|
+
function (v) {
|
2377
|
+
return controller.enqueue(v);
|
2378
|
+
},
|
2379
|
+
function (e) {
|
2380
|
+
return controller.error(e);
|
2381
|
+
}
|
2382
|
+
);
|
2383
|
+
previousBlockedChunk = chunk$27;
|
2384
|
+
chunk.then(function () {
|
2385
|
+
previousBlockedChunk === chunk$27 && (previousBlockedChunk = null);
|
2386
|
+
resolveModelChunk(chunk$27, json, -1);
|
2387
|
+
});
|
2388
|
+
}
|
2389
|
+
},
|
2390
|
+
close: function () {
|
2391
|
+
if (null === previousBlockedChunk) controller.close();
|
2392
|
+
else {
|
2393
|
+
var blockedChunk = previousBlockedChunk;
|
2394
|
+
previousBlockedChunk = null;
|
2395
|
+
blockedChunk.then(function () {
|
2396
|
+
return controller.close();
|
2397
|
+
});
|
2398
|
+
}
|
2399
|
+
},
|
2400
|
+
error: function (error) {
|
2401
|
+
if (null === previousBlockedChunk) controller.error(error);
|
2402
|
+
else {
|
2403
|
+
var blockedChunk = previousBlockedChunk;
|
2404
|
+
previousBlockedChunk = null;
|
2405
|
+
blockedChunk.then(function () {
|
2406
|
+
return controller.error(error);
|
2407
|
+
});
|
2408
|
+
}
|
2409
|
+
}
|
2410
|
+
});
|
2411
|
+
return type;
|
2412
|
+
}
|
2413
|
+
function asyncIterator() {
|
2414
|
+
return this;
|
2415
|
+
}
|
2416
|
+
function createIterator(next) {
|
2417
|
+
next = { next: next };
|
2418
|
+
next[ASYNC_ITERATOR] = asyncIterator;
|
2419
|
+
return next;
|
2420
|
+
}
|
2421
|
+
function parseAsyncIterable(response, reference, iterator) {
|
2422
|
+
reference = parseInt(reference.slice(2), 16);
|
2423
|
+
var buffer = [],
|
2424
|
+
closed = !1,
|
2425
|
+
nextWriteIndex = 0,
|
2426
|
+
$jscomp$compprop2 = {};
|
2427
|
+
$jscomp$compprop2 =
|
2428
|
+
(($jscomp$compprop2[ASYNC_ITERATOR] = function () {
|
2429
|
+
var nextReadIndex = 0;
|
2430
|
+
return createIterator(function (arg) {
|
2431
|
+
if (void 0 !== arg)
|
2432
|
+
throw Error(
|
2433
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
2434
|
+
);
|
2435
|
+
if (nextReadIndex === buffer.length) {
|
2436
|
+
if (closed)
|
2437
|
+
return new Chunk(
|
2438
|
+
"fulfilled",
|
2439
|
+
{ done: !0, value: void 0 },
|
2440
|
+
null,
|
2441
|
+
response
|
2442
|
+
);
|
2443
|
+
buffer[nextReadIndex] = createPendingChunk(response);
|
2444
|
+
}
|
2445
|
+
return buffer[nextReadIndex++];
|
2446
|
+
});
|
2447
|
+
}),
|
2448
|
+
$jscomp$compprop2);
|
2449
|
+
iterator = iterator ? $jscomp$compprop2[ASYNC_ITERATOR]() : $jscomp$compprop2;
|
2450
|
+
resolveStream(response, reference, iterator, {
|
2451
|
+
enqueueModel: function (value) {
|
2452
|
+
nextWriteIndex === buffer.length
|
2453
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2454
|
+
response,
|
2455
|
+
value,
|
2456
|
+
!1
|
2457
|
+
))
|
2458
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !1);
|
2459
|
+
nextWriteIndex++;
|
2460
|
+
},
|
2461
|
+
close: function (value) {
|
2462
|
+
closed = !0;
|
2463
|
+
nextWriteIndex === buffer.length
|
2464
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
2465
|
+
response,
|
2466
|
+
value,
|
2467
|
+
!0
|
2468
|
+
))
|
2469
|
+
: resolveIteratorResultChunk(buffer[nextWriteIndex], value, !0);
|
2470
|
+
for (nextWriteIndex++; nextWriteIndex < buffer.length; )
|
2471
|
+
resolveIteratorResultChunk(
|
2472
|
+
buffer[nextWriteIndex++],
|
2473
|
+
'"$undefined"',
|
2474
|
+
!0
|
2475
|
+
);
|
2476
|
+
},
|
2477
|
+
error: function (error) {
|
2478
|
+
closed = !0;
|
2479
|
+
for (
|
2480
|
+
nextWriteIndex === buffer.length &&
|
2481
|
+
(buffer[nextWriteIndex] = createPendingChunk(response));
|
2482
|
+
nextWriteIndex < buffer.length;
|
2483
|
+
|
2484
|
+
)
|
2485
|
+
triggerErrorOnChunk(buffer[nextWriteIndex++], error);
|
2486
|
+
}
|
2487
|
+
});
|
2488
|
+
return iterator;
|
2489
|
+
}
|
2490
|
+
function parseModelString(response, obj, key, value, reference) {
|
2491
|
+
if ("$" === value[0]) {
|
2492
|
+
switch (value[1]) {
|
2493
|
+
case "$":
|
2494
|
+
return value.slice(1);
|
2495
|
+
case "@":
|
2496
|
+
return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
|
2497
|
+
case "F":
|
2498
|
+
return (
|
2499
|
+
(value = value.slice(2)),
|
2500
|
+
(value = getOutlinedModel(response, value, obj, key, createModel)),
|
2501
|
+
loadServerReference$1(
|
2502
|
+
response,
|
2503
|
+
value.id,
|
2504
|
+
value.bound,
|
2505
|
+
initializingChunk,
|
2506
|
+
obj,
|
2507
|
+
key
|
2508
|
+
)
|
2509
|
+
);
|
2510
|
+
case "T":
|
2511
|
+
if (void 0 === reference || void 0 === response._temporaryReferences)
|
2512
|
+
throw Error(
|
2513
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
2514
|
+
);
|
2515
|
+
return createTemporaryReference(
|
2516
|
+
response._temporaryReferences,
|
2517
|
+
reference
|
2518
|
+
);
|
2519
|
+
case "Q":
|
2520
|
+
return (
|
2521
|
+
(value = value.slice(2)),
|
2522
|
+
getOutlinedModel(response, value, obj, key, createMap)
|
2523
|
+
);
|
2524
|
+
case "W":
|
2525
|
+
return (
|
2526
|
+
(value = value.slice(2)),
|
2527
|
+
getOutlinedModel(response, value, obj, key, createSet)
|
2528
|
+
);
|
2529
|
+
case "K":
|
2530
|
+
obj = value.slice(2);
|
2531
|
+
var formPrefix = response._prefix + obj + "_",
|
2532
|
+
data = new FormData();
|
2533
|
+
response._formData.forEach(function (entry, entryKey) {
|
2534
|
+
entryKey.startsWith(formPrefix) &&
|
2535
|
+
data.append(entryKey.slice(formPrefix.length), entry);
|
2536
|
+
});
|
2537
|
+
return data;
|
2538
|
+
case "i":
|
2539
|
+
return (
|
2540
|
+
(value = value.slice(2)),
|
2541
|
+
getOutlinedModel(response, value, obj, key, extractIterator)
|
2542
|
+
);
|
2543
|
+
case "I":
|
2544
|
+
return Infinity;
|
2545
|
+
case "-":
|
2546
|
+
return "$-0" === value ? -0 : -Infinity;
|
2547
|
+
case "N":
|
2548
|
+
return NaN;
|
2549
|
+
case "u":
|
2550
|
+
return;
|
2551
|
+
case "D":
|
2552
|
+
return new Date(Date.parse(value.slice(2)));
|
2553
|
+
case "n":
|
2554
|
+
return BigInt(value.slice(2));
|
2555
|
+
}
|
2556
|
+
switch (value[1]) {
|
2557
|
+
case "A":
|
2558
|
+
return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
|
2559
|
+
case "O":
|
2560
|
+
return parseTypedArray(response, value, Int8Array, 1, obj, key);
|
2561
|
+
case "o":
|
2562
|
+
return parseTypedArray(response, value, Uint8Array, 1, obj, key);
|
2563
|
+
case "U":
|
2564
|
+
return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);
|
2565
|
+
case "S":
|
2566
|
+
return parseTypedArray(response, value, Int16Array, 2, obj, key);
|
2567
|
+
case "s":
|
2568
|
+
return parseTypedArray(response, value, Uint16Array, 2, obj, key);
|
2569
|
+
case "L":
|
2570
|
+
return parseTypedArray(response, value, Int32Array, 4, obj, key);
|
2571
|
+
case "l":
|
2572
|
+
return parseTypedArray(response, value, Uint32Array, 4, obj, key);
|
2573
|
+
case "G":
|
2574
|
+
return parseTypedArray(response, value, Float32Array, 4, obj, key);
|
2575
|
+
case "g":
|
2576
|
+
return parseTypedArray(response, value, Float64Array, 8, obj, key);
|
2577
|
+
case "M":
|
2578
|
+
return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
|
2579
|
+
case "m":
|
2580
|
+
return parseTypedArray(response, value, BigUint64Array, 8, obj, key);
|
2581
|
+
case "V":
|
2582
|
+
return parseTypedArray(response, value, DataView, 1, obj, key);
|
2583
|
+
case "B":
|
2584
|
+
return (
|
2585
|
+
(obj = parseInt(value.slice(2), 16)),
|
2586
|
+
response._formData.get(response._prefix + obj)
|
2587
|
+
);
|
2588
|
+
}
|
2589
|
+
switch (value[1]) {
|
2590
|
+
case "R":
|
2591
|
+
return parseReadableStream(response, value, void 0);
|
2592
|
+
case "r":
|
2593
|
+
return parseReadableStream(response, value, "bytes");
|
2594
|
+
case "X":
|
2595
|
+
return parseAsyncIterable(response, value, !1);
|
2596
|
+
case "x":
|
2597
|
+
return parseAsyncIterable(response, value, !0);
|
2598
|
+
}
|
2599
|
+
value = value.slice(1);
|
2600
|
+
return getOutlinedModel(response, value, obj, key, createModel);
|
2601
|
+
}
|
2602
|
+
return value;
|
2603
|
+
}
|
2604
|
+
function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
2605
|
+
var backingFormData =
|
2606
|
+
3 < arguments.length && void 0 !== arguments[3]
|
2607
|
+
? arguments[3]
|
2608
|
+
: new FormData(),
|
2609
|
+
chunks = new Map();
|
2610
|
+
return {
|
2611
|
+
_bundlerConfig: bundlerConfig,
|
2612
|
+
_prefix: formFieldPrefix,
|
2613
|
+
_formData: backingFormData,
|
2614
|
+
_chunks: chunks,
|
2615
|
+
_temporaryReferences: temporaryReferences
|
2616
|
+
};
|
2617
|
+
}
|
2618
|
+
function close(response) {
|
2619
|
+
reportGlobalError(response, Error("Connection closed."));
|
2620
|
+
}
|
2621
|
+
function loadServerReference(bundlerConfig, id, bound) {
|
2622
|
+
var serverReference = resolveServerReference(bundlerConfig, id);
|
2623
|
+
bundlerConfig = preloadModule(serverReference);
|
2624
|
+
return bound
|
2625
|
+
? Promise.all([bound, bundlerConfig]).then(function (_ref) {
|
2626
|
+
_ref = _ref[0];
|
2627
|
+
var fn = requireModule(serverReference);
|
2628
|
+
return fn.bind.apply(fn, [null].concat(_ref));
|
2629
|
+
})
|
2630
|
+
: bundlerConfig
|
2631
|
+
? Promise.resolve(bundlerConfig).then(function () {
|
2632
|
+
return requireModule(serverReference);
|
2633
|
+
})
|
2634
|
+
: Promise.resolve(requireModule(serverReference));
|
2635
|
+
}
|
2636
|
+
function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
|
2637
|
+
body = createResponse(serverManifest, formFieldPrefix, void 0, body);
|
2638
|
+
close(body);
|
2639
|
+
body = getChunk(body, 0);
|
2640
|
+
body.then(function () {});
|
2641
|
+
if ("fulfilled" !== body.status) throw body.reason;
|
2642
|
+
return body.value;
|
2643
|
+
}
|
2644
|
+
exports.createClientModuleProxy = function (moduleId) {
|
2645
|
+
moduleId = registerClientReferenceImpl({}, moduleId, !1);
|
2646
|
+
return new Proxy(moduleId, proxyHandlers$1);
|
2647
|
+
};
|
2648
|
+
exports.createTemporaryReferenceSet = function () {
|
2649
|
+
return new WeakMap();
|
2650
|
+
};
|
2651
|
+
exports.decodeAction = function (body, serverManifest) {
|
2652
|
+
var formData = new FormData(),
|
2653
|
+
action = null;
|
2654
|
+
body.forEach(function (value, key) {
|
2655
|
+
key.startsWith("$ACTION_")
|
2656
|
+
? key.startsWith("$ACTION_REF_")
|
2657
|
+
? ((value = "$ACTION_" + key.slice(12) + ":"),
|
2658
|
+
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
2659
|
+
(action = loadServerReference(serverManifest, value.id, value.bound)))
|
2660
|
+
: key.startsWith("$ACTION_ID_") &&
|
2661
|
+
((value = key.slice(11)),
|
2662
|
+
(action = loadServerReference(serverManifest, value, null)))
|
2663
|
+
: formData.append(key, value);
|
2664
|
+
});
|
2665
|
+
return null === action
|
2666
|
+
? null
|
2667
|
+
: action.then(function (fn) {
|
2668
|
+
return fn.bind(null, formData);
|
2669
|
+
});
|
2670
|
+
};
|
2671
|
+
exports.decodeFormState = function (actionResult, body, serverManifest) {
|
2672
|
+
var keyPath = body.get("$ACTION_KEY");
|
2673
|
+
if ("string" !== typeof keyPath) return Promise.resolve(null);
|
2674
|
+
var metaData = null;
|
2675
|
+
body.forEach(function (value, key) {
|
2676
|
+
key.startsWith("$ACTION_REF_") &&
|
2677
|
+
((value = "$ACTION_" + key.slice(12) + ":"),
|
2678
|
+
(metaData = decodeBoundActionMetaData(body, serverManifest, value)));
|
2679
|
+
});
|
2680
|
+
if (null === metaData) return Promise.resolve(null);
|
2681
|
+
var referenceId = metaData.id;
|
2682
|
+
return Promise.resolve(metaData.bound).then(function (bound) {
|
2683
|
+
return null === bound
|
2684
|
+
? null
|
2685
|
+
: [actionResult, keyPath, referenceId, bound.length - 1];
|
2686
|
+
});
|
2687
|
+
};
|
2688
|
+
exports.decodeReply = function (body, webpackMap, options) {
|
2689
|
+
if ("string" === typeof body) {
|
2690
|
+
var form = new FormData();
|
2691
|
+
form.append("0", body);
|
2692
|
+
body = form;
|
2693
|
+
}
|
2694
|
+
body = createResponse(
|
2695
|
+
webpackMap,
|
2696
|
+
"",
|
2697
|
+
options ? options.temporaryReferences : void 0,
|
2698
|
+
body
|
2699
|
+
);
|
2700
|
+
webpackMap = getChunk(body, 0);
|
2701
|
+
close(body);
|
2702
|
+
return webpackMap;
|
2703
|
+
};
|
2704
|
+
exports.registerClientReference = function (
|
2705
|
+
proxyImplementation,
|
2706
|
+
id,
|
2707
|
+
exportName
|
2708
|
+
) {
|
2709
|
+
return registerClientReferenceImpl(
|
2710
|
+
proxyImplementation,
|
2711
|
+
id + "#" + exportName,
|
2712
|
+
!1
|
2713
|
+
);
|
2714
|
+
};
|
2715
|
+
exports.registerServerReference = function (reference, id, exportName) {
|
2716
|
+
return Object.defineProperties(reference, {
|
2717
|
+
$$typeof: { value: SERVER_REFERENCE_TAG },
|
2718
|
+
$$id: {
|
2719
|
+
value: null === exportName ? id : id + "#" + exportName,
|
2720
|
+
configurable: !0
|
2721
|
+
},
|
2722
|
+
$$bound: { value: null, configurable: !0 },
|
2723
|
+
bind: { value: bind, configurable: !0 }
|
2724
|
+
});
|
2725
|
+
};
|
2726
|
+
exports.renderToReadableStream = function (model, webpackMap, options) {
|
2727
|
+
var request = new RequestInstance(
|
2728
|
+
20,
|
2729
|
+
model,
|
2730
|
+
webpackMap,
|
2731
|
+
options ? options.onError : void 0,
|
2732
|
+
options ? options.identifierPrefix : void 0,
|
2733
|
+
options ? options.onPostpone : void 0,
|
2734
|
+
options ? options.temporaryReferences : void 0,
|
2735
|
+
void 0,
|
2736
|
+
void 0,
|
2737
|
+
noop,
|
2738
|
+
noop
|
2739
|
+
);
|
2740
|
+
if (options && options.signal) {
|
2741
|
+
var signal = options.signal;
|
2742
|
+
if (signal.aborted) abort(request, signal.reason);
|
2743
|
+
else {
|
2744
|
+
var listener = function () {
|
2745
|
+
abort(request, signal.reason);
|
2746
|
+
signal.removeEventListener("abort", listener);
|
2747
|
+
};
|
2748
|
+
signal.addEventListener("abort", listener);
|
2749
|
+
}
|
2750
|
+
}
|
2751
|
+
return new ReadableStream(
|
2752
|
+
{
|
2753
|
+
type: "bytes",
|
2754
|
+
start: function () {
|
2755
|
+
startWork(request);
|
2756
|
+
},
|
2757
|
+
pull: function (controller) {
|
2758
|
+
if (13 === request.status)
|
2759
|
+
(request.status = 14), closeWithError(controller, request.fatalError);
|
2760
|
+
else if (14 !== request.status && null === request.destination) {
|
2761
|
+
request.destination = controller;
|
2762
|
+
try {
|
2763
|
+
flushCompletedChunks(request, controller);
|
2764
|
+
} catch (error) {
|
2765
|
+
logRecoverableError(request, error, null),
|
2766
|
+
fatalError(request, error);
|
2767
|
+
}
|
2768
|
+
}
|
2769
|
+
},
|
2770
|
+
cancel: function (reason) {
|
2771
|
+
request.destination = null;
|
2772
|
+
abort(request, reason);
|
2773
|
+
}
|
2774
|
+
},
|
2775
|
+
{ highWaterMark: 0 }
|
2776
|
+
);
|
2777
|
+
};
|