react-dom.react-server.production.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /**
  2. * @license React
  3. * react-dom.react-server.production.js
  4. *
  5. * Copyright (c) Meta Platforms, Inc. and affiliates.
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE file in the root directory of this source tree.
  9. */
  10. "use strict";
  11. var React = require("react");
  12. function noop() {}
  13. var Internals = {
  14. d: {
  15. f: noop,
  16. r: function () {
  17. throw Error(
  18. "Invalid form element. requestFormReset must be passed a form that was rendered by React."
  19. );
  20. },
  21. D: noop,
  22. C: noop,
  23. L: noop,
  24. m: noop,
  25. X: noop,
  26. S: noop,
  27. M: noop
  28. },
  29. p: 0,
  30. findDOMNode: null
  31. };
  32. if (!React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)
  33. throw Error(
  34. 'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
  35. );
  36. function getCrossOriginStringAs(as, input) {
  37. if ("font" === as) return "";
  38. if ("string" === typeof input)
  39. return "use-credentials" === input ? input : "";
  40. }
  41. exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
  42. Internals;
  43. exports.preconnect = function (href, options) {
  44. "string" === typeof href &&
  45. (options
  46. ? ((options = options.crossOrigin),
  47. (options =
  48. "string" === typeof options
  49. ? "use-credentials" === options
  50. ? options
  51. : ""
  52. : void 0))
  53. : (options = null),
  54. Internals.d.C(href, options));
  55. };
  56. exports.prefetchDNS = function (href) {
  57. "string" === typeof href && Internals.d.D(href);
  58. };
  59. exports.preinit = function (href, options) {
  60. if ("string" === typeof href && options && "string" === typeof options.as) {
  61. var as = options.as,
  62. crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
  63. integrity =
  64. "string" === typeof options.integrity ? options.integrity : void 0,
  65. fetchPriority =
  66. "string" === typeof options.fetchPriority
  67. ? options.fetchPriority
  68. : void 0;
  69. "style" === as
  70. ? Internals.d.S(
  71. href,
  72. "string" === typeof options.precedence ? options.precedence : void 0,
  73. {
  74. crossOrigin: crossOrigin,
  75. integrity: integrity,
  76. fetchPriority: fetchPriority
  77. }
  78. )
  79. : "script" === as &&
  80. Internals.d.X(href, {
  81. crossOrigin: crossOrigin,
  82. integrity: integrity,
  83. fetchPriority: fetchPriority,
  84. nonce: "string" === typeof options.nonce ? options.nonce : void 0
  85. });
  86. }
  87. };
  88. exports.preinitModule = function (href, options) {
  89. if ("string" === typeof href)
  90. if ("object" === typeof options && null !== options) {
  91. if (null == options.as || "script" === options.as) {
  92. var crossOrigin = getCrossOriginStringAs(
  93. options.as,
  94. options.crossOrigin
  95. );
  96. Internals.d.M(href, {
  97. crossOrigin: crossOrigin,
  98. integrity:
  99. "string" === typeof options.integrity ? options.integrity : void 0,
  100. nonce: "string" === typeof options.nonce ? options.nonce : void 0
  101. });
  102. }
  103. } else null == options && Internals.d.M(href);
  104. };
  105. exports.preload = function (href, options) {
  106. if (
  107. "string" === typeof href &&
  108. "object" === typeof options &&
  109. null !== options &&
  110. "string" === typeof options.as
  111. ) {
  112. var as = options.as,
  113. crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
  114. Internals.d.L(href, as, {
  115. crossOrigin: crossOrigin,
  116. integrity:
  117. "string" === typeof options.integrity ? options.integrity : void 0,
  118. nonce: "string" === typeof options.nonce ? options.nonce : void 0,
  119. type: "string" === typeof options.type ? options.type : void 0,
  120. fetchPriority:
  121. "string" === typeof options.fetchPriority
  122. ? options.fetchPriority
  123. : void 0,
  124. referrerPolicy:
  125. "string" === typeof options.referrerPolicy
  126. ? options.referrerPolicy
  127. : void 0,
  128. imageSrcSet:
  129. "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
  130. imageSizes:
  131. "string" === typeof options.imageSizes ? options.imageSizes : void 0,
  132. media: "string" === typeof options.media ? options.media : void 0
  133. });
  134. }
  135. };
  136. exports.preloadModule = function (href, options) {
  137. if ("string" === typeof href)
  138. if (options) {
  139. var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
  140. Internals.d.m(href, {
  141. as:
  142. "string" === typeof options.as && "script" !== options.as
  143. ? options.as
  144. : void 0,
  145. crossOrigin: crossOrigin,
  146. integrity:
  147. "string" === typeof options.integrity ? options.integrity : void 0
  148. });
  149. } else Internals.d.m(href);
  150. };
  151. exports.version = "19.2.4";