decord/source/1170__isNativeReflectConstruct.js

343 lines
11 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1170
2026-07-25 08:10:48 +00:00
// Function ID: 13301
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 6, 7, 15, 17, 18, 31, 27, 794, 1168, 1141, 1131, 1134]
2026-07-20 16:05:17 +00:00
// Exports: withTouchEventBoundary
// Module 1170 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray";
import result from "result";
import getActivityIndicator from "get ActivityIndicator";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import importAllResult from "result";
import get_ActivityIndicator from "get ActivityIndicator";
2026-07-20 16:05:17 +00:00
let StyleSheet;
2026-07-23 10:11:24 +00:00
let closure_9;
const require = arg1;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function getTouchedComponentInfo(elementType) {
elementType = elementType.elementType;
if (null !== elementType) {
if (undefined !== elementType) {
const displayName = elementType.displayName;
}
}
const memoizedProps = elementType.memoizedProps;
if (memoizedProps) {
let obj = {};
2026-07-23 10:11:24 +00:00
const obj2 = require(794) /* registerSpanErrorInstrumentation */;
2026-07-20 16:05:17 +00:00
obj.name = getComponentName(memoizedProps) || displayName;
obj.element = getElementName(memoizedProps);
obj.file = getFileName(memoizedProps);
obj.label = getLabelValue(memoizedProps, arg1);
let dropUndefinedKeysResult = obj2.dropUndefinedKeys(obj);
const tmp5 = getComponentName(memoizedProps) || displayName;
} else if (displayName) {
obj = { name: displayName };
dropUndefinedKeysResult = obj;
}
return dropUndefinedKeysResult;
}
function getComponentName(arg0) {
2026-07-23 10:11:24 +00:00
let tmp = "string" === typeof arg0[c12];
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = arg0[c12].length > 0;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = "unknown" !== arg0[c12];
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = arg0[c12];
2026-07-20 16:05:17 +00:00
}
return tmp;
}
function getElementName(memoizedProps) {
2026-07-23 10:11:24 +00:00
let tmp = "string" === typeof memoizedProps[c13];
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = memoizedProps[c13].length > 0;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = "unknown" !== memoizedProps[c13];
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = memoizedProps[c13];
2026-07-20 16:05:17 +00:00
}
return tmp;
}
function getFileName(memoizedProps) {
2026-07-23 10:11:24 +00:00
let tmp = "string" === typeof memoizedProps[c14];
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = memoizedProps[c14].length > 0;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = "unknown" !== memoizedProps[c14];
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = memoizedProps[c14];
2026-07-20 16:05:17 +00:00
}
return tmp;
}
function getLabelValue(memoizedProps, arg1) {
2026-07-23 10:11:24 +00:00
if ("string" === typeof memoizedProps[c11]) {
if (memoizedProps[c11].length > 0) {
let tmp2 = memoizedProps[c11];
2026-07-20 16:05:17 +00:00
}
return tmp2;
}
if ("string" === typeof arg1) {
if ("string" === typeof memoizedProps[arg1]) {
if (memoizedProps[arg1].length > 0) {
tmp2 = memoizedProps[arg1];
}
}
}
}
2026-07-23 10:11:24 +00:00
({ StyleSheet, View: closure_9 } = get_ActivityIndicator);
2026-07-20 16:05:17 +00:00
const styles = StyleSheet.create({ wrapperView: { flex: 1 } });
2026-07-23 10:11:24 +00:00
let c11 = "sentry-label";
let c12 = "data-sentry-component";
let c13 = "data-sentry-element";
let c14 = "data-sentry-source-file";
let tmp4 = ((Component) => {
2026-07-20 16:05:17 +00:00
class TouchEventBoundary {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, TouchEventBoundary);
obj = outer1_6(TouchEventBoundary);
tmp2 = outer1_5;
if (outer1_16()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
tmp2Result = tmp2(self, constructResult);
tmp2Result.name = "TouchEventBoundary";
return tmp2Result;
}
}
callback2(TouchEventBoundary, Component);
let obj = {
key: "componentDidMount",
value: function componentDidMount() {
2026-07-23 10:11:24 +00:00
const client = TouchEventBoundary(outer1_1[8]).getClient();
2026-07-20 16:05:17 +00:00
let addIntegration;
if (null != client) {
addIntegration = client.addIntegration;
}
if (!tmp3) {
const self = this;
2026-07-23 10:11:24 +00:00
addIntegration.call(client, TouchEventBoundary(outer1_1[9]).createIntegration(this.name));
const obj2 = TouchEventBoundary(outer1_1[9]);
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "render",
value: function render() {
const _onTouchStart = this._onTouchStart;
2026-07-23 10:11:24 +00:00
return <outer1_9 style={outer1_10.wrapperView} onTouchStart={_onTouchStart.bind(this)}>{this.props.children}</outer1_9>;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "_logTouchEvent",
value: function _logTouchEvent(items, label) {
let combined = label;
const self = this;
const first = items[0];
if (first) {
if (!combined) {
let str3 = "";
if (first.file) {
const _HermesInternal = HermesInternal;
str3 = " (" + first.file + ")";
}
const _HermesInternal2 = HermesInternal;
combined = "" + first.name + str3;
}
let obj = { category: self.props.breadcrumbCategory };
obj = { path: items };
obj.data = obj;
obj.level = "info";
const _HermesInternal3 = HermesInternal;
obj.message = "Touch event within element: " + combined;
obj.type = self.props.breadcrumbType;
2026-07-23 10:11:24 +00:00
TouchEventBoundary(outer1_1[8]).addBreadcrumb(obj);
const debug2 = TouchEventBoundary(outer1_1[8]).debug;
2026-07-20 16:05:17 +00:00
const _HermesInternal4 = HermesInternal;
debug2.log("[TouchEvents] " + obj.message);
2026-07-23 10:11:24 +00:00
const obj3 = TouchEventBoundary(outer1_1[8]);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
const debug = TouchEventBoundary(outer1_1[8]).debug;
2026-07-20 16:05:17 +00:00
debug.warn("[TouchEvents] No root component found in touch path.");
}
}
};
items[2] = obj;
items[3] = {
key: "_isNameIgnored",
value: function _isNameIgnored(label) {
const self = this;
2026-07-23 10:11:24 +00:00
let closure_0 = label;
let tmp = this.props.ignoreNames || [];
2026-07-20 16:05:17 +00:00
let combined = tmp;
if (self.props.ignoredDisplayNames) {
const items = [];
2026-07-23 10:11:24 +00:00
combined = items.concat(outer1_2(tmp), outer1_2(self.props.ignoredDisplayNames));
const tmp3 = outer1_2(tmp);
2026-07-20 16:05:17 +00:00
}
return combined.some((arg0) => {
let tmp = "string" === typeof arg0;
if (tmp) {
2026-07-23 10:11:24 +00:00
tmp = label === arg0;
2026-07-20 16:05:17 +00:00
}
if (!tmp) {
const _RegExp = RegExp;
let match = arg0 instanceof RegExp;
if (match) {
2026-07-23 10:11:24 +00:00
match = label.match(arg0);
2026-07-20 16:05:17 +00:00
}
tmp = match;
}
return tmp;
});
}
};
items[4] = {
key: "_onTouchStart",
value: function _onTouchStart(_targetInst) {
const self = this;
if (_targetInst._targetInst) {
let _return = _targetInst._targetInst;
const items = [];
if (_return) {
if (self.props.maxComponentTreeSize) {
if (items.length < self.props.maxComponentTreeSize) {
const elementType2 = _return.elementType;
let displayName;
if (null !== elementType2) {
if (undefined !== elementType2) {
displayName = elementType2.displayName;
}
}
if (displayName !== TouchEventBoundary.displayName) {
2026-07-23 10:11:24 +00:00
self._pushIfNotIgnored(items, outer1_17(_return, self.props.labelName));
2026-07-20 16:05:17 +00:00
_return = _return.return;
while (_return) {
if (!self.props.maxComponentTreeSize) {
break;
} else if (items.length >= self.props.maxComponentTreeSize) {
break;
} else {
let elementType = _return.elementType;
let displayName1;
if (null !== elementType) {
if (undefined !== elementType) {
displayName1 = elementType.displayName;
}
}
let tmp6 = TouchEventBoundary;
if (displayName1 === TouchEventBoundary.displayName) {
break;
}
}
}
}
}
}
}
const found = items.find((label) => label.label);
let label;
if (null !== found) {
if (undefined !== found) {
label = found.label;
}
}
if (items.length > 0) {
self._logTouchEvent(items, label);
}
2026-07-23 10:11:24 +00:00
let obj = TouchEventBoundary(outer1_1[10]);
obj = { elementId: label, op: TouchEventBoundary(outer1_1[11]).UI_ACTION_TOUCH };
2026-07-20 16:05:17 +00:00
const result = obj.startUserInteractionSpan(obj);
if (result) {
2026-07-23 10:11:24 +00:00
const attr = result.setAttribute(TouchEventBoundary(outer1_1[8]).SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, TouchEventBoundary(outer1_1[12]).SPAN_ORIGIN_AUTO_INTERACTION);
2026-07-20 16:05:17 +00:00
}
}
}
};
items[5] = {
key: "_pushIfNotIgnored",
value: function _pushIfNotIgnored(items, name) {
const self = this;
let tmp2 = !tmp;
if (!!name) {
let tmp4 = !tmp3;
if (!(!name.name && !name.label)) {
let tmp5 = !name.name || !self._isNameIgnored(name.name);
if (tmp5) {
let tmp6 = !name.label || !self._isNameIgnored(name.label);
if (tmp6) {
let tmp7 = items.length > 0;
if (tmp7) {
const _JSON = JSON;
const _JSON2 = JSON;
const json = JSON.stringify(items[items.length - 1]);
tmp7 = json === JSON.stringify(name);
}
let flag = !tmp7;
if (!tmp7) {
items.push(name);
flag = true;
}
tmp6 = flag;
}
tmp5 = tmp6;
}
tmp4 = tmp5;
}
tmp2 = tmp4;
}
return tmp2;
}
};
return callback(TouchEventBoundary, items);
2026-07-23 10:11:24 +00:00
})(importAllResult.Component);
let closure_15 = tmp4;
2026-07-20 16:05:17 +00:00
tmp4.displayName = "__Sentry.TouchEventBoundary";
2026-07-23 10:11:24 +00:00
let obj = { breadcrumbCategory: "touch", breadcrumbType: "user", ignoreNames: [], maxComponentTreeSize: 20 };
tmp4.defaultProps = obj;
2026-07-20 16:05:17 +00:00
export const TouchEventBoundary = tmp4;
export const withTouchEventBoundary = function withTouchEventBoundary(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
class WrappedComponent {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
tmp = outer1_8;
tmp2 = outer1_15;
merged = Object.assign({}, null != closure_1 ? closure_1 : {});
return outer1_8.createElement(tmp2, merged, outer1_8.createElement(closure_0, Object.assign({}, arg0)));
2026-07-20 16:05:17 +00:00
}
}
WrappedComponent.displayName = "WithTouchEventBoundary";
return WrappedComponent;
};