decord/source/6541__isNativeReflectConstruct.js

310 lines
10 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6541
// Function ID: 6542
2026-08-05 07:35:12 +00:00
// Name: _isNativeReflectConstruct
2026-08-24 06:08:38 +00:00
// Dependencies: [41, 42, 93, 95, 98, 19, 17, 21, 6414, 6521]
2026-08-05 07:35:12 +00:00
2026-08-24 06:08:38 +00:00
// Module 6541 (_isNativeReflectConstruct)
import noopAll from "noop" /* 19 */;
import _inheritsDefault from "_inherits" /* 98 */;
import closure_2 from "_classCallCheck" /* 41 */;
import closure_3 from "_possibleConstructorReturn" /* 93 */;
import closure_4 from "_getPrototypeOf" /* 95 */;
import importDefaultResult from "_createClass" /* 42 */;
import { Animated } from "get ActivityIndicator" /* 17 */;
import { jsx } from "jsxProd" /* 21 */;
2026-08-05 07:35:12 +00:00
2026-08-13 07:00:46 +00:00
const GenericTouchable = arg1;
2026-08-05 07:35:12 +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);
}
2026-08-24 06:08:38 +00:00
closure_0 = !callResult;
_isNativeReflectConstruct = function _isNativeReflectConstruct() {
2026-08-05 07:35:12 +00:00
return closure_0;
2026-08-24 06:08:38 +00:00
};
2026-08-05 07:35:12 +00:00
return _isNativeReflectConstruct();
} catch (err) {
}
}
2026-08-24 06:08:38 +00:00
noopAll;
2026-08-13 07:00:46 +00:00
let obj = { UNDETERMINED: 0, BEGAN: 1, MOVED_OUTSIDE: 2 };
class GenericTouchable {
2026-08-05 07:35:12 +00:00
constructor() {
self = this;
2026-08-13 07:00:46 +00:00
items = [...arguments];
2026-08-24 06:08:38 +00:00
closure_0 = undefined;
tmp = closure_2(this, closure_0);
2026-08-13 07:00:46 +00:00
items1 = [...items];
2026-08-24 06:08:38 +00:00
tmp2 = closure_4;
obj = closure_4(closure_0);
tmp3 = closure_3;
2026-08-05 07:35:12 +00:00
if (_isNativeReflectConstruct()) {
2026-08-13 07:00:46 +00:00
tmp5 = globalThis;
2026-08-05 07:35:12 +00:00
_Reflect = Reflect;
2026-08-13 07:00:46 +00:00
constructResult = Reflect.construct(obj, items1, tmp2(self).constructor);
2026-08-05 07:35:12 +00:00
} else {
2026-08-13 07:00:46 +00:00
constructResult = obj.apply(self, items1);
2026-08-05 07:35:12 +00:00
}
2026-08-13 07:00:46 +00:00
tmp3Result = tmp3(self, constructResult);
2026-08-24 06:08:38 +00:00
closure_0 = tmp3Result;
2026-08-13 07:00:46 +00:00
tmp3Result.longPressDetected = false;
tmp3Result.pointerInside = true;
2026-08-24 06:08:38 +00:00
tmp3Result.STATE = closure_8.UNDETERMINED;
2026-08-13 07:00:46 +00:00
tmp3Result.onGestureEvent = (nativeEvent) => {
const pointerInside = nativeEvent.nativeEvent.pointerInside;
2026-08-24 06:08:38 +00:00
if (lib.pointerInside !== pointerInside) {
2026-08-13 07:00:46 +00:00
if (pointerInside) {
obj.onMoveIn();
} else {
obj.onMoveOut();
}
}
2026-08-24 06:08:38 +00:00
lib.pointerInside = pointerInside;
2026-08-13 07:00:46 +00:00
};
tmp3Result.onHandlerStateChange = (nativeEvent) => {
const state = nativeEvent.nativeEvent.state;
2026-08-24 06:08:38 +00:00
if (state !== lib(closure_1_1[8]).State.CANCELLED) {
2026-08-13 07:00:46 +00:00
if (state !== tmp(tmp2[8]).State.FAILED) {
if (state === tmp(tmp2[8]).State.BEGAN) {
2026-08-24 06:08:38 +00:00
if (lib.STATE === closure_1_8.UNDETERMINED) {
2026-08-13 07:00:46 +00:00
obj.handlePressIn();
}
2026-08-24 06:08:38 +00:00
obj = lib;
2026-08-13 07:00:46 +00:00
}
if (state === tmp(tmp2[8]).State.END) {
2026-08-24 06:08:38 +00:00
const longPressDetected = lib.longPressDetected;
2026-08-13 07:00:46 +00:00
let tmp5 = !longPressDetected;
if (!longPressDetected) {
2026-08-24 06:08:38 +00:00
tmp5 = obj2.STATE !== closure_1_8.MOVED_OUTSIDE;
2026-08-13 07:00:46 +00:00
}
if (tmp5) {
tmp5 = undefined === obj2.pressOutTimeout;
}
const result = obj2.handleGoToUndetermined();
if (tmp5) {
const props = obj2.props;
const onPress = props.onPress;
if (onPress != null) {
onPress();
}
}
}
}
}
2026-08-24 06:08:38 +00:00
lib.moveToState(closure_1_8.UNDETERMINED);
2026-08-13 07:00:46 +00:00
};
tmp3Result.onLongPressDetected = () => {
2026-08-24 06:08:38 +00:00
lib.longPressDetected = true;
const props = lib.props;
2026-08-13 07:00:46 +00:00
const onLongPress = props.onLongPress;
if (onLongPress != null) {
onLongPress();
}
};
return tmp3Result;
2026-08-05 07:35:12 +00:00
}
}
2026-08-24 06:08:38 +00:00
_inheritsDefault(GenericTouchable, require("noop").Component);
2026-08-13 07:00:46 +00:00
obj = {
key: "handlePressIn",
value: function handlePressIn() {
let self = this;
self = this;
if (this.props.delayPressIn) {
const _setTimeout = setTimeout;
self.pressInTimeout = setTimeout(() => {
2026-08-24 06:08:38 +00:00
self.moveToState(closure_1_8.BEGAN);
2026-08-13 07:00:46 +00:00
self.pressInTimeout = undefined;
}, self.props.delayPressIn);
2026-08-05 07:35:12 +00:00
} else {
2026-08-13 07:00:46 +00:00
self.moveToState(obj.BEGAN);
}
if (self.props.onLongPress) {
const _setTimeout2 = setTimeout;
self.longPressTimeout = setTimeout(self.onLongPressDetected, (self.props.delayPressIn || 0) + (self.props.delayLongPress || 0));
const tmp4 = self.props.delayPressIn || 0;
const tmp5 = self.props.delayLongPress || 0;
2026-08-05 07:35:12 +00:00
}
}
};
2026-08-13 07:00:46 +00:00
let items = [
2026-08-05 07:35:12 +00:00
obj,
2026-08-13 07:00:46 +00:00
{
key: "handleMoveOutside",
value: function handleMoveOutside() {
let self = this;
self = this;
if (this.props.delayPressOut) {
let pressOutTimeout = self.pressOutTimeout;
if (!pressOutTimeout) {
const _setTimeout = setTimeout;
pressOutTimeout = setTimeout(() => {
2026-08-24 06:08:38 +00:00
self.moveToState(closure_1_8.MOVED_OUTSIDE);
2026-08-13 07:00:46 +00:00
self.pressOutTimeout = undefined;
}, self.props.delayPressOut);
}
self.pressOutTimeout = pressOutTimeout;
} else {
self.moveToState(obj.MOVED_OUTSIDE);
}
}
},
{
key: "handleGoToUndetermined",
value: function handleGoToUndetermined() {
let self = this;
self = this;
clearTimeout(this.pressOutTimeout);
if (this.props.delayPressOut) {
const _setTimeout = setTimeout;
self.pressOutTimeout = setTimeout(() => {
2026-08-24 06:08:38 +00:00
if (self.STATE === closure_1_8.UNDETERMINED) {
2026-08-13 07:00:46 +00:00
obj.moveToState(tmp.BEGAN);
}
2026-08-24 06:08:38 +00:00
self.moveToState(closure_1_8.UNDETERMINED);
2026-08-13 07:00:46 +00:00
self.pressOutTimeout = undefined;
}, self.props.delayPressOut);
} else {
if (self.STATE === obj.UNDETERMINED) {
self.moveToState(tmp2.BEGAN);
}
self.moveToState(obj.UNDETERMINED);
}
}
},
{
key: "componentDidMount",
value: function componentDidMount() {
this.reset();
}
},
{
key: "reset",
value: function reset() {
2026-08-24 06:08:38 +00:00
obj = { longPressDetected: false, pointerInside: true };
2026-08-13 07:00:46 +00:00
clearTimeout(obj.pressInTimeout);
clearTimeout(obj.pressOutTimeout);
clearTimeout(obj.longPressTimeout);
obj.pressOutTimeout = undefined;
obj.longPressTimeout = undefined;
obj.pressInTimeout = undefined;
}
},
{
key: "moveToState",
value: function moveToState(BEGAN) {
const self = this;
if (BEGAN !== this.STATE) {
if (BEGAN === obj.BEGAN) {
const props3 = self.props;
const onPressIn = props3.onPressIn;
if (onPressIn != null) {
onPressIn();
}
} else if (BEGAN === tmp10.MOVED_OUTSIDE) {
const props2 = self.props;
const onPressOut2 = props2.onPressOut;
if (onPressOut2 != null) {
onPressOut2();
}
} else if (BEGAN === tmp10.UNDETERMINED) {
self.reset();
if (self.STATE === tmp10.BEGAN) {
const props = self.props;
const onPressOut = props.onPressOut;
if (onPressOut != null) {
onPressOut();
}
}
}
const props4 = self.props;
const onStateChange = props4.onStateChange;
if (onStateChange != null) {
onStateChange(self.STATE, BEGAN);
}
self.STATE = BEGAN;
}
}
},
{
key: "componentWillUnmount",
value: function componentWillUnmount() {
this.reset();
}
},
{
key: "onMoveIn",
value: function onMoveIn() {
const self = this;
if (this.STATE === obj.MOVED_OUTSIDE) {
self.moveToState(tmp.BEGAN);
}
}
},
{
key: "onMoveOut",
value: function onMoveOut() {
const self = this;
clearTimeout(this.longPressTimeout);
this.longPressTimeout = undefined;
if (this.STATE === obj.BEGAN) {
self.handleMoveOutside();
}
}
},
2026-08-05 07:35:12 +00:00
{
key: "render",
value: function render() {
const self = this;
2026-08-13 07:00:46 +00:00
if (typeof this.props.hitSlop === "number") {
2026-08-24 06:08:38 +00:00
obj = { top: null, left: null, bottom: null, right: null };
2026-08-13 07:00:46 +00:00
obj[0] = self.props.hitSlop;
obj[1] = self.props.hitSlop;
obj[2] = self.props.hitSlop;
obj[3] = self.props.hitSlop;
let hitSlop = obj;
} else {
hitSlop = self.props.hitSlop;
}
obj = { accessible: false !== self.props.accessible, accessibilityLabel: self.props.accessibilityLabel, accessibilityHint: self.props.accessibilityHint, accessibilityRole: self.props.accessibilityRole, accessibilityState: self.props.accessibilityState, accessibilityActions: self.props.accessibilityActions, onAccessibilityAction: self.props.onAccessibilityAction, nativeID: self.props.nativeID, onLayout: self.props.onLayout };
obj = { style: self.props.containerStyle, onHandlerStateChange: null, onGestureEvent: null, hitSlop: null, userSelect: null, shouldActivateOnStart: null, disallowInterruption: null, testID: null, touchSoundDisabled: null, enabled: null };
let onHandlerStateChange;
if (!self.props.disabled) {
onHandlerStateChange = self.onHandlerStateChange;
}
obj[1] = onHandlerStateChange;
obj[2] = self.onGestureEvent;
obj[3] = hitSlop;
obj[4] = self.props.userSelect;
obj[5] = self.props.shouldActivateOnStart;
obj[6] = self.props.disallowInterruption;
obj[7] = self.props.testID;
let flag = self.props.touchSoundDisabled;
if (flag == null) {
flag = false;
2026-08-05 07:35:12 +00:00
}
2026-08-13 07:00:46 +00:00
obj[8] = flag;
obj[9] = !self.props.disabled;
const merged = Object.assign(self.props.extraButtonProps);
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-08-13 07:00:46 +00:00
const merged1 = Object.assign(obj);
obj1.style = self.props.style;
obj1.children = self.props.children;
obj.children = <Animated.View />;
2026-08-24 06:08:38 +00:00
return jsx(GenericTouchable(6521).LegacyBaseButton, { style: self.props.containerStyle, onHandlerStateChange: null, onGestureEvent: null, hitSlop: null, userSelect: null, shouldActivateOnStart: null, disallowInterruption: null, testID: null, touchSoundDisabled: null, enabled: null });
2026-08-05 07:35:12 +00:00
}
}
];
2026-08-13 07:00:46 +00:00
const importDefaultResultResult = importDefaultResult(GenericTouchable, items);
importDefaultResultResult.defaultProps = { delayLongPress: 600, extraButtonProps: { rippleColor: "transparent", exclusive: true } };
2026-08-05 07:35:12 +00:00
export default importDefaultResultResult;
2026-08-13 07:00:46 +00:00
export const TOUCHABLE_STATE = obj;