Socket
Socket
Sign inDemoInstall

react-server-dom-webpack

Package Overview
Dependencies
Maintainers
5
Versions
1251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-server-dom-webpack - npm Package Compare versions

Comparing version 19.0.0-rc-9d4fba0788-20240530 to 19.0.0-rc-a03254bc-20240905

static.browser.js

477

cjs/react-server-dom-webpack-client.browser.production.js

@@ -74,4 +74,4 @@ /**

: 0 < promises.length
? Promise.all(promises)
: null;
? Promise.all(promises)
: null;
}

@@ -109,6 +109,6 @@ var chunkMap = new Map(),

: Infinity === number
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
}

@@ -472,3 +472,19 @@ function processReply(

}
function Chunk(status, value, reason, response) {
function createBoundServerReference(metaData, callServer) {
function action() {
var args = Array.prototype.slice.call(arguments);
return bound
? "fulfilled" === bound.status
? callServer(id, bound.value.concat(args))
: Promise.resolve(bound).then(function (boundArgs) {
return callServer(id, boundArgs.concat(args));
})
: callServer(id, args);
}
var id = metaData.id,
bound = metaData.bound;
registerServerReference(action, { id: id, bound: bound });
return action;
}
function ReactPromise(status, value, reason, response) {
this.status = status;

@@ -479,4 +495,4 @@ this.value = value;

}
Chunk.prototype = Object.create(Promise.prototype);
Chunk.prototype.then = function (resolve, reject) {
ReactPromise.prototype = Object.create(Promise.prototype);
ReactPromise.prototype.then = function (resolve, reject) {
switch (this.status) {

@@ -495,3 +511,2 @@ case "resolved_model":

case "blocked":
case "cyclic":
resolve &&

@@ -519,3 +534,2 @@ (null === this.value && (this.value = []), this.value.push(resolve));

case "blocked":
case "cyclic":
throw chunk;

@@ -527,3 +541,3 @@ default:

function createPendingChunk(response) {
return new Chunk("pending", null, null, response);
return new ReactPromise("pending", null, null, response);
}

@@ -540,3 +554,2 @@ function wakeChunk(listeners, value) {

case "blocked":
case "cyclic":
if (chunk.value)

@@ -571,3 +584,3 @@ for (var i = 0; i < resolveListeners.length; i++)

function createResolvedIteratorResultChunk(response, value, done) {
return new Chunk(
return new ReactPromise(
"resolved_model",

@@ -608,31 +621,31 @@ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",

}
var initializingChunk = null,
initializingChunkBlockedModel = null;
var initializingHandler = null;
function initializeModelChunk(chunk) {
var prevChunk = initializingChunk,
prevBlocked = initializingChunkBlockedModel;
initializingChunk = chunk;
initializingChunkBlockedModel = null;
var prevHandler = initializingHandler;
initializingHandler = null;
var resolvedModel = chunk.value;
chunk.status = "cyclic";
chunk.status = "blocked";
chunk.value = null;
chunk.reason = null;
try {
var value = JSON.parse(resolvedModel, chunk._response._fromJSON);
if (
null !== initializingChunkBlockedModel &&
0 < initializingChunkBlockedModel.deps
)
(initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
else {
var resolveListeners = chunk.value;
chunk.status = "fulfilled";
chunk.value = value;
null !== resolveListeners && wakeChunk(resolveListeners, value);
var value = JSON.parse(resolvedModel, chunk._response._fromJSON),
resolveListeners = chunk.value;
null !== resolveListeners &&
((chunk.value = null),
(chunk.reason = null),
wakeChunk(resolveListeners, value));
if (null !== initializingHandler) {
if (initializingHandler.errored) throw initializingHandler.value;
if (0 < initializingHandler.deps) {
initializingHandler.value = value;
initializingHandler.chunk = chunk;
return;
}
}
chunk.status = "fulfilled";
chunk.value = value;
} catch (error) {
(chunk.status = "rejected"), (chunk.reason = error);
} finally {
(initializingChunk = prevChunk),
(initializingChunkBlockedModel = prevBlocked);
initializingHandler = prevHandler;
}

@@ -652,6 +665,6 @@ }

: "" === metadata[2]
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
chunk.status = "fulfilled";

@@ -668,2 +681,5 @@ chunk.value = JSCompiler_inline_result;

}
function createLazyChunkWrapper(chunk) {
return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };
}
function getChunk(response, id) {

@@ -675,7 +691,6 @@ var chunks = response._chunks,

}
function createModelResolver(
chunk,
function waitForReference(
referencedChunk,
parentObject,
key,
cyclic,
response,

@@ -685,43 +700,60 @@ map,

) {
if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel;
cyclic || blocked.deps++;
function fulfill(value) {
for (var i = 1; i < path.length; i++) {
for (; value.$$typeof === REACT_LAZY_TYPE; )
if (((value = value._payload), value === handler.chunk))
value = handler.value;
else if ("fulfilled" === value.status) value = value.value;
else {
path.splice(0, i - 1);
value.then(fulfill, reject);
return;
}
value = value[path[i]];
}
parentObject[key] = map(response, value);
"" === key && null === handler.value && (handler.value = parentObject[key]);
parentObject[0] === REACT_ELEMENT_TYPE &&
"3" === key &&
"object" === typeof handler.value &&
null !== handler.value &&
handler.value.$$typeof === REACT_ELEMENT_TYPE &&
null === handler.value.props &&
(handler.value.props = parentObject[key]);
handler.deps--;
0 === handler.deps &&
((i = handler.chunk),
null !== i &&
"blocked" === i.status &&
((value = i.value),
(i.status = "fulfilled"),
(i.value = handler.value),
null !== value && wakeChunk(value, handler.value)));
}
function reject(error) {
if (!handler.errored) {
handler.errored = !0;
handler.value = error;
var chunk = handler.chunk;
null !== chunk &&
"blocked" === chunk.status &&
triggerErrorOnChunk(chunk, error);
}
}
if (initializingHandler) {
var handler = initializingHandler;
handler.deps++;
} else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
handler = initializingHandler = {
parent: null,
chunk: null,
value: null,
deps: 1,
errored: !1
};
return function (value) {
for (var i = 1; i < path.length; i++) value = value[path[i]];
parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--;
0 === blocked.deps &&
"blocked" === chunk.status &&
((value = chunk.value),
(chunk.status = "fulfilled"),
(chunk.value = blocked.value),
null !== value && wakeChunk(value, blocked.value));
};
referencedChunk.then(fulfill, reject);
return null;
}
function createModelReject(chunk) {
return function (error) {
return triggerErrorOnChunk(chunk, error);
};
}
function createServerReferenceProxy(response, metaData) {
function proxy() {
var args = Array.prototype.slice.call(arguments),
p = metaData.bound;
return p
? "fulfilled" === p.status
? callServer(metaData.id, p.value.concat(args))
: Promise.resolve(p).then(function (bound) {
return callServer(metaData.id, bound.concat(args));
})
: callServer(metaData.id, args);
}
var callServer = response._callServer;
knownServerReferences.set(proxy, metaData);
return proxy;
return createBoundServerReference(metaData, response._callServer);
}

@@ -741,25 +773,36 @@ function getOutlinedModel(response, reference, parentObject, key, map) {

case "fulfilled":
parentObject = id.value;
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
return map(response, parentObject);
var value = id.value;
for (id = 1; id < reference.length; id++)
if (
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE)
)
if (((value = value._payload), "fulfilled" === value.status))
value = value.value;
else
return waitForReference(
value,
parentObject,
key,
response,
map,
reference.slice(id)
);
return map(response, value);
case "pending":
case "blocked":
case "cyclic":
var parentChunk = initializingChunk;
id.then(
createModelResolver(
parentChunk,
parentObject,
key,
"cyclic" === id.status,
response,
map,
reference
),
createModelReject(parentChunk)
return waitForReference(id, parentObject, key, response, map, reference);
default:
return (
initializingHandler
? ((initializingHandler.errored = !0),
(initializingHandler.value = id.reason))
: (initializingHandler = {
parent: null,
chunk: null,
value: id.reason,
deps: 0,
errored: !0
}),
null
);
return null;
default:
throw id.reason;
}

@@ -790,3 +833,15 @@ }

if ("$" === value[0]) {
if ("$" === value) return REACT_ELEMENT_TYPE;
if ("$" === value)
return (
null !== initializingHandler &&
"0" === key &&
(initializingHandler = {
parent: initializingHandler,
chunk: null,
value: null,
deps: 0,
errored: !1
}),
REACT_ELEMENT_TYPE
);
switch (value[1]) {

@@ -799,3 +854,3 @@ case "$":

(response = getChunk(response, parentObject)),
{ $$typeof: REACT_LAZY_TYPE, _payload: response, _init: readChunk }
createLazyChunkWrapper(response)
);

@@ -878,2 +933,24 @@ case "@":

}
function ResponseInstance(
bundlerConfig,
moduleLoading,
callServer,
encodeFormAction,
nonce,
temporaryReferences
) {
var chunks = new Map();
this._bundlerConfig = bundlerConfig;
this._moduleLoading = moduleLoading;
this._callServer = void 0 !== callServer ? callServer : missingCall;
this._encodeFormAction = encodeFormAction;
this._nonce = nonce;
this._chunks = chunks;
this._stringDecoder = new TextDecoder();
this._fromJSON = null;
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
this._buffer = [];
this._tempRefs = temporaryReferences;
this._fromJSON = createFromJSONCallback(this);
}
function resolveBuffer(response, id, buffer) {

@@ -884,3 +961,3 @@ var chunks = response._chunks,

? chunk.reason.enqueueValue(buffer)
: chunks.set(id, new Chunk("fulfilled", buffer, null, response));
: chunks.set(id, new ReactPromise("fulfilled", buffer, null, response));
}

@@ -897,3 +974,3 @@ function resolveModule(response, id, model) {

} else
(blockedChunk = new Chunk("blocked", null, null, response)),
(blockedChunk = new ReactPromise("blocked", null, null, response)),
chunks.set(id, blockedChunk);

@@ -913,3 +990,3 @@ model.then(

id,
new Chunk("resolved_module", clientReference, null, response)
new ReactPromise("resolved_module", clientReference, null, response)
);

@@ -927,3 +1004,6 @@ }

null !== response && wakeChunk(response, chunk.value))
: chunks.set(id, new Chunk("fulfilled", stream, controller, response));
: chunks.set(
id,
new ReactPromise("fulfilled", stream, controller, response)
);
}

@@ -949,3 +1029,3 @@ function startReadableStream(response, id, type) {

if (null === previousBlockedChunk) {
var chunk = new Chunk("resolved_model", json, null, response);
var chunk = new ReactPromise("resolved_model", json, null, response);
initializeModelChunk(chunk);

@@ -965,4 +1045,4 @@ "fulfilled" === chunk.status

chunk = previousBlockedChunk;
var chunk$51 = createPendingChunk(response);
chunk$51.then(
var chunk$52 = createPendingChunk(response);
chunk$52.then(
function (v) {

@@ -975,6 +1055,6 @@ return controller.enqueue(v);

);
previousBlockedChunk = chunk$51;
previousBlockedChunk = chunk$52;
chunk.then(function () {
previousBlockedChunk === chunk$51 && (previousBlockedChunk = null);
resolveModelChunk(chunk$51, json);
previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);
resolveModelChunk(chunk$52, json);
});

@@ -1028,3 +1108,3 @@ }

if (closed)
return new Chunk(
return new ReactPromise(
"fulfilled",

@@ -1048,3 +1128,3 @@ { done: !0, value: void 0 },

if (nextWriteIndex === buffer.length)
buffer[nextWriteIndex] = new Chunk(
buffer[nextWriteIndex] = new ReactPromise(
"fulfilled",

@@ -1109,4 +1189,4 @@ { done: !1, value: value },

byteLength = new Uint8Array(byteLength);
for (var i$52 = (i = 0); i$52 < l; i$52++) {
var chunk = buffer[i$52];
for (var i$53 = (i = 0); i$53 < l; i$53++) {
var chunk = buffer[i$53];
byteLength.set(chunk, i);

@@ -1137,3 +1217,3 @@ i += chunk.byteLength;

}
function processFullRow(response, id, tag, buffer, chunk) {
function processFullBinaryRow(response, id, tag, buffer, chunk) {
switch (tag) {

@@ -1190,20 +1270,20 @@ case 65:

row += stringDecoder.decode(buffer[i], decoderOptions);
row += stringDecoder.decode(chunk);
buffer = row += stringDecoder.decode(chunk);
switch (tag) {
case 73:
resolveModule(response, id, row);
resolveModule(response, id, buffer);
break;
case 72:
id = row[0];
row = row.slice(1);
response = JSON.parse(row, response._fromJSON);
row = ReactDOMSharedInternals.d;
id = buffer[0];
buffer = buffer.slice(1);
response = JSON.parse(buffer, response._fromJSON);
buffer = ReactDOMSharedInternals.d;
switch (id) {
case "D":
row.D(response);
buffer.D(response);
break;
case "C":
"string" === typeof response
? row.C(response)
: row.C(response[0], response[1]);
? buffer.C(response)
: buffer.C(response[0], response[1]);
break;

@@ -1213,18 +1293,20 @@ case "L":

tag = response[1];
3 === response.length ? row.L(id, tag, response[2]) : row.L(id, tag);
3 === response.length
? buffer.L(id, tag, response[2])
: buffer.L(id, tag);
break;
case "m":
"string" === typeof response
? row.m(response)
: row.m(response[0], response[1]);
? buffer.m(response)
: buffer.m(response[0], response[1]);
break;
case "X":
"string" === typeof response
? row.X(response)
: row.X(response[0], response[1]);
? buffer.X(response)
: buffer.X(response[0], response[1]);
break;
case "S":
"string" === typeof response
? row.S(response)
: row.S(
? buffer.S(response)
: buffer.S(
response[0],

@@ -1237,23 +1319,23 @@ 0 === response[1] ? void 0 : response[1],

"string" === typeof response
? row.M(response)
: row.M(response[0], response[1]);
? buffer.M(response)
: buffer.M(response[0], response[1]);
}
break;
case 69:
tag = JSON.parse(row).digest;
row = Error(
tag = JSON.parse(buffer).digest;
buffer = Error(
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error."
);
row.stack = "Error: " + row.message;
row.digest = tag;
buffer.stack = "Error: " + buffer.message;
buffer.digest = tag;
tag = response._chunks;
(buffer = tag.get(id))
? triggerErrorOnChunk(buffer, row)
: tag.set(id, new Chunk("rejected", null, row, response));
(chunk = tag.get(id))
? triggerErrorOnChunk(chunk, buffer)
: tag.set(id, new ReactPromise("rejected", null, buffer, response));
break;
case 84:
tag = response._chunks;
(buffer = tag.get(id)) && "pending" !== buffer.status
? buffer.reason.enqueueValue(row)
: tag.set(id, new Chunk("fulfilled", row, null, response));
(chunk = tag.get(id)) && "pending" !== chunk.status
? chunk.reason.enqueueValue(buffer)
: tag.set(id, new ReactPromise("fulfilled", buffer, null, response));
break;

@@ -1280,9 +1362,12 @@ case 68:

"fulfilled" === response.status &&
response.reason.close("" === row ? '"$undefined"' : row);
response.reason.close("" === buffer ? '"$undefined"' : buffer);
break;
default:
(tag = response._chunks),
(buffer = tag.get(id))
? resolveModelChunk(buffer, row)
: tag.set(id, new Chunk("resolved_model", row, null, response));
(chunk = tag.get(id))
? resolveModelChunk(chunk, buffer)
: tag.set(
id,
new ReactPromise("resolved_model", buffer, null, response)
);
}

@@ -1292,44 +1377,51 @@ }

return function (key, value) {
return "string" === typeof value
? parseModelString(response, this, key, value)
: "object" === typeof value && null !== value
? ((key =
value[0] === REACT_ELEMENT_TYPE
? {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}
: value),
key)
: value;
if ("string" === typeof value)
return parseModelString(response, this, key, value);
if ("object" === typeof value && null !== value) {
if (value[0] === REACT_ELEMENT_TYPE) {
if (
((key = {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}),
null !== initializingHandler)
)
if (
((value = initializingHandler),
(initializingHandler = value.parent),
value.errored)
)
(key = new ReactPromise("rejected", null, value.value, response)),
(key = createLazyChunkWrapper(key));
else if (0 < value.deps) {
var blockedChunk = new ReactPromise(
"blocked",
null,
null,
response
);
value.value = key;
value.chunk = blockedChunk;
key = createLazyChunkWrapper(blockedChunk);
}
} else key = value;
return key;
}
return value;
};
}
function createResponseFromOptions(options) {
var callServer = options && options.callServer ? options.callServer : void 0;
options =
return new ResponseInstance(
null,
null,
options && options.callServer ? options.callServer : void 0,
void 0,
void 0,
options && options.temporaryReferences
? options.temporaryReferences
: void 0;
var chunks = new Map();
callServer = {
_bundlerConfig: null,
_moduleLoading: null,
_callServer: void 0 !== callServer ? callServer : missingCall,
_encodeFormAction: void 0,
_nonce: void 0,
_chunks: chunks,
_stringDecoder: new TextDecoder(),
_fromJSON: null,
_rowState: 0,
_rowID: 0,
_rowTag: 0,
_rowLength: 0,
_buffer: [],
_tempRefs: options
};
callServer._fromJSON = createFromJSONCallback(callServer);
return callServer;
: void 0
);
}

@@ -1379,6 +1471,7 @@ function startReadingFromStream(response, stream) {

: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
35 === rowState ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;

@@ -1402,3 +1495,3 @@ case 2:

(rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),
processFullRow(response, _ref, rowTag, buffer, rowLength),
processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),
(i = lastIdx),

@@ -1446,8 +1539,8 @@ 3 === rowState && i++,

exports.createServerReference = function (id, callServer) {
function proxy() {
function action() {
var args = Array.prototype.slice.call(arguments);
return callServer(id, args);
}
registerServerReference(proxy, { id: id, bound: null });
return proxy;
registerServerReference(action, { id: id, bound: null });
return action;
};

@@ -1454,0 +1547,0 @@ exports.createTemporaryReferenceSet = function () {

@@ -73,4 +73,4 @@ /**

: 0 < promises.length
? Promise.all(promises)
: null;
? Promise.all(promises)
: null;
}

@@ -121,6 +121,6 @@ function prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) {

: Infinity === number
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
}

@@ -618,11 +618,27 @@ function processReply(

}
function createBoundServerReference(metaData, callServer, encodeFormAction) {
function action() {
var args = Array.prototype.slice.call(arguments);
return bound
? "fulfilled" === bound.status
? callServer(id, bound.value.concat(args))
: Promise.resolve(bound).then(function (boundArgs) {
return callServer(id, boundArgs.concat(args));
})
: callServer(id, args);
}
var id = metaData.id,
bound = metaData.bound;
registerServerReference(action, { id: id, bound: bound }, encodeFormAction);
return action;
}
function createServerReference$1(id, callServer, encodeFormAction) {
function proxy() {
function action() {
var args = Array.prototype.slice.call(arguments);
return callServer(id, args);
}
registerServerReference(proxy, { id: id, bound: null }, encodeFormAction);
return proxy;
registerServerReference(action, { id: id, bound: null }, encodeFormAction);
return action;
}
function Chunk(status, value, reason, response) {
function ReactPromise(status, value, reason, response) {
this.status = status;

@@ -633,4 +649,4 @@ this.value = value;

}
Chunk.prototype = Object.create(Promise.prototype);
Chunk.prototype.then = function (resolve, reject) {
ReactPromise.prototype = Object.create(Promise.prototype);
ReactPromise.prototype.then = function (resolve, reject) {
switch (this.status) {

@@ -649,3 +665,2 @@ case "resolved_model":

case "blocked":
case "cyclic":
resolve &&

@@ -673,3 +688,2 @@ (null === this.value && (this.value = []), this.value.push(resolve));

case "blocked":
case "cyclic":
throw chunk;

@@ -681,3 +695,3 @@ default:

function createPendingChunk(response) {
return new Chunk("pending", null, null, response);
return new ReactPromise("pending", null, null, response);
}

@@ -694,3 +708,2 @@ function wakeChunk(listeners, value) {

case "blocked":
case "cyclic":
if (chunk.value)

@@ -725,3 +738,3 @@ for (var i = 0; i < resolveListeners.length; i++)

function createResolvedIteratorResultChunk(response, value, done) {
return new Chunk(
return new ReactPromise(
"resolved_model",

@@ -762,31 +775,31 @@ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",

}
var initializingChunk = null,
initializingChunkBlockedModel = null;
var initializingHandler = null;
function initializeModelChunk(chunk) {
var prevChunk = initializingChunk,
prevBlocked = initializingChunkBlockedModel;
initializingChunk = chunk;
initializingChunkBlockedModel = null;
var prevHandler = initializingHandler;
initializingHandler = null;
var resolvedModel = chunk.value;
chunk.status = "cyclic";
chunk.status = "blocked";
chunk.value = null;
chunk.reason = null;
try {
var value = JSON.parse(resolvedModel, chunk._response._fromJSON);
if (
null !== initializingChunkBlockedModel &&
0 < initializingChunkBlockedModel.deps
)
(initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
else {
var resolveListeners = chunk.value;
chunk.status = "fulfilled";
chunk.value = value;
null !== resolveListeners && wakeChunk(resolveListeners, value);
var value = JSON.parse(resolvedModel, chunk._response._fromJSON),
resolveListeners = chunk.value;
null !== resolveListeners &&
((chunk.value = null),
(chunk.reason = null),
wakeChunk(resolveListeners, value));
if (null !== initializingHandler) {
if (initializingHandler.errored) throw initializingHandler.value;
if (0 < initializingHandler.deps) {
initializingHandler.value = value;
initializingHandler.chunk = chunk;
return;
}
}
chunk.status = "fulfilled";
chunk.value = value;
} catch (error) {
(chunk.status = "rejected"), (chunk.reason = error);
} finally {
(initializingChunk = prevChunk),
(initializingChunkBlockedModel = prevBlocked);
initializingHandler = prevHandler;
}

@@ -806,6 +819,6 @@ }

: "" === metadata[2]
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
chunk.status = "fulfilled";

@@ -822,2 +835,5 @@ chunk.value = JSCompiler_inline_result;

}
function createLazyChunkWrapper(chunk) {
return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };
}
function getChunk(response, id) {

@@ -829,7 +845,6 @@ var chunks = response._chunks,

}
function createModelResolver(
chunk,
function waitForReference(
referencedChunk,
parentObject,
key,
cyclic,
response,

@@ -839,43 +854,64 @@ map,

) {
if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel;
cyclic || blocked.deps++;
function fulfill(value) {
for (var i = 1; i < path.length; i++) {
for (; value.$$typeof === REACT_LAZY_TYPE; )
if (((value = value._payload), value === handler.chunk))
value = handler.value;
else if ("fulfilled" === value.status) value = value.value;
else {
path.splice(0, i - 1);
value.then(fulfill, reject);
return;
}
value = value[path[i]];
}
parentObject[key] = map(response, value);
"" === key && null === handler.value && (handler.value = parentObject[key]);
parentObject[0] === REACT_ELEMENT_TYPE &&
"3" === key &&
"object" === typeof handler.value &&
null !== handler.value &&
handler.value.$$typeof === REACT_ELEMENT_TYPE &&
null === handler.value.props &&
(handler.value.props = parentObject[key]);
handler.deps--;
0 === handler.deps &&
((i = handler.chunk),
null !== i &&
"blocked" === i.status &&
((value = i.value),
(i.status = "fulfilled"),
(i.value = handler.value),
null !== value && wakeChunk(value, handler.value)));
}
function reject(error) {
if (!handler.errored) {
handler.errored = !0;
handler.value = error;
var chunk = handler.chunk;
null !== chunk &&
"blocked" === chunk.status &&
triggerErrorOnChunk(chunk, error);
}
}
if (initializingHandler) {
var handler = initializingHandler;
handler.deps++;
} else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
handler = initializingHandler = {
parent: null,
chunk: null,
value: null,
deps: 1,
errored: !1
};
return function (value) {
for (var i = 1; i < path.length; i++) value = value[path[i]];
parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--;
0 === blocked.deps &&
"blocked" === chunk.status &&
((value = chunk.value),
(chunk.status = "fulfilled"),
(chunk.value = blocked.value),
null !== value && wakeChunk(value, blocked.value));
};
referencedChunk.then(fulfill, reject);
return null;
}
function createModelReject(chunk) {
return function (error) {
return triggerErrorOnChunk(chunk, error);
};
}
function createServerReferenceProxy(response, metaData) {
function proxy() {
var args = Array.prototype.slice.call(arguments),
p = metaData.bound;
return p
? "fulfilled" === p.status
? callServer(metaData.id, p.value.concat(args))
: Promise.resolve(p).then(function (bound) {
return callServer(metaData.id, bound.concat(args));
})
: callServer(metaData.id, args);
}
var callServer = response._callServer;
registerServerReference(proxy, metaData, response._encodeFormAction);
return proxy;
return createBoundServerReference(
metaData,
response._callServer,
response._encodeFormAction
);
}

@@ -895,25 +931,36 @@ function getOutlinedModel(response, reference, parentObject, key, map) {

case "fulfilled":
parentObject = id.value;
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
return map(response, parentObject);
var value = id.value;
for (id = 1; id < reference.length; id++)
if (
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE)
)
if (((value = value._payload), "fulfilled" === value.status))
value = value.value;
else
return waitForReference(
value,
parentObject,
key,
response,
map,
reference.slice(id)
);
return map(response, value);
case "pending":
case "blocked":
case "cyclic":
var parentChunk = initializingChunk;
id.then(
createModelResolver(
parentChunk,
parentObject,
key,
"cyclic" === id.status,
response,
map,
reference
),
createModelReject(parentChunk)
return waitForReference(id, parentObject, key, response, map, reference);
default:
return (
initializingHandler
? ((initializingHandler.errored = !0),
(initializingHandler.value = id.reason))
: (initializingHandler = {
parent: null,
chunk: null,
value: id.reason,
deps: 0,
errored: !0
}),
null
);
return null;
default:
throw id.reason;
}

@@ -944,3 +991,15 @@ }

if ("$" === value[0]) {
if ("$" === value) return REACT_ELEMENT_TYPE;
if ("$" === value)
return (
null !== initializingHandler &&
"0" === key &&
(initializingHandler = {
parent: initializingHandler,
chunk: null,
value: null,
deps: 0,
errored: !1
}),
REACT_ELEMENT_TYPE
);
switch (value[1]) {

@@ -953,3 +1012,3 @@ case "$":

(response = getChunk(response, parentObject)),
{ $$typeof: REACT_LAZY_TYPE, _payload: response, _init: readChunk }
createLazyChunkWrapper(response)
);

@@ -1032,2 +1091,24 @@ case "@":

}
function ResponseInstance(
bundlerConfig,
moduleLoading,
callServer,
encodeFormAction,
nonce,
temporaryReferences
) {
var chunks = new Map();
this._bundlerConfig = bundlerConfig;
this._moduleLoading = moduleLoading;
this._callServer = void 0 !== callServer ? callServer : missingCall;
this._encodeFormAction = encodeFormAction;
this._nonce = nonce;
this._chunks = chunks;
this._stringDecoder = new TextDecoder();
this._fromJSON = null;
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
this._buffer = [];
this._tempRefs = temporaryReferences;
this._fromJSON = createFromJSONCallback(this);
}
function resolveBuffer(response, id, buffer) {

@@ -1038,3 +1119,3 @@ var chunks = response._chunks,

? chunk.reason.enqueueValue(buffer)
: chunks.set(id, new Chunk("fulfilled", buffer, null, response));
: chunks.set(id, new ReactPromise("fulfilled", buffer, null, response));
}

@@ -1056,3 +1137,3 @@ function resolveModule(response, id, model) {

} else
(blockedChunk = new Chunk("blocked", null, null, response)),
(blockedChunk = new ReactPromise("blocked", null, null, response)),
chunks.set(id, blockedChunk);

@@ -1072,3 +1153,3 @@ model.then(

id,
new Chunk("resolved_module", clientReference, null, response)
new ReactPromise("resolved_module", clientReference, null, response)
);

@@ -1086,3 +1167,6 @@ }

null !== response && wakeChunk(response, chunk.value))
: chunks.set(id, new Chunk("fulfilled", stream, controller, response));
: chunks.set(
id,
new ReactPromise("fulfilled", stream, controller, response)
);
}

@@ -1108,3 +1192,3 @@ function startReadableStream(response, id, type) {

if (null === previousBlockedChunk) {
var chunk = new Chunk("resolved_model", json, null, response);
var chunk = new ReactPromise("resolved_model", json, null, response);
initializeModelChunk(chunk);

@@ -1124,4 +1208,4 @@ "fulfilled" === chunk.status

chunk = previousBlockedChunk;
var chunk$51 = createPendingChunk(response);
chunk$51.then(
var chunk$52 = createPendingChunk(response);
chunk$52.then(
function (v) {

@@ -1134,6 +1218,6 @@ return controller.enqueue(v);

);
previousBlockedChunk = chunk$51;
previousBlockedChunk = chunk$52;
chunk.then(function () {
previousBlockedChunk === chunk$51 && (previousBlockedChunk = null);
resolveModelChunk(chunk$51, json);
previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);
resolveModelChunk(chunk$52, json);
});

@@ -1187,3 +1271,3 @@ }

if (closed)
return new Chunk(
return new ReactPromise(
"fulfilled",

@@ -1207,3 +1291,3 @@ { done: !0, value: void 0 },

if (nextWriteIndex === buffer.length)
buffer[nextWriteIndex] = new Chunk(
buffer[nextWriteIndex] = new ReactPromise(
"fulfilled",

@@ -1268,4 +1352,4 @@ { done: !1, value: value },

byteLength = new Uint8Array(byteLength);
for (var i$52 = (i = 0); i$52 < l; i$52++) {
var chunk = buffer[i$52];
for (var i$53 = (i = 0); i$53 < l; i$53++) {
var chunk = buffer[i$53];
byteLength.set(chunk, i);

@@ -1296,3 +1380,3 @@ i += chunk.byteLength;

}
function processFullRow(response, id, tag, buffer, chunk) {
function processFullBinaryRow(response, id, tag, buffer, chunk) {
switch (tag) {

@@ -1349,20 +1433,20 @@ case 65:

row += stringDecoder.decode(buffer[i], decoderOptions);
row += stringDecoder.decode(chunk);
buffer = row += stringDecoder.decode(chunk);
switch (tag) {
case 73:
resolveModule(response, id, row);
resolveModule(response, id, buffer);
break;
case 72:
id = row[0];
row = row.slice(1);
response = JSON.parse(row, response._fromJSON);
row = ReactDOMSharedInternals.d;
id = buffer[0];
buffer = buffer.slice(1);
response = JSON.parse(buffer, response._fromJSON);
buffer = ReactDOMSharedInternals.d;
switch (id) {
case "D":
row.D(response);
buffer.D(response);
break;
case "C":
"string" === typeof response
? row.C(response)
: row.C(response[0], response[1]);
? buffer.C(response)
: buffer.C(response[0], response[1]);
break;

@@ -1372,18 +1456,20 @@ case "L":

tag = response[1];
3 === response.length ? row.L(id, tag, response[2]) : row.L(id, tag);
3 === response.length
? buffer.L(id, tag, response[2])
: buffer.L(id, tag);
break;
case "m":
"string" === typeof response
? row.m(response)
: row.m(response[0], response[1]);
? buffer.m(response)
: buffer.m(response[0], response[1]);
break;
case "X":
"string" === typeof response
? row.X(response)
: row.X(response[0], response[1]);
? buffer.X(response)
: buffer.X(response[0], response[1]);
break;
case "S":
"string" === typeof response
? row.S(response)
: row.S(
? buffer.S(response)
: buffer.S(
response[0],

@@ -1396,23 +1482,23 @@ 0 === response[1] ? void 0 : response[1],

"string" === typeof response
? row.M(response)
: row.M(response[0], response[1]);
? buffer.M(response)
: buffer.M(response[0], response[1]);
}
break;
case 69:
tag = JSON.parse(row).digest;
row = Error(
tag = JSON.parse(buffer).digest;
buffer = Error(
"An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error."
);
row.stack = "Error: " + row.message;
row.digest = tag;
buffer.stack = "Error: " + buffer.message;
buffer.digest = tag;
tag = response._chunks;
(buffer = tag.get(id))
? triggerErrorOnChunk(buffer, row)
: tag.set(id, new Chunk("rejected", null, row, response));
(chunk = tag.get(id))
? triggerErrorOnChunk(chunk, buffer)
: tag.set(id, new ReactPromise("rejected", null, buffer, response));
break;
case 84:
tag = response._chunks;
(buffer = tag.get(id)) && "pending" !== buffer.status
? buffer.reason.enqueueValue(row)
: tag.set(id, new Chunk("fulfilled", row, null, response));
(chunk = tag.get(id)) && "pending" !== chunk.status
? chunk.reason.enqueueValue(buffer)
: tag.set(id, new ReactPromise("fulfilled", buffer, null, response));
break;

@@ -1439,9 +1525,12 @@ case 68:

"fulfilled" === response.status &&
response.reason.close("" === row ? '"$undefined"' : row);
response.reason.close("" === buffer ? '"$undefined"' : buffer);
break;
default:
(tag = response._chunks),
(buffer = tag.get(id))
? resolveModelChunk(buffer, row)
: tag.set(id, new Chunk("resolved_model", row, null, response));
(chunk = tag.get(id))
? resolveModelChunk(chunk, buffer)
: tag.set(
id,
new ReactPromise("resolved_model", buffer, null, response)
);
}

@@ -1451,17 +1540,38 @@ }

return function (key, value) {
return "string" === typeof value
? parseModelString(response, this, key, value)
: "object" === typeof value && null !== value
? ((key =
value[0] === REACT_ELEMENT_TYPE
? {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}
: value),
key)
: value;
if ("string" === typeof value)
return parseModelString(response, this, key, value);
if ("object" === typeof value && null !== value) {
if (value[0] === REACT_ELEMENT_TYPE) {
if (
((key = {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}),
null !== initializingHandler)
)
if (
((value = initializingHandler),
(initializingHandler = value.parent),
value.errored)
)
(key = new ReactPromise("rejected", null, value.value, response)),
(key = createLazyChunkWrapper(key));
else if (0 < value.deps) {
var blockedChunk = new ReactPromise(
"blocked",
null,
null,
response
);
value.value = key;
value.chunk = blockedChunk;
key = createLazyChunkWrapper(blockedChunk);
}
} else key = value;
return key;
}
return value;
};

@@ -1475,29 +1585,12 @@ }

function createResponseFromOptions(options) {
var bundlerConfig = options.ssrManifest.moduleMap,
moduleLoading = options.ssrManifest.moduleLoading,
encodeFormAction = options.encodeFormAction,
nonce = "string" === typeof options.nonce ? options.nonce : void 0;
options =
return new ResponseInstance(
options.ssrManifest.moduleMap,
options.ssrManifest.moduleLoading,
noServerCall,
options.encodeFormAction,
"string" === typeof options.nonce ? options.nonce : void 0,
options && options.temporaryReferences
? options.temporaryReferences
: void 0;
var chunks = new Map();
bundlerConfig = {
_bundlerConfig: bundlerConfig,
_moduleLoading: moduleLoading,
_callServer: void 0 !== noServerCall ? noServerCall : missingCall,
_encodeFormAction: encodeFormAction,
_nonce: nonce,
_chunks: chunks,
_stringDecoder: new TextDecoder(),
_fromJSON: null,
_rowState: 0,
_rowID: 0,
_rowTag: 0,
_rowLength: 0,
_buffer: [],
_tempRefs: options
};
bundlerConfig._fromJSON = createFromJSONCallback(bundlerConfig);
return bundlerConfig;
: void 0
);
}

@@ -1547,6 +1640,7 @@ function startReadingFromStream(response, stream) {

: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
35 === rowState ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;

@@ -1570,3 +1664,3 @@ case 2:

(rowLength = new Uint8Array(value.buffer, offset, lastIdx - i)),
processFullRow(response, _ref, rowTag, buffer, rowLength),
processFullBinaryRow(response, _ref, rowTag, buffer, rowLength),
(i = lastIdx),

@@ -1573,0 +1667,0 @@ 3 === rowState && i++,

@@ -74,4 +74,4 @@ /**

: 0 < promises.length
? Promise.all(promises)
: null;
? Promise.all(promises)
: null;
}

@@ -122,6 +122,6 @@ function prepareDestinationWithChunks(moduleLoading, chunks, nonce$jscomp$0) {

: Infinity === number
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
}

@@ -619,11 +619,27 @@ function processReply(

}
function createBoundServerReference(metaData, callServer, encodeFormAction) {
function action() {
var args = Array.prototype.slice.call(arguments);
return bound
? "fulfilled" === bound.status
? callServer(id, bound.value.concat(args))
: Promise.resolve(bound).then(function (boundArgs) {
return callServer(id, boundArgs.concat(args));
})
: callServer(id, args);
}
var id = metaData.id,
bound = metaData.bound;
registerServerReference(action, { id: id, bound: bound }, encodeFormAction);
return action;
}
function createServerReference$1(id, callServer, encodeFormAction) {
function proxy() {
function action() {
var args = Array.prototype.slice.call(arguments);
return callServer(id, args);
}
registerServerReference(proxy, { id: id, bound: null }, encodeFormAction);
return proxy;
registerServerReference(action, { id: id, bound: null }, encodeFormAction);
return action;
}
function Chunk(status, value, reason, response) {
function ReactPromise(status, value, reason, response) {
this.status = status;

@@ -634,4 +650,4 @@ this.value = value;

}
Chunk.prototype = Object.create(Promise.prototype);
Chunk.prototype.then = function (resolve, reject) {
ReactPromise.prototype = Object.create(Promise.prototype);
ReactPromise.prototype.then = function (resolve, reject) {
switch (this.status) {

@@ -650,3 +666,2 @@ case "resolved_model":

case "blocked":
case "cyclic":
resolve &&

@@ -674,3 +689,2 @@ (null === this.value && (this.value = []), this.value.push(resolve));

case "blocked":
case "cyclic":
throw chunk;

@@ -682,3 +696,3 @@ default:

function createPendingChunk(response) {
return new Chunk("pending", null, null, response);
return new ReactPromise("pending", null, null, response);
}

@@ -695,3 +709,2 @@ function wakeChunk(listeners, value) {

case "blocked":
case "cyclic":
if (chunk.value)

@@ -726,3 +739,3 @@ for (var i = 0; i < resolveListeners.length; i++)

function createResolvedIteratorResultChunk(response, value, done) {
return new Chunk(
return new ReactPromise(
"resolved_model",

@@ -763,31 +776,31 @@ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",

}
var initializingChunk = null,
initializingChunkBlockedModel = null;
var initializingHandler = null;
function initializeModelChunk(chunk) {
var prevChunk = initializingChunk,
prevBlocked = initializingChunkBlockedModel;
initializingChunk = chunk;
initializingChunkBlockedModel = null;
var prevHandler = initializingHandler;
initializingHandler = null;
var resolvedModel = chunk.value;
chunk.status = "cyclic";
chunk.status = "blocked";
chunk.value = null;
chunk.reason = null;
try {
var value = JSON.parse(resolvedModel, chunk._response._fromJSON);
if (
null !== initializingChunkBlockedModel &&
0 < initializingChunkBlockedModel.deps
)
(initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
else {
var resolveListeners = chunk.value;
chunk.status = "fulfilled";
chunk.value = value;
null !== resolveListeners && wakeChunk(resolveListeners, value);
var value = JSON.parse(resolvedModel, chunk._response._fromJSON),
resolveListeners = chunk.value;
null !== resolveListeners &&
((chunk.value = null),
(chunk.reason = null),
wakeChunk(resolveListeners, value));
if (null !== initializingHandler) {
if (initializingHandler.errored) throw initializingHandler.value;
if (0 < initializingHandler.deps) {
initializingHandler.value = value;
initializingHandler.chunk = chunk;
return;
}
}
chunk.status = "fulfilled";
chunk.value = value;
} catch (error) {
(chunk.status = "rejected"), (chunk.reason = error);
} finally {
(initializingChunk = prevChunk),
(initializingChunkBlockedModel = prevBlocked);
initializingHandler = prevHandler;
}

@@ -807,6 +820,6 @@ }

: "" === metadata[2]
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
? moduleExports.__esModule
? moduleExports.default
: moduleExports
: moduleExports[metadata[2]];
chunk.status = "fulfilled";

@@ -823,2 +836,5 @@ chunk.value = JSCompiler_inline_result;

}
function createLazyChunkWrapper(chunk) {
return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };
}
function getChunk(response, id) {

@@ -830,7 +846,6 @@ var chunks = response._chunks,

}
function createModelResolver(
chunk,
function waitForReference(
referencedChunk,
parentObject,
key,
cyclic,
response,

@@ -840,43 +855,64 @@ map,

) {
if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel;
cyclic || blocked.deps++;
function fulfill(value) {
for (var i = 1; i < path.length; i++) {
for (; value.$$typeof === REACT_LAZY_TYPE; )
if (((value = value._payload), value === handler.chunk))
value = handler.value;
else if ("fulfilled" === value.status) value = value.value;
else {
path.splice(0, i - 1);
value.then(fulfill, reject);
return;
}
value = value[path[i]];
}
parentObject[key] = map(response, value);
"" === key && null === handler.value && (handler.value = parentObject[key]);
parentObject[0] === REACT_ELEMENT_TYPE &&
"3" === key &&
"object" === typeof handler.value &&
null !== handler.value &&
handler.value.$$typeof === REACT_ELEMENT_TYPE &&
null === handler.value.props &&
(handler.value.props = parentObject[key]);
handler.deps--;
0 === handler.deps &&
((i = handler.chunk),
null !== i &&
"blocked" === i.status &&
((value = i.value),
(i.status = "fulfilled"),
(i.value = handler.value),
null !== value && wakeChunk(value, handler.value)));
}
function reject(error) {
if (!handler.errored) {
handler.errored = !0;
handler.value = error;
var chunk = handler.chunk;
null !== chunk &&
"blocked" === chunk.status &&
triggerErrorOnChunk(chunk, error);
}
}
if (initializingHandler) {
var handler = initializingHandler;
handler.deps++;
} else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
handler = initializingHandler = {
parent: null,
chunk: null,
value: null,
deps: 1,
errored: !1
};
return function (value) {
for (var i = 1; i < path.length; i++) value = value[path[i]];
parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--;
0 === blocked.deps &&
"blocked" === chunk.status &&
((value = chunk.value),
(chunk.status = "fulfilled"),
(chunk.value = blocked.value),
null !== value && wakeChunk(value, blocked.value));
};
referencedChunk.then(fulfill, reject);
return null;
}
function createModelReject(chunk) {
return function (error) {
return triggerErrorOnChunk(chunk, error);
};
}
function createServerReferenceProxy(response, metaData) {
function proxy() {
var args = Array.prototype.slice.call(arguments),
p = metaData.bound;
return p
? "fulfilled" === p.status
? callServer(metaData.id, p.value.concat(args))
: Promise.resolve(p).then(function (bound) {
return callServer(metaData.id, bound.concat(args));
})
: callServer(metaData.id, args);
}
var callServer = response._callServer;
registerServerReference(proxy, metaData, response._encodeFormAction);
return proxy;
return createBoundServerReference(
metaData,
response._callServer,
response._encodeFormAction
);
}

@@ -896,25 +932,36 @@ function getOutlinedModel(response, reference, parentObject, key, map) {

case "fulfilled":
parentObject = id.value;
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
return map(response, parentObject);
var value = id.value;
for (id = 1; id < reference.length; id++)
if (
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE)
)
if (((value = value._payload), "fulfilled" === value.status))
value = value.value;
else
return waitForReference(
value,
parentObject,
key,
response,
map,
reference.slice(id)
);
return map(response, value);
case "pending":
case "blocked":
case "cyclic":
var parentChunk = initializingChunk;
id.then(
createModelResolver(
parentChunk,
parentObject,
key,
"cyclic" === id.status,
response,
map,
reference
),
createModelReject(parentChunk)
return waitForReference(id, parentObject, key, response, map, reference);
default:
return (
initializingHandler
? ((initializingHandler.errored = !0),
(initializingHandler.value = id.reason))
: (initializingHandler = {
parent: null,
chunk: null,
value: id.reason,
deps: 0,
errored: !0
}),
null
);
return null;
default:
throw id.reason;
}

@@ -945,3 +992,15 @@ }

if ("$" === value[0]) {
if ("$" === value) return REACT_ELEMENT_TYPE;
if ("$" === value)
return (
null !== initializingHandler &&
"0" === key &&
(initializingHandler = {
parent: initializingHandler,
chunk: null,
value: null,
deps: 0,
errored: !1
}),
REACT_ELEMENT_TYPE
);
switch (value[1]) {

@@ -954,3 +1013,3 @@ case "$":

(response = getChunk(response, parentObject)),
{ $$typeof: REACT_LAZY_TYPE, _payload: response, _init: readChunk }
createLazyChunkWrapper(response)
);

@@ -1033,3 +1092,3 @@ case "@":

}
function createResponse(
function ResponseInstance(
bundlerConfig,

@@ -1043,20 +1102,14 @@ moduleLoading,

var chunks = new Map();
bundlerConfig = {
_bundlerConfig: bundlerConfig,
_moduleLoading: moduleLoading,
_callServer: void 0 !== callServer ? callServer : missingCall,
_encodeFormAction: encodeFormAction,
_nonce: nonce,
_chunks: chunks,
_stringDecoder: new util.TextDecoder(),
_fromJSON: null,
_rowState: 0,
_rowID: 0,
_rowTag: 0,
_rowLength: 0,
_buffer: [],
_tempRefs: temporaryReferences
};
bundlerConfig._fromJSON = createFromJSONCallback(bundlerConfig);
return bundlerConfig;
this._bundlerConfig = bundlerConfig;
this._moduleLoading = moduleLoading;
this._callServer = void 0 !== callServer ? callServer : missingCall;
this._encodeFormAction = encodeFormAction;
this._nonce = nonce;
this._chunks = chunks;
this._stringDecoder = new util.TextDecoder();
this._fromJSON = null;
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
this._buffer = [];
this._tempRefs = temporaryReferences;
this._fromJSON = createFromJSONCallback(this);
}

@@ -1068,3 +1121,3 @@ function resolveBuffer(response, id, buffer) {

? chunk.reason.enqueueValue(buffer)
: chunks.set(id, new Chunk("fulfilled", buffer, null, response));
: chunks.set(id, new ReactPromise("fulfilled", buffer, null, response));
}

@@ -1086,3 +1139,3 @@ function resolveModule(response, id, model) {

} else
(blockedChunk = new Chunk("blocked", null, null, response)),
(blockedChunk = new ReactPromise("blocked", null, null, response)),
chunks.set(id, blockedChunk);

@@ -1102,3 +1155,3 @@ model.then(

id,
new Chunk("resolved_module", clientReference, null, response)
new ReactPromise("resolved_module", clientReference, null, response)
);

@@ -1116,3 +1169,6 @@ }

null !== response && wakeChunk(response, chunk.value))
: chunks.set(id, new Chunk("fulfilled", stream, controller, response));
: chunks.set(
id,
new ReactPromise("fulfilled", stream, controller, response)
);
}

@@ -1138,3 +1194,3 @@ function startReadableStream(response, id, type) {

if (null === previousBlockedChunk) {
var chunk = new Chunk("resolved_model", json, null, response);
var chunk = new ReactPromise("resolved_model", json, null, response);
initializeModelChunk(chunk);

@@ -1154,4 +1210,4 @@ "fulfilled" === chunk.status

chunk = previousBlockedChunk;
var chunk$51 = createPendingChunk(response);
chunk$51.then(
var chunk$52 = createPendingChunk(response);
chunk$52.then(
function (v) {

@@ -1164,6 +1220,6 @@ return controller.enqueue(v);

);
previousBlockedChunk = chunk$51;
previousBlockedChunk = chunk$52;
chunk.then(function () {
previousBlockedChunk === chunk$51 && (previousBlockedChunk = null);
resolveModelChunk(chunk$51, json);
previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);
resolveModelChunk(chunk$52, json);
});

@@ -1217,3 +1273,3 @@ }

if (closed)
return new Chunk(
return new ReactPromise(
"fulfilled",

@@ -1237,3 +1293,3 @@ { done: !0, value: void 0 },

if (nextWriteIndex === buffer.length)
buffer[nextWriteIndex] = new Chunk(
buffer[nextWriteIndex] = new ReactPromise(
"fulfilled",

@@ -1298,4 +1354,4 @@ { done: !1, value: value },

byteLength = new Uint8Array(byteLength);
for (var i$52 = (i = 0); i$52 < l; i$52++) {
var chunk = buffer[i$52];
for (var i$53 = (i = 0); i$53 < l; i$53++) {
var chunk = buffer[i$53];
byteLength.set(chunk, i);

@@ -1326,3 +1382,3 @@ i += chunk.byteLength;

}
function processFullRow(response, id, tag, buffer, chunk) {
function processFullBinaryRow(response, id, tag, buffer, chunk) {
switch (tag) {

@@ -1380,2 +1436,5 @@ case 65:

row += stringDecoder.decode(chunk);
processFullStringRow(response, id, tag, row);
}
function processFullStringRow(response, id, tag, row) {
switch (tag) {

@@ -1437,11 +1496,12 @@ case 73:

tag = response._chunks;
(buffer = tag.get(id))
? triggerErrorOnChunk(buffer, row)
: tag.set(id, new Chunk("rejected", null, row, response));
var chunk = tag.get(id);
chunk
? triggerErrorOnChunk(chunk, row)
: tag.set(id, new ReactPromise("rejected", null, row, response));
break;
case 84:
tag = response._chunks;
(buffer = tag.get(id)) && "pending" !== buffer.status
? buffer.reason.enqueueValue(row)
: tag.set(id, new Chunk("fulfilled", row, null, response));
(chunk = tag.get(id)) && "pending" !== chunk.status
? chunk.reason.enqueueValue(row)
: tag.set(id, new ReactPromise("fulfilled", row, null, response));
break;

@@ -1472,5 +1532,8 @@ case 68:

(tag = response._chunks),
(buffer = tag.get(id))
? resolveModelChunk(buffer, row)
: tag.set(id, new Chunk("resolved_model", row, null, response));
(chunk = tag.get(id))
? resolveModelChunk(chunk, row)
: tag.set(
id,
new ReactPromise("resolved_model", row, null, response)
);
}

@@ -1480,17 +1543,38 @@ }

return function (key, value) {
return "string" === typeof value
? parseModelString(response, this, key, value)
: "object" === typeof value && null !== value
? ((key =
value[0] === REACT_ELEMENT_TYPE
? {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}
: value),
key)
: value;
if ("string" === typeof value)
return parseModelString(response, this, key, value);
if ("object" === typeof value && null !== value) {
if (value[0] === REACT_ELEMENT_TYPE) {
if (
((key = {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}),
null !== initializingHandler)
)
if (
((value = initializingHandler),
(initializingHandler = value.parent),
value.errored)
)
(key = new ReactPromise("rejected", null, value.value, response)),
(key = createLazyChunkWrapper(key));
else if (0 < value.deps) {
var blockedChunk = new ReactPromise(
"blocked",
null,
null,
response
);
value.value = key;
value.chunk = blockedChunk;
key = createLazyChunkWrapper(blockedChunk);
}
} else key = value;
return key;
}
return value;
};

@@ -1504,3 +1588,3 @@ }

exports.createFromNodeStream = function (stream, ssrManifest, options) {
var response = createResponse(
var response = new ResponseInstance(
ssrManifest.moduleMap,

@@ -1514,78 +1598,172 @@ ssrManifest.moduleLoading,

stream.on("data", function (chunk) {
for (
var i = 0,
rowState = response._rowState,
rowID = response._rowID,
rowTag = response._rowTag,
rowLength = response._rowLength,
buffer = response._buffer,
chunkLength = chunk.length;
i < chunkLength;
if ("string" === typeof chunk) {
for (
var i = 0,
rowState = response._rowState,
rowID = response._rowID,
rowTag = response._rowTag,
rowLength = response._rowLength,
buffer = response._buffer,
chunkLength = chunk.length;
i < chunkLength;
) {
var lastIdx = -1;
switch (rowState) {
case 0:
lastIdx = chunk[i++];
58 === lastIdx
? (rowState = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
rowState = chunk[i];
84 === rowState ||
65 === rowState ||
79 === rowState ||
111 === rowState ||
85 === rowState ||
83 === rowState ||
115 === rowState ||
76 === rowState ||
108 === rowState ||
71 === rowState ||
103 === rowState ||
77 === rowState ||
109 === rowState ||
86 === rowState
? ((rowTag = rowState), (rowState = 2), i++)
: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;
case 2:
lastIdx = chunk[i++];
44 === lastIdx
? (rowState = 4)
: (rowLength =
(rowLength << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf(10, i);
) {
var lastIdx = -1;
switch (rowState) {
case 0:
lastIdx = chunk.charCodeAt(i++);
58 === lastIdx
? (rowState = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
rowState = chunk.charCodeAt(i);
84 === rowState ||
65 === rowState ||
79 === rowState ||
111 === rowState ||
85 === rowState ||
83 === rowState ||
115 === rowState ||
76 === rowState ||
108 === rowState ||
71 === rowState ||
103 === rowState ||
77 === rowState ||
109 === rowState ||
86 === rowState
? ((rowTag = rowState), (rowState = 2), i++)
: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;
case 2:
lastIdx = chunk.charCodeAt(i++);
44 === lastIdx
? (rowState = 4)
: (rowLength =
(rowLength << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf("\n", i);
break;
case 4:
if (84 !== rowTag)
throw Error(
"Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams."
);
if (rowLength < chunk.length || chunk.length > 3 * rowLength)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
lastIdx = chunk.length;
}
if (-1 < lastIdx) {
if (0 < buffer.length)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
i = chunk.slice(i, lastIdx);
processFullStringRow(response, rowID, rowTag, i);
i = lastIdx;
3 === rowState && i++;
rowLength = rowID = rowTag = rowState = 0;
buffer.length = 0;
} else if (chunk.length !== i)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
}
response._rowState = rowState;
response._rowID = rowID;
response._rowTag = rowTag;
response._rowLength = rowLength;
} else {
rowLength = 0;
chunkLength = response._rowState;
rowID = response._rowID;
i = response._rowTag;
rowState = response._rowLength;
buffer = response._buffer;
for (rowTag = chunk.length; rowLength < rowTag; ) {
lastIdx = -1;
switch (chunkLength) {
case 0:
lastIdx = chunk[rowLength++];
58 === lastIdx
? (chunkLength = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
chunkLength = chunk[rowLength];
84 === chunkLength ||
65 === chunkLength ||
79 === chunkLength ||
111 === chunkLength ||
85 === chunkLength ||
83 === chunkLength ||
115 === chunkLength ||
76 === chunkLength ||
108 === chunkLength ||
71 === chunkLength ||
103 === chunkLength ||
77 === chunkLength ||
109 === chunkLength ||
86 === chunkLength
? ((i = chunkLength), (chunkLength = 2), rowLength++)
: (64 < chunkLength && 91 > chunkLength) ||
35 === chunkLength ||
114 === chunkLength ||
120 === chunkLength
? ((i = chunkLength), (chunkLength = 3), rowLength++)
: ((i = 0), (chunkLength = 3));
continue;
case 2:
lastIdx = chunk[rowLength++];
44 === lastIdx
? (chunkLength = 4)
: (rowState =
(rowState << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf(10, rowLength);
break;
case 4:
(lastIdx = rowLength + rowState),
lastIdx > chunk.length && (lastIdx = -1);
}
var offset = chunk.byteOffset + rowLength;
if (-1 < lastIdx)
(rowState = new Uint8Array(
chunk.buffer,
offset,
lastIdx - rowLength
)),
processFullBinaryRow(response, rowID, i, buffer, rowState),
(rowLength = lastIdx),
3 === chunkLength && rowLength++,
(rowState = rowID = i = chunkLength = 0),
(buffer.length = 0);
else {
chunk = new Uint8Array(
chunk.buffer,
offset,
chunk.byteLength - rowLength
);
buffer.push(chunk);
rowState -= chunk.byteLength;
break;
case 4:
(lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
}
}
var offset = chunk.byteOffset + i;
if (-1 < lastIdx)
(rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
processFullRow(response, rowID, rowTag, buffer, rowLength),
(i = lastIdx),
3 === rowState && i++,
(rowLength = rowID = rowTag = rowState = 0),
(buffer.length = 0);
else {
chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
buffer.push(chunk);
rowLength -= chunk.byteLength;
break;
}
response._rowState = chunkLength;
response._rowID = rowID;
response._rowTag = i;
response._rowLength = rowState;
}
response._rowState = rowState;
response._rowID = rowID;
response._rowTag = rowTag;
response._rowLength = rowLength;
});

@@ -1592,0 +1770,0 @@ stream.on("error", function (error) {

@@ -104,6 +104,6 @@ /**

: Infinity === number
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
? "$Infinity"
: -Infinity === number
? "$-Infinity"
: "$NaN";
}

@@ -601,11 +601,27 @@ function processReply(

}
function createBoundServerReference(metaData, callServer, encodeFormAction) {
function action() {
var args = Array.prototype.slice.call(arguments);
return bound
? "fulfilled" === bound.status
? callServer(id, bound.value.concat(args))
: Promise.resolve(bound).then(function (boundArgs) {
return callServer(id, boundArgs.concat(args));
})
: callServer(id, args);
}
var id = metaData.id,
bound = metaData.bound;
registerServerReference(action, { id: id, bound: bound }, encodeFormAction);
return action;
}
function createServerReference$1(id, callServer, encodeFormAction) {
function proxy() {
function action() {
var args = Array.prototype.slice.call(arguments);
return callServer(id, args);
}
registerServerReference(proxy, { id: id, bound: null }, encodeFormAction);
return proxy;
registerServerReference(action, { id: id, bound: null }, encodeFormAction);
return action;
}
function Chunk(status, value, reason, response) {
function ReactPromise(status, value, reason, response) {
this.status = status;

@@ -616,4 +632,4 @@ this.value = value;

}
Chunk.prototype = Object.create(Promise.prototype);
Chunk.prototype.then = function (resolve, reject) {
ReactPromise.prototype = Object.create(Promise.prototype);
ReactPromise.prototype.then = function (resolve, reject) {
switch (this.status) {

@@ -632,3 +648,2 @@ case "resolved_model":

case "blocked":
case "cyclic":
resolve &&

@@ -656,3 +671,2 @@ (null === this.value && (this.value = []), this.value.push(resolve));

case "blocked":
case "cyclic":
throw chunk;

@@ -664,3 +678,3 @@ default:

function createPendingChunk(response) {
return new Chunk("pending", null, null, response);
return new ReactPromise("pending", null, null, response);
}

@@ -677,3 +691,2 @@ function wakeChunk(listeners, value) {

case "blocked":
case "cyclic":
if (chunk.value)

@@ -708,3 +721,3 @@ for (var i = 0; i < resolveListeners.length; i++)

function createResolvedIteratorResultChunk(response, value, done) {
return new Chunk(
return new ReactPromise(
"resolved_model",

@@ -745,31 +758,31 @@ (done ? '{"done":true,"value":' : '{"done":false,"value":') + value + "}",

}
var initializingChunk = null,
initializingChunkBlockedModel = null;
var initializingHandler = null;
function initializeModelChunk(chunk) {
var prevChunk = initializingChunk,
prevBlocked = initializingChunkBlockedModel;
initializingChunk = chunk;
initializingChunkBlockedModel = null;
var prevHandler = initializingHandler;
initializingHandler = null;
var resolvedModel = chunk.value;
chunk.status = "cyclic";
chunk.status = "blocked";
chunk.value = null;
chunk.reason = null;
try {
var value = JSON.parse(resolvedModel, chunk._response._fromJSON);
if (
null !== initializingChunkBlockedModel &&
0 < initializingChunkBlockedModel.deps
)
(initializingChunkBlockedModel.value = value), (chunk.status = "blocked");
else {
var resolveListeners = chunk.value;
chunk.status = "fulfilled";
chunk.value = value;
null !== resolveListeners && wakeChunk(resolveListeners, value);
var value = JSON.parse(resolvedModel, chunk._response._fromJSON),
resolveListeners = chunk.value;
null !== resolveListeners &&
((chunk.value = null),
(chunk.reason = null),
wakeChunk(resolveListeners, value));
if (null !== initializingHandler) {
if (initializingHandler.errored) throw initializingHandler.value;
if (0 < initializingHandler.deps) {
initializingHandler.value = value;
initializingHandler.chunk = chunk;
return;
}
}
chunk.status = "fulfilled";
chunk.value = value;
} catch (error) {
(chunk.status = "rejected"), (chunk.reason = error);
} finally {
(initializingChunk = prevChunk),
(initializingChunkBlockedModel = prevBlocked);
initializingHandler = prevHandler;
}

@@ -787,4 +800,4 @@ }

: "" === metadata.name
? moduleExports.default
: moduleExports[metadata.name];
? moduleExports.default
: moduleExports[metadata.name];
chunk.status = "fulfilled";

@@ -801,2 +814,5 @@ chunk.value = JSCompiler_inline_result;

}
function createLazyChunkWrapper(chunk) {
return { $$typeof: REACT_LAZY_TYPE, _payload: chunk, _init: readChunk };
}
function getChunk(response, id) {

@@ -808,7 +824,6 @@ var chunks = response._chunks,

}
function createModelResolver(
chunk,
function waitForReference(
referencedChunk,
parentObject,
key,
cyclic,
response,

@@ -818,43 +833,64 @@ map,

) {
if (initializingChunkBlockedModel) {
var blocked = initializingChunkBlockedModel;
cyclic || blocked.deps++;
function fulfill(value) {
for (var i = 1; i < path.length; i++) {
for (; value.$$typeof === REACT_LAZY_TYPE; )
if (((value = value._payload), value === handler.chunk))
value = handler.value;
else if ("fulfilled" === value.status) value = value.value;
else {
path.splice(0, i - 1);
value.then(fulfill, reject);
return;
}
value = value[path[i]];
}
parentObject[key] = map(response, value);
"" === key && null === handler.value && (handler.value = parentObject[key]);
parentObject[0] === REACT_ELEMENT_TYPE &&
"3" === key &&
"object" === typeof handler.value &&
null !== handler.value &&
handler.value.$$typeof === REACT_ELEMENT_TYPE &&
null === handler.value.props &&
(handler.value.props = parentObject[key]);
handler.deps--;
0 === handler.deps &&
((i = handler.chunk),
null !== i &&
"blocked" === i.status &&
((value = i.value),
(i.status = "fulfilled"),
(i.value = handler.value),
null !== value && wakeChunk(value, handler.value)));
}
function reject(error) {
if (!handler.errored) {
handler.errored = !0;
handler.value = error;
var chunk = handler.chunk;
null !== chunk &&
"blocked" === chunk.status &&
triggerErrorOnChunk(chunk, error);
}
}
if (initializingHandler) {
var handler = initializingHandler;
handler.deps++;
} else
blocked = initializingChunkBlockedModel = {
deps: cyclic ? 0 : 1,
value: null
handler = initializingHandler = {
parent: null,
chunk: null,
value: null,
deps: 1,
errored: !1
};
return function (value) {
for (var i = 1; i < path.length; i++) value = value[path[i]];
parentObject[key] = map(response, value);
"" === key && null === blocked.value && (blocked.value = parentObject[key]);
blocked.deps--;
0 === blocked.deps &&
"blocked" === chunk.status &&
((value = chunk.value),
(chunk.status = "fulfilled"),
(chunk.value = blocked.value),
null !== value && wakeChunk(value, blocked.value));
};
referencedChunk.then(fulfill, reject);
return null;
}
function createModelReject(chunk) {
return function (error) {
return triggerErrorOnChunk(chunk, error);
};
}
function createServerReferenceProxy(response, metaData) {
function proxy() {
var args = Array.prototype.slice.call(arguments),
p = metaData.bound;
return p
? "fulfilled" === p.status
? callServer(metaData.id, p.value.concat(args))
: Promise.resolve(p).then(function (bound) {
return callServer(metaData.id, bound.concat(args));
})
: callServer(metaData.id, args);
}
var callServer = response._callServer;
registerServerReference(proxy, metaData, response._encodeFormAction);
return proxy;
return createBoundServerReference(
metaData,
response._callServer,
response._encodeFormAction
);
}

@@ -874,25 +910,36 @@ function getOutlinedModel(response, reference, parentObject, key, map) {

case "fulfilled":
parentObject = id.value;
for (key = 1; key < reference.length; key++)
parentObject = parentObject[reference[key]];
return map(response, parentObject);
var value = id.value;
for (id = 1; id < reference.length; id++)
if (
((value = value[reference[id]]), value.$$typeof === REACT_LAZY_TYPE)
)
if (((value = value._payload), "fulfilled" === value.status))
value = value.value;
else
return waitForReference(
value,
parentObject,
key,
response,
map,
reference.slice(id)
);
return map(response, value);
case "pending":
case "blocked":
case "cyclic":
var parentChunk = initializingChunk;
id.then(
createModelResolver(
parentChunk,
parentObject,
key,
"cyclic" === id.status,
response,
map,
reference
),
createModelReject(parentChunk)
return waitForReference(id, parentObject, key, response, map, reference);
default:
return (
initializingHandler
? ((initializingHandler.errored = !0),
(initializingHandler.value = id.reason))
: (initializingHandler = {
parent: null,
chunk: null,
value: id.reason,
deps: 0,
errored: !0
}),
null
);
return null;
default:
throw id.reason;
}

@@ -923,3 +970,15 @@ }

if ("$" === value[0]) {
if ("$" === value) return REACT_ELEMENT_TYPE;
if ("$" === value)
return (
null !== initializingHandler &&
"0" === key &&
(initializingHandler = {
parent: initializingHandler,
chunk: null,
value: null,
deps: 0,
errored: !1
}),
REACT_ELEMENT_TYPE
);
switch (value[1]) {

@@ -932,3 +991,3 @@ case "$":

(response = getChunk(response, parentObject)),
{ $$typeof: REACT_LAZY_TYPE, _payload: response, _init: readChunk }
createLazyChunkWrapper(response)
);

@@ -1011,3 +1070,3 @@ case "@":

}
function createResponse(
function ResponseInstance(
bundlerConfig,

@@ -1021,20 +1080,14 @@ moduleLoading,

var chunks = new Map();
bundlerConfig = {
_bundlerConfig: bundlerConfig,
_moduleLoading: moduleLoading,
_callServer: void 0 !== callServer ? callServer : missingCall,
_encodeFormAction: encodeFormAction,
_nonce: nonce,
_chunks: chunks,
_stringDecoder: new util.TextDecoder(),
_fromJSON: null,
_rowState: 0,
_rowID: 0,
_rowTag: 0,
_rowLength: 0,
_buffer: [],
_tempRefs: temporaryReferences
};
bundlerConfig._fromJSON = createFromJSONCallback(bundlerConfig);
return bundlerConfig;
this._bundlerConfig = bundlerConfig;
this._moduleLoading = moduleLoading;
this._callServer = void 0 !== callServer ? callServer : missingCall;
this._encodeFormAction = encodeFormAction;
this._nonce = nonce;
this._chunks = chunks;
this._stringDecoder = new util.TextDecoder();
this._fromJSON = null;
this._rowLength = this._rowTag = this._rowID = this._rowState = 0;
this._buffer = [];
this._tempRefs = temporaryReferences;
this._fromJSON = createFromJSONCallback(this);
}

@@ -1046,3 +1099,3 @@ function resolveBuffer(response, id, buffer) {

? chunk.reason.enqueueValue(buffer)
: chunks.set(id, new Chunk("fulfilled", buffer, null, response));
: chunks.set(id, new ReactPromise("fulfilled", buffer, null, response));
}

@@ -1064,3 +1117,3 @@ function resolveModule(response, id, model) {

} else
(blockedChunk = new Chunk("blocked", null, null, response)),
(blockedChunk = new ReactPromise("blocked", null, null, response)),
chunks.set(id, blockedChunk);

@@ -1080,3 +1133,3 @@ model.then(

id,
new Chunk("resolved_module", clientReference, null, response)
new ReactPromise("resolved_module", clientReference, null, response)
);

@@ -1094,3 +1147,6 @@ }

null !== response && wakeChunk(response, chunk.value))
: chunks.set(id, new Chunk("fulfilled", stream, controller, response));
: chunks.set(
id,
new ReactPromise("fulfilled", stream, controller, response)
);
}

@@ -1116,3 +1172,3 @@ function startReadableStream(response, id, type) {

if (null === previousBlockedChunk) {
var chunk = new Chunk("resolved_model", json, null, response);
var chunk = new ReactPromise("resolved_model", json, null, response);
initializeModelChunk(chunk);

@@ -1132,4 +1188,4 @@ "fulfilled" === chunk.status

chunk = previousBlockedChunk;
var chunk$51 = createPendingChunk(response);
chunk$51.then(
var chunk$52 = createPendingChunk(response);
chunk$52.then(
function (v) {

@@ -1142,6 +1198,6 @@ return controller.enqueue(v);

);
previousBlockedChunk = chunk$51;
previousBlockedChunk = chunk$52;
chunk.then(function () {
previousBlockedChunk === chunk$51 && (previousBlockedChunk = null);
resolveModelChunk(chunk$51, json);
previousBlockedChunk === chunk$52 && (previousBlockedChunk = null);
resolveModelChunk(chunk$52, json);
});

@@ -1195,3 +1251,3 @@ }

if (closed)
return new Chunk(
return new ReactPromise(
"fulfilled",

@@ -1215,3 +1271,3 @@ { done: !0, value: void 0 },

if (nextWriteIndex === buffer.length)
buffer[nextWriteIndex] = new Chunk(
buffer[nextWriteIndex] = new ReactPromise(
"fulfilled",

@@ -1276,4 +1332,4 @@ { done: !1, value: value },

byteLength = new Uint8Array(byteLength);
for (var i$52 = (i = 0); i$52 < l; i$52++) {
var chunk = buffer[i$52];
for (var i$53 = (i = 0); i$53 < l; i$53++) {
var chunk = buffer[i$53];
byteLength.set(chunk, i);

@@ -1304,3 +1360,3 @@ i += chunk.byteLength;

}
function processFullRow(response, id, tag, buffer, chunk) {
function processFullBinaryRow(response, id, tag, buffer, chunk) {
switch (tag) {

@@ -1358,2 +1414,5 @@ case 65:

row += stringDecoder.decode(chunk);
processFullStringRow(response, id, tag, row);
}
function processFullStringRow(response, id, tag, row) {
switch (tag) {

@@ -1415,11 +1474,12 @@ case 73:

tag = response._chunks;
(buffer = tag.get(id))
? triggerErrorOnChunk(buffer, row)
: tag.set(id, new Chunk("rejected", null, row, response));
var chunk = tag.get(id);
chunk
? triggerErrorOnChunk(chunk, row)
: tag.set(id, new ReactPromise("rejected", null, row, response));
break;
case 84:
tag = response._chunks;
(buffer = tag.get(id)) && "pending" !== buffer.status
? buffer.reason.enqueueValue(row)
: tag.set(id, new Chunk("fulfilled", row, null, response));
(chunk = tag.get(id)) && "pending" !== chunk.status
? chunk.reason.enqueueValue(row)
: tag.set(id, new ReactPromise("fulfilled", row, null, response));
break;

@@ -1450,5 +1510,8 @@ case 68:

(tag = response._chunks),
(buffer = tag.get(id))
? resolveModelChunk(buffer, row)
: tag.set(id, new Chunk("resolved_model", row, null, response));
(chunk = tag.get(id))
? resolveModelChunk(chunk, row)
: tag.set(
id,
new ReactPromise("resolved_model", row, null, response)
);
}

@@ -1458,17 +1521,38 @@ }

return function (key, value) {
return "string" === typeof value
? parseModelString(response, this, key, value)
: "object" === typeof value && null !== value
? ((key =
value[0] === REACT_ELEMENT_TYPE
? {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}
: value),
key)
: value;
if ("string" === typeof value)
return parseModelString(response, this, key, value);
if ("object" === typeof value && null !== value) {
if (value[0] === REACT_ELEMENT_TYPE) {
if (
((key = {
$$typeof: REACT_ELEMENT_TYPE,
type: value[1],
key: value[2],
ref: null,
props: value[3]
}),
null !== initializingHandler)
)
if (
((value = initializingHandler),
(initializingHandler = value.parent),
value.errored)
)
(key = new ReactPromise("rejected", null, value.value, response)),
(key = createLazyChunkWrapper(key));
else if (0 < value.deps) {
var blockedChunk = new ReactPromise(
"blocked",
null,
null,
response
);
value.value = key;
value.chunk = blockedChunk;
key = createLazyChunkWrapper(blockedChunk);
}
} else key = value;
return key;
}
return value;
};

@@ -1482,3 +1566,3 @@ }

exports.createFromNodeStream = function (stream, ssrManifest, options) {
var response = createResponse(
var response = new ResponseInstance(
ssrManifest.moduleMap,

@@ -1492,78 +1576,172 @@ ssrManifest.moduleLoading,

stream.on("data", function (chunk) {
for (
var i = 0,
rowState = response._rowState,
rowID = response._rowID,
rowTag = response._rowTag,
rowLength = response._rowLength,
buffer = response._buffer,
chunkLength = chunk.length;
i < chunkLength;
if ("string" === typeof chunk) {
for (
var i = 0,
rowState = response._rowState,
rowID = response._rowID,
rowTag = response._rowTag,
rowLength = response._rowLength,
buffer = response._buffer,
chunkLength = chunk.length;
i < chunkLength;
) {
var lastIdx = -1;
switch (rowState) {
case 0:
lastIdx = chunk[i++];
58 === lastIdx
? (rowState = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
rowState = chunk[i];
84 === rowState ||
65 === rowState ||
79 === rowState ||
111 === rowState ||
85 === rowState ||
83 === rowState ||
115 === rowState ||
76 === rowState ||
108 === rowState ||
71 === rowState ||
103 === rowState ||
77 === rowState ||
109 === rowState ||
86 === rowState
? ((rowTag = rowState), (rowState = 2), i++)
: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;
case 2:
lastIdx = chunk[i++];
44 === lastIdx
? (rowState = 4)
: (rowLength =
(rowLength << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf(10, i);
) {
var lastIdx = -1;
switch (rowState) {
case 0:
lastIdx = chunk.charCodeAt(i++);
58 === lastIdx
? (rowState = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
rowState = chunk.charCodeAt(i);
84 === rowState ||
65 === rowState ||
79 === rowState ||
111 === rowState ||
85 === rowState ||
83 === rowState ||
115 === rowState ||
76 === rowState ||
108 === rowState ||
71 === rowState ||
103 === rowState ||
77 === rowState ||
109 === rowState ||
86 === rowState
? ((rowTag = rowState), (rowState = 2), i++)
: (64 < rowState && 91 > rowState) ||
114 === rowState ||
120 === rowState
? ((rowTag = rowState), (rowState = 3), i++)
: ((rowTag = 0), (rowState = 3));
continue;
case 2:
lastIdx = chunk.charCodeAt(i++);
44 === lastIdx
? (rowState = 4)
: (rowLength =
(rowLength << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf("\n", i);
break;
case 4:
if (84 !== rowTag)
throw Error(
"Binary RSC chunks cannot be encoded as strings. This is a bug in the wiring of the React streams."
);
if (rowLength < chunk.length || chunk.length > 3 * rowLength)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
lastIdx = chunk.length;
}
if (-1 < lastIdx) {
if (0 < buffer.length)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
i = chunk.slice(i, lastIdx);
processFullStringRow(response, rowID, rowTag, i);
i = lastIdx;
3 === rowState && i++;
rowLength = rowID = rowTag = rowState = 0;
buffer.length = 0;
} else if (chunk.length !== i)
throw Error(
"String chunks need to be passed in their original shape. Not split into smaller string chunks. This is a bug in the wiring of the React streams."
);
}
response._rowState = rowState;
response._rowID = rowID;
response._rowTag = rowTag;
response._rowLength = rowLength;
} else {
rowLength = 0;
chunkLength = response._rowState;
rowID = response._rowID;
i = response._rowTag;
rowState = response._rowLength;
buffer = response._buffer;
for (rowTag = chunk.length; rowLength < rowTag; ) {
lastIdx = -1;
switch (chunkLength) {
case 0:
lastIdx = chunk[rowLength++];
58 === lastIdx
? (chunkLength = 1)
: (rowID =
(rowID << 4) | (96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 1:
chunkLength = chunk[rowLength];
84 === chunkLength ||
65 === chunkLength ||
79 === chunkLength ||
111 === chunkLength ||
85 === chunkLength ||
83 === chunkLength ||
115 === chunkLength ||
76 === chunkLength ||
108 === chunkLength ||
71 === chunkLength ||
103 === chunkLength ||
77 === chunkLength ||
109 === chunkLength ||
86 === chunkLength
? ((i = chunkLength), (chunkLength = 2), rowLength++)
: (64 < chunkLength && 91 > chunkLength) ||
35 === chunkLength ||
114 === chunkLength ||
120 === chunkLength
? ((i = chunkLength), (chunkLength = 3), rowLength++)
: ((i = 0), (chunkLength = 3));
continue;
case 2:
lastIdx = chunk[rowLength++];
44 === lastIdx
? (chunkLength = 4)
: (rowState =
(rowState << 4) |
(96 < lastIdx ? lastIdx - 87 : lastIdx - 48));
continue;
case 3:
lastIdx = chunk.indexOf(10, rowLength);
break;
case 4:
(lastIdx = rowLength + rowState),
lastIdx > chunk.length && (lastIdx = -1);
}
var offset = chunk.byteOffset + rowLength;
if (-1 < lastIdx)
(rowState = new Uint8Array(
chunk.buffer,
offset,
lastIdx - rowLength
)),
processFullBinaryRow(response, rowID, i, buffer, rowState),
(rowLength = lastIdx),
3 === chunkLength && rowLength++,
(rowState = rowID = i = chunkLength = 0),
(buffer.length = 0);
else {
chunk = new Uint8Array(
chunk.buffer,
offset,
chunk.byteLength - rowLength
);
buffer.push(chunk);
rowState -= chunk.byteLength;
break;
case 4:
(lastIdx = i + rowLength), lastIdx > chunk.length && (lastIdx = -1);
}
}
var offset = chunk.byteOffset + i;
if (-1 < lastIdx)
(rowLength = new Uint8Array(chunk.buffer, offset, lastIdx - i)),
processFullRow(response, rowID, rowTag, buffer, rowLength),
(i = lastIdx),
3 === rowState && i++,
(rowLength = rowID = rowTag = rowState = 0),
(buffer.length = 0);
else {
chunk = new Uint8Array(chunk.buffer, offset, chunk.byteLength - i);
buffer.push(chunk);
rowLength -= chunk.byteLength;
break;
}
response._rowState = chunkLength;
response._rowID = rowID;
response._rowTag = i;
response._rowLength = rowState;
}
response._rowState = rowState;
response._rowID = rowID;
response._rowTag = rowTag;
response._rowLength = rowLength;
});

@@ -1570,0 +1748,0 @@ stream.on("error", function (error) {

@@ -159,3 +159,3 @@ /**

);
compilation = parser => {
compilation = (parser) => {
parser.hooks.program.tap("React Server Plugin", () => {

@@ -193,3 +193,3 @@ const module = parser.state.module;

);
compiler.hooks.make.tap("React Server Plugin", compilation => {
compiler.hooks.make.tap("React Server Plugin", (compilation) => {
compilation.hooks.processAssets.tap(

@@ -219,3 +219,3 @@ {

var resolvedClientFiles = new Set(
(resolvedClientReferences || []).map(ref => ref.request)
(resolvedClientReferences || []).map((ref) => ref.request)
),

@@ -232,5 +232,5 @@ clientManifest = {},

var runtimeChunkFiles = new Set();
compilation.entrypoints.forEach(entrypoint => {
compilation.entrypoints.forEach((entrypoint) => {
(entrypoint = entrypoint.getRuntimeChunk()) &&
entrypoint.files.forEach(runtimeFile => {
entrypoint.files.forEach((runtimeFile) => {
runtimeChunkFiles.add(runtimeFile);

@@ -276,3 +276,3 @@ });

module.modules &&
module.modules.forEach(concatenatedMod => {
module.modules.forEach((concatenatedMod) => {
recordModule(moduleId, concatenatedMod);

@@ -355,3 +355,3 @@ });

if (err2) return cb(err2);
err2 = deps.map(dep => {
err2 = deps.map((dep) => {
var request = path.join(

@@ -358,0 +358,0 @@ resolvedDirectory,

@@ -12,2 +12,4 @@ /**

import * as acorn from 'acorn-loose';
import readMappings from 'webpack-sources/lib/helpers/readMappings.js';
import createMappingsSerializer from 'webpack-sources/lib/helpers/createMappingsSerializer.js';

@@ -43,10 +45,28 @@ const assign = Object.assign;

function addLocalExportedNames(names, node) {
function addExportedEntry(exportedEntries, localNames, localName, exportedName, type, loc) {
if (localNames.has(localName)) {
// If the same local name is exported more than once, we only need one of the names.
return;
}
exportedEntries.push({
localName,
exportedName,
type,
loc,
originalLine: -1,
originalColumn: -1,
originalSource: -1,
nameIndex: -1
});
}
function addLocalExportedNames(exportedEntries, localNames, node) {
switch (node.type) {
case 'Identifier':
names.set(node.name, node.name);
addExportedEntry(exportedEntries, localNames, node.name, node.name, null, node.loc);
return;
case 'ObjectPattern':
for (let i = 0; i < node.properties.length; i++) addLocalExportedNames(names, node.properties[i]);
for (let i = 0; i < node.properties.length; i++) addLocalExportedNames(exportedEntries, localNames, node.properties[i]);

@@ -58,3 +78,3 @@ return;

const element = node.elements[i];
if (element) addLocalExportedNames(names, element);
if (element) addLocalExportedNames(exportedEntries, localNames, element);
}

@@ -65,15 +85,15 @@

case 'Property':
addLocalExportedNames(names, node.value);
addLocalExportedNames(exportedEntries, localNames, node.value);
return;
case 'AssignmentPattern':
addLocalExportedNames(names, node.left);
addLocalExportedNames(exportedEntries, localNames, node.left);
return;
case 'RestElement':
addLocalExportedNames(names, node.argument);
addLocalExportedNames(exportedEntries, localNames, node.argument);
return;
case 'ParenthesizedExpression':
addLocalExportedNames(names, node.expression);
addLocalExportedNames(exportedEntries, localNames, node.expression);
return;

@@ -83,7 +103,9 @@ }

function transformServerModule(source, body, url, loader) {
// If the same local name is exported more than once, we only need one of the names.
const localNames = new Map();
const localTypes = new Map();
function transformServerModule(source, program, url, sourceMap, loader) {
const body = program.body; // This entry list needs to be in source location order.
const exportedEntries = []; // Dedupe set.
const localNames = new Set();
for (let i = 0; i < body.length; i++) {

@@ -99,7 +121,6 @@ const node = body[i];

if (node.declaration.type === 'Identifier') {
localNames.set(node.declaration.name, 'default');
addExportedEntry(exportedEntries, localNames, node.declaration.name, 'default', null, node.declaration.loc);
} else if (node.declaration.type === 'FunctionDeclaration') {
if (node.declaration.id) {
localNames.set(node.declaration.id.name, 'default');
localTypes.set(node.declaration.id.name, 'function');
addExportedEntry(exportedEntries, localNames, node.declaration.id.name, 'default', 'function', node.declaration.id.loc);
}

@@ -116,11 +137,7 @@ }

for (let j = 0; j < declarations.length; j++) {
addLocalExportedNames(localNames, declarations[j].id);
addLocalExportedNames(exportedEntries, localNames, declarations[j].id);
}
} else {
const name = node.declaration.id.name;
localNames.set(name, name);
if (node.declaration.type === 'FunctionDeclaration') {
localTypes.set(name, 'function');
}
addExportedEntry(exportedEntries, localNames, name, name, node.declaration.type === 'FunctionDeclaration' ? 'function' : null, node.declaration.id.loc);
}

@@ -134,3 +151,3 @@ }

const specifier = specifiers[j];
localNames.set(specifier.local.name, specifier.exported.name);
addExportedEntry(exportedEntries, localNames, specifier.local.name, specifier.exported.name, null, specifier.local.loc);
}

@@ -143,18 +160,155 @@ }

if (localNames.size === 0) {
return source;
}
let mappings = sourceMap && typeof sourceMap.mappings === 'string' ? sourceMap.mappings : '';
let newSrc = source;
let newSrc = source + '\n\n;';
newSrc += 'import {registerServerReference} from "react-server-dom-webpack/server";\n';
localNames.forEach(function (exported, local) {
if (localTypes.get(local) !== 'function') {
// We first check if the export is a function and if so annotate it.
newSrc += 'if (typeof ' + local + ' === "function") ';
if (exportedEntries.length > 0) {
let lastSourceIndex = 0;
let lastOriginalLine = 0;
let lastOriginalColumn = 0;
let lastNameIndex = 0;
let sourceLineCount = 0;
let lastMappedLine = 0;
if (sourceMap) {
// We iterate source mapping entries and our matched exports in parallel to source map
// them to their original location.
let nextEntryIdx = 0;
let nextEntryLine = exportedEntries[nextEntryIdx].loc.start.line;
let nextEntryColumn = exportedEntries[nextEntryIdx].loc.start.column;
readMappings(mappings, (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
if (generatedLine > nextEntryLine || generatedLine === nextEntryLine && generatedColumn > nextEntryColumn) {
// We're past the entry which means that the best match we have is the previous entry.
if (lastMappedLine === nextEntryLine) {
// Match
exportedEntries[nextEntryIdx].originalLine = lastOriginalLine;
exportedEntries[nextEntryIdx].originalColumn = lastOriginalColumn;
exportedEntries[nextEntryIdx].originalSource = lastSourceIndex;
exportedEntries[nextEntryIdx].nameIndex = lastNameIndex;
}
nextEntryIdx++;
if (nextEntryIdx < exportedEntries.length) {
nextEntryLine = exportedEntries[nextEntryIdx].loc.start.line;
nextEntryColumn = exportedEntries[nextEntryIdx].loc.start.column;
} else {
nextEntryLine = -1;
nextEntryColumn = -1;
}
}
lastMappedLine = generatedLine;
if (sourceIndex > -1) {
lastSourceIndex = sourceIndex;
}
if (originalLine > -1) {
lastOriginalLine = originalLine;
}
if (originalColumn > -1) {
lastOriginalColumn = originalColumn;
}
if (nameIndex > -1) {
lastNameIndex = nameIndex;
}
});
if (nextEntryIdx < exportedEntries.length) {
if (lastMappedLine === nextEntryLine) {
// Match
exportedEntries[nextEntryIdx].originalLine = lastOriginalLine;
exportedEntries[nextEntryIdx].originalColumn = lastOriginalColumn;
exportedEntries[nextEntryIdx].originalSource = lastSourceIndex;
exportedEntries[nextEntryIdx].nameIndex = lastNameIndex;
}
}
for (let lastIdx = mappings.length - 1; lastIdx >= 0 && mappings[lastIdx] === ';'; lastIdx--) {
// If the last mapped lines don't contain any segments, we don't get a callback from readMappings
// so we need to pad the number of mapped lines, with one for each empty line.
lastMappedLine++;
}
sourceLineCount = program.loc.end.line;
if (sourceLineCount < lastMappedLine) {
throw new Error('The source map has more mappings than there are lines.');
} // If the original source string had more lines than there are mappings in the source map.
// Add some extra padding of unmapped lines so that any lines that we add line up.
for (let extraLines = sourceLineCount - lastMappedLine; extraLines > 0; extraLines--) {
mappings += ';';
}
} else {
// If a file doesn't have a source map then we generate a blank source map that just
// contains the original content and segments pointing to the original lines.
sourceLineCount = 1;
let idx = -1;
while ((idx = source.indexOf('\n', idx + 1)) !== -1) {
sourceLineCount++;
}
mappings = 'AAAA' + ';AACA'.repeat(sourceLineCount - 1);
sourceMap = {
version: 3,
sources: [url],
sourcesContent: [source],
mappings: mappings,
sourceRoot: ''
};
lastSourceIndex = 0;
lastOriginalLine = sourceLineCount;
lastOriginalColumn = 0;
lastNameIndex = -1;
lastMappedLine = sourceLineCount;
for (let i = 0; i < exportedEntries.length; i++) {
// Point each entry to original location.
const entry = exportedEntries[i];
entry.originalSource = 0;
entry.originalLine = entry.loc.start.line; // We use column zero since we do the short-hand line-only source maps above.
entry.originalColumn = 0; // entry.loc.start.column;
}
}
newSrc += 'registerServerReference(' + local + ',';
newSrc += JSON.stringify(url) + ',';
newSrc += JSON.stringify(exported) + ');\n';
});
newSrc += '\n\n;';
newSrc += 'import {registerServerReference} from "react-server-dom-webpack/server";\n';
if (mappings) {
mappings += ';;';
}
const createMapping = createMappingsSerializer(); // Create an empty mapping pointing to where we last left off to reset the counters.
let generatedLine = 1;
createMapping(generatedLine, 0, lastSourceIndex, lastOriginalLine, lastOriginalColumn, lastNameIndex);
for (let i = 0; i < exportedEntries.length; i++) {
const entry = exportedEntries[i];
generatedLine++;
if (entry.type !== 'function') {
// We first check if the export is a function and if so annotate it.
newSrc += 'if (typeof ' + entry.localName + ' === "function") ';
}
newSrc += 'registerServerReference(' + entry.localName + ',';
newSrc += JSON.stringify(url) + ',';
newSrc += JSON.stringify(entry.exportedName) + ');\n';
mappings += createMapping(generatedLine, 0, entry.originalSource, entry.originalLine, entry.originalColumn, entry.nameIndex);
}
}
if (sourceMap) {
// Override with an new mappings and serialize an inline source map.
sourceMap.mappings = mappings;
newSrc += '//# sourceMappingURL=data:application/json;charset=utf-8;base64,' + Buffer.from(JSON.stringify(sourceMap)).toString('base64');
}
return newSrc;

@@ -289,3 +443,4 @@ }

async function transformClientModule(body, url, loader) {
async function transformClientModule(program, url, sourceMap, loader) {
const body = program.body;
const names = [];

@@ -306,3 +461,3 @@ await parseExportNamesInto(body, names, url, loader);

newSrc += 'registerClientReference(function() {';
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + url + " 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.") + ');';
newSrc += 'throw new Error(' + JSON.stringify("Attempted to call the default export of " + url + " 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.") + ');';
} else {

@@ -317,4 +472,6 @@ newSrc += 'export const ' + name + ' = ';

newSrc += JSON.stringify(name) + ');\n';
}
} // TODO: Generate source maps for Client Reference functions so they can point to their
// original locations.
return newSrc;

@@ -351,9 +508,24 @@ }

let body;
let sourceMappingURL = null;
let sourceMappingStart = 0;
let sourceMappingEnd = 0;
let sourceMappingLines = 0;
let program;
try {
body = acorn.parse(source, {
program = acorn.parse(source, {
ecmaVersion: '2024',
sourceType: 'module'
}).body;
sourceType: 'module',
locations: true,
onComment(block, text, start, end, startLoc, endLoc) {
if (text.startsWith('# sourceMappingURL=') || text.startsWith('@ sourceMappingURL=')) {
sourceMappingURL = text.slice(19);
sourceMappingStart = start;
sourceMappingEnd = end;
sourceMappingLines = endLoc.line - startLoc.line;
}
}
});
} catch (x) {

@@ -367,2 +539,3 @@ // eslint-disable-next-line react-internal/no-production-logging

let useServer = false;
const body = program.body;

@@ -393,7 +566,28 @@ for (let i = 0; i < body.length; i++) {

let sourceMap = null;
if (sourceMappingURL) {
const sourceMapResult = await loader(sourceMappingURL, // $FlowFixMe
{
format: 'json',
conditions: [],
importAssertions: {
type: 'json'
},
importAttributes: {
type: 'json'
}
}, loader);
const sourceMapString = typeof sourceMapResult.source === 'string' ? sourceMapResult.source : // $FlowFixMe
sourceMapResult.source.toString('utf8');
sourceMap = JSON.parse(sourceMapString); // Strip the source mapping comment. We'll re-add it below if needed.
source = source.slice(0, sourceMappingStart) + '\n'.repeat(sourceMappingLines) + source.slice(sourceMappingEnd);
}
if (useClient) {
return transformClientModule(body, url, loader);
return transformClientModule(program, url, sourceMap, loader);
}
return transformServerModule(source, body, url);
return transformServerModule(source, program, url, sourceMap);
}

@@ -400,0 +594,0 @@

{
"name": "react-server-dom-webpack",
"description": "React Server Components bindings for DOM using Webpack. This is intended to be integrated into meta-frameworks. It is not intended to be imported directly.",
"version": "19.0.0-rc-9d4fba0788-20240530",
"version": "19.0.0-rc-a03254bc-20240905",
"keywords": [

@@ -26,2 +26,7 @@ "react"

"server.node.unbundled.js",
"static.js",
"static.browser.js",
"static.edge.js",
"static.node.js",
"static.node.unbundled.js",
"node-register.js",

@@ -67,2 +72,19 @@ "cjs/",

"./server.node.unbundled": "./server.node.unbundled.js",
"./static": {
"react-server": {
"workerd": "./static.edge.js",
"deno": "./static.browser.js",
"node": {
"webpack": "./static.node.js",
"default": "./static.node.unbundled.js"
},
"edge-light": "./static.edge.js",
"browser": "./static.browser.js"
},
"default": "./static.js"
},
"./static.browser": "./static.browser.js",
"./static.edge": "./static.edge.js",
"./static.node": "./static.node.js",
"./static.node.unbundled": "./static.node.unbundled.js",
"./node-loader": "./esm/react-server-dom-webpack-node-loader.production.js",

@@ -82,4 +104,4 @@ "./node-register": "./node-register.js",

"peerDependencies": {
"react": "19.0.0-rc-9d4fba0788-20240530",
"react-dom": "19.0.0-rc-9d4fba0788-20240530",
"react": "19.0.0-rc-a03254bc-20240905",
"react-dom": "19.0.0-rc-a03254bc-20240905",
"webpack": "^5.59.0"

@@ -89,4 +111,5 @@ },

"acorn-loose": "^8.3.0",
"neo-async": "^2.6.1"
"neo-async": "^2.6.1",
"webpack-sources": "^3.2.0"
}
}
'use strict';
var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-server.browser.production.js');
s = require('./cjs/react-server-dom-webpack-server.browser.production.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-server.browser.development.js');
s = require('./cjs/react-server-dom-webpack-server.browser.development.js');
}
exports.renderToReadableStream = s.renderToReadableStream;
exports.decodeReply = s.decodeReply;
exports.decodeAction = s.decodeAction;
exports.decodeFormState = s.decodeFormState;
exports.registerServerReference = s.registerServerReference;
exports.registerClientReference = s.registerClientReference;
exports.createClientModuleProxy = s.createClientModuleProxy;
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
'use strict';
var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-server.edge.production.js');
s = require('./cjs/react-server-dom-webpack-server.edge.production.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-server.edge.development.js');
s = require('./cjs/react-server-dom-webpack-server.edge.development.js');
}
exports.renderToReadableStream = s.renderToReadableStream;
exports.decodeReply = s.decodeReply;
exports.decodeAction = s.decodeAction;
exports.decodeFormState = s.decodeFormState;
exports.registerServerReference = s.registerServerReference;
exports.registerClientReference = s.registerClientReference;
exports.createClientModuleProxy = s.createClientModuleProxy;
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
'use strict';
var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-server.node.production.js');
s = require('./cjs/react-server-dom-webpack-server.node.production.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-server.node.development.js');
s = require('./cjs/react-server-dom-webpack-server.node.development.js');
}
exports.renderToPipeableStream = s.renderToPipeableStream;
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy;
exports.decodeReply = s.decodeReply;
exports.decodeAction = s.decodeAction;
exports.decodeFormState = s.decodeFormState;
exports.registerServerReference = s.registerServerReference;
exports.registerClientReference = s.registerClientReference;
exports.createClientModuleProxy = s.createClientModuleProxy;
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;
'use strict';
var s;
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js');
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.production.js');
} else {
module.exports = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js');
s = require('./cjs/react-server-dom-webpack-server.node.unbundled.development.js');
}
exports.renderToPipeableStream = s.renderToPipeableStream;
exports.decodeReplyFromBusboy = s.decodeReplyFromBusboy;
exports.decodeReply = s.decodeReply;
exports.decodeAction = s.decodeAction;
exports.decodeFormState = s.decodeFormState;
exports.registerServerReference = s.registerServerReference;
exports.registerClientReference = s.registerClientReference;
exports.createClientModuleProxy = s.createClientModuleProxy;
exports.createTemporaryReferenceSet = s.createTemporaryReferenceSet;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc