2021-07-30 04:11:27 +03:00
! function ( global , factory ) {
2022-05-04 17:25:28 +03:00
"object" == typeof exports && "undefined" != typeof module ? factory ( exports , require ( "react" ) ) : "function" == typeof define && define . amd ? define ( [
"exports" ,
"react"
2022-01-02 23:54:58 +03:00
] , factory ) : factory ( ( global = global || self ) . ReactDOM = { } , global . React ) ;
2022-06-15 17:36:57 +03:00
} ( this , function ( exports1 , React ) {
2022-05-04 17:25:28 +03:00
"use strict" ;
2022-08-26 13:06:25 +03:00
var prevLog , prevInfo , prevWarn , prevError , prevGroup , prevGroupCollapsed , prevGroupEnd , prefix , componentFrameCache , didWarnValueDefaultValue$1 , reusableSVGContainer , attemptUserBlockingHydration , attemptContinuousHydration , attemptHydrationAtCurrentPriority , attemptHydrationAtPriority , lastMovementX , lastMovementY , lastMouseEvent , warnedUnknownTags , suppressHydrationWarning , validatePropertiesInDevelopment , warnForTextDifference , warnForPropDifference , warnForExtraAttributes , warnForInvalidEventListener , canDiffStyleForHydrationWarning , normalizeMarkupForTextOrAttribute , normalizeHTML , SUPPRESS _HYDRATION _WARNING$1 , fiberStack , warnedAboutMissingGetChildContext , rendererSigil , didWarnUpdateInsideUpdate , currentlyProcessingQueue , didWarnAboutStateAssignmentForComponent , didWarnAboutUninitializedState , didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate , didWarnAboutLegacyLifecyclesAndDerivedState , didWarnAboutUndefinedDerivedState , warnOnUndefinedDerivedState , warnOnInvalidCallback , didWarnAboutDirectlyAssigningPropsToState , didWarnAboutContextTypeAndContextTypes , didWarnAboutInvalidateContextType , didWarnAboutMaps , didWarnAboutGenerators , didWarnAboutStringRefs , ownerHasKeyUseWarning , ownerHasFunctionTypeWarning , rendererSigil$1 , didWarnAboutMismatchedHooksForComponent , didWarnAboutUseOpaqueIdentifier , didWarnAboutBadClass , didWarnAboutModulePatternComponent , didWarnAboutContextTypeOnFunctionComponent , didWarnAboutGetDerivedStateOnFunctionComponent , didWarnAboutFunctionRefs , didWarnAboutReassigningProps , didWarnAboutRevealOrder , didWarnAboutTailOptions , appendAllChildren , updateHostContainer , updateHostComponent$1 , updateHostText$1 , beginWork$1 , didWarnAboutUpdateInRenderForAnotherComponent , hasBadMapPolyfill , didWarnAboutNestedUpdates , didWarnAboutFindNodeInStrictMode , topLevelUpdateWarnings , ReactSharedInternals = React . _ _SECRET _INTERNALS _DO _NOT _USE _OR _YOU _WILL _BE _FIRED ;
2021-07-30 04:11:27 +03:00
function warn ( format ) {
2022-06-11 08:27:13 +03:00
for ( var _len = arguments . length , args = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) args [ _key - 1 ] = arguments [ _key ] ;
2022-05-04 17:25:28 +03:00
printWarning ( "warn" , format , args ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
function error ( format ) {
2022-06-11 08:27:13 +03:00
for ( var _len2 = arguments . length , args = Array ( _len2 > 1 ? _len2 - 1 : 0 ) , _key2 = 1 ; _key2 < _len2 ; _key2 ++ ) args [ _key2 - 1 ] = arguments [ _key2 ] ;
2022-05-04 17:25:28 +03:00
printWarning ( "error" , format , args ) ;
2021-07-30 04:11:27 +03:00
}
function printWarning ( level , format , args ) {
var stack = ReactSharedInternals . ReactDebugCurrentFrame . getStackAddendum ( ) ;
2022-05-04 17:25:28 +03:00
"" !== stack && ( format += "%s" , args = args . concat ( [
2021-08-03 18:52:47 +03:00
stack
] ) ) ;
2021-07-30 04:11:27 +03:00
var argsWithFormat = args . map ( function ( item ) {
2022-05-04 17:25:28 +03:00
return "" + item ;
2021-07-30 04:11:27 +03:00
} ) ;
2022-05-04 17:25:28 +03:00
argsWithFormat . unshift ( "Warning: " + format ) , Function . prototype . apply . call ( console [ level ] , console , argsWithFormat ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( ! React ) throw Error ( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ) ;
2022-06-15 17:36:57 +03:00
var allNativeEvents = new Set ( ) , registrationNameDependencies = { } , possibleRegistrationNames = { } ;
2021-07-30 04:11:27 +03:00
function registerTwoPhaseEvent ( registrationName , dependencies ) {
2022-05-04 17:25:28 +03:00
registerDirectEvent ( registrationName , dependencies ) , registerDirectEvent ( registrationName + "Capture" , dependencies ) ;
2021-07-30 04:11:27 +03:00
}
function registerDirectEvent ( registrationName , dependencies ) {
2022-06-15 17:36:57 +03:00
registrationNameDependencies [ registrationName ] && error ( "EventRegistry: More than one plugin attempted to publish the same registration name, `%s`." , registrationName ) , registrationNameDependencies [ registrationName ] = dependencies , possibleRegistrationNames [ registrationName . toLowerCase ( ) ] = registrationName , "onDoubleClick" === registrationName && ( possibleRegistrationNames . ondblclick = registrationName ) ;
2021-07-30 04:11:27 +03:00
for ( var i = 0 ; i < dependencies . length ; i ++ ) allNativeEvents . add ( dependencies [ i ] ) ;
}
2022-06-11 08:27:13 +03:00
var canUseDOM = ! ! ( "undefined" != typeof window && void 0 !== window . document && void 0 !== window . document . createElement ) , 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" , ATTRIBUTE _NAME _CHAR = ATTRIBUTE _NAME _START _CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040" , ROOT _ATTRIBUTE _NAME = "data-reactroot" , VALID _ATTRIBUTE _NAME _REGEX = RegExp ( "^[" + ATTRIBUTE _NAME _START _CHAR + "][" + ATTRIBUTE _NAME _CHAR + "]*$" ) , hasOwnProperty = Object . prototype . hasOwnProperty , illegalAttributeNameCache = { } , validatedAttributeNameCache = { } ;
2021-07-30 04:11:27 +03:00
function isAttributeNameSafe ( attributeName ) {
2022-06-15 17:36:57 +03:00
return ! ! hasOwnProperty . call ( validatedAttributeNameCache , attributeName ) || ! hasOwnProperty . call ( illegalAttributeNameCache , attributeName ) && ( VALID _ATTRIBUTE _NAME _REGEX . test ( attributeName ) ? ( validatedAttributeNameCache [ attributeName ] = ! 0 , ! 0 ) : ( illegalAttributeNameCache [ attributeName ] = ! 0 , error ( "Invalid attribute name: `%s`" , attributeName ) , ! 1 ) ) ;
2021-07-30 04:11:27 +03:00
}
function shouldIgnoreAttribute ( name , propertyInfo , isCustomComponentTag ) {
2022-05-04 17:25:28 +03:00
return null !== propertyInfo ? 0 === propertyInfo . type : ! isCustomComponentTag && name . length > 2 && ( "o" === name [ 0 ] || "O" === name [ 0 ] ) && ( "n" === name [ 1 ] || "N" === name [ 1 ] ) ;
2021-07-30 04:11:27 +03:00
}
function shouldRemoveAttributeWithWarning ( name , value , propertyInfo , isCustomComponentTag ) {
if ( null !== propertyInfo && 0 === propertyInfo . type ) return ! 1 ;
switch ( typeof value ) {
2022-05-04 17:25:28 +03:00
case "function" :
case "symbol" :
2021-08-03 18:52:47 +03:00
return ! 0 ;
2022-05-04 17:25:28 +03:00
case "boolean" :
2021-07-30 04:11:27 +03:00
if ( isCustomComponentTag ) return ! 1 ;
if ( null !== propertyInfo ) return ! propertyInfo . acceptsBooleans ;
2021-10-21 08:12:50 +03:00
var prefix = name . toLowerCase ( ) . slice ( 0 , 5 ) ;
2022-05-04 17:25:28 +03:00
return "data-" !== prefix && "aria-" !== prefix ;
2021-08-03 18:52:47 +03:00
default :
return ! 1 ;
2021-07-30 04:11:27 +03:00
}
}
function shouldRemoveAttribute ( name , value , propertyInfo , isCustomComponentTag ) {
2022-05-17 10:34:47 +03:00
if ( null == value || shouldRemoveAttributeWithWarning ( name , value , propertyInfo , isCustomComponentTag ) ) return ! 0 ;
2021-07-30 04:11:27 +03:00
if ( isCustomComponentTag ) return ! 1 ;
if ( null !== propertyInfo ) switch ( propertyInfo . type ) {
2021-08-03 18:52:47 +03:00
case 3 :
return ! value ;
case 4 :
return ! 1 === value ;
case 5 :
return isNaN ( value ) ;
case 6 :
return isNaN ( value ) || value < 1 ;
2021-07-30 04:11:27 +03:00
}
return ! 1 ;
}
function getPropertyInfo ( name ) {
return properties . hasOwnProperty ( name ) ? properties [ name ] : null ;
}
function PropertyInfoRecord ( name , type , mustUseProperty , attributeName , attributeNamespace , sanitizeURL , removeEmptyString ) {
this . acceptsBooleans = 2 === type || 3 === type || 4 === type , this . attributeName = attributeName , this . attributeNamespace = attributeNamespace , this . mustUseProperty = mustUseProperty , this . propertyName = name , this . type = type , this . sanitizeURL = sanitizeURL , this . removeEmptyString = removeEmptyString ;
}
2022-01-02 23:54:58 +03:00
var properties = { } ;
2021-08-04 13:27:17 +03:00
[
2022-05-04 17:25:28 +03:00
"children" ,
"dangerouslySetInnerHTML" ,
"defaultValue" ,
"defaultChecked" ,
"innerHTML" ,
"suppressContentEditableWarning" ,
"suppressHydrationWarning" ,
"style" ,
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 0 , ! 1 , name , null , ! 1 , ! 1 ) ;
} ) , [
[
2022-05-04 17:25:28 +03:00
"acceptCharset" ,
"accept-charset"
2021-08-04 13:27:17 +03:00
] ,
[
2022-05-04 17:25:28 +03:00
"className" ,
"class"
2021-08-04 13:27:17 +03:00
] ,
[
2022-05-04 17:25:28 +03:00
"htmlFor" ,
"for"
2021-08-04 13:27:17 +03:00
] ,
[
2022-05-04 17:25:28 +03:00
"httpEquiv" ,
"http-equiv"
] ,
2021-08-04 13:27:17 +03:00
] . forEach ( function ( _ref ) {
var name = _ref [ 0 ] , attributeName = _ref [ 1 ] ;
properties [ name ] = new PropertyInfoRecord ( name , 1 , ! 1 , attributeName , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"contentEditable" ,
"draggable" ,
"spellCheck" ,
"value"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 2 , ! 1 , name . toLowerCase ( ) , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"autoReverse" ,
"externalResourcesRequired" ,
"focusable" ,
"preserveAlpha" ,
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 2 , ! 1 , name , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"allowFullScreen" ,
"async" ,
"autoFocus" ,
"autoPlay" ,
"controls" ,
"default" ,
"defer" ,
"disabled" ,
"disablePictureInPicture" ,
"disableRemotePlayback" ,
"formNoValidate" ,
"hidden" ,
"loop" ,
"noModule" ,
"noValidate" ,
"open" ,
"playsInline" ,
"readOnly" ,
"required" ,
"reversed" ,
"scoped" ,
"seamless" ,
"itemScope" ,
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 3 , ! 1 , name . toLowerCase ( ) , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"checked" ,
"multiple" ,
"muted" ,
"selected"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 3 , ! 0 , name , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"capture" ,
"download"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 4 , ! 1 , name , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"cols" ,
"rows" ,
"size" ,
"span"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 6 , ! 1 , name , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"rowSpan" ,
"start"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( name ) {
properties [ name ] = new PropertyInfoRecord ( name , 5 , ! 1 , name . toLowerCase ( ) , null , ! 1 , ! 1 ) ;
} ) ;
var CAMELIZE = /[\-\:]([a-z])/g , capitalize = function ( token ) {
2021-07-30 04:11:27 +03:00
return token [ 1 ] . toUpperCase ( ) ;
2021-08-04 13:27:17 +03:00
} ;
[
2022-05-04 17:25:28 +03:00
"accent-height" ,
"alignment-baseline" ,
"arabic-form" ,
"baseline-shift" ,
"cap-height" ,
"clip-path" ,
"clip-rule" ,
"color-interpolation" ,
"color-interpolation-filters" ,
"color-profile" ,
"color-rendering" ,
"dominant-baseline" ,
"enable-background" ,
"fill-opacity" ,
"fill-rule" ,
"flood-color" ,
"flood-opacity" ,
"font-family" ,
"font-size" ,
"font-size-adjust" ,
"font-stretch" ,
"font-style" ,
"font-variant" ,
"font-weight" ,
"glyph-name" ,
"glyph-orientation-horizontal" ,
"glyph-orientation-vertical" ,
"horiz-adv-x" ,
"horiz-origin-x" ,
"image-rendering" ,
"letter-spacing" ,
"lighting-color" ,
"marker-end" ,
"marker-mid" ,
"marker-start" ,
"overline-position" ,
"overline-thickness" ,
"paint-order" ,
"panose-1" ,
"pointer-events" ,
"rendering-intent" ,
"shape-rendering" ,
"stop-color" ,
"stop-opacity" ,
"strikethrough-position" ,
"strikethrough-thickness" ,
"stroke-dasharray" ,
"stroke-dashoffset" ,
"stroke-linecap" ,
"stroke-linejoin" ,
"stroke-miterlimit" ,
"stroke-opacity" ,
"stroke-width" ,
"text-anchor" ,
"text-decoration" ,
"text-rendering" ,
"underline-position" ,
"underline-thickness" ,
"unicode-bidi" ,
"unicode-range" ,
"units-per-em" ,
"v-alphabetic" ,
"v-hanging" ,
"v-ideographic" ,
"v-mathematical" ,
"vector-effect" ,
"vert-adv-y" ,
"vert-origin-x" ,
"vert-origin-y" ,
"word-spacing" ,
"writing-mode" ,
"xmlns:xlink" ,
"x-height"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( attributeName ) {
var name = attributeName . replace ( CAMELIZE , capitalize ) ;
properties [ name ] = new PropertyInfoRecord ( name , 1 , ! 1 , attributeName , null , ! 1 , ! 1 ) ;
} ) , [
2022-05-04 17:25:28 +03:00
"xlink:actuate" ,
"xlink:arcrole" ,
"xlink:role" ,
"xlink:show" ,
"xlink:title" ,
"xlink:type"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( attributeName ) {
var name = attributeName . replace ( CAMELIZE , capitalize ) ;
2022-05-04 17:25:28 +03:00
properties [ name ] = new PropertyInfoRecord ( name , 1 , ! 1 , attributeName , "http://www.w3.org/1999/xlink" , ! 1 , ! 1 ) ;
2021-08-04 13:27:17 +03:00
} ) , [
2022-05-04 17:25:28 +03:00
"xml:base" ,
"xml:lang" ,
"xml:space"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( attributeName ) {
var name = attributeName . replace ( CAMELIZE , capitalize ) ;
2022-05-04 17:25:28 +03:00
properties [ name ] = new PropertyInfoRecord ( name , 1 , ! 1 , attributeName , "http://www.w3.org/XML/1998/namespace" , ! 1 , ! 1 ) ;
2021-08-04 13:27:17 +03:00
} ) , [
2022-05-04 17:25:28 +03:00
"tabIndex" ,
"crossOrigin"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( attributeName ) {
properties [ attributeName ] = new PropertyInfoRecord ( attributeName , 1 , ! 1 , attributeName . toLowerCase ( ) , null , ! 1 , ! 1 ) ;
2022-05-04 17:25:28 +03:00
} ) , properties . xlinkHref = new PropertyInfoRecord ( "xlinkHref" , 1 , ! 1 , "xlink:href" , "http://www.w3.org/1999/xlink" , ! 0 , ! 1 ) , [
"src" ,
"href" ,
"action" ,
"formAction"
2021-08-04 13:27:17 +03:00
] . forEach ( function ( attributeName ) {
properties [ attributeName ] = new PropertyInfoRecord ( attributeName , 1 , ! 1 , attributeName . toLowerCase ( ) , null , ! 0 , ! 0 ) ;
} ) ;
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 , didWarn = ! 1 ;
2022-06-15 17:36:57 +03:00
function sanitizeURL ( url ) {
! didWarn && isJavaScriptProtocol . test ( url ) && ( didWarn = ! 0 , 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 ( url ) ) ) ;
2021-07-30 04:11:27 +03:00
}
function getValueForProperty ( node , name , expected , propertyInfo ) {
if ( propertyInfo . mustUseProperty ) return node [ propertyInfo . propertyName ] ;
2022-06-15 17:36:57 +03:00
propertyInfo . sanitizeURL && sanitizeURL ( "" + expected ) ;
2021-07-30 04:11:27 +03:00
var attributeName = propertyInfo . attributeName , stringValue = null ;
if ( 4 === propertyInfo . type ) {
if ( node . hasAttribute ( attributeName ) ) {
var value = node . getAttribute ( attributeName ) ;
2022-05-04 17:25:28 +03:00
return "" === value || ( shouldRemoveAttribute ( name , expected , propertyInfo , ! 1 ) ? value : value === "" + expected ? expected : value ) ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
} else if ( node . hasAttribute ( attributeName ) ) {
if ( shouldRemoveAttribute ( name , expected , propertyInfo , ! 1 ) ) return node . getAttribute ( attributeName ) ;
if ( 3 === propertyInfo . type ) return expected ;
stringValue = node . getAttribute ( attributeName ) ;
}
2022-05-04 17:25:28 +03:00
return shouldRemoveAttribute ( name , expected , propertyInfo , ! 1 ) ? null === stringValue ? expected : stringValue : stringValue === "" + expected ? expected : stringValue ;
2021-07-30 04:11:27 +03:00
}
function getValueForAttribute ( node , name , expected ) {
if ( isAttributeNameSafe ( name ) ) {
if ( isOpaqueHydratingObject ( expected ) ) return expected ;
if ( ! node . hasAttribute ( name ) ) return void 0 === expected ? void 0 : null ;
var value = node . getAttribute ( name ) ;
2022-05-04 17:25:28 +03:00
return value === "" + expected ? expected : value ;
2021-07-30 04:11:27 +03:00
}
}
function setValueForProperty ( node , name , value , isCustomComponentTag ) {
var propertyInfo = getPropertyInfo ( name ) ;
if ( ! shouldIgnoreAttribute ( name , propertyInfo , isCustomComponentTag ) ) {
if ( shouldRemoveAttribute ( name , value , propertyInfo , isCustomComponentTag ) && ( value = null ) , isCustomComponentTag || null === propertyInfo ) {
if ( isAttributeNameSafe ( name ) ) {
var _attributeName = name ;
2022-05-04 17:25:28 +03:00
null === value ? node . removeAttribute ( _attributeName ) : node . setAttribute ( _attributeName , "" + value ) ;
2021-07-30 04:11:27 +03:00
}
return ;
}
2021-08-03 18:52:47 +03:00
if ( propertyInfo . mustUseProperty ) {
2021-07-30 04:11:27 +03:00
var propertyName = propertyInfo . propertyName ;
if ( null === value ) {
var type = propertyInfo . type ;
2022-05-04 17:25:28 +03:00
node [ propertyName ] = 3 !== type && "" ;
2021-07-30 04:11:27 +03:00
} else node [ propertyName ] = value ;
return ;
}
var attributeName = propertyInfo . attributeName , attributeNamespace = propertyInfo . attributeNamespace ;
if ( null === value ) node . removeAttribute ( attributeName ) ;
else {
var attributeValue , _type = propertyInfo . type ;
2022-06-15 17:36:57 +03:00
3 === _type || 4 === _type && ! 0 === value ? attributeValue = "" : ( attributeValue = "" + value , propertyInfo . sanitizeURL && sanitizeURL ( attributeValue . toString ( ) ) ) , attributeNamespace ? node . setAttributeNS ( attributeNamespace , attributeName , attributeValue ) : node . setAttribute ( attributeName , attributeValue ) ;
2021-07-30 04:11:27 +03:00
}
}
}
2022-04-21 13:00:25 +03:00
var _assign = React . _ _SECRET _INTERNALS _DO _NOT _USE _OR _YOU _WILL _BE _FIRED . assign , REACT _ELEMENT _TYPE = 0xeac7 , REACT _PORTAL _TYPE = 0xeaca , REACT _FRAGMENT _TYPE = 0xeacb , REACT _STRICT _MODE _TYPE = 0xeacc , REACT _PROFILER _TYPE = 0xead2 , REACT _PROVIDER _TYPE = 0xeacd , REACT _CONTEXT _TYPE = 0xeace , REACT _FORWARD _REF _TYPE = 0xead0 , REACT _SUSPENSE _TYPE = 0xead1 , REACT _SUSPENSE _LIST _TYPE = 0xead8 , REACT _MEMO _TYPE = 0xead3 , REACT _LAZY _TYPE = 0xead4 , REACT _BLOCK _TYPE = 0xead9 , REACT _OPAQUE _ID _TYPE = 0xeae0 , REACT _DEBUG _TRACING _MODE _TYPE = 0xeae1 , REACT _OFFSCREEN _TYPE = 0xeae2 , REACT _LEGACY _HIDDEN _TYPE = 0xeae3 ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof Symbol && Symbol . for ) {
2021-08-04 13:27:17 +03:00
var symbolFor = Symbol . for ;
2022-05-04 17:25:28 +03:00
REACT _ELEMENT _TYPE = symbolFor ( "react.element" ) , REACT _PORTAL _TYPE = symbolFor ( "react.portal" ) , REACT _FRAGMENT _TYPE = symbolFor ( "react.fragment" ) , REACT _STRICT _MODE _TYPE = symbolFor ( "react.strict_mode" ) , REACT _PROFILER _TYPE = symbolFor ( "react.profiler" ) , REACT _PROVIDER _TYPE = symbolFor ( "react.provider" ) , REACT _CONTEXT _TYPE = symbolFor ( "react.context" ) , REACT _FORWARD _REF _TYPE = symbolFor ( "react.forward_ref" ) , REACT _SUSPENSE _TYPE = symbolFor ( "react.suspense" ) , REACT _SUSPENSE _LIST _TYPE = symbolFor ( "react.suspense_list" ) , REACT _MEMO _TYPE = symbolFor ( "react.memo" ) , REACT _LAZY _TYPE = symbolFor ( "react.lazy" ) , REACT _BLOCK _TYPE = symbolFor ( "react.block" ) , symbolFor ( "react.server.block" ) , symbolFor ( "react.fundamental" ) , symbolFor ( "react.scope" ) , REACT _OPAQUE _ID _TYPE = symbolFor ( "react.opaque.id" ) , REACT _DEBUG _TRACING _MODE _TYPE = symbolFor ( "react.debug_trace_mode" ) , REACT _OFFSCREEN _TYPE = symbolFor ( "react.offscreen" ) , REACT _LEGACY _HIDDEN _TYPE = symbolFor ( "react.legacy_hidden" ) ;
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
var MAYBE _ITERATOR _SYMBOL = "function" == typeof Symbol && Symbol . iterator ;
2021-07-30 04:11:27 +03:00
function getIteratorFn ( maybeIterable ) {
2022-05-04 17:25:28 +03:00
if ( null === maybeIterable || "object" != typeof maybeIterable ) return null ;
var maybeIterator = MAYBE _ITERATOR _SYMBOL && maybeIterable [ MAYBE _ITERATOR _SYMBOL ] || maybeIterable [ "@@iterator" ] ;
return "function" == typeof maybeIterator ? maybeIterator : null ;
2021-07-30 04:11:27 +03:00
}
2021-08-07 11:27:52 +03:00
var disabledDepth = 0 ;
2022-01-02 23:54:58 +03:00
function disabledLog ( ) { }
2021-07-30 04:11:27 +03:00
function disableLogs ( ) {
if ( 0 === disabledDepth ) {
prevLog = console . log , prevInfo = console . info , prevWarn = console . warn , prevError = console . error , prevGroup = console . group , prevGroupCollapsed = console . groupCollapsed , prevGroupEnd = console . groupEnd ;
var props = {
configurable : ! 0 ,
enumerable : ! 0 ,
value : disabledLog ,
writable : ! 0
} ;
Object . defineProperties ( console , {
info : props ,
log : props ,
warn : props ,
error : props ,
group : props ,
groupCollapsed : props ,
groupEnd : props
} ) ;
}
disabledDepth ++ ;
}
function reenableLogs ( ) {
2022-04-03 16:13:15 +03:00
if ( 0 == -- disabledDepth ) {
2021-07-30 04:11:27 +03:00
var props = {
configurable : ! 0 ,
enumerable : ! 0 ,
writable : ! 0
} ;
Object . defineProperties ( console , {
2022-01-02 23:54:58 +03:00
log : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevLog
} ) ,
2022-01-02 23:54:58 +03:00
info : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevInfo
} ) ,
2022-01-02 23:54:58 +03:00
warn : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevWarn
} ) ,
2022-01-02 23:54:58 +03:00
error : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevError
} ) ,
2022-01-02 23:54:58 +03:00
group : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevGroup
} ) ,
2022-01-02 23:54:58 +03:00
groupCollapsed : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevGroupCollapsed
} ) ,
2022-01-02 23:54:58 +03:00
groupEnd : _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : prevGroupEnd
} )
} ) ;
}
2022-06-15 17:36:57 +03:00
disabledDepth < 0 && error ( "disabledDepth fell below zero. This is a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
disabledLog . _ _reactDisabledLog = ! 0 ;
2022-08-26 13:06:25 +03:00
var ReactCurrentDispatcher = ReactSharedInternals . ReactCurrentDispatcher ;
2021-07-30 04:11:27 +03:00
function describeBuiltInComponentFrame ( name , source , ownerFn ) {
2022-06-15 17:36:57 +03:00
if ( void 0 === prefix ) try {
2021-07-30 04:11:27 +03:00
throw Error ( ) ;
} catch ( x ) {
var match = x . stack . trim ( ) . match ( /\n( *(at )?)/ ) ;
2022-06-15 17:36:57 +03:00
prefix = match && match [ 1 ] || "" ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
return "\n" + prefix + name ;
2021-07-30 04:11:27 +03:00
}
2021-08-07 11:27:52 +03:00
var reentry = ! 1 ;
2021-07-30 04:11:27 +03:00
function describeNativeComponentFrame ( fn , construct ) {
2022-05-04 17:25:28 +03:00
if ( ! fn || reentry ) return "" ;
2021-10-17 09:24:17 +03:00
var control , previousDispatcher , frame = componentFrameCache . get ( fn ) ;
2021-07-30 04:11:27 +03:00
if ( void 0 !== frame ) return frame ;
reentry = ! 0 ;
var previousPrepareStackTrace = Error . prepareStackTrace ;
2022-08-26 13:06:25 +03:00
Error . prepareStackTrace = void 0 , previousDispatcher = ReactCurrentDispatcher . current , ReactCurrentDispatcher . current = null , disableLogs ( ) ;
2021-07-30 04:11:27 +03:00
try {
if ( construct ) {
var Fake = function ( ) {
throw Error ( ) ;
} ;
2022-05-04 17:25:28 +03:00
if ( Object . defineProperty ( Fake . prototype , "props" , {
2021-07-30 04:11:27 +03:00
set : function ( ) {
throw Error ( ) ;
}
2022-05-04 17:25:28 +03:00
} ) , "object" == typeof Reflect && Reflect . construct ) {
2021-07-30 04:11:27 +03:00
try {
Reflect . construct ( Fake , [ ] ) ;
} catch ( x ) {
control = x ;
}
Reflect . construct ( fn , [ ] , Fake ) ;
} else {
try {
Fake . call ( ) ;
2022-06-15 17:36:57 +03:00
} catch ( x1 ) {
control = x1 ;
2021-07-30 04:11:27 +03:00
}
fn . call ( Fake . prototype ) ;
}
} else {
try {
throw Error ( ) ;
2022-06-15 17:36:57 +03:00
} catch ( x2 ) {
control = x2 ;
2021-07-30 04:11:27 +03:00
}
fn ( ) ;
}
} catch ( sample ) {
2022-05-04 17:25:28 +03:00
if ( sample && control && "string" == typeof sample . stack ) {
for ( var sampleLines = sample . stack . split ( "\n" ) , controlLines = control . stack . split ( "\n" ) , s = sampleLines . length - 1 , c = controlLines . length - 1 ; s >= 1 && c >= 0 && sampleLines [ s ] !== controlLines [ c ] ; ) c -- ;
2021-07-30 04:11:27 +03:00
for ( ; s >= 1 && c >= 0 ; s -- , c -- ) if ( sampleLines [ s ] !== controlLines [ c ] ) {
2022-04-03 16:13:15 +03:00
if ( 1 !== s || 1 !== c ) do if ( s -- , -- c < 0 || sampleLines [ s ] !== controlLines [ c ] ) {
2022-05-04 17:25:28 +03:00
var _frame = "\n" + sampleLines [ s ] . replace ( " at new " , " at " ) ;
return "function" == typeof fn && componentFrameCache . set ( fn , _frame ) , _frame ;
2021-07-30 04:11:27 +03:00
}
while ( s >= 1 && c >= 0 )
break ;
}
}
} finally {
2022-08-26 13:06:25 +03:00
reentry = ! 1 , ReactCurrentDispatcher . current = previousDispatcher , reenableLogs ( ) , Error . prepareStackTrace = previousPrepareStackTrace ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var name = fn ? fn . displayName || fn . name : "" , syntheticFrame = name ? describeBuiltInComponentFrame ( name ) : "" ;
return "function" == typeof fn && componentFrameCache . set ( fn , syntheticFrame ) , syntheticFrame ;
2021-07-30 04:11:27 +03:00
}
function describeFiber ( fiber ) {
2022-06-15 17:36:57 +03:00
var fn , fn1 , fn2 , ctor ;
2021-08-10 11:52:28 +03:00
switch ( fiber . _debugOwner && fiber . _debugOwner . type , fiber . _debugSource , fiber . tag ) {
2021-08-03 18:52:47 +03:00
case 5 :
return describeBuiltInComponentFrame ( fiber . type ) ;
case 16 :
2022-05-04 17:25:28 +03:00
return describeBuiltInComponentFrame ( "Lazy" ) ;
2021-08-03 18:52:47 +03:00
case 13 :
2022-05-04 17:25:28 +03:00
return describeBuiltInComponentFrame ( "Suspense" ) ;
2021-08-03 18:52:47 +03:00
case 19 :
2022-05-04 17:25:28 +03:00
return describeBuiltInComponentFrame ( "SuspenseList" ) ;
2021-07-30 04:11:27 +03:00
case 0 :
case 2 :
2021-08-03 18:52:47 +03:00
case 15 :
2022-04-29 08:58:59 +03:00
return describeNativeComponentFrame ( fiber . type , ! 1 ) ;
2021-08-03 18:52:47 +03:00
case 11 :
2022-04-29 08:58:59 +03:00
return describeNativeComponentFrame ( fiber . type . render , ! 1 ) ;
2021-08-03 18:52:47 +03:00
case 22 :
2022-04-29 08:58:59 +03:00
return describeNativeComponentFrame ( fiber . type . _render , ! 1 ) ;
2021-08-03 18:52:47 +03:00
case 1 :
2021-10-17 09:24:17 +03:00
return describeNativeComponentFrame ( fiber . type , ! 0 ) ;
2021-08-03 18:52:47 +03:00
default :
2022-05-04 17:25:28 +03:00
return "" ;
2021-07-30 04:11:27 +03:00
}
}
function getStackByFiberInDevAndProd ( workInProgress ) {
try {
2022-05-04 17:25:28 +03:00
var info = "" , node = workInProgress ;
2021-07-30 04:11:27 +03:00
do info += describeFiber ( node ) , node = node . return ;
while ( node )
return info ;
} catch ( x ) {
2022-05-04 17:25:28 +03:00
return "\nError generating stack: " + x . message + "\n" + x . stack ;
2021-07-30 04:11:27 +03:00
}
}
function getContextName ( type ) {
2022-05-04 17:25:28 +03:00
return type . displayName || "Context" ;
2021-07-30 04:11:27 +03:00
}
function getComponentName ( type ) {
if ( null == type ) return null ;
2022-06-15 17:36:57 +03:00
if ( "number" == typeof type . tag && error ( "Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue." ) , "function" == typeof type ) return type . displayName || type . name || null ;
2022-05-04 17:25:28 +03:00
if ( "string" == typeof type ) return type ;
2021-07-30 04:11:27 +03:00
switch ( type ) {
2021-08-03 18:52:47 +03:00
case REACT _FRAGMENT _TYPE :
2022-05-04 17:25:28 +03:00
return "Fragment" ;
2021-08-03 18:52:47 +03:00
case REACT _PORTAL _TYPE :
2022-05-04 17:25:28 +03:00
return "Portal" ;
2021-08-03 18:52:47 +03:00
case REACT _PROFILER _TYPE :
2022-05-04 17:25:28 +03:00
return "Profiler" ;
2021-08-03 18:52:47 +03:00
case REACT _STRICT _MODE _TYPE :
2022-05-04 17:25:28 +03:00
return "StrictMode" ;
2021-08-03 18:52:47 +03:00
case REACT _SUSPENSE _TYPE :
2022-05-04 17:25:28 +03:00
return "Suspense" ;
2021-08-03 18:52:47 +03:00
case REACT _SUSPENSE _LIST _TYPE :
2022-05-04 17:25:28 +03:00
return "SuspenseList" ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "object" == typeof type ) switch ( type . $$typeof ) {
2021-08-03 18:52:47 +03:00
case REACT _CONTEXT _TYPE :
2022-05-04 17:25:28 +03:00
return getContextName ( type ) + ".Consumer" ;
2021-08-03 18:52:47 +03:00
case REACT _PROVIDER _TYPE :
2022-05-04 17:25:28 +03:00
return getContextName ( type . _context ) + ".Provider" ;
2021-08-03 18:52:47 +03:00
case REACT _FORWARD _REF _TYPE :
2022-08-02 14:37:40 +03:00
var outerType , innerType , functionName , wrapperName = "ForwardRef" ;
return outerType = type , innerType = type . render , functionName = innerType . displayName || innerType . name || "" , outerType . displayName || ( "" !== functionName ? wrapperName + "(" + functionName + ")" : wrapperName ) ;
2021-08-03 18:52:47 +03:00
case REACT _MEMO _TYPE :
return getComponentName ( type . type ) ;
case REACT _BLOCK _TYPE :
return getComponentName ( type . _render ) ;
2021-07-30 04:11:27 +03:00
case REACT _LAZY _TYPE :
2022-08-02 14:37:40 +03:00
var lazyComponent = type , payload = lazyComponent . _payload , init = lazyComponent . _init ;
2021-07-30 04:11:27 +03:00
try {
return getComponentName ( init ( payload ) ) ;
2022-04-28 16:28:33 +03:00
} catch ( x ) { }
2021-07-30 04:11:27 +03:00
}
return null ;
}
2022-05-04 17:25:28 +03:00
componentFrameCache = new ( "function" == typeof WeakMap ? WeakMap : Map ) ( ) ;
2022-06-15 17:36:57 +03:00
var ReactDebugCurrentFrame = ReactSharedInternals . ReactDebugCurrentFrame , current = null , isRendering = ! 1 ;
2021-07-30 04:11:27 +03:00
function getCurrentFiberOwnerNameInDevOrNull ( ) {
2022-06-15 17:36:57 +03:00
if ( null === current ) return null ;
var owner = current . _debugOwner ;
2021-07-30 04:11:27 +03:00
return null != owner ? getComponentName ( owner . type ) : null ;
}
function getCurrentFiberStackInDev ( ) {
2022-06-15 17:36:57 +03:00
return null === current ? "" : getStackByFiberInDevAndProd ( current ) ;
2021-07-30 04:11:27 +03:00
}
function resetCurrentFiber ( ) {
2022-06-15 17:36:57 +03:00
ReactDebugCurrentFrame . getCurrentStack = null , current = null , isRendering = ! 1 ;
2021-07-30 04:11:27 +03:00
}
function setCurrentFiber ( fiber ) {
2022-06-15 17:36:57 +03:00
ReactDebugCurrentFrame . getCurrentStack = getCurrentFiberStackInDev , current = fiber , isRendering = ! 1 ;
2021-07-30 04:11:27 +03:00
}
function getToStringValue ( value ) {
switch ( typeof value ) {
2022-05-04 17:25:28 +03:00
case "boolean" :
case "number" :
case "object" :
case "string" :
case "undefined" :
2021-08-03 18:52:47 +03:00
return value ;
default :
2022-05-04 17:25:28 +03:00
return "" ;
2021-07-30 04:11:27 +03:00
}
}
var hasReadOnlyValue = {
button : ! 0 ,
checkbox : ! 0 ,
image : ! 0 ,
hidden : ! 0 ,
radio : ! 0 ,
reset : ! 0 ,
submit : ! 0
} ;
function checkControlledValueProps ( tagName , props ) {
2022-06-15 17:36:57 +03:00
hasReadOnlyValue [ props . type ] || props . onChange || props . onInput || props . readOnly || props . disabled || null == props . value || 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`." ) , props . onChange || props . readOnly || props . disabled || null == props . checked || 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`." ) ;
2021-07-30 04:11:27 +03:00
}
function isCheckable ( elem ) {
var type = elem . type , nodeName = elem . nodeName ;
2022-05-04 17:25:28 +03:00
return nodeName && "input" === nodeName . toLowerCase ( ) && ( "checkbox" === type || "radio" === type ) ;
2021-07-30 04:11:27 +03:00
}
function getTracker ( node ) {
return node . _valueTracker ;
}
2022-06-15 17:36:57 +03:00
function track ( node ) {
getTracker ( node ) || ( node . _valueTracker = function ( node ) {
2022-05-04 17:25:28 +03:00
var valueField = isCheckable ( node ) ? "checked" : "value" , descriptor = Object . getOwnPropertyDescriptor ( node . constructor . prototype , valueField ) , currentValue = "" + node [ valueField ] ;
if ( ! node . hasOwnProperty ( valueField ) && void 0 !== descriptor && "function" == typeof descriptor . get && "function" == typeof descriptor . set ) {
2021-09-08 12:45:39 +03:00
var get = descriptor . get , set = descriptor . set ;
return Object . defineProperty ( node , valueField , {
configurable : ! 0 ,
get : function ( ) {
return get . call ( this ) ;
} ,
set : function ( value ) {
2022-05-04 17:25:28 +03:00
currentValue = "" + value , set . call ( this , value ) ;
2021-09-08 12:45:39 +03:00
}
} ) , Object . defineProperty ( node , valueField , {
enumerable : descriptor . enumerable
} ) , {
getValue : function ( ) {
return currentValue ;
} ,
setValue : function ( value ) {
2022-05-04 17:25:28 +03:00
currentValue = "" + value ;
2021-09-08 12:45:39 +03:00
} ,
stopTracking : function ( ) {
2022-06-15 17:36:57 +03:00
var node1 ;
2021-09-08 12:45:39 +03:00
node . _valueTracker = null , delete node [ valueField ] ;
}
} ;
}
2022-06-15 17:36:57 +03:00
} ( node ) ) ;
2021-07-30 04:11:27 +03:00
}
function updateValueIfChanged ( node ) {
if ( ! node ) return ! 1 ;
var tracker = getTracker ( node ) ;
if ( ! tracker ) return ! 0 ;
2022-08-26 13:06:25 +03:00
var node1 , value , lastValue = tracker . getValue ( ) , nextValue = ( node1 = node , value = "" , node1 ? value = isCheckable ( node1 ) ? node1 . checked ? "true" : "false" : node1 . value : value ) ;
2021-07-30 04:11:27 +03:00
return nextValue !== lastValue && ( tracker . setValue ( nextValue ) , ! 0 ) ;
}
function getActiveElement ( doc ) {
2022-08-26 13:06:25 +03:00
if ( doc = doc || ( "undefined" != typeof document ? document : void 0 ) , void 0 === doc ) return null ;
2021-07-30 04:11:27 +03:00
try {
return doc . activeElement || doc . body ;
} catch ( e ) {
return doc . body ;
}
}
var didWarnValueDefaultValue = ! 1 , didWarnCheckedDefaultChecked = ! 1 , didWarnControlledToUncontrolled = ! 1 , didWarnUncontrolledToControlled = ! 1 ;
function isControlled ( props ) {
2022-05-04 17:25:28 +03:00
return "checkbox" === props . type || "radio" === props . type ? null != props . checked : null != props . value ;
2021-07-30 04:11:27 +03:00
}
function getHostProps ( element , props ) {
2022-08-26 13:06:25 +03:00
var checked = props . checked , hostProps = _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
defaultChecked : void 0 ,
defaultValue : void 0 ,
value : void 0 ,
checked : null != checked ? checked : element . _wrapperState . initialChecked
} ) ;
2022-08-26 13:06:25 +03:00
return hostProps ;
2021-07-30 04:11:27 +03:00
}
function initWrapperState ( element , props ) {
2022-06-15 17:36:57 +03:00
checkControlledValueProps ( "input" , props ) , void 0 === props . checked || void 0 === props . defaultChecked || didWarnCheckedDefaultChecked || ( error ( "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components" , getCurrentFiberOwnerNameInDevOrNull ( ) || "A component" , props . type ) , didWarnCheckedDefaultChecked = ! 0 ) , void 0 === props . value || void 0 === props . defaultValue || didWarnValueDefaultValue || ( error ( "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components" , getCurrentFiberOwnerNameInDevOrNull ( ) || "A component" , props . type ) , didWarnValueDefaultValue = ! 0 ) ;
2022-05-04 17:25:28 +03:00
var node = element , defaultValue = null == props . defaultValue ? "" : props . defaultValue ;
2021-07-30 04:11:27 +03:00
node . _wrapperState = {
initialChecked : null != props . checked ? props . checked : props . defaultChecked ,
initialValue : getToStringValue ( null != props . value ? props . value : defaultValue ) ,
controlled : isControlled ( props )
} ;
}
function updateChecked ( element , props ) {
var checked = props . checked ;
2022-05-04 17:25:28 +03:00
null != checked && setValueForProperty ( element , "checked" , checked , ! 1 ) ;
2021-07-30 04:11:27 +03:00
}
function updateWrapper ( element , props ) {
2022-04-29 08:58:59 +03:00
var value , value1 , value2 , node = element , controlled = isControlled ( props ) ;
2022-06-15 17:36:57 +03:00
node . _wrapperState . controlled || ! controlled || didWarnUncontrolledToControlled || ( error ( "A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components" ) , didWarnUncontrolledToControlled = ! 0 ) , ! node . _wrapperState . controlled || controlled || didWarnControlledToUncontrolled || ( error ( "A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components" ) , didWarnControlledToUncontrolled = ! 0 ) , updateChecked ( element , props ) ;
2022-04-29 08:58:59 +03:00
var value3 = getToStringValue ( props . value ) , type = props . type ;
2022-05-04 17:25:28 +03:00
if ( null != value3 ) "number" === type ? ( 0 === value3 && "" === node . value || node . value != value3 ) && ( node . value = "" + value3 ) : node . value !== "" + value3 && ( node . value = "" + value3 ) ;
else if ( "submit" === type || "reset" === type ) {
node . removeAttribute ( "value" ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-05-04 17:25:28 +03:00
props . hasOwnProperty ( "value" ) ? setDefaultValue ( node , props . type , value3 ) : props . hasOwnProperty ( "defaultValue" ) && setDefaultValue ( node , props . type , getToStringValue ( props . defaultValue ) ) , null == props . checked && null != props . defaultChecked && ( node . defaultChecked = ! ! props . defaultChecked ) ;
2021-07-30 04:11:27 +03:00
}
function postMountWrapper ( element , props , isHydrating ) {
var node = element ;
2022-05-04 17:25:28 +03:00
if ( props . hasOwnProperty ( "value" ) || props . hasOwnProperty ( "defaultValue" ) ) {
2021-08-03 18:52:47 +03:00
var type = props . type ;
2022-05-04 17:25:28 +03:00
if ( ( "submit" === type || "reset" === type ) && ( void 0 === props . value || null === props . value ) ) return ;
var value , initialValue = "" + node . _wrapperState . initialValue ;
2022-01-12 10:57:54 +03:00
isHydrating || initialValue === node . value || ( node . value = initialValue ) , node . defaultValue = initialValue ;
2021-07-30 04:11:27 +03:00
}
var name = node . name ;
2022-05-04 17:25:28 +03:00
"" !== name && ( node . name = "" ) , node . defaultChecked = ! node . defaultChecked , node . defaultChecked = ! ! node . _wrapperState . initialChecked , "" !== name && ( node . name = name ) ;
2021-07-30 04:11:27 +03:00
}
function setDefaultValue ( node , type , value ) {
2022-05-04 17:25:28 +03:00
if ( "number" !== type || getActiveElement ( node . ownerDocument ) !== node ) {
2022-06-15 17:36:57 +03:00
var value1 , value2 , value3 ;
2022-05-04 17:25:28 +03:00
null == value ? node . defaultValue = "" + node . _wrapperState . initialValue : node . defaultValue !== "" + value && ( node . defaultValue = "" + value ) ;
2022-04-29 08:58:59 +03:00
}
2021-07-30 04:11:27 +03:00
}
var didWarnSelectedSetOnOption = ! 1 , didWarnInvalidChild = ! 1 ;
function validateProps ( element , props ) {
2022-05-04 17:25:28 +03:00
"object" == typeof props . children && null !== props . children && React . Children . forEach ( props . children , function ( child ) {
2022-06-15 17:36:57 +03:00
null != child && "string" != typeof child && "number" != typeof child && "string" == typeof child . type && ( didWarnInvalidChild || ( didWarnInvalidChild = ! 0 , error ( "Only strings and numbers are supported as <option> children." ) ) ) ;
} ) , null == props . selected || didWarnSelectedSetOnOption || ( error ( "Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>." ) , didWarnSelectedSetOnOption = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
function getHostProps$1 ( element , props ) {
2022-01-06 14:49:10 +03:00
var children , content , hostProps = _assign ( {
2021-07-30 04:11:27 +03:00
children : void 0
2022-05-04 17:25:28 +03:00
} , props ) , content1 = ( children = props . children , content = "" , React . Children . forEach ( children , function ( child ) {
2021-09-08 12:45:39 +03:00
null != child && ( content += child ) ;
} ) , content ) ;
return content1 && ( hostProps . children = content1 ) , hostProps ;
2021-07-30 04:11:27 +03:00
}
function getDeclarationErrorAddendum ( ) {
var ownerName = getCurrentFiberOwnerNameInDevOrNull ( ) ;
2022-05-04 17:25:28 +03:00
return ownerName ? "\n\nCheck the render method of `" + ownerName + "`." : "" ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
didWarnValueDefaultValue$1 = ! 1 ;
2021-08-03 18:52:47 +03:00
var valuePropNames = [
2022-05-04 17:25:28 +03:00
"value" ,
"defaultValue"
2021-08-03 18:52:47 +03:00
] ;
2021-07-30 04:11:27 +03:00
function updateOptions ( node , multiple , propValue , setDefaultSelected ) {
var options = node . options ;
if ( multiple ) {
2022-05-04 17:25:28 +03:00
for ( var selectedValues = propValue , selectedValue = { } , i = 0 ; i < selectedValues . length ; i ++ ) selectedValue [ "$" + selectedValues [ i ] ] = ! 0 ;
2021-07-30 04:11:27 +03:00
for ( var _i = 0 ; _i < options . length ; _i ++ ) {
2022-05-04 17:25:28 +03:00
var selected = selectedValue . hasOwnProperty ( "$" + options [ _i ] . value ) ;
2021-07-30 04:11:27 +03:00
options [ _i ] . selected !== selected && ( options [ _i ] . selected = selected ) , selected && setDefaultSelected && ( options [ _i ] . defaultSelected = ! 0 ) ;
}
} else {
2022-05-04 17:25:28 +03:00
for ( var value , _selectedValue = "" + getToStringValue ( propValue ) , defaultSelected = null , _i2 = 0 ; _i2 < options . length ; _i2 ++ ) {
2021-09-16 07:23:33 +03:00
if ( options [ _i2 ] . value === _selectedValue ) {
options [ _i2 ] . selected = ! 0 , setDefaultSelected && ( options [ _i2 ] . defaultSelected = ! 0 ) ;
return ;
}
2021-07-30 04:11:27 +03:00
null !== defaultSelected || options [ _i2 ] . disabled || ( defaultSelected = options [ _i2 ] ) ;
}
null !== defaultSelected && ( defaultSelected . selected = ! 0 ) ;
}
}
function getHostProps$2 ( element , props ) {
2022-01-02 23:54:58 +03:00
return _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : void 0
} ) ;
}
2022-06-15 17:36:57 +03:00
function initWrapperState$1 ( element , props ) {
2021-07-30 04:11:27 +03:00
var node = element ;
2021-09-08 12:45:39 +03:00
! function ( props ) {
2022-05-04 17:25:28 +03:00
checkControlledValueProps ( "select" , props ) ;
2021-09-08 12:45:39 +03:00
for ( var i = 0 ; i < valuePropNames . length ; i ++ ) {
var propName = valuePropNames [ i ] ;
if ( null != props [ propName ] ) {
var isArray = Array . isArray ( props [ propName ] ) ;
2022-06-15 17:36:57 +03:00
props . multiple && ! isArray ? error ( "The `%s` prop supplied to <select> must be an array if `multiple` is true.%s" , propName , getDeclarationErrorAddendum ( ) ) : ! props . multiple && isArray && error ( "The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s" , propName , getDeclarationErrorAddendum ( ) ) ;
2021-09-08 12:45:39 +03:00
}
}
2022-06-15 17:36:57 +03:00
} ( props ) , node . _wrapperState = {
wasMultiple : ! ! props . multiple
} , void 0 === props . value || void 0 === props . defaultValue || didWarnValueDefaultValue$1 || ( error ( "Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components" ) , didWarnValueDefaultValue$1 = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
var didWarnValDefaultVal = ! 1 ;
function getHostProps$3 ( element , props ) {
if ( null != props . dangerouslySetInnerHTML ) throw Error ( "`dangerouslySetInnerHTML` does not make sense on <textarea>." ) ;
2022-08-26 13:06:25 +03:00
var value , hostProps = _assign ( { } , props , {
2021-07-30 04:11:27 +03:00
value : void 0 ,
defaultValue : void 0 ,
2022-05-04 17:25:28 +03:00
children : "" + element . _wrapperState . initialValue
2021-07-30 04:11:27 +03:00
} ) ;
2022-08-26 13:06:25 +03:00
return hostProps ;
2021-07-30 04:11:27 +03:00
}
function initWrapperState$2 ( element , props ) {
var node = element ;
2022-06-15 17:36:57 +03:00
checkControlledValueProps ( "textarea" , props ) , void 0 === props . value || void 0 === props . defaultValue || didWarnValDefaultVal || ( error ( "%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components" , getCurrentFiberOwnerNameInDevOrNull ( ) || "A component" ) , didWarnValDefaultVal = ! 0 ) ;
2021-07-30 04:11:27 +03:00
var initialValue = props . value ;
if ( null == initialValue ) {
var children = props . children , defaultValue = props . defaultValue ;
if ( null != children ) {
2022-06-15 17:36:57 +03:00
if ( error ( "Use the `defaultValue` or `value` props instead of setting children on <textarea>." ) , null != defaultValue ) throw Error ( "If you supply `defaultValue` on a <textarea>, do not pass children." ) ;
2021-07-30 04:11:27 +03:00
if ( Array . isArray ( children ) ) {
if ( ! ( children . length <= 1 ) ) throw Error ( "<textarea> can only have at most one child." ) ;
children = children [ 0 ] ;
}
defaultValue = children ;
}
2022-05-04 17:25:28 +03:00
null == defaultValue && ( defaultValue = "" ) , initialValue = defaultValue ;
2021-07-30 04:11:27 +03:00
}
node . _wrapperState = {
initialValue : getToStringValue ( initialValue )
} ;
}
function updateWrapper$1 ( element , props ) {
2022-06-15 17:36:57 +03:00
var value , node = element , value1 = getToStringValue ( props . value ) , defaultValue = getToStringValue ( props . defaultValue ) ;
if ( null != value1 ) {
var value2 , newValue = "" + value1 ;
2021-07-30 04:11:27 +03:00
newValue !== node . value && ( node . value = newValue ) , null == props . defaultValue && node . defaultValue !== newValue && ( node . defaultValue = newValue ) ;
}
2022-05-04 17:25:28 +03:00
null != defaultValue && ( node . defaultValue = "" + defaultValue ) ;
2021-07-30 04:11:27 +03:00
}
function postMountWrapper$3 ( element , props ) {
var node = element , textContent = node . textContent ;
2022-05-04 17:25:28 +03:00
textContent === node . _wrapperState . initialValue && "" !== textContent && null !== textContent && ( node . value = textContent ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var HTML _NAMESPACE = "http://www.w3.org/1999/xhtml" , MATH _NAMESPACE = "http://www.w3.org/1998/Math/MathML" , SVG _NAMESPACE = "http://www.w3.org/2000/svg" , Namespaces = {
2021-11-15 08:03:03 +03:00
html : HTML _NAMESPACE ,
mathml : MATH _NAMESPACE ,
svg : SVG _NAMESPACE
2021-10-27 07:19:14 +03:00
} ;
2021-07-30 04:11:27 +03:00
function getIntrinsicNamespace ( type ) {
switch ( type ) {
2022-05-04 17:25:28 +03:00
case "svg" :
2021-11-15 08:03:03 +03:00
return SVG _NAMESPACE ;
2022-05-04 17:25:28 +03:00
case "math" :
2021-11-15 08:03:03 +03:00
return MATH _NAMESPACE ;
2021-08-03 18:52:47 +03:00
default :
2021-11-15 08:03:03 +03:00
return HTML _NAMESPACE ;
2021-07-30 04:11:27 +03:00
}
}
function getChildNamespace ( parentNamespace , type ) {
2022-05-04 17:25:28 +03:00
return null == parentNamespace || parentNamespace === HTML _NAMESPACE ? getIntrinsicNamespace ( type ) : parentNamespace === SVG _NAMESPACE && "foreignObject" === type ? HTML _NAMESPACE : parentNamespace ;
2021-07-30 04:11:27 +03:00
}
2021-08-07 11:27:52 +03:00
var setInnerHTML = function ( func ) {
2022-05-04 17:25:28 +03:00
return "undefined" != typeof MSApp && MSApp . execUnsafeLocalFunction ? function ( arg0 , arg1 , arg2 , arg3 ) {
2021-07-30 04:11:27 +03:00
MSApp . execUnsafeLocalFunction ( function ( ) {
return func ( arg0 , arg1 , arg2 , arg3 ) ;
} ) ;
} : func ;
} ( function ( node , html ) {
2022-05-04 17:25:28 +03:00
if ( node . namespaceURI === Namespaces . svg && ! ( "innerHTML" in node ) ) {
2022-08-26 13:06:25 +03:00
reusableSVGContainer = reusableSVGContainer || document . createElement ( "div" ) , reusableSVGContainer . innerHTML = "<svg>" + html . valueOf ( ) . toString ( ) + "</svg>" ;
2021-07-30 04:11:27 +03:00
for ( var svgNode = reusableSVGContainer . firstChild ; node . firstChild ; ) node . removeChild ( node . firstChild ) ;
for ( ; svgNode . firstChild ; ) node . appendChild ( svgNode . firstChild ) ;
return ;
}
node . innerHTML = html ;
} ) , setTextContent = function ( node , text ) {
if ( text ) {
var firstChild = node . firstChild ;
2021-09-16 07:23:33 +03:00
if ( firstChild && firstChild === node . lastChild && 3 === firstChild . nodeType ) {
firstChild . nodeValue = text ;
return ;
}
2021-07-30 04:11:27 +03:00
}
node . textContent = text ;
} , shorthandToLonghand = {
2021-08-03 18:52:47 +03:00
animation : [
2022-05-04 17:25:28 +03:00
"animationDelay" ,
"animationDirection" ,
"animationDuration" ,
"animationFillMode" ,
"animationIterationCount" ,
"animationName" ,
"animationPlayState" ,
"animationTimingFunction" ,
2021-08-03 18:52:47 +03:00
] ,
background : [
2022-05-04 17:25:28 +03:00
"backgroundAttachment" ,
"backgroundClip" ,
"backgroundColor" ,
"backgroundImage" ,
"backgroundOrigin" ,
"backgroundPositionX" ,
"backgroundPositionY" ,
"backgroundRepeat" ,
"backgroundSize" ,
2021-08-03 18:52:47 +03:00
] ,
backgroundPosition : [
2022-05-04 17:25:28 +03:00
"backgroundPositionX" ,
"backgroundPositionY"
2021-08-03 18:52:47 +03:00
] ,
border : [
2022-05-04 17:25:28 +03:00
"borderBottomColor" ,
"borderBottomStyle" ,
"borderBottomWidth" ,
"borderImageOutset" ,
"borderImageRepeat" ,
"borderImageSlice" ,
"borderImageSource" ,
"borderImageWidth" ,
"borderLeftColor" ,
"borderLeftStyle" ,
"borderLeftWidth" ,
"borderRightColor" ,
"borderRightStyle" ,
"borderRightWidth" ,
"borderTopColor" ,
"borderTopStyle" ,
"borderTopWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderBlockEnd : [
2022-05-04 17:25:28 +03:00
"borderBlockEndColor" ,
"borderBlockEndStyle" ,
"borderBlockEndWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderBlockStart : [
2022-05-04 17:25:28 +03:00
"borderBlockStartColor" ,
"borderBlockStartStyle" ,
"borderBlockStartWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderBottom : [
2022-05-04 17:25:28 +03:00
"borderBottomColor" ,
"borderBottomStyle" ,
"borderBottomWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderColor : [
2022-05-04 17:25:28 +03:00
"borderBottomColor" ,
"borderLeftColor" ,
"borderRightColor" ,
"borderTopColor" ,
2021-08-03 18:52:47 +03:00
] ,
borderImage : [
2022-05-04 17:25:28 +03:00
"borderImageOutset" ,
"borderImageRepeat" ,
"borderImageSlice" ,
"borderImageSource" ,
"borderImageWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderInlineEnd : [
2022-05-04 17:25:28 +03:00
"borderInlineEndColor" ,
"borderInlineEndStyle" ,
"borderInlineEndWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderInlineStart : [
2022-05-04 17:25:28 +03:00
"borderInlineStartColor" ,
"borderInlineStartStyle" ,
"borderInlineStartWidth" ,
2021-08-03 18:52:47 +03:00
] ,
borderLeft : [
2022-05-04 17:25:28 +03:00
"borderLeftColor" ,
"borderLeftStyle" ,
"borderLeftWidth"
2021-08-03 18:52:47 +03:00
] ,
borderRadius : [
2022-05-04 17:25:28 +03:00
"borderBottomLeftRadius" ,
"borderBottomRightRadius" ,
"borderTopLeftRadius" ,
"borderTopRightRadius" ,
2021-08-03 18:52:47 +03:00
] ,
borderRight : [
2022-05-04 17:25:28 +03:00
"borderRightColor" ,
"borderRightStyle" ,
"borderRightWidth"
2021-08-03 18:52:47 +03:00
] ,
borderStyle : [
2022-05-04 17:25:28 +03:00
"borderBottomStyle" ,
"borderLeftStyle" ,
"borderRightStyle" ,
"borderTopStyle" ,
2021-08-03 18:52:47 +03:00
] ,
borderTop : [
2022-05-04 17:25:28 +03:00
"borderTopColor" ,
"borderTopStyle" ,
"borderTopWidth"
2021-08-03 18:52:47 +03:00
] ,
borderWidth : [
2022-05-04 17:25:28 +03:00
"borderBottomWidth" ,
"borderLeftWidth" ,
"borderRightWidth" ,
"borderTopWidth" ,
2021-08-03 18:52:47 +03:00
] ,
columnRule : [
2022-05-04 17:25:28 +03:00
"columnRuleColor" ,
"columnRuleStyle" ,
"columnRuleWidth"
2021-08-03 18:52:47 +03:00
] ,
columns : [
2022-05-04 17:25:28 +03:00
"columnCount" ,
"columnWidth"
2021-08-03 18:52:47 +03:00
] ,
flex : [
2022-05-04 17:25:28 +03:00
"flexBasis" ,
"flexGrow" ,
"flexShrink"
2021-08-03 18:52:47 +03:00
] ,
flexFlow : [
2022-05-04 17:25:28 +03:00
"flexDirection" ,
"flexWrap"
2021-08-03 18:52:47 +03:00
] ,
font : [
2022-05-04 17:25:28 +03:00
"fontFamily" ,
"fontFeatureSettings" ,
"fontKerning" ,
"fontLanguageOverride" ,
"fontSize" ,
"fontSizeAdjust" ,
"fontStretch" ,
"fontStyle" ,
"fontVariant" ,
"fontVariantAlternates" ,
"fontVariantCaps" ,
"fontVariantEastAsian" ,
"fontVariantLigatures" ,
"fontVariantNumeric" ,
"fontVariantPosition" ,
"fontWeight" ,
"lineHeight" ,
2021-08-03 18:52:47 +03:00
] ,
fontVariant : [
2022-05-04 17:25:28 +03:00
"fontVariantAlternates" ,
"fontVariantCaps" ,
"fontVariantEastAsian" ,
"fontVariantLigatures" ,
"fontVariantNumeric" ,
"fontVariantPosition" ,
2021-08-03 18:52:47 +03:00
] ,
gap : [
2022-05-04 17:25:28 +03:00
"columnGap" ,
"rowGap"
2021-08-03 18:52:47 +03:00
] ,
grid : [
2022-05-04 17:25:28 +03:00
"gridAutoColumns" ,
"gridAutoFlow" ,
"gridAutoRows" ,
"gridTemplateAreas" ,
"gridTemplateColumns" ,
"gridTemplateRows" ,
2021-08-03 18:52:47 +03:00
] ,
gridArea : [
2022-05-04 17:25:28 +03:00
"gridColumnEnd" ,
"gridColumnStart" ,
"gridRowEnd" ,
"gridRowStart" ,
2021-08-03 18:52:47 +03:00
] ,
gridColumn : [
2022-05-04 17:25:28 +03:00
"gridColumnEnd" ,
"gridColumnStart"
2021-08-03 18:52:47 +03:00
] ,
gridColumnGap : [
2022-05-04 17:25:28 +03:00
"columnGap"
2021-08-03 18:52:47 +03:00
] ,
gridGap : [
2022-05-04 17:25:28 +03:00
"columnGap" ,
"rowGap"
2021-08-03 18:52:47 +03:00
] ,
gridRow : [
2022-05-04 17:25:28 +03:00
"gridRowEnd" ,
"gridRowStart"
2021-08-03 18:52:47 +03:00
] ,
gridRowGap : [
2022-05-04 17:25:28 +03:00
"rowGap"
2021-08-03 18:52:47 +03:00
] ,
gridTemplate : [
2022-05-04 17:25:28 +03:00
"gridTemplateAreas" ,
"gridTemplateColumns" ,
"gridTemplateRows" ,
2021-08-03 18:52:47 +03:00
] ,
listStyle : [
2022-05-04 17:25:28 +03:00
"listStyleImage" ,
"listStylePosition" ,
"listStyleType"
2021-08-03 18:52:47 +03:00
] ,
margin : [
2022-05-04 17:25:28 +03:00
"marginBottom" ,
"marginLeft" ,
"marginRight" ,
"marginTop"
2021-08-03 18:52:47 +03:00
] ,
marker : [
2022-05-04 17:25:28 +03:00
"markerEnd" ,
"markerMid" ,
"markerStart"
2021-08-03 18:52:47 +03:00
] ,
mask : [
2022-05-04 17:25:28 +03:00
"maskClip" ,
"maskComposite" ,
"maskImage" ,
"maskMode" ,
"maskOrigin" ,
"maskPositionX" ,
"maskPositionY" ,
"maskRepeat" ,
"maskSize" ,
2021-08-03 18:52:47 +03:00
] ,
maskPosition : [
2022-05-04 17:25:28 +03:00
"maskPositionX" ,
"maskPositionY"
2021-08-03 18:52:47 +03:00
] ,
outline : [
2022-05-04 17:25:28 +03:00
"outlineColor" ,
"outlineStyle" ,
"outlineWidth"
2021-08-03 18:52:47 +03:00
] ,
overflow : [
2022-05-04 17:25:28 +03:00
"overflowX" ,
"overflowY"
2021-08-03 18:52:47 +03:00
] ,
padding : [
2022-05-04 17:25:28 +03:00
"paddingBottom" ,
"paddingLeft" ,
"paddingRight" ,
"paddingTop"
2021-08-03 18:52:47 +03:00
] ,
placeContent : [
2022-05-04 17:25:28 +03:00
"alignContent" ,
"justifyContent"
2021-08-03 18:52:47 +03:00
] ,
placeItems : [
2022-05-04 17:25:28 +03:00
"alignItems" ,
"justifyItems"
2021-08-03 18:52:47 +03:00
] ,
placeSelf : [
2022-05-04 17:25:28 +03:00
"alignSelf" ,
"justifySelf"
2021-08-03 18:52:47 +03:00
] ,
textDecoration : [
2022-05-04 17:25:28 +03:00
"textDecorationColor" ,
"textDecorationLine" ,
"textDecorationStyle" ,
2021-08-03 18:52:47 +03:00
] ,
textEmphasis : [
2022-05-04 17:25:28 +03:00
"textEmphasisColor" ,
"textEmphasisStyle"
2021-08-03 18:52:47 +03:00
] ,
transition : [
2022-05-04 17:25:28 +03:00
"transitionDelay" ,
"transitionDuration" ,
"transitionProperty" ,
"transitionTimingFunction" ,
2021-08-03 18:52:47 +03:00
] ,
wordWrap : [
2022-05-04 17:25:28 +03:00
"overflowWrap"
2021-08-03 18:52:47 +03:00
]
2021-07-30 04:11:27 +03:00
} , isUnitlessNumber = {
animationIterationCount : ! 0 ,
borderImageOutset : ! 0 ,
borderImageSlice : ! 0 ,
borderImageWidth : ! 0 ,
boxFlex : ! 0 ,
boxFlexGroup : ! 0 ,
boxOrdinalGroup : ! 0 ,
columnCount : ! 0 ,
columns : ! 0 ,
flex : ! 0 ,
flexGrow : ! 0 ,
flexPositive : ! 0 ,
flexShrink : ! 0 ,
flexNegative : ! 0 ,
flexOrder : ! 0 ,
gridArea : ! 0 ,
gridRow : ! 0 ,
gridRowEnd : ! 0 ,
gridRowSpan : ! 0 ,
gridRowStart : ! 0 ,
gridColumn : ! 0 ,
gridColumnEnd : ! 0 ,
gridColumnSpan : ! 0 ,
gridColumnStart : ! 0 ,
fontWeight : ! 0 ,
lineClamp : ! 0 ,
lineHeight : ! 0 ,
opacity : ! 0 ,
order : ! 0 ,
orphans : ! 0 ,
tabSize : ! 0 ,
widows : ! 0 ,
zIndex : ! 0 ,
zoom : ! 0 ,
fillOpacity : ! 0 ,
floodOpacity : ! 0 ,
stopOpacity : ! 0 ,
strokeDasharray : ! 0 ,
strokeDashoffset : ! 0 ,
strokeMiterlimit : ! 0 ,
strokeOpacity : ! 0 ,
strokeWidth : ! 0
2022-06-15 17:36:57 +03:00
} , prefixes = [
2022-05-04 17:25:28 +03:00
"Webkit" ,
"ms" ,
"Moz" ,
"O"
2021-08-03 18:52:47 +03:00
] ;
2021-07-30 04:11:27 +03:00
function dangerousStyleValue ( name , value , isCustomProperty ) {
2022-05-04 17:25:28 +03:00
return null == value || "boolean" == typeof value || "" === value ? "" : isCustomProperty || "number" != typeof value || 0 === value || isUnitlessNumber . hasOwnProperty ( name ) && isUnitlessNumber [ name ] ? ( "" + value ) . trim ( ) : value + "px" ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
Object . keys ( isUnitlessNumber ) . forEach ( function ( prop ) {
2022-06-15 17:36:57 +03:00
prefixes . forEach ( function ( prefix ) {
var prefix1 , key ;
isUnitlessNumber [ ( prefix1 = prefix ) + ( key = prop ) . charAt ( 0 ) . toUpperCase ( ) + key . substring ( 1 ) ] = isUnitlessNumber [ prop ] ;
2021-08-04 13:27:17 +03:00
} ) ;
} ) ;
2021-07-30 04:11:27 +03:00
var uppercasePattern = /([A-Z])/g , msPattern = /^ms-/ ;
function hyphenateStyleName ( name ) {
2022-05-04 17:25:28 +03:00
return name . replace ( uppercasePattern , "-$1" ) . toLowerCase ( ) . replace ( msPattern , "-ms-" ) ;
2021-07-30 04:11:27 +03:00
}
2022-01-02 23:54:58 +03:00
var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/ , msPattern$1 = /^-ms-/ , hyphenPattern = /-(.)/g , badStyleValueWithSemicolonPattern = /;\s*$/ , warnedStyleNames = { } , warnedStyleValues = { } , warnedForNaNValue = ! 1 , warnedForInfinityValue = ! 1 , warnHyphenatedStyleName = function ( name ) {
2022-04-29 08:58:59 +03:00
var string ;
2022-08-26 13:06:25 +03:00
warnedStyleNames . hasOwnProperty ( name ) && warnedStyleNames [ name ] || ( warnedStyleNames [ name ] = ! 0 , error ( "Unsupported style property %s. Did you mean %s?" , name , ( string = name . replace ( msPattern$1 , "ms-" ) , string . replace ( hyphenPattern , function ( _ , character ) {
2021-08-10 11:52:28 +03:00
return character . toUpperCase ( ) ;
2022-08-26 13:06:25 +03:00
} ) ) ) ) ;
2021-07-30 04:11:27 +03:00
} , warnBadVendoredStyleName = function ( name ) {
2022-06-15 17:36:57 +03:00
warnedStyleNames . hasOwnProperty ( name ) && warnedStyleNames [ name ] || ( warnedStyleNames [ name ] = ! 0 , error ( "Unsupported vendor-prefixed style property %s. Did you mean %s?" , name , name . charAt ( 0 ) . toUpperCase ( ) + name . slice ( 1 ) ) ) ;
2021-07-30 04:11:27 +03:00
} , warnStyleValueWithSemicolon = function ( name , value ) {
2022-06-15 17:36:57 +03:00
warnedStyleValues . hasOwnProperty ( value ) && warnedStyleValues [ value ] || ( warnedStyleValues [ value ] = ! 0 , error ( 'Style property values shouldn\'t contain a semicolon. Try "%s: %s" instead.' , name , value . replace ( badStyleValueWithSemicolonPattern , "" ) ) ) ;
2021-07-30 04:11:27 +03:00
} , warnStyleValueIsNaN = function ( name , value ) {
2022-06-15 17:36:57 +03:00
warnedForNaNValue || ( warnedForNaNValue = ! 0 , error ( "`NaN` is an invalid value for the `%s` css style property." , name ) ) ;
2021-07-30 04:11:27 +03:00
} , warnStyleValueIsInfinity = function ( name , value ) {
2022-06-15 17:36:57 +03:00
warnedForInfinityValue || ( warnedForInfinityValue = ! 0 , error ( "`Infinity` is an invalid value for the `%s` css style property." , name ) ) ;
2021-08-04 13:27:17 +03:00
} , warnValidStyle$1 = function ( name , value ) {
2022-05-04 17:25:28 +03:00
name . indexOf ( "-" ) > - 1 ? warnHyphenatedStyleName ( name ) : badVendoredStyleNamePattern . test ( name ) ? warnBadVendoredStyleName ( name ) : badStyleValueWithSemicolonPattern . test ( value ) && warnStyleValueWithSemicolon ( name , value ) , "number" != typeof value || ( isNaN ( value ) ? warnStyleValueIsNaN ( name , value ) : isFinite ( value ) || warnStyleValueIsInfinity ( name , value ) ) ;
2021-08-04 13:27:17 +03:00
} ;
2021-07-30 04:11:27 +03:00
function createDangerousStringForStyles ( styles ) {
2022-05-04 17:25:28 +03:00
var serialized = "" , delimiter = "" ;
2021-07-30 04:11:27 +03:00
for ( var styleName in styles ) if ( styles . hasOwnProperty ( styleName ) ) {
var styleValue = styles [ styleName ] ;
if ( null != styleValue ) {
2022-05-04 17:25:28 +03:00
var isCustomProperty = 0 === styleName . indexOf ( "--" ) ;
serialized += delimiter + ( isCustomProperty ? styleName : hyphenateStyleName ( styleName ) ) + ":" , serialized += dangerousStyleValue ( styleName , styleValue , isCustomProperty ) , delimiter = ";" ;
2021-07-30 04:11:27 +03:00
}
}
return serialized || null ;
}
function setValueForStyles ( node , styles ) {
var style = node . style ;
for ( var styleName in styles ) if ( styles . hasOwnProperty ( styleName ) ) {
2022-05-04 17:25:28 +03:00
var isCustomProperty = 0 === styleName . indexOf ( "--" ) ;
2021-07-30 04:11:27 +03:00
isCustomProperty || warnValidStyle$1 ( styleName , styles [ styleName ] ) ;
var styleValue = dangerousStyleValue ( styleName , styles [ styleName ] , isCustomProperty ) ;
2022-05-04 17:25:28 +03:00
"float" === styleName && ( styleName = "cssFloat" ) , isCustomProperty ? style . setProperty ( styleName , styleValue ) : style [ styleName ] = styleValue ;
2021-07-30 04:11:27 +03:00
}
}
function isValueEmpty ( value ) {
2022-05-04 17:25:28 +03:00
return null == value || "boolean" == typeof value || "" === value ;
2021-07-30 04:11:27 +03:00
}
function expandShorthandMap ( styles ) {
2022-01-02 23:54:58 +03:00
var expanded = { } ;
2021-08-03 18:52:47 +03:00
for ( var key in styles ) for ( var longhands = shorthandToLonghand [ key ] || [
key
] , i = 0 ; i < longhands . length ; i ++ ) expanded [ longhands [ i ] ] = key ;
2021-07-30 04:11:27 +03:00
return expanded ;
}
var voidElementTags = _assign ( {
menuitem : ! 0
} , {
area : ! 0 ,
base : ! 0 ,
br : ! 0 ,
col : ! 0 ,
embed : ! 0 ,
hr : ! 0 ,
img : ! 0 ,
input : ! 0 ,
keygen : ! 0 ,
link : ! 0 ,
meta : ! 0 ,
param : ! 0 ,
source : ! 0 ,
track : ! 0 ,
wbr : ! 0
} ) ;
function assertValidProps ( tag , props ) {
if ( props ) {
if ( voidElementTags [ tag ] && ! ( null == props . children && null == props . dangerouslySetInnerHTML ) ) throw Error ( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." ) ;
if ( null != props . dangerouslySetInnerHTML ) {
if ( null != props . children ) throw Error ( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." ) ;
2022-05-04 17:25:28 +03:00
if ( ! ( "object" == typeof props . dangerouslySetInnerHTML && "__html" in props . dangerouslySetInnerHTML ) ) throw Error ( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information." ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
if ( ! props . suppressContentEditableWarning && props . contentEditable && null != props . children && error ( "A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional." ) , ! ( null == props . style || "object" == typeof props . style ) ) throw Error ( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ) ;
2021-07-30 04:11:27 +03:00
}
}
function isCustomComponent ( tagName , props ) {
2022-05-04 17:25:28 +03:00
if ( - 1 === tagName . indexOf ( "-" ) ) return "string" == typeof props . is ;
2021-07-30 04:11:27 +03:00
switch ( tagName ) {
2022-05-04 17:25:28 +03:00
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" :
2021-08-03 18:52:47 +03:00
return ! 1 ;
default :
return ! 0 ;
2021-07-30 04:11:27 +03:00
}
}
var possibleStandardNames = {
2022-05-04 17:25:28 +03:00
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" ,
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" ,
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" ,
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" ,
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"
2021-07-30 04:11:27 +03:00
} , ariaProperties = {
2022-05-04 17:25:28 +03:00
"aria-current" : 0 ,
"aria-details" : 0 ,
"aria-disabled" : 0 ,
"aria-hidden" : 0 ,
"aria-invalid" : 0 ,
"aria-keyshortcuts" : 0 ,
"aria-label" : 0 ,
"aria-roledescription" : 0 ,
"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 ,
"aria-atomic" : 0 ,
"aria-busy" : 0 ,
"aria-live" : 0 ,
"aria-relevant" : 0 ,
"aria-dropeffect" : 0 ,
"aria-grabbed" : 0 ,
"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
2022-06-11 08:27:13 +03:00
} , warnedProperties = { } , rARIA = RegExp ( "^(aria)-[" + ATTRIBUTE _NAME _CHAR + "]*$" ) , rARIACamel = RegExp ( "^(aria)[A-Z][" + ATTRIBUTE _NAME _CHAR + "]*$" ) , hasOwnProperty$1 = Object . prototype . hasOwnProperty ;
2021-07-30 04:11:27 +03:00
function validateProperty ( tagName , name ) {
if ( hasOwnProperty$1 . call ( warnedProperties , name ) && warnedProperties [ name ] ) return ! 0 ;
if ( rARIACamel . test ( name ) ) {
2022-05-04 17:25:28 +03:00
var ariaName = "aria-" + name . slice ( 4 ) . toLowerCase ( ) , correctName = ariaProperties . hasOwnProperty ( ariaName ) ? ariaName : null ;
2022-06-15 17:36:57 +03:00
if ( null == correctName ) return error ( "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase." , name ) , warnedProperties [ name ] = ! 0 , ! 0 ;
if ( name !== correctName ) return error ( "Invalid ARIA attribute `%s`. Did you mean `%s`?" , name , correctName ) , warnedProperties [ name ] = ! 0 , ! 0 ;
2021-07-30 04:11:27 +03:00
}
if ( rARIA . test ( name ) ) {
var lowerCasedName = name . toLowerCase ( ) , standardName = ariaProperties . hasOwnProperty ( lowerCasedName ) ? lowerCasedName : null ;
2021-08-15 16:09:21 +03:00
if ( null == standardName ) return warnedProperties [ name ] = ! 0 , ! 1 ;
2022-06-15 17:36:57 +03:00
name !== standardName && ( error ( "Unknown ARIA attribute `%s`. Did you mean `%s`?" , name , standardName ) , warnedProperties [ name ] = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
return ! 0 ;
}
2022-06-11 08:27:13 +03:00
var didWarnValueNull = ! 1 , validateProperty$1 = function ( ) { } , warnedProperties$1 = { } , _hasOwnProperty = Object . prototype . hasOwnProperty , EVENT _NAME _REGEX = /^on./ , INVALID _EVENT _NAME _REGEX = /^on[^A-Z]/ , rARIA$1 = RegExp ( "^(aria)-[" + ATTRIBUTE _NAME _CHAR + "]*$" ) , rARIACamel$1 = RegExp ( "^(aria)[A-Z][" + ATTRIBUTE _NAME _CHAR + "]*$" ) ;
2021-10-10 06:47:11 +03:00
validateProperty$1 = function ( tagName , name , value , eventRegistry ) {
if ( _hasOwnProperty . call ( warnedProperties$1 , name ) && warnedProperties$1 [ name ] ) return ! 0 ;
var lowerCasedName = name . toLowerCase ( ) ;
2022-06-15 17:36:57 +03:00
if ( "onfocusin" === lowerCasedName || "onfocusout" === lowerCasedName ) return 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$1 [ name ] = ! 0 , ! 0 ;
2021-10-10 06:47:11 +03:00
if ( null != eventRegistry ) {
var registrationNameDependencies = eventRegistry . registrationNameDependencies , possibleRegistrationNames = eventRegistry . possibleRegistrationNames ;
if ( registrationNameDependencies . hasOwnProperty ( name ) ) return ! 0 ;
var registrationName = possibleRegistrationNames . hasOwnProperty ( lowerCasedName ) ? possibleRegistrationNames [ lowerCasedName ] : null ;
2022-06-15 17:36:57 +03:00
if ( null != registrationName ) return error ( "Invalid event handler property `%s`. Did you mean `%s`?" , name , registrationName ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
if ( EVENT _NAME _REGEX . test ( name ) ) return error ( "Unknown event handler property `%s`. It will be ignored." , name ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
} else if ( EVENT _NAME _REGEX . test ( name ) ) return INVALID _EVENT _NAME _REGEX . test ( name ) && error ( "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`." , name ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
2021-10-10 06:47:11 +03:00
if ( rARIA$1 . test ( name ) || rARIACamel$1 . test ( name ) ) return ! 0 ;
2022-06-15 17:36:57 +03:00
if ( "innerhtml" === lowerCasedName ) return error ( "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`." ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
if ( "aria" === lowerCasedName ) return error ( "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead." ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
if ( "is" === lowerCasedName && null != value && "string" != typeof value ) return error ( "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string." , typeof value ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
if ( "number" == typeof value && isNaN ( value ) ) return error ( "Received NaN for the `%s` attribute. If this is expected, cast the value to a string." , name ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
2021-10-10 06:47:11 +03:00
var propertyInfo = getPropertyInfo ( name ) , isReserved = null !== propertyInfo && 0 === propertyInfo . type ;
if ( possibleStandardNames . hasOwnProperty ( lowerCasedName ) ) {
var standardName = possibleStandardNames [ lowerCasedName ] ;
2022-06-15 17:36:57 +03:00
if ( standardName !== name ) return error ( "Invalid DOM property `%s`. Did you mean `%s`?" , name , standardName ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ;
} else if ( ! isReserved && name !== lowerCasedName ) return 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$1 [ name ] = ! 0 , ! 0 ;
return "boolean" == typeof value && shouldRemoveAttributeWithWarning ( name , value , propertyInfo , ! 1 ) ? ( value ? error ( 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.' , value , name , name , value , name ) : error ( 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.' , value , name , name , value , name , name , name ) , warnedProperties$1 [ name ] = ! 0 , ! 0 ) : ! ! isReserved || ( shouldRemoveAttributeWithWarning ( name , value , propertyInfo , ! 1 ) ? ( warnedProperties$1 [ name ] = ! 0 , ! 1 ) : ( ( "false" === value || "true" === value ) && null !== propertyInfo && 3 === propertyInfo . type && ( error ( "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?" , value , name , "false" === value ? "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$1 [ name ] = ! 0 ) , ! 0 ) ) ;
2021-10-10 06:47:11 +03:00
} ;
var warnUnknownProperties = function ( type , props , eventRegistry ) {
2021-08-10 11:52:28 +03:00
var unknownProps = [ ] ;
2021-10-10 06:47:11 +03:00
for ( var key in props ) validateProperty$1 ( type , key , props [ key ] , eventRegistry ) || unknownProps . push ( key ) ;
2021-07-30 04:11:27 +03:00
var unknownPropString = unknownProps . map ( function ( prop ) {
2022-05-04 17:25:28 +03:00
return "`" + prop + "`" ;
} ) . join ( ", " ) ;
2022-06-15 17:36:57 +03:00
1 === unknownProps . length ? 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 ) : 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 ) ;
2021-07-30 04:11:27 +03:00
} ;
function getEventTarget ( nativeEvent ) {
var target = nativeEvent . target || nativeEvent . srcElement || window ;
return target . correspondingUseElement && ( target = target . correspondingUseElement ) , 3 === target . nodeType ? target . parentNode : target ;
}
var restoreImpl = null , restoreTarget = null , restoreQueue = null ;
function restoreStateOfTarget ( target ) {
var internalInstance = getInstanceFromNode ( target ) ;
if ( internalInstance ) {
2022-05-04 17:25:28 +03:00
if ( "function" != typeof restoreImpl ) throw Error ( "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
var stateNode = internalInstance . stateNode ;
if ( stateNode ) {
var _props = getFiberCurrentPropsFromNode ( stateNode ) ;
restoreImpl ( internalInstance . stateNode , internalInstance . type , _props ) ;
}
}
}
function enqueueStateRestore ( target ) {
2021-08-03 18:52:47 +03:00
restoreTarget ? restoreQueue ? restoreQueue . push ( target ) : restoreQueue = [
target
] : restoreTarget = target ;
2021-07-30 04:11:27 +03:00
}
function restoreStateIfNeeded ( ) {
if ( restoreTarget ) {
var target = restoreTarget , queuedTargets = restoreQueue ;
if ( restoreTarget = null , restoreQueue = null , restoreStateOfTarget ( target ) , queuedTargets ) for ( var i = 0 ; i < queuedTargets . length ; i ++ ) restoreStateOfTarget ( queuedTargets [ i ] ) ;
}
}
var batchedUpdatesImpl = function ( fn , bookkeeping ) {
return fn ( bookkeeping ) ;
} , discreteUpdatesImpl = function ( fn , a , b , c , d ) {
return fn ( a , b , c , d ) ;
2022-01-02 23:54:58 +03:00
} , flushDiscreteUpdatesImpl = function ( ) { } , batchedEventUpdatesImpl = batchedUpdatesImpl , isInsideEventHandler = ! 1 , isBatchingEventUpdates = ! 1 ;
2021-07-30 04:11:27 +03:00
function finishEventHandler ( ) {
2021-09-08 12:45:39 +03:00
( null !== restoreTarget || null !== restoreQueue ) && ( flushDiscreteUpdatesImpl ( ) , restoreStateIfNeeded ( ) ) ;
2021-07-30 04:11:27 +03:00
}
function getListener ( inst , registrationName ) {
var stateNode = inst . stateNode ;
if ( null === stateNode ) return null ;
2022-06-15 17:36:57 +03:00
var props = getFiberCurrentPropsFromNode ( stateNode ) ;
if ( null === props ) return null ;
var listener = props [ registrationName ] ;
2022-03-08 17:35:18 +03:00
if ( function ( name , type , props ) {
2021-09-08 12:45:39 +03:00
switch ( name ) {
2022-05-04 17:25:28 +03:00
case "onClick" :
case "onClickCapture" :
case "onDoubleClick" :
case "onDoubleClickCapture" :
case "onMouseDown" :
case "onMouseDownCapture" :
case "onMouseMove" :
case "onMouseMoveCapture" :
case "onMouseUp" :
case "onMouseUpCapture" :
case "onMouseEnter" :
2021-09-08 12:45:39 +03:00
var tag ;
2022-05-04 17:25:28 +03:00
return ! ! ( props . disabled && ( "button" === ( tag = type ) || "input" === tag || "select" === tag || "textarea" === tag ) ) ;
2021-09-08 12:45:39 +03:00
default :
return ! 1 ;
}
2022-06-15 17:36:57 +03:00
} ( registrationName , inst . type , props ) ) return null ;
2022-05-04 17:25:28 +03:00
if ( ! ( ! listener || "function" == typeof listener ) ) throw Error ( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." ) ;
2021-07-30 04:11:27 +03:00
return listener ;
}
var passiveBrowserEventsSupported = ! 1 ;
2021-08-04 13:27:17 +03:00
if ( canUseDOM ) try {
2022-06-15 17:36:57 +03:00
var options = { } ;
Object . defineProperty ( options , "passive" , {
2021-08-04 13:27:17 +03:00
get : function ( ) {
passiveBrowserEventsSupported = ! 0 ;
}
2022-06-15 17:36:57 +03:00
} ) , window . addEventListener ( "test" , options , options ) , window . removeEventListener ( "test" , options , options ) ;
} catch ( e ) {
2021-08-04 13:27:17 +03:00
passiveBrowserEventsSupported = ! 1 ;
}
2021-07-30 04:11:27 +03:00
function invokeGuardedCallbackProd ( name , func , context , a , b , c , d , e , f ) {
var funcArgs = Array . prototype . slice . call ( arguments , 3 ) ;
try {
func . apply ( context , funcArgs ) ;
} catch ( error ) {
this . onError ( error ) ;
}
}
2021-08-04 13:27:17 +03:00
var invokeGuardedCallbackImpl = invokeGuardedCallbackProd ;
2022-05-04 17:25:28 +03:00
if ( "undefined" != typeof window && "function" == typeof window . dispatchEvent && "undefined" != typeof document && "function" == typeof document . createEvent ) {
var fakeNode = document . createElement ( "react" ) ;
2021-08-04 13:27:17 +03:00
invokeGuardedCallbackImpl = function ( name , func , context , a , b , c , d , e , f ) {
2022-05-04 17:25:28 +03:00
if ( ! ( "undefined" != typeof document ) ) throw Error ( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." ) ;
var error , evt = document . createEvent ( "Event" ) , didCall = ! 1 , didError = ! 0 , windowEvent = window . event , windowEventDescriptor = Object . getOwnPropertyDescriptor ( window , "event" ) ;
2021-08-04 13:27:17 +03:00
function restoreAfterDispatch ( ) {
2022-05-04 17:25:28 +03:00
fakeNode . removeEventListener ( evtType , callCallback , ! 1 ) , void 0 !== window . event && window . hasOwnProperty ( "event" ) && ( window . event = windowEvent ) ;
2021-08-04 13:27:17 +03:00
}
var funcArgs = Array . prototype . slice . call ( arguments , 3 ) ;
function callCallback ( ) {
didCall = ! 0 , restoreAfterDispatch ( ) , func . apply ( context , funcArgs ) , didError = ! 1 ;
}
2021-08-07 11:27:52 +03:00
var didSetError = ! 1 , isCrossOriginError = ! 1 ;
2021-08-04 13:27:17 +03:00
function handleWindowError ( event ) {
2022-05-04 17:25:28 +03:00
if ( error = event . error , didSetError = ! 0 , null === error && 0 === event . colno && 0 === event . lineno && ( isCrossOriginError = ! 0 ) , event . defaultPrevented && null != error && "object" == typeof error ) try {
2021-10-21 08:12:50 +03:00
error . _suppressLogging = ! 0 ;
2022-01-02 23:54:58 +03:00
} catch ( inner ) { }
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
var evtType = "react-" + ( name || "invokeguardedcallback" ) ;
2022-06-11 08:27:13 +03:00
if ( window . addEventListener ( "error" , handleWindowError ) , fakeNode . addEventListener ( evtType , callCallback , ! 1 ) , evt . initEvent ( evtType , ! 1 , ! 1 ) , fakeNode . dispatchEvent ( evt ) , windowEventDescriptor && Object . defineProperty ( window , "event" , windowEventDescriptor ) , didCall && didError && ( didSetError ? isCrossOriginError && ( error = Error ( "A cross-origin error was thrown. React doesn't have access to the actual error object in development. See https://reactjs.org/link/crossorigin-error for more information." ) ) : error = Error ( "An error was thrown inside one of your components, but React doesn't know what it was. This is likely due to browser flakiness. React does its best to preserve the \"Pause on exceptions\" behavior of the DevTools, which requires some DEV-mode only tricks. It's possible that these don't work in your browser. Try triggering the error in production mode, or switching to a modern browser. If you suspect that this is actually an issue with React, please file an issue." ) , this . onError ( error ) ) , window . removeEventListener ( "error" , handleWindowError ) , ! didCall ) return restoreAfterDispatch ( ) , invokeGuardedCallbackProd . apply ( this , arguments ) ;
2021-08-04 13:27:17 +03:00
} ;
}
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl , hasError = ! 1 , caughtError = null , hasRethrowError = ! 1 , rethrowError = null , reporter = {
2021-07-30 04:11:27 +03:00
onError : function ( error ) {
hasError = ! 0 , caughtError = error ;
}
} ;
function invokeGuardedCallback ( name , func , context , a , b , c , d , e , f ) {
hasError = ! 1 , caughtError = null , invokeGuardedCallbackImpl$1 . apply ( reporter , arguments ) ;
}
function clearCaughtError ( ) {
2021-08-15 16:09:21 +03:00
if ( hasError ) {
var error = caughtError ;
return hasError = ! 1 , caughtError = null , error ;
}
2021-07-30 04:11:27 +03:00
throw Error ( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." ) ;
}
2022-03-09 18:43:01 +03:00
var _ReactInternals$Sched = React . _ _SECRET _INTERNALS _DO _NOT _USE _OR _YOU _WILL _BE _FIRED . Scheduler , unstable _cancelCallback = _ReactInternals$Sched . unstable _cancelCallback , unstable _now = _ReactInternals$Sched . unstable _now , unstable _scheduleCallback = _ReactInternals$Sched . unstable _scheduleCallback , unstable _shouldYield = _ReactInternals$Sched . unstable _shouldYield , unstable _requestPaint = _ReactInternals$Sched . unstable _requestPaint , unstable _runWithPriority = ( _ReactInternals$Sched . unstable _getFirstCallbackNode , _ReactInternals$Sched . unstable _runWithPriority ) , unstable _getCurrentPriorityLevel = ( _ReactInternals$Sched . unstable _next , _ReactInternals$Sched . unstable _continueExecution , _ReactInternals$Sched . unstable _pauseExecution , _ReactInternals$Sched . unstable _getCurrentPriorityLevel ) , unstable _ImmediatePriority = _ReactInternals$Sched . unstable _ImmediatePriority , unstable _UserBlockingPriority = _ReactInternals$Sched . unstable _UserBlockingPriority , unstable _NormalPriority = _ReactInternals$Sched . unstable _NormalPriority , unstable _LowPriority = _ReactInternals$Sched . unstable _LowPriority , unstable _IdlePriority = _ReactInternals$Sched . unstable _IdlePriority , unstable _flushAllWithoutAsserting = ( _ReactInternals$Sched . unstable _forceFrameRate , _ReactInternals$Sched . unstable _flushAllWithoutAsserting ) ;
2022-06-15 17:36:57 +03:00
function get ( key ) {
2021-07-30 04:11:27 +03:00
return key . _reactInternals ;
}
2022-08-26 13:06:25 +03:00
var ReactCurrentOwner = ReactSharedInternals . ReactCurrentOwner ;
2021-07-30 04:11:27 +03:00
function getNearestMountedFiber ( fiber ) {
var node = fiber , nearestMounted = fiber ;
if ( fiber . alternate ) for ( ; node . return ; ) node = node . return ;
else {
var nextNode = node ;
2022-08-26 13:06:25 +03:00
do ( 1026 & ( node = nextNode ) . flags ) != 0 && ( nearestMounted = node . return ) , nextNode = node . return ;
2021-07-30 04:11:27 +03:00
while ( nextNode )
}
return 3 === node . tag ? nearestMounted : null ;
}
function getSuspenseInstanceFromFiber ( fiber ) {
if ( 13 === fiber . tag ) {
var suspenseState = fiber . memoizedState ;
if ( null === suspenseState ) {
var current = fiber . alternate ;
null !== current && ( suspenseState = current . memoizedState ) ;
}
if ( null !== suspenseState ) return suspenseState . dehydrated ;
}
return null ;
}
function getContainerFromFiber ( fiber ) {
return 3 === fiber . tag ? fiber . stateNode . containerInfo : null ;
}
function assertIsMounted ( fiber ) {
if ( getNearestMountedFiber ( fiber ) !== fiber ) throw Error ( "Unable to find node on an unmounted component." ) ;
}
function findCurrentFiberUsingSlowPath ( fiber ) {
var alternate = fiber . alternate ;
if ( ! alternate ) {
var nearestMounted = getNearestMountedFiber ( fiber ) ;
if ( ! ( null !== nearestMounted ) ) throw Error ( "Unable to find node on an unmounted component." ) ;
return nearestMounted !== fiber ? null : fiber ;
}
for ( var a = fiber , b = alternate ; ; ) {
var parentA = a . return ;
if ( null === parentA ) break ;
var parentB = parentA . alternate ;
if ( null === parentB ) {
var nextParent = parentA . return ;
if ( null !== nextParent ) {
a = b = nextParent ;
continue ;
}
break ;
}
if ( parentA . child === parentB . child ) {
for ( var child = parentA . child ; child ; ) {
if ( child === a ) return assertIsMounted ( parentA ) , fiber ;
if ( child === b ) return assertIsMounted ( parentA ) , alternate ;
child = child . sibling ;
}
throw Error ( "Unable to find node on an unmounted component." ) ;
}
if ( a . return !== b . return ) a = parentA , b = parentB ;
else {
for ( var didFindChild = ! 1 , _child = parentA . child ; _child ; ) {
if ( _child === a ) {
didFindChild = ! 0 , a = parentA , b = parentB ;
break ;
}
if ( _child === b ) {
didFindChild = ! 0 , b = parentA , a = parentB ;
break ;
}
_child = _child . sibling ;
}
if ( ! didFindChild ) {
for ( _child = parentB . child ; _child ; ) {
if ( _child === a ) {
didFindChild = ! 0 , a = parentB , b = parentA ;
break ;
}
if ( _child === b ) {
didFindChild = ! 0 , b = parentB , a = parentA ;
break ;
}
_child = _child . sibling ;
}
if ( ! didFindChild ) throw Error ( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." ) ;
}
}
if ( a . alternate !== b ) throw Error ( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." ) ;
}
if ( 3 !== a . tag ) throw Error ( "Unable to find node on an unmounted component." ) ;
return a . stateNode . current === a ? fiber : alternate ;
}
function findCurrentHostFiber ( parent ) {
var currentParent = findCurrentFiberUsingSlowPath ( parent ) ;
if ( ! currentParent ) return null ;
for ( var node = currentParent ; ; ) {
if ( 5 === node . tag || 6 === node . tag ) return node ;
if ( node . child ) {
node . child . return = node , node = node . child ;
continue ;
}
2022-05-08 07:07:58 +03:00
if ( node === currentParent ) break ;
2021-07-30 04:11:27 +03:00
for ( ; ! node . sibling ; ) {
if ( ! node . return || node . return === currentParent ) return null ;
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
}
return null ;
}
function doesFiberContain ( parentFiber , childFiber ) {
for ( var node = childFiber , parentFiberAlternate = parentFiber . alternate ; null !== node ; ) {
if ( node === parentFiber || node === parentFiberAlternate ) return ! 0 ;
node = node . return ;
}
return ! 1 ;
}
2021-09-08 12:45:39 +03:00
var hasScheduledReplayAttempt = ! 1 , queuedDiscreteEvents = [ ] , queuedFocus = null , queuedDrag = null , queuedMouse = null , queuedPointers = new Map ( ) , queuedPointerCaptures = new Map ( ) , queuedExplicitHydrationTargets = [ ] , discreteReplayableEvents = [
2022-05-04 17:25:28 +03:00
"mousedown" ,
"mouseup" ,
"touchcancel" ,
"touchend" ,
"touchstart" ,
"auxclick" ,
"dblclick" ,
"pointercancel" ,
"pointerdown" ,
"pointerup" ,
"dragend" ,
"dragstart" ,
"drop" ,
"compositionend" ,
"compositionstart" ,
"keydown" ,
"keypress" ,
"keyup" ,
"input" ,
"textInput" ,
"copy" ,
"cut" ,
"paste" ,
"click" ,
"change" ,
"contextmenu" ,
"reset" ,
"submit" ,
2021-08-03 18:52:47 +03:00
] ;
2021-07-30 04:11:27 +03:00
function isReplayableDiscreteEvent ( eventType ) {
return discreteReplayableEvents . indexOf ( eventType ) > - 1 ;
}
function createQueuedReplayableEvent ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
return {
blockedOn : blockedOn ,
domEventName : domEventName ,
eventSystemFlags : 16 | eventSystemFlags ,
nativeEvent : nativeEvent ,
2021-08-03 18:52:47 +03:00
targetContainers : [
targetContainer
]
2021-07-30 04:11:27 +03:00
} ;
}
function queueDiscreteEvent ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
var queuedEvent = createQueuedReplayableEvent ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) ;
queuedDiscreteEvents . push ( queuedEvent ) ;
}
function clearIfContinuousEvent ( domEventName , nativeEvent ) {
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "focusin" :
case "focusout" :
2021-07-30 04:11:27 +03:00
queuedFocus = null ;
break ;
2022-05-04 17:25:28 +03:00
case "dragenter" :
case "dragleave" :
2021-07-30 04:11:27 +03:00
queuedDrag = null ;
break ;
2022-05-04 17:25:28 +03:00
case "mouseover" :
case "mouseout" :
2021-07-30 04:11:27 +03:00
queuedMouse = null ;
break ;
2022-05-04 17:25:28 +03:00
case "pointerover" :
case "pointerout" :
2021-07-30 04:11:27 +03:00
var pointerId = nativeEvent . pointerId ;
queuedPointers . delete ( pointerId ) ;
break ;
2022-05-04 17:25:28 +03:00
case "gotpointercapture" :
case "lostpointercapture" :
2021-07-30 04:11:27 +03:00
var _pointerId = nativeEvent . pointerId ;
queuedPointerCaptures . delete ( _pointerId ) ;
}
}
function accumulateOrCreateContinuousQueuedReplayableEvent ( existingQueuedEvent , blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
if ( null === existingQueuedEvent || existingQueuedEvent . nativeEvent !== nativeEvent ) {
var queuedEvent = createQueuedReplayableEvent ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) ;
if ( null !== blockedOn ) {
var _fiber2 = getInstanceFromNode ( blockedOn ) ;
null !== _fiber2 && attemptContinuousHydration ( _fiber2 ) ;
}
return queuedEvent ;
}
existingQueuedEvent . eventSystemFlags |= eventSystemFlags ;
var targetContainers = existingQueuedEvent . targetContainers ;
return null !== targetContainer && - 1 === targetContainers . indexOf ( targetContainer ) && targetContainers . push ( targetContainer ) , existingQueuedEvent ;
}
function attemptExplicitHydrationTarget ( queuedTarget ) {
var targetInst = getClosestInstanceFromNode ( queuedTarget . target ) ;
if ( null !== targetInst ) {
var nearestMounted = getNearestMountedFiber ( targetInst ) ;
if ( null !== nearestMounted ) {
var tag = nearestMounted . tag ;
if ( 13 === tag ) {
var instance = getSuspenseInstanceFromFiber ( nearestMounted ) ;
2021-09-16 07:23:33 +03:00
if ( null !== instance ) {
queuedTarget . blockedOn = instance , attemptHydrationAtPriority ( queuedTarget . lanePriority , function ( ) {
unstable _runWithPriority ( queuedTarget . priority , function ( ) {
attemptHydrationAtCurrentPriority ( nearestMounted ) ;
} ) ;
2021-07-30 04:11:27 +03:00
} ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-08-26 13:06:25 +03:00
} else if ( 3 === tag ) {
var root = nearestMounted . stateNode ;
if ( root . hydrate ) {
queuedTarget . blockedOn = getContainerFromFiber ( nearestMounted ) ;
return ;
}
2021-09-16 07:23:33 +03:00
}
2021-07-30 04:11:27 +03:00
}
}
queuedTarget . blockedOn = null ;
}
function attemptReplayContinuousQueuedEvent ( queuedEvent ) {
if ( null !== queuedEvent . blockedOn ) return ! 1 ;
for ( var targetContainers = queuedEvent . targetContainers ; targetContainers . length > 0 ; ) {
var targetContainer = targetContainers [ 0 ] , nextBlockedOn = attemptToDispatchEvent ( queuedEvent . domEventName , queuedEvent . eventSystemFlags , targetContainer , queuedEvent . nativeEvent ) ;
if ( null !== nextBlockedOn ) {
var _fiber3 = getInstanceFromNode ( nextBlockedOn ) ;
return null !== _fiber3 && attemptContinuousHydration ( _fiber3 ) , queuedEvent . blockedOn = nextBlockedOn , ! 1 ;
}
targetContainers . shift ( ) ;
}
return ! 0 ;
}
function attemptReplayContinuousQueuedEventInMap ( queuedEvent , key , map ) {
attemptReplayContinuousQueuedEvent ( queuedEvent ) && map . delete ( key ) ;
}
function replayUnblockedEvents ( ) {
for ( hasScheduledReplayAttempt = ! 1 ; queuedDiscreteEvents . length > 0 ; ) {
var nextDiscreteEvent = queuedDiscreteEvents [ 0 ] ;
if ( null !== nextDiscreteEvent . blockedOn ) {
var _fiber4 = getInstanceFromNode ( nextDiscreteEvent . blockedOn ) ;
null !== _fiber4 && attemptUserBlockingHydration ( _fiber4 ) ;
break ;
}
for ( var targetContainers = nextDiscreteEvent . targetContainers ; targetContainers . length > 0 ; ) {
var targetContainer = targetContainers [ 0 ] , nextBlockedOn = attemptToDispatchEvent ( nextDiscreteEvent . domEventName , nextDiscreteEvent . eventSystemFlags , targetContainer , nextDiscreteEvent . nativeEvent ) ;
if ( null !== nextBlockedOn ) {
nextDiscreteEvent . blockedOn = nextBlockedOn ;
break ;
}
targetContainers . shift ( ) ;
}
null === nextDiscreteEvent . blockedOn && queuedDiscreteEvents . shift ( ) ;
}
null !== queuedFocus && attemptReplayContinuousQueuedEvent ( queuedFocus ) && ( queuedFocus = null ) , null !== queuedDrag && attemptReplayContinuousQueuedEvent ( queuedDrag ) && ( queuedDrag = null ) , null !== queuedMouse && attemptReplayContinuousQueuedEvent ( queuedMouse ) && ( queuedMouse = null ) , queuedPointers . forEach ( attemptReplayContinuousQueuedEventInMap ) , queuedPointerCaptures . forEach ( attemptReplayContinuousQueuedEventInMap ) ;
}
function scheduleCallbackIfUnblocked ( queuedEvent , unblocked ) {
queuedEvent . blockedOn !== unblocked || ( queuedEvent . blockedOn = null , hasScheduledReplayAttempt || ( hasScheduledReplayAttempt = ! 0 , unstable _scheduleCallback ( unstable _NormalPriority , replayUnblockedEvents ) ) ) ;
}
function retryIfBlockedOn ( unblocked ) {
if ( queuedDiscreteEvents . length > 0 ) {
scheduleCallbackIfUnblocked ( queuedDiscreteEvents [ 0 ] , unblocked ) ;
for ( var i = 1 ; i < queuedDiscreteEvents . length ; i ++ ) {
var queuedEvent = queuedDiscreteEvents [ i ] ;
queuedEvent . blockedOn === unblocked && ( queuedEvent . blockedOn = null ) ;
}
}
null !== queuedFocus && scheduleCallbackIfUnblocked ( queuedFocus , unblocked ) , null !== queuedDrag && scheduleCallbackIfUnblocked ( queuedDrag , unblocked ) , null !== queuedMouse && scheduleCallbackIfUnblocked ( queuedMouse , unblocked ) ;
var unblock = function ( queuedEvent ) {
return scheduleCallbackIfUnblocked ( queuedEvent , unblocked ) ;
} ;
queuedPointers . forEach ( unblock ) , queuedPointerCaptures . forEach ( unblock ) ;
for ( var _i = 0 ; _i < queuedExplicitHydrationTargets . length ; _i ++ ) {
var queuedTarget = queuedExplicitHydrationTargets [ _i ] ;
queuedTarget . blockedOn === unblocked && ( queuedTarget . blockedOn = null ) ;
}
for ( ; queuedExplicitHydrationTargets . length > 0 ; ) {
var nextExplicitTarget = queuedExplicitHydrationTargets [ 0 ] ;
if ( null !== nextExplicitTarget . blockedOn ) break ;
attemptExplicitHydrationTarget ( nextExplicitTarget ) , null === nextExplicitTarget . blockedOn && queuedExplicitHydrationTargets . shift ( ) ;
}
}
function makePrefixMap ( styleProp , eventName ) {
2022-01-02 23:54:58 +03:00
var prefixes = { } ;
2022-05-04 17:25:28 +03:00
return prefixes [ styleProp . toLowerCase ( ) ] = eventName . toLowerCase ( ) , prefixes [ "Webkit" + styleProp ] = "webkit" + eventName , prefixes [ "Moz" + styleProp ] = "moz" + eventName , prefixes ;
2021-07-30 04:11:27 +03:00
}
var vendorPrefixes = {
2022-05-04 17:25:28 +03:00
animationend : makePrefixMap ( "Animation" , "AnimationEnd" ) ,
animationiteration : makePrefixMap ( "Animation" , "AnimationIteration" ) ,
animationstart : makePrefixMap ( "Animation" , "AnimationStart" ) ,
transitionend : makePrefixMap ( "Transition" , "TransitionEnd" )
2022-06-15 17:36:57 +03:00
} , prefixedEventNames = { } , style = { } ;
2021-07-30 04:11:27 +03:00
function getVendorPrefixedEventName ( eventName ) {
if ( prefixedEventNames [ eventName ] ) return prefixedEventNames [ eventName ] ;
if ( ! vendorPrefixes [ eventName ] ) return eventName ;
var prefixMap = vendorPrefixes [ eventName ] ;
2022-06-15 17:36:57 +03:00
for ( var styleProp in prefixMap ) if ( prefixMap . hasOwnProperty ( styleProp ) && styleProp in style ) return prefixedEventNames [ eventName ] = prefixMap [ styleProp ] ;
2021-07-30 04:11:27 +03:00
return eventName ;
}
2022-06-15 17:36:57 +03:00
! canUseDOM || ( style = document . createElement ( "div" ) . style , "AnimationEvent" in window || ( delete vendorPrefixes . animationend . animation , delete vendorPrefixes . animationiteration . animation , delete vendorPrefixes . animationstart . animation ) , "TransitionEvent" in window || delete vendorPrefixes . transitionend . transition ) ;
2022-05-04 17:25:28 +03:00
var ANIMATION _END = getVendorPrefixedEventName ( "animationend" ) , ANIMATION _ITERATION = getVendorPrefixedEventName ( "animationiteration" ) , ANIMATION _START = getVendorPrefixedEventName ( "animationstart" ) , TRANSITION _END = getVendorPrefixedEventName ( "transitionend" ) , topLevelEventsToReactNames = new Map ( ) , eventPriorities = new Map ( ) ;
2021-07-30 04:11:27 +03:00
function registerSimplePluginEventsAndSetTheirPriorities ( eventTypes , priority ) {
for ( var i = 0 ; i < eventTypes . length ; i += 2 ) {
2022-05-04 17:25:28 +03:00
var topEvent = eventTypes [ i ] , event = eventTypes [ i + 1 ] , reactName = "on" + ( event [ 0 ] . toUpperCase ( ) + event . slice ( 1 ) ) ;
2021-08-03 18:52:47 +03:00
eventPriorities . set ( topEvent , priority ) , topLevelEventsToReactNames . set ( topEvent , reactName ) , registerTwoPhaseEvent ( reactName , [
topEvent
] ) ;
2021-07-30 04:11:27 +03:00
}
}
2022-03-09 18:43:01 +03:00
var _ReactInternals$Sched$1 = React . _ _SECRET _INTERNALS _DO _NOT _USE _OR _YOU _WILL _BE _FIRED . SchedulerTracing , _ _interactionsRef = _ReactInternals$Sched$1 . _ _interactionsRef , _ _subscriberRef = _ReactInternals$Sched$1 . _ _subscriberRef , unstable _getThreadID = ( _ReactInternals$Sched$1 . unstable _clear , _ReactInternals$Sched$1 . unstable _getCurrent , _ReactInternals$Sched$1 . unstable _getThreadID ) , unstable _wrap = ( _ReactInternals$Sched$1 . unstable _subscribe , _ReactInternals$Sched$1 . unstable _trace , _ReactInternals$Sched$1 . unstable _unsubscribe , _ReactInternals$Sched$1 . unstable _wrap ) ;
2021-09-08 12:45:39 +03:00
if ( ! ( null != _ _interactionsRef && null != _ _interactionsRef . current ) ) throw Error ( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" ) ;
2021-08-04 13:27:17 +03:00
unstable _now ( ) ;
2022-08-26 13:06:25 +03:00
var NoLanes = 0 , SyncLane = 1 , return _highestLanePriority = 8 ;
2021-07-30 04:11:27 +03:00
function getHighestPriorityLanes ( lanes ) {
2022-08-26 11:45:49 +03:00
if ( ( SyncLane & lanes ) !== NoLanes ) return return _highestLanePriority = 15 , SyncLane ;
if ( ( 2 & lanes ) !== NoLanes ) return return _highestLanePriority = 14 , 2 ;
if ( ( 4 & lanes ) !== NoLanes ) return return _highestLanePriority = 13 , 4 ;
2021-07-30 04:11:27 +03:00
var inputDiscreteLanes = 24 & lanes ;
2022-08-26 11:45:49 +03:00
if ( inputDiscreteLanes !== NoLanes ) return return _highestLanePriority = 12 , inputDiscreteLanes ;
if ( ( 32 & lanes ) !== NoLanes ) return return _highestLanePriority = 11 , 32 ;
2021-07-30 04:11:27 +03:00
var inputContinuousLanes = 192 & lanes ;
2022-08-26 11:45:49 +03:00
if ( inputContinuousLanes !== NoLanes ) return return _highestLanePriority = 10 , inputContinuousLanes ;
if ( ( 256 & lanes ) !== NoLanes ) return return _highestLanePriority = 9 , 256 ;
2021-07-30 04:11:27 +03:00
var defaultLanes = 3584 & lanes ;
2022-08-26 11:45:49 +03:00
if ( defaultLanes !== NoLanes ) return return _highestLanePriority = 8 , defaultLanes ;
if ( ( 4096 & lanes ) !== NoLanes ) return return _highestLanePriority = 7 , 4096 ;
2021-07-30 04:11:27 +03:00
var transitionLanes = 4186112 & lanes ;
2022-08-26 11:45:49 +03:00
if ( transitionLanes !== NoLanes ) return return _highestLanePriority = 6 , transitionLanes ;
2021-07-30 04:11:27 +03:00
var retryLanes = 62914560 & lanes ;
2022-08-26 11:45:49 +03:00
if ( retryLanes !== NoLanes ) return return _highestLanePriority = 5 , retryLanes ;
2021-07-30 04:11:27 +03:00
if ( 67108864 & lanes ) return return _highestLanePriority = 4 , 67108864 ;
2022-08-26 11:45:49 +03:00
if ( ( 134217728 & lanes ) !== NoLanes ) return return _highestLanePriority = 3 , 134217728 ;
2021-07-30 04:11:27 +03:00
var idleLanes = 805306368 & lanes ;
2022-08-26 11:45:49 +03:00
return idleLanes !== NoLanes ? ( return _highestLanePriority = 2 , idleLanes ) : ( 1073741824 & lanes ) !== NoLanes ? ( return _highestLanePriority = 1 , 1073741824 ) : ( error ( "Should have found matching lanes. This is a bug in React." ) , return _highestLanePriority = 8 , lanes ) ;
2021-07-30 04:11:27 +03:00
}
function getNextLanes ( root , wipLanes ) {
var pendingLanes = root . pendingLanes ;
2022-08-26 11:45:49 +03:00
if ( pendingLanes === NoLanes ) return return _highestLanePriority = 0 , NoLanes ;
var nextLanes = NoLanes , nextLanePriority = 0 , expiredLanes = root . expiredLanes , suspendedLanes = root . suspendedLanes , pingedLanes = root . pingedLanes ;
if ( expiredLanes !== NoLanes ) nextLanes = expiredLanes , nextLanePriority = return _highestLanePriority = 15 ;
2021-07-30 04:11:27 +03:00
else {
var nonIdlePendingLanes = 134217727 & pendingLanes ;
2022-08-26 11:45:49 +03:00
if ( nonIdlePendingLanes !== NoLanes ) {
2021-07-30 04:11:27 +03:00
var nonIdleUnblockedLanes = nonIdlePendingLanes & ~ suspendedLanes ;
2022-08-26 11:45:49 +03:00
if ( nonIdleUnblockedLanes !== NoLanes ) nextLanes = getHighestPriorityLanes ( nonIdleUnblockedLanes ) , nextLanePriority = return _highestLanePriority ;
2021-07-30 04:11:27 +03:00
else {
var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes ;
2022-08-26 11:45:49 +03:00
nonIdlePingedLanes !== NoLanes && ( nextLanes = getHighestPriorityLanes ( nonIdlePingedLanes ) , nextLanePriority = return _highestLanePriority ) ;
2021-07-30 04:11:27 +03:00
}
} else {
var unblockedLanes = pendingLanes & ~ suspendedLanes ;
2022-08-26 11:45:49 +03:00
unblockedLanes !== NoLanes ? ( nextLanes = getHighestPriorityLanes ( unblockedLanes ) , nextLanePriority = return _highestLanePriority ) : pingedLanes !== NoLanes && ( nextLanes = getHighestPriorityLanes ( pingedLanes ) , nextLanePriority = return _highestLanePriority ) ;
2021-07-30 04:11:27 +03:00
}
}
2022-08-26 11:45:49 +03:00
if ( nextLanes === NoLanes ) return NoLanes ;
if ( nextLanes = pendingLanes & getEqualOrHigherPriorityLanes ( nextLanes ) , wipLanes !== NoLanes && wipLanes !== nextLanes && ( wipLanes & suspendedLanes ) === NoLanes ) {
2021-08-03 18:52:47 +03:00
if ( getHighestPriorityLanes ( wipLanes ) , nextLanePriority <= return _highestLanePriority ) return wipLanes ;
2021-07-30 04:11:27 +03:00
return _highestLanePriority = nextLanePriority ;
}
var entangledLanes = root . entangledLanes ;
2022-08-26 11:45:49 +03:00
if ( entangledLanes !== NoLanes ) for ( var entanglements = root . entanglements , lanes = nextLanes & entangledLanes ; lanes > 0 ; ) {
2021-07-30 04:11:27 +03:00
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index ;
nextLanes |= entanglements [ index ] , lanes &= ~ lane ;
}
return nextLanes ;
}
function computeExpirationTime ( lane , currentTime ) {
getHighestPriorityLanes ( lane ) ;
var priority = return _highestLanePriority ;
return priority >= 10 ? currentTime + 250 : priority >= 6 ? currentTime + 5000 : - 1 ;
}
function getLanesToRetrySynchronouslyOnError ( root ) {
var everythingButOffscreen = - 1073741825 & root . pendingLanes ;
2022-08-26 11:45:49 +03:00
return everythingButOffscreen !== NoLanes ? everythingButOffscreen : 1073741824 & everythingButOffscreen ? 1073741824 : NoLanes ;
2021-07-30 04:11:27 +03:00
}
2022-04-29 08:58:59 +03:00
function includesNonIdleWork ( lanes ) {
2022-08-26 11:45:49 +03:00
return ( 134217727 & lanes ) !== NoLanes ;
2022-04-29 08:58:59 +03:00
}
function includesOnlyRetries ( lanes ) {
return ( 62914560 & lanes ) === lanes ;
}
2021-07-30 04:11:27 +03:00
function findUpdateLane ( lanePriority , wipLanes ) {
switch ( lanePriority ) {
2021-08-03 18:52:47 +03:00
case 0 :
2022-04-21 13:00:25 +03:00
case 6 :
case 5 :
2021-08-03 18:52:47 +03:00
break ;
case 15 :
2022-08-26 11:45:49 +03:00
return SyncLane ;
2021-08-03 18:52:47 +03:00
case 14 :
return 2 ;
2021-07-30 04:11:27 +03:00
case 12 :
var _lane = pickArbitraryLane ( 24 & ~ wipLanes ) ;
2022-08-26 13:06:25 +03:00
if ( 0 === _lane ) return findUpdateLane ( 10 , wipLanes ) ;
2021-07-30 04:11:27 +03:00
return _lane ;
case 10 :
var _lane2 = pickArbitraryLane ( 192 & ~ wipLanes ) ;
2022-08-26 13:06:25 +03:00
if ( 0 === _lane2 ) return findUpdateLane ( 8 , wipLanes ) ;
2021-07-30 04:11:27 +03:00
return _lane2 ;
case 8 :
var _lane3 = pickArbitraryLane ( 3584 & ~ wipLanes ) ;
2022-08-26 13:06:25 +03:00
return 0 === _lane3 && ( _lane3 = pickArbitraryLane ( 4186112 & ~ wipLanes ) , 0 === _lane3 && ( _lane3 = pickArbitraryLane ( 3584 ) ) ) , _lane3 ;
2021-07-30 04:11:27 +03:00
case 2 :
var lane = pickArbitraryLane ( 805306368 & ~ wipLanes ) ;
2022-08-26 13:06:25 +03:00
return 0 === lane && ( lane = pickArbitraryLane ( 805306368 ) ) , lane ;
2021-07-30 04:11:27 +03:00
}
throw Error ( "Invalid update priority: " + lanePriority + ". This is a bug in React." ) ;
}
function getEqualOrHigherPriorityLanes ( lanes ) {
2022-04-29 08:58:59 +03:00
var lanes1 , index ;
2022-08-26 11:45:49 +03:00
return ( ( ( index = 31 - clz32 ( lanes ) ) < 0 ? NoLanes : 1 << index ) << 1 ) - 1 ;
2021-07-30 04:11:27 +03:00
}
function pickArbitraryLane ( lanes ) {
2022-06-15 17:36:57 +03:00
var lanes1 ;
return ( lanes1 = lanes ) & - lanes1 ;
2021-07-30 04:11:27 +03:00
}
function pickArbitraryLaneIndex ( lanes ) {
return 31 - clz32 ( lanes ) ;
}
2022-08-26 11:45:49 +03:00
function includesSomeLane ( a , b ) {
return ( a & b ) !== NoLanes ;
}
2022-04-29 08:58:59 +03:00
function isSubsetOfLanes ( set , subset ) {
return ( set & subset ) === subset ;
2021-07-30 04:11:27 +03:00
}
function createLaneMap ( initial ) {
for ( var laneMap = [ ] , i = 0 ; i < 31 ; i ++ ) laneMap . push ( initial ) ;
return laneMap ;
}
function markRootUpdated ( root , updateLane , eventTime ) {
root . pendingLanes |= updateLane ;
2022-04-29 08:58:59 +03:00
var lane , higherPriorityLanes = updateLane - 1 ;
2021-09-08 12:45:39 +03:00
root . suspendedLanes &= higherPriorityLanes , root . pingedLanes &= higherPriorityLanes , root . eventTimes [ pickArbitraryLaneIndex ( updateLane ) ] = eventTime ;
2021-07-30 04:11:27 +03:00
}
function markRootPinged ( root , pingedLanes , eventTime ) {
root . pingedLanes |= root . suspendedLanes & pingedLanes ;
}
function markRootMutableRead ( root , updateLane ) {
root . mutableReadLanes |= updateLane & root . pendingLanes ;
}
2021-08-10 11:52:28 +03:00
var clz32 = Math . clz32 ? Math . clz32 : function ( lanes ) {
2021-07-30 04:11:27 +03:00
return 0 === lanes ? 32 : 31 - ( log ( lanes ) / LN2 | 0 ) | 0 ;
2021-08-03 18:52:47 +03:00
} , log = Math . log , LN2 = Math . LN2 , UserBlockingPriority$1 = unstable _UserBlockingPriority , runWithPriority = unstable _runWithPriority , _enabled = ! 0 ;
2021-07-30 04:11:27 +03:00
function setEnabled ( enabled ) {
_enabled = ! ! enabled ;
}
function dispatchDiscreteEvent ( domEventName , eventSystemFlags , container , nativeEvent ) {
2022-03-07 06:51:57 +03:00
nativeEvent . timeStamp , isInsideEventHandler || flushDiscreteUpdatesImpl ( ) , function ( fn , a , b , c , d ) {
2021-09-08 12:45:39 +03:00
var prevIsInsideEventHandler = isInsideEventHandler ;
isInsideEventHandler = ! 0 ;
try {
2021-10-06 10:12:11 +03:00
return discreteUpdatesImpl ( fn , a , b , c , d ) ;
2021-09-08 12:45:39 +03:00
} finally {
( isInsideEventHandler = prevIsInsideEventHandler ) || finishEventHandler ( ) ;
}
2022-03-07 06:51:57 +03:00
} ( dispatchEvent , domEventName , eventSystemFlags , container , nativeEvent ) ;
2021-07-30 04:11:27 +03:00
}
function dispatchUserBlockingUpdate ( domEventName , eventSystemFlags , container , nativeEvent ) {
runWithPriority ( UserBlockingPriority$1 , dispatchEvent . bind ( null , domEventName , eventSystemFlags , container , nativeEvent ) ) ;
}
2022-06-15 17:36:57 +03:00
function dispatchEvent ( domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
2021-07-30 04:11:27 +03:00
if ( _enabled ) {
var allowReplay = ! 0 ;
2022-08-26 13:06:25 +03:00
if ( allowReplay = ( 4 & eventSystemFlags ) == 0 , allowReplay && queuedDiscreteEvents . length > 0 && isReplayableDiscreteEvent ( domEventName ) ) {
2022-06-15 17:36:57 +03:00
queueDiscreteEvent ( null , domEventName , eventSystemFlags , targetContainer , nativeEvent ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-06-15 17:36:57 +03:00
var blockedOn = attemptToDispatchEvent ( domEventName , eventSystemFlags , targetContainer , nativeEvent ) ;
if ( null === blockedOn ) {
allowReplay && clearIfContinuousEvent ( domEventName , nativeEvent ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-08-03 18:52:47 +03:00
if ( allowReplay ) {
2022-06-15 17:36:57 +03:00
if ( isReplayableDiscreteEvent ( domEventName ) ) {
queueDiscreteEvent ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-03-08 17:35:18 +03:00
if ( function ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
2021-09-08 12:45:39 +03:00
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "focusin" :
2021-09-08 12:45:39 +03:00
return queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent ( queuedFocus , blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) , ! 0 ;
2022-05-04 17:25:28 +03:00
case "dragenter" :
2021-09-08 12:45:39 +03:00
return queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent ( queuedDrag , blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) , ! 0 ;
2022-05-04 17:25:28 +03:00
case "mouseover" :
2021-09-08 12:45:39 +03:00
return queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent ( queuedMouse , blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) , ! 0 ;
2022-05-04 17:25:28 +03:00
case "pointerover" :
2021-09-08 12:45:39 +03:00
var pointerEvent = nativeEvent , pointerId = pointerEvent . pointerId ;
return queuedPointers . set ( pointerId , accumulateOrCreateContinuousQueuedReplayableEvent ( queuedPointers . get ( pointerId ) || null , blockedOn , domEventName , eventSystemFlags , targetContainer , pointerEvent ) ) , ! 0 ;
2022-05-04 17:25:28 +03:00
case "gotpointercapture" :
2021-09-08 12:45:39 +03:00
var _pointerEvent = nativeEvent , _pointerId2 = _pointerEvent . pointerId ;
return queuedPointerCaptures . set ( _pointerId2 , accumulateOrCreateContinuousQueuedReplayableEvent ( queuedPointerCaptures . get ( _pointerId2 ) || null , blockedOn , domEventName , eventSystemFlags , targetContainer , _pointerEvent ) ) , ! 0 ;
}
return ! 1 ;
2022-06-15 17:36:57 +03:00
} ( blockedOn , domEventName , eventSystemFlags , targetContainer , nativeEvent ) ) return ;
clearIfContinuousEvent ( domEventName , nativeEvent ) ;
2021-08-03 18:52:47 +03:00
}
2022-06-15 17:36:57 +03:00
dispatchEventForPluginEventSystem ( domEventName , eventSystemFlags , nativeEvent , null , targetContainer ) ;
2021-07-30 04:11:27 +03:00
}
}
function attemptToDispatchEvent ( domEventName , eventSystemFlags , targetContainer , nativeEvent ) {
2022-08-26 11:45:49 +03:00
var nativeEventTarget = getEventTarget ( nativeEvent ) , targetInst = getClosestInstanceFromNode ( nativeEventTarget ) ;
2021-07-30 04:11:27 +03:00
if ( null !== targetInst ) {
var nearestMounted = getNearestMountedFiber ( targetInst ) ;
if ( null === nearestMounted ) targetInst = null ;
else {
var tag = nearestMounted . tag ;
if ( 13 === tag ) {
var instance = getSuspenseInstanceFromFiber ( nearestMounted ) ;
if ( null !== instance ) return instance ;
targetInst = null ;
} else if ( 3 === tag ) {
2022-08-26 13:06:25 +03:00
var root = nearestMounted . stateNode ;
if ( root . hydrate ) return getContainerFromFiber ( nearestMounted ) ;
2021-07-30 04:11:27 +03:00
targetInst = null ;
} else nearestMounted !== targetInst && ( targetInst = null ) ;
}
}
return dispatchEventForPluginEventSystem ( domEventName , eventSystemFlags , nativeEvent , targetInst , targetContainer ) , null ;
}
2022-06-15 17:36:57 +03:00
var root = null , startText = null , fallbackText = null ;
2021-07-30 04:11:27 +03:00
function getData ( ) {
if ( fallbackText ) return fallbackText ;
var start , end , startValue = startText , startLength = startValue . length , endValue = getText ( ) , endLength = endValue . length ;
for ( start = 0 ; start < startLength && startValue [ start ] === endValue [ start ] ; start ++ ) ;
var minEnd = startLength - start ;
for ( end = 1 ; end <= minEnd && startValue [ startLength - end ] === endValue [ endLength - end ] ; end ++ ) ;
2022-05-20 07:57:38 +03:00
var sliceTail = end > 1 ? 1 - end : void 0 ;
return fallbackText = endValue . slice ( start , sliceTail ) ;
2021-07-30 04:11:27 +03:00
}
function getText ( ) {
2022-06-15 17:36:57 +03:00
return "value" in root ? root . value : root . textContent ;
2021-07-30 04:11:27 +03:00
}
function getEventCharCode ( nativeEvent ) {
var charCode , keyCode = nativeEvent . keyCode ;
2022-05-04 17:25:28 +03:00
return ( "charCode" in nativeEvent ? 0 === ( charCode = nativeEvent . charCode ) && 13 === keyCode && ( charCode = 13 ) : charCode = keyCode , 10 === charCode && ( charCode = 13 ) , charCode >= 32 || 13 === charCode ) ? charCode : 0 ;
2021-07-30 04:11:27 +03:00
}
function functionThatReturnsTrue ( ) {
return ! 0 ;
}
function functionThatReturnsFalse ( ) {
return ! 1 ;
}
function createSyntheticEvent ( Interface ) {
function SyntheticBaseEvent ( reactName , reactEventType , targetInst , nativeEvent , nativeEventTarget ) {
for ( var _propName in this . _reactName = reactName , this . _targetInst = targetInst , this . type = reactEventType , this . nativeEvent = nativeEvent , this . target = nativeEventTarget , this . currentTarget = null , Interface ) if ( Interface . hasOwnProperty ( _propName ) ) {
var normalize = Interface [ _propName ] ;
normalize ? this [ _propName ] = normalize ( nativeEvent ) : this [ _propName ] = nativeEvent [ _propName ] ;
}
return ( null != nativeEvent . defaultPrevented ? nativeEvent . defaultPrevented : ! 1 === nativeEvent . returnValue ) ? this . isDefaultPrevented = functionThatReturnsTrue : this . isDefaultPrevented = functionThatReturnsFalse , this . isPropagationStopped = functionThatReturnsFalse , this ;
}
return _assign ( SyntheticBaseEvent . prototype , {
preventDefault : function ( ) {
this . defaultPrevented = ! 0 ;
var event = this . nativeEvent ;
2022-05-04 17:25:28 +03:00
event && ( event . preventDefault ? event . preventDefault ( ) : "unknown" != typeof event . returnValue && ( event . returnValue = ! 1 ) , this . isDefaultPrevented = functionThatReturnsTrue ) ;
2021-07-30 04:11:27 +03:00
} ,
stopPropagation : function ( ) {
var event = this . nativeEvent ;
2022-05-04 17:25:28 +03:00
event && ( event . stopPropagation ? event . stopPropagation ( ) : "unknown" != typeof event . cancelBubble && ( event . cancelBubble = ! 0 ) , this . isPropagationStopped = functionThatReturnsTrue ) ;
2021-07-30 04:11:27 +03:00
} ,
2022-01-02 23:54:58 +03:00
persist : function ( ) { } ,
2021-07-30 04:11:27 +03:00
isPersistent : functionThatReturnsTrue
} ) , SyntheticBaseEvent ;
}
2021-08-07 11:27:52 +03:00
var EventInterface = {
2021-07-30 04:11:27 +03:00
eventPhase : 0 ,
bubbles : 0 ,
cancelable : 0 ,
timeStamp : function ( event ) {
return event . timeStamp || Date . now ( ) ;
} ,
defaultPrevented : 0 ,
isTrusted : 0
2022-01-02 23:54:58 +03:00
} , SyntheticEvent = createSyntheticEvent ( EventInterface ) , UIEventInterface = _assign ( { } , EventInterface , {
2021-07-30 04:11:27 +03:00
view : 0 ,
detail : 0
2022-01-02 23:54:58 +03:00
} ) , SyntheticUIEvent = createSyntheticEvent ( UIEventInterface ) , MouseEventInterface = _assign ( { } , UIEventInterface , {
2021-07-30 04:11:27 +03:00
screenX : 0 ,
screenY : 0 ,
clientX : 0 ,
clientY : 0 ,
pageX : 0 ,
pageY : 0 ,
ctrlKey : 0 ,
shiftKey : 0 ,
altKey : 0 ,
metaKey : 0 ,
getModifierState : getEventModifierState ,
button : 0 ,
buttons : 0 ,
relatedTarget : function ( event ) {
return void 0 === event . relatedTarget ? event . fromElement === event . srcElement ? event . toElement : event . fromElement : event . relatedTarget ;
} ,
movementX : function ( event ) {
2021-09-08 12:45:39 +03:00
var event1 ;
2022-05-04 17:25:28 +03:00
return "movementX" in event ? event . movementX : ( ( event1 = event ) !== lastMouseEvent && ( lastMouseEvent && "mousemove" === event1 . type ? ( lastMovementX = event1 . screenX - lastMouseEvent . screenX , lastMovementY = event1 . screenY - lastMouseEvent . screenY ) : ( lastMovementX = 0 , lastMovementY = 0 ) , lastMouseEvent = event1 ) , lastMovementX ) ;
2021-07-30 04:11:27 +03:00
} ,
movementY : function ( event ) {
2022-05-04 17:25:28 +03:00
return "movementY" in event ? event . movementY : lastMovementY ;
2021-07-30 04:11:27 +03:00
}
2022-08-26 11:45:49 +03:00
} ) , SyntheticMouseEvent = createSyntheticEvent ( MouseEventInterface ) , DragEventInterface = _assign ( { } , MouseEventInterface , {
2021-07-30 04:11:27 +03:00
dataTransfer : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticDragEvent = createSyntheticEvent ( DragEventInterface ) , FocusEventInterface = _assign ( { } , UIEventInterface , {
2021-07-30 04:11:27 +03:00
relatedTarget : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticFocusEvent = createSyntheticEvent ( FocusEventInterface ) , AnimationEventInterface = _assign ( { } , EventInterface , {
2021-07-30 04:11:27 +03:00
animationName : 0 ,
elapsedTime : 0 ,
pseudoElement : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticAnimationEvent = createSyntheticEvent ( AnimationEventInterface ) , ClipboardEventInterface = _assign ( { } , EventInterface , {
2021-07-30 04:11:27 +03:00
clipboardData : function ( event ) {
2022-05-04 17:25:28 +03:00
return "clipboardData" in event ? event . clipboardData : window . clipboardData ;
2021-07-30 04:11:27 +03:00
}
2022-08-26 11:45:49 +03:00
} ) , SyntheticClipboardEvent = createSyntheticEvent ( ClipboardEventInterface ) , CompositionEventInterface = _assign ( { } , EventInterface , {
2021-07-30 04:11:27 +03:00
data : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticCompositionEvent = createSyntheticEvent ( CompositionEventInterface ) , SyntheticInputEvent = SyntheticCompositionEvent , normalizeKey = {
2022-05-04 17:25:28 +03:00
Esc : "Escape" ,
Spacebar : " " ,
Left : "ArrowLeft" ,
Up : "ArrowUp" ,
Right : "ArrowRight" ,
Down : "ArrowDown" ,
Del : "Delete" ,
Win : "OS" ,
Menu : "ContextMenu" ,
Apps : "ContextMenu" ,
Scroll : "ScrollLock" ,
MozPrintableKey : "Unidentified"
2021-07-30 04:11:27 +03:00
} , translateToKey = {
2022-05-04 17:25:28 +03:00
8 : "Backspace" ,
9 : "Tab" ,
12 : "Clear" ,
13 : "Enter" ,
16 : "Shift" ,
17 : "Control" ,
18 : "Alt" ,
19 : "Pause" ,
20 : "CapsLock" ,
27 : "Escape" ,
32 : " " ,
33 : "PageUp" ,
34 : "PageDown" ,
35 : "End" ,
36 : "Home" ,
37 : "ArrowLeft" ,
38 : "ArrowUp" ,
39 : "ArrowRight" ,
40 : "ArrowDown" ,
45 : "Insert" ,
46 : "Delete" ,
112 : "F1" ,
113 : "F2" ,
114 : "F3" ,
115 : "F4" ,
116 : "F5" ,
117 : "F6" ,
118 : "F7" ,
119 : "F8" ,
120 : "F9" ,
121 : "F10" ,
122 : "F11" ,
123 : "F12" ,
144 : "NumLock" ,
145 : "ScrollLock" ,
224 : "Meta"
2021-07-30 04:11:27 +03:00
} , modifierKeyToProp = {
2022-05-04 17:25:28 +03:00
Alt : "altKey" ,
Control : "ctrlKey" ,
Meta : "metaKey" ,
Shift : "shiftKey"
2021-07-30 04:11:27 +03:00
} ;
function modifierStateGetter ( keyArg ) {
var nativeEvent = this . nativeEvent ;
if ( nativeEvent . getModifierState ) return nativeEvent . getModifierState ( keyArg ) ;
var keyProp = modifierKeyToProp [ keyArg ] ;
return ! ! keyProp && ! ! nativeEvent [ keyProp ] ;
}
function getEventModifierState ( nativeEvent ) {
return modifierStateGetter ;
}
2022-08-26 11:45:49 +03:00
var KeyboardEventInterface = _assign ( { } , UIEventInterface , {
2021-08-10 11:52:28 +03:00
key : function ( nativeEvent ) {
2021-07-30 04:11:27 +03:00
if ( nativeEvent . key ) {
var key = normalizeKey [ nativeEvent . key ] || nativeEvent . key ;
2022-05-04 17:25:28 +03:00
if ( "Unidentified" !== key ) return key ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "keypress" === nativeEvent . type ) {
2021-07-30 04:11:27 +03:00
var charCode = getEventCharCode ( nativeEvent ) ;
2022-05-04 17:25:28 +03:00
return 13 === charCode ? "Enter" : String . fromCharCode ( charCode ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
return "keydown" === nativeEvent . type || "keyup" === nativeEvent . type ? translateToKey [ nativeEvent . keyCode ] || "Unidentified" : "" ;
2021-07-30 04:11:27 +03:00
} ,
code : 0 ,
location : 0 ,
ctrlKey : 0 ,
shiftKey : 0 ,
altKey : 0 ,
metaKey : 0 ,
repeat : 0 ,
locale : 0 ,
getModifierState : getEventModifierState ,
charCode : function ( event ) {
2022-05-04 17:25:28 +03:00
return "keypress" === event . type ? getEventCharCode ( event ) : 0 ;
2021-07-30 04:11:27 +03:00
} ,
keyCode : function ( event ) {
2022-05-04 17:25:28 +03:00
return "keydown" === event . type || "keyup" === event . type ? event . keyCode : 0 ;
2021-07-30 04:11:27 +03:00
} ,
which : function ( event ) {
2022-05-04 17:25:28 +03:00
return "keypress" === event . type ? getEventCharCode ( event ) : "keydown" === event . type || "keyup" === event . type ? event . keyCode : 0 ;
2021-07-30 04:11:27 +03:00
}
2022-08-26 11:45:49 +03:00
} ) , SyntheticKeyboardEvent = createSyntheticEvent ( KeyboardEventInterface ) , PointerEventInterface = _assign ( { } , MouseEventInterface , {
2021-07-30 04:11:27 +03:00
pointerId : 0 ,
width : 0 ,
height : 0 ,
pressure : 0 ,
tangentialPressure : 0 ,
tiltX : 0 ,
tiltY : 0 ,
twist : 0 ,
pointerType : 0 ,
isPrimary : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticPointerEvent = createSyntheticEvent ( PointerEventInterface ) , TouchEventInterface = _assign ( { } , UIEventInterface , {
2021-07-30 04:11:27 +03:00
touches : 0 ,
targetTouches : 0 ,
changedTouches : 0 ,
altKey : 0 ,
metaKey : 0 ,
ctrlKey : 0 ,
shiftKey : 0 ,
getModifierState : getEventModifierState
2022-08-26 11:45:49 +03:00
} ) , SyntheticTouchEvent = createSyntheticEvent ( TouchEventInterface ) , TransitionEventInterface = _assign ( { } , EventInterface , {
2021-07-30 04:11:27 +03:00
propertyName : 0 ,
elapsedTime : 0 ,
pseudoElement : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticTransitionEvent = createSyntheticEvent ( TransitionEventInterface ) , WheelEventInterface = _assign ( { } , MouseEventInterface , {
2021-07-30 04:11:27 +03:00
deltaX : function ( event ) {
2022-05-04 17:25:28 +03:00
return "deltaX" in event ? event . deltaX : "wheelDeltaX" in event ? - event . wheelDeltaX : 0 ;
2021-07-30 04:11:27 +03:00
} ,
deltaY : function ( event ) {
2022-05-04 17:25:28 +03:00
return "deltaY" in event ? event . deltaY : "wheelDeltaY" in event ? - event . wheelDeltaY : "wheelDelta" in event ? - event . wheelDelta : 0 ;
2021-07-30 04:11:27 +03:00
} ,
deltaZ : 0 ,
deltaMode : 0
2022-08-26 11:45:49 +03:00
} ) , SyntheticWheelEvent = createSyntheticEvent ( WheelEventInterface ) , END _KEYCODES = [
2021-08-03 18:52:47 +03:00
9 ,
13 ,
27 ,
32
2022-05-04 17:25:28 +03:00
] , canUseCompositionEvent = canUseDOM && "CompositionEvent" in window , documentMode = null ;
canUseDOM && "documentMode" in document && ( documentMode = document . documentMode ) ;
var canUseTextInputEvent = canUseDOM && "TextEvent" in window && ! documentMode , useFallbackCompositionData = canUseDOM && ( ! canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11 ) , hasSpaceKeypress = ! 1 ;
2021-07-30 04:11:27 +03:00
function isFallbackCompositionEnd ( domEventName , nativeEvent ) {
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "keyup" :
2021-08-03 18:52:47 +03:00
return - 1 !== END _KEYCODES . indexOf ( nativeEvent . keyCode ) ;
2022-05-04 17:25:28 +03:00
case "keydown" :
2021-08-03 18:52:47 +03:00
return 229 !== nativeEvent . keyCode ;
2022-05-04 17:25:28 +03:00
case "keypress" :
case "mousedown" :
case "focusout" :
2021-08-03 18:52:47 +03:00
return ! 0 ;
default :
return ! 1 ;
2021-07-30 04:11:27 +03:00
}
}
function getDataFromCustomEvent ( nativeEvent ) {
var detail = nativeEvent . detail ;
2022-05-04 17:25:28 +03:00
return "object" == typeof detail && "data" in detail ? detail . data : null ;
2021-07-30 04:11:27 +03:00
}
function isUsingKoreanIME ( nativeEvent ) {
2022-05-04 17:25:28 +03:00
return "ko" === nativeEvent . locale ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
var isComposing = ! 1 , supportedInputTypes = {
2021-07-30 04:11:27 +03:00
color : ! 0 ,
date : ! 0 ,
datetime : ! 0 ,
2022-05-04 17:25:28 +03:00
"datetime-local" : ! 0 ,
2021-07-30 04:11:27 +03:00
email : ! 0 ,
month : ! 0 ,
number : ! 0 ,
password : ! 0 ,
range : ! 0 ,
search : ! 0 ,
tel : ! 0 ,
text : ! 0 ,
time : ! 0 ,
url : ! 0 ,
week : ! 0
} ;
function isTextInputElement ( elem ) {
var nodeName = elem && elem . nodeName && elem . nodeName . toLowerCase ( ) ;
2022-05-04 17:25:28 +03:00
return "input" === nodeName ? ! ! supportedInputTypes [ elem . type ] : "textarea" === nodeName ;
2021-07-30 04:11:27 +03:00
}
function createAndAccumulateChangeEvent ( dispatchQueue , inst , nativeEvent , target ) {
enqueueStateRestore ( target ) ;
2022-05-04 17:25:28 +03:00
var listeners = accumulateTwoPhaseListeners ( inst , "onChange" ) ;
2021-07-30 04:11:27 +03:00
if ( listeners . length > 0 ) {
2022-05-04 17:25:28 +03:00
var event = new SyntheticEvent ( "onChange" , "change" , null , nativeEvent , target ) ;
2021-07-30 04:11:27 +03:00
dispatchQueue . push ( {
event : event ,
listeners : listeners
} ) ;
}
}
var activeElement = null , activeElementInst = null ;
function runEventInBatch ( dispatchQueue ) {
processDispatchQueue ( dispatchQueue , 0 ) ;
}
function getInstIfValueChanged ( targetInst ) {
2022-08-26 11:45:49 +03:00
var targetNode = getNodeFromInstance ( targetInst ) ;
if ( updateValueIfChanged ( targetNode ) ) return targetInst ;
2021-07-30 04:11:27 +03:00
}
function getTargetInstForChangeEvent ( domEventName , targetInst ) {
2022-05-04 17:25:28 +03:00
if ( "change" === domEventName ) return targetInst ;
2021-07-30 04:11:27 +03:00
}
var isInputEventSupported = ! 1 ;
function stopWatchingForValueChange ( ) {
2022-05-04 17:25:28 +03:00
activeElement && ( activeElement . detachEvent ( "onpropertychange" , handlePropertyChange ) , activeElement = null , activeElementInst = null ) ;
2021-07-30 04:11:27 +03:00
}
function handlePropertyChange ( nativeEvent ) {
2022-05-04 17:25:28 +03:00
if ( "value" === nativeEvent . propertyName && getInstIfValueChanged ( activeElementInst ) ) {
2022-06-15 17:36:57 +03:00
var nativeEvent1 , dispatchQueue ;
createAndAccumulateChangeEvent ( dispatchQueue = [ ] , activeElementInst , nativeEvent1 = nativeEvent , getEventTarget ( nativeEvent1 ) ) , function ( fn , bookkeeping ) {
2021-09-08 12:45:39 +03:00
if ( isInsideEventHandler ) return fn ( bookkeeping ) ;
isInsideEventHandler = ! 0 ;
try {
return batchedUpdatesImpl ( fn , bookkeeping ) ;
} finally {
isInsideEventHandler = ! 1 , finishEventHandler ( ) ;
}
2022-03-07 06:51:57 +03:00
} ( runEventInBatch , dispatchQueue ) ;
2021-09-08 12:45:39 +03:00
}
2021-07-30 04:11:27 +03:00
}
function handleEventsForInputEventPolyfill ( domEventName , target , targetInst ) {
2022-05-04 17:25:28 +03:00
if ( "focusin" === domEventName ) {
2021-10-06 10:12:11 +03:00
var target1 , targetInst1 ;
2022-05-04 17:25:28 +03:00
stopWatchingForValueChange ( ) , target1 = target , targetInst1 = targetInst , activeElement = target1 , activeElementInst = targetInst1 , activeElement . attachEvent ( "onpropertychange" , handlePropertyChange ) ;
} else "focusout" === domEventName && stopWatchingForValueChange ( ) ;
2021-07-30 04:11:27 +03:00
}
function getTargetInstForInputEventPolyfill ( domEventName , targetInst ) {
2022-05-04 17:25:28 +03:00
if ( "selectionchange" === domEventName || "keyup" === domEventName || "keydown" === domEventName ) return getInstIfValueChanged ( activeElementInst ) ;
2021-07-30 04:11:27 +03:00
}
function getTargetInstForClickEvent ( domEventName , targetInst ) {
2022-05-04 17:25:28 +03:00
if ( "click" === domEventName ) return getInstIfValueChanged ( targetInst ) ;
2021-07-30 04:11:27 +03:00
}
function getTargetInstForInputOrChangeEvent ( domEventName , targetInst ) {
2022-05-04 17:25:28 +03:00
if ( "input" === domEventName || "change" === domEventName ) return getInstIfValueChanged ( targetInst ) ;
2021-07-30 04:11:27 +03:00
}
2022-03-07 06:51:57 +03:00
canUseDOM && ( isInputEventSupported = function ( eventNameSuffix ) {
2021-08-04 13:27:17 +03:00
if ( ! canUseDOM ) return ! 1 ;
2022-05-04 17:25:28 +03:00
var eventName = "on" + eventNameSuffix , isSupported = eventName in document ;
2021-08-04 13:27:17 +03:00
if ( ! isSupported ) {
2022-05-04 17:25:28 +03:00
var element = document . createElement ( "div" ) ;
element . setAttribute ( eventName , "return;" ) , isSupported = "function" == typeof element [ eventName ] ;
2021-08-04 13:27:17 +03:00
}
return isSupported ;
2022-05-04 17:25:28 +03:00
} ( "input" ) && ( ! document . documentMode || document . documentMode > 9 ) ) ;
var objectIs = "function" == typeof Object . is ? Object . is : function ( x , y ) {
2022-04-29 08:58:59 +03:00
return x === y && ( 0 !== x || 1 / x == 1 / y ) || x != x && y != y ;
} , hasOwnProperty$2 = Object . prototype . hasOwnProperty ;
2021-07-30 04:11:27 +03:00
function shallowEqual ( objA , objB ) {
if ( objectIs ( objA , objB ) ) return ! 0 ;
2022-05-04 17:25:28 +03:00
if ( "object" != typeof objA || null === objA || "object" != typeof objB || null === objB ) return ! 1 ;
2021-07-30 04:11:27 +03:00
var keysA = Object . keys ( objA ) , keysB = Object . keys ( objB ) ;
if ( keysA . length !== keysB . length ) return ! 1 ;
for ( var i = 0 ; i < keysA . length ; i ++ ) if ( ! hasOwnProperty$2 . call ( objB , keysA [ i ] ) || ! objectIs ( objA [ keysA [ i ] ] , objB [ keysA [ i ] ] ) ) return ! 1 ;
return ! 0 ;
}
function getLeafNode ( node ) {
for ( ; node && node . firstChild ; ) node = node . firstChild ;
return node ;
}
function getSiblingNode ( node ) {
for ( ; node ; ) {
if ( node . nextSibling ) return node . nextSibling ;
node = node . parentNode ;
}
}
function getNodeForCharacterOffset ( root , offset ) {
for ( var node = getLeafNode ( root ) , nodeStart = 0 , nodeEnd = 0 ; node ; ) {
if ( 3 === node . nodeType ) {
if ( nodeEnd = nodeStart + node . textContent . length , nodeStart <= offset && nodeEnd >= offset ) return {
node : node ,
offset : offset - nodeStart
} ;
nodeStart = nodeEnd ;
}
node = getLeafNode ( getSiblingNode ( node ) ) ;
}
}
function isTextNode ( node ) {
return node && 3 === node . nodeType ;
}
function isSameOriginFrame ( iframe ) {
try {
2022-05-04 17:25:28 +03:00
return "string" == typeof iframe . contentWindow . location . href ;
2021-07-30 04:11:27 +03:00
} catch ( err ) {
return ! 1 ;
}
}
function getActiveElementDeep ( ) {
2022-08-26 13:06:25 +03:00
for ( var win = window , element = getActiveElement ( ) ; element instanceof win . HTMLIFrameElement && isSameOriginFrame ( element ) ; ) win = element . contentWindow , element = getActiveElement ( win . document ) ;
2021-07-30 04:11:27 +03:00
return element ;
}
function hasSelectionCapabilities ( elem ) {
var nodeName = elem && elem . nodeName && elem . nodeName . toLowerCase ( ) ;
2022-05-04 17:25:28 +03:00
return nodeName && ( "input" === nodeName && ( "text" === elem . type || "search" === elem . type || "tel" === elem . type || "url" === elem . type || "password" === elem . type ) || "textarea" === nodeName || "true" === elem . contentEditable ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && document . documentMode <= 11 , activeElement$1 = null , activeElementInst$1 = null , lastSelection = null , mouseDown = ! 1 ;
2021-07-30 04:11:27 +03:00
function constructSelectEvent ( dispatchQueue , nativeEvent , nativeEventTarget ) {
2022-08-26 13:06:25 +03:00
var eventTarget , doc = ( eventTarget = nativeEventTarget , eventTarget . window === eventTarget ? eventTarget . document : 9 === eventTarget . nodeType ? eventTarget : eventTarget . ownerDocument ) ;
2021-07-30 04:11:27 +03:00
if ( ! mouseDown && null != activeElement$1 && activeElement$1 === getActiveElement ( doc ) ) {
2021-09-08 12:45:39 +03:00
var currentSelection = function ( node ) {
2022-05-04 17:25:28 +03:00
if ( "selectionStart" in node && hasSelectionCapabilities ( node ) ) return {
2021-09-08 12:45:39 +03:00
start : node . selectionStart ,
end : node . selectionEnd
} ;
2022-08-26 13:06:25 +03:00
var win = node . ownerDocument && node . ownerDocument . defaultView || window , selection = win . getSelection ( ) ;
2021-09-08 12:45:39 +03:00
return {
anchorNode : selection . anchorNode ,
anchorOffset : selection . anchorOffset ,
focusNode : selection . focusNode ,
focusOffset : selection . focusOffset
} ;
} ( activeElement$1 ) ;
2021-07-30 04:11:27 +03:00
if ( ! lastSelection || ! shallowEqual ( lastSelection , currentSelection ) ) {
lastSelection = currentSelection ;
2022-05-04 17:25:28 +03:00
var listeners = accumulateTwoPhaseListeners ( activeElementInst$1 , "onSelect" ) ;
2021-07-30 04:11:27 +03:00
if ( listeners . length > 0 ) {
2022-05-04 17:25:28 +03:00
var event = new SyntheticEvent ( "onSelect" , "select" , null , nativeEvent , nativeEventTarget ) ;
2021-07-30 04:11:27 +03:00
dispatchQueue . push ( {
event : event ,
listeners : listeners
} ) , event . target = activeElement$1 ;
}
}
}
}
2021-08-04 13:27:17 +03:00
registerSimplePluginEventsAndSetTheirPriorities ( [
2022-03-22 10:54:08 +03:00
'cancel' ,
'cancel' ,
'click' ,
'click' ,
'close' ,
'close' ,
'contextmenu' ,
'contextMenu' ,
'copy' ,
'copy' ,
'cut' ,
'cut' ,
'auxclick' ,
'auxClick' ,
'dblclick' ,
'doubleClick' ,
'dragend' ,
'dragEnd' ,
'dragstart' ,
'dragStart' ,
'drop' ,
'drop' ,
'focusin' ,
'focus' ,
'focusout' ,
'blur' ,
'input' ,
'input' ,
'invalid' ,
'invalid' ,
'keydown' ,
'keyDown' ,
'keypress' ,
'keyPress' ,
'keyup' ,
'keyUp' ,
'mousedown' ,
'mouseDown' ,
'mouseup' ,
'mouseUp' ,
'paste' ,
'paste' ,
'pause' ,
'pause' ,
'play' ,
'play' ,
'pointercancel' ,
'pointerCancel' ,
'pointerdown' ,
'pointerDown' ,
'pointerup' ,
'pointerUp' ,
'ratechange' ,
'rateChange' ,
'reset' ,
'reset' ,
'seeked' ,
'seeked' ,
'submit' ,
'submit' ,
'touchcancel' ,
'touchCancel' ,
'touchend' ,
'touchEnd' ,
'touchstart' ,
'touchStart' ,
'volumechange' ,
'volumeChange'
2021-08-04 13:27:17 +03:00
] , 0 ) , registerSimplePluginEventsAndSetTheirPriorities ( [
2022-03-22 10:54:08 +03:00
'drag' ,
'drag' ,
'dragenter' ,
'dragEnter' ,
'dragexit' ,
'dragExit' ,
'dragleave' ,
'dragLeave' ,
'dragover' ,
'dragOver' ,
'mousemove' ,
'mouseMove' ,
'mouseout' ,
'mouseOut' ,
'mouseover' ,
'mouseOver' ,
'pointermove' ,
'pointerMove' ,
'pointerout' ,
'pointerOut' ,
'pointerover' ,
'pointerOver' ,
'scroll' ,
'scroll' ,
'toggle' ,
'toggle' ,
'touchmove' ,
'touchMove' ,
'wheel' ,
'wheel'
2021-08-04 13:27:17 +03:00
] , 1 ) , registerSimplePluginEventsAndSetTheirPriorities ( [
2022-05-04 17:25:28 +03:00
"abort" ,
"abort" ,
2021-08-04 13:27:17 +03:00
ANIMATION _END ,
2022-05-04 17:25:28 +03:00
"animationEnd" ,
2021-08-04 13:27:17 +03:00
ANIMATION _ITERATION ,
2022-05-04 17:25:28 +03:00
"animationIteration" ,
2021-08-04 13:27:17 +03:00
ANIMATION _START ,
2022-05-04 17:25:28 +03:00
"animationStart" ,
"canplay" ,
"canPlay" ,
"canplaythrough" ,
"canPlayThrough" ,
"durationchange" ,
"durationChange" ,
"emptied" ,
"emptied" ,
"encrypted" ,
"encrypted" ,
"ended" ,
"ended" ,
"error" ,
"error" ,
"gotpointercapture" ,
"gotPointerCapture" ,
"load" ,
"load" ,
"loadeddata" ,
"loadedData" ,
"loadedmetadata" ,
"loadedMetadata" ,
"loadstart" ,
"loadStart" ,
"lostpointercapture" ,
"lostPointerCapture" ,
"playing" ,
"playing" ,
"progress" ,
"progress" ,
"seeking" ,
"seeking" ,
"stalled" ,
"stalled" ,
"suspend" ,
"suspend" ,
"timeupdate" ,
"timeUpdate" ,
2021-08-04 13:27:17 +03:00
TRANSITION _END ,
2022-05-04 17:25:28 +03:00
"transitionEnd" ,
"waiting" ,
"waiting" ,
2022-03-07 06:51:57 +03:00
] , 2 ) , function ( eventTypes , priority ) {
2021-08-04 13:27:17 +03:00
for ( var i = 0 ; i < eventTypes . length ; i ++ ) eventPriorities . set ( eventTypes [ i ] , 0 ) ;
2022-03-07 06:51:57 +03:00
} ( [
2022-05-04 17:25:28 +03:00
"change" ,
"selectionchange" ,
"textInput" ,
"compositionstart" ,
"compositionend" ,
"compositionupdate" ,
] , 0 ) , registerDirectEvent ( "onMouseEnter" , [
"mouseout" ,
"mouseover"
] ) , registerDirectEvent ( "onMouseLeave" , [
"mouseout" ,
"mouseover"
] ) , registerDirectEvent ( "onPointerEnter" , [
"pointerout" ,
"pointerover"
] ) , registerDirectEvent ( "onPointerLeave" , [
"pointerout" ,
"pointerover"
] ) , registerTwoPhaseEvent ( "onChange" , [
"change" ,
"click" ,
"focusin" ,
"focusout" ,
"input" ,
"keydown" ,
"keyup" ,
"selectionchange" ,
] ) , registerTwoPhaseEvent ( "onSelect" , [
"focusout" ,
"contextmenu" ,
"dragend" ,
"focusin" ,
"keydown" ,
"keyup" ,
"mousedown" ,
"mouseup" ,
"selectionchange" ,
] ) , registerTwoPhaseEvent ( "onBeforeInput" , [
"compositionend" ,
"keypress" ,
"textInput" ,
"paste" ,
] ) , registerTwoPhaseEvent ( "onCompositionEnd" , [
"compositionend" ,
"focusout" ,
"keydown" ,
"keypress" ,
"keyup" ,
"mousedown" ,
] ) , registerTwoPhaseEvent ( "onCompositionStart" , [
"compositionstart" ,
"focusout" ,
"keydown" ,
"keypress" ,
"keyup" ,
"mousedown" ,
] ) , registerTwoPhaseEvent ( "onCompositionUpdate" , [
"compositionupdate" ,
"focusout" ,
"keydown" ,
"keypress" ,
"keyup" ,
"mousedown" ,
2021-08-04 13:27:17 +03:00
] ) ;
var mediaEventTypes = [
2022-05-04 17:25:28 +03:00
"abort" ,
"canplay" ,
"canplaythrough" ,
"durationchange" ,
"emptied" ,
"encrypted" ,
"ended" ,
"error" ,
"loadeddata" ,
"loadedmetadata" ,
"loadstart" ,
"pause" ,
"play" ,
"playing" ,
"progress" ,
"ratechange" ,
"seeked" ,
"seeking" ,
"stalled" ,
"suspend" ,
"timeupdate" ,
"volumechange" ,
"waiting" ,
2021-08-03 18:52:47 +03:00
] , nonDelegatedEvents = new Set ( [
2022-05-04 17:25:28 +03:00
"cancel" ,
"close" ,
"invalid" ,
"load" ,
"scroll" ,
"toggle"
2021-08-03 18:52:47 +03:00
] . concat ( mediaEventTypes ) ) ;
2021-07-30 04:11:27 +03:00
function executeDispatch ( event , listener , currentTarget ) {
2022-05-04 17:25:28 +03:00
var type = event . type || "unknown-event" ;
2022-03-07 06:51:57 +03:00
event . currentTarget = currentTarget , function ( name , func , context , a , b , c , d , e , f ) {
2021-09-08 12:45:39 +03:00
if ( invokeGuardedCallback . apply ( this , arguments ) , hasError ) {
var error = clearCaughtError ( ) ;
hasRethrowError || ( hasRethrowError = ! 0 , rethrowError = error ) ;
}
2022-03-07 06:51:57 +03:00
} ( type , listener , void 0 , event ) , event . currentTarget = null ;
2021-07-30 04:11:27 +03:00
}
function processDispatchQueueItemsInOrder ( event , dispatchListeners , inCapturePhase ) {
var previousInstance ;
if ( inCapturePhase ) for ( var i = dispatchListeners . length - 1 ; i >= 0 ; i -- ) {
var _dispatchListeners$i = dispatchListeners [ i ] , instance = _dispatchListeners$i . instance , currentTarget = _dispatchListeners$i . currentTarget , listener = _dispatchListeners$i . listener ;
if ( instance !== previousInstance && event . isPropagationStopped ( ) ) return ;
executeDispatch ( event , listener , currentTarget ) , previousInstance = instance ;
}
else for ( var _i = 0 ; _i < dispatchListeners . length ; _i ++ ) {
var _dispatchListeners$ _i = dispatchListeners [ _i ] , _instance = _dispatchListeners$ _i . instance , _currentTarget = _dispatchListeners$ _i . currentTarget , _listener = _dispatchListeners$ _i . listener ;
if ( _instance !== previousInstance && event . isPropagationStopped ( ) ) return ;
executeDispatch ( event , _listener , _currentTarget ) , previousInstance = _instance ;
}
}
function processDispatchQueue ( dispatchQueue , eventSystemFlags ) {
2021-09-08 12:45:39 +03:00
for ( var inCapturePhase = ( 4 & eventSystemFlags ) != 0 , i = 0 ; i < dispatchQueue . length ; i ++ ) {
2021-10-14 16:48:14 +03:00
var _dispatchQueue$i = dispatchQueue [ i ] , event = _dispatchQueue$i . event , listeners = _dispatchQueue$i . listeners ;
processDispatchQueueItemsInOrder ( event , listeners , inCapturePhase ) ;
2021-08-03 18:52:47 +03:00
}
2021-09-08 12:45:39 +03:00
! function ( ) {
if ( hasRethrowError ) {
var error = rethrowError ;
throw hasRethrowError = ! 1 , rethrowError = null , error ;
}
} ( ) ;
2021-07-30 04:11:27 +03:00
}
function listenToNonDelegatedEvent ( domEventName , targetElement ) {
2022-02-19 11:33:36 +03:00
var listenerSet = getEventListenerSet ( targetElement ) , listenerSetKey = getListenerSetKey ( domEventName , ! 1 ) ;
listenerSet . has ( listenerSetKey ) || ( addTrappedEventListener ( targetElement , domEventName , 2 , ! 1 ) , listenerSet . add ( listenerSetKey ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var listeningMarker = "_reactListening" + Math . random ( ) . toString ( 36 ) . slice ( 2 ) ;
2021-07-30 04:11:27 +03:00
function listenToAllSupportedEvents ( rootContainerElement ) {
rootContainerElement [ listeningMarker ] || ( rootContainerElement [ listeningMarker ] = ! 0 , allNativeEvents . forEach ( function ( domEventName ) {
nonDelegatedEvents . has ( domEventName ) || listenToNativeEvent ( domEventName , ! 1 , rootContainerElement , null ) , listenToNativeEvent ( domEventName , ! 0 , rootContainerElement , null ) ;
} ) ) ;
}
function listenToNativeEvent ( domEventName , isCapturePhaseListener , rootContainerElement , targetElement ) {
var eventSystemFlags = arguments . length > 4 && void 0 !== arguments [ 4 ] ? arguments [ 4 ] : 0 , target = rootContainerElement ;
2022-05-04 17:25:28 +03:00
if ( "selectionchange" === domEventName && 9 !== rootContainerElement . nodeType && ( target = rootContainerElement . ownerDocument ) , null !== targetElement && ! isCapturePhaseListener && nonDelegatedEvents . has ( domEventName ) ) {
if ( "scroll" !== domEventName ) return ;
2021-09-08 12:45:39 +03:00
eventSystemFlags |= 2 , target = targetElement ;
}
2021-07-30 04:11:27 +03:00
var listenerSet = getEventListenerSet ( target ) , listenerSetKey = getListenerSetKey ( domEventName , isCapturePhaseListener ) ;
listenerSet . has ( listenerSetKey ) || ( isCapturePhaseListener && ( eventSystemFlags |= 4 ) , addTrappedEventListener ( target , domEventName , eventSystemFlags , isCapturePhaseListener ) , listenerSet . add ( listenerSetKey ) ) ;
}
2022-06-15 17:36:57 +03:00
function addTrappedEventListener ( targetContainer , domEventName , eventSystemFlags , isCapturePhaseListener , isDeferredListenerForLegacyFBSupport ) {
var target , eventType , listener , passive , target1 , eventType1 , listener1 , target2 , eventType2 , listener2 , passive1 , target3 , eventType3 , listener3 , listener4 = function ( targetContainer , domEventName , eventSystemFlags ) {
var domEventName1 , priority , listenerWrapper , eventPriority = ( domEventName1 = domEventName , void 0 === ( priority = eventPriorities . get ( domEventName1 ) ) ? 2 : priority ) ;
2021-09-08 12:45:39 +03:00
switch ( eventPriority ) {
case 0 :
listenerWrapper = dispatchDiscreteEvent ;
break ;
case 1 :
listenerWrapper = dispatchUserBlockingUpdate ;
break ;
default :
listenerWrapper = dispatchEvent ;
}
return listenerWrapper . bind ( null , domEventName , eventSystemFlags , targetContainer ) ;
2022-06-15 17:36:57 +03:00
} ( targetContainer , domEventName , eventSystemFlags ) , isPassiveListener = void 0 ;
( passiveBrowserEventsSupported && ( "touchstart" === domEventName || "touchmove" === domEventName || "wheel" === domEventName ) && ( isPassiveListener = ! 0 ) , isCapturePhaseListener ) ? void 0 !== isPassiveListener ? ( target = targetContainer , eventType = domEventName , listener = listener4 , passive = isPassiveListener , target . addEventListener ( eventType , listener , {
2021-09-08 12:45:39 +03:00
capture : ! 0 ,
2021-10-06 10:12:11 +03:00
passive : passive
2022-06-15 17:36:57 +03:00
} ) ) : ( target1 = targetContainer , eventType1 = domEventName , listener1 = listener4 , target1 . addEventListener ( eventType1 , listener1 , ! 0 ) ) : void 0 !== isPassiveListener ? ( target2 = targetContainer , eventType2 = domEventName , listener2 = listener4 , passive1 = isPassiveListener , target2 . addEventListener ( eventType2 , listener2 , {
2021-10-06 10:12:11 +03:00
passive : passive1
2022-06-15 17:36:57 +03:00
} ) ) : ( target3 = targetContainer , eventType3 = domEventName , listener3 = listener4 , target3 . addEventListener ( eventType3 , listener3 , ! 1 ) ) ;
2021-07-30 04:11:27 +03:00
}
function isMatchingRootContainer ( grandContainer , targetContainer ) {
return grandContainer === targetContainer || 8 === grandContainer . nodeType && grandContainer . parentNode === targetContainer ;
}
2022-06-15 17:36:57 +03:00
function dispatchEventForPluginEventSystem ( domEventName , eventSystemFlags , nativeEvent , targetInst , targetContainer ) {
var ancestorInst = targetInst ;
if ( ( 1 & eventSystemFlags ) == 0 && ( 2 & eventSystemFlags ) == 0 ) {
2021-07-30 04:11:27 +03:00
var targetContainerNode = targetContainer ;
2022-06-15 17:36:57 +03:00
if ( null !== targetInst ) {
var node = targetInst ;
2021-07-30 04:11:27 +03:00
mainLoop : for ( ; ; ) {
if ( null === node ) return ;
var nodeTag = node . tag ;
if ( 3 === nodeTag || 4 === nodeTag ) {
var container = node . stateNode . containerInfo ;
if ( isMatchingRootContainer ( container , targetContainerNode ) ) break ;
if ( 4 === nodeTag ) for ( var grandNode = node . return ; null !== grandNode ; ) {
2022-05-09 12:15:12 +03:00
var grandContainer , grandTag = grandNode . tag ;
2021-08-10 11:52:28 +03:00
if ( ( 3 === grandTag || 4 === grandTag ) && isMatchingRootContainer ( grandNode . stateNode . containerInfo , targetContainerNode ) ) return ;
2021-07-30 04:11:27 +03:00
grandNode = grandNode . return ;
}
for ( ; null !== container ; ) {
var parentNode = getClosestInstanceFromNode ( container ) ;
if ( null === parentNode ) return ;
var parentTag = parentNode . tag ;
if ( 5 === parentTag || 6 === parentTag ) {
node = ancestorInst = parentNode ;
continue mainLoop ;
}
container = container . parentNode ;
}
}
node = node . return ;
}
}
}
2021-09-08 12:45:39 +03:00
! function ( fn , a , b ) {
if ( isBatchingEventUpdates ) return fn ( a , b ) ;
isBatchingEventUpdates = ! 0 ;
try {
return batchedEventUpdatesImpl ( fn , a , b ) ;
} finally {
isBatchingEventUpdates = ! 1 , finishEventHandler ( ) ;
}
} ( function ( ) {
2022-06-15 17:36:57 +03:00
var domEventName1 , eventSystemFlags1 , nativeEvent1 , targetInst , nativeEventTarget , dispatchQueue ;
return domEventName1 = domEventName , eventSystemFlags1 = eventSystemFlags , nativeEvent1 = nativeEvent , targetInst = ancestorInst , nativeEventTarget = getEventTarget ( nativeEvent1 ) , void ( function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags , targetContainer ) {
2022-03-08 17:35:18 +03:00
if ( function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags , targetContainer ) {
2022-01-27 09:36:22 +03:00
var reactName = topLevelEventsToReactNames . get ( domEventName ) ;
if ( void 0 !== reactName ) {
var SyntheticEventCtor = SyntheticEvent , reactEventType = domEventName ;
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "keypress" :
2022-01-27 09:36:22 +03:00
if ( 0 === getEventCharCode ( nativeEvent ) ) return ;
2022-05-04 17:25:28 +03:00
case "keydown" :
case "keyup" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticKeyboardEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "focusin" :
reactEventType = "focus" , SyntheticEventCtor = SyntheticFocusEvent ;
2022-01-27 09:36:22 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "focusout" :
reactEventType = "blur" , SyntheticEventCtor = SyntheticFocusEvent ;
2022-01-27 09:36:22 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "beforeblur" :
case "afterblur" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticFocusEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "click" :
2022-01-27 09:36:22 +03:00
if ( 2 === nativeEvent . button ) return ;
2022-05-04 17:25:28 +03:00
case "auxclick" :
case "dblclick" :
case "mousedown" :
case "mousemove" :
case "mouseup" :
case "mouseout" :
case "mouseover" :
case "contextmenu" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticMouseEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "drag" :
case "dragend" :
case "dragenter" :
case "dragexit" :
case "dragleave" :
case "dragover" :
case "dragstart" :
case "drop" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticDragEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "touchcancel" :
case "touchend" :
case "touchmove" :
case "touchstart" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticTouchEvent ;
break ;
case ANIMATION _END :
case ANIMATION _ITERATION :
case ANIMATION _START :
SyntheticEventCtor = SyntheticAnimationEvent ;
break ;
case TRANSITION _END :
SyntheticEventCtor = SyntheticTransitionEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "scroll" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticUIEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "wheel" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticWheelEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "copy" :
case "cut" :
case "paste" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticClipboardEvent ;
break ;
2022-05-04 17:25:28 +03:00
case "gotpointercapture" :
case "lostpointercapture" :
case "pointercancel" :
case "pointerdown" :
case "pointermove" :
case "pointerout" :
case "pointerover" :
case "pointerup" :
2022-01-27 09:36:22 +03:00
SyntheticEventCtor = SyntheticPointerEvent ;
2021-10-14 16:48:14 +03:00
}
2022-08-05 16:25:28 +03:00
var inCapturePhase = ( 4 & eventSystemFlags ) != 0 , _listeners = accumulateSinglePhaseListeners ( targetInst , reactName , nativeEvent . type , inCapturePhase , ! inCapturePhase && "scroll" === domEventName ) ;
2022-01-27 09:36:22 +03:00
if ( _listeners . length > 0 ) {
var _event = new SyntheticEventCtor ( reactName , reactEventType , null , nativeEvent , nativeEventTarget ) ;
dispatchQueue . push ( {
event : _event ,
listeners : _listeners
} ) ;
2021-09-08 12:45:39 +03:00
}
2021-09-16 07:23:33 +03:00
}
2022-06-15 17:36:57 +03:00
} ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags ) , ( 7 & eventSystemFlags ) == 0 ) {
var dispatchQueue1 , domEventName1 , targetInst1 , nativeEvent1 , nativeEventTarget1 ;
2022-01-27 09:36:22 +03:00
( function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags , targetContainer ) {
2022-05-04 17:25:28 +03:00
var win , from , to , isOverEvent = "mouseover" === domEventName || "pointerover" === domEventName , isOutEvent = "mouseout" === domEventName || "pointerout" === domEventName ;
2022-01-27 09:36:22 +03:00
if ( isOverEvent && ( 16 & eventSystemFlags ) == 0 ) {
var related = nativeEvent . relatedTarget || nativeEvent . fromElement ;
if ( related && ( getClosestInstanceFromNode ( related ) || isContainerMarkedAsRoot ( related ) ) ) return ;
}
if ( isOutEvent || isOverEvent ) {
if ( nativeEventTarget . window === nativeEventTarget ) win = nativeEventTarget ;
else {
var doc = nativeEventTarget . ownerDocument ;
win = doc ? doc . defaultView || doc . parentWindow : window ;
2021-09-08 12:45:39 +03:00
}
2022-01-27 09:36:22 +03:00
if ( isOutEvent ) {
var _related = nativeEvent . relatedTarget || nativeEvent . toElement ;
2022-08-26 13:06:25 +03:00
if ( from = targetInst , to = _related ? getClosestInstanceFromNode ( _related ) : null , null !== to ) {
2022-01-27 09:36:22 +03:00
var nearestMounted = getNearestMountedFiber ( to ) ;
( to !== nearestMounted || 5 !== to . tag && 6 !== to . tag ) && ( to = null ) ;
}
} else from = null , to = targetInst ;
if ( from !== to ) {
2022-05-04 17:25:28 +03:00
var SyntheticEventCtor = SyntheticMouseEvent , leaveEventType = "onMouseLeave" , enterEventType = "onMouseEnter" , eventTypePrefix = "mouse" ;
( "pointerout" === domEventName || "pointerover" === domEventName ) && ( SyntheticEventCtor = SyntheticPointerEvent , leaveEventType = "onPointerLeave" , enterEventType = "onPointerEnter" , eventTypePrefix = "pointer" ) ;
var fromNode = null == from ? win : getNodeFromInstance ( from ) , toNode = null == to ? win : getNodeFromInstance ( to ) , leave = new SyntheticEventCtor ( leaveEventType , eventTypePrefix + "leave" , from , nativeEvent , nativeEventTarget ) ;
2022-01-27 09:36:22 +03:00
leave . target = fromNode , leave . relatedTarget = toNode ;
2022-08-26 13:06:25 +03:00
var enter = null , nativeTargetInst = getClosestInstanceFromNode ( nativeEventTarget ) ;
if ( nativeTargetInst === targetInst ) {
2022-05-04 17:25:28 +03:00
var enterEvent = new SyntheticEventCtor ( enterEventType , eventTypePrefix + "enter" , to , nativeEvent , nativeEventTarget ) ;
2022-01-27 09:36:22 +03:00
enterEvent . target = toNode , enterEvent . relatedTarget = fromNode , enter = enterEvent ;
}
accumulateEnterLeaveTwoPhaseListeners ( dispatchQueue , leave , enter , from , to ) ;
}
}
2022-06-15 17:36:57 +03:00
} ) ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags ) , function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags , targetContainer ) {
2022-01-27 09:36:22 +03:00
var node , state , elem , nodeName , getTargetInstFunc , handleEventFunc , elem1 , nodeName1 , targetNode = targetInst ? getNodeFromInstance ( targetInst ) : window ;
2022-08-26 13:06:25 +03:00
if ( ( elem1 = targetNode , "select" === ( nodeName1 = elem1 . nodeName && elem1 . nodeName . toLowerCase ( ) ) || "input" === nodeName1 && "file" === elem1 . type ) ? getTargetInstFunc = getTargetInstForChangeEvent : isTextInputElement ( targetNode ) ? isInputEventSupported ? getTargetInstFunc = getTargetInstForInputOrChangeEvent : ( getTargetInstFunc = getTargetInstForInputEventPolyfill , handleEventFunc = handleEventsForInputEventPolyfill ) : ( elem = targetNode , ( nodeName = elem . nodeName ) && "input" === nodeName . toLowerCase ( ) && ( "checkbox" === elem . type || "radio" === elem . type ) && ( getTargetInstFunc = getTargetInstForClickEvent ) ) , getTargetInstFunc ) {
2022-01-27 09:36:22 +03:00
var inst = getTargetInstFunc ( domEventName , targetInst ) ;
if ( inst ) {
createAndAccumulateChangeEvent ( dispatchQueue , inst , nativeEvent , nativeEventTarget ) ;
return ;
}
}
2022-08-26 13:06:25 +03:00
handleEventFunc && handleEventFunc ( domEventName , targetNode , targetInst ) , "focusout" === domEventName && ( node = targetNode , ( state = node . _wrapperState ) && state . controlled && "number" === node . type && setDefaultValue ( node , "number" , node . value ) ) ;
2022-06-15 17:36:57 +03:00
} ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget ) , function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget , eventSystemFlags , targetContainer ) {
2022-01-27 09:36:22 +03:00
var targetNode = targetInst ? getNodeFromInstance ( targetInst ) : window ;
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "focusin" :
( isTextInputElement ( targetNode ) || "true" === targetNode . contentEditable ) && ( activeElement$1 = targetNode , activeElementInst$1 = targetInst , lastSelection = null ) ;
2022-01-27 09:36:22 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "focusout" :
2022-01-27 09:36:22 +03:00
activeElement$1 = null , activeElementInst$1 = null , lastSelection = null ;
break ;
2022-05-04 17:25:28 +03:00
case "mousedown" :
2022-01-27 09:36:22 +03:00
mouseDown = ! 0 ;
break ;
2022-05-04 17:25:28 +03:00
case "contextmenu" :
case "mouseup" :
case "dragend" :
2022-01-27 09:36:22 +03:00
mouseDown = ! 1 , constructSelectEvent ( dispatchQueue , nativeEvent , nativeEventTarget ) ;
break ;
2022-05-04 17:25:28 +03:00
case "selectionchange" :
2022-01-27 09:36:22 +03:00
if ( skipSelectionChangeEvent ) break ;
2022-05-04 17:25:28 +03:00
case "keydown" :
case "keyup" :
2022-01-27 09:36:22 +03:00
constructSelectEvent ( dispatchQueue , nativeEvent , nativeEventTarget ) ;
}
2022-06-15 17:36:57 +03:00
} ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget ) , dispatchQueue1 = dispatchQueue , domEventName1 = domEventName , targetInst1 = targetInst , function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget ) {
2022-03-07 06:51:57 +03:00
if ( canUseCompositionEvent ? eventType = function ( domEventName ) {
2022-01-27 09:36:22 +03:00
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "compositionstart" :
return "onCompositionStart" ;
case "compositionend" :
return "onCompositionEnd" ;
case "compositionupdate" :
return "onCompositionUpdate" ;
2022-01-27 09:36:22 +03:00
}
2022-06-15 17:36:57 +03:00
} ( domEventName ) : isComposing ? isFallbackCompositionEnd ( domEventName , nativeEvent ) && ( eventType = "onCompositionEnd" ) : ( domEventName1 = domEventName , nativeEvent1 = nativeEvent , "keydown" === domEventName1 && 229 === nativeEvent1 . keyCode && ( eventType = "onCompositionStart" ) ) , ! eventType ) return null ;
2022-08-26 13:06:25 +03:00
useFallbackCompositionData && ! isUsingKoreanIME ( nativeEvent ) && ( isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && ( fallbackData = getData ( ) ) : isComposing = ( nativeEventTarget1 = nativeEventTarget , root = nativeEventTarget1 , startText = getText ( ) , ! 0 ) ) ;
2022-06-15 17:36:57 +03:00
var domEventName1 , nativeEvent1 , nativeEventTarget1 , eventType , fallbackData , listeners = accumulateTwoPhaseListeners ( targetInst , eventType ) ;
2022-01-27 09:36:22 +03:00
if ( listeners . length > 0 ) {
2022-06-15 17:36:57 +03:00
var event = new SyntheticCompositionEvent ( eventType , domEventName , null , nativeEvent , nativeEventTarget ) ;
2022-01-27 09:36:22 +03:00
if ( dispatchQueue . push ( {
event : event ,
listeners : listeners
} ) , fallbackData ) event . data = fallbackData ;
else {
var customData = getDataFromCustomEvent ( nativeEvent ) ;
null !== customData && ( event . data = customData ) ;
}
}
2022-06-15 17:36:57 +03:00
} ( dispatchQueue1 , domEventName1 , targetInst1 , nativeEvent1 = nativeEvent , nativeEventTarget1 = nativeEventTarget ) , function ( dispatchQueue , domEventName , targetInst , nativeEvent , nativeEventTarget ) {
2022-08-26 13:06:25 +03:00
if ( chars = canUseTextInputEvent ? function ( domEventName , nativeEvent ) {
2022-01-27 09:36:22 +03:00
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "compositionend" :
2022-01-27 09:36:22 +03:00
return getDataFromCustomEvent ( nativeEvent ) ;
2022-05-04 17:25:28 +03:00
case "keypress" :
2022-01-27 09:36:22 +03:00
if ( 32 !== nativeEvent . which ) return null ;
return hasSpaceKeypress = ! 0 , " " ;
2022-05-04 17:25:28 +03:00
case "textInput" :
2022-01-27 09:36:22 +03:00
var chars = nativeEvent . data ;
if ( " " === chars && hasSpaceKeypress ) return null ;
return chars ;
default :
return null ;
}
2022-06-15 17:36:57 +03:00
} ( domEventName , nativeEvent ) : function ( domEventName , nativeEvent ) {
2022-02-28 15:07:12 +03:00
if ( isComposing ) {
2022-05-04 17:25:28 +03:00
if ( "compositionend" === domEventName || ! canUseCompositionEvent && isFallbackCompositionEnd ( domEventName , nativeEvent ) ) {
2022-08-26 13:06:25 +03:00
var nativeEvent1 , chars = getData ( ) ;
return root = null , startText = null , fallbackText = null , isComposing = ! 1 , chars ;
2022-02-28 15:07:12 +03:00
}
return null ;
}
2022-01-27 09:36:22 +03:00
switch ( domEventName ) {
2022-05-04 17:25:28 +03:00
case "paste" :
2022-04-21 13:00:25 +03:00
default :
2022-01-27 09:36:22 +03:00
return null ;
2022-05-04 17:25:28 +03:00
case "keypress" :
2022-06-15 17:36:57 +03:00
if ( ! ( nativeEvent1 = nativeEvent ) . ctrlKey && ! nativeEvent1 . altKey && ! nativeEvent1 . metaKey || nativeEvent1 . ctrlKey && nativeEvent1 . altKey ) {
2022-01-27 09:36:22 +03:00
if ( nativeEvent . char && nativeEvent . char . length > 1 ) return nativeEvent . char ;
if ( nativeEvent . which ) return String . fromCharCode ( nativeEvent . which ) ;
}
return null ;
2022-05-04 17:25:28 +03:00
case "compositionend" :
2022-01-27 09:36:22 +03:00
return useFallbackCompositionData && ! isUsingKoreanIME ( nativeEvent ) ? null : nativeEvent . data ;
}
2022-08-26 13:06:25 +03:00
} ( domEventName , nativeEvent ) , ! chars ) return null ;
2022-06-15 17:36:57 +03:00
var chars , listeners = accumulateTwoPhaseListeners ( targetInst , "onBeforeInput" ) ;
2022-01-27 09:36:22 +03:00
if ( listeners . length > 0 ) {
2022-06-15 17:36:57 +03:00
var event = new SyntheticInputEvent ( "onBeforeInput" , "beforeinput" , null , nativeEvent , nativeEventTarget ) ;
2022-01-27 09:36:22 +03:00
dispatchQueue . push ( {
event : event ,
listeners : listeners
2022-06-15 17:36:57 +03:00
} ) , event . data = chars ;
2022-01-27 09:36:22 +03:00
}
2022-06-15 17:36:57 +03:00
} ( dispatchQueue1 , domEventName1 , targetInst1 , nativeEvent1 , nativeEventTarget1 ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( dispatchQueue = [ ] , domEventName1 , targetInst , nativeEvent1 , nativeEventTarget , eventSystemFlags1 ) , processDispatchQueue ( dispatchQueue , eventSystemFlags1 ) ) ;
2021-07-30 04:11:27 +03:00
} ) ;
}
function createDispatchListener ( instance , listener , currentTarget ) {
return {
instance : instance ,
listener : listener ,
currentTarget : currentTarget
} ;
}
function accumulateSinglePhaseListeners ( targetFiber , reactName , nativeEventType , inCapturePhase , accumulateTargetOnly ) {
2022-05-04 17:25:28 +03:00
for ( var reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName , listeners = [ ] , instance = targetFiber , lastHostComponent = null ; null !== instance ; ) {
2021-08-10 11:52:28 +03:00
var _instance2 = instance , stateNode = _instance2 . stateNode ;
if ( 5 === _instance2 . tag && null !== stateNode && ( lastHostComponent = stateNode , null !== reactEventName ) ) {
2021-07-30 04:11:27 +03:00
var listener = getListener ( instance , reactEventName ) ;
null != listener && listeners . push ( createDispatchListener ( instance , listener , lastHostComponent ) ) ;
}
if ( accumulateTargetOnly ) break ;
instance = instance . return ;
}
return listeners ;
}
function accumulateTwoPhaseListeners ( targetFiber , reactName ) {
2022-05-04 17:25:28 +03:00
for ( var captureName = reactName + "Capture" , listeners = [ ] , instance = targetFiber ; null !== instance ; ) {
2021-08-10 11:52:28 +03:00
var _instance3 = instance , stateNode = _instance3 . stateNode ;
if ( 5 === _instance3 . tag && null !== stateNode ) {
2021-07-30 04:11:27 +03:00
var currentTarget = stateNode , captureListener = getListener ( instance , captureName ) ;
null != captureListener && listeners . unshift ( createDispatchListener ( instance , captureListener , currentTarget ) ) ;
var bubbleListener = getListener ( instance , reactName ) ;
null != bubbleListener && listeners . push ( createDispatchListener ( instance , bubbleListener , currentTarget ) ) ;
}
instance = instance . return ;
}
return listeners ;
}
function getParent ( inst ) {
if ( null === inst ) return null ;
do inst = inst . return ;
while ( inst && 5 !== inst . tag )
return inst || null ;
}
function accumulateEnterLeaveListenersForEvent ( dispatchQueue , event , target , common , inCapturePhase ) {
2022-03-24 03:49:32 +03:00
for ( var registrationName = event . _reactName , listeners = [ ] , instance = target ; null !== instance && instance !== common ; ) {
2021-07-30 04:11:27 +03:00
var _instance4 = instance , alternate = _instance4 . alternate , stateNode = _instance4 . stateNode , tag = _instance4 . tag ;
if ( null !== alternate && alternate === common ) break ;
if ( 5 === tag && null !== stateNode ) {
var currentTarget = stateNode ;
if ( inCapturePhase ) {
var captureListener = getListener ( instance , registrationName ) ;
null != captureListener && listeners . unshift ( createDispatchListener ( instance , captureListener , currentTarget ) ) ;
} else if ( ! inCapturePhase ) {
var bubbleListener = getListener ( instance , registrationName ) ;
null != bubbleListener && listeners . push ( createDispatchListener ( instance , bubbleListener , currentTarget ) ) ;
}
}
instance = instance . return ;
}
0 !== listeners . length && dispatchQueue . push ( {
event : event ,
listeners : listeners
} ) ;
}
function accumulateEnterLeaveTwoPhaseListeners ( dispatchQueue , leaveEvent , enterEvent , from , to ) {
2021-09-08 12:45:39 +03:00
var common = from && to ? function ( instA , instB ) {
2021-10-06 10:12:11 +03:00
for ( var nodeA = instA , nodeB = instB , depthA = 0 , tempA = nodeA ; tempA ; tempA = getParent ( tempA ) ) depthA ++ ;
2021-09-08 12:45:39 +03:00
for ( var depthB = 0 , tempB = nodeB ; tempB ; tempB = getParent ( tempB ) ) depthB ++ ;
for ( ; depthA - depthB > 0 ; ) nodeA = getParent ( nodeA ) , depthA -- ;
for ( ; depthB - depthA > 0 ; ) nodeB = getParent ( nodeB ) , depthB -- ;
for ( var depth = depthA ; depth -- ; ) {
if ( nodeA === nodeB || null !== nodeB && nodeA === nodeB . alternate ) return nodeA ;
nodeA = getParent ( nodeA ) , nodeB = getParent ( nodeB ) ;
}
return null ;
} ( from , to ) : null ;
2021-07-30 04:11:27 +03:00
null !== from && accumulateEnterLeaveListenersForEvent ( dispatchQueue , leaveEvent , from , common , ! 1 ) , null !== to && null !== enterEvent && accumulateEnterLeaveListenersForEvent ( dispatchQueue , enterEvent , to , common , ! 0 ) ;
}
function getListenerSetKey ( domEventName , capture ) {
2022-05-04 17:25:28 +03:00
return domEventName + "__" + ( capture ? "capture" : "bubble" ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var didWarnInvalidHydration = ! 1 , DANGEROUSLY _SET _INNER _HTML = "dangerouslySetInnerHTML" , SUPPRESS _CONTENT _EDITABLE _WARNING = "suppressContentEditableWarning" , SUPPRESS _HYDRATION _WARNING = "suppressHydrationWarning" , AUTOFOCUS = "autoFocus" , CHILDREN = "children" , STYLE = "style" , HTML$1 = "__html" , HTML _NAMESPACE$1 = Namespaces . html ;
2021-08-04 13:27:17 +03:00
warnedUnknownTags = {
dialog : ! 0 ,
webview : ! 0
2022-06-15 17:36:57 +03:00
} , validatePropertiesInDevelopment = function ( type , props ) {
var type1 , props1 , type2 , props2 , type3 , props3 , eventRegistry ;
isCustomComponent ( type1 = type , props1 = props ) || function ( type , props ) {
2021-09-08 12:45:39 +03:00
var invalidProps = [ ] ;
for ( var key in props ) validateProperty ( type , key ) || invalidProps . push ( key ) ;
var unknownPropString = invalidProps . map ( function ( prop ) {
2022-05-04 17:25:28 +03:00
return "`" + prop + "`" ;
} ) . join ( ", " ) ;
2022-06-15 17:36:57 +03:00
1 === invalidProps . length ? error ( "Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props" , unknownPropString , type ) : invalidProps . length > 1 && error ( "Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props" , unknownPropString , type ) ;
} ( type1 , props1 ) , type2 = type , props2 = props , ( "input" === type2 || "textarea" === type2 || "select" === type2 ) && ( null == props2 || null !== props2 . value || didWarnValueNull || ( didWarnValueNull = ! 0 , "select" === type2 && props2 . 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." , type2 ) : error ( "`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components." , type2 ) ) ) , type3 = type , props3 = props , eventRegistry = {
registrationNameDependencies : registrationNameDependencies ,
possibleRegistrationNames : possibleRegistrationNames
} , isCustomComponent ( type3 , props3 ) || warnUnknownProperties ( type3 , props3 , eventRegistry ) ;
2021-08-04 13:27:17 +03:00
} , canDiffStyleForHydrationWarning = canUseDOM && ! document . documentMode ;
var NORMALIZE _NEWLINES _REGEX = /\r\n?/g , NORMALIZE _NULL _AND _REPLACEMENT _REGEX = /\u0000|\uFFFD/g ;
2021-07-30 04:11:27 +03:00
function getOwnerDocumentFromRootContainer ( rootContainerElement ) {
return 9 === rootContainerElement . nodeType ? rootContainerElement : rootContainerElement . ownerDocument ;
}
2022-01-02 23:54:58 +03:00
function noop ( ) { }
2021-07-30 04:11:27 +03:00
function trapClickOnNonInteractiveElement ( node ) {
node . onclick = noop ;
}
function getPossibleStandardName ( propName ) {
var lowerCasedName = propName . toLowerCase ( ) ;
2022-05-17 10:34:47 +03:00
return possibleStandardNames . hasOwnProperty ( lowerCasedName ) && possibleStandardNames [ lowerCasedName ] || null ;
2021-07-30 04:11:27 +03:00
}
function warnForUnmatchedText ( textNode , text ) {
warnForTextDifference ( textNode . nodeValue , text ) ;
}
function warnForDeletedHydratableElement ( parentNode , child ) {
2022-06-15 17:36:57 +03:00
didWarnInvalidHydration || ( didWarnInvalidHydration = ! 0 , error ( "Did not expect server HTML to contain a <%s> in <%s>." , child . nodeName . toLowerCase ( ) , parentNode . nodeName . toLowerCase ( ) ) ) ;
2021-07-30 04:11:27 +03:00
}
function warnForDeletedHydratableText ( parentNode , child ) {
2022-06-15 17:36:57 +03:00
didWarnInvalidHydration || ( didWarnInvalidHydration = ! 0 , error ( 'Did not expect server HTML to contain the text node "%s" in <%s>.' , child . nodeValue , parentNode . nodeName . toLowerCase ( ) ) ) ;
2021-07-30 04:11:27 +03:00
}
function warnForInsertedHydratedElement ( parentNode , tag , props ) {
2022-06-15 17:36:57 +03:00
didWarnInvalidHydration || ( didWarnInvalidHydration = ! 0 , error ( "Expected server HTML to contain a matching <%s> in <%s>." , tag , parentNode . nodeName . toLowerCase ( ) ) ) ;
2021-07-30 04:11:27 +03:00
}
function warnForInsertedHydratedText ( parentNode , text ) {
2022-06-15 17:36:57 +03:00
"" === text || didWarnInvalidHydration || ( didWarnInvalidHydration = ! 0 , error ( 'Expected server HTML to contain a matching text node for "%s" in <%s>.' , text , parentNode . nodeName . toLowerCase ( ) ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
normalizeMarkupForTextOrAttribute = function ( markup ) {
2022-05-04 17:25:28 +03:00
return ( "string" == typeof markup ? markup : "" + markup ) . replace ( NORMALIZE _NEWLINES _REGEX , "\n" ) . replace ( NORMALIZE _NULL _AND _REPLACEMENT _REGEX , "" ) ;
2021-08-04 13:27:17 +03:00
} , warnForTextDifference = function ( serverText , clientText ) {
if ( ! didWarnInvalidHydration ) {
var normalizedClientText = normalizeMarkupForTextOrAttribute ( clientText ) , normalizedServerText = normalizeMarkupForTextOrAttribute ( serverText ) ;
2022-06-15 17:36:57 +03:00
normalizedServerText !== normalizedClientText && ( didWarnInvalidHydration = ! 0 , error ( 'Text content did not match. Server: "%s" Client: "%s"' , normalizedServerText , normalizedClientText ) ) ;
2021-08-04 13:27:17 +03:00
}
} , warnForPropDifference = function ( propName , serverValue , clientValue ) {
if ( ! didWarnInvalidHydration ) {
var normalizedClientValue = normalizeMarkupForTextOrAttribute ( clientValue ) , normalizedServerValue = normalizeMarkupForTextOrAttribute ( serverValue ) ;
2022-06-15 17:36:57 +03:00
normalizedServerValue !== normalizedClientValue && ( didWarnInvalidHydration = ! 0 , error ( "Prop `%s` did not match. Server: %s Client: %s" , propName , JSON . stringify ( normalizedServerValue ) , JSON . stringify ( normalizedClientValue ) ) ) ;
2021-08-04 13:27:17 +03:00
}
} , warnForExtraAttributes = function ( attributeNames ) {
if ( ! didWarnInvalidHydration ) {
didWarnInvalidHydration = ! 0 ;
var names = [ ] ;
attributeNames . forEach ( function ( name ) {
names . push ( name ) ;
2022-06-15 17:36:57 +03:00
} ) , error ( "Extra attributes from the server: %s" , names ) ;
2021-08-04 13:27:17 +03:00
}
} , warnForInvalidEventListener = function ( registrationName , listener ) {
2022-06-15 17:36:57 +03:00
! 1 === listener ? error ( "Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead." , registrationName , registrationName , registrationName ) : error ( "Expected `%s` listener to be a function, instead got a value of `%s` type." , registrationName , typeof listener ) ;
2021-08-04 13:27:17 +03:00
} , normalizeHTML = function ( parent , html ) {
2021-10-27 07:19:14 +03:00
var testElement = parent . namespaceURI === HTML _NAMESPACE$1 ? parent . ownerDocument . createElement ( parent . tagName ) : parent . ownerDocument . createElementNS ( parent . namespaceURI , parent . tagName ) ;
2021-08-04 13:27:17 +03:00
return testElement . innerHTML = html , testElement . innerHTML ;
} ;
2022-01-02 23:54:58 +03:00
var validateDOMNesting = function ( ) { } , updatedAncestorInfo = function ( ) { } , specialTags = [
2022-05-04 17:25:28 +03:00
"address" ,
"applet" ,
"area" ,
"article" ,
"aside" ,
"base" ,
"basefont" ,
"bgsound" ,
"blockquote" ,
"body" ,
"br" ,
"button" ,
"caption" ,
"center" ,
"col" ,
"colgroup" ,
"dd" ,
"details" ,
"dir" ,
"div" ,
"dl" ,
"dt" ,
"embed" ,
"fieldset" ,
"figcaption" ,
"figure" ,
"footer" ,
"form" ,
"frame" ,
"frameset" ,
"h1" ,
"h2" ,
"h3" ,
"h4" ,
"h5" ,
"h6" ,
"head" ,
"header" ,
"hgroup" ,
"hr" ,
"html" ,
"iframe" ,
"img" ,
"input" ,
"isindex" ,
"li" ,
"link" ,
"listing" ,
"main" ,
"marquee" ,
"menu" ,
"menuitem" ,
"meta" ,
"nav" ,
"noembed" ,
"noframes" ,
"noscript" ,
"object" ,
"ol" ,
"p" ,
"param" ,
"plaintext" ,
"pre" ,
"script" ,
"section" ,
"select" ,
"source" ,
"style" ,
"summary" ,
"table" ,
"tbody" ,
"td" ,
"template" ,
"textarea" ,
"tfoot" ,
"th" ,
"thead" ,
"title" ,
"tr" ,
"track" ,
"ul" ,
"wbr" ,
"xmp" ,
2021-08-03 18:52:47 +03:00
] , inScopeTags = [
2022-05-04 17:25:28 +03:00
"applet" ,
"caption" ,
"html" ,
"table" ,
"td" ,
"th" ,
"marquee" ,
"object" ,
"template" ,
"foreignObject" ,
"desc" ,
"title" ,
2021-08-03 18:52:47 +03:00
] , buttonScopeTags = inScopeTags . concat ( [
2022-05-04 17:25:28 +03:00
"button"
2021-08-03 18:52:47 +03:00
] ) , impliedEndTags = [
2022-05-04 17:25:28 +03:00
"dd" ,
"dt" ,
"li" ,
"option" ,
"optgroup" ,
"p" ,
"rp" ,
"rt" ,
2021-08-03 18:52:47 +03:00
] , emptyAncestorInfo = {
2021-07-30 04:11:27 +03:00
current : null ,
formTag : null ,
aTagInScope : null ,
buttonTagInScope : null ,
nobrTagInScope : null ,
pTagInButtonScope : null ,
listItemTagAutoclosing : null ,
dlItemTagAutoclosing : null
2021-08-04 13:27:17 +03:00
} ;
updatedAncestorInfo = function ( oldInfo , tag ) {
2022-01-02 23:54:58 +03:00
var ancestorInfo = _assign ( { } , oldInfo || emptyAncestorInfo ) , info = {
2021-08-04 13:27:17 +03:00
tag : tag
} ;
2022-05-04 17:25:28 +03:00
return - 1 !== inScopeTags . indexOf ( tag ) && ( ancestorInfo . aTagInScope = null , ancestorInfo . buttonTagInScope = null , ancestorInfo . nobrTagInScope = null ) , - 1 !== buttonScopeTags . indexOf ( tag ) && ( ancestorInfo . pTagInButtonScope = null ) , - 1 !== specialTags . indexOf ( tag ) && "address" !== tag && "div" !== tag && "p" !== tag && ( ancestorInfo . listItemTagAutoclosing = null , ancestorInfo . dlItemTagAutoclosing = null ) , ancestorInfo . current = info , "form" === tag && ( ancestorInfo . formTag = info ) , "a" === tag && ( ancestorInfo . aTagInScope = info ) , "button" === tag && ( ancestorInfo . buttonTagInScope = info ) , "nobr" === tag && ( ancestorInfo . nobrTagInScope = info ) , "p" === tag && ( ancestorInfo . pTagInButtonScope = info ) , "li" === tag && ( ancestorInfo . listItemTagAutoclosing = info ) , ( "dd" === tag || "dt" === tag ) && ( ancestorInfo . dlItemTagAutoclosing = info ) , ancestorInfo ;
2021-08-04 13:27:17 +03:00
} ;
var isTagValidWithParent = function ( tag , parentTag ) {
switch ( parentTag ) {
2022-05-04 17:25:28 +03:00
case "select" :
return "option" === tag || "optgroup" === tag || "#text" === tag ;
case "optgroup" :
return "option" === tag || "#text" === tag ;
case "option" :
return "#text" === tag ;
case "tr" :
return "th" === tag || "td" === tag || "style" === tag || "script" === tag || "template" === tag ;
case "tbody" :
case "thead" :
case "tfoot" :
return "tr" === tag || "style" === tag || "script" === tag || "template" === tag ;
case "colgroup" :
return "col" === tag || "template" === tag ;
case "table" :
return "caption" === tag || "colgroup" === tag || "tbody" === tag || "tfoot" === tag || "thead" === tag || "style" === tag || "script" === tag || "template" === tag ;
case "head" :
return "base" === tag || "basefont" === tag || "bgsound" === tag || "link" === tag || "meta" === tag || "title" === tag || "noscript" === tag || "noframes" === tag || "style" === tag || "script" === tag || "template" === tag ;
case "html" :
return "head" === tag || "body" === tag || "frameset" === tag ;
case "frameset" :
return "frame" === tag ;
case "#document" :
return "html" === tag ;
2021-07-30 04:11:27 +03:00
}
switch ( tag ) {
2022-05-04 17:25:28 +03:00
case "h1" :
case "h2" :
case "h3" :
case "h4" :
case "h5" :
case "h6" :
return "h1" !== parentTag && "h2" !== parentTag && "h3" !== parentTag && "h4" !== parentTag && "h5" !== parentTag && "h6" !== parentTag ;
case "rp" :
case "rt" :
2021-08-03 18:52:47 +03:00
return - 1 === impliedEndTags . indexOf ( parentTag ) ;
2022-05-04 17:25:28 +03:00
case "body" :
case "caption" :
case "col" :
case "colgroup" :
case "frameset" :
case "frame" :
case "head" :
case "html" :
case "tbody" :
case "td" :
case "tfoot" :
case "th" :
case "thead" :
case "tr" :
2021-08-03 18:52:47 +03:00
return null == parentTag ;
2021-07-30 04:11:27 +03:00
}
return ! 0 ;
} , findInvalidAncestorForTag = function ( tag , ancestorInfo ) {
switch ( tag ) {
2022-05-04 17:25:28 +03:00
case "address" :
case "article" :
case "aside" :
case "blockquote" :
case "center" :
case "details" :
case "dialog" :
case "dir" :
case "div" :
case "dl" :
case "fieldset" :
case "figcaption" :
case "figure" :
case "footer" :
case "header" :
case "hgroup" :
case "main" :
case "menu" :
case "nav" :
case "ol" :
case "p" :
case "section" :
case "summary" :
case "ul" :
case "pre" :
case "listing" :
case "table" :
case "hr" :
case "xmp" :
case "h1" :
case "h2" :
case "h3" :
case "h4" :
case "h5" :
case "h6" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . pTagInButtonScope ;
2022-05-04 17:25:28 +03:00
case "form" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . formTag || ancestorInfo . pTagInButtonScope ;
2022-05-04 17:25:28 +03:00
case "li" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . listItemTagAutoclosing ;
2022-05-04 17:25:28 +03:00
case "dd" :
case "dt" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . dlItemTagAutoclosing ;
2022-05-04 17:25:28 +03:00
case "button" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . buttonTagInScope ;
2022-05-04 17:25:28 +03:00
case "a" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . aTagInScope ;
2022-05-04 17:25:28 +03:00
case "nobr" :
2021-08-03 18:52:47 +03:00
return ancestorInfo . nobrTagInScope ;
2021-07-30 04:11:27 +03:00
}
return null ;
2022-01-02 23:54:58 +03:00
} , didWarn$1 = { } ;
2021-08-04 13:27:17 +03:00
validateDOMNesting = function ( childTag , childText , ancestorInfo ) {
2022-08-26 13:06:25 +03:00
ancestorInfo = ancestorInfo || emptyAncestorInfo ;
var parentInfo = ancestorInfo . current , parentTag = parentInfo && parentInfo . tag ;
2022-06-15 17:36:57 +03:00
null != childText && ( null != childTag && error ( "validateDOMNesting: when childText is passed, childTag should be null" ) , childTag = "#text" ) ;
2021-08-04 13:27:17 +03:00
var invalidParent = isTagValidWithParent ( childTag , parentTag ) ? null : parentInfo , invalidAncestor = invalidParent ? null : findInvalidAncestorForTag ( childTag , ancestorInfo ) , invalidParentOrAncestor = invalidParent || invalidAncestor ;
if ( invalidParentOrAncestor ) {
2022-05-04 17:25:28 +03:00
var ancestorTag = invalidParentOrAncestor . tag , warnKey = ! ! invalidParent + "|" + childTag + "|" + ancestorTag ;
2021-08-04 13:27:17 +03:00
if ( ! didWarn$1 [ warnKey ] ) {
didWarn$1 [ warnKey ] = ! 0 ;
2022-05-04 17:25:28 +03:00
var tagDisplayName = childTag , whitespaceInfo = "" ;
if ( "#text" === childTag ? /\S/ . test ( childText ) ? tagDisplayName = "Text nodes" : ( tagDisplayName = "Whitespace text nodes" , whitespaceInfo = " Make sure you don't have any extra whitespace between tags on each line of your source code." ) : tagDisplayName = "<" + childTag + ">" , invalidParent ) {
var info = "" ;
2022-06-15 17:36:57 +03:00
"table" === ancestorTag && "tr" === childTag && ( info += " Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser." ) , error ( "validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s" , tagDisplayName , ancestorTag , whitespaceInfo , info ) ;
} else error ( "validateDOMNesting(...): %s cannot appear as a descendant of <%s>." , tagDisplayName , ancestorTag ) ;
2021-08-04 13:27:17 +03:00
}
}
2022-05-04 17:25:28 +03:00
} , SUPPRESS _HYDRATION _WARNING$1 = "suppressHydrationWarning" ;
2021-08-04 13:27:17 +03:00
var eventsEnabled = null , selectionInformation = null ;
2021-07-30 04:11:27 +03:00
function shouldAutoFocusHostComponent ( type , props ) {
switch ( type ) {
2022-05-04 17:25:28 +03:00
case "button" :
case "input" :
case "select" :
case "textarea" :
2021-08-03 18:52:47 +03:00
return ! ! props . autoFocus ;
2021-07-30 04:11:27 +03:00
}
return ! 1 ;
}
function appendInitialChild ( parentInstance , child ) {
parentInstance . appendChild ( child ) ;
}
function shouldSetTextContent ( type , props ) {
2022-05-04 17:25:28 +03:00
return "textarea" === type || "option" === type || "noscript" === type || "string" == typeof props . children || "number" == typeof props . children || "object" == typeof props . dangerouslySetInnerHTML && null !== props . dangerouslySetInnerHTML && null != props . dangerouslySetInnerHTML . _ _html ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var scheduleTimeout = "function" == typeof setTimeout ? setTimeout : void 0 , cancelTimeout = "function" == typeof clearTimeout ? clearTimeout : void 0 ;
2021-07-30 04:11:27 +03:00
function resetTextContent ( domElement ) {
2022-05-04 17:25:28 +03:00
setTextContent ( domElement , "" ) ;
2021-07-30 04:11:27 +03:00
}
function removeChild ( parentInstance , child ) {
parentInstance . removeChild ( child ) ;
}
function removeChildFromContainer ( container , child ) {
8 === container . nodeType ? container . parentNode . removeChild ( child ) : container . removeChild ( child ) ;
}
function hideInstance ( instance ) {
2022-02-11 11:43:48 +03:00
var style = instance . style ;
2022-05-04 17:25:28 +03:00
"function" == typeof style . setProperty ? style . setProperty ( "display" , "none" , "important" ) : style . display = "none" ;
2021-07-30 04:11:27 +03:00
}
function hideTextInstance ( textInstance ) {
2022-05-04 17:25:28 +03:00
textInstance . nodeValue = "" ;
2021-07-30 04:11:27 +03:00
}
function unhideInstance ( instance , props ) {
2022-05-04 17:25:28 +03:00
var styleProp = props . style , display = null != styleProp && styleProp . hasOwnProperty ( "display" ) ? styleProp . display : null ;
instance . style . display = dangerousStyleValue ( "display" , display ) ;
2021-07-30 04:11:27 +03:00
}
function unhideTextInstance ( textInstance , text ) {
textInstance . nodeValue = text ;
}
function clearContainer ( container ) {
2022-05-04 17:25:28 +03:00
if ( 1 === container . nodeType ) container . textContent = "" ;
2021-07-30 04:11:27 +03:00
else if ( 9 === container . nodeType ) {
var body = container . body ;
2022-05-04 17:25:28 +03:00
null != body && ( body . textContent = "" ) ;
2021-07-30 04:11:27 +03:00
}
}
function isSuspenseInstancePending ( instance ) {
2022-05-04 17:25:28 +03:00
return "$?" === instance . data ;
2021-07-30 04:11:27 +03:00
}
function isSuspenseInstanceFallback ( instance ) {
2022-05-04 17:25:28 +03:00
return "$!" === instance . data ;
2021-07-30 04:11:27 +03:00
}
function getNextHydratable ( node ) {
for ( ; null != node ; node = node . nextSibling ) {
var nodeType = node . nodeType ;
if ( 1 === nodeType || 3 === nodeType ) break ;
}
return node ;
}
function getNextHydratableSibling ( instance ) {
return getNextHydratable ( instance . nextSibling ) ;
}
function getFirstHydratableChild ( parentInstance ) {
return getNextHydratable ( parentInstance . firstChild ) ;
}
function getParentSuspenseInstance ( targetInstance ) {
for ( var node = targetInstance . previousSibling , depth = 0 ; node ; ) {
if ( 8 === node . nodeType ) {
var data = node . data ;
2022-05-04 17:25:28 +03:00
if ( "$" === data || "$!" === data || "$?" === data ) {
2021-07-30 04:11:27 +03:00
if ( 0 === depth ) return node ;
depth -- ;
2022-05-04 17:25:28 +03:00
} else "/$" === data && depth ++ ;
2021-07-30 04:11:27 +03:00
}
node = node . previousSibling ;
}
return null ;
}
var clientId = 0 ;
function makeClientIdInDEV ( warnOnAccessInDEV ) {
2022-05-04 17:25:28 +03:00
var id = "r:" + ( clientId ++ ) . toString ( 36 ) ;
2021-07-30 04:11:27 +03:00
return {
toString : function ( ) {
return warnOnAccessInDEV ( ) , id ;
} ,
valueOf : function ( ) {
return warnOnAccessInDEV ( ) , id ;
}
} ;
}
function isOpaqueHydratingObject ( value ) {
2022-05-04 17:25:28 +03:00
return null !== value && "object" == typeof value && value . $$typeof === REACT _OPAQUE _ID _TYPE ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
var randomKey = Math . random ( ) . toString ( 36 ) . slice ( 2 ) , internalInstanceKey = "__reactFiber$" + randomKey , internalPropsKey = "__reactProps$" + randomKey , internalContainerInstanceKey = "__reactContainer$" + randomKey , internalEventHandlersKey = "__reactEvents$" + randomKey ;
2021-07-30 04:11:27 +03:00
function unmarkContainerAsRoot ( node ) {
node [ internalContainerInstanceKey ] = null ;
}
function isContainerMarkedAsRoot ( node ) {
return ! ! node [ internalContainerInstanceKey ] ;
}
function getClosestInstanceFromNode ( targetNode ) {
var targetInst = targetNode [ internalInstanceKey ] ;
if ( targetInst ) return targetInst ;
for ( var parentNode = targetNode . parentNode ; parentNode ; ) {
if ( targetInst = parentNode [ internalContainerInstanceKey ] || parentNode [ internalInstanceKey ] ) {
var alternate = targetInst . alternate ;
if ( null !== targetInst . child || null !== alternate && null !== alternate . child ) for ( var suspenseInstance = getParentSuspenseInstance ( targetNode ) ; null !== suspenseInstance ; ) {
var targetSuspenseInst = suspenseInstance [ internalInstanceKey ] ;
if ( targetSuspenseInst ) return targetSuspenseInst ;
suspenseInstance = getParentSuspenseInstance ( suspenseInstance ) ;
}
return targetInst ;
}
parentNode = ( targetNode = parentNode ) . parentNode ;
}
return null ;
}
function getInstanceFromNode ( node ) {
var inst = node [ internalInstanceKey ] || node [ internalContainerInstanceKey ] ;
return inst && ( 5 === inst . tag || 6 === inst . tag || 13 === inst . tag || 3 === inst . tag ) ? inst : null ;
}
function getNodeFromInstance ( inst ) {
if ( 5 === inst . tag || 6 === inst . tag ) return inst . stateNode ;
throw Error ( "getNodeFromInstance: Invalid argument." ) ;
}
function getFiberCurrentPropsFromNode ( node ) {
return node [ internalPropsKey ] || null ;
}
function getEventListenerSet ( node ) {
var elementListenerSet = node [ internalEventHandlersKey ] ;
return void 0 === elementListenerSet && ( elementListenerSet = node [ internalEventHandlersKey ] = new Set ( ) ) , elementListenerSet ;
}
2022-01-02 23:54:58 +03:00
var loggedTypeFailures = { } , ReactDebugCurrentFrame$1 = ReactSharedInternals . ReactDebugCurrentFrame ;
2021-07-30 04:11:27 +03:00
function setCurrentlyValidatingElement ( element ) {
if ( element ) {
2022-08-18 02:24:10 +03:00
var owner = element . _owner , stack = function describeUnknownElementTypeFrameInDEV ( type , source , ownerFn ) {
if ( null == type ) return "" ;
if ( "function" == typeof type ) return describeNativeComponentFrame ( type , ! ! ( ( prototype = type . prototype ) && prototype . isReactComponent ) ) ;
if ( "string" == typeof type ) return describeBuiltInComponentFrame ( type ) ;
switch ( type ) {
case REACT _SUSPENSE _TYPE :
return describeBuiltInComponentFrame ( "Suspense" ) ;
case REACT _SUSPENSE _LIST _TYPE :
return describeBuiltInComponentFrame ( "SuspenseList" ) ;
}
if ( "object" == typeof type ) switch ( type . $$typeof ) {
case REACT _FORWARD _REF _TYPE :
return describeNativeComponentFrame ( type . render , ! 1 ) ;
case REACT _MEMO _TYPE :
return describeUnknownElementTypeFrameInDEV ( type . type , source , ownerFn ) ;
case REACT _BLOCK _TYPE :
return describeNativeComponentFrame ( type . _render , ! 1 ) ;
case REACT _LAZY _TYPE :
var Component , prototype , fn , fn1 , lazyComponent = type , payload = lazyComponent . _payload , init = lazyComponent . _init ;
try {
return describeUnknownElementTypeFrameInDEV ( init ( payload ) , source , ownerFn ) ;
} catch ( x ) { }
}
return "" ;
} ( element . type , element . _source , owner ? owner . type : null ) ;
2021-07-30 04:11:27 +03:00
ReactDebugCurrentFrame$1 . setExtraStackFrame ( stack ) ;
} else ReactDebugCurrentFrame$1 . setExtraStackFrame ( null ) ;
}
function checkPropTypes ( typeSpecs , values , location , componentName , element ) {
var has = Function . call . bind ( Object . prototype . hasOwnProperty ) ;
for ( var typeSpecName in typeSpecs ) if ( has ( typeSpecs , typeSpecName ) ) {
var error$1 = void 0 ;
try {
2022-05-04 17:25:28 +03:00
if ( "function" != typeof typeSpecs [ typeSpecName ] ) {
var err = Error ( ( componentName || "React class" ) + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs [ typeSpecName ] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." ) ;
throw err . name = "Invariant Violation" , err ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
error$1 = typeSpecs [ typeSpecName ] ( values , typeSpecName , componentName , location , null , "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED" ) ;
2021-07-30 04:11:27 +03:00
} catch ( ex ) {
error$1 = ex ;
}
2022-06-15 17:36:57 +03:00
! error$1 || error$1 instanceof Error || ( setCurrentlyValidatingElement ( element ) , error ( "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)." , componentName || "React class" , location , typeSpecName , typeof error$1 ) , setCurrentlyValidatingElement ( null ) ) , error$1 instanceof Error && ! ( error$1 . message in loggedTypeFailures ) && ( loggedTypeFailures [ error$1 . message ] = ! 0 , setCurrentlyValidatingElement ( element ) , error ( "Failed %s type: %s" , location , error$1 . message ) , setCurrentlyValidatingElement ( null ) ) ;
2021-07-30 04:11:27 +03:00
}
}
2021-08-07 11:27:52 +03:00
var valueStack = [ ] ;
2021-08-04 13:27:17 +03:00
fiberStack = [ ] ;
2022-06-15 17:36:57 +03:00
var index = - 1 ;
2021-07-30 04:11:27 +03:00
function createCursor ( defaultValue ) {
return {
current : defaultValue
} ;
}
function pop ( cursor , fiber ) {
2022-06-15 17:36:57 +03:00
if ( index < 0 ) {
error ( "Unexpected pop." ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-06-15 17:36:57 +03:00
fiber !== fiberStack [ index ] && error ( "Unexpected Fiber popped." ) , cursor . current = valueStack [ index ] , valueStack [ index ] = null , fiberStack [ index ] = null , index -- ;
2021-07-30 04:11:27 +03:00
}
function push ( cursor , value , fiber ) {
2022-06-15 17:36:57 +03:00
valueStack [ ++ index ] = cursor . current , fiberStack [ index ] = fiber , cursor . current = value ;
2021-07-30 04:11:27 +03:00
}
2022-01-02 23:54:58 +03:00
warnedAboutMissingGetChildContext = { } ;
var emptyContextObject = { } ;
2021-08-04 13:27:17 +03:00
Object . freeze ( emptyContextObject ) ;
var contextStackCursor = createCursor ( emptyContextObject ) , didPerformWorkStackCursor = createCursor ( ! 1 ) , previousContext = emptyContextObject ;
2021-07-30 04:11:27 +03:00
function getUnmaskedContext ( workInProgress , Component , didPushOwnContextIfProvider ) {
return didPushOwnContextIfProvider && isContextProvider ( Component ) ? previousContext : contextStackCursor . current ;
}
function cacheContext ( workInProgress , unmaskedContext , maskedContext ) {
var instance = workInProgress . stateNode ;
instance . _ _reactInternalMemoizedUnmaskedChildContext = unmaskedContext , instance . _ _reactInternalMemoizedMaskedChildContext = maskedContext ;
}
function getMaskedContext ( workInProgress , unmaskedContext ) {
var type = workInProgress . type , contextTypes = type . contextTypes ;
if ( ! contextTypes ) return emptyContextObject ;
var instance = workInProgress . stateNode ;
if ( instance && instance . _ _reactInternalMemoizedUnmaskedChildContext === unmaskedContext ) return instance . _ _reactInternalMemoizedMaskedChildContext ;
2022-01-02 23:54:58 +03:00
var context = { } ;
2021-07-30 04:11:27 +03:00
for ( var key in contextTypes ) context [ key ] = unmaskedContext [ key ] ;
2022-08-26 11:45:49 +03:00
var name = getComponentName ( type ) || "Unknown" ;
return checkPropTypes ( contextTypes , context , "context" , name ) , instance && cacheContext ( workInProgress , unmaskedContext , context ) , context ;
2021-07-30 04:11:27 +03:00
}
function hasContextChanged ( ) {
return didPerformWorkStackCursor . current ;
}
function isContextProvider ( type ) {
2022-04-29 08:58:59 +03:00
var childContextTypes ;
2021-07-30 04:11:27 +03:00
return null != type . childContextTypes ;
}
function popContext ( fiber ) {
pop ( didPerformWorkStackCursor , fiber ) , pop ( contextStackCursor , fiber ) ;
}
function popTopLevelContextObject ( fiber ) {
pop ( didPerformWorkStackCursor , fiber ) , pop ( contextStackCursor , fiber ) ;
}
function pushTopLevelContextObject ( fiber , context , didChange ) {
if ( contextStackCursor . current !== emptyContextObject ) throw Error ( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." ) ;
push ( contextStackCursor , context , fiber ) , push ( didPerformWorkStackCursor , didChange , fiber ) ;
}
function processChildContext ( fiber , type , parentContext ) {
var instance = fiber . stateNode , childContextTypes = type . childContextTypes ;
2022-05-04 17:25:28 +03:00
if ( "function" != typeof instance . getChildContext ) {
var componentName = getComponentName ( type ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
return warnedAboutMissingGetChildContext [ componentName ] || ( warnedAboutMissingGetChildContext [ componentName ] = ! 0 , error ( "%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it." , componentName , componentName ) ) , parentContext ;
2021-07-30 04:11:27 +03:00
}
var childContext = instance . getChildContext ( ) ;
2022-05-04 17:25:28 +03:00
for ( var contextKey in childContext ) if ( ! ( contextKey in childContextTypes ) ) throw Error ( ( getComponentName ( type ) || "Unknown" ) + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.' ) ;
2022-08-26 11:45:49 +03:00
var name = getComponentName ( type ) || "Unknown" ;
return checkPropTypes ( childContextTypes , childContext , "child context" , name ) , _assign ( { } , parentContext , childContext ) ;
2021-07-30 04:11:27 +03:00
}
function pushContextProvider ( workInProgress ) {
var instance = workInProgress . stateNode , memoizedMergedChildContext = instance && instance . _ _reactInternalMemoizedMergedChildContext || emptyContextObject ;
return previousContext = contextStackCursor . current , push ( contextStackCursor , memoizedMergedChildContext , workInProgress ) , push ( didPerformWorkStackCursor , didPerformWorkStackCursor . current , workInProgress ) , ! 0 ;
}
function invalidateContextProvider ( workInProgress , type , didChange ) {
var instance = workInProgress . stateNode ;
if ( ! instance ) throw Error ( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." ) ;
if ( didChange ) {
var mergedContext = processChildContext ( workInProgress , type , previousContext ) ;
instance . _ _reactInternalMemoizedMergedChildContext = mergedContext , pop ( didPerformWorkStackCursor , workInProgress ) , pop ( contextStackCursor , workInProgress ) , push ( contextStackCursor , mergedContext , workInProgress ) , push ( didPerformWorkStackCursor , didChange , workInProgress ) ;
} else pop ( didPerformWorkStackCursor , workInProgress ) , push ( didPerformWorkStackCursor , didChange , workInProgress ) ;
}
2022-05-04 17:25:28 +03:00
var rendererID = null , injectedHook = null , hasLoggedError = ! 1 , isDevToolsPresent = "undefined" != typeof _ _REACT _DEVTOOLS _GLOBAL _HOOK _ _ , Scheduler _runWithPriority = unstable _runWithPriority , Scheduler _scheduleCallback = unstable _scheduleCallback , Scheduler _cancelCallback = unstable _cancelCallback , Scheduler _requestPaint = unstable _requestPaint , Scheduler _now$1 = unstable _now , Scheduler _getCurrentPriorityLevel = unstable _getCurrentPriorityLevel , Scheduler _ImmediatePriority = unstable _ImmediatePriority , Scheduler _UserBlockingPriority = unstable _UserBlockingPriority , Scheduler _NormalPriority = unstable _NormalPriority , Scheduler _LowPriority = unstable _LowPriority , Scheduler _IdlePriority = unstable _IdlePriority ;
2021-08-04 13:27:17 +03:00
if ( ! ( null != _ _interactionsRef && null != _ _interactionsRef . current ) ) throw Error ( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https://reactjs.org/link/profiling" ) ;
2022-08-26 11:45:49 +03:00
var fakeCallbackNode = { } , NormalPriority$1 = 97 , shouldYield = unstable _shouldYield , requestPaint = void 0 !== Scheduler _requestPaint ? Scheduler _requestPaint : function ( ) { } , syncQueue = null , immediateQueueCallbackNode = null , isFlushingSyncQueue = ! 1 , initialTimeMs$1 = Scheduler _now$1 ( ) , now = initialTimeMs$1 < 10000 ? Scheduler _now$1 : function ( ) {
2021-07-30 04:11:27 +03:00
return Scheduler _now$1 ( ) - initialTimeMs$1 ;
} ;
function getCurrentPriorityLevel ( ) {
switch ( Scheduler _getCurrentPriorityLevel ( ) ) {
2021-08-03 18:52:47 +03:00
case Scheduler _ImmediatePriority :
return 99 ;
case Scheduler _UserBlockingPriority :
return 98 ;
case Scheduler _NormalPriority :
2022-08-26 11:45:49 +03:00
return NormalPriority$1 ;
2021-08-03 18:52:47 +03:00
case Scheduler _LowPriority :
return 96 ;
case Scheduler _IdlePriority :
return 95 ;
default :
throw Error ( "Unknown priority level." ) ;
2021-07-30 04:11:27 +03:00
}
}
function reactPriorityToSchedulerPriority ( reactPriorityLevel ) {
switch ( reactPriorityLevel ) {
2021-08-03 18:52:47 +03:00
case 99 :
return Scheduler _ImmediatePriority ;
case 98 :
return Scheduler _UserBlockingPriority ;
2022-08-26 11:45:49 +03:00
case NormalPriority$1 :
2021-08-03 18:52:47 +03:00
return Scheduler _NormalPriority ;
case 96 :
return Scheduler _LowPriority ;
case 95 :
return Scheduler _IdlePriority ;
default :
throw Error ( "Unknown priority level." ) ;
2021-07-30 04:11:27 +03:00
}
}
function runWithPriority$1 ( reactPriorityLevel , fn ) {
2022-08-26 13:06:25 +03:00
return Scheduler _runWithPriority ( reactPriorityToSchedulerPriority ( reactPriorityLevel ) , fn ) ;
2021-07-30 04:11:27 +03:00
}
function scheduleCallback ( reactPriorityLevel , callback , options ) {
2022-08-26 13:06:25 +03:00
return Scheduler _scheduleCallback ( reactPriorityToSchedulerPriority ( reactPriorityLevel ) , callback , options ) ;
2021-07-30 04:11:27 +03:00
}
function cancelCallback ( callbackNode ) {
callbackNode !== fakeCallbackNode && Scheduler _cancelCallback ( callbackNode ) ;
}
function flushSyncCallbackQueue ( ) {
2021-08-15 16:09:21 +03:00
if ( null !== immediateQueueCallbackNode ) {
var node = immediateQueueCallbackNode ;
immediateQueueCallbackNode = null , Scheduler _cancelCallback ( node ) ;
}
flushSyncCallbackQueueImpl ( ) ;
2021-07-30 04:11:27 +03:00
}
function flushSyncCallbackQueueImpl ( ) {
if ( ! isFlushingSyncQueue && null !== syncQueue ) {
isFlushingSyncQueue = ! 0 ;
var i = 0 ;
try {
2022-08-05 16:25:28 +03:00
var _queue = syncQueue ;
2021-07-30 04:11:27 +03:00
runWithPriority$1 ( 99 , function ( ) {
for ( ; i < _queue . length ; i ++ ) {
var callback = _queue [ i ] ;
2022-08-05 16:25:28 +03:00
do callback = callback ( ! 0 ) ;
2021-07-30 04:11:27 +03:00
while ( null !== callback )
}
} ) , syncQueue = null ;
} catch ( error ) {
throw null !== syncQueue && ( syncQueue = syncQueue . slice ( i + 1 ) ) , Scheduler _scheduleCallback ( Scheduler _ImmediatePriority , flushSyncCallbackQueue ) , error ;
} finally {
isFlushingSyncQueue = ! 1 ;
}
}
}
2022-05-04 17:25:28 +03:00
var ReactVersion = "17.0.2" , ReactCurrentBatchConfig = ReactSharedInternals . ReactCurrentBatchConfig , ReactStrictModeWarnings = {
2022-01-02 23:54:58 +03:00
recordUnsafeLifecycleWarnings : function ( fiber , instance ) { } ,
flushPendingUnsafeLifecycleWarnings : function ( ) { } ,
recordLegacyContextWarning : function ( fiber , instance ) { } ,
flushLegacyContextWarning : function ( ) { } ,
discardPendingWarnings : function ( ) { }
2021-07-30 04:11:27 +03:00
} , findStrictRoot = function ( fiber ) {
for ( var maybeStrictRoot = null , node = fiber ; null !== node ; ) 1 & node . mode && ( maybeStrictRoot = node ) , node = node . return ;
return maybeStrictRoot ;
} , setToSortedString = function ( set ) {
var array = [ ] ;
return set . forEach ( function ( value ) {
array . push ( value ) ;
2022-05-04 17:25:28 +03:00
} ) , array . sort ( ) . join ( ", " ) ;
2021-08-04 13:27:17 +03:00
} , pendingComponentWillMountWarnings = [ ] , pendingUNSAFE _ComponentWillMountWarnings = [ ] , pendingComponentWillReceivePropsWarnings = [ ] , pendingUNSAFE _ComponentWillReceivePropsWarnings = [ ] , pendingComponentWillUpdateWarnings = [ ] , pendingUNSAFE _ComponentWillUpdateWarnings = [ ] , didWarnAboutUnsafeLifecycles = new Set ( ) ;
ReactStrictModeWarnings . recordUnsafeLifecycleWarnings = function ( fiber , instance ) {
2022-05-04 17:25:28 +03:00
! didWarnAboutUnsafeLifecycles . has ( fiber . type ) && ( "function" == typeof instance . componentWillMount && ! 0 !== instance . componentWillMount . _ _suppressDeprecationWarning && pendingComponentWillMountWarnings . push ( fiber ) , 1 & fiber . mode && "function" == typeof instance . UNSAFE _componentWillMount && pendingUNSAFE _ComponentWillMountWarnings . push ( fiber ) , "function" == typeof instance . componentWillReceiveProps && ! 0 !== instance . componentWillReceiveProps . _ _suppressDeprecationWarning && pendingComponentWillReceivePropsWarnings . push ( fiber ) , 1 & fiber . mode && "function" == typeof instance . UNSAFE _componentWillReceiveProps && pendingUNSAFE _ComponentWillReceivePropsWarnings . push ( fiber ) , "function" == typeof instance . componentWillUpdate && ! 0 !== instance . componentWillUpdate . _ _suppressDeprecationWarning && pendingComponentWillUpdateWarnings . push ( fiber ) , 1 & fiber . mode && "function" == typeof instance . UNSAFE _componentWillUpdate && pendingUNSAFE _ComponentWillUpdateWarnings . push ( fiber ) ) ;
2021-08-04 13:27:17 +03:00
} , ReactStrictModeWarnings . flushPendingUnsafeLifecycleWarnings = function ( ) {
2022-07-06 06:53:11 +03:00
var componentWillMountUniqueNames = new Set ( ) ;
2021-08-04 13:27:17 +03:00
pendingComponentWillMountWarnings . length > 0 && ( pendingComponentWillMountWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
componentWillMountUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) , pendingComponentWillMountWarnings = [ ] ) ;
var UNSAFE _componentWillMountUniqueNames = new Set ( ) ;
pendingUNSAFE _ComponentWillMountWarnings . length > 0 && ( pendingUNSAFE _ComponentWillMountWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
UNSAFE _componentWillMountUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) , pendingUNSAFE _ComponentWillMountWarnings = [ ] ) ;
var componentWillReceivePropsUniqueNames = new Set ( ) ;
pendingComponentWillReceivePropsWarnings . length > 0 && ( pendingComponentWillReceivePropsWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
componentWillReceivePropsUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) , pendingComponentWillReceivePropsWarnings = [ ] ) ;
var UNSAFE _componentWillReceivePropsUniqueNames = new Set ( ) ;
pendingUNSAFE _ComponentWillReceivePropsWarnings . length > 0 && ( pendingUNSAFE _ComponentWillReceivePropsWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
UNSAFE _componentWillReceivePropsUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) , pendingUNSAFE _ComponentWillReceivePropsWarnings = [ ] ) ;
var componentWillUpdateUniqueNames = new Set ( ) ;
pendingComponentWillUpdateWarnings . length > 0 && ( pendingComponentWillUpdateWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
componentWillUpdateUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) , pendingComponentWillUpdateWarnings = [ ] ) ;
var UNSAFE _componentWillUpdateUniqueNames = new Set ( ) ;
2022-08-26 11:45:49 +03:00
if ( pendingUNSAFE _ComponentWillUpdateWarnings . length > 0 && ( pendingUNSAFE _ComponentWillUpdateWarnings . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
UNSAFE _componentWillUpdateUniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutUnsafeLifecycles . add ( fiber . type ) ;
2022-08-26 11:45:49 +03:00
} ) , pendingUNSAFE _ComponentWillUpdateWarnings = [ ] ) , UNSAFE _componentWillMountUniqueNames . size > 0 ) {
var sortedNames = setToSortedString ( UNSAFE _componentWillMountUniqueNames ) ;
error ( "Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n\nPlease update the following components: %s" , sortedNames ) ;
}
if ( UNSAFE _componentWillReceivePropsUniqueNames . size > 0 ) {
var _sortedNames = setToSortedString ( UNSAFE _componentWillReceivePropsUniqueNames ) ;
error ( "Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n\nPlease update the following components: %s" , _sortedNames ) ;
}
if ( UNSAFE _componentWillUpdateUniqueNames . size > 0 ) {
var _sortedNames2 = setToSortedString ( UNSAFE _componentWillUpdateUniqueNames ) ;
error ( "Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n\nPlease update the following components: %s" , _sortedNames2 ) ;
}
if ( componentWillMountUniqueNames . size > 0 ) {
var _sortedNames3 = setToSortedString ( componentWillMountUniqueNames ) ;
warn ( "componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code with side effects to componentDidMount, and set initial state in the constructor.\n* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s" , _sortedNames3 ) ;
}
if ( componentWillReceivePropsUniqueNames . size > 0 ) {
var _sortedNames4 = setToSortedString ( componentWillReceivePropsUniqueNames ) ;
warn ( "componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s" , _sortedNames4 ) ;
}
if ( componentWillUpdateUniqueNames . size > 0 ) {
var _sortedNames5 = setToSortedString ( componentWillUpdateUniqueNames ) ;
warn ( "componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move data fetching code or side effects to componentDidUpdate.\n* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n\nPlease update the following components: %s" , _sortedNames5 ) ;
}
2021-08-04 13:27:17 +03:00
} ;
var pendingLegacyContextWarning = new Map ( ) , didWarnAboutLegacyContext = new Set ( ) ;
2021-07-30 04:11:27 +03:00
function resolveDefaultProps ( Component , baseProps ) {
if ( Component && Component . defaultProps ) {
2022-01-02 23:54:58 +03:00
var props = _assign ( { } , baseProps ) , defaultProps = Component . defaultProps ;
2021-07-30 04:11:27 +03:00
for ( var propName in defaultProps ) void 0 === props [ propName ] && ( props [ propName ] = defaultProps [ propName ] ) ;
return props ;
}
return baseProps ;
}
2021-08-04 13:27:17 +03:00
ReactStrictModeWarnings . recordLegacyContextWarning = function ( fiber , instance ) {
var strictRoot = findStrictRoot ( fiber ) ;
2021-09-16 07:23:33 +03:00
if ( null === strictRoot ) {
2022-06-15 17:36:57 +03:00
error ( "Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue." ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-08-04 13:27:17 +03:00
if ( ! didWarnAboutLegacyContext . has ( fiber . type ) ) {
var warningsForRoot = pendingLegacyContextWarning . get ( strictRoot ) ;
2022-05-04 17:25:28 +03:00
( null != fiber . type . contextTypes || null != fiber . type . childContextTypes || null !== instance && "function" == typeof instance . getChildContext ) && ( void 0 === warningsForRoot && ( warningsForRoot = [ ] , pendingLegacyContextWarning . set ( strictRoot , warningsForRoot ) ) , warningsForRoot . push ( fiber ) ) ;
2021-08-04 13:27:17 +03:00
}
} , ReactStrictModeWarnings . flushLegacyContextWarning = function ( ) {
pendingLegacyContextWarning . forEach ( function ( fiberArray , strictRoot ) {
if ( 0 !== fiberArray . length ) {
var firstFiber = fiberArray [ 0 ] , uniqueNames = new Set ( ) ;
fiberArray . forEach ( function ( fiber ) {
2022-05-04 17:25:28 +03:00
uniqueNames . add ( getComponentName ( fiber . type ) || "Component" ) , didWarnAboutLegacyContext . add ( fiber . type ) ;
2021-08-04 13:27:17 +03:00
} ) ;
var sortedNames = setToSortedString ( uniqueNames ) ;
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( firstFiber ) , error ( "Legacy context API has been detected within a strict-mode tree.\n\nThe old API will be supported in all 16.x releases, but applications using it should migrate to the new version.\n\nPlease update the following components: %s\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context" , sortedNames ) ;
2021-08-04 13:27:17 +03:00
} finally {
resetCurrentFiber ( ) ;
}
}
} ) ;
} , ReactStrictModeWarnings . discardPendingWarnings = function ( ) {
pendingComponentWillMountWarnings = [ ] , pendingUNSAFE _ComponentWillMountWarnings = [ ] , pendingComponentWillReceivePropsWarnings = [ ] , pendingUNSAFE _ComponentWillReceivePropsWarnings = [ ] , pendingComponentWillUpdateWarnings = [ ] , pendingUNSAFE _ComponentWillUpdateWarnings = [ ] , pendingLegacyContextWarning = new Map ( ) ;
} ;
2021-08-07 11:27:52 +03:00
var valueCursor = createCursor ( null ) ;
2022-01-02 23:54:58 +03:00
rendererSigil = { } ;
2021-08-04 13:27:17 +03:00
var currentlyRenderingFiber = null , lastContextDependency = null , lastContextWithAllBitsObserved = null , isDisallowedContextReadInDEV = ! 1 ;
2021-07-30 04:11:27 +03:00
function resetContextDependencies ( ) {
currentlyRenderingFiber = null , lastContextDependency = null , lastContextWithAllBitsObserved = null , isDisallowedContextReadInDEV = ! 1 ;
}
function enterDisallowedContextReadInDEV ( ) {
isDisallowedContextReadInDEV = ! 0 ;
}
function exitDisallowedContextReadInDEV ( ) {
isDisallowedContextReadInDEV = ! 1 ;
}
function pushProvider ( providerFiber , nextValue ) {
var context = providerFiber . type . _context ;
2022-06-15 17:36:57 +03:00
push ( valueCursor , context . _currentValue , providerFiber ) , context . _currentValue = nextValue , void 0 !== context . _currentRenderer && null !== context . _currentRenderer && context . _currentRenderer !== rendererSigil && error ( "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." ) , context . _currentRenderer = rendererSigil ;
2021-07-30 04:11:27 +03:00
}
function popProvider ( providerFiber ) {
var currentValue = valueCursor . current ;
2022-08-26 13:06:25 +03:00
pop ( valueCursor , providerFiber ) , providerFiber . type . _context . _currentValue = currentValue ;
2021-07-30 04:11:27 +03:00
}
function scheduleWorkOnParentPath ( parent , renderLanes ) {
for ( var node = parent ; null !== node ; ) {
2022-04-29 08:58:59 +03:00
var a , b , a1 , b1 , a2 , b2 , alternate = node . alternate ;
if ( isSubsetOfLanes ( node . childLanes , renderLanes ) ) {
if ( null === alternate || isSubsetOfLanes ( alternate . childLanes , renderLanes ) ) break ;
alternate . childLanes = ( a = alternate . childLanes ) | renderLanes ;
} else node . childLanes = ( a1 = node . childLanes ) | renderLanes , null !== alternate && ( alternate . childLanes = ( a2 = alternate . childLanes ) | renderLanes ) ;
2021-07-30 04:11:27 +03:00
node = node . return ;
}
}
function prepareToReadContext ( workInProgress , renderLanes ) {
currentlyRenderingFiber = workInProgress , lastContextDependency = null , lastContextWithAllBitsObserved = null ;
2022-08-26 11:45:49 +03:00
var dependencies = workInProgress . dependencies ;
null !== dependencies && null !== dependencies . firstContext && ( includesSomeLane ( dependencies . lanes , renderLanes ) && markWorkInProgressReceivedUpdate ( ) , dependencies . firstContext = null ) ;
2021-07-30 04:11:27 +03:00
}
function readContext ( context , observedBits ) {
2022-06-15 17:36:57 +03:00
if ( isDisallowedContextReadInDEV && error ( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ) , lastContextWithAllBitsObserved === context ) ;
2021-07-30 04:11:27 +03:00
else if ( ! 1 === observedBits || 0 === observedBits ) ;
else {
2022-05-04 17:25:28 +03:00
"number" != typeof observedBits || 1073741823 === observedBits ? ( lastContextWithAllBitsObserved = context , resolvedObservedBits = 1073741823 ) : resolvedObservedBits = observedBits ;
2022-01-27 09:36:22 +03:00
var resolvedObservedBits , contextItem = {
2021-07-30 04:11:27 +03:00
context : context ,
observedBits : resolvedObservedBits ,
next : null
} ;
if ( null === lastContextDependency ) {
if ( ! ( null !== currentlyRenderingFiber ) ) throw Error ( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ) ;
lastContextDependency = contextItem , currentlyRenderingFiber . dependencies = {
2022-08-26 11:45:49 +03:00
lanes : NoLanes ,
2021-07-30 04:11:27 +03:00
firstContext : contextItem ,
responders : null
} ;
} else lastContextDependency = lastContextDependency . next = contextItem ;
}
return context . _currentValue ;
}
2021-09-08 12:45:39 +03:00
var hasForceUpdate = ! 1 ;
2021-07-30 04:11:27 +03:00
function initializeUpdateQueue ( fiber ) {
var queue = {
baseState : fiber . memoizedState ,
firstBaseUpdate : null ,
lastBaseUpdate : null ,
shared : {
pending : null
} ,
effects : null
} ;
fiber . updateQueue = queue ;
}
function cloneUpdateQueue ( current , workInProgress ) {
var queue = workInProgress . updateQueue , currentQueue = current . updateQueue ;
if ( queue === currentQueue ) {
var clone = {
baseState : currentQueue . baseState ,
firstBaseUpdate : currentQueue . firstBaseUpdate ,
lastBaseUpdate : currentQueue . lastBaseUpdate ,
shared : currentQueue . shared ,
effects : currentQueue . effects
} ;
workInProgress . updateQueue = clone ;
}
}
function createUpdate ( eventTime , lane ) {
return {
eventTime : eventTime ,
lane : lane ,
tag : 0 ,
payload : null ,
callback : null ,
next : null
} ;
}
function enqueueUpdate ( fiber , update ) {
var updateQueue = fiber . updateQueue ;
if ( null !== updateQueue ) {
var sharedQueue = updateQueue . shared , pending = sharedQueue . pending ;
2022-06-15 17:36:57 +03:00
null === pending ? update . next = update : ( update . next = pending . next , pending . next = update ) , sharedQueue . pending = update , currentlyProcessingQueue !== sharedQueue || didWarnUpdateInsideUpdate || ( error ( "An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback." ) , didWarnUpdateInsideUpdate = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
}
function enqueueCapturedUpdate ( workInProgress , capturedUpdate ) {
2021-10-21 08:12:50 +03:00
var queue = workInProgress . updateQueue , current = workInProgress . alternate ;
if ( null !== current ) {
var currentQueue = current . updateQueue ;
2021-07-30 04:11:27 +03:00
if ( queue === currentQueue ) {
var newFirst = null , newLast = null , firstBaseUpdate = queue . firstBaseUpdate ;
if ( null !== firstBaseUpdate ) {
var update = firstBaseUpdate ;
do {
var clone = {
eventTime : update . eventTime ,
lane : update . lane ,
tag : update . tag ,
payload : update . payload ,
callback : update . callback ,
next : null
} ;
null === newLast ? newFirst = newLast = clone : ( newLast . next = clone , newLast = clone ) , update = update . next ;
} while ( null !== update )
null === newLast ? newFirst = newLast = capturedUpdate : ( newLast . next = capturedUpdate , newLast = capturedUpdate ) ;
} else newFirst = newLast = capturedUpdate ;
2021-09-16 07:23:33 +03:00
queue = {
2021-07-30 04:11:27 +03:00
baseState : currentQueue . baseState ,
firstBaseUpdate : newFirst ,
lastBaseUpdate : newLast ,
shared : currentQueue . shared ,
effects : currentQueue . effects
2021-09-16 07:23:33 +03:00
} , workInProgress . updateQueue = queue ;
return ;
2021-07-30 04:11:27 +03:00
}
}
var lastBaseUpdate = queue . lastBaseUpdate ;
null === lastBaseUpdate ? queue . firstBaseUpdate = capturedUpdate : lastBaseUpdate . next = capturedUpdate , queue . lastBaseUpdate = capturedUpdate ;
}
function getStateFromUpdate ( workInProgress , queue , update , prevState , nextProps , instance ) {
switch ( update . tag ) {
case 1 :
var payload = update . payload ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof payload ) {
2021-07-30 04:11:27 +03:00
enterDisallowedContextReadInDEV ( ) ;
var nextState = payload . call ( instance , prevState , nextProps ) ;
if ( 1 & workInProgress . mode ) {
disableLogs ( ) ;
try {
payload . call ( instance , prevState , nextProps ) ;
} finally {
reenableLogs ( ) ;
}
}
return exitDisallowedContextReadInDEV ( ) , nextState ;
}
return payload ;
2021-08-03 18:52:47 +03:00
case 3 :
2022-08-26 13:06:25 +03:00
workInProgress . flags = - 4097 & workInProgress . flags | 64 ;
2021-07-30 04:11:27 +03:00
case 0 :
var partialState , _payload = update . payload ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof _payload ) {
2021-07-30 04:11:27 +03:00
if ( enterDisallowedContextReadInDEV ( ) , partialState = _payload . call ( instance , prevState , nextProps ) , 1 & workInProgress . mode ) {
disableLogs ( ) ;
try {
_payload . call ( instance , prevState , nextProps ) ;
} finally {
reenableLogs ( ) ;
}
}
exitDisallowedContextReadInDEV ( ) ;
} else partialState = _payload ;
2022-05-08 07:07:58 +03:00
if ( null == partialState ) break ;
2022-01-02 23:54:58 +03:00
return _assign ( { } , prevState , partialState ) ;
2021-09-08 12:45:39 +03:00
case 2 :
2022-04-28 16:28:33 +03:00
hasForceUpdate = ! 0 ;
2021-07-30 04:11:27 +03:00
}
return prevState ;
}
function processUpdateQueue ( workInProgress , props , instance , renderLanes ) {
var queue = workInProgress . updateQueue ;
hasForceUpdate = ! 1 , currentlyProcessingQueue = queue . shared ;
var firstBaseUpdate = queue . firstBaseUpdate , lastBaseUpdate = queue . lastBaseUpdate , pendingQueue = queue . shared . pending ;
if ( null !== pendingQueue ) {
queue . shared . pending = null ;
var lastPendingUpdate = pendingQueue , firstPendingUpdate = lastPendingUpdate . next ;
lastPendingUpdate . next = null , null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate . next = firstPendingUpdate , lastBaseUpdate = lastPendingUpdate ;
var current = workInProgress . alternate ;
if ( null !== current ) {
var currentQueue = current . updateQueue , currentLastBaseUpdate = currentQueue . lastBaseUpdate ;
currentLastBaseUpdate !== lastBaseUpdate && ( null === currentLastBaseUpdate ? currentQueue . firstBaseUpdate = firstPendingUpdate : currentLastBaseUpdate . next = firstPendingUpdate , currentQueue . lastBaseUpdate = lastPendingUpdate ) ;
}
}
if ( null !== firstBaseUpdate ) {
2022-08-26 11:45:49 +03:00
for ( var newState = queue . baseState , newLanes = NoLanes , newBaseState = null , newFirstBaseUpdate = null , newLastBaseUpdate = null , update = firstBaseUpdate ; ; ) {
2022-04-29 08:58:59 +03:00
var updateLane = update . lane , updateEventTime = update . eventTime ;
if ( isSubsetOfLanes ( renderLanes , updateLane ) ) {
2021-07-30 04:11:27 +03:00
if ( null !== newLastBaseUpdate ) {
var _clone = {
eventTime : updateEventTime ,
2022-08-26 13:06:25 +03:00
lane : 0 ,
2021-07-30 04:11:27 +03:00
tag : update . tag ,
payload : update . payload ,
callback : update . callback ,
next : null
} ;
newLastBaseUpdate = newLastBaseUpdate . next = _clone ;
}
2022-08-26 13:06:25 +03:00
if ( newState = getStateFromUpdate ( workInProgress , queue , update , newState , props , instance ) , null !== update . callback ) {
2021-07-30 04:11:27 +03:00
workInProgress . flags |= 32 ;
var effects = queue . effects ;
2021-08-03 18:52:47 +03:00
null === effects ? queue . effects = [
update
] : effects . push ( update ) ;
2021-07-30 04:11:27 +03:00
}
} else {
2022-04-29 08:58:59 +03:00
var a , b , clone = {
2021-07-30 04:11:27 +03:00
eventTime : updateEventTime ,
lane : updateLane ,
tag : update . tag ,
payload : update . payload ,
callback : update . callback ,
next : null
} ;
2022-08-26 13:06:25 +03:00
null === newLastBaseUpdate ? ( newFirstBaseUpdate = newLastBaseUpdate = clone , newBaseState = newState ) : newLastBaseUpdate = newLastBaseUpdate . next = clone , newLanes = ( a = newLanes , a | updateLane ) ;
2021-07-30 04:11:27 +03:00
}
if ( null === ( update = update . next ) ) {
if ( null === ( pendingQueue = queue . shared . pending ) ) break ;
var _lastPendingUpdate = pendingQueue , _firstPendingUpdate = _lastPendingUpdate . next ;
_lastPendingUpdate . next = null , update = _firstPendingUpdate , queue . lastBaseUpdate = _lastPendingUpdate , queue . shared . pending = null ;
}
}
2022-04-29 08:58:59 +03:00
null === newLastBaseUpdate && ( newBaseState = newState ) , queue . baseState = newBaseState , queue . firstBaseUpdate = newFirstBaseUpdate , queue . lastBaseUpdate = newLastBaseUpdate , markSkippedUpdateLanes ( newLanes ) , workInProgress . lanes = newLanes , workInProgress . memoizedState = newState ;
2021-07-30 04:11:27 +03:00
}
currentlyProcessingQueue = null ;
}
2022-06-15 17:36:57 +03:00
function callCallback ( callback , context ) {
2022-05-04 17:25:28 +03:00
if ( "function" != typeof callback ) throw Error ( "Invalid argument passed as callback. Expected a function. Instead received: " + callback ) ;
2021-07-30 04:11:27 +03:00
callback . call ( context ) ;
}
function resetHasForceUpdateBeforeProcessing ( ) {
hasForceUpdate = ! 1 ;
}
function commitUpdateQueue ( finishedWork , finishedQueue , instance ) {
var effects = finishedQueue . effects ;
if ( finishedQueue . effects = null , null !== effects ) for ( var i = 0 ; i < effects . length ; i ++ ) {
var effect = effects [ i ] , callback = effect . callback ;
2022-06-15 17:36:57 +03:00
null !== callback && ( effect . callback = null , callCallback ( callback , instance ) ) ;
2021-07-30 04:11:27 +03:00
}
}
2021-08-04 13:27:17 +03:00
didWarnUpdateInsideUpdate = ! 1 , currentlyProcessingQueue = null ;
2022-06-15 17:36:57 +03:00
var fakeInternalInstance = { } , isArray = Array . isArray , emptyRefsObject = new React . Component ( ) . refs ;
2021-08-04 13:27:17 +03:00
didWarnAboutStateAssignmentForComponent = new Set ( ) , didWarnAboutUninitializedState = new Set ( ) , didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set ( ) , didWarnAboutLegacyLifecyclesAndDerivedState = new Set ( ) , didWarnAboutDirectlyAssigningPropsToState = new Set ( ) , didWarnAboutUndefinedDerivedState = new Set ( ) , didWarnAboutContextTypeAndContextTypes = new Set ( ) , didWarnAboutInvalidateContextType = new Set ( ) ;
var didWarnOnInvalidCallback = new Set ( ) ;
2021-07-30 04:11:27 +03:00
function applyDerivedStateFromProps ( workInProgress , ctor , getDerivedStateFromProps , nextProps ) {
var prevState = workInProgress . memoizedState ;
if ( 1 & workInProgress . mode ) {
disableLogs ( ) ;
try {
getDerivedStateFromProps ( nextProps , prevState ) ;
} finally {
reenableLogs ( ) ;
}
}
var partialState = getDerivedStateFromProps ( nextProps , prevState ) ;
warnOnUndefinedDerivedState ( ctor , partialState ) ;
2022-01-02 23:54:58 +03:00
var memoizedState = null == partialState ? prevState : _assign ( { } , prevState , partialState ) ;
2022-08-26 11:45:49 +03:00
workInProgress . memoizedState = memoizedState , workInProgress . lanes === NoLanes && ( workInProgress . updateQueue . baseState = memoizedState ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
warnOnInvalidCallback = function ( callback , callerName ) {
2022-05-04 17:25:28 +03:00
if ( null !== callback && "function" != typeof callback ) {
var key = callerName + "_" + callback ;
2022-06-15 17:36:57 +03:00
didWarnOnInvalidCallback . has ( key ) || ( didWarnOnInvalidCallback . add ( key ) , error ( "%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s." , callerName , callback ) ) ;
2021-08-04 13:27:17 +03:00
}
} , warnOnUndefinedDerivedState = function ( type , partialState ) {
if ( void 0 === partialState ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( type ) || "Component" ;
2022-06-15 17:36:57 +03:00
didWarnAboutUndefinedDerivedState . has ( componentName ) || ( didWarnAboutUndefinedDerivedState . add ( componentName ) , error ( "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined." , componentName ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
} , Object . defineProperty ( fakeInternalInstance , "_processChildContext" , {
2021-08-04 13:27:17 +03:00
enumerable : ! 1 ,
value : function ( ) {
throw Error ( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." ) ;
}
} ) , Object . freeze ( fakeInternalInstance ) ;
2021-07-30 04:11:27 +03:00
var classComponentUpdater = {
2021-08-04 13:27:17 +03:00
isMounted : function ( component ) {
2021-07-30 04:11:27 +03:00
var owner = ReactCurrentOwner . current ;
if ( null !== owner && 1 === owner . tag ) {
var ownerFiber = owner , instance = ownerFiber . stateNode ;
2022-06-15 17:36:57 +03:00
instance . _warnedAboutRefsInRender || error ( "%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead." , getComponentName ( ownerFiber . type ) || "A component" ) , instance . _warnedAboutRefsInRender = ! 0 ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
var fiber = get ( component ) ;
2021-07-30 04:11:27 +03:00
return ! ! fiber && getNearestMountedFiber ( fiber ) === fiber ;
} ,
enqueueSetState : function ( inst , payload , callback ) {
2022-06-15 17:36:57 +03:00
var fiber = get ( inst ) , eventTime = requestEventTime ( ) , lane = requestUpdateLane ( fiber ) , update = createUpdate ( eventTime , lane ) ;
2022-05-04 17:25:28 +03:00
update . payload = payload , null != callback && ( warnOnInvalidCallback ( callback , "setState" ) , update . callback = callback ) , enqueueUpdate ( fiber , update ) , scheduleUpdateOnFiber ( fiber , lane , eventTime ) ;
2021-07-30 04:11:27 +03:00
} ,
enqueueReplaceState : function ( inst , payload , callback ) {
2022-06-15 17:36:57 +03:00
var fiber = get ( inst ) , eventTime = requestEventTime ( ) , lane = requestUpdateLane ( fiber ) , update = createUpdate ( eventTime , lane ) ;
2022-05-04 17:25:28 +03:00
update . tag = 1 , update . payload = payload , null != callback && ( warnOnInvalidCallback ( callback , "replaceState" ) , update . callback = callback ) , enqueueUpdate ( fiber , update ) , scheduleUpdateOnFiber ( fiber , lane , eventTime ) ;
2021-07-30 04:11:27 +03:00
} ,
enqueueForceUpdate : function ( inst , callback ) {
2022-06-15 17:36:57 +03:00
var fiber = get ( inst ) , eventTime = requestEventTime ( ) , lane = requestUpdateLane ( fiber ) , update = createUpdate ( eventTime , lane ) ;
2022-05-04 17:25:28 +03:00
update . tag = 2 , null != callback && ( warnOnInvalidCallback ( callback , "forceUpdate" ) , update . callback = callback ) , enqueueUpdate ( fiber , update ) , scheduleUpdateOnFiber ( fiber , lane , eventTime ) ;
2021-07-30 04:11:27 +03:00
}
} ;
function checkShouldComponentUpdate ( workInProgress , ctor , oldProps , newProps , oldState , newState , nextContext ) {
var instance = workInProgress . stateNode ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof instance . shouldComponentUpdate ) {
2021-07-30 04:11:27 +03:00
if ( 1 & workInProgress . mode ) {
disableLogs ( ) ;
try {
instance . shouldComponentUpdate ( newProps , newState , nextContext ) ;
} finally {
reenableLogs ( ) ;
}
}
var shouldUpdate = instance . shouldComponentUpdate ( newProps , newState , nextContext ) ;
2022-06-15 17:36:57 +03:00
return void 0 === shouldUpdate && error ( "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false." , getComponentName ( ctor ) || "Component" ) , shouldUpdate ;
2021-07-30 04:11:27 +03:00
}
return ! ctor . prototype || ! ctor . prototype . isPureReactComponent || ! shallowEqual ( oldProps , newProps ) || ! shallowEqual ( oldState , newState ) ;
}
function adoptClassInstance ( workInProgress , instance ) {
2021-10-06 10:12:11 +03:00
var key , value ;
instance . updater = classComponentUpdater , workInProgress . stateNode = instance , key = instance , value = workInProgress , key . _reactInternals = value , instance . _reactInternalInstance = fakeInternalInstance ;
2021-07-30 04:11:27 +03:00
}
function constructClassInstance ( workInProgress , ctor , props ) {
var isLegacyContextConsumer = ! 1 , unmaskedContext = emptyContextObject , context = emptyContextObject , contextType = ctor . contextType ;
2022-05-04 17:25:28 +03:00
if ( "contextType" in ctor && ! ( null === contextType || void 0 !== contextType && contextType . $$typeof === REACT _CONTEXT _TYPE && void 0 === contextType . _context ) && ! didWarnAboutInvalidateContextType . has ( ctor ) ) {
2021-08-03 18:52:47 +03:00
didWarnAboutInvalidateContextType . add ( ctor ) ;
2022-05-04 17:25:28 +03:00
var addendum = "" ;
2022-06-15 17:36:57 +03:00
addendum = void 0 === contextType ? " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file." : "object" != typeof contextType ? " However, it is set to a " + typeof contextType + "." : contextType . $$typeof === REACT _PROVIDER _TYPE ? " Did you accidentally pass the Context.Provider instead?" : void 0 !== contextType . _context ? " Did you accidentally pass the Context.Consumer instead?" : " However, it is set to an object with keys {" + Object . keys ( contextType ) . join ( ", " ) + "}." , error ( "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s" , getComponentName ( ctor ) || "Component" , addendum ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "object" == typeof contextType && null !== contextType ) context = readContext ( contextType ) ;
2021-10-14 16:48:14 +03:00
else {
unmaskedContext = getUnmaskedContext ( workInProgress , ctor , ! 0 ) ;
var contextTypes = ctor . contextTypes ;
context = ( isLegacyContextConsumer = null != contextTypes ) ? getMaskedContext ( workInProgress , unmaskedContext ) : emptyContextObject ;
}
if ( 1 & workInProgress . mode ) {
2021-07-30 04:11:27 +03:00
disableLogs ( ) ;
try {
new ctor ( props , context ) ;
} finally {
reenableLogs ( ) ;
}
}
var instance = new ctor ( props , context ) , state = workInProgress . memoizedState = null !== instance . state && void 0 !== instance . state ? instance . state : null ;
2022-05-04 17:25:28 +03:00
if ( adoptClassInstance ( workInProgress , instance ) , "function" == typeof ctor . getDerivedStateFromProps && null === state ) {
var componentName = getComponentName ( ctor ) || "Component" ;
2022-06-15 17:36:57 +03:00
didWarnAboutUninitializedState . has ( componentName ) || ( didWarnAboutUninitializedState . add ( componentName ) , error ( "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape." , componentName , null === instance . state ? "null" : "undefined" , componentName ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "function" == typeof ctor . getDerivedStateFromProps || "function" == typeof instance . getSnapshotBeforeUpdate ) {
2021-07-30 04:11:27 +03:00
var foundWillMountName = null , foundWillReceivePropsName = null , foundWillUpdateName = null ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof instance . componentWillMount && ! 0 !== instance . componentWillMount . _ _suppressDeprecationWarning ? foundWillMountName = "componentWillMount" : "function" == typeof instance . UNSAFE _componentWillMount && ( foundWillMountName = "UNSAFE_componentWillMount" ) , "function" == typeof instance . componentWillReceiveProps && ! 0 !== instance . componentWillReceiveProps . _ _suppressDeprecationWarning ? foundWillReceivePropsName = "componentWillReceiveProps" : "function" == typeof instance . UNSAFE _componentWillReceiveProps && ( foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps" ) , "function" == typeof instance . componentWillUpdate && ! 0 !== instance . componentWillUpdate . _ _suppressDeprecationWarning ? foundWillUpdateName = "componentWillUpdate" : "function" == typeof instance . UNSAFE _componentWillUpdate && ( foundWillUpdateName = "UNSAFE_componentWillUpdate" ) , null !== foundWillMountName || null !== foundWillReceivePropsName || null !== foundWillUpdateName ) {
var _componentName = getComponentName ( ctor ) || "Component" , newApiName = "function" == typeof ctor . getDerivedStateFromProps ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()" ;
2022-06-15 17:36:57 +03:00
didWarnAboutLegacyLifecyclesAndDerivedState . has ( _componentName ) || ( didWarnAboutLegacyLifecyclesAndDerivedState . add ( _componentName ) , error ( "Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles" , _componentName , newApiName , null !== foundWillMountName ? "\n " + foundWillMountName : "" , null !== foundWillReceivePropsName ? "\n " + foundWillReceivePropsName : "" , null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" ) ) ;
2021-07-30 04:11:27 +03:00
}
}
return isLegacyContextConsumer && cacheContext ( workInProgress , unmaskedContext , context ) , instance ;
}
function callComponentWillReceiveProps ( workInProgress , instance , newProps , nextContext ) {
var oldState = instance . state ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof instance . componentWillReceiveProps && instance . componentWillReceiveProps ( newProps , nextContext ) , "function" == typeof instance . UNSAFE _componentWillReceiveProps && instance . UNSAFE _componentWillReceiveProps ( newProps , nextContext ) , instance . state !== oldState ) {
var componentName = getComponentName ( workInProgress . type ) || "Component" ;
2022-06-15 17:36:57 +03:00
didWarnAboutStateAssignmentForComponent . has ( componentName ) || ( didWarnAboutStateAssignmentForComponent . add ( componentName ) , error ( "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead." , componentName ) ) , classComponentUpdater . enqueueReplaceState ( instance , instance . state , null ) ;
2021-07-30 04:11:27 +03:00
}
}
2021-10-21 08:12:50 +03:00
function mountClassInstance ( workInProgress , ctor , newProps , renderLanes ) {
2022-06-15 17:36:57 +03:00
workInProgress1 = workInProgress , ctor1 = ctor , newProps1 = newProps , instance = workInProgress1 . stateNode , name = getComponentName ( ctor1 ) || "Component" , instance . render || ( ctor1 . prototype && "function" == typeof ctor1 . prototype . render ? error ( "%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?" , name ) : error ( "%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`." , name ) ) , ! instance . getInitialState || instance . getInitialState . isReactClassApproved || instance . state || error ( "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?" , name ) , instance . getDefaultProps && ! instance . getDefaultProps . isReactClassApproved && error ( "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead." , name ) , instance . propTypes && error ( "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead." , name ) , instance . contextType && error ( "contextType was defined as an instance property on %s. Use a static property to define contextType instead." , name ) , instance . contextTypes && error ( "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead." , name ) , ctor1 . contextType && ctor1 . contextTypes && ! didWarnAboutContextTypeAndContextTypes . has ( ctor1 ) && ( didWarnAboutContextTypeAndContextTypes . add ( ctor1 ) , error ( "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored." , name ) ) , "function" == typeof instance . componentShouldUpdate && error ( "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value." , name ) , ctor1 . prototype && ctor1 . prototype . isPureReactComponent && void 0 !== instance . shouldComponentUpdate && error ( "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used." , getComponentName ( ctor1 ) || "A pure component" ) , "function" == typeof instance . componentDidUnmount && error ( "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?" , name ) , "function" == typeof instance . componentDidReceiveProps && error ( "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate()." , name ) , "function" == typeof instance . componentWillRecieveProps && error ( "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?" , name ) , "function" == typeof instance . UNSAFE _componentWillRecieveProps && error ( "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?" , name ) , hasMutatedProps = instance . props !== newProps1 , void 0 !== instance . props && hasMutatedProps && error ( "%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed." , name , name ) , instance . defaultProps && error ( "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s." , name , name ) , "function" != typeof instance . getSnapshotBeforeUpdate || "function" == typeof instance . componentDidUpdate || didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate . has ( ctor1 ) || ( didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate . add ( ctor1 ) , error ( " % s : getSnapshotBeforeUpdate ( ) should be used with componentDidUpdate ( ) . This com
var workInProgress1 , ctor1 , newProps1 , instance , name , hasMutatedProps , _state , workInProgress2 , instance1 , oldState , instance2 = workInProgress . stateNode ;
2021-10-21 08:12:50 +03:00
instance2 . props = newProps , instance2 . state = workInProgress . memoizedState , instance2 . refs = emptyRefsObject , initializeUpdateQueue ( workInProgress ) ;
var contextType = ctor . contextType ;
2022-05-04 17:25:28 +03:00
if ( "object" == typeof contextType && null !== contextType ) instance2 . context = readContext ( contextType ) ;
2021-07-30 04:11:27 +03:00
else {
2021-10-21 08:12:50 +03:00
var unmaskedContext = getUnmaskedContext ( workInProgress , ctor , ! 0 ) ;
instance2 . context = getMaskedContext ( workInProgress , unmaskedContext ) ;
2021-07-30 04:11:27 +03:00
}
2021-10-21 08:12:50 +03:00
if ( instance2 . state === newProps ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( ctor ) || "Component" ;
2022-06-15 17:36:57 +03:00
didWarnAboutDirectlyAssigningPropsToState . has ( componentName ) || ( didWarnAboutDirectlyAssigningPropsToState . add ( componentName ) , error ( "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly." , componentName ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-10-21 08:12:50 +03:00
1 & workInProgress . mode && ReactStrictModeWarnings . recordLegacyContextWarning ( workInProgress , instance2 ) , ReactStrictModeWarnings . recordUnsafeLifecycleWarnings ( workInProgress , instance2 ) , processUpdateQueue ( workInProgress , newProps , instance2 , renderLanes ) , instance2 . state = workInProgress . memoizedState ;
var getDerivedStateFromProps = ctor . getDerivedStateFromProps ;
2022-08-26 13:06:25 +03:00
"function" == typeof getDerivedStateFromProps && ( applyDerivedStateFromProps ( workInProgress , ctor , getDerivedStateFromProps , newProps ) , instance2 . state = workInProgress . memoizedState ) , "function" != typeof ctor . getDerivedStateFromProps && "function" != typeof instance2 . getSnapshotBeforeUpdate && ( "function" == typeof instance2 . UNSAFE _componentWillMount || "function" == typeof instance2 . componentWillMount ) && ( workInProgress2 = workInProgress , oldState = ( instance1 = instance2 ) . state , "function" == typeof instance1 . componentWillMount && instance1 . componentWillMount ( ) , "function" == typeof instance1 . UNSAFE _componentWillMount && instance1 . UNSAFE _componentWillMount ( ) , oldState !== instance1 . state && ( error ( "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead." , getComponentName ( workInProgress2 . type ) || "Component" ) , classComponentUpdater . enqueueReplaceState ( instance1 , instance1 . state , null ) ) , processUpdateQueue ( workInProgress , newProps , instance2 , renderLanes ) , instance2 . state = workInProgress . memoizedState ) , "function" == typeof instance2 . componentDidMount && ( workInProgress . flags |= 4 ) ;
2021-07-30 04:11:27 +03:00
}
2022-01-02 23:54:58 +03:00
var warnForMissingKey = function ( child , returnFiber ) { } ;
didWarnAboutMaps = ! 1 , didWarnAboutGenerators = ! 1 , didWarnAboutStringRefs = { } , ownerHasKeyUseWarning = { } , ownerHasFunctionTypeWarning = { } , warnForMissingKey = function ( child , returnFiber ) {
2022-05-17 10:34:47 +03:00
if ( null !== child && "object" == typeof child && child . _store && ! child . _store . validated && null == child . key ) {
if ( "object" != typeof child . _store ) throw Error ( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ) ;
child . _store . validated = ! 0 ;
var componentName = getComponentName ( returnFiber . type ) || "Component" ;
2022-06-15 17:36:57 +03:00
ownerHasKeyUseWarning [ componentName ] || ( ownerHasKeyUseWarning [ componentName ] = ! 0 , error ( 'Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.' ) ) ;
2021-08-04 13:27:17 +03:00
}
} ;
var isArray$1 = Array . isArray ;
2021-07-30 04:11:27 +03:00
function coerceRef ( returnFiber , current , element ) {
var mixedRef = element . ref ;
2022-05-04 17:25:28 +03:00
if ( null !== mixedRef && "function" != typeof mixedRef && "object" != typeof mixedRef ) {
2022-03-21 14:06:25 +03:00
if ( 1 & returnFiber . mode && ! ( element . _owner && element . _self && element . _owner . stateNode !== element . _self ) ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( returnFiber . type ) || "Component" ;
2022-06-15 17:36:57 +03:00
didWarnAboutStringRefs [ componentName ] || ( error ( 'A string ref, "%s", has been found within a strict mode tree. String refs are a source of potential bugs and should be avoided. We recommend using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref' , mixedRef ) , didWarnAboutStringRefs [ componentName ] = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
if ( element . _owner ) {
var inst , owner = element . _owner ;
if ( owner ) {
var ownerFiber = owner ;
if ( 1 !== ownerFiber . tag ) throw Error ( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref" ) ;
inst = ownerFiber . stateNode ;
}
if ( ! inst ) throw Error ( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." ) ;
2022-05-04 17:25:28 +03:00
var stringRef = "" + mixedRef ;
if ( null !== current && null !== current . ref && "function" == typeof current . ref && current . ref . _stringRef === stringRef ) return current . ref ;
2021-07-30 04:11:27 +03:00
var ref = function ( value ) {
var refs = inst . refs ;
2022-01-02 23:54:58 +03:00
refs === emptyRefsObject && ( refs = inst . refs = { } ) , null === value ? delete refs [ stringRef ] : refs [ stringRef ] = value ;
2021-07-30 04:11:27 +03:00
} ;
return ref . _stringRef = stringRef , ref ;
}
2022-05-04 17:25:28 +03:00
if ( "string" != typeof mixedRef ) throw Error ( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." ) ;
2021-07-30 04:11:27 +03:00
if ( ! element . _owner ) throw Error ( "Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information." ) ;
}
return mixedRef ;
}
function throwOnInvalidObjectType ( returnFiber , newChild ) {
2022-05-04 17:25:28 +03:00
if ( "textarea" !== returnFiber . type ) throw Error ( "Objects are not valid as a React child (found: " + ( "[object Object]" === Object . prototype . toString . call ( newChild ) ? "object with keys {" + Object . keys ( newChild ) . join ( ", " ) + "}" : newChild ) + "). If you meant to render a collection of children, use an array instead." ) ;
2021-07-30 04:11:27 +03:00
}
function warnOnFunctionType ( returnFiber ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( returnFiber . type ) || "Component" ;
2022-06-15 17:36:57 +03:00
ownerHasFunctionTypeWarning [ componentName ] || ( ownerHasFunctionTypeWarning [ componentName ] = ! 0 , error ( "Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it." ) ) ;
2021-07-30 04:11:27 +03:00
}
function ChildReconciler ( shouldTrackSideEffects ) {
function deleteChild ( returnFiber , childToDelete ) {
if ( shouldTrackSideEffects ) {
var last = returnFiber . lastEffect ;
2022-08-26 13:06:25 +03:00
null !== last ? ( last . nextEffect = childToDelete , returnFiber . lastEffect = childToDelete ) : returnFiber . firstEffect = returnFiber . lastEffect = childToDelete , childToDelete . nextEffect = null , childToDelete . flags = 8 ;
2021-07-30 04:11:27 +03:00
}
}
function deleteRemainingChildren ( returnFiber , currentFirstChild ) {
if ( ! shouldTrackSideEffects ) return null ;
for ( var childToDelete = currentFirstChild ; null !== childToDelete ; ) deleteChild ( returnFiber , childToDelete ) , childToDelete = childToDelete . sibling ;
return null ;
}
function mapRemainingChildren ( returnFiber , currentFirstChild ) {
for ( var existingChildren = new Map ( ) , existingChild = currentFirstChild ; null !== existingChild ; ) null !== existingChild . key ? existingChildren . set ( existingChild . key , existingChild ) : existingChildren . set ( existingChild . index , existingChild ) , existingChild = existingChild . sibling ;
return existingChildren ;
}
function useFiber ( fiber , pendingProps ) {
var clone = createWorkInProgress ( fiber , pendingProps ) ;
return clone . index = 0 , clone . sibling = null , clone ;
}
function placeChild ( newFiber , lastPlacedIndex , newIndex ) {
if ( newFiber . index = newIndex , ! shouldTrackSideEffects ) return lastPlacedIndex ;
var current = newFiber . alternate ;
2022-08-26 13:06:25 +03:00
if ( null === current ) return newFiber . flags = 2 , lastPlacedIndex ;
2021-07-30 04:11:27 +03:00
var oldIndex = current . index ;
2022-08-26 13:06:25 +03:00
return oldIndex < lastPlacedIndex ? ( newFiber . flags = 2 , lastPlacedIndex ) : oldIndex ;
2021-07-30 04:11:27 +03:00
}
function placeSingleChild ( newFiber ) {
2022-08-26 13:06:25 +03:00
return shouldTrackSideEffects && null === newFiber . alternate && ( newFiber . flags = 2 ) , newFiber ;
2021-07-30 04:11:27 +03:00
}
function updateTextNode ( returnFiber , current , textContent , lanes ) {
if ( null === current || 6 !== current . tag ) {
var created = createFiberFromText ( textContent , returnFiber . mode , lanes ) ;
return created . return = returnFiber , created ;
}
var existing = useFiber ( current , textContent ) ;
return existing . return = returnFiber , existing ;
}
function updateElement ( returnFiber , current , element , lanes ) {
if ( null !== current && ( current . elementType === element . type || isCompatibleFamilyForHotReloading ( current , element ) ) ) {
var existing = useFiber ( current , element . props ) ;
return existing . ref = coerceRef ( returnFiber , current , element ) , existing . return = returnFiber , existing . _debugSource = element . _source , existing . _debugOwner = element . _owner , existing ;
}
var created = createFiberFromElement ( element , returnFiber . mode , lanes ) ;
return created . ref = coerceRef ( returnFiber , current , element ) , created . return = returnFiber , created ;
}
function updatePortal ( returnFiber , current , portal , lanes ) {
if ( null === current || 4 !== current . tag || current . stateNode . containerInfo !== portal . containerInfo || current . stateNode . implementation !== portal . implementation ) {
var created = createFiberFromPortal ( portal , returnFiber . mode , lanes ) ;
return created . return = returnFiber , created ;
}
var existing = useFiber ( current , portal . children || [ ] ) ;
return existing . return = returnFiber , existing ;
}
function updateFragment ( returnFiber , current , fragment , lanes , key ) {
if ( null === current || 7 !== current . tag ) {
var created = createFiberFromFragment ( fragment , returnFiber . mode , lanes , key ) ;
return created . return = returnFiber , created ;
}
var existing = useFiber ( current , fragment ) ;
return existing . return = returnFiber , existing ;
}
function createChild ( returnFiber , newChild , lanes ) {
2022-05-04 17:25:28 +03:00
if ( "string" == typeof newChild || "number" == typeof newChild ) {
var created = createFiberFromText ( "" + newChild , returnFiber . mode , lanes ) ;
2021-07-30 04:11:27 +03:00
return created . return = returnFiber , created ;
}
2022-05-04 17:25:28 +03:00
if ( "object" == typeof newChild && null !== newChild ) {
2021-07-30 04:11:27 +03:00
switch ( newChild . $$typeof ) {
case REACT _ELEMENT _TYPE :
var _created = createFiberFromElement ( newChild , returnFiber . mode , lanes ) ;
return _created . ref = coerceRef ( returnFiber , null , newChild ) , _created . return = returnFiber , _created ;
case REACT _PORTAL _TYPE :
var _created2 = createFiberFromPortal ( newChild , returnFiber . mode , lanes ) ;
return _created2 . return = returnFiber , _created2 ;
}
if ( isArray$1 ( newChild ) || getIteratorFn ( newChild ) ) {
var _created3 = createFiberFromFragment ( newChild , returnFiber . mode , lanes , null ) ;
return _created3 . return = returnFiber , _created3 ;
}
throwOnInvalidObjectType ( returnFiber , newChild ) ;
}
2022-05-04 17:25:28 +03:00
return "function" == typeof newChild && warnOnFunctionType ( returnFiber ) , null ;
2021-07-30 04:11:27 +03:00
}
function updateSlot ( returnFiber , oldFiber , newChild , lanes ) {
var key = null !== oldFiber ? oldFiber . key : null ;
2022-05-04 17:25:28 +03:00
if ( "string" == typeof newChild || "number" == typeof newChild ) return null !== key ? null : updateTextNode ( returnFiber , oldFiber , "" + newChild , lanes ) ;
if ( "object" == typeof newChild && null !== newChild ) {
2021-07-30 04:11:27 +03:00
switch ( newChild . $$typeof ) {
case REACT _ELEMENT _TYPE :
if ( newChild . key !== key ) return null ;
if ( newChild . type === REACT _FRAGMENT _TYPE ) return updateFragment ( returnFiber , oldFiber , newChild . props . children , lanes , key ) ;
return updateElement ( returnFiber , oldFiber , newChild , lanes ) ;
case REACT _PORTAL _TYPE :
if ( newChild . key === key ) return updatePortal ( returnFiber , oldFiber , newChild , lanes ) ;
return null ;
}
if ( isArray$1 ( newChild ) || getIteratorFn ( newChild ) ) return null !== key ? null : updateFragment ( returnFiber , oldFiber , newChild , lanes , null ) ;
throwOnInvalidObjectType ( returnFiber , newChild ) ;
}
2022-05-04 17:25:28 +03:00
return "function" == typeof newChild && warnOnFunctionType ( returnFiber ) , null ;
2021-07-30 04:11:27 +03:00
}
function updateFromMap ( existingChildren , returnFiber , newIdx , newChild , lanes ) {
2022-05-04 17:25:28 +03:00
if ( "string" == typeof newChild || "number" == typeof newChild ) return updateTextNode ( returnFiber , existingChildren . get ( newIdx ) || null , "" + newChild , lanes ) ;
if ( "object" == typeof newChild && null !== newChild ) {
2021-07-30 04:11:27 +03:00
switch ( newChild . $$typeof ) {
case REACT _ELEMENT _TYPE :
var _matchedFiber = existingChildren . get ( null === newChild . key ? newIdx : newChild . key ) || null ;
if ( newChild . type === REACT _FRAGMENT _TYPE ) return updateFragment ( returnFiber , _matchedFiber , newChild . props . children , lanes , newChild . key ) ;
return updateElement ( returnFiber , _matchedFiber , newChild , lanes ) ;
2021-08-03 18:52:47 +03:00
case REACT _PORTAL _TYPE :
return updatePortal ( returnFiber , existingChildren . get ( null === newChild . key ? newIdx : newChild . key ) || null , newChild , lanes ) ;
2021-07-30 04:11:27 +03:00
}
if ( isArray$1 ( newChild ) || getIteratorFn ( newChild ) ) return updateFragment ( returnFiber , existingChildren . get ( newIdx ) || null , newChild , lanes , null ) ;
throwOnInvalidObjectType ( returnFiber , newChild ) ;
}
2022-05-04 17:25:28 +03:00
return "function" == typeof newChild && warnOnFunctionType ( returnFiber ) , null ;
2021-07-30 04:11:27 +03:00
}
function warnOnInvalidKey ( child , knownKeys , returnFiber ) {
2022-05-04 17:25:28 +03:00
if ( "object" != typeof child || null === child ) return knownKeys ;
2021-07-30 04:11:27 +03:00
switch ( child . $$typeof ) {
case REACT _ELEMENT _TYPE :
case REACT _PORTAL _TYPE :
warnForMissingKey ( child , returnFiber ) ;
var key = child . key ;
2022-05-04 17:25:28 +03:00
if ( "string" != typeof key ) break ;
2021-07-30 04:11:27 +03:00
if ( null === knownKeys ) {
2022-08-26 13:06:25 +03:00
knownKeys = new Set ( ) , knownKeys . add ( key ) ;
2021-07-30 04:11:27 +03:00
break ;
}
if ( ! knownKeys . has ( key ) ) {
knownKeys . add ( key ) ;
break ;
}
2022-07-05 13:22:25 +03:00
error ( "Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version." , key ) ;
2021-07-30 04:11:27 +03:00
}
return knownKeys ;
}
2022-06-15 17:36:57 +03:00
return function ( returnFiber , currentFirstChild , newChild , lanes ) {
2022-05-04 17:25:28 +03:00
var isUnkeyedTopLevelFragment = "object" == typeof newChild && null !== newChild && newChild . type === REACT _FRAGMENT _TYPE && null === newChild . key ;
2021-09-08 12:45:39 +03:00
isUnkeyedTopLevelFragment && ( newChild = newChild . props . children ) ;
2022-05-04 17:25:28 +03:00
var isObject = "object" == typeof newChild && null !== newChild ;
2021-09-08 12:45:39 +03:00
if ( isObject ) switch ( newChild . $$typeof ) {
case REACT _ELEMENT _TYPE :
return placeSingleChild ( function ( returnFiber , currentFirstChild , element , lanes ) {
for ( var key = element . key , child = currentFirstChild ; null !== child ; ) {
if ( child . key === key ) {
2022-04-21 13:00:25 +03:00
if ( 7 === child . tag ) {
if ( element . type === REACT _FRAGMENT _TYPE ) {
deleteRemainingChildren ( returnFiber , child . sibling ) ;
var existing = useFiber ( child , element . props . children ) ;
return existing . return = returnFiber , existing . _debugSource = element . _source , existing . _debugOwner = element . _owner , existing ;
}
} else if ( child . elementType === element . type || isCompatibleFamilyForHotReloading ( child , element ) ) {
deleteRemainingChildren ( returnFiber , child . sibling ) ;
var _existing3 = useFiber ( child , element . props ) ;
return _existing3 . ref = coerceRef ( returnFiber , child , element ) , _existing3 . return = returnFiber , _existing3 . _debugSource = element . _source , _existing3 . _debugOwner = element . _owner , _existing3 ;
2021-09-08 12:45:39 +03:00
}
deleteRemainingChildren ( returnFiber , child ) ;
break ;
}
deleteChild ( returnFiber , child ) , child = child . sibling ;
}
if ( element . type === REACT _FRAGMENT _TYPE ) {
var created = createFiberFromFragment ( element . props . children , returnFiber . mode , lanes , element . key ) ;
return created . return = returnFiber , created ;
}
var _created4 = createFiberFromElement ( element , returnFiber . mode , lanes ) ;
return _created4 . ref = coerceRef ( returnFiber , currentFirstChild , element ) , _created4 . return = returnFiber , _created4 ;
2022-06-15 17:36:57 +03:00
} ( returnFiber , currentFirstChild , newChild , lanes ) ) ;
2021-09-08 12:45:39 +03:00
case REACT _PORTAL _TYPE :
2021-10-06 10:12:11 +03:00
return placeSingleChild ( function ( returnFiber , currentFirstChild , portal , lanes ) {
2021-09-08 12:45:39 +03:00
for ( var key = portal . key , child = currentFirstChild ; null !== child ; ) {
if ( child . key === key ) {
if ( 4 === child . tag && child . stateNode . containerInfo === portal . containerInfo && child . stateNode . implementation === portal . implementation ) {
deleteRemainingChildren ( returnFiber , child . sibling ) ;
var existing = useFiber ( child , portal . children || [ ] ) ;
return existing . return = returnFiber , existing ;
}
deleteRemainingChildren ( returnFiber , child ) ;
break ;
}
deleteChild ( returnFiber , child ) , child = child . sibling ;
}
var created = createFiberFromPortal ( portal , returnFiber . mode , lanes ) ;
return created . return = returnFiber , created ;
2022-06-15 17:36:57 +03:00
} ( returnFiber , currentFirstChild , newChild , lanes ) ) ;
2021-09-08 12:45:39 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "string" == typeof newChild || "number" == typeof newChild ) return placeSingleChild ( function ( returnFiber , currentFirstChild , textContent , lanes ) {
2021-09-08 12:45:39 +03:00
if ( null !== currentFirstChild && 6 === currentFirstChild . tag ) {
deleteRemainingChildren ( returnFiber , currentFirstChild . sibling ) ;
var existing = useFiber ( currentFirstChild , textContent ) ;
return existing . return = returnFiber , existing ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
deleteRemainingChildren ( returnFiber , currentFirstChild ) ;
var created = createFiberFromText ( textContent , returnFiber . mode , lanes ) ;
return created . return = returnFiber , created ;
2022-06-15 17:36:57 +03:00
} ( returnFiber , currentFirstChild , "" + newChild , lanes ) ) ;
2022-03-08 17:35:18 +03:00
if ( isArray$1 ( newChild ) ) return function ( returnFiber , currentFirstChild , newChildren , lanes ) {
2021-09-08 12:45:39 +03:00
for ( var knownKeys = null , i = 0 ; i < newChildren . length ; i ++ ) knownKeys = warnOnInvalidKey ( newChildren [ i ] , knownKeys , returnFiber ) ;
for ( var resultingFirstChild = null , previousNewFiber = null , oldFiber = currentFirstChild , lastPlacedIndex = 0 , newIdx = 0 , nextOldFiber = null ; null !== oldFiber && newIdx < newChildren . length ; newIdx ++ ) {
oldFiber . index > newIdx ? ( nextOldFiber = oldFiber , oldFiber = null ) : nextOldFiber = oldFiber . sibling ;
var newFiber = updateSlot ( returnFiber , oldFiber , newChildren [ newIdx ] , lanes ) ;
if ( null === newFiber ) {
null === oldFiber && ( oldFiber = nextOldFiber ) ;
break ;
}
shouldTrackSideEffects && oldFiber && null === newFiber . alternate && deleteChild ( returnFiber , oldFiber ) , lastPlacedIndex = placeChild ( newFiber , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber . sibling = newFiber , previousNewFiber = newFiber , oldFiber = nextOldFiber ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
if ( newIdx === newChildren . length ) return deleteRemainingChildren ( returnFiber , oldFiber ) , resultingFirstChild ;
if ( null === oldFiber ) {
for ( ; newIdx < newChildren . length ; newIdx ++ ) {
var _newFiber = createChild ( returnFiber , newChildren [ newIdx ] , lanes ) ;
null !== _newFiber && ( lastPlacedIndex = placeChild ( _newFiber , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber . sibling = _newFiber , previousNewFiber = _newFiber ) ;
}
return resultingFirstChild ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
for ( var existingChildren = mapRemainingChildren ( returnFiber , oldFiber ) ; newIdx < newChildren . length ; newIdx ++ ) {
var _newFiber2 = updateFromMap ( existingChildren , returnFiber , newIdx , newChildren [ newIdx ] , lanes ) ;
null !== _newFiber2 && ( shouldTrackSideEffects && null !== _newFiber2 . alternate && existingChildren . delete ( null === _newFiber2 . key ? newIdx : _newFiber2 . key ) , lastPlacedIndex = placeChild ( _newFiber2 , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber . sibling = _newFiber2 , previousNewFiber = _newFiber2 ) ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
return shouldTrackSideEffects && existingChildren . forEach ( function ( child ) {
return deleteChild ( returnFiber , child ) ;
} ) , resultingFirstChild ;
2022-06-15 17:36:57 +03:00
} ( returnFiber , currentFirstChild , newChild , lanes ) ;
2022-03-08 17:35:18 +03:00
if ( getIteratorFn ( newChild ) ) return function ( returnFiber , currentFirstChild , newChildrenIterable , lanes ) {
2021-09-08 12:45:39 +03:00
var iteratorFn = getIteratorFn ( newChildrenIterable ) ;
2022-05-04 17:25:28 +03:00
if ( "function" != typeof iteratorFn ) throw Error ( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-06-15 17:36:57 +03:00
"function" == typeof Symbol && "Generator" === newChildrenIterable [ Symbol . toStringTag ] && ( didWarnAboutGenerators || error ( "Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers." ) , didWarnAboutGenerators = ! 0 ) , newChildrenIterable . entries === iteratorFn && ( didWarnAboutMaps || error ( "Using Maps as children is not supported. Use an array of keyed ReactElements instead." ) , didWarnAboutMaps = ! 0 ) ;
2021-09-08 12:45:39 +03:00
var _newChildren = iteratorFn . call ( newChildrenIterable ) ;
if ( _newChildren ) for ( var knownKeys = null , _step = _newChildren . next ( ) ; ! _step . done ; _step = _newChildren . next ( ) ) knownKeys = warnOnInvalidKey ( _step . value , knownKeys , returnFiber ) ;
var newChildren = iteratorFn . call ( newChildrenIterable ) ;
if ( ! ( null != newChildren ) ) throw Error ( "An iterable object provided no iterator." ) ;
for ( var resultingFirstChild = null , previousNewFiber = null , oldFiber = currentFirstChild , lastPlacedIndex = 0 , newIdx = 0 , nextOldFiber = null , step = newChildren . next ( ) ; null !== oldFiber && ! step . done ; newIdx ++ , step = newChildren . next ( ) ) {
oldFiber . index > newIdx ? ( nextOldFiber = oldFiber , oldFiber = null ) : nextOldFiber = oldFiber . sibling ;
var newFiber = updateSlot ( returnFiber , oldFiber , step . value , lanes ) ;
if ( null === newFiber ) {
null === oldFiber && ( oldFiber = nextOldFiber ) ;
break ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
shouldTrackSideEffects && oldFiber && null === newFiber . alternate && deleteChild ( returnFiber , oldFiber ) , lastPlacedIndex = placeChild ( newFiber , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber . sibling = newFiber , previousNewFiber = newFiber , oldFiber = nextOldFiber ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
if ( step . done ) return deleteRemainingChildren ( returnFiber , oldFiber ) , resultingFirstChild ;
if ( null === oldFiber ) {
for ( ; ! step . done ; newIdx ++ , step = newChildren . next ( ) ) {
var _newFiber3 = createChild ( returnFiber , step . value , lanes ) ;
null !== _newFiber3 && ( lastPlacedIndex = placeChild ( _newFiber3 , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber . sibling = _newFiber3 , previousNewFiber = _newFiber3 ) ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
return resultingFirstChild ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
for ( var existingChildren = mapRemainingChildren ( returnFiber , oldFiber ) ; ! step . done ; newIdx ++ , step = newChildren . next ( ) ) {
var _newFiber4 = updateFromMap ( existingChildren , returnFiber , newIdx , step . value , lanes ) ;
null !== _newFiber4 && ( shouldTrackSideEffects && null !== _newFiber4 . alternate && existingChildren . delete ( null === _newFiber4 . key ? newIdx : _newFiber4 . key ) , lastPlacedIndex = placeChild ( _newFiber4 , lastPlacedIndex , newIdx ) , null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber . sibling = _newFiber4 , previousNewFiber = _newFiber4 ) ;
}
return shouldTrackSideEffects && existingChildren . forEach ( function ( child ) {
return deleteChild ( returnFiber , child ) ;
} ) , resultingFirstChild ;
2022-06-15 17:36:57 +03:00
} ( returnFiber , currentFirstChild , newChild , lanes ) ;
if ( isObject && throwOnInvalidObjectType ( returnFiber , newChild ) , "function" == typeof newChild && warnOnFunctionType ( returnFiber ) , void 0 === newChild && ! isUnkeyedTopLevelFragment ) switch ( returnFiber . tag ) {
2021-07-30 04:11:27 +03:00
case 1 :
2022-06-15 17:36:57 +03:00
if ( returnFiber . stateNode . render . _isMockFunction ) break ;
2021-07-30 04:11:27 +03:00
case 22 :
case 0 :
case 11 :
2021-08-03 18:52:47 +03:00
case 15 :
2022-06-15 17:36:57 +03:00
throw Error ( ( getComponentName ( returnFiber . type ) || "Component" ) + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
return deleteRemainingChildren ( returnFiber , currentFirstChild ) ;
2021-07-30 04:11:27 +03:00
} ;
}
var reconcileChildFibers = ChildReconciler ( ! 0 ) , mountChildFibers = ChildReconciler ( ! 1 ) ;
function resetChildFibers ( workInProgress , lanes ) {
for ( var child = workInProgress . child ; null !== child ; ) resetWorkInProgress ( child , lanes ) , child = child . sibling ;
}
2022-01-02 23:54:58 +03:00
var NO _CONTEXT = { } , contextStackCursor$1 = createCursor ( NO _CONTEXT ) , contextFiberStackCursor = createCursor ( NO _CONTEXT ) , rootInstanceStackCursor = createCursor ( NO _CONTEXT ) ;
2021-07-30 04:11:27 +03:00
function requiredContext ( c ) {
if ( ! ( c !== NO _CONTEXT ) ) throw Error ( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." ) ;
return c ;
}
function getRootHostContainer ( ) {
2022-08-26 13:06:25 +03:00
var rootInstance = requiredContext ( rootInstanceStackCursor . current ) ;
return rootInstance ;
2021-07-30 04:11:27 +03:00
}
function pushHostContainer ( fiber , nextRootInstance ) {
push ( rootInstanceStackCursor , nextRootInstance , fiber ) , push ( contextFiberStackCursor , fiber , fiber ) , push ( contextStackCursor$1 , NO _CONTEXT , fiber ) ;
2021-09-08 12:45:39 +03:00
var nextRootContext = function ( rootContainerInstance ) {
var type , namespace , nodeType = rootContainerInstance . nodeType ;
switch ( nodeType ) {
case 9 :
case 11 :
2022-05-04 17:25:28 +03:00
type = 9 === nodeType ? "#document" : "#fragment" ;
2021-09-08 12:45:39 +03:00
var root = rootContainerInstance . documentElement ;
2022-05-04 17:25:28 +03:00
namespace = root ? root . namespaceURI : getChildNamespace ( null , "" ) ;
2021-09-08 12:45:39 +03:00
break ;
default :
var container = 8 === nodeType ? rootContainerInstance . parentNode : rootContainerInstance ;
namespace = getChildNamespace ( container . namespaceURI || null , type = container . tagName ) ;
}
return {
namespace : namespace ,
2022-08-26 13:06:25 +03:00
ancestorInfo : updatedAncestorInfo ( null , type . toLowerCase ( ) )
2021-09-08 12:45:39 +03:00
} ;
} ( nextRootInstance ) ;
2021-07-30 04:11:27 +03:00
pop ( contextStackCursor$1 , fiber ) , push ( contextStackCursor$1 , nextRootContext , fiber ) ;
}
function popHostContainer ( fiber ) {
pop ( contextStackCursor$1 , fiber ) , pop ( contextFiberStackCursor , fiber ) , pop ( rootInstanceStackCursor , fiber ) ;
}
function getHostContext ( ) {
2022-08-26 13:06:25 +03:00
var context = requiredContext ( contextStackCursor$1 . current ) ;
return context ;
2021-07-30 04:11:27 +03:00
}
function pushHostContext ( fiber ) {
requiredContext ( rootInstanceStackCursor . current ) ;
2022-08-26 13:06:25 +03:00
var parentHostContext , type , parentHostContextDev , namespace , ancestorInfo , context = requiredContext ( contextStackCursor$1 . current ) , nextContext = ( parentHostContext = context , type = fiber . type , parentHostContextDev = parentHostContext , namespace = getChildNamespace ( parentHostContextDev . namespace , type ) , ancestorInfo = updatedAncestorInfo ( parentHostContextDev . ancestorInfo , type ) , {
2021-10-14 16:48:14 +03:00
namespace : namespace ,
ancestorInfo : ancestorInfo
2021-09-08 12:45:39 +03:00
} ) ;
2021-07-30 04:11:27 +03:00
context !== nextContext && ( push ( contextFiberStackCursor , fiber , fiber ) , push ( contextStackCursor$1 , nextContext , fiber ) ) ;
}
function popHostContext ( fiber ) {
contextFiberStackCursor . current === fiber && ( pop ( contextStackCursor$1 , fiber ) , pop ( contextFiberStackCursor , fiber ) ) ;
}
var suspenseStackCursor = createCursor ( 0 ) ;
function pushSuspenseContext ( fiber , newContext ) {
push ( suspenseStackCursor , newContext , fiber ) ;
}
function popSuspenseContext ( fiber ) {
pop ( suspenseStackCursor , fiber ) ;
}
function shouldCaptureSuspense ( workInProgress , hasInvisibleParent ) {
var nextState = workInProgress . memoizedState ;
if ( null !== nextState ) return null !== nextState . dehydrated ;
var props = workInProgress . memoizedProps ;
return void 0 !== props . fallback && ( ! 0 !== props . unstable _avoidThisFallback || ! hasInvisibleParent ) ;
}
function findFirstSuspended ( row ) {
for ( var node = row ; null !== node ; ) {
if ( 13 === node . tag ) {
var state = node . memoizedState ;
if ( null !== state ) {
var dehydrated = state . dehydrated ;
if ( null === dehydrated || isSuspenseInstancePending ( dehydrated ) || isSuspenseInstanceFallback ( dehydrated ) ) return node ;
}
} else if ( 19 === node . tag && void 0 !== node . memoizedProps . revealOrder ) {
2022-08-26 13:06:25 +03:00
if ( ( 64 & node . flags ) != 0 ) return node ;
2021-07-30 04:11:27 +03:00
} else if ( null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
}
2022-05-08 07:07:58 +03:00
if ( node === row ) break ;
2021-07-30 04:11:27 +03:00
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === row ) return null ;
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
}
return null ;
}
2022-06-15 17:36:57 +03:00
var hydrationParentFiber = null , nextHydratableInstance = null , isHydrating = ! 1 ;
2021-10-21 08:12:50 +03:00
function deleteHydratableInstance ( returnFiber , instance ) {
2021-07-30 04:11:27 +03:00
switch ( returnFiber . tag ) {
case 3 :
2022-06-15 17:36:57 +03:00
parentContainer = returnFiber . stateNode . containerInfo , 1 === ( instance1 = instance ) . nodeType ? warnForDeletedHydratableElement ( parentContainer , instance1 ) : 8 === instance1 . nodeType || warnForDeletedHydratableText ( parentContainer , instance1 ) ;
2021-07-30 04:11:27 +03:00
break ;
case 5 :
2022-06-15 17:36:57 +03:00
returnFiber . type , parentProps = returnFiber . memoizedProps , parentInstance = returnFiber . stateNode , instance2 = instance , ! 0 !== parentProps [ SUPPRESS _HYDRATION _WARNING$1 ] && ( 1 === instance2 . nodeType ? warnForDeletedHydratableElement ( parentInstance , instance2 ) : 8 === instance2 . nodeType || warnForDeletedHydratableText ( parentInstance , instance2 ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
var parentContainer , instance1 , parentProps , parentInstance , instance2 , childToDelete = createFiberFromHostInstanceForDeletion ( ) ;
2022-08-26 13:06:25 +03:00
childToDelete . stateNode = instance , childToDelete . return = returnFiber , childToDelete . flags = 8 , null !== returnFiber . lastEffect ? ( returnFiber . lastEffect . nextEffect = childToDelete , returnFiber . lastEffect = childToDelete ) : returnFiber . firstEffect = returnFiber . lastEffect = childToDelete ;
2021-07-30 04:11:27 +03:00
}
function insertNonHydratedInstance ( returnFiber , fiber ) {
2022-08-26 13:06:25 +03:00
switch ( fiber . flags = - 1025 & fiber . flags | 2 , returnFiber . tag ) {
2021-07-30 04:11:27 +03:00
case 3 :
var parentContainer = returnFiber . stateNode . containerInfo ;
switch ( fiber . tag ) {
case 5 :
2022-06-15 17:36:57 +03:00
var parentContainer1 , type , type1 = fiber . type ;
fiber . pendingProps , warnForInsertedHydratedElement ( parentContainer1 = parentContainer , type1 ) ;
2021-07-30 04:11:27 +03:00
break ;
case 6 :
2022-04-29 08:58:59 +03:00
var parentContainer2 , text , text1 = fiber . pendingProps ;
warnForInsertedHydratedText ( parentContainer2 = parentContainer , text1 ) ;
2021-07-30 04:11:27 +03:00
}
break ;
case 5 :
2021-09-08 12:45:39 +03:00
returnFiber . type ;
2022-04-29 08:58:59 +03:00
var parentProps , parentProps1 = returnFiber . memoizedProps , parentInstance = returnFiber . stateNode ;
2021-07-30 04:11:27 +03:00
switch ( fiber . tag ) {
case 5 :
2022-06-15 17:36:57 +03:00
var parentProps2 , parentInstance1 , type2 , _type = fiber . type ;
fiber . pendingProps , parentProps2 = parentProps1 , parentInstance1 = parentInstance , type2 = _type , ! 0 !== parentProps2 [ SUPPRESS _HYDRATION _WARNING$1 ] && warnForInsertedHydratedElement ( parentInstance1 , type2 ) ;
2021-07-30 04:11:27 +03:00
break ;
case 6 :
2022-04-29 08:58:59 +03:00
var parentProps3 , parentInstance2 , text2 , _text = fiber . pendingProps ;
parentProps3 = parentProps1 , parentInstance2 = parentInstance , text2 = _text , ! 0 !== parentProps3 [ SUPPRESS _HYDRATION _WARNING$1 ] && warnForInsertedHydratedText ( parentInstance2 , text2 ) ;
2021-07-30 04:11:27 +03:00
break ;
case 13 :
2022-04-29 08:58:59 +03:00
parentProps1 [ SUPPRESS _HYDRATION _WARNING$1 ] ;
2021-07-30 04:11:27 +03:00
}
break ;
2021-08-03 18:52:47 +03:00
default :
return ;
2021-07-30 04:11:27 +03:00
}
}
function tryHydrate ( fiber , nextInstance ) {
switch ( fiber . tag ) {
case 5 :
2022-06-15 17:36:57 +03:00
var instance , type , type1 = fiber . type ;
2021-08-10 11:52:28 +03:00
fiber . pendingProps ;
2022-06-15 17:36:57 +03:00
var instance1 = ( instance = nextInstance , type = type1 , 1 !== instance . nodeType || type . toLowerCase ( ) !== instance . nodeName . toLowerCase ( ) ? null : instance ) ;
if ( null !== instance1 ) return fiber . stateNode = instance1 , ! 0 ;
2021-07-30 04:11:27 +03:00
return ! 1 ;
case 6 :
2022-08-26 13:06:25 +03:00
var instance2 , text , text1 = fiber . pendingProps , textInstance = ( instance2 = nextInstance , text = text1 , "" === text || 3 !== instance2 . nodeType ? null : instance2 ) ;
2021-07-30 04:11:27 +03:00
if ( null !== textInstance ) return fiber . stateNode = textInstance , ! 0 ;
return ! 1 ;
2021-08-03 18:52:47 +03:00
default :
return ! 1 ;
2021-07-30 04:11:27 +03:00
}
}
function tryToClaimNextHydratableInstance ( fiber ) {
2022-06-15 17:36:57 +03:00
if ( isHydrating ) {
2021-07-30 04:11:27 +03:00
var nextInstance = nextHydratableInstance ;
2021-09-16 07:23:33 +03:00
if ( ! nextInstance ) {
2022-06-15 17:36:57 +03:00
insertNonHydratedInstance ( hydrationParentFiber , fiber ) , isHydrating = ! 1 , hydrationParentFiber = fiber ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-07-30 04:11:27 +03:00
var firstAttemptedInstance = nextInstance ;
if ( ! tryHydrate ( fiber , nextInstance ) ) {
2021-09-16 07:23:33 +03:00
if ( ! ( nextInstance = getNextHydratableSibling ( firstAttemptedInstance ) ) || ! tryHydrate ( fiber , nextInstance ) ) {
2022-06-15 17:36:57 +03:00
insertNonHydratedInstance ( hydrationParentFiber , fiber ) , isHydrating = ! 1 , hydrationParentFiber = fiber ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-07-30 04:11:27 +03:00
deleteHydratableInstance ( hydrationParentFiber , firstAttemptedInstance ) ;
}
hydrationParentFiber = fiber , nextHydratableInstance = getFirstHydratableChild ( nextInstance ) ;
}
}
function popToNextHostParent ( fiber ) {
for ( var parent = fiber . return ; null !== parent && 5 !== parent . tag && 3 !== parent . tag && 13 !== parent . tag ; ) parent = parent . return ;
hydrationParentFiber = parent ;
}
2022-06-15 17:36:57 +03:00
function popHydrationState ( fiber ) {
if ( fiber !== hydrationParentFiber ) return ! 1 ;
if ( ! isHydrating ) return popToNextHostParent ( fiber ) , isHydrating = ! 0 , ! 1 ;
var type = fiber . type ;
if ( 5 !== fiber . tag || "head" !== type && "body" !== type && ! shouldSetTextContent ( type , fiber . memoizedProps ) ) for ( var nextInstance = nextHydratableInstance ; nextInstance ; ) deleteHydratableInstance ( fiber , nextInstance ) , nextInstance = getNextHydratableSibling ( nextInstance ) ;
return popToNextHostParent ( fiber ) , nextHydratableInstance = 13 === fiber . tag ? function ( fiber ) {
var suspenseState = fiber . memoizedState , suspenseInstance = null !== suspenseState ? suspenseState . dehydrated : null ;
if ( ! suspenseInstance ) throw Error ( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-03-08 17:35:18 +03:00
return function ( suspenseInstance ) {
2021-09-08 12:45:39 +03:00
for ( var node = suspenseInstance . nextSibling , depth = 0 ; node ; ) {
if ( 8 === node . nodeType ) {
var data = node . data ;
2022-05-04 17:25:28 +03:00
if ( "/$" === data ) {
2021-09-08 12:45:39 +03:00
if ( 0 === depth ) return getNextHydratableSibling ( node ) ;
depth -- ;
2022-05-04 17:25:28 +03:00
} else ( "$" === data || "$!" === data || "$?" === data ) && depth ++ ;
2021-09-08 12:45:39 +03:00
}
node = node . nextSibling ;
}
return null ;
2022-06-15 17:36:57 +03:00
} ( suspenseInstance ) ;
} ( fiber ) : hydrationParentFiber ? getNextHydratableSibling ( fiber . stateNode ) : null , ! 0 ;
2021-07-30 04:11:27 +03:00
}
function resetHydrationState ( ) {
2022-06-15 17:36:57 +03:00
hydrationParentFiber = null , nextHydratableInstance = null , isHydrating = ! 1 ;
2021-07-30 04:11:27 +03:00
}
2021-08-07 11:27:52 +03:00
var workInProgressSources = [ ] ;
2021-07-30 04:11:27 +03:00
function resetWorkInProgressVersions ( ) {
2021-08-03 18:52:47 +03:00
for ( var i = 0 ; i < workInProgressSources . length ; i ++ ) workInProgressSources [ i ] . _workInProgressVersionPrimary = null ;
2021-07-30 04:11:27 +03:00
workInProgressSources . length = 0 ;
}
function setWorkInProgressVersion ( mutableSource , version ) {
mutableSource . _workInProgressVersionPrimary = version , workInProgressSources . push ( mutableSource ) ;
}
2022-01-02 23:54:58 +03:00
rendererSigil$1 = { } ;
2021-08-07 11:27:52 +03:00
var ReactCurrentDispatcher$1 = ReactSharedInternals . ReactCurrentDispatcher , ReactCurrentBatchConfig$1 = ReactSharedInternals . ReactCurrentBatchConfig ;
2022-01-02 23:54:58 +03:00
didWarnAboutUseOpaqueIdentifier = { } , didWarnAboutMismatchedHooksForComponent = new Set ( ) ;
2022-08-26 11:45:49 +03:00
var renderLanes = NoLanes , currentlyRenderingFiber$1 = null , currentHook = null , workInProgressHook = null , didScheduleRenderPhaseUpdate = ! 1 , didScheduleRenderPhaseUpdateDuringThisPass = ! 1 , currentHookNameInDev = null , hookTypesDev = null , hookTypesUpdateIndexDev = - 1 , ignorePreviousDependencies = ! 1 ;
2021-07-30 04:11:27 +03:00
function mountHookTypesDev ( ) {
var hookName = currentHookNameInDev ;
2021-08-03 18:52:47 +03:00
null === hookTypesDev ? hookTypesDev = [
hookName
] : hookTypesDev . push ( hookName ) ;
2021-07-30 04:11:27 +03:00
}
function updateHookTypesDev ( ) {
var hookName = currentHookNameInDev ;
2022-04-03 16:13:15 +03:00
null !== hookTypesDev && hookTypesDev [ ++ hookTypesUpdateIndexDev ] !== hookName && warnOnHookMismatchInDev ( hookName ) ;
2021-07-30 04:11:27 +03:00
}
function checkDepsAreArrayDev ( deps ) {
2022-06-15 17:36:57 +03:00
null == deps || Array . isArray ( deps ) || error ( "%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array." , currentHookNameInDev , typeof deps ) ;
2021-07-30 04:11:27 +03:00
}
function warnOnHookMismatchInDev ( currentHookName ) {
var componentName = getComponentName ( currentlyRenderingFiber$1 . type ) ;
if ( ! didWarnAboutMismatchedHooksForComponent . has ( componentName ) && ( didWarnAboutMismatchedHooksForComponent . add ( componentName ) , null !== hookTypesDev ) ) {
2022-08-05 16:25:28 +03:00
for ( var table = "" , i = 0 ; i <= hookTypesUpdateIndexDev ; i ++ ) {
for ( var oldHookName = hookTypesDev [ i ] , newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName , row = i + 1 + ". " + oldHookName ; row . length < 30 ; ) row += " " ;
2022-05-04 17:25:28 +03:00
row += newHookName + "\n" , table += row ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
error ( "React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" , componentName , table ) ;
2021-07-30 04:11:27 +03:00
}
}
function throwInvalidHookError ( ) {
throw Error ( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." ) ;
}
function areHookInputsEqual ( nextDeps , prevDeps ) {
if ( ignorePreviousDependencies ) return ! 1 ;
2022-06-15 17:36:57 +03:00
if ( null === prevDeps ) return error ( "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders." , currentHookNameInDev ) , ! 1 ;
nextDeps . length !== prevDeps . length && error ( "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s" , currentHookNameInDev , "[" + prevDeps . join ( ", " ) + "]" , "[" + nextDeps . join ( ", " ) + "]" ) ;
2021-07-30 04:11:27 +03:00
for ( var i = 0 ; i < prevDeps . length && i < nextDeps . length ; i ++ ) if ( ! objectIs ( nextDeps [ i ] , prevDeps [ i ] ) ) return ! 1 ;
return ! 0 ;
}
function renderWithHooks ( current , workInProgress , Component , props , secondArg , nextRenderLanes ) {
2022-08-26 11:45:49 +03:00
renderLanes = nextRenderLanes , currentlyRenderingFiber$1 = workInProgress , hookTypesDev = null !== current ? current . _debugHookTypes : null , hookTypesUpdateIndexDev = - 1 , ignorePreviousDependencies = null !== current && current . type !== workInProgress . type , workInProgress . memoizedState = null , workInProgress . updateQueue = null , workInProgress . lanes = NoLanes , null !== current && null !== current . memoizedState ? ReactCurrentDispatcher$1 . current = HooksDispatcherOnUpdateInDEV : null !== hookTypesDev ? ReactCurrentDispatcher$1 . current = HooksDispatcherOnMountWithHookTypesInDEV : ReactCurrentDispatcher$1 . current = HooksDispatcherOnMountInDEV ;
2021-07-30 04:11:27 +03:00
var children = Component ( props , secondArg ) ;
if ( didScheduleRenderPhaseUpdateDuringThisPass ) {
var numberOfReRenders = 0 ;
do {
if ( didScheduleRenderPhaseUpdateDuringThisPass = ! 1 , ! ( numberOfReRenders < 25 ) ) throw Error ( "Too many re-renders. React limits the number of renders to prevent an infinite loop." ) ;
2022-06-15 17:36:57 +03:00
numberOfReRenders += 1 , ignorePreviousDependencies = ! 1 , currentHook = null , workInProgressHook = null , workInProgress . updateQueue = null , hookTypesUpdateIndexDev = - 1 , ReactCurrentDispatcher$1 . current = HooksDispatcherOnRerenderInDEV , children = Component ( props , secondArg ) ;
2021-07-30 04:11:27 +03:00
} while ( didScheduleRenderPhaseUpdateDuringThisPass )
}
ReactCurrentDispatcher$1 . current = ContextOnlyDispatcher , workInProgress . _debugHookTypes = hookTypesDev ;
2022-06-15 17:36:57 +03:00
var didRenderTooFewHooks = null !== currentHook && null !== currentHook . next ;
2022-08-26 11:45:49 +03:00
if ( renderLanes = NoLanes , currentlyRenderingFiber$1 = null , currentHook = null , workInProgressHook = null , currentHookNameInDev = null , hookTypesDev = null , hookTypesUpdateIndexDev = - 1 , didScheduleRenderPhaseUpdate = ! 1 , didRenderTooFewHooks ) throw Error ( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ) ;
2021-07-30 04:11:27 +03:00
return children ;
}
function bailoutHooks ( current , workInProgress , lanes ) {
2022-04-29 08:58:59 +03:00
var set , subset ;
2022-08-26 13:06:25 +03:00
workInProgress . updateQueue = current . updateQueue , workInProgress . flags &= - 517 , current . lanes = ( set = current . lanes ) & ~ lanes ;
2021-07-30 04:11:27 +03:00
}
function resetHooksAfterThrow ( ) {
if ( ReactCurrentDispatcher$1 . current = ContextOnlyDispatcher , didScheduleRenderPhaseUpdate ) {
for ( var hook = currentlyRenderingFiber$1 . memoizedState ; null !== hook ; ) {
var queue = hook . queue ;
null !== queue && ( queue . pending = null ) , hook = hook . next ;
}
didScheduleRenderPhaseUpdate = ! 1 ;
}
2022-08-26 11:45:49 +03:00
renderLanes = NoLanes , currentlyRenderingFiber$1 = null , currentHook = null , workInProgressHook = null , hookTypesDev = null , hookTypesUpdateIndexDev = - 1 , currentHookNameInDev = null , isUpdatingOpaqueValueInRenderPhase = ! 1 , didScheduleRenderPhaseUpdateDuringThisPass = ! 1 ;
2021-07-30 04:11:27 +03:00
}
function mountWorkInProgressHook ( ) {
var hook = {
memoizedState : null ,
baseState : null ,
baseQueue : null ,
queue : null ,
next : null
} ;
return null === workInProgressHook ? currentlyRenderingFiber$1 . memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook . next = hook , workInProgressHook ;
}
function updateWorkInProgressHook ( ) {
2022-06-15 17:36:57 +03:00
if ( null === currentHook ) {
2021-07-30 04:11:27 +03:00
var nextCurrentHook , nextWorkInProgressHook , current = currentlyRenderingFiber$1 . alternate ;
nextCurrentHook = null !== current ? current . memoizedState : null ;
2022-06-15 17:36:57 +03:00
} else nextCurrentHook = currentHook . next ;
2022-08-26 13:06:25 +03:00
if ( nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber$1 . memoizedState : workInProgressHook . next , null !== nextWorkInProgressHook ) nextWorkInProgressHook = ( workInProgressHook = nextWorkInProgressHook ) . next , currentHook = nextCurrentHook ;
2021-07-30 04:11:27 +03:00
else {
if ( ! ( null !== nextCurrentHook ) ) throw Error ( "Rendered more hooks than during the previous render." ) ;
var newHook = {
2022-06-15 17:36:57 +03:00
memoizedState : ( currentHook = nextCurrentHook ) . memoizedState ,
baseState : currentHook . baseState ,
baseQueue : currentHook . baseQueue ,
queue : currentHook . queue ,
2021-07-30 04:11:27 +03:00
next : null
} ;
null === workInProgressHook ? currentlyRenderingFiber$1 . memoizedState = workInProgressHook = newHook : workInProgressHook = workInProgressHook . next = newHook ;
}
return workInProgressHook ;
}
function basicStateReducer ( state , action ) {
2022-05-04 17:25:28 +03:00
return "function" == typeof action ? action ( state ) : action ;
2021-07-30 04:11:27 +03:00
}
function mountReducer ( reducer , initialArg , init ) {
var initialState , hook = mountWorkInProgressHook ( ) ;
initialState = void 0 !== init ? init ( initialArg ) : initialArg , hook . memoizedState = hook . baseState = initialState ;
var queue = hook . queue = {
pending : null ,
dispatch : null ,
lastRenderedReducer : reducer ,
lastRenderedState : initialState
} , dispatch = queue . dispatch = dispatchAction . bind ( null , currentlyRenderingFiber$1 , queue ) ;
2021-08-03 18:52:47 +03:00
return [
hook . memoizedState ,
dispatch
] ;
2021-07-30 04:11:27 +03:00
}
function updateReducer ( reducer , initialArg , init ) {
var hook = updateWorkInProgressHook ( ) , queue = hook . queue ;
if ( ! ( null !== queue ) ) throw Error ( "Should have a queue. This is likely a bug in React. Please file an issue." ) ;
queue . lastRenderedReducer = reducer ;
2022-06-15 17:36:57 +03:00
var current = currentHook , baseQueue = current . baseQueue , pendingQueue = queue . pending ;
2021-07-30 04:11:27 +03:00
if ( null !== pendingQueue ) {
if ( null !== baseQueue ) {
var baseFirst = baseQueue . next , pendingFirst = pendingQueue . next ;
baseQueue . next = pendingFirst , pendingQueue . next = baseFirst ;
}
2022-06-15 17:36:57 +03:00
current . baseQueue !== baseQueue && error ( "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ) , current . baseQueue = baseQueue = pendingQueue , queue . pending = null ;
2021-07-30 04:11:27 +03:00
}
if ( null !== baseQueue ) {
2021-10-21 08:12:50 +03:00
var first = baseQueue . next , newState = current . baseState , newBaseState = null , newBaseQueueFirst = null , newBaseQueueLast = null , update = first ;
2021-07-30 04:11:27 +03:00
do {
2022-04-29 08:58:59 +03:00
var updateLane = update . lane ;
2022-06-15 17:36:57 +03:00
if ( isSubsetOfLanes ( renderLanes , updateLane ) ) {
2021-07-30 04:11:27 +03:00
if ( null !== newBaseQueueLast ) {
var _clone = {
2022-08-26 13:06:25 +03:00
lane : 0 ,
2021-07-30 04:11:27 +03:00
action : update . action ,
eagerReducer : update . eagerReducer ,
eagerState : update . eagerState ,
next : null
} ;
newBaseQueueLast = newBaseQueueLast . next = _clone ;
}
2021-08-10 11:52:28 +03:00
newState = update . eagerReducer === reducer ? update . eagerState : reducer ( newState , update . action ) ;
2021-07-30 04:11:27 +03:00
} else {
2022-04-29 08:58:59 +03:00
var a , b , clone = {
2021-07-30 04:11:27 +03:00
lane : updateLane ,
action : update . action ,
eagerReducer : update . eagerReducer ,
eagerState : update . eagerState ,
next : null
} ;
2022-08-26 13:06:25 +03:00
null === newBaseQueueLast ? ( newBaseQueueFirst = newBaseQueueLast = clone , newBaseState = newState ) : newBaseQueueLast = newBaseQueueLast . next = clone , currentlyRenderingFiber$1 . lanes = ( a = currentlyRenderingFiber$1 . lanes , a | updateLane ) , markSkippedUpdateLanes ( updateLane ) ;
2021-07-30 04:11:27 +03:00
}
update = update . next ;
} while ( null !== update && update !== first )
null === newBaseQueueLast ? newBaseState = newState : newBaseQueueLast . next = newBaseQueueFirst , objectIs ( newState , hook . memoizedState ) || markWorkInProgressReceivedUpdate ( ) , hook . memoizedState = newState , hook . baseState = newBaseState , hook . baseQueue = newBaseQueueLast , queue . lastRenderedState = newState ;
}
var dispatch = queue . dispatch ;
2021-08-03 18:52:47 +03:00
return [
hook . memoizedState ,
dispatch
] ;
2021-07-30 04:11:27 +03:00
}
function rerenderReducer ( reducer , initialArg , init ) {
var hook = updateWorkInProgressHook ( ) , queue = hook . queue ;
if ( ! ( null !== queue ) ) throw Error ( "Should have a queue. This is likely a bug in React. Please file an issue." ) ;
queue . lastRenderedReducer = reducer ;
var dispatch = queue . dispatch , lastRenderPhaseUpdate = queue . pending , newState = hook . memoizedState ;
if ( null !== lastRenderPhaseUpdate ) {
queue . pending = null ;
var firstRenderPhaseUpdate = lastRenderPhaseUpdate . next , update = firstRenderPhaseUpdate ;
2021-08-10 11:52:28 +03:00
do newState = reducer ( newState , update . action ) , update = update . next ;
while ( update !== firstRenderPhaseUpdate )
2021-07-30 04:11:27 +03:00
objectIs ( newState , hook . memoizedState ) || markWorkInProgressReceivedUpdate ( ) , hook . memoizedState = newState , null === hook . baseQueue && ( hook . baseState = newState ) , queue . lastRenderedState = newState ;
}
2021-08-03 18:52:47 +03:00
return [
newState ,
dispatch
] ;
2021-07-30 04:11:27 +03:00
}
function readFromUnsubcribedMutableSource ( root , source , getSnapshot ) {
2022-06-15 17:36:57 +03:00
null == ( mutableSource1 = source ) . _currentPrimaryRenderer ? mutableSource1 . _currentPrimaryRenderer = rendererSigil$1 : mutableSource1 . _currentPrimaryRenderer !== rendererSigil$1 && error ( "Detected multiple renderers concurrently rendering the same mutable source. This is currently unsupported." ) ;
2022-04-29 08:58:59 +03:00
var mutableSource , mutableSource1 , mutableSource2 , version = ( 0 , source . _getVersion ) ( source . _source ) , isSafeToReadFromSource = ! 1 , currentRenderVersion = source . _workInProgressVersionPrimary ;
2022-08-26 13:06:25 +03:00
if ( null !== currentRenderVersion ? isSafeToReadFromSource = currentRenderVersion === version : ( isSafeToReadFromSource = isSubsetOfLanes ( renderLanes , root . mutableReadLanes ) , isSafeToReadFromSource && setWorkInProgressVersion ( source , version ) ) , isSafeToReadFromSource ) {
2021-07-30 04:11:27 +03:00
var snapshot = getSnapshot ( source . _source ) ;
2022-06-15 17:36:57 +03:00
return "function" == typeof snapshot && error ( "Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing." ) , snapshot ;
2021-07-30 04:11:27 +03:00
}
2021-10-21 08:12:50 +03:00
throw mutableSource = source , workInProgressSources . push ( mutableSource ) , Error ( "Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
}
function useMutableSource ( hook , source , getSnapshot , subscribe ) {
2022-06-15 17:36:57 +03:00
var root = workInProgressRoot ;
if ( ! ( null !== root ) ) throw Error ( "Expected a work-in-progress root. This is a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
var getVersion = source . _getVersion , version = getVersion ( source . _source ) , dispatcher = ReactCurrentDispatcher$1 . current , _dispatcher$useState = dispatcher . useState ( function ( ) {
2022-06-15 17:36:57 +03:00
return readFromUnsubcribedMutableSource ( root , source , getSnapshot ) ;
2021-07-30 04:11:27 +03:00
} ) , currentSnapshot = _dispatcher$useState [ 0 ] , setSnapshot = _dispatcher$useState [ 1 ] , snapshot = currentSnapshot , stateHook = workInProgressHook , memoizedState = hook . memoizedState , refs = memoizedState . refs , prevGetSnapshot = refs . getSnapshot , prevSource = memoizedState . source , prevSubscribe = memoizedState . subscribe , fiber = currentlyRenderingFiber$1 ;
if ( hook . memoizedState = {
refs : refs ,
source : source ,
subscribe : subscribe
} , dispatcher . useEffect ( function ( ) {
2022-05-09 19:36:40 +03:00
refs . getSnapshot = getSnapshot , refs . setSnapshot = setSnapshot ;
var maybeNewVersion = getVersion ( source . _source ) ;
if ( ! objectIs ( version , maybeNewVersion ) ) {
2021-07-30 04:11:27 +03:00
var maybeNewSnapshot = getSnapshot ( source . _source ) ;
2022-08-26 11:45:49 +03:00
if ( "function" == typeof maybeNewSnapshot && error ( "Mutable source should not return a function as the snapshot value. Functions may close over mutable values and cause tearing." ) , ! objectIs ( snapshot , maybeNewSnapshot ) ) {
setSnapshot ( maybeNewSnapshot ) ;
var lane = requestUpdateLane ( fiber ) ;
markRootMutableRead ( root , lane ) ;
}
! function ( root , entangledLanes ) {
2021-09-08 12:45:39 +03:00
root . entangledLanes |= entangledLanes ;
for ( var entanglements = root . entanglements , lanes = entangledLanes ; lanes > 0 ; ) {
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index ;
entanglements [ index ] |= entangledLanes , lanes &= ~ lane ;
}
2022-06-15 17:36:57 +03:00
} ( root , root . mutableReadLanes ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-03 18:52:47 +03:00
} , [
getSnapshot ,
2021-07-30 04:11:27 +03:00
source ,
2021-08-03 18:52:47 +03:00
subscribe
] ) , dispatcher . useEffect ( function ( ) {
2022-07-06 06:53:11 +03:00
var handleChange = function ( ) {
2021-07-30 04:11:27 +03:00
var latestGetSnapshot = refs . getSnapshot , latestSetSnapshot = refs . setSnapshot ;
try {
latestSetSnapshot ( latestGetSnapshot ( source . _source ) ) ;
var lane = requestUpdateLane ( fiber ) ;
2022-06-15 17:36:57 +03:00
markRootMutableRead ( root , lane ) ;
2021-07-30 04:11:27 +03:00
} catch ( error ) {
latestSetSnapshot ( function ( ) {
throw error ;
} ) ;
}
2022-07-06 06:53:11 +03:00
} , unsubscribe = subscribe ( source . _source , handleChange ) ;
2022-06-15 17:36:57 +03:00
return "function" != typeof unsubscribe && error ( "Mutable source subscribe function must return an unsubscribe function." ) , unsubscribe ;
2021-08-03 18:52:47 +03:00
} , [
source ,
subscribe
] ) , ! objectIs ( prevGetSnapshot , getSnapshot ) || ! objectIs ( prevSource , source ) || ! objectIs ( prevSubscribe , subscribe ) ) {
2021-07-30 04:11:27 +03:00
var newQueue = {
pending : null ,
dispatch : null ,
lastRenderedReducer : basicStateReducer ,
lastRenderedState : snapshot
} ;
2022-06-15 17:36:57 +03:00
newQueue . dispatch = setSnapshot = dispatchAction . bind ( null , currentlyRenderingFiber$1 , newQueue ) , stateHook . queue = newQueue , stateHook . baseQueue = null , snapshot = readFromUnsubcribedMutableSource ( root , source , getSnapshot ) , stateHook . memoizedState = stateHook . baseState = snapshot ;
2021-07-30 04:11:27 +03:00
}
return snapshot ;
}
function mountMutableSource ( source , getSnapshot , subscribe ) {
var hook = mountWorkInProgressHook ( ) ;
return hook . memoizedState = {
refs : {
getSnapshot : getSnapshot ,
setSnapshot : null
} ,
source : source ,
subscribe : subscribe
} , useMutableSource ( hook , source , getSnapshot , subscribe ) ;
}
function updateMutableSource ( source , getSnapshot , subscribe ) {
2022-08-26 13:06:25 +03:00
return useMutableSource ( updateWorkInProgressHook ( ) , source , getSnapshot , subscribe ) ;
2021-07-30 04:11:27 +03:00
}
function mountState ( initialState ) {
var hook = mountWorkInProgressHook ( ) ;
2022-05-04 17:25:28 +03:00
"function" == typeof initialState && ( initialState = initialState ( ) ) , hook . memoizedState = hook . baseState = initialState ;
2021-07-30 04:11:27 +03:00
var queue = hook . queue = {
pending : null ,
dispatch : null ,
lastRenderedReducer : basicStateReducer ,
lastRenderedState : initialState
} , dispatch = queue . dispatch = dispatchAction . bind ( null , currentlyRenderingFiber$1 , queue ) ;
2021-08-03 18:52:47 +03:00
return [
hook . memoizedState ,
dispatch
] ;
2021-07-30 04:11:27 +03:00
}
function pushEffect ( tag , create , destroy , deps ) {
var effect = {
tag : tag ,
create : create ,
destroy : destroy ,
deps : deps ,
next : null
} , componentUpdateQueue = currentlyRenderingFiber$1 . updateQueue ;
2021-09-08 12:45:39 +03:00
if ( null === componentUpdateQueue ) componentUpdateQueue = {
lastEffect : null
} , currentlyRenderingFiber$1 . updateQueue = componentUpdateQueue , componentUpdateQueue . lastEffect = effect . next = effect ;
2021-07-30 04:11:27 +03:00
else {
var lastEffect = componentUpdateQueue . lastEffect ;
if ( null === lastEffect ) componentUpdateQueue . lastEffect = effect . next = effect ;
else {
var firstEffect = lastEffect . next ;
lastEffect . next = effect , effect . next = firstEffect , componentUpdateQueue . lastEffect = effect ;
}
}
return effect ;
}
function mountRef ( initialValue ) {
var hook = mountWorkInProgressHook ( ) , ref = {
current : initialValue
} ;
return Object . seal ( ref ) , hook . memoizedState = ref , ref ;
}
function updateRef ( initialValue ) {
return updateWorkInProgressHook ( ) . memoizedState ;
}
function mountEffectImpl ( fiberFlags , hookFlags , create , deps ) {
var hook = mountWorkInProgressHook ( ) ;
currentlyRenderingFiber$1 . flags |= fiberFlags , hook . memoizedState = pushEffect ( 1 | hookFlags , create , void 0 , void 0 === deps ? null : deps ) ;
}
function updateEffectImpl ( fiberFlags , hookFlags , create , deps ) {
var hook = updateWorkInProgressHook ( ) , nextDeps = void 0 === deps ? null : deps , destroy = void 0 ;
2022-06-15 17:36:57 +03:00
if ( null !== currentHook ) {
var prevEffect = currentHook . memoizedState ;
2021-09-16 07:23:33 +03:00
if ( destroy = prevEffect . destroy , null !== nextDeps && areHookInputsEqual ( nextDeps , prevEffect . deps ) ) {
pushEffect ( hookFlags , create , destroy , nextDeps ) ;
return ;
}
2021-07-30 04:11:27 +03:00
}
currentlyRenderingFiber$1 . flags |= fiberFlags , hook . memoizedState = pushEffect ( 1 | hookFlags , create , destroy , nextDeps ) ;
}
function mountEffect ( create , deps ) {
2022-08-26 13:06:25 +03:00
return "undefined" != typeof jest && warnIfNotCurrentlyActingEffectsInDEV ( currentlyRenderingFiber$1 ) , mountEffectImpl ( 516 , 4 , create , deps ) ;
2021-07-30 04:11:27 +03:00
}
function updateEffect ( create , deps ) {
2022-08-26 13:06:25 +03:00
return "undefined" != typeof jest && warnIfNotCurrentlyActingEffectsInDEV ( currentlyRenderingFiber$1 ) , updateEffectImpl ( 516 , 4 , create , deps ) ;
2021-07-30 04:11:27 +03:00
}
function mountLayoutEffect ( create , deps ) {
2022-08-26 13:06:25 +03:00
return mountEffectImpl ( 4 , 2 , create , deps ) ;
2021-07-30 04:11:27 +03:00
}
function updateLayoutEffect ( create , deps ) {
2022-08-26 13:06:25 +03:00
return updateEffectImpl ( 4 , 2 , create , deps ) ;
2021-07-30 04:11:27 +03:00
}
function imperativeHandleEffect ( create , ref ) {
2022-05-04 17:25:28 +03:00
if ( "function" == typeof ref ) {
2021-07-30 04:11:27 +03:00
var refCallback = ref ;
return refCallback ( create ( ) ) , function ( ) {
refCallback ( null ) ;
} ;
}
if ( null != ref ) {
var refObject = ref ;
2022-06-15 17:36:57 +03:00
refObject . hasOwnProperty ( "current" ) || error ( "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s." , "an object with keys {" + Object . keys ( refObject ) . join ( ", " ) + "}" ) ;
2021-07-30 04:11:27 +03:00
var _inst2 = create ( ) ;
return refObject . current = _inst2 , function ( ) {
refObject . current = null ;
} ;
}
}
function mountImperativeHandle ( ref , create , deps ) {
2022-06-15 17:36:57 +03:00
"function" != typeof create && error ( "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s." , null !== create ? typeof create : "null" ) ;
2021-08-03 18:52:47 +03:00
var effectDeps = null != deps ? deps . concat ( [
ref
] ) : null ;
2022-08-26 13:06:25 +03:00
return mountEffectImpl ( 4 , 2 , imperativeHandleEffect . bind ( null , create , ref ) , effectDeps ) ;
2021-07-30 04:11:27 +03:00
}
function updateImperativeHandle ( ref , create , deps ) {
2022-06-15 17:36:57 +03:00
"function" != typeof create && error ( "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s." , null !== create ? typeof create : "null" ) ;
2021-08-03 18:52:47 +03:00
var effectDeps = null != deps ? deps . concat ( [
ref
] ) : null ;
2022-08-26 13:06:25 +03:00
return updateEffectImpl ( 4 , 2 , imperativeHandleEffect . bind ( null , create , ref ) , effectDeps ) ;
2021-07-30 04:11:27 +03:00
}
2022-01-02 23:54:58 +03:00
function mountDebugValue ( value , formatterFn ) { }
2021-07-30 04:11:27 +03:00
var updateDebugValue = mountDebugValue ;
function mountCallback ( callback , deps ) {
2021-08-04 13:27:17 +03:00
return mountWorkInProgressHook ( ) . memoizedState = [
2021-08-03 18:52:47 +03:00
callback ,
void 0 === deps ? null : deps
] , callback ;
2021-07-30 04:11:27 +03:00
}
function updateCallback ( callback , deps ) {
var hook = updateWorkInProgressHook ( ) , nextDeps = void 0 === deps ? null : deps , prevState = hook . memoizedState ;
2021-08-03 18:52:47 +03:00
return null !== prevState && null !== nextDeps && areHookInputsEqual ( nextDeps , prevState [ 1 ] ) ? prevState [ 0 ] : ( hook . memoizedState = [
callback ,
nextDeps
] , callback ) ;
2021-07-30 04:11:27 +03:00
}
function mountMemo ( nextCreate , deps ) {
var hook = mountWorkInProgressHook ( ) , nextValue = nextCreate ( ) ;
2021-08-03 18:52:47 +03:00
return hook . memoizedState = [
nextValue ,
void 0 === deps ? null : deps
] , nextValue ;
2021-07-30 04:11:27 +03:00
}
function updateMemo ( nextCreate , deps ) {
var hook = updateWorkInProgressHook ( ) , nextDeps = void 0 === deps ? null : deps , prevState = hook . memoizedState ;
2021-08-03 18:52:47 +03:00
if ( null !== prevState && null !== nextDeps && areHookInputsEqual ( nextDeps , prevState [ 1 ] ) ) return prevState [ 0 ] ;
2021-07-30 04:11:27 +03:00
var nextValue = nextCreate ( ) ;
2021-08-03 18:52:47 +03:00
return hook . memoizedState = [
nextValue ,
nextDeps
] , nextValue ;
2021-07-30 04:11:27 +03:00
}
function mountDeferredValue ( value ) {
var _mountState = mountState ( value ) , prevValue = _mountState [ 0 ] , setValue = _mountState [ 1 ] ;
return mountEffect ( function ( ) {
var prevTransition = ReactCurrentBatchConfig$1 . transition ;
ReactCurrentBatchConfig$1 . transition = 1 ;
try {
setValue ( value ) ;
} finally {
ReactCurrentBatchConfig$1 . transition = prevTransition ;
}
2021-08-03 18:52:47 +03:00
} , [
value
] ) , prevValue ;
2021-07-30 04:11:27 +03:00
}
function updateDeferredValue ( value ) {
2022-07-20 11:25:26 +03:00
var _updateState = updateReducer ( basicStateReducer ) , prevValue = _updateState [ 0 ] , setValue = _updateState [ 1 ] ;
2021-07-30 04:11:27 +03:00
return updateEffect ( function ( ) {
var prevTransition = ReactCurrentBatchConfig$1 . transition ;
ReactCurrentBatchConfig$1 . transition = 1 ;
try {
setValue ( value ) ;
} finally {
ReactCurrentBatchConfig$1 . transition = prevTransition ;
}
2021-08-03 18:52:47 +03:00
} , [
value
] ) , prevValue ;
2021-07-30 04:11:27 +03:00
}
function rerenderDeferredValue ( value ) {
2022-07-20 11:25:26 +03:00
var _rerenderState = rerenderReducer ( basicStateReducer ) , prevValue = _rerenderState [ 0 ] , setValue = _rerenderState [ 1 ] ;
2021-07-30 04:11:27 +03:00
return updateEffect ( function ( ) {
var prevTransition = ReactCurrentBatchConfig$1 . transition ;
ReactCurrentBatchConfig$1 . transition = 1 ;
try {
setValue ( value ) ;
} finally {
ReactCurrentBatchConfig$1 . transition = prevTransition ;
}
2021-08-03 18:52:47 +03:00
} , [
value
] ) , prevValue ;
2021-07-30 04:11:27 +03:00
}
function startTransition ( setPending , callback ) {
var priorityLevel = getCurrentPriorityLevel ( ) ;
runWithPriority$1 ( priorityLevel < 98 ? 98 : priorityLevel , function ( ) {
setPending ( ! 0 ) ;
2022-08-26 11:45:49 +03:00
} ) , runWithPriority$1 ( priorityLevel > NormalPriority$1 ? NormalPriority$1 : priorityLevel , function ( ) {
2021-07-30 04:11:27 +03:00
var prevTransition = ReactCurrentBatchConfig$1 . transition ;
ReactCurrentBatchConfig$1 . transition = 1 ;
try {
setPending ( ! 1 ) , callback ( ) ;
} finally {
ReactCurrentBatchConfig$1 . transition = prevTransition ;
}
} ) ;
}
function mountTransition ( ) {
var _mountState2 = mountState ( ! 1 ) , isPending = _mountState2 [ 0 ] , setPending = _mountState2 [ 1 ] , start = startTransition . bind ( null , setPending ) ;
2021-08-03 18:52:47 +03:00
return mountRef ( start ) , [
start ,
isPending
] ;
2021-07-30 04:11:27 +03:00
}
function updateTransition ( ) {
2022-08-26 13:06:25 +03:00
var _updateState2 = updateReducer ( basicStateReducer ) , isPending = _updateState2 [ 0 ] ;
2021-08-03 18:52:47 +03:00
return [
updateRef ( ) . current ,
isPending
] ;
2021-07-30 04:11:27 +03:00
}
function rerenderTransition ( ) {
2022-08-26 13:06:25 +03:00
var _rerenderState2 = rerenderReducer ( basicStateReducer ) , isPending = _rerenderState2 [ 0 ] ;
2021-08-03 18:52:47 +03:00
return [
updateRef ( ) . current ,
isPending
] ;
2021-07-30 04:11:27 +03:00
}
var isUpdatingOpaqueValueInRenderPhase = ! 1 ;
function warnOnOpaqueIdentifierAccessInDEV ( fiber ) {
2022-05-04 17:25:28 +03:00
var name = getComponentName ( fiber . type ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
isRendering && ! didWarnAboutUseOpaqueIdentifier [ name ] && ( error ( "The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly." ) , didWarnAboutUseOpaqueIdentifier [ name ] = ! 0 ) ;
2021-07-30 04:11:27 +03:00
}
function mountOpaqueIdentifier ( ) {
var makeId = makeClientIdInDEV . bind ( null , warnOnOpaqueIdentifierAccessInDEV . bind ( null , currentlyRenderingFiber$1 ) ) ;
2022-06-15 17:36:57 +03:00
if ( isHydrating ) {
2022-05-09 19:36:40 +03:00
var attemptToReadValue , didUpgrade = ! 1 , fiber = currentlyRenderingFiber$1 , id = ( attemptToReadValue = function ( ) {
throw didUpgrade || ( didUpgrade = ! 0 , isUpdatingOpaqueValueInRenderPhase = ! 0 , setId ( makeId ( ) ) , isUpdatingOpaqueValueInRenderPhase = ! 1 , warnOnOpaqueIdentifierAccessInDEV ( fiber ) ) , Error ( "The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly." ) ;
} , {
2021-09-08 12:45:39 +03:00
$$typeof : REACT _OPAQUE _ID _TYPE ,
2022-05-09 19:36:40 +03:00
toString : attemptToReadValue ,
2021-09-08 12:45:39 +03:00
valueOf : attemptToReadValue
2022-05-09 19:36:40 +03:00
} ) , setId = mountState ( id ) [ 1 ] ;
2022-08-26 13:06:25 +03:00
return ( 2 & currentlyRenderingFiber$1 . mode ) == 0 && ( currentlyRenderingFiber$1 . flags |= 516 , pushEffect ( 5 , function ( ) {
2021-07-30 04:11:27 +03:00
setId ( makeId ( ) ) ;
} , void 0 , null ) ) , id ;
}
var _id = makeId ( ) ;
return mountState ( _id ) , _id ;
}
function updateOpaqueIdentifier ( ) {
2022-08-26 13:06:25 +03:00
var id = updateReducer ( basicStateReducer ) [ 0 ] ;
return id ;
2021-07-30 04:11:27 +03:00
}
function rerenderOpaqueIdentifier ( ) {
2022-08-26 13:06:25 +03:00
var id = rerenderReducer ( basicStateReducer ) [ 0 ] ;
return id ;
2021-07-30 04:11:27 +03:00
}
function dispatchAction ( fiber , queue , action ) {
2022-06-15 17:36:57 +03:00
"function" == typeof arguments [ 3 ] && error ( "State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()." ) ;
2021-07-30 04:11:27 +03:00
var eventTime = requestEventTime ( ) , lane = requestUpdateLane ( fiber ) , update = {
lane : lane ,
action : action ,
eagerReducer : null ,
eagerState : null ,
next : null
} , pending = queue . pending ;
null === pending ? update . next = update : ( update . next = pending . next , pending . next = update ) , queue . pending = update ;
var alternate = fiber . alternate ;
if ( fiber === currentlyRenderingFiber$1 || null !== alternate && alternate === currentlyRenderingFiber$1 ) didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = ! 0 ;
else {
2022-08-26 11:45:49 +03:00
if ( fiber . lanes === NoLanes && ( null === alternate || alternate . lanes === NoLanes ) ) {
2021-07-30 04:11:27 +03:00
var prevDispatcher , lastRenderedReducer = queue . lastRenderedReducer ;
if ( null !== lastRenderedReducer ) {
prevDispatcher = ReactCurrentDispatcher$1 . current , ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
var currentState = queue . lastRenderedState , eagerState = lastRenderedReducer ( currentState , action ) ;
if ( update . eagerReducer = lastRenderedReducer , update . eagerState = eagerState , objectIs ( eagerState , currentState ) ) return ;
2022-06-15 17:36:57 +03:00
} catch ( error1 ) { } finally {
2021-07-30 04:11:27 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
}
}
2022-05-04 17:25:28 +03:00
"undefined" != typeof jest && ( warnIfNotScopedWithMatchingAct ( fiber ) , warnIfNotCurrentlyActingUpdatesInDev ( fiber ) ) , scheduleUpdateOnFiber ( fiber , lane , eventTime ) ;
2021-07-30 04:11:27 +03:00
}
}
var ContextOnlyDispatcher = {
readContext : readContext ,
useCallback : throwInvalidHookError ,
useContext : throwInvalidHookError ,
useEffect : throwInvalidHookError ,
useImperativeHandle : throwInvalidHookError ,
useLayoutEffect : throwInvalidHookError ,
useMemo : throwInvalidHookError ,
useReducer : throwInvalidHookError ,
useRef : throwInvalidHookError ,
useState : throwInvalidHookError ,
useDebugValue : throwInvalidHookError ,
useDeferredValue : throwInvalidHookError ,
useTransition : throwInvalidHookError ,
useMutableSource : throwInvalidHookError ,
useOpaqueIdentifier : throwInvalidHookError ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-07-30 04:11:27 +03:00
} , HooksDispatcherOnMountInDEV = null , HooksDispatcherOnMountWithHookTypesInDEV = null , HooksDispatcherOnUpdateInDEV = null , HooksDispatcherOnRerenderInDEV = null , InvalidNestedHooksDispatcherOnMountInDEV = null , InvalidNestedHooksDispatcherOnUpdateInDEV = null , InvalidNestedHooksDispatcherOnRerenderInDEV = null , warnInvalidContextAccess = function ( ) {
2022-06-15 17:36:57 +03:00
error ( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ) ;
2021-07-30 04:11:27 +03:00
} , warnInvalidHookAccess = function ( ) {
2022-06-15 17:36:57 +03:00
error ( "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks" ) ;
2021-08-04 13:27:17 +03:00
} ;
HooksDispatcherOnMountInDEV = {
readContext : function ( context , observedBits ) {
return readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , mountHookTypesDev ( ) , checkDepsAreArrayDev ( deps ) , mountCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , mountHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , mountHookTypesDev ( ) , checkDepsAreArrayDev ( deps ) , mountEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , mountHookTypesDev ( ) , checkDepsAreArrayDev ( deps ) , mountImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , mountHookTypesDev ( ) , checkDepsAreArrayDev ( deps ) , mountLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , mountHookTypesDev ( ) , checkDepsAreArrayDev ( deps ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
2021-07-30 04:11:27 +03:00
try {
2021-08-04 13:27:17 +03:00
return mountMemo ( create , deps ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , mountHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
try {
return mountReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , mountHookTypesDev ( ) , mountRef ( initialValue ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , mountHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
try {
return mountState ( initialState ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , mountHookTypesDev ( ) , mountDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , mountHookTypesDev ( ) , mountDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , mountHookTypesDev ( ) , mountTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , mountHookTypesDev ( ) , mountMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , mountHookTypesDev ( ) , mountOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} , HooksDispatcherOnMountWithHookTypesInDEV = {
readContext : function ( context , observedBits ) {
return readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , updateHookTypesDev ( ) , mountCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , updateHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , updateHookTypesDev ( ) , mountEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , updateHookTypesDev ( ) , mountImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , updateHookTypesDev ( ) , mountLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
2021-07-30 04:11:27 +03:00
try {
2021-08-04 13:27:17 +03:00
return mountMemo ( create , deps ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
try {
return mountReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , updateHookTypesDev ( ) , mountRef ( initialValue ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
2021-07-30 04:11:27 +03:00
try {
2021-08-04 13:27:17 +03:00
return mountState ( initialState ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , updateHookTypesDev ( ) , mountDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , updateHookTypesDev ( ) , mountDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , updateHookTypesDev ( ) , mountTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , updateHookTypesDev ( ) , mountMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , updateHookTypesDev ( ) , mountOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} , HooksDispatcherOnUpdateInDEV = {
readContext : function ( context , observedBits ) {
return readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , updateHookTypesDev ( ) , updateCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , updateHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , updateHookTypesDev ( ) , updateEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , updateHookTypesDev ( ) , updateImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , updateHookTypesDev ( ) , updateLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
return updateMemo ( create , deps ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
return updateReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , updateHookTypesDev ( ) , updateRef ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
2022-07-20 11:25:26 +03:00
return updateReducer ( basicStateReducer ) ;
2021-08-04 13:27:17 +03:00
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , updateHookTypesDev ( ) , updateDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , updateHookTypesDev ( ) , updateDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , updateHookTypesDev ( ) , updateTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , updateHookTypesDev ( ) , updateMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , updateHookTypesDev ( ) , updateOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} , HooksDispatcherOnRerenderInDEV = {
readContext : function ( context , observedBits ) {
return readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , updateHookTypesDev ( ) , updateCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , updateHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , updateHookTypesDev ( ) , updateEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , updateHookTypesDev ( ) , updateImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , updateHookTypesDev ( ) , updateLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnRerenderInDEV ;
try {
return updateMemo ( create , deps ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnRerenderInDEV ;
try {
return rerenderReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , updateHookTypesDev ( ) , updateRef ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnRerenderInDEV ;
2021-07-30 04:11:27 +03:00
try {
2022-07-20 11:25:26 +03:00
return rerenderReducer ( basicStateReducer ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , updateHookTypesDev ( ) , updateDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , updateHookTypesDev ( ) , rerenderDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , updateHookTypesDev ( ) , rerenderTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , updateHookTypesDev ( ) , updateMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , updateHookTypesDev ( ) , rerenderOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} , InvalidNestedHooksDispatcherOnMountInDEV = {
readContext : function ( context , observedBits ) {
return warnInvalidContextAccess ( ) , readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
2021-07-30 04:11:27 +03:00
try {
2021-08-04 13:27:17 +03:00
return mountMemo ( create , deps ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
try {
return mountReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountRef ( initialValue ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnMountInDEV ;
try {
return mountState ( initialState ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , warnInvalidHookAccess ( ) , mountHookTypesDev ( ) , mountOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-10-10 06:47:11 +03:00
} , InvalidNestedHooksDispatcherOnUpdateInDEV = {
readContext : function ( context , observedBits ) {
return warnInvalidContextAccess ( ) , readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateCallback ( callback , deps ) ;
2021-10-10 06:47:11 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-10-10 06:47:11 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateEffect ( create , deps ) ;
2021-10-10 06:47:11 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateImperativeHandle ( ref , create , deps ) ;
2021-10-10 06:47:11 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateLayoutEffect ( create , deps ) ;
2021-10-10 06:47:11 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-10-10 06:47:11 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
return updateMemo ( create , deps ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-10-10 06:47:11 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
return updateReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateRef ( ) ;
2021-10-10 06:47:11 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-10-10 06:47:11 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
2022-07-20 11:25:26 +03:00
return updateReducer ( basicStateReducer ) ;
2021-10-10 06:47:11 +03:00
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateDebugValue ( ) ;
2021-10-10 06:47:11 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateDeferredValue ( value ) ;
2021-10-10 06:47:11 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateTransition ( ) ;
2021-10-10 06:47:11 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateMutableSource ( source , getSnapshot , subscribe ) ;
2021-10-10 06:47:11 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateOpaqueIdentifier ( ) ;
2021-10-10 06:47:11 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} , InvalidNestedHooksDispatcherOnRerenderInDEV = {
readContext : function ( context , observedBits ) {
return warnInvalidContextAccess ( ) , readContext ( context , observedBits ) ;
} ,
useCallback : function ( callback , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useCallback" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateCallback ( callback , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useContext : function ( context , observedBits ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useContext" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , readContext ( context , observedBits ) ;
2021-08-04 13:27:17 +03:00
} ,
useEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useEffect" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useImperativeHandle : function ( ref , create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useImperativeHandle" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateImperativeHandle ( ref , create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useLayoutEffect : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useLayoutEffect" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateLayoutEffect ( create , deps ) ;
2021-08-04 13:27:17 +03:00
} ,
useMemo : function ( create , deps ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useMemo" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
2021-10-10 06:47:11 +03:00
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
2021-08-04 13:27:17 +03:00
try {
return updateMemo ( create , deps ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
} ,
useReducer : function ( reducer , initialArg , init ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useReducer" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
return rerenderReducer ( reducer , initialArg , init ) ;
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
} ,
useRef : function ( initialValue ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useRef" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateRef ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useState : function ( initialState ) {
2022-05-04 17:25:28 +03:00
currentHookNameInDev = "useState" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) ;
2021-08-04 13:27:17 +03:00
var prevDispatcher = ReactCurrentDispatcher$1 . current ;
ReactCurrentDispatcher$1 . current = InvalidNestedHooksDispatcherOnUpdateInDEV ;
try {
2022-07-20 11:25:26 +03:00
return rerenderReducer ( basicStateReducer ) ;
2021-08-04 13:27:17 +03:00
} finally {
ReactCurrentDispatcher$1 . current = prevDispatcher ;
}
} ,
useDebugValue : function ( value , formatterFn ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDebugValue" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateDebugValue ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useDeferredValue : function ( value ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useDeferredValue" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , rerenderDeferredValue ( value ) ;
2021-08-04 13:27:17 +03:00
} ,
useTransition : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useTransition" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , rerenderTransition ( ) ;
2021-08-04 13:27:17 +03:00
} ,
useMutableSource : function ( source , getSnapshot , subscribe ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useMutableSource" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , updateMutableSource ( source , getSnapshot , subscribe ) ;
2021-08-04 13:27:17 +03:00
} ,
useOpaqueIdentifier : function ( ) {
2022-05-04 17:25:28 +03:00
return currentHookNameInDev = "useOpaqueIdentifier" , warnInvalidHookAccess ( ) , updateHookTypesDev ( ) , rerenderOpaqueIdentifier ( ) ;
2021-08-04 13:27:17 +03:00
} ,
2022-02-19 11:33:36 +03:00
unstable _isNewReconciler : ! 1
2021-08-04 13:27:17 +03:00
} ;
var now$1 = unstable _now , commitTime = 0 , profilerStartTime = - 1 ;
function recordCommitTime ( ) {
commitTime = now$1 ( ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function startProfilerTimer ( fiber ) {
profilerStartTime = now$1 ( ) , fiber . actualStartTime < 0 && ( fiber . actualStartTime = now$1 ( ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function stopProfilerTimerIfRunningAndRecordDelta ( fiber , overrideBaseTime ) {
if ( profilerStartTime >= 0 ) {
var elapsedTime = now$1 ( ) - profilerStartTime ;
fiber . actualDuration += elapsedTime , overrideBaseTime && ( fiber . selfBaseDuration = elapsedTime ) , profilerStartTime = - 1 ;
2021-07-30 04:11:27 +03:00
}
}
2021-08-04 13:27:17 +03:00
function transferActualDuration ( fiber ) {
for ( var child = fiber . child ; child ; ) fiber . actualDuration += child . actualDuration , child = child . sibling ;
2021-07-30 04:11:27 +03:00
}
2021-08-07 11:27:52 +03:00
var ReactCurrentOwner$1 = ReactSharedInternals . ReactCurrentOwner , didReceiveUpdate = ! 1 ;
2021-08-04 13:27:17 +03:00
function reconcileChildren ( current , workInProgress , nextChildren , renderLanes ) {
null === current ? workInProgress . child = mountChildFibers ( workInProgress , null , nextChildren , renderLanes ) : workInProgress . child = reconcileChildFibers ( workInProgress , current . child , nextChildren , renderLanes ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateForwardRef ( current , workInProgress , Component , nextProps , renderLanes ) {
if ( workInProgress . type !== workInProgress . elementType ) {
2022-04-29 08:58:59 +03:00
var rendering , nextChildren , innerPropTypes = Component . propTypes ;
2022-05-04 17:25:28 +03:00
innerPropTypes && checkPropTypes ( innerPropTypes , nextProps , "prop" , getComponentName ( Component ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-04-29 08:58:59 +03:00
var rendering1 , render = Component . render , ref = workInProgress . ref ;
2022-04-05 09:25:23 +03:00
if ( prepareToReadContext ( workInProgress , renderLanes ) , ReactCurrentOwner$1 . current = workInProgress , isRendering = ! 0 , nextChildren = renderWithHooks ( current , workInProgress , render , nextProps , ref , renderLanes ) , 1 & workInProgress . mode ) {
2021-08-04 13:27:17 +03:00
disableLogs ( ) ;
try {
nextChildren = renderWithHooks ( current , workInProgress , render , nextProps , ref , renderLanes ) ;
} finally {
reenableLogs ( ) ;
}
2021-07-30 04:11:27 +03:00
}
2022-04-05 09:25:23 +03:00
return ( isRendering = ! 1 , null === current || didReceiveUpdate ) ? ( workInProgress . flags |= 1 , reconcileChildren ( current , workInProgress , nextChildren , renderLanes ) , workInProgress . child ) : ( bailoutHooks ( current , workInProgress , renderLanes ) , bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateMemoComponent ( current , workInProgress , Component , nextProps , updateLanes , renderLanes ) {
if ( null === current ) {
var type = Component . type ;
if ( isSimpleFunctionComponent ( type ) && null === Component . compare && void 0 === Component . defaultProps ) {
var resolvedType = type ;
return resolvedType = resolveFunctionForHotReloading ( type ) , workInProgress . tag = 15 , workInProgress . type = resolvedType , validateFunctionComponentInDev ( workInProgress , type ) , updateSimpleMemoComponent ( current , workInProgress , resolvedType , nextProps , updateLanes , renderLanes ) ;
}
var innerPropTypes = type . propTypes ;
2022-05-04 17:25:28 +03:00
innerPropTypes && checkPropTypes ( innerPropTypes , nextProps , "prop" , getComponentName ( type ) ) ;
2021-08-04 13:27:17 +03:00
var child = createFiberFromTypeAndProps ( Component . type , null , nextProps , workInProgress , workInProgress . mode , renderLanes ) ;
return child . ref = workInProgress . ref , child . return = workInProgress , workInProgress . child = child , child ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
var _type = Component . type , _innerPropTypes = _type . propTypes ;
2022-05-04 17:25:28 +03:00
_innerPropTypes && checkPropTypes ( _innerPropTypes , nextProps , "prop" , getComponentName ( _type ) ) ;
2022-08-26 11:45:49 +03:00
var currentChild = current . child ;
if ( ! includesSomeLane ( updateLanes , renderLanes ) ) {
2021-08-04 13:27:17 +03:00
var prevProps = currentChild . memoizedProps , compare = Component . compare ;
if ( ( compare = null !== compare ? compare : shallowEqual ) ( prevProps , nextProps ) && current . ref === workInProgress . ref ) return bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
}
workInProgress . flags |= 1 ;
var newChild = createWorkInProgress ( currentChild , nextProps ) ;
return newChild . ref = workInProgress . ref , newChild . return = workInProgress , workInProgress . child = newChild , newChild ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateSimpleMemoComponent ( current , workInProgress , Component , nextProps , updateLanes , renderLanes ) {
if ( workInProgress . type !== workInProgress . elementType ) {
2022-08-26 11:45:49 +03:00
var outerMemoType = workInProgress . elementType ;
2021-08-04 13:27:17 +03:00
if ( outerMemoType . $$typeof === REACT _LAZY _TYPE ) {
var lazyComponent = outerMemoType , payload = lazyComponent . _payload , init = lazyComponent . _init ;
try {
outerMemoType = init ( payload ) ;
} catch ( x ) {
outerMemoType = null ;
}
var outerPropTypes = outerMemoType && outerMemoType . propTypes ;
2022-05-04 17:25:28 +03:00
outerPropTypes && checkPropTypes ( outerPropTypes , nextProps , "prop" , getComponentName ( outerMemoType ) ) ;
2021-07-30 04:11:27 +03:00
}
}
2021-08-04 13:27:17 +03:00
if ( null !== current && shallowEqual ( current . memoizedProps , nextProps ) && current . ref === workInProgress . ref && workInProgress . type === current . type ) {
2022-08-26 11:45:49 +03:00
if ( didReceiveUpdate = ! 1 , ! includesSomeLane ( renderLanes , updateLanes ) ) return workInProgress . lanes = current . lanes , bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
2022-08-26 13:06:25 +03:00
( 16384 & current . flags ) != 0 && ( didReceiveUpdate = ! 0 ) ;
2021-08-04 13:27:17 +03:00
}
return updateFunctionComponent ( current , workInProgress , Component , nextProps , renderLanes ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateOffscreenComponent ( current , workInProgress , renderLanes ) {
2022-04-29 08:58:59 +03:00
var a , b , _subtreeRenderLanes , nextProps = workInProgress . pendingProps , nextChildren = nextProps . children , prevState = null !== current ? current . memoizedState : null ;
2022-05-04 17:25:28 +03:00
if ( "hidden" === nextProps . mode || "unstable-defer-without-hiding" === nextProps . mode ) {
2022-08-05 16:25:28 +03:00
if ( ( 4 & workInProgress . mode ) == 0 ) workInProgress . memoizedState = {
2022-08-26 11:45:49 +03:00
baseLanes : NoLanes
2022-08-05 16:25:28 +03:00
} , pushRenderLanes ( workInProgress , renderLanes ) ;
2022-08-26 11:45:49 +03:00
else if ( includesSomeLane ( renderLanes , 1073741824 ) ) workInProgress . memoizedState = {
baseLanes : NoLanes
} , pushRenderLanes ( workInProgress , null !== prevState ? prevState . baseLanes : renderLanes ) ;
2022-08-05 16:25:28 +03:00
else {
2022-08-26 11:45:49 +03:00
nextBaseLanes = null !== prevState ? ( a1 = prevState . baseLanes ) | renderLanes : renderLanes , markSpawnedWork ( 1073741824 ) , workInProgress . lanes = workInProgress . childLanes = 1073741824 ;
var nextBaseLanes , a1 , b1 , _nextState = {
baseLanes : nextBaseLanes
} ;
return workInProgress . memoizedState = _nextState , pushRenderLanes ( workInProgress , nextBaseLanes ) , null ;
2022-04-12 05:12:10 +03:00
}
2022-04-29 08:58:59 +03:00
} else null !== prevState ? ( _subtreeRenderLanes = ( a = prevState . baseLanes ) | renderLanes , workInProgress . memoizedState = null ) : _subtreeRenderLanes = renderLanes , pushRenderLanes ( workInProgress , _subtreeRenderLanes ) ;
2021-08-04 13:27:17 +03:00
return reconcileChildren ( current , workInProgress , nextChildren , renderLanes ) , workInProgress . child ;
2021-07-30 04:11:27 +03:00
}
2022-01-02 23:54:58 +03:00
didWarnAboutBadClass = { } , didWarnAboutModulePatternComponent = { } , didWarnAboutContextTypeOnFunctionComponent = { } , didWarnAboutGetDerivedStateOnFunctionComponent = { } , didWarnAboutFunctionRefs = { } , didWarnAboutReassigningProps = ! 1 , didWarnAboutRevealOrder = { } , didWarnAboutTailOptions = { } ;
2021-08-04 13:27:17 +03:00
var updateLegacyHiddenComponent = updateOffscreenComponent ;
function markRef ( current , workInProgress ) {
var ref = workInProgress . ref ;
( null === current && null !== ref || null !== current && current . ref !== ref ) && ( workInProgress . flags |= 128 ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateFunctionComponent ( current , workInProgress , Component , nextProps , renderLanes ) {
if ( workInProgress . type !== workInProgress . elementType ) {
2022-04-29 08:58:59 +03:00
var rendering , context , nextChildren , innerPropTypes = Component . propTypes ;
2022-05-04 17:25:28 +03:00
innerPropTypes && checkPropTypes ( innerPropTypes , nextProps , "prop" , getComponentName ( Component ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
var rendering1 , unmaskedContext = getUnmaskedContext ( workInProgress , Component , ! 0 ) ;
2022-05-09 19:36:40 +03:00
if ( context = getMaskedContext ( workInProgress , unmaskedContext ) , prepareToReadContext ( workInProgress , renderLanes ) , ReactCurrentOwner$1 . current = workInProgress , isRendering = ! 0 , nextChildren = renderWithHooks ( current , workInProgress , Component , nextProps , context , renderLanes ) , 1 & workInProgress . mode ) {
2021-08-04 13:27:17 +03:00
disableLogs ( ) ;
try {
nextChildren = renderWithHooks ( current , workInProgress , Component , nextProps , context , renderLanes ) ;
} finally {
reenableLogs ( ) ;
}
}
2022-04-05 09:25:23 +03:00
return ( isRendering = ! 1 , null === current || didReceiveUpdate ) ? ( workInProgress . flags |= 1 , reconcileChildren ( current , workInProgress , nextChildren , renderLanes ) , workInProgress . child ) : ( bailoutHooks ( current , workInProgress , renderLanes ) , bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
function updateClassComponent ( current , workInProgress , Component , nextProps , renderLanes ) {
if ( workInProgress . type !== workInProgress . elementType ) {
2021-08-04 13:27:17 +03:00
var hasContext , shouldUpdate , innerPropTypes = Component . propTypes ;
2022-05-04 17:25:28 +03:00
innerPropTypes && checkPropTypes ( innerPropTypes , nextProps , "prop" , getComponentName ( Component ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-08-26 13:06:25 +03:00
isContextProvider ( Component ) ? ( hasContext = ! 0 , pushContextProvider ( workInProgress ) ) : hasContext = ! 1 , prepareToReadContext ( workInProgress , renderLanes ) ;
var instance = workInProgress . stateNode ;
null === instance ? ( null !== current && ( current . alternate = null , workInProgress . alternate = null , workInProgress . flags |= 2 ) , constructClassInstance ( workInProgress , Component , nextProps ) , mountClassInstance ( workInProgress , Component , nextProps , renderLanes ) , shouldUpdate = ! 0 ) : shouldUpdate = null === current ? function ( workInProgress , ctor , newProps , renderLanes ) {
2021-09-08 12:45:39 +03:00
var instance = workInProgress . stateNode , oldProps = workInProgress . memoizedProps ;
instance . props = oldProps ;
var oldContext = instance . context , contextType = ctor . contextType , nextContext = emptyContextObject ;
2022-05-04 17:25:28 +03:00
if ( "object" == typeof contextType && null !== contextType ) nextContext = readContext ( contextType ) ;
2021-10-14 16:48:14 +03:00
else {
var nextLegacyUnmaskedContext = getUnmaskedContext ( workInProgress , ctor , ! 0 ) ;
nextContext = getMaskedContext ( workInProgress , nextLegacyUnmaskedContext ) ;
}
2022-05-04 17:25:28 +03:00
var getDerivedStateFromProps = ctor . getDerivedStateFromProps , hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance . getSnapshotBeforeUpdate ;
2022-06-05 08:52:22 +03:00
hasNewLifecycles || "function" != typeof instance . UNSAFE _componentWillReceiveProps && "function" != typeof instance . componentWillReceiveProps || oldProps === newProps && oldContext === nextContext || callComponentWillReceiveProps ( workInProgress , instance , newProps , nextContext ) , resetHasForceUpdateBeforeProcessing ( ) ;
2021-09-08 12:45:39 +03:00
var oldState = workInProgress . memoizedState , newState = instance . state = oldState ;
2022-08-26 13:06:25 +03:00
if ( processUpdateQueue ( workInProgress , newProps , instance , renderLanes ) , newState = workInProgress . memoizedState , oldProps === newProps && oldState === newState && ! hasContextChanged ( ) && ! hasForceUpdate ) return "function" == typeof instance . componentDidMount && ( workInProgress . flags |= 4 ) , ! 1 ;
2022-05-04 17:25:28 +03:00
"function" == typeof getDerivedStateFromProps && ( applyDerivedStateFromProps ( workInProgress , ctor , getDerivedStateFromProps , newProps ) , newState = workInProgress . memoizedState ) ;
2022-04-05 09:25:23 +03:00
var shouldUpdate = hasForceUpdate || checkShouldComponentUpdate ( workInProgress , ctor , oldProps , newProps , oldState , newState , nextContext ) ;
2022-08-26 13:06:25 +03:00
return shouldUpdate ? ( hasNewLifecycles || "function" != typeof instance . UNSAFE _componentWillMount && "function" != typeof instance . componentWillMount || ( "function" == typeof instance . componentWillMount && instance . componentWillMount ( ) , "function" == typeof instance . UNSAFE _componentWillMount && instance . UNSAFE _componentWillMount ( ) ) , "function" == typeof instance . componentDidMount && ( workInProgress . flags |= 4 ) ) : ( "function" == typeof instance . componentDidMount && ( workInProgress . flags |= 4 ) , workInProgress . memoizedProps = newProps , workInProgress . memoizedState = newState ) , instance . props = newProps , instance . state = newState , instance . context = nextContext , shouldUpdate ;
2022-06-15 17:36:57 +03:00
} ( workInProgress , Component , nextProps , renderLanes ) : function ( current , workInProgress , ctor , newProps , renderLanes ) {
2021-09-08 12:45:39 +03:00
var instance = workInProgress . stateNode ;
cloneUpdateQueue ( current , workInProgress ) ;
var unresolvedOldProps = workInProgress . memoizedProps , oldProps = workInProgress . type === workInProgress . elementType ? unresolvedOldProps : resolveDefaultProps ( workInProgress . type , unresolvedOldProps ) ;
instance . props = oldProps ;
var unresolvedNewProps = workInProgress . pendingProps , oldContext = instance . context , contextType = ctor . contextType , nextContext = emptyContextObject ;
2022-05-04 17:25:28 +03:00
if ( "object" == typeof contextType && null !== contextType ) nextContext = readContext ( contextType ) ;
2021-10-14 16:48:14 +03:00
else {
var nextUnmaskedContext = getUnmaskedContext ( workInProgress , ctor , ! 0 ) ;
nextContext = getMaskedContext ( workInProgress , nextUnmaskedContext ) ;
}
2022-05-04 17:25:28 +03:00
var getDerivedStateFromProps = ctor . getDerivedStateFromProps , hasNewLifecycles = "function" == typeof getDerivedStateFromProps || "function" == typeof instance . getSnapshotBeforeUpdate ;
2022-06-05 08:52:22 +03:00
hasNewLifecycles || "function" != typeof instance . UNSAFE _componentWillReceiveProps && "function" != typeof instance . componentWillReceiveProps || unresolvedOldProps === unresolvedNewProps && oldContext === nextContext || callComponentWillReceiveProps ( workInProgress , instance , newProps , nextContext ) , resetHasForceUpdateBeforeProcessing ( ) ;
2021-09-08 12:45:39 +03:00
var oldState = workInProgress . memoizedState , newState = instance . state = oldState ;
2022-08-26 13:06:25 +03:00
if ( processUpdateQueue ( workInProgress , newProps , instance , renderLanes ) , newState = workInProgress . memoizedState , unresolvedOldProps === unresolvedNewProps && oldState === newState && ! hasContextChanged ( ) && ! hasForceUpdate ) return "function" == typeof instance . componentDidUpdate && ( unresolvedOldProps !== current . memoizedProps || oldState !== current . memoizedState ) && ( workInProgress . flags |= 4 ) , "function" == typeof instance . getSnapshotBeforeUpdate && ( unresolvedOldProps !== current . memoizedProps || oldState !== current . memoizedState ) && ( workInProgress . flags |= 256 ) , ! 1 ;
2022-05-04 17:25:28 +03:00
"function" == typeof getDerivedStateFromProps && ( applyDerivedStateFromProps ( workInProgress , ctor , getDerivedStateFromProps , newProps ) , newState = workInProgress . memoizedState ) ;
2022-04-05 09:25:23 +03:00
var shouldUpdate = hasForceUpdate || checkShouldComponentUpdate ( workInProgress , ctor , oldProps , newProps , oldState , newState , nextContext ) ;
2022-08-26 13:06:25 +03:00
return shouldUpdate ? ( hasNewLifecycles || "function" != typeof instance . UNSAFE _componentWillUpdate && "function" != typeof instance . componentWillUpdate || ( "function" == typeof instance . componentWillUpdate && instance . componentWillUpdate ( newProps , newState , nextContext ) , "function" == typeof instance . UNSAFE _componentWillUpdate && instance . UNSAFE _componentWillUpdate ( newProps , newState , nextContext ) ) , "function" == typeof instance . componentDidUpdate && ( workInProgress . flags |= 4 ) , "function" == typeof instance . getSnapshotBeforeUpdate && ( workInProgress . flags |= 256 ) ) : ( "function" == typeof instance . componentDidUpdate && ( unresolvedOldProps !== current . memoizedProps || oldState !== current . memoizedState ) && ( workInProgress . flags |= 4 ) , "function" == typeof instance . getSnapshotBeforeUpdate && ( unresolvedOldProps !== current . memoizedProps || oldState !== current . memoizedState ) && ( workInProgress . flags |= 256 ) , workInProgress . memoizedProps = newProps , workInProgress . memoizedState = newState ) , instance . props = newProps , instance . state = newState , instance . context = nextContext , shouldUpdate ;
2022-06-15 17:36:57 +03:00
} ( current , workInProgress , Component , nextProps , renderLanes ) ;
var nextUnitOfWork = finishClassComponent ( current , workInProgress , Component , shouldUpdate , hasContext , renderLanes ) , inst = workInProgress . stateNode ;
return shouldUpdate && inst . props !== nextProps && ( didWarnAboutReassigningProps || error ( "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs." , getComponentName ( workInProgress . type ) || "a component" ) , didWarnAboutReassigningProps = ! 0 ) , nextUnitOfWork ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function finishClassComponent ( current , workInProgress , Component , shouldUpdate , hasContext , renderLanes ) {
markRef ( current , workInProgress ) ;
2022-08-26 13:06:25 +03:00
var rendering , rendering1 , current1 , workInProgress1 , nextChildren , renderLanes1 , nextChildren1 , didCaptureError = ( 64 & workInProgress . flags ) != 0 ;
2021-08-04 13:27:17 +03:00
if ( ! shouldUpdate && ! didCaptureError ) return hasContext && invalidateContextProvider ( workInProgress , Component , ! 1 ) , bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
var instance = workInProgress . stateNode ;
2022-05-04 17:25:28 +03:00
if ( ReactCurrentOwner$1 . current = workInProgress , didCaptureError && "function" != typeof Component . getDerivedStateFromError ) nextChildren1 = null , profilerStartTime = - 1 ;
2021-08-04 13:27:17 +03:00
else {
2022-04-05 09:25:23 +03:00
if ( isRendering = ! 0 , nextChildren1 = instance . render ( ) , 1 & workInProgress . mode ) {
2021-08-04 13:27:17 +03:00
disableLogs ( ) ;
try {
instance . render ( ) ;
} finally {
reenableLogs ( ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
2022-04-05 09:25:23 +03:00
isRendering = ! 1 ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
return ( workInProgress . flags |= 1 , null !== current && didCaptureError ) ? ( current1 = current , workInProgress1 = workInProgress , nextChildren = nextChildren1 , renderLanes1 = renderLanes , workInProgress1 . child = reconcileChildFibers ( workInProgress1 , current1 . child , null , renderLanes1 ) , workInProgress1 . child = reconcileChildFibers ( workInProgress1 , null , nextChildren , renderLanes1 ) ) : reconcileChildren ( current , workInProgress , nextChildren1 , renderLanes ) , workInProgress . memoizedState = instance . state , hasContext && invalidateContextProvider ( workInProgress , Component , ! 0 ) , workInProgress . child ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function pushHostRootContext ( workInProgress ) {
2021-10-21 08:12:50 +03:00
var root = workInProgress . stateNode ;
root . pendingContext ? pushTopLevelContextObject ( workInProgress , root . pendingContext , root . pendingContext !== root . context ) : root . context && pushTopLevelContextObject ( workInProgress , root . context , ! 1 ) , pushHostContainer ( workInProgress , root . containerInfo ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function validateFunctionComponentInDev ( workInProgress , Component ) {
2022-06-15 17:36:57 +03:00
if ( Component && Component . childContextTypes && error ( "%s(...): childContextTypes cannot be defined on a function component." , Component . displayName || Component . name || "Component" ) , null !== workInProgress . ref ) {
2022-05-04 17:25:28 +03:00
var info = "" , ownerName = getCurrentFiberOwnerNameInDevOrNull ( ) ;
ownerName && ( info += "\n\nCheck the render method of `" + ownerName + "`." ) ;
var warningKey = ownerName || workInProgress . _debugID || "" , debugSource = workInProgress . _debugSource ;
2022-06-15 17:36:57 +03:00
debugSource && ( warningKey = debugSource . fileName + ":" + debugSource . lineNumber ) , didWarnAboutFunctionRefs [ warningKey ] || ( didWarnAboutFunctionRefs [ warningKey ] = ! 0 , error ( "Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s" , info ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "function" == typeof Component . getDerivedStateFromProps ) {
var _componentName3 = getComponentName ( Component ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
didWarnAboutGetDerivedStateOnFunctionComponent [ _componentName3 ] || ( error ( "%s: Function components do not support getDerivedStateFromProps." , _componentName3 ) , didWarnAboutGetDerivedStateOnFunctionComponent [ _componentName3 ] = ! 0 ) ;
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "object" == typeof Component . contextType && null !== Component . contextType ) {
var _componentName4 = getComponentName ( Component ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
didWarnAboutContextTypeOnFunctionComponent [ _componentName4 ] || ( error ( "%s: Function components do not support contextType." , _componentName4 ) , didWarnAboutContextTypeOnFunctionComponent [ _componentName4 ] = ! 0 ) ;
2021-08-04 13:27:17 +03:00
}
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
var SUSPENDED _MARKER = {
dehydrated : null ,
2022-08-26 13:06:25 +03:00
retryLane : 0
2021-08-04 13:27:17 +03:00
} ;
function mountSuspenseOffscreenState ( renderLanes ) {
return {
baseLanes : renderLanes
} ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateSuspenseOffscreenState ( prevOffscreenState , renderLanes ) {
2022-04-29 08:58:59 +03:00
var a , b ;
2021-07-30 04:11:27 +03:00
return {
2022-04-29 08:58:59 +03:00
baseLanes : ( a = prevOffscreenState . baseLanes ) | renderLanes
2021-07-30 04:11:27 +03:00
} ;
}
2021-08-04 13:27:17 +03:00
function getRemainingWorkInPrimaryTree ( current , renderLanes ) {
2022-04-29 08:58:59 +03:00
var set , subset ;
return ( set = current . childLanes ) & ~ renderLanes ;
2021-08-04 13:27:17 +03:00
}
function updateSuspenseComponent ( current , workInProgress , renderLanes ) {
2022-07-20 11:25:26 +03:00
var fiber , nextProps = workInProgress . pendingProps ;
2022-08-26 13:06:25 +03:00
fiber = workInProgress , shouldSuspendImpl ( fiber ) && ( workInProgress . flags |= 64 ) ;
var suspenseContext , current1 , workInProgress1 , renderLanes1 , parentContext , suspenseContext1 = suspenseStackCursor . current , showFallback = ! 1 , didSuspend = ( 64 & workInProgress . flags ) != 0 ;
if ( didSuspend || ( suspenseContext = suspenseContext1 , current1 = current , ( null === current1 || null !== current1 . memoizedState ) && ( 2 & suspenseContext ) != 0 ) ) showFallback = ! 0 , workInProgress . flags &= - 65 ;
else ( null === current || null !== current . memoizedState ) && void 0 !== nextProps . fallback && ! 0 !== nextProps . unstable _avoidThisFallback && ( suspenseContext1 |= 1 ) ;
2022-08-02 14:37:40 +03:00
if ( pushSuspenseContext ( workInProgress , suspenseContext1 &= 1 ) , null === current ) {
2021-08-04 13:27:17 +03:00
void 0 !== nextProps . fallback && tryToClaimNextHydratableInstance ( workInProgress ) ;
var nextPrimaryChildren = nextProps . children , nextFallbackChildren = nextProps . fallback ;
if ( showFallback ) {
2021-10-14 16:48:14 +03:00
var fallbackFragment = mountSuspenseFallbackChildren ( workInProgress , nextPrimaryChildren , nextFallbackChildren , renderLanes ) , primaryChildFragment = workInProgress . child ;
return primaryChildFragment . memoizedState = mountSuspenseOffscreenState ( renderLanes ) , workInProgress . memoizedState = SUSPENDED _MARKER , fallbackFragment ;
2021-08-04 13:27:17 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "number" != typeof nextProps . unstable _expectedLoadTime ) return mountSuspensePrimaryChildren ( workInProgress , nextPrimaryChildren , renderLanes ) ;
2021-10-14 16:48:14 +03:00
var _fallbackFragment = mountSuspenseFallbackChildren ( workInProgress , nextPrimaryChildren , nextFallbackChildren , renderLanes ) , _primaryChildFragment = workInProgress . child ;
return _primaryChildFragment . memoizedState = mountSuspenseOffscreenState ( renderLanes ) , workInProgress . memoizedState = SUSPENDED _MARKER , workInProgress . lanes = 33554432 , markSpawnedWork ( 33554432 ) , _fallbackFragment ;
2021-07-30 04:11:27 +03:00
}
2022-08-26 13:06:25 +03:00
var prevState = current . memoizedState ;
if ( null !== prevState ) {
2021-08-04 13:27:17 +03:00
if ( showFallback ) {
2021-10-14 16:48:14 +03:00
var _nextFallbackChildren2 = nextProps . fallback , _nextPrimaryChildren2 = nextProps . children , _fallbackChildFragment = updateSuspenseFallbackChildren ( current , workInProgress , _nextPrimaryChildren2 , _nextFallbackChildren2 , renderLanes ) , _primaryChildFragment3 = workInProgress . child , prevOffscreenState = current . child . memoizedState ;
2021-08-04 13:27:17 +03:00
return _primaryChildFragment3 . memoizedState = null === prevOffscreenState ? mountSuspenseOffscreenState ( renderLanes ) : updateSuspenseOffscreenState ( prevOffscreenState , renderLanes ) , _primaryChildFragment3 . childLanes = getRemainingWorkInPrimaryTree ( current , renderLanes ) , workInProgress . memoizedState = SUSPENDED _MARKER , _fallbackChildFragment ;
2021-07-30 04:11:27 +03:00
}
2022-04-29 08:58:59 +03:00
var parentContext1 , parentContext2 , _primaryChildFragment4 = updateSuspensePrimaryChildren ( current , workInProgress , nextProps . children , renderLanes ) ;
2021-08-04 13:27:17 +03:00
return workInProgress . memoizedState = null , _primaryChildFragment4 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( showFallback ) {
2021-10-14 16:48:14 +03:00
var _nextFallbackChildren3 = nextProps . fallback , _nextPrimaryChildren4 = nextProps . children , _fallbackChildFragment2 = updateSuspenseFallbackChildren ( current , workInProgress , _nextPrimaryChildren4 , _nextFallbackChildren3 , renderLanes ) , _primaryChildFragment5 = workInProgress . child , _prevOffscreenState = current . child . memoizedState ;
2021-08-04 13:27:17 +03:00
return _primaryChildFragment5 . memoizedState = null === _prevOffscreenState ? mountSuspenseOffscreenState ( renderLanes ) : updateSuspenseOffscreenState ( _prevOffscreenState , renderLanes ) , _primaryChildFragment5 . childLanes = getRemainingWorkInPrimaryTree ( current , renderLanes ) , workInProgress . memoizedState = SUSPENDED _MARKER , _fallbackChildFragment2 ;
}
var _primaryChildFragment6 = updateSuspensePrimaryChildren ( current , workInProgress , nextProps . children , renderLanes ) ;
return workInProgress . memoizedState = null , _primaryChildFragment6 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function mountSuspensePrimaryChildren ( workInProgress , primaryChildren , renderLanes ) {
2022-05-20 10:01:27 +03:00
var primaryChildFragment = createFiberFromOffscreen ( {
2022-05-04 17:25:28 +03:00
mode : "visible" ,
2021-08-04 13:27:17 +03:00
children : primaryChildren
2022-05-20 10:01:27 +03:00
} , workInProgress . mode , renderLanes , null ) ;
2021-08-04 13:27:17 +03:00
return primaryChildFragment . return = workInProgress , workInProgress . child = primaryChildFragment , primaryChildFragment ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function mountSuspenseFallbackChildren ( workInProgress , primaryChildren , fallbackChildren , renderLanes ) {
var primaryChildFragment , fallbackChildFragment , mode = workInProgress . mode , progressedPrimaryFragment = workInProgress . child , primaryChildProps = {
2022-05-04 17:25:28 +03:00
mode : "hidden" ,
2021-08-04 13:27:17 +03:00
children : primaryChildren
} ;
2022-08-26 11:45:49 +03:00
return ( 2 & mode ) == 0 && null !== progressedPrimaryFragment ? ( ( primaryChildFragment = progressedPrimaryFragment ) . childLanes = NoLanes , primaryChildFragment . pendingProps = primaryChildProps , 8 & workInProgress . mode && ( primaryChildFragment . actualDuration = 0 , primaryChildFragment . actualStartTime = - 1 , primaryChildFragment . selfBaseDuration = 0 , primaryChildFragment . treeBaseDuration = 0 ) , fallbackChildFragment = createFiberFromFragment ( fallbackChildren , mode , renderLanes , null ) ) : ( primaryChildFragment = createFiberFromOffscreen ( primaryChildProps , mode , NoLanes , null ) , fallbackChildFragment = createFiberFromFragment ( fallbackChildren , mode , renderLanes , null ) ) , primaryChildFragment . return = workInProgress , fallbackChildFragment . return = workInProgress , primaryChildFragment . sibling = fallbackChildFragment , workInProgress . child = primaryChildFragment , fallbackChildFragment ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateSuspensePrimaryChildren ( current , workInProgress , primaryChildren , renderLanes ) {
2022-08-26 11:45:49 +03:00
var current1 , offscreenProps , currentPrimaryChildFragment = current . child , currentFallbackChildFragment = currentPrimaryChildFragment . sibling , primaryChildFragment = ( current1 = currentPrimaryChildFragment , offscreenProps = {
2022-05-04 17:25:28 +03:00
mode : "visible" ,
2021-08-04 13:27:17 +03:00
children : primaryChildren
2022-08-26 11:45:49 +03:00
} , createWorkInProgress ( current1 , offscreenProps ) ) ;
2022-08-26 13:06:25 +03:00
return ( 2 & workInProgress . mode ) == 0 && ( primaryChildFragment . lanes = renderLanes ) , primaryChildFragment . return = workInProgress , primaryChildFragment . sibling = null , null !== currentFallbackChildFragment && ( currentFallbackChildFragment . nextEffect = null , currentFallbackChildFragment . flags = 8 , workInProgress . firstEffect = workInProgress . lastEffect = currentFallbackChildFragment ) , workInProgress . child = primaryChildFragment , primaryChildFragment ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function updateSuspenseFallbackChildren ( current , workInProgress , primaryChildren , fallbackChildren , renderLanes ) {
2022-07-20 11:25:26 +03:00
var current1 , offscreenProps , primaryChildFragment , fallbackChildFragment , mode = workInProgress . mode , currentPrimaryChildFragment = current . child , currentFallbackChildFragment = currentPrimaryChildFragment . sibling , primaryChildProps = {
2022-05-04 17:25:28 +03:00
mode : "hidden" ,
2021-08-04 13:27:17 +03:00
children : primaryChildren
} ;
if ( ( 2 & mode ) == 0 && workInProgress . child !== currentPrimaryChildFragment ) {
2022-08-26 11:45:49 +03:00
( primaryChildFragment = workInProgress . child ) . childLanes = NoLanes , primaryChildFragment . pendingProps = primaryChildProps , 8 & workInProgress . mode && ( primaryChildFragment . actualDuration = 0 , primaryChildFragment . actualStartTime = - 1 , primaryChildFragment . selfBaseDuration = currentPrimaryChildFragment . selfBaseDuration , primaryChildFragment . treeBaseDuration = currentPrimaryChildFragment . treeBaseDuration ) ;
2021-08-04 13:27:17 +03:00
var progressedLastEffect = primaryChildFragment . lastEffect ;
null !== progressedLastEffect ? ( workInProgress . firstEffect = primaryChildFragment . firstEffect , workInProgress . lastEffect = progressedLastEffect , progressedLastEffect . nextEffect = null ) : workInProgress . firstEffect = workInProgress . lastEffect = null ;
2022-07-20 11:25:26 +03:00
} else primaryChildFragment = createWorkInProgress ( current1 = currentPrimaryChildFragment , primaryChildProps ) ;
2022-08-26 13:06:25 +03:00
return null !== currentFallbackChildFragment ? fallbackChildFragment = createWorkInProgress ( currentFallbackChildFragment , fallbackChildren ) : ( fallbackChildFragment = createFiberFromFragment ( fallbackChildren , mode , renderLanes , null ) , fallbackChildFragment . flags |= 2 ) , fallbackChildFragment . return = workInProgress , primaryChildFragment . return = workInProgress , primaryChildFragment . sibling = fallbackChildFragment , workInProgress . child = primaryChildFragment , fallbackChildFragment ;
2021-08-04 13:27:17 +03:00
}
function scheduleWorkOnFiber ( fiber , renderLanes ) {
2022-04-29 08:58:59 +03:00
fiber . lanes = ( a = fiber . lanes ) | renderLanes ;
2022-06-15 17:36:57 +03:00
var a , b , a1 , b1 , alternate = fiber . alternate ;
null !== alternate && ( alternate . lanes = ( a1 = alternate . lanes ) | renderLanes ) , scheduleWorkOnParentPath ( fiber . return , renderLanes ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function validateSuspenseListNestedChild ( childSlot , index ) {
2022-05-04 17:25:28 +03:00
var isArray = Array . isArray ( childSlot ) , isIterable = ! isArray && "function" == typeof getIteratorFn ( childSlot ) ;
2021-10-21 08:12:50 +03:00
if ( isArray || isIterable ) {
2022-05-04 17:25:28 +03:00
var type = isArray ? "array" : "iterable" ;
2022-06-15 17:36:57 +03:00
return error ( "A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>" , type , index , type ) , ! 1 ;
2021-08-04 13:27:17 +03:00
}
return ! 0 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function initSuspenseListRenderState ( workInProgress , isBackwards , tail , lastContentRow , tailMode , lastEffectBeforeRendering ) {
var renderState = workInProgress . memoizedState ;
null === renderState ? workInProgress . memoizedState = {
isBackwards : isBackwards ,
rendering : null ,
renderingStartTime : 0 ,
last : lastContentRow ,
tail : tail ,
tailMode : tailMode ,
lastEffect : lastEffectBeforeRendering
} : ( renderState . isBackwards = isBackwards , renderState . rendering = null , renderState . renderingStartTime = 0 , renderState . last = lastContentRow , renderState . tail = tail , renderState . tailMode = tailMode , renderState . lastEffect = lastEffectBeforeRendering ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
function updateSuspenseListComponent ( current , workInProgress , renderLanes ) {
var tailMode , revealOrder , nextProps = workInProgress . pendingProps , revealOrder1 = nextProps . revealOrder , tailMode1 = nextProps . tail , newChildren = nextProps . children ;
2021-09-08 12:45:39 +03:00
! function ( revealOrder ) {
2022-05-04 17:25:28 +03:00
if ( void 0 !== revealOrder && "forwards" !== revealOrder && "backwards" !== revealOrder && "together" !== revealOrder && ! didWarnAboutRevealOrder [ revealOrder ] ) {
if ( didWarnAboutRevealOrder [ revealOrder ] = ! 0 , "string" == typeof revealOrder ) switch ( revealOrder . toLowerCase ( ) ) {
case "together" :
case "forwards" :
case "backwards" :
2022-06-15 17:36:57 +03:00
error ( '"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.' , revealOrder , revealOrder . toLowerCase ( ) ) ;
2022-04-12 05:12:10 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "forward" :
case "backward" :
2022-06-15 17:36:57 +03:00
error ( '"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.' , revealOrder , revealOrder . toLowerCase ( ) ) ;
2022-04-12 05:12:10 +03:00
break ;
default :
2022-06-15 17:36:57 +03:00
error ( '"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?' , revealOrder ) ;
2022-04-12 05:12:10 +03:00
}
2022-06-15 17:36:57 +03:00
else error ( '%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?' , revealOrder ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( revealOrder1 ) , tailMode = tailMode1 , revealOrder = revealOrder1 , void 0 === tailMode || didWarnAboutTailOptions [ tailMode ] || ( "collapsed" !== tailMode && "hidden" !== tailMode ? ( didWarnAboutTailOptions [ tailMode ] = ! 0 , error ( '"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?' , tailMode ) ) : "forwards" !== revealOrder && "backwards" !== revealOrder && ( didWarnAboutTailOptions [ tailMode ] = ! 0 , error ( '<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?' , tailMode ) ) ) , function ( children , revealOrder ) {
2022-05-04 17:25:28 +03:00
if ( ( "forwards" === revealOrder || "backwards" === revealOrder ) && null != children && ! 1 !== children ) {
2022-04-12 05:12:10 +03:00
if ( Array . isArray ( children ) ) {
for ( var i = 0 ; i < children . length ; i ++ ) if ( ! validateSuspenseListNestedChild ( children [ i ] , i ) ) return ;
} else {
var iteratorFn = getIteratorFn ( children ) ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof iteratorFn ) {
2022-04-12 05:12:10 +03:00
var childrenIterator = iteratorFn . call ( children ) ;
if ( childrenIterator ) for ( var step = childrenIterator . next ( ) , _i = 0 ; ! step . done ; step = childrenIterator . next ( ) ) {
if ( ! validateSuspenseListNestedChild ( step . value , _i ) ) return ;
_i ++ ;
}
2022-06-15 17:36:57 +03:00
} else error ( 'A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?' , revealOrder ) ;
2022-04-12 05:12:10 +03:00
}
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( newChildren , revealOrder1 ) , reconcileChildren ( current , workInProgress , newChildren , renderLanes ) ;
2022-04-29 08:58:59 +03:00
var parentContext , suspenseContext = suspenseStackCursor . current ;
2022-08-26 13:06:25 +03:00
if ( ( 2 & suspenseContext ) != 0 ? ( suspenseContext = 1 & suspenseContext | 2 , workInProgress . flags |= 64 ) : ( null !== current && ( 64 & current . flags ) != 0 && function ( workInProgress , firstChild , renderLanes ) {
2021-09-08 12:45:39 +03:00
for ( var node = firstChild ; null !== node ; ) {
if ( 13 === node . tag ) null !== node . memoizedState && scheduleWorkOnFiber ( node , renderLanes ) ;
else if ( 19 === node . tag ) scheduleWorkOnFiber ( node , renderLanes ) ;
else if ( null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
}
if ( node === workInProgress ) return ;
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === workInProgress ) return ;
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
}
2022-06-15 17:36:57 +03:00
} ( workInProgress , workInProgress . child , renderLanes ) , suspenseContext &= 1 ) , pushSuspenseContext ( workInProgress , suspenseContext ) , ( 2 & workInProgress . mode ) == 0 ) workInProgress . memoizedState = null ;
2021-09-08 12:45:39 +03:00
else switch ( revealOrder1 ) {
2022-05-04 17:25:28 +03:00
case "forwards" :
2022-06-15 17:36:57 +03:00
var parentContext1 , parentContext2 , tail , lastContentRow = function ( firstChild ) {
2021-09-08 12:45:39 +03:00
for ( var row = firstChild , lastContentRow = null ; null !== row ; ) {
var currentRow = row . alternate ;
null !== currentRow && null === findFirstSuspended ( currentRow ) && ( lastContentRow = row ) , row = row . sibling ;
}
return lastContentRow ;
2022-06-15 17:36:57 +03:00
} ( workInProgress . child ) ;
null === lastContentRow ? ( tail = workInProgress . child , workInProgress . child = null ) : ( tail = lastContentRow . sibling , lastContentRow . sibling = null ) , initSuspenseListRenderState ( workInProgress , ! 1 , tail , lastContentRow , tailMode1 , workInProgress . lastEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "backwards" :
2022-06-15 17:36:57 +03:00
var _tail = null , row = workInProgress . child ;
for ( workInProgress . child = null ; null !== row ; ) {
var currentRow = row . alternate ;
if ( null !== currentRow && null === findFirstSuspended ( currentRow ) ) {
workInProgress . child = row ;
2021-08-04 13:27:17 +03:00
break ;
}
2022-06-15 17:36:57 +03:00
var nextRow = row . sibling ;
row . sibling = _tail , _tail = row , row = nextRow ;
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
initSuspenseListRenderState ( workInProgress , ! 0 , _tail , null , tailMode1 , workInProgress . lastEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "together" :
2022-06-15 17:36:57 +03:00
initSuspenseListRenderState ( workInProgress , ! 1 , null , null , void 0 , workInProgress . lastEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
default :
2022-06-15 17:36:57 +03:00
workInProgress . memoizedState = null ;
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
return workInProgress . child ;
2021-07-30 04:11:27 +03:00
}
2021-09-08 12:45:39 +03:00
var hasWarnedAboutUsingNoValuePropOnContextProvider = ! 1 , hasWarnedAboutUsingContextAsConsumer = ! 1 ;
2021-08-04 13:27:17 +03:00
function markWorkInProgressReceivedUpdate ( ) {
didReceiveUpdate = ! 0 ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
function bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) {
2022-08-26 11:45:49 +03:00
return ( null !== current && ( workInProgress . dependencies = current . dependencies ) , profilerStartTime = - 1 , markSkippedUpdateLanes ( workInProgress . lanes ) , includesSomeLane ( renderLanes , workInProgress . childLanes ) ) ? ( ! function ( current , workInProgress ) {
2021-09-08 12:45:39 +03:00
if ( ! ( null === current || workInProgress . child === current . child ) ) throw Error ( "Resuming work not yet implemented." ) ;
if ( null !== workInProgress . child ) {
var currentChild = workInProgress . child , newChild = createWorkInProgress ( currentChild , currentChild . pendingProps ) ;
2022-08-26 13:06:25 +03:00
for ( workInProgress . child = newChild , newChild . return = workInProgress ; null !== currentChild . sibling ; ) currentChild = currentChild . sibling , newChild = newChild . sibling = createWorkInProgress ( currentChild , currentChild . pendingProps ) , newChild . return = workInProgress ;
2021-09-08 12:45:39 +03:00
newChild . sibling = null ;
}
2022-06-15 17:36:57 +03:00
} ( current , workInProgress ) , workInProgress . child ) : null ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
function beginWork ( current , workInProgress , renderLanes ) {
var updateLanes = workInProgress . lanes ;
if ( workInProgress . _debugNeedsRemount && null !== current ) return function ( current , oldWorkInProgress , newWorkInProgress ) {
2021-09-08 12:45:39 +03:00
var returnFiber = oldWorkInProgress . return ;
2022-06-11 08:27:13 +03:00
if ( null === returnFiber ) throw Error ( "Cannot swap the root fiber." ) ;
2021-09-08 12:45:39 +03:00
if ( current . alternate = null , oldWorkInProgress . alternate = null , newWorkInProgress . index = oldWorkInProgress . index , newWorkInProgress . sibling = oldWorkInProgress . sibling , newWorkInProgress . return = oldWorkInProgress . return , newWorkInProgress . ref = oldWorkInProgress . ref , oldWorkInProgress === returnFiber . child ) returnFiber . child = newWorkInProgress ;
else {
var prevSibling = returnFiber . child ;
2022-06-11 08:27:13 +03:00
if ( null === prevSibling ) throw Error ( "Expected parent to have a child." ) ;
for ( ; prevSibling . sibling !== oldWorkInProgress ; ) if ( null === ( prevSibling = prevSibling . sibling ) ) throw Error ( "Expected to find the previous sibling." ) ;
2021-09-08 12:45:39 +03:00
prevSibling . sibling = newWorkInProgress ;
}
var last = returnFiber . lastEffect ;
2022-08-26 13:06:25 +03:00
return null !== last ? ( last . nextEffect = current , returnFiber . lastEffect = current ) : returnFiber . firstEffect = returnFiber . lastEffect = current , current . nextEffect = null , current . flags = 8 , newWorkInProgress . flags |= 2 , newWorkInProgress ;
2022-06-15 17:36:57 +03:00
} ( current , workInProgress , createFiberFromTypeAndProps ( workInProgress . type , workInProgress . key , workInProgress . pendingProps , workInProgress . _debugOwner || null , workInProgress . mode , workInProgress . lanes ) ) ;
if ( null !== current ) {
2022-08-26 13:06:25 +03:00
var oldProps = current . memoizedProps , newProps = workInProgress . pendingProps ;
if ( oldProps !== newProps || hasContextChanged ( ) || workInProgress . type !== current . type ) didReceiveUpdate = ! 0 ;
else if ( includesSomeLane ( renderLanes , updateLanes ) ) didReceiveUpdate = ( 16384 & current . flags ) != 0 ;
2022-04-12 05:12:10 +03:00
else {
2022-06-15 17:36:57 +03:00
switch ( didReceiveUpdate = ! 1 , workInProgress . tag ) {
2022-04-12 05:12:10 +03:00
case 3 :
2022-06-15 17:36:57 +03:00
pushHostRootContext ( workInProgress ) , resetHydrationState ( ) ;
2022-04-12 05:12:10 +03:00
break ;
case 5 :
2022-06-15 17:36:57 +03:00
pushHostContext ( workInProgress ) ;
2022-04-12 05:12:10 +03:00
break ;
case 1 :
2022-08-26 13:06:25 +03:00
var Component = workInProgress . type ;
isContextProvider ( Component ) && pushContextProvider ( workInProgress ) ;
2022-04-12 05:12:10 +03:00
break ;
case 4 :
2022-06-15 17:36:57 +03:00
pushHostContainer ( workInProgress , workInProgress . stateNode . containerInfo ) ;
2022-04-12 05:12:10 +03:00
break ;
case 10 :
2022-06-15 17:36:57 +03:00
var newValue = workInProgress . memoizedProps . value ;
pushProvider ( workInProgress , newValue ) ;
2022-04-12 05:12:10 +03:00
break ;
case 12 :
2022-08-26 13:06:25 +03:00
var hasChildWork = includesSomeLane ( renderLanes , workInProgress . childLanes ) ;
hasChildWork && ( workInProgress . flags |= 4 ) ;
2022-08-26 11:45:49 +03:00
var stateNode = workInProgress . stateNode ;
2022-04-12 05:12:10 +03:00
stateNode . effectDuration = 0 , stateNode . passiveEffectDuration = 0 ;
break ;
case 13 :
2022-08-26 13:06:25 +03:00
var parentContext , state = workInProgress . memoizedState ;
if ( null !== state ) {
var parentContext1 , primaryChildFragment = workInProgress . child ;
if ( includesSomeLane ( renderLanes , primaryChildFragment . childLanes ) ) return updateSuspenseComponent ( current , workInProgress , renderLanes ) ;
pushSuspenseContext ( workInProgress , ( parentContext1 = suspenseStackCursor . current , 1 & parentContext1 ) ) ;
var child = bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
2022-04-12 05:12:10 +03:00
if ( null !== child ) return child . sibling ;
return null ;
}
2022-08-26 13:06:25 +03:00
pushSuspenseContext ( workInProgress , ( parentContext = suspenseStackCursor . current , 1 & parentContext ) ) ;
2022-04-12 05:12:10 +03:00
break ;
case 19 :
2022-08-26 13:06:25 +03:00
var didSuspendBefore = ( 64 & current . flags ) != 0 , _hasChildWork = includesSomeLane ( renderLanes , workInProgress . childLanes ) ;
2022-04-12 05:12:10 +03:00
if ( didSuspendBefore ) {
2022-06-15 17:36:57 +03:00
if ( _hasChildWork ) return updateSuspenseListComponent ( current , workInProgress , renderLanes ) ;
2022-08-26 13:06:25 +03:00
workInProgress . flags |= 64 ;
2022-04-12 05:12:10 +03:00
}
2022-06-15 17:36:57 +03:00
var renderState = workInProgress . memoizedState ;
if ( null !== renderState && ( renderState . rendering = null , renderState . tail = null , renderState . lastEffect = null ) , pushSuspenseContext ( workInProgress , suspenseStackCursor . current ) , ! _hasChildWork ) return null ;
2022-04-12 05:12:10 +03:00
break ;
case 23 :
case 24 :
2022-08-26 11:45:49 +03:00
return workInProgress . lanes = NoLanes , updateOffscreenComponent ( current , workInProgress , renderLanes ) ;
2022-04-12 05:12:10 +03:00
}
2022-06-15 17:36:57 +03:00
return bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
2021-07-30 04:11:27 +03:00
}
2022-04-12 05:12:10 +03:00
} else didReceiveUpdate = ! 1 ;
2022-08-26 11:45:49 +03:00
switch ( workInProgress . lanes = NoLanes , workInProgress . tag ) {
2021-08-04 13:27:17 +03:00
case 2 :
2022-03-08 17:35:18 +03:00
return function ( _current , workInProgress , Component , renderLanes ) {
2022-08-26 13:06:25 +03:00
null !== _current && ( _current . alternate = null , workInProgress . alternate = null , workInProgress . flags |= 2 ) ;
2022-06-15 17:36:57 +03:00
var rendering , rendering1 , context , value , props = workInProgress . pendingProps , unmaskedContext = getUnmaskedContext ( workInProgress , Component , ! 1 ) ;
2022-05-04 17:25:28 +03:00
if ( context = getMaskedContext ( workInProgress , unmaskedContext ) , prepareToReadContext ( workInProgress , renderLanes ) , Component . prototype && "function" == typeof Component . prototype . render ) {
var componentName = getComponentName ( Component ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
didWarnAboutBadClass [ componentName ] || ( error ( "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead." , componentName , componentName ) , didWarnAboutBadClass [ componentName ] = ! 0 ) ;
2021-09-08 12:45:39 +03:00
}
2022-05-04 17:25:28 +03:00
if ( 1 & workInProgress . mode && ReactStrictModeWarnings . recordLegacyContextWarning ( workInProgress , null ) , isRendering = ! 0 , ReactCurrentOwner$1 . current = workInProgress , value = renderWithHooks ( null , workInProgress , Component , props , context , renderLanes ) , isRendering = ! 1 , workInProgress . flags |= 1 , "object" == typeof value && null !== value && "function" == typeof value . render && void 0 === value . $$typeof ) {
var _componentName = getComponentName ( Component ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
didWarnAboutModulePatternComponent [ _componentName ] || ( error ( "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React." , _componentName , _componentName , _componentName ) , didWarnAboutModulePatternComponent [ _componentName ] = ! 0 ) ;
2021-09-08 12:45:39 +03:00
}
2022-05-04 17:25:28 +03:00
if ( "object" == typeof value && null !== value && "function" == typeof value . render && void 0 === value . $$typeof ) {
var _componentName2 = getComponentName ( Component ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
didWarnAboutModulePatternComponent [ _componentName2 ] || ( error ( "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React." , _componentName2 , _componentName2 , _componentName2 ) , didWarnAboutModulePatternComponent [ _componentName2 ] = ! 0 ) , workInProgress . tag = 1 , workInProgress . memoizedState = null , workInProgress . updateQueue = null ;
2021-09-08 12:45:39 +03:00
var hasContext = ! 1 ;
isContextProvider ( Component ) ? ( hasContext = ! 0 , pushContextProvider ( workInProgress ) ) : hasContext = ! 1 , workInProgress . memoizedState = null !== value . state && void 0 !== value . state ? value . state : null , initializeUpdateQueue ( workInProgress ) ;
var getDerivedStateFromProps = Component . getDerivedStateFromProps ;
2022-05-04 17:25:28 +03:00
return "function" == typeof getDerivedStateFromProps && applyDerivedStateFromProps ( workInProgress , Component , getDerivedStateFromProps , props ) , adoptClassInstance ( workInProgress , value ) , mountClassInstance ( workInProgress , Component , props , renderLanes ) , finishClassComponent ( null , workInProgress , Component , ! 0 , hasContext , renderLanes ) ;
2021-09-08 12:45:39 +03:00
}
if ( workInProgress . tag = 0 , 1 & workInProgress . mode ) {
disableLogs ( ) ;
try {
value = renderWithHooks ( null , workInProgress , Component , props , context , renderLanes ) ;
} finally {
reenableLogs ( ) ;
}
}
return reconcileChildren ( null , workInProgress , value , renderLanes ) , validateFunctionComponentInDev ( workInProgress , Component ) , workInProgress . child ;
2022-06-15 17:36:57 +03:00
} ( current , workInProgress , workInProgress . type , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 16 :
2022-06-15 17:36:57 +03:00
var elementType = workInProgress . elementType ;
2022-03-08 17:35:18 +03:00
return function ( _current , workInProgress , elementType , updateLanes , renderLanes ) {
2022-08-26 13:06:25 +03:00
null !== _current && ( _current . alternate = null , workInProgress . alternate = null , workInProgress . flags |= 2 ) ;
var type , child , props = workInProgress . pendingProps , lazyComponent = elementType , payload = lazyComponent . _payload , init = lazyComponent . _init , Component = init ( payload ) ;
2021-10-06 10:12:11 +03:00
workInProgress . type = Component ;
var resolvedTag = workInProgress . tag = resolveLazyComponentTag ( Component ) , resolvedProps = resolveDefaultProps ( Component , props ) ;
2021-09-08 12:45:39 +03:00
switch ( resolvedTag ) {
case 0 :
2021-10-06 10:12:11 +03:00
return validateFunctionComponentInDev ( workInProgress , Component ) , workInProgress . type = Component = resolveFunctionForHotReloading ( Component ) , updateFunctionComponent ( null , workInProgress , Component , resolvedProps , renderLanes ) ;
2021-09-08 12:45:39 +03:00
case 1 :
2022-08-26 13:06:25 +03:00
return workInProgress . type = Component = ( type = Component , resolveFunctionForHotReloading ( type ) ) , updateClassComponent ( null , workInProgress , Component , resolvedProps , renderLanes ) ;
2021-09-08 12:45:39 +03:00
case 11 :
2021-10-06 10:12:11 +03:00
return workInProgress . type = Component = resolveForwardRefForHotReloading ( Component ) , updateForwardRef ( null , workInProgress , Component , resolvedProps , renderLanes ) ;
2021-09-08 12:45:39 +03:00
case 14 :
2021-10-06 10:12:11 +03:00
if ( workInProgress . type !== workInProgress . elementType ) {
2021-09-08 12:45:39 +03:00
var outerPropTypes = Component . propTypes ;
2022-05-04 17:25:28 +03:00
outerPropTypes && checkPropTypes ( outerPropTypes , resolvedProps , "prop" , getComponentName ( Component ) ) ;
2021-09-08 12:45:39 +03:00
}
2021-10-06 10:12:11 +03:00
return updateMemoComponent ( null , workInProgress , Component , resolveDefaultProps ( Component . type , resolvedProps ) , updateLanes , renderLanes ) ;
2021-09-08 12:45:39 +03:00
}
2022-05-04 17:25:28 +03:00
var hint = "" ;
throw null !== Component && "object" == typeof Component && Component . $$typeof === REACT _LAZY _TYPE && ( hint = " Did you wrap a component in React.lazy() more than once?" ) , Error ( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint ) ;
2022-06-15 17:36:57 +03:00
} ( current , workInProgress , elementType , updateLanes , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 0 :
2022-06-15 17:36:57 +03:00
var _Component = workInProgress . type , unresolvedProps = workInProgress . pendingProps , resolvedProps = workInProgress . elementType === _Component ? unresolvedProps : resolveDefaultProps ( _Component , unresolvedProps ) ;
return updateFunctionComponent ( current , workInProgress , _Component , resolvedProps , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 1 :
2022-06-15 17:36:57 +03:00
var _Component2 = workInProgress . type , _unresolvedProps = workInProgress . pendingProps , _resolvedProps = workInProgress . elementType === _Component2 ? _unresolvedProps : resolveDefaultProps ( _Component2 , _unresolvedProps ) ;
return updateClassComponent ( current , workInProgress , _Component2 , _resolvedProps , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 3 :
2022-03-08 17:35:18 +03:00
return function ( current , workInProgress , renderLanes ) {
2021-09-08 12:45:39 +03:00
pushHostRootContext ( workInProgress ) ;
var updateQueue = workInProgress . updateQueue ;
if ( ! ( null !== current && null !== updateQueue ) ) throw Error ( "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue." ) ;
var nextProps = workInProgress . pendingProps , prevState = workInProgress . memoizedState , prevChildren = null !== prevState ? prevState . element : null ;
cloneUpdateQueue ( current , workInProgress ) , processUpdateQueue ( workInProgress , nextProps , null , renderLanes ) ;
2021-10-14 16:48:14 +03:00
var nextState = workInProgress . memoizedState , nextChildren = nextState . element ;
2021-09-08 12:45:39 +03:00
if ( nextChildren === prevChildren ) return resetHydrationState ( ) , bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
var fiber , root = workInProgress . stateNode ;
2022-08-26 13:06:25 +03:00
if ( root . hydrate && ( fiber = workInProgress , nextHydratableInstance = getFirstHydratableChild ( fiber . stateNode . containerInfo ) , hydrationParentFiber = fiber , isHydrating = ! 0 , 1 ) ) {
2021-09-08 12:45:39 +03:00
var mutableSourceEagerHydrationData = root . mutableSourceEagerHydrationData ;
2021-10-14 16:48:14 +03:00
if ( null != mutableSourceEagerHydrationData ) for ( var i = 0 ; i < mutableSourceEagerHydrationData . length ; i += 2 ) {
var mutableSource = mutableSourceEagerHydrationData [ i ] , version = mutableSourceEagerHydrationData [ i + 1 ] ;
setWorkInProgressVersion ( mutableSource , version ) ;
}
2021-09-08 12:45:39 +03:00
var child = mountChildFibers ( workInProgress , null , nextChildren , renderLanes ) ;
workInProgress . child = child ;
2022-08-26 13:06:25 +03:00
for ( var node = child ; node ; ) node . flags = - 3 & node . flags | 1024 , node = node . sibling ;
2021-09-08 12:45:39 +03:00
} else reconcileChildren ( current , workInProgress , nextChildren , renderLanes ) , resetHydrationState ( ) ;
return workInProgress . child ;
2022-06-15 17:36:57 +03:00
} ( current , workInProgress , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 5 :
2022-06-15 17:36:57 +03:00
return current1 = current , workInProgress1 = workInProgress , renderLanes1 = renderLanes , pushHostContext ( workInProgress1 ) , null === current1 && tryToClaimNextHydratableInstance ( workInProgress1 ) , type1 = workInProgress1 . type , nextProps = workInProgress1 . pendingProps , prevProps = null !== current1 ? current1 . memoizedProps : null , nextChildren = nextProps . children , shouldSetTextContent ( type1 , nextProps ) ? nextChildren = null : null !== prevProps && shouldSetTextContent ( type1 , prevProps ) && ( workInProgress1 . flags |= 16 ) , markRef ( current1 , workInProgress1 ) , reconcileChildren ( current1 , workInProgress1 , nextChildren , renderLanes1 ) , workInProgress1 . child ;
2021-08-04 13:27:17 +03:00
case 6 :
2022-06-15 17:36:57 +03:00
return current2 = current , workInProgress2 = workInProgress , null === current2 && tryToClaimNextHydratableInstance ( workInProgress2 ) , null ;
2021-08-04 13:27:17 +03:00
case 13 :
2022-06-15 17:36:57 +03:00
return updateSuspenseComponent ( current , workInProgress , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 4 :
2022-06-15 17:36:57 +03:00
return current3 = current , workInProgress3 = workInProgress , renderLanes2 = renderLanes , pushHostContainer ( workInProgress3 , workInProgress3 . stateNode . containerInfo ) , nextChildren1 = workInProgress3 . pendingProps , null === current3 ? workInProgress3 . child = reconcileChildFibers ( workInProgress3 , null , nextChildren1 , renderLanes2 ) : reconcileChildren ( current3 , workInProgress3 , nextChildren1 , renderLanes2 ) , workInProgress3 . child ;
2021-08-04 13:27:17 +03:00
case 11 :
2022-06-15 17:36:57 +03:00
var type = workInProgress . type , _unresolvedProps2 = workInProgress . pendingProps , _resolvedProps2 = workInProgress . elementType === type ? _unresolvedProps2 : resolveDefaultProps ( type , _unresolvedProps2 ) ;
return updateForwardRef ( current , workInProgress , type , _resolvedProps2 , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 7 :
2022-06-15 17:36:57 +03:00
return current4 = current , workInProgress4 = workInProgress , renderLanes3 = renderLanes , nextChildren2 = workInProgress4 . pendingProps , reconcileChildren ( current4 , workInProgress4 , nextChildren2 , renderLanes3 ) , workInProgress4 . child ;
2021-08-04 13:27:17 +03:00
case 8 :
2022-06-15 17:36:57 +03:00
return current5 = current , workInProgress5 = workInProgress , renderLanes4 = renderLanes , nextChildren3 = workInProgress5 . pendingProps . children , reconcileChildren ( current5 , workInProgress5 , nextChildren3 , renderLanes4 ) , workInProgress5 . child ;
2021-08-04 13:27:17 +03:00
case 12 :
2022-08-26 13:06:25 +03:00
return current6 = current , workInProgress6 = workInProgress , renderLanes5 = renderLanes , workInProgress6 . flags |= 4 , ( stateNode1 = workInProgress6 . stateNode ) . effectDuration = 0 , stateNode1 . passiveEffectDuration = 0 , nextChildren4 = workInProgress6 . pendingProps . children , reconcileChildren ( current6 , workInProgress6 , nextChildren4 , renderLanes5 ) , workInProgress6 . child ;
2021-08-04 13:27:17 +03:00
case 10 :
2022-06-15 17:36:57 +03:00
return function ( current , workInProgress , renderLanes ) {
var context = workInProgress . type . _context , newProps = workInProgress . pendingProps , oldProps = workInProgress . memoizedProps , newValue = newProps . value ;
"value" in newProps || hasWarnedAboutUsingNoValuePropOnContextProvider || ( hasWarnedAboutUsingNoValuePropOnContextProvider = ! 0 , error ( "The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?" ) ) ;
var providerPropTypes = workInProgress . type . propTypes ;
if ( providerPropTypes && checkPropTypes ( providerPropTypes , newProps , "prop" , "Context.Provider" ) , pushProvider ( workInProgress , newValue ) , null !== oldProps ) {
var changedBits = function ( context , newValue , oldValue ) {
2021-09-08 12:45:39 +03:00
if ( objectIs ( oldValue , newValue ) ) return 0 ;
2022-05-04 17:25:28 +03:00
var changedBits = "function" == typeof context . _calculateChangedBits ? context . _calculateChangedBits ( oldValue , newValue ) : 1073741823 ;
2022-06-15 17:36:57 +03:00
return ( 1073741823 & changedBits ) !== changedBits && error ( "calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s" , changedBits ) , 0 | changedBits ;
} ( context , newValue , oldProps . value ) ;
if ( 0 === changedBits ) {
if ( oldProps . children === newProps . children && ! hasContextChanged ( ) ) return bailoutOnAlreadyFinishedWork ( current , workInProgress , renderLanes ) ;
2021-09-08 12:45:39 +03:00
} else ! function ( workInProgress , context , changedBits , renderLanes ) {
var fiber = workInProgress . child ;
for ( null !== fiber && ( fiber . return = workInProgress ) ; null !== fiber ; ) {
var nextFiber = void 0 , list = fiber . dependencies ;
if ( null !== list ) {
nextFiber = fiber . child ;
for ( var dependency = list . firstContext ; null !== dependency ; ) {
if ( dependency . context === context && ( dependency . observedBits & changedBits ) != 0 ) {
if ( 1 === fiber . tag ) {
2022-06-15 17:36:57 +03:00
var a , b , a1 , b1 , a2 , b2 , update = createUpdate ( - 1 , pickArbitraryLane ( renderLanes ) ) ;
2021-09-08 12:45:39 +03:00
update . tag = 2 , enqueueUpdate ( fiber , update ) ;
}
2022-08-26 13:06:25 +03:00
fiber . lanes = ( a = fiber . lanes , b = renderLanes , a | b ) ;
2021-09-08 12:45:39 +03:00
var alternate = fiber . alternate ;
2022-08-26 13:06:25 +03:00
null !== alternate && ( alternate . lanes = ( a1 = alternate . lanes , b1 = renderLanes , a1 | b1 ) ) , scheduleWorkOnParentPath ( fiber . return , renderLanes ) , list . lanes = ( a2 = list . lanes , b2 = renderLanes , a2 | b2 ) ;
2021-09-08 12:45:39 +03:00
break ;
}
dependency = dependency . next ;
}
} else nextFiber = 10 === fiber . tag && fiber . type === workInProgress . type ? null : fiber . child ;
if ( null !== nextFiber ) nextFiber . return = fiber ;
else for ( nextFiber = fiber ; null !== nextFiber ; ) {
if ( nextFiber === workInProgress ) {
nextFiber = null ;
break ;
}
var sibling = nextFiber . sibling ;
if ( null !== sibling ) {
sibling . return = nextFiber . return , nextFiber = sibling ;
break ;
}
nextFiber = nextFiber . return ;
}
fiber = nextFiber ;
}
2022-06-15 17:36:57 +03:00
} ( workInProgress , context , changedBits , renderLanes ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
return reconcileChildren ( current , workInProgress , newProps . children , renderLanes ) , workInProgress . child ;
} ( current , workInProgress , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 9 :
2022-08-26 13:06:25 +03:00
return current7 = current , workInProgress7 = workInProgress , renderLanes6 = renderLanes , void 0 === ( context = workInProgress7 . type ) . _context ? context === context . Consumer || hasWarnedAboutUsingContextAsConsumer || ( hasWarnedAboutUsingContextAsConsumer = ! 0 , error ( "Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?" ) ) : context = context . _context , "function" != typeof ( render = ( newProps1 = workInProgress7 . pendingProps ) . children ) && error ( "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it." ) , prepareToReadContext ( workInProgress7 , renderLanes6 ) , newValue1 = readContext ( context , newProps1 . unstable _observedBits ) , ReactCurrentOwner$1 . current = workInProgress7 , isRendering = ! 0 , newChildren = render ( newValue1 ) , isRendering = ! 1 , workInProgress7 . flags |= 1 , reconcileChildren ( current7 , workInProgress7 , newChildren , renderLanes6 ) , workInProgress7 . child ;
2021-08-04 13:27:17 +03:00
case 14 :
2022-08-26 13:06:25 +03:00
var _type2 = workInProgress . type , _unresolvedProps3 = workInProgress . pendingProps , _resolvedProps3 = resolveDefaultProps ( _type2 , _unresolvedProps3 ) ;
2022-06-15 17:36:57 +03:00
if ( workInProgress . type !== workInProgress . elementType ) {
var outerPropTypes = _type2 . propTypes ;
outerPropTypes && checkPropTypes ( outerPropTypes , _resolvedProps3 , "prop" , getComponentName ( _type2 ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
return _resolvedProps3 = resolveDefaultProps ( _type2 . type , _resolvedProps3 ) , updateMemoComponent ( current , workInProgress , _type2 , _resolvedProps3 , updateLanes , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 15 :
2022-06-15 17:36:57 +03:00
return updateSimpleMemoComponent ( current , workInProgress , workInProgress . type , workInProgress . pendingProps , updateLanes , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 17 :
2022-08-26 13:06:25 +03:00
var current1 , workInProgress1 , renderLanes1 , type1 , nextProps , prevProps , nextChildren , current2 , workInProgress2 , current3 , workInProgress3 , renderLanes2 , nextChildren1 , current4 , workInProgress4 , renderLanes3 , nextChildren2 , current5 , workInProgress5 , renderLanes4 , nextChildren3 , current6 , workInProgress6 , renderLanes5 , stateNode1 , nextChildren4 , current7 , workInProgress7 , renderLanes6 , newChildren , context , newProps1 , render , newValue1 , rendering , rendering1 , _current , workInProgress8 , Component1 , nextProps1 , renderLanes7 , hasContext , _Component3 = workInProgress . type , _unresolvedProps4 = workInProgress . pendingProps , _resolvedProps4 = workInProgress . elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps ( _Component3 , _unresolvedProps4 ) ;
return _current = current , workInProgress8 = workInProgress , Component1 = _Component3 , nextProps1 = _resolvedProps4 , renderLanes7 = renderLanes , null !== _current && ( _current . alternate = null , workInProgress8 . alternate = null , workInProgress8 . flags |= 2 ) , workInProgress8 . tag = 1 , isContextProvider ( Component1 ) ? ( hasContext = ! 0 , pushContextProvider ( workInProgress8 ) ) : hasContext = ! 1 , prepareToReadContext ( workInProgress8 , renderLanes7 ) , constructClassInstance ( workInProgress8 , Component1 , nextProps1 ) , mountClassInstance ( workInProgress8 , Component1 , nextProps1 , renderLanes7 ) , finishClassComponent ( null , workInProgress8 , Component1 , ! 0 , hasContext , renderLanes7 ) ;
2021-08-04 13:27:17 +03:00
case 19 :
2022-06-15 17:36:57 +03:00
return updateSuspenseListComponent ( current , workInProgress , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 20 :
case 21 :
case 22 :
break ;
case 23 :
2022-06-15 17:36:57 +03:00
return updateOffscreenComponent ( current , workInProgress , renderLanes ) ;
2021-08-04 13:27:17 +03:00
case 24 :
2022-06-15 17:36:57 +03:00
return updateLegacyHiddenComponent ( current , workInProgress , renderLanes ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
throw Error ( "Unknown unit of work tag (" + workInProgress . tag + "). This error is likely caused by a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function markUpdate ( workInProgress ) {
2022-08-26 13:06:25 +03:00
workInProgress . flags |= 4 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function markRef$1 ( workInProgress ) {
workInProgress . flags |= 128 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function cutOffTailIfNeeded ( renderState , hasRenderedATailFallback ) {
2022-06-15 17:36:57 +03:00
if ( ! isHydrating ) switch ( renderState . tailMode ) {
2022-05-04 17:25:28 +03:00
case "hidden" :
2021-08-04 13:27:17 +03:00
for ( var tailNode = renderState . tail , lastTailNode = null ; null !== tailNode ; ) null !== tailNode . alternate && ( lastTailNode = tailNode ) , tailNode = tailNode . sibling ;
null === lastTailNode ? renderState . tail = null : lastTailNode . sibling = null ;
break ;
2022-05-04 17:25:28 +03:00
case "collapsed" :
2021-08-04 13:27:17 +03:00
for ( var _tailNode = renderState . tail , _lastTailNode = null ; null !== _tailNode ; ) null !== _tailNode . alternate && ( _lastTailNode = _tailNode ) , _tailNode = _tailNode . sibling ;
null === _lastTailNode ? hasRenderedATailFallback || null === renderState . tail ? renderState . tail = null : renderState . tail . sibling = null : _lastTailNode . sibling = null ;
}
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
function completeWork ( current , workInProgress , renderLanes ) {
var newProps = workInProgress . pendingProps ;
switch ( workInProgress . tag ) {
case 2 :
case 16 :
case 15 :
case 0 :
case 11 :
case 7 :
case 8 :
case 12 :
case 9 :
case 14 :
return null ;
case 1 :
2022-08-26 13:06:25 +03:00
var Component = workInProgress . type ;
return isContextProvider ( Component ) && popContext ( workInProgress ) , null ;
2021-08-04 13:27:17 +03:00
case 3 :
popHostContainer ( workInProgress ) , popTopLevelContextObject ( workInProgress ) , resetWorkInProgressVersions ( ) ;
var fiberRoot = workInProgress . stateNode ;
2022-08-26 13:06:25 +03:00
if ( fiberRoot . pendingContext && ( fiberRoot . context = fiberRoot . pendingContext , fiberRoot . pendingContext = null ) , null === current || null === current . child ) {
var wasHydrated = popHydrationState ( workInProgress ) ;
wasHydrated ? markUpdate ( workInProgress ) : fiberRoot . hydrate || ( workInProgress . flags |= 256 ) ;
}
return updateHostContainer ( workInProgress ) , null ;
2021-08-04 13:27:17 +03:00
case 5 :
popHostContext ( workInProgress ) ;
2022-06-15 17:36:57 +03:00
var rootContainerInstance = getRootHostContainer ( ) , type = workInProgress . type ;
if ( null !== current && null != workInProgress . stateNode ) updateHostComponent$1 ( current , workInProgress , type , newProps , rootContainerInstance ) , current . ref !== workInProgress . ref && markRef$1 ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
else {
if ( ! newProps ) {
if ( ! ( null !== workInProgress . stateNode ) ) throw Error ( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." ) ;
return null ;
}
2022-08-26 13:06:25 +03:00
var currentHostContext = getHostContext ( ) , _wasHydrated = popHydrationState ( workInProgress ) ;
if ( _wasHydrated ) fiber = workInProgress , hostContext = currentHostContext , updatePayload = ( instance1 = fiber . stateNode , type1 = fiber . type , props1 = fiber . memoizedProps , hostContext1 = hostContext , internalInstanceHandle = fiber , hostInst = internalInstanceHandle , node = instance1 , node [ internalInstanceKey ] = hostInst , node1 = instance1 , props = props1 , node1 [ internalPropsKey ] = props , function ( domElement , tag , rawProps , parentNamespace , rootContainerElement ) {
2021-11-15 08:03:03 +03:00
switch ( suppressHydrationWarning = ! 0 === rawProps [ SUPPRESS _HYDRATION _WARNING ] , isCustomComponentTag = isCustomComponent ( tag , rawProps ) , validatePropertiesInDevelopment ( tag , rawProps ) , tag ) {
2022-05-04 17:25:28 +03:00
case "dialog" :
listenToNonDelegatedEvent ( "cancel" , domElement ) , listenToNonDelegatedEvent ( "close" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "iframe" :
case "object" :
case "embed" :
listenToNonDelegatedEvent ( "load" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "video" :
case "audio" :
2021-09-08 12:45:39 +03:00
for ( var isCustomComponentTag , extraAttributeNames , i = 0 ; i < mediaEventTypes . length ; i ++ ) listenToNonDelegatedEvent ( mediaEventTypes [ i ] , domElement ) ;
break ;
2022-05-04 17:25:28 +03:00
case "source" :
listenToNonDelegatedEvent ( "error" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "img" :
case "image" :
case "link" :
listenToNonDelegatedEvent ( "error" , domElement ) , listenToNonDelegatedEvent ( "load" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "details" :
listenToNonDelegatedEvent ( "toggle" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "input" :
initWrapperState ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "option" :
2021-09-08 12:45:39 +03:00
validateProps ( domElement , rawProps ) ;
break ;
2022-05-04 17:25:28 +03:00
case "select" :
initWrapperState$1 ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "textarea" :
initWrapperState$2 ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
}
assertValidProps ( tag , rawProps ) , extraAttributeNames = new Set ( ) ;
for ( var attributes = domElement . attributes , _i = 0 ; _i < attributes . length ; _i ++ ) {
var name = attributes [ _i ] . name . toLowerCase ( ) ;
switch ( name ) {
2022-05-04 17:25:28 +03:00
case "data-reactroot" :
case "value" :
case "checked" :
case "selected" :
2021-09-08 12:45:39 +03:00
break ;
default :
extraAttributeNames . add ( attributes [ _i ] . name ) ;
}
}
var updatePayload = null ;
for ( var propKey in rawProps ) if ( rawProps . hasOwnProperty ( propKey ) ) {
var nextProp = rawProps [ propKey ] ;
2022-05-04 17:25:28 +03:00
if ( propKey === CHILDREN ) "string" == typeof nextProp ? domElement . textContent !== nextProp && ( suppressHydrationWarning || warnForTextDifference ( domElement . textContent , nextProp ) , updatePayload = [
2021-11-15 08:03:03 +03:00
CHILDREN ,
2021-09-08 12:45:39 +03:00
nextProp
2022-05-04 17:25:28 +03:00
] ) : "number" == typeof nextProp && domElement . textContent !== "" + nextProp && ( suppressHydrationWarning || warnForTextDifference ( domElement . textContent , nextProp ) , updatePayload = [
2021-11-15 08:03:03 +03:00
CHILDREN ,
2022-05-04 17:25:28 +03:00
"" + nextProp
2021-09-08 12:45:39 +03:00
] ) ;
2022-06-15 17:36:57 +03:00
else if ( registrationNameDependencies . hasOwnProperty ( propKey ) ) null != nextProp && ( "function" != typeof nextProp && warnForInvalidEventListener ( propKey , nextProp ) , "onScroll" === propKey && listenToNonDelegatedEvent ( "scroll" , domElement ) ) ;
2022-05-04 17:25:28 +03:00
else if ( "boolean" == typeof isCustomComponentTag ) {
2021-09-08 12:45:39 +03:00
var serverValue = void 0 , propertyInfo = getPropertyInfo ( propKey ) ;
if ( suppressHydrationWarning ) ;
2022-05-04 17:25:28 +03:00
else if ( propKey === SUPPRESS _CONTENT _EDITABLE _WARNING || propKey === SUPPRESS _HYDRATION _WARNING || "value" === propKey || "checked" === propKey || "selected" === propKey ) ;
2021-11-15 08:03:03 +03:00
else if ( propKey === DANGEROUSLY _SET _INNER _HTML ) {
var serverHTML = domElement . innerHTML , nextHtml = nextProp ? nextProp [ HTML$1 ] : void 0 ;
2021-09-08 12:45:39 +03:00
if ( null != nextHtml ) {
var expectedHTML = normalizeHTML ( domElement , nextHtml ) ;
expectedHTML !== serverHTML && warnForPropDifference ( propKey , serverHTML , expectedHTML ) ;
}
2021-11-15 08:03:03 +03:00
} else if ( propKey === STYLE ) {
2021-09-08 12:45:39 +03:00
if ( extraAttributeNames . delete ( propKey ) , canDiffStyleForHydrationWarning ) {
var expectedStyle = createDangerousStringForStyles ( nextProp ) ;
2022-05-04 17:25:28 +03:00
expectedStyle !== ( serverValue = domElement . getAttribute ( "style" ) ) && warnForPropDifference ( propKey , serverValue , expectedStyle ) ;
2021-09-08 12:45:39 +03:00
}
2021-10-14 16:48:14 +03:00
} else if ( isCustomComponentTag ) extraAttributeNames . delete ( propKey . toLowerCase ( ) ) , serverValue = getValueForAttribute ( domElement , propKey , nextProp ) , nextProp !== serverValue && warnForPropDifference ( propKey , serverValue , nextProp ) ;
2021-09-08 12:45:39 +03:00
else if ( ! shouldIgnoreAttribute ( propKey , propertyInfo , isCustomComponentTag ) && ! shouldRemoveAttribute ( propKey , nextProp , propertyInfo , isCustomComponentTag ) ) {
var isMismatchDueToBadCasing = ! 1 ;
if ( null !== propertyInfo ) extraAttributeNames . delete ( propertyInfo . attributeName ) , serverValue = getValueForProperty ( domElement , propKey , nextProp , propertyInfo ) ;
else {
var ownNamespace = parentNamespace ;
2021-10-27 07:19:14 +03:00
if ( ownNamespace === HTML _NAMESPACE$1 && ( ownNamespace = getIntrinsicNamespace ( tag ) ) , ownNamespace === HTML _NAMESPACE$1 ) extraAttributeNames . delete ( propKey . toLowerCase ( ) ) ;
2021-09-08 12:45:39 +03:00
else {
var standardName = getPossibleStandardName ( propKey ) ;
null !== standardName && standardName !== propKey && ( isMismatchDueToBadCasing = ! 0 , extraAttributeNames . delete ( standardName ) ) , extraAttributeNames . delete ( propKey ) ;
}
serverValue = getValueForAttribute ( domElement , propKey , nextProp ) ;
}
nextProp === serverValue || isMismatchDueToBadCasing || warnForPropDifference ( propKey , serverValue , nextProp ) ;
}
}
}
switch ( extraAttributeNames . size > 0 && ! suppressHydrationWarning && warnForExtraAttributes ( extraAttributeNames ) , tag ) {
2022-05-04 17:25:28 +03:00
case "input" :
2021-09-08 12:45:39 +03:00
track ( domElement ) , postMountWrapper ( domElement , rawProps , ! 0 ) ;
break ;
2022-05-04 17:25:28 +03:00
case "textarea" :
2021-09-08 12:45:39 +03:00
track ( domElement ) , postMountWrapper$3 ( domElement ) ;
break ;
2022-05-04 17:25:28 +03:00
case "select" :
case "option" :
2021-09-08 12:45:39 +03:00
break ;
default :
2022-05-04 17:25:28 +03:00
"function" == typeof rawProps . onClick && trapClickOnNonInteractiveElement ( domElement ) ;
2021-09-08 12:45:39 +03:00
}
return updatePayload ;
2022-08-26 13:06:25 +03:00
} ( instance1 , type1 , props1 , hostContext1 . namespace ) ) , fiber . updateQueue = updatePayload , null !== updatePayload && markUpdate ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
else {
2022-08-26 13:06:25 +03:00
var hostInst , node , node1 , props , fiber , rootContainerInstance1 , hostContext , instance , instance1 , type1 , props1 , hostContext1 , internalInstanceHandle , updatePayload , domElement , type2 , props2 , rootContainerInstance2 , instance2 = function ( type , props , rootContainerInstance , hostContext , internalInstanceHandle ) {
2022-08-26 11:45:49 +03:00
var hostContextDev = hostContext ;
if ( validateDOMNesting ( type , null , hostContextDev . ancestorInfo ) , "string" == typeof props . children || "number" == typeof props . children ) {
var string = "" + props . children , ownAncestorInfo = updatedAncestorInfo ( hostContextDev . ancestorInfo , type ) ;
validateDOMNesting ( null , string , ownAncestorInfo ) ;
}
var hostInst , node , node1 , props1 , domElement = function ( type , props , rootContainerElement , parentNamespace ) {
var isCustomComponentTag , domElement , ownerDocument = getOwnerDocumentFromRootContainer ( rootContainerElement ) , namespaceURI = parentNamespace ;
if ( namespaceURI === HTML _NAMESPACE$1 && ( namespaceURI = getIntrinsicNamespace ( type ) ) , namespaceURI === HTML _NAMESPACE$1 ) {
if ( ( isCustomComponentTag = isCustomComponent ( type , props ) ) || type === type . toLowerCase ( ) || error ( "<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements." , type ) , "script" === type ) {
var div = ownerDocument . createElement ( "div" ) ;
div . innerHTML = "<script></script>" ;
var firstChild = div . firstChild ;
domElement = div . removeChild ( firstChild ) ;
} else if ( "string" == typeof props . is ) domElement = ownerDocument . createElement ( type , {
is : props . is
} ) ;
else if ( domElement = ownerDocument . createElement ( type ) , "select" === type ) {
var node = domElement ;
props . multiple ? node . multiple = ! 0 : props . size && ( node . size = props . size ) ;
}
} else domElement = ownerDocument . createElementNS ( namespaceURI , type ) ;
return namespaceURI !== HTML _NAMESPACE$1 || isCustomComponentTag || "[object HTMLUnknownElement]" !== Object . prototype . toString . call ( domElement ) || Object . prototype . hasOwnProperty . call ( warnedUnknownTags , type ) || ( warnedUnknownTags [ type ] = ! 0 , error ( "The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter." , type ) ) , domElement ;
} ( type , props , rootContainerInstance , hostContextDev . namespace ) ;
2022-08-26 13:06:25 +03:00
return hostInst = internalInstanceHandle , node = domElement , node [ internalInstanceKey ] = hostInst , node1 = domElement , props1 = props , node1 [ internalPropsKey ] = props1 , domElement ;
2022-08-26 11:45:49 +03:00
} ( type , newProps , rootContainerInstance , currentHostContext , workInProgress ) ;
2022-08-26 13:06:25 +03:00
appendAllChildren ( instance2 , workInProgress , ! 1 , ! 1 ) , workInProgress . stateNode = instance2 , domElement = instance2 , type2 = type , props2 = newProps , rootContainerInstance2 = rootContainerInstance , function ( domElement , tag , rawProps , rootContainerElement ) {
2022-06-15 17:36:57 +03:00
var element , props , node , value , props1 , isCustomComponentTag = isCustomComponent ( tag , rawProps ) ;
switch ( validatePropertiesInDevelopment ( tag , rawProps ) , tag ) {
2022-05-04 17:25:28 +03:00
case "dialog" :
2022-06-15 17:36:57 +03:00
listenToNonDelegatedEvent ( "cancel" , domElement ) , listenToNonDelegatedEvent ( "close" , domElement ) , props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "iframe" :
case "object" :
case "embed" :
2022-06-15 17:36:57 +03:00
listenToNonDelegatedEvent ( "load" , domElement ) , props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "video" :
case "audio" :
2022-06-15 17:36:57 +03:00
for ( var i = 0 ; i < mediaEventTypes . length ; i ++ ) listenToNonDelegatedEvent ( mediaEventTypes [ i ] , domElement ) ;
props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "source" :
2022-06-15 17:36:57 +03:00
listenToNonDelegatedEvent ( "error" , domElement ) , props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "img" :
case "image" :
case "link" :
2022-06-15 17:36:57 +03:00
listenToNonDelegatedEvent ( "error" , domElement ) , listenToNonDelegatedEvent ( "load" , domElement ) , props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "details" :
2022-06-15 17:36:57 +03:00
listenToNonDelegatedEvent ( "toggle" , domElement ) , props1 = rawProps ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "input" :
2022-06-15 17:36:57 +03:00
initWrapperState ( domElement , rawProps ) , props1 = getHostProps ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "option" :
2022-06-15 17:36:57 +03:00
validateProps ( domElement , rawProps ) , props1 = getHostProps$1 ( domElement , rawProps ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "select" :
2022-06-15 17:36:57 +03:00
initWrapperState$1 ( domElement , rawProps ) , props1 = getHostProps$2 ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "textarea" :
2022-06-15 17:36:57 +03:00
initWrapperState$2 ( domElement , rawProps ) , props1 = getHostProps$3 ( domElement , rawProps ) , listenToNonDelegatedEvent ( "invalid" , domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
default :
2022-06-15 17:36:57 +03:00
props1 = rawProps ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
switch ( assertValidProps ( tag , props1 ) , function ( tag , domElement , rootContainerElement , nextProps , isCustomComponentTag ) {
2021-09-08 12:45:39 +03:00
for ( var propKey in nextProps ) if ( nextProps . hasOwnProperty ( propKey ) ) {
var nextProp = nextProps [ propKey ] ;
2021-11-15 08:03:03 +03:00
if ( propKey === STYLE ) nextProp && Object . freeze ( nextProp ) , setValueForStyles ( domElement , nextProp ) ;
else if ( propKey === DANGEROUSLY _SET _INNER _HTML ) {
var nextHtml = nextProp ? nextProp [ HTML$1 ] : void 0 ;
2021-09-08 12:45:39 +03:00
null != nextHtml && setInnerHTML ( domElement , nextHtml ) ;
2022-06-15 17:36:57 +03:00
} else propKey === CHILDREN ? "string" == typeof nextProp ? ( "textarea" !== tag || "" !== nextProp ) && setTextContent ( domElement , nextProp ) : "number" == typeof nextProp && setTextContent ( domElement , "" + nextProp ) : propKey === SUPPRESS _CONTENT _EDITABLE _WARNING || propKey === SUPPRESS _HYDRATION _WARNING || propKey === AUTOFOCUS || ( registrationNameDependencies . hasOwnProperty ( propKey ) ? null != nextProp && ( "function" != typeof nextProp && warnForInvalidEventListener ( propKey , nextProp ) , "onScroll" === propKey && listenToNonDelegatedEvent ( "scroll" , domElement ) ) : null != nextProp && setValueForProperty ( domElement , propKey , nextProp , isCustomComponentTag ) ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( tag , domElement , rootContainerElement , props1 , isCustomComponentTag ) , tag ) {
2022-05-04 17:25:28 +03:00
case "input" :
2022-06-15 17:36:57 +03:00
track ( domElement ) , postMountWrapper ( domElement , rawProps , ! 1 ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "textarea" :
2022-06-15 17:36:57 +03:00
track ( domElement ) , postMountWrapper$3 ( domElement ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "option" :
2022-04-29 08:58:59 +03:00
! function ( element , props ) {
if ( null != props . value ) {
var value ;
2022-05-04 17:25:28 +03:00
element . setAttribute ( "value" , "" + getToStringValue ( props . value ) ) ;
2022-04-29 08:58:59 +03:00
}
2022-06-15 17:36:57 +03:00
} ( domElement , rawProps ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "select" :
2022-06-15 17:36:57 +03:00
element = domElement , props = rawProps , ( node = element ) . multiple = ! ! props . multiple , null != ( value = props . value ) ? updateOptions ( node , ! ! props . multiple , value , ! 1 ) : null != props . defaultValue && updateOptions ( node , ! ! props . multiple , props . defaultValue , ! 0 ) ;
2021-09-08 12:45:39 +03:00
break ;
default :
2022-06-15 17:36:57 +03:00
"function" == typeof props1 . onClick && trapClickOnNonInteractiveElement ( domElement ) ;
2021-09-08 12:45:39 +03:00
}
2022-08-26 13:06:25 +03:00
} ( domElement , type2 , props2 , rootContainerInstance2 ) , shouldAutoFocusHostComponent ( type2 , props2 ) && markUpdate ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
}
null !== workInProgress . ref && markRef$1 ( workInProgress ) ;
}
return null ;
case 6 :
var newText = newProps ;
2021-10-14 16:48:14 +03:00
if ( current && null != workInProgress . stateNode ) {
var oldText = current . memoizedProps ;
updateHostText$1 ( current , workInProgress , oldText , newText ) ;
} else {
2022-05-04 17:25:28 +03:00
if ( "string" != typeof newText && ! ( null !== workInProgress . stateNode ) ) throw Error ( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-08-26 13:06:25 +03:00
var hostInst1 , node2 , text , rootContainerInstance3 , hostContext2 , internalInstanceHandle1 , text1 , rootContainerElement , textNode , _rootContainerInstance = getRootHostContainer ( ) , _currentHostContext = getHostContext ( ) , _wasHydrated2 = popHydrationState ( workInProgress ) ;
_wasHydrated2 ? function ( fiber ) {
var hostInst , node , textInstance , text , internalInstanceHandle , textNode , text1 , textInstance1 = fiber . stateNode , textContent = fiber . memoizedProps , shouldUpdate = ( textInstance = textInstance1 , text = textContent , internalInstanceHandle = fiber , hostInst = internalInstanceHandle , node = textInstance , node [ internalInstanceKey ] = hostInst , textNode = textInstance , text1 = text , textNode . nodeValue !== text1 ) ;
2021-09-08 12:45:39 +03:00
if ( shouldUpdate ) {
var returnFiber = hydrationParentFiber ;
if ( null !== returnFiber ) switch ( returnFiber . tag ) {
case 3 :
2022-08-26 13:06:25 +03:00
returnFiber . stateNode . containerInfo , textInstance2 = textInstance1 , text2 = textContent , warnForUnmatchedText ( textInstance2 , text2 ) ;
2021-09-08 12:45:39 +03:00
break ;
case 5 :
2022-02-21 07:35:56 +03:00
returnFiber . type ;
2022-06-15 17:36:57 +03:00
var textInstance2 , text2 , parentProps , textInstance3 , text3 , parentProps1 = returnFiber . memoizedProps ;
returnFiber . stateNode , parentProps = parentProps1 , textInstance3 = textInstance1 , text3 = textContent , ! 0 !== parentProps [ SUPPRESS _HYDRATION _WARNING$1 ] && warnForUnmatchedText ( textInstance3 , text3 ) ;
2021-09-08 12:45:39 +03:00
}
}
return shouldUpdate ;
2022-08-26 11:45:49 +03:00
} ( workInProgress ) && markUpdate ( workInProgress ) : workInProgress . stateNode = ( text = newText , rootContainerInstance3 = _rootContainerInstance , hostContext2 = _currentHostContext , internalInstanceHandle1 = workInProgress , validateDOMNesting ( null , text , hostContext2 . ancestorInfo ) , textNode = ( text1 = text , getOwnerDocumentFromRootContainer ( rootContainerInstance3 ) . createTextNode ( text1 ) ) , hostInst1 = internalInstanceHandle1 , textNode [ internalInstanceKey ] = hostInst1 , textNode ) ;
2021-08-04 13:27:17 +03:00
}
return null ;
case 13 :
popSuspenseContext ( workInProgress ) ;
2022-08-26 13:06:25 +03:00
var nextState = workInProgress . memoizedState ;
if ( ( 64 & workInProgress . flags ) != 0 ) return workInProgress . lanes = renderLanes , ( 8 & workInProgress . mode ) != 0 && transferActualDuration ( workInProgress ) , workInProgress ;
2021-08-04 13:27:17 +03:00
var nextDidTimeout = null !== nextState , prevDidTimeout = ! 1 ;
2022-08-26 13:06:25 +03:00
if ( null === current ? void 0 !== workInProgress . memoizedProps . fallback && popHydrationState ( workInProgress ) : prevDidTimeout = null !== current . memoizedState , nextDidTimeout && ! prevDidTimeout && ( 2 & workInProgress . mode ) != 0 ) {
var parentContext , hasInvisibleChildContext = null === current && ! 0 !== workInProgress . memoizedProps . unstable _avoidThisFallback ;
hasInvisibleChildContext || ( parentContext = suspenseStackCursor . current , ( 1 & parentContext ) != 0 ) ? renderDidSuspend ( ) : renderDidSuspendDelayIfPossible ( ) ;
}
return ( nextDidTimeout || prevDidTimeout ) && ( workInProgress . flags |= 4 ) , null ;
2021-08-04 13:27:17 +03:00
case 4 :
2022-08-26 13:06:25 +03:00
return popHostContainer ( workInProgress ) , updateHostContainer ( workInProgress ) , null === current && ( portalInstance = workInProgress . stateNode . containerInfo , listenToAllSupportedEvents ( portalInstance ) ) , null ;
2021-08-04 13:27:17 +03:00
case 10 :
return popProvider ( workInProgress ) , null ;
2022-08-26 13:06:25 +03:00
case 17 :
var _Component = workInProgress . type ;
return isContextProvider ( _Component ) && popContext ( workInProgress ) , null ;
2021-08-04 13:27:17 +03:00
case 19 :
popSuspenseContext ( workInProgress ) ;
var renderState = workInProgress . memoizedState ;
if ( null === renderState ) return null ;
2022-08-26 13:06:25 +03:00
var didSuspendAlready = ( 64 & workInProgress . flags ) != 0 , renderedTail = renderState . rendering ;
2022-04-12 05:12:10 +03:00
if ( null === renderedTail ) {
if ( didSuspendAlready ) cutOffTailIfNeeded ( renderState , ! 1 ) ;
else {
2022-08-26 13:06:25 +03:00
if ( ! ( renderHasNotSuspendedYet ( ) && ( null === current || ( 64 & current . flags ) == 0 ) ) ) for ( var row = workInProgress . child ; null !== row ; ) {
2022-04-12 05:12:10 +03:00
var suspended = findFirstSuspended ( row ) ;
if ( null !== suspended ) {
2022-08-26 13:06:25 +03:00
didSuspendAlready = ! 0 , workInProgress . flags |= 64 , cutOffTailIfNeeded ( renderState , ! 1 ) ;
2022-06-15 17:36:57 +03:00
var portalInstance , parentContext1 , newThennables = suspended . updateQueue ;
2022-08-26 13:06:25 +03:00
return null !== newThennables && ( workInProgress . updateQueue = newThennables , workInProgress . flags |= 4 ) , null === renderState . lastEffect && ( workInProgress . firstEffect = null ) , workInProgress . lastEffect = renderState . lastEffect , resetChildFibers ( workInProgress , renderLanes ) , pushSuspenseContext ( workInProgress , ( parentContext1 = suspenseStackCursor . current , 1 & parentContext1 | 2 ) ) , workInProgress . child ;
2022-04-12 05:12:10 +03:00
}
row = row . sibling ;
2021-08-04 13:27:17 +03:00
}
2022-08-26 13:06:25 +03:00
null !== renderState . tail && now ( ) > workInProgressRootRenderTargetTime && ( workInProgress . flags |= 64 , didSuspendAlready = ! 0 , cutOffTailIfNeeded ( renderState , ! 1 ) , workInProgress . lanes = 33554432 , markSpawnedWork ( 33554432 ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-04-12 05:12:10 +03:00
} else {
2021-08-04 13:27:17 +03:00
if ( ! didSuspendAlready ) {
var _suspended = findFirstSuspended ( renderedTail ) ;
if ( null !== _suspended ) {
2022-08-26 13:06:25 +03:00
workInProgress . flags |= 64 , didSuspendAlready = ! 0 ;
2021-08-04 13:27:17 +03:00
var _newThennables = _suspended . updateQueue ;
2022-08-26 13:06:25 +03:00
if ( null !== _newThennables && ( workInProgress . updateQueue = _newThennables , workInProgress . flags |= 4 ) , cutOffTailIfNeeded ( renderState , ! 0 ) , null === renderState . tail && "hidden" === renderState . tailMode && ! renderedTail . alternate && ! isHydrating ) {
2021-08-04 13:27:17 +03:00
var lastEffect = workInProgress . lastEffect = renderState . lastEffect ;
return null !== lastEffect && ( lastEffect . nextEffect = null ) , null ;
}
2022-08-26 13:06:25 +03:00
} else 2 * now ( ) - renderState . renderingStartTime > workInProgressRootRenderTargetTime && 1073741824 !== renderLanes && ( workInProgress . flags |= 64 , didSuspendAlready = ! 0 , cutOffTailIfNeeded ( renderState , ! 1 ) , workInProgress . lanes = 33554432 , markSpawnedWork ( 33554432 ) ) ;
2021-08-04 13:27:17 +03:00
}
if ( renderState . isBackwards ) renderedTail . sibling = workInProgress . child , workInProgress . child = renderedTail ;
else {
var previousSibling = renderState . last ;
null !== previousSibling ? previousSibling . sibling = renderedTail : workInProgress . child = renderedTail , renderState . last = renderedTail ;
}
}
if ( null !== renderState . tail ) {
2022-06-15 17:36:57 +03:00
var parentContext2 , parentContext3 , next = renderState . tail ;
2021-08-04 13:27:17 +03:00
renderState . rendering = next , renderState . tail = next . sibling , renderState . lastEffect = workInProgress . lastEffect , renderState . renderingStartTime = now ( ) , next . sibling = null ;
var suspenseContext = suspenseStackCursor . current ;
2022-08-02 14:37:40 +03:00
return didSuspendAlready ? suspenseContext = 1 & suspenseContext | 2 : suspenseContext &= 1 , pushSuspenseContext ( workInProgress , suspenseContext ) , next ;
2021-08-04 13:27:17 +03:00
}
return null ;
case 20 :
case 21 :
case 22 :
break ;
case 23 :
case 24 :
if ( popRenderLanes ( workInProgress ) , null !== current ) {
var _nextState = workInProgress . memoizedState ;
2022-08-26 13:06:25 +03:00
null !== current . memoizedState != ( null !== _nextState ) && "unstable-defer-without-hiding" !== newProps . mode && ( workInProgress . flags |= 4 ) ;
2021-08-04 13:27:17 +03:00
}
return null ;
}
throw Error ( "Unknown unit of work tag (" + workInProgress . tag + "). This error is likely caused by a bug in React. Please file an issue." ) ;
}
function unwindWork ( workInProgress , renderLanes ) {
switch ( workInProgress . tag ) {
case 1 :
isContextProvider ( workInProgress . type ) && popContext ( workInProgress ) ;
var flags = workInProgress . flags ;
2022-08-26 13:06:25 +03:00
if ( 4096 & flags ) return workInProgress . flags = - 4097 & flags | 64 , ( 8 & workInProgress . mode ) != 0 && transferActualDuration ( workInProgress ) , workInProgress ;
2021-08-04 13:27:17 +03:00
return null ;
case 3 :
popHostContainer ( workInProgress ) , popTopLevelContextObject ( workInProgress ) , resetWorkInProgressVersions ( ) ;
var _flags = workInProgress . flags ;
2022-08-26 13:06:25 +03:00
if ( ( 64 & _flags ) != 0 ) throw Error ( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." ) ;
return workInProgress . flags = - 4097 & _flags | 64 , workInProgress ;
2021-08-04 13:27:17 +03:00
case 5 :
return popHostContext ( workInProgress ) , null ;
case 13 :
popSuspenseContext ( workInProgress ) ;
var _flags2 = workInProgress . flags ;
2022-08-26 13:06:25 +03:00
if ( 4096 & _flags2 ) return workInProgress . flags = - 4097 & _flags2 | 64 , ( 8 & workInProgress . mode ) != 0 && transferActualDuration ( workInProgress ) , workInProgress ;
2021-08-04 13:27:17 +03:00
return null ;
case 19 :
return popSuspenseContext ( workInProgress ) , null ;
case 4 :
return popHostContainer ( workInProgress ) , null ;
case 10 :
return popProvider ( workInProgress ) , null ;
case 23 :
case 24 :
return popRenderLanes ( workInProgress ) , null ;
default :
return null ;
}
}
function unwindInterruptedWork ( interruptedWork ) {
switch ( interruptedWork . tag ) {
case 1 :
2022-04-29 08:58:59 +03:00
var childContextTypes ;
2021-08-04 13:27:17 +03:00
null != interruptedWork . type . childContextTypes && popContext ( interruptedWork ) ;
break ;
case 3 :
popHostContainer ( interruptedWork ) , popTopLevelContextObject ( interruptedWork ) , resetWorkInProgressVersions ( ) ;
break ;
case 5 :
popHostContext ( interruptedWork ) ;
break ;
case 4 :
popHostContainer ( interruptedWork ) ;
break ;
case 13 :
case 19 :
popSuspenseContext ( interruptedWork ) ;
break ;
case 10 :
popProvider ( interruptedWork ) ;
break ;
case 23 :
case 24 :
popRenderLanes ( interruptedWork ) ;
}
}
function createCapturedValue ( value , source ) {
return {
value : value ,
source : source ,
stack : getStackByFiberInDevAndProd ( source )
2021-07-30 04:11:27 +03:00
} ;
}
2021-08-04 13:27:17 +03:00
function logCapturedError ( boundary , errorInfo ) {
try {
2022-08-05 16:25:28 +03:00
var errorBoundaryMessage , error = errorInfo . value , source = errorInfo . source , stack = errorInfo . stack ;
2021-10-21 08:12:50 +03:00
if ( null != error && error . _suppressLogging ) {
2021-08-10 11:52:28 +03:00
if ( 1 === boundary . tag ) return ;
2021-10-21 08:12:50 +03:00
console . error ( error ) ;
2021-08-10 11:52:28 +03:00
}
2022-08-05 16:25:28 +03:00
var componentName = source ? getComponentName ( source . type ) : null , errorBoundaryName = getComponentName ( boundary . type ) ;
2022-06-05 08:52:22 +03:00
errorBoundaryMessage = errorBoundaryName ? "React will try to recreate this component tree from scratch using the error boundary you provided, " + errorBoundaryName + "." : "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://reactjs.org/link/error-boundaries to learn more about error boundaries." ;
2022-08-05 16:25:28 +03:00
var combinedMessage = ( componentName ? "The above error occurred in the <" + componentName + "> component:" : "The above error occurred in one of your React components:" ) + "\n" + ( null !== stack ? stack : "" ) + "\n\n" + errorBoundaryMessage ;
2021-08-10 11:52:28 +03:00
console . error ( combinedMessage ) ;
2021-08-04 13:27:17 +03:00
} catch ( e ) {
setTimeout ( function ( ) {
throw e ;
} ) ;
}
}
appendAllChildren = function ( parent , workInProgress , needsVisibilityToggle , isHidden ) {
for ( var node = workInProgress . child ; null !== node ; ) {
if ( 5 === node . tag || 6 === node . tag ) appendInitialChild ( parent , node . stateNode ) ;
else if ( 4 === node . tag ) ;
else if ( null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( node === workInProgress ) return ;
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === workInProgress ) return ;
node = node . return ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
node . sibling . return = node . return , node = node . sibling ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
} , updateHostContainer = function ( workInProgress ) { } , updateHostComponent$1 = function ( current , workInProgress , type , newProps , rootContainerInstance ) {
var oldProps = current . memoizedProps ;
if ( oldProps !== newProps ) {
2022-08-26 13:06:25 +03:00
var domElement , type1 , oldProps1 , newProps1 , rootContainerInstance1 , hostContext , instance = workInProgress . stateNode , currentHostContext = getHostContext ( ) , updatePayload = ( domElement = instance , type1 = type , oldProps1 = oldProps , newProps1 = newProps , rootContainerInstance1 = rootContainerInstance , hostContext = currentHostContext , typeof newProps1 . children != typeof oldProps1 . children && ( "string" == typeof newProps1 . children || "number" == typeof newProps1 . children ) && validateDOMNesting ( null , "" + newProps1 . children , updatedAncestorInfo ( hostContext . ancestorInfo , type1 ) ) , function ( domElement , tag , lastRawProps , nextRawProps , rootContainerElement ) {
validatePropertiesInDevelopment ( tag , nextRawProps ) ;
var lastProps , nextProps , propKey , styleName , updatePayload = null ;
switch ( tag ) {
case "input" :
lastProps = getHostProps ( domElement , lastRawProps ) , nextProps = getHostProps ( domElement , nextRawProps ) , updatePayload = [ ] ;
break ;
case "option" :
lastProps = getHostProps$1 ( domElement , lastRawProps ) , nextProps = getHostProps$1 ( domElement , nextRawProps ) , updatePayload = [ ] ;
break ;
case "select" :
lastProps = getHostProps$2 ( domElement , lastRawProps ) , nextProps = getHostProps$2 ( domElement , nextRawProps ) , updatePayload = [ ] ;
break ;
case "textarea" :
lastProps = getHostProps$3 ( domElement , lastRawProps ) , nextProps = getHostProps$3 ( domElement , nextRawProps ) , updatePayload = [ ] ;
break ;
default :
lastProps = lastRawProps , nextProps = nextRawProps , "function" != typeof lastProps . onClick && "function" == typeof nextProps . onClick && trapClickOnNonInteractiveElement ( domElement ) ;
2021-09-08 12:45:39 +03:00
}
2022-08-26 13:06:25 +03:00
assertValidProps ( tag , nextProps ) ;
var styleUpdates = null ;
for ( propKey in lastProps ) if ( ! nextProps . hasOwnProperty ( propKey ) && lastProps . hasOwnProperty ( propKey ) && null != lastProps [ propKey ] ) {
if ( propKey === STYLE ) {
var lastStyle = lastProps [ propKey ] ;
for ( styleName in lastStyle ) lastStyle . hasOwnProperty ( styleName ) && ( styleUpdates || ( styleUpdates = { } ) , styleUpdates [ styleName ] = "" ) ;
} else propKey !== DANGEROUSLY _SET _INNER _HTML && propKey !== CHILDREN && propKey !== SUPPRESS _CONTENT _EDITABLE _WARNING && propKey !== SUPPRESS _HYDRATION _WARNING && propKey !== AUTOFOCUS && ( registrationNameDependencies . hasOwnProperty ( propKey ) ? updatePayload || ( updatePayload = [ ] ) : ( updatePayload = updatePayload || [ ] ) . push ( propKey , null ) ) ;
}
for ( propKey in nextProps ) {
var nextProp = nextProps [ propKey ] , lastProp = null != lastProps ? lastProps [ propKey ] : void 0 ;
if ( nextProps . hasOwnProperty ( propKey ) && nextProp !== lastProp && ( null != nextProp || null != lastProp ) ) {
2022-04-12 05:12:10 +03:00
if ( propKey === STYLE ) {
2022-08-26 13:06:25 +03:00
if ( nextProp && Object . freeze ( nextProp ) , lastProp ) {
for ( styleName in lastProp ) ! lastProp . hasOwnProperty ( styleName ) || nextProp && nextProp . hasOwnProperty ( styleName ) || ( styleUpdates || ( styleUpdates = { } ) , styleUpdates [ styleName ] = "" ) ;
for ( styleName in nextProp ) nextProp . hasOwnProperty ( styleName ) && lastProp [ styleName ] !== nextProp [ styleName ] && ( styleUpdates || ( styleUpdates = { } ) , styleUpdates [ styleName ] = nextProp [ styleName ] ) ;
} else styleUpdates || ( updatePayload || ( updatePayload = [ ] ) , updatePayload . push ( propKey , styleUpdates ) ) , styleUpdates = nextProp ;
} else if ( propKey === DANGEROUSLY _SET _INNER _HTML ) {
var nextHtml = nextProp ? nextProp [ HTML$1 ] : void 0 , lastHtml = lastProp ? lastProp [ HTML$1 ] : void 0 ;
null != nextHtml && lastHtml !== nextHtml && ( updatePayload = updatePayload || [ ] ) . push ( propKey , nextHtml ) ;
} else propKey === CHILDREN ? ( "string" == typeof nextProp || "number" == typeof nextProp ) && ( updatePayload = updatePayload || [ ] ) . push ( propKey , "" + nextProp ) : propKey !== SUPPRESS _CONTENT _EDITABLE _WARNING && propKey !== SUPPRESS _HYDRATION _WARNING && ( registrationNameDependencies . hasOwnProperty ( propKey ) ? ( null != nextProp && ( "function" != typeof nextProp && warnForInvalidEventListener ( propKey , nextProp ) , "onScroll" === propKey && listenToNonDelegatedEvent ( "scroll" , domElement ) ) , updatePayload || lastProp === nextProp || ( updatePayload = [ ] ) ) : "object" == typeof nextProp && null !== nextProp && nextProp . $$typeof === REACT _OPAQUE _ID _TYPE ? nextProp . toString ( ) : ( updatePayload = updatePayload || [ ] ) . push ( propKey , nextProp ) ) ;
2022-08-26 10:56:40 +03:00
}
2022-08-26 13:06:25 +03:00
}
return styleUpdates && ( function ( styleUpdates , nextStyles ) {
if ( nextStyles ) {
var expandedUpdates = expandShorthandMap ( styleUpdates ) , expandedStyles = expandShorthandMap ( nextStyles ) , warnedAbout = { } ;
for ( var key in expandedUpdates ) {
var originalKey = expandedUpdates [ key ] , correctOriginalKey = expandedStyles [ key ] ;
if ( correctOriginalKey && originalKey !== correctOriginalKey ) {
var warningKey = originalKey + "," + correctOriginalKey ;
if ( warnedAbout [ warningKey ] ) continue ;
warnedAbout [ warningKey ] = ! 0 , error ( "%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values." , isValueEmpty ( styleUpdates [ originalKey ] ) ? "Removing" : "Updating" , originalKey , correctOriginalKey ) ;
2022-08-26 11:45:49 +03:00
}
}
2022-08-26 13:06:25 +03:00
}
} ( styleUpdates , nextProps [ STYLE ] ) , ( updatePayload = updatePayload || [ ] ) . push ( STYLE , styleUpdates ) ) , updatePayload ;
} ( domElement , type1 , oldProps1 , newProps1 ) ) ;
2022-06-15 17:36:57 +03:00
workInProgress . updateQueue = updatePayload , updatePayload && markUpdate ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
}
} , updateHostText$1 = function ( current , workInProgress , oldText , newText ) {
oldText !== newText && markUpdate ( workInProgress ) ;
} ;
2022-05-04 17:25:28 +03:00
var PossiblyWeakMap$1 = "function" == typeof WeakMap ? WeakMap : Map ;
2021-08-04 13:27:17 +03:00
function createRootErrorUpdate ( fiber , errorInfo , lane ) {
var update = createUpdate ( - 1 , lane ) ;
update . tag = 3 , update . payload = {
element : null
} ;
var error = errorInfo . value ;
return update . callback = function ( ) {
onUncaughtError ( error ) , logCapturedError ( fiber , errorInfo ) ;
} , update ;
}
function createClassErrorUpdate ( fiber , errorInfo , lane ) {
var update = createUpdate ( - 1 , lane ) ;
update . tag = 3 ;
var getDerivedStateFromError = fiber . type . getDerivedStateFromError ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof getDerivedStateFromError ) {
2021-08-04 13:27:17 +03:00
var error$1 = errorInfo . value ;
update . payload = function ( ) {
return logCapturedError ( fiber , errorInfo ) , getDerivedStateFromError ( error$1 ) ;
} ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
var inst = fiber . stateNode ;
2022-05-04 17:25:28 +03:00
return null !== inst && "function" == typeof inst . componentDidCatch ? update . callback = function ( ) {
markFailedErrorBoundaryForHotReloading ( fiber ) , "function" != typeof getDerivedStateFromError && ( markLegacyErrorBoundaryAsFailed ( this ) , logCapturedError ( fiber , errorInfo ) ) ;
2022-08-26 11:45:49 +03:00
var error$1 = errorInfo . value , stack = errorInfo . stack ;
2021-08-04 13:27:17 +03:00
this . componentDidCatch ( error$1 , {
2022-05-04 17:25:28 +03:00
componentStack : null !== stack ? stack : ""
2022-08-26 11:45:49 +03:00
} ) , "function" == typeof getDerivedStateFromError || includesSomeLane ( fiber . lanes , SyncLane ) || error ( "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI." , getComponentName ( fiber . type ) || "Unknown" ) ;
2021-08-04 13:27:17 +03:00
} : update . callback = function ( ) {
markFailedErrorBoundaryForHotReloading ( fiber ) ;
} , update ;
}
function attachPingListener ( root , wakeable , lanes ) {
var threadIDs , pingCache = root . pingCache ;
if ( null === pingCache ? ( pingCache = root . pingCache = new PossiblyWeakMap$1 ( ) , threadIDs = new Set ( ) , pingCache . set ( wakeable , threadIDs ) ) : void 0 === ( threadIDs = pingCache . get ( wakeable ) ) && ( threadIDs = new Set ( ) , pingCache . set ( wakeable , threadIDs ) ) , ! threadIDs . has ( lanes ) ) {
threadIDs . add ( lanes ) ;
var ping = pingSuspendedRoot . bind ( null , root , wakeable , lanes ) ;
wakeable . then ( ping , ping ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
function throwException ( root , returnFiber , sourceFiber , value , rootRenderLanes ) {
2022-05-04 17:25:28 +03:00
if ( sourceFiber . flags |= 2048 , sourceFiber . firstEffect = sourceFiber . lastEffect = null , null !== value && "object" == typeof value && "function" == typeof value . then ) {
2021-08-04 13:27:17 +03:00
var wakeable = value ;
if ( ( 2 & sourceFiber . mode ) == 0 ) {
var currentSource = sourceFiber . alternate ;
currentSource ? ( sourceFiber . updateQueue = currentSource . updateQueue , sourceFiber . memoizedState = currentSource . memoizedState , sourceFiber . lanes = currentSource . lanes ) : ( sourceFiber . updateQueue = null , sourceFiber . memoizedState = null ) ;
}
2022-08-26 13:06:25 +03:00
var parentContext , hasInvisibleParentBoundary = ( parentContext = suspenseStackCursor . current , ( 1 & parentContext ) != 0 ) , _workInProgress = returnFiber ;
2021-08-04 13:27:17 +03:00
do {
if ( 13 === _workInProgress . tag && shouldCaptureSuspense ( _workInProgress , hasInvisibleParentBoundary ) ) {
var wakeables = _workInProgress . updateQueue ;
if ( null === wakeables ) {
var updateQueue = new Set ( ) ;
updateQueue . add ( wakeable ) , _workInProgress . updateQueue = updateQueue ;
} else wakeables . add ( wakeable ) ;
if ( ( 2 & _workInProgress . mode ) == 0 ) {
2022-08-26 13:06:25 +03:00
if ( _workInProgress . flags |= 64 , sourceFiber . flags |= 16384 , sourceFiber . flags &= - 2981 , 1 === sourceFiber . tag ) {
2022-04-12 05:12:10 +03:00
if ( null === sourceFiber . alternate ) sourceFiber . tag = 17 ;
else {
2022-08-26 11:45:49 +03:00
var a , b , update = createUpdate ( - 1 , SyncLane ) ;
2022-04-12 05:12:10 +03:00
update . tag = 2 , enqueueUpdate ( sourceFiber , update ) ;
}
2021-08-04 13:27:17 +03:00
}
2022-08-26 13:06:25 +03:00
sourceFiber . lanes = ( a = sourceFiber . lanes , b = SyncLane , a | b ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
}
2021-09-16 07:23:33 +03:00
attachPingListener ( root , wakeable , rootRenderLanes ) , _workInProgress . flags |= 4096 , _workInProgress . lanes = rootRenderLanes ;
return ;
2021-08-04 13:27:17 +03:00
}
_workInProgress = _workInProgress . return ;
} while ( null !== _workInProgress )
2022-06-11 08:27:13 +03:00
value = Error ( ( getComponentName ( sourceFiber . type ) || "A React component" ) + " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." ) ;
2021-07-30 04:11:27 +03:00
}
2022-04-29 08:58:59 +03:00
renderDidError ( ) , value = createCapturedValue ( value , sourceFiber ) ;
2021-08-04 13:27:17 +03:00
var workInProgress = returnFiber ;
do {
switch ( workInProgress . tag ) {
case 3 :
var _errorInfo = value ;
workInProgress . flags |= 4096 ;
2022-08-26 11:45:49 +03:00
var a1 , b1 , lane = pickArbitraryLane ( rootRenderLanes ) ;
2022-08-26 13:06:25 +03:00
workInProgress . lanes = ( a1 = workInProgress . lanes , b1 = lane , a1 | b1 ) ;
2021-10-14 16:48:14 +03:00
var _update = createRootErrorUpdate ( workInProgress , _errorInfo , lane ) ;
enqueueCapturedUpdate ( workInProgress , _update ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 1 :
var errorInfo = value , ctor = workInProgress . type , instance = workInProgress . stateNode ;
2022-08-26 13:06:25 +03:00
if ( ( 64 & workInProgress . flags ) == 0 && ( "function" == typeof ctor . getDerivedStateFromError || null !== instance && "function" == typeof instance . componentDidCatch && ! isAlreadyFailedLegacyErrorBoundary ( instance ) ) ) {
2021-08-04 13:27:17 +03:00
workInProgress . flags |= 4096 ;
2022-08-26 11:45:49 +03:00
var a2 , b2 , _lane = pickArbitraryLane ( rootRenderLanes ) ;
2022-08-26 13:06:25 +03:00
workInProgress . lanes = ( a2 = workInProgress . lanes , b2 = _lane , a2 | b2 ) ;
2021-10-14 16:48:14 +03:00
var _update2 = createClassErrorUpdate ( workInProgress , errorInfo , _lane ) ;
enqueueCapturedUpdate ( workInProgress , _update2 ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
}
}
workInProgress = workInProgress . return ;
} while ( null !== workInProgress )
}
var didWarnAboutUndefinedSnapshotBeforeUpdate = null ;
didWarnAboutUndefinedSnapshotBeforeUpdate = new Set ( ) ;
2022-05-04 17:25:28 +03:00
var PossiblyWeakSet = "function" == typeof WeakSet ? WeakSet : Set , callComponentWillUnmountWithTimer = function ( current , instance ) {
2021-08-04 13:27:17 +03:00
instance . props = current . memoizedProps , instance . state = current . memoizedState , instance . componentWillUnmount ( ) ;
} ;
function safelyDetachRef ( current ) {
var ref = current . ref ;
2022-08-26 13:06:25 +03:00
null !== ref && ( "function" == typeof ref ? ( invokeGuardedCallback ( null , ref , null , null ) , hasError && captureCommitPhaseError ( current , clearCaughtError ( ) ) ) : ref . current = null ) ;
2021-08-04 13:27:17 +03:00
}
function safelyCallDestroy ( current , destroy ) {
2022-08-26 13:06:25 +03:00
invokeGuardedCallback ( null , destroy , null ) , hasError && captureCommitPhaseError ( current , clearCaughtError ( ) ) ;
2021-08-04 13:27:17 +03:00
}
function commitBeforeMutationLifeCycles ( current , finishedWork ) {
switch ( finishedWork . tag ) {
case 0 :
case 11 :
case 15 :
case 22 :
2022-04-21 13:00:25 +03:00
case 5 :
case 6 :
case 4 :
case 17 :
2021-08-04 13:27:17 +03:00
return ;
case 1 :
if ( 256 & finishedWork . flags && null !== current ) {
var prevProps = current . memoizedProps , prevState = current . memoizedState , instance = finishedWork . stateNode ;
2022-06-15 17:36:57 +03:00
finishedWork . type !== finishedWork . elementType || didWarnAboutReassigningProps || ( instance . props !== finishedWork . memoizedProps && error ( "Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) , instance . state !== finishedWork . memoizedState && error ( "Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) ) ;
2021-08-04 13:27:17 +03:00
var snapshot = instance . getSnapshotBeforeUpdate ( finishedWork . elementType === finishedWork . type ? prevProps : resolveDefaultProps ( finishedWork . type , prevProps ) , prevState ) , didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate ;
2022-06-15 17:36:57 +03:00
void 0 !== snapshot || didWarnSet . has ( finishedWork . type ) || ( didWarnSet . add ( finishedWork . type ) , error ( "%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined." , getComponentName ( finishedWork . type ) ) ) , instance . _ _reactInternalSnapshotBeforeUpdate = snapshot ;
2021-08-04 13:27:17 +03:00
}
return ;
case 3 :
2021-09-16 07:23:33 +03:00
256 & finishedWork . flags && clearContainer ( finishedWork . stateNode . containerInfo ) ;
return ;
2021-08-04 13:27:17 +03:00
}
throw Error ( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ) ;
}
2022-06-15 17:36:57 +03:00
function commitLifeCycles ( finishedRoot , current , finishedWork , committedLanes ) {
switch ( finishedWork . tag ) {
2021-08-04 13:27:17 +03:00
case 0 :
case 11 :
case 15 :
case 22 :
2021-10-06 10:12:11 +03:00
! function ( tag , finishedWork ) {
2021-09-08 12:45:39 +03:00
var updateQueue = finishedWork . updateQueue , lastEffect = null !== updateQueue ? updateQueue . lastEffect : null ;
if ( null !== lastEffect ) {
var firstEffect = lastEffect . next , effect = firstEffect ;
do {
if ( ( effect . tag & tag ) === tag ) {
var create = effect . create ;
effect . destroy = create ( ) ;
var destroy = effect . destroy ;
2022-06-15 17:36:57 +03:00
void 0 !== destroy && "function" != typeof destroy && error ( "An effect function must not return anything besides a function, which is used for clean-up.%s" , null === destroy ? " You returned null. If your effect does not require clean up, return undefined (or nothing)." : "function" == typeof destroy . then ? "\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:\n\nuseEffect(() => {\n async function fetchData() {\n // You can await here\n const response = await MyAPI.getData(someId);\n // ...\n }\n fetchData();\n}, [someId]); // Or [] if effect doesn't need props or state\n\nLearn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching" : " You returned: " + destroy ) ;
2021-09-08 12:45:39 +03:00
}
effect = effect . next ;
} while ( effect !== firstEffect )
}
2022-06-15 17:36:57 +03:00
} ( 3 , finishedWork ) , function ( finishedWork ) {
2021-09-08 12:45:39 +03:00
var updateQueue = finishedWork . updateQueue , lastEffect = null !== updateQueue ? updateQueue . lastEffect : null ;
if ( null !== lastEffect ) {
var firstEffect = lastEffect . next , effect = firstEffect ;
do {
var _effect = effect , next = _effect . next , tag = _effect . tag ;
( 4 & tag ) != 0 && ( 1 & tag ) != 0 && ( enqueuePendingPassiveHookEffectUnmount ( finishedWork , effect ) , enqueuePendingPassiveHookEffectMount ( finishedWork , effect ) ) , effect = next ;
} while ( effect !== firstEffect )
}
2022-06-15 17:36:57 +03:00
} ( finishedWork ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 1 :
2022-06-15 17:36:57 +03:00
var instance = finishedWork . stateNode ;
2022-08-26 13:06:25 +03:00
if ( 4 & finishedWork . flags ) {
2022-06-15 17:36:57 +03:00
if ( null === current ) finishedWork . type !== finishedWork . elementType || didWarnAboutReassigningProps || ( instance . props !== finishedWork . memoizedProps && error ( "Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) , instance . state !== finishedWork . memoizedState && error ( "Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) ) , instance . componentDidMount ( ) ;
2022-04-12 05:12:10 +03:00
else {
2022-06-15 17:36:57 +03:00
var prevProps = finishedWork . elementType === finishedWork . type ? current . memoizedProps : resolveDefaultProps ( finishedWork . type , current . memoizedProps ) , prevState = current . memoizedState ;
finishedWork . type !== finishedWork . elementType || didWarnAboutReassigningProps || ( instance . props !== finishedWork . memoizedProps && error ( "Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) , instance . state !== finishedWork . memoizedState && error ( "Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) ) , instance . componentDidUpdate ( prevProps , prevState , instance . _ _reactInternalSnapshotBeforeUpdate ) ;
2022-04-12 05:12:10 +03:00
}
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
var updateQueue = finishedWork . updateQueue ;
null !== updateQueue && ( finishedWork . type !== finishedWork . elementType || didWarnAboutReassigningProps || ( instance . props !== finishedWork . memoizedProps && error ( "Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) , instance . state !== finishedWork . memoizedState && error ( "Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue." , getComponentName ( finishedWork . type ) || "instance" ) ) , commitUpdateQueue ( finishedWork , updateQueue , instance ) ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 3 :
2022-06-15 17:36:57 +03:00
var _updateQueue = finishedWork . updateQueue ;
2021-08-04 13:27:17 +03:00
if ( null !== _updateQueue ) {
2022-06-15 17:36:57 +03:00
var instance1 , _instance = null ;
if ( null !== finishedWork . child ) switch ( finishedWork . child . tag ) {
2021-08-04 13:27:17 +03:00
case 5 :
case 1 :
2022-06-15 17:36:57 +03:00
_instance = finishedWork . child . stateNode ;
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
commitUpdateQueue ( finishedWork , _updateQueue , _instance ) ;
2021-08-04 13:27:17 +03:00
}
return ;
case 5 :
2022-06-15 17:36:57 +03:00
var _instance2 = finishedWork . stateNode ;
2022-08-26 13:06:25 +03:00
if ( null === current && 4 & finishedWork . flags ) {
2022-06-15 17:36:57 +03:00
var domElement , type , newProps , type1 = finishedWork . type , props = finishedWork . memoizedProps ;
domElement = _instance2 , shouldAutoFocusHostComponent ( type = type1 , props ) && domElement . focus ( ) ;
2021-10-06 10:12:11 +03:00
}
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 6 :
case 4 :
2022-04-21 13:00:25 +03:00
case 19 :
case 17 :
case 20 :
case 21 :
case 23 :
case 24 :
2021-08-04 13:27:17 +03:00
return ;
case 12 :
2022-06-15 17:36:57 +03:00
var _finishedWork$memoize2 = finishedWork . memoizedProps , onRender = ( _finishedWork$memoize2 . onCommit , _finishedWork$memoize2 . onRender ) ;
finishedWork . stateNode . effectDuration ;
2021-09-08 12:45:39 +03:00
var commitTime1 = commitTime ;
2022-06-15 17:36:57 +03:00
"function" == typeof onRender && onRender ( finishedWork . memoizedProps . id , null === current ? "mount" : "update" , finishedWork . actualDuration , finishedWork . treeBaseDuration , finishedWork . actualStartTime , commitTime1 , finishedRoot . memoizedInteractions ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 13 :
2022-06-15 17:36:57 +03:00
commitSuspenseHydrationCallbacks ( finishedRoot , finishedWork ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
}
throw Error ( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ) ;
}
function hideOrUnhideAllChildren ( finishedWork , isHidden ) {
for ( var node = finishedWork ; ; ) {
if ( 5 === node . tag ) {
var instance = node . stateNode ;
isHidden ? hideInstance ( instance ) : unhideInstance ( node . stateNode , node . memoizedProps ) ;
} else if ( 6 === node . tag ) {
var _instance3 = node . stateNode ;
isHidden ? hideTextInstance ( _instance3 ) : unhideTextInstance ( _instance3 , node . memoizedProps ) ;
} else if ( ( 23 === node . tag || 24 === node . tag ) && null !== node . memoizedState && node !== finishedWork ) ;
else if ( null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
}
if ( node === finishedWork ) return ;
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === finishedWork ) return ;
node = node . return ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
node . sibling . return = node . return , node = node . sibling ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
function commitAttachRef ( finishedWork ) {
var ref = finishedWork . ref ;
if ( null !== ref ) {
2022-06-15 17:36:57 +03:00
var instance , instanceToUse , instance1 = finishedWork . stateNode ;
instanceToUse = ( finishedWork . tag , instance1 ) , "function" == typeof ref ? ref ( instanceToUse ) : ( ref . hasOwnProperty ( "current" ) || error ( "Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef()." , getComponentName ( finishedWork . type ) ) , ref . current = instanceToUse ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
function commitDetachRef ( current ) {
var currentRef = current . ref ;
2022-05-04 17:25:28 +03:00
null !== currentRef && ( "function" == typeof currentRef ? currentRef ( null ) : currentRef . current = null ) ;
2021-08-04 13:27:17 +03:00
}
2022-06-15 17:36:57 +03:00
function commitUnmount ( finishedRoot , current , renderPriorityLevel ) {
2021-09-08 12:45:39 +03:00
switch ( ! function ( fiber ) {
2022-05-04 17:25:28 +03:00
if ( injectedHook && "function" == typeof injectedHook . onCommitFiberUnmount ) try {
2021-10-06 10:12:11 +03:00
injectedHook . onCommitFiberUnmount ( rendererID , fiber ) ;
2021-09-08 12:45:39 +03:00
} catch ( err ) {
2022-06-15 17:36:57 +03:00
hasLoggedError || ( hasLoggedError = ! 0 , error ( "React instrumentation encountered an error: %s" , err ) ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( current ) , current . tag ) {
2021-08-04 13:27:17 +03:00
case 0 :
case 11 :
case 14 :
case 15 :
case 22 :
2022-06-15 17:36:57 +03:00
var updateQueue = current . updateQueue ;
2021-08-04 13:27:17 +03:00
if ( null !== updateQueue ) {
var lastEffect = updateQueue . lastEffect ;
if ( null !== lastEffect ) {
var firstEffect = lastEffect . next , effect = firstEffect ;
do {
var _effect2 = effect , destroy = _effect2 . destroy , tag = _effect2 . tag ;
2022-06-15 17:36:57 +03:00
void 0 !== destroy && ( ( 4 & tag ) != 0 ? enqueuePendingPassiveHookEffectUnmount ( current , effect ) : safelyCallDestroy ( current , destroy ) ) , effect = effect . next ;
2021-08-04 13:27:17 +03:00
} while ( effect !== firstEffect )
}
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
return ;
case 1 :
2022-06-15 17:36:57 +03:00
safelyDetachRef ( current ) ;
2022-08-26 13:06:25 +03:00
var current1 , instance , instance1 = current . stateNode ;
"function" != typeof instance1 . componentWillUnmount || ( current1 = current , invokeGuardedCallback ( null , callComponentWillUnmountWithTimer , null , current1 , instance = instance1 ) , hasError && captureCommitPhaseError ( current1 , clearCaughtError ( ) ) ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 5 :
2022-06-15 17:36:57 +03:00
safelyDetachRef ( current ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 4 :
2022-06-15 17:36:57 +03:00
unmountHostComponents ( finishedRoot , current ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 20 :
case 18 :
case 21 :
return ;
}
}
function commitNestedUnmounts ( finishedRoot , root , renderPriorityLevel ) {
for ( var node = root ; ; ) {
if ( commitUnmount ( finishedRoot , node ) , null !== node . child && 4 !== node . tag ) {
node . child . return = node , node = node . child ;
continue ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( node === root ) return ;
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === root ) return ;
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
function detachFiberMutation ( fiber ) {
fiber . alternate = null , fiber . child = null , fiber . dependencies = null , fiber . firstEffect = null , fiber . lastEffect = null , fiber . memoizedProps = null , fiber . memoizedState = null , fiber . pendingProps = null , fiber . return = null , fiber . updateQueue = null , fiber . _debugOwner = null ;
}
function isHostParent ( fiber ) {
return 5 === fiber . tag || 3 === fiber . tag || 4 === fiber . tag ;
}
function commitPlacement ( finishedWork ) {
2022-06-15 17:36:57 +03:00
var parent , isContainer , parentFiber = function ( fiber ) {
2021-10-21 08:12:50 +03:00
for ( var parent = fiber . return ; null !== parent ; ) {
if ( isHostParent ( parent ) ) return parent ;
parent = parent . return ;
2021-09-08 12:45:39 +03:00
}
throw Error ( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." ) ;
} ( finishedWork ) , parentStateNode = parentFiber . stateNode ;
2021-08-04 13:27:17 +03:00
switch ( parentFiber . tag ) {
case 5 :
2022-06-15 17:36:57 +03:00
parent = parentStateNode , isContainer = ! 1 ;
2021-08-04 13:27:17 +03:00
break ;
case 3 :
case 4 :
2022-06-15 17:36:57 +03:00
parent = parentStateNode . containerInfo , isContainer = ! 0 ;
2021-08-04 13:27:17 +03:00
break ;
default :
throw Error ( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
16 & parentFiber . flags && ( resetTextContent ( parent ) , parentFiber . flags &= - 17 ) ;
2021-09-08 12:45:39 +03:00
var before = function ( fiber ) {
2021-10-06 10:12:11 +03:00
var node = fiber ;
2021-09-08 12:45:39 +03:00
siblings : for ( ; ; ) {
for ( ; null === node . sibling ; ) {
if ( null === node . return || isHostParent ( node . return ) ) return null ;
node = node . return ;
}
2022-04-22 04:44:53 +03:00
for ( node . sibling . return = node . return , node = node . sibling ; 5 !== node . tag && 6 !== node . tag && 18 !== node . tag ; ) {
2022-08-26 13:06:25 +03:00
if ( 2 & node . flags || null === node . child || 4 === node . tag ) continue siblings ;
2022-04-22 04:44:53 +03:00
node . child . return = node , node = node . child ;
}
2022-08-26 13:06:25 +03:00
if ( ! ( 2 & node . flags ) ) return node . stateNode ;
2021-09-08 12:45:39 +03:00
}
} ( finishedWork ) ;
2022-06-15 17:36:57 +03:00
isContainer ? insertOrAppendPlacementNodeIntoContainer ( finishedWork , before , parent ) : insertOrAppendPlacementNode ( finishedWork , before , parent ) ;
2021-08-04 13:27:17 +03:00
}
function insertOrAppendPlacementNodeIntoContainer ( node , before , parent ) {
var tag = node . tag , isHost = 5 === tag || 6 === tag ;
2022-03-21 14:06:25 +03:00
if ( isHost ) {
2022-04-29 08:58:59 +03:00
var container , child , beforeChild , container1 , child1 , parentNode , reactRootContainer , stateNode = isHost ? node . stateNode : node . stateNode . instance ;
2021-09-08 12:45:39 +03:00
before ? ( container = parent , child = stateNode , beforeChild = before , 8 === container . nodeType ? container . parentNode . insertBefore ( child , beforeChild ) : container . insertBefore ( child , beforeChild ) ) : ( container1 = parent , child1 = stateNode , 8 === container1 . nodeType ? ( parentNode = container1 . parentNode ) . insertBefore ( child1 , container1 ) : ( parentNode = container1 ) . appendChild ( child1 ) , null == container1 . _reactRootContainer && null === parentNode . onclick && trapClickOnNonInteractiveElement ( parentNode ) ) ;
2021-08-04 13:27:17 +03:00
} else if ( 4 === tag ) ;
else {
2021-10-21 08:12:50 +03:00
var child2 = node . child ;
if ( null !== child2 ) {
insertOrAppendPlacementNodeIntoContainer ( child2 , before , parent ) ;
for ( var sibling = child2 . sibling ; null !== sibling ; ) insertOrAppendPlacementNodeIntoContainer ( sibling , before , parent ) , sibling = sibling . sibling ;
2021-08-04 13:27:17 +03:00
}
}
}
function insertOrAppendPlacementNode ( node , before , parent ) {
var tag = node . tag , isHost = 5 === tag || 6 === tag ;
2022-03-21 14:06:25 +03:00
if ( isHost ) {
2021-08-04 13:27:17 +03:00
var stateNode = isHost ? node . stateNode : node . stateNode . instance ;
2022-03-07 06:51:57 +03:00
before ? function ( parentInstance , child , beforeChild ) {
2021-10-06 10:12:11 +03:00
parentInstance . insertBefore ( child , beforeChild ) ;
2022-03-07 06:51:57 +03:00
} ( parent , stateNode , before ) : function ( parentInstance , child ) {
2021-10-06 10:12:11 +03:00
parentInstance . appendChild ( child ) ;
2022-03-07 06:51:57 +03:00
} ( parent , stateNode ) ;
2021-08-04 13:27:17 +03:00
} else if ( 4 === tag ) ;
else {
2022-06-15 17:36:57 +03:00
var child = node . child ;
if ( null !== child ) {
insertOrAppendPlacementNode ( child , before , parent ) ;
for ( var sibling = child . sibling ; null !== sibling ; ) insertOrAppendPlacementNode ( sibling , before , parent ) , sibling = sibling . sibling ;
2021-08-04 13:27:17 +03:00
}
}
}
function unmountHostComponents ( finishedRoot , current , renderPriorityLevel ) {
for ( var currentParent , currentParentIsContainer , node = current , currentParentIsValid = ! 1 ; ; ) {
if ( ! currentParentIsValid ) {
var parent = node . return ;
findParent : for ( ; ; ) {
if ( ! ( null !== parent ) ) throw Error ( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." ) ;
var parentStateNode = parent . stateNode ;
switch ( parent . tag ) {
case 5 :
currentParent = parentStateNode , currentParentIsContainer = ! 1 ;
break findParent ;
case 3 :
case 4 :
currentParent = parentStateNode . containerInfo , currentParentIsContainer = ! 0 ;
break findParent ;
}
parent = parent . return ;
}
currentParentIsValid = ! 0 ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( 5 === node . tag || 6 === node . tag ) commitNestedUnmounts ( finishedRoot , node ) , currentParentIsContainer ? removeChildFromContainer ( currentParent , node . stateNode ) : removeChild ( currentParent , node . stateNode ) ;
else if ( 4 === node . tag ) {
if ( null !== node . child ) {
currentParent = node . stateNode . containerInfo , currentParentIsContainer = ! 0 , node . child . return = node , node = node . child ;
continue ;
}
} else if ( commitUnmount ( finishedRoot , node ) , null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
if ( node === current ) return ;
for ( ; null === node . sibling ; ) {
if ( null === node . return || node . return === current ) return ;
4 === ( node = node . return ) . tag && ( currentParentIsValid = ! 1 ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
node . sibling . return = node . return , node = node . sibling ;
}
}
function commitDeletion ( finishedRoot , current , renderPriorityLevel ) {
unmountHostComponents ( finishedRoot , current ) ;
var alternate = current . alternate ;
detachFiberMutation ( current ) , null !== alternate && detachFiberMutation ( alternate ) ;
}
2022-06-15 17:36:57 +03:00
function commitWork ( current , finishedWork ) {
switch ( finishedWork . tag ) {
2021-08-04 13:27:17 +03:00
case 0 :
case 11 :
case 14 :
case 15 :
case 22 :
2021-10-06 10:12:11 +03:00
! function ( tag , finishedWork ) {
2021-09-08 12:45:39 +03:00
var updateQueue = finishedWork . updateQueue , lastEffect = null !== updateQueue ? updateQueue . lastEffect : null ;
if ( null !== lastEffect ) {
var firstEffect = lastEffect . next , effect = firstEffect ;
do {
if ( ( effect . tag & tag ) === tag ) {
var destroy = effect . destroy ;
effect . destroy = void 0 , void 0 !== destroy && destroy ( ) ;
}
effect = effect . next ;
} while ( effect !== firstEffect )
}
2022-06-15 17:36:57 +03:00
} ( 3 , finishedWork ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 1 :
2022-04-21 13:00:25 +03:00
case 12 :
case 17 :
2021-08-04 13:27:17 +03:00
return ;
case 5 :
2022-06-15 17:36:57 +03:00
var instance = finishedWork . stateNode ;
2021-08-04 13:27:17 +03:00
if ( null != instance ) {
2022-07-20 11:25:26 +03:00
var node , props , domElement , updatePayload , type , oldProps , newProps , newProps1 = finishedWork . memoizedProps , oldProps1 = null !== current ? current . memoizedProps : newProps1 , type1 = finishedWork . type , updatePayload1 = finishedWork . updateQueue ;
finishedWork . updateQueue = null , null !== updatePayload1 && ( domElement = instance , updatePayload = updatePayload1 , type = type1 , oldProps = oldProps1 , newProps = newProps1 , node = domElement , props = newProps , node [ internalPropsKey ] = props , function ( domElement , updatePayload , tag , lastRawProps , nextRawProps ) {
2022-06-15 17:36:57 +03:00
"input" === tag && "radio" === nextRawProps . type && null != nextRawProps . name && updateChecked ( domElement , nextRawProps ) ;
var element , props , node , wasMultiple , value , wasCustomComponentTag = isCustomComponent ( tag , lastRawProps ) , isCustomComponentTag = isCustomComponent ( tag , nextRawProps ) ;
2022-03-08 17:35:18 +03:00
switch ( function ( domElement , updatePayload , wasCustomComponentTag , isCustomComponentTag ) {
2021-09-08 12:45:39 +03:00
for ( var i = 0 ; i < updatePayload . length ; i += 2 ) {
var propKey = updatePayload [ i ] , propValue = updatePayload [ i + 1 ] ;
2021-11-15 08:03:03 +03:00
propKey === STYLE ? setValueForStyles ( domElement , propValue ) : propKey === DANGEROUSLY _SET _INNER _HTML ? setInnerHTML ( domElement , propValue ) : propKey === CHILDREN ? setTextContent ( domElement , propValue ) : setValueForProperty ( domElement , propKey , propValue , isCustomComponentTag ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( domElement , updatePayload , wasCustomComponentTag , isCustomComponentTag ) , tag ) {
2022-05-04 17:25:28 +03:00
case "input" :
2022-06-15 17:36:57 +03:00
updateWrapper ( domElement , nextRawProps ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "textarea" :
2022-06-15 17:36:57 +03:00
updateWrapper$1 ( domElement , nextRawProps ) ;
2021-09-08 12:45:39 +03:00
break ;
2022-05-04 17:25:28 +03:00
case "select" :
2022-06-15 17:36:57 +03:00
element = domElement , props = nextRawProps , wasMultiple = ( node = element ) . _wrapperState . wasMultiple , node . _wrapperState . wasMultiple = ! ! props . multiple , value = props . value , null != value ? updateOptions ( node , ! ! props . multiple , value , ! 1 ) : ! ! props . multiple !== wasMultiple && ( null != props . defaultValue ? updateOptions ( node , ! ! props . multiple , props . defaultValue , ! 0 ) : updateOptions ( node , ! ! props . multiple , props . multiple ? [ ] : "" , ! 1 ) ) ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( domElement , updatePayload , type , oldProps , newProps ) ) ;
2021-08-04 13:27:17 +03:00
}
return ;
case 6 :
2022-06-15 17:36:57 +03:00
if ( ! ( null !== finishedWork . stateNode ) ) throw Error ( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ) ;
var textInstance , newText , textInstance1 = finishedWork . stateNode , newText1 = finishedWork . memoizedProps ;
null !== current && current . memoizedProps , textInstance = textInstance1 , newText = newText1 , textInstance . nodeValue = newText ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 3 :
2022-06-15 17:36:57 +03:00
var container , _root = finishedWork . stateNode ;
2021-10-06 10:12:11 +03:00
_root . hydrate && ( _root . hydrate = ! 1 , retryIfBlockedOn ( _root . containerInfo ) ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 13 :
2022-06-15 17:36:57 +03:00
commitSuspenseComponent ( finishedWork ) , attachSuspenseRetryListeners ( finishedWork ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 19 :
2022-06-15 17:36:57 +03:00
attachSuspenseRetryListeners ( finishedWork ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
case 20 :
case 21 :
break ;
case 23 :
case 24 :
2022-08-05 16:25:28 +03:00
var newState = finishedWork . memoizedState ;
hideOrUnhideAllChildren ( finishedWork , null !== newState ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-08-04 13:27:17 +03:00
}
throw Error ( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ) ;
}
function commitSuspenseComponent ( finishedWork ) {
null !== finishedWork . memoizedState && ( markCommitTimeOfFallback ( ) , hideOrUnhideAllChildren ( finishedWork . child , ! 0 ) ) ;
}
function commitSuspenseHydrationCallbacks ( finishedRoot , finishedWork ) {
if ( null === finishedWork . memoizedState ) {
var current = finishedWork . alternate ;
if ( null !== current ) {
var prevState = current . memoizedState ;
if ( null !== prevState ) {
2022-06-15 17:36:57 +03:00
var suspenseInstance , suspenseInstance1 = prevState . dehydrated ;
null !== suspenseInstance1 && retryIfBlockedOn ( suspenseInstance1 ) ;
2021-08-04 13:27:17 +03:00
}
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
}
function attachSuspenseRetryListeners ( finishedWork ) {
var wakeables = finishedWork . updateQueue ;
if ( null !== wakeables ) {
finishedWork . updateQueue = null ;
var retryCache = finishedWork . stateNode ;
null === retryCache && ( retryCache = finishedWork . stateNode = new PossiblyWeakSet ( ) ) , wakeables . forEach ( function ( wakeable ) {
var retry = resolveRetryWakeable . bind ( null , finishedWork , wakeable ) ;
retryCache . has ( wakeable ) || ( ! 0 !== wakeable . _ _reactDoNotTraceInteractions && ( retry = unstable _wrap ( retry ) ) , retryCache . add ( wakeable ) , wakeable . then ( retry , retry ) ) ;
} ) ;
}
}
function isSuspenseBoundaryBeingHidden ( current , finishedWork ) {
if ( null !== current ) {
var oldState = current . memoizedState ;
if ( null === oldState || null !== oldState . dehydrated ) {
var newState = finishedWork . memoizedState ;
return null !== newState && null === newState . dehydrated ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
return ! 1 ;
}
function commitResetTextContent ( current ) {
resetTextContent ( current . stateNode ) ;
}
2022-05-04 17:25:28 +03:00
if ( "function" == typeof Symbol && Symbol . for ) {
2021-08-04 13:27:17 +03:00
var symbolFor$1 = Symbol . for ;
2022-05-04 17:25:28 +03:00
symbolFor$1 ( "selector.component" ) , symbolFor$1 ( "selector.has_pseudo_class" ) , symbolFor$1 ( "selector.role" ) , symbolFor$1 ( "selector.test_id" ) , symbolFor$1 ( "selector.text" ) ;
2021-08-04 13:27:17 +03:00
}
2022-08-26 11:45:49 +03:00
var commitHooks = [ ] , ceil = Math . ceil , ReactCurrentDispatcher$2 = ReactSharedInternals . ReactCurrentDispatcher , ReactCurrentOwner$2 = ReactSharedInternals . ReactCurrentOwner , IsSomeRendererActing = ReactSharedInternals . IsSomeRendererActing , executionContext = 0 , workInProgressRoot = null , workInProgress = null , workInProgressRootRenderLanes = NoLanes , subtreeRenderLanes = NoLanes , subtreeRenderLanesCursor = createCursor ( NoLanes ) , workInProgressRootExitStatus = 0 , workInProgressRootFatalError = null , workInProgressRootIncludedLanes = NoLanes , workInProgressRootSkippedLanes = NoLanes , workInProgressRootUpdatedLanes = NoLanes , workInProgressRootPingedLanes = NoLanes , mostRecentlyUpdatedRoot = null , globalMostRecentFallbackTime = 0 , workInProgressRootRenderTargetTime = 1 / 0 ;
2021-08-04 13:27:17 +03:00
function resetRenderTimer ( ) {
workInProgressRootRenderTargetTime = now ( ) + 500 ;
}
2022-08-26 11:45:49 +03:00
var nextEffect = null , hasUncaughtError = ! 1 , firstUncaughtError = null , legacyErrorBoundariesThatAlreadyFailed = null , rootDoesHavePassiveEffects = ! 1 , rootWithPendingPassiveEffects = null , pendingPassiveEffectsRenderPriority = 90 , pendingPassiveEffectsLanes = NoLanes , pendingPassiveHookEffectsMount = [ ] , pendingPassiveHookEffectsUnmount = [ ] , rootsWithPendingDiscreteUpdates = null , nestedUpdateCount = 0 , rootWithNestedUpdates = null , nestedPassiveUpdateCount = 0 , spawnedWorkDuringRender = null , currentEventTime = - 1 , currentEventWipLanes = NoLanes , currentEventPendingLanes = NoLanes , isFlushingPassiveEffects = ! 1 , focusedInstanceHandle = null , shouldFireAfterActiveInstanceBlur = ! 1 ;
2021-08-04 13:27:17 +03:00
function requestEventTime ( ) {
2021-09-08 12:45:39 +03:00
return ( 48 & executionContext ) != 0 ? now ( ) : - 1 !== currentEventTime ? currentEventTime : currentEventTime = now ( ) ;
2021-08-04 13:27:17 +03:00
}
function requestUpdateLane ( fiber ) {
2022-04-29 08:58:59 +03:00
var wipLanes , pendingLanes , lane , lane1 , mode = fiber . mode ;
2022-08-26 11:45:49 +03:00
if ( ( 2 & mode ) == 0 ) return SyncLane ;
if ( ( 4 & mode ) == 0 ) return 99 === getCurrentPriorityLevel ( ) ? SyncLane : 2 ;
2022-08-26 13:06:25 +03:00
if ( currentEventWipLanes === NoLanes && ( currentEventWipLanes = workInProgressRootIncludedLanes ) , 0 !== ReactCurrentBatchConfig . transition ) return currentEventPendingLanes !== NoLanes && ( currentEventPendingLanes = null !== mostRecentlyUpdatedRoot ? mostRecentlyUpdatedRoot . pendingLanes : NoLanes ) , wipLanes = currentEventWipLanes , pendingLanes = currentEventPendingLanes , lane = pickArbitraryLane ( 4186112 & ~ pendingLanes ) , 0 === lane && ( lane = pickArbitraryLane ( 4186112 & ~ wipLanes ) , 0 === lane && ( lane = pickArbitraryLane ( 4186112 ) ) ) , lane ;
2021-08-04 13:27:17 +03:00
var schedulerPriority = getCurrentPriorityLevel ( ) ;
2022-08-26 13:06:25 +03:00
return ( 4 & executionContext ) != 0 && 98 === schedulerPriority ? findUpdateLane ( 12 , currentEventWipLanes ) : findUpdateLane ( function ( schedulerPriorityLevel ) {
switch ( schedulerPriorityLevel ) {
case 99 :
return 15 ;
case 98 :
return 10 ;
case 97 :
case 96 :
return 8 ;
case 95 :
return 2 ;
default :
return 0 ;
}
} ( schedulerPriority ) , currentEventWipLanes ) ;
2021-08-04 13:27:17 +03:00
}
function scheduleUpdateOnFiber ( fiber , lane , eventTime ) {
checkForNestedUpdates ( ) , warnAboutRenderPhaseUpdatesInDEV ( fiber ) ;
2022-04-29 08:58:59 +03:00
var a , b , root = markUpdateLaneFromFiberToRoot ( fiber , lane ) ;
2021-10-21 08:12:50 +03:00
if ( null === root ) return warnAboutUpdateOnUnmountedFiberInDEV ( fiber ) , null ;
2022-08-26 13:06:25 +03:00
markRootUpdated ( root , lane , eventTime ) , root === workInProgressRoot && ( workInProgressRootUpdatedLanes = ( a = workInProgressRootUpdatedLanes , b = lane , a | b ) , 4 === workInProgressRootExitStatus && markRootSuspended$1 ( root , workInProgressRootRenderLanes ) ) ;
2021-08-04 13:27:17 +03:00
var priorityLevel = getCurrentPriorityLevel ( ) ;
2022-08-26 11:45:49 +03:00
lane === SyncLane ? ( 8 & executionContext ) != 0 && ( 48 & executionContext ) == 0 ? ( schedulePendingInteractions ( root , lane ) , performSyncWorkOnRoot ( root ) ) : ( ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , lane ) , 0 === executionContext && ( resetRenderTimer ( ) , flushSyncCallbackQueue ( ) ) ) : ( ( 4 & executionContext ) != 0 && ( 98 === priorityLevel || 99 === priorityLevel ) && ( null === rootsWithPendingDiscreteUpdates ? rootsWithPendingDiscreteUpdates = new Set ( [
2021-10-21 08:12:50 +03:00
root
] ) : rootsWithPendingDiscreteUpdates . add ( root ) ) , ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , lane ) ) , mostRecentlyUpdatedRoot = root ;
2021-08-04 13:27:17 +03:00
}
function markUpdateLaneFromFiberToRoot ( sourceFiber , lane ) {
2022-04-29 08:58:59 +03:00
sourceFiber . lanes = ( a = sourceFiber . lanes ) | lane ;
2022-06-15 17:36:57 +03:00
var a , b , a1 , b1 , a2 , b2 , a3 , b3 , alternate = sourceFiber . alternate ;
2022-08-26 13:06:25 +03:00
null !== alternate && ( alternate . lanes = ( a1 = alternate . lanes ) | lane ) , null === alternate && ( 1026 & sourceFiber . flags ) != 0 && warnAboutUpdateOnNotYetMountedFiberInDEV ( sourceFiber ) ;
for ( var node = sourceFiber , parent = sourceFiber . return ; null !== parent ; ) ( parent . childLanes = ( a2 = parent . childLanes ) | lane , null !== ( alternate = parent . alternate ) ) ? alternate . childLanes = ( a3 = alternate . childLanes ) | lane : ( 1026 & parent . flags ) != 0 && warnAboutUpdateOnNotYetMountedFiberInDEV ( sourceFiber ) , node = parent , parent = parent . return ;
2021-08-04 13:27:17 +03:00
return 3 !== node . tag ? null : node . stateNode ;
}
2022-06-15 17:36:57 +03:00
function ensureRootIsScheduled ( root , currentTime ) {
var callback , newCallbackNode , existingCallbackNode = root . callbackNode ;
2021-09-08 12:45:39 +03:00
! function ( root , currentTime ) {
for ( var pendingLanes = root . pendingLanes , suspendedLanes = root . suspendedLanes , pingedLanes = root . pingedLanes , expirationTimes = root . expirationTimes , lanes = pendingLanes ; lanes > 0 ; ) {
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index , expirationTime = expirationTimes [ index ] ;
2022-08-26 11:45:49 +03:00
- 1 === expirationTime ? ( ( lane & suspendedLanes ) === NoLanes || ( lane & pingedLanes ) !== NoLanes ) && ( expirationTimes [ index ] = computeExpirationTime ( lane , currentTime ) ) : expirationTime <= currentTime && ( root . expiredLanes |= lane ) , lanes &= ~ lane ;
2021-09-08 12:45:39 +03:00
}
2022-06-15 17:36:57 +03:00
} ( root , currentTime ) ;
2022-08-26 11:45:49 +03:00
var nextLanes = getNextLanes ( root , root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes ) , newCallbackPriority = return _highestLanePriority ;
if ( nextLanes === NoLanes ) {
2022-06-15 17:36:57 +03:00
null !== existingCallbackNode && ( cancelCallback ( existingCallbackNode ) , root . callbackNode = null , root . callbackPriority = 0 ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-09-08 12:45:39 +03:00
if ( null !== existingCallbackNode ) {
2022-08-26 13:06:25 +03:00
var existingCallbackPriority = root . callbackPriority ;
if ( existingCallbackPriority === newCallbackPriority ) return ;
2021-09-08 12:45:39 +03:00
cancelCallback ( existingCallbackNode ) ;
}
2022-08-26 13:06:25 +03:00
newCallbackNode = 15 === newCallbackPriority ? ( callback = performSyncWorkOnRoot . bind ( null , root ) , null === syncQueue ? ( syncQueue = [
2021-09-08 12:45:39 +03:00
callback
2022-08-26 13:06:25 +03:00
] , immediateQueueCallbackNode = Scheduler _scheduleCallback ( Scheduler _ImmediatePriority , flushSyncCallbackQueueImpl ) ) : syncQueue . push ( callback ) , fakeCallbackNode ) : 14 === newCallbackPriority ? scheduleCallback ( 99 , performSyncWorkOnRoot . bind ( null , root ) ) : scheduleCallback ( function ( lanePriority ) {
switch ( lanePriority ) {
case 15 :
case 14 :
return 99 ;
case 13 :
case 12 :
case 11 :
case 10 :
return 98 ;
case 9 :
case 8 :
case 7 :
case 6 :
case 4 :
case 5 :
return 97 ;
case 3 :
case 2 :
case 1 :
return 95 ;
case 0 :
return 90 ;
default :
throw Error ( "Invalid update priority: " + lanePriority + ". This is a bug in React." ) ;
}
} ( newCallbackPriority ) , performConcurrentWorkOnRoot . bind ( null , root ) ) , root . callbackPriority = newCallbackPriority , root . callbackNode = newCallbackNode ;
2021-08-04 13:27:17 +03:00
}
function performConcurrentWorkOnRoot ( root ) {
2022-08-26 11:45:49 +03:00
if ( currentEventTime = - 1 , currentEventWipLanes = NoLanes , currentEventPendingLanes = NoLanes , ( 48 & executionContext ) != 0 ) throw Error ( "Should not already be working." ) ;
2022-08-26 13:06:25 +03:00
var originalCallbackNode = root . callbackNode , didFlushPassiveEffects = flushPassiveEffects ( ) ;
if ( didFlushPassiveEffects && root . callbackNode !== originalCallbackNode ) return null ;
2022-08-26 11:45:49 +03:00
var lanes = getNextLanes ( root , root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes ) ;
if ( lanes === NoLanes ) return null ;
var exitStatus = renderRootConcurrent ( root , lanes ) ;
if ( includesSomeLane ( workInProgressRootIncludedLanes , workInProgressRootUpdatedLanes ) ) prepareFreshStack ( root , NoLanes ) ;
2021-08-04 13:27:17 +03:00
else if ( 0 !== exitStatus ) {
2022-08-26 13:06:25 +03:00
if ( 2 === exitStatus && ( executionContext |= 64 , root . hydrate && ( root . hydrate = ! 1 , clearContainer ( root . containerInfo ) ) , lanes = getLanesToRetrySynchronouslyOnError ( root ) , lanes !== NoLanes && ( exitStatus = renderRootSync ( root , lanes ) ) ) , 1 === exitStatus ) {
2021-08-04 13:27:17 +03:00
var fatalError = workInProgressRootFatalError ;
2022-08-26 11:45:49 +03:00
throw prepareFreshStack ( root , NoLanes ) , markRootSuspended$1 ( root , lanes ) , ensureRootIsScheduled ( root , now ( ) ) , fatalError ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
var finishedWork = root . current . alternate ;
root . finishedWork = finishedWork , root . finishedLanes = lanes , finishConcurrentRender ( root , exitStatus , lanes ) ;
}
return ( ensureRootIsScheduled ( root , now ( ) ) , root . callbackNode === originalCallbackNode ) ? performConcurrentWorkOnRoot . bind ( null , root ) : null ;
}
2022-06-15 17:36:57 +03:00
function finishConcurrentRender ( root , exitStatus , lanes ) {
2021-08-04 13:27:17 +03:00
switch ( exitStatus ) {
case 0 :
case 1 :
throw Error ( "Root did not complete. This is a bug in React." ) ;
case 2 :
2022-04-21 13:00:25 +03:00
case 5 :
2022-06-15 17:36:57 +03:00
commitRoot ( root ) ;
2021-08-04 13:27:17 +03:00
break ;
case 3 :
2022-06-15 17:36:57 +03:00
if ( markRootSuspended$1 ( root , lanes ) , includesOnlyRetries ( lanes ) && ! shouldForceFlushFallbacksInDEV ( ) ) {
2022-08-05 16:25:28 +03:00
var lanes1 , msUntilTimeout = globalMostRecentFallbackTime + 500 - now ( ) ;
2021-08-04 13:27:17 +03:00
if ( msUntilTimeout > 10 ) {
2022-08-26 13:06:25 +03:00
var nextLanes = getNextLanes ( root , NoLanes ) ;
if ( nextLanes !== NoLanes ) break ;
2022-06-15 17:36:57 +03:00
var suspendedLanes = root . suspendedLanes ;
if ( ! isSubsetOfLanes ( suspendedLanes , lanes ) ) {
requestEventTime ( ) , markRootPinged ( root , suspendedLanes ) ;
2021-08-04 13:27:17 +03:00
break ;
}
2022-06-15 17:36:57 +03:00
root . timeoutHandle = scheduleTimeout ( commitRoot . bind ( null , root ) , msUntilTimeout ) ;
2021-08-04 13:27:17 +03:00
break ;
}
}
2022-06-15 17:36:57 +03:00
commitRoot ( root ) ;
2021-08-04 13:27:17 +03:00
break ;
case 4 :
2022-08-26 13:06:25 +03:00
if ( markRootSuspended$1 ( root , lanes ) , lanes1 = lanes , ( 4186112 & lanes1 ) === lanes1 ) break ;
2022-04-29 08:58:59 +03:00
if ( ! shouldForceFlushFallbacksInDEV ( ) ) {
2022-08-05 16:25:28 +03:00
var mostRecentEventTime = function ( root , lanes ) {
2021-09-08 12:45:39 +03:00
for ( var eventTimes = root . eventTimes , mostRecentEventTime = - 1 ; lanes > 0 ; ) {
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index , eventTime = eventTimes [ index ] ;
eventTime > mostRecentEventTime && ( mostRecentEventTime = eventTime ) , lanes &= ~ lane ;
}
return mostRecentEventTime ;
2022-08-05 16:25:28 +03:00
} ( root , lanes ) , timeElapsedMs = now ( ) - mostRecentEventTime , _msUntilTimeout = jnd ( timeElapsedMs ) - timeElapsedMs ;
2021-08-04 13:27:17 +03:00
if ( _msUntilTimeout > 10 ) {
2022-06-15 17:36:57 +03:00
root . timeoutHandle = scheduleTimeout ( commitRoot . bind ( null , root ) , _msUntilTimeout ) ;
2021-08-04 13:27:17 +03:00
break ;
}
}
2022-06-15 17:36:57 +03:00
commitRoot ( root ) ;
2021-08-04 13:27:17 +03:00
break ;
default :
throw Error ( "Unknown root exit status." ) ;
}
}
2022-06-15 17:36:57 +03:00
function markRootSuspended$1 ( root , suspendedLanes ) {
2022-04-29 08:58:59 +03:00
var set , subset , set1 , subset1 ;
2022-08-26 13:06:25 +03:00
suspendedLanes = ( set = suspendedLanes , subset = workInProgressRootPingedLanes , set & ~ subset ) , suspendedLanes = ( set1 = suspendedLanes , subset1 = workInProgressRootUpdatedLanes , set1 & ~ subset1 ) , function ( root , suspendedLanes ) {
2021-09-08 12:45:39 +03:00
root . suspendedLanes |= suspendedLanes , root . pingedLanes &= ~ suspendedLanes ;
for ( var expirationTimes = root . expirationTimes , lanes = suspendedLanes ; lanes > 0 ; ) {
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index ;
expirationTimes [ index ] = - 1 , lanes &= ~ lane ;
}
2022-08-26 13:06:25 +03:00
} ( root , suspendedLanes ) ;
2021-08-04 13:27:17 +03:00
}
function performSyncWorkOnRoot ( root ) {
if ( ( 48 & executionContext ) != 0 ) throw Error ( "Should not already be working." ) ;
2022-08-26 13:06:25 +03:00
if ( flushPassiveEffects ( ) , root === workInProgressRoot && includesSomeLane ( root . expiredLanes , workInProgressRootRenderLanes ) ? ( lanes = workInProgressRootRenderLanes , exitStatus = renderRootSync ( root , lanes ) , includesSomeLane ( workInProgressRootIncludedLanes , workInProgressRootUpdatedLanes ) && ( lanes = getNextLanes ( root , lanes ) , exitStatus = renderRootSync ( root , lanes ) ) ) : ( lanes = getNextLanes ( root , NoLanes ) , exitStatus = renderRootSync ( root , lanes ) ) , 0 !== root . tag && 2 === exitStatus && ( executionContext |= 64 , root . hydrate && ( root . hydrate = ! 1 , clearContainer ( root . containerInfo ) ) , lanes = getLanesToRetrySynchronouslyOnError ( root ) , lanes !== NoLanes && ( exitStatus = renderRootSync ( root , lanes ) ) ) , 1 === exitStatus ) {
2022-08-26 11:45:49 +03:00
var lanes , exitStatus , fatalError = workInProgressRootFatalError ;
throw prepareFreshStack ( root , NoLanes ) , markRootSuspended$1 ( root , lanes ) , ensureRootIsScheduled ( root , now ( ) ) , fatalError ;
2021-08-04 13:27:17 +03:00
}
var finishedWork = root . current . alternate ;
return root . finishedWork = finishedWork , root . finishedLanes = lanes , commitRoot ( root ) , ensureRootIsScheduled ( root , now ( ) ) , null ;
}
function batchedUpdates$1 ( fn , a ) {
var prevExecutionContext = executionContext ;
executionContext |= 1 ;
try {
return fn ( a ) ;
} finally {
0 === ( executionContext = prevExecutionContext ) && ( resetRenderTimer ( ) , flushSyncCallbackQueue ( ) ) ;
}
}
function unbatchedUpdates ( fn , a ) {
var prevExecutionContext = executionContext ;
executionContext &= - 2 , executionContext |= 8 ;
try {
return fn ( a ) ;
} finally {
0 === ( executionContext = prevExecutionContext ) && ( resetRenderTimer ( ) , flushSyncCallbackQueue ( ) ) ;
}
}
function flushSync ( fn , a ) {
var prevExecutionContext = executionContext ;
2022-06-15 17:36:57 +03:00
if ( ( 48 & prevExecutionContext ) != 0 ) return error ( "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task." ) , fn ( a ) ;
2021-08-04 13:27:17 +03:00
executionContext |= 1 ;
try {
if ( fn ) return runWithPriority$1 ( 99 , fn . bind ( null , a ) ) ;
return ;
} finally {
executionContext = prevExecutionContext , flushSyncCallbackQueue ( ) ;
}
}
function pushRenderLanes ( fiber , lanes ) {
2022-06-15 17:36:57 +03:00
var a , b , a1 , b1 ;
2022-08-26 13:06:25 +03:00
push ( subtreeRenderLanesCursor , subtreeRenderLanes , fiber ) , subtreeRenderLanes = ( a = subtreeRenderLanes , a | lanes ) , workInProgressRootIncludedLanes = ( a1 = workInProgressRootIncludedLanes , a1 | lanes ) ;
2021-08-04 13:27:17 +03:00
}
function popRenderLanes ( fiber ) {
subtreeRenderLanes = subtreeRenderLanesCursor . current , pop ( subtreeRenderLanesCursor , fiber ) ;
}
function prepareFreshStack ( root , lanes ) {
2022-08-26 11:45:49 +03:00
root . finishedWork = null , root . finishedLanes = NoLanes ;
2021-08-04 13:27:17 +03:00
var timeoutHandle = root . timeoutHandle ;
2022-06-15 17:36:57 +03:00
if ( - 1 !== timeoutHandle && ( root . timeoutHandle = - 1 , cancelTimeout ( timeoutHandle ) ) , null !== workInProgress ) for ( var interruptedWork = workInProgress . return ; null !== interruptedWork ; ) unwindInterruptedWork ( interruptedWork ) , interruptedWork = interruptedWork . return ;
2022-08-26 11:45:49 +03:00
workInProgressRoot = root , workInProgress = createWorkInProgress ( root . current , null ) , workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes , workInProgressRootExitStatus = 0 , workInProgressRootFatalError = null , workInProgressRootSkippedLanes = NoLanes , workInProgressRootUpdatedLanes = NoLanes , workInProgressRootPingedLanes = NoLanes , spawnedWorkDuringRender = null , ReactStrictModeWarnings . discardPendingWarnings ( ) ;
2021-08-04 13:27:17 +03:00
}
function handleError ( root , thrownValue ) {
for ( ; ; ) {
2022-06-15 17:36:57 +03:00
var erroredWork = workInProgress ;
2021-07-30 04:11:27 +03:00
try {
2021-09-16 07:23:33 +03:00
if ( resetContextDependencies ( ) , resetHooksAfterThrow ( ) , resetCurrentFiber ( ) , ReactCurrentOwner$2 . current = null , null === erroredWork || null === erroredWork . return ) {
2022-06-15 17:36:57 +03:00
workInProgressRootExitStatus = 1 , workInProgressRootFatalError = thrownValue , workInProgress = null ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-02-19 11:33:36 +03:00
8 & erroredWork . mode && stopProfilerTimerIfRunningAndRecordDelta ( erroredWork , ! 0 ) , throwException ( root , erroredWork . return , erroredWork , thrownValue , workInProgressRootRenderLanes ) , completeUnitOfWork ( erroredWork ) ;
2021-08-04 13:27:17 +03:00
} catch ( yetAnotherThrownValue ) {
2022-08-26 13:06:25 +03:00
thrownValue = yetAnotherThrownValue , workInProgress === erroredWork && null !== erroredWork ? ( erroredWork = erroredWork . return , workInProgress = erroredWork ) : erroredWork = workInProgress ;
2021-08-04 13:27:17 +03:00
continue ;
}
return ;
}
}
function pushDispatcher ( ) {
var prevDispatcher = ReactCurrentDispatcher$2 . current ;
return ( ReactCurrentDispatcher$2 . current = ContextOnlyDispatcher , null === prevDispatcher ) ? ContextOnlyDispatcher : prevDispatcher ;
}
function popDispatcher ( prevDispatcher ) {
ReactCurrentDispatcher$2 . current = prevDispatcher ;
}
function pushInteractions ( root ) {
var prevInteractions = _ _interactionsRef . current ;
return _ _interactionsRef . current = root . memoizedInteractions , prevInteractions ;
}
function popInteractions ( prevInteractions ) {
_ _interactionsRef . current = prevInteractions ;
}
function markCommitTimeOfFallback ( ) {
globalMostRecentFallbackTime = now ( ) ;
}
2022-04-29 08:58:59 +03:00
function markSkippedUpdateLanes ( lane ) {
var a , b ;
2022-08-26 13:06:25 +03:00
workInProgressRootSkippedLanes = ( a = lane , b = workInProgressRootSkippedLanes , a | b ) ;
2022-04-29 08:58:59 +03:00
}
function renderDidSuspend ( ) {
0 === workInProgressRootExitStatus && ( workInProgressRootExitStatus = 3 ) ;
}
2021-08-04 13:27:17 +03:00
function renderDidSuspendDelayIfPossible ( ) {
2022-04-29 08:58:59 +03:00
( 0 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus ) && ( workInProgressRootExitStatus = 4 ) , null !== workInProgressRoot && ( includesNonIdleWork ( workInProgressRootSkippedLanes ) || includesNonIdleWork ( workInProgressRootUpdatedLanes ) ) && markRootSuspended$1 ( workInProgressRoot , workInProgressRootRenderLanes ) ;
}
function renderDidError ( ) {
5 !== workInProgressRootExitStatus && ( workInProgressRootExitStatus = 2 ) ;
}
function renderHasNotSuspendedYet ( ) {
return 0 === workInProgressRootExitStatus ;
2021-08-04 13:27:17 +03:00
}
function renderRootSync ( root , lanes ) {
var prevExecutionContext = executionContext ;
executionContext |= 16 ;
var prevDispatcher = pushDispatcher ( ) ;
( workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes ) && ( prepareFreshStack ( root , lanes ) , startWorkOnPendingInteractions ( root , lanes ) ) ;
for ( var prevInteractions = pushInteractions ( root ) ; ; ) try {
workLoopSync ( ) ;
break ;
} catch ( thrownValue ) {
handleError ( root , thrownValue ) ;
}
2022-06-15 17:36:57 +03:00
if ( resetContextDependencies ( ) , popInteractions ( prevInteractions ) , executionContext = prevExecutionContext , popDispatcher ( prevDispatcher ) , null !== workInProgress ) throw Error ( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-08-26 11:45:49 +03:00
return workInProgressRoot = null , workInProgressRootRenderLanes = NoLanes , workInProgressRootExitStatus ;
2021-08-04 13:27:17 +03:00
}
function workLoopSync ( ) {
2022-06-15 17:36:57 +03:00
for ( ; null !== workInProgress ; ) performUnitOfWork ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
}
function renderRootConcurrent ( root , lanes ) {
var prevExecutionContext = executionContext ;
executionContext |= 16 ;
var prevDispatcher = pushDispatcher ( ) ;
( workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes ) && ( resetRenderTimer ( ) , prepareFreshStack ( root , lanes ) , startWorkOnPendingInteractions ( root , lanes ) ) ;
for ( var prevInteractions = pushInteractions ( root ) ; ; ) try {
workLoopConcurrent ( ) ;
break ;
} catch ( thrownValue ) {
handleError ( root , thrownValue ) ;
}
2022-08-26 11:45:49 +03:00
return ( resetContextDependencies ( ) , popInteractions ( prevInteractions ) , popDispatcher ( prevDispatcher ) , executionContext = prevExecutionContext , null !== workInProgress ) ? 0 : ( workInProgressRoot = null , workInProgressRootRenderLanes = NoLanes , workInProgressRootExitStatus ) ;
2021-08-04 13:27:17 +03:00
}
function workLoopConcurrent ( ) {
2022-06-15 17:36:57 +03:00
for ( ; null !== workInProgress && ! shouldYield ( ) ; ) performUnitOfWork ( workInProgress ) ;
2021-08-04 13:27:17 +03:00
}
function performUnitOfWork ( unitOfWork ) {
var next , current = unitOfWork . alternate ;
2022-06-15 17:36:57 +03:00
setCurrentFiber ( unitOfWork ) , ( 8 & unitOfWork . mode ) != 0 ? ( startProfilerTimer ( unitOfWork ) , next = beginWork$1 ( current , unitOfWork , subtreeRenderLanes ) , stopProfilerTimerIfRunningAndRecordDelta ( unitOfWork , ! 0 ) ) : next = beginWork$1 ( current , unitOfWork , subtreeRenderLanes ) , resetCurrentFiber ( ) , unitOfWork . memoizedProps = unitOfWork . pendingProps , null === next ? completeUnitOfWork ( unitOfWork ) : workInProgress = next , ReactCurrentOwner$2 . current = null ;
2021-08-04 13:27:17 +03:00
}
function completeUnitOfWork ( unitOfWork ) {
var completedWork = unitOfWork ;
do {
var current = completedWork . alternate , returnFiber = completedWork . return ;
2022-08-26 13:06:25 +03:00
if ( ( 2048 & completedWork . flags ) == 0 ) {
2021-08-04 13:27:17 +03:00
setCurrentFiber ( completedWork ) ;
var next = void 0 ;
2021-09-16 07:23:33 +03:00
if ( ( 8 & completedWork . mode ) == 0 ? next = completeWork ( current , completedWork , subtreeRenderLanes ) : ( startProfilerTimer ( completedWork ) , next = completeWork ( current , completedWork , subtreeRenderLanes ) , stopProfilerTimerIfRunningAndRecordDelta ( completedWork , ! 1 ) ) , resetCurrentFiber ( ) , null !== next ) {
2022-06-15 17:36:57 +03:00
workInProgress = next ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-08-26 13:06:25 +03:00
if ( resetChildLanes ( completedWork ) , null !== returnFiber && ( 2048 & returnFiber . flags ) == 0 ) {
null === returnFiber . firstEffect && ( returnFiber . firstEffect = completedWork . firstEffect ) , null !== completedWork . lastEffect && ( null !== returnFiber . lastEffect && ( returnFiber . lastEffect . nextEffect = completedWork . firstEffect ) , returnFiber . lastEffect = completedWork . lastEffect ) ;
var flags = completedWork . flags ;
flags > 1 && ( null !== returnFiber . lastEffect ? returnFiber . lastEffect . nextEffect = completedWork : returnFiber . firstEffect = completedWork , returnFiber . lastEffect = completedWork ) ;
}
2021-08-04 13:27:17 +03:00
} else {
var _next = unwindWork ( completedWork ) ;
2021-09-16 07:23:33 +03:00
if ( null !== _next ) {
2022-06-15 17:36:57 +03:00
_next . flags &= 2047 , workInProgress = _next ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-09-08 12:45:39 +03:00
if ( ( 8 & completedWork . mode ) != 0 ) {
2021-08-04 13:27:17 +03:00
stopProfilerTimerIfRunningAndRecordDelta ( completedWork , ! 1 ) ;
for ( var actualDuration = completedWork . actualDuration , child = completedWork . child ; null !== child ; ) actualDuration += child . actualDuration , child = child . sibling ;
completedWork . actualDuration = actualDuration ;
}
null !== returnFiber && ( returnFiber . firstEffect = returnFiber . lastEffect = null , returnFiber . flags |= 2048 ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
var siblingFiber = completedWork . sibling ;
2021-09-16 07:23:33 +03:00
if ( null !== siblingFiber ) {
2022-06-15 17:36:57 +03:00
workInProgress = siblingFiber ;
2021-09-16 07:23:33 +03:00
return ;
}
2022-06-15 17:36:57 +03:00
workInProgress = completedWork = returnFiber ;
2021-08-04 13:27:17 +03:00
} while ( null !== completedWork )
0 === workInProgressRootExitStatus && ( workInProgressRootExitStatus = 5 ) ;
}
function resetChildLanes ( completedWork ) {
2022-08-26 11:45:49 +03:00
if ( 24 !== completedWork . tag && 23 !== completedWork . tag || null === completedWork . memoizedState || includesSomeLane ( subtreeRenderLanes , 1073741824 ) || ( 4 & completedWork . mode ) === NoLanes ) {
var newChildLanes = NoLanes ;
2021-09-08 12:45:39 +03:00
if ( ( 8 & completedWork . mode ) != 0 ) {
2022-08-26 13:06:25 +03:00
for ( var a , b , a1 , b1 , actualDuration = completedWork . actualDuration , treeBaseDuration = completedWork . selfBaseDuration , shouldBubbleActualDurations = null === completedWork . alternate || completedWork . child !== completedWork . alternate . child , child = completedWork . child ; null !== child ; ) newChildLanes = ( a1 = newChildLanes , a1 | ( a = child . lanes , b = child . childLanes , a | b ) ) , shouldBubbleActualDurations && ( actualDuration += child . actualDuration ) , treeBaseDuration += child . treeBaseDuration , child = child . sibling ;
2021-08-04 13:27:17 +03:00
if ( 13 === completedWork . tag && null !== completedWork . memoizedState ) {
var primaryChildFragment = completedWork . child ;
null !== primaryChildFragment && ( treeBaseDuration -= primaryChildFragment . treeBaseDuration ) ;
}
completedWork . actualDuration = actualDuration , completedWork . treeBaseDuration = treeBaseDuration ;
2022-08-26 13:06:25 +03:00
} else for ( var a2 , b2 , a3 , b3 , _child = completedWork . child ; null !== _child ; ) newChildLanes = ( a3 = newChildLanes , a3 | ( a2 = _child . lanes , b2 = _child . childLanes , a2 | b2 ) ) , _child = _child . sibling ;
2021-08-04 13:27:17 +03:00
completedWork . childLanes = newChildLanes ;
}
}
function commitRoot ( root ) {
var renderPriorityLevel = getCurrentPriorityLevel ( ) ;
return runWithPriority$1 ( 99 , commitRootImpl . bind ( null , root , renderPriorityLevel ) ) , null ;
}
2022-06-15 17:36:57 +03:00
function commitRootImpl ( root , renderPriorityLevel ) {
2021-08-04 13:27:17 +03:00
do flushPassiveEffects ( ) ;
while ( null !== rootWithPendingPassiveEffects )
if ( flushRenderPhaseStrictModeWarningsInDEV ( ) , ( 48 & executionContext ) != 0 ) throw Error ( "Should not already be working." ) ;
2022-06-15 17:36:57 +03:00
var firstEffect , finishedWork = root . finishedWork , lanes = root . finishedLanes ;
2021-08-04 13:27:17 +03:00
if ( null === finishedWork ) return null ;
2022-08-26 11:45:49 +03:00
if ( root . finishedWork = null , root . finishedLanes = NoLanes , ! ( finishedWork !== root . current ) ) throw Error ( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-06-15 17:36:57 +03:00
root . callbackNode = null ;
var remainingLanes = ( a = finishedWork . lanes , b = finishedWork . childLanes , a | b ) ;
2022-03-21 14:06:25 +03:00
if ( ! function ( root , remainingLanes ) {
2021-09-08 12:45:39 +03:00
var noLongerPendingLanes = root . pendingLanes & ~ remainingLanes ;
root . pendingLanes = remainingLanes , root . suspendedLanes = 0 , root . pingedLanes = 0 , root . expiredLanes &= remainingLanes , root . mutableReadLanes &= remainingLanes , root . entangledLanes &= remainingLanes ;
2021-10-21 08:12:50 +03:00
for ( var entanglements = root . entanglements , eventTimes = root . eventTimes , expirationTimes = root . expirationTimes , lanes = noLongerPendingLanes ; lanes > 0 ; ) {
var index = pickArbitraryLaneIndex ( lanes ) , lane = 1 << index ;
2022-08-26 11:45:49 +03:00
entanglements [ index ] = NoLanes , eventTimes [ index ] = - 1 , expirationTimes [ index ] = - 1 , lanes &= ~ lane ;
2021-09-08 12:45:39 +03:00
}
2022-08-26 11:45:49 +03:00
} ( root , remainingLanes ) , null !== rootsWithPendingDiscreteUpdates && ( 24 & remainingLanes ) === NoLanes && rootsWithPendingDiscreteUpdates . has ( root ) && rootsWithPendingDiscreteUpdates . delete ( root ) , root === workInProgressRoot && ( workInProgressRoot = null , workInProgress = null , workInProgressRootRenderLanes = NoLanes ) , finishedWork . flags > 1 ? null !== finishedWork . lastEffect ? ( finishedWork . lastEffect . nextEffect = finishedWork , firstEffect = finishedWork . firstEffect ) : firstEffect = finishedWork : firstEffect = finishedWork . firstEffect , null !== firstEffect ) {
2022-06-15 17:36:57 +03:00
var a , b , lanes1 , prevExecutionContext = executionContext ;
2021-08-04 13:27:17 +03:00
executionContext |= 32 ;
2022-08-26 13:06:25 +03:00
var focusedElem , input , selection , prevInteractions = pushInteractions ( root ) ;
ReactCurrentOwner$2 . current = null , focusedInstanceHandle = ( root . containerInfo , eventsEnabled = _enabled , selectionInformation = ( focusedElem = getActiveElementDeep ( ) , {
focusedElem : focusedElem ,
2022-06-15 17:36:57 +03:00
selectionRange : hasSelectionCapabilities ( focusedElem ) ? ( "selectionStart" in ( input = focusedElem ) ? {
start : input . selectionStart ,
end : input . selectionEnd
} : function ( outerNode ) {
var ownerDocument = outerNode . ownerDocument , win = ownerDocument && ownerDocument . defaultView || window , selection = win . getSelection && win . getSelection ( ) ;
2021-09-08 12:45:39 +03:00
if ( ! selection || 0 === selection . rangeCount ) return null ;
2022-06-15 17:36:57 +03:00
var anchorNode = selection . anchorNode , anchorOffset = selection . anchorOffset , focusNode = selection . focusNode , focusOffset = selection . focusOffset ;
2021-09-08 12:45:39 +03:00
try {
2022-06-15 17:36:57 +03:00
anchorNode . nodeType , focusNode . nodeType ;
2021-09-08 12:45:39 +03:00
} catch ( e ) {
return null ;
}
2022-03-08 17:35:18 +03:00
return function ( outerNode , anchorNode , anchorOffset , focusNode , focusOffset ) {
2021-09-08 12:45:39 +03:00
var length = 0 , start = - 1 , end = - 1 , indexWithinAnchor = 0 , indexWithinFocus = 0 , node = outerNode , parentNode = null ;
outer : for ( ; ; ) {
2022-03-24 03:49:32 +03:00
for ( var next = null ; node === anchorNode && ( 0 === anchorOffset || 3 === node . nodeType ) && ( start = length + anchorOffset ) , node === focusNode && ( 0 === focusOffset || 3 === node . nodeType ) && ( end = length + focusOffset ) , 3 === node . nodeType && ( length += node . nodeValue . length ) , null !== ( next = node . firstChild ) ; ) parentNode = node , node = next ;
2021-09-08 12:45:39 +03:00
for ( ; ; ) {
if ( node === outerNode ) break outer ;
if ( parentNode === anchorNode && ++ indexWithinAnchor === anchorOffset && ( start = length ) , parentNode === focusNode && ++ indexWithinFocus === focusOffset && ( end = length ) , null !== ( next = node . nextSibling ) ) break ;
parentNode = ( node = parentNode ) . parentNode ;
}
node = next ;
}
return - 1 === start || - 1 === end ? null : {
start : start ,
end : end
} ;
2022-06-15 17:36:57 +03:00
} ( outerNode , anchorNode , anchorOffset , focusNode , focusOffset ) ;
} ( input ) ) || {
2021-09-08 12:45:39 +03:00
start : 0 ,
end : 0
} : null
2022-08-26 13:06:25 +03:00
} ) , setEnabled ( ! 1 ) , null ) , shouldFireAfterActiveInstanceBlur = ! 1 , nextEffect = firstEffect ;
2022-04-05 09:25:23 +03:00
do if ( invokeGuardedCallback ( null , commitBeforeMutationEffects , null ) , hasError ) {
2021-08-04 13:27:17 +03:00
if ( ! ( null !== nextEffect ) ) throw Error ( "Should be working on an effect." ) ;
2022-08-26 13:06:25 +03:00
captureCommitPhaseError ( nextEffect , clearCaughtError ( ) ) , nextEffect = nextEffect . nextEffect ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
while ( null !== nextEffect )
focusedInstanceHandle = null , recordCommitTime ( ) , nextEffect = firstEffect ;
2022-06-15 17:36:57 +03:00
do if ( invokeGuardedCallback ( null , commitMutationEffects , null , root , renderPriorityLevel ) , hasError ) {
2021-08-04 13:27:17 +03:00
if ( ! ( null !== nextEffect ) ) throw Error ( "Should be working on an effect." ) ;
2022-08-26 13:06:25 +03:00
captureCommitPhaseError ( nextEffect , clearCaughtError ( ) ) , nextEffect = nextEffect . nextEffect ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
while ( null !== nextEffect )
2022-06-15 17:36:57 +03:00
root . containerInfo , function ( priorSelectionInformation ) {
var input , offsets , start , end , node , curFocusedElem = getActiveElementDeep ( ) , priorFocusedElem = priorSelectionInformation . focusedElem , priorSelectionRange = priorSelectionInformation . selectionRange ;
2022-08-18 02:24:10 +03:00
if ( curFocusedElem !== priorFocusedElem && ( node = priorFocusedElem ) && node . ownerDocument && function containsNode ( outerNode , innerNode ) {
return ! ! outerNode && ! ! innerNode && ( outerNode === innerNode || ! isTextNode ( outerNode ) && ( isTextNode ( innerNode ) ? containsNode ( outerNode , innerNode . parentNode ) : "contains" in outerNode ? outerNode . contains ( innerNode ) : ! ! outerNode . compareDocumentPosition && ! ! ( 16 & outerNode . compareDocumentPosition ( innerNode ) ) ) ) ;
} ( node . ownerDocument . documentElement , node ) ) {
2022-06-15 17:36:57 +03:00
null !== priorSelectionRange && hasSelectionCapabilities ( priorFocusedElem ) && ( input = priorFocusedElem , start = ( offsets = priorSelectionRange ) . start , end = offsets . end , void 0 === end && ( end = start ) , "selectionStart" in input ? ( input . selectionStart = start , input . selectionEnd = Math . min ( end , input . value . length ) ) : function ( node , offsets ) {
2021-09-08 12:45:39 +03:00
var doc = node . ownerDocument || document , win = doc && doc . defaultView || window ;
if ( win . getSelection ) {
var selection = win . getSelection ( ) , length = node . textContent . length , start = Math . min ( offsets . start , length ) , end = void 0 === offsets . end ? start : Math . min ( offsets . end , length ) ;
if ( ! selection . extend && start > end ) {
var temp = end ;
end = start , start = temp ;
}
var startMarker = getNodeForCharacterOffset ( node , start ) , endMarker = getNodeForCharacterOffset ( node , end ) ;
if ( startMarker && endMarker ) {
if ( 1 === selection . rangeCount && selection . anchorNode === startMarker . node && selection . anchorOffset === startMarker . offset && selection . focusNode === endMarker . node && selection . focusOffset === endMarker . offset ) return ;
var range = doc . createRange ( ) ;
range . setStart ( startMarker . node , startMarker . offset ) , selection . removeAllRanges ( ) , start > end ? ( selection . addRange ( range ) , selection . extend ( endMarker . node , endMarker . offset ) ) : ( range . setEnd ( endMarker . node , endMarker . offset ) , selection . addRange ( range ) ) ;
}
}
2022-06-15 17:36:57 +03:00
} ( input , offsets ) ) ;
2021-09-08 12:45:39 +03:00
for ( var ancestors = [ ] , ancestor = priorFocusedElem ; ancestor = ancestor . parentNode ; ) 1 === ancestor . nodeType && ancestors . push ( {
element : ancestor ,
left : ancestor . scrollLeft ,
top : ancestor . scrollTop
} ) ;
2022-05-04 17:25:28 +03:00
"function" == typeof priorFocusedElem . focus && priorFocusedElem . focus ( ) ;
2021-09-08 12:45:39 +03:00
for ( var i = 0 ; i < ancestors . length ; i ++ ) {
var info = ancestors [ i ] ;
info . element . scrollLeft = info . left , info . element . scrollTop = info . top ;
}
}
2022-06-15 17:36:57 +03:00
} ( selectionInformation ) , setEnabled ( eventsEnabled ) , eventsEnabled = null , selectionInformation = null , root . current = finishedWork , nextEffect = firstEffect ;
do if ( invokeGuardedCallback ( null , commitLayoutEffects , null , root , lanes ) , hasError ) {
2021-08-04 13:27:17 +03:00
if ( ! ( null !== nextEffect ) ) throw Error ( "Should be working on an effect." ) ;
2022-08-26 13:06:25 +03:00
captureCommitPhaseError ( nextEffect , clearCaughtError ( ) ) , nextEffect = nextEffect . nextEffect ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
while ( null !== nextEffect )
nextEffect = null , requestPaint ( ) , popInteractions ( prevInteractions ) , executionContext = prevExecutionContext ;
2022-06-15 17:36:57 +03:00
} else root . current = finishedWork , recordCommitTime ( ) ;
2022-01-21 08:01:20 +03:00
var rootDidHavePassiveEffects = rootDoesHavePassiveEffects ;
2022-06-15 17:36:57 +03:00
if ( rootDoesHavePassiveEffects ) rootDoesHavePassiveEffects = ! 1 , rootWithPendingPassiveEffects = root , pendingPassiveEffectsLanes = lanes , pendingPassiveEffectsRenderPriority = renderPriorityLevel ;
2021-08-04 13:27:17 +03:00
else for ( nextEffect = firstEffect ; null !== nextEffect ; ) {
var nextNextEffect = nextEffect . nextEffect ;
2022-08-26 13:06:25 +03:00
nextEffect . nextEffect = null , 8 & nextEffect . flags && detachFiberAfterEffects ( nextEffect ) , nextEffect = nextNextEffect ;
2021-08-04 13:27:17 +03:00
}
2022-08-26 11:45:49 +03:00
if ( ( remainingLanes = root . pendingLanes ) !== NoLanes ) {
2021-08-04 13:27:17 +03:00
if ( null !== spawnedWorkDuringRender ) {
2022-06-15 17:36:57 +03:00
var expirationTimes = spawnedWorkDuringRender ;
2021-08-04 13:27:17 +03:00
spawnedWorkDuringRender = null ;
2022-06-15 17:36:57 +03:00
for ( var i = 0 ; i < expirationTimes . length ; i ++ ) scheduleInteractions ( root , expirationTimes [ i ] , root . memoizedInteractions ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
schedulePendingInteractions ( root , remainingLanes ) ;
2021-08-04 13:27:17 +03:00
} else legacyErrorBoundariesThatAlreadyFailed = null ;
2022-08-26 11:45:49 +03:00
if ( rootDidHavePassiveEffects || finishPendingInteractions ( root , lanes ) , remainingLanes === SyncLane ? root === rootWithNestedUpdates ? nestedUpdateCount ++ : ( nestedUpdateCount = 0 , rootWithNestedUpdates = root ) : nestedUpdateCount = 0 , ! function ( root , priorityLevel ) {
2022-05-04 17:25:28 +03:00
if ( injectedHook && "function" == typeof injectedHook . onCommitFiberRoot ) try {
2022-08-26 13:06:25 +03:00
var didError = ( 64 & root . current . flags ) == 64 ;
2022-02-19 11:33:36 +03:00
injectedHook . onCommitFiberRoot ( rendererID , root , priorityLevel , didError ) ;
2021-09-08 12:45:39 +03:00
} catch ( err ) {
2022-06-15 17:36:57 +03:00
hasLoggedError || ( hasLoggedError = ! 0 , error ( "React instrumentation encountered an error: %s" , err ) ) ;
2021-09-08 12:45:39 +03:00
}
} ( finishedWork . stateNode , renderPriorityLevel ) , commitHooks . forEach ( function ( commitHook ) {
return commitHook ( ) ;
2022-06-15 17:36:57 +03:00
} ) , ensureRootIsScheduled ( root , now ( ) ) , hasUncaughtError ) {
2021-08-04 13:27:17 +03:00
hasUncaughtError = ! 1 ;
var _error3 = firstUncaughtError ;
throw firstUncaughtError = null , _error3 ;
}
2021-09-08 12:45:39 +03:00
return ( 8 & executionContext ) != 0 || flushSyncCallbackQueue ( ) , null ;
2021-08-04 13:27:17 +03:00
}
function commitBeforeMutationEffects ( ) {
for ( ; null !== nextEffect ; ) {
var current = nextEffect . alternate ;
2022-08-26 13:06:25 +03:00
! shouldFireAfterActiveInstanceBlur && null !== focusedInstanceHandle && ( ( 8 & nextEffect . flags ) != 0 ? doesFiberContain ( nextEffect , focusedInstanceHandle ) && ( shouldFireAfterActiveInstanceBlur = ! 0 ) : 13 === nextEffect . tag && isSuspenseBoundaryBeingHidden ( current , nextEffect ) && doesFiberContain ( nextEffect , focusedInstanceHandle ) && ( shouldFireAfterActiveInstanceBlur = ! 0 ) ) ;
2021-08-04 13:27:17 +03:00
var flags = nextEffect . flags ;
2022-08-26 13:06:25 +03:00
( 256 & flags ) != 0 && ( setCurrentFiber ( nextEffect ) , commitBeforeMutationLifeCycles ( current , nextEffect ) , resetCurrentFiber ( ) ) , ( 512 & flags ) == 0 || rootDoesHavePassiveEffects || ( rootDoesHavePassiveEffects = ! 0 , scheduleCallback ( NormalPriority$1 , function ( ) {
2021-08-04 13:27:17 +03:00
return flushPassiveEffects ( ) , null ;
} ) ) , nextEffect = nextEffect . nextEffect ;
}
}
function commitMutationEffects ( root , renderPriorityLevel ) {
for ( ; null !== nextEffect ; ) {
setCurrentFiber ( nextEffect ) ;
var flags = nextEffect . flags ;
if ( 16 & flags && commitResetTextContent ( nextEffect ) , 128 & flags ) {
var current = nextEffect . alternate ;
null !== current && commitDetachRef ( current ) ;
2021-07-30 04:11:27 +03:00
}
2022-08-26 13:06:25 +03:00
var primaryFlags = 1038 & flags ;
2021-08-04 13:27:17 +03:00
switch ( primaryFlags ) {
2022-08-26 13:06:25 +03:00
case 2 :
commitPlacement ( nextEffect ) , nextEffect . flags &= - 3 ;
2021-08-04 13:27:17 +03:00
break ;
case 6 :
2022-08-26 13:06:25 +03:00
commitPlacement ( nextEffect ) , nextEffect . flags &= - 3 , commitWork ( nextEffect . alternate , nextEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
2022-08-26 13:06:25 +03:00
case 1024 :
nextEffect . flags &= - 1025 ;
2021-08-04 13:27:17 +03:00
break ;
case 1028 :
2022-08-26 13:06:25 +03:00
nextEffect . flags &= - 1025 , commitWork ( nextEffect . alternate , nextEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
2022-08-26 13:06:25 +03:00
case 4 :
2021-08-10 11:52:28 +03:00
commitWork ( nextEffect . alternate , nextEffect ) ;
2021-08-04 13:27:17 +03:00
break ;
2022-08-26 13:06:25 +03:00
case 8 :
2021-08-04 13:27:17 +03:00
commitDeletion ( root , nextEffect ) ;
}
resetCurrentFiber ( ) , nextEffect = nextEffect . nextEffect ;
}
}
function commitLayoutEffects ( root , committedLanes ) {
for ( ; null !== nextEffect ; ) {
setCurrentFiber ( nextEffect ) ;
var flags = nextEffect . flags ;
2022-08-26 13:06:25 +03:00
36 & flags && commitLifeCycles ( root , nextEffect . alternate , nextEffect ) , 128 & flags && commitAttachRef ( nextEffect ) , resetCurrentFiber ( ) , nextEffect = nextEffect . nextEffect ;
2021-08-04 13:27:17 +03:00
}
}
function flushPassiveEffects ( ) {
2021-08-15 16:09:21 +03:00
if ( 90 !== pendingPassiveEffectsRenderPriority ) {
2022-08-26 11:45:49 +03:00
var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority ;
2021-08-15 16:09:21 +03:00
return pendingPassiveEffectsRenderPriority = 90 , runWithPriority$1 ( priorityLevel , flushPassiveEffectsImpl ) ;
}
return ! 1 ;
2021-08-04 13:27:17 +03:00
}
function enqueuePendingPassiveHookEffectMount ( fiber , effect ) {
2022-08-26 11:45:49 +03:00
pendingPassiveHookEffectsMount . push ( effect , fiber ) , rootDoesHavePassiveEffects || ( rootDoesHavePassiveEffects = ! 0 , scheduleCallback ( NormalPriority$1 , function ( ) {
2021-08-04 13:27:17 +03:00
return flushPassiveEffects ( ) , null ;
} ) ) ;
}
function enqueuePendingPassiveHookEffectUnmount ( fiber , effect ) {
pendingPassiveHookEffectsUnmount . push ( effect , fiber ) , fiber . flags |= 8192 ;
var alternate = fiber . alternate ;
2022-08-26 11:45:49 +03:00
null !== alternate && ( alternate . flags |= 8192 ) , rootDoesHavePassiveEffects || ( rootDoesHavePassiveEffects = ! 0 , scheduleCallback ( NormalPriority$1 , function ( ) {
2021-08-04 13:27:17 +03:00
return flushPassiveEffects ( ) , null ;
} ) ) ;
}
function invokePassiveEffectCreate ( effect ) {
var create = effect . create ;
effect . destroy = create ( ) ;
}
function flushPassiveEffectsImpl ( ) {
if ( null === rootWithPendingPassiveEffects ) return ! 1 ;
2021-10-21 08:12:50 +03:00
var root = rootWithPendingPassiveEffects , lanes = pendingPassiveEffectsLanes ;
2022-08-26 11:45:49 +03:00
if ( rootWithPendingPassiveEffects = null , pendingPassiveEffectsLanes = NoLanes , ( 48 & executionContext ) != 0 ) throw Error ( "Cannot flush passive effects while already rendering." ) ;
2021-08-04 13:27:17 +03:00
isFlushingPassiveEffects = ! 0 ;
var prevExecutionContext = executionContext ;
executionContext |= 32 ;
2021-10-21 08:12:50 +03:00
var prevInteractions = pushInteractions ( root ) , unmountEffects = pendingPassiveHookEffectsUnmount ;
2021-08-04 13:27:17 +03:00
pendingPassiveHookEffectsUnmount = [ ] ;
for ( var i = 0 ; i < unmountEffects . length ; i += 2 ) {
var _effect = unmountEffects [ i ] , fiber = unmountEffects [ i + 1 ] , destroy = _effect . destroy ;
_effect . destroy = void 0 , fiber . flags &= - 8193 ;
var alternate = fiber . alternate ;
2022-05-04 17:25:28 +03:00
if ( null !== alternate && ( alternate . flags &= - 8193 ) , "function" == typeof destroy ) {
2022-04-05 09:25:23 +03:00
if ( setCurrentFiber ( fiber ) , invokeGuardedCallback ( null , destroy , null ) , hasError ) {
2021-08-04 13:27:17 +03:00
if ( ! ( null !== fiber ) ) throw Error ( "Should be working on an effect." ) ;
2022-08-26 13:06:25 +03:00
captureCommitPhaseError ( fiber , clearCaughtError ( ) ) ;
2021-08-04 13:27:17 +03:00
}
resetCurrentFiber ( ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
var mountEffects = pendingPassiveHookEffectsMount ;
pendingPassiveHookEffectsMount = [ ] ;
for ( var _i = 0 ; _i < mountEffects . length ; _i += 2 ) {
var _effect2 = mountEffects [ _i ] , _fiber = mountEffects [ _i + 1 ] ;
2022-04-05 09:25:23 +03:00
if ( setCurrentFiber ( _fiber ) , invokeGuardedCallback ( null , invokePassiveEffectCreate , null , _effect2 ) , hasError ) {
2021-08-04 13:27:17 +03:00
if ( ! ( null !== _fiber ) ) throw Error ( "Should be working on an effect." ) ;
2022-08-26 13:06:25 +03:00
captureCommitPhaseError ( _fiber , clearCaughtError ( ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
resetCurrentFiber ( ) ;
}
2021-10-21 08:12:50 +03:00
for ( var effect = root . current . firstEffect ; null !== effect ; ) {
2021-08-04 13:27:17 +03:00
var nextNextEffect = effect . nextEffect ;
2022-08-26 13:06:25 +03:00
effect . nextEffect = null , 8 & effect . flags && detachFiberAfterEffects ( effect ) , effect = nextNextEffect ;
2021-08-04 13:27:17 +03:00
}
2021-10-21 08:12:50 +03:00
return popInteractions ( prevInteractions ) , finishPendingInteractions ( root , lanes ) , isFlushingPassiveEffects = ! 1 , executionContext = prevExecutionContext , flushSyncCallbackQueue ( ) , nestedPassiveUpdateCount = null === rootWithPendingPassiveEffects ? 0 : nestedPassiveUpdateCount + 1 , ! 0 ;
2021-08-04 13:27:17 +03:00
}
function isAlreadyFailedLegacyErrorBoundary ( instance ) {
return null !== legacyErrorBoundariesThatAlreadyFailed && legacyErrorBoundariesThatAlreadyFailed . has ( instance ) ;
}
function markLegacyErrorBoundaryAsFailed ( instance ) {
null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = new Set ( [
instance
] ) : legacyErrorBoundariesThatAlreadyFailed . add ( instance ) ;
}
var onUncaughtError = function ( error ) {
hasUncaughtError || ( hasUncaughtError = ! 0 , firstUncaughtError = error ) ;
} ;
function captureCommitPhaseErrorOnRoot ( rootFiber , sourceFiber , error ) {
2022-08-26 11:45:49 +03:00
var errorInfo = createCapturedValue ( error , sourceFiber ) , update = createRootErrorUpdate ( rootFiber , errorInfo , SyncLane ) ;
2021-10-14 16:48:14 +03:00
enqueueUpdate ( rootFiber , update ) ;
2022-08-26 11:45:49 +03:00
var eventTime = requestEventTime ( ) , root = markUpdateLaneFromFiberToRoot ( rootFiber , SyncLane ) ;
null !== root && ( markRootUpdated ( root , SyncLane , eventTime ) , ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , SyncLane ) ) ;
2021-08-04 13:27:17 +03:00
}
function captureCommitPhaseError ( sourceFiber , error ) {
2021-09-16 07:23:33 +03:00
if ( 3 === sourceFiber . tag ) {
captureCommitPhaseErrorOnRoot ( sourceFiber , sourceFiber , error ) ;
return ;
}
2021-08-04 13:27:17 +03:00
for ( var fiber = sourceFiber . return ; null !== fiber ; ) {
2021-09-16 07:23:33 +03:00
if ( 3 === fiber . tag ) {
captureCommitPhaseErrorOnRoot ( fiber , sourceFiber , error ) ;
return ;
}
2021-08-04 13:27:17 +03:00
if ( 1 === fiber . tag ) {
var ctor = fiber . type , instance = fiber . stateNode ;
2022-05-04 17:25:28 +03:00
if ( "function" == typeof ctor . getDerivedStateFromError || "function" == typeof instance . componentDidCatch && ! isAlreadyFailedLegacyErrorBoundary ( instance ) ) {
2022-08-26 11:45:49 +03:00
var errorInfo = createCapturedValue ( error , sourceFiber ) , update = createClassErrorUpdate ( fiber , errorInfo , SyncLane ) ;
2021-10-14 16:48:14 +03:00
enqueueUpdate ( fiber , update ) ;
2022-08-26 11:45:49 +03:00
var eventTime = requestEventTime ( ) , root = markUpdateLaneFromFiberToRoot ( fiber , SyncLane ) ;
if ( null !== root ) markRootUpdated ( root , SyncLane , eventTime ) , ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , SyncLane ) ;
2022-05-04 17:25:28 +03:00
else if ( "function" == typeof instance . componentDidCatch && ! isAlreadyFailedLegacyErrorBoundary ( instance ) ) try {
2021-08-04 13:27:17 +03:00
instance . componentDidCatch ( error , errorInfo ) ;
2022-01-02 23:54:58 +03:00
} catch ( errorToIgnore ) { }
2021-08-04 13:27:17 +03:00
return ;
}
}
fiber = fiber . return ;
}
}
function pingSuspendedRoot ( root , wakeable , pingedLanes ) {
2022-04-29 08:58:59 +03:00
var a , b , pingCache = root . pingCache ;
2021-08-04 13:27:17 +03:00
null !== pingCache && pingCache . delete ( wakeable ) ;
2022-04-29 08:58:59 +03:00
var eventTime = requestEventTime ( ) ;
2022-08-26 13:06:25 +03:00
markRootPinged ( root , pingedLanes ) , workInProgressRoot === root && isSubsetOfLanes ( workInProgressRootRenderLanes , pingedLanes ) && ( 4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && includesOnlyRetries ( workInProgressRootRenderLanes ) && now ( ) - globalMostRecentFallbackTime < 500 ? prepareFreshStack ( root , NoLanes ) : workInProgressRootPingedLanes = ( a = workInProgressRootPingedLanes , a | pingedLanes ) ) , ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , pingedLanes ) ;
2021-08-04 13:27:17 +03:00
}
function resolveRetryWakeable ( boundaryFiber , wakeable ) {
2022-08-26 13:06:25 +03:00
null !== ( retryCache = boundaryFiber . stateNode ) && retryCache . delete ( wakeable ) ;
var retryCache , boundaryFiber1 , eventTime , root , fiber , wipLanes , lane , mode , retryLane = 0 ;
boundaryFiber1 = boundaryFiber , 0 === retryLane && ( retryLane = ( 2 & ( mode = ( fiber = boundaryFiber1 ) . mode ) ) == 0 ? SyncLane : ( 4 & mode ) == 0 ? 99 === getCurrentPriorityLevel ( ) ? SyncLane : 2 : ( currentEventWipLanes === NoLanes && ( currentEventWipLanes = workInProgressRootIncludedLanes ) , wipLanes = currentEventWipLanes , lane = pickArbitraryLane ( 62914560 & ~ wipLanes ) , 0 === lane && ( lane = pickArbitraryLane ( 62914560 ) ) , lane ) ) , eventTime = requestEventTime ( ) , root = markUpdateLaneFromFiberToRoot ( boundaryFiber1 , retryLane ) , null !== root && ( markRootUpdated ( root , retryLane , eventTime ) , ensureRootIsScheduled ( root , eventTime ) , schedulePendingInteractions ( root , retryLane ) ) ;
2021-08-04 13:27:17 +03:00
}
function jnd ( timeElapsed ) {
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : 1960 * ceil ( timeElapsed / 1960 ) ;
}
function checkForNestedUpdates ( ) {
if ( nestedUpdateCount > 50 ) throw nestedUpdateCount = 0 , rootWithNestedUpdates = null , Error ( "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." ) ;
2022-06-15 17:36:57 +03:00
nestedPassiveUpdateCount > 50 && ( nestedPassiveUpdateCount = 0 , error ( "Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render." ) ) ;
2021-08-04 13:27:17 +03:00
}
function flushRenderPhaseStrictModeWarningsInDEV ( ) {
ReactStrictModeWarnings . flushLegacyContextWarning ( ) , ReactStrictModeWarnings . flushPendingUnsafeLifecycleWarnings ( ) ;
}
var didWarnStateUpdateForNotYetMountedComponent = null ;
function warnAboutUpdateOnNotYetMountedFiberInDEV ( fiber ) {
2022-05-17 10:34:47 +03:00
if ( ( 16 & executionContext ) == 0 && 6 & fiber . mode ) {
var tag = fiber . tag ;
if ( 2 === tag || 3 === tag || 1 === tag || 0 === tag || 11 === tag || 14 === tag || 15 === tag || 22 === tag ) {
var componentName = getComponentName ( fiber . type ) || "ReactComponent" ;
if ( null !== didWarnStateUpdateForNotYetMountedComponent ) {
if ( didWarnStateUpdateForNotYetMountedComponent . has ( componentName ) ) return ;
didWarnStateUpdateForNotYetMountedComponent . add ( componentName ) ;
} else didWarnStateUpdateForNotYetMountedComponent = new Set ( [
componentName
] ) ;
2022-06-15 17:36:57 +03:00
var previousFiber = current ;
2022-05-17 10:34:47 +03:00
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( fiber ) , error ( "Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead." ) ;
2022-05-17 10:34:47 +03:00
} finally {
previousFiber ? setCurrentFiber ( fiber ) : resetCurrentFiber ( ) ;
2021-08-04 13:27:17 +03:00
}
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
}
var didWarnStateUpdateForUnmountedComponent = null ;
function warnAboutUpdateOnUnmountedFiberInDEV ( fiber ) {
var tag = fiber . tag ;
2022-08-26 13:06:25 +03:00
if ( ( 3 === tag || 1 === tag || 0 === tag || 11 === tag || 14 === tag || 15 === tag || 22 === tag ) && ( 8192 & fiber . flags ) == 0 ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( fiber . type ) || "ReactComponent" ;
2021-09-08 12:45:39 +03:00
if ( null !== didWarnStateUpdateForUnmountedComponent ) {
if ( didWarnStateUpdateForUnmountedComponent . has ( componentName ) ) return ;
didWarnStateUpdateForUnmountedComponent . add ( componentName ) ;
} else didWarnStateUpdateForUnmountedComponent = new Set ( [
2021-08-04 13:27:17 +03:00
componentName
2021-09-08 12:45:39 +03:00
] ) ;
if ( isFlushingPassiveEffects ) ;
2021-08-04 13:27:17 +03:00
else {
2022-06-15 17:36:57 +03:00
var previousFiber = current ;
2021-08-04 13:27:17 +03:00
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( fiber ) , error ( "Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s." , 1 === tag ? "the componentWillUnmount method" : "a useEffect cleanup function" ) ;
2021-08-04 13:27:17 +03:00
} finally {
previousFiber ? setCurrentFiber ( fiber ) : resetCurrentFiber ( ) ;
}
}
}
}
beginWork$1 = function ( current , unitOfWork , lanes ) {
var originalWorkInProgressCopy = assignFiberPropertiesInDEV ( null , unitOfWork ) ;
try {
return beginWork ( current , unitOfWork , lanes ) ;
} catch ( originalError ) {
2022-05-04 17:25:28 +03:00
if ( null !== originalError && "object" == typeof originalError && "function" == typeof originalError . then ) throw originalError ;
2022-04-05 09:25:23 +03:00
if ( resetContextDependencies ( ) , resetHooksAfterThrow ( ) , unwindInterruptedWork ( unitOfWork ) , assignFiberPropertiesInDEV ( unitOfWork , originalWorkInProgressCopy ) , 8 & unitOfWork . mode && startProfilerTimer ( unitOfWork ) , invokeGuardedCallback ( null , beginWork , null , current , unitOfWork , lanes ) , hasError ) throw clearCaughtError ( ) ;
2021-08-04 13:27:17 +03:00
throw originalError ;
}
} ;
2021-08-07 11:27:52 +03:00
var didWarnAboutUpdateInRender = ! 1 ;
2021-08-04 13:27:17 +03:00
function warnAboutRenderPhaseUpdatesInDEV ( fiber ) {
2021-09-08 12:45:39 +03:00
if ( isRendering && ( 16 & executionContext ) != 0 && ! isUpdatingOpaqueValueInRenderPhase ) switch ( fiber . tag ) {
2021-08-04 13:27:17 +03:00
case 0 :
case 11 :
case 15 :
2022-06-15 17:36:57 +03:00
var renderingComponentName = workInProgress && getComponentName ( workInProgress . type ) || "Unknown" , dedupeKey = renderingComponentName ;
2022-05-09 19:36:40 +03:00
if ( ! didWarnAboutUpdateInRenderForAnotherComponent . has ( dedupeKey ) ) {
didWarnAboutUpdateInRenderForAnotherComponent . add ( dedupeKey ) ;
var setStateComponentName = getComponentName ( fiber . type ) || "Unknown" ;
2022-06-15 17:36:57 +03:00
error ( "Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render" , setStateComponentName , renderingComponentName , renderingComponentName ) ;
2022-05-09 19:36:40 +03:00
}
2021-08-04 13:27:17 +03:00
break ;
case 1 :
2022-06-15 17:36:57 +03:00
didWarnAboutUpdateInRender || ( error ( "Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state." ) , didWarnAboutUpdateInRender = ! 0 ) ;
2021-08-04 13:27:17 +03:00
}
}
didWarnAboutUpdateInRenderForAnotherComponent = new Set ( ) ;
var IsThisRendererActing = {
current : ! 1
} ;
function warnIfNotScopedWithMatchingAct ( fiber ) {
if ( ! 0 === IsSomeRendererActing . current && ! 0 !== IsThisRendererActing . current ) {
2022-06-15 17:36:57 +03:00
var previousFiber = current ;
2021-07-30 04:11:27 +03:00
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( fiber ) , error ( "It looks like you're using the wrong act() around your test interactions.\nBe sure to use the matching version of act() corresponding to your renderer:\n\n// for react-dom:\nimport {act} from 'react-dom/test-utils';\n// ...\nact(() => ...);\n\n// for react-test-renderer:\nimport TestRenderer from react-test-renderer';\nconst {act} = TestRenderer;\n// ...\nact(() => ...);" ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
previousFiber ? setCurrentFiber ( fiber ) : resetCurrentFiber ( ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
}
}
function warnIfNotCurrentlyActingEffectsInDEV ( fiber ) {
2022-06-15 17:36:57 +03:00
( 1 & fiber . mode ) != 0 && ! 1 === IsSomeRendererActing . current && ! 1 === IsThisRendererActing . current && error ( "An update to %s ran an effect, but was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act" , getComponentName ( fiber . type ) ) ;
2021-08-04 13:27:17 +03:00
}
var warnIfNotCurrentlyActingUpdatesInDev = function ( fiber ) {
if ( 0 === executionContext && ! 1 === IsSomeRendererActing . current && ! 1 === IsThisRendererActing . current ) {
2022-06-15 17:36:57 +03:00
var previousFiber = current ;
2021-07-30 04:11:27 +03:00
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( fiber ) , error ( "An update to %s inside a test was not wrapped in act(...).\n\nWhen testing, code that causes React state updates should be wrapped into act(...):\n\nact(() => {\n /* fire events that update state */\n});\n/* assert on the output */\n\nThis ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act" , getComponentName ( fiber . type ) ) ;
2021-07-30 04:11:27 +03:00
} finally {
2021-08-04 13:27:17 +03:00
previousFiber ? setCurrentFiber ( fiber ) : resetCurrentFiber ( ) ;
}
}
} , didWarnAboutUnmockedScheduler = ! 1 ;
function computeThreadID ( root , lane ) {
return 1000 * lane + root . interactionThreadID ;
}
function markSpawnedWork ( lane ) {
null === spawnedWorkDuringRender ? spawnedWorkDuringRender = [
lane
] : spawnedWorkDuringRender . push ( lane ) ;
}
function scheduleInteractions ( root , lane , interactions ) {
if ( interactions . size > 0 ) {
var pendingInteractionMap = root . pendingInteractionMap , pendingInteractions = pendingInteractionMap . get ( lane ) ;
null != pendingInteractions ? interactions . forEach ( function ( interaction ) {
! pendingInteractions . has ( interaction ) && interaction . _ _count ++ , pendingInteractions . add ( interaction ) ;
} ) : ( pendingInteractionMap . set ( lane , new Set ( interactions ) ) , interactions . forEach ( function ( interaction ) {
interaction . _ _count ++ ;
} ) ) ;
var subscriber = _ _subscriberRef . current ;
if ( null !== subscriber ) {
var threadID = computeThreadID ( root , lane ) ;
subscriber . onWorkScheduled ( interactions , threadID ) ;
}
}
}
function schedulePendingInteractions ( root , lane ) {
scheduleInteractions ( root , lane , _ _interactionsRef . current ) ;
}
function startWorkOnPendingInteractions ( root , lanes ) {
var interactions = new Set ( ) ;
if ( root . pendingInteractionMap . forEach ( function ( scheduledInteractions , scheduledLane ) {
2022-08-26 11:45:49 +03:00
includesSomeLane ( lanes , scheduledLane ) && scheduledInteractions . forEach ( function ( interaction ) {
2021-08-04 13:27:17 +03:00
return interactions . add ( interaction ) ;
} ) ;
} ) , root . memoizedInteractions = interactions , interactions . size > 0 ) {
var subscriber = _ _subscriberRef . current ;
if ( null !== subscriber ) {
var threadID = computeThreadID ( root , lanes ) ;
try {
subscriber . onWorkStarted ( interactions , threadID ) ;
2021-09-01 16:11:55 +03:00
} catch ( error ) {
2021-08-04 13:27:17 +03:00
scheduleCallback ( 99 , function ( ) {
2021-09-01 16:11:55 +03:00
throw error ;
2021-08-04 13:27:17 +03:00
} ) ;
}
}
}
}
function finishPendingInteractions ( root , committedLanes ) {
var subscriber , remainingLanesAfterCommit = root . pendingLanes ;
try {
2021-08-07 11:27:52 +03:00
if ( subscriber = _ _subscriberRef . current , null !== subscriber && root . memoizedInteractions . size > 0 ) {
2021-08-04 13:27:17 +03:00
var threadID = computeThreadID ( root , committedLanes ) ;
subscriber . onWorkStopped ( root . memoizedInteractions , threadID ) ;
}
2022-06-15 17:36:57 +03:00
} catch ( error ) {
2021-08-04 13:27:17 +03:00
scheduleCallback ( 99 , function ( ) {
2022-06-15 17:36:57 +03:00
throw error ;
2021-08-04 13:27:17 +03:00
} ) ;
} finally {
var pendingInteractionMap = root . pendingInteractionMap ;
pendingInteractionMap . forEach ( function ( scheduledInteractions , lane ) {
2022-08-26 11:45:49 +03:00
includesSomeLane ( remainingLanesAfterCommit , lane ) || ( pendingInteractionMap . delete ( lane ) , scheduledInteractions . forEach ( function ( interaction ) {
2021-08-04 13:27:17 +03:00
if ( interaction . _ _count -- , null !== subscriber && 0 === interaction . _ _count ) try {
subscriber . onInteractionScheduledWorkCompleted ( interaction ) ;
} catch ( error ) {
scheduleCallback ( 99 , function ( ) {
throw error ;
} ) ;
}
} ) ) ;
} ) ;
}
}
2022-04-29 08:58:59 +03:00
function shouldForceFlushFallbacksInDEV ( ) {
return actingUpdatesScopeDepth > 0 ;
}
2021-08-04 13:27:17 +03:00
var actingUpdatesScopeDepth = 0 ;
function detachFiberAfterEffects ( fiber ) {
fiber . sibling = null , fiber . stateNode = null ;
}
2022-07-06 06:53:11 +03:00
var resolveFamily = null , failedBoundaries = null , setRefreshHandler = function ( handler ) {
resolveFamily = handler ;
} ;
2021-08-04 13:27:17 +03:00
function resolveFunctionForHotReloading ( type ) {
if ( null === resolveFamily ) return type ;
var family = resolveFamily ( type ) ;
return void 0 === family ? type : family . current ;
}
function resolveForwardRefForHotReloading ( type ) {
if ( null === resolveFamily ) return type ;
var family = resolveFamily ( type ) ;
if ( void 0 === family ) {
2022-05-04 17:25:28 +03:00
if ( null != type && "function" == typeof type . render ) {
2021-08-04 13:27:17 +03:00
var currentRender = resolveFunctionForHotReloading ( type . render ) ;
if ( type . render !== currentRender ) {
var syntheticType = {
$$typeof : REACT _FORWARD _REF _TYPE ,
render : currentRender
} ;
return void 0 !== type . displayName && ( syntheticType . displayName = type . displayName ) , syntheticType ;
}
}
return type ;
}
return family . current ;
}
function isCompatibleFamilyForHotReloading ( fiber , element ) {
if ( null === resolveFamily ) return ! 1 ;
2022-05-04 17:25:28 +03:00
var prevType = fiber . elementType , nextType = element . type , needsCompareFamilies = ! 1 , $$typeofNextType = "object" == typeof nextType && null !== nextType ? nextType . $$typeof : null ;
2021-08-04 13:27:17 +03:00
switch ( fiber . tag ) {
case 1 :
2022-05-04 17:25:28 +03:00
"function" == typeof nextType && ( needsCompareFamilies = ! 0 ) ;
2021-08-04 13:27:17 +03:00
break ;
case 0 :
2022-05-04 17:25:28 +03:00
"function" == typeof nextType ? needsCompareFamilies = ! 0 : $$typeofNextType === REACT _LAZY _TYPE && ( needsCompareFamilies = ! 0 ) ;
2021-08-04 13:27:17 +03:00
break ;
case 11 :
$$typeofNextType === REACT _FORWARD _REF _TYPE ? needsCompareFamilies = ! 0 : $$typeofNextType === REACT _LAZY _TYPE && ( needsCompareFamilies = ! 0 ) ;
break ;
case 14 :
case 15 :
$$typeofNextType === REACT _MEMO _TYPE ? needsCompareFamilies = ! 0 : $$typeofNextType === REACT _LAZY _TYPE && ( needsCompareFamilies = ! 0 ) ;
break ;
default :
return ! 1 ;
}
if ( needsCompareFamilies ) {
var prevFamily = resolveFamily ( prevType ) ;
if ( void 0 !== prevFamily && prevFamily === resolveFamily ( nextType ) ) return ! 0 ;
}
return ! 1 ;
}
function markFailedErrorBoundaryForHotReloading ( fiber ) {
2022-05-04 17:25:28 +03:00
null !== resolveFamily && "function" == typeof WeakSet && ( null === failedBoundaries && ( failedBoundaries = new WeakSet ( ) ) , failedBoundaries . add ( fiber ) ) ;
2021-08-04 13:27:17 +03:00
}
2022-07-06 06:53:11 +03:00
var scheduleRefresh = function ( root , update ) {
if ( null !== resolveFamily ) {
var staleFamilies = update . staleFamilies , updatedFamilies = update . updatedFamilies ;
flushPassiveEffects ( ) , flushSync ( function ( ) {
scheduleFibersWithFamiliesRecursively ( root . current , updatedFamilies , staleFamilies ) ;
} ) ;
}
} , scheduleRoot = function ( root , element ) {
root . context === emptyContextObject && ( flushPassiveEffects ( ) , flushSync ( function ( ) {
updateContainer ( element , root , null , null ) ;
} ) ) ;
} ;
2021-08-04 13:27:17 +03:00
function scheduleFibersWithFamiliesRecursively ( fiber , updatedFamilies , staleFamilies ) {
var alternate = fiber . alternate , child = fiber . child , sibling = fiber . sibling , tag = fiber . tag , type = fiber . type , candidateType = null ;
switch ( tag ) {
case 0 :
case 15 :
case 1 :
candidateType = type ;
break ;
case 11 :
candidateType = type . render ;
}
2022-06-11 08:27:13 +03:00
if ( null === resolveFamily ) throw Error ( "Expected resolveFamily to be set during hot reload." ) ;
2021-08-04 13:27:17 +03:00
var needsRender = ! 1 , needsRemount = ! 1 ;
if ( null !== candidateType ) {
var family = resolveFamily ( candidateType ) ;
void 0 !== family && ( staleFamilies . has ( family ) ? needsRemount = ! 0 : updatedFamilies . has ( family ) && ( 1 === tag ? needsRemount = ! 0 : needsRender = ! 0 ) ) ;
}
2022-08-26 11:45:49 +03:00
null !== failedBoundaries && ( failedBoundaries . has ( fiber ) || null !== alternate && failedBoundaries . has ( alternate ) ) && ( needsRemount = ! 0 ) , needsRemount && ( fiber . _debugNeedsRemount = ! 0 ) , ( needsRemount || needsRender ) && scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) , null === child || needsRemount || scheduleFibersWithFamiliesRecursively ( child , updatedFamilies , staleFamilies ) , null !== sibling && scheduleFibersWithFamiliesRecursively ( sibling , updatedFamilies , staleFamilies ) ;
2021-08-04 13:27:17 +03:00
}
2022-07-06 06:53:11 +03:00
var findHostInstancesForRefresh = function ( root , families ) {
var hostInstances = new Set ( ) , types = new Set ( families . map ( function ( family ) {
return family . current ;
} ) ) ;
return findHostInstancesForMatchingFibersRecursively ( root . current , types , hostInstances ) , hostInstances ;
} ;
2021-08-04 13:27:17 +03:00
function findHostInstancesForMatchingFibersRecursively ( fiber , types , hostInstances ) {
var child = fiber . child , sibling = fiber . sibling , tag = fiber . tag , type = fiber . type , candidateType = null ;
switch ( tag ) {
case 0 :
case 15 :
case 1 :
candidateType = type ;
break ;
case 11 :
candidateType = type . render ;
}
var didMatch = ! 1 ;
null !== candidateType && types . has ( candidateType ) && ( didMatch = ! 0 ) , didMatch ? findHostInstancesForFiberShallowly ( fiber , hostInstances ) : null !== child && findHostInstancesForMatchingFibersRecursively ( child , types , hostInstances ) , null !== sibling && findHostInstancesForMatchingFibersRecursively ( sibling , types , hostInstances ) ;
}
function findHostInstancesForFiberShallowly ( fiber , hostInstances ) {
if ( ! findChildHostInstancesForFiberShallowly ( fiber , hostInstances ) ) for ( var node = fiber ; ; ) {
switch ( node . tag ) {
case 5 :
2021-09-16 07:23:33 +03:00
hostInstances . add ( node . stateNode ) ;
return ;
2021-08-04 13:27:17 +03:00
case 4 :
case 3 :
2021-09-16 07:23:33 +03:00
hostInstances . add ( node . stateNode . containerInfo ) ;
return ;
2021-07-30 04:11:27 +03:00
}
2022-06-11 08:27:13 +03:00
if ( null === node . return ) throw Error ( "Expected to reach root first." ) ;
2021-08-04 13:27:17 +03:00
node = node . return ;
}
}
function findChildHostInstancesForFiberShallowly ( fiber , hostInstances ) {
for ( var node = fiber , foundHostInstances = ! 1 ; ; ) {
if ( 5 === node . tag ) foundHostInstances = ! 0 , hostInstances . add ( node . stateNode ) ;
2021-07-30 04:11:27 +03:00
else if ( null !== node . child ) {
node . child . return = node , node = node . child ;
continue ;
}
2021-08-04 13:27:17 +03:00
if ( node === fiber ) return foundHostInstances ;
2021-07-30 04:11:27 +03:00
for ( ; null === node . sibling ; ) {
2021-08-04 13:27:17 +03:00
if ( null === node . return || node . return === fiber ) return foundHostInstances ;
2021-07-30 04:11:27 +03:00
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
}
2021-08-04 13:27:17 +03:00
return ! 1 ;
}
hasBadMapPolyfill = ! 1 ;
try {
2022-04-29 10:22:13 +03:00
Object . preventExtensions ( { } ) ;
2022-06-15 17:36:57 +03:00
} catch ( e1 ) {
2021-08-04 13:27:17 +03:00
hasBadMapPolyfill = ! 0 ;
}
var debugCounter = 1 ;
function FiberNode ( tag , pendingProps , key , mode ) {
2022-08-26 13:06:25 +03:00
this . tag = tag , this . key = key , this . elementType = null , this . type = null , this . stateNode = null , this . return = null , this . child = null , this . sibling = null , this . index = 0 , this . ref = null , this . pendingProps = pendingProps , this . memoizedProps = null , this . updateQueue = null , this . memoizedState = null , this . dependencies = null , this . mode = mode , this . flags = 0 , this . nextEffect = null , this . firstEffect = null , this . lastEffect = null , this . lanes = NoLanes , this . childLanes = NoLanes , this . alternate = null , this . actualDuration = Number . NaN , this . actualStartTime = Number . NaN , this . selfBaseDuration = Number . NaN , this . treeBaseDuration = Number . NaN , this . actualDuration = 0 , this . actualStartTime = - 1 , this . selfBaseDuration = 0 , this . treeBaseDuration = 0 , this . _debugID = debugCounter ++ , this . _debugSource = null , this . _debugOwner = null , this . _debugNeedsRemount = ! 1 , this . _debugHookTypes = null , hasBadMapPolyfill || "function" != typeof Object . preventExtensions || Object . preventExtensions ( this ) ;
2021-08-04 13:27:17 +03:00
}
var createFiber = function ( tag , pendingProps , key , mode ) {
return new FiberNode ( tag , pendingProps , key , mode ) ;
} ;
function shouldConstruct$1 ( Component ) {
var prototype = Component . prototype ;
return ! ! ( prototype && prototype . isReactComponent ) ;
}
function isSimpleFunctionComponent ( type ) {
2022-05-04 17:25:28 +03:00
return "function" == typeof type && ! shouldConstruct$1 ( type ) && void 0 === type . defaultProps ;
2021-08-04 13:27:17 +03:00
}
function resolveLazyComponentTag ( Component ) {
2022-05-04 17:25:28 +03:00
if ( "function" == typeof Component ) return shouldConstruct$1 ( Component ) ? 1 : 0 ;
2021-08-04 13:27:17 +03:00
if ( null != Component ) {
var $$typeof = Component . $$typeof ;
2021-08-15 16:09:21 +03:00
if ( $$typeof === REACT _FORWARD _REF _TYPE ) return 11 ;
if ( $$typeof === REACT _MEMO _TYPE ) return 14 ;
2021-08-04 13:27:17 +03:00
}
return 2 ;
}
function createWorkInProgress ( current , pendingProps ) {
2022-07-20 11:25:26 +03:00
var type , workInProgress = current . alternate ;
2022-08-26 13:06:25 +03:00
null === workInProgress ? ( workInProgress = createFiber ( current . tag , pendingProps , current . key , current . mode ) , workInProgress . elementType = current . elementType , workInProgress . type = current . type , workInProgress . stateNode = current . stateNode , workInProgress . _debugID = current . _debugID , workInProgress . _debugSource = current . _debugSource , workInProgress . _debugOwner = current . _debugOwner , workInProgress . _debugHookTypes = current . _debugHookTypes , workInProgress . alternate = current , current . alternate = workInProgress ) : ( workInProgress . pendingProps = pendingProps , workInProgress . type = current . type , workInProgress . flags = 0 , workInProgress . nextEffect = null , workInProgress . firstEffect = null , workInProgress . lastEffect = null , workInProgress . actualDuration = 0 , workInProgress . actualStartTime = - 1 ) , workInProgress . childLanes = current . childLanes , workInProgress . lanes = current . lanes , workInProgress . child = current . child , workInProgress . memoizedProps = current . memoizedProps , workInProgress . memoizedState = current . memoizedState , workInProgress . updateQueue = current . updateQueue ;
2021-08-04 13:27:17 +03:00
var currentDependencies = current . dependencies ;
2021-10-21 08:12:50 +03:00
switch ( workInProgress . dependencies = null === currentDependencies ? null : {
2021-08-04 13:27:17 +03:00
lanes : currentDependencies . lanes ,
firstContext : currentDependencies . firstContext
2021-10-21 08:12:50 +03:00
} , workInProgress . sibling = current . sibling , workInProgress . index = current . index , workInProgress . ref = current . ref , workInProgress . selfBaseDuration = current . selfBaseDuration , workInProgress . treeBaseDuration = current . treeBaseDuration , workInProgress . _debugNeedsRemount = current . _debugNeedsRemount , workInProgress . tag ) {
2021-08-04 13:27:17 +03:00
case 2 :
case 0 :
case 15 :
case 1 :
2022-07-20 11:25:26 +03:00
workInProgress . type = resolveFunctionForHotReloading ( current . type ) ;
2021-08-04 13:27:17 +03:00
break ;
case 11 :
2021-10-21 08:12:50 +03:00
workInProgress . type = resolveForwardRefForHotReloading ( current . type ) ;
2021-08-04 13:27:17 +03:00
}
2021-10-21 08:12:50 +03:00
return workInProgress ;
2021-08-04 13:27:17 +03:00
}
function resetWorkInProgress ( workInProgress , renderLanes ) {
2022-08-26 13:06:25 +03:00
workInProgress . flags &= 2 , workInProgress . nextEffect = null , workInProgress . firstEffect = null , workInProgress . lastEffect = null ;
2021-08-04 13:27:17 +03:00
var current = workInProgress . alternate ;
2022-08-26 11:45:49 +03:00
if ( null === current ) workInProgress . childLanes = NoLanes , workInProgress . lanes = renderLanes , workInProgress . child = null , workInProgress . memoizedProps = null , workInProgress . memoizedState = null , workInProgress . updateQueue = null , workInProgress . dependencies = null , workInProgress . stateNode = null , workInProgress . selfBaseDuration = 0 , workInProgress . treeBaseDuration = 0 ;
2021-08-04 13:27:17 +03:00
else {
workInProgress . childLanes = current . childLanes , workInProgress . lanes = current . lanes , workInProgress . child = current . child , workInProgress . memoizedProps = current . memoizedProps , workInProgress . memoizedState = current . memoizedState , workInProgress . updateQueue = current . updateQueue , workInProgress . type = current . type ;
var currentDependencies = current . dependencies ;
workInProgress . dependencies = null === currentDependencies ? null : {
lanes : currentDependencies . lanes ,
firstContext : currentDependencies . firstContext
} , workInProgress . selfBaseDuration = current . selfBaseDuration , workInProgress . treeBaseDuration = current . treeBaseDuration ;
}
return workInProgress ;
}
function createFiberFromTypeAndProps ( type , key , pendingProps , owner , mode , lanes ) {
2022-07-20 11:25:26 +03:00
var type1 , fiberTag = 2 , resolvedType = type ;
if ( "function" == typeof type ) shouldConstruct$1 ( type ) && ( fiberTag = 1 ) , resolvedType = resolveFunctionForHotReloading ( resolvedType ) ;
2022-05-04 17:25:28 +03:00
else if ( "string" == typeof type ) fiberTag = 5 ;
2021-08-04 13:27:17 +03:00
else getTag : switch ( type ) {
case REACT _FRAGMENT _TYPE :
return createFiberFromFragment ( pendingProps . children , mode , lanes , key ) ;
case REACT _DEBUG _TRACING _MODE _TYPE :
fiberTag = 8 , mode |= 16 ;
break ;
case REACT _STRICT _MODE _TYPE :
fiberTag = 8 , mode |= 1 ;
break ;
case REACT _PROFILER _TYPE :
return createFiberFromProfiler ( pendingProps , mode , lanes , key ) ;
case REACT _SUSPENSE _TYPE :
return createFiberFromSuspense ( pendingProps , mode , lanes , key ) ;
case REACT _SUSPENSE _LIST _TYPE :
return createFiberFromSuspenseList ( pendingProps , mode , lanes , key ) ;
case REACT _OFFSCREEN _TYPE :
return createFiberFromOffscreen ( pendingProps , mode , lanes , key ) ;
case REACT _LEGACY _HIDDEN _TYPE :
return createFiberFromLegacyHidden ( pendingProps , mode , lanes , key ) ;
default :
2022-05-04 17:25:28 +03:00
if ( "object" == typeof type && null !== type ) switch ( type . $$typeof ) {
2021-08-04 13:27:17 +03:00
case REACT _PROVIDER _TYPE :
fiberTag = 10 ;
break getTag ;
case REACT _CONTEXT _TYPE :
fiberTag = 9 ;
break getTag ;
case REACT _FORWARD _REF _TYPE :
fiberTag = 11 , resolvedType = resolveForwardRefForHotReloading ( resolvedType ) ;
break getTag ;
case REACT _MEMO _TYPE :
fiberTag = 14 ;
break getTag ;
case REACT _LAZY _TYPE :
fiberTag = 16 , resolvedType = null ;
break getTag ;
case REACT _BLOCK _TYPE :
fiberTag = 22 ;
break getTag ;
}
2022-05-04 17:25:28 +03:00
var info = "" ;
( void 0 === type || "object" == typeof type && null !== type && 0 === Object . keys ( type ) . length ) && ( info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports." ) ;
2021-08-04 13:27:17 +03:00
var ownerName = owner ? getComponentName ( owner . type ) : null ;
2022-05-04 17:25:28 +03:00
throw ownerName && ( info += "\n\nCheck the render method of `" + ownerName + "`." ) , Error ( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + ( null == type ? type : typeof type ) + "." + info ) ;
2021-08-04 13:27:17 +03:00
}
var fiber = createFiber ( fiberTag , pendingProps , key , mode ) ;
return fiber . elementType = type , fiber . type = resolvedType , fiber . lanes = lanes , fiber . _debugOwner = owner , fiber ;
}
function createFiberFromElement ( element , mode , lanes ) {
2022-01-06 14:49:10 +03:00
var owner = null ;
owner = element . _owner ;
var type = element . type , key = element . key , pendingProps = element . props , fiber = createFiberFromTypeAndProps ( type , key , pendingProps , owner , mode , lanes ) ;
2021-08-04 13:27:17 +03:00
return fiber . _debugSource = element . _source , fiber . _debugOwner = element . _owner , fiber ;
}
function createFiberFromFragment ( elements , mode , lanes , key ) {
var fiber = createFiber ( 7 , elements , key , mode ) ;
return fiber . lanes = lanes , fiber ;
}
function createFiberFromProfiler ( pendingProps , mode , lanes , key ) {
2022-06-15 17:36:57 +03:00
"string" != typeof pendingProps . id && error ( 'Profiler must specify an "id" as a prop' ) ;
2021-08-04 13:27:17 +03:00
var fiber = createFiber ( 12 , pendingProps , key , 8 | mode ) ;
return fiber . elementType = REACT _PROFILER _TYPE , fiber . type = REACT _PROFILER _TYPE , fiber . lanes = lanes , fiber . stateNode = {
effectDuration : 0 ,
passiveEffectDuration : 0
} , fiber ;
}
function createFiberFromSuspense ( pendingProps , mode , lanes , key ) {
var fiber = createFiber ( 13 , pendingProps , key , mode ) ;
return fiber . type = REACT _SUSPENSE _TYPE , fiber . elementType = REACT _SUSPENSE _TYPE , fiber . lanes = lanes , fiber ;
}
function createFiberFromSuspenseList ( pendingProps , mode , lanes , key ) {
var fiber = createFiber ( 19 , pendingProps , key , mode ) ;
return fiber . type = REACT _SUSPENSE _LIST _TYPE , fiber . elementType = REACT _SUSPENSE _LIST _TYPE , fiber . lanes = lanes , fiber ;
}
function createFiberFromOffscreen ( pendingProps , mode , lanes , key ) {
var fiber = createFiber ( 23 , pendingProps , key , mode ) ;
return fiber . type = REACT _OFFSCREEN _TYPE , fiber . elementType = REACT _OFFSCREEN _TYPE , fiber . lanes = lanes , fiber ;
}
function createFiberFromLegacyHidden ( pendingProps , mode , lanes , key ) {
var fiber = createFiber ( 24 , pendingProps , key , mode ) ;
return fiber . type = REACT _LEGACY _HIDDEN _TYPE , fiber . elementType = REACT _LEGACY _HIDDEN _TYPE , fiber . lanes = lanes , fiber ;
}
function createFiberFromText ( content , mode , lanes ) {
var fiber = createFiber ( 6 , content , null , mode ) ;
return fiber . lanes = lanes , fiber ;
}
function createFiberFromHostInstanceForDeletion ( ) {
var fiber = createFiber ( 5 , null , null , 0 ) ;
2022-05-04 17:25:28 +03:00
return fiber . elementType = "DELETED" , fiber . type = "DELETED" , fiber ;
2021-08-04 13:27:17 +03:00
}
function createFiberFromPortal ( portal , mode , lanes ) {
var fiber = createFiber ( 4 , null !== portal . children ? portal . children : [ ] , portal . key , mode ) ;
return fiber . lanes = lanes , fiber . stateNode = {
containerInfo : portal . containerInfo ,
pendingChildren : null ,
implementation : portal . implementation
} , fiber ;
}
function assignFiberPropertiesInDEV ( target , source ) {
return null === target && ( target = createFiber ( 2 , null , null , 0 ) ) , target . tag = source . tag , target . key = source . key , target . elementType = source . elementType , target . type = source . type , target . stateNode = source . stateNode , target . return = source . return , target . child = source . child , target . sibling = source . sibling , target . index = source . index , target . ref = source . ref , target . pendingProps = source . pendingProps , target . memoizedProps = source . memoizedProps , target . updateQueue = source . updateQueue , target . memoizedState = source . memoizedState , target . dependencies = source . dependencies , target . mode = source . mode , target . flags = source . flags , target . nextEffect = source . nextEffect , target . firstEffect = source . firstEffect , target . lastEffect = source . lastEffect , target . lanes = source . lanes , target . childLanes = source . childLanes , target . alternate = source . alternate , target . actualDuration = source . actualDuration , target . actualStartTime = source . actualStartTime , target . selfBaseDuration = source . selfBaseDuration , target . treeBaseDuration = source . treeBaseDuration , target . _debugID = source . _debugID , target . _debugSource = source . _debugSource , target . _debugOwner = source . _debugOwner , target . _debugNeedsRemount = source . _debugNeedsRemount , target . _debugHookTypes = source . _debugHookTypes , target ;
}
function FiberRootNode ( containerInfo , tag , hydrate ) {
2022-08-26 11:45:49 +03:00
switch ( this . tag = tag , this . containerInfo = containerInfo , this . pendingChildren = null , this . current = null , this . pingCache = null , this . finishedWork = null , this . timeoutHandle = - 1 , this . context = null , this . pendingContext = null , this . hydrate = hydrate , this . callbackNode = null , this . callbackPriority = 0 , this . eventTimes = createLaneMap ( NoLanes ) , this . expirationTimes = createLaneMap ( - 1 ) , this . pendingLanes = NoLanes , this . suspendedLanes = NoLanes , this . pingedLanes = NoLanes , this . expiredLanes = NoLanes , this . mutableReadLanes = NoLanes , this . finishedLanes = NoLanes , this . entangledLanes = NoLanes , this . entanglements = createLaneMap ( NoLanes ) , this . mutableSourceEagerHydrationData = null , this . interactionThreadID = unstable _getThreadID ( ) , this . memoizedInteractions = new Set ( ) , this . pendingInteractionMap = new Map ( ) , tag ) {
2021-08-04 13:27:17 +03:00
case 1 :
2022-05-04 17:25:28 +03:00
this . _debugRootType = "createBlockingRoot()" ;
2021-08-04 13:27:17 +03:00
break ;
case 2 :
2022-05-04 17:25:28 +03:00
this . _debugRootType = "createRoot()" ;
2021-08-04 13:27:17 +03:00
break ;
case 0 :
2022-05-04 17:25:28 +03:00
this . _debugRootType = "createLegacyRoot()" ;
2021-07-30 04:11:27 +03:00
}
}
2021-08-04 13:27:17 +03:00
function registerMutableSourceForHydration ( root , mutableSource ) {
var version = ( 0 , mutableSource . _getVersion ) ( mutableSource . _source ) ;
null == root . mutableSourceEagerHydrationData ? root . mutableSourceEagerHydrationData = [
mutableSource ,
version
] : root . mutableSourceEagerHydrationData . push ( mutableSource , version ) ;
}
2022-06-15 17:36:57 +03:00
function updateContainer ( element , container , parentComponent , callback ) {
2021-09-08 12:45:39 +03:00
! function ( root , children ) {
2022-05-04 17:25:28 +03:00
if ( injectedHook && "function" == typeof injectedHook . onScheduleFiberRoot ) try {
2021-10-06 10:12:11 +03:00
injectedHook . onScheduleFiberRoot ( rendererID , root , children ) ;
2021-09-08 12:45:39 +03:00
} catch ( err ) {
2022-06-15 17:36:57 +03:00
hasLoggedError || ( hasLoggedError = ! 0 , error ( "React instrumentation encountered an error: %s" , err ) ) ;
2021-09-08 12:45:39 +03:00
}
} ( container , element ) ;
2022-06-15 17:36:57 +03:00
var fiber , current$1 = container . current , eventTime = requestEventTime ( ) ;
"undefined" != typeof jest && ( fiber = current$1 , ! 1 === didWarnAboutUnmockedScheduler && void 0 === unstable _flushAllWithoutAsserting && ( 2 & fiber . mode || 4 & fiber . mode ) && ( didWarnAboutUnmockedScheduler = ! 0 , error ( "In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked to guarantee consistent behaviour across tests and browsers. For example, with jest: \njest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\nFor more info, visit https://reactjs.org/link/mock-scheduler" ) ) , warnIfNotScopedWithMatchingAct ( current$1 ) ) ;
2021-09-08 12:45:39 +03:00
var lane = requestUpdateLane ( current$1 ) , context = function ( parentComponent ) {
if ( ! parentComponent ) return emptyContextObject ;
2022-06-15 17:36:57 +03:00
var fiber = get ( parentComponent ) , parentContext = function ( fiber ) {
if ( getNearestMountedFiber ( fiber1 = fiber ) !== fiber1 || 1 !== fiber . tag ) throw Error ( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." ) ;
var fiber1 , node = fiber ;
2021-09-08 12:45:39 +03:00
do {
switch ( node . tag ) {
case 3 :
return node . stateNode . context ;
case 1 :
if ( isContextProvider ( node . type ) ) return node . stateNode . _ _reactInternalMemoizedMergedChildContext ;
}
node = node . return ;
} while ( null !== node )
throw Error ( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." ) ;
2022-06-15 17:36:57 +03:00
} ( fiber ) ;
if ( 1 === fiber . tag ) {
var Component = fiber . type ;
if ( isContextProvider ( Component ) ) return processChildContext ( fiber , Component , parentContext ) ;
2021-09-08 12:45:39 +03:00
}
return parentContext ;
2022-06-15 17:36:57 +03:00
} ( parentComponent ) ;
null === container . context ? container . context = context : container . pendingContext = context , isRendering && null !== current && ! didWarnAboutNestedUpdates && ( didWarnAboutNestedUpdates = ! 0 , error ( "Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.\n\nCheck the render method of %s." , getComponentName ( current . type ) || "Unknown" ) ) ;
2021-08-04 13:27:17 +03:00
var update = createUpdate ( eventTime , lane ) ;
return update . payload = {
element : element
2022-06-15 17:36:57 +03:00
} , null !== ( callback = void 0 === callback ? null : callback ) && ( "function" != typeof callback && error ( "render(...): Expected the last optional `callback` argument to be a function. Instead received: %s." , callback ) , update . callback = callback ) , enqueueUpdate ( current$1 , update ) , scheduleUpdateOnFiber ( current$1 , lane , eventTime ) , lane ;
2021-08-04 13:27:17 +03:00
}
function getPublicRootInstance ( container ) {
var containerFiber = container . current ;
2022-04-21 13:00:25 +03:00
return containerFiber . child ? ( containerFiber . child . tag , containerFiber . child . stateNode ) : null ;
2021-08-04 13:27:17 +03:00
}
function markRetryLaneImpl ( fiber , retryLane ) {
2021-09-08 12:45:39 +03:00
var a , b , suspenseState = fiber . memoizedState ;
2022-08-26 13:06:25 +03:00
null !== suspenseState && null !== suspenseState . dehydrated && ( suspenseState . retryLane = ( a = suspenseState . retryLane , b = retryLane , 0 !== a && a < b ? a : b ) ) ;
2021-08-04 13:27:17 +03:00
}
function markRetryLaneIfNotHydrated ( fiber , retryLane ) {
markRetryLaneImpl ( fiber , retryLane ) ;
var alternate = fiber . alternate ;
alternate && markRetryLaneImpl ( alternate , retryLane ) ;
}
function findHostInstanceWithNoPortals ( fiber ) {
2021-09-08 12:45:39 +03:00
var hostFiber = function ( parent ) {
2021-10-06 10:12:11 +03:00
var currentParent = findCurrentFiberUsingSlowPath ( parent ) ;
2021-09-08 12:45:39 +03:00
if ( ! currentParent ) return null ;
for ( var node = currentParent ; ; ) {
2022-02-19 11:33:36 +03:00
if ( 5 === node . tag || 6 === node . tag ) return node ;
2021-09-08 12:45:39 +03:00
if ( node . child && 4 !== node . tag ) {
node . child . return = node , node = node . child ;
continue ;
}
2022-05-08 07:07:58 +03:00
if ( node === currentParent ) break ;
2021-09-08 12:45:39 +03:00
for ( ; ! node . sibling ; ) {
if ( ! node . return || node . return === currentParent ) return null ;
node = node . return ;
}
node . sibling . return = node . return , node = node . sibling ;
}
return null ;
} ( fiber ) ;
2021-08-04 13:27:17 +03:00
return null === hostFiber ? null : 20 === hostFiber . tag ? hostFiber . stateNode . instance : hostFiber . stateNode ;
}
2022-01-02 23:54:58 +03:00
didWarnAboutNestedUpdates = ! 1 , didWarnAboutFindNodeInStrictMode = { } ;
2021-08-04 13:27:17 +03:00
var shouldSuspendImpl = function ( fiber ) {
return ! 1 ;
2022-07-20 11:25:26 +03:00
} , overrideHookState = null , overrideHookStateDeletePath = null , overrideHookStateRenamePath = null , overrideProps = null , overridePropsDeletePath = null , overridePropsRenamePath = null , scheduleUpdate = null , setSuspenseHandler = null , copyWithDeleteImpl = function ( obj , path , index ) {
2022-01-02 23:54:58 +03:00
var key = path [ index ] , updated = Array . isArray ( obj ) ? obj . slice ( ) : _assign ( { } , obj ) ;
2021-08-04 13:27:17 +03:00
return index + 1 === path . length ? ( Array . isArray ( updated ) ? updated . splice ( key , 1 ) : delete updated [ key ] , updated ) : ( updated [ key ] = copyWithDeleteImpl ( obj [ key ] , path , index + 1 ) , updated ) ;
} , copyWithDelete = function ( obj , path ) {
return copyWithDeleteImpl ( obj , path , 0 ) ;
} , copyWithRenameImpl = function ( obj , oldPath , newPath , index ) {
2022-01-02 23:54:58 +03:00
var oldKey = oldPath [ index ] , updated = Array . isArray ( obj ) ? obj . slice ( ) : _assign ( { } , obj ) ;
2021-08-04 13:27:17 +03:00
return index + 1 === oldPath . length ? ( updated [ newPath [ index ] ] = updated [ oldKey ] , Array . isArray ( updated ) ? updated . splice ( oldKey , 1 ) : delete updated [ oldKey ] ) : updated [ oldKey ] = copyWithRenameImpl ( obj [ oldKey ] , oldPath , newPath , index + 1 ) , updated ;
} , copyWithRename = function ( obj , oldPath , newPath ) {
2021-09-16 07:23:33 +03:00
if ( oldPath . length !== newPath . length ) {
2022-05-04 17:25:28 +03:00
warn ( "copyWithRename() expects paths of the same length" ) ;
2021-09-16 07:23:33 +03:00
return ;
}
for ( var i = 0 ; i < newPath . length - 1 ; i ++ ) if ( oldPath [ i ] !== newPath [ i ] ) {
2022-05-04 17:25:28 +03:00
warn ( "copyWithRename() expects paths to be the same except for the deepest key" ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-08-04 13:27:17 +03:00
return copyWithRenameImpl ( obj , oldPath , newPath , 0 ) ;
} , copyWithSetImpl = function ( obj , path , index , value ) {
if ( index >= path . length ) return value ;
2022-01-02 23:54:58 +03:00
var key = path [ index ] , updated = Array . isArray ( obj ) ? obj . slice ( ) : _assign ( { } , obj ) ;
2021-08-04 13:27:17 +03:00
return updated [ key ] = copyWithSetImpl ( obj [ key ] , path , index + 1 , value ) , updated ;
} , copyWithSet = function ( obj , path , value ) {
return copyWithSetImpl ( obj , path , 0 , value ) ;
} , findHook = function ( fiber , id ) {
2021-10-21 08:12:50 +03:00
for ( var currentHook = fiber . memoizedState ; null !== currentHook && id > 0 ; ) currentHook = currentHook . next , id -- ;
return currentHook ;
2021-08-04 13:27:17 +03:00
} ;
2022-04-05 09:25:23 +03:00
function emptyFindFiberByHostInstance ( instance ) {
return null ;
}
function getCurrentFiberForDevTools ( ) {
2022-06-15 17:36:57 +03:00
return current ;
2022-04-05 09:25:23 +03:00
}
2021-08-04 13:27:17 +03:00
function ReactDOMRoot ( container , options ) {
this . _internalRoot = createRootImpl ( container , 2 , options ) ;
}
function ReactDOMBlockingRoot ( container , tag , options ) {
this . _internalRoot = createRootImpl ( container , tag , options ) ;
}
function createRootImpl ( container , tag , options ) {
2021-08-10 11:52:28 +03:00
var hydrate = null != options && ! 0 === options . hydrate ;
null != options && options . hydrationOptions ;
2022-08-26 13:06:25 +03:00
var containerInfo , tag1 , hydrate1 , containerInfo1 , tag2 , hydrate2 , root , tag3 , mode , uninitializedFiber , hostRoot , node , mutableSources = null != options && null != options . hydrationOptions && options . hydrationOptions . mutableSources || null , root1 = ( containerInfo = container , tag1 = tag , hydrate1 = hydrate , containerInfo1 = containerInfo , tag2 = tag1 , hydrate2 = hydrate1 , root = new FiberRootNode ( containerInfo1 , tag2 , hydrate2 ) , uninitializedFiber = ( tag3 = tag2 , mode = 2 === tag3 ? 7 : 1 === tag3 ? 3 : 0 , isDevToolsPresent && ( mode |= 8 ) , createFiber ( 3 , null , null , mode ) ) , root . current = uninitializedFiber , uninitializedFiber . stateNode = root , initializeUpdateQueue ( uninitializedFiber ) , root ) ;
hostRoot = root1 . current , node = container , node [ internalContainerInstanceKey ] = hostRoot , container . nodeType ;
2022-01-14 10:36:48 +03:00
var rootContainerElement = 8 === container . nodeType ? container . parentNode : container ;
2022-06-15 17:36:57 +03:00
if ( listenToAllSupportedEvents ( rootContainerElement ) , mutableSources ) for ( var i = 0 ; i < mutableSources . length ; i ++ ) registerMutableSourceForHydration ( root1 , mutableSources [ i ] ) ;
return root1 ;
2021-08-04 13:27:17 +03:00
}
function isValidContainer ( node ) {
2022-05-04 17:25:28 +03:00
return ! ! ( node && ( 1 === node . nodeType || 9 === node . nodeType || 11 === node . nodeType || 8 === node . nodeType && " react-mount-point-unstable " === node . nodeValue ) ) ;
2021-07-30 04:11:27 +03:00
}
2021-08-04 13:27:17 +03:00
overrideHookState = function ( fiber , id , path , value ) {
2021-07-30 04:11:27 +03:00
var hook = findHook ( fiber , id ) ;
if ( null !== hook ) {
var newState = copyWithSet ( hook . memoizedState , path , value ) ;
2022-08-26 11:45:49 +03:00
hook . memoizedState = newState , hook . baseState = newState , fiber . memoizedProps = _assign ( { } , fiber . memoizedProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
}
} , overrideHookStateDeletePath = function ( fiber , id , path ) {
var hook = findHook ( fiber , id ) ;
if ( null !== hook ) {
var newState = copyWithDelete ( hook . memoizedState , path ) ;
2022-08-26 11:45:49 +03:00
hook . memoizedState = newState , hook . baseState = newState , fiber . memoizedProps = _assign ( { } , fiber . memoizedProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
}
} , overrideHookStateRenamePath = function ( fiber , id , oldPath , newPath ) {
var hook = findHook ( fiber , id ) ;
if ( null !== hook ) {
var newState = copyWithRename ( hook . memoizedState , oldPath , newPath ) ;
2022-08-26 11:45:49 +03:00
hook . memoizedState = newState , hook . baseState = newState , fiber . memoizedProps = _assign ( { } , fiber . memoizedProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
}
} , overrideProps = function ( fiber , path , value ) {
2022-08-26 11:45:49 +03:00
fiber . pendingProps = copyWithSet ( fiber . memoizedProps , path , value ) , fiber . alternate && ( fiber . alternate . pendingProps = fiber . pendingProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
} , overridePropsDeletePath = function ( fiber , path ) {
2022-08-26 11:45:49 +03:00
fiber . pendingProps = copyWithDelete ( fiber . memoizedProps , path ) , fiber . alternate && ( fiber . alternate . pendingProps = fiber . pendingProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
} , overridePropsRenamePath = function ( fiber , oldPath , newPath ) {
2022-08-26 11:45:49 +03:00
fiber . pendingProps = copyWithRename ( fiber . memoizedProps , oldPath , newPath ) , fiber . alternate && ( fiber . alternate . pendingProps = fiber . pendingProps ) , scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
} , scheduleUpdate = function ( fiber ) {
2022-08-26 11:45:49 +03:00
scheduleUpdateOnFiber ( fiber , SyncLane , - 1 ) ;
2021-07-30 04:11:27 +03:00
} , setSuspenseHandler = function ( newShouldSuspendImpl ) {
shouldSuspendImpl = newShouldSuspendImpl ;
} , ReactDOMRoot . prototype . render = ReactDOMBlockingRoot . prototype . render = function ( children ) {
2021-10-21 08:12:50 +03:00
var root = this . _internalRoot ;
2022-06-15 17:36:57 +03:00
"function" == typeof arguments [ 1 ] && error ( "render(...): does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) ;
2021-10-21 08:12:50 +03:00
var container = root . containerInfo ;
2021-07-30 04:11:27 +03:00
if ( 8 !== container . nodeType ) {
2021-10-21 08:12:50 +03:00
var hostInstance = findHostInstanceWithNoPortals ( root . current ) ;
2022-06-15 17:36:57 +03:00
hostInstance && hostInstance . parentNode !== container && error ( "render(...): It looks like the React-rendered content of the root container was removed without using React. This is not supported and will cause errors. Instead, call root.unmount() to empty a root's container." ) ;
2021-07-30 04:11:27 +03:00
}
2021-10-21 08:12:50 +03:00
updateContainer ( children , root , null , null ) ;
2021-07-30 04:11:27 +03:00
} , ReactDOMRoot . prototype . unmount = ReactDOMBlockingRoot . prototype . unmount = function ( ) {
2022-06-15 17:36:57 +03:00
"function" == typeof arguments [ 0 ] && error ( "unmount(...): does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) ;
2021-10-21 08:12:50 +03:00
var root = this . _internalRoot , container = root . containerInfo ;
updateContainer ( null , root , null , function ( ) {
2021-07-30 04:11:27 +03:00
unmarkContainerAsRoot ( container ) ;
} ) ;
2021-08-04 13:27:17 +03:00
} ;
2021-08-07 11:27:52 +03:00
var ReactCurrentOwner$3 = ReactSharedInternals . ReactCurrentOwner , warnedAboutHydrateAPI = ! 1 ;
2021-08-04 13:27:17 +03:00
function getReactRootElementInContainer ( container ) {
return container ? 9 === container . nodeType ? container . documentElement : container . firstChild : null ;
}
2022-06-15 17:36:57 +03:00
function legacyRenderSubtreeIntoContainer ( parentComponent , children , container , forceHydrate , callback ) {
2022-08-02 14:37:40 +03:00
topLevelUpdateWarnings ( container ) , null !== ( callback1 = void 0 === callback ? null : callback ) && "function" != typeof callback1 && error ( "%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s." , "render" , callback1 ) ;
var callback1 , fiberRoot , root = container . _reactRootContainer ;
2021-10-21 08:12:50 +03:00
if ( root ) {
2022-05-04 17:25:28 +03:00
if ( fiberRoot = root . _internalRoot , "function" == typeof callback ) {
2021-08-04 13:27:17 +03:00
var _originalCallback = callback ;
callback = function ( ) {
var instance = getPublicRootInstance ( fiberRoot ) ;
_originalCallback . call ( instance ) ;
} ;
}
updateContainer ( children , fiberRoot , parentComponent , callback ) ;
} else {
2022-06-15 17:36:57 +03:00
if ( fiberRoot = ( root = container . _reactRootContainer = function ( container , forceHydrate ) {
2022-08-26 13:06:25 +03:00
var container1 , options , container2 , rootElement , shouldHydrate = forceHydrate || ( container2 = container , rootElement = getReactRootElementInContainer ( container2 ) , ! ! ( rootElement && 1 === rootElement . nodeType && rootElement . hasAttribute ( ROOT _ATTRIBUTE _NAME ) ) ) ;
2022-06-15 17:36:57 +03:00
if ( ! shouldHydrate ) for ( var rootSibling , warned = ! 1 ; rootSibling = container . lastChild ; ) ! warned && 1 === rootSibling . nodeType && rootSibling . hasAttribute ( ROOT _ATTRIBUTE _NAME ) && ( warned = ! 0 , error ( "render(): Target node has markup rendered by React, but there are unrelated nodes as well. This is most commonly caused by white-space inserted around server-rendered markup." ) ) , container . removeChild ( rootSibling ) ;
return ! shouldHydrate || forceHydrate || warnedAboutHydrateAPI || ( warnedAboutHydrateAPI = ! 0 , warn ( "render(): Calling ReactDOM.render() to hydrate server-rendered markup will stop working in React v18. Replace the ReactDOM.render() call with ReactDOM.hydrate() if you want React to attach to the server HTML." ) ) , container1 = container , options = shouldHydrate ? {
2021-09-08 12:45:39 +03:00
hydrate : ! 0
2022-06-15 17:36:57 +03:00
} : void 0 , new ReactDOMBlockingRoot ( container1 , 0 , options ) ;
} ( container , forceHydrate ) ) . _internalRoot , "function" == typeof callback ) {
2021-08-04 13:27:17 +03:00
var originalCallback = callback ;
callback = function ( ) {
var instance = getPublicRootInstance ( fiberRoot ) ;
originalCallback . call ( instance ) ;
} ;
}
unbatchedUpdates ( function ( ) {
updateContainer ( children , fiberRoot , parentComponent , callback ) ;
} ) ;
}
return getPublicRootInstance ( fiberRoot ) ;
}
topLevelUpdateWarnings = function ( container ) {
2021-07-30 04:11:27 +03:00
if ( container . _reactRootContainer && 8 !== container . nodeType ) {
var hostInstance = findHostInstanceWithNoPortals ( container . _reactRootContainer . _internalRoot . current ) ;
2022-06-15 17:36:57 +03:00
hostInstance && hostInstance . parentNode !== container && error ( "render(...): It looks like the React-rendered content of this container was removed without using React. This is not supported and will cause errors. Instead, call ReactDOM.unmountComponentAtNode to empty a container." ) ;
2021-07-30 04:11:27 +03:00
}
2021-10-14 16:48:14 +03:00
var isRootRenderedBySomeReact = ! ! container . _reactRootContainer , rootEl = getReactRootElementInContainer ( container ) , hasNonRootReactChild = ! ! ( rootEl && getInstanceFromNode ( rootEl ) ) ;
2022-06-15 17:36:57 +03:00
hasNonRootReactChild && ! isRootRenderedBySomeReact && error ( "render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render." ) , 1 === container . nodeType && container . tagName && "BODY" === container . tagName . toUpperCase ( ) && error ( "render(): Rendering components directly into document.body is discouraged, since its children are often manipulated by third-party scripts and browser extensions. This may lead to subtle reconciliation issues. Try rendering into a container element created for your app." ) ;
2022-03-07 06:51:57 +03:00
} , function ( fn ) {
2021-07-30 04:11:27 +03:00
attemptUserBlockingHydration = fn ;
2022-03-07 06:51:57 +03:00
} ( function ( fiber ) {
2022-08-26 11:45:49 +03:00
if ( 13 === fiber . tag ) {
var eventTime = requestEventTime ( ) ;
scheduleUpdateOnFiber ( fiber , 4 , eventTime ) , markRetryLaneIfNotHydrated ( fiber , 4 ) ;
}
2022-03-07 06:51:57 +03:00
} ) , function ( fn ) {
2021-07-30 04:11:27 +03:00
attemptContinuousHydration = fn ;
2022-03-07 06:51:57 +03:00
} ( function ( fiber ) {
2022-08-26 11:45:49 +03:00
if ( 13 === fiber . tag ) {
var eventTime = requestEventTime ( ) ;
scheduleUpdateOnFiber ( fiber , 67108864 , eventTime ) , markRetryLaneIfNotHydrated ( fiber , 67108864 ) ;
}
2022-03-07 06:51:57 +03:00
} ) , function ( fn ) {
2021-07-30 04:11:27 +03:00
attemptHydrationAtCurrentPriority = fn ;
2022-03-07 06:51:57 +03:00
} ( function ( fiber ) {
2021-07-30 04:11:27 +03:00
if ( 13 === fiber . tag ) {
var eventTime = requestEventTime ( ) , lane = requestUpdateLane ( fiber ) ;
scheduleUpdateOnFiber ( fiber , lane , eventTime ) , markRetryLaneIfNotHydrated ( fiber , lane ) ;
}
2022-03-07 06:51:57 +03:00
} ) , function ( fn ) {
2021-07-30 04:11:27 +03:00
attemptHydrationAtPriority = fn ;
2022-03-07 06:51:57 +03:00
} ( function ( priority , fn ) {
2022-04-12 05:12:10 +03:00
return fn ( ) ;
2021-08-04 13:27:17 +03:00
} ) ;
var didWarnAboutUnstableCreatePortal = ! 1 ;
2022-06-15 17:36:57 +03:00
function createPortal$1 ( children , container ) {
var key = arguments . length > 2 && void 0 !== arguments [ 2 ] ? arguments [ 2 ] : null ;
2021-08-04 13:27:17 +03:00
if ( ! isValidContainer ( container ) ) throw Error ( "Target container is not a DOM element." ) ;
2022-03-08 17:35:18 +03:00
return function ( children , containerInfo , implementation ) {
2021-10-21 08:12:50 +03:00
var key = arguments . length > 3 && void 0 !== arguments [ 3 ] ? arguments [ 3 ] : null ;
2021-09-08 12:45:39 +03:00
return {
$$typeof : REACT _PORTAL _TYPE ,
2022-05-04 17:25:28 +03:00
key : null == key ? null : "" + key ,
2021-09-08 12:45:39 +03:00
children : children ,
2021-10-06 10:12:11 +03:00
containerInfo : containerInfo ,
2021-09-08 12:45:39 +03:00
implementation : null
} ;
2022-06-15 17:36:57 +03:00
} ( children , container , null , key ) ;
2021-08-04 13:27:17 +03:00
}
2022-08-26 13:06:25 +03:00
( "function" != typeof Map || null == Map . prototype || "function" != typeof Map . prototype . forEach || "function" != typeof Set || null == Set . prototype || "function" != typeof Set . prototype . clear || "function" != typeof Set . prototype . forEach ) && error ( "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills" ) , function ( impl ) {
2021-07-30 04:11:27 +03:00
restoreImpl = impl ;
2022-06-15 17:36:57 +03:00
} ( function ( domElement , tag , props ) {
var element , props1 , node , element1 , props2 , element2 , props3 , value ;
2021-07-30 04:11:27 +03:00
switch ( tag ) {
2022-05-04 17:25:28 +03:00
case "input" :
2022-06-15 17:36:57 +03:00
element = domElement , props1 = props , updateWrapper ( node = element , props1 ) , function ( rootNode , props ) {
2021-09-08 12:45:39 +03:00
var name = props . name ;
2022-05-04 17:25:28 +03:00
if ( "radio" === props . type && null != name ) {
2021-09-08 12:45:39 +03:00
for ( var queryRoot = rootNode ; queryRoot . parentNode ; ) queryRoot = queryRoot . parentNode ;
2022-05-04 17:25:28 +03:00
for ( var group = queryRoot . querySelectorAll ( "input[name=" + JSON . stringify ( "" + name ) + '][type="radio"]' ) , i = 0 ; i < group . length ; i ++ ) {
2021-09-08 12:45:39 +03:00
var otherNode = group [ i ] ;
if ( otherNode !== rootNode && otherNode . form === rootNode . form ) {
var otherProps = getFiberCurrentPropsFromNode ( otherNode ) ;
if ( ! otherProps ) throw Error ( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ) ;
updateValueIfChanged ( otherNode ) , updateWrapper ( otherNode , otherProps ) ;
}
}
}
2022-06-15 17:36:57 +03:00
} ( node , props1 ) ;
2021-09-16 07:23:33 +03:00
return ;
2022-05-04 17:25:28 +03:00
case "textarea" :
2022-06-15 17:36:57 +03:00
updateWrapper$1 ( element1 = domElement , props ) ;
2021-09-16 07:23:33 +03:00
return ;
2022-05-04 17:25:28 +03:00
case "select" :
2022-06-15 17:36:57 +03:00
element2 = domElement , null != ( value = ( props3 = props ) . value ) && updateOptions ( element2 , ! ! props3 . multiple , value , ! 1 ) ;
2021-09-16 07:23:33 +03:00
return ;
2021-07-30 04:11:27 +03:00
}
2022-03-07 06:51:57 +03:00
} ) , function ( _batchedUpdatesImpl , _discreteUpdatesImpl , _flushDiscreteUpdatesImpl , _batchedEventUpdatesImpl ) {
2021-10-06 10:12:11 +03:00
batchedUpdatesImpl = _batchedUpdatesImpl , discreteUpdatesImpl = _discreteUpdatesImpl , flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl , batchedEventUpdatesImpl = _batchedEventUpdatesImpl ;
2022-03-07 06:51:57 +03:00
} ( batchedUpdates$1 , function ( fn , a , b , c , d ) {
2021-07-30 04:11:27 +03:00
var prevExecutionContext = executionContext ;
executionContext |= 4 ;
try {
return runWithPriority$1 ( 98 , fn . bind ( null , a , b , c , d ) ) ;
} finally {
0 === ( executionContext = prevExecutionContext ) && ( resetRenderTimer ( ) , flushSyncCallbackQueue ( ) ) ;
}
} , function ( ) {
2021-09-16 07:23:33 +03:00
if ( ( 49 & executionContext ) != 0 ) {
2022-06-15 17:36:57 +03:00
( 16 & executionContext ) != 0 && error ( "unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering." ) ;
2021-09-16 07:23:33 +03:00
return ;
}
2021-09-08 12:45:39 +03:00
( function ( ) {
if ( null !== rootsWithPendingDiscreteUpdates ) {
var roots = rootsWithPendingDiscreteUpdates ;
rootsWithPendingDiscreteUpdates = null , roots . forEach ( function ( root ) {
2022-06-15 17:36:57 +03:00
var root1 ;
root1 = root , root1 . expiredLanes |= 24 & root1 . pendingLanes , ensureRootIsScheduled ( root , now ( ) ) ;
2021-09-08 12:45:39 +03:00
} ) ;
}
flushSyncCallbackQueue ( ) ;
} ) ( ) , flushPassiveEffects ( ) ;
2021-07-30 04:11:27 +03:00
} , function ( fn , a ) {
var prevExecutionContext = executionContext ;
executionContext |= 2 ;
try {
return fn ( a ) ;
} finally {
0 === ( executionContext = prevExecutionContext ) && ( resetRenderTimer ( ) , flushSyncCallbackQueue ( ) ) ;
}
2022-08-26 13:06:25 +03:00
} ) ;
var devToolsConfig , findFiberByHostInstance , ReactCurrentDispatcher1 , foundDevTools = ( devToolsConfig = {
2021-08-04 13:27:17 +03:00
findFiberByHostInstance : getClosestInstanceFromNode ,
bundleType : 1 ,
2021-11-15 08:03:03 +03:00
version : ReactVersion ,
2022-05-04 17:25:28 +03:00
rendererPackageName : "react-dom"
2022-08-26 13:06:25 +03:00
} , findFiberByHostInstance = devToolsConfig . findFiberByHostInstance , ReactCurrentDispatcher1 = ReactSharedInternals . ReactCurrentDispatcher , function ( internals ) {
2022-05-04 17:25:28 +03:00
if ( "undefined" == typeof _ _REACT _DEVTOOLS _GLOBAL _HOOK _ _ ) return ! 1 ;
2021-08-04 13:27:17 +03:00
var hook = _ _REACT _DEVTOOLS _GLOBAL _HOOK _ _ ;
if ( hook . isDisabled ) return ! 0 ;
2022-06-15 17:36:57 +03:00
if ( ! hook . supportsFiber ) return error ( "The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://reactjs.org/link/react-devtools" ) , ! 0 ;
2021-08-04 13:27:17 +03:00
try {
rendererID = hook . inject ( internals ) , injectedHook = hook ;
} catch ( err ) {
2022-06-15 17:36:57 +03:00
error ( "React instrumentation encountered an error: %s." , err ) ;
2021-08-04 13:27:17 +03:00
}
return ! 0 ;
} ( {
bundleType : devToolsConfig . bundleType ,
version : devToolsConfig . version ,
rendererPackageName : devToolsConfig . rendererPackageName ,
rendererConfig : devToolsConfig . rendererConfig ,
overrideHookState : overrideHookState ,
overrideHookStateDeletePath : overrideHookStateDeletePath ,
overrideHookStateRenamePath : overrideHookStateRenamePath ,
overrideProps : overrideProps ,
overridePropsDeletePath : overridePropsDeletePath ,
overridePropsRenamePath : overridePropsRenamePath ,
setSuspenseHandler : setSuspenseHandler ,
scheduleUpdate : scheduleUpdate ,
2022-08-26 13:06:25 +03:00
currentDispatcherRef : ReactCurrentDispatcher1 ,
2021-08-04 13:27:17 +03:00
findHostInstanceByFiber : function ( fiber ) {
var hostFiber = findCurrentHostFiber ( fiber ) ;
return null === hostFiber ? null : hostFiber . stateNode ;
} ,
2022-04-05 09:25:23 +03:00
findFiberByHostInstance : findFiberByHostInstance || emptyFindFiberByHostInstance ,
2022-07-06 06:53:11 +03:00
findHostInstancesForRefresh : findHostInstancesForRefresh ,
scheduleRefresh : scheduleRefresh ,
scheduleRoot : scheduleRoot ,
setRefreshHandler : setRefreshHandler ,
2022-04-05 09:25:23 +03:00
getCurrentFiber : getCurrentFiberForDevTools
2022-08-26 13:06:25 +03:00
} ) ) ;
if ( ! foundDevTools && canUseDOM && window . top === window . self && ( navigator . userAgent . indexOf ( "Chrome" ) > - 1 && - 1 === navigator . userAgent . indexOf ( "Edge" ) || navigator . userAgent . indexOf ( "Firefox" ) > - 1 ) ) {
2021-07-30 04:11:27 +03:00
var protocol = window . location . protocol ;
2022-05-04 17:25:28 +03:00
/^(https?|file):$/ . test ( protocol ) && console . info ( "%cDownload the React DevTools for a better development experience: https://reactjs.org/link/react-devtools" + ( "file:" === protocol ? "\nYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq" : "" ) , "font-weight:bold" ) ;
2021-07-30 04:11:27 +03:00
}
2022-06-15 17:36:57 +03:00
exports1 . _ _SECRET _INTERNALS _DO _NOT _USE _OR _YOU _WILL _BE _FIRED = {
2021-08-03 18:52:47 +03:00
Events : [
getInstanceFromNode ,
2021-07-30 04:11:27 +03:00
getNodeFromInstance ,
getFiberCurrentPropsFromNode ,
enqueueStateRestore ,
restoreStateIfNeeded ,
flushPassiveEffects ,
2022-05-04 17:25:28 +03:00
IsThisRendererActing ,
2021-08-03 18:52:47 +03:00
]
2022-06-15 17:36:57 +03:00
} , exports1 . createPortal = createPortal$1 , exports1 . findDOMNode = function ( componentOrElement ) {
2021-07-30 04:11:27 +03:00
var owner = ReactCurrentOwner$3 . current ;
2022-06-15 17:36:57 +03:00
return null !== owner && null !== owner . stateNode && ( owner . stateNode . _warnedAboutRefsInRender || error ( "%s is accessing findDOMNode inside its render(). render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead." , getComponentName ( owner . type ) || "A component" ) , owner . stateNode . _warnedAboutRefsInRender = ! 0 ) , null == componentOrElement ? null : 1 === componentOrElement . nodeType ? componentOrElement : function ( component , methodName ) {
var fiber = get ( component ) ;
2021-09-08 12:45:39 +03:00
if ( void 0 === fiber ) {
2022-05-04 17:25:28 +03:00
if ( "function" == typeof component . render ) throw Error ( "Unable to find node on an unmounted component." ) ;
2021-09-08 12:45:39 +03:00
throw Error ( "Argument appears to not be a ReactComponent. Keys: " + Object . keys ( component ) ) ;
}
var hostFiber = findCurrentHostFiber ( fiber ) ;
if ( null === hostFiber ) return null ;
if ( 1 & hostFiber . mode ) {
2022-05-04 17:25:28 +03:00
var componentName = getComponentName ( fiber . type ) || "Component" ;
2021-09-08 12:45:39 +03:00
if ( ! didWarnAboutFindNodeInStrictMode [ componentName ] ) {
didWarnAboutFindNodeInStrictMode [ componentName ] = ! 0 ;
2022-06-15 17:36:57 +03:00
var previousFiber = current ;
2021-09-08 12:45:39 +03:00
try {
2022-06-15 17:36:57 +03:00
setCurrentFiber ( hostFiber ) , 1 & fiber . mode ? error ( "%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node" , methodName , methodName , componentName ) : error ( "%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node" , methodName , methodName , componentName ) ;
2021-09-08 12:45:39 +03:00
} finally {
previousFiber ? setCurrentFiber ( previousFiber ) : resetCurrentFiber ( ) ;
}
}
}
return hostFiber . stateNode ;
2022-05-04 17:25:28 +03:00
} ( componentOrElement , "findDOMNode" ) ;
2022-06-15 17:36:57 +03:00
} , exports1 . flushSync = flushSync , exports1 . hydrate = function ( element , container , callback ) {
2021-07-30 04:11:27 +03:00
if ( ! isValidContainer ( container ) ) throw Error ( "Target container is not a DOM element." ) ;
2022-08-26 13:06:25 +03:00
var isModernRoot = isContainerMarkedAsRoot ( container ) && void 0 === container . _reactRootContainer ;
return isModernRoot && error ( "You are calling ReactDOM.hydrate() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call createRoot(container, {hydrate: true}).render(element)?" ) , legacyRenderSubtreeIntoContainer ( null , element , container , ! 0 , callback ) ;
2022-06-15 17:36:57 +03:00
} , exports1 . render = function ( element , container , callback ) {
2021-07-30 04:11:27 +03:00
if ( ! isValidContainer ( container ) ) throw Error ( "Target container is not a DOM element." ) ;
2022-08-26 13:06:25 +03:00
var isModernRoot = isContainerMarkedAsRoot ( container ) && void 0 === container . _reactRootContainer ;
return isModernRoot && error ( "You are calling ReactDOM.render() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.render(element)?" ) , legacyRenderSubtreeIntoContainer ( null , element , container , ! 1 , callback ) ;
2022-06-15 17:36:57 +03:00
} , exports1 . unmountComponentAtNode = function ( container ) {
2021-07-30 04:11:27 +03:00
if ( ! isValidContainer ( container ) ) throw Error ( "unmountComponentAtNode(...): Target container is not a DOM element." ) ;
2022-08-26 13:06:25 +03:00
var isModernRoot = isContainerMarkedAsRoot ( container ) && void 0 === container . _reactRootContainer ;
if ( isModernRoot && error ( "You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?" ) , container . _reactRootContainer ) {
var rootEl = getReactRootElementInContainer ( container ) , renderedByDifferentReact = rootEl && ! getInstanceFromNode ( rootEl ) ;
return renderedByDifferentReact && error ( "unmountComponentAtNode(): The node you're attempting to unmount was rendered by another copy of React." ) , unbatchedUpdates ( function ( ) {
2021-07-30 04:11:27 +03:00
legacyRenderSubtreeIntoContainer ( null , null , container , ! 1 , function ( ) {
container . _reactRootContainer = null , unmarkContainerAsRoot ( container ) ;
} ) ;
} ) , ! 0 ;
}
var _rootEl = getReactRootElementInContainer ( container ) , hasNonRootReactChild = ! ! ( _rootEl && getInstanceFromNode ( _rootEl ) ) , isContainerReactRoot = 1 === container . nodeType && isValidContainer ( container . parentNode ) && ! ! container . parentNode . _reactRootContainer ;
2022-06-15 17:36:57 +03:00
return hasNonRootReactChild && error ( "unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. %s" , isContainerReactRoot ? "You may have accidentally passed in a React root node instead of its container." : "Instead, have the parent component update its state and rerender in order to remove this component." ) , ! 1 ;
} , exports1 . unstable _batchedUpdates = batchedUpdates$1 , exports1 . unstable _createPortal = function ( children , container ) {
2021-07-30 04:11:27 +03:00
var key = arguments . length > 2 && void 0 !== arguments [ 2 ] ? arguments [ 2 ] : null ;
2022-03-16 17:25:26 +03:00
return didWarnAboutUnstableCreatePortal || ( didWarnAboutUnstableCreatePortal = ! 0 , warn ( 'The ReactDOM.unstable_createPortal() alias has been deprecated, and will be removed in React 18+. Update your code to use ReactDOM.createPortal() instead. It has the exact same API, but without the "unstable_" prefix.' ) ) , createPortal$1 ( children , container , key ) ;
2022-06-15 17:36:57 +03:00
} , exports1 . unstable _renderSubtreeIntoContainer = function ( parentComponent , element , containerNode , callback ) {
2022-03-08 17:35:18 +03:00
return function ( parentComponent , element , containerNode , callback ) {
2022-04-29 08:58:59 +03:00
var key ;
2021-09-08 12:45:39 +03:00
if ( ! isValidContainer ( containerNode ) ) throw Error ( "Target container is not a DOM element." ) ;
if ( ! ( null != parentComponent && void 0 !== parentComponent . _reactInternals ) ) throw Error ( "parentComponent must be a valid React Component" ) ;
return legacyRenderSubtreeIntoContainer ( parentComponent , element , containerNode , ! 1 , callback ) ;
2022-06-15 17:36:57 +03:00
} ( parentComponent , element , containerNode , callback ) ;
} , exports1 . version = ReactVersion ;
2021-07-30 04:11:27 +03:00
} ) ;