2026-08-08 06:10:11 +00:00
// Module ID: 5454
// Function ID: 5455
2026-07-29 08:29:29 +00:00
// Name: _isNativeReflectConstruct
2026-08-08 06:10:11 +00:00
// Dependencies: [41, 42, 93, 95, 98, 19, 17, 21, 5455, 5433, 5449, 5456, 5458, 5431, 5460, 5459, 5461, 5462, 5432, 5446]
2026-08-07 06:50:47 +00:00
// Exports: default
2026-07-29 08:29:29 +00:00
2026-08-08 06:10:11 +00:00
// Module 5454 (_isNativeReflectConstruct)
2026-08-07 06:50:47 +00:00
import _classCallCheck from "_classCallCheck" ;
import _createClass from "_createClass" ;
2026-07-29 08:29:29 +00:00
import _possibleConstructorReturn from "_possibleConstructorReturn" ;
import _getPrototypeOf from "_getPrototypeOf" ;
2026-08-07 06:50:47 +00:00
import _inherits from "_inherits" ;
import noop from "noop" ;
2026-08-08 06:10:11 +00:00
import get _ActivityIndicator from "get ActivityIndicator" ;
2026-08-07 06:50:47 +00:00
import { jsx } from "jsxProd" ;
2026-07-29 08:29:29 +00:00
2026-08-07 06:50:47 +00:00
let DeviceEventEmitter ;
let Platform ;
const require = arg1 ;
2026-07-29 08:29:29 +00:00
function _isNativeReflectConstruct ( ) {
try {
const _Boolean = Boolean ;
const call = valueOf . call ;
const _Reflect = Reflect ;
const _Boolean2 = Boolean ;
if ( typeof call === "unknown" ) {
let callResult = valueOf ( ) ;
} else {
callResult = call ( constructResult ) ;
}
let closure _0 = ! callResult ;
function _isNativeReflectConstruct ( ) {
return closure _0 ;
}
return _isNativeReflectConstruct ( ) ;
} catch ( err ) {
}
}
2026-08-08 06:10:11 +00:00
( { DeviceEventEmitter , Platform } = get _ActivityIndicator ) ;
2026-08-07 06:50:47 +00:00
require ( "customDirectEventTypes" ) . customDirectEventTypes . topGestureHandlerEvent = { registrationName : "onGestureHandlerEvent" } ;
2026-08-08 06:10:11 +00:00
let closure _10 = { [ arg1 ( 5433 ) . State . UNDETERMINED ] : undefined , [ arg1 ( 5433 ) . State . BEGAN ] : "onBegan" , [ arg1 ( 5433 ) . State . FAILED ] : "onFailed" , [ arg1 ( 5433 ) . State . CANCELLED ] : "onCancelled" , [ arg1 ( 5433 ) . State . ACTIVE ] : "onActivated" , [ arg1 ( 5433 ) . State . END ] : "onEnded" } ;
2026-08-07 06:50:47 +00:00
export default function createHandler ( name ) {
let _classCallCheck ;
let customNativeProps ;
name = name . name ;
const Handler = name ;
let allowedProps = name . allowedProps ;
if ( allowedProps === undefined ) {
allowedProps = [ ] ;
}
let config = name . config ;
if ( config === undefined ) {
config = { } ;
}
( { transformProps : _classCallCheck , customNativeProps } = name ) ;
if ( customNativeProps === undefined ) {
customNativeProps = [ ] ;
}
class Handler {
constructor ( arg0 ) {
self = this ;
tmp = _isNativeReflectConstruct ( this , apply ) ;
items = [ ] ;
items [ 0 ] = name ;
tmp2 = _isNativeReflectConstruct ;
obj = _isNativeReflectConstruct ( apply ) ;
tmp3 = _isNativeReflectConstruct ;
if ( _isNativeReflectConstruct ( ) ) {
tmp5 = globalThis ;
_Reflect = Reflect ;
constructResult = Reflect . construct ( obj , items , tmp2 ( self ) . constructor ) ;
} else {
constructResult = obj . apply ( self , items ) ;
}
tmp3Result = tmp3 ( self , constructResult ) ;
apply = tmp3Result ;
tmp3Result . handlerTag = - 1 ;
tmp3Result . onGestureHandlerEvent = ( nativeEvent ) => {
if ( nativeEvent . nativeEvent . handlerTag === tmp3Result . handlerTag ) {
if ( typeof tmp . props . onGestureEvent === "function" ) {
const props2 = tmp . props ;
const onGestureEvent = props2 . onGestureEvent ;
if ( onGestureEvent != null ) {
onGestureEvent ( nativeEvent ) ;
}
}
} else {
const props = tmp . props ;
if ( props . onGestureHandlerEvent != null ) {
const result = onGestureHandlerEvent ( nativeEvent ) ;
}
}
} ;
tmp3Result . onGestureHandlerStateChange = ( nativeEvent ) => {
if ( nativeEvent . nativeEvent . handlerTag === tmp3Result . handlerTag ) {
if ( typeof tmp . props . onHandlerStateChange === "function" ) {
const props2 = tmp . props ;
if ( props2 . onHandlerStateChange != null ) {
onHandlerStateChange ( nativeEvent ) ;
}
}
let tmp7 = tmp6 ;
2026-08-08 06:10:11 +00:00
if ( outer2 _10 [ nativeEvent . nativeEvent . state ] ) {
2026-08-07 06:50:47 +00:00
tmp7 = tmp . props [ tmp6 ] ;
}
let tmp8 = tmp7 ;
if ( tmp7 ) {
tmp8 = typeof tmp7 === "function" ;
}
if ( tmp8 ) {
tmp7 ( nativeEvent ) ;
}
} else {
const props = tmp . props ;
if ( props . onGestureHandlerStateChange != null ) {
const result = onGestureHandlerStateChange ( nativeEvent ) ;
}
}
} ;
tmp3Result . refHandler = ( viewNode ) => {
tmp3Result . viewNode = viewNode ;
const Children = outer2 _8 . Children ;
2026-08-08 06:10:11 +00:00
const props = Children . only ( tmp3Result . props . children ) . props ;
let ref ;
if ( props != null ) {
ref = props . ref ;
2026-08-07 06:50:47 +00:00
}
if ( ref ) {
if ( typeof ref === "function" ) {
ref ( viewNode ) ;
} else {
ref . current = viewNode ;
}
}
} ;
tmp3Result . createGestureHandler = ( config ) => {
2026-08-08 06:10:11 +00:00
tmp3Result . handlerTag = Handler ( config [ 10 ] ) . getNextHandlerTag ( ) ;
2026-08-07 06:50:47 +00:00
tmp3Result . config = config ;
2026-08-08 06:10:11 +00:00
const obj = Handler ( config [ 10 ] ) ;
allowedProps ( config [ 11 ] ) . createGestureHandler ( tmp3Result , tmp3Result . handlerTag , config ) ;
const obj2 = allowedProps ( config [ 11 ] ) ;
const obj3 = allowedProps ( config [ 11 ] ) ;
obj3 . configureRelations ( tmp3Result . handlerTag , Handler ( config [ 12 ] ) . selectProperties ( config , [ "waitFor" , "simultaneousHandlers" , "blocksHandlers" ] ) ) ;
2026-08-07 06:50:47 +00:00
} ;
tmp3Result . attachGestureHandler = ( viewTag ) => {
tmp3Result . viewTag = viewTag ;
let obj = Handler ( config [ 13 ] ) ;
obj = { onGestureEvent : tmp3Result . onGestureHandlerEvent , onGestureStateChange : tmp3Result . onGestureHandlerStateChange } ;
let result = obj . registerOldGestureHandler ( tmp3Result . handlerTag , obj ) ;
const props = tmp3Result . props ;
let onGestureEvent ;
if ( props != null ) {
onGestureEvent = props . onGestureEvent ;
}
let tmp6 = onGestureEvent ;
if ( onGestureEvent ) {
let tmp7 = "current" in onGestureEvent ;
if ( ! tmp7 ) {
tmp7 = "workletEventHandler" in onGestureEvent ;
}
tmp6 = tmp7 ;
}
const props2 = tmp . props ;
if ( ! tmp6 ) {
if ( ! onHandlerStateChange ) {
if ( onGestureEvent ) {
if ( "__isNative" in onGestureEvent ) {
let REANIMATED _WORKLET = tmp2 ( tmp3 [ 14 ] ) . ActionType . NATIVE _ANIMATED _EVENT ;
}
}
REANIMATED _WORKLET = tmp2 ( tmp3 [ 14 ] ) . ActionType . JS _FUNCTION _OLD _API ;
}
2026-08-08 06:10:11 +00:00
allowedProps ( tmp3 [ 11 ] ) . attachGestureHandler ( tmp . handlerTag , viewTag , REANIMATED _WORKLET ) ;
let tmp2Result = tmp2 ( tmp3 [ 12 ] ) ;
2026-08-07 06:50:47 +00:00
const result1 = tmp2Result . scheduleFlushOperations ( ) ;
2026-08-08 06:10:11 +00:00
tmp2Result = tmp2 ( tmp3 [ 15 ] ) ;
2026-08-07 06:50:47 +00:00
tmp2Result . ghQueueMicrotask ( ( ) => {
2026-08-08 06:10:11 +00:00
const MountRegistry = callback ( outer2 _2 [ 16 ] ) . MountRegistry ;
2026-08-07 06:50:47 +00:00
const result = MountRegistry . gestureHandlerWillMount ( callback ) ;
} ) ;
}
REANIMATED _WORKLET = tmp2 ( tmp3 [ 14 ] ) . ActionType . REANIMATED _WORKLET ;
} ;
2026-08-08 06:10:11 +00:00
tmp3Result . setGestureHandlerConfig = ( config ) => {
2026-08-07 06:50:47 +00:00
tmp3Result . config = config ;
2026-08-08 06:10:11 +00:00
const result = allowedProps ( config [ 11 ] ) . setGestureHandlerConfig ( tmp3Result . handlerTag , config ) ;
const obj = allowedProps ( config [ 11 ] ) ;
const obj2 = allowedProps ( config [ 11 ] ) ;
obj2 . configureRelations ( tmp3Result . handlerTag , Handler ( config [ 12 ] ) . selectProperties ( config , [ "waitFor" , "simultaneousHandlers" , "blocksHandlers" ] ) ) ;
const obj3 = Handler ( config [ 12 ] ) ;
const result1 = Handler ( config [ 12 ] ) . scheduleFlushOperations ( ) ;
2026-08-07 06:50:47 +00:00
} ;
tmp3Result . config = { } ;
tmp3Result . propsRef = noop . createRef ( ) ;
tmp3Result . isMountedRef = noop . createRef ( ) ;
tmp3Result . state = { allowTouches : true } ;
if ( name . id ) {
tmp7 = closure _0 ;
tmp8 = closure _2 ;
if ( undefined !== closure _0 ( closure _2 [ 13 ] ) . handlerIDToTag [ name . id ] ) {
tmp9 = globalThis ;
_Error = Error ;
_HermesInternal = HermesInternal ;
str = "\" already registered" ;
str2 = "Handler with ID \"" ;
tmp10 = new . target ;
tmp11 = new . target ;
error = new Error ( "Handler with ID \"" + name . id + "\" already registered" ) ;
tmp13 = error ;
throw error ;
} else {
tmp7 ( tmp8 [ 13 ] ) . handlerIDToTag [ name . id ] = tmp3Result . handlerTag ;
}
2026-07-29 08:29:29 +00:00
}
2026-08-07 06:50:47 +00:00
return tmp3Result ;
2026-07-29 08:29:29 +00:00
}
}
2026-08-07 06:50:47 +00:00
callback ( Handler , Component . Component ) ;
let items = [
{
key : "componentDidMount" ,
value : function componentDidMount ( ) {
let self = this ;
self = this ;
const props = this . props ;
this . isMountedRef . current = true ;
if ( Array . isArray ( props . simultaneousHandlers ) ) {
let someResult = simultaneousHandlers . some ( ( current ) => {
let tmp = current ;
if ( current ) {
tmp = null === current . current ;
}
return tmp ;
} ) ;
} else {
someResult = simultaneousHandlers ;
if ( simultaneousHandlers ) {
someResult = null === simultaneousHandlers . current ;
}
}
if ( someResult ) {
if ( someResult ) {
2026-08-08 06:10:11 +00:00
require ( 5459 ) . ghQueueMicrotask ( ( ) => {
2026-08-07 06:50:47 +00:00
self . update ( 1 ) ;
} ) ;
2026-08-08 06:10:11 +00:00
const obj = require ( 5459 ) ;
2026-08-07 06:50:47 +00:00
}
const props2 = self . props ;
const items = [ ] ;
2026-08-08 06:10:11 +00:00
const obj2 = require ( 5458 ) /* transformIntoHandlerTags */ ;
2026-08-07 06:50:47 +00:00
HermesBuiltin . arraySpread ( customNativeProps , HermesBuiltin . arraySpread ( allowedProps , 0 ) ) ;
self . createGestureHandler ( obj2 . filterConfig ( outer1 _3 ? outer1 _3 ( props2 ) : props2 , items , config ) ) ;
if ( self . viewNode ) {
2026-08-08 06:10:11 +00:00
self . attachGestureHandler ( importDefault ( 5462 ) ( self . viewNode ) ) ;
2026-08-07 06:50:47 +00:00
} else {
const _Error = Error ;
const _HermesInternal = HermesInternal ;
const error = new Error ( "[Gesture Handler] Failed to obtain view for " + self . displayName + ". Note that old API doesn't support functional components." ) ;
throw error ;
}
const tmp11 = outer1 _3 ? outer1 _3 ( props2 ) : props2 ;
} else {
const waitFor = props . waitFor ;
const _Array = Array ;
if ( Array . isArray ( waitFor ) ) {
let someResult1 = waitFor . some ( ( current ) => {
let tmp = current ;
if ( current ) {
tmp = null === current . current ;
}
return tmp ;
} ) ;
} else {
someResult1 = waitFor ;
if ( waitFor ) {
someResult1 = null === waitFor . current ;
}
}
}
}
} ,
{
key : "componentDidUpdate" ,
value : function componentDidUpdate ( ) {
const self = this ;
2026-08-08 06:10:11 +00:00
const tmp = allowedProps ( config [ 17 ] ) ( this . viewNode ) ;
2026-08-07 06:50:47 +00:00
if ( this . viewTag !== tmp ) {
self . attachGestureHandler ( tmp ) ;
}
self . update ( 1 ) ;
}
} ,
{
key : "componentWillUnmount" ,
value : function componentWillUnmount ( ) {
const self = this ;
const inspectorToggleListener = this . inspectorToggleListener ;
if ( inspectorToggleListener != null ) {
inspectorToggleListener . remove ( ) ;
}
self . isMountedRef . current = false ;
const result = Handler ( config [ 13 ] ) . unregisterOldGestureHandler ( self . handlerTag ) ;
const obj = Handler ( config [ 13 ] ) ;
2026-08-08 06:10:11 +00:00
allowedProps ( config [ 11 ] ) . dropGestureHandler ( self . handlerTag ) ;
const obj2 = allowedProps ( config [ 11 ] ) ;
const result1 = Handler ( config [ 12 ] ) . scheduleFlushOperations ( ) ;
2026-08-07 06:50:47 +00:00
if ( self . props . id ) {
const handlerIDToTag = tmp4 ( tmp5 [ 13 ] ) . handlerIDToTag ;
delete tmp [ tmp2 ] ;
}
2026-08-08 06:10:11 +00:00
const MountRegistry = tmp4 ( tmp5 [ 16 ] ) . MountRegistry ;
2026-08-07 06:50:47 +00:00
const result2 = MountRegistry . gestureHandlerWillUnmount ( self ) ;
}
} ,
{
key : "update" ,
value : function update ( arg0 ) {
let self = this ;
self = this ;
let closure _0 = arg0 ;
if ( this . isMountedRef . current ) {
const props = self . props ;
const _Array = Array ;
if ( Array . isArray ( props . simultaneousHandlers ) ) {
let someResult = simultaneousHandlers . some ( ( current ) => {
let tmp = current ;
if ( current ) {
tmp = null === current . current ;
}
return tmp ;
} ) ;
} else {
someResult = simultaneousHandlers ;
if ( simultaneousHandlers ) {
someResult = null === simultaneousHandlers . current ;
}
}
if ( someResult ) {
if ( someResult ) {
if ( arg0 > 0 ) {
2026-08-08 06:10:11 +00:00
Handler ( config [ 15 ] ) . ghQueueMicrotask ( ( ) => {
2026-08-07 06:50:47 +00:00
self . update ( closure _0 - 1 ) ;
} ) ;
2026-08-08 06:10:11 +00:00
const obj3 = Handler ( config [ 15 ] ) ;
2026-08-07 06:50:47 +00:00
}
}
const props2 = self . props ;
const items = [ ] ;
2026-08-08 06:10:11 +00:00
const obj = Handler ( config [ 12 ] ) ;
2026-08-07 06:50:47 +00:00
const tmp7 = Handler ;
const tmp8 = config ;
HermesBuiltin . arraySpread ( customNativeProps , HermesBuiltin . arraySpread ( self , 0 ) ) ;
const filterConfigResult = obj . filterConfig ( callback ? callback ( props2 ) : props2 , items , config ) ;
const tmp9 = callback ? callback ( props2 ) : props2 ;
if ( ! tmp7Result . deepEqual ( self . config , filterConfigResult ) ) {
2026-08-08 06:10:11 +00:00
const result = self . setGestureHandlerConfig ( filterConfigResult ) ;
2026-08-07 06:50:47 +00:00
}
2026-08-08 06:10:11 +00:00
tmp7Result = tmp7 ( tmp8 [ 18 ] ) ;
2026-08-07 06:50:47 +00:00
} else {
const waitFor = props . waitFor ;
const _Array2 = Array ;
if ( Array . isArray ( waitFor ) ) {
let someResult1 = waitFor . some ( ( current ) => {
let tmp = current ;
if ( current ) {
tmp = null === current . current ;
}
return tmp ;
} ) ;
} else {
someResult1 = waitFor ;
if ( waitFor ) {
someResult1 = null === waitFor . current ;
}
}
}
}
}
} ,
{
key : "setNativeProps" ,
value : function setNativeProps ( arg0 ) {
const self = this ;
const obj = { } ;
const merged = Object . assign ( this . props ) ;
const merged1 = Object . assign ( arg0 ) ;
let tmp3 = obj ;
if ( callback ) {
tmp3 = callback ( obj ) ;
}
const items = [ ... customNativeProps ] ;
2026-08-08 06:10:11 +00:00
const result = self . setGestureHandlerConfig ( Handler ( config [ 12 ] ) . filterConfig ( tmp3 , items , config ) ) ;
2026-08-07 06:50:47 +00:00
}
} ,
{
key : "render" ,
value : function render ( ) {
let onGestureEvent ;
let onGestureHandlerEvent ;
let onGestureHandlerEvent2 ;
let onGestureHandlerStateChange ;
let onGestureHandlerStateChange2 ;
let onHandlerStateChange ;
let props ;
let props2 ;
const self = this ;
( { onGestureHandlerEvent , props } = this ) ;
( { onGestureEvent , onGestureHandlerEvent : onGestureHandlerEvent2 } = props ) ;
if ( onGestureEvent ) {
if ( typeof onGestureEvent !== "function" ) {
let tmp2 = onGestureEvent ;
if ( onGestureHandlerEvent2 ) {
const _Error3 = Error ;
const error = new Error ( "Nesting touch handlers with native animated driver is not supported yet" ) ;
throw error ;
}
}
( { onGestureHandlerStateChange , props : props2 } = self ) ;
( { onHandlerStateChange , onGestureHandlerStateChange : onGestureHandlerStateChange2 } = props2 ) ;
if ( onHandlerStateChange ) {
if ( typeof onHandlerStateChange !== "function" ) {
let tmp3 = onHandlerStateChange ;
if ( onGestureHandlerStateChange2 ) {
const _Error2 = Error ;
const error1 = new Error ( "Nesting touch handlers with native animated driver is not supported yet" ) ;
throw error1 ;
}
}
let tmp4 ;
if ( self . state . allowTouches ) {
tmp4 = tmp2 ;
}
let obj = { onGestureHandlerEvent : null , onGestureHandlerStateChange : null } ;
obj [ 0 ] = tmp4 ;
let tmp5 ;
if ( self . state . allowTouches ) {
tmp5 = tmp3 ;
}
obj [ 1 ] = tmp5 ;
self . propsRef . current = obj ;
try {
let obj1 = outer1 _8 ;
const Children = outer1 _8 . Children ;
const onlyResult = Children . only ( self . props . children ) ;
obj = { ref : null , collapsable : false } ;
obj [ 0 ] = self . refHandler ;
if ( obj4 . isTestEnv ( ) ) {
obj = { handlerType : null , handlerTag : null , enabled : null } ;
obj [ 0 ] = Handler ;
obj [ 1 ] = self . handlerTag ;
obj [ 2 ] = self . props . enabled ;
obj1 = obj ;
} else {
obj1 = { } ;
}
const merged = Object . assign ( obj1 ) ;
let testID = self . props . testID ;
if ( testID == null ) {
testID = onlyResult . props . testID ;
}
obj . testID = testID ;
const merged1 = Object . assign ( obj ) ;
return obj1 . cloneElement ( onlyResult , obj , onlyResult . props . children ) ;
} catch ( err ) {
const _Error = Error ;
const _HermesInternal = HermesInternal ;
2026-08-08 06:10:11 +00:00
const error2 = new Error ( Handler ( config [ 18 ] ) . tagMessage ( "" + Handler + " got more than one view as a child. If you want the gesture to work on multiple views, wrap them with a common parent and attach the gesture to that view." ) ) ;
2026-08-07 06:50:47 +00:00
throw error2 ;
}
}
tmp3 = onGestureHandlerStateChange ;
if ( onGestureHandlerStateChange2 ) {
tmp3 = onGestureHandlerStateChange ;
if ( typeof onGestureHandlerStateChange2 !== "function" ) {
const _Error5 = Error ;
const error3 = new Error ( "Nesting touch handlers with native animated driver is not supported yet" ) ;
throw error3 ;
}
}
}
tmp2 = onGestureHandlerEvent ;
if ( onGestureHandlerEvent2 ) {
tmp2 = onGestureHandlerEvent ;
if ( typeof onGestureHandlerEvent2 !== "function" ) {
const _Error4 = Error ;
const error4 = new Error ( "Nesting touch handlers with native animated driver is not supported yet" ) ;
throw error4 ;
}
}
}
}
] ;
let tmp2 = customNativeProps ( Handler , items ) ;
tmp2 . displayName = name ;
tmp2 . contextType = allowedProps ( config [ 19 ] ) ;
return tmp2 ;
} ;