From f7e4eb83694aa007a492ef66c28ffbe6a2dae791 Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Tue, 7 Mar 2023 12:22:34 -0800 Subject: Reorganize tests (#2332) --- .../third_party/react-dom/react-dom-server.bun.cjs | 2670 ++++++++++++++++++++ 1 file changed, 2670 insertions(+) create mode 100644 test/js/third_party/react-dom/react-dom-server.bun.cjs (limited to 'test/js/third_party/react-dom/react-dom-server.bun.cjs') diff --git a/test/js/third_party/react-dom/react-dom-server.bun.cjs b/test/js/third_party/react-dom/react-dom-server.bun.cjs new file mode 100644 index 000000000..f67e54a8c --- /dev/null +++ b/test/js/third_party/react-dom/react-dom-server.bun.cjs @@ -0,0 +1,2670 @@ +/** + * @license React + * react-dom-server.bun.production.min.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var ba = require("react"), + ca = require("react-dom"); +function l(a, b) { + 0 !== b.length && a.write(b); +} +function da(a, b) { + "function" === typeof a.error ? a.error(b) : a.close(); +} +var r = Object.prototype.hasOwnProperty, + ea = + /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, + fa = {}, + ha = {}; +function ia(a) { + if (r.call(ha, a)) return !0; + if (r.call(fa, a)) return !1; + if (ea.test(a)) return (ha[a] = !0); + fa[a] = !0; + return !1; +} +function t(a, b, c, d, e, f, g) { + this.acceptsBooleans = 2 === b || 3 === b || 4 === b; + this.attributeName = d; + this.attributeNamespace = e; + this.mustUseProperty = c; + this.propertyName = a; + this.type = b; + this.sanitizeURL = f; + this.removeEmptyString = g; +} +var v = {}, + ja = + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split( + " ", + ); +ja.push("innerText", "textContent"); +ja.forEach(function (a) { + v[a] = new t(a, 0, !1, a, null, !1, !1); +}); +[ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], +].forEach(function (a) { + var b = a[0]; + v[b] = new t(b, 1, !1, a[1], null, !1, !1); +}); +["contentEditable", "draggable", "spellCheck", "value"].forEach(function (a) { + v[a] = new t(a, 2, !1, a.toLowerCase(), null, !1, !1); +}); +["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function (a) { + v[a] = new t(a, 2, !1, a, null, !1, !1); +}); +"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope" + .split(" ") + .forEach(function (a) { + v[a] = new t(a, 3, !1, a.toLowerCase(), null, !1, !1); + }); +["checked", "multiple", "muted", "selected"].forEach(function (a) { + v[a] = new t(a, 3, !0, a, null, !1, !1); +}); +["capture", "download"].forEach(function (a) { + v[a] = new t(a, 4, !1, a, null, !1, !1); +}); +["cols", "rows", "size", "span"].forEach(function (a) { + v[a] = new t(a, 6, !1, a, null, !1, !1); +}); +["rowSpan", "start"].forEach(function (a) { + v[a] = new t(a, 5, !1, a.toLowerCase(), null, !1, !1); +}); +var ka = /[\-:]([a-z])/g; +function la(a) { + return a[1].toUpperCase(); +} +"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height" + .split(" ") + .forEach(function (a) { + var b = a.replace(ka, la); + v[b] = new t(b, 1, !1, a, null, !1, !1); + }); +"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function (a) { + var b = a.replace(ka, la); + v[b] = new t(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1, !1); +}); +["xml:base", "xml:lang", "xml:space"].forEach(function (a) { + var b = a.replace(ka, la); + v[b] = new t(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1, !1); +}); +["tabIndex", "crossOrigin"].forEach(function (a) { + v[a] = new t(a, 1, !1, a.toLowerCase(), null, !1, !1); +}); +v.xlinkHref = new t("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1); +["src", "href", "action", "formAction"].forEach(function (a) { + v[a] = new t(a, 1, !1, a.toLowerCase(), null, !0, !0); +}); +var ma = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0, + }, + na = ["Webkit", "ms", "Moz", "O"]; +Object.keys(ma).forEach(function (a) { + na.forEach(function (b) { + b = b + a.charAt(0).toUpperCase() + a.substring(1); + ma[b] = ma[a]; + }); +}); +var oa = /["'&<>]/; +function w(a) { + if ("boolean" === typeof a || "number" === typeof a) return "" + a; + a = "" + a; + var b = oa.exec(a); + if (b) { + var c = "", + d, + e = 0; + for (d = b.index; d < a.length; d++) { + switch (a.charCodeAt(d)) { + case 34: + b = """; + break; + case 38: + b = "&"; + break; + case 39: + b = "'"; + break; + case 60: + b = "<"; + break; + case 62: + b = ">"; + break; + default: + continue; + } + e !== d && (c += a.substring(e, d)); + e = d + 1; + c += b; + } + a = e !== d ? c + a.substring(e, d) : c; + } + return a; +} +var pa = /([A-Z])/g, + qa = /^ms-/, + ra = Array.isArray, + x = Object.assign, + y = null, + sa = [], + va = { preload: ta, preinit: ua }; +function ta(a, b) { + if (y) { + var c = y; + if ("string" === typeof a && a && "object" === typeof b && null !== b) { + var d = b.as, + e = c.preloadsMap.get(a); + e || + (e = z(c, a, d, { + href: a, + rel: "preload", + as: d, + crossOrigin: "font" === d ? "" : b.crossOrigin, + integrity: b.integrity, + })); + switch (d) { + case "font": + c.fontPreloads.add(e); + break; + case "style": + c.explicitStylePreloads.add(e); + break; + case "script": + c.explicitScriptPreloads.add(e); + } + } + } +} +function ua(a, b) { + if (y) { + var c = y; + if ("string" === typeof a && a && "object" === typeof b && null !== b) + switch (b.as) { + case "style": + var d = c.stylesMap.get(a); + d || + ((d = b.precedence || "default"), + (d = wa(c, a, d, { + rel: "stylesheet", + href: a, + "data-precedence": d, + crossOrigin: b.crossOrigin, + }))); + d.set.add(d); + c.explicitStylePreloads.add(d.hint); + break; + case "script": + (d = c.scriptsMap.get(a)), + d || + ((d = xa(c, a, { + src: a, + async: !0, + crossOrigin: b.crossOrigin, + integrity: b.integrity, + })), + c.scripts.add(d)); + } + } +} +function ya(a, b) { + return { + rel: "preload", + as: "style", + href: a, + crossOrigin: b.crossOrigin, + integrity: b.integrity, + media: b.media, + hrefLang: b.hrefLang, + referrerPolicy: b.referrerPolicy, + }; +} +function za(a, b) { + return { + rel: "preload", + as: "script", + href: a, + crossOrigin: b.crossOrigin, + integrity: b.integrity, + referrerPolicy: b.referrerPolicy, + }; +} +function z(a, b, c, d) { + c = { type: "preload", as: c, href: b, flushed: !1, props: d }; + a.preloadsMap.set(b, c); + return c; +} +function wa(a, b, c, d) { + var e = a.stylesMap, + f = a.preloadsMap, + g = a.precedences, + h = g.get(c); + h || ((h = new Set()), g.set(c, h)); + (f = f.get(b)) + ? ((a = f.props), + null == d.crossOrigin && (d.crossOrigin = a.crossOrigin), + null == d.referrerPolicy && (d.referrerPolicy = a.referrerPolicy), + null == d.title && (d.title = a.title)) + : ((f = ya(b, d)), (f = z(a, b, "style", f)), a.explicitStylePreloads.add(f)); + c = { + type: "style", + href: b, + precedence: c, + flushed: !1, + inShell: !1, + props: d, + hint: f, + set: h, + }; + e.set(b, c); + return c; +} +function xa(a, b, c) { + var d = a.scriptsMap, + e = a.preloadsMap.get(b); + e + ? ((a = e.props), + null == c.crossOrigin && (c.crossOrigin = a.crossOrigin), + null == c.referrerPolicy && (c.referrerPolicy = a.referrerPolicy), + null == c.integrity && (c.integrity = a.integrity)) + : ((e = za(b, c)), (e = z(a, b, "script", e)), a.explicitScriptPreloads.add(e)); + c = { type: "script", src: b, flushed: !1, props: c, hint: e }; + d.set(b, c); + return c; +} +function Aa(a, b) { + if (!y) throw Error('"currentResources" was expected to exist. This is a bug in React.'); + var c = y; + switch (a) { + case "title": + var d = b.children; + Array.isArray(d) && 1 === d.length && (d = d[0]); + if ("string" === typeof d || "number" === typeof d) { + var e = "title::" + d; + a = c.headsMap.get(e); + a || + ((b = x({}, b)), + (b.children = d), + (a = { type: "title", props: b, flushed: !1 }), + c.headsMap.set(e, a), + c.headResources.add(a)); + } + return !0; + case "meta": + if ("string" === typeof b.charSet) e = "charSet"; + else if ("string" === typeof b.content) + if (((a = "::" + b.content), "string" === typeof b.httpEquiv)) e = "httpEquiv::" + b.httpEquiv + a; + else if ("string" === typeof b.name) e = "name::" + b.name + a; + else if ("string" === typeof b.itemProp) e = "itemProp::" + b.itemProp + a; + else if ("string" === typeof b.property) { + var f = b.property; + e = "property::" + f + a; + d = f; + a = f.split(":").slice(0, -1).join(":"); + (a = c.structuredMetaKeys.get(a)) && (e = a.key + "::child::" + e); + } + e && + !c.headsMap.has(e) && + ((b = { type: "meta", key: e, props: x({}, b), flushed: !1 }), + c.headsMap.set(e, b), + "charSet" === e ? (c.charset = b) : (d && c.structuredMetaKeys.set(d, b), c.headResources.add(b))); + return !0; + case "base": + return ( + (e = b.target), + (d = b.href), + (e = + "base" + + ("string" === typeof d ? '[href="' + d + '"]' : ":not([href])") + + ("string" === typeof e ? '[target="' + e + '"]' : ":not([target])")), + c.headsMap.has(e) || + ((b = { type: "base", props: x({}, b), flushed: !1 }), c.headsMap.set(e, b), c.bases.add(b)), + !0 + ); + } + return !1; +} +function Ba(a) { + if (!y) throw Error('"currentResources" was expected to exist. This is a bug in React.'); + var b = y, + c = a.rel, + d = a.href; + if (!d || "string" !== typeof d || !c || "string" !== typeof c) return !1; + switch (c) { + case "stylesheet": + var e = a.onLoad, + f = a.onError; + c = a.precedence; + var g = a.disabled; + if ("string" !== typeof c || e || f || null != g) + return (c = b.preloadsMap.get(d)), c || ((c = z(b, d, "style", ya(d, a))), b.usedStylePreloads.add(c)), !1; + e = b.stylesMap.get(d); + e || + ((a = x({}, a)), + (a.href = d), + (a.rel = "stylesheet"), + (a["data-precedence"] = c), + delete a.precedence, + (e = wa(y, d, c, a)), + b.usedStylePreloads.add(e.hint)); + b.boundaryResources ? b.boundaryResources.add(e) : e.set.add(e); + return !0; + case "preload": + switch (((e = a.as), e)) { + case "script": + case "style": + case "font": + c = b.preloadsMap.get(d); + if (!c) + switch ( + ((a = x({}, a)), + (a.href = d), + (a.rel = "preload"), + (a.as = e), + "font" === e && (a.crossOrigin = ""), + (c = z(b, d, e, a)), + e) + ) { + case "script": + b.explicitScriptPreloads.add(c); + break; + case "style": + b.explicitStylePreloads.add(c); + break; + case "font": + b.fontPreloads.add(c); + } + return !0; + } + } + if (a.onLoad || a.onError) return !0; + d = + "rel:" + + c + + "::href:" + + d + + "::sizes:" + + ("string" === typeof a.sizes ? a.sizes : "") + + "::media:" + + ("string" === typeof a.media ? a.media : ""); + e = b.headsMap.get(d); + if (!e) + switch (((e = { type: "link", props: x({}, a), flushed: !1 }), b.headsMap.set(d, e), c)) { + case "preconnect": + case "dns-prefetch": + b.preconnects.add(e); + break; + default: + b.headResources.add(e); + } + return !0; +} +function Ca(a, b) { + var c = a.boundaryResources; + c && + (b.forEach(function (a) { + return c.add(a); + }), + b.clear()); +} +function Da(a, b) { + b.forEach(function (a) { + return a.set.add(a); + }); + b.clear(); +} +var Ea = ca.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher, + Fa = /(<\/|<)(s)(cript)/gi; +function Ga(a, b, c, d) { + return "" + b + ("s" === c ? "\\u0073" : "\\u0053") + d; +} +function Ha(a, b, c, d, e) { + a = void 0 === a ? "" : a; + b = void 0 === b ? "