react-server-dom-webpack 18.3.0-next-4fcc9184a-20230217 → 18.3.0-next-bfb9cbd8c-20230223

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/cjs/react-server-dom-webpack-client.browser.development.js +11 -7
  2. package/cjs/react-server-dom-webpack-client.browser.production.min.js +17 -18
  3. package/cjs/react-server-dom-webpack-client.edge.development.js +14 -48
  4. package/cjs/react-server-dom-webpack-client.edge.production.min.js +16 -19
  5. package/cjs/react-server-dom-webpack-client.node.development.js +23 -69
  6. package/cjs/react-server-dom-webpack-client.node.production.min.js +17 -19
  7. package/cjs/react-server-dom-webpack-client.node.unbundled.development.js +52 -157
  8. package/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +15 -19
  9. package/cjs/react-server-dom-webpack-node-register.js +9 -9
  10. package/cjs/react-server-dom-webpack-plugin.js +8 -8
  11. package/cjs/react-server-dom-webpack-server.browser.development.js +122 -142
  12. package/cjs/react-server-dom-webpack-server.browser.production.min.js +31 -31
  13. package/cjs/react-server-dom-webpack-server.edge.development.js +122 -142
  14. package/cjs/react-server-dom-webpack-server.edge.production.min.js +27 -27
  15. package/cjs/react-server-dom-webpack-server.node.development.js +122 -142
  16. package/cjs/react-server-dom-webpack-server.node.production.min.js +27 -27
  17. package/cjs/react-server-dom-webpack-server.node.unbundled.development.js +122 -142
  18. package/cjs/react-server-dom-webpack-server.node.unbundled.production.min.js +27 -27
  19. package/esm/{react-server-dom-webpack-node-loader.js → react-server-dom-webpack-node-loader.production.min.js} +4 -4
  20. package/package.json +4 -4
  21. package/umd/react-server-dom-webpack-client.browser.development.js +14 -10
  22. package/umd/react-server-dom-webpack-client.browser.production.min.js +14 -14
  23. package/umd/react-server-dom-webpack-server.browser.development.js +127 -146
  24. package/umd/react-server-dom-webpack-server.browser.production.min.js +42 -42
@@ -14,10 +14,11 @@ if (process.env.NODE_ENV !== "production") {
14
14
  (function() {
15
15
  'use strict';
16
16
 
17
+ var util = require('util');
17
18
  var React = require('react');
18
19
 
19
20
  function createStringDecoder() {
20
- return new TextDecoder();
21
+ return new util.TextDecoder();
21
22
  }
22
23
  var decoderOptions = {
23
24
  stream: true
@@ -35,104 +36,45 @@ function parseModel(response, json) {
35
36
 
36
37
  // eslint-disable-next-line no-unused-vars
37
38
  function resolveClientReference(bundlerConfig, metadata) {
38
- if (bundlerConfig) {
39
- var resolvedModuleData = bundlerConfig[metadata.id][metadata.name];
40
-
41
- if (metadata.async) {
42
- return {
43
- id: resolvedModuleData.id,
44
- chunks: resolvedModuleData.chunks,
45
- name: resolvedModuleData.name,
46
- async: true
47
- };
48
- } else {
49
- return resolvedModuleData;
50
- }
51
- }
52
-
53
- return metadata;
54
- } // The chunk cache contains all the chunks we've preloaded so far.
55
- // If they're still pending they're a thenable. This map also exists
56
- // in Webpack but unfortunately it's not exposed so we have to
57
- // replicate it in user space. null means that it has already loaded.
58
-
59
- var chunkCache = new Map();
39
+ var resolvedModuleData = bundlerConfig[metadata.id][metadata.name];
40
+ return resolvedModuleData;
41
+ }
60
42
  var asyncModuleCache = new Map();
61
-
62
- function ignoreReject() {// We rely on rejected promises to be handled by another listener.
63
- } // Start preloading the modules since we might need them soon.
64
- // This function doesn't suspend.
65
-
66
-
67
43
  function preloadModule(metadata) {
68
- var chunks = metadata.chunks;
69
- var promises = [];
70
-
71
- for (var i = 0; i < chunks.length; i++) {
72
- var chunkId = chunks[i];
73
- var entry = chunkCache.get(chunkId);
44
+ var existingPromise = asyncModuleCache.get(metadata.specifier);
74
45
 
75
- if (entry === undefined) {
76
- var thenable = __webpack_chunk_load__(chunkId);
77
-
78
- promises.push(thenable); // $FlowFixMe[method-unbinding]
79
-
80
- var resolve = chunkCache.set.bind(chunkCache, chunkId, null);
81
- thenable.then(resolve, ignoreReject);
82
- chunkCache.set(chunkId, thenable);
83
- } else if (entry !== null) {
84
- promises.push(entry);
46
+ if (existingPromise) {
47
+ if (existingPromise.status === 'fulfilled') {
48
+ return null;
85
49
  }
86
- }
87
50
 
88
- if (metadata.async) {
89
- var existingPromise = asyncModuleCache.get(metadata.id);
90
-
91
- if (existingPromise) {
92
- if (existingPromise.status === 'fulfilled') {
93
- return null;
94
- }
95
-
96
- return existingPromise;
97
- } else {
98
- var modulePromise = Promise.all(promises).then(function () {
99
- return __webpack_require__(metadata.id);
100
- });
101
- modulePromise.then(function (value) {
102
- var fulfilledThenable = modulePromise;
103
- fulfilledThenable.status = 'fulfilled';
104
- fulfilledThenable.value = value;
105
- }, function (reason) {
106
- var rejectedThenable = modulePromise;
107
- rejectedThenable.status = 'rejected';
108
- rejectedThenable.reason = reason;
109
- });
110
- asyncModuleCache.set(metadata.id, modulePromise);
111
- return modulePromise;
112
- }
113
- } else if (promises.length > 0) {
114
- return Promise.all(promises);
51
+ return existingPromise;
115
52
  } else {
116
- return null;
53
+ // $FlowFixMe[unsupported-syntax]
54
+ var modulePromise = import(metadata.specifier);
55
+ modulePromise.then(function (value) {
56
+ var fulfilledThenable = modulePromise;
57
+ fulfilledThenable.status = 'fulfilled';
58
+ fulfilledThenable.value = value;
59
+ }, function (reason) {
60
+ var rejectedThenable = modulePromise;
61
+ rejectedThenable.status = 'rejected';
62
+ rejectedThenable.reason = reason;
63
+ });
64
+ asyncModuleCache.set(metadata.specifier, modulePromise);
65
+ return modulePromise;
117
66
  }
118
- } // Actually require the module or suspend if it's not yet ready.
119
- // Increase priority if necessary.
120
-
67
+ }
121
68
  function requireModule(metadata) {
122
- var moduleExports;
69
+ var moduleExports; // We assume that preloadModule has been called before, which
70
+ // should have added something to the module cache.
123
71
 
124
- if (metadata.async) {
125
- // We assume that preloadModule has been called before, which
126
- // should have added something to the module cache.
127
- var promise = asyncModuleCache.get(metadata.id);
72
+ var promise = asyncModuleCache.get(metadata.specifier);
128
73
 
129
- if (promise.status === 'fulfilled') {
130
- moduleExports = promise.value;
131
- } else {
132
- throw promise.reason;
133
- }
74
+ if (promise.status === 'fulfilled') {
75
+ moduleExports = promise.value;
134
76
  } else {
135
- moduleExports = __webpack_require__(metadata.id);
77
+ throw promise.reason;
136
78
  }
137
79
 
138
80
  if (metadata.name === '*') {
@@ -144,7 +86,7 @@ function requireModule(metadata) {
144
86
  if (metadata.name === '') {
145
87
  // This is a placeholder value that represents that the caller accessed the
146
88
  // default property of this if it was an ESM interop module.
147
- return moduleExports.__esModule ? moduleExports.default : moduleExports;
89
+ return moduleExports.default;
148
90
  }
149
91
 
150
92
  return moduleExports[metadata.name];
@@ -690,7 +632,7 @@ function missingCall() {
690
632
  throw new Error('Trying to call a function from "use server" but the callServer option ' + 'was not implemented in your router runtime.');
691
633
  }
692
634
 
693
- function createResponse(bundlerConfig, callServer) {
635
+ function createResponse$1(bundlerConfig, callServer) {
694
636
  var chunks = new Map();
695
637
  var response = {
696
638
  _bundlerConfig: bundlerConfig,
@@ -857,11 +799,11 @@ function createFromJSONCallback(response) {
857
799
  };
858
800
  }
859
801
 
860
- function createResponse$1(bundlerConfig, callServer) {
802
+ function createResponse(bundlerConfig, callServer) {
861
803
  // NOTE: CHECK THE COMPILER OUTPUT EACH TIME YOU CHANGE THIS.
862
804
  // It should be inlined to one object literal but minor changes can break it.
863
- var stringDecoder = createStringDecoder() ;
864
- var response = createResponse(bundlerConfig, callServer);
805
+ var stringDecoder = createStringDecoder() ;
806
+ var response = createResponse$1(bundlerConfig, callServer);
865
807
  response._partialRow = '';
866
808
 
867
809
  {
@@ -873,75 +815,28 @@ function createResponse$1(bundlerConfig, callServer) {
873
815
  return response;
874
816
  }
875
817
 
876
- function startReadingFromStream(response, stream) {
877
- var reader = stream.getReader();
878
-
879
- function progress(_ref) {
880
- var done = _ref.done,
881
- value = _ref.value;
882
-
883
- if (done) {
884
- close(response);
885
- return;
886
- }
887
-
888
- var buffer = value;
889
- processBinaryChunk(response, buffer);
890
- return reader.read().then(progress).catch(error);
891
- }
892
-
893
- function error(e) {
894
- reportGlobalError(response, e);
895
- }
896
-
897
- reader.read().then(progress).catch(error);
898
- }
899
-
900
- function createFromReadableStream(stream, options) {
901
- var response = createResponse$1(options && options.moduleMap ? options.moduleMap : null, options && options.callServer ? options.callServer : undefined);
902
- startReadingFromStream(response, stream);
903
- return getRoot(response);
818
+ function noServerCall() {
819
+ throw new Error('Server Functions cannot be called during initial render. ' + 'This would create a fetch waterfall. Try to use a Server Component ' + 'to pass data to Client Components instead.');
904
820
  }
905
821
 
906
- function createFromFetch(promiseForResponse, options) {
907
- var response = createResponse$1(options && options.moduleMap ? options.moduleMap : null, options && options.callServer ? options.callServer : undefined);
908
- promiseForResponse.then(function (r) {
909
- startReadingFromStream(response, r.body);
910
- }, function (e) {
911
- reportGlobalError(response, e);
822
+ function createFromNodeStream(stream, moduleMap) {
823
+ var response = createResponse(moduleMap, noServerCall);
824
+ stream.on('data', function (chunk) {
825
+ if (typeof chunk === 'string') {
826
+ processStringChunk(response, chunk, 0);
827
+ } else {
828
+ processBinaryChunk(response, chunk);
829
+ }
830
+ });
831
+ stream.on('error', function (error) {
832
+ reportGlobalError(response, error);
833
+ });
834
+ stream.on('end', function () {
835
+ return close(response);
912
836
  });
913
837
  return getRoot(response);
914
838
  }
915
839
 
916
- function createFromXHR(request, options) {
917
- var response = createResponse$1(options && options.moduleMap ? options.moduleMap : null, options && options.callServer ? options.callServer : undefined);
918
- var processedLength = 0;
919
-
920
- function progress(e) {
921
- var chunk = request.responseText;
922
- processStringChunk(response, chunk, processedLength);
923
- processedLength = chunk.length;
924
- }
925
-
926
- function load(e) {
927
- progress();
928
- close(response);
929
- }
930
-
931
- function error(e) {
932
- reportGlobalError(response, new TypeError('Network error'));
933
- }
934
-
935
- request.addEventListener('progress', progress);
936
- request.addEventListener('load', load);
937
- request.addEventListener('error', error);
938
- request.addEventListener('abort', error);
939
- request.addEventListener('timeout', error);
940
- return getRoot(response);
941
- }
942
-
943
- exports.createFromFetch = createFromFetch;
944
- exports.createFromReadableStream = createFromReadableStream;
945
- exports.createFromXHR = createFromXHR;
840
+ exports.createFromNodeStream = createFromNodeStream;
946
841
  })();
947
842
  }
@@ -7,22 +7,18 @@
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
- 'use strict';var h=require("react"),l={stream:!0};function m(a,b){return a?(a=a[b.id][b.name],b.async?{id:a.id,chunks:a.chunks,name:a.name,async:!0}:a):b}var n=new Map,p=new Map;function q(){}
11
- function r(a){for(var b=a.chunks,c=[],d=0;d<b.length;d++){var e=b[d],f=n.get(e);if(void 0===f){f=__webpack_chunk_load__(e);c.push(f);var k=n.set.bind(n,e,null);f.then(k,q);n.set(e,f)}else null!==f&&c.push(f)}if(a.async){if(b=p.get(a.id))return"fulfilled"===b.status?null:b;var g=Promise.all(c).then(function(){return __webpack_require__(a.id)});g.then(function(a){g.status="fulfilled";g.value=a},function(a){g.status="rejected";g.reason=a});p.set(a.id,g);return g}return 0<c.length?Promise.all(c):null}
12
- var t=Symbol.for("react.element"),u=Symbol.for("react.lazy"),v=Symbol.for("react.default_value"),w=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;function x(a,b,c,d){this.status=a;this.value=b;this.reason=c;this._response=d}x.prototype=Object.create(Promise.prototype);
13
- x.prototype.then=function(a,b){switch(this.status){case "resolved_model":y(this);break;case "resolved_module":z(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));b&&(null===this.reason&&(this.reason=[]),this.reason.push(b));break;default:b(this.reason)}};
14
- function B(a){switch(a.status){case "resolved_model":y(a);break;case "resolved_module":z(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function C(a,b){for(var c=0;c<a.length;c++)(0,a[c])(b)}function D(a,b,c){switch(a.status){case "fulfilled":C(b,a.value);break;case "pending":case "blocked":a.value=b;a.reason=c;break;case "rejected":c&&C(c,a.reason)}}
15
- function E(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.reason;a.status="rejected";a.reason=b;null!==c&&C(c,b)}}function F(a,b){if("pending"===a.status||"blocked"===a.status){var c=a.value,d=a.reason;a.status="resolved_module";a.value=b;null!==c&&(z(a),D(a,c,d))}}var G=null,H=null;
16
- function y(a){var b=G,c=H;G=a;H=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==H&&0<H.deps?(H.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{G=b,H=c}}
17
- function z(a){try{var b=a.value;if(b.async){var c=p.get(b.id);if("fulfilled"===c.status)var d=c.value;else throw c.reason;}else d=__webpack_require__(b.id);var e="*"===b.name?d:""===b.name?d.__esModule?d.default:d:d[b.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}function I(a,b){a._chunks.forEach(function(a){"pending"===a.status&&E(a,b)})}function J(a,b){var c=a._chunks,d=c.get(b);d||(d=new x("pending",null,null,a),c.set(b,d));return d}
18
- function K(a,b,c){if(H){var d=H;d.deps++}else d=H={deps:1,value:null};return function(e){b[c]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&C(e,d.value))}}function M(a){return function(b){return E(a,b)}}function N(a,b){var c=a._callServer;return function(){var a=Array.prototype.slice.call(arguments),e=b.bound;return"fulfilled"===e.status?c(b,e.value.concat(a)):Promise.resolve(e).then(function(d){return c(b,d.concat(a))})}}
19
- function O(a,b,c,d){if("$"===d[0]){if("$"===d)return t;switch(d[1]){case "$":return d.substring(1);case "L":return b=parseInt(d.substring(2),16),a=J(a,b),{$$typeof:u,_payload:a,_init:B};case "@":return b=parseInt(d.substring(2),16),J(a,b);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),w[a]||(w[a]=h.createServerContext(a,v)),w[a].Provider;case "F":b=parseInt(d.substring(2),16);b=J(a,b);switch(b.status){case "resolved_model":y(b)}switch(b.status){case "fulfilled":return N(a,
20
- b.value);default:throw b.reason;}default:d=parseInt(d.substring(1),16);a=J(a,d);switch(a.status){case "resolved_model":y(a);break;case "resolved_module":z(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=G,a.then(K(d,b,c),M(d)),null;default:throw a.reason;}}}return d}function P(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
21
- function Q(a,b,c){var d=a._chunks,e=d.get(b);c=JSON.parse(c,a._fromJSON);var f=m(a._bundlerConfig,c);if(c=r(f)){if(e){var k=e;k.status="blocked"}else k=new x("blocked",null,null,a),d.set(b,k);c.then(function(){return F(k,f)},function(a){return E(k,a)})}else e?F(e,f):d.set(b,new x("resolved_module",f,null,a))}function R(a){I(a,Error("Connection closed."))}
22
- function S(a,b){if(""!==b){var c=b.indexOf(":",0),d=parseInt(b.substring(0,c),16);switch(b[c+1]){case "I":Q(a,d,b.substring(c+2));break;case "E":c=JSON.parse(b.substring(c+2)).digest;b=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.");b.stack="Error: "+b.message;b.digest=c;c=a._chunks;
23
- var e=c.get(d);e?E(e,b):c.set(d,new x("rejected",null,b,a));break;default:b=b.substring(c+1),e=a._chunks,(c=e.get(d))?"pending"===c.status&&(a=c.value,d=c.reason,c.status="resolved_model",c.value=b,null!==a&&(y(c),D(c,a,d))):e.set(d,new x("resolved_model",b,null,a))}}}function T(a){return function(b,c){return"string"===typeof c?O(a,this,b,c):"object"===typeof c&&null!==c?(b=c[0]===t?{$$typeof:t,type:c[1],key:c[2],ref:null,props:c[3],_owner:null}:c,b):c}}
24
- function U(a,b){var c=new TextDecoder,d=new Map;a={_bundlerConfig:a,_callServer:void 0!==b?b:P,_chunks:d,_partialRow:"",_stringDecoder:c};a._fromJSON=T(a);return a}
25
- function V(a,b){function c(b){var f=b.value;if(b.done)R(a);else{b=f;f=a._stringDecoder;for(var g=b.indexOf(10);-1<g;){var L=a._partialRow;var A=b.subarray(0,g);A=f.decode(A);S(a,L+A);a._partialRow="";b=b.subarray(g+1);g=b.indexOf(10)}a._partialRow+=f.decode(b,l);return e.read().then(c).catch(d)}}function d(b){I(a,b)}var e=b.getReader();e.read().then(c).catch(d)}
26
- exports.createFromFetch=function(a,b){var c=U(b&&b.moduleMap?b.moduleMap:null,b&&b.callServer?b.callServer:void 0);a.then(function(a){V(c,a.body)},function(a){I(c,a)});return J(c,0)};exports.createFromReadableStream=function(a,b){b=U(b&&b.moduleMap?b.moduleMap:null,b&&b.callServer?b.callServer:void 0);V(b,a);return J(b,0)};
27
- exports.createFromXHR=function(a,b){function c(){for(var b=a.responseText,c=f,d=b.indexOf("\n",c);-1<d;)c=e._partialRow+b.substring(c,d),S(e,c),e._partialRow="",c=d+1,d=b.indexOf("\n",c);e._partialRow+=b.substring(c);f=b.length}function d(){I(e,new TypeError("Network error"))}var e=U(b&&b.moduleMap?b.moduleMap:null,b&&b.callServer?b.callServer:void 0),f=0;a.addEventListener("progress",c);a.addEventListener("load",function(){c();R(e)});a.addEventListener("error",d);a.addEventListener("abort",d);a.addEventListener("timeout",
28
- d);return J(e,0)};
10
+ 'use strict';var g=require("util"),h=require("react"),l={stream:!0},m=new Map;function p(a){var c=m.get(a.specifier);if(c)return"fulfilled"===c.status?null:c;var b=import(a.specifier);b.then(function(d){b.status="fulfilled";b.value=d},function(d){b.status="rejected";b.reason=d});m.set(a.specifier,b);return b}var q=Symbol.for("react.element"),r=Symbol.for("react.lazy"),t=Symbol.for("react.default_value"),u=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ContextRegistry;
11
+ function v(a,c,b,d){this.status=a;this.value=c;this.reason=b;this._response=d}v.prototype=Object.create(Promise.prototype);v.prototype.then=function(a,c){switch(this.status){case "resolved_model":w(this);break;case "resolved_module":x(this)}switch(this.status){case "fulfilled":a(this.value);break;case "pending":case "blocked":a&&(null===this.value&&(this.value=[]),this.value.push(a));c&&(null===this.reason&&(this.reason=[]),this.reason.push(c));break;default:c(this.reason)}};
12
+ function y(a){switch(a.status){case "resolved_model":w(a);break;case "resolved_module":x(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":throw a;default:throw a.reason;}}function z(a,c){for(var b=0;b<a.length;b++)(0,a[b])(c)}function A(a,c,b){switch(a.status){case "fulfilled":z(c,a.value);break;case "pending":case "blocked":a.value=c;a.reason=b;break;case "rejected":b&&z(b,a.reason)}}
13
+ function B(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.reason;a.status="rejected";a.reason=c;null!==b&&z(b,c)}}function C(a,c){if("pending"===a.status||"blocked"===a.status){var b=a.value,d=a.reason;a.status="resolved_module";a.value=c;null!==b&&(x(a),A(a,b,d))}}var D=null,E=null;
14
+ function w(a){var c=D,b=E;D=a;E=null;try{var d=JSON.parse(a.value,a._response._fromJSON);null!==E&&0<E.deps?(E.value=d,a.status="blocked",a.value=null,a.reason=null):(a.status="fulfilled",a.value=d)}catch(e){a.status="rejected",a.reason=e}finally{D=c,E=b}}function x(a){try{var c=a.value,b=m.get(c.specifier);if("fulfilled"===b.status)var d=b.value;else throw b.reason;var e="*"===c.name?d:""===c.name?d.default:d[c.name];a.status="fulfilled";a.value=e}catch(f){a.status="rejected",a.reason=f}}
15
+ function F(a,c){a._chunks.forEach(function(b){"pending"===b.status&&B(b,c)})}function G(a,c){var b=a._chunks,d=b.get(c);d||(d=new v("pending",null,null,a),b.set(c,d));return d}function H(a,c,b){if(E){var d=E;d.deps++}else d=E={deps:1,value:null};return function(e){c[b]=e;d.deps--;0===d.deps&&"blocked"===a.status&&(e=a.value,a.status="fulfilled",a.value=d.value,null!==e&&z(e,d.value))}}function I(a){return function(c){return B(a,c)}}
16
+ function J(a,c){var b=a._callServer;return function(){var d=Array.prototype.slice.call(arguments),e=c.bound;return"fulfilled"===e.status?b(c,e.value.concat(d)):Promise.resolve(e).then(function(f){return b(c,f.concat(d))})}}
17
+ function K(a,c,b,d){if("$"===d[0]){if("$"===d)return q;switch(d[1]){case "$":return d.substring(1);case "L":return c=parseInt(d.substring(2),16),a=G(a,c),{$$typeof:r,_payload:a,_init:y};case "@":return c=parseInt(d.substring(2),16),G(a,c);case "S":return Symbol.for(d.substring(2));case "P":return a=d.substring(2),u[a]||(u[a]=h.createServerContext(a,t)),u[a].Provider;case "F":c=parseInt(d.substring(2),16);c=G(a,c);switch(c.status){case "resolved_model":w(c)}switch(c.status){case "fulfilled":return J(a,
18
+ c.value);default:throw c.reason;}default:d=parseInt(d.substring(1),16);a=G(a,d);switch(a.status){case "resolved_model":w(a);break;case "resolved_module":x(a)}switch(a.status){case "fulfilled":return a.value;case "pending":case "blocked":return d=D,a.then(H(d,c,b),I(d)),null;default:throw a.reason;}}}return d}function L(){throw Error('Trying to call a function from "use server" but the callServer option was not implemented in your router runtime.');}
19
+ function M(a,c,b){var d=a._chunks,e=d.get(c);b=JSON.parse(b,a._fromJSON);var f=a._bundlerConfig[b.id][b.name];if(b=p(f)){if(e){var k=e;k.status="blocked"}else k=new v("blocked",null,null,a),d.set(c,k);b.then(function(){return C(k,f)},function(n){return B(k,n)})}else e?C(e,f):d.set(c,new v("resolved_module",f,null,a))}
20
+ function N(a,c){if(""!==c){var b=c.indexOf(":",0),d=parseInt(c.substring(0,b),16);switch(c[b+1]){case "I":M(a,d,c.substring(b+2));break;case "E":b=JSON.parse(c.substring(b+2)).digest;c=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.");c.stack="Error: "+c.message;c.digest=b;b=a._chunks;
21
+ var e=b.get(d);e?B(e,c):b.set(d,new v("rejected",null,c,a));break;default:c=c.substring(b+1),e=a._chunks,(b=e.get(d))?"pending"===b.status&&(a=b.value,d=b.reason,b.status="resolved_model",b.value=c,null!==a&&(w(b),A(b,a,d))):e.set(d,new v("resolved_model",c,null,a))}}}function O(a){return function(c,b){return"string"===typeof b?K(a,this,c,b):"object"===typeof b&&null!==b?(c=b[0]===q?{$$typeof:q,type:b[1],key:b[2],ref:null,props:b[3],_owner:null}:b,c):b}}
22
+ function P(a,c){var b=new g.TextDecoder,d=new Map;a={_bundlerConfig:a,_callServer:void 0!==c?c:L,_chunks:d,_partialRow:"",_stringDecoder:b};a._fromJSON=O(a);return a}function Q(){throw Error("Server Functions cannot be called during initial render. This would create a fetch waterfall. Try to use a Server Component to pass data to Client Components instead.");}
23
+ exports.createFromNodeStream=function(a,c){var b=P(c,Q);a.on("data",function(d){if("string"===typeof d){for(var e=0,f=d.indexOf("\n",e);-1<f;)e=b._partialRow+d.substring(e,f),N(b,e),b._partialRow="",e=f+1,f=d.indexOf("\n",e);b._partialRow+=d.substring(e)}else{f=b._stringDecoder;for(e=d.indexOf(10);-1<e;){var k=b._partialRow;var n=d.subarray(0,e);n=f.decode(n);N(b,k+n);b._partialRow="";d=d.subarray(e+1);e=d.indexOf(10)}b._partialRow+=f.decode(d,l)}});a.on("error",function(d){F(b,d)});a.on("end",function(){F(b,
24
+ Error("Connection closed."))});return G(b,0)};
@@ -10,12 +10,12 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- 'use strict';const m=require("acorn"),n=require("url"),q=require("module");
14
- module.exports=function(){const h=Symbol.for("react.client.reference"),k=Symbol.for("react.server.reference"),r=Promise.prototype,t=Function.prototype.bind;Function.prototype.bind=function(a){const b=t.apply(this,arguments);if(this.$$typeof===k){const a=Array.prototype.slice.call(arguments,1);b.$$typeof=k;b.$$filepath=this.$$filepath;b.$$name=this.$$name;b.$$bound=this.$$bound.concat(a)}return b};const u={get:function(a,b){switch(b){case "$$typeof":return a.$$typeof;case "filepath":return a.filepath;
15
- case "name":return a.name;case "displayName":return;case "async":return a.async;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "Provider":throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider.");}switch(a.name){case "":a=String(b);break;case "*":a=String(b);break;default:a=String(a.name)+"."+String(b)}throw Error("Cannot access "+
16
- a+" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.");},set:function(){throw Error("Cannot assign to a client module from a server module.");}},p={get:function(a,b){switch(b){case "$$typeof":return a.$$typeof;case "filepath":return a.filepath;case "name":return a.name;case "async":return a.async;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "__esModule":const d=
17
- a.filepath;a.default=Object.defineProperties(function(){throw Error("Attempted to call the default export of "+d+" 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.");},{name:{value:""},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:a.async}});return!0;case "then":if(a.then)return a.then;if(a.async)return;{var c=Object.defineProperties({},{name:{value:"*"},
18
- $$typeof:{value:h},filepath:{value:a.filepath},async:{value:!0}});const b=new Proxy(c,p);a.status="fulfilled";a.value=b;return a.then=Object.defineProperties(function(a){return Promise.resolve(a(b))},{name:{value:"then"},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:!1}})}}c=a[b];c||(c=Object.defineProperties(function(){throw Error("Attempted to call "+String(b)+"() from the server but "+String(b)+" is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");
19
- },{name:{value:b},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:a.async}}),c=a[b]=new Proxy(c,u));return c},getPrototypeOf(){return r},set:function(){throw Error("Cannot assign to a client module from a server module.");}},l=q.prototype._compile;q.prototype._compile=function(a,b){if(-1===a.indexOf("use client")&&-1===a.indexOf("use server"))return l.apply(this,arguments);var c=m.parse(a,{ecmaVersion:"2019",sourceType:"source"}).body,d=!1,f=!1;for(var e=0;e<c.length;e++){var g=c[e];if("ExpressionStatement"!==
20
- g.type||!g.directive)break;"use client"===g.directive&&(d=!0);"use server"===g.directive&&(f=!0)}if(!d&&!f)return l.apply(this,arguments);if(d&&f)throw Error('Cannot have both "use client" and "use server" directives in the same file.');d&&(c=n.pathToFileURL(b).href,c=Object.defineProperties({},{name:{value:"*"},$$typeof:{value:h},filepath:{value:c},async:{value:!1}}),this.exports=new Proxy(c,p));if(f)if(l.apply(this,arguments),f=n.pathToFileURL(b).href,c=this.exports,"function"===typeof c)Object.defineProperties(c,
21
- {$$typeof:{value:k},$$filepath:{value:f},$$name:{value:"*"},$$bound:{value:[]}});else for(d=Object.keys(c),e=0;e<d.length;e++){g=d[e];const a=c[d[e]];"function"===typeof a&&Object.defineProperties(a,{$$typeof:{value:k},$$filepath:{value:f},$$name:{value:g},$$bound:{value:[]}})}}};
13
+ 'use strict';const m=require("acorn"),n=require("url"),r=require("module");
14
+ module.exports=function(){const h=Symbol.for("react.client.reference"),k=Symbol.for("react.server.reference"),t=Promise.prototype,u=Function.prototype.bind;Function.prototype.bind=function(a){const c=u.apply(this,arguments);if(this.$$typeof===k){const b=Array.prototype.slice.call(arguments,1);c.$$typeof=k;c.$$filepath=this.$$filepath;c.$$name=this.$$name;c.$$bound=this.$$bound.concat(b)}return c};const v={get:function(a,c){switch(c){case "$$typeof":return a.$$typeof;case "filepath":return a.filepath;
15
+ case "name":return a.name;case "displayName":return;case "async":return a.async;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "Provider":throw Error("Cannot render a Client Context Provider on the Server. Instead, you can export a Client Component wrapper that itself renders a Client Context Provider.");}switch(a.name){case "":a=String(c);break;case "*":a=String(c);break;default:a=String(a.name)+"."+String(c)}throw Error("Cannot access "+
16
+ a+" on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.");},set:function(){throw Error("Cannot assign to a client module from a server module.");}},p={get:function(a,c){switch(c){case "$$typeof":return a.$$typeof;case "filepath":return a.filepath;case "name":return a.name;case "async":return a.async;case "defaultProps":return;case "toJSON":return;case Symbol.toPrimitive:return Object.prototype[Symbol.toPrimitive];case "__esModule":const d=
17
+ a.filepath;a.default=Object.defineProperties(function(){throw Error("Attempted to call the default export of "+d+" 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.");},{name:{value:""},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:a.async}});return!0;case "then":if(a.then)return a.then;if(a.async)return;var b=Object.defineProperties({},{name:{value:"*"},
18
+ $$typeof:{value:h},filepath:{value:a.filepath},async:{value:!0}});const e=new Proxy(b,p);a.status="fulfilled";a.value=e;return a.then=Object.defineProperties(function(f){return Promise.resolve(f(e))},{name:{value:"then"},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:!1}})}b=a[c];b||(b=Object.defineProperties(function(){throw Error("Attempted to call "+String(c)+"() from the server but "+String(c)+" is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.");
19
+ },{name:{value:c},$$typeof:{value:h},filepath:{value:a.filepath},async:{value:a.async}}),b=a[c]=new Proxy(b,v));return b},getPrototypeOf(){return t},set:function(){throw Error("Cannot assign to a client module from a server module.");}},l=r.prototype._compile;r.prototype._compile=function(a,c){if(-1===a.indexOf("use client")&&-1===a.indexOf("use server"))return l.apply(this,arguments);var b=m.parse(a,{ecmaVersion:"2019",sourceType:"source"}).body,d=!1,e=!1;for(var f=0;f<b.length;f++){var g=b[f];if("ExpressionStatement"!==
20
+ g.type||!g.directive)break;"use client"===g.directive&&(d=!0);"use server"===g.directive&&(e=!0)}if(!d&&!e)return l.apply(this,arguments);if(d&&e)throw Error('Cannot have both "use client" and "use server" directives in the same file.');d&&(b=n.pathToFileURL(c).href,b=Object.defineProperties({},{name:{value:"*"},$$typeof:{value:h},filepath:{value:b},async:{value:!1}}),this.exports=new Proxy(b,p));if(e)if(l.apply(this,arguments),e=n.pathToFileURL(c).href,b=this.exports,"function"===typeof b)Object.defineProperties(b,
21
+ {$$typeof:{value:k},$$filepath:{value:e},$$name:{value:"*"},$$bound:{value:[]}});else for(d=Object.keys(b),f=0;f<d.length;f++){g=d[f];const q=b[d[f]];"function"===typeof q&&Object.defineProperties(q,{$$typeof:{value:k},$$filepath:{value:e},$$name:{value:g},$$bound:{value:[]}})}}};
@@ -10,11 +10,11 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- 'use strict';var k=require("path"),l=require("url"),n=require("neo-async"),p=require("webpack/lib/dependencies/ModuleDependency"),q=require("webpack/lib/dependencies/NullDependency"),r=require("webpack/lib/Template"),t=require("webpack");const u=Array.isArray;class v extends p{constructor(a){super(a)}get type(){return"client-reference"}}const w=require.resolve("../client.browser.js");
14
- class x{constructor(a){this.manifestFilename=this.chunkName=this.clientReferences=void 0;if(!a||"boolean"!==typeof a.isServer)throw Error("React Server Plugin: You must specify the isServer option as a boolean.");if(a.isServer)throw Error("TODO: Implement the server compiler.");a.clientReferences?"string"!==typeof a.clientReferences&&u(a.clientReferences)?this.clientReferences=a.clientReferences:this.clientReferences=[a.clientReferences]:this.clientReferences=[{directory:".",recursive:!0,include:/\.(js|ts|jsx|tsx)$/}];
15
- "string"===typeof a.chunkName?(this.chunkName=a.chunkName,/\[(index|request)\]/.test(this.chunkName)||(this.chunkName+="[index]")):this.chunkName="client[index]";this.manifestFilename=a.manifestFilename||"react-client-manifest.json"}apply(a){const e=this;let f,m=!1;a.hooks.beforeCompile.tapAsync("React Server Plugin",(c,b)=>{c=c.contextModuleFactory;const d=a.resolverFactory.get("context",{});e.resolveAllClientFiles(a.context,d,a.inputFileSystem,c,function(a,c){a?b(a):(f=c,b())})});a.hooks.thisCompilation.tap("React Server Plugin",
16
- (a,b)=>{b=b.normalModuleFactory;a.dependencyFactories.set(v,b);a.dependencyTemplates.set(v,new q.Template);a=a=>{a.hooks.program.tap("React Server Plugin",()=>{const b=a.state.module;if(b.resource===w&&(m=!0,f))for(let a=0;a<f.length;a++){const g=f[a];var c=e.chunkName.replace(/\[index\]/g,""+a).replace(/\[request\]/g,r.toPath(g.userRequest));c=new t.AsyncDependenciesBlock({name:c},null,g.request);c.addDependency(g);b.addBlock(c)}})};b.hooks.parser.for("javascript/auto").tap("HarmonyModulesPlugin",
17
- a);b.hooks.parser.for("javascript/esm").tap("HarmonyModulesPlugin",a);b.hooks.parser.for("javascript/dynamic").tap("HarmonyModulesPlugin",a)});a.hooks.make.tap("React Server Plugin",a=>{a.hooks.processAssets.tap({name:"React Server Plugin",stage:t.Compilation.PROCESS_ASSETS_STAGE_REPORT},function(){if(!1===m)a.warnings.push(new t.WebpackError("Client runtime at react-server-dom-webpack/client was not found. React Server Components module map file "+e.manifestFilename+" was not created."));else{var b=
18
- {};a.chunkGroups.forEach(function(c){function d(c,h){if(/\.(js|ts)x?$/.test(h.resource)){var d=a.moduleGraph.getExportsInfo(h).getProvidedExports(),g={};["","*"].concat(Array.isArray(d)?d:[]).forEach(function(a){g[a]={id:c,chunks:e,name:a}});h=l.pathToFileURL(h.resource).href;void 0!==h&&(b[h]=g)}}const e=c.chunks.map(function(a){return a.id});c.chunks.forEach(function(b){b=a.chunkGraph.getChunkModulesIterable(b);Array.from(b).forEach(function(b){const c=a.chunkGraph.getModuleId(b);d(c,b);b.modules&&
19
- b.modules.forEach(a=>{d(c,a)})})})});var c=JSON.stringify(b,null,2);a.emitAsset(e.manifestFilename,new t.sources.RawSource(c,!1))}})})}resolveAllClientFiles(a,e,f,m,c){n.map(this.clientReferences,(b,c)=>{"string"===typeof b?c(null,[new v(b)]):e.resolve({},a,b.directory,{},(a,d)=>{if(a)return c(a);m.resolveDependencies(f,{resource:d,resourceQuery:"",recursive:void 0===b.recursive?!0:b.recursive,regExp:b.include,include:void 0,exclude:b.exclude},(a,b)=>{if(a)return c(a);a=b.map(a=>{var b=k.join(d,a.userRequest);
20
- b=new v(b);b.userRequest=a.userRequest;return b});c(null,a)})})},(a,d)=>{if(a)return c(a);a=[];for(let b=0;b<d.length;b++)a.push.apply(a,d[b]);c(null,a)})}}module.exports=x;
13
+ 'use strict';var q=require("path"),r=require("url"),x=require("neo-async"),y=require("webpack/lib/dependencies/ModuleDependency"),z=require("webpack/lib/dependencies/NullDependency"),A=require("webpack/lib/Template"),B=require("webpack");const C=Array.isArray;class D extends y{constructor(b){super(b)}get type(){return"client-reference"}}const E=require.resolve("../client.browser.js");
14
+ class F{constructor(b){this.ssrManifestFilename=this.clientManifestFilename=this.chunkName=this.clientReferences=void 0;if(!b||"boolean"!==typeof b.isServer)throw Error("React Server Plugin: You must specify the isServer option as a boolean.");if(b.isServer)throw Error("TODO: Implement the server compiler.");b.clientReferences?"string"!==typeof b.clientReferences&&C(b.clientReferences)?this.clientReferences=b.clientReferences:this.clientReferences=[b.clientReferences]:this.clientReferences=[{directory:".",
15
+ recursive:!0,include:/\.(js|ts|jsx|tsx)$/}];"string"===typeof b.chunkName?(this.chunkName=b.chunkName,/\[(index|request)\]/.test(this.chunkName)||(this.chunkName+="[index]")):this.chunkName="client[index]";this.clientManifestFilename=b.clientManifestFilename||"react-client-manifest.json";this.ssrManifestFilename=b.ssrManifestFilename||"react-ssr-manifest.json"}apply(b){const m=this;let p,t=!1;b.hooks.beforeCompile.tapAsync("React Server Plugin",(c,a)=>{c=c.contextModuleFactory;const d=b.resolverFactory.get("context",
16
+ {});m.resolveAllClientFiles(b.context,d,b.inputFileSystem,c,function(e,g){e?a(e):(p=g,a())})});b.hooks.thisCompilation.tap("React Server Plugin",(c,a)=>{a=a.normalModuleFactory;c.dependencyFactories.set(D,a);c.dependencyTemplates.set(D,new z.Template);c=d=>{d.hooks.program.tap("React Server Plugin",()=>{const e=d.state.module;if(e.resource===E&&(t=!0,p))for(let h=0;h<p.length;h++){const n=p[h];var g=m.chunkName.replace(/\[index\]/g,""+h).replace(/\[request\]/g,A.toPath(n.userRequest));g=new B.AsyncDependenciesBlock({name:g},
17
+ null,n.request);g.addDependency(n);e.addBlock(g)}})};a.hooks.parser.for("javascript/auto").tap("HarmonyModulesPlugin",c);a.hooks.parser.for("javascript/esm").tap("HarmonyModulesPlugin",c);a.hooks.parser.for("javascript/dynamic").tap("HarmonyModulesPlugin",c)});b.hooks.make.tap("React Server Plugin",c=>{c.hooks.processAssets.tap({name:"React Server Plugin",stage:B.Compilation.PROCESS_ASSETS_STAGE_REPORT},function(){if(!1===t)c.warnings.push(new B.WebpackError("Client runtime at react-server-dom-webpack/client was not found. React Server Components module map file "+
18
+ m.clientManifestFilename+" was not created."));else{var a={},d={};c.chunkGroups.forEach(function(g){function h(k,f){if(/\.(js|ts)x?$/.test(f.resource)){var l=c.moduleGraph.getExportsInfo(f).getProvidedExports(),u={},w={};d[k]=w;["","*"].concat(Array.isArray(l)?l:[]).forEach(function(v){u[v]={id:k,chunks:n,name:v};w[v]={specifier:f.resource,name:v}});l=r.pathToFileURL(f.resource).href;void 0!==l&&(a[l]=u,d[l]=w)}}const n=g.chunks.map(function(k){return k.id});g.chunks.forEach(function(k){k=c.chunkGraph.getChunkModulesIterable(k);
19
+ Array.from(k).forEach(function(f){const l=c.chunkGraph.getModuleId(f);h(l,f);f.modules&&f.modules.forEach(u=>{h(l,u)})})})});var e=JSON.stringify(a,null,2);c.emitAsset(m.clientManifestFilename,new B.sources.RawSource(e,!1));e=JSON.stringify(d,null,2);c.emitAsset(m.ssrManifestFilename,new B.sources.RawSource(e,!1))}})})}resolveAllClientFiles(b,m,p,t,c){x.map(this.clientReferences,(a,d)=>{"string"===typeof a?d(null,[new D(a)]):m.resolve({},b,a.directory,{},(e,g)=>{if(e)return d(e);t.resolveDependencies(p,
20
+ {resource:g,resourceQuery:"",recursive:void 0===a.recursive?!0:a.recursive,regExp:a.include,include:void 0,exclude:a.exclude},(h,n)=>{if(h)return d(h);h=n.map(k=>{var f=q.join(g,k.userRequest);f=new D(f);f.userRequest=k.userRequest;return f});d(null,h)})})},(a,d)=>{if(a)return c(a);a=[];for(let e=0;e<d.length;e++)a.push.apply(a,d[e]);c(null,a)})}}module.exports=F;