react-server-dom-rspack 0.0.1-alpha.1 → 0.0.1-alpha.3
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/client.browser.d.ts +23 -0
- package/dist/client.browser.js +41 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.edge.d.ts +28 -0
- package/dist/client.edge.js +27 -0
- package/dist/client.js +1 -0
- package/dist/client.node.d.ts +11 -0
- package/dist/client.node.js +10 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +2 -0
- package/dist/server.browser.d.ts +0 -0
- package/dist/server.browser.js +2 -0
- package/dist/server.d.ts +0 -0
- package/dist/server.edge.d.ts +29 -0
- package/dist/server.edge.js +44 -0
- package/dist/server.js +3 -0
- package/dist/server.node.d.ts +30 -0
- package/dist/server.node.js +48 -0
- package/dist/types.d.ts +41 -0
- package/dist/types.js +1 -0
- package/package.json +122 -12
- package/vendor/react-server-dom-webpack/LICENSE +21 -0
- package/vendor/react-server-dom-webpack/README.md +5 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +5006 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +1947 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +4987 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +2128 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +5130 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +2256 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-node-register.js +69 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-plugin.js +404 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +5515 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +3264 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +5617 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +3299 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +6403 -0
- package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +3517 -0
- package/vendor/react-server-dom-webpack/client.browser.js +7 -0
- package/vendor/react-server-dom-webpack/client.edge.js +7 -0
- package/vendor/react-server-dom-webpack/client.js +3 -0
- package/vendor/react-server-dom-webpack/client.node.js +7 -0
- package/vendor/react-server-dom-webpack/esm/package.json +3 -0
- package/vendor/react-server-dom-webpack/esm/react-server-dom-webpack-node-loader.production.js +515 -0
- package/vendor/react-server-dom-webpack/index.js +12 -0
- package/vendor/react-server-dom-webpack/node-register.js +3 -0
- package/vendor/react-server-dom-webpack/package.json +96 -0
- package/vendor/react-server-dom-webpack/plugin.js +3 -0
- package/vendor/react-server-dom-webpack/server.browser.js +17 -0
- package/vendor/react-server-dom-webpack/server.edge.js +18 -0
- package/vendor/react-server-dom-webpack/server.js +6 -0
- package/vendor/react-server-dom-webpack/server.node.js +20 -0
- package/vendor/react-server-dom-webpack/static.browser.js +10 -0
- package/vendor/react-server-dom-webpack/static.edge.js +10 -0
- package/vendor/react-server-dom-webpack/static.js +6 -0
- package/vendor/react-server-dom-webpack/static.node.js +11 -0
- package/dist/client.mjs +0 -19
- package/dist/server.mjs +0 -11
package/vendor/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js
ADDED
|
@@ -0,0 +1,3517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-server-dom-webpack-server.node.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 stream = require("stream"),
|
|
13
|
+
util = require("util");
|
|
14
|
+
require("crypto");
|
|
15
|
+
var async_hooks = require("async_hooks"),
|
|
16
|
+
ReactDOM = require("react-dom"),
|
|
17
|
+
React = require("react"),
|
|
18
|
+
REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"),
|
|
19
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
20
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
21
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
22
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
23
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
24
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
25
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
26
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
27
|
+
REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
28
|
+
Symbol.for("react.postpone");
|
|
29
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
30
|
+
function getIteratorFn(maybeIterable) {
|
|
31
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
32
|
+
maybeIterable =
|
|
33
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|
34
|
+
maybeIterable["@@iterator"];
|
|
35
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
36
|
+
}
|
|
37
|
+
var ASYNC_ITERATOR = Symbol.asyncIterator,
|
|
38
|
+
scheduleMicrotask = queueMicrotask,
|
|
39
|
+
currentView = null,
|
|
40
|
+
writtenBytes = 0,
|
|
41
|
+
destinationHasCapacity = !0;
|
|
42
|
+
function writeToDestination(destination, view) {
|
|
43
|
+
destination = destination.write(view);
|
|
44
|
+
destinationHasCapacity = destinationHasCapacity && destination;
|
|
45
|
+
}
|
|
46
|
+
function writeChunkAndReturn(destination, chunk) {
|
|
47
|
+
if ("string" === typeof chunk) {
|
|
48
|
+
if (0 !== chunk.length)
|
|
49
|
+
if (2048 < 3 * chunk.length)
|
|
50
|
+
0 < writtenBytes &&
|
|
51
|
+
(writeToDestination(
|
|
52
|
+
destination,
|
|
53
|
+
currentView.subarray(0, writtenBytes)
|
|
54
|
+
),
|
|
55
|
+
(currentView = new Uint8Array(2048)),
|
|
56
|
+
(writtenBytes = 0)),
|
|
57
|
+
writeToDestination(destination, chunk);
|
|
58
|
+
else {
|
|
59
|
+
var target = currentView;
|
|
60
|
+
0 < writtenBytes && (target = currentView.subarray(writtenBytes));
|
|
61
|
+
target = textEncoder.encodeInto(chunk, target);
|
|
62
|
+
var read = target.read;
|
|
63
|
+
writtenBytes += target.written;
|
|
64
|
+
read < chunk.length &&
|
|
65
|
+
(writeToDestination(
|
|
66
|
+
destination,
|
|
67
|
+
currentView.subarray(0, writtenBytes)
|
|
68
|
+
),
|
|
69
|
+
(currentView = new Uint8Array(2048)),
|
|
70
|
+
(writtenBytes = textEncoder.encodeInto(
|
|
71
|
+
chunk.slice(read),
|
|
72
|
+
currentView
|
|
73
|
+
).written));
|
|
74
|
+
2048 === writtenBytes &&
|
|
75
|
+
(writeToDestination(destination, currentView),
|
|
76
|
+
(currentView = new Uint8Array(2048)),
|
|
77
|
+
(writtenBytes = 0));
|
|
78
|
+
}
|
|
79
|
+
} else
|
|
80
|
+
0 !== chunk.byteLength &&
|
|
81
|
+
(2048 < chunk.byteLength
|
|
82
|
+
? (0 < writtenBytes &&
|
|
83
|
+
(writeToDestination(
|
|
84
|
+
destination,
|
|
85
|
+
currentView.subarray(0, writtenBytes)
|
|
86
|
+
),
|
|
87
|
+
(currentView = new Uint8Array(2048)),
|
|
88
|
+
(writtenBytes = 0)),
|
|
89
|
+
writeToDestination(destination, chunk))
|
|
90
|
+
: ((target = currentView.length - writtenBytes),
|
|
91
|
+
target < chunk.byteLength &&
|
|
92
|
+
(0 === target
|
|
93
|
+
? writeToDestination(destination, currentView)
|
|
94
|
+
: (currentView.set(chunk.subarray(0, target), writtenBytes),
|
|
95
|
+
(writtenBytes += target),
|
|
96
|
+
writeToDestination(destination, currentView),
|
|
97
|
+
(chunk = chunk.subarray(target))),
|
|
98
|
+
(currentView = new Uint8Array(2048)),
|
|
99
|
+
(writtenBytes = 0)),
|
|
100
|
+
currentView.set(chunk, writtenBytes),
|
|
101
|
+
(writtenBytes += chunk.byteLength),
|
|
102
|
+
2048 === writtenBytes &&
|
|
103
|
+
(writeToDestination(destination, currentView),
|
|
104
|
+
(currentView = new Uint8Array(2048)),
|
|
105
|
+
(writtenBytes = 0))));
|
|
106
|
+
return destinationHasCapacity;
|
|
107
|
+
}
|
|
108
|
+
var textEncoder = new util.TextEncoder();
|
|
109
|
+
function byteLengthOfChunk(chunk) {
|
|
110
|
+
return "string" === typeof chunk
|
|
111
|
+
? Buffer.byteLength(chunk, "utf8")
|
|
112
|
+
: chunk.byteLength;
|
|
113
|
+
}
|
|
114
|
+
var CLIENT_REFERENCE_TAG$1 = Symbol.for("react.client.reference"),
|
|
115
|
+
SERVER_REFERENCE_TAG = Symbol.for("react.server.reference");
|
|
116
|
+
function registerClientReferenceImpl(proxyImplementation, id, async) {
|
|
117
|
+
return Object.defineProperties(proxyImplementation, {
|
|
118
|
+
$$typeof: { value: CLIENT_REFERENCE_TAG$1 },
|
|
119
|
+
$$id: { value: id },
|
|
120
|
+
$$async: { value: async }
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
var FunctionBind = Function.prototype.bind,
|
|
124
|
+
ArraySlice = Array.prototype.slice;
|
|
125
|
+
function bind() {
|
|
126
|
+
var newFn = FunctionBind.apply(this, arguments);
|
|
127
|
+
if (this.$$typeof === SERVER_REFERENCE_TAG) {
|
|
128
|
+
var args = ArraySlice.call(arguments, 1),
|
|
129
|
+
$$typeof = { value: SERVER_REFERENCE_TAG },
|
|
130
|
+
$$id = { value: this.$$id };
|
|
131
|
+
args = { value: this.$$bound ? this.$$bound.concat(args) : args };
|
|
132
|
+
return Object.defineProperties(newFn, {
|
|
133
|
+
$$typeof: $$typeof,
|
|
134
|
+
$$id: $$id,
|
|
135
|
+
$$bound: args,
|
|
136
|
+
bind: { value: bind, configurable: !0 }
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return newFn;
|
|
140
|
+
}
|
|
141
|
+
var serverReferenceToString = {
|
|
142
|
+
value: function () {
|
|
143
|
+
return "function () { [omitted code] }";
|
|
144
|
+
},
|
|
145
|
+
configurable: !0,
|
|
146
|
+
writable: !0
|
|
147
|
+
},
|
|
148
|
+
PROMISE_PROTOTYPE = Promise.prototype,
|
|
149
|
+
deepProxyHandlers = {
|
|
150
|
+
get: function (target, name) {
|
|
151
|
+
switch (name) {
|
|
152
|
+
case "$$typeof":
|
|
153
|
+
return target.$$typeof;
|
|
154
|
+
case "$$id":
|
|
155
|
+
return target.$$id;
|
|
156
|
+
case "$$async":
|
|
157
|
+
return target.$$async;
|
|
158
|
+
case "name":
|
|
159
|
+
return target.name;
|
|
160
|
+
case "displayName":
|
|
161
|
+
return;
|
|
162
|
+
case "defaultProps":
|
|
163
|
+
return;
|
|
164
|
+
case "_debugInfo":
|
|
165
|
+
return;
|
|
166
|
+
case "toJSON":
|
|
167
|
+
return;
|
|
168
|
+
case Symbol.toPrimitive:
|
|
169
|
+
return Object.prototype[Symbol.toPrimitive];
|
|
170
|
+
case Symbol.toStringTag:
|
|
171
|
+
return Object.prototype[Symbol.toStringTag];
|
|
172
|
+
case "Provider":
|
|
173
|
+
throw Error(
|
|
174
|
+
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
|
175
|
+
);
|
|
176
|
+
case "then":
|
|
177
|
+
throw Error(
|
|
178
|
+
"Cannot await or return from a thenable. You cannot await a client module from a server component."
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
throw Error(
|
|
182
|
+
"Cannot access " +
|
|
183
|
+
(String(target.name) + "." + String(name)) +
|
|
184
|
+
" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through."
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
set: function () {
|
|
188
|
+
throw Error("Cannot assign to a client module from a server module.");
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
function getReference(target, name) {
|
|
192
|
+
switch (name) {
|
|
193
|
+
case "$$typeof":
|
|
194
|
+
return target.$$typeof;
|
|
195
|
+
case "$$id":
|
|
196
|
+
return target.$$id;
|
|
197
|
+
case "$$async":
|
|
198
|
+
return target.$$async;
|
|
199
|
+
case "name":
|
|
200
|
+
return target.name;
|
|
201
|
+
case "defaultProps":
|
|
202
|
+
return;
|
|
203
|
+
case "_debugInfo":
|
|
204
|
+
return;
|
|
205
|
+
case "toJSON":
|
|
206
|
+
return;
|
|
207
|
+
case Symbol.toPrimitive:
|
|
208
|
+
return Object.prototype[Symbol.toPrimitive];
|
|
209
|
+
case Symbol.toStringTag:
|
|
210
|
+
return Object.prototype[Symbol.toStringTag];
|
|
211
|
+
case "__esModule":
|
|
212
|
+
var moduleId = target.$$id;
|
|
213
|
+
target.default = registerClientReferenceImpl(
|
|
214
|
+
function () {
|
|
215
|
+
throw Error(
|
|
216
|
+
"Attempted to call the default export of " +
|
|
217
|
+
moduleId +
|
|
218
|
+
" 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."
|
|
219
|
+
);
|
|
220
|
+
},
|
|
221
|
+
target.$$id + "#",
|
|
222
|
+
target.$$async
|
|
223
|
+
);
|
|
224
|
+
return !0;
|
|
225
|
+
case "then":
|
|
226
|
+
if (target.then) return target.then;
|
|
227
|
+
if (target.$$async) return;
|
|
228
|
+
var clientReference = registerClientReferenceImpl({}, target.$$id, !0),
|
|
229
|
+
proxy = new Proxy(clientReference, proxyHandlers$1);
|
|
230
|
+
target.status = "fulfilled";
|
|
231
|
+
target.value = proxy;
|
|
232
|
+
return (target.then = registerClientReferenceImpl(
|
|
233
|
+
function (resolve) {
|
|
234
|
+
return Promise.resolve(resolve(proxy));
|
|
235
|
+
},
|
|
236
|
+
target.$$id + "#then",
|
|
237
|
+
!1
|
|
238
|
+
));
|
|
239
|
+
}
|
|
240
|
+
if ("symbol" === typeof name)
|
|
241
|
+
throw Error(
|
|
242
|
+
"Cannot read Symbol exports. Only named exports are supported on a client module imported on the server."
|
|
243
|
+
);
|
|
244
|
+
clientReference = target[name];
|
|
245
|
+
clientReference ||
|
|
246
|
+
((clientReference = registerClientReferenceImpl(
|
|
247
|
+
function () {
|
|
248
|
+
throw Error(
|
|
249
|
+
"Attempted to call " +
|
|
250
|
+
String(name) +
|
|
251
|
+
"() from the server but " +
|
|
252
|
+
String(name) +
|
|
253
|
+
" 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."
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
target.$$id + "#" + name,
|
|
257
|
+
target.$$async
|
|
258
|
+
)),
|
|
259
|
+
Object.defineProperty(clientReference, "name", { value: name }),
|
|
260
|
+
(clientReference = target[name] =
|
|
261
|
+
new Proxy(clientReference, deepProxyHandlers)));
|
|
262
|
+
return clientReference;
|
|
263
|
+
}
|
|
264
|
+
var proxyHandlers$1 = {
|
|
265
|
+
get: function (target, name) {
|
|
266
|
+
return getReference(target, name);
|
|
267
|
+
},
|
|
268
|
+
getOwnPropertyDescriptor: function (target, name) {
|
|
269
|
+
var descriptor = Object.getOwnPropertyDescriptor(target, name);
|
|
270
|
+
descriptor ||
|
|
271
|
+
((descriptor = {
|
|
272
|
+
value: getReference(target, name),
|
|
273
|
+
writable: !1,
|
|
274
|
+
configurable: !1,
|
|
275
|
+
enumerable: !1
|
|
276
|
+
}),
|
|
277
|
+
Object.defineProperty(target, name, descriptor));
|
|
278
|
+
return descriptor;
|
|
279
|
+
},
|
|
280
|
+
getPrototypeOf: function () {
|
|
281
|
+
return PROMISE_PROTOTYPE;
|
|
282
|
+
},
|
|
283
|
+
set: function () {
|
|
284
|
+
throw Error("Cannot assign to a client module from a server module.");
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
ReactDOMSharedInternals =
|
|
288
|
+
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
289
|
+
previousDispatcher = ReactDOMSharedInternals.d;
|
|
290
|
+
ReactDOMSharedInternals.d = {
|
|
291
|
+
f: previousDispatcher.f,
|
|
292
|
+
r: previousDispatcher.r,
|
|
293
|
+
D: prefetchDNS,
|
|
294
|
+
C: preconnect,
|
|
295
|
+
L: preload,
|
|
296
|
+
m: preloadModule$1,
|
|
297
|
+
X: preinitScript,
|
|
298
|
+
S: preinitStyle,
|
|
299
|
+
M: preinitModuleScript
|
|
300
|
+
};
|
|
301
|
+
function prefetchDNS(href) {
|
|
302
|
+
if ("string" === typeof href && href) {
|
|
303
|
+
var request = resolveRequest();
|
|
304
|
+
if (request) {
|
|
305
|
+
var hints = request.hints,
|
|
306
|
+
key = "D|" + href;
|
|
307
|
+
hints.has(key) || (hints.add(key), emitHint(request, "D", href));
|
|
308
|
+
} else previousDispatcher.D(href);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function preconnect(href, crossOrigin) {
|
|
312
|
+
if ("string" === typeof href) {
|
|
313
|
+
var request = resolveRequest();
|
|
314
|
+
if (request) {
|
|
315
|
+
var hints = request.hints,
|
|
316
|
+
key = "C|" + (null == crossOrigin ? "null" : crossOrigin) + "|" + href;
|
|
317
|
+
hints.has(key) ||
|
|
318
|
+
(hints.add(key),
|
|
319
|
+
"string" === typeof crossOrigin
|
|
320
|
+
? emitHint(request, "C", [href, crossOrigin])
|
|
321
|
+
: emitHint(request, "C", href));
|
|
322
|
+
} else previousDispatcher.C(href, crossOrigin);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
function preload(href, as, options) {
|
|
326
|
+
if ("string" === typeof href) {
|
|
327
|
+
var request = resolveRequest();
|
|
328
|
+
if (request) {
|
|
329
|
+
var hints = request.hints,
|
|
330
|
+
key = "L";
|
|
331
|
+
if ("image" === as && options) {
|
|
332
|
+
var imageSrcSet = options.imageSrcSet,
|
|
333
|
+
imageSizes = options.imageSizes,
|
|
334
|
+
uniquePart = "";
|
|
335
|
+
"string" === typeof imageSrcSet && "" !== imageSrcSet
|
|
336
|
+
? ((uniquePart += "[" + imageSrcSet + "]"),
|
|
337
|
+
"string" === typeof imageSizes &&
|
|
338
|
+
(uniquePart += "[" + imageSizes + "]"))
|
|
339
|
+
: (uniquePart += "[][]" + href);
|
|
340
|
+
key += "[image]" + uniquePart;
|
|
341
|
+
} else key += "[" + as + "]" + href;
|
|
342
|
+
hints.has(key) ||
|
|
343
|
+
(hints.add(key),
|
|
344
|
+
(options = trimOptions(options))
|
|
345
|
+
? emitHint(request, "L", [href, as, options])
|
|
346
|
+
: emitHint(request, "L", [href, as]));
|
|
347
|
+
} else previousDispatcher.L(href, as, options);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
function preloadModule$1(href, options) {
|
|
351
|
+
if ("string" === typeof href) {
|
|
352
|
+
var request = resolveRequest();
|
|
353
|
+
if (request) {
|
|
354
|
+
var hints = request.hints,
|
|
355
|
+
key = "m|" + href;
|
|
356
|
+
if (hints.has(key)) return;
|
|
357
|
+
hints.add(key);
|
|
358
|
+
return (options = trimOptions(options))
|
|
359
|
+
? emitHint(request, "m", [href, options])
|
|
360
|
+
: emitHint(request, "m", href);
|
|
361
|
+
}
|
|
362
|
+
previousDispatcher.m(href, options);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function preinitStyle(href, precedence, options) {
|
|
366
|
+
if ("string" === typeof href) {
|
|
367
|
+
var request = resolveRequest();
|
|
368
|
+
if (request) {
|
|
369
|
+
var hints = request.hints,
|
|
370
|
+
key = "S|" + href;
|
|
371
|
+
if (hints.has(key)) return;
|
|
372
|
+
hints.add(key);
|
|
373
|
+
return (options = trimOptions(options))
|
|
374
|
+
? emitHint(request, "S", [
|
|
375
|
+
href,
|
|
376
|
+
"string" === typeof precedence ? precedence : 0,
|
|
377
|
+
options
|
|
378
|
+
])
|
|
379
|
+
: "string" === typeof precedence
|
|
380
|
+
? emitHint(request, "S", [href, precedence])
|
|
381
|
+
: emitHint(request, "S", href);
|
|
382
|
+
}
|
|
383
|
+
previousDispatcher.S(href, precedence, options);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function preinitScript(src, options) {
|
|
387
|
+
if ("string" === typeof src) {
|
|
388
|
+
var request = resolveRequest();
|
|
389
|
+
if (request) {
|
|
390
|
+
var hints = request.hints,
|
|
391
|
+
key = "X|" + src;
|
|
392
|
+
if (hints.has(key)) return;
|
|
393
|
+
hints.add(key);
|
|
394
|
+
return (options = trimOptions(options))
|
|
395
|
+
? emitHint(request, "X", [src, options])
|
|
396
|
+
: emitHint(request, "X", src);
|
|
397
|
+
}
|
|
398
|
+
previousDispatcher.X(src, options);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function preinitModuleScript(src, options) {
|
|
402
|
+
if ("string" === typeof src) {
|
|
403
|
+
var request = resolveRequest();
|
|
404
|
+
if (request) {
|
|
405
|
+
var hints = request.hints,
|
|
406
|
+
key = "M|" + src;
|
|
407
|
+
if (hints.has(key)) return;
|
|
408
|
+
hints.add(key);
|
|
409
|
+
return (options = trimOptions(options))
|
|
410
|
+
? emitHint(request, "M", [src, options])
|
|
411
|
+
: emitHint(request, "M", src);
|
|
412
|
+
}
|
|
413
|
+
previousDispatcher.M(src, options);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function trimOptions(options) {
|
|
417
|
+
if (null == options) return null;
|
|
418
|
+
var hasProperties = !1,
|
|
419
|
+
trimmed = {},
|
|
420
|
+
key;
|
|
421
|
+
for (key in options)
|
|
422
|
+
null != options[key] &&
|
|
423
|
+
((hasProperties = !0), (trimmed[key] = options[key]));
|
|
424
|
+
return hasProperties ? trimmed : null;
|
|
425
|
+
}
|
|
426
|
+
function getChildFormatContext(parentContext, type, props) {
|
|
427
|
+
switch (type) {
|
|
428
|
+
case "img":
|
|
429
|
+
type = props.src;
|
|
430
|
+
var srcSet = props.srcSet;
|
|
431
|
+
if (
|
|
432
|
+
!(
|
|
433
|
+
"lazy" === props.loading ||
|
|
434
|
+
(!type && !srcSet) ||
|
|
435
|
+
("string" !== typeof type && null != type) ||
|
|
436
|
+
("string" !== typeof srcSet && null != srcSet) ||
|
|
437
|
+
"low" === props.fetchPriority ||
|
|
438
|
+
parentContext & 3
|
|
439
|
+
) &&
|
|
440
|
+
("string" !== typeof type ||
|
|
441
|
+
":" !== type[4] ||
|
|
442
|
+
("d" !== type[0] && "D" !== type[0]) ||
|
|
443
|
+
("a" !== type[1] && "A" !== type[1]) ||
|
|
444
|
+
("t" !== type[2] && "T" !== type[2]) ||
|
|
445
|
+
("a" !== type[3] && "A" !== type[3])) &&
|
|
446
|
+
("string" !== typeof srcSet ||
|
|
447
|
+
":" !== srcSet[4] ||
|
|
448
|
+
("d" !== srcSet[0] && "D" !== srcSet[0]) ||
|
|
449
|
+
("a" !== srcSet[1] && "A" !== srcSet[1]) ||
|
|
450
|
+
("t" !== srcSet[2] && "T" !== srcSet[2]) ||
|
|
451
|
+
("a" !== srcSet[3] && "A" !== srcSet[3]))
|
|
452
|
+
) {
|
|
453
|
+
var sizes = "string" === typeof props.sizes ? props.sizes : void 0;
|
|
454
|
+
var input = props.crossOrigin;
|
|
455
|
+
preload(type || "", "image", {
|
|
456
|
+
imageSrcSet: srcSet,
|
|
457
|
+
imageSizes: sizes,
|
|
458
|
+
crossOrigin:
|
|
459
|
+
"string" === typeof input
|
|
460
|
+
? "use-credentials" === input
|
|
461
|
+
? input
|
|
462
|
+
: ""
|
|
463
|
+
: void 0,
|
|
464
|
+
integrity: props.integrity,
|
|
465
|
+
type: props.type,
|
|
466
|
+
fetchPriority: props.fetchPriority,
|
|
467
|
+
referrerPolicy: props.referrerPolicy
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
return parentContext;
|
|
471
|
+
case "link":
|
|
472
|
+
type = props.rel;
|
|
473
|
+
srcSet = props.href;
|
|
474
|
+
if (
|
|
475
|
+
!(
|
|
476
|
+
parentContext & 1 ||
|
|
477
|
+
null != props.itemProp ||
|
|
478
|
+
"string" !== typeof type ||
|
|
479
|
+
"string" !== typeof srcSet ||
|
|
480
|
+
"" === srcSet
|
|
481
|
+
)
|
|
482
|
+
)
|
|
483
|
+
switch (type) {
|
|
484
|
+
case "preload":
|
|
485
|
+
preload(srcSet, props.as, {
|
|
486
|
+
crossOrigin: props.crossOrigin,
|
|
487
|
+
integrity: props.integrity,
|
|
488
|
+
nonce: props.nonce,
|
|
489
|
+
type: props.type,
|
|
490
|
+
fetchPriority: props.fetchPriority,
|
|
491
|
+
referrerPolicy: props.referrerPolicy,
|
|
492
|
+
imageSrcSet: props.imageSrcSet,
|
|
493
|
+
imageSizes: props.imageSizes,
|
|
494
|
+
media: props.media
|
|
495
|
+
});
|
|
496
|
+
break;
|
|
497
|
+
case "modulepreload":
|
|
498
|
+
preloadModule$1(srcSet, {
|
|
499
|
+
as: props.as,
|
|
500
|
+
crossOrigin: props.crossOrigin,
|
|
501
|
+
integrity: props.integrity,
|
|
502
|
+
nonce: props.nonce
|
|
503
|
+
});
|
|
504
|
+
break;
|
|
505
|
+
case "stylesheet":
|
|
506
|
+
preload(srcSet, "stylesheet", {
|
|
507
|
+
crossOrigin: props.crossOrigin,
|
|
508
|
+
integrity: props.integrity,
|
|
509
|
+
nonce: props.nonce,
|
|
510
|
+
type: props.type,
|
|
511
|
+
fetchPriority: props.fetchPriority,
|
|
512
|
+
referrerPolicy: props.referrerPolicy,
|
|
513
|
+
media: props.media
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
return parentContext;
|
|
517
|
+
case "picture":
|
|
518
|
+
return parentContext | 2;
|
|
519
|
+
case "noscript":
|
|
520
|
+
return parentContext | 1;
|
|
521
|
+
default:
|
|
522
|
+
return parentContext;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
var requestStorage = new async_hooks.AsyncLocalStorage(),
|
|
526
|
+
TEMPORARY_REFERENCE_TAG = Symbol.for("react.temporary.reference"),
|
|
527
|
+
proxyHandlers = {
|
|
528
|
+
get: function (target, name) {
|
|
529
|
+
switch (name) {
|
|
530
|
+
case "$$typeof":
|
|
531
|
+
return target.$$typeof;
|
|
532
|
+
case "name":
|
|
533
|
+
return;
|
|
534
|
+
case "displayName":
|
|
535
|
+
return;
|
|
536
|
+
case "defaultProps":
|
|
537
|
+
return;
|
|
538
|
+
case "_debugInfo":
|
|
539
|
+
return;
|
|
540
|
+
case "toJSON":
|
|
541
|
+
return;
|
|
542
|
+
case Symbol.toPrimitive:
|
|
543
|
+
return Object.prototype[Symbol.toPrimitive];
|
|
544
|
+
case Symbol.toStringTag:
|
|
545
|
+
return Object.prototype[Symbol.toStringTag];
|
|
546
|
+
case "Provider":
|
|
547
|
+
throw Error(
|
|
548
|
+
"Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider."
|
|
549
|
+
);
|
|
550
|
+
case "then":
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
throw Error(
|
|
554
|
+
"Cannot access " +
|
|
555
|
+
String(name) +
|
|
556
|
+
" 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."
|
|
557
|
+
);
|
|
558
|
+
},
|
|
559
|
+
set: function () {
|
|
560
|
+
throw Error(
|
|
561
|
+
"Cannot assign to a temporary client reference from a server module."
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
function createTemporaryReference(temporaryReferences, id) {
|
|
566
|
+
var reference = Object.defineProperties(
|
|
567
|
+
function () {
|
|
568
|
+
throw Error(
|
|
569
|
+
"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."
|
|
570
|
+
);
|
|
571
|
+
},
|
|
572
|
+
{ $$typeof: { value: TEMPORARY_REFERENCE_TAG } }
|
|
573
|
+
);
|
|
574
|
+
reference = new Proxy(reference, proxyHandlers);
|
|
575
|
+
temporaryReferences.set(reference, id);
|
|
576
|
+
return reference;
|
|
577
|
+
}
|
|
578
|
+
function noop() {}
|
|
579
|
+
var SuspenseException = Error(
|
|
580
|
+
"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`."
|
|
581
|
+
);
|
|
582
|
+
function trackUsedThenable(thenableState, thenable, index) {
|
|
583
|
+
index = thenableState[index];
|
|
584
|
+
void 0 === index
|
|
585
|
+
? thenableState.push(thenable)
|
|
586
|
+
: index !== thenable && (thenable.then(noop, noop), (thenable = index));
|
|
587
|
+
switch (thenable.status) {
|
|
588
|
+
case "fulfilled":
|
|
589
|
+
return thenable.value;
|
|
590
|
+
case "rejected":
|
|
591
|
+
throw thenable.reason;
|
|
592
|
+
default:
|
|
593
|
+
"string" === typeof thenable.status
|
|
594
|
+
? thenable.then(noop, noop)
|
|
595
|
+
: ((thenableState = thenable),
|
|
596
|
+
(thenableState.status = "pending"),
|
|
597
|
+
thenableState.then(
|
|
598
|
+
function (fulfilledValue) {
|
|
599
|
+
if ("pending" === thenable.status) {
|
|
600
|
+
var fulfilledThenable = thenable;
|
|
601
|
+
fulfilledThenable.status = "fulfilled";
|
|
602
|
+
fulfilledThenable.value = fulfilledValue;
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
function (error) {
|
|
606
|
+
if ("pending" === thenable.status) {
|
|
607
|
+
var rejectedThenable = thenable;
|
|
608
|
+
rejectedThenable.status = "rejected";
|
|
609
|
+
rejectedThenable.reason = error;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
));
|
|
613
|
+
switch (thenable.status) {
|
|
614
|
+
case "fulfilled":
|
|
615
|
+
return thenable.value;
|
|
616
|
+
case "rejected":
|
|
617
|
+
throw thenable.reason;
|
|
618
|
+
}
|
|
619
|
+
suspendedThenable = thenable;
|
|
620
|
+
throw SuspenseException;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
var suspendedThenable = null;
|
|
624
|
+
function getSuspendedThenable() {
|
|
625
|
+
if (null === suspendedThenable)
|
|
626
|
+
throw Error(
|
|
627
|
+
"Expected a suspended thenable. This is a bug in React. Please file an issue."
|
|
628
|
+
);
|
|
629
|
+
var thenable = suspendedThenable;
|
|
630
|
+
suspendedThenable = null;
|
|
631
|
+
return thenable;
|
|
632
|
+
}
|
|
633
|
+
var currentRequest$1 = null,
|
|
634
|
+
thenableIndexCounter = 0,
|
|
635
|
+
thenableState = null;
|
|
636
|
+
function getThenableStateAfterSuspending() {
|
|
637
|
+
var state = thenableState || [];
|
|
638
|
+
thenableState = null;
|
|
639
|
+
return state;
|
|
640
|
+
}
|
|
641
|
+
var HooksDispatcher = {
|
|
642
|
+
readContext: unsupportedContext,
|
|
643
|
+
use: use,
|
|
644
|
+
useCallback: function (callback) {
|
|
645
|
+
return callback;
|
|
646
|
+
},
|
|
647
|
+
useContext: unsupportedContext,
|
|
648
|
+
useEffect: unsupportedHook,
|
|
649
|
+
useImperativeHandle: unsupportedHook,
|
|
650
|
+
useLayoutEffect: unsupportedHook,
|
|
651
|
+
useInsertionEffect: unsupportedHook,
|
|
652
|
+
useMemo: function (nextCreate) {
|
|
653
|
+
return nextCreate();
|
|
654
|
+
},
|
|
655
|
+
useReducer: unsupportedHook,
|
|
656
|
+
useRef: unsupportedHook,
|
|
657
|
+
useState: unsupportedHook,
|
|
658
|
+
useDebugValue: function () {},
|
|
659
|
+
useDeferredValue: unsupportedHook,
|
|
660
|
+
useTransition: unsupportedHook,
|
|
661
|
+
useSyncExternalStore: unsupportedHook,
|
|
662
|
+
useId: useId,
|
|
663
|
+
useHostTransitionStatus: unsupportedHook,
|
|
664
|
+
useFormState: unsupportedHook,
|
|
665
|
+
useActionState: unsupportedHook,
|
|
666
|
+
useOptimistic: unsupportedHook,
|
|
667
|
+
useMemoCache: function (size) {
|
|
668
|
+
for (var data = Array(size), i = 0; i < size; i++)
|
|
669
|
+
data[i] = REACT_MEMO_CACHE_SENTINEL;
|
|
670
|
+
return data;
|
|
671
|
+
},
|
|
672
|
+
useCacheRefresh: function () {
|
|
673
|
+
return unsupportedRefresh;
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
HooksDispatcher.useEffectEvent = unsupportedHook;
|
|
677
|
+
function unsupportedHook() {
|
|
678
|
+
throw Error("This Hook is not supported in Server Components.");
|
|
679
|
+
}
|
|
680
|
+
function unsupportedRefresh() {
|
|
681
|
+
throw Error("Refreshing the cache is not supported in Server Components.");
|
|
682
|
+
}
|
|
683
|
+
function unsupportedContext() {
|
|
684
|
+
throw Error("Cannot read a Client Context from a Server Component.");
|
|
685
|
+
}
|
|
686
|
+
function useId() {
|
|
687
|
+
if (null === currentRequest$1)
|
|
688
|
+
throw Error("useId can only be used while React is rendering");
|
|
689
|
+
var id = currentRequest$1.identifierCount++;
|
|
690
|
+
return "_" + currentRequest$1.identifierPrefix + "S_" + id.toString(32) + "_";
|
|
691
|
+
}
|
|
692
|
+
function use(usable) {
|
|
693
|
+
if (
|
|
694
|
+
(null !== usable && "object" === typeof usable) ||
|
|
695
|
+
"function" === typeof usable
|
|
696
|
+
) {
|
|
697
|
+
if ("function" === typeof usable.then) {
|
|
698
|
+
var index = thenableIndexCounter;
|
|
699
|
+
thenableIndexCounter += 1;
|
|
700
|
+
null === thenableState && (thenableState = []);
|
|
701
|
+
return trackUsedThenable(thenableState, usable, index);
|
|
702
|
+
}
|
|
703
|
+
usable.$$typeof === REACT_CONTEXT_TYPE && unsupportedContext();
|
|
704
|
+
}
|
|
705
|
+
if (usable.$$typeof === CLIENT_REFERENCE_TAG$1) {
|
|
706
|
+
if (null != usable.value && usable.value.$$typeof === REACT_CONTEXT_TYPE)
|
|
707
|
+
throw Error("Cannot read a Client Context from a Server Component.");
|
|
708
|
+
throw Error("Cannot use() an already resolved Client Reference.");
|
|
709
|
+
}
|
|
710
|
+
throw Error("An unsupported type was passed to use(): " + String(usable));
|
|
711
|
+
}
|
|
712
|
+
var DefaultAsyncDispatcher = {
|
|
713
|
+
getCacheForType: function (resourceType) {
|
|
714
|
+
var JSCompiler_inline_result = (JSCompiler_inline_result =
|
|
715
|
+
resolveRequest())
|
|
716
|
+
? JSCompiler_inline_result.cache
|
|
717
|
+
: new Map();
|
|
718
|
+
var entry = JSCompiler_inline_result.get(resourceType);
|
|
719
|
+
void 0 === entry &&
|
|
720
|
+
((entry = resourceType()),
|
|
721
|
+
JSCompiler_inline_result.set(resourceType, entry));
|
|
722
|
+
return entry;
|
|
723
|
+
},
|
|
724
|
+
cacheSignal: function () {
|
|
725
|
+
var request = resolveRequest();
|
|
726
|
+
return request ? request.cacheController.signal : null;
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
ReactSharedInternalsServer =
|
|
730
|
+
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
731
|
+
if (!ReactSharedInternalsServer)
|
|
732
|
+
throw Error(
|
|
733
|
+
'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.'
|
|
734
|
+
);
|
|
735
|
+
var isArrayImpl = Array.isArray,
|
|
736
|
+
getPrototypeOf = Object.getPrototypeOf;
|
|
737
|
+
function objectName(object) {
|
|
738
|
+
object = Object.prototype.toString.call(object);
|
|
739
|
+
return object.slice(8, object.length - 1);
|
|
740
|
+
}
|
|
741
|
+
function describeValueForErrorMessage(value) {
|
|
742
|
+
switch (typeof value) {
|
|
743
|
+
case "string":
|
|
744
|
+
return JSON.stringify(
|
|
745
|
+
10 >= value.length ? value : value.slice(0, 10) + "..."
|
|
746
|
+
);
|
|
747
|
+
case "object":
|
|
748
|
+
if (isArrayImpl(value)) return "[...]";
|
|
749
|
+
if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)
|
|
750
|
+
return "client";
|
|
751
|
+
value = objectName(value);
|
|
752
|
+
return "Object" === value ? "{...}" : value;
|
|
753
|
+
case "function":
|
|
754
|
+
return value.$$typeof === CLIENT_REFERENCE_TAG
|
|
755
|
+
? "client"
|
|
756
|
+
: (value = value.displayName || value.name)
|
|
757
|
+
? "function " + value
|
|
758
|
+
: "function";
|
|
759
|
+
default:
|
|
760
|
+
return String(value);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
function describeElementType(type) {
|
|
764
|
+
if ("string" === typeof type) return type;
|
|
765
|
+
switch (type) {
|
|
766
|
+
case REACT_SUSPENSE_TYPE:
|
|
767
|
+
return "Suspense";
|
|
768
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
769
|
+
return "SuspenseList";
|
|
770
|
+
}
|
|
771
|
+
if ("object" === typeof type)
|
|
772
|
+
switch (type.$$typeof) {
|
|
773
|
+
case REACT_FORWARD_REF_TYPE:
|
|
774
|
+
return describeElementType(type.render);
|
|
775
|
+
case REACT_MEMO_TYPE:
|
|
776
|
+
return describeElementType(type.type);
|
|
777
|
+
case REACT_LAZY_TYPE:
|
|
778
|
+
var payload = type._payload;
|
|
779
|
+
type = type._init;
|
|
780
|
+
try {
|
|
781
|
+
return describeElementType(type(payload));
|
|
782
|
+
} catch (x) {}
|
|
783
|
+
}
|
|
784
|
+
return "";
|
|
785
|
+
}
|
|
786
|
+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
|
|
787
|
+
function describeObjectForErrorMessage(objectOrArray, expandedName) {
|
|
788
|
+
var objKind = objectName(objectOrArray);
|
|
789
|
+
if ("Object" !== objKind && "Array" !== objKind) return objKind;
|
|
790
|
+
objKind = -1;
|
|
791
|
+
var length = 0;
|
|
792
|
+
if (isArrayImpl(objectOrArray)) {
|
|
793
|
+
var str = "[";
|
|
794
|
+
for (var i = 0; i < objectOrArray.length; i++) {
|
|
795
|
+
0 < i && (str += ", ");
|
|
796
|
+
var value = objectOrArray[i];
|
|
797
|
+
value =
|
|
798
|
+
"object" === typeof value && null !== value
|
|
799
|
+
? describeObjectForErrorMessage(value)
|
|
800
|
+
: describeValueForErrorMessage(value);
|
|
801
|
+
"" + i === expandedName
|
|
802
|
+
? ((objKind = str.length), (length = value.length), (str += value))
|
|
803
|
+
: (str =
|
|
804
|
+
10 > value.length && 40 > str.length + value.length
|
|
805
|
+
? str + value
|
|
806
|
+
: str + "...");
|
|
807
|
+
}
|
|
808
|
+
str += "]";
|
|
809
|
+
} else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)
|
|
810
|
+
str = "<" + describeElementType(objectOrArray.type) + "/>";
|
|
811
|
+
else {
|
|
812
|
+
if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client";
|
|
813
|
+
str = "{";
|
|
814
|
+
i = Object.keys(objectOrArray);
|
|
815
|
+
for (value = 0; value < i.length; value++) {
|
|
816
|
+
0 < value && (str += ", ");
|
|
817
|
+
var name = i[value],
|
|
818
|
+
encodedKey = JSON.stringify(name);
|
|
819
|
+
str += ('"' + name + '"' === encodedKey ? name : encodedKey) + ": ";
|
|
820
|
+
encodedKey = objectOrArray[name];
|
|
821
|
+
encodedKey =
|
|
822
|
+
"object" === typeof encodedKey && null !== encodedKey
|
|
823
|
+
? describeObjectForErrorMessage(encodedKey)
|
|
824
|
+
: describeValueForErrorMessage(encodedKey);
|
|
825
|
+
name === expandedName
|
|
826
|
+
? ((objKind = str.length),
|
|
827
|
+
(length = encodedKey.length),
|
|
828
|
+
(str += encodedKey))
|
|
829
|
+
: (str =
|
|
830
|
+
10 > encodedKey.length && 40 > str.length + encodedKey.length
|
|
831
|
+
? str + encodedKey
|
|
832
|
+
: str + "...");
|
|
833
|
+
}
|
|
834
|
+
str += "}";
|
|
835
|
+
}
|
|
836
|
+
return void 0 === expandedName
|
|
837
|
+
? str
|
|
838
|
+
: -1 < objKind && 0 < length
|
|
839
|
+
? ((objectOrArray = " ".repeat(objKind) + "^".repeat(length)),
|
|
840
|
+
"\n " + str + "\n " + objectOrArray)
|
|
841
|
+
: "\n " + str;
|
|
842
|
+
}
|
|
843
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
844
|
+
ObjectPrototype = Object.prototype,
|
|
845
|
+
stringify = JSON.stringify;
|
|
846
|
+
function defaultErrorHandler(error) {
|
|
847
|
+
console.error(error);
|
|
848
|
+
}
|
|
849
|
+
function RequestInstance(
|
|
850
|
+
type,
|
|
851
|
+
model,
|
|
852
|
+
bundlerConfig,
|
|
853
|
+
onError,
|
|
854
|
+
onPostpone,
|
|
855
|
+
onAllReady,
|
|
856
|
+
onFatalError,
|
|
857
|
+
identifierPrefix,
|
|
858
|
+
temporaryReferences
|
|
859
|
+
) {
|
|
860
|
+
if (
|
|
861
|
+
null !== ReactSharedInternalsServer.A &&
|
|
862
|
+
ReactSharedInternalsServer.A !== DefaultAsyncDispatcher
|
|
863
|
+
)
|
|
864
|
+
throw Error("Currently React only supports one RSC renderer at a time.");
|
|
865
|
+
ReactSharedInternalsServer.A = DefaultAsyncDispatcher;
|
|
866
|
+
var abortSet = new Set(),
|
|
867
|
+
pingedTasks = [],
|
|
868
|
+
hints = new Set();
|
|
869
|
+
this.type = type;
|
|
870
|
+
this.status = 10;
|
|
871
|
+
this.flushScheduled = !1;
|
|
872
|
+
this.destination = this.fatalError = null;
|
|
873
|
+
this.bundlerConfig = bundlerConfig;
|
|
874
|
+
this.cache = new Map();
|
|
875
|
+
this.cacheController = new AbortController();
|
|
876
|
+
this.pendingChunks = this.nextChunkId = 0;
|
|
877
|
+
this.hints = hints;
|
|
878
|
+
this.abortableTasks = abortSet;
|
|
879
|
+
this.pingedTasks = pingedTasks;
|
|
880
|
+
this.completedImportChunks = [];
|
|
881
|
+
this.completedHintChunks = [];
|
|
882
|
+
this.completedRegularChunks = [];
|
|
883
|
+
this.completedErrorChunks = [];
|
|
884
|
+
this.writtenSymbols = new Map();
|
|
885
|
+
this.writtenClientReferences = new Map();
|
|
886
|
+
this.writtenServerReferences = new Map();
|
|
887
|
+
this.writtenObjects = new WeakMap();
|
|
888
|
+
this.temporaryReferences = temporaryReferences;
|
|
889
|
+
this.identifierPrefix = identifierPrefix || "";
|
|
890
|
+
this.identifierCount = 1;
|
|
891
|
+
this.taintCleanupQueue = [];
|
|
892
|
+
this.onError = void 0 === onError ? defaultErrorHandler : onError;
|
|
893
|
+
this.onPostpone = void 0 === onPostpone ? noop : onPostpone;
|
|
894
|
+
this.onAllReady = onAllReady;
|
|
895
|
+
this.onFatalError = onFatalError;
|
|
896
|
+
type = createTask(this, model, null, !1, 0, abortSet);
|
|
897
|
+
pingedTasks.push(type);
|
|
898
|
+
}
|
|
899
|
+
var currentRequest = null;
|
|
900
|
+
function resolveRequest() {
|
|
901
|
+
if (currentRequest) return currentRequest;
|
|
902
|
+
var store = requestStorage.getStore();
|
|
903
|
+
return store ? store : null;
|
|
904
|
+
}
|
|
905
|
+
function serializeThenable(request, task, thenable) {
|
|
906
|
+
var newTask = createTask(
|
|
907
|
+
request,
|
|
908
|
+
thenable,
|
|
909
|
+
task.keyPath,
|
|
910
|
+
task.implicitSlot,
|
|
911
|
+
task.formatContext,
|
|
912
|
+
request.abortableTasks
|
|
913
|
+
);
|
|
914
|
+
switch (thenable.status) {
|
|
915
|
+
case "fulfilled":
|
|
916
|
+
return (
|
|
917
|
+
(newTask.model = thenable.value), pingTask(request, newTask), newTask.id
|
|
918
|
+
);
|
|
919
|
+
case "rejected":
|
|
920
|
+
return erroredTask(request, newTask, thenable.reason), newTask.id;
|
|
921
|
+
default:
|
|
922
|
+
if (12 === request.status)
|
|
923
|
+
return (
|
|
924
|
+
request.abortableTasks.delete(newTask),
|
|
925
|
+
21 === request.type
|
|
926
|
+
? (haltTask(newTask), finishHaltedTask(newTask, request))
|
|
927
|
+
: ((task = request.fatalError),
|
|
928
|
+
abortTask(newTask),
|
|
929
|
+
finishAbortedTask(newTask, request, task)),
|
|
930
|
+
newTask.id
|
|
931
|
+
);
|
|
932
|
+
"string" !== typeof thenable.status &&
|
|
933
|
+
((thenable.status = "pending"),
|
|
934
|
+
thenable.then(
|
|
935
|
+
function (fulfilledValue) {
|
|
936
|
+
"pending" === thenable.status &&
|
|
937
|
+
((thenable.status = "fulfilled"),
|
|
938
|
+
(thenable.value = fulfilledValue));
|
|
939
|
+
},
|
|
940
|
+
function (error) {
|
|
941
|
+
"pending" === thenable.status &&
|
|
942
|
+
((thenable.status = "rejected"), (thenable.reason = error));
|
|
943
|
+
}
|
|
944
|
+
));
|
|
945
|
+
}
|
|
946
|
+
thenable.then(
|
|
947
|
+
function (value) {
|
|
948
|
+
newTask.model = value;
|
|
949
|
+
pingTask(request, newTask);
|
|
950
|
+
},
|
|
951
|
+
function (reason) {
|
|
952
|
+
0 === newTask.status &&
|
|
953
|
+
(erroredTask(request, newTask, reason), enqueueFlush(request));
|
|
954
|
+
}
|
|
955
|
+
);
|
|
956
|
+
return newTask.id;
|
|
957
|
+
}
|
|
958
|
+
function serializeReadableStream(request, task, stream) {
|
|
959
|
+
function progress(entry) {
|
|
960
|
+
if (0 === streamTask.status)
|
|
961
|
+
if (entry.done)
|
|
962
|
+
(streamTask.status = 1),
|
|
963
|
+
(entry = streamTask.id.toString(16) + ":C\n"),
|
|
964
|
+
request.completedRegularChunks.push(entry),
|
|
965
|
+
request.abortableTasks.delete(streamTask),
|
|
966
|
+
request.cacheController.signal.removeEventListener(
|
|
967
|
+
"abort",
|
|
968
|
+
abortStream
|
|
969
|
+
),
|
|
970
|
+
enqueueFlush(request),
|
|
971
|
+
callOnAllReadyIfReady(request);
|
|
972
|
+
else
|
|
973
|
+
try {
|
|
974
|
+
(streamTask.model = entry.value),
|
|
975
|
+
request.pendingChunks++,
|
|
976
|
+
tryStreamTask(request, streamTask),
|
|
977
|
+
enqueueFlush(request),
|
|
978
|
+
reader.read().then(progress, error);
|
|
979
|
+
} catch (x$11) {
|
|
980
|
+
error(x$11);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
function error(reason) {
|
|
984
|
+
0 === streamTask.status &&
|
|
985
|
+
(request.cacheController.signal.removeEventListener("abort", abortStream),
|
|
986
|
+
erroredTask(request, streamTask, reason),
|
|
987
|
+
enqueueFlush(request),
|
|
988
|
+
reader.cancel(reason).then(error, error));
|
|
989
|
+
}
|
|
990
|
+
function abortStream() {
|
|
991
|
+
if (0 === streamTask.status) {
|
|
992
|
+
var signal = request.cacheController.signal;
|
|
993
|
+
signal.removeEventListener("abort", abortStream);
|
|
994
|
+
signal = signal.reason;
|
|
995
|
+
21 === request.type
|
|
996
|
+
? (request.abortableTasks.delete(streamTask),
|
|
997
|
+
haltTask(streamTask),
|
|
998
|
+
finishHaltedTask(streamTask, request))
|
|
999
|
+
: (erroredTask(request, streamTask, signal), enqueueFlush(request));
|
|
1000
|
+
reader.cancel(signal).then(error, error);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
var supportsBYOB = stream.supportsBYOB;
|
|
1004
|
+
if (void 0 === supportsBYOB)
|
|
1005
|
+
try {
|
|
1006
|
+
stream.getReader({ mode: "byob" }).releaseLock(), (supportsBYOB = !0);
|
|
1007
|
+
} catch (x) {
|
|
1008
|
+
supportsBYOB = !1;
|
|
1009
|
+
}
|
|
1010
|
+
var reader = stream.getReader(),
|
|
1011
|
+
streamTask = createTask(
|
|
1012
|
+
request,
|
|
1013
|
+
task.model,
|
|
1014
|
+
task.keyPath,
|
|
1015
|
+
task.implicitSlot,
|
|
1016
|
+
task.formatContext,
|
|
1017
|
+
request.abortableTasks
|
|
1018
|
+
);
|
|
1019
|
+
request.pendingChunks++;
|
|
1020
|
+
task = streamTask.id.toString(16) + ":" + (supportsBYOB ? "r" : "R") + "\n";
|
|
1021
|
+
request.completedRegularChunks.push(task);
|
|
1022
|
+
request.cacheController.signal.addEventListener("abort", abortStream);
|
|
1023
|
+
reader.read().then(progress, error);
|
|
1024
|
+
return serializeByValueID(streamTask.id);
|
|
1025
|
+
}
|
|
1026
|
+
function serializeAsyncIterable(request, task, iterable, iterator) {
|
|
1027
|
+
function progress(entry) {
|
|
1028
|
+
if (0 === streamTask.status)
|
|
1029
|
+
if (entry.done) {
|
|
1030
|
+
streamTask.status = 1;
|
|
1031
|
+
if (void 0 === entry.value)
|
|
1032
|
+
var endStreamRow = streamTask.id.toString(16) + ":C\n";
|
|
1033
|
+
else
|
|
1034
|
+
try {
|
|
1035
|
+
var chunkId = outlineModelWithFormatContext(
|
|
1036
|
+
request,
|
|
1037
|
+
entry.value,
|
|
1038
|
+
0
|
|
1039
|
+
);
|
|
1040
|
+
endStreamRow =
|
|
1041
|
+
streamTask.id.toString(16) +
|
|
1042
|
+
":C" +
|
|
1043
|
+
stringify(serializeByValueID(chunkId)) +
|
|
1044
|
+
"\n";
|
|
1045
|
+
} catch (x) {
|
|
1046
|
+
error(x);
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
request.completedRegularChunks.push(endStreamRow);
|
|
1050
|
+
request.abortableTasks.delete(streamTask);
|
|
1051
|
+
request.cacheController.signal.removeEventListener(
|
|
1052
|
+
"abort",
|
|
1053
|
+
abortIterable
|
|
1054
|
+
);
|
|
1055
|
+
enqueueFlush(request);
|
|
1056
|
+
callOnAllReadyIfReady(request);
|
|
1057
|
+
} else
|
|
1058
|
+
try {
|
|
1059
|
+
(streamTask.model = entry.value),
|
|
1060
|
+
request.pendingChunks++,
|
|
1061
|
+
tryStreamTask(request, streamTask),
|
|
1062
|
+
enqueueFlush(request),
|
|
1063
|
+
iterator.next().then(progress, error);
|
|
1064
|
+
} catch (x$12) {
|
|
1065
|
+
error(x$12);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
function error(reason) {
|
|
1069
|
+
0 === streamTask.status &&
|
|
1070
|
+
(request.cacheController.signal.removeEventListener(
|
|
1071
|
+
"abort",
|
|
1072
|
+
abortIterable
|
|
1073
|
+
),
|
|
1074
|
+
erroredTask(request, streamTask, reason),
|
|
1075
|
+
enqueueFlush(request),
|
|
1076
|
+
"function" === typeof iterator.throw &&
|
|
1077
|
+
iterator.throw(reason).then(error, error));
|
|
1078
|
+
}
|
|
1079
|
+
function abortIterable() {
|
|
1080
|
+
if (0 === streamTask.status) {
|
|
1081
|
+
var signal = request.cacheController.signal;
|
|
1082
|
+
signal.removeEventListener("abort", abortIterable);
|
|
1083
|
+
var reason = signal.reason;
|
|
1084
|
+
21 === request.type
|
|
1085
|
+
? (request.abortableTasks.delete(streamTask),
|
|
1086
|
+
haltTask(streamTask),
|
|
1087
|
+
finishHaltedTask(streamTask, request))
|
|
1088
|
+
: (erroredTask(request, streamTask, signal.reason),
|
|
1089
|
+
enqueueFlush(request));
|
|
1090
|
+
"function" === typeof iterator.throw &&
|
|
1091
|
+
iterator.throw(reason).then(error, error);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
iterable = iterable === iterator;
|
|
1095
|
+
var streamTask = createTask(
|
|
1096
|
+
request,
|
|
1097
|
+
task.model,
|
|
1098
|
+
task.keyPath,
|
|
1099
|
+
task.implicitSlot,
|
|
1100
|
+
task.formatContext,
|
|
1101
|
+
request.abortableTasks
|
|
1102
|
+
);
|
|
1103
|
+
request.pendingChunks++;
|
|
1104
|
+
task = streamTask.id.toString(16) + ":" + (iterable ? "x" : "X") + "\n";
|
|
1105
|
+
request.completedRegularChunks.push(task);
|
|
1106
|
+
request.cacheController.signal.addEventListener("abort", abortIterable);
|
|
1107
|
+
iterator.next().then(progress, error);
|
|
1108
|
+
return serializeByValueID(streamTask.id);
|
|
1109
|
+
}
|
|
1110
|
+
function emitHint(request, code, model) {
|
|
1111
|
+
model = stringify(model);
|
|
1112
|
+
request.completedHintChunks.push(":H" + code + model + "\n");
|
|
1113
|
+
enqueueFlush(request);
|
|
1114
|
+
}
|
|
1115
|
+
function readThenable(thenable) {
|
|
1116
|
+
if ("fulfilled" === thenable.status) return thenable.value;
|
|
1117
|
+
if ("rejected" === thenable.status) throw thenable.reason;
|
|
1118
|
+
throw thenable;
|
|
1119
|
+
}
|
|
1120
|
+
function createLazyWrapperAroundWakeable(request, task, wakeable) {
|
|
1121
|
+
switch (wakeable.status) {
|
|
1122
|
+
case "fulfilled":
|
|
1123
|
+
return wakeable.value;
|
|
1124
|
+
case "rejected":
|
|
1125
|
+
break;
|
|
1126
|
+
default:
|
|
1127
|
+
"string" !== typeof wakeable.status &&
|
|
1128
|
+
((wakeable.status = "pending"),
|
|
1129
|
+
wakeable.then(
|
|
1130
|
+
function (fulfilledValue) {
|
|
1131
|
+
"pending" === wakeable.status &&
|
|
1132
|
+
((wakeable.status = "fulfilled"),
|
|
1133
|
+
(wakeable.value = fulfilledValue));
|
|
1134
|
+
},
|
|
1135
|
+
function (error) {
|
|
1136
|
+
"pending" === wakeable.status &&
|
|
1137
|
+
((wakeable.status = "rejected"), (wakeable.reason = error));
|
|
1138
|
+
}
|
|
1139
|
+
));
|
|
1140
|
+
}
|
|
1141
|
+
return { $$typeof: REACT_LAZY_TYPE, _payload: wakeable, _init: readThenable };
|
|
1142
|
+
}
|
|
1143
|
+
function voidHandler() {}
|
|
1144
|
+
function processServerComponentReturnValue(request, task, Component, result) {
|
|
1145
|
+
if (
|
|
1146
|
+
"object" !== typeof result ||
|
|
1147
|
+
null === result ||
|
|
1148
|
+
result.$$typeof === CLIENT_REFERENCE_TAG$1
|
|
1149
|
+
)
|
|
1150
|
+
return result;
|
|
1151
|
+
if ("function" === typeof result.then)
|
|
1152
|
+
return createLazyWrapperAroundWakeable(request, task, result);
|
|
1153
|
+
var iteratorFn = getIteratorFn(result);
|
|
1154
|
+
return iteratorFn
|
|
1155
|
+
? ((request = {}),
|
|
1156
|
+
(request[Symbol.iterator] = function () {
|
|
1157
|
+
return iteratorFn.call(result);
|
|
1158
|
+
}),
|
|
1159
|
+
request)
|
|
1160
|
+
: "function" !== typeof result[ASYNC_ITERATOR] ||
|
|
1161
|
+
("function" === typeof ReadableStream &&
|
|
1162
|
+
result instanceof ReadableStream)
|
|
1163
|
+
? result
|
|
1164
|
+
: ((request = {}),
|
|
1165
|
+
(request[ASYNC_ITERATOR] = function () {
|
|
1166
|
+
return result[ASYNC_ITERATOR]();
|
|
1167
|
+
}),
|
|
1168
|
+
request);
|
|
1169
|
+
}
|
|
1170
|
+
function renderFunctionComponent(request, task, key, Component, props) {
|
|
1171
|
+
var prevThenableState = task.thenableState;
|
|
1172
|
+
task.thenableState = null;
|
|
1173
|
+
thenableIndexCounter = 0;
|
|
1174
|
+
thenableState = prevThenableState;
|
|
1175
|
+
props = Component(props, void 0);
|
|
1176
|
+
if (12 === request.status)
|
|
1177
|
+
throw (
|
|
1178
|
+
("object" === typeof props &&
|
|
1179
|
+
null !== props &&
|
|
1180
|
+
"function" === typeof props.then &&
|
|
1181
|
+
props.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
|
|
1182
|
+
props.then(voidHandler, voidHandler),
|
|
1183
|
+
null)
|
|
1184
|
+
);
|
|
1185
|
+
props = processServerComponentReturnValue(request, task, Component, props);
|
|
1186
|
+
Component = task.keyPath;
|
|
1187
|
+
prevThenableState = task.implicitSlot;
|
|
1188
|
+
null !== key
|
|
1189
|
+
? (task.keyPath = null === Component ? key : Component + "," + key)
|
|
1190
|
+
: null === Component && (task.implicitSlot = !0);
|
|
1191
|
+
request = renderModelDestructive(request, task, emptyRoot, "", props);
|
|
1192
|
+
task.keyPath = Component;
|
|
1193
|
+
task.implicitSlot = prevThenableState;
|
|
1194
|
+
return request;
|
|
1195
|
+
}
|
|
1196
|
+
function renderFragment(request, task, children) {
|
|
1197
|
+
return null !== task.keyPath
|
|
1198
|
+
? ((request = [
|
|
1199
|
+
REACT_ELEMENT_TYPE,
|
|
1200
|
+
REACT_FRAGMENT_TYPE,
|
|
1201
|
+
task.keyPath,
|
|
1202
|
+
{ children: children }
|
|
1203
|
+
]),
|
|
1204
|
+
task.implicitSlot ? [request] : request)
|
|
1205
|
+
: children;
|
|
1206
|
+
}
|
|
1207
|
+
var serializedSize = 0;
|
|
1208
|
+
function deferTask(request, task) {
|
|
1209
|
+
task = createTask(
|
|
1210
|
+
request,
|
|
1211
|
+
task.model,
|
|
1212
|
+
task.keyPath,
|
|
1213
|
+
task.implicitSlot,
|
|
1214
|
+
task.formatContext,
|
|
1215
|
+
request.abortableTasks
|
|
1216
|
+
);
|
|
1217
|
+
pingTask(request, task);
|
|
1218
|
+
return serializeLazyID(task.id);
|
|
1219
|
+
}
|
|
1220
|
+
function renderElement(request, task, type, key, ref, props) {
|
|
1221
|
+
if (null !== ref && void 0 !== ref)
|
|
1222
|
+
throw Error(
|
|
1223
|
+
"Refs cannot be used in Server Components, nor passed to Client Components."
|
|
1224
|
+
);
|
|
1225
|
+
if (
|
|
1226
|
+
"function" === typeof type &&
|
|
1227
|
+
type.$$typeof !== CLIENT_REFERENCE_TAG$1 &&
|
|
1228
|
+
type.$$typeof !== TEMPORARY_REFERENCE_TAG
|
|
1229
|
+
)
|
|
1230
|
+
return renderFunctionComponent(request, task, key, type, props);
|
|
1231
|
+
if (type === REACT_FRAGMENT_TYPE && null === key)
|
|
1232
|
+
return (
|
|
1233
|
+
(type = task.implicitSlot),
|
|
1234
|
+
null === task.keyPath && (task.implicitSlot = !0),
|
|
1235
|
+
(props = renderModelDestructive(
|
|
1236
|
+
request,
|
|
1237
|
+
task,
|
|
1238
|
+
emptyRoot,
|
|
1239
|
+
"",
|
|
1240
|
+
props.children
|
|
1241
|
+
)),
|
|
1242
|
+
(task.implicitSlot = type),
|
|
1243
|
+
props
|
|
1244
|
+
);
|
|
1245
|
+
if (
|
|
1246
|
+
null != type &&
|
|
1247
|
+
"object" === typeof type &&
|
|
1248
|
+
type.$$typeof !== CLIENT_REFERENCE_TAG$1
|
|
1249
|
+
)
|
|
1250
|
+
switch (type.$$typeof) {
|
|
1251
|
+
case REACT_LAZY_TYPE:
|
|
1252
|
+
var init = type._init;
|
|
1253
|
+
type = init(type._payload);
|
|
1254
|
+
if (12 === request.status) throw null;
|
|
1255
|
+
return renderElement(request, task, type, key, ref, props);
|
|
1256
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1257
|
+
return renderFunctionComponent(request, task, key, type.render, props);
|
|
1258
|
+
case REACT_MEMO_TYPE:
|
|
1259
|
+
return renderElement(request, task, type.type, key, ref, props);
|
|
1260
|
+
}
|
|
1261
|
+
else
|
|
1262
|
+
"string" === typeof type &&
|
|
1263
|
+
((ref = task.formatContext),
|
|
1264
|
+
(init = getChildFormatContext(ref, type, props)),
|
|
1265
|
+
ref !== init &&
|
|
1266
|
+
null != props.children &&
|
|
1267
|
+
outlineModelWithFormatContext(request, props.children, init));
|
|
1268
|
+
request = key;
|
|
1269
|
+
key = task.keyPath;
|
|
1270
|
+
null === request
|
|
1271
|
+
? (request = key)
|
|
1272
|
+
: null !== key && (request = key + "," + request);
|
|
1273
|
+
props = [REACT_ELEMENT_TYPE, type, request, props];
|
|
1274
|
+
task = task.implicitSlot && null !== request ? [props] : props;
|
|
1275
|
+
return task;
|
|
1276
|
+
}
|
|
1277
|
+
function pingTask(request, task) {
|
|
1278
|
+
var pingedTasks = request.pingedTasks;
|
|
1279
|
+
pingedTasks.push(task);
|
|
1280
|
+
1 === pingedTasks.length &&
|
|
1281
|
+
((request.flushScheduled = null !== request.destination),
|
|
1282
|
+
21 === request.type || 10 === request.status
|
|
1283
|
+
? scheduleMicrotask(function () {
|
|
1284
|
+
return performWork(request);
|
|
1285
|
+
})
|
|
1286
|
+
: setImmediate(function () {
|
|
1287
|
+
return performWork(request);
|
|
1288
|
+
}));
|
|
1289
|
+
}
|
|
1290
|
+
function createTask(
|
|
1291
|
+
request,
|
|
1292
|
+
model,
|
|
1293
|
+
keyPath,
|
|
1294
|
+
implicitSlot,
|
|
1295
|
+
formatContext,
|
|
1296
|
+
abortSet
|
|
1297
|
+
) {
|
|
1298
|
+
request.pendingChunks++;
|
|
1299
|
+
var id = request.nextChunkId++;
|
|
1300
|
+
"object" !== typeof model ||
|
|
1301
|
+
null === model ||
|
|
1302
|
+
null !== keyPath ||
|
|
1303
|
+
implicitSlot ||
|
|
1304
|
+
request.writtenObjects.set(model, serializeByValueID(id));
|
|
1305
|
+
var task = {
|
|
1306
|
+
id: id,
|
|
1307
|
+
status: 0,
|
|
1308
|
+
model: model,
|
|
1309
|
+
keyPath: keyPath,
|
|
1310
|
+
implicitSlot: implicitSlot,
|
|
1311
|
+
formatContext: formatContext,
|
|
1312
|
+
ping: function () {
|
|
1313
|
+
return pingTask(request, task);
|
|
1314
|
+
},
|
|
1315
|
+
toJSON: function (parentPropertyName, value) {
|
|
1316
|
+
serializedSize += parentPropertyName.length;
|
|
1317
|
+
var prevKeyPath = task.keyPath,
|
|
1318
|
+
prevImplicitSlot = task.implicitSlot;
|
|
1319
|
+
try {
|
|
1320
|
+
var JSCompiler_inline_result = renderModelDestructive(
|
|
1321
|
+
request,
|
|
1322
|
+
task,
|
|
1323
|
+
this,
|
|
1324
|
+
parentPropertyName,
|
|
1325
|
+
value
|
|
1326
|
+
);
|
|
1327
|
+
} catch (thrownValue) {
|
|
1328
|
+
if (
|
|
1329
|
+
((parentPropertyName = task.model),
|
|
1330
|
+
(parentPropertyName =
|
|
1331
|
+
"object" === typeof parentPropertyName &&
|
|
1332
|
+
null !== parentPropertyName &&
|
|
1333
|
+
(parentPropertyName.$$typeof === REACT_ELEMENT_TYPE ||
|
|
1334
|
+
parentPropertyName.$$typeof === REACT_LAZY_TYPE)),
|
|
1335
|
+
12 === request.status)
|
|
1336
|
+
)
|
|
1337
|
+
(task.status = 3),
|
|
1338
|
+
21 === request.type
|
|
1339
|
+
? ((prevKeyPath = request.nextChunkId++),
|
|
1340
|
+
(prevKeyPath = parentPropertyName
|
|
1341
|
+
? serializeLazyID(prevKeyPath)
|
|
1342
|
+
: serializeByValueID(prevKeyPath)),
|
|
1343
|
+
(JSCompiler_inline_result = prevKeyPath))
|
|
1344
|
+
: ((prevKeyPath = request.fatalError),
|
|
1345
|
+
(JSCompiler_inline_result = parentPropertyName
|
|
1346
|
+
? serializeLazyID(prevKeyPath)
|
|
1347
|
+
: serializeByValueID(prevKeyPath)));
|
|
1348
|
+
else if (
|
|
1349
|
+
((value =
|
|
1350
|
+
thrownValue === SuspenseException
|
|
1351
|
+
? getSuspendedThenable()
|
|
1352
|
+
: thrownValue),
|
|
1353
|
+
"object" === typeof value &&
|
|
1354
|
+
null !== value &&
|
|
1355
|
+
"function" === typeof value.then)
|
|
1356
|
+
) {
|
|
1357
|
+
JSCompiler_inline_result = createTask(
|
|
1358
|
+
request,
|
|
1359
|
+
task.model,
|
|
1360
|
+
task.keyPath,
|
|
1361
|
+
task.implicitSlot,
|
|
1362
|
+
task.formatContext,
|
|
1363
|
+
request.abortableTasks
|
|
1364
|
+
);
|
|
1365
|
+
var ping = JSCompiler_inline_result.ping;
|
|
1366
|
+
value.then(ping, ping);
|
|
1367
|
+
JSCompiler_inline_result.thenableState =
|
|
1368
|
+
getThenableStateAfterSuspending();
|
|
1369
|
+
task.keyPath = prevKeyPath;
|
|
1370
|
+
task.implicitSlot = prevImplicitSlot;
|
|
1371
|
+
JSCompiler_inline_result = parentPropertyName
|
|
1372
|
+
? serializeLazyID(JSCompiler_inline_result.id)
|
|
1373
|
+
: serializeByValueID(JSCompiler_inline_result.id);
|
|
1374
|
+
} else
|
|
1375
|
+
(task.keyPath = prevKeyPath),
|
|
1376
|
+
(task.implicitSlot = prevImplicitSlot),
|
|
1377
|
+
request.pendingChunks++,
|
|
1378
|
+
(prevKeyPath = request.nextChunkId++),
|
|
1379
|
+
(prevImplicitSlot = logRecoverableError(request, value, task)),
|
|
1380
|
+
emitErrorChunk(request, prevKeyPath, prevImplicitSlot),
|
|
1381
|
+
(JSCompiler_inline_result = parentPropertyName
|
|
1382
|
+
? serializeLazyID(prevKeyPath)
|
|
1383
|
+
: serializeByValueID(prevKeyPath));
|
|
1384
|
+
}
|
|
1385
|
+
return JSCompiler_inline_result;
|
|
1386
|
+
},
|
|
1387
|
+
thenableState: null
|
|
1388
|
+
};
|
|
1389
|
+
abortSet.add(task);
|
|
1390
|
+
return task;
|
|
1391
|
+
}
|
|
1392
|
+
function serializeByValueID(id) {
|
|
1393
|
+
return "$" + id.toString(16);
|
|
1394
|
+
}
|
|
1395
|
+
function serializeLazyID(id) {
|
|
1396
|
+
return "$L" + id.toString(16);
|
|
1397
|
+
}
|
|
1398
|
+
function encodeReferenceChunk(request, id, reference) {
|
|
1399
|
+
request = stringify(reference);
|
|
1400
|
+
return id.toString(16) + ":" + request + "\n";
|
|
1401
|
+
}
|
|
1402
|
+
function serializeClientReference(
|
|
1403
|
+
request,
|
|
1404
|
+
parent,
|
|
1405
|
+
parentPropertyName,
|
|
1406
|
+
clientReference
|
|
1407
|
+
) {
|
|
1408
|
+
var clientReferenceKey = clientReference.$$async
|
|
1409
|
+
? clientReference.$$id + "#async"
|
|
1410
|
+
: clientReference.$$id,
|
|
1411
|
+
writtenClientReferences = request.writtenClientReferences,
|
|
1412
|
+
existingId = writtenClientReferences.get(clientReferenceKey);
|
|
1413
|
+
if (void 0 !== existingId)
|
|
1414
|
+
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
|
1415
|
+
? serializeLazyID(existingId)
|
|
1416
|
+
: serializeByValueID(existingId);
|
|
1417
|
+
try {
|
|
1418
|
+
var config = request.bundlerConfig,
|
|
1419
|
+
modulePath = clientReference.$$id;
|
|
1420
|
+
existingId = "";
|
|
1421
|
+
var resolvedModuleData = config[modulePath];
|
|
1422
|
+
if (resolvedModuleData) existingId = resolvedModuleData.name;
|
|
1423
|
+
else {
|
|
1424
|
+
var idx = modulePath.lastIndexOf("#");
|
|
1425
|
+
-1 !== idx &&
|
|
1426
|
+
((existingId = modulePath.slice(idx + 1)),
|
|
1427
|
+
(resolvedModuleData = config[modulePath.slice(0, idx)]));
|
|
1428
|
+
if (!resolvedModuleData)
|
|
1429
|
+
throw Error(
|
|
1430
|
+
'Could not find the module "' +
|
|
1431
|
+
modulePath +
|
|
1432
|
+
'" in the React Client Manifest. This is probably a bug in the React Server Components bundler.'
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1435
|
+
if (!0 === resolvedModuleData.async && !0 === clientReference.$$async)
|
|
1436
|
+
throw Error(
|
|
1437
|
+
'The module "' +
|
|
1438
|
+
modulePath +
|
|
1439
|
+
'" 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.'
|
|
1440
|
+
);
|
|
1441
|
+
var JSCompiler_inline_result =
|
|
1442
|
+
!0 === resolvedModuleData.async || !0 === clientReference.$$async
|
|
1443
|
+
? [resolvedModuleData.id, resolvedModuleData.chunks, existingId, 1]
|
|
1444
|
+
: [resolvedModuleData.id, resolvedModuleData.chunks, existingId];
|
|
1445
|
+
request.pendingChunks++;
|
|
1446
|
+
var importId = request.nextChunkId++,
|
|
1447
|
+
json = stringify(JSCompiler_inline_result),
|
|
1448
|
+
processedChunk = importId.toString(16) + ":I" + json + "\n";
|
|
1449
|
+
request.completedImportChunks.push(processedChunk);
|
|
1450
|
+
writtenClientReferences.set(clientReferenceKey, importId);
|
|
1451
|
+
return parent[0] === REACT_ELEMENT_TYPE && "1" === parentPropertyName
|
|
1452
|
+
? serializeLazyID(importId)
|
|
1453
|
+
: serializeByValueID(importId);
|
|
1454
|
+
} catch (x) {
|
|
1455
|
+
return (
|
|
1456
|
+
request.pendingChunks++,
|
|
1457
|
+
(parent = request.nextChunkId++),
|
|
1458
|
+
(parentPropertyName = logRecoverableError(request, x, null)),
|
|
1459
|
+
emitErrorChunk(request, parent, parentPropertyName),
|
|
1460
|
+
serializeByValueID(parent)
|
|
1461
|
+
);
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
function outlineModelWithFormatContext(request, value, formatContext) {
|
|
1465
|
+
value = createTask(
|
|
1466
|
+
request,
|
|
1467
|
+
value,
|
|
1468
|
+
null,
|
|
1469
|
+
!1,
|
|
1470
|
+
formatContext,
|
|
1471
|
+
request.abortableTasks
|
|
1472
|
+
);
|
|
1473
|
+
retryTask(request, value);
|
|
1474
|
+
return value.id;
|
|
1475
|
+
}
|
|
1476
|
+
function serializeTypedArray(request, tag, typedArray) {
|
|
1477
|
+
request.pendingChunks++;
|
|
1478
|
+
var bufferId = request.nextChunkId++;
|
|
1479
|
+
emitTypedArrayChunk(request, bufferId, tag, typedArray, !1);
|
|
1480
|
+
return serializeByValueID(bufferId);
|
|
1481
|
+
}
|
|
1482
|
+
function serializeBlob(request, blob) {
|
|
1483
|
+
function progress(entry) {
|
|
1484
|
+
if (0 === newTask.status)
|
|
1485
|
+
if (entry.done)
|
|
1486
|
+
request.cacheController.signal.removeEventListener("abort", abortBlob),
|
|
1487
|
+
pingTask(request, newTask);
|
|
1488
|
+
else
|
|
1489
|
+
return (
|
|
1490
|
+
model.push(entry.value), reader.read().then(progress).catch(error)
|
|
1491
|
+
);
|
|
1492
|
+
}
|
|
1493
|
+
function error(reason) {
|
|
1494
|
+
0 === newTask.status &&
|
|
1495
|
+
(request.cacheController.signal.removeEventListener("abort", abortBlob),
|
|
1496
|
+
erroredTask(request, newTask, reason),
|
|
1497
|
+
enqueueFlush(request),
|
|
1498
|
+
reader.cancel(reason).then(error, error));
|
|
1499
|
+
}
|
|
1500
|
+
function abortBlob() {
|
|
1501
|
+
if (0 === newTask.status) {
|
|
1502
|
+
var signal = request.cacheController.signal;
|
|
1503
|
+
signal.removeEventListener("abort", abortBlob);
|
|
1504
|
+
signal = signal.reason;
|
|
1505
|
+
21 === request.type
|
|
1506
|
+
? (request.abortableTasks.delete(newTask),
|
|
1507
|
+
haltTask(newTask),
|
|
1508
|
+
finishHaltedTask(newTask, request))
|
|
1509
|
+
: (erroredTask(request, newTask, signal), enqueueFlush(request));
|
|
1510
|
+
reader.cancel(signal).then(error, error);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
var model = [blob.type],
|
|
1514
|
+
newTask = createTask(request, model, null, !1, 0, request.abortableTasks),
|
|
1515
|
+
reader = blob.stream().getReader();
|
|
1516
|
+
request.cacheController.signal.addEventListener("abort", abortBlob);
|
|
1517
|
+
reader.read().then(progress).catch(error);
|
|
1518
|
+
return "$B" + newTask.id.toString(16);
|
|
1519
|
+
}
|
|
1520
|
+
var modelRoot = !1;
|
|
1521
|
+
function renderModelDestructive(
|
|
1522
|
+
request,
|
|
1523
|
+
task,
|
|
1524
|
+
parent,
|
|
1525
|
+
parentPropertyName,
|
|
1526
|
+
value
|
|
1527
|
+
) {
|
|
1528
|
+
task.model = value;
|
|
1529
|
+
if (value === REACT_ELEMENT_TYPE) return "$";
|
|
1530
|
+
if (null === value) return null;
|
|
1531
|
+
if ("object" === typeof value) {
|
|
1532
|
+
switch (value.$$typeof) {
|
|
1533
|
+
case REACT_ELEMENT_TYPE:
|
|
1534
|
+
var elementReference = null,
|
|
1535
|
+
writtenObjects = request.writtenObjects;
|
|
1536
|
+
if (null === task.keyPath && !task.implicitSlot) {
|
|
1537
|
+
var existingReference = writtenObjects.get(value);
|
|
1538
|
+
if (void 0 !== existingReference)
|
|
1539
|
+
if (modelRoot === value) modelRoot = null;
|
|
1540
|
+
else return existingReference;
|
|
1541
|
+
else
|
|
1542
|
+
-1 === parentPropertyName.indexOf(":") &&
|
|
1543
|
+
((parent = writtenObjects.get(parent)),
|
|
1544
|
+
void 0 !== parent &&
|
|
1545
|
+
((elementReference = parent + ":" + parentPropertyName),
|
|
1546
|
+
writtenObjects.set(value, elementReference)));
|
|
1547
|
+
}
|
|
1548
|
+
if (3200 < serializedSize) return deferTask(request, task);
|
|
1549
|
+
parentPropertyName = value.props;
|
|
1550
|
+
parent = parentPropertyName.ref;
|
|
1551
|
+
request = renderElement(
|
|
1552
|
+
request,
|
|
1553
|
+
task,
|
|
1554
|
+
value.type,
|
|
1555
|
+
value.key,
|
|
1556
|
+
void 0 !== parent ? parent : null,
|
|
1557
|
+
parentPropertyName
|
|
1558
|
+
);
|
|
1559
|
+
"object" === typeof request &&
|
|
1560
|
+
null !== request &&
|
|
1561
|
+
null !== elementReference &&
|
|
1562
|
+
(writtenObjects.has(request) ||
|
|
1563
|
+
writtenObjects.set(request, elementReference));
|
|
1564
|
+
return request;
|
|
1565
|
+
case REACT_LAZY_TYPE:
|
|
1566
|
+
if (3200 < serializedSize) return deferTask(request, task);
|
|
1567
|
+
task.thenableState = null;
|
|
1568
|
+
parentPropertyName = value._init;
|
|
1569
|
+
value = parentPropertyName(value._payload);
|
|
1570
|
+
if (12 === request.status) throw null;
|
|
1571
|
+
return renderModelDestructive(request, task, emptyRoot, "", value);
|
|
1572
|
+
case REACT_LEGACY_ELEMENT_TYPE:
|
|
1573
|
+
throw Error(
|
|
1574
|
+
'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.'
|
|
1575
|
+
);
|
|
1576
|
+
}
|
|
1577
|
+
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
|
1578
|
+
return serializeClientReference(
|
|
1579
|
+
request,
|
|
1580
|
+
parent,
|
|
1581
|
+
parentPropertyName,
|
|
1582
|
+
value
|
|
1583
|
+
);
|
|
1584
|
+
if (
|
|
1585
|
+
void 0 !== request.temporaryReferences &&
|
|
1586
|
+
((elementReference = request.temporaryReferences.get(value)),
|
|
1587
|
+
void 0 !== elementReference)
|
|
1588
|
+
)
|
|
1589
|
+
return "$T" + elementReference;
|
|
1590
|
+
elementReference = request.writtenObjects;
|
|
1591
|
+
writtenObjects = elementReference.get(value);
|
|
1592
|
+
if ("function" === typeof value.then) {
|
|
1593
|
+
if (void 0 !== writtenObjects) {
|
|
1594
|
+
if (null !== task.keyPath || task.implicitSlot)
|
|
1595
|
+
return "$@" + serializeThenable(request, task, value).toString(16);
|
|
1596
|
+
if (modelRoot === value) modelRoot = null;
|
|
1597
|
+
else return writtenObjects;
|
|
1598
|
+
}
|
|
1599
|
+
request = "$@" + serializeThenable(request, task, value).toString(16);
|
|
1600
|
+
elementReference.set(value, request);
|
|
1601
|
+
return request;
|
|
1602
|
+
}
|
|
1603
|
+
if (void 0 !== writtenObjects)
|
|
1604
|
+
if (modelRoot === value) {
|
|
1605
|
+
if (writtenObjects !== serializeByValueID(task.id))
|
|
1606
|
+
return writtenObjects;
|
|
1607
|
+
modelRoot = null;
|
|
1608
|
+
} else return writtenObjects;
|
|
1609
|
+
else if (
|
|
1610
|
+
-1 === parentPropertyName.indexOf(":") &&
|
|
1611
|
+
((writtenObjects = elementReference.get(parent)),
|
|
1612
|
+
void 0 !== writtenObjects)
|
|
1613
|
+
) {
|
|
1614
|
+
existingReference = parentPropertyName;
|
|
1615
|
+
if (isArrayImpl(parent) && parent[0] === REACT_ELEMENT_TYPE)
|
|
1616
|
+
switch (parentPropertyName) {
|
|
1617
|
+
case "1":
|
|
1618
|
+
existingReference = "type";
|
|
1619
|
+
break;
|
|
1620
|
+
case "2":
|
|
1621
|
+
existingReference = "key";
|
|
1622
|
+
break;
|
|
1623
|
+
case "3":
|
|
1624
|
+
existingReference = "props";
|
|
1625
|
+
break;
|
|
1626
|
+
case "4":
|
|
1627
|
+
existingReference = "_owner";
|
|
1628
|
+
}
|
|
1629
|
+
elementReference.set(value, writtenObjects + ":" + existingReference);
|
|
1630
|
+
}
|
|
1631
|
+
if (isArrayImpl(value)) return renderFragment(request, task, value);
|
|
1632
|
+
if (value instanceof Map)
|
|
1633
|
+
return (
|
|
1634
|
+
(value = Array.from(value)),
|
|
1635
|
+
"$Q" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1636
|
+
);
|
|
1637
|
+
if (value instanceof Set)
|
|
1638
|
+
return (
|
|
1639
|
+
(value = Array.from(value)),
|
|
1640
|
+
"$W" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1641
|
+
);
|
|
1642
|
+
if ("function" === typeof FormData && value instanceof FormData)
|
|
1643
|
+
return (
|
|
1644
|
+
(value = Array.from(value.entries())),
|
|
1645
|
+
"$K" + outlineModelWithFormatContext(request, value, 0).toString(16)
|
|
1646
|
+
);
|
|
1647
|
+
if (value instanceof Error) return "$Z";
|
|
1648
|
+
if (value instanceof ArrayBuffer)
|
|
1649
|
+
return serializeTypedArray(request, "A", new Uint8Array(value));
|
|
1650
|
+
if (value instanceof Int8Array)
|
|
1651
|
+
return serializeTypedArray(request, "O", value);
|
|
1652
|
+
if (value instanceof Uint8Array)
|
|
1653
|
+
return serializeTypedArray(request, "o", value);
|
|
1654
|
+
if (value instanceof Uint8ClampedArray)
|
|
1655
|
+
return serializeTypedArray(request, "U", value);
|
|
1656
|
+
if (value instanceof Int16Array)
|
|
1657
|
+
return serializeTypedArray(request, "S", value);
|
|
1658
|
+
if (value instanceof Uint16Array)
|
|
1659
|
+
return serializeTypedArray(request, "s", value);
|
|
1660
|
+
if (value instanceof Int32Array)
|
|
1661
|
+
return serializeTypedArray(request, "L", value);
|
|
1662
|
+
if (value instanceof Uint32Array)
|
|
1663
|
+
return serializeTypedArray(request, "l", value);
|
|
1664
|
+
if (value instanceof Float32Array)
|
|
1665
|
+
return serializeTypedArray(request, "G", value);
|
|
1666
|
+
if (value instanceof Float64Array)
|
|
1667
|
+
return serializeTypedArray(request, "g", value);
|
|
1668
|
+
if (value instanceof BigInt64Array)
|
|
1669
|
+
return serializeTypedArray(request, "M", value);
|
|
1670
|
+
if (value instanceof BigUint64Array)
|
|
1671
|
+
return serializeTypedArray(request, "m", value);
|
|
1672
|
+
if (value instanceof DataView)
|
|
1673
|
+
return serializeTypedArray(request, "V", value);
|
|
1674
|
+
if ("function" === typeof Blob && value instanceof Blob)
|
|
1675
|
+
return serializeBlob(request, value);
|
|
1676
|
+
if ((elementReference = getIteratorFn(value)))
|
|
1677
|
+
return (
|
|
1678
|
+
(parentPropertyName = elementReference.call(value)),
|
|
1679
|
+
parentPropertyName === value
|
|
1680
|
+
? ((value = Array.from(parentPropertyName)),
|
|
1681
|
+
"$i" +
|
|
1682
|
+
outlineModelWithFormatContext(request, value, 0).toString(16))
|
|
1683
|
+
: renderFragment(request, task, Array.from(parentPropertyName))
|
|
1684
|
+
);
|
|
1685
|
+
if ("function" === typeof ReadableStream && value instanceof ReadableStream)
|
|
1686
|
+
return serializeReadableStream(request, task, value);
|
|
1687
|
+
elementReference = value[ASYNC_ITERATOR];
|
|
1688
|
+
if ("function" === typeof elementReference)
|
|
1689
|
+
return (
|
|
1690
|
+
null !== task.keyPath
|
|
1691
|
+
? ((request = [
|
|
1692
|
+
REACT_ELEMENT_TYPE,
|
|
1693
|
+
REACT_FRAGMENT_TYPE,
|
|
1694
|
+
task.keyPath,
|
|
1695
|
+
{ children: value }
|
|
1696
|
+
]),
|
|
1697
|
+
(request = task.implicitSlot ? [request] : request))
|
|
1698
|
+
: ((parentPropertyName = elementReference.call(value)),
|
|
1699
|
+
(request = serializeAsyncIterable(
|
|
1700
|
+
request,
|
|
1701
|
+
task,
|
|
1702
|
+
value,
|
|
1703
|
+
parentPropertyName
|
|
1704
|
+
))),
|
|
1705
|
+
request
|
|
1706
|
+
);
|
|
1707
|
+
if (value instanceof Date) return "$D" + value.toJSON();
|
|
1708
|
+
request = getPrototypeOf(value);
|
|
1709
|
+
if (
|
|
1710
|
+
request !== ObjectPrototype &&
|
|
1711
|
+
(null === request || null !== getPrototypeOf(request))
|
|
1712
|
+
)
|
|
1713
|
+
throw Error(
|
|
1714
|
+
"Only plain objects, and a few built-ins, can be passed to Client Components from Server Components. Classes or null prototypes are not supported." +
|
|
1715
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
|
1716
|
+
);
|
|
1717
|
+
return value;
|
|
1718
|
+
}
|
|
1719
|
+
if ("string" === typeof value) {
|
|
1720
|
+
serializedSize += value.length;
|
|
1721
|
+
if (
|
|
1722
|
+
"Z" === value[value.length - 1] &&
|
|
1723
|
+
parent[parentPropertyName] instanceof Date
|
|
1724
|
+
)
|
|
1725
|
+
return "$D" + value;
|
|
1726
|
+
if (1024 <= value.length && null !== byteLengthOfChunk)
|
|
1727
|
+
return (
|
|
1728
|
+
request.pendingChunks++,
|
|
1729
|
+
(task = request.nextChunkId++),
|
|
1730
|
+
emitTextChunk(request, task, value, !1),
|
|
1731
|
+
serializeByValueID(task)
|
|
1732
|
+
);
|
|
1733
|
+
request = "$" === value[0] ? "$" + value : value;
|
|
1734
|
+
return request;
|
|
1735
|
+
}
|
|
1736
|
+
if ("boolean" === typeof value) return value;
|
|
1737
|
+
if ("number" === typeof value)
|
|
1738
|
+
return Number.isFinite(value)
|
|
1739
|
+
? 0 === value && -Infinity === 1 / value
|
|
1740
|
+
? "$-0"
|
|
1741
|
+
: value
|
|
1742
|
+
: Infinity === value
|
|
1743
|
+
? "$Infinity"
|
|
1744
|
+
: -Infinity === value
|
|
1745
|
+
? "$-Infinity"
|
|
1746
|
+
: "$NaN";
|
|
1747
|
+
if ("undefined" === typeof value) return "$undefined";
|
|
1748
|
+
if ("function" === typeof value) {
|
|
1749
|
+
if (value.$$typeof === CLIENT_REFERENCE_TAG$1)
|
|
1750
|
+
return serializeClientReference(
|
|
1751
|
+
request,
|
|
1752
|
+
parent,
|
|
1753
|
+
parentPropertyName,
|
|
1754
|
+
value
|
|
1755
|
+
);
|
|
1756
|
+
if (value.$$typeof === SERVER_REFERENCE_TAG)
|
|
1757
|
+
return (
|
|
1758
|
+
(task = request.writtenServerReferences),
|
|
1759
|
+
(parentPropertyName = task.get(value)),
|
|
1760
|
+
void 0 !== parentPropertyName
|
|
1761
|
+
? (request = "$h" + parentPropertyName.toString(16))
|
|
1762
|
+
: ((parentPropertyName = value.$$bound),
|
|
1763
|
+
(parentPropertyName =
|
|
1764
|
+
null === parentPropertyName
|
|
1765
|
+
? null
|
|
1766
|
+
: Promise.resolve(parentPropertyName)),
|
|
1767
|
+
(request = outlineModelWithFormatContext(
|
|
1768
|
+
request,
|
|
1769
|
+
{ id: value.$$id, bound: parentPropertyName },
|
|
1770
|
+
0
|
|
1771
|
+
)),
|
|
1772
|
+
task.set(value, request),
|
|
1773
|
+
(request = "$h" + request.toString(16))),
|
|
1774
|
+
request
|
|
1775
|
+
);
|
|
1776
|
+
if (
|
|
1777
|
+
void 0 !== request.temporaryReferences &&
|
|
1778
|
+
((request = request.temporaryReferences.get(value)), void 0 !== request)
|
|
1779
|
+
)
|
|
1780
|
+
return "$T" + request;
|
|
1781
|
+
if (value.$$typeof === TEMPORARY_REFERENCE_TAG)
|
|
1782
|
+
throw Error(
|
|
1783
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
|
1784
|
+
);
|
|
1785
|
+
if (/^on[A-Z]/.test(parentPropertyName))
|
|
1786
|
+
throw Error(
|
|
1787
|
+
"Event handlers cannot be passed to Client Component props." +
|
|
1788
|
+
describeObjectForErrorMessage(parent, parentPropertyName) +
|
|
1789
|
+
"\nIf you need interactivity, consider converting part of this to a Client Component."
|
|
1790
|
+
);
|
|
1791
|
+
throw Error(
|
|
1792
|
+
'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.' +
|
|
1793
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
if ("symbol" === typeof value) {
|
|
1797
|
+
task = request.writtenSymbols;
|
|
1798
|
+
elementReference = task.get(value);
|
|
1799
|
+
if (void 0 !== elementReference)
|
|
1800
|
+
return serializeByValueID(elementReference);
|
|
1801
|
+
elementReference = value.description;
|
|
1802
|
+
if (Symbol.for(elementReference) !== value)
|
|
1803
|
+
throw Error(
|
|
1804
|
+
"Only global symbols received from Symbol.for(...) can be passed to Client Components. The symbol Symbol.for(" +
|
|
1805
|
+
(value.description + ") cannot be found among global symbols.") +
|
|
1806
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
|
1807
|
+
);
|
|
1808
|
+
request.pendingChunks++;
|
|
1809
|
+
parentPropertyName = request.nextChunkId++;
|
|
1810
|
+
parent = encodeReferenceChunk(
|
|
1811
|
+
request,
|
|
1812
|
+
parentPropertyName,
|
|
1813
|
+
"$S" + elementReference
|
|
1814
|
+
);
|
|
1815
|
+
request.completedImportChunks.push(parent);
|
|
1816
|
+
task.set(value, parentPropertyName);
|
|
1817
|
+
return serializeByValueID(parentPropertyName);
|
|
1818
|
+
}
|
|
1819
|
+
if ("bigint" === typeof value) return "$n" + value.toString(10);
|
|
1820
|
+
throw Error(
|
|
1821
|
+
"Type " +
|
|
1822
|
+
typeof value +
|
|
1823
|
+
" is not supported in Client Component props." +
|
|
1824
|
+
describeObjectForErrorMessage(parent, parentPropertyName)
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
function logRecoverableError(request, error) {
|
|
1828
|
+
var prevRequest = currentRequest;
|
|
1829
|
+
currentRequest = null;
|
|
1830
|
+
try {
|
|
1831
|
+
var errorDigest = requestStorage.run(void 0, request.onError, error);
|
|
1832
|
+
} finally {
|
|
1833
|
+
currentRequest = prevRequest;
|
|
1834
|
+
}
|
|
1835
|
+
if (null != errorDigest && "string" !== typeof errorDigest)
|
|
1836
|
+
throw Error(
|
|
1837
|
+
'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 "' +
|
|
1838
|
+
typeof errorDigest +
|
|
1839
|
+
'" instead'
|
|
1840
|
+
);
|
|
1841
|
+
return errorDigest || "";
|
|
1842
|
+
}
|
|
1843
|
+
function fatalError(request, error) {
|
|
1844
|
+
var onFatalError = request.onFatalError;
|
|
1845
|
+
onFatalError(error);
|
|
1846
|
+
null !== request.destination
|
|
1847
|
+
? ((request.status = 14), request.destination.destroy(error))
|
|
1848
|
+
: ((request.status = 13), (request.fatalError = error));
|
|
1849
|
+
request.cacheController.abort(
|
|
1850
|
+
Error("The render was aborted due to a fatal error.", { cause: error })
|
|
1851
|
+
);
|
|
1852
|
+
}
|
|
1853
|
+
function emitErrorChunk(request, id, digest) {
|
|
1854
|
+
digest = { digest: digest };
|
|
1855
|
+
id = id.toString(16) + ":E" + stringify(digest) + "\n";
|
|
1856
|
+
request.completedErrorChunks.push(id);
|
|
1857
|
+
}
|
|
1858
|
+
function emitTypedArrayChunk(request, id, tag, typedArray, debug) {
|
|
1859
|
+
debug ? request.pendingDebugChunks++ : request.pendingChunks++;
|
|
1860
|
+
typedArray = new Uint8Array(
|
|
1861
|
+
typedArray.buffer,
|
|
1862
|
+
typedArray.byteOffset,
|
|
1863
|
+
typedArray.byteLength
|
|
1864
|
+
);
|
|
1865
|
+
debug = typedArray.byteLength;
|
|
1866
|
+
id = id.toString(16) + ":" + tag + debug.toString(16) + ",";
|
|
1867
|
+
request.completedRegularChunks.push(id, typedArray);
|
|
1868
|
+
}
|
|
1869
|
+
function emitTextChunk(request, id, text, debug) {
|
|
1870
|
+
if (null === byteLengthOfChunk)
|
|
1871
|
+
throw Error(
|
|
1872
|
+
"Existence of byteLengthOfChunk should have already been checked. This is a bug in React."
|
|
1873
|
+
);
|
|
1874
|
+
debug ? request.pendingDebugChunks++ : request.pendingChunks++;
|
|
1875
|
+
debug = byteLengthOfChunk(text);
|
|
1876
|
+
id = id.toString(16) + ":T" + debug.toString(16) + ",";
|
|
1877
|
+
request.completedRegularChunks.push(id, text);
|
|
1878
|
+
}
|
|
1879
|
+
function emitChunk(request, task, value) {
|
|
1880
|
+
var id = task.id;
|
|
1881
|
+
"string" === typeof value && null !== byteLengthOfChunk
|
|
1882
|
+
? emitTextChunk(request, id, value, !1)
|
|
1883
|
+
: value instanceof ArrayBuffer
|
|
1884
|
+
? emitTypedArrayChunk(request, id, "A", new Uint8Array(value), !1)
|
|
1885
|
+
: value instanceof Int8Array
|
|
1886
|
+
? emitTypedArrayChunk(request, id, "O", value, !1)
|
|
1887
|
+
: value instanceof Uint8Array
|
|
1888
|
+
? emitTypedArrayChunk(request, id, "o", value, !1)
|
|
1889
|
+
: value instanceof Uint8ClampedArray
|
|
1890
|
+
? emitTypedArrayChunk(request, id, "U", value, !1)
|
|
1891
|
+
: value instanceof Int16Array
|
|
1892
|
+
? emitTypedArrayChunk(request, id, "S", value, !1)
|
|
1893
|
+
: value instanceof Uint16Array
|
|
1894
|
+
? emitTypedArrayChunk(request, id, "s", value, !1)
|
|
1895
|
+
: value instanceof Int32Array
|
|
1896
|
+
? emitTypedArrayChunk(request, id, "L", value, !1)
|
|
1897
|
+
: value instanceof Uint32Array
|
|
1898
|
+
? emitTypedArrayChunk(request, id, "l", value, !1)
|
|
1899
|
+
: value instanceof Float32Array
|
|
1900
|
+
? emitTypedArrayChunk(request, id, "G", value, !1)
|
|
1901
|
+
: value instanceof Float64Array
|
|
1902
|
+
? emitTypedArrayChunk(request, id, "g", value, !1)
|
|
1903
|
+
: value instanceof BigInt64Array
|
|
1904
|
+
? emitTypedArrayChunk(request, id, "M", value, !1)
|
|
1905
|
+
: value instanceof BigUint64Array
|
|
1906
|
+
? emitTypedArrayChunk(request, id, "m", value, !1)
|
|
1907
|
+
: value instanceof DataView
|
|
1908
|
+
? emitTypedArrayChunk(request, id, "V", value, !1)
|
|
1909
|
+
: ((value = stringify(value, task.toJSON)),
|
|
1910
|
+
(task =
|
|
1911
|
+
task.id.toString(16) + ":" + value + "\n"),
|
|
1912
|
+
request.completedRegularChunks.push(task));
|
|
1913
|
+
}
|
|
1914
|
+
function erroredTask(request, task, error) {
|
|
1915
|
+
task.status = 4;
|
|
1916
|
+
error = logRecoverableError(request, error, task);
|
|
1917
|
+
emitErrorChunk(request, task.id, error);
|
|
1918
|
+
request.abortableTasks.delete(task);
|
|
1919
|
+
callOnAllReadyIfReady(request);
|
|
1920
|
+
}
|
|
1921
|
+
var emptyRoot = {};
|
|
1922
|
+
function retryTask(request, task) {
|
|
1923
|
+
if (0 === task.status) {
|
|
1924
|
+
task.status = 5;
|
|
1925
|
+
var parentSerializedSize = serializedSize;
|
|
1926
|
+
try {
|
|
1927
|
+
modelRoot = task.model;
|
|
1928
|
+
var resolvedModel = renderModelDestructive(
|
|
1929
|
+
request,
|
|
1930
|
+
task,
|
|
1931
|
+
emptyRoot,
|
|
1932
|
+
"",
|
|
1933
|
+
task.model
|
|
1934
|
+
);
|
|
1935
|
+
modelRoot = resolvedModel;
|
|
1936
|
+
task.keyPath = null;
|
|
1937
|
+
task.implicitSlot = !1;
|
|
1938
|
+
if ("object" === typeof resolvedModel && null !== resolvedModel)
|
|
1939
|
+
request.writtenObjects.set(resolvedModel, serializeByValueID(task.id)),
|
|
1940
|
+
emitChunk(request, task, resolvedModel);
|
|
1941
|
+
else {
|
|
1942
|
+
var json = stringify(resolvedModel),
|
|
1943
|
+
processedChunk = task.id.toString(16) + ":" + json + "\n";
|
|
1944
|
+
request.completedRegularChunks.push(processedChunk);
|
|
1945
|
+
}
|
|
1946
|
+
task.status = 1;
|
|
1947
|
+
request.abortableTasks.delete(task);
|
|
1948
|
+
callOnAllReadyIfReady(request);
|
|
1949
|
+
} catch (thrownValue) {
|
|
1950
|
+
if (12 === request.status)
|
|
1951
|
+
if (
|
|
1952
|
+
(request.abortableTasks.delete(task),
|
|
1953
|
+
(task.status = 0),
|
|
1954
|
+
21 === request.type)
|
|
1955
|
+
)
|
|
1956
|
+
haltTask(task), finishHaltedTask(task, request);
|
|
1957
|
+
else {
|
|
1958
|
+
var errorId = request.fatalError;
|
|
1959
|
+
abortTask(task);
|
|
1960
|
+
finishAbortedTask(task, request, errorId);
|
|
1961
|
+
}
|
|
1962
|
+
else {
|
|
1963
|
+
var x =
|
|
1964
|
+
thrownValue === SuspenseException
|
|
1965
|
+
? getSuspendedThenable()
|
|
1966
|
+
: thrownValue;
|
|
1967
|
+
if (
|
|
1968
|
+
"object" === typeof x &&
|
|
1969
|
+
null !== x &&
|
|
1970
|
+
"function" === typeof x.then
|
|
1971
|
+
) {
|
|
1972
|
+
task.status = 0;
|
|
1973
|
+
task.thenableState = getThenableStateAfterSuspending();
|
|
1974
|
+
var ping = task.ping;
|
|
1975
|
+
x.then(ping, ping);
|
|
1976
|
+
} else erroredTask(request, task, x);
|
|
1977
|
+
}
|
|
1978
|
+
} finally {
|
|
1979
|
+
serializedSize = parentSerializedSize;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
function tryStreamTask(request, task) {
|
|
1984
|
+
var parentSerializedSize = serializedSize;
|
|
1985
|
+
try {
|
|
1986
|
+
emitChunk(request, task, task.model);
|
|
1987
|
+
} finally {
|
|
1988
|
+
serializedSize = parentSerializedSize;
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
function performWork(request) {
|
|
1992
|
+
var prevDispatcher = ReactSharedInternalsServer.H;
|
|
1993
|
+
ReactSharedInternalsServer.H = HooksDispatcher;
|
|
1994
|
+
var prevRequest = currentRequest;
|
|
1995
|
+
currentRequest$1 = currentRequest = request;
|
|
1996
|
+
try {
|
|
1997
|
+
var pingedTasks = request.pingedTasks;
|
|
1998
|
+
request.pingedTasks = [];
|
|
1999
|
+
for (var i = 0; i < pingedTasks.length; i++)
|
|
2000
|
+
retryTask(request, pingedTasks[i]);
|
|
2001
|
+
flushCompletedChunks(request);
|
|
2002
|
+
} catch (error) {
|
|
2003
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2004
|
+
} finally {
|
|
2005
|
+
(ReactSharedInternalsServer.H = prevDispatcher),
|
|
2006
|
+
(currentRequest$1 = null),
|
|
2007
|
+
(currentRequest = prevRequest);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
function abortTask(task) {
|
|
2011
|
+
0 === task.status && (task.status = 3);
|
|
2012
|
+
}
|
|
2013
|
+
function finishAbortedTask(task, request, errorId) {
|
|
2014
|
+
3 === task.status &&
|
|
2015
|
+
((errorId = serializeByValueID(errorId)),
|
|
2016
|
+
(task = encodeReferenceChunk(request, task.id, errorId)),
|
|
2017
|
+
request.completedErrorChunks.push(task));
|
|
2018
|
+
}
|
|
2019
|
+
function haltTask(task) {
|
|
2020
|
+
0 === task.status && (task.status = 3);
|
|
2021
|
+
}
|
|
2022
|
+
function finishHaltedTask(task, request) {
|
|
2023
|
+
3 === task.status && request.pendingChunks--;
|
|
2024
|
+
}
|
|
2025
|
+
function flushCompletedChunks(request) {
|
|
2026
|
+
var destination = request.destination;
|
|
2027
|
+
if (null !== destination) {
|
|
2028
|
+
currentView = new Uint8Array(2048);
|
|
2029
|
+
writtenBytes = 0;
|
|
2030
|
+
destinationHasCapacity = !0;
|
|
2031
|
+
try {
|
|
2032
|
+
for (
|
|
2033
|
+
var importsChunks = request.completedImportChunks, i = 0;
|
|
2034
|
+
i < importsChunks.length;
|
|
2035
|
+
i++
|
|
2036
|
+
)
|
|
2037
|
+
if (
|
|
2038
|
+
(request.pendingChunks--,
|
|
2039
|
+
!writeChunkAndReturn(destination, importsChunks[i]))
|
|
2040
|
+
) {
|
|
2041
|
+
request.destination = null;
|
|
2042
|
+
i++;
|
|
2043
|
+
break;
|
|
2044
|
+
}
|
|
2045
|
+
importsChunks.splice(0, i);
|
|
2046
|
+
var hintChunks = request.completedHintChunks;
|
|
2047
|
+
for (i = 0; i < hintChunks.length; i++)
|
|
2048
|
+
if (!writeChunkAndReturn(destination, hintChunks[i])) {
|
|
2049
|
+
request.destination = null;
|
|
2050
|
+
i++;
|
|
2051
|
+
break;
|
|
2052
|
+
}
|
|
2053
|
+
hintChunks.splice(0, i);
|
|
2054
|
+
var regularChunks = request.completedRegularChunks;
|
|
2055
|
+
for (i = 0; i < regularChunks.length; i++)
|
|
2056
|
+
if (
|
|
2057
|
+
(request.pendingChunks--,
|
|
2058
|
+
!writeChunkAndReturn(destination, regularChunks[i]))
|
|
2059
|
+
) {
|
|
2060
|
+
request.destination = null;
|
|
2061
|
+
i++;
|
|
2062
|
+
break;
|
|
2063
|
+
}
|
|
2064
|
+
regularChunks.splice(0, i);
|
|
2065
|
+
var errorChunks = request.completedErrorChunks;
|
|
2066
|
+
for (i = 0; i < errorChunks.length; i++)
|
|
2067
|
+
if (
|
|
2068
|
+
(request.pendingChunks--,
|
|
2069
|
+
!writeChunkAndReturn(destination, errorChunks[i]))
|
|
2070
|
+
) {
|
|
2071
|
+
request.destination = null;
|
|
2072
|
+
i++;
|
|
2073
|
+
break;
|
|
2074
|
+
}
|
|
2075
|
+
errorChunks.splice(0, i);
|
|
2076
|
+
} finally {
|
|
2077
|
+
(request.flushScheduled = !1),
|
|
2078
|
+
currentView &&
|
|
2079
|
+
0 < writtenBytes &&
|
|
2080
|
+
destination.write(currentView.subarray(0, writtenBytes)),
|
|
2081
|
+
(currentView = null),
|
|
2082
|
+
(writtenBytes = 0),
|
|
2083
|
+
(destinationHasCapacity = !0);
|
|
2084
|
+
}
|
|
2085
|
+
"function" === typeof destination.flush && destination.flush();
|
|
2086
|
+
}
|
|
2087
|
+
0 === request.pendingChunks &&
|
|
2088
|
+
(12 > request.status &&
|
|
2089
|
+
request.cacheController.abort(
|
|
2090
|
+
Error(
|
|
2091
|
+
"This render completed successfully. All cacheSignals are now aborted to allow clean up of any unused resources."
|
|
2092
|
+
)
|
|
2093
|
+
),
|
|
2094
|
+
null !== request.destination &&
|
|
2095
|
+
((request.status = 14),
|
|
2096
|
+
request.destination.end(),
|
|
2097
|
+
(request.destination = null)));
|
|
2098
|
+
}
|
|
2099
|
+
function startWork(request) {
|
|
2100
|
+
request.flushScheduled = null !== request.destination;
|
|
2101
|
+
scheduleMicrotask(function () {
|
|
2102
|
+
requestStorage.run(request, performWork, request);
|
|
2103
|
+
});
|
|
2104
|
+
setImmediate(function () {
|
|
2105
|
+
10 === request.status && (request.status = 11);
|
|
2106
|
+
});
|
|
2107
|
+
}
|
|
2108
|
+
function enqueueFlush(request) {
|
|
2109
|
+
!1 === request.flushScheduled &&
|
|
2110
|
+
0 === request.pingedTasks.length &&
|
|
2111
|
+
null !== request.destination &&
|
|
2112
|
+
((request.flushScheduled = !0),
|
|
2113
|
+
setImmediate(function () {
|
|
2114
|
+
request.flushScheduled = !1;
|
|
2115
|
+
flushCompletedChunks(request);
|
|
2116
|
+
}));
|
|
2117
|
+
}
|
|
2118
|
+
function callOnAllReadyIfReady(request) {
|
|
2119
|
+
0 === request.abortableTasks.size &&
|
|
2120
|
+
((request = request.onAllReady), request());
|
|
2121
|
+
}
|
|
2122
|
+
function startFlowing(request, destination) {
|
|
2123
|
+
if (13 === request.status)
|
|
2124
|
+
(request.status = 14), destination.destroy(request.fatalError);
|
|
2125
|
+
else if (14 !== request.status && null === request.destination) {
|
|
2126
|
+
request.destination = destination;
|
|
2127
|
+
try {
|
|
2128
|
+
flushCompletedChunks(request);
|
|
2129
|
+
} catch (error) {
|
|
2130
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
function finishHalt(request, abortedTasks) {
|
|
2135
|
+
try {
|
|
2136
|
+
abortedTasks.forEach(function (task) {
|
|
2137
|
+
return finishHaltedTask(task, request);
|
|
2138
|
+
});
|
|
2139
|
+
var onAllReady = request.onAllReady;
|
|
2140
|
+
onAllReady();
|
|
2141
|
+
flushCompletedChunks(request);
|
|
2142
|
+
} catch (error) {
|
|
2143
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
function finishAbort(request, abortedTasks, errorId) {
|
|
2147
|
+
try {
|
|
2148
|
+
abortedTasks.forEach(function (task) {
|
|
2149
|
+
return finishAbortedTask(task, request, errorId);
|
|
2150
|
+
});
|
|
2151
|
+
var onAllReady = request.onAllReady;
|
|
2152
|
+
onAllReady();
|
|
2153
|
+
flushCompletedChunks(request);
|
|
2154
|
+
} catch (error) {
|
|
2155
|
+
logRecoverableError(request, error, null), fatalError(request, error);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
function abort(request, reason) {
|
|
2159
|
+
if (!(11 < request.status))
|
|
2160
|
+
try {
|
|
2161
|
+
request.status = 12;
|
|
2162
|
+
request.cacheController.abort(reason);
|
|
2163
|
+
var abortableTasks = request.abortableTasks;
|
|
2164
|
+
if (0 < abortableTasks.size)
|
|
2165
|
+
if (21 === request.type)
|
|
2166
|
+
abortableTasks.forEach(function (task) {
|
|
2167
|
+
return haltTask(task, request);
|
|
2168
|
+
}),
|
|
2169
|
+
setImmediate(function () {
|
|
2170
|
+
return finishHalt(request, abortableTasks);
|
|
2171
|
+
});
|
|
2172
|
+
else {
|
|
2173
|
+
var error =
|
|
2174
|
+
void 0 === reason
|
|
2175
|
+
? Error(
|
|
2176
|
+
"The render was aborted by the server without a reason."
|
|
2177
|
+
)
|
|
2178
|
+
: "object" === typeof reason &&
|
|
2179
|
+
null !== reason &&
|
|
2180
|
+
"function" === typeof reason.then
|
|
2181
|
+
? Error(
|
|
2182
|
+
"The render was aborted by the server with a promise."
|
|
2183
|
+
)
|
|
2184
|
+
: reason,
|
|
2185
|
+
digest = logRecoverableError(request, error, null),
|
|
2186
|
+
errorId = request.nextChunkId++;
|
|
2187
|
+
request.fatalError = errorId;
|
|
2188
|
+
request.pendingChunks++;
|
|
2189
|
+
emitErrorChunk(request, errorId, digest, error, !1, null);
|
|
2190
|
+
abortableTasks.forEach(function (task) {
|
|
2191
|
+
return abortTask(task, request, errorId);
|
|
2192
|
+
});
|
|
2193
|
+
setImmediate(function () {
|
|
2194
|
+
return finishAbort(request, abortableTasks, errorId);
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
else {
|
|
2198
|
+
var onAllReady = request.onAllReady;
|
|
2199
|
+
onAllReady();
|
|
2200
|
+
flushCompletedChunks(request);
|
|
2201
|
+
}
|
|
2202
|
+
} catch (error$26) {
|
|
2203
|
+
logRecoverableError(request, error$26, null),
|
|
2204
|
+
fatalError(request, error$26);
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
function resolveServerReference(bundlerConfig, id) {
|
|
2208
|
+
var name = "",
|
|
2209
|
+
resolvedModuleData = bundlerConfig[id];
|
|
2210
|
+
if (resolvedModuleData) name = resolvedModuleData.name;
|
|
2211
|
+
else {
|
|
2212
|
+
var idx = id.lastIndexOf("#");
|
|
2213
|
+
-1 !== idx &&
|
|
2214
|
+
((name = id.slice(idx + 1)),
|
|
2215
|
+
(resolvedModuleData = bundlerConfig[id.slice(0, idx)]));
|
|
2216
|
+
if (!resolvedModuleData)
|
|
2217
|
+
throw Error(
|
|
2218
|
+
'Could not find the module "' +
|
|
2219
|
+
id +
|
|
2220
|
+
'" in the React Server Manifest. This is probably a bug in the React Server Components bundler.'
|
|
2221
|
+
);
|
|
2222
|
+
}
|
|
2223
|
+
return resolvedModuleData.async
|
|
2224
|
+
? [resolvedModuleData.id, resolvedModuleData.chunks, name, 1]
|
|
2225
|
+
: [resolvedModuleData.id, resolvedModuleData.chunks, name];
|
|
2226
|
+
}
|
|
2227
|
+
function requireAsyncModule(id) {
|
|
2228
|
+
var promise = __webpack_require__(id);
|
|
2229
|
+
if ("function" !== typeof promise.then || "fulfilled" === promise.status)
|
|
2230
|
+
return null;
|
|
2231
|
+
promise.then(
|
|
2232
|
+
function (value) {
|
|
2233
|
+
promise.status = "fulfilled";
|
|
2234
|
+
promise.value = value;
|
|
2235
|
+
},
|
|
2236
|
+
function (reason) {
|
|
2237
|
+
promise.status = "rejected";
|
|
2238
|
+
promise.reason = reason;
|
|
2239
|
+
}
|
|
2240
|
+
);
|
|
2241
|
+
return promise;
|
|
2242
|
+
}
|
|
2243
|
+
function ignoreReject() {}
|
|
2244
|
+
function preloadModule(metadata) {
|
|
2245
|
+
for (var chunks = metadata[1], promises = [], i = 0; i < chunks.length; ) {
|
|
2246
|
+
var chunkId = chunks[i++];
|
|
2247
|
+
i++;
|
|
2248
|
+
var thenable = __webpack_chunk_load__(chunkId);
|
|
2249
|
+
promises.push(thenable);
|
|
2250
|
+
thenable.catch(ignoreReject);
|
|
2251
|
+
}
|
|
2252
|
+
return 4 === metadata.length
|
|
2253
|
+
? 0 === promises.length
|
|
2254
|
+
? requireAsyncModule(metadata[0])
|
|
2255
|
+
: Promise.all(promises).then(function () {
|
|
2256
|
+
return requireAsyncModule(metadata[0]);
|
|
2257
|
+
})
|
|
2258
|
+
: 0 < promises.length
|
|
2259
|
+
? Promise.all(promises)
|
|
2260
|
+
: null;
|
|
2261
|
+
}
|
|
2262
|
+
function requireModule(metadata) {
|
|
2263
|
+
var moduleExports = __webpack_require__(metadata[0]);
|
|
2264
|
+
if (4 === metadata.length && "function" === typeof moduleExports.then)
|
|
2265
|
+
if ("fulfilled" === moduleExports.status)
|
|
2266
|
+
moduleExports = moduleExports.value;
|
|
2267
|
+
else throw moduleExports.reason;
|
|
2268
|
+
if ("*" === metadata[2]) return moduleExports;
|
|
2269
|
+
if ("" === metadata[2])
|
|
2270
|
+
return moduleExports.__esModule ? moduleExports.default : moduleExports;
|
|
2271
|
+
if (hasOwnProperty.call(moduleExports, metadata[2]))
|
|
2272
|
+
return moduleExports[metadata[2]];
|
|
2273
|
+
}
|
|
2274
|
+
var RESPONSE_SYMBOL = Symbol();
|
|
2275
|
+
function ReactPromise(status, value, reason) {
|
|
2276
|
+
this.status = status;
|
|
2277
|
+
this.value = value;
|
|
2278
|
+
this.reason = reason;
|
|
2279
|
+
}
|
|
2280
|
+
ReactPromise.prototype = Object.create(Promise.prototype);
|
|
2281
|
+
ReactPromise.prototype.then = function (resolve, reject) {
|
|
2282
|
+
switch (this.status) {
|
|
2283
|
+
case "resolved_model":
|
|
2284
|
+
initializeModelChunk(this);
|
|
2285
|
+
}
|
|
2286
|
+
switch (this.status) {
|
|
2287
|
+
case "fulfilled":
|
|
2288
|
+
if ("function" === typeof resolve) {
|
|
2289
|
+
for (
|
|
2290
|
+
var inspectedValue = this.value, cycleProtection = 0;
|
|
2291
|
+
inspectedValue instanceof ReactPromise;
|
|
2292
|
+
|
|
2293
|
+
) {
|
|
2294
|
+
cycleProtection++;
|
|
2295
|
+
if (inspectedValue === this || 1e3 < cycleProtection) {
|
|
2296
|
+
"function" === typeof reject &&
|
|
2297
|
+
reject(Error("Cannot have cyclic thenables."));
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
if ("fulfilled" === inspectedValue.status)
|
|
2301
|
+
inspectedValue = inspectedValue.value;
|
|
2302
|
+
else break;
|
|
2303
|
+
}
|
|
2304
|
+
resolve(this.value);
|
|
2305
|
+
}
|
|
2306
|
+
break;
|
|
2307
|
+
case "pending":
|
|
2308
|
+
case "blocked":
|
|
2309
|
+
"function" === typeof resolve &&
|
|
2310
|
+
(null === this.value && (this.value = []), this.value.push(resolve));
|
|
2311
|
+
"function" === typeof reject &&
|
|
2312
|
+
(null === this.reason && (this.reason = []), this.reason.push(reject));
|
|
2313
|
+
break;
|
|
2314
|
+
default:
|
|
2315
|
+
"function" === typeof reject && reject(this.reason);
|
|
2316
|
+
}
|
|
2317
|
+
};
|
|
2318
|
+
function wakeChunk(response, listeners, value) {
|
|
2319
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
2320
|
+
var listener = listeners[i];
|
|
2321
|
+
"function" === typeof listener
|
|
2322
|
+
? listener(value)
|
|
2323
|
+
: fulfillReference(response, listener, value);
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
function rejectChunk(response, listeners, error) {
|
|
2327
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
2328
|
+
var listener = listeners[i];
|
|
2329
|
+
"function" === typeof listener
|
|
2330
|
+
? listener(error)
|
|
2331
|
+
: rejectReference(response, listener.handler, error);
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
function resolveBlockedCycle(resolvedChunk, reference) {
|
|
2335
|
+
var referencedChunk = reference.handler.chunk;
|
|
2336
|
+
if (null === referencedChunk) return null;
|
|
2337
|
+
if (referencedChunk === resolvedChunk) return reference.handler;
|
|
2338
|
+
reference = referencedChunk.value;
|
|
2339
|
+
if (null !== reference)
|
|
2340
|
+
for (
|
|
2341
|
+
referencedChunk = 0;
|
|
2342
|
+
referencedChunk < reference.length;
|
|
2343
|
+
referencedChunk++
|
|
2344
|
+
) {
|
|
2345
|
+
var listener = reference[referencedChunk];
|
|
2346
|
+
if (
|
|
2347
|
+
"function" !== typeof listener &&
|
|
2348
|
+
((listener = resolveBlockedCycle(resolvedChunk, listener)),
|
|
2349
|
+
null !== listener)
|
|
2350
|
+
)
|
|
2351
|
+
return listener;
|
|
2352
|
+
}
|
|
2353
|
+
return null;
|
|
2354
|
+
}
|
|
2355
|
+
function triggerErrorOnChunk(response, chunk, error) {
|
|
2356
|
+
if ("pending" !== chunk.status && "blocked" !== chunk.status)
|
|
2357
|
+
chunk.reason.error(error);
|
|
2358
|
+
else {
|
|
2359
|
+
var listeners = chunk.reason;
|
|
2360
|
+
chunk.status = "rejected";
|
|
2361
|
+
chunk.reason = error;
|
|
2362
|
+
null !== listeners && rejectChunk(response, listeners, error);
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
function createResolvedModelChunk(response, value, id) {
|
|
2366
|
+
var $jscomp$compprop2 = {};
|
|
2367
|
+
return new ReactPromise(
|
|
2368
|
+
"resolved_model",
|
|
2369
|
+
value,
|
|
2370
|
+
(($jscomp$compprop2.id = id),
|
|
2371
|
+
($jscomp$compprop2[RESPONSE_SYMBOL] = response),
|
|
2372
|
+
$jscomp$compprop2)
|
|
2373
|
+
);
|
|
2374
|
+
}
|
|
2375
|
+
function resolveModelChunk(response, chunk, value, id) {
|
|
2376
|
+
if ("pending" !== chunk.status)
|
|
2377
|
+
(chunk = chunk.reason),
|
|
2378
|
+
"C" === value[0]
|
|
2379
|
+
? chunk.close("C" === value ? '"$undefined"' : value.slice(1))
|
|
2380
|
+
: chunk.enqueueModel(value);
|
|
2381
|
+
else {
|
|
2382
|
+
var resolveListeners = chunk.value,
|
|
2383
|
+
rejectListeners = chunk.reason;
|
|
2384
|
+
chunk.status = "resolved_model";
|
|
2385
|
+
chunk.value = value;
|
|
2386
|
+
value = {};
|
|
2387
|
+
chunk.reason =
|
|
2388
|
+
((value.id = id), (value[RESPONSE_SYMBOL] = response), value);
|
|
2389
|
+
if (null !== resolveListeners)
|
|
2390
|
+
a: switch ((initializeModelChunk(chunk), chunk.status)) {
|
|
2391
|
+
case "fulfilled":
|
|
2392
|
+
wakeChunk(response, resolveListeners, chunk.value);
|
|
2393
|
+
break;
|
|
2394
|
+
case "blocked":
|
|
2395
|
+
for (value = 0; value < resolveListeners.length; value++)
|
|
2396
|
+
if (((id = resolveListeners[value]), "function" !== typeof id)) {
|
|
2397
|
+
var cyclicHandler = resolveBlockedCycle(chunk, id);
|
|
2398
|
+
if (null !== cyclicHandler)
|
|
2399
|
+
switch (
|
|
2400
|
+
(fulfillReference(response, id, cyclicHandler.value),
|
|
2401
|
+
resolveListeners.splice(value, 1),
|
|
2402
|
+
value--,
|
|
2403
|
+
null !== rejectListeners &&
|
|
2404
|
+
((id = rejectListeners.indexOf(id)),
|
|
2405
|
+
-1 !== id && rejectListeners.splice(id, 1)),
|
|
2406
|
+
chunk.status)
|
|
2407
|
+
) {
|
|
2408
|
+
case "fulfilled":
|
|
2409
|
+
wakeChunk(response, resolveListeners, chunk.value);
|
|
2410
|
+
break a;
|
|
2411
|
+
case "rejected":
|
|
2412
|
+
null !== rejectListeners &&
|
|
2413
|
+
rejectChunk(response, rejectListeners, chunk.reason);
|
|
2414
|
+
break a;
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
case "pending":
|
|
2418
|
+
if (chunk.value)
|
|
2419
|
+
for (response = 0; response < resolveListeners.length; response++)
|
|
2420
|
+
chunk.value.push(resolveListeners[response]);
|
|
2421
|
+
else chunk.value = resolveListeners;
|
|
2422
|
+
if (chunk.reason) {
|
|
2423
|
+
if (rejectListeners)
|
|
2424
|
+
for (
|
|
2425
|
+
resolveListeners = 0;
|
|
2426
|
+
resolveListeners < rejectListeners.length;
|
|
2427
|
+
resolveListeners++
|
|
2428
|
+
)
|
|
2429
|
+
chunk.reason.push(rejectListeners[resolveListeners]);
|
|
2430
|
+
} else chunk.reason = rejectListeners;
|
|
2431
|
+
break;
|
|
2432
|
+
case "rejected":
|
|
2433
|
+
rejectListeners && wakeChunk(response, rejectListeners, chunk.reason);
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
function createResolvedIteratorResultChunk(response, value, done) {
|
|
2438
|
+
var $jscomp$compprop4 = {};
|
|
2439
|
+
return new ReactPromise(
|
|
2440
|
+
"resolved_model",
|
|
2441
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
|
2442
|
+
(($jscomp$compprop4.id = -1),
|
|
2443
|
+
($jscomp$compprop4[RESPONSE_SYMBOL] = response),
|
|
2444
|
+
$jscomp$compprop4)
|
|
2445
|
+
);
|
|
2446
|
+
}
|
|
2447
|
+
function resolveIteratorResultChunk(response, chunk, value, done) {
|
|
2448
|
+
resolveModelChunk(
|
|
2449
|
+
response,
|
|
2450
|
+
chunk,
|
|
2451
|
+
(done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",
|
|
2452
|
+
-1
|
|
2453
|
+
);
|
|
2454
|
+
}
|
|
2455
|
+
function loadServerReference$1(response, metaData, parentObject, key) {
|
|
2456
|
+
var id = metaData.id;
|
|
2457
|
+
if ("string" !== typeof id || "then" === key) return null;
|
|
2458
|
+
var serverReference = resolveServerReference(response._bundlerConfig, id);
|
|
2459
|
+
id = metaData.bound;
|
|
2460
|
+
var promise = preloadModule(serverReference);
|
|
2461
|
+
if (promise)
|
|
2462
|
+
id instanceof ReactPromise && (promise = Promise.all([promise, id]));
|
|
2463
|
+
else if (id instanceof ReactPromise) promise = Promise.resolve(id);
|
|
2464
|
+
else return requireModule(serverReference);
|
|
2465
|
+
if (initializingHandler) {
|
|
2466
|
+
var handler = initializingHandler;
|
|
2467
|
+
handler.deps++;
|
|
2468
|
+
} else
|
|
2469
|
+
handler = initializingHandler = {
|
|
2470
|
+
chunk: null,
|
|
2471
|
+
value: null,
|
|
2472
|
+
reason: null,
|
|
2473
|
+
deps: 1,
|
|
2474
|
+
errored: !1
|
|
2475
|
+
};
|
|
2476
|
+
promise.then(
|
|
2477
|
+
function () {
|
|
2478
|
+
var resolvedValue = requireModule(serverReference);
|
|
2479
|
+
if (metaData.bound) {
|
|
2480
|
+
var promiseValue = metaData.bound.value;
|
|
2481
|
+
promiseValue = Array.isArray(promiseValue) ? promiseValue.slice(0) : [];
|
|
2482
|
+
promiseValue.unshift(null);
|
|
2483
|
+
resolvedValue = resolvedValue.bind.apply(resolvedValue, promiseValue);
|
|
2484
|
+
}
|
|
2485
|
+
parentObject[key] = resolvedValue;
|
|
2486
|
+
"" === key && null === handler.value && (handler.value = resolvedValue);
|
|
2487
|
+
handler.deps--;
|
|
2488
|
+
0 === handler.deps &&
|
|
2489
|
+
((resolvedValue = handler.chunk),
|
|
2490
|
+
null !== resolvedValue &&
|
|
2491
|
+
"blocked" === resolvedValue.status &&
|
|
2492
|
+
((promiseValue = resolvedValue.value),
|
|
2493
|
+
(resolvedValue.status = "fulfilled"),
|
|
2494
|
+
(resolvedValue.value = handler.value),
|
|
2495
|
+
(resolvedValue.reason = null),
|
|
2496
|
+
null !== promiseValue &&
|
|
2497
|
+
wakeChunk(response, promiseValue, handler.value)));
|
|
2498
|
+
},
|
|
2499
|
+
function (error) {
|
|
2500
|
+
if (!handler.errored) {
|
|
2501
|
+
handler.errored = !0;
|
|
2502
|
+
handler.value = null;
|
|
2503
|
+
handler.reason = error;
|
|
2504
|
+
var chunk = handler.chunk;
|
|
2505
|
+
null !== chunk &&
|
|
2506
|
+
"blocked" === chunk.status &&
|
|
2507
|
+
triggerErrorOnChunk(response, chunk, error);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
);
|
|
2511
|
+
return null;
|
|
2512
|
+
}
|
|
2513
|
+
function reviveModel(response, parentObj, parentKey, value, reference) {
|
|
2514
|
+
if ("string" === typeof value)
|
|
2515
|
+
return parseModelString(response, parentObj, parentKey, value, reference);
|
|
2516
|
+
if ("object" === typeof value && null !== value)
|
|
2517
|
+
if (
|
|
2518
|
+
(void 0 !== reference &&
|
|
2519
|
+
void 0 !== response._temporaryReferences &&
|
|
2520
|
+
response._temporaryReferences.set(value, reference),
|
|
2521
|
+
Array.isArray(value))
|
|
2522
|
+
)
|
|
2523
|
+
for (var i = 0; i < value.length; i++)
|
|
2524
|
+
value[i] = reviveModel(
|
|
2525
|
+
response,
|
|
2526
|
+
value,
|
|
2527
|
+
"" + i,
|
|
2528
|
+
value[i],
|
|
2529
|
+
void 0 !== reference ? reference + ":" + i : void 0
|
|
2530
|
+
);
|
|
2531
|
+
else
|
|
2532
|
+
for (i in value)
|
|
2533
|
+
hasOwnProperty.call(value, i) &&
|
|
2534
|
+
((parentObj =
|
|
2535
|
+
void 0 !== reference && -1 === i.indexOf(":")
|
|
2536
|
+
? reference + ":" + i
|
|
2537
|
+
: void 0),
|
|
2538
|
+
(parentObj = reviveModel(response, value, i, value[i], parentObj)),
|
|
2539
|
+
void 0 !== parentObj || "__proto__" === i
|
|
2540
|
+
? (value[i] = parentObj)
|
|
2541
|
+
: delete value[i]);
|
|
2542
|
+
return value;
|
|
2543
|
+
}
|
|
2544
|
+
var initializingHandler = null;
|
|
2545
|
+
function initializeModelChunk(chunk) {
|
|
2546
|
+
var prevHandler = initializingHandler;
|
|
2547
|
+
initializingHandler = null;
|
|
2548
|
+
var _chunk$reason = chunk.reason,
|
|
2549
|
+
response = _chunk$reason[RESPONSE_SYMBOL];
|
|
2550
|
+
_chunk$reason = _chunk$reason.id;
|
|
2551
|
+
_chunk$reason = -1 === _chunk$reason ? void 0 : _chunk$reason.toString(16);
|
|
2552
|
+
var resolvedModel = chunk.value;
|
|
2553
|
+
chunk.status = "blocked";
|
|
2554
|
+
chunk.value = null;
|
|
2555
|
+
chunk.reason = null;
|
|
2556
|
+
try {
|
|
2557
|
+
var rawModel = JSON.parse(resolvedModel),
|
|
2558
|
+
value = reviveModel(
|
|
2559
|
+
response,
|
|
2560
|
+
{ "": rawModel },
|
|
2561
|
+
"",
|
|
2562
|
+
rawModel,
|
|
2563
|
+
_chunk$reason
|
|
2564
|
+
),
|
|
2565
|
+
resolveListeners = chunk.value;
|
|
2566
|
+
if (null !== resolveListeners)
|
|
2567
|
+
for (
|
|
2568
|
+
chunk.value = null, chunk.reason = null, rawModel = 0;
|
|
2569
|
+
rawModel < resolveListeners.length;
|
|
2570
|
+
rawModel++
|
|
2571
|
+
) {
|
|
2572
|
+
var listener = resolveListeners[rawModel];
|
|
2573
|
+
"function" === typeof listener
|
|
2574
|
+
? listener(value)
|
|
2575
|
+
: fulfillReference(response, listener, value);
|
|
2576
|
+
}
|
|
2577
|
+
if (null !== initializingHandler) {
|
|
2578
|
+
if (initializingHandler.errored) throw initializingHandler.reason;
|
|
2579
|
+
if (0 < initializingHandler.deps) {
|
|
2580
|
+
initializingHandler.value = value;
|
|
2581
|
+
initializingHandler.chunk = chunk;
|
|
2582
|
+
return;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
chunk.status = "fulfilled";
|
|
2586
|
+
chunk.value = value;
|
|
2587
|
+
chunk.reason = null;
|
|
2588
|
+
} catch (error) {
|
|
2589
|
+
(chunk.status = "rejected"), (chunk.reason = error);
|
|
2590
|
+
} finally {
|
|
2591
|
+
initializingHandler = prevHandler;
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
function reportGlobalError(response, error) {
|
|
2595
|
+
response._closed = !0;
|
|
2596
|
+
response._closedReason = error;
|
|
2597
|
+
response._chunks.forEach(function (chunk) {
|
|
2598
|
+
"pending" === chunk.status
|
|
2599
|
+
? triggerErrorOnChunk(response, chunk, error)
|
|
2600
|
+
: "fulfilled" === chunk.status &&
|
|
2601
|
+
null !== chunk.reason &&
|
|
2602
|
+
chunk.reason.error(error);
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
function getChunk(response, id) {
|
|
2606
|
+
var chunks = response._chunks,
|
|
2607
|
+
chunk = chunks.get(id);
|
|
2608
|
+
chunk ||
|
|
2609
|
+
((chunk = response._formData.get(response._prefix + id)),
|
|
2610
|
+
(chunk =
|
|
2611
|
+
"string" === typeof chunk
|
|
2612
|
+
? createResolvedModelChunk(response, chunk, id)
|
|
2613
|
+
: response._closed
|
|
2614
|
+
? new ReactPromise("rejected", null, response._closedReason)
|
|
2615
|
+
: new ReactPromise("pending", null, null)),
|
|
2616
|
+
chunks.set(id, chunk));
|
|
2617
|
+
return chunk;
|
|
2618
|
+
}
|
|
2619
|
+
function fulfillReference(response, reference, value) {
|
|
2620
|
+
var handler = reference.handler,
|
|
2621
|
+
parentObject = reference.parentObject,
|
|
2622
|
+
key = reference.key,
|
|
2623
|
+
map = reference.map,
|
|
2624
|
+
path = reference.path;
|
|
2625
|
+
try {
|
|
2626
|
+
for (var i = 1; i < path.length; i++) {
|
|
2627
|
+
var name = path[i];
|
|
2628
|
+
if (
|
|
2629
|
+
"object" !== typeof value ||
|
|
2630
|
+
!hasOwnProperty.call(value, name) ||
|
|
2631
|
+
value instanceof Promise
|
|
2632
|
+
)
|
|
2633
|
+
throw Error("Invalid reference.");
|
|
2634
|
+
value = value[name];
|
|
2635
|
+
}
|
|
2636
|
+
var mappedValue = map(response, value, parentObject, key);
|
|
2637
|
+
parentObject[key] = mappedValue;
|
|
2638
|
+
"" === key && null === handler.value && (handler.value = mappedValue);
|
|
2639
|
+
} catch (error) {
|
|
2640
|
+
rejectReference(response, reference.handler, error);
|
|
2641
|
+
return;
|
|
2642
|
+
}
|
|
2643
|
+
handler.deps--;
|
|
2644
|
+
0 === handler.deps &&
|
|
2645
|
+
((reference = handler.chunk),
|
|
2646
|
+
null !== reference &&
|
|
2647
|
+
"blocked" === reference.status &&
|
|
2648
|
+
((value = reference.value),
|
|
2649
|
+
(reference.status = "fulfilled"),
|
|
2650
|
+
(reference.value = handler.value),
|
|
2651
|
+
(reference.reason = handler.reason),
|
|
2652
|
+
null !== value && wakeChunk(response, value, handler.value)));
|
|
2653
|
+
}
|
|
2654
|
+
function rejectReference(response, handler, error) {
|
|
2655
|
+
handler.errored ||
|
|
2656
|
+
((handler.errored = !0),
|
|
2657
|
+
(handler.value = null),
|
|
2658
|
+
(handler.reason = error),
|
|
2659
|
+
(handler = handler.chunk),
|
|
2660
|
+
null !== handler &&
|
|
2661
|
+
"blocked" === handler.status &&
|
|
2662
|
+
triggerErrorOnChunk(response, handler, error));
|
|
2663
|
+
}
|
|
2664
|
+
function getOutlinedModel(response, reference, parentObject, key, map) {
|
|
2665
|
+
reference = reference.split(":");
|
|
2666
|
+
var id = parseInt(reference[0], 16);
|
|
2667
|
+
id = getChunk(response, id);
|
|
2668
|
+
switch (id.status) {
|
|
2669
|
+
case "resolved_model":
|
|
2670
|
+
initializeModelChunk(id);
|
|
2671
|
+
}
|
|
2672
|
+
switch (id.status) {
|
|
2673
|
+
case "fulfilled":
|
|
2674
|
+
id = id.value;
|
|
2675
|
+
for (var i = 1; i < reference.length; i++) {
|
|
2676
|
+
var name = reference[i];
|
|
2677
|
+
if (
|
|
2678
|
+
"object" !== typeof id ||
|
|
2679
|
+
!hasOwnProperty.call(id, name) ||
|
|
2680
|
+
id instanceof Promise
|
|
2681
|
+
)
|
|
2682
|
+
throw Error("Invalid reference.");
|
|
2683
|
+
id = id[name];
|
|
2684
|
+
}
|
|
2685
|
+
return map(response, id, parentObject, key);
|
|
2686
|
+
case "pending":
|
|
2687
|
+
case "blocked":
|
|
2688
|
+
return (
|
|
2689
|
+
initializingHandler
|
|
2690
|
+
? ((response = initializingHandler), response.deps++)
|
|
2691
|
+
: (response = initializingHandler =
|
|
2692
|
+
{ chunk: null, value: null, reason: null, deps: 1, errored: !1 }),
|
|
2693
|
+
(parentObject = {
|
|
2694
|
+
handler: response,
|
|
2695
|
+
parentObject: parentObject,
|
|
2696
|
+
key: key,
|
|
2697
|
+
map: map,
|
|
2698
|
+
path: reference
|
|
2699
|
+
}),
|
|
2700
|
+
null === id.value
|
|
2701
|
+
? (id.value = [parentObject])
|
|
2702
|
+
: id.value.push(parentObject),
|
|
2703
|
+
null === id.reason
|
|
2704
|
+
? (id.reason = [parentObject])
|
|
2705
|
+
: id.reason.push(parentObject),
|
|
2706
|
+
null
|
|
2707
|
+
);
|
|
2708
|
+
default:
|
|
2709
|
+
return (
|
|
2710
|
+
initializingHandler
|
|
2711
|
+
? ((initializingHandler.errored = !0),
|
|
2712
|
+
(initializingHandler.value = null),
|
|
2713
|
+
(initializingHandler.reason = id.reason))
|
|
2714
|
+
: (initializingHandler = {
|
|
2715
|
+
chunk: null,
|
|
2716
|
+
value: null,
|
|
2717
|
+
reason: id.reason,
|
|
2718
|
+
deps: 0,
|
|
2719
|
+
errored: !0
|
|
2720
|
+
}),
|
|
2721
|
+
null
|
|
2722
|
+
);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
function createMap(response, model) {
|
|
2726
|
+
return new Map(model);
|
|
2727
|
+
}
|
|
2728
|
+
function createSet(response, model) {
|
|
2729
|
+
return new Set(model);
|
|
2730
|
+
}
|
|
2731
|
+
function extractIterator(response, model) {
|
|
2732
|
+
return model[Symbol.iterator]();
|
|
2733
|
+
}
|
|
2734
|
+
function createModel(response, model, parentObject, key) {
|
|
2735
|
+
return "then" === key && "function" === typeof model ? null : model;
|
|
2736
|
+
}
|
|
2737
|
+
function parseTypedArray(
|
|
2738
|
+
response,
|
|
2739
|
+
reference,
|
|
2740
|
+
constructor,
|
|
2741
|
+
bytesPerElement,
|
|
2742
|
+
parentObject,
|
|
2743
|
+
parentKey
|
|
2744
|
+
) {
|
|
2745
|
+
reference = parseInt(reference.slice(2), 16);
|
|
2746
|
+
bytesPerElement = response._prefix + reference;
|
|
2747
|
+
if (response._chunks.has(reference))
|
|
2748
|
+
throw Error("Already initialized typed array.");
|
|
2749
|
+
reference = response._formData.get(bytesPerElement).arrayBuffer();
|
|
2750
|
+
if (initializingHandler) {
|
|
2751
|
+
var handler = initializingHandler;
|
|
2752
|
+
handler.deps++;
|
|
2753
|
+
} else
|
|
2754
|
+
handler = initializingHandler = {
|
|
2755
|
+
chunk: null,
|
|
2756
|
+
value: null,
|
|
2757
|
+
reason: null,
|
|
2758
|
+
deps: 1,
|
|
2759
|
+
errored: !1
|
|
2760
|
+
};
|
|
2761
|
+
reference.then(
|
|
2762
|
+
function (buffer) {
|
|
2763
|
+
buffer = constructor === ArrayBuffer ? buffer : new constructor(buffer);
|
|
2764
|
+
parentObject[parentKey] = buffer;
|
|
2765
|
+
"" === parentKey && null === handler.value && (handler.value = buffer);
|
|
2766
|
+
handler.deps--;
|
|
2767
|
+
if (
|
|
2768
|
+
0 === handler.deps &&
|
|
2769
|
+
((buffer = handler.chunk),
|
|
2770
|
+
null !== buffer && "blocked" === buffer.status)
|
|
2771
|
+
) {
|
|
2772
|
+
var resolveListeners = buffer.value;
|
|
2773
|
+
buffer.status = "fulfilled";
|
|
2774
|
+
buffer.value = handler.value;
|
|
2775
|
+
buffer.reason = null;
|
|
2776
|
+
null !== resolveListeners &&
|
|
2777
|
+
wakeChunk(response, resolveListeners, handler.value);
|
|
2778
|
+
}
|
|
2779
|
+
},
|
|
2780
|
+
function (error) {
|
|
2781
|
+
if (!handler.errored) {
|
|
2782
|
+
handler.errored = !0;
|
|
2783
|
+
handler.value = null;
|
|
2784
|
+
handler.reason = error;
|
|
2785
|
+
var chunk = handler.chunk;
|
|
2786
|
+
null !== chunk &&
|
|
2787
|
+
"blocked" === chunk.status &&
|
|
2788
|
+
triggerErrorOnChunk(response, chunk, error);
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
);
|
|
2792
|
+
return null;
|
|
2793
|
+
}
|
|
2794
|
+
function resolveStream(response, id, stream, controller) {
|
|
2795
|
+
var chunks = response._chunks;
|
|
2796
|
+
stream = new ReactPromise("fulfilled", stream, controller);
|
|
2797
|
+
chunks.set(id, stream);
|
|
2798
|
+
response = response._formData.getAll(response._prefix + id);
|
|
2799
|
+
for (id = 0; id < response.length; id++)
|
|
2800
|
+
(chunks = response[id]),
|
|
2801
|
+
"string" === typeof chunks &&
|
|
2802
|
+
("C" === chunks[0]
|
|
2803
|
+
? controller.close("C" === chunks ? '"$undefined"' : chunks.slice(1))
|
|
2804
|
+
: controller.enqueueModel(chunks));
|
|
2805
|
+
}
|
|
2806
|
+
function parseReadableStream(response, reference, type) {
|
|
2807
|
+
reference = parseInt(reference.slice(2), 16);
|
|
2808
|
+
if (response._chunks.has(reference))
|
|
2809
|
+
throw Error("Already initialized stream.");
|
|
2810
|
+
var controller = null,
|
|
2811
|
+
closed = !1;
|
|
2812
|
+
type = new ReadableStream({
|
|
2813
|
+
type: type,
|
|
2814
|
+
start: function (c) {
|
|
2815
|
+
controller = c;
|
|
2816
|
+
}
|
|
2817
|
+
});
|
|
2818
|
+
var previousBlockedChunk = null;
|
|
2819
|
+
resolveStream(response, reference, type, {
|
|
2820
|
+
enqueueModel: function (json) {
|
|
2821
|
+
if (null === previousBlockedChunk) {
|
|
2822
|
+
var chunk = createResolvedModelChunk(response, json, -1);
|
|
2823
|
+
initializeModelChunk(chunk);
|
|
2824
|
+
"fulfilled" === chunk.status
|
|
2825
|
+
? controller.enqueue(chunk.value)
|
|
2826
|
+
: (chunk.then(
|
|
2827
|
+
function (v) {
|
|
2828
|
+
return controller.enqueue(v);
|
|
2829
|
+
},
|
|
2830
|
+
function (e) {
|
|
2831
|
+
return controller.error(e);
|
|
2832
|
+
}
|
|
2833
|
+
),
|
|
2834
|
+
(previousBlockedChunk = chunk));
|
|
2835
|
+
} else {
|
|
2836
|
+
chunk = previousBlockedChunk;
|
|
2837
|
+
var chunk$30 = new ReactPromise("pending", null, null);
|
|
2838
|
+
chunk$30.then(
|
|
2839
|
+
function (v) {
|
|
2840
|
+
return controller.enqueue(v);
|
|
2841
|
+
},
|
|
2842
|
+
function (e) {
|
|
2843
|
+
return controller.error(e);
|
|
2844
|
+
}
|
|
2845
|
+
);
|
|
2846
|
+
previousBlockedChunk = chunk$30;
|
|
2847
|
+
chunk.then(function () {
|
|
2848
|
+
previousBlockedChunk === chunk$30 && (previousBlockedChunk = null);
|
|
2849
|
+
resolveModelChunk(response, chunk$30, json, -1);
|
|
2850
|
+
});
|
|
2851
|
+
}
|
|
2852
|
+
},
|
|
2853
|
+
close: function () {
|
|
2854
|
+
if (!closed)
|
|
2855
|
+
if (((closed = !0), null === previousBlockedChunk)) controller.close();
|
|
2856
|
+
else {
|
|
2857
|
+
var blockedChunk = previousBlockedChunk;
|
|
2858
|
+
previousBlockedChunk = null;
|
|
2859
|
+
blockedChunk.then(function () {
|
|
2860
|
+
return controller.close();
|
|
2861
|
+
});
|
|
2862
|
+
}
|
|
2863
|
+
},
|
|
2864
|
+
error: function (error) {
|
|
2865
|
+
if (!closed)
|
|
2866
|
+
if (((closed = !0), null === previousBlockedChunk))
|
|
2867
|
+
controller.error(error);
|
|
2868
|
+
else {
|
|
2869
|
+
var blockedChunk = previousBlockedChunk;
|
|
2870
|
+
previousBlockedChunk = null;
|
|
2871
|
+
blockedChunk.then(function () {
|
|
2872
|
+
return controller.error(error);
|
|
2873
|
+
});
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
});
|
|
2877
|
+
return type;
|
|
2878
|
+
}
|
|
2879
|
+
function asyncIterator() {
|
|
2880
|
+
return this;
|
|
2881
|
+
}
|
|
2882
|
+
function createIterator(next) {
|
|
2883
|
+
next = { next: next };
|
|
2884
|
+
next[ASYNC_ITERATOR] = asyncIterator;
|
|
2885
|
+
return next;
|
|
2886
|
+
}
|
|
2887
|
+
function parseAsyncIterable(response, reference, iterator) {
|
|
2888
|
+
reference = parseInt(reference.slice(2), 16);
|
|
2889
|
+
if (response._chunks.has(reference))
|
|
2890
|
+
throw Error("Already initialized stream.");
|
|
2891
|
+
var buffer = [],
|
|
2892
|
+
closed = !1,
|
|
2893
|
+
nextWriteIndex = 0,
|
|
2894
|
+
$jscomp$compprop5 = {};
|
|
2895
|
+
$jscomp$compprop5 =
|
|
2896
|
+
(($jscomp$compprop5[ASYNC_ITERATOR] = function () {
|
|
2897
|
+
var nextReadIndex = 0;
|
|
2898
|
+
return createIterator(function (arg) {
|
|
2899
|
+
if (void 0 !== arg)
|
|
2900
|
+
throw Error(
|
|
2901
|
+
"Values cannot be passed to next() of AsyncIterables passed to Client Components."
|
|
2902
|
+
);
|
|
2903
|
+
if (nextReadIndex === buffer.length) {
|
|
2904
|
+
if (closed)
|
|
2905
|
+
return new ReactPromise(
|
|
2906
|
+
"fulfilled",
|
|
2907
|
+
{ done: !0, value: void 0 },
|
|
2908
|
+
null
|
|
2909
|
+
);
|
|
2910
|
+
buffer[nextReadIndex] = new ReactPromise("pending", null, null);
|
|
2911
|
+
}
|
|
2912
|
+
return buffer[nextReadIndex++];
|
|
2913
|
+
});
|
|
2914
|
+
}),
|
|
2915
|
+
$jscomp$compprop5);
|
|
2916
|
+
iterator = iterator ? $jscomp$compprop5[ASYNC_ITERATOR]() : $jscomp$compprop5;
|
|
2917
|
+
resolveStream(response, reference, iterator, {
|
|
2918
|
+
enqueueModel: function (value) {
|
|
2919
|
+
nextWriteIndex === buffer.length
|
|
2920
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
|
2921
|
+
response,
|
|
2922
|
+
value,
|
|
2923
|
+
!1
|
|
2924
|
+
))
|
|
2925
|
+
: resolveIteratorResultChunk(
|
|
2926
|
+
response,
|
|
2927
|
+
buffer[nextWriteIndex],
|
|
2928
|
+
value,
|
|
2929
|
+
!1
|
|
2930
|
+
);
|
|
2931
|
+
nextWriteIndex++;
|
|
2932
|
+
},
|
|
2933
|
+
close: function (value) {
|
|
2934
|
+
if (!closed)
|
|
2935
|
+
for (
|
|
2936
|
+
closed = !0,
|
|
2937
|
+
nextWriteIndex === buffer.length
|
|
2938
|
+
? (buffer[nextWriteIndex] = createResolvedIteratorResultChunk(
|
|
2939
|
+
response,
|
|
2940
|
+
value,
|
|
2941
|
+
!0
|
|
2942
|
+
))
|
|
2943
|
+
: resolveIteratorResultChunk(
|
|
2944
|
+
response,
|
|
2945
|
+
buffer[nextWriteIndex],
|
|
2946
|
+
value,
|
|
2947
|
+
!0
|
|
2948
|
+
),
|
|
2949
|
+
nextWriteIndex++;
|
|
2950
|
+
nextWriteIndex < buffer.length;
|
|
2951
|
+
|
|
2952
|
+
)
|
|
2953
|
+
resolveIteratorResultChunk(
|
|
2954
|
+
response,
|
|
2955
|
+
buffer[nextWriteIndex++],
|
|
2956
|
+
'"$undefined"',
|
|
2957
|
+
!0
|
|
2958
|
+
);
|
|
2959
|
+
},
|
|
2960
|
+
error: function (error) {
|
|
2961
|
+
if (!closed)
|
|
2962
|
+
for (
|
|
2963
|
+
closed = !0,
|
|
2964
|
+
nextWriteIndex === buffer.length &&
|
|
2965
|
+
(buffer[nextWriteIndex] = new ReactPromise(
|
|
2966
|
+
"pending",
|
|
2967
|
+
null,
|
|
2968
|
+
null
|
|
2969
|
+
));
|
|
2970
|
+
nextWriteIndex < buffer.length;
|
|
2971
|
+
|
|
2972
|
+
)
|
|
2973
|
+
triggerErrorOnChunk(response, buffer[nextWriteIndex++], error);
|
|
2974
|
+
}
|
|
2975
|
+
});
|
|
2976
|
+
return iterator;
|
|
2977
|
+
}
|
|
2978
|
+
function parseModelString(response, obj, key, value, reference) {
|
|
2979
|
+
if ("$" === value[0]) {
|
|
2980
|
+
switch (value[1]) {
|
|
2981
|
+
case "$":
|
|
2982
|
+
return value.slice(1);
|
|
2983
|
+
case "@":
|
|
2984
|
+
return (obj = parseInt(value.slice(2), 16)), getChunk(response, obj);
|
|
2985
|
+
case "h":
|
|
2986
|
+
return (
|
|
2987
|
+
(value = value.slice(2)),
|
|
2988
|
+
getOutlinedModel(response, value, obj, key, loadServerReference$1)
|
|
2989
|
+
);
|
|
2990
|
+
case "T":
|
|
2991
|
+
if (void 0 === reference || void 0 === response._temporaryReferences)
|
|
2992
|
+
throw Error(
|
|
2993
|
+
"Could not reference an opaque temporary reference. This is likely due to misconfiguring the temporaryReferences options on the server."
|
|
2994
|
+
);
|
|
2995
|
+
return createTemporaryReference(
|
|
2996
|
+
response._temporaryReferences,
|
|
2997
|
+
reference
|
|
2998
|
+
);
|
|
2999
|
+
case "Q":
|
|
3000
|
+
return (
|
|
3001
|
+
(value = value.slice(2)),
|
|
3002
|
+
getOutlinedModel(response, value, obj, key, createMap)
|
|
3003
|
+
);
|
|
3004
|
+
case "W":
|
|
3005
|
+
return (
|
|
3006
|
+
(value = value.slice(2)),
|
|
3007
|
+
getOutlinedModel(response, value, obj, key, createSet)
|
|
3008
|
+
);
|
|
3009
|
+
case "K":
|
|
3010
|
+
obj = value.slice(2);
|
|
3011
|
+
var formPrefix = response._prefix + obj + "_",
|
|
3012
|
+
data = new FormData();
|
|
3013
|
+
response._formData.forEach(function (entry, entryKey) {
|
|
3014
|
+
entryKey.startsWith(formPrefix) &&
|
|
3015
|
+
data.append(entryKey.slice(formPrefix.length), entry);
|
|
3016
|
+
});
|
|
3017
|
+
return data;
|
|
3018
|
+
case "i":
|
|
3019
|
+
return (
|
|
3020
|
+
(value = value.slice(2)),
|
|
3021
|
+
getOutlinedModel(response, value, obj, key, extractIterator)
|
|
3022
|
+
);
|
|
3023
|
+
case "I":
|
|
3024
|
+
return Infinity;
|
|
3025
|
+
case "-":
|
|
3026
|
+
return "$-0" === value ? -0 : -Infinity;
|
|
3027
|
+
case "N":
|
|
3028
|
+
return NaN;
|
|
3029
|
+
case "u":
|
|
3030
|
+
return;
|
|
3031
|
+
case "D":
|
|
3032
|
+
return new Date(Date.parse(value.slice(2)));
|
|
3033
|
+
case "n":
|
|
3034
|
+
return BigInt(value.slice(2));
|
|
3035
|
+
}
|
|
3036
|
+
switch (value[1]) {
|
|
3037
|
+
case "A":
|
|
3038
|
+
return parseTypedArray(response, value, ArrayBuffer, 1, obj, key);
|
|
3039
|
+
case "O":
|
|
3040
|
+
return parseTypedArray(response, value, Int8Array, 1, obj, key);
|
|
3041
|
+
case "o":
|
|
3042
|
+
return parseTypedArray(response, value, Uint8Array, 1, obj, key);
|
|
3043
|
+
case "U":
|
|
3044
|
+
return parseTypedArray(response, value, Uint8ClampedArray, 1, obj, key);
|
|
3045
|
+
case "S":
|
|
3046
|
+
return parseTypedArray(response, value, Int16Array, 2, obj, key);
|
|
3047
|
+
case "s":
|
|
3048
|
+
return parseTypedArray(response, value, Uint16Array, 2, obj, key);
|
|
3049
|
+
case "L":
|
|
3050
|
+
return parseTypedArray(response, value, Int32Array, 4, obj, key);
|
|
3051
|
+
case "l":
|
|
3052
|
+
return parseTypedArray(response, value, Uint32Array, 4, obj, key);
|
|
3053
|
+
case "G":
|
|
3054
|
+
return parseTypedArray(response, value, Float32Array, 4, obj, key);
|
|
3055
|
+
case "g":
|
|
3056
|
+
return parseTypedArray(response, value, Float64Array, 8, obj, key);
|
|
3057
|
+
case "M":
|
|
3058
|
+
return parseTypedArray(response, value, BigInt64Array, 8, obj, key);
|
|
3059
|
+
case "m":
|
|
3060
|
+
return parseTypedArray(response, value, BigUint64Array, 8, obj, key);
|
|
3061
|
+
case "V":
|
|
3062
|
+
return parseTypedArray(response, value, DataView, 1, obj, key);
|
|
3063
|
+
case "B":
|
|
3064
|
+
return (
|
|
3065
|
+
(obj = parseInt(value.slice(2), 16)),
|
|
3066
|
+
response._formData.get(response._prefix + obj)
|
|
3067
|
+
);
|
|
3068
|
+
}
|
|
3069
|
+
switch (value[1]) {
|
|
3070
|
+
case "R":
|
|
3071
|
+
return parseReadableStream(response, value, void 0);
|
|
3072
|
+
case "r":
|
|
3073
|
+
return parseReadableStream(response, value, "bytes");
|
|
3074
|
+
case "X":
|
|
3075
|
+
return parseAsyncIterable(response, value, !1);
|
|
3076
|
+
case "x":
|
|
3077
|
+
return parseAsyncIterable(response, value, !0);
|
|
3078
|
+
}
|
|
3079
|
+
value = value.slice(1);
|
|
3080
|
+
return getOutlinedModel(response, value, obj, key, createModel);
|
|
3081
|
+
}
|
|
3082
|
+
return value;
|
|
3083
|
+
}
|
|
3084
|
+
function createResponse(bundlerConfig, formFieldPrefix, temporaryReferences) {
|
|
3085
|
+
var backingFormData =
|
|
3086
|
+
3 < arguments.length && void 0 !== arguments[3]
|
|
3087
|
+
? arguments[3]
|
|
3088
|
+
: new FormData(),
|
|
3089
|
+
chunks = new Map();
|
|
3090
|
+
return {
|
|
3091
|
+
_bundlerConfig: bundlerConfig,
|
|
3092
|
+
_prefix: formFieldPrefix,
|
|
3093
|
+
_formData: backingFormData,
|
|
3094
|
+
_chunks: chunks,
|
|
3095
|
+
_closed: !1,
|
|
3096
|
+
_closedReason: null,
|
|
3097
|
+
_temporaryReferences: temporaryReferences
|
|
3098
|
+
};
|
|
3099
|
+
}
|
|
3100
|
+
function resolveField(response, key, value) {
|
|
3101
|
+
response._formData.append(key, value);
|
|
3102
|
+
var prefix = response._prefix;
|
|
3103
|
+
if (key.startsWith(prefix)) {
|
|
3104
|
+
var chunks = response._chunks;
|
|
3105
|
+
key = +key.slice(prefix.length);
|
|
3106
|
+
(chunks = chunks.get(key)) &&
|
|
3107
|
+
resolveModelChunk(response, chunks, value, key);
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
function close(response) {
|
|
3111
|
+
reportGlobalError(response, Error("Connection closed."));
|
|
3112
|
+
}
|
|
3113
|
+
function loadServerReference(bundlerConfig, id, bound) {
|
|
3114
|
+
var serverReference = resolveServerReference(bundlerConfig, id);
|
|
3115
|
+
bundlerConfig = preloadModule(serverReference);
|
|
3116
|
+
return bound
|
|
3117
|
+
? Promise.all([bound, bundlerConfig]).then(function (_ref) {
|
|
3118
|
+
_ref = _ref[0];
|
|
3119
|
+
var fn = requireModule(serverReference);
|
|
3120
|
+
return fn.bind.apply(fn, [null].concat(_ref));
|
|
3121
|
+
})
|
|
3122
|
+
: bundlerConfig
|
|
3123
|
+
? Promise.resolve(bundlerConfig).then(function () {
|
|
3124
|
+
return requireModule(serverReference);
|
|
3125
|
+
})
|
|
3126
|
+
: Promise.resolve(requireModule(serverReference));
|
|
3127
|
+
}
|
|
3128
|
+
function decodeBoundActionMetaData(body, serverManifest, formFieldPrefix) {
|
|
3129
|
+
body = createResponse(serverManifest, formFieldPrefix, void 0, body);
|
|
3130
|
+
close(body);
|
|
3131
|
+
body = getChunk(body, 0);
|
|
3132
|
+
body.then(function () {});
|
|
3133
|
+
if ("fulfilled" !== body.status) throw body.reason;
|
|
3134
|
+
return body.value;
|
|
3135
|
+
}
|
|
3136
|
+
function createDrainHandler(destination, request) {
|
|
3137
|
+
return function () {
|
|
3138
|
+
return startFlowing(request, destination);
|
|
3139
|
+
};
|
|
3140
|
+
}
|
|
3141
|
+
function createCancelHandler(request, reason) {
|
|
3142
|
+
return function () {
|
|
3143
|
+
request.destination = null;
|
|
3144
|
+
abort(request, Error(reason));
|
|
3145
|
+
};
|
|
3146
|
+
}
|
|
3147
|
+
function createFakeWritableFromReadableStreamController(controller) {
|
|
3148
|
+
return {
|
|
3149
|
+
write: function (chunk) {
|
|
3150
|
+
"string" === typeof chunk && (chunk = textEncoder.encode(chunk));
|
|
3151
|
+
controller.enqueue(chunk);
|
|
3152
|
+
return !0;
|
|
3153
|
+
},
|
|
3154
|
+
end: function () {
|
|
3155
|
+
controller.close();
|
|
3156
|
+
},
|
|
3157
|
+
destroy: function (error) {
|
|
3158
|
+
"function" === typeof controller.error
|
|
3159
|
+
? controller.error(error)
|
|
3160
|
+
: controller.close();
|
|
3161
|
+
}
|
|
3162
|
+
};
|
|
3163
|
+
}
|
|
3164
|
+
function createFakeWritableFromNodeReadable(readable) {
|
|
3165
|
+
return {
|
|
3166
|
+
write: function (chunk) {
|
|
3167
|
+
return readable.push(chunk);
|
|
3168
|
+
},
|
|
3169
|
+
end: function () {
|
|
3170
|
+
readable.push(null);
|
|
3171
|
+
},
|
|
3172
|
+
destroy: function (error) {
|
|
3173
|
+
readable.destroy(error);
|
|
3174
|
+
}
|
|
3175
|
+
};
|
|
3176
|
+
}
|
|
3177
|
+
exports.createClientModuleProxy = function (moduleId) {
|
|
3178
|
+
moduleId = registerClientReferenceImpl({}, moduleId, !1);
|
|
3179
|
+
return new Proxy(moduleId, proxyHandlers$1);
|
|
3180
|
+
};
|
|
3181
|
+
exports.createTemporaryReferenceSet = function () {
|
|
3182
|
+
return new WeakMap();
|
|
3183
|
+
};
|
|
3184
|
+
exports.decodeAction = function (body, serverManifest) {
|
|
3185
|
+
var formData = new FormData(),
|
|
3186
|
+
action = null;
|
|
3187
|
+
body.forEach(function (value, key) {
|
|
3188
|
+
key.startsWith("$ACTION_")
|
|
3189
|
+
? key.startsWith("$ACTION_REF_")
|
|
3190
|
+
? ((value = "$ACTION_" + key.slice(12) + ":"),
|
|
3191
|
+
(value = decodeBoundActionMetaData(body, serverManifest, value)),
|
|
3192
|
+
(action = loadServerReference(serverManifest, value.id, value.bound)))
|
|
3193
|
+
: key.startsWith("$ACTION_ID_") &&
|
|
3194
|
+
((value = key.slice(11)),
|
|
3195
|
+
(action = loadServerReference(serverManifest, value, null)))
|
|
3196
|
+
: formData.append(key, value);
|
|
3197
|
+
});
|
|
3198
|
+
return null === action
|
|
3199
|
+
? null
|
|
3200
|
+
: action.then(function (fn) {
|
|
3201
|
+
return fn.bind(null, formData);
|
|
3202
|
+
});
|
|
3203
|
+
};
|
|
3204
|
+
exports.decodeFormState = function (actionResult, body, serverManifest) {
|
|
3205
|
+
var keyPath = body.get("$ACTION_KEY");
|
|
3206
|
+
if ("string" !== typeof keyPath) return Promise.resolve(null);
|
|
3207
|
+
var metaData = null;
|
|
3208
|
+
body.forEach(function (value, key) {
|
|
3209
|
+
key.startsWith("$ACTION_REF_") &&
|
|
3210
|
+
((value = "$ACTION_" + key.slice(12) + ":"),
|
|
3211
|
+
(metaData = decodeBoundActionMetaData(body, serverManifest, value)));
|
|
3212
|
+
});
|
|
3213
|
+
if (null === metaData) return Promise.resolve(null);
|
|
3214
|
+
var referenceId = metaData.id;
|
|
3215
|
+
return Promise.resolve(metaData.bound).then(function (bound) {
|
|
3216
|
+
return null === bound
|
|
3217
|
+
? null
|
|
3218
|
+
: [actionResult, keyPath, referenceId, bound.length - 1];
|
|
3219
|
+
});
|
|
3220
|
+
};
|
|
3221
|
+
exports.decodeReply = function (body, webpackMap, options) {
|
|
3222
|
+
if ("string" === typeof body) {
|
|
3223
|
+
var form = new FormData();
|
|
3224
|
+
form.append("0", body);
|
|
3225
|
+
body = form;
|
|
3226
|
+
}
|
|
3227
|
+
body = createResponse(
|
|
3228
|
+
webpackMap,
|
|
3229
|
+
"",
|
|
3230
|
+
options ? options.temporaryReferences : void 0,
|
|
3231
|
+
body
|
|
3232
|
+
);
|
|
3233
|
+
webpackMap = getChunk(body, 0);
|
|
3234
|
+
close(body);
|
|
3235
|
+
return webpackMap;
|
|
3236
|
+
};
|
|
3237
|
+
exports.decodeReplyFromAsyncIterable = function (
|
|
3238
|
+
iterable,
|
|
3239
|
+
webpackMap,
|
|
3240
|
+
options
|
|
3241
|
+
) {
|
|
3242
|
+
function progress(entry) {
|
|
3243
|
+
if (entry.done) close(response);
|
|
3244
|
+
else {
|
|
3245
|
+
var _entry$value = entry.value;
|
|
3246
|
+
entry = _entry$value[0];
|
|
3247
|
+
_entry$value = _entry$value[1];
|
|
3248
|
+
"string" === typeof _entry$value
|
|
3249
|
+
? resolveField(response, entry, _entry$value)
|
|
3250
|
+
: response._formData.append(entry, _entry$value);
|
|
3251
|
+
iterator.next().then(progress, error);
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
function error(reason) {
|
|
3255
|
+
reportGlobalError(response, reason);
|
|
3256
|
+
"function" === typeof iterator.throw &&
|
|
3257
|
+
iterator.throw(reason).then(error, error);
|
|
3258
|
+
}
|
|
3259
|
+
var iterator = iterable[ASYNC_ITERATOR](),
|
|
3260
|
+
response = createResponse(
|
|
3261
|
+
webpackMap,
|
|
3262
|
+
"",
|
|
3263
|
+
options ? options.temporaryReferences : void 0
|
|
3264
|
+
);
|
|
3265
|
+
iterator.next().then(progress, error);
|
|
3266
|
+
return getChunk(response, 0);
|
|
3267
|
+
};
|
|
3268
|
+
exports.decodeReplyFromBusboy = function (busboyStream, webpackMap, options) {
|
|
3269
|
+
var response = createResponse(
|
|
3270
|
+
webpackMap,
|
|
3271
|
+
"",
|
|
3272
|
+
options ? options.temporaryReferences : void 0
|
|
3273
|
+
),
|
|
3274
|
+
pendingFiles = 0,
|
|
3275
|
+
queuedFields = [];
|
|
3276
|
+
busboyStream.on("field", function (name, value) {
|
|
3277
|
+
if (0 < pendingFiles) queuedFields.push(name, value);
|
|
3278
|
+
else
|
|
3279
|
+
try {
|
|
3280
|
+
resolveField(response, name, value);
|
|
3281
|
+
} catch (error) {
|
|
3282
|
+
busboyStream.destroy(error);
|
|
3283
|
+
}
|
|
3284
|
+
});
|
|
3285
|
+
busboyStream.on("file", function (name, value, _ref2) {
|
|
3286
|
+
var filename = _ref2.filename,
|
|
3287
|
+
mimeType = _ref2.mimeType;
|
|
3288
|
+
if ("base64" === _ref2.encoding.toLowerCase())
|
|
3289
|
+
busboyStream.destroy(
|
|
3290
|
+
Error(
|
|
3291
|
+
"React doesn't accept base64 encoded file uploads because we don't expect form data passed from a browser to ever encode data that way. If that's the wrong assumption, we can easily fix it."
|
|
3292
|
+
)
|
|
3293
|
+
);
|
|
3294
|
+
else {
|
|
3295
|
+
pendingFiles++;
|
|
3296
|
+
var JSCompiler_object_inline_chunks_291 = [];
|
|
3297
|
+
value.on("data", function (chunk) {
|
|
3298
|
+
JSCompiler_object_inline_chunks_291.push(chunk);
|
|
3299
|
+
});
|
|
3300
|
+
value.on("end", function () {
|
|
3301
|
+
try {
|
|
3302
|
+
var blob = new Blob(JSCompiler_object_inline_chunks_291, {
|
|
3303
|
+
type: mimeType
|
|
3304
|
+
});
|
|
3305
|
+
response._formData.append(name, blob, filename);
|
|
3306
|
+
pendingFiles--;
|
|
3307
|
+
if (0 === pendingFiles) {
|
|
3308
|
+
for (blob = 0; blob < queuedFields.length; blob += 2)
|
|
3309
|
+
resolveField(
|
|
3310
|
+
response,
|
|
3311
|
+
queuedFields[blob],
|
|
3312
|
+
queuedFields[blob + 1]
|
|
3313
|
+
);
|
|
3314
|
+
queuedFields.length = 0;
|
|
3315
|
+
}
|
|
3316
|
+
} catch (error) {
|
|
3317
|
+
busboyStream.destroy(error);
|
|
3318
|
+
}
|
|
3319
|
+
});
|
|
3320
|
+
}
|
|
3321
|
+
});
|
|
3322
|
+
busboyStream.on("finish", function () {
|
|
3323
|
+
close(response);
|
|
3324
|
+
});
|
|
3325
|
+
busboyStream.on("error", function (err) {
|
|
3326
|
+
reportGlobalError(response, err);
|
|
3327
|
+
});
|
|
3328
|
+
return getChunk(response, 0);
|
|
3329
|
+
};
|
|
3330
|
+
exports.prerender = function (model, webpackMap, options) {
|
|
3331
|
+
return new Promise(function (resolve, reject) {
|
|
3332
|
+
var request = new RequestInstance(
|
|
3333
|
+
21,
|
|
3334
|
+
model,
|
|
3335
|
+
webpackMap,
|
|
3336
|
+
options ? options.onError : void 0,
|
|
3337
|
+
options ? options.onPostpone : void 0,
|
|
3338
|
+
function () {
|
|
3339
|
+
var writable,
|
|
3340
|
+
stream = new ReadableStream(
|
|
3341
|
+
{
|
|
3342
|
+
type: "bytes",
|
|
3343
|
+
start: function (controller) {
|
|
3344
|
+
writable =
|
|
3345
|
+
createFakeWritableFromReadableStreamController(controller);
|
|
3346
|
+
},
|
|
3347
|
+
pull: function () {
|
|
3348
|
+
startFlowing(request, writable);
|
|
3349
|
+
},
|
|
3350
|
+
cancel: function (reason) {
|
|
3351
|
+
request.destination = null;
|
|
3352
|
+
abort(request, reason);
|
|
3353
|
+
}
|
|
3354
|
+
},
|
|
3355
|
+
{ highWaterMark: 0 }
|
|
3356
|
+
);
|
|
3357
|
+
resolve({ prelude: stream });
|
|
3358
|
+
},
|
|
3359
|
+
reject,
|
|
3360
|
+
options ? options.identifierPrefix : void 0,
|
|
3361
|
+
options ? options.temporaryReferences : void 0
|
|
3362
|
+
);
|
|
3363
|
+
if (options && options.signal) {
|
|
3364
|
+
var signal = options.signal;
|
|
3365
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3366
|
+
else {
|
|
3367
|
+
var listener = function () {
|
|
3368
|
+
abort(request, signal.reason);
|
|
3369
|
+
signal.removeEventListener("abort", listener);
|
|
3370
|
+
};
|
|
3371
|
+
signal.addEventListener("abort", listener);
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
startWork(request);
|
|
3375
|
+
});
|
|
3376
|
+
};
|
|
3377
|
+
exports.prerenderToNodeStream = function (model, webpackMap, options) {
|
|
3378
|
+
return new Promise(function (resolve, reject) {
|
|
3379
|
+
var request = new RequestInstance(
|
|
3380
|
+
21,
|
|
3381
|
+
model,
|
|
3382
|
+
webpackMap,
|
|
3383
|
+
options ? options.onError : void 0,
|
|
3384
|
+
options ? options.onPostpone : void 0,
|
|
3385
|
+
function () {
|
|
3386
|
+
var readable = new stream.Readable({
|
|
3387
|
+
read: function () {
|
|
3388
|
+
startFlowing(request, writable);
|
|
3389
|
+
}
|
|
3390
|
+
}),
|
|
3391
|
+
writable = createFakeWritableFromNodeReadable(readable);
|
|
3392
|
+
resolve({ prelude: readable });
|
|
3393
|
+
},
|
|
3394
|
+
reject,
|
|
3395
|
+
options ? options.identifierPrefix : void 0,
|
|
3396
|
+
options ? options.temporaryReferences : void 0
|
|
3397
|
+
);
|
|
3398
|
+
if (options && options.signal) {
|
|
3399
|
+
var signal = options.signal;
|
|
3400
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3401
|
+
else {
|
|
3402
|
+
var listener = function () {
|
|
3403
|
+
abort(request, signal.reason);
|
|
3404
|
+
signal.removeEventListener("abort", listener);
|
|
3405
|
+
};
|
|
3406
|
+
signal.addEventListener("abort", listener);
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3409
|
+
startWork(request);
|
|
3410
|
+
});
|
|
3411
|
+
};
|
|
3412
|
+
exports.registerClientReference = function (
|
|
3413
|
+
proxyImplementation,
|
|
3414
|
+
id,
|
|
3415
|
+
exportName
|
|
3416
|
+
) {
|
|
3417
|
+
return registerClientReferenceImpl(
|
|
3418
|
+
proxyImplementation,
|
|
3419
|
+
id + "#" + exportName,
|
|
3420
|
+
!1
|
|
3421
|
+
);
|
|
3422
|
+
};
|
|
3423
|
+
exports.registerServerReference = function (reference, id, exportName) {
|
|
3424
|
+
return Object.defineProperties(reference, {
|
|
3425
|
+
$$typeof: { value: SERVER_REFERENCE_TAG },
|
|
3426
|
+
$$id: {
|
|
3427
|
+
value: null === exportName ? id : id + "#" + exportName,
|
|
3428
|
+
configurable: !0
|
|
3429
|
+
},
|
|
3430
|
+
$$bound: { value: null, configurable: !0 },
|
|
3431
|
+
bind: { value: bind, configurable: !0 },
|
|
3432
|
+
toString: serverReferenceToString
|
|
3433
|
+
});
|
|
3434
|
+
};
|
|
3435
|
+
exports.renderToPipeableStream = function (model, webpackMap, options) {
|
|
3436
|
+
var request = new RequestInstance(
|
|
3437
|
+
20,
|
|
3438
|
+
model,
|
|
3439
|
+
webpackMap,
|
|
3440
|
+
options ? options.onError : void 0,
|
|
3441
|
+
options ? options.onPostpone : void 0,
|
|
3442
|
+
noop,
|
|
3443
|
+
noop,
|
|
3444
|
+
options ? options.identifierPrefix : void 0,
|
|
3445
|
+
options ? options.temporaryReferences : void 0
|
|
3446
|
+
),
|
|
3447
|
+
hasStartedFlowing = !1;
|
|
3448
|
+
startWork(request);
|
|
3449
|
+
return {
|
|
3450
|
+
pipe: function (destination) {
|
|
3451
|
+
if (hasStartedFlowing)
|
|
3452
|
+
throw Error(
|
|
3453
|
+
"React currently only supports piping to one writable stream."
|
|
3454
|
+
);
|
|
3455
|
+
hasStartedFlowing = !0;
|
|
3456
|
+
startFlowing(request, destination);
|
|
3457
|
+
destination.on("drain", createDrainHandler(destination, request));
|
|
3458
|
+
destination.on(
|
|
3459
|
+
"error",
|
|
3460
|
+
createCancelHandler(
|
|
3461
|
+
request,
|
|
3462
|
+
"The destination stream errored while writing data."
|
|
3463
|
+
)
|
|
3464
|
+
);
|
|
3465
|
+
destination.on(
|
|
3466
|
+
"close",
|
|
3467
|
+
createCancelHandler(request, "The destination stream closed early.")
|
|
3468
|
+
);
|
|
3469
|
+
return destination;
|
|
3470
|
+
},
|
|
3471
|
+
abort: function (reason) {
|
|
3472
|
+
abort(request, reason);
|
|
3473
|
+
}
|
|
3474
|
+
};
|
|
3475
|
+
};
|
|
3476
|
+
exports.renderToReadableStream = function (model, webpackMap, options) {
|
|
3477
|
+
var request = new RequestInstance(
|
|
3478
|
+
20,
|
|
3479
|
+
model,
|
|
3480
|
+
webpackMap,
|
|
3481
|
+
options ? options.onError : void 0,
|
|
3482
|
+
options ? options.onPostpone : void 0,
|
|
3483
|
+
noop,
|
|
3484
|
+
noop,
|
|
3485
|
+
options ? options.identifierPrefix : void 0,
|
|
3486
|
+
options ? options.temporaryReferences : void 0
|
|
3487
|
+
);
|
|
3488
|
+
if (options && options.signal) {
|
|
3489
|
+
var signal = options.signal;
|
|
3490
|
+
if (signal.aborted) abort(request, signal.reason);
|
|
3491
|
+
else {
|
|
3492
|
+
var listener = function () {
|
|
3493
|
+
abort(request, signal.reason);
|
|
3494
|
+
signal.removeEventListener("abort", listener);
|
|
3495
|
+
};
|
|
3496
|
+
signal.addEventListener("abort", listener);
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
var writable;
|
|
3500
|
+
return new ReadableStream(
|
|
3501
|
+
{
|
|
3502
|
+
type: "bytes",
|
|
3503
|
+
start: function (controller) {
|
|
3504
|
+
writable = createFakeWritableFromReadableStreamController(controller);
|
|
3505
|
+
startWork(request);
|
|
3506
|
+
},
|
|
3507
|
+
pull: function () {
|
|
3508
|
+
startFlowing(request, writable);
|
|
3509
|
+
},
|
|
3510
|
+
cancel: function (reason) {
|
|
3511
|
+
request.destination = null;
|
|
3512
|
+
abort(request, reason);
|
|
3513
|
+
}
|
|
3514
|
+
},
|
|
3515
|
+
{ highWaterMark: 0 }
|
|
3516
|
+
);
|
|
3517
|
+
};
|