275 lines
12 KiB
TypeScript
275 lines
12 KiB
TypeScript
/* Metro module 13112; source: components_native/ErrorBoundary.tsx; dependencies: [6, 7, 15, 17, 18, 5, 57, 31, 27, 10557, 33, 4501, 566, 10558, 4578, 1244, 1216, 694, 1305, 9165, 4573, 3868, 2] */
|
|
function _fun100197(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:6, offset: 0x021e0e58, size: 468 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const env0_8 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_9 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_11 = value2.NativeModules;
|
|
const env0_12 = value2.View;
|
|
const buildOverrideStore = importDefault(10557) /* metro dependency 10557: BuildOverrideStore */;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value3.jsx;
|
|
const env0_15 = value3.jsxs;
|
|
const env0_16 = (require(4501) /* metro dependency 4501: createStyles */).createLegacyClassComponentStyles({buttons: {'position': 'absolute',
|
|
'right': 32, 'bottom': 32, 'left': 32, 'gap': 12}, debugLogsContainer: {'position': 'absolute', 'right': 32,
|
|
'top': 64, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'gap': 12},
|
|
error: {'marginTop': 24, 'textAlign': 'center'}, text: {textAlign: 'center'}});
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun100207(PureComponent);
|
|
const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/ErrorBoundary.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_100198() { // fn#100198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:253, offset: 0x021e102c, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_100198_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function MaybeClearBuildOverride() { // fn#100201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:746, offset: 0x021e108e, size: 238 bytes, params: 1, frame: 20
|
|
let [property, env0_0] = env0_9(env0_10.useState(false), 2);
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStores = fluxModule.useStateFromStores;
|
|
if (Reflect.apply(useStateFromStores, fluxModule, [[BuildOverrideStore], function() {
|
|
var r0;
|
|
var property = BuildOverrideStore.getCurrentBuildOverride().overrides;
|
|
var value2 = undefined;
|
|
if (property == null) {
|
|
r0 = value2;
|
|
} else {
|
|
property = property[require(dependencyMap[13]).DEVICE_FIELD];
|
|
r0 = property == null ? value2 : property.id;
|
|
}
|
|
return r0;
|
|
}]) == null) {
|
|
return null;
|
|
}
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<Button
|
|
variant="secondary"
|
|
loading={property}
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/Nz9rY'])}
|
|
onPress={function() {
|
|
return _clearOverride.apply(this, arguments);
|
|
}}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun100207(a0) { // fn#100207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1337, offset: 0x021e126f, size: 199 bytes, params: 2, frame: 16
|
|
const closure = ErrorBoundary_100208;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'componentDidCatch', value: function(a0, a1) {
|
|
this.triggerSoftCrash(a0, a1);
|
|
}}, {key: 'triggerSoftCrash', value: value_100210}, {key: 'handleReload', value: function() {
|
|
var BundleUpdaterManager = NativeModules.BundleUpdaterManager;
|
|
BundleUpdaterManager.reload();
|
|
}}, {key: 'componentDidMount', value: function() {
|
|
var env0_0 = this;
|
|
if (global.window.DiscordErrors == null) {
|
|
global.window.DiscordErrors = {softCrash: _fun100213};
|
|
this.discordErrorsSet = true;
|
|
}
|
|
}}, {key: 'componentWillUnmount', value: function() {
|
|
if (this.discordErrorsSet) {
|
|
global.window.DiscordErrors = null;
|
|
this.discordErrorsSet = false;
|
|
}
|
|
}}, {key: 'render', value: value_100215}]);
|
|
}
|
|
|
|
function _clearOverride() { // fn#100202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:996, owner: MaybeClearBuildOverride._clearOverride, offset: 0x021e117c, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return env1_8(_fun100204).apply(this, arguments);
|
|
}
|
|
|
|
function ErrorBoundary_100208(a0) { // fn#100208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1349, offset: 0x021e1336, size: 154 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, ErrorBoundary_100208);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(ErrorBoundary_100208);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_100198()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.state = {'error': null, 'info': null};
|
|
value.discordErrorsSet = false;
|
|
return value;
|
|
}
|
|
|
|
function value_100210(a0, a1) { // fn#100210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1794, offset: 0x021e13e9, size: 113 bytes, params: 3, frame: 17
|
|
this.setState({error: a0, info: a1});
|
|
const value = environment.__proto__;
|
|
(importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).captureCrash(a0, {extra: a1});
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({'type': 'CLEAR_CACHES',
|
|
'reason': 'App Crashed'});
|
|
}
|
|
|
|
function value_100212() { // fn#100212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2071, offset: 0x021e1475, size: 67 bytes, params: 1, frame: 5
|
|
const DiscordErrors = global.window.DiscordErrors;
|
|
if (DiscordErrors == null) {
|
|
global.window.DiscordErrors = {softCrash: softCrash};
|
|
this.discordErrorsSet = true;
|
|
}
|
|
}
|
|
|
|
function value_100215() { // fn#100215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2384, offset: 0x021e14f9, size: 523 bytes, params: 1, frame: 29
|
|
var r0;
|
|
var EmptyState;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var text;
|
|
var items3;
|
|
var items2;
|
|
const value = environment.__proto__;
|
|
const binding = env1_16;
|
|
const context = this.context;
|
|
const value2 = undefined;
|
|
const value3 = binding(context);
|
|
const error = this.state.error;
|
|
if (error !== null) {
|
|
EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState;
|
|
var emptyStateProps2 = {Illustration: (require(9165) /* metro dependency 9165: AppCrash */).AppCrash,
|
|
title: intl.string(t.tx8CkI), body: intl.string(t.CvQlAH)};
|
|
text = value3.text;
|
|
emptyStateProps2.titleStyle = text;
|
|
text = value3.text;
|
|
emptyStateProps2.bodyStyle = text;
|
|
items3 = [((Text) => <Text style={value3.error} variant="text-sm/medium" color="text-muted">{(error == null ? value2 : error.message) ?? (error == null ? value2 : error.name) ?? 'Unknown Error'}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
|
|
var viewBindingProps = {style: value3.buttons};
|
|
items2 = [<MaybeClearBuildOverride />];
|
|
items2[1] = ((Button) => <Button text={intl.string(t['4n8OJn'])} onPress={this.handleReload} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button);
|
|
items3[1] = <View {...viewBindingProps}>{items2}</View>;
|
|
items3[2] = null;
|
|
r0 = <EmptyState {...emptyStateProps2}>{items3}</EmptyState>;
|
|
} else {
|
|
r0 = this.props.children;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function* _fun100204() { // fn#100204, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:1047, offset: 0x021e11bc, size: 97 bytes, params: 1, frame: 13
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var clearBuildOverride;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var error;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
require(true);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding = env3_0;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env3_2;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[13];
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
clearBuildOverride = value4.clearBuildOverride;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(clearBuildOverride, value4, []);
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
yield value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
require(false);
|
|
return undefined;
|
|
}
|
|
if (value7) {
|
|
return value6;
|
|
}
|
|
}
|
|
}
|
|
|
|
function softCrash(a0) { // fn#100213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13302:2161, owner: value_100212.softCrash, offset: 0x021e14b8, size: 25 bytes, params: 2, frame: 11
|
|
env0_0.triggerSoftCrash(a0);
|
|
}
|
|
|