UNPKG

28.8 kBJavaScriptView Raw
1/**
2 * @license React
3 * react.react-server.development.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */
10
11"use strict";
12"production" !== process.env.NODE_ENV &&
13 (function () {
14 function getIteratorFn(maybeIterable) {
15 if (null === maybeIterable || "object" !== typeof maybeIterable)
16 return null;
17 maybeIterable =
18 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
19 maybeIterable["@@iterator"];
20 return "function" === typeof maybeIterable ? maybeIterable : null;
21 }
22 function testStringCoercion(value) {
23 return "" + value;
24 }
25 function checkKeyStringCoercion(value) {
26 try {
27 testStringCoercion(value);
28 var JSCompiler_inline_result = !1;
29 } catch (e) {
30 JSCompiler_inline_result = !0;
31 }
32 if (JSCompiler_inline_result) {
33 JSCompiler_inline_result = console;
34 var JSCompiler_temp_const = JSCompiler_inline_result.error;
35 var JSCompiler_inline_result$jscomp$0 =
36 ("function" === typeof Symbol &&
37 Symbol.toStringTag &&
38 value[Symbol.toStringTag]) ||
39 value.constructor.name ||
40 "Object";
41 JSCompiler_temp_const.call(
42 JSCompiler_inline_result,
43 "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
44 JSCompiler_inline_result$jscomp$0
45 );
46 return testStringCoercion(value);
47 }
48 }
49 function getComponentNameFromType(type) {
50 if (null == type) return null;
51 if ("function" === typeof type)
52 return type.$$typeof === REACT_CLIENT_REFERENCE
53 ? null
54 : type.displayName || type.name || null;
55 if ("string" === typeof type) return type;
56 switch (type) {
57 case REACT_FRAGMENT_TYPE:
58 return "Fragment";
59 case REACT_PROFILER_TYPE:
60 return "Profiler";
61 case REACT_STRICT_MODE_TYPE:
62 return "StrictMode";
63 case REACT_SUSPENSE_TYPE:
64 return "Suspense";
65 case REACT_SUSPENSE_LIST_TYPE:
66 return "SuspenseList";
67 case REACT_ACTIVITY_TYPE:
68 return "Activity";
69 }
70 if ("object" === typeof type)
71 switch (
72 ("number" === typeof type.tag &&
73 console.error(
74 "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
75 ),
76 type.$$typeof)
77 ) {
78 case REACT_PORTAL_TYPE:
79 return "Portal";
80 case REACT_CONTEXT_TYPE:
81 return (type.displayName || "Context") + ".Provider";
82 case REACT_CONSUMER_TYPE:
83 return (type._context.displayName || "Context") + ".Consumer";
84 case REACT_FORWARD_REF_TYPE:
85 var innerType = type.render;
86 type = type.displayName;
87 type ||
88 ((type = innerType.displayName || innerType.name || ""),
89 (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
90 return type;
91 case REACT_MEMO_TYPE:
92 return (
93 (innerType = type.displayName || null),
94 null !== innerType
95 ? innerType
96 : getComponentNameFromType(type.type) || "Memo"
97 );
98 case REACT_LAZY_TYPE:
99 innerType = type._payload;
100 type = type._init;
101 try {
102 return getComponentNameFromType(type(innerType));
103 } catch (x) {}
104 }
105 return null;
106 }
107 function getTaskName(type) {
108 if (type === REACT_FRAGMENT_TYPE) return "<>";
109 if (
110 "object" === typeof type &&
111 null !== type &&
112 type.$$typeof === REACT_LAZY_TYPE
113 )
114 return "<...>";
115 try {
116 var name = getComponentNameFromType(type);
117 return name ? "<" + name + ">" : "<...>";
118 } catch (x) {
119 return "<...>";
120 }
121 }
122 function getOwner() {
123 var dispatcher = ReactSharedInternals.A;
124 return null === dispatcher ? null : dispatcher.getOwner();
125 }
126 function UnknownOwner() {
127 return Error("react-stack-top-frame");
128 }
129 function hasValidKey(config) {
130 if (hasOwnProperty.call(config, "key")) {
131 var getter = Object.getOwnPropertyDescriptor(config, "key").get;
132 if (getter && getter.isReactWarning) return !1;
133 }
134 return void 0 !== config.key;
135 }
136 function defineKeyPropWarningGetter(props, displayName) {
137 function warnAboutAccessingKey() {
138 specialPropKeyWarningShown ||
139 ((specialPropKeyWarningShown = !0),
140 console.error(
141 "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142 displayName
143 ));
144 }
145 warnAboutAccessingKey.isReactWarning = !0;
146 Object.defineProperty(props, "key", {
147 get: warnAboutAccessingKey,
148 configurable: !0
149 });
150 }
151 function elementRefGetterWithDeprecationWarning() {
152 var componentName = getComponentNameFromType(this.type);
153 didWarnAboutElementRef[componentName] ||
154 ((didWarnAboutElementRef[componentName] = !0),
155 console.error(
156 "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
157 ));
158 componentName = this.props.ref;
159 return void 0 !== componentName ? componentName : null;
160 }
161 function ReactElement(
162 type,
163 key,
164 self,
165 source,
166 owner,
167 props,
168 debugStack,
169 debugTask
170 ) {
171 self = props.ref;
172 type = {
173 $$typeof: REACT_ELEMENT_TYPE,
174 type: type,
175 key: key,
176 props: props,
177 _owner: owner
178 };
179 null !== (void 0 !== self ? self : null)
180 ? Object.defineProperty(type, "ref", {
181 enumerable: !1,
182 get: elementRefGetterWithDeprecationWarning
183 })
184 : Object.defineProperty(type, "ref", { enumerable: !1, value: null });
185 type._store = {};
186 Object.defineProperty(type._store, "validated", {
187 configurable: !1,
188 enumerable: !1,
189 writable: !0,
190 value: 0
191 });
192 Object.defineProperty(type, "_debugInfo", {
193 configurable: !1,
194 enumerable: !1,
195 writable: !0,
196 value: null
197 });
198 Object.defineProperty(type, "_debugStack", {
199 configurable: !1,
200 enumerable: !1,
201 writable: !0,
202 value: debugStack
203 });
204 Object.defineProperty(type, "_debugTask", {
205 configurable: !1,
206 enumerable: !1,
207 writable: !0,
208 value: debugTask
209 });
210 Object.freeze && (Object.freeze(type.props), Object.freeze(type));
211 return type;
212 }
213 function cloneAndReplaceKey(oldElement, newKey) {
214 newKey = ReactElement(
215 oldElement.type,
216 newKey,
217 void 0,
218 void 0,
219 oldElement._owner,
220 oldElement.props,
221 oldElement._debugStack,
222 oldElement._debugTask
223 );
224 oldElement._store &&
225 (newKey._store.validated = oldElement._store.validated);
226 return newKey;
227 }
228 function isValidElement(object) {
229 return (
230 "object" === typeof object &&
231 null !== object &&
232 object.$$typeof === REACT_ELEMENT_TYPE
233 );
234 }
235 function escape(key) {
236 var escaperLookup = { "=": "=0", ":": "=2" };
237 return (
238 "$" +
239 key.replace(/[=:]/g, function (match) {
240 return escaperLookup[match];
241 })
242 );
243 }
244 function getElementKey(element, index) {
245 return "object" === typeof element &&
246 null !== element &&
247 null != element.key
248 ? (checkKeyStringCoercion(element.key), escape("" + element.key))
249 : index.toString(36);
250 }
251 function noop() {}
252 function resolveThenable(thenable) {
253 switch (thenable.status) {
254 case "fulfilled":
255 return thenable.value;
256 case "rejected":
257 throw thenable.reason;
258 default:
259 switch (
260 ("string" === typeof thenable.status
261 ? thenable.then(noop, noop)
262 : ((thenable.status = "pending"),
263 thenable.then(
264 function (fulfilledValue) {
265 "pending" === thenable.status &&
266 ((thenable.status = "fulfilled"),
267 (thenable.value = fulfilledValue));
268 },
269 function (error) {
270 "pending" === thenable.status &&
271 ((thenable.status = "rejected"),
272 (thenable.reason = error));
273 }
274 )),
275 thenable.status)
276 ) {
277 case "fulfilled":
278 return thenable.value;
279 case "rejected":
280 throw thenable.reason;
281 }
282 }
283 throw thenable;
284 }
285 function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
286 var type = typeof children;
287 if ("undefined" === type || "boolean" === type) children = null;
288 var invokeCallback = !1;
289 if (null === children) invokeCallback = !0;
290 else
291 switch (type) {
292 case "bigint":
293 case "string":
294 case "number":
295 invokeCallback = !0;
296 break;
297 case "object":
298 switch (children.$$typeof) {
299 case REACT_ELEMENT_TYPE:
300 case REACT_PORTAL_TYPE:
301 invokeCallback = !0;
302 break;
303 case REACT_LAZY_TYPE:
304 return (
305 (invokeCallback = children._init),
306 mapIntoArray(
307 invokeCallback(children._payload),
308 array,
309 escapedPrefix,
310 nameSoFar,
311 callback
312 )
313 );
314 }
315 }
316 if (invokeCallback) {
317 invokeCallback = children;
318 callback = callback(invokeCallback);
319 var childKey =
320 "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
321 isArrayImpl(callback)
322 ? ((escapedPrefix = ""),
323 null != childKey &&
324 (escapedPrefix =
325 childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),
326 mapIntoArray(callback, array, escapedPrefix, "", function (c) {
327 return c;
328 }))
329 : null != callback &&
330 (isValidElement(callback) &&
331 (null != callback.key &&
332 ((invokeCallback && invokeCallback.key === callback.key) ||
333 checkKeyStringCoercion(callback.key)),
334 (escapedPrefix = cloneAndReplaceKey(
335 callback,
336 escapedPrefix +
337 (null == callback.key ||
338 (invokeCallback && invokeCallback.key === callback.key)
339 ? ""
340 : ("" + callback.key).replace(
341 userProvidedKeyEscapeRegex,
342 "$&/"
343 ) + "/") +
344 childKey
345 )),
346 "" !== nameSoFar &&
347 null != invokeCallback &&
348 isValidElement(invokeCallback) &&
349 null == invokeCallback.key &&
350 invokeCallback._store &&
351 !invokeCallback._store.validated &&
352 (escapedPrefix._store.validated = 2),
353 (callback = escapedPrefix)),
354 array.push(callback));
355 return 1;
356 }
357 invokeCallback = 0;
358 childKey = "" === nameSoFar ? "." : nameSoFar + ":";
359 if (isArrayImpl(children))
360 for (var i = 0; i < children.length; i++)
361 (nameSoFar = children[i]),
362 (type = childKey + getElementKey(nameSoFar, i)),
363 (invokeCallback += mapIntoArray(
364 nameSoFar,
365 array,
366 escapedPrefix,
367 type,
368 callback
369 ));
370 else if (((i = getIteratorFn(children)), "function" === typeof i))
371 for (
372 i === children.entries &&
373 (didWarnAboutMaps ||
374 console.warn(
375 "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
376 ),
377 (didWarnAboutMaps = !0)),
378 children = i.call(children),
379 i = 0;
380 !(nameSoFar = children.next()).done;
381
382 )
383 (nameSoFar = nameSoFar.value),
384 (type = childKey + getElementKey(nameSoFar, i++)),
385 (invokeCallback += mapIntoArray(
386 nameSoFar,
387 array,
388 escapedPrefix,
389 type,
390 callback
391 ));
392 else if ("object" === type) {
393 if ("function" === typeof children.then)
394 return mapIntoArray(
395 resolveThenable(children),
396 array,
397 escapedPrefix,
398 nameSoFar,
399 callback
400 );
401 array = String(children);
402 throw Error(
403 "Objects are not valid as a React child (found: " +
404 ("[object Object]" === array
405 ? "object with keys {" + Object.keys(children).join(", ") + "}"
406 : array) +
407 "). If you meant to render a collection of children, use an array instead."
408 );
409 }
410 return invokeCallback;
411 }
412 function mapChildren(children, func, context) {
413 if (null == children) return children;
414 var result = [],
415 count = 0;
416 mapIntoArray(children, result, "", "", function (child) {
417 return func.call(context, child, count++);
418 });
419 return result;
420 }
421 function resolveDispatcher() {
422 var dispatcher = ReactSharedInternals.H;
423 null === dispatcher &&
424 console.error(
425 "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
426 );
427 return dispatcher;
428 }
429 function lazyInitializer(payload) {
430 if (-1 === payload._status) {
431 var ctor = payload._result;
432 ctor = ctor();
433 ctor.then(
434 function (moduleObject) {
435 if (0 === payload._status || -1 === payload._status)
436 (payload._status = 1), (payload._result = moduleObject);
437 },
438 function (error) {
439 if (0 === payload._status || -1 === payload._status)
440 (payload._status = 2), (payload._result = error);
441 }
442 );
443 -1 === payload._status &&
444 ((payload._status = 0), (payload._result = ctor));
445 }
446 if (1 === payload._status)
447 return (
448 (ctor = payload._result),
449 void 0 === ctor &&
450 console.error(
451 "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
452 ctor
453 ),
454 "default" in ctor ||
455 console.error(
456 "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
457 ctor
458 ),
459 ctor.default
460 );
461 throw payload._result;
462 }
463 function createCacheRoot() {
464 return new WeakMap();
465 }
466 function createCacheNode() {
467 return { s: 0, v: void 0, o: null, p: null };
468 }
469 var ReactSharedInternals = {
470 H: null,
471 A: null,
472 getCurrentStack: null,
473 recentlyCreatedOwnerStacks: 0
474 },
475 isArrayImpl = Array.isArray,
476 REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
477 REACT_PORTAL_TYPE = Symbol.for("react.portal"),
478 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
479 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
480 REACT_PROFILER_TYPE = Symbol.for("react.profiler");
481 Symbol.for("react.provider");
482 var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
483 REACT_CONTEXT_TYPE = Symbol.for("react.context"),
484 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
485 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
486 REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
487 REACT_MEMO_TYPE = Symbol.for("react.memo"),
488 REACT_LAZY_TYPE = Symbol.for("react.lazy"),
489 REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
490 MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
491 REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
492 hasOwnProperty = Object.prototype.hasOwnProperty,
493 assign = Object.assign,
494 createTask = console.createTask
495 ? console.createTask
496 : function () {
497 return null;
498 },
499 createFakeCallStack = {
500 react_stack_bottom_frame: function (callStackForError) {
501 return callStackForError();
502 }
503 },
504 specialPropKeyWarningShown,
505 didWarnAboutOldJSXRuntime;
506 var didWarnAboutElementRef = {};
507 var unknownOwnerDebugStack =
508 createFakeCallStack.react_stack_bottom_frame.bind(
509 createFakeCallStack,
510 UnknownOwner
511 )();
512 var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
513 var didWarnAboutMaps = !1,
514 userProvidedKeyEscapeRegex = /\/+/g;
515 exports.Children = {
516 map: mapChildren,
517 forEach: function (children, forEachFunc, forEachContext) {
518 mapChildren(
519 children,
520 function () {
521 forEachFunc.apply(this, arguments);
522 },
523 forEachContext
524 );
525 },
526 count: function (children) {
527 var n = 0;
528 mapChildren(children, function () {
529 n++;
530 });
531 return n;
532 },
533 toArray: function (children) {
534 return (
535 mapChildren(children, function (child) {
536 return child;
537 }) || []
538 );
539 },
540 only: function (children) {
541 if (!isValidElement(children))
542 throw Error(
543 "React.Children.only expected to receive a single React element child."
544 );
545 return children;
546 }
547 };
548 exports.Fragment = REACT_FRAGMENT_TYPE;
549 exports.Profiler = REACT_PROFILER_TYPE;
550 exports.StrictMode = REACT_STRICT_MODE_TYPE;
551 exports.Suspense = REACT_SUSPENSE_TYPE;
552 exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
553 ReactSharedInternals;
554 exports.cache = function (fn) {
555 return function () {
556 var dispatcher = ReactSharedInternals.A;
557 if (!dispatcher) return fn.apply(null, arguments);
558 var fnMap = dispatcher.getCacheForType(createCacheRoot);
559 dispatcher = fnMap.get(fn);
560 void 0 === dispatcher &&
561 ((dispatcher = createCacheNode()), fnMap.set(fn, dispatcher));
562 fnMap = 0;
563 for (var l = arguments.length; fnMap < l; fnMap++) {
564 var arg = arguments[fnMap];
565 if (
566 "function" === typeof arg ||
567 ("object" === typeof arg && null !== arg)
568 ) {
569 var objectCache = dispatcher.o;
570 null === objectCache &&
571 (dispatcher.o = objectCache = new WeakMap());
572 dispatcher = objectCache.get(arg);
573 void 0 === dispatcher &&
574 ((dispatcher = createCacheNode()),
575 objectCache.set(arg, dispatcher));
576 } else
577 (objectCache = dispatcher.p),
578 null === objectCache && (dispatcher.p = objectCache = new Map()),
579 (dispatcher = objectCache.get(arg)),
580 void 0 === dispatcher &&
581 ((dispatcher = createCacheNode()),
582 objectCache.set(arg, dispatcher));
583 }
584 if (1 === dispatcher.s) return dispatcher.v;
585 if (2 === dispatcher.s) throw dispatcher.v;
586 try {
587 var result = fn.apply(null, arguments);
588 fnMap = dispatcher;
589 fnMap.s = 1;
590 return (fnMap.v = result);
591 } catch (error) {
592 throw (
593 ((result = dispatcher), (result.s = 2), (result.v = error), error)
594 );
595 }
596 };
597 };
598 exports.captureOwnerStack = function () {
599 var getCurrentStack = ReactSharedInternals.getCurrentStack;
600 return null === getCurrentStack ? null : getCurrentStack();
601 };
602 exports.cloneElement = function (element, config, children) {
603 if (null === element || void 0 === element)
604 throw Error(
605 "The argument must be a React element, but you passed " +
606 element +
607 "."
608 );
609 var props = assign({}, element.props),
610 key = element.key,
611 owner = element._owner;
612 if (null != config) {
613 var JSCompiler_inline_result;
614 a: {
615 if (
616 hasOwnProperty.call(config, "ref") &&
617 (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
618 config,
619 "ref"
620 ).get) &&
621 JSCompiler_inline_result.isReactWarning
622 ) {
623 JSCompiler_inline_result = !1;
624 break a;
625 }
626 JSCompiler_inline_result = void 0 !== config.ref;
627 }
628 JSCompiler_inline_result && (owner = getOwner());
629 hasValidKey(config) &&
630 (checkKeyStringCoercion(config.key), (key = "" + config.key));
631 for (propName in config)
632 !hasOwnProperty.call(config, propName) ||
633 "key" === propName ||
634 "__self" === propName ||
635 "__source" === propName ||
636 ("ref" === propName && void 0 === config.ref) ||
637 (props[propName] = config[propName]);
638 }
639 var propName = arguments.length - 2;
640 if (1 === propName) props.children = children;
641 else if (1 < propName) {
642 JSCompiler_inline_result = Array(propName);
643 for (var i = 0; i < propName; i++)
644 JSCompiler_inline_result[i] = arguments[i + 2];
645 props.children = JSCompiler_inline_result;
646 }
647 props = ReactElement(
648 element.type,
649 key,
650 void 0,
651 void 0,
652 owner,
653 props,
654 element._debugStack,
655 element._debugTask
656 );
657 for (key = 2; key < arguments.length; key++)
658 (owner = arguments[key]),
659 isValidElement(owner) && owner._store && (owner._store.validated = 1);
660 return props;
661 };
662 exports.createElement = function (type, config, children) {
663 for (var i = 2; i < arguments.length; i++) {
664 var node = arguments[i];
665 isValidElement(node) && node._store && (node._store.validated = 1);
666 }
667 i = {};
668 node = null;
669 if (null != config)
670 for (propName in (didWarnAboutOldJSXRuntime ||
671 !("__self" in config) ||
672 "key" in config ||
673 ((didWarnAboutOldJSXRuntime = !0),
674 console.warn(
675 "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
676 )),
677 hasValidKey(config) &&
678 (checkKeyStringCoercion(config.key), (node = "" + config.key)),
679 config))
680 hasOwnProperty.call(config, propName) &&
681 "key" !== propName &&
682 "__self" !== propName &&
683 "__source" !== propName &&
684 (i[propName] = config[propName]);
685 var childrenLength = arguments.length - 2;
686 if (1 === childrenLength) i.children = children;
687 else if (1 < childrenLength) {
688 for (
689 var childArray = Array(childrenLength), _i = 0;
690 _i < childrenLength;
691 _i++
692 )
693 childArray[_i] = arguments[_i + 2];
694 Object.freeze && Object.freeze(childArray);
695 i.children = childArray;
696 }
697 if (type && type.defaultProps)
698 for (propName in ((childrenLength = type.defaultProps), childrenLength))
699 void 0 === i[propName] && (i[propName] = childrenLength[propName]);
700 node &&
701 defineKeyPropWarningGetter(
702 i,
703 "function" === typeof type
704 ? type.displayName || type.name || "Unknown"
705 : type
706 );
707 var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
708 return ReactElement(
709 type,
710 node,
711 void 0,
712 void 0,
713 getOwner(),
714 i,
715 propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
716 propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
717 );
718 };
719 exports.createRef = function () {
720 var refObject = { current: null };
721 Object.seal(refObject);
722 return refObject;
723 };
724 exports.forwardRef = function (render) {
725 null != render && render.$$typeof === REACT_MEMO_TYPE
726 ? console.error(
727 "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
728 )
729 : "function" !== typeof render
730 ? console.error(
731 "forwardRef requires a render function but was given %s.",
732 null === render ? "null" : typeof render
733 )
734 : 0 !== render.length &&
735 2 !== render.length &&
736 console.error(
737 "forwardRef render functions accept exactly two parameters: props and ref. %s",
738 1 === render.length
739 ? "Did you forget to use the ref parameter?"
740 : "Any additional parameter will be undefined."
741 );
742 null != render &&
743 null != render.defaultProps &&
744 console.error(
745 "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
746 );
747 var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },
748 ownName;
749 Object.defineProperty(elementType, "displayName", {
750 enumerable: !1,
751 configurable: !0,
752 get: function () {
753 return ownName;
754 },
755 set: function (name) {
756 ownName = name;
757 render.name ||
758 render.displayName ||
759 (Object.defineProperty(render, "name", { value: name }),
760 (render.displayName = name));
761 }
762 });
763 return elementType;
764 };
765 exports.isValidElement = isValidElement;
766 exports.lazy = function (ctor) {
767 return {
768 $$typeof: REACT_LAZY_TYPE,
769 _payload: { _status: -1, _result: ctor },
770 _init: lazyInitializer
771 };
772 };
773 exports.memo = function (type, compare) {
774 null == type &&
775 console.error(
776 "memo: The first argument must be a component. Instead received: %s",
777 null === type ? "null" : typeof type
778 );
779 compare = {
780 $$typeof: REACT_MEMO_TYPE,
781 type: type,
782 compare: void 0 === compare ? null : compare
783 };
784 var ownName;
785 Object.defineProperty(compare, "displayName", {
786 enumerable: !1,
787 configurable: !0,
788 get: function () {
789 return ownName;
790 },
791 set: function (name) {
792 ownName = name;
793 type.name ||
794 type.displayName ||
795 (Object.defineProperty(type, "name", { value: name }),
796 (type.displayName = name));
797 }
798 });
799 return compare;
800 };
801 exports.use = function (usable) {
802 return resolveDispatcher().use(usable);
803 };
804 exports.useCallback = function (callback, deps) {
805 return resolveDispatcher().useCallback(callback, deps);
806 };
807 exports.useDebugValue = function (value, formatterFn) {
808 return resolveDispatcher().useDebugValue(value, formatterFn);
809 };
810 exports.useId = function () {
811 return resolveDispatcher().useId();
812 };
813 exports.useMemo = function (create, deps) {
814 return resolveDispatcher().useMemo(create, deps);
815 };
816 exports.version = "19.1.1";
817 })();