311 lines
13 KiB
React
311 lines
13 KiB
React
/* Metro module 5271; source: unknown; dependencies: [31, 27, 33, 5272, 5273] */
|
|
import React from './module-00031-React.js'; /* Metro dependency 31 */
|
|
import Module05272 from './module-05272.js'; /* Metro dependency 5272 */
|
|
import Module05273 from './module-05273.js'; /* Metro dependency 5273 */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
|
|
function _fun46873(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:6, offset: 0x011b1af8, size: 302 bytes, params: 8, frame: 20
|
|
const value = this;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_2 = ReactModule.useCallback;
|
|
React;
|
|
ReactNativeModule.Platform;
|
|
if (value && value.__spreadArray) {
|
|
}
|
|
const closure = function(a0, a1, a2) {
|
|
var env0_0 = a0;
|
|
var env0_1 = a1;
|
|
var env0_2 = a2;
|
|
return _fun46877;
|
|
};
|
|
exports.defaultOriginWhitelist = ['http://*', 'https://*'];
|
|
exports.createOnShouldStartLoadWithRequest = closure;
|
|
exports.defaultRenderLoading = defaultRenderLoading;
|
|
exports.defaultRenderError = defaultRenderError;
|
|
exports.useWebWiewLogic = useWebWiewLogic;
|
|
function originWhitelistToRegex(a0) { // fn#46875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:496, offset: 0x011b1c26, size: 80 bytes, params: 2, frame: 15
|
|
const concat = '^'.concat;
|
|
let value = Module05272;
|
|
value = value(a0);
|
|
return Reflect.apply(concat, '^', [value.replace(RegExp('\\\\\\*', 'g'), '.*')]);
|
|
}
|
|
|
|
function createOnShouldStartLoadWithRequest(a0, a1, a2) { // fn#46876, offset: 0x011b1c76, size: 30 bytes, params: 4, frame: 2
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
return _fun46877;
|
|
function _fun46877({nativeEvent}) { // fn#46877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:644, offset: 0x011b1c94, size: 179 bytes, params: 2, frame: 21
|
|
var r2;
|
|
const url = nativeEvent.url;
|
|
const url2 = url;
|
|
const lockIdentifier = nativeEvent.lockIdentifier;
|
|
const value4 = env1_12(['about:blank'], require || [], true);
|
|
if (((a0, a1) => {
|
|
var value = RegExp('^[A-Za-z][A-Za-z0-9+\\-.]+:(\\/\\/)?[^/]*', '').exec(a1);
|
|
var env0_0 = value === null ? '' : value[0];
|
|
return a0.some(_fun46879);
|
|
})(value4.map(originWhitelistToRegex), url)) {
|
|
r2 = !importDefault || importDefault(nativeEvent);
|
|
} else {
|
|
Linking.canOpenURL(url).then(_fun46880).catch(function(a0) {
|
|
global.console.warn('Error opening URL: ', a0);
|
|
});
|
|
r2 = false;
|
|
}
|
|
url2(r2, url, lockIdentifier);
|
|
function passesWhitelist(a0, a1) { // fn#46878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:709, offset: 0x011b1d47, size: 71 bytes, params: 3, frame: 13
|
|
const value = RegExp('^[A-Za-z][A-Za-z0-9+\\-.]+:(\\/\\/)?[^/]*', '').exec(a1);
|
|
const env0_0 = value === null ? '' : value[0];
|
|
return a0.some(_fun46879);
|
|
function _fun46879(a0) { // fn#46879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:869, offset: 0x011b1d8e, size: 50 bytes, params: 2, frame: 11
|
|
const RegExp = global.RegExp;
|
|
return new RegExp(a0).test(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun46880(a0) { // fn#46880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:1015, offset: 0x011b1dc0, size: 78 bytes, params: 2, frame: 13
|
|
var value;
|
|
if (a0) {
|
|
value = environment.__proto__.__proto__;
|
|
return Linking.openURL(url);
|
|
}
|
|
const console = global.console;
|
|
console.warn("Can't open url: ".concat(url));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function defaultRenderLoading() { // fn#46882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:1302, offset: 0x011b1e2e, size: 69 bytes, params: 1, frame: 16
|
|
return (
|
|
<View style={(Module05273).loadingOrErrorView}>
|
|
<ActivityIndicator />
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function defaultRenderError(a0, a1, a2) { // fn#46883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:1422, offset: 0x011b1e73, size: 272 bytes, params: 4, frame: 23
|
|
return (
|
|
<View style={(Module05273).loadingOrErrorView}>
|
|
<Text style={(Module05273).errorTextTitle}>
|
|
{'Error loading page'}
|
|
</Text>
|
|
<Text style={(Module05273).errorText}>
|
|
{'Domain: '.concat(a0)}
|
|
</Text>
|
|
<Text style={(Module05273).errorText}>
|
|
{'Error Code: '.concat(a1)}
|
|
</Text>
|
|
<Text style={(Module05273).errorText}>
|
|
{'Description: '.concat(a2)}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function useWebWiewLogic({startInLoadingState, onNavigationStateChange, onLoadStart, onLoad, onLoadProgress, onLoadEnd, onError, onHttpErrorProp, onMessageProp, onRenderProcessGoneProp, onContentProcessDidTerminateProp, originWhitelist, onShouldStartLoadWithRequestProp, onShouldStartLoadWithRequestCallback}) { // fn#46884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:1798, offset: 0x011b1f83, size: 511 bytes, params: 2, frame: 31
|
|
const [property, property2] = useState(startInLoadingState ? 'LOADING' : 'IDLE');
|
|
const [property3, env0_14] = useState(null);
|
|
const env0_15 = useRef(null);
|
|
const value6 = useCallback(function(a0) {
|
|
if (onNavigationStateChange != null) {
|
|
onNavigationStateChange(a0.nativeEvent);
|
|
}
|
|
}, [onNavigationStateChange]);
|
|
const value7 = useCallback(_fun46886, [onLoadStart, value6]);
|
|
const value8 = useCallback(_fun46887, [onError, onLoadEnd]);
|
|
const value9 = useCallback(function(a0) {
|
|
if (onHttpErrorProp != null) {
|
|
onHttpErrorProp(a0);
|
|
}
|
|
}, [onHttpErrorProp]);
|
|
const value10 = useCallback(function(a0) {
|
|
if (onRenderProcessGoneProp != null) {
|
|
onRenderProcessGoneProp(a0);
|
|
}
|
|
}, [onRenderProcessGoneProp]);
|
|
const value11 = useCallback(function(a0) {
|
|
if (onContentProcessDidTerminateProp != null) {
|
|
onContentProcessDidTerminateProp(a0);
|
|
}
|
|
}, [onContentProcessDidTerminateProp]);
|
|
const value12 = useCallback(_fun46891, [onLoad, onLoadEnd, value6]);
|
|
const value13 = useCallback(function(a0) {
|
|
if (onMessageProp != null) {
|
|
onMessageProp(a0);
|
|
}
|
|
}, [onMessageProp]);
|
|
const value14 = useCallback(_fun46893, [onLoadProgress]);
|
|
object = {};
|
|
object.onShouldStartLoadWithRequest = useMemo(function() {
|
|
return createOnShouldStartLoadWithRequest(onShouldStartLoadWithRequestCallback, originWhitelist,
|
|
onShouldStartLoadWithRequestProp);
|
|
}, [originWhitelist, onShouldStartLoadWithRequestProp, onShouldStartLoadWithRequestCallback]);
|
|
object.onLoadingStart = value7;
|
|
object.onLoadingProgress = value14;
|
|
object.onLoadingError = value8;
|
|
object.onLoadingFinish = value12;
|
|
object.onHttpError = value9;
|
|
object.onRenderProcessGone = value10;
|
|
object.onContentProcessDidTerminate = value11;
|
|
object.onMessage = value13;
|
|
object.viewState = property;
|
|
object.setViewState = property2;
|
|
object.lastErrorEvent = property3;
|
|
return object;
|
|
function _fun46886(a0) { // fn#46886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:2282, offset: 0x011b21a7, size: 61 bytes, params: 2, frame: 12
|
|
env0_15.current = a0.nativeEvent.url;
|
|
if (onLoadStart != null) {
|
|
onLoadStart(a0);
|
|
}
|
|
env0_16(a0);
|
|
}
|
|
|
|
function _fun46887(a0) { // fn#46887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:2355, offset: 0x011b21e4, size: 135 bytes, params: 2, frame: 15
|
|
var console;
|
|
a0.persist();
|
|
if (onError) {
|
|
onError(a0);
|
|
} else {
|
|
console = global.console;
|
|
console.warn('Encountered an error loading page', a0.nativeEvent);
|
|
}
|
|
if (onLoadEnd != null) {
|
|
onLoadEnd(a0);
|
|
}
|
|
if (!a0.isDefaultPrevented()) {
|
|
env0_13('ERROR');
|
|
env0_14(a0.nativeEvent);
|
|
}
|
|
}
|
|
|
|
function _fun46891(a0) { // fn#46891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:2646, offset: 0x011b22c8, size: 98 bytes, params: 2, frame: 13
|
|
if (onLoad != null) {
|
|
onLoad(a0);
|
|
}
|
|
if (onLoadEnd != null) {
|
|
onLoadEnd(a0);
|
|
}
|
|
if (a0.nativeEvent.url === env0_15.current) {
|
|
env0_13('IDLE');
|
|
}
|
|
env0_16(a0);
|
|
}
|
|
|
|
function _fun46893(a0) { // fn#46893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:2786, offset: 0x011b2349, size: 71 bytes, params: 2, frame: 12
|
|
if (a0.nativeEvent.progress === 1) {
|
|
env0_13(function(a0) {
|
|
var value = a0;
|
|
return value === 'LOADING' ? 'IDLE' : value;
|
|
});
|
|
}
|
|
if (onLoadProgress != null) {
|
|
onLoadProgress(a0);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun46874(a0, a1, a2) { // fn#46874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5449:302, offset: 0x00dfe7bf, size: 165 bytes, params: 4, frame: 22
|
|
var r0;
|
|
var r3;
|
|
var r9;
|
|
var r8;
|
|
var r1;
|
|
var length;
|
|
var value2;
|
|
var Array;
|
|
var prototype;
|
|
var slice;
|
|
var call;
|
|
let value = undefined;
|
|
reducibleJoin10: while (true) {
|
|
reducibleJoin2: while (true) {
|
|
if (a2) {
|
|
break reducibleJoin2;
|
|
}
|
|
if (arguments.length !== 2) {
|
|
r1 = value;
|
|
break reducibleJoin10;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
length = a1.length;
|
|
value2 = 0;
|
|
if (!(value2 < length)) {
|
|
r1 = value;
|
|
break reducibleJoin10;
|
|
}
|
|
r0 = value2;
|
|
r3 = value;
|
|
reducibleLoop3: while (true) {
|
|
value = !r3;
|
|
reducibleJoin5: while (true) {
|
|
if (r3) {
|
|
r9 = value;
|
|
break reducibleJoin5;
|
|
}
|
|
value = r0 in a1;
|
|
r9 = value;
|
|
break reducibleJoin5;
|
|
}
|
|
reducibleJoin9: while (true) {
|
|
if (r9) {
|
|
r8 = r3;
|
|
break reducibleJoin9;
|
|
}
|
|
reducibleJoin8: while (true) {
|
|
if (r3) {
|
|
r9 = r3;
|
|
break reducibleJoin8;
|
|
}
|
|
Array = global.Array;
|
|
prototype = Array.prototype;
|
|
slice = prototype.slice;
|
|
call = slice.call;
|
|
value = Reflect.apply(call, slice, [a1, value2, r0]);
|
|
r9 = value;
|
|
break reducibleJoin8;
|
|
}
|
|
r9[r0] = a1[r0];
|
|
r8 = r9;
|
|
break reducibleJoin9;
|
|
}
|
|
value = typeof r0 === 'bigint' ? r0 + 1n : +r0 + 1;
|
|
if (value < length) {
|
|
r0 = value;
|
|
r3 = r8;
|
|
continue reducibleLoop3;
|
|
}
|
|
r1 = r8;
|
|
break reducibleJoin10;
|
|
}
|
|
break reducibleJoin10;
|
|
}
|
|
const concat = a0.concat;
|
|
reducibleJoin12: while (true) {
|
|
if (r1) {
|
|
break reducibleJoin12;
|
|
}
|
|
Array = global.Array;
|
|
prototype = Array.prototype;
|
|
slice = prototype.slice;
|
|
call = slice.call;
|
|
value = Reflect.apply(call, slice, [a1]);
|
|
r1 = value;
|
|
break reducibleJoin12;
|
|
}
|
|
return Reflect.apply(concat, a0, [r1]);
|
|
}
|
|
|
|
global.__d(_fun46873, 5271, [31, 27, 33, 5272,
|
|
5273]) /* metro module 5271, dependencies: [31, 27, 33, 5272, 5273] */;
|