diff --git a/package.json b/package.json index 04a4b81a16d9..75bf9e347f81 100644 --- a/package.json +++ b/package.json @@ -197,13 +197,11 @@ "random-seed": "0.3.0", "react": "18.2.0", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@18.3.0-next-b14f8da15-20230403", - "react-experimental-builtin": "npm:react@0.0.0-experimental-b14f8da15-20230403", + "react-builtin": "npm:react@18.3.0-next-85de6fde5-20230328", "react-dom": "18.2.0", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@18.3.0-next-b14f8da15-20230403", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-b14f8da15-20230403", - "react-server-dom-webpack": "18.3.0-next-b14f8da15-20230403", + "react-dom-builtin": "npm:react-dom@18.3.0-next-85de6fde5-20230328", + "react-server-dom-webpack": "18.3.0-next-85de6fde5-20230328", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -214,8 +212,6 @@ "rimraf": "3.0.2", "sass": "1.54.0", "satori": "0.4.4", - "scheduler-builtin": "npm:scheduler@0.24.0-next-b14f8da15-20230403", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-b14f8da15-20230403", "seedrandom": "3.0.5", "selenium-webdriver": "4.0.0-beta.4", "semver": "7.3.7", diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index d0d72b65de73..f22fdd1ff8fe 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -280,7 +280,6 @@ export default async function build( const publicDir = path.join(dir, 'public') const isAppDirEnabled = !!config.experimental.appDir - const useExperimentalReact = !!config.experimental.experimentalReact const initialRequireHookFilePath = require.resolve( 'next/dist/server/initialize-require-hook' ) @@ -290,9 +289,7 @@ export default async function build( ) if (isAppDirEnabled) { - process.env.NEXT_PREBUNDLED_REACT = useExperimentalReact - ? 'experimental' - : 'next' + process.env.NEXT_PREBUNDLED_REACT = '1' } await promises .writeFile( diff --git a/packages/next/src/build/webpack-config.ts b/packages/next/src/build/webpack-config.ts index 475f5b16d029..bb66db2c34a3 100644 --- a/packages/next/src/build/webpack-config.ts +++ b/packages/next/src/build/webpack-config.ts @@ -683,10 +683,8 @@ export default async function getBaseWebpackConfig( const hasAppDir = !!config.experimental.appDir && !!appDir const hasServerComponents = hasAppDir - const useExperimentalReact = !!config.experimental.experimentalReact const disableOptimizedLoading = true const enableTypedRoutes = !!config.experimental.typedRoutes && hasAppDir - const builtInReactChannel = useExperimentalReact ? '-experimental' : '' if (isClient) { if (isEdgeRuntime(config.experimental.runtime)) { @@ -694,11 +692,6 @@ export default async function getBaseWebpackConfig( 'You are using `experimental.runtime` which was removed. Check https://nextjs.org/docs/api-routes/edge-api-routes on how to use edge runtime.' ) } - if (useExperimentalReact && !hasAppDir) { - Log.warn( - 'You are using `experimental.experimentalReact` which requires `experimental.appDir` to be enabled.' - ) - } } const babelConfigFile = await getBabelConfigFile(dir) @@ -1032,11 +1025,13 @@ export default async function getBaseWebpackConfig( ? { // For react and react-dom, alias them dynamically for server layer // and others in the loaders configuration - 'react-dom/client$': `next/dist/compiled/react-dom${builtInReactChannel}/client`, - 'react-dom/server$': `next/dist/compiled/react-dom${builtInReactChannel}/server`, - 'react-dom/server.browser$': `next/dist/compiled/react-dom${builtInReactChannel}/server.browser`, - 'react/jsx-dev-runtime$': `next/dist/compiled/react${builtInReactChannel}/jsx-dev-runtime`, - 'react/jsx-runtime$': `next/dist/compiled/react${builtInReactChannel}/jsx-runtime`, + 'react-dom/client$': 'next/dist/compiled/react-dom/client', + 'react-dom/server$': 'next/dist/compiled/react-dom/server', + 'react-dom/server.browser$': + 'next/dist/compiled/react-dom/server.browser', + 'react/jsx-dev-runtime$': + 'next/dist/compiled/react/jsx-dev-runtime', + 'react/jsx-runtime$': 'next/dist/compiled/react/jsx-runtime', } : { react: reactDir, @@ -1238,17 +1233,11 @@ export default async function getBaseWebpackConfig( if (/^(react(?:$|\/)|react-dom(?:$|\/))/.test(request)) { // override react-dom to server-rendering-stub for server - const channel = useExperimentalReact ? '-experimental' : '' if ( request === 'react-dom' && (layer === WEBPACK_LAYERS.client || layer === WEBPACK_LAYERS.server) ) { - request = `react-dom${channel}/server-rendering-stub` - } else { - // `react` -> `react-experimental` - // `react-dom` -> `react-dom-experimental` - // `react/jsx-runtime` -> `react-experimental/jsx-runtime` - request = request.replace(/^(react|react-dom)/, (m) => m + channel) + request = 'react-dom/server-rendering-stub' } return `commonjs ${hasAppDir ? 'next/dist/compiled/' : ''}${request}` } @@ -1777,8 +1766,9 @@ export default async function getBaseWebpackConfig( // If missing the alias override here, the default alias will be used which aliases // react to the direct file path, not the package name. In that case the condition // will be ignored completely. - react: `next/dist/compiled/react${builtInReactChannel}/react.shared-subset`, - 'react-dom$': `next/dist/compiled/react-dom${builtInReactChannel}/server-rendering-stub`, + react: 'next/dist/compiled/react/react.shared-subset', + 'react-dom$': + 'next/dist/compiled/react-dom/server-rendering-stub', }, }, use: { @@ -1864,10 +1854,11 @@ export default async function getBaseWebpackConfig( // It needs `conditionNames` here to require the proper asset, // when react is acting as dependency of compiled/react-dom. alias: { - react: `next/dist/compiled/react${builtInReactChannel}/react.shared-subset`, + react: 'next/dist/compiled/react/react.shared-subset', // Use server rendering stub for RSC // x-ref: https://github.com/facebook/react/pull/25436 - 'react-dom$': `next/dist/compiled/react-dom${builtInReactChannel}/server-rendering-stub`, + 'react-dom$': + 'next/dist/compiled/react-dom/server-rendering-stub', }, }, }, @@ -1876,8 +1867,9 @@ export default async function getBaseWebpackConfig( test: codeCondition.test, resolve: { alias: { - react: `next/dist/compiled/react${builtInReactChannel}`, - 'react-dom$': `next/dist/compiled/react-dom${builtInReactChannel}/server-rendering-stub`, + react: 'next/dist/compiled/react', + 'react-dom$': + 'next/dist/compiled/react-dom/server-rendering-stub', }, }, }, @@ -1885,11 +1877,12 @@ export default async function getBaseWebpackConfig( test: codeCondition.test, resolve: { alias: { - react: `next/dist/compiled/react${builtInReactChannel}`, + react: 'next/dist/compiled/react', 'react-dom$': reactProductionProfiling - ? `next/dist/compiled/react-dom${builtInReactChannel}/cjs/react-dom.profiling.min` - : `next/dist/compiled/react-dom${builtInReactChannel}`, - 'react-dom/client$': `next/dist/compiled/react-dom${builtInReactChannel}/client`, + ? 'next/dist/compiled/react-dom/cjs/react-dom.profiling.min' + : 'next/dist/compiled/react-dom', + 'react-dom/client$': + 'next/dist/compiled/react-dom/client', }, }, }, diff --git a/packages/next/src/build/webpack/require-hook.ts b/packages/next/src/build/webpack/require-hook.ts index 2f357439027b..7d65d10b99cb 100644 --- a/packages/next/src/build/webpack/require-hook.ts +++ b/packages/next/src/build/webpack/require-hook.ts @@ -48,35 +48,31 @@ export function loadRequireHook(aliases: [string, string][] = []) { } export function overrideBuiltInReactPackages() { - const channel = - process.env.NEXT_PREBUNDLED_REACT === 'experimental' ? '-experimental' : '' setRequireOverrides([ - ['react', require.resolve(`next/dist/compiled/react${channel}`)], + ['react', require.resolve('next/dist/compiled/react')], [ 'react/jsx-runtime', - require.resolve(`next/dist/compiled/react${channel}/jsx-runtime`), + require.resolve('next/dist/compiled/react/jsx-runtime'), ], [ 'react/jsx-dev-runtime', - require.resolve(`next/dist/compiled/react${channel}/jsx-dev-runtime`), + require.resolve('next/dist/compiled/react/jsx-dev-runtime'), ], [ 'react-dom', - require.resolve( - `next/dist/compiled/react-dom${channel}/server-rendering-stub` - ), + require.resolve('next/dist/compiled/react-dom/server-rendering-stub'), ], [ 'react-dom/client', - require.resolve(`next/dist/compiled/react-dom${channel}/client`), + require.resolve('next/dist/compiled/react-dom/client'), ], [ 'react-dom/server', - require.resolve(`next/dist/compiled/react-dom${channel}/server`), + require.resolve('next/dist/compiled/react-dom/server'), ], [ 'react-dom/server.browser', - require.resolve(`next/dist/compiled/react-dom${channel}/server.browser`), + require.resolve('next/dist/compiled/react-dom/server.browser'), ], ]) } diff --git a/packages/next/src/compiled/react-dom-experimental/LICENSE b/packages/next/src/compiled/react-dom-experimental/LICENSE deleted file mode 100644 index b93be90515cc..000000000000 --- a/packages/next/src/compiled/react-dom-experimental/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Meta Platforms, Inc. and affiliates. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js deleted file mode 100644 index a46244711e68..000000000000 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ /dev/null @@ -1,9945 +0,0 @@ -/** - * @license React - * react-dom-server-legacy.browser.development.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'; - -if (process.env.NODE_ENV !== "production") { - (function() { -'use strict'; - -var React = require('react'); -var ReactDOM = require('react-dom'); - -var ReactVersion = '18.3.0-experimental-b14f8da15-20230403'; - -var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -// by calls to these methods by a Babel plugin. -// -// In PROD (or in packages without access to React internals), -// they are left as they are instead. - -function warn(format) { - { - { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } - } -} -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -function scheduleWork(callback) { - callback(); -} -function beginWriting(destination) {} -function writeChunk(destination, chunk) { - writeChunkAndReturn(destination, chunk); -} -function writeChunkAndReturn(destination, chunk) { - return destination.push(chunk); -} -function completeWriting(destination) {} -function close(destination) { - destination.push(null); -} -function stringToChunk(content) { - return content; -} -function stringToPrecomputedChunk(content) { - return content; -} -function clonePrecomputedChunk(chunk) { - return chunk; -} -function closeWithError(destination, error) { - // $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types. - destination.destroy(error); -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -var assign = Object.assign; - -/* - * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ -// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. -function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return] - - return type; - } -} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - - -function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } -} - -function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return '' + value; -} - -function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} - -// ----------------------------------------------------------------------------- -var enableFloat = true; - -// $FlowFixMe[method-unbinding] -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/* eslint-disable max-len */ - -var ATTRIBUTE_NAME_START_CHAR = ":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"; -/* eslint-enable max-len */ - -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - - { - error('Invalid attribute name: `%s`', attributeName); - } - - return false; -} - -// A simple string attribute. -// Attributes that aren't in the filter are presumed to have this type. -var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called -// "enumerated" attributes with "true" and "false" as possible values. -// When true, it should be set to a "true" string. -// When false, it should be set to a "false" string. - -var BOOLEANISH_STRING = 2; // A real boolean attribute. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. - -var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. -// For any other value, should be present with that value. - -var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. -// When falsy, it should be removed. - -var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. -// When falsy, it should be removed. - -var POSITIVE_NUMERIC = 6; -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} // $FlowFixMe[missing-this-annot] - -function PropertyInfoRecord(type, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.type = type; - this.sanitizeURL = sanitizeURL; - this.removeEmptyString = removeEmptyString; -} // When adding attributes to this list, be sure to also add them to -// the `possibleStandardNames` module to ensure casing and incorrect -// name warnings. - - -var properties = {}; // A few React string attributes have a different name. -// This is a mapping from React prop names to the attribute names. - -[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { - var name = _ref[0], - attributeName = _ref[1]; - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(STRING, attributeName, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" HTML attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). - -['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" SVG attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). -// Since these are SVG attributes, their attribute names are case-sensitive. - -['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML boolean attributes. - -['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM -// on the client side because the browsers are inconsistent. Instead we call focus(). -'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata -'itemScope'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEAN, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that are "overloaded booleans": they behave like -// booleans, but can also accept a string value. - -['capture', 'download' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(OVERLOADED_BOOLEAN, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be positive numbers. - -['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(POSITIVE_NUMERIC, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be numbers. - -['rowSpan', 'start'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(NUMERIC, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); -var CAMELIZE = /[\-\:]([a-z])/g; - -var capitalize = function (token) { - return token[1].toUpperCase(); -}; // This is a list of all SVG attributes that need special casing, namespacing, -// or boolean value assignment. Regular attributes that just accept strings -// and have the same names are omitted, just like in the HTML attribute filter. -// Some of these attributes can be hard to find. This list was created by -// scraping the MDN documentation. - - -['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', 'transform-origin', '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' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, null, // attributeNamespace - false, // sanitizeURL - false); -}); // String SVG attributes with the xlink namespace. - -['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL - false); -}); // String SVG attributes with the xml namespace. - -['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL - false); -}); // These attribute exists both in HTML and SVG. -// The attribute name is case-sensitive in SVG so we can't just use -// the React name like we do for attributes that exist only in HTML. - -['tabIndex', 'crossOrigin'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These attributes accept URLs. These must not allow javascript: URLS. -// These will also need to accept Trusted Types object in the future. - -var xlinkHref = 'xlinkHref'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[xlinkHref] = new PropertyInfoRecord(STRING, 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL -false); -var formAction = 'formAction'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[formAction] = new PropertyInfoRecord(STRING, 'formaction', // attributeName -null, // attributeNamespace -true, // sanitizeURL -false); -['src', 'href', 'action'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - true, // sanitizeURL - true); -}); - -/** - * CSS properties which accept numbers but are not in units of "px". - */ -function isUnitlessNumber (name) { - switch (name) { - case 'animationIterationCount': - case 'aspectRatio': - case 'borderImageOutset': - case 'borderImageSlice': - case 'borderImageWidth': - case 'boxFlex': - case 'boxFlexGroup': - case 'boxOrdinalGroup': - case 'columnCount': - case 'columns': - case 'flex': - case 'flexGrow': - case 'flexPositive': - case 'flexShrink': - case 'flexNegative': - case 'flexOrder': - case 'gridArea': - case 'gridRow': - case 'gridRowEnd': - case 'gridRowSpan': - case 'gridRowStart': - case 'gridColumn': - case 'gridColumnEnd': - case 'gridColumnSpan': - case 'gridColumnStart': - case 'fontWeight': - case 'lineClamp': - case 'lineHeight': - case 'opacity': - case 'order': - case 'orphans': - case 'scale': - case 'tabSize': - case 'widows': - case 'zIndex': - case 'zoom': - case 'fillOpacity': // SVG-related properties - - case 'floodOpacity': - case 'stopOpacity': - case 'strokeDasharray': - case 'strokeDashoffset': - case 'strokeMiterlimit': - case 'strokeOpacity': - case 'strokeWidth': - case 'MozAnimationIterationCount': // Known Prefixed Properties - - case 'MozBoxFlex': // TODO: Remove these since they shouldn't be used in modern code - - case 'MozBoxFlexGroup': - case 'MozLineClamp': - case 'msAnimationIterationCount': - case 'msFlex': - case 'msZoom': - case 'msFlexGrow': - case 'msFlexNegative': - case 'msFlexOrder': - case 'msFlexPositive': - case 'msFlexShrink': - case 'msGridColumn': - case 'msGridColumnSpan': - case 'msGridRow': - case 'msGridRowSpan': - case 'WebkitAnimationIterationCount': - case 'WebkitBoxFlex': - case 'WebKitBoxFlexGroup': - case 'WebkitBoxOrdinalGroup': - case 'WebkitColumnCount': - case 'WebkitColumns': - case 'WebkitFlex': - case 'WebkitFlexGrow': - case 'WebkitFlexPositive': - case 'WebkitFlexShrink': - case 'WebkitLineClamp': - return true; - - default: - return false; - } -} - -var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true -}; -function checkControlledValueProps(tagName, props) { - { - if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { - error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - - if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { - error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - } -} - -var ariaProperties = { - 'aria-current': 0, - // state - 'aria-description': 0, - 'aria-details': 0, - 'aria-disabled': 0, - // state - 'aria-hidden': 0, - // state - 'aria-invalid': 0, - // state - 'aria-keyshortcuts': 0, - 'aria-label': 0, - 'aria-roledescription': 0, - // Widget Attributes - 'aria-autocomplete': 0, - 'aria-checked': 0, - 'aria-expanded': 0, - 'aria-haspopup': 0, - 'aria-level': 0, - 'aria-modal': 0, - 'aria-multiline': 0, - 'aria-multiselectable': 0, - 'aria-orientation': 0, - 'aria-placeholder': 0, - 'aria-pressed': 0, - 'aria-readonly': 0, - 'aria-required': 0, - 'aria-selected': 0, - 'aria-sort': 0, - 'aria-valuemax': 0, - 'aria-valuemin': 0, - 'aria-valuenow': 0, - 'aria-valuetext': 0, - // Live Region Attributes - 'aria-atomic': 0, - 'aria-busy': 0, - 'aria-live': 0, - 'aria-relevant': 0, - // Drag-and-Drop Attributes - 'aria-dropeffect': 0, - 'aria-grabbed': 0, - // Relationship Attributes - 'aria-activedescendant': 0, - 'aria-colcount': 0, - 'aria-colindex': 0, - 'aria-colspan': 0, - 'aria-controls': 0, - 'aria-describedby': 0, - 'aria-errormessage': 0, - 'aria-flowto': 0, - 'aria-labelledby': 0, - 'aria-owns': 0, - 'aria-posinset': 0, - 'aria-rowcount': 0, - 'aria-rowindex': 0, - 'aria-rowspan': 0, - 'aria-setsize': 0 -}; - -var warnedProperties$1 = {}; -var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); -var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); - -function validateProperty$1(tagName, name) { - { - if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { - return true; - } - - if (rARIACamel$1.test(name)) { - var ariaName = 'aria-' + name.slice(4).toLowerCase(); - var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (correctName == null) { - error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); - - warnedProperties$1[name] = true; - return true; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== correctName) { - error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); - - warnedProperties$1[name] = true; - return true; - } - } - - if (rARIA$1.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (standardName == null) { - warnedProperties$1[name] = true; - return false; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== standardName) { - error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties$1[name] = true; - return true; - } - } - } - - return true; -} - -function validateProperties$2(type, props) { - { - var invalidProps = []; - - for (var key in props) { - var isValid = validateProperty$1(type, key); - - if (!isValid) { - invalidProps.push(key); - } - } - - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (invalidProps.length === 1) { - error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } else if (invalidProps.length > 1) { - error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } - } -} - -var didWarnValueNull = false; -function validateProperties$1(type, props) { - { - if (type !== 'input' && type !== 'textarea' && type !== 'select') { - return; - } - - if (props != null && props.value === null && !didWarnValueNull) { - didWarnValueNull = true; - - if (type === 'select' && props.multiple) { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); - } else { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); - } - } - } -} - -function isCustomElement(tagName, props) { - if (tagName.indexOf('-') === -1) { - return false; - } - - switch (tagName) { - // These are reserved SVG and MathML elements. - // We don't mind this list too much because we expect it to never grow. - // The alternative is to track the namespace in a few places which is convoluted. - // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts - case 'annotation-xml': - case 'color-profile': - case 'font-face': - case 'font-face-src': - case 'font-face-uri': - case 'font-face-format': - case 'font-face-name': - case 'missing-glyph': - return false; - - default: - return true; - } -} - -// When adding attributes to the HTML or SVG allowed attribute list, be sure to -// also add them to this module to ensure casing and incorrect name -// warnings. -var possibleStandardNames = { - // HTML - accept: 'accept', - acceptcharset: 'acceptCharset', - 'accept-charset': 'acceptCharset', - accesskey: 'accessKey', - action: 'action', - allowfullscreen: 'allowFullScreen', - alt: 'alt', - as: 'as', - async: 'async', - autocapitalize: 'autoCapitalize', - autocomplete: 'autoComplete', - autocorrect: 'autoCorrect', - autofocus: 'autoFocus', - autoplay: 'autoPlay', - autosave: 'autoSave', - capture: 'capture', - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing', - challenge: 'challenge', - charset: 'charSet', - checked: 'checked', - children: 'children', - cite: 'cite', - class: 'className', - classid: 'classID', - classname: 'className', - cols: 'cols', - colspan: 'colSpan', - content: 'content', - contenteditable: 'contentEditable', - contextmenu: 'contextMenu', - controls: 'controls', - controlslist: 'controlsList', - coords: 'coords', - crossorigin: 'crossOrigin', - dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', - data: 'data', - datetime: 'dateTime', - default: 'default', - defaultchecked: 'defaultChecked', - defaultvalue: 'defaultValue', - defer: 'defer', - dir: 'dir', - disabled: 'disabled', - disablepictureinpicture: 'disablePictureInPicture', - disableremoteplayback: 'disableRemotePlayback', - download: 'download', - draggable: 'draggable', - enctype: 'encType', - enterkeyhint: 'enterKeyHint', - fetchpriority: 'fetchPriority', - for: 'htmlFor', - form: 'form', - formmethod: 'formMethod', - formaction: 'formAction', - formenctype: 'formEncType', - formnovalidate: 'formNoValidate', - formtarget: 'formTarget', - frameborder: 'frameBorder', - headers: 'headers', - height: 'height', - hidden: 'hidden', - high: 'high', - href: 'href', - hreflang: 'hrefLang', - htmlfor: 'htmlFor', - httpequiv: 'httpEquiv', - 'http-equiv': 'httpEquiv', - icon: 'icon', - id: 'id', - imagesizes: 'imageSizes', - imagesrcset: 'imageSrcSet', - innerhtml: 'innerHTML', - inputmode: 'inputMode', - integrity: 'integrity', - is: 'is', - itemid: 'itemID', - itemprop: 'itemProp', - itemref: 'itemRef', - itemscope: 'itemScope', - itemtype: 'itemType', - keyparams: 'keyParams', - keytype: 'keyType', - kind: 'kind', - label: 'label', - lang: 'lang', - list: 'list', - loop: 'loop', - low: 'low', - manifest: 'manifest', - marginwidth: 'marginWidth', - marginheight: 'marginHeight', - max: 'max', - maxlength: 'maxLength', - media: 'media', - mediagroup: 'mediaGroup', - method: 'method', - min: 'min', - minlength: 'minLength', - multiple: 'multiple', - muted: 'muted', - name: 'name', - nomodule: 'noModule', - nonce: 'nonce', - novalidate: 'noValidate', - open: 'open', - optimum: 'optimum', - pattern: 'pattern', - placeholder: 'placeholder', - playsinline: 'playsInline', - poster: 'poster', - preload: 'preload', - profile: 'profile', - radiogroup: 'radioGroup', - readonly: 'readOnly', - referrerpolicy: 'referrerPolicy', - rel: 'rel', - required: 'required', - reversed: 'reversed', - role: 'role', - rows: 'rows', - rowspan: 'rowSpan', - sandbox: 'sandbox', - scope: 'scope', - scoped: 'scoped', - scrolling: 'scrolling', - seamless: 'seamless', - selected: 'selected', - shape: 'shape', - size: 'size', - sizes: 'sizes', - span: 'span', - spellcheck: 'spellCheck', - src: 'src', - srcdoc: 'srcDoc', - srclang: 'srcLang', - srcset: 'srcSet', - start: 'start', - step: 'step', - style: 'style', - summary: 'summary', - tabindex: 'tabIndex', - target: 'target', - title: 'title', - type: 'type', - usemap: 'useMap', - value: 'value', - width: 'width', - wmode: 'wmode', - wrap: 'wrap', - // SVG - about: 'about', - accentheight: 'accentHeight', - 'accent-height': 'accentHeight', - accumulate: 'accumulate', - additive: 'additive', - alignmentbaseline: 'alignmentBaseline', - 'alignment-baseline': 'alignmentBaseline', - allowreorder: 'allowReorder', - alphabetic: 'alphabetic', - amplitude: 'amplitude', - arabicform: 'arabicForm', - 'arabic-form': 'arabicForm', - ascent: 'ascent', - attributename: 'attributeName', - attributetype: 'attributeType', - autoreverse: 'autoReverse', - azimuth: 'azimuth', - basefrequency: 'baseFrequency', - baselineshift: 'baselineShift', - 'baseline-shift': 'baselineShift', - baseprofile: 'baseProfile', - bbox: 'bbox', - begin: 'begin', - bias: 'bias', - by: 'by', - calcmode: 'calcMode', - capheight: 'capHeight', - 'cap-height': 'capHeight', - clip: 'clip', - clippath: 'clipPath', - 'clip-path': 'clipPath', - clippathunits: 'clipPathUnits', - cliprule: 'clipRule', - 'clip-rule': 'clipRule', - color: 'color', - colorinterpolation: 'colorInterpolation', - 'color-interpolation': 'colorInterpolation', - colorinterpolationfilters: 'colorInterpolationFilters', - 'color-interpolation-filters': 'colorInterpolationFilters', - colorprofile: 'colorProfile', - 'color-profile': 'colorProfile', - colorrendering: 'colorRendering', - 'color-rendering': 'colorRendering', - contentscripttype: 'contentScriptType', - contentstyletype: 'contentStyleType', - cursor: 'cursor', - cx: 'cx', - cy: 'cy', - d: 'd', - datatype: 'datatype', - decelerate: 'decelerate', - descent: 'descent', - diffuseconstant: 'diffuseConstant', - direction: 'direction', - display: 'display', - divisor: 'divisor', - dominantbaseline: 'dominantBaseline', - 'dominant-baseline': 'dominantBaseline', - dur: 'dur', - dx: 'dx', - dy: 'dy', - edgemode: 'edgeMode', - elevation: 'elevation', - enablebackground: 'enableBackground', - 'enable-background': 'enableBackground', - end: 'end', - exponent: 'exponent', - externalresourcesrequired: 'externalResourcesRequired', - fill: 'fill', - fillopacity: 'fillOpacity', - 'fill-opacity': 'fillOpacity', - fillrule: 'fillRule', - 'fill-rule': 'fillRule', - filter: 'filter', - filterres: 'filterRes', - filterunits: 'filterUnits', - floodopacity: 'floodOpacity', - 'flood-opacity': 'floodOpacity', - floodcolor: 'floodColor', - 'flood-color': 'floodColor', - focusable: 'focusable', - fontfamily: 'fontFamily', - 'font-family': 'fontFamily', - fontsize: 'fontSize', - 'font-size': 'fontSize', - fontsizeadjust: 'fontSizeAdjust', - 'font-size-adjust': 'fontSizeAdjust', - fontstretch: 'fontStretch', - 'font-stretch': 'fontStretch', - fontstyle: 'fontStyle', - 'font-style': 'fontStyle', - fontvariant: 'fontVariant', - 'font-variant': 'fontVariant', - fontweight: 'fontWeight', - 'font-weight': 'fontWeight', - format: 'format', - from: 'from', - fx: 'fx', - fy: 'fy', - g1: 'g1', - g2: 'g2', - glyphname: 'glyphName', - 'glyph-name': 'glyphName', - glyphorientationhorizontal: 'glyphOrientationHorizontal', - 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', - glyphorientationvertical: 'glyphOrientationVertical', - 'glyph-orientation-vertical': 'glyphOrientationVertical', - glyphref: 'glyphRef', - gradienttransform: 'gradientTransform', - gradientunits: 'gradientUnits', - hanging: 'hanging', - horizadvx: 'horizAdvX', - 'horiz-adv-x': 'horizAdvX', - horizoriginx: 'horizOriginX', - 'horiz-origin-x': 'horizOriginX', - ideographic: 'ideographic', - imagerendering: 'imageRendering', - 'image-rendering': 'imageRendering', - in2: 'in2', - in: 'in', - inlist: 'inlist', - intercept: 'intercept', - k1: 'k1', - k2: 'k2', - k3: 'k3', - k4: 'k4', - k: 'k', - kernelmatrix: 'kernelMatrix', - kernelunitlength: 'kernelUnitLength', - kerning: 'kerning', - keypoints: 'keyPoints', - keysplines: 'keySplines', - keytimes: 'keyTimes', - lengthadjust: 'lengthAdjust', - letterspacing: 'letterSpacing', - 'letter-spacing': 'letterSpacing', - lightingcolor: 'lightingColor', - 'lighting-color': 'lightingColor', - limitingconeangle: 'limitingConeAngle', - local: 'local', - markerend: 'markerEnd', - 'marker-end': 'markerEnd', - markerheight: 'markerHeight', - markermid: 'markerMid', - 'marker-mid': 'markerMid', - markerstart: 'markerStart', - 'marker-start': 'markerStart', - markerunits: 'markerUnits', - markerwidth: 'markerWidth', - mask: 'mask', - maskcontentunits: 'maskContentUnits', - maskunits: 'maskUnits', - mathematical: 'mathematical', - mode: 'mode', - numoctaves: 'numOctaves', - offset: 'offset', - opacity: 'opacity', - operator: 'operator', - order: 'order', - orient: 'orient', - orientation: 'orientation', - origin: 'origin', - overflow: 'overflow', - overlineposition: 'overlinePosition', - 'overline-position': 'overlinePosition', - overlinethickness: 'overlineThickness', - 'overline-thickness': 'overlineThickness', - paintorder: 'paintOrder', - 'paint-order': 'paintOrder', - panose1: 'panose1', - 'panose-1': 'panose1', - pathlength: 'pathLength', - patterncontentunits: 'patternContentUnits', - patterntransform: 'patternTransform', - patternunits: 'patternUnits', - pointerevents: 'pointerEvents', - 'pointer-events': 'pointerEvents', - points: 'points', - pointsatx: 'pointsAtX', - pointsaty: 'pointsAtY', - pointsatz: 'pointsAtZ', - prefix: 'prefix', - preservealpha: 'preserveAlpha', - preserveaspectratio: 'preserveAspectRatio', - primitiveunits: 'primitiveUnits', - property: 'property', - r: 'r', - radius: 'radius', - refx: 'refX', - refy: 'refY', - renderingintent: 'renderingIntent', - 'rendering-intent': 'renderingIntent', - repeatcount: 'repeatCount', - repeatdur: 'repeatDur', - requiredextensions: 'requiredExtensions', - requiredfeatures: 'requiredFeatures', - resource: 'resource', - restart: 'restart', - result: 'result', - results: 'results', - rotate: 'rotate', - rx: 'rx', - ry: 'ry', - scale: 'scale', - security: 'security', - seed: 'seed', - shaperendering: 'shapeRendering', - 'shape-rendering': 'shapeRendering', - slope: 'slope', - spacing: 'spacing', - specularconstant: 'specularConstant', - specularexponent: 'specularExponent', - speed: 'speed', - spreadmethod: 'spreadMethod', - startoffset: 'startOffset', - stddeviation: 'stdDeviation', - stemh: 'stemh', - stemv: 'stemv', - stitchtiles: 'stitchTiles', - stopcolor: 'stopColor', - 'stop-color': 'stopColor', - stopopacity: 'stopOpacity', - 'stop-opacity': 'stopOpacity', - strikethroughposition: 'strikethroughPosition', - 'strikethrough-position': 'strikethroughPosition', - strikethroughthickness: 'strikethroughThickness', - 'strikethrough-thickness': 'strikethroughThickness', - string: 'string', - stroke: 'stroke', - strokedasharray: 'strokeDasharray', - 'stroke-dasharray': 'strokeDasharray', - strokedashoffset: 'strokeDashoffset', - 'stroke-dashoffset': 'strokeDashoffset', - strokelinecap: 'strokeLinecap', - 'stroke-linecap': 'strokeLinecap', - strokelinejoin: 'strokeLinejoin', - 'stroke-linejoin': 'strokeLinejoin', - strokemiterlimit: 'strokeMiterlimit', - 'stroke-miterlimit': 'strokeMiterlimit', - strokewidth: 'strokeWidth', - 'stroke-width': 'strokeWidth', - strokeopacity: 'strokeOpacity', - 'stroke-opacity': 'strokeOpacity', - suppresscontenteditablewarning: 'suppressContentEditableWarning', - suppresshydrationwarning: 'suppressHydrationWarning', - surfacescale: 'surfaceScale', - systemlanguage: 'systemLanguage', - tablevalues: 'tableValues', - targetx: 'targetX', - targety: 'targetY', - textanchor: 'textAnchor', - 'text-anchor': 'textAnchor', - textdecoration: 'textDecoration', - 'text-decoration': 'textDecoration', - textlength: 'textLength', - textrendering: 'textRendering', - 'text-rendering': 'textRendering', - to: 'to', - transform: 'transform', - transformorigin: 'transformOrigin', - 'transform-origin': 'transformOrigin', - typeof: 'typeof', - u1: 'u1', - u2: 'u2', - underlineposition: 'underlinePosition', - 'underline-position': 'underlinePosition', - underlinethickness: 'underlineThickness', - 'underline-thickness': 'underlineThickness', - unicode: 'unicode', - unicodebidi: 'unicodeBidi', - 'unicode-bidi': 'unicodeBidi', - unicoderange: 'unicodeRange', - 'unicode-range': 'unicodeRange', - unitsperem: 'unitsPerEm', - 'units-per-em': 'unitsPerEm', - unselectable: 'unselectable', - valphabetic: 'vAlphabetic', - 'v-alphabetic': 'vAlphabetic', - values: 'values', - vectoreffect: 'vectorEffect', - 'vector-effect': 'vectorEffect', - version: 'version', - vertadvy: 'vertAdvY', - 'vert-adv-y': 'vertAdvY', - vertoriginx: 'vertOriginX', - 'vert-origin-x': 'vertOriginX', - vertoriginy: 'vertOriginY', - 'vert-origin-y': 'vertOriginY', - vhanging: 'vHanging', - 'v-hanging': 'vHanging', - videographic: 'vIdeographic', - 'v-ideographic': 'vIdeographic', - viewbox: 'viewBox', - viewtarget: 'viewTarget', - visibility: 'visibility', - vmathematical: 'vMathematical', - 'v-mathematical': 'vMathematical', - vocab: 'vocab', - widths: 'widths', - wordspacing: 'wordSpacing', - 'word-spacing': 'wordSpacing', - writingmode: 'writingMode', - 'writing-mode': 'writingMode', - x1: 'x1', - x2: 'x2', - x: 'x', - xchannelselector: 'xChannelSelector', - xheight: 'xHeight', - 'x-height': 'xHeight', - xlinkactuate: 'xlinkActuate', - 'xlink:actuate': 'xlinkActuate', - xlinkarcrole: 'xlinkArcrole', - 'xlink:arcrole': 'xlinkArcrole', - xlinkhref: 'xlinkHref', - 'xlink:href': 'xlinkHref', - xlinkrole: 'xlinkRole', - 'xlink:role': 'xlinkRole', - xlinkshow: 'xlinkShow', - 'xlink:show': 'xlinkShow', - xlinktitle: 'xlinkTitle', - 'xlink:title': 'xlinkTitle', - xlinktype: 'xlinkType', - 'xlink:type': 'xlinkType', - xmlbase: 'xmlBase', - 'xml:base': 'xmlBase', - xmllang: 'xmlLang', - 'xml:lang': 'xmlLang', - xmlns: 'xmlns', - 'xml:space': 'xmlSpace', - xmlnsxlink: 'xmlnsXlink', - 'xmlns:xlink': 'xmlnsXlink', - xmlspace: 'xmlSpace', - y1: 'y1', - y2: 'y2', - y: 'y', - ychannelselector: 'yChannelSelector', - z: 'z', - zoomandpan: 'zoomAndPan' -}; - -var warnedProperties = {}; -var EVENT_NAME_REGEX = /^on./; -var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; -var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$') ; -var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$') ; - -function validateProperty(tagName, name, value, eventRegistry) { - { - if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { - return true; - } - - var lowerCasedName = name.toLowerCase(); - - if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); - - warnedProperties[name] = true; - return true; - } // We can't rely on the event system being injected on the server. - - - if (eventRegistry != null) { - var registrationNameDependencies = eventRegistry.registrationNameDependencies, - possibleRegistrationNames = eventRegistry.possibleRegistrationNames; - - if (registrationNameDependencies.hasOwnProperty(name)) { - return true; - } - - var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; - - if (registrationName != null) { - error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); - - warnedProperties[name] = true; - return true; - } - - if (EVENT_NAME_REGEX.test(name)) { - error('Unknown event handler property `%s`. It will be ignored.', name); - - warnedProperties[name] = true; - return true; - } - } else if (EVENT_NAME_REGEX.test(name)) { - // If no event plugins have been injected, we are in a server environment. - // So we can't tell if the event name is correct for sure, but we can filter - // out known bad ones like `onclick`. We can't suggest a specific replacement though. - if (INVALID_EVENT_NAME_REGEX.test(name)) { - error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); - } - - warnedProperties[name] = true; - return true; - } // Let the ARIA attribute hook validate ARIA attributes - - - if (rARIA.test(name) || rARIACamel.test(name)) { - return true; - } - - if (lowerCasedName === 'innerhtml') { - error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'aria') { - error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { - error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); - - warnedProperties[name] = true; - return true; - } - - if (typeof value === 'number' && isNaN(value)) { - error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); - - warnedProperties[name] = true; - return true; - } - - var propertyInfo = getPropertyInfo(name); // Known attributes should match the casing specified in the property config. - - if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { - var standardName = possibleStandardNames[lowerCasedName]; - - if (standardName !== name) { - error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties[name] = true; - return true; - } - } else if (name !== lowerCasedName) { - // Unknown attributes should have lowercase casing since that's how they - // will be cased anyway with server rendering. - error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); - - warnedProperties[name] = true; - return true; - } // Now that we've validated casing, do not validate - // data types for reserved props - - - switch (name) { - case 'dangerouslySetInnerHTML': - case 'children': - case 'style': - case 'suppressContentEditableWarning': - case 'suppressHydrationWarning': - case 'defaultValue': // Reserved - - case 'defaultChecked': - case 'innerHTML': - { - return true; - } - - case 'innerText': // Properties - - case 'textContent': - { - return true; - } - - } - - switch (typeof value) { - case 'boolean': - { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - // Boolean properties can accept boolean values - return true; - } - - default: - { - if (propertyInfo === null) { - var prefix = name.toLowerCase().slice(0, 5); - - if (prefix === 'data-' || prefix === 'aria-') { - return true; - } - } else if (propertyInfo.acceptsBooleans) { - return true; - } - - if (value) { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); - } else { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); - } - - warnedProperties[name] = true; - return true; - } - } - } - - case 'function': - case 'symbol': - // eslint-disable-line - // Warn when a known attribute is a bad type - warnedProperties[name] = true; - return false; - - case 'string': - { - // Warn when passing the strings 'false' or 'true' into a boolean prop - if (value === 'false' || value === 'true') { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - break; - } - - default: - { - if (propertyInfo === null || propertyInfo.type !== BOOLEAN) { - return true; - } - } - } - - error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); - - warnedProperties[name] = true; - return true; - } - } - } - - return true; - } -} - -function warnUnknownProperties(type, props, eventRegistry) { - { - var unknownProps = []; - - for (var key in props) { - var isValid = validateProperty(type, key, props[key], eventRegistry); - - if (!isValid) { - unknownProps.push(key); - } - } - - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (unknownProps.length === 1) { - error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } else if (unknownProps.length > 1) { - error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } - } -} - -function validateProperties(type, props, eventRegistry) { - if (isCustomElement(type) || typeof props.is === 'string') { - return; - } - - warnUnknownProperties(type, props, eventRegistry); -} - -// 'msTransform' is correct, but the other prefixes should be capitalized -var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; -var msPattern$1 = /^-ms-/; -var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon - -var badStyleValueWithSemicolonPattern = /;\s*$/; -var warnedStyleNames = {}; -var warnedStyleValues = {}; -var warnedForNaNValue = false; -var warnedForInfinityValue = false; - -function camelize(string) { - return string.replace(hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); -} - -function warnHyphenatedStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests - // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - // is converted to lowercase `ms`. - camelize(name.replace(msPattern$1, 'ms-'))); - } -} - -function warnBadVendoredStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); - } -} - -function warnStyleValueWithSemicolon(name, value) { - { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - - error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); - } -} - -function warnStyleValueIsNaN(name, value) { - { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - - error('`NaN` is an invalid value for the `%s` css style property.', name); - } -} - -function warnStyleValueIsInfinity(name, value) { - { - if (warnedForInfinityValue) { - return; - } - - warnedForInfinityValue = true; - - error('`Infinity` is an invalid value for the `%s` css style property.', name); - } -} - -function warnValidStyle(name, value) { - { - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value); - } - - if (typeof value === 'number') { - if (isNaN(value)) { - warnStyleValueIsNaN(name); - } else if (!isFinite(value)) { - warnStyleValueIsInfinity(name); - } - } - } -} - -// code copied and modified from escape-html -var matchHtmlRegExp = /["'&<>]/; -/** - * Escapes special characters and HTML entities in a given html string. - * - * @param {string} string HTML string to escape for later insertion - * @return {string} - * @public - */ - -function escapeHtml(string) { - { - checkHtmlStringCoercion(string); - } - - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - // " - escape = '"'; - break; - - case 38: - // & - escape = '&'; - break; - - case 39: - // ' - escape = '''; // modified from escape-html; used to be ''' - - break; - - case 60: - // < - escape = '<'; - break; - - case 62: - // > - escape = '>'; - break; - - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index ? html + str.substring(lastIndex, index) : html; -} // end code copied and modified from escape-html - -/** - * Escapes text to prevent scripting attacks. - * - * @param {*} text Text value to escape. - * @return {string} An escaped string. - */ - - -function escapeTextForBrowser(text) { - if (typeof text === 'boolean' || typeof text === 'number') { - // this shortcircuit helps perf for types that we know will never have - // special characters, especially given that this function is used often - // for numeric dom ids. - return '' + text; - } - - return escapeHtml(text); -} - -var uppercasePattern = /([A-Z])/g; -var msPattern = /^ms-/; -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - */ - -function hyphenateStyleName(name) { - return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); -} - -// and any newline or tab are filtered out as if they're not part of the URL. -// https://url.spec.whatwg.org/#url-parsing -// Tab or newline are defined as \r\n\t: -// https://infra.spec.whatwg.org/#ascii-tab-or-newline -// A C0 control is a code point in the range \u0000 NULL to \u001F -// INFORMATION SEPARATOR ONE, inclusive: -// https://infra.spec.whatwg.org/#c0-control-or-space - -/* eslint-disable max-len */ - -var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; -var didWarn = false; - -function sanitizeURL(url) { - // We should never have symbols here because they get filtered out elsewhere. - // eslint-disable-next-line react-internal/safe-string-coercion - var stringifiedURL = '' + url; - - { - if (!didWarn && isJavaScriptProtocol.test(stringifiedURL)) { - didWarn = true; - - error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(stringifiedURL)); - } - } - - return url; -} - -var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - -function isArray(a) { - return isArrayImpl(a); -} - -// The build script is at scripts/rollup/generate-inline-fizz-runtime.js. -// Run `yarn generate-inline-fizz-runtime` to generate. -var clientRenderBoundary = '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};'; -var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; -var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; - -function getValueDescriptorExpectingObjectForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : "something with type \"" + typeof thing + "\""; -} -function getValueDescriptorExpectingEnumForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : typeof thing === 'string' ? JSON.stringify(thing) : "something with type \"" + typeof thing + "\""; -} - -function compareResourcePropsForWarning(newProps, currentProps) { - { - var propDiffs = null; - var allProps = Array.from(new Set(Object.keys(currentProps).concat(Object.keys(newProps)))); - - for (var i = 0; i < allProps.length; i++) { - var propName = allProps[i]; - var newValue = newProps[propName]; - var currentValue = currentProps[propName]; - - if (newValue !== currentValue && !(newValue == null && currentValue == null)) { - if (newValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.missing[propName] = currentValue; - } else if (currentValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.extra[propName] = newValue; - } else { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.different[propName] = { - original: currentValue, - latest: newValue - }; - } - } - } - - return propDiffs; - } -} - -function describeDifferencesForStylesheets(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'media') { - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName in diff.extra) { - var _propValue = diff.extra[_propName]; - description += "\n \"" + _propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue) + ", missing from original props"; - } - - for (var _propName2 in diff.different) { - var latestValue = diff.different[_propName2].latest; - var originalValue = diff.different[_propName2].original; - description += "\n \"" + _propName2 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForStylesheetOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'precedence' || propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName3 in diff.different) { - var latestValue = diff.different[_propName3].latest; - var originalValue = diff.different[_propName3].original; - - if (_propName3 === 'precedence' && originalValue === 'default') { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", missing from options"; - } else { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreinitOverStylesheet(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName4 in diff.extra) { - var _propValue2 = diff.extra[_propName4]; - - if (_propName4 === 'precedence' || _propName4 === 'crossOrigin' || _propName4 === 'integrity') { - description += "\n \"" + _propName4 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue2) + ", missing from props"; - } - } - - for (var _propName5 in diff.different) { - var latestValue = diff.different[_propName5].latest; - var originalValue = diff.different[_propName5].original; - description += "\n \"" + _propName5 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinits(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName6 in diff.extra) { - var _propValue3 = diff.extra[_propName6]; - - if (_propName6 === 'precedence' && _propValue3 !== 'default' || _propName6 === 'crossOrigin' || _propName6 === 'integrity') { - description += "\n \"" + _propName6 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue3) + ", missing from original options"; - } - } - - for (var _propName7 in diff.different) { - var latestValue = diff.different[_propName7].latest; - var originalValue = diff.different[_propName7].original; - description += "\n \"" + _propName7 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -var preloadOptionsForComparison = ['as', 'crossOrigin', 'integrity', 'media']; -function describeDifferencesForPreloads(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName8 in diff.extra) { - var _propValue4 = diff.extra[_propName8]; - - if (preloadOptionsForComparison.includes(_propName8)) { - description += "\n \"" + _propName8 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue4) + ", missing from original options"; - } - } - - for (var _propName9 in diff.different) { - var latestValue = diff.different[_propName9].latest; - var originalValue = diff.different[_propName9].original; - - if (preloadOptionsForComparison.includes(_propName9)) { - description += "\n \"" + _propName9 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreloadOverImplicitPreload(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, underlying prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName10 in diff.extra) { - var _propValue5 = diff.extra[_propName10]; - - if (preloadOptionsForComparison.includes(_propName10)) { - description += "\n \"" + _propName10 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue5) + ", missing from underlying props"; - } - } - - for (var _propName11 in diff.different) { - var latestValue = diff.different[_propName11].latest; - var originalValue = diff.different[_propName11].original; - - if (preloadOptionsForComparison.includes(_propName11)) { - description += "\n \"" + _propName11 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", underlying prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForScripts(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - - for (var _propName12 in diff.extra) { - var _propValue6 = diff.extra[_propName12]; - description += "\n \"" + _propName12 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue6) + ", missing from original props"; - } - - for (var _propName13 in diff.different) { - var latestValue = diff.different[_propName13].latest; - var originalValue = diff.different[_propName13].original; - description += "\n \"" + _propName13 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForScriptOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName14 in diff.different) { - var latestValue = diff.different[_propName14].latest; - var originalValue = diff.different[_propName14].original; - description += "\n \"" + _propName14 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinitOverScript(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" option value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", missing from props"; - } - } - - for (var _propName15 in diff.different) { - var latestValue = diff.different[_propName15].latest; - var originalValue = diff.different[_propName15].original; - description += "\n \"" + _propName15 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} - -var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher; -var ReactDOMServerDispatcher = { - prefetchDNS: prefetchDNS, - preconnect: preconnect, - preload: preload, - preinit: preinit -} ; -var currentResources = null; -var currentResourcesStack = []; -function prepareToRender(resources) { - currentResourcesStack.push(currentResources); - currentResources = resources; - var previousHostDispatcher = ReactDOMCurrentDispatcher.current; - ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher; - return previousHostDispatcher; -} -function cleanupAfterRender(previousDispatcher) { - currentResources = currentResourcesStack.pop(); - ReactDOMCurrentDispatcher.current = previousDispatcher; -} // Used to distinguish these contexts from ones used in other renderers. -var ScriptStreamingFormat = 0; -var DataStreamingFormat = 1; -var NothingSent -/* */ -= 0; -var SentCompleteSegmentFunction -/* */ -= 1; -var SentCompleteBoundaryFunction -/* */ -= 2; -var SentClientRenderFunction -/* */ -= 4; -var SentStyleInsertionFunction -/* */ -= 8; // Per response, global state that is not contextual to the rendering subtree. - -var dataElementQuotedEnd = stringToPrecomputedChunk('">'); -var startInlineScript = stringToPrecomputedChunk(''); -var startScriptSrc = stringToPrecomputedChunk(''); -/** - * This escaping function is designed to work with bootstrapScriptContent only. - * because we know we are escaping the entire script. We can avoid for instance - * escaping html comment string sequences that are valid javascript as well because - * if there are no sebsequent '); -var completeSegmentData1 = stringToPrecomputedChunk('")),Qc(a,b,c),a=a.responseState.generateStaticMarkup?!0:b.push("\x3c!--/$--\x3e"),a;if(0a.progressiveChunkSize)return d.rootSegmentID=a.nextSegmentId++,a.completedBoundaries.push(d),Ma(b,a.responseState,d.id),Qc(a,b,c),b.push("\x3c!--/$--\x3e");(c=a.resources.boundaryResources)&&d.resources.forEach(hb,c);a.responseState.generateStaticMarkup||b.push("\x3c!--$--\x3e");c=d.completedSegments;if(1!==c.length)throw Error(m(391));Rc(a,b,c[0]); -a=a.responseState.generateStaticMarkup?!0:b.push("\x3c!--/$--\x3e");return a}function Sc(a,b,c){Na(b,a.responseState,c.formatContext,c.id);Rc(a,b,c);return Oa(b,c.formatContext)} -function Tc(a,b,c){a.resources.boundaryResources=c.resources;for(var d=c.completedSegments,e=0;e"):b.push('">');return b} -function Uc(a,b,c,d){if(2===d.status)return!0;var e=d.id;if(-1===e){if(-1===(d.id=c.rootSegmentID))throw Error(m(392));return Sc(a,b,d)}Sc(a,b,d);a=a.responseState;(c=0===a.streamingFormat)?(b.push(a.startInlineScript),0===(a.instructions&1)?(a.instructions|=1,b.push('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("')):b.push('$RS("')):b.push('');return b} -function Pc(a,b){try{var c,d=a.completedRootSegment;if(null!==d)if(0===a.pendingRootTasks){cb(b,a.resources,a.responseState,0===a.allPendingTasks);Rc(a,b,d);a.completedRootSegment=null;var e=a.responseState.bootstrapChunks;for(d=0;d"):!e.push('">')){a.destination=null;c++;f.splice(0,c);return}}f.splice(0,c);var U=a.completedBoundaries;for(c=0;c")),a.htmlChunks&&(b.push("")),b.push(null))}}function Vc(a,b){try{var c=a.abortableTasks;if(0 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } - } -} -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -function scheduleWork(callback) { - callback(); -} -function beginWriting(destination) {} -function writeChunk(destination, chunk) { - writeChunkAndReturn(destination, chunk); -} -function writeChunkAndReturn(destination, chunk) { - return destination.push(chunk); -} -function completeWriting(destination) {} -function close(destination) { - destination.push(null); -} -function stringToChunk(content) { - return content; -} -function stringToPrecomputedChunk(content) { - return content; -} -function clonePrecomputedChunk(chunk) { - return chunk; -} -function closeWithError(destination, error) { - // $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types. - destination.destroy(error); -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -function _inheritsLoose(subClass, superClass) { - subClass.prototype = Object.create(superClass.prototype); - subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; -} - -var assign = Object.assign; - -/* - * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ -// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. -function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return] - - return type; - } -} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - - -function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } -} - -function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return '' + value; -} - -function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} - -// ----------------------------------------------------------------------------- -var enableFloat = true; - -// $FlowFixMe[method-unbinding] -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/* eslint-disable max-len */ - -var ATTRIBUTE_NAME_START_CHAR = ":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"; -/* eslint-enable max-len */ - -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - - { - error('Invalid attribute name: `%s`', attributeName); - } - - return false; -} - -// A simple string attribute. -// Attributes that aren't in the filter are presumed to have this type. -var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called -// "enumerated" attributes with "true" and "false" as possible values. -// When true, it should be set to a "true" string. -// When false, it should be set to a "false" string. - -var BOOLEANISH_STRING = 2; // A real boolean attribute. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. - -var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. -// For any other value, should be present with that value. - -var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. -// When falsy, it should be removed. - -var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. -// When falsy, it should be removed. - -var POSITIVE_NUMERIC = 6; -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} // $FlowFixMe[missing-this-annot] - -function PropertyInfoRecord(type, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.type = type; - this.sanitizeURL = sanitizeURL; - this.removeEmptyString = removeEmptyString; -} // When adding attributes to this list, be sure to also add them to -// the `possibleStandardNames` module to ensure casing and incorrect -// name warnings. - - -var properties = {}; // A few React string attributes have a different name. -// This is a mapping from React prop names to the attribute names. - -[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { - var name = _ref[0], - attributeName = _ref[1]; - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(STRING, attributeName, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" HTML attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). - -['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" SVG attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). -// Since these are SVG attributes, their attribute names are case-sensitive. - -['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML boolean attributes. - -['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM -// on the client side because the browsers are inconsistent. Instead we call focus(). -'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata -'itemScope'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEAN, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that are "overloaded booleans": they behave like -// booleans, but can also accept a string value. - -['capture', 'download' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(OVERLOADED_BOOLEAN, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be positive numbers. - -['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(POSITIVE_NUMERIC, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be numbers. - -['rowSpan', 'start'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(NUMERIC, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); -var CAMELIZE = /[\-\:]([a-z])/g; - -var capitalize = function (token) { - return token[1].toUpperCase(); -}; // This is a list of all SVG attributes that need special casing, namespacing, -// or boolean value assignment. Regular attributes that just accept strings -// and have the same names are omitted, just like in the HTML attribute filter. -// Some of these attributes can be hard to find. This list was created by -// scraping the MDN documentation. - - -['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', 'transform-origin', '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' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, null, // attributeNamespace - false, // sanitizeURL - false); -}); // String SVG attributes with the xlink namespace. - -['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL - false); -}); // String SVG attributes with the xml namespace. - -['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL - false); -}); // These attribute exists both in HTML and SVG. -// The attribute name is case-sensitive in SVG so we can't just use -// the React name like we do for attributes that exist only in HTML. - -['tabIndex', 'crossOrigin'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These attributes accept URLs. These must not allow javascript: URLS. -// These will also need to accept Trusted Types object in the future. - -var xlinkHref = 'xlinkHref'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[xlinkHref] = new PropertyInfoRecord(STRING, 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL -false); -var formAction = 'formAction'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[formAction] = new PropertyInfoRecord(STRING, 'formaction', // attributeName -null, // attributeNamespace -true, // sanitizeURL -false); -['src', 'href', 'action'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - true, // sanitizeURL - true); -}); - -/** - * CSS properties which accept numbers but are not in units of "px". - */ -function isUnitlessNumber (name) { - switch (name) { - case 'animationIterationCount': - case 'aspectRatio': - case 'borderImageOutset': - case 'borderImageSlice': - case 'borderImageWidth': - case 'boxFlex': - case 'boxFlexGroup': - case 'boxOrdinalGroup': - case 'columnCount': - case 'columns': - case 'flex': - case 'flexGrow': - case 'flexPositive': - case 'flexShrink': - case 'flexNegative': - case 'flexOrder': - case 'gridArea': - case 'gridRow': - case 'gridRowEnd': - case 'gridRowSpan': - case 'gridRowStart': - case 'gridColumn': - case 'gridColumnEnd': - case 'gridColumnSpan': - case 'gridColumnStart': - case 'fontWeight': - case 'lineClamp': - case 'lineHeight': - case 'opacity': - case 'order': - case 'orphans': - case 'scale': - case 'tabSize': - case 'widows': - case 'zIndex': - case 'zoom': - case 'fillOpacity': // SVG-related properties - - case 'floodOpacity': - case 'stopOpacity': - case 'strokeDasharray': - case 'strokeDashoffset': - case 'strokeMiterlimit': - case 'strokeOpacity': - case 'strokeWidth': - case 'MozAnimationIterationCount': // Known Prefixed Properties - - case 'MozBoxFlex': // TODO: Remove these since they shouldn't be used in modern code - - case 'MozBoxFlexGroup': - case 'MozLineClamp': - case 'msAnimationIterationCount': - case 'msFlex': - case 'msZoom': - case 'msFlexGrow': - case 'msFlexNegative': - case 'msFlexOrder': - case 'msFlexPositive': - case 'msFlexShrink': - case 'msGridColumn': - case 'msGridColumnSpan': - case 'msGridRow': - case 'msGridRowSpan': - case 'WebkitAnimationIterationCount': - case 'WebkitBoxFlex': - case 'WebKitBoxFlexGroup': - case 'WebkitBoxOrdinalGroup': - case 'WebkitColumnCount': - case 'WebkitColumns': - case 'WebkitFlex': - case 'WebkitFlexGrow': - case 'WebkitFlexPositive': - case 'WebkitFlexShrink': - case 'WebkitLineClamp': - return true; - - default: - return false; - } -} - -var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true -}; -function checkControlledValueProps(tagName, props) { - { - if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { - error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - - if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { - error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - } -} - -var ariaProperties = { - 'aria-current': 0, - // state - 'aria-description': 0, - 'aria-details': 0, - 'aria-disabled': 0, - // state - 'aria-hidden': 0, - // state - 'aria-invalid': 0, - // state - 'aria-keyshortcuts': 0, - 'aria-label': 0, - 'aria-roledescription': 0, - // Widget Attributes - 'aria-autocomplete': 0, - 'aria-checked': 0, - 'aria-expanded': 0, - 'aria-haspopup': 0, - 'aria-level': 0, - 'aria-modal': 0, - 'aria-multiline': 0, - 'aria-multiselectable': 0, - 'aria-orientation': 0, - 'aria-placeholder': 0, - 'aria-pressed': 0, - 'aria-readonly': 0, - 'aria-required': 0, - 'aria-selected': 0, - 'aria-sort': 0, - 'aria-valuemax': 0, - 'aria-valuemin': 0, - 'aria-valuenow': 0, - 'aria-valuetext': 0, - // Live Region Attributes - 'aria-atomic': 0, - 'aria-busy': 0, - 'aria-live': 0, - 'aria-relevant': 0, - // Drag-and-Drop Attributes - 'aria-dropeffect': 0, - 'aria-grabbed': 0, - // Relationship Attributes - 'aria-activedescendant': 0, - 'aria-colcount': 0, - 'aria-colindex': 0, - 'aria-colspan': 0, - 'aria-controls': 0, - 'aria-describedby': 0, - 'aria-errormessage': 0, - 'aria-flowto': 0, - 'aria-labelledby': 0, - 'aria-owns': 0, - 'aria-posinset': 0, - 'aria-rowcount': 0, - 'aria-rowindex': 0, - 'aria-rowspan': 0, - 'aria-setsize': 0 -}; - -var warnedProperties$1 = {}; -var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); -var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); - -function validateProperty$1(tagName, name) { - { - if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { - return true; - } - - if (rARIACamel$1.test(name)) { - var ariaName = 'aria-' + name.slice(4).toLowerCase(); - var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (correctName == null) { - error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); - - warnedProperties$1[name] = true; - return true; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== correctName) { - error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); - - warnedProperties$1[name] = true; - return true; - } - } - - if (rARIA$1.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (standardName == null) { - warnedProperties$1[name] = true; - return false; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== standardName) { - error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties$1[name] = true; - return true; - } - } - } - - return true; -} - -function validateProperties$2(type, props) { - { - var invalidProps = []; - - for (var key in props) { - var isValid = validateProperty$1(type, key); - - if (!isValid) { - invalidProps.push(key); - } - } - - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (invalidProps.length === 1) { - error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } else if (invalidProps.length > 1) { - error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } - } -} - -var didWarnValueNull = false; -function validateProperties$1(type, props) { - { - if (type !== 'input' && type !== 'textarea' && type !== 'select') { - return; - } - - if (props != null && props.value === null && !didWarnValueNull) { - didWarnValueNull = true; - - if (type === 'select' && props.multiple) { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); - } else { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); - } - } - } -} - -function isCustomElement(tagName, props) { - if (tagName.indexOf('-') === -1) { - return false; - } - - switch (tagName) { - // These are reserved SVG and MathML elements. - // We don't mind this list too much because we expect it to never grow. - // The alternative is to track the namespace in a few places which is convoluted. - // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts - case 'annotation-xml': - case 'color-profile': - case 'font-face': - case 'font-face-src': - case 'font-face-uri': - case 'font-face-format': - case 'font-face-name': - case 'missing-glyph': - return false; - - default: - return true; - } -} - -// When adding attributes to the HTML or SVG allowed attribute list, be sure to -// also add them to this module to ensure casing and incorrect name -// warnings. -var possibleStandardNames = { - // HTML - accept: 'accept', - acceptcharset: 'acceptCharset', - 'accept-charset': 'acceptCharset', - accesskey: 'accessKey', - action: 'action', - allowfullscreen: 'allowFullScreen', - alt: 'alt', - as: 'as', - async: 'async', - autocapitalize: 'autoCapitalize', - autocomplete: 'autoComplete', - autocorrect: 'autoCorrect', - autofocus: 'autoFocus', - autoplay: 'autoPlay', - autosave: 'autoSave', - capture: 'capture', - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing', - challenge: 'challenge', - charset: 'charSet', - checked: 'checked', - children: 'children', - cite: 'cite', - class: 'className', - classid: 'classID', - classname: 'className', - cols: 'cols', - colspan: 'colSpan', - content: 'content', - contenteditable: 'contentEditable', - contextmenu: 'contextMenu', - controls: 'controls', - controlslist: 'controlsList', - coords: 'coords', - crossorigin: 'crossOrigin', - dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', - data: 'data', - datetime: 'dateTime', - default: 'default', - defaultchecked: 'defaultChecked', - defaultvalue: 'defaultValue', - defer: 'defer', - dir: 'dir', - disabled: 'disabled', - disablepictureinpicture: 'disablePictureInPicture', - disableremoteplayback: 'disableRemotePlayback', - download: 'download', - draggable: 'draggable', - enctype: 'encType', - enterkeyhint: 'enterKeyHint', - fetchpriority: 'fetchPriority', - for: 'htmlFor', - form: 'form', - formmethod: 'formMethod', - formaction: 'formAction', - formenctype: 'formEncType', - formnovalidate: 'formNoValidate', - formtarget: 'formTarget', - frameborder: 'frameBorder', - headers: 'headers', - height: 'height', - hidden: 'hidden', - high: 'high', - href: 'href', - hreflang: 'hrefLang', - htmlfor: 'htmlFor', - httpequiv: 'httpEquiv', - 'http-equiv': 'httpEquiv', - icon: 'icon', - id: 'id', - imagesizes: 'imageSizes', - imagesrcset: 'imageSrcSet', - innerhtml: 'innerHTML', - inputmode: 'inputMode', - integrity: 'integrity', - is: 'is', - itemid: 'itemID', - itemprop: 'itemProp', - itemref: 'itemRef', - itemscope: 'itemScope', - itemtype: 'itemType', - keyparams: 'keyParams', - keytype: 'keyType', - kind: 'kind', - label: 'label', - lang: 'lang', - list: 'list', - loop: 'loop', - low: 'low', - manifest: 'manifest', - marginwidth: 'marginWidth', - marginheight: 'marginHeight', - max: 'max', - maxlength: 'maxLength', - media: 'media', - mediagroup: 'mediaGroup', - method: 'method', - min: 'min', - minlength: 'minLength', - multiple: 'multiple', - muted: 'muted', - name: 'name', - nomodule: 'noModule', - nonce: 'nonce', - novalidate: 'noValidate', - open: 'open', - optimum: 'optimum', - pattern: 'pattern', - placeholder: 'placeholder', - playsinline: 'playsInline', - poster: 'poster', - preload: 'preload', - profile: 'profile', - radiogroup: 'radioGroup', - readonly: 'readOnly', - referrerpolicy: 'referrerPolicy', - rel: 'rel', - required: 'required', - reversed: 'reversed', - role: 'role', - rows: 'rows', - rowspan: 'rowSpan', - sandbox: 'sandbox', - scope: 'scope', - scoped: 'scoped', - scrolling: 'scrolling', - seamless: 'seamless', - selected: 'selected', - shape: 'shape', - size: 'size', - sizes: 'sizes', - span: 'span', - spellcheck: 'spellCheck', - src: 'src', - srcdoc: 'srcDoc', - srclang: 'srcLang', - srcset: 'srcSet', - start: 'start', - step: 'step', - style: 'style', - summary: 'summary', - tabindex: 'tabIndex', - target: 'target', - title: 'title', - type: 'type', - usemap: 'useMap', - value: 'value', - width: 'width', - wmode: 'wmode', - wrap: 'wrap', - // SVG - about: 'about', - accentheight: 'accentHeight', - 'accent-height': 'accentHeight', - accumulate: 'accumulate', - additive: 'additive', - alignmentbaseline: 'alignmentBaseline', - 'alignment-baseline': 'alignmentBaseline', - allowreorder: 'allowReorder', - alphabetic: 'alphabetic', - amplitude: 'amplitude', - arabicform: 'arabicForm', - 'arabic-form': 'arabicForm', - ascent: 'ascent', - attributename: 'attributeName', - attributetype: 'attributeType', - autoreverse: 'autoReverse', - azimuth: 'azimuth', - basefrequency: 'baseFrequency', - baselineshift: 'baselineShift', - 'baseline-shift': 'baselineShift', - baseprofile: 'baseProfile', - bbox: 'bbox', - begin: 'begin', - bias: 'bias', - by: 'by', - calcmode: 'calcMode', - capheight: 'capHeight', - 'cap-height': 'capHeight', - clip: 'clip', - clippath: 'clipPath', - 'clip-path': 'clipPath', - clippathunits: 'clipPathUnits', - cliprule: 'clipRule', - 'clip-rule': 'clipRule', - color: 'color', - colorinterpolation: 'colorInterpolation', - 'color-interpolation': 'colorInterpolation', - colorinterpolationfilters: 'colorInterpolationFilters', - 'color-interpolation-filters': 'colorInterpolationFilters', - colorprofile: 'colorProfile', - 'color-profile': 'colorProfile', - colorrendering: 'colorRendering', - 'color-rendering': 'colorRendering', - contentscripttype: 'contentScriptType', - contentstyletype: 'contentStyleType', - cursor: 'cursor', - cx: 'cx', - cy: 'cy', - d: 'd', - datatype: 'datatype', - decelerate: 'decelerate', - descent: 'descent', - diffuseconstant: 'diffuseConstant', - direction: 'direction', - display: 'display', - divisor: 'divisor', - dominantbaseline: 'dominantBaseline', - 'dominant-baseline': 'dominantBaseline', - dur: 'dur', - dx: 'dx', - dy: 'dy', - edgemode: 'edgeMode', - elevation: 'elevation', - enablebackground: 'enableBackground', - 'enable-background': 'enableBackground', - end: 'end', - exponent: 'exponent', - externalresourcesrequired: 'externalResourcesRequired', - fill: 'fill', - fillopacity: 'fillOpacity', - 'fill-opacity': 'fillOpacity', - fillrule: 'fillRule', - 'fill-rule': 'fillRule', - filter: 'filter', - filterres: 'filterRes', - filterunits: 'filterUnits', - floodopacity: 'floodOpacity', - 'flood-opacity': 'floodOpacity', - floodcolor: 'floodColor', - 'flood-color': 'floodColor', - focusable: 'focusable', - fontfamily: 'fontFamily', - 'font-family': 'fontFamily', - fontsize: 'fontSize', - 'font-size': 'fontSize', - fontsizeadjust: 'fontSizeAdjust', - 'font-size-adjust': 'fontSizeAdjust', - fontstretch: 'fontStretch', - 'font-stretch': 'fontStretch', - fontstyle: 'fontStyle', - 'font-style': 'fontStyle', - fontvariant: 'fontVariant', - 'font-variant': 'fontVariant', - fontweight: 'fontWeight', - 'font-weight': 'fontWeight', - format: 'format', - from: 'from', - fx: 'fx', - fy: 'fy', - g1: 'g1', - g2: 'g2', - glyphname: 'glyphName', - 'glyph-name': 'glyphName', - glyphorientationhorizontal: 'glyphOrientationHorizontal', - 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', - glyphorientationvertical: 'glyphOrientationVertical', - 'glyph-orientation-vertical': 'glyphOrientationVertical', - glyphref: 'glyphRef', - gradienttransform: 'gradientTransform', - gradientunits: 'gradientUnits', - hanging: 'hanging', - horizadvx: 'horizAdvX', - 'horiz-adv-x': 'horizAdvX', - horizoriginx: 'horizOriginX', - 'horiz-origin-x': 'horizOriginX', - ideographic: 'ideographic', - imagerendering: 'imageRendering', - 'image-rendering': 'imageRendering', - in2: 'in2', - in: 'in', - inlist: 'inlist', - intercept: 'intercept', - k1: 'k1', - k2: 'k2', - k3: 'k3', - k4: 'k4', - k: 'k', - kernelmatrix: 'kernelMatrix', - kernelunitlength: 'kernelUnitLength', - kerning: 'kerning', - keypoints: 'keyPoints', - keysplines: 'keySplines', - keytimes: 'keyTimes', - lengthadjust: 'lengthAdjust', - letterspacing: 'letterSpacing', - 'letter-spacing': 'letterSpacing', - lightingcolor: 'lightingColor', - 'lighting-color': 'lightingColor', - limitingconeangle: 'limitingConeAngle', - local: 'local', - markerend: 'markerEnd', - 'marker-end': 'markerEnd', - markerheight: 'markerHeight', - markermid: 'markerMid', - 'marker-mid': 'markerMid', - markerstart: 'markerStart', - 'marker-start': 'markerStart', - markerunits: 'markerUnits', - markerwidth: 'markerWidth', - mask: 'mask', - maskcontentunits: 'maskContentUnits', - maskunits: 'maskUnits', - mathematical: 'mathematical', - mode: 'mode', - numoctaves: 'numOctaves', - offset: 'offset', - opacity: 'opacity', - operator: 'operator', - order: 'order', - orient: 'orient', - orientation: 'orientation', - origin: 'origin', - overflow: 'overflow', - overlineposition: 'overlinePosition', - 'overline-position': 'overlinePosition', - overlinethickness: 'overlineThickness', - 'overline-thickness': 'overlineThickness', - paintorder: 'paintOrder', - 'paint-order': 'paintOrder', - panose1: 'panose1', - 'panose-1': 'panose1', - pathlength: 'pathLength', - patterncontentunits: 'patternContentUnits', - patterntransform: 'patternTransform', - patternunits: 'patternUnits', - pointerevents: 'pointerEvents', - 'pointer-events': 'pointerEvents', - points: 'points', - pointsatx: 'pointsAtX', - pointsaty: 'pointsAtY', - pointsatz: 'pointsAtZ', - prefix: 'prefix', - preservealpha: 'preserveAlpha', - preserveaspectratio: 'preserveAspectRatio', - primitiveunits: 'primitiveUnits', - property: 'property', - r: 'r', - radius: 'radius', - refx: 'refX', - refy: 'refY', - renderingintent: 'renderingIntent', - 'rendering-intent': 'renderingIntent', - repeatcount: 'repeatCount', - repeatdur: 'repeatDur', - requiredextensions: 'requiredExtensions', - requiredfeatures: 'requiredFeatures', - resource: 'resource', - restart: 'restart', - result: 'result', - results: 'results', - rotate: 'rotate', - rx: 'rx', - ry: 'ry', - scale: 'scale', - security: 'security', - seed: 'seed', - shaperendering: 'shapeRendering', - 'shape-rendering': 'shapeRendering', - slope: 'slope', - spacing: 'spacing', - specularconstant: 'specularConstant', - specularexponent: 'specularExponent', - speed: 'speed', - spreadmethod: 'spreadMethod', - startoffset: 'startOffset', - stddeviation: 'stdDeviation', - stemh: 'stemh', - stemv: 'stemv', - stitchtiles: 'stitchTiles', - stopcolor: 'stopColor', - 'stop-color': 'stopColor', - stopopacity: 'stopOpacity', - 'stop-opacity': 'stopOpacity', - strikethroughposition: 'strikethroughPosition', - 'strikethrough-position': 'strikethroughPosition', - strikethroughthickness: 'strikethroughThickness', - 'strikethrough-thickness': 'strikethroughThickness', - string: 'string', - stroke: 'stroke', - strokedasharray: 'strokeDasharray', - 'stroke-dasharray': 'strokeDasharray', - strokedashoffset: 'strokeDashoffset', - 'stroke-dashoffset': 'strokeDashoffset', - strokelinecap: 'strokeLinecap', - 'stroke-linecap': 'strokeLinecap', - strokelinejoin: 'strokeLinejoin', - 'stroke-linejoin': 'strokeLinejoin', - strokemiterlimit: 'strokeMiterlimit', - 'stroke-miterlimit': 'strokeMiterlimit', - strokewidth: 'strokeWidth', - 'stroke-width': 'strokeWidth', - strokeopacity: 'strokeOpacity', - 'stroke-opacity': 'strokeOpacity', - suppresscontenteditablewarning: 'suppressContentEditableWarning', - suppresshydrationwarning: 'suppressHydrationWarning', - surfacescale: 'surfaceScale', - systemlanguage: 'systemLanguage', - tablevalues: 'tableValues', - targetx: 'targetX', - targety: 'targetY', - textanchor: 'textAnchor', - 'text-anchor': 'textAnchor', - textdecoration: 'textDecoration', - 'text-decoration': 'textDecoration', - textlength: 'textLength', - textrendering: 'textRendering', - 'text-rendering': 'textRendering', - to: 'to', - transform: 'transform', - transformorigin: 'transformOrigin', - 'transform-origin': 'transformOrigin', - typeof: 'typeof', - u1: 'u1', - u2: 'u2', - underlineposition: 'underlinePosition', - 'underline-position': 'underlinePosition', - underlinethickness: 'underlineThickness', - 'underline-thickness': 'underlineThickness', - unicode: 'unicode', - unicodebidi: 'unicodeBidi', - 'unicode-bidi': 'unicodeBidi', - unicoderange: 'unicodeRange', - 'unicode-range': 'unicodeRange', - unitsperem: 'unitsPerEm', - 'units-per-em': 'unitsPerEm', - unselectable: 'unselectable', - valphabetic: 'vAlphabetic', - 'v-alphabetic': 'vAlphabetic', - values: 'values', - vectoreffect: 'vectorEffect', - 'vector-effect': 'vectorEffect', - version: 'version', - vertadvy: 'vertAdvY', - 'vert-adv-y': 'vertAdvY', - vertoriginx: 'vertOriginX', - 'vert-origin-x': 'vertOriginX', - vertoriginy: 'vertOriginY', - 'vert-origin-y': 'vertOriginY', - vhanging: 'vHanging', - 'v-hanging': 'vHanging', - videographic: 'vIdeographic', - 'v-ideographic': 'vIdeographic', - viewbox: 'viewBox', - viewtarget: 'viewTarget', - visibility: 'visibility', - vmathematical: 'vMathematical', - 'v-mathematical': 'vMathematical', - vocab: 'vocab', - widths: 'widths', - wordspacing: 'wordSpacing', - 'word-spacing': 'wordSpacing', - writingmode: 'writingMode', - 'writing-mode': 'writingMode', - x1: 'x1', - x2: 'x2', - x: 'x', - xchannelselector: 'xChannelSelector', - xheight: 'xHeight', - 'x-height': 'xHeight', - xlinkactuate: 'xlinkActuate', - 'xlink:actuate': 'xlinkActuate', - xlinkarcrole: 'xlinkArcrole', - 'xlink:arcrole': 'xlinkArcrole', - xlinkhref: 'xlinkHref', - 'xlink:href': 'xlinkHref', - xlinkrole: 'xlinkRole', - 'xlink:role': 'xlinkRole', - xlinkshow: 'xlinkShow', - 'xlink:show': 'xlinkShow', - xlinktitle: 'xlinkTitle', - 'xlink:title': 'xlinkTitle', - xlinktype: 'xlinkType', - 'xlink:type': 'xlinkType', - xmlbase: 'xmlBase', - 'xml:base': 'xmlBase', - xmllang: 'xmlLang', - 'xml:lang': 'xmlLang', - xmlns: 'xmlns', - 'xml:space': 'xmlSpace', - xmlnsxlink: 'xmlnsXlink', - 'xmlns:xlink': 'xmlnsXlink', - xmlspace: 'xmlSpace', - y1: 'y1', - y2: 'y2', - y: 'y', - ychannelselector: 'yChannelSelector', - z: 'z', - zoomandpan: 'zoomAndPan' -}; - -var warnedProperties = {}; -var EVENT_NAME_REGEX = /^on./; -var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; -var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$') ; -var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$') ; - -function validateProperty(tagName, name, value, eventRegistry) { - { - if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { - return true; - } - - var lowerCasedName = name.toLowerCase(); - - if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); - - warnedProperties[name] = true; - return true; - } // We can't rely on the event system being injected on the server. - - - if (eventRegistry != null) { - var registrationNameDependencies = eventRegistry.registrationNameDependencies, - possibleRegistrationNames = eventRegistry.possibleRegistrationNames; - - if (registrationNameDependencies.hasOwnProperty(name)) { - return true; - } - - var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; - - if (registrationName != null) { - error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); - - warnedProperties[name] = true; - return true; - } - - if (EVENT_NAME_REGEX.test(name)) { - error('Unknown event handler property `%s`. It will be ignored.', name); - - warnedProperties[name] = true; - return true; - } - } else if (EVENT_NAME_REGEX.test(name)) { - // If no event plugins have been injected, we are in a server environment. - // So we can't tell if the event name is correct for sure, but we can filter - // out known bad ones like `onclick`. We can't suggest a specific replacement though. - if (INVALID_EVENT_NAME_REGEX.test(name)) { - error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); - } - - warnedProperties[name] = true; - return true; - } // Let the ARIA attribute hook validate ARIA attributes - - - if (rARIA.test(name) || rARIACamel.test(name)) { - return true; - } - - if (lowerCasedName === 'innerhtml') { - error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'aria') { - error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { - error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); - - warnedProperties[name] = true; - return true; - } - - if (typeof value === 'number' && isNaN(value)) { - error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); - - warnedProperties[name] = true; - return true; - } - - var propertyInfo = getPropertyInfo(name); // Known attributes should match the casing specified in the property config. - - if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { - var standardName = possibleStandardNames[lowerCasedName]; - - if (standardName !== name) { - error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties[name] = true; - return true; - } - } else if (name !== lowerCasedName) { - // Unknown attributes should have lowercase casing since that's how they - // will be cased anyway with server rendering. - error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); - - warnedProperties[name] = true; - return true; - } // Now that we've validated casing, do not validate - // data types for reserved props - - - switch (name) { - case 'dangerouslySetInnerHTML': - case 'children': - case 'style': - case 'suppressContentEditableWarning': - case 'suppressHydrationWarning': - case 'defaultValue': // Reserved - - case 'defaultChecked': - case 'innerHTML': - { - return true; - } - - case 'innerText': // Properties - - case 'textContent': - { - return true; - } - - } - - switch (typeof value) { - case 'boolean': - { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - // Boolean properties can accept boolean values - return true; - } - - default: - { - if (propertyInfo === null) { - var prefix = name.toLowerCase().slice(0, 5); - - if (prefix === 'data-' || prefix === 'aria-') { - return true; - } - } else if (propertyInfo.acceptsBooleans) { - return true; - } - - if (value) { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); - } else { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); - } - - warnedProperties[name] = true; - return true; - } - } - } - - case 'function': - case 'symbol': - // eslint-disable-line - // Warn when a known attribute is a bad type - warnedProperties[name] = true; - return false; - - case 'string': - { - // Warn when passing the strings 'false' or 'true' into a boolean prop - if (value === 'false' || value === 'true') { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - break; - } - - default: - { - if (propertyInfo === null || propertyInfo.type !== BOOLEAN) { - return true; - } - } - } - - error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); - - warnedProperties[name] = true; - return true; - } - } - } - - return true; - } -} - -function warnUnknownProperties(type, props, eventRegistry) { - { - var unknownProps = []; - - for (var key in props) { - var isValid = validateProperty(type, key, props[key], eventRegistry); - - if (!isValid) { - unknownProps.push(key); - } - } - - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (unknownProps.length === 1) { - error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } else if (unknownProps.length > 1) { - error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } - } -} - -function validateProperties(type, props, eventRegistry) { - if (isCustomElement(type) || typeof props.is === 'string') { - return; - } - - warnUnknownProperties(type, props, eventRegistry); -} - -// 'msTransform' is correct, but the other prefixes should be capitalized -var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; -var msPattern$1 = /^-ms-/; -var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon - -var badStyleValueWithSemicolonPattern = /;\s*$/; -var warnedStyleNames = {}; -var warnedStyleValues = {}; -var warnedForNaNValue = false; -var warnedForInfinityValue = false; - -function camelize(string) { - return string.replace(hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); -} - -function warnHyphenatedStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests - // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - // is converted to lowercase `ms`. - camelize(name.replace(msPattern$1, 'ms-'))); - } -} - -function warnBadVendoredStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); - } -} - -function warnStyleValueWithSemicolon(name, value) { - { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - - error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); - } -} - -function warnStyleValueIsNaN(name, value) { - { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - - error('`NaN` is an invalid value for the `%s` css style property.', name); - } -} - -function warnStyleValueIsInfinity(name, value) { - { - if (warnedForInfinityValue) { - return; - } - - warnedForInfinityValue = true; - - error('`Infinity` is an invalid value for the `%s` css style property.', name); - } -} - -function warnValidStyle(name, value) { - { - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value); - } - - if (typeof value === 'number') { - if (isNaN(value)) { - warnStyleValueIsNaN(name); - } else if (!isFinite(value)) { - warnStyleValueIsInfinity(name); - } - } - } -} - -// code copied and modified from escape-html -var matchHtmlRegExp = /["'&<>]/; -/** - * Escapes special characters and HTML entities in a given html string. - * - * @param {string} string HTML string to escape for later insertion - * @return {string} - * @public - */ - -function escapeHtml(string) { - { - checkHtmlStringCoercion(string); - } - - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - // " - escape = '"'; - break; - - case 38: - // & - escape = '&'; - break; - - case 39: - // ' - escape = '''; // modified from escape-html; used to be ''' - - break; - - case 60: - // < - escape = '<'; - break; - - case 62: - // > - escape = '>'; - break; - - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index ? html + str.substring(lastIndex, index) : html; -} // end code copied and modified from escape-html - -/** - * Escapes text to prevent scripting attacks. - * - * @param {*} text Text value to escape. - * @return {string} An escaped string. - */ - - -function escapeTextForBrowser(text) { - if (typeof text === 'boolean' || typeof text === 'number') { - // this shortcircuit helps perf for types that we know will never have - // special characters, especially given that this function is used often - // for numeric dom ids. - return '' + text; - } - - return escapeHtml(text); -} - -var uppercasePattern = /([A-Z])/g; -var msPattern = /^ms-/; -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - */ - -function hyphenateStyleName(name) { - return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); -} - -// and any newline or tab are filtered out as if they're not part of the URL. -// https://url.spec.whatwg.org/#url-parsing -// Tab or newline are defined as \r\n\t: -// https://infra.spec.whatwg.org/#ascii-tab-or-newline -// A C0 control is a code point in the range \u0000 NULL to \u001F -// INFORMATION SEPARATOR ONE, inclusive: -// https://infra.spec.whatwg.org/#c0-control-or-space - -/* eslint-disable max-len */ - -var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; -var didWarn = false; - -function sanitizeURL(url) { - // We should never have symbols here because they get filtered out elsewhere. - // eslint-disable-next-line react-internal/safe-string-coercion - var stringifiedURL = '' + url; - - { - if (!didWarn && isJavaScriptProtocol.test(stringifiedURL)) { - didWarn = true; - - error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(stringifiedURL)); - } - } - - return url; -} - -var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - -function isArray(a) { - return isArrayImpl(a); -} - -// The build script is at scripts/rollup/generate-inline-fizz-runtime.js. -// Run `yarn generate-inline-fizz-runtime` to generate. -var clientRenderBoundary = '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};'; -var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; -var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; - -function getValueDescriptorExpectingObjectForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : "something with type \"" + typeof thing + "\""; -} -function getValueDescriptorExpectingEnumForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : typeof thing === 'string' ? JSON.stringify(thing) : "something with type \"" + typeof thing + "\""; -} - -function compareResourcePropsForWarning(newProps, currentProps) { - { - var propDiffs = null; - var allProps = Array.from(new Set(Object.keys(currentProps).concat(Object.keys(newProps)))); - - for (var i = 0; i < allProps.length; i++) { - var propName = allProps[i]; - var newValue = newProps[propName]; - var currentValue = currentProps[propName]; - - if (newValue !== currentValue && !(newValue == null && currentValue == null)) { - if (newValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.missing[propName] = currentValue; - } else if (currentValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.extra[propName] = newValue; - } else { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.different[propName] = { - original: currentValue, - latest: newValue - }; - } - } - } - - return propDiffs; - } -} - -function describeDifferencesForStylesheets(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'media') { - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName in diff.extra) { - var _propValue = diff.extra[_propName]; - description += "\n \"" + _propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue) + ", missing from original props"; - } - - for (var _propName2 in diff.different) { - var latestValue = diff.different[_propName2].latest; - var originalValue = diff.different[_propName2].original; - description += "\n \"" + _propName2 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForStylesheetOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'precedence' || propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName3 in diff.different) { - var latestValue = diff.different[_propName3].latest; - var originalValue = diff.different[_propName3].original; - - if (_propName3 === 'precedence' && originalValue === 'default') { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", missing from options"; - } else { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreinitOverStylesheet(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName4 in diff.extra) { - var _propValue2 = diff.extra[_propName4]; - - if (_propName4 === 'precedence' || _propName4 === 'crossOrigin' || _propName4 === 'integrity') { - description += "\n \"" + _propName4 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue2) + ", missing from props"; - } - } - - for (var _propName5 in diff.different) { - var latestValue = diff.different[_propName5].latest; - var originalValue = diff.different[_propName5].original; - description += "\n \"" + _propName5 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinits(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName6 in diff.extra) { - var _propValue3 = diff.extra[_propName6]; - - if (_propName6 === 'precedence' && _propValue3 !== 'default' || _propName6 === 'crossOrigin' || _propName6 === 'integrity') { - description += "\n \"" + _propName6 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue3) + ", missing from original options"; - } - } - - for (var _propName7 in diff.different) { - var latestValue = diff.different[_propName7].latest; - var originalValue = diff.different[_propName7].original; - description += "\n \"" + _propName7 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -var preloadOptionsForComparison = ['as', 'crossOrigin', 'integrity', 'media']; -function describeDifferencesForPreloads(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName8 in diff.extra) { - var _propValue4 = diff.extra[_propName8]; - - if (preloadOptionsForComparison.includes(_propName8)) { - description += "\n \"" + _propName8 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue4) + ", missing from original options"; - } - } - - for (var _propName9 in diff.different) { - var latestValue = diff.different[_propName9].latest; - var originalValue = diff.different[_propName9].original; - - if (preloadOptionsForComparison.includes(_propName9)) { - description += "\n \"" + _propName9 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreloadOverImplicitPreload(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, underlying prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName10 in diff.extra) { - var _propValue5 = diff.extra[_propName10]; - - if (preloadOptionsForComparison.includes(_propName10)) { - description += "\n \"" + _propName10 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue5) + ", missing from underlying props"; - } - } - - for (var _propName11 in diff.different) { - var latestValue = diff.different[_propName11].latest; - var originalValue = diff.different[_propName11].original; - - if (preloadOptionsForComparison.includes(_propName11)) { - description += "\n \"" + _propName11 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", underlying prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForScripts(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - - for (var _propName12 in diff.extra) { - var _propValue6 = diff.extra[_propName12]; - description += "\n \"" + _propName12 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue6) + ", missing from original props"; - } - - for (var _propName13 in diff.different) { - var latestValue = diff.different[_propName13].latest; - var originalValue = diff.different[_propName13].original; - description += "\n \"" + _propName13 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForScriptOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName14 in diff.different) { - var latestValue = diff.different[_propName14].latest; - var originalValue = diff.different[_propName14].original; - description += "\n \"" + _propName14 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinitOverScript(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" option value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", missing from props"; - } - } - - for (var _propName15 in diff.different) { - var latestValue = diff.different[_propName15].latest; - var originalValue = diff.different[_propName15].original; - description += "\n \"" + _propName15 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} - -var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher; -var ReactDOMServerDispatcher = { - prefetchDNS: prefetchDNS, - preconnect: preconnect, - preload: preload, - preinit: preinit -} ; -var currentResources = null; -var currentResourcesStack = []; -function prepareToRender(resources) { - currentResourcesStack.push(currentResources); - currentResources = resources; - var previousHostDispatcher = ReactDOMCurrentDispatcher.current; - ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher; - return previousHostDispatcher; -} -function cleanupAfterRender(previousDispatcher) { - currentResources = currentResourcesStack.pop(); - ReactDOMCurrentDispatcher.current = previousDispatcher; -} // Used to distinguish these contexts from ones used in other renderers. -var ScriptStreamingFormat = 0; -var DataStreamingFormat = 1; -var NothingSent -/* */ -= 0; -var SentCompleteSegmentFunction -/* */ -= 1; -var SentCompleteBoundaryFunction -/* */ -= 2; -var SentClientRenderFunction -/* */ -= 4; -var SentStyleInsertionFunction -/* */ -= 8; // Per response, global state that is not contextual to the rendering subtree. - -var dataElementQuotedEnd = stringToPrecomputedChunk('">'); -var startInlineScript = stringToPrecomputedChunk(''); -var startScriptSrc = stringToPrecomputedChunk(''); -/** - * This escaping function is designed to work with bootstrapScriptContent only. - * because we know we are escaping the entire script. We can avoid for instance - * escaping html comment string sequences that are valid javascript as well because - * if there are no sebsequent '); -var completeSegmentData1 = stringToPrecomputedChunk('")),Rc(a,b,c),a=a.responseState.generateStaticMarkup?!0:b.push("\x3c!--/$--\x3e"),a;if(0a.progressiveChunkSize)return d.rootSegmentID=a.nextSegmentId++,a.completedBoundaries.push(d),Na(b,a.responseState,d.id),Rc(a,b,c),b.push("\x3c!--/$--\x3e");(c=a.resources.boundaryResources)&&d.resources.forEach(ib,c);a.responseState.generateStaticMarkup||b.push("\x3c!--$--\x3e");c=d.completedSegments;if(1!==c.length)throw Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React."); -Sc(a,b,c[0]);a=a.responseState.generateStaticMarkup?!0:b.push("\x3c!--/$--\x3e");return a}function Tc(a,b,c){Oa(b,a.responseState,c.formatContext,c.id);Sc(a,b,c);return Pa(b,c.formatContext)} -function Uc(a,b,c){a.resources.boundaryResources=c.resources;for(var d=c.completedSegments,e=0;e"):b.push('">');return b} -function Vc(a,b,c,d){if(2===d.status)return!0;var e=d.id;if(-1===e){if(-1===(d.id=c.rootSegmentID))throw Error("A root segment ID must have been assigned by now. This is a bug in React.");return Tc(a,b,d)}Tc(a,b,d);a=a.responseState;(c=0===a.streamingFormat)?(b.push(a.startInlineScript),0===(a.instructions&1)?(a.instructions|=1,b.push('$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("')): -b.push('$RS("')):b.push('');return b} -function Qc(a,b){try{var c,d=a.completedRootSegment;if(null!==d)if(0===a.pendingRootTasks){db(b,a.resources,a.responseState,0===a.allPendingTasks);Sc(a,b,d);a.completedRootSegment=null;var e=a.responseState.bootstrapChunks;for(d=0;d"):!e.push('">')){a.destination=null;c++;f.splice(0,c);return}}f.splice(0,c);var T=a.completedBoundaries;for(c=0;c")),a.htmlChunks&&(b.push("")),b.push(null))}}function Wc(a,b){if(1===a.status)a.status=2,b.destroy(a.fatalError);else if(2!==a.status&&null===a.destination){a.destination=b;try{Qc(a,b)}catch(c){X(a,c),Y(a,c)}}} -function Xc(a,b){try{var c=a.abortableTasks;if(0 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - printWarning('warn', format, args); - } - } -} -function error(format) { - { - { - for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - args[_key2 - 1] = arguments[_key2]; - } - - printWarning('error', format, args); - } - } -} - -function printWarning(level, format, args) { - // When changing this logic, you might want to also - // update consoleWithStackDev.www.js as well. - { - var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; - var stack = ReactDebugCurrentFrame.getStackAddendum(); - - if (stack !== '') { - format += '%s'; - args = args.concat([stack]); - } // eslint-disable-next-line react-internal/safe-string-coercion - - - var argsWithFormat = args.map(function (item) { - return String(item); - }); // Careful: RN currently depends on this prefix - - argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it - // breaks IE9: https://github.com/facebook/react/issues/13610 - // eslint-disable-next-line react-internal/no-production-logging - - Function.prototype.apply.call(console[level], console, argsWithFormat); - } -} - -function scheduleWork(callback) { - callback(); -} -var VIEW_SIZE = 512; -var currentView = null; -var writtenBytes = 0; -function beginWriting(destination) { - currentView = new Uint8Array(VIEW_SIZE); - writtenBytes = 0; -} -function writeChunk(destination, chunk) { - if (chunk.length === 0) { - return; - } - - if (chunk.length > VIEW_SIZE) { - { - if (precomputedChunkSet.has(chunk)) { - error('A large precomputed chunk was passed to writeChunk without being copied.' + ' Large chunks get enqueued directly and are not copied. This is incompatible with precomputed chunks because you cannot enqueue the same precomputed chunk twice.' + ' Use "cloneChunk" to make a copy of this large precomputed chunk before writing it. This is a bug in React.'); - } - } // this chunk may overflow a single view which implies it was not - // one that is cached by the streaming renderer. We will enqueu - // it directly and expect it is not re-used - - - if (writtenBytes > 0) { - destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes)); - currentView = new Uint8Array(VIEW_SIZE); - writtenBytes = 0; - } - - destination.enqueue(chunk); - return; - } - - var bytesToWrite = chunk; - var allowableBytes = currentView.length - writtenBytes; - - if (allowableBytes < bytesToWrite.length) { - // this chunk would overflow the current view. We enqueue a full view - // and start a new view with the remaining chunk - if (allowableBytes === 0) { - // the current view is already full, send it - destination.enqueue(currentView); - } else { - // fill up the current view and apply the remaining chunk bytes - // to a new view. - currentView.set(bytesToWrite.subarray(0, allowableBytes), writtenBytes); // writtenBytes += allowableBytes; // this can be skipped because we are going to immediately reset the view - - destination.enqueue(currentView); - bytesToWrite = bytesToWrite.subarray(allowableBytes); - } - - currentView = new Uint8Array(VIEW_SIZE); - writtenBytes = 0; - } - - currentView.set(bytesToWrite, writtenBytes); - writtenBytes += bytesToWrite.length; -} -function writeChunkAndReturn(destination, chunk) { - writeChunk(destination, chunk); // in web streams there is no backpressure so we can alwas write more - - return true; -} -function completeWriting(destination) { - if (currentView && writtenBytes > 0) { - destination.enqueue(new Uint8Array(currentView.buffer, 0, writtenBytes)); - currentView = null; - writtenBytes = 0; - } -} -function close(destination) { - destination.close(); -} -var textEncoder = new TextEncoder(); -function stringToChunk(content) { - return textEncoder.encode(content); -} -var precomputedChunkSet = new Set() ; -function stringToPrecomputedChunk(content) { - var precomputedChunk = textEncoder.encode(content); - - { - precomputedChunkSet.add(precomputedChunk); - } - - return precomputedChunk; -} -function clonePrecomputedChunk(precomputedChunk) { - return precomputedChunk.length > VIEW_SIZE ? precomputedChunk.slice() : precomputedChunk; -} -function closeWithError(destination, error) { - // $FlowFixMe[method-unbinding] - if (typeof destination.error === 'function') { - // $FlowFixMe[incompatible-call]: This is an Error object or the destination accepts other types. - destination.error(error); - } else { - // Earlier implementations doesn't support this method. In that environment you're - // supposed to throw from a promise returned but we don't return a promise in our - // approach. We could fork this implementation but this is environment is an edge - // case to begin with. It's even less common to run this in an older environment. - // Even then, this is not where errors are supposed to happen and they get reported - // to a global callback in addition to this anyway. So it's fine just to close this. - destination.close(); - } -} - -function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -} - -var assign = Object.assign; - -/* - * The `'' + value` pattern (used in perf-sensitive code) throws for Symbol - * and Temporal.* types. See https://github.com/facebook/react/pull/22064. - * - * The functions in this module will throw an easier-to-understand, - * easier-to-debug exception with a clear errors message message explaining the - * problem. (Instead of a confusing exception thrown inside the implementation - * of the `value` object). - */ -// $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. -function typeName(value) { - { - // toStringTag is needed for namespaced types like Temporal.Instant - var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; - var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; // $FlowFixMe[incompatible-return] - - return type; - } -} // $FlowFixMe[incompatible-return] only called in DEV, so void return is not possible. - - -function willCoercionThrow(value) { - { - try { - testStringCoercion(value); - return false; - } catch (e) { - return true; - } - } -} - -function testStringCoercion(value) { - // If you ended up here by following an exception call stack, here's what's - // happened: you supplied an object or symbol value to React (as a prop, key, - // DOM attribute, CSS property, string ref, etc.) and when React tried to - // coerce it to a string using `'' + value`, an exception was thrown. - // - // The most common types that will cause this exception are `Symbol` instances - // and Temporal objects like `Temporal.Instant`. But any object that has a - // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this - // exception. (Library authors do this to prevent users from using built-in - // numeric operators like `+` or comparison operators like `>=` because custom - // methods are needed to perform accurate arithmetic or comparison.) - // - // To fix the problem, coerce this object or symbol value to a string before - // passing it to React. The most reliable way is usually `String(value)`. - // - // To find which value is throwing, check the browser or debugger console. - // Before this exception was thrown, there should be `console.error` output - // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the - // problem and how that type was used: key, atrribute, input value prop, etc. - // In most cases, this console output also shows the component and its - // ancestor components where the exception happened. - // - // eslint-disable-next-line react-internal/safe-string-coercion - return '' + value; -} - -function checkAttributeStringCoercion(value, attributeName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkCSSPropertyStringCoercion(value, propName) { - { - if (willCoercionThrow(value)) { - error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} -function checkHtmlStringCoercion(value) { - { - if (willCoercionThrow(value)) { - error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); - - return testStringCoercion(value); // throw (to help callers find troubleshooting comments) - } - } -} - -// ----------------------------------------------------------------------------- -var enableFloat = true; - -// $FlowFixMe[method-unbinding] -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/* eslint-disable max-len */ - -var ATTRIBUTE_NAME_START_CHAR = ":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"; -/* eslint-enable max-len */ - -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; -function isAttributeNameSafe(attributeName) { - if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { - return true; - } - - if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { - return false; - } - - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - - illegalAttributeNameCache[attributeName] = true; - - { - error('Invalid attribute name: `%s`', attributeName); - } - - return false; -} - -// A simple string attribute. -// Attributes that aren't in the filter are presumed to have this type. -var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called -// "enumerated" attributes with "true" and "false" as possible values. -// When true, it should be set to a "true" string. -// When false, it should be set to a "false" string. - -var BOOLEANISH_STRING = 2; // A real boolean attribute. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. - -var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. -// When true, it should be present (set either to an empty string or its name). -// When false, it should be omitted. -// For any other value, should be present with that value. - -var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. -// When falsy, it should be removed. - -var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. -// When falsy, it should be removed. - -var POSITIVE_NUMERIC = 6; -function getPropertyInfo(name) { - return properties.hasOwnProperty(name) ? properties[name] : null; -} // $FlowFixMe[missing-this-annot] - -function PropertyInfoRecord(type, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { - this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; - this.attributeName = attributeName; - this.attributeNamespace = attributeNamespace; - this.type = type; - this.sanitizeURL = sanitizeURL; - this.removeEmptyString = removeEmptyString; -} // When adding attributes to this list, be sure to also add them to -// the `possibleStandardNames` module to ensure casing and incorrect -// name warnings. - - -var properties = {}; // A few React string attributes have a different name. -// This is a mapping from React prop names to the attribute names. - -[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { - var name = _ref[0], - attributeName = _ref[1]; - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(STRING, attributeName, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" HTML attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). - -['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are "enumerated" SVG attributes that accept "true" and "false". -// In React, we let users pass `true` and `false` even though technically -// these aren't boolean attributes (they are coerced to strings). -// Since these are SVG attributes, their attribute names are case-sensitive. - -['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEANISH_STRING, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML boolean attributes. - -['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM -// on the client side because the browsers are inconsistent. Instead we call focus(). -'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata -'itemScope'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(BOOLEAN, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that are "overloaded booleans": they behave like -// booleans, but can also accept a string value. - -['capture', 'download' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(OVERLOADED_BOOLEAN, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be positive numbers. - -['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(POSITIVE_NUMERIC, name, // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These are HTML attributes that must be numbers. - -['rowSpan', 'start'].forEach(function (name) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[name] = new PropertyInfoRecord(NUMERIC, name.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); -var CAMELIZE = /[\-\:]([a-z])/g; - -var capitalize = function (token) { - return token[1].toUpperCase(); -}; // This is a list of all SVG attributes that need special casing, namespacing, -// or boolean value assignment. Regular attributes that just accept strings -// and have the same names are omitted, just like in the HTML attribute filter. -// Some of these attributes can be hard to find. This list was created by -// scraping the MDN documentation. - - -['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', 'transform-origin', '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' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, null, // attributeNamespace - false, // sanitizeURL - false); -}); // String SVG attributes with the xlink namespace. - -['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL - false); -}); // String SVG attributes with the xml namespace. - -['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, -// you'll need to set attributeName to name.toLowerCase() -// instead in the assignment below. -].forEach(function (attributeName) { - var name = attributeName.replace(CAMELIZE, capitalize); // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - - properties[name] = new PropertyInfoRecord(STRING, attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL - false); -}); // These attribute exists both in HTML and SVG. -// The attribute name is case-sensitive in SVG so we can't just use -// the React name like we do for attributes that exist only in HTML. - -['tabIndex', 'crossOrigin'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - false, // sanitizeURL - false); -}); // These attributes accept URLs. These must not allow javascript: URLS. -// These will also need to accept Trusted Types object in the future. - -var xlinkHref = 'xlinkHref'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[xlinkHref] = new PropertyInfoRecord(STRING, 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL -false); -var formAction = 'formAction'; // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - -properties[formAction] = new PropertyInfoRecord(STRING, 'formaction', // attributeName -null, // attributeNamespace -true, // sanitizeURL -false); -['src', 'href', 'action'].forEach(function (attributeName) { - // $FlowFixMe[invalid-constructor] Flow no longer supports calling new on functions - properties[attributeName] = new PropertyInfoRecord(STRING, attributeName.toLowerCase(), // attributeName - null, // attributeNamespace - true, // sanitizeURL - true); -}); - -/** - * CSS properties which accept numbers but are not in units of "px". - */ -function isUnitlessNumber (name) { - switch (name) { - case 'animationIterationCount': - case 'aspectRatio': - case 'borderImageOutset': - case 'borderImageSlice': - case 'borderImageWidth': - case 'boxFlex': - case 'boxFlexGroup': - case 'boxOrdinalGroup': - case 'columnCount': - case 'columns': - case 'flex': - case 'flexGrow': - case 'flexPositive': - case 'flexShrink': - case 'flexNegative': - case 'flexOrder': - case 'gridArea': - case 'gridRow': - case 'gridRowEnd': - case 'gridRowSpan': - case 'gridRowStart': - case 'gridColumn': - case 'gridColumnEnd': - case 'gridColumnSpan': - case 'gridColumnStart': - case 'fontWeight': - case 'lineClamp': - case 'lineHeight': - case 'opacity': - case 'order': - case 'orphans': - case 'scale': - case 'tabSize': - case 'widows': - case 'zIndex': - case 'zoom': - case 'fillOpacity': // SVG-related properties - - case 'floodOpacity': - case 'stopOpacity': - case 'strokeDasharray': - case 'strokeDashoffset': - case 'strokeMiterlimit': - case 'strokeOpacity': - case 'strokeWidth': - case 'MozAnimationIterationCount': // Known Prefixed Properties - - case 'MozBoxFlex': // TODO: Remove these since they shouldn't be used in modern code - - case 'MozBoxFlexGroup': - case 'MozLineClamp': - case 'msAnimationIterationCount': - case 'msFlex': - case 'msZoom': - case 'msFlexGrow': - case 'msFlexNegative': - case 'msFlexOrder': - case 'msFlexPositive': - case 'msFlexShrink': - case 'msGridColumn': - case 'msGridColumnSpan': - case 'msGridRow': - case 'msGridRowSpan': - case 'WebkitAnimationIterationCount': - case 'WebkitBoxFlex': - case 'WebKitBoxFlexGroup': - case 'WebkitBoxOrdinalGroup': - case 'WebkitColumnCount': - case 'WebkitColumns': - case 'WebkitFlex': - case 'WebkitFlexGrow': - case 'WebkitFlexPositive': - case 'WebkitFlexShrink': - case 'WebkitLineClamp': - return true; - - default: - return false; - } -} - -var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true -}; -function checkControlledValueProps(tagName, props) { - { - if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { - error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - - if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { - error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); - } - } -} - -var ariaProperties = { - 'aria-current': 0, - // state - 'aria-description': 0, - 'aria-details': 0, - 'aria-disabled': 0, - // state - 'aria-hidden': 0, - // state - 'aria-invalid': 0, - // state - 'aria-keyshortcuts': 0, - 'aria-label': 0, - 'aria-roledescription': 0, - // Widget Attributes - 'aria-autocomplete': 0, - 'aria-checked': 0, - 'aria-expanded': 0, - 'aria-haspopup': 0, - 'aria-level': 0, - 'aria-modal': 0, - 'aria-multiline': 0, - 'aria-multiselectable': 0, - 'aria-orientation': 0, - 'aria-placeholder': 0, - 'aria-pressed': 0, - 'aria-readonly': 0, - 'aria-required': 0, - 'aria-selected': 0, - 'aria-sort': 0, - 'aria-valuemax': 0, - 'aria-valuemin': 0, - 'aria-valuenow': 0, - 'aria-valuetext': 0, - // Live Region Attributes - 'aria-atomic': 0, - 'aria-busy': 0, - 'aria-live': 0, - 'aria-relevant': 0, - // Drag-and-Drop Attributes - 'aria-dropeffect': 0, - 'aria-grabbed': 0, - // Relationship Attributes - 'aria-activedescendant': 0, - 'aria-colcount': 0, - 'aria-colindex': 0, - 'aria-colspan': 0, - 'aria-controls': 0, - 'aria-describedby': 0, - 'aria-errormessage': 0, - 'aria-flowto': 0, - 'aria-labelledby': 0, - 'aria-owns': 0, - 'aria-posinset': 0, - 'aria-rowcount': 0, - 'aria-rowindex': 0, - 'aria-rowspan': 0, - 'aria-setsize': 0 -}; - -var warnedProperties$1 = {}; -var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); -var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); - -function validateProperty$1(tagName, name) { - { - if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { - return true; - } - - if (rARIACamel$1.test(name)) { - var ariaName = 'aria-' + name.slice(4).toLowerCase(); - var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (correctName == null) { - error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); - - warnedProperties$1[name] = true; - return true; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== correctName) { - error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); - - warnedProperties$1[name] = true; - return true; - } - } - - if (rARIA$1.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - - if (standardName == null) { - warnedProperties$1[name] = true; - return false; - } // aria-* attributes should be lowercase; suggest the lowercase version. - - - if (name !== standardName) { - error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties$1[name] = true; - return true; - } - } - } - - return true; -} - -function validateProperties$2(type, props) { - { - var invalidProps = []; - - for (var key in props) { - var isValid = validateProperty$1(type, key); - - if (!isValid) { - invalidProps.push(key); - } - } - - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (invalidProps.length === 1) { - error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } else if (invalidProps.length > 1) { - error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); - } - } -} - -var didWarnValueNull = false; -function validateProperties$1(type, props) { - { - if (type !== 'input' && type !== 'textarea' && type !== 'select') { - return; - } - - if (props != null && props.value === null && !didWarnValueNull) { - didWarnValueNull = true; - - if (type === 'select' && props.multiple) { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); - } else { - error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); - } - } - } -} - -function isCustomElement(tagName, props) { - if (tagName.indexOf('-') === -1) { - return false; - } - - switch (tagName) { - // These are reserved SVG and MathML elements. - // We don't mind this list too much because we expect it to never grow. - // The alternative is to track the namespace in a few places which is convoluted. - // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts - case 'annotation-xml': - case 'color-profile': - case 'font-face': - case 'font-face-src': - case 'font-face-uri': - case 'font-face-format': - case 'font-face-name': - case 'missing-glyph': - return false; - - default: - return true; - } -} - -// When adding attributes to the HTML or SVG allowed attribute list, be sure to -// also add them to this module to ensure casing and incorrect name -// warnings. -var possibleStandardNames = { - // HTML - accept: 'accept', - acceptcharset: 'acceptCharset', - 'accept-charset': 'acceptCharset', - accesskey: 'accessKey', - action: 'action', - allowfullscreen: 'allowFullScreen', - alt: 'alt', - as: 'as', - async: 'async', - autocapitalize: 'autoCapitalize', - autocomplete: 'autoComplete', - autocorrect: 'autoCorrect', - autofocus: 'autoFocus', - autoplay: 'autoPlay', - autosave: 'autoSave', - capture: 'capture', - cellpadding: 'cellPadding', - cellspacing: 'cellSpacing', - challenge: 'challenge', - charset: 'charSet', - checked: 'checked', - children: 'children', - cite: 'cite', - class: 'className', - classid: 'classID', - classname: 'className', - cols: 'cols', - colspan: 'colSpan', - content: 'content', - contenteditable: 'contentEditable', - contextmenu: 'contextMenu', - controls: 'controls', - controlslist: 'controlsList', - coords: 'coords', - crossorigin: 'crossOrigin', - dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', - data: 'data', - datetime: 'dateTime', - default: 'default', - defaultchecked: 'defaultChecked', - defaultvalue: 'defaultValue', - defer: 'defer', - dir: 'dir', - disabled: 'disabled', - disablepictureinpicture: 'disablePictureInPicture', - disableremoteplayback: 'disableRemotePlayback', - download: 'download', - draggable: 'draggable', - enctype: 'encType', - enterkeyhint: 'enterKeyHint', - fetchpriority: 'fetchPriority', - for: 'htmlFor', - form: 'form', - formmethod: 'formMethod', - formaction: 'formAction', - formenctype: 'formEncType', - formnovalidate: 'formNoValidate', - formtarget: 'formTarget', - frameborder: 'frameBorder', - headers: 'headers', - height: 'height', - hidden: 'hidden', - high: 'high', - href: 'href', - hreflang: 'hrefLang', - htmlfor: 'htmlFor', - httpequiv: 'httpEquiv', - 'http-equiv': 'httpEquiv', - icon: 'icon', - id: 'id', - imagesizes: 'imageSizes', - imagesrcset: 'imageSrcSet', - innerhtml: 'innerHTML', - inputmode: 'inputMode', - integrity: 'integrity', - is: 'is', - itemid: 'itemID', - itemprop: 'itemProp', - itemref: 'itemRef', - itemscope: 'itemScope', - itemtype: 'itemType', - keyparams: 'keyParams', - keytype: 'keyType', - kind: 'kind', - label: 'label', - lang: 'lang', - list: 'list', - loop: 'loop', - low: 'low', - manifest: 'manifest', - marginwidth: 'marginWidth', - marginheight: 'marginHeight', - max: 'max', - maxlength: 'maxLength', - media: 'media', - mediagroup: 'mediaGroup', - method: 'method', - min: 'min', - minlength: 'minLength', - multiple: 'multiple', - muted: 'muted', - name: 'name', - nomodule: 'noModule', - nonce: 'nonce', - novalidate: 'noValidate', - open: 'open', - optimum: 'optimum', - pattern: 'pattern', - placeholder: 'placeholder', - playsinline: 'playsInline', - poster: 'poster', - preload: 'preload', - profile: 'profile', - radiogroup: 'radioGroup', - readonly: 'readOnly', - referrerpolicy: 'referrerPolicy', - rel: 'rel', - required: 'required', - reversed: 'reversed', - role: 'role', - rows: 'rows', - rowspan: 'rowSpan', - sandbox: 'sandbox', - scope: 'scope', - scoped: 'scoped', - scrolling: 'scrolling', - seamless: 'seamless', - selected: 'selected', - shape: 'shape', - size: 'size', - sizes: 'sizes', - span: 'span', - spellcheck: 'spellCheck', - src: 'src', - srcdoc: 'srcDoc', - srclang: 'srcLang', - srcset: 'srcSet', - start: 'start', - step: 'step', - style: 'style', - summary: 'summary', - tabindex: 'tabIndex', - target: 'target', - title: 'title', - type: 'type', - usemap: 'useMap', - value: 'value', - width: 'width', - wmode: 'wmode', - wrap: 'wrap', - // SVG - about: 'about', - accentheight: 'accentHeight', - 'accent-height': 'accentHeight', - accumulate: 'accumulate', - additive: 'additive', - alignmentbaseline: 'alignmentBaseline', - 'alignment-baseline': 'alignmentBaseline', - allowreorder: 'allowReorder', - alphabetic: 'alphabetic', - amplitude: 'amplitude', - arabicform: 'arabicForm', - 'arabic-form': 'arabicForm', - ascent: 'ascent', - attributename: 'attributeName', - attributetype: 'attributeType', - autoreverse: 'autoReverse', - azimuth: 'azimuth', - basefrequency: 'baseFrequency', - baselineshift: 'baselineShift', - 'baseline-shift': 'baselineShift', - baseprofile: 'baseProfile', - bbox: 'bbox', - begin: 'begin', - bias: 'bias', - by: 'by', - calcmode: 'calcMode', - capheight: 'capHeight', - 'cap-height': 'capHeight', - clip: 'clip', - clippath: 'clipPath', - 'clip-path': 'clipPath', - clippathunits: 'clipPathUnits', - cliprule: 'clipRule', - 'clip-rule': 'clipRule', - color: 'color', - colorinterpolation: 'colorInterpolation', - 'color-interpolation': 'colorInterpolation', - colorinterpolationfilters: 'colorInterpolationFilters', - 'color-interpolation-filters': 'colorInterpolationFilters', - colorprofile: 'colorProfile', - 'color-profile': 'colorProfile', - colorrendering: 'colorRendering', - 'color-rendering': 'colorRendering', - contentscripttype: 'contentScriptType', - contentstyletype: 'contentStyleType', - cursor: 'cursor', - cx: 'cx', - cy: 'cy', - d: 'd', - datatype: 'datatype', - decelerate: 'decelerate', - descent: 'descent', - diffuseconstant: 'diffuseConstant', - direction: 'direction', - display: 'display', - divisor: 'divisor', - dominantbaseline: 'dominantBaseline', - 'dominant-baseline': 'dominantBaseline', - dur: 'dur', - dx: 'dx', - dy: 'dy', - edgemode: 'edgeMode', - elevation: 'elevation', - enablebackground: 'enableBackground', - 'enable-background': 'enableBackground', - end: 'end', - exponent: 'exponent', - externalresourcesrequired: 'externalResourcesRequired', - fill: 'fill', - fillopacity: 'fillOpacity', - 'fill-opacity': 'fillOpacity', - fillrule: 'fillRule', - 'fill-rule': 'fillRule', - filter: 'filter', - filterres: 'filterRes', - filterunits: 'filterUnits', - floodopacity: 'floodOpacity', - 'flood-opacity': 'floodOpacity', - floodcolor: 'floodColor', - 'flood-color': 'floodColor', - focusable: 'focusable', - fontfamily: 'fontFamily', - 'font-family': 'fontFamily', - fontsize: 'fontSize', - 'font-size': 'fontSize', - fontsizeadjust: 'fontSizeAdjust', - 'font-size-adjust': 'fontSizeAdjust', - fontstretch: 'fontStretch', - 'font-stretch': 'fontStretch', - fontstyle: 'fontStyle', - 'font-style': 'fontStyle', - fontvariant: 'fontVariant', - 'font-variant': 'fontVariant', - fontweight: 'fontWeight', - 'font-weight': 'fontWeight', - format: 'format', - from: 'from', - fx: 'fx', - fy: 'fy', - g1: 'g1', - g2: 'g2', - glyphname: 'glyphName', - 'glyph-name': 'glyphName', - glyphorientationhorizontal: 'glyphOrientationHorizontal', - 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', - glyphorientationvertical: 'glyphOrientationVertical', - 'glyph-orientation-vertical': 'glyphOrientationVertical', - glyphref: 'glyphRef', - gradienttransform: 'gradientTransform', - gradientunits: 'gradientUnits', - hanging: 'hanging', - horizadvx: 'horizAdvX', - 'horiz-adv-x': 'horizAdvX', - horizoriginx: 'horizOriginX', - 'horiz-origin-x': 'horizOriginX', - ideographic: 'ideographic', - imagerendering: 'imageRendering', - 'image-rendering': 'imageRendering', - in2: 'in2', - in: 'in', - inlist: 'inlist', - intercept: 'intercept', - k1: 'k1', - k2: 'k2', - k3: 'k3', - k4: 'k4', - k: 'k', - kernelmatrix: 'kernelMatrix', - kernelunitlength: 'kernelUnitLength', - kerning: 'kerning', - keypoints: 'keyPoints', - keysplines: 'keySplines', - keytimes: 'keyTimes', - lengthadjust: 'lengthAdjust', - letterspacing: 'letterSpacing', - 'letter-spacing': 'letterSpacing', - lightingcolor: 'lightingColor', - 'lighting-color': 'lightingColor', - limitingconeangle: 'limitingConeAngle', - local: 'local', - markerend: 'markerEnd', - 'marker-end': 'markerEnd', - markerheight: 'markerHeight', - markermid: 'markerMid', - 'marker-mid': 'markerMid', - markerstart: 'markerStart', - 'marker-start': 'markerStart', - markerunits: 'markerUnits', - markerwidth: 'markerWidth', - mask: 'mask', - maskcontentunits: 'maskContentUnits', - maskunits: 'maskUnits', - mathematical: 'mathematical', - mode: 'mode', - numoctaves: 'numOctaves', - offset: 'offset', - opacity: 'opacity', - operator: 'operator', - order: 'order', - orient: 'orient', - orientation: 'orientation', - origin: 'origin', - overflow: 'overflow', - overlineposition: 'overlinePosition', - 'overline-position': 'overlinePosition', - overlinethickness: 'overlineThickness', - 'overline-thickness': 'overlineThickness', - paintorder: 'paintOrder', - 'paint-order': 'paintOrder', - panose1: 'panose1', - 'panose-1': 'panose1', - pathlength: 'pathLength', - patterncontentunits: 'patternContentUnits', - patterntransform: 'patternTransform', - patternunits: 'patternUnits', - pointerevents: 'pointerEvents', - 'pointer-events': 'pointerEvents', - points: 'points', - pointsatx: 'pointsAtX', - pointsaty: 'pointsAtY', - pointsatz: 'pointsAtZ', - prefix: 'prefix', - preservealpha: 'preserveAlpha', - preserveaspectratio: 'preserveAspectRatio', - primitiveunits: 'primitiveUnits', - property: 'property', - r: 'r', - radius: 'radius', - refx: 'refX', - refy: 'refY', - renderingintent: 'renderingIntent', - 'rendering-intent': 'renderingIntent', - repeatcount: 'repeatCount', - repeatdur: 'repeatDur', - requiredextensions: 'requiredExtensions', - requiredfeatures: 'requiredFeatures', - resource: 'resource', - restart: 'restart', - result: 'result', - results: 'results', - rotate: 'rotate', - rx: 'rx', - ry: 'ry', - scale: 'scale', - security: 'security', - seed: 'seed', - shaperendering: 'shapeRendering', - 'shape-rendering': 'shapeRendering', - slope: 'slope', - spacing: 'spacing', - specularconstant: 'specularConstant', - specularexponent: 'specularExponent', - speed: 'speed', - spreadmethod: 'spreadMethod', - startoffset: 'startOffset', - stddeviation: 'stdDeviation', - stemh: 'stemh', - stemv: 'stemv', - stitchtiles: 'stitchTiles', - stopcolor: 'stopColor', - 'stop-color': 'stopColor', - stopopacity: 'stopOpacity', - 'stop-opacity': 'stopOpacity', - strikethroughposition: 'strikethroughPosition', - 'strikethrough-position': 'strikethroughPosition', - strikethroughthickness: 'strikethroughThickness', - 'strikethrough-thickness': 'strikethroughThickness', - string: 'string', - stroke: 'stroke', - strokedasharray: 'strokeDasharray', - 'stroke-dasharray': 'strokeDasharray', - strokedashoffset: 'strokeDashoffset', - 'stroke-dashoffset': 'strokeDashoffset', - strokelinecap: 'strokeLinecap', - 'stroke-linecap': 'strokeLinecap', - strokelinejoin: 'strokeLinejoin', - 'stroke-linejoin': 'strokeLinejoin', - strokemiterlimit: 'strokeMiterlimit', - 'stroke-miterlimit': 'strokeMiterlimit', - strokewidth: 'strokeWidth', - 'stroke-width': 'strokeWidth', - strokeopacity: 'strokeOpacity', - 'stroke-opacity': 'strokeOpacity', - suppresscontenteditablewarning: 'suppressContentEditableWarning', - suppresshydrationwarning: 'suppressHydrationWarning', - surfacescale: 'surfaceScale', - systemlanguage: 'systemLanguage', - tablevalues: 'tableValues', - targetx: 'targetX', - targety: 'targetY', - textanchor: 'textAnchor', - 'text-anchor': 'textAnchor', - textdecoration: 'textDecoration', - 'text-decoration': 'textDecoration', - textlength: 'textLength', - textrendering: 'textRendering', - 'text-rendering': 'textRendering', - to: 'to', - transform: 'transform', - transformorigin: 'transformOrigin', - 'transform-origin': 'transformOrigin', - typeof: 'typeof', - u1: 'u1', - u2: 'u2', - underlineposition: 'underlinePosition', - 'underline-position': 'underlinePosition', - underlinethickness: 'underlineThickness', - 'underline-thickness': 'underlineThickness', - unicode: 'unicode', - unicodebidi: 'unicodeBidi', - 'unicode-bidi': 'unicodeBidi', - unicoderange: 'unicodeRange', - 'unicode-range': 'unicodeRange', - unitsperem: 'unitsPerEm', - 'units-per-em': 'unitsPerEm', - unselectable: 'unselectable', - valphabetic: 'vAlphabetic', - 'v-alphabetic': 'vAlphabetic', - values: 'values', - vectoreffect: 'vectorEffect', - 'vector-effect': 'vectorEffect', - version: 'version', - vertadvy: 'vertAdvY', - 'vert-adv-y': 'vertAdvY', - vertoriginx: 'vertOriginX', - 'vert-origin-x': 'vertOriginX', - vertoriginy: 'vertOriginY', - 'vert-origin-y': 'vertOriginY', - vhanging: 'vHanging', - 'v-hanging': 'vHanging', - videographic: 'vIdeographic', - 'v-ideographic': 'vIdeographic', - viewbox: 'viewBox', - viewtarget: 'viewTarget', - visibility: 'visibility', - vmathematical: 'vMathematical', - 'v-mathematical': 'vMathematical', - vocab: 'vocab', - widths: 'widths', - wordspacing: 'wordSpacing', - 'word-spacing': 'wordSpacing', - writingmode: 'writingMode', - 'writing-mode': 'writingMode', - x1: 'x1', - x2: 'x2', - x: 'x', - xchannelselector: 'xChannelSelector', - xheight: 'xHeight', - 'x-height': 'xHeight', - xlinkactuate: 'xlinkActuate', - 'xlink:actuate': 'xlinkActuate', - xlinkarcrole: 'xlinkArcrole', - 'xlink:arcrole': 'xlinkArcrole', - xlinkhref: 'xlinkHref', - 'xlink:href': 'xlinkHref', - xlinkrole: 'xlinkRole', - 'xlink:role': 'xlinkRole', - xlinkshow: 'xlinkShow', - 'xlink:show': 'xlinkShow', - xlinktitle: 'xlinkTitle', - 'xlink:title': 'xlinkTitle', - xlinktype: 'xlinkType', - 'xlink:type': 'xlinkType', - xmlbase: 'xmlBase', - 'xml:base': 'xmlBase', - xmllang: 'xmlLang', - 'xml:lang': 'xmlLang', - xmlns: 'xmlns', - 'xml:space': 'xmlSpace', - xmlnsxlink: 'xmlnsXlink', - 'xmlns:xlink': 'xmlnsXlink', - xmlspace: 'xmlSpace', - y1: 'y1', - y2: 'y2', - y: 'y', - ychannelselector: 'yChannelSelector', - z: 'z', - zoomandpan: 'zoomAndPan' -}; - -var warnedProperties = {}; -var EVENT_NAME_REGEX = /^on./; -var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; -var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$') ; -var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$') ; - -function validateProperty(tagName, name, value, eventRegistry) { - { - if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { - return true; - } - - var lowerCasedName = name.toLowerCase(); - - if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { - error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); - - warnedProperties[name] = true; - return true; - } // We can't rely on the event system being injected on the server. - - - if (eventRegistry != null) { - var registrationNameDependencies = eventRegistry.registrationNameDependencies, - possibleRegistrationNames = eventRegistry.possibleRegistrationNames; - - if (registrationNameDependencies.hasOwnProperty(name)) { - return true; - } - - var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; - - if (registrationName != null) { - error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); - - warnedProperties[name] = true; - return true; - } - - if (EVENT_NAME_REGEX.test(name)) { - error('Unknown event handler property `%s`. It will be ignored.', name); - - warnedProperties[name] = true; - return true; - } - } else if (EVENT_NAME_REGEX.test(name)) { - // If no event plugins have been injected, we are in a server environment. - // So we can't tell if the event name is correct for sure, but we can filter - // out known bad ones like `onclick`. We can't suggest a specific replacement though. - if (INVALID_EVENT_NAME_REGEX.test(name)) { - error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); - } - - warnedProperties[name] = true; - return true; - } // Let the ARIA attribute hook validate ARIA attributes - - - if (rARIA.test(name) || rARIACamel.test(name)) { - return true; - } - - if (lowerCasedName === 'innerhtml') { - error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'aria') { - error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); - - warnedProperties[name] = true; - return true; - } - - if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { - error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); - - warnedProperties[name] = true; - return true; - } - - if (typeof value === 'number' && isNaN(value)) { - error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); - - warnedProperties[name] = true; - return true; - } - - var propertyInfo = getPropertyInfo(name); // Known attributes should match the casing specified in the property config. - - if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { - var standardName = possibleStandardNames[lowerCasedName]; - - if (standardName !== name) { - error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); - - warnedProperties[name] = true; - return true; - } - } else if (name !== lowerCasedName) { - // Unknown attributes should have lowercase casing since that's how they - // will be cased anyway with server rendering. - error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); - - warnedProperties[name] = true; - return true; - } // Now that we've validated casing, do not validate - // data types for reserved props - - - switch (name) { - case 'dangerouslySetInnerHTML': - case 'children': - case 'style': - case 'suppressContentEditableWarning': - case 'suppressHydrationWarning': - case 'defaultValue': // Reserved - - case 'defaultChecked': - case 'innerHTML': - { - return true; - } - - case 'innerText': // Properties - - case 'textContent': - { - return true; - } - - } - - switch (typeof value) { - case 'boolean': - { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - // Boolean properties can accept boolean values - return true; - } - - default: - { - if (propertyInfo === null) { - var prefix = name.toLowerCase().slice(0, 5); - - if (prefix === 'data-' || prefix === 'aria-') { - return true; - } - } else if (propertyInfo.acceptsBooleans) { - return true; - } - - if (value) { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); - } else { - error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); - } - - warnedProperties[name] = true; - return true; - } - } - } - - case 'function': - case 'symbol': - // eslint-disable-line - // Warn when a known attribute is a bad type - warnedProperties[name] = true; - return false; - - case 'string': - { - // Warn when passing the strings 'false' or 'true' into a boolean prop - if (value === 'false' || value === 'true') { - switch (name) { - case 'checked': - case 'selected': - case 'multiple': - case 'muted': - { - break; - } - - default: - { - if (propertyInfo === null || propertyInfo.type !== BOOLEAN) { - return true; - } - } - } - - error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); - - warnedProperties[name] = true; - return true; - } - } - } - - return true; - } -} - -function warnUnknownProperties(type, props, eventRegistry) { - { - var unknownProps = []; - - for (var key in props) { - var isValid = validateProperty(type, key, props[key], eventRegistry); - - if (!isValid) { - unknownProps.push(key); - } - } - - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (unknownProps.length === 1) { - error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } else if (unknownProps.length > 1) { - error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); - } - } -} - -function validateProperties(type, props, eventRegistry) { - if (isCustomElement(type) || typeof props.is === 'string') { - return; - } - - warnUnknownProperties(type, props, eventRegistry); -} - -// 'msTransform' is correct, but the other prefixes should be capitalized -var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; -var msPattern$1 = /^-ms-/; -var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon - -var badStyleValueWithSemicolonPattern = /;\s*$/; -var warnedStyleNames = {}; -var warnedStyleValues = {}; -var warnedForNaNValue = false; -var warnedForInfinityValue = false; - -function camelize(string) { - return string.replace(hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); -} - -function warnHyphenatedStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests - // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - // is converted to lowercase `ms`. - camelize(name.replace(msPattern$1, 'ms-'))); - } -} - -function warnBadVendoredStyleName(name) { - { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - - error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); - } -} - -function warnStyleValueWithSemicolon(name, value) { - { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - - error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); - } -} - -function warnStyleValueIsNaN(name, value) { - { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - - error('`NaN` is an invalid value for the `%s` css style property.', name); - } -} - -function warnStyleValueIsInfinity(name, value) { - { - if (warnedForInfinityValue) { - return; - } - - warnedForInfinityValue = true; - - error('`Infinity` is an invalid value for the `%s` css style property.', name); - } -} - -function warnValidStyle(name, value) { - { - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value); - } - - if (typeof value === 'number') { - if (isNaN(value)) { - warnStyleValueIsNaN(name); - } else if (!isFinite(value)) { - warnStyleValueIsInfinity(name); - } - } - } -} - -// code copied and modified from escape-html -var matchHtmlRegExp = /["'&<>]/; -/** - * Escapes special characters and HTML entities in a given html string. - * - * @param {string} string HTML string to escape for later insertion - * @return {string} - * @public - */ - -function escapeHtml(string) { - { - checkHtmlStringCoercion(string); - } - - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - // " - escape = '"'; - break; - - case 38: - // & - escape = '&'; - break; - - case 39: - // ' - escape = '''; // modified from escape-html; used to be ''' - - break; - - case 60: - // < - escape = '<'; - break; - - case 62: - // > - escape = '>'; - break; - - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index ? html + str.substring(lastIndex, index) : html; -} // end code copied and modified from escape-html - -/** - * Escapes text to prevent scripting attacks. - * - * @param {*} text Text value to escape. - * @return {string} An escaped string. - */ - - -function escapeTextForBrowser(text) { - if (typeof text === 'boolean' || typeof text === 'number') { - // this shortcircuit helps perf for types that we know will never have - // special characters, especially given that this function is used often - // for numeric dom ids. - return '' + text; - } - - return escapeHtml(text); -} - -var uppercasePattern = /([A-Z])/g; -var msPattern = /^ms-/; -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - */ - -function hyphenateStyleName(name) { - return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); -} - -// and any newline or tab are filtered out as if they're not part of the URL. -// https://url.spec.whatwg.org/#url-parsing -// Tab or newline are defined as \r\n\t: -// https://infra.spec.whatwg.org/#ascii-tab-or-newline -// A C0 control is a code point in the range \u0000 NULL to \u001F -// INFORMATION SEPARATOR ONE, inclusive: -// https://infra.spec.whatwg.org/#c0-control-or-space - -/* eslint-disable max-len */ - -var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; -var didWarn = false; - -function sanitizeURL(url) { - // We should never have symbols here because they get filtered out elsewhere. - // eslint-disable-next-line react-internal/safe-string-coercion - var stringifiedURL = '' + url; - - { - if (!didWarn && isJavaScriptProtocol.test(stringifiedURL)) { - didWarn = true; - - error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(stringifiedURL)); - } - } - - return url; -} - -var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare - -function isArray(a) { - return isArrayImpl(a); -} - -// The build script is at scripts/rollup/generate-inline-fizz-runtime.js. -// Run `yarn generate-inline-fizz-runtime` to generate. -var clientRenderBoundary = '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};'; -var completeBoundary = '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};'; -var completeBoundaryWithStyles = '$RM=new Map;\n$RR=function(r,t,w){for(var u=$RC,n=$RM,p=new Map,q=document,g,b,h=q.querySelectorAll("link[data-precedence],style[data-precedence]"),v=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?v.push(b):("LINK"===b.tagName&&n.set(b.getAttribute("href"),b),p.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var f=w[b++];if(!f){k=!1;b=0;continue}var c=!1,m=0;var d=f[m++];if(a=n.get(d)){var e=a._p;c=!0}else{a=q.createElement("link");a.href=d;a.rel="stylesheet";for(a.dataset.precedence=\nl=f[m++];e=f[m++];)a.setAttribute(e,f[m++]);e=a._p=new Promise(function(x,y){a.onload=x;a.onerror=y});n.set(d,a)}d=a.getAttribute("media");!e||"l"===e.s||d&&!matchMedia(d).matches||h.push(e);if(c)continue}else{a=v[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=p.get(l)||g;c===g&&(g=a);p.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=q.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(u.bind(null,r,t,""),u.bind(null,r,t,"Resource failed to load"))};'; -var completeSegment = '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};'; - -function getValueDescriptorExpectingObjectForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : "something with type \"" + typeof thing + "\""; -} -function getValueDescriptorExpectingEnumForWarning(thing) { - return thing === null ? '`null`' : thing === undefined ? '`undefined`' : thing === '' ? 'an empty string' : typeof thing === 'string' ? JSON.stringify(thing) : "something with type \"" + typeof thing + "\""; -} - -function compareResourcePropsForWarning(newProps, currentProps) { - { - var propDiffs = null; - var allProps = Array.from(new Set(Object.keys(currentProps).concat(Object.keys(newProps)))); - - for (var i = 0; i < allProps.length; i++) { - var propName = allProps[i]; - var newValue = newProps[propName]; - var currentValue = currentProps[propName]; - - if (newValue !== currentValue && !(newValue == null && currentValue == null)) { - if (newValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.missing[propName] = currentValue; - } else if (currentValue == null) { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.extra[propName] = newValue; - } else { - if (propDiffs === null) { - propDiffs = { - missing: {}, - extra: {}, - different: {} - }; - } - - propDiffs.different[propName] = { - original: currentValue, - latest: newValue - }; - } - } - } - - return propDiffs; - } -} - -function describeDifferencesForStylesheets(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'media') { - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName in diff.extra) { - var _propValue = diff.extra[_propName]; - description += "\n \"" + _propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue) + ", missing from original props"; - } - - for (var _propName2 in diff.different) { - var latestValue = diff.different[_propName2].latest; - var originalValue = diff.different[_propName2].original; - description += "\n \"" + _propName2 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForStylesheetOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'precedence' || propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName3 in diff.different) { - var latestValue = diff.different[_propName3].latest; - var originalValue = diff.different[_propName3].original; - - if (_propName3 === 'precedence' && originalValue === 'default') { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", missing from options"; - } else { - description += "\n \"" + _propName3 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreinitOverStylesheet(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName4 in diff.extra) { - var _propValue2 = diff.extra[_propName4]; - - if (_propName4 === 'precedence' || _propName4 === 'crossOrigin' || _propName4 === 'integrity') { - description += "\n \"" + _propName4 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue2) + ", missing from props"; - } - } - - for (var _propName5 in diff.different) { - var latestValue = diff.different[_propName5].latest; - var originalValue = diff.different[_propName5].original; - description += "\n \"" + _propName5 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinits(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (propName === 'precedence' && propValue !== 'default') { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName6 in diff.extra) { - var _propValue3 = diff.extra[_propName6]; - - if (_propName6 === 'precedence' && _propValue3 !== 'default' || _propName6 === 'crossOrigin' || _propName6 === 'integrity') { - description += "\n \"" + _propName6 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue3) + ", missing from original options"; - } - } - - for (var _propName7 in diff.different) { - var latestValue = diff.different[_propName7].latest; - var originalValue = diff.different[_propName7].original; - description += "\n \"" + _propName7 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -var preloadOptionsForComparison = ['as', 'crossOrigin', 'integrity', 'media']; -function describeDifferencesForPreloads(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, original option value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName8 in diff.extra) { - var _propValue4 = diff.extra[_propName8]; - - if (preloadOptionsForComparison.includes(_propName8)) { - description += "\n \"" + _propName8 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue4) + ", missing from original options"; - } - } - - for (var _propName9 in diff.different) { - var latestValue = diff.different[_propName9].latest; - var originalValue = diff.different[_propName9].original; - - if (preloadOptionsForComparison.includes(_propName9)) { - description += "\n \"" + _propName9 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForPreloadOverImplicitPreload(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - - if (preloadOptionsForComparison.includes(propName)) { - description += "\n \"" + propName + "\" missing from options, underlying prop value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - } - - for (var _propName10 in diff.extra) { - var _propValue5 = diff.extra[_propName10]; - - if (preloadOptionsForComparison.includes(_propName10)) { - description += "\n \"" + _propName10 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(_propValue5) + ", missing from underlying props"; - } - } - - for (var _propName11 in diff.different) { - var latestValue = diff.different[_propName11].latest; - var originalValue = diff.different[_propName11].original; - - if (preloadOptionsForComparison.includes(_propName11)) { - description += "\n \"" + _propName11 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", underlying prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - } - - return description; -} -function describeDifferencesForScripts(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.missing) { - var propValue = diff.missing[propName]; - description += "\n \"" + propName + "\" missing for props, original value: " + getValueDescriptorExpectingEnumForWarning(propValue); - } - - for (var _propName12 in diff.extra) { - var _propValue6 = diff.extra[_propName12]; - description += "\n \"" + _propName12 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(_propValue6) + ", missing from original props"; - } - - for (var _propName13 in diff.different) { - var latestValue = diff.different[_propName13].latest; - var originalValue = diff.different[_propName13].original; - description += "\n \"" + _propName13 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", original value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForScriptOverPreinit(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option missing"; - } else { - description += "\n \"" + propName + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", option not available with ReactDOM.preinit()"; - } - } - - for (var _propName14 in diff.different) { - var latestValue = diff.different[_propName14].latest; - var originalValue = diff.different[_propName14].original; - description += "\n \"" + _propName14 + "\" prop value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", option value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} -function describeDifferencesForPreinitOverScript(newProps, currentProps) { - var diff = compareResourcePropsForWarning(newProps, currentProps); - if (!diff) return ''; - var description = ''; - - for (var propName in diff.extra) { - var propValue = diff.extra[propName]; - - if (propName === 'crossOrigin' || propName === 'integrity') { - description += "\n \"" + propName + "\" option value: " + getValueDescriptorExpectingEnumForWarning(propValue) + ", missing from props"; - } - } - - for (var _propName15 in diff.different) { - var latestValue = diff.different[_propName15].latest; - var originalValue = diff.different[_propName15].original; - description += "\n \"" + _propName15 + "\" option value: " + getValueDescriptorExpectingEnumForWarning(latestValue) + ", prop value: " + getValueDescriptorExpectingEnumForWarning(originalValue); - } - - return description; -} - -var ReactDOMSharedInternals = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - -var ReactDOMCurrentDispatcher = ReactDOMSharedInternals.Dispatcher; -var ReactDOMServerDispatcher = { - prefetchDNS: prefetchDNS, - preconnect: preconnect, - preload: preload, - preinit: preinit -} ; -var currentResources = null; -var currentResourcesStack = []; -function prepareToRender(resources) { - currentResourcesStack.push(currentResources); - currentResources = resources; - var previousHostDispatcher = ReactDOMCurrentDispatcher.current; - ReactDOMCurrentDispatcher.current = ReactDOMServerDispatcher; - return previousHostDispatcher; -} -function cleanupAfterRender(previousDispatcher) { - currentResources = currentResourcesStack.pop(); - ReactDOMCurrentDispatcher.current = previousDispatcher; -} // Used to distinguish these contexts from ones used in other renderers. -var ScriptStreamingFormat = 0; -var DataStreamingFormat = 1; -var NothingSent -/* */ -= 0; -var SentCompleteSegmentFunction -/* */ -= 1; -var SentCompleteBoundaryFunction -/* */ -= 2; -var SentClientRenderFunction -/* */ -= 4; -var SentStyleInsertionFunction -/* */ -= 8; // Per response, global state that is not contextual to the rendering subtree. - -var dataElementQuotedEnd = stringToPrecomputedChunk('">'); -var startInlineScript = stringToPrecomputedChunk(''); -var startScriptSrc = stringToPrecomputedChunk(''); -/** - * This escaping function is designed to work with bootstrapScriptContent only. - * because we know we are escaping the entire script. We can avoid for instance - * escaping html comment string sequences that are valid javascript as well because - * if there are no sebsequent '); -var completeSegmentData1 = stringToPrecomputedChunk('