case "gotpointercapture":
case "lostpointercapture":
case "pointercancel":
case "pointerdown":
case "pointermove":
case "pointerout":
case "pointerover":
case "pointerup":
SyntheticEventCtor = SyntheticPointerEvent;
break;
case "toggle":
case "beforetoggle":
SyntheticEventCtor = SyntheticToggleEvent;
}
var inCapturePhase = 0 !== (eventSystemFlags & 4), accumulateTargetOnly = !inCapturePhase && ("scroll" === domEventName || "scrollend" === domEventName), reactEventName = inCapturePhase ? null !== reactName ? reactName + "Capture" : null : reactName;
inCapturePhase = [];
for (var instance = targetInst, lastHostComponent; null !== instance; ) {
var _instance2 = instance;
lastHostComponent = _instance2.stateNode;
_instance2 = _instance2.tag;
5 !== _instance2 && 26 !== _instance2 && 27 !== _instance2 || null === lastHostComponent || null === reactEventName || (_instance2 = getListener(instance, reactEventName), null != _instance2 && inCapturePhase.push(
createDispatchListener(
instance,
_instance2,
lastHostComponent
)
));
if (accumulateTargetOnly) break;
instance = instance.return;
}
0 < inCapturePhase.length && (reactName = new SyntheticEventCtor(
reactName,
reactEventType,
null,
nativeEvent,
nativeEventTarget
), dispatchQueue.push({
event: reactName,
listeners: inCapturePhase
}));
}
}
if (0 === (eventSystemFlags & 7)) {
a: {
reactName = "mouseover" === domEventName || "pointerover" === domEventName;
SyntheticEventCtor = "mouseout" === domEventName || "pointerout" === domEventName;
if (reactName && nativeEvent !== currentReplayingEvent && (reactEventType = nativeEvent.relatedTarget || nativeEvent.fromElement) && (getClosestInstanceFromNode(reactEventType) || reactEventType[internalContainerInstanceKey]))
break a;
if (SyntheticEventCtor || reactName) {
reactName = nativeEventTarget.window === nativeEventTarget ? nativeEventTarget : (reactName = nativeEventTarget.ownerDocument) ? reactName.defaultView || reactName.parentWindow : window;
if (SyntheticEventCtor) {
if (reactEventType = nativeEvent.relatedTarget || nativeEvent.toElement, SyntheticEventCtor = targetInst, reactEventType = reactEventType ? getClosestInstanceFromNode(reactEventType) : null, null !== reactEventType && (accumulateTargetOnly = getNearestMountedFiber(reactEventType), inCapturePhase = reactEventType.tag, reactEventType !== accumulateTargetOnly || 5 !== inCapturePhase && 27 !== inCapturePhase && 6 !== inCapturePhase))
reactEventType = null;
} else SyntheticEventCtor = null, reactEventType = targetInst;
if (SyntheticEventCtor !== reactEventType) {
inCapturePhase = SyntheticMouseEvent;
_instance2 = "onMouseLeave";
reactEventName = "onMouseEnter";
instance = "mouse";
if ("pointerout" === domEventName || "pointerover" === domEventName)
inCapturePhase = SyntheticPointerEvent, _instance2 = "onPointerLeave", reactEventName = "onPointerEnter", instance = "pointer";
accumulateTargetOnly = null == SyntheticEventCtor ? reactName : getNodeFromInstance(SyntheticEventCtor);
lastHostComponent = null == reactEventType ? reactName : getNodeFromInstance(reactEventType);
reactName = new inCapturePhase(
_instance2,
instance + "leave",
SyntheticEventCtor,
nativeEvent,
nativeEventTarget
);
reactName.target = accumulateTargetOnly;
reactName.relatedTarget = lastHostComponent;
_instance2 = null;
getClosestInstanceFromNode(nativeEventTarget) === targetInst && (inCapturePhase = new inCapturePhase(
reactEventName,
instance + "enter",
reactEventType,
nativeEvent,
nativeEventTarget
), inCapturePhase.target = lastHostComponent, inCapturePhase.relatedTarget = accumulateTargetOnly, _instance2 = inCapturePhase);
accumulateTargetOnly = _instance2;
if (SyntheticEventCtor && reactEventType)
b: {
inCapturePhase = SyntheticEventCtor;
reactEventName = reactEventType;
instance = 0;
for (lastHostComponent = inCapturePhase; lastHostComponent; lastHostComponent = getParent(lastHostComponent))
instance++;
lastHostComponent = 0;
for (_instance2 = reactEventName; _instance2; _instance2 = getParent(_instance2))
lastHostComponent++;
for (; 0 < instance - lastHostComponent; )
inCapturePhase = getParent(inCapturePhase), instance--;
for (; 0 < lastHostComponent - instance; )
reactEventName = getParent(reactEventName), lastHostComponent--;
for (; instance--; ) {
if (inCapturePhase === reactEventName || null !== reactEventName && inCapturePhase === reactEventName.alternate)
break b;
inCapturePhase = getParent(inCapturePhase);
reactEventName = getParent(reactEventName);
}
inCapturePhase = null;
}
else inCapturePhase = null;
null !== SyntheticEventCtor && accumulateEnterLeaveListenersForEvent(
dispatchQueue,
reactName,
SyntheticEventCtor,
inCapturePhase,
false
);
null !== reactEventType && null !== accumulateTargetOnly && accumulateEnterLeaveListenersForEvent(
dispatchQueue,
accumulateTargetOnly,
reactEventType,
inCapturePhase,
true
);
}
}
}
a: {
reactName = targetInst ? getNodeFromInstance(targetInst) : window;
SyntheticEventCtor = reactName.nodeName && reactName.nodeName.toLowerCase();
if ("select" === SyntheticEventCtor || "input" === SyntheticEventCtor && "file" === reactName.type)
var getTargetInstFunc = getTargetInstForChangeEvent;
else if (isTextInputElement(reactName))
if (isInputEventSupported)
getTargetInstFunc = getTargetInstForInputOrChangeEvent;
else {
getTargetInstFunc = getTargetInstForInputEventPolyfill;
var handleEventFunc = handleEventsForInputEventPolyfill;
}
else
SyntheticEventCtor = reactName.nodeName, !SyntheticEventCtor || "input" !== SyntheticEventCtor.toLowerCase() || "checkbox" !== reactName.type && "radio" !== reactName.type ? targetInst && isCustomElement(targetInst.elementType) && (getTargetInstFunc = getTargetInstForChangeEvent) : getTargetInstFunc = getTargetInstForClickEvent;
if (getTargetInstFunc && (getTargetInstFunc = getTargetInstFunc(domEventName, targetInst))) {
createAndAccumulateChangeEvent(
dispatchQueue,
getTargetInstFunc,
nativeEvent,
nativeEventTarget
);
break a;
}
handleEventFunc && handleEventFunc(domEventName, reactName, targetInst);
"focusout" === domEventName && targetInst && "number" === reactName.type && null != targetInst.memoizedProps.value && setDefaultValue(reactName, "number", reactName.value);
}
handleEventFunc = targetInst ? getNodeFromInstance(targetInst) : window;
switch (domEventName) {
case "focusin":
if (isTextInputElement(handleEventFunc) || "true" === handleEventFunc.contentEditable)
activeElement = handleEventFunc, activeElementInst = targetInst, lastSelection = null;
break;
case "focusout":
lastSelection = activeElementInst = activeElement = null;
break;
case "mousedown":
mouseDown = true;
break;
case "contextmenu":
case "mouseup":
case "dragend":
mouseDown = false;
constructSelectEvent(
dispatchQueue,
nativeEvent,
nativeEventTarget
);
break;
case "selectionchange":
if (skipSelectionChangeEvent) break;
case "keydown":
case "keyup":
constructSelectEvent(
dispatchQueue,
nativeEvent,
nativeEventTarget
);
}
var fallbackData;
if (canUseCompositionEvent)
b: {
switch (domEventName) {
case "compositionstart":
var eventType = "onCompositionStart";
break b;
case "compositionend":
eventType = "onCompositionEnd";
break b;
case "compositionupdate":
eventType = "onCompositionUpdate";
break b;
}
eventType = void 0;
}
else
isComposing ? isFallbackCompositionEnd(domEventName, nativeEvent) && (eventType = "onCompositionEnd") : "keydown" === domEventName && nativeEvent.keyCode === START_KEYCODE && (eventType = "onCompositionStart");
eventType && (useFallbackCompositionData && "ko" !== nativeEvent.locale && (isComposing || "onCompositionStart" !== eventType ? "onCompositionEnd" === eventType && isComposing && (fallbackData = getData()) : (root = nativeEventTarget, startText = "value" in root ? root.value : root.textContent, isComposing = true)), handleEventFunc = accumulateTwoPhaseListeners(
targetInst,
eventType
), 0 < handleEventFunc.length && (eventType = new SyntheticCompositionEvent(
eventType,
domEventName,
null,
nativeEvent,
nativeEventTarget
), dispatchQueue.push({
event: eventType,
listeners: handleEventFunc
}), fallbackData ? eventType.data = fallbackData : (fallbackData = getDataFromCustomEvent(nativeEvent), null !== fallbackData && (eventType.data = fallbackData))));
if (fallbackData = canUseTextInputEvent ? getNativeBeforeInputChars(domEventName, nativeEvent) : getFallbackBeforeInputChars(domEventName, nativeEvent))
eventType = accumulateTwoPhaseListeners(
targetInst,
"onBeforeInput"
), 0 < eventType.length && (handleEventFunc = new SyntheticInputEvent(
"onBeforeInput",
"beforeinput",
null,
nativeEvent,
nativeEventTarget
), dispatchQueue.push({
event: handleEventFunc,
listeners: eventType
}), handleEventFunc.data = fallbackData);
extractEvents$1(
dispatchQueue,
domEventName,
targetInst,
nativeEvent,
nativeEventTarget
);
}
processDispatchQueue(dispatchQueue, eventSystemFlags);
});
}
function createDispatchListener(instance, listener, currentTarget) {
return {
instance,
listener,
currentTarget
};
}
function accumulateTwoPhaseListeners(targetFiber, reactName) {
for (var captureName = reactName + "Capture", listeners = []; null !== targetFiber; ) {
var _instance3 = targetFiber, stateNode = _instance3.stateNode;
_instance3 = _instance3.tag;
5 !== _instance3 && 26 !== _instance3 && 27 !== _instance3 || null === stateNode || (_instance3 = getListener(targetFiber, captureName), null != _instance3 && listeners.unshift(
createDispatchListener(targetFiber, _instance3, stateNode)
), _instance3 = getListener(targetFiber, reactName), null != _instance3 && listeners.push(
createDispatchListener(targetFiber, _instance3, stateNode)
));
targetFiber = targetFiber.return;
}
return listeners;
}
function getParent(inst) {
if (null === inst) return null;
do
inst = inst.return;
while (inst && 5 !== inst.tag && 27 !== inst.tag);
return inst ? inst : null;
}
function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
for (var registrationName = event._reactName, listeners = []; null !== target && target !== common; ) {
var _instance4 = target, alternate = _instance4.alternate, stateNode = _instance4.stateNode;
_instance4 = _instance4.tag;
if (null !== alternate && alternate === common) break;
5 !== _instance4 && 26 !== _instance4 && 27 !== _instance4 || null === stateNode || (alternate = stateNode, inCapturePhase ? (stateNode = getListener(target, registrationName), null != stateNode && listeners.unshift(
createDispatchListener(target, stateNode, alternate)
)) : inCapturePhase || (stateNode = getListener(target, registrationName), null != stateNode && listeners.push(
createDispatchListener(target, stateNode, alternate)
)));
target = target.return;
}
0 !== listeners.length && dispatchQueue.push({ event, listeners });
}
function validatePropertiesInDevelopment(type, props) {
validateProperties$2(type, props);
"input" !== type && "textarea" !== type && "select" !== type || null == props || null !== props.value || didWarnValueNull || (didWarnValueNull = true, "select" === type && props.multiple ? console.error(
"`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",
type
) : console.error(
"`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",
type
));
var eventRegistry = {
registrationNameDependencies,
possibleRegistrationNames
};
isCustomElement(type) || "string" === typeof props.is || warnUnknownProperties(type, props, eventRegistry);
props.contentEditable && !props.suppressContentEditableWarning && null != props.children && console.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."
);
}
function warnForPropDifference(propName, serverValue, clientValue, serverDifferences) {
serverValue !== clientValue && (clientValue = normalizeMarkupForTextOrAttribute(clientValue), normalizeMarkupForTextOrAttribute(serverValue) !== clientValue && (serverDifferences[propName] = serverValue));
}
function warnForExtraAttributes(domElement, attributeNames, serverDifferences) {
attributeNames.forEach(function(attributeName) {
serverDifferences[getPropNameFromAttributeName(attributeName)] = "style" === attributeName ? getStylesObjectFromElement(domElement) : domElement.getAttribute(attributeName);
});
}
function warnForInvalidEventListener(registrationName, listener) {
false === listener ? console.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
) : console.error(
"Expected `%s` listener to be a function, instead got a value of `%s` type.",
registrationName,
typeof listener
);
}
function normalizeHTML(parent, html) {
parent = parent.namespaceURI === MATH_NAMESPACE || parent.namespaceURI === SVG_NAMESPACE ? parent.ownerDocument.createElementNS(
parent.namespaceURI,
parent.tagName
) : parent.ownerDocument.createElement(parent.tagName);
parent.innerHTML = html;
return parent.innerHTML;
}
function normalizeMarkupForTextOrAttribute(markup) {
willCoercionThrow(markup) && (console.error(
"The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",
typeName(markup)
), testStringCoercion(markup));
return ("string" === typeof markup ? markup : "" + markup).replace(NORMALIZE_NEWLINES_REGEX, "\n").replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, "");
}
function checkForUnmatchedText(serverText, clientText) {
clientText = normalizeMarkupForTextOrAttribute(clientText);
return normalizeMarkupForTextOrAttribute(serverText) === clientText ? true : false;
}
function noop$1() {
}
function setProp(domElement, tag, key, value, props, prevValue) {
switch (key) {
case "children":
if ("string" === typeof value)
validateTextNesting(value, tag), "body" === tag || "textarea" === tag && "" === value || setTextContent(domElement, value);
else if ("number" === typeof value || "bigint" === typeof value)
validateTextNesting("" + value, tag), "body" !== tag && setTextContent(domElement, "" + value);
break;
case "className":
setValueForKnownAttribute(domElement, "class", value);
break;
case "tabIndex":
setValueForKnownAttribute(domElement, "tabindex", value);
break;
case "dir":
case "role":
case "viewBox":
case "width":
case "height":
setValueForKnownAttribute(domElement, key, value);
break;
case "style":
setValueForStyles(domElement, value, prevValue);
break;
case "data":
if ("object" !== tag) {
setValueForKnownAttribute(domElement, "data", value);
break;
}
case "src":
case "href":
if ("" === value && ("a" !== tag || "href" !== key)) {
"src" === key ? console.error(
'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
key,
key
) : console.error(
'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',
key,
key
);
domElement.removeAttribute(key);
break;
}
if (null == value || "function" === typeof value || "symbol" === typeof value || "boolean" === typeof value) {
domElement.removeAttribute(key);
break;
}
checkAttributeStringCoercion(value, key);
value = sanitizeURL("" + value);
domElement.setAttribute(key, value);
break;
case "action":
case "formAction":
null != value && ("form" === tag ? "formAction" === key ? console.error(
"You can only pass the formAction prop to or