react-dom.production.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /**
  2. * @license React
  3. * react-dom.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 formatProdErrorMessage(code) {
  13. var url = "https://react.dev/errors/" + code;
  14. if (1 < arguments.length) {
  15. url += "?args[]=" + encodeURIComponent(arguments[1]);
  16. for (var i = 2; i < arguments.length; i++)
  17. url += "&args[]=" + encodeURIComponent(arguments[i]);
  18. }
  19. return (
  20. "Minified React error #" +
  21. code +
  22. "; visit " +
  23. url +
  24. " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."
  25. );
  26. }
  27. function noop() {}
  28. var Internals = {
  29. d: {
  30. f: noop,
  31. r: function () {
  32. throw Error(formatProdErrorMessage(522));
  33. },
  34. D: noop,
  35. C: noop,
  36. L: noop,
  37. m: noop,
  38. X: noop,
  39. S: noop,
  40. M: noop
  41. },
  42. p: 0,
  43. findDOMNode: null
  44. },
  45. REACT_PORTAL_TYPE = Symbol.for("react.portal");
  46. function createPortal$1(children, containerInfo, implementation) {
  47. var key =
  48. 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
  49. return {
  50. $$typeof: REACT_PORTAL_TYPE,
  51. key: null == key ? null : "" + key,
  52. children: children,
  53. containerInfo: containerInfo,
  54. implementation: implementation
  55. };
  56. }
  57. var ReactSharedInternals =
  58. React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
  59. function getCrossOriginStringAs(as, input) {
  60. if ("font" === as) return "";
  61. if ("string" === typeof input)
  62. return "use-credentials" === input ? input : "";
  63. }
  64. exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =
  65. Internals;
  66. exports.createPortal = function (children, container) {
  67. var key =
  68. 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
  69. if (
  70. !container ||
  71. (1 !== container.nodeType &&
  72. 9 !== container.nodeType &&
  73. 11 !== container.nodeType)
  74. )
  75. throw Error(formatProdErrorMessage(299));
  76. return createPortal$1(children, container, null, key);
  77. };
  78. exports.flushSync = function (fn) {
  79. var previousTransition = ReactSharedInternals.T,
  80. previousUpdatePriority = Internals.p;
  81. try {
  82. if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();
  83. } finally {
  84. (ReactSharedInternals.T = previousTransition),
  85. (Internals.p = previousUpdatePriority),
  86. Internals.d.f();
  87. }
  88. };
  89. exports.preconnect = function (href, options) {
  90. "string" === typeof href &&
  91. (options
  92. ? ((options = options.crossOrigin),
  93. (options =
  94. "string" === typeof options
  95. ? "use-credentials" === options
  96. ? options
  97. : ""
  98. : void 0))
  99. : (options = null),
  100. Internals.d.C(href, options));
  101. };
  102. exports.prefetchDNS = function (href) {
  103. "string" === typeof href && Internals.d.D(href);
  104. };
  105. exports.preinit = function (href, options) {
  106. if ("string" === typeof href && options && "string" === typeof options.as) {
  107. var as = options.as,
  108. crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),
  109. integrity =
  110. "string" === typeof options.integrity ? options.integrity : void 0,
  111. fetchPriority =
  112. "string" === typeof options.fetchPriority
  113. ? options.fetchPriority
  114. : void 0;
  115. "style" === as
  116. ? Internals.d.S(
  117. href,
  118. "string" === typeof options.precedence ? options.precedence : void 0,
  119. {
  120. crossOrigin: crossOrigin,
  121. integrity: integrity,
  122. fetchPriority: fetchPriority
  123. }
  124. )
  125. : "script" === as &&
  126. Internals.d.X(href, {
  127. crossOrigin: crossOrigin,
  128. integrity: integrity,
  129. fetchPriority: fetchPriority,
  130. nonce: "string" === typeof options.nonce ? options.nonce : void 0
  131. });
  132. }
  133. };
  134. exports.preinitModule = function (href, options) {
  135. if ("string" === typeof href)
  136. if ("object" === typeof options && null !== options) {
  137. if (null == options.as || "script" === options.as) {
  138. var crossOrigin = getCrossOriginStringAs(
  139. options.as,
  140. options.crossOrigin
  141. );
  142. Internals.d.M(href, {
  143. crossOrigin: crossOrigin,
  144. integrity:
  145. "string" === typeof options.integrity ? options.integrity : void 0,
  146. nonce: "string" === typeof options.nonce ? options.nonce : void 0
  147. });
  148. }
  149. } else null == options && Internals.d.M(href);
  150. };
  151. exports.preload = function (href, options) {
  152. if (
  153. "string" === typeof href &&
  154. "object" === typeof options &&
  155. null !== options &&
  156. "string" === typeof options.as
  157. ) {
  158. var as = options.as,
  159. crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
  160. Internals.d.L(href, as, {
  161. crossOrigin: crossOrigin,
  162. integrity:
  163. "string" === typeof options.integrity ? options.integrity : void 0,
  164. nonce: "string" === typeof options.nonce ? options.nonce : void 0,
  165. type: "string" === typeof options.type ? options.type : void 0,
  166. fetchPriority:
  167. "string" === typeof options.fetchPriority
  168. ? options.fetchPriority
  169. : void 0,
  170. referrerPolicy:
  171. "string" === typeof options.referrerPolicy
  172. ? options.referrerPolicy
  173. : void 0,
  174. imageSrcSet:
  175. "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
  176. imageSizes:
  177. "string" === typeof options.imageSizes ? options.imageSizes : void 0,
  178. media: "string" === typeof options.media ? options.media : void 0
  179. });
  180. }
  181. };
  182. exports.preloadModule = function (href, options) {
  183. if ("string" === typeof href)
  184. if (options) {
  185. var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
  186. Internals.d.m(href, {
  187. as:
  188. "string" === typeof options.as && "script" !== options.as
  189. ? options.as
  190. : void 0,
  191. crossOrigin: crossOrigin,
  192. integrity:
  193. "string" === typeof options.integrity ? options.integrity : void 0
  194. });
  195. } else Internals.d.m(href);
  196. };
  197. exports.requestFormReset = function (form) {
  198. Internals.d.r(form);
  199. };
  200. exports.unstable_batchedUpdates = function (fn, a) {
  201. return fn(a);
  202. };
  203. exports.useFormState = function (action, initialState, permalink) {
  204. return ReactSharedInternals.H.useFormState(action, initialState, permalink);
  205. };
  206. exports.useFormStatus = function () {
  207. return ReactSharedInternals.H.useHostTransitionStatus();
  208. };
  209. exports.version = "19.2.4";