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