925 lines
38 KiB
TypeScript
925 lines
38 KiB
TypeScript
/* Metro module 10709; source: modules/activities/native/EmbeddedActivityWebView.tsx; dependencies: [5, 57, 31, 27, 7503, 4237, 661, 33, 4501, 3, 477, 10710, 491, 5269, 1239, 10711, 1582, 10713, 10714, 683, 632, 4647, 1244, 507, 10715, 1471, 8071, 8072, 6266, 7712, 8092, 2] */
|
|
function _fun82275(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:6, offset: 0x01ef180a, size: 458 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_82278 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const getSafeArea = function(a0, a1) {
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var value2;
|
|
var value = a1;
|
|
if (a0 == null) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = 0;
|
|
if (a0.disable) {
|
|
r1 = value2;
|
|
} else {
|
|
if (a0.override != null) {
|
|
r2 = global.Math.max(value2, a0.override);
|
|
} else if (a0.offset == null) {
|
|
r2 = value;
|
|
} else {
|
|
value = global.Math.max(value2, value + a0.offset);
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
};
|
|
const closure = BaseActivityWebView;
|
|
const closure2 = useHasInvalidUrlErrorState;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_5 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_6 = importAll(31) /* metro dependency 31 */;
|
|
const env0_7 = (require(27) /* metro dependency 27 */).Linking;
|
|
const developerActivityShelfStore = importDefault(7503) /* metro dependency 7503: DeveloperActivityShelfStore */;
|
|
let value = require(4237) /* metro dependency 4237: Constants */;
|
|
const env0_9 = value.ActivityPlatform;
|
|
const env0_10 = value.DISALLOWED_NAVIGATION_ERROR_CLOSE_ACTIVITY;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.ComponentActions;
|
|
const env0_12 = value.AnalyticEvents;
|
|
const env0_13 = (require(33) /* metro dependency 33 */).jsx;
|
|
const env0_14 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({webView: {backgroundColor: 'transparent'}});
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('EmbeddedActivityWebView');
|
|
const env0_16 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/native/EmbeddedActivityWebView.tsx');
|
|
exports.default = EmbeddedActivityWebView;
|
|
exports.BaseActivityWebView = closure;
|
|
exports.useHasInvalidUrlErrorState = closure2;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_82276(a0, a1) { // fn#82276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:305, offset: 0x01ef19d4, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun82277;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_82278(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_82278(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_82278(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun82277;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function BaseActivityWebView({hasFrameId, getOrCreateFrameId, releaseFrameId, hasInvalidUrlError, setHasInvalidUrlError, hadInvalidUrlError, deepLinkQueryParams = {}, activityUrl, applicationId, queryParams, onActivityCrash, onLoadError, allowPopups, referrerPolicy, isPipOrGridMode, webViewKey, ignoreSilentHardwareSwitch, safeAreasConfig, channelId, guildId, activitySessionId}) { // fn#82280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:1483, offset: 0x01ef1bbb, size: 2206 bytes, params: 2, frame: 50
|
|
var r1;
|
|
var WebView;
|
|
const env0_5 = hadInvalidUrlError;
|
|
let value = undefined;
|
|
const env0_6 = applicationId;
|
|
ignoreSilentHardwareSwitch = ignoreSilentHardwareSwitch === value || ignoreSilentHardwareSwitch;
|
|
const styles = useStyles();
|
|
let binding = env0_6;
|
|
const useContext = binding.useContext;
|
|
const WebViewContext = (require(10710) /* metro dependency 10710: WebViewContext */).WebViewContext;
|
|
const value4 = Reflect.apply(useContext, binding, [WebViewContext]);
|
|
var property = env0_5(env0_6.useState(function() {
|
|
return hasFrameId();
|
|
}), 1)[0];
|
|
const env0_16 = property;
|
|
const property2 = env0_5(env0_6.useState(_fun82282), 1)[0];
|
|
const [property3, env0_19] = env0_5(env0_6.useState(null), 2);
|
|
const value12 = env0_6.useMemo(_fun82283, [webViewKey]);
|
|
const [property4, env0_21] = env0_5(env0_6.useState(null), 2);
|
|
env0_6.useEffect(_fun82284, [property, property2, webViewKey]);
|
|
env0_6.useEffect(function() {
|
|
return _fun82286;
|
|
}, [webViewKey, property2]);
|
|
const value15 = (importDefault(10711) /* metro dependency 10711: useStableSafeAreaInsetsNative */)();
|
|
const constants = (importAll(1582) /* metro dependency 1582: ClientInfoUtils */).getConstants();
|
|
let object2 = {};
|
|
copyDataProperties(object2, queryParams, undefined);
|
|
copyDataProperties(object2, deepLinkQueryParams, undefined);
|
|
object2['frame_id'] = property2;
|
|
const MOBILE = ActivityPlatform.MOBILE;
|
|
object2['platform'] = MOBILE;
|
|
const Version = constants.Version;
|
|
object2['mobile_app_version'] = Version;
|
|
const value17 = (importDefault(10713) /* metro dependency 10713: getIFrameSandboxAttributes */)({allowPopups: allowPopups});
|
|
const URLSearchParams = global.URLSearchParams;
|
|
const value18 = Object.create(URLSearchParams.prototype, {constructor: {value: URLSearchParams}});
|
|
const uRLSearchParams = new URLSearchParams(object2);
|
|
const value20 = '' + activityUrl + '?' + (uRLSearchParams instanceof Object ? uRLSearchParams : value18);
|
|
const env0_25 = env0_6.useRef(safeAreasConfig);
|
|
env0_6.useEffect(function() {
|
|
_fun82288()();
|
|
}, [value20, value17, onLoadError, referrerPolicy]);
|
|
const value21 = env0_6.useCallback(_fun82292, [applicationId]);
|
|
const value22 = env0_6.useCallback(_fun82293, [applicationId]);
|
|
const value23 = env0_6.useCallback(_fun82294, [applicationId, channelId, guildId, activitySessionId, property2,
|
|
releaseFrameId, value12, onActivityCrash]);
|
|
const useActivityUrlOverride = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([DeveloperActivityShelfStore],
|
|
function() {
|
|
return DeveloperActivityShelfStore.getUseActivityUrlOverride();
|
|
});
|
|
env0_6.useEffect(_fun82296, [value20, useActivityUrlOverride, setHasInvalidUrlError]);
|
|
env0_6.useEffect(_fun82297, [hadInvalidUrlError, hasInvalidUrlError]);
|
|
let r24 = property3 != null ? env0_16 ? 'file://' + property4 : '' + property3.origin + '/' + property2 + '/activity.html' : null;
|
|
binding = env0_16;
|
|
var [property, env0_29] = env0_5(env0_6.useState(false), 2);
|
|
const [property5, env0_31] = env0_5(env0_6.useState([]), 2);
|
|
env0_6.useEffect(_fun82298, [applicationId, binding]);
|
|
const value30 = env0_6.useCallback(_fun82306, [r24, property5]);
|
|
const r32 = r24 != null && property3 != null && property4 != null;
|
|
const value34 = env0_6.useRef(null);
|
|
const value35 = env0_6.useCallback(_fun82307, []);
|
|
const value36 = env0_6.useCallback(_fun82308, [webViewKey, property3 == null ? value : property3.origin, value35]);
|
|
env0_6.useEffect(_fun82309, [value15, isPipOrGridMode, r32, value12, value35, safeAreasConfig]);
|
|
if (r24 == null) {
|
|
return null;
|
|
}
|
|
if (property3 == null) {
|
|
return null;
|
|
}
|
|
if (binding) {
|
|
if (property === false) {
|
|
return null;
|
|
}
|
|
}
|
|
object2 = {left: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.left,
|
|
(value15 == null ? value : value15.left) ?? 0),
|
|
right: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.right,
|
|
(value15 == null ? value : value15.right) ?? 0),
|
|
top: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.top,
|
|
(value15 == null ? value : value15.top) ?? 0),
|
|
bottom: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.bottom,
|
|
(value15 == null ? value : value15.bottom) ?? 0)};
|
|
if (property4 == null) {
|
|
r1 = null;
|
|
} else {
|
|
WebView = (require(5269) /* metro dependency 5269 */).WebView;
|
|
var webViewProps = {style: styles.webView, ref: value34, source: {uri: r24}};
|
|
r24 = property3.port === '' ? property3.host : '' + property3.hostname + ':' + property3.port;
|
|
webViewProps.androidAssetLoaderConfig = {domain: r24, httpAllowed: property3.protocol === 'http:',
|
|
pathHandlers: [{type: 'internal', path: '/' + property2 + '/', directory: property4.substring(0,
|
|
property4.lastIndexOf('/'))}]};
|
|
webViewProps.originWhitelist = ['*'];
|
|
webViewProps.overScrollMode = 'never';
|
|
webViewProps.scrollEnabled = false;
|
|
webViewProps.cacheEnabled = true;
|
|
webViewProps.onError = value21;
|
|
webViewProps.onContentProcessDidTerminate = value23;
|
|
webViewProps.onRenderProcessGone = value22;
|
|
webViewProps.webViewKey = webViewKey;
|
|
webViewProps.temporaryParentNodeTag = value4;
|
|
webViewProps.messagingWithWebViewKeyEnabled = webViewKey != null;
|
|
webViewProps.onMessage = value36;
|
|
webViewProps.allowFileAccess = env0_16;
|
|
webViewProps.injectedJavaScript = env0_16 ? (require(10714) /* metro dependency 10714: createWebviewHtmlFile */).createInjectedJavascriptForIOS(webViewProps) : value;
|
|
webViewProps.injectedJavaScriptForMainFrameOnly = false;
|
|
webViewProps.onShouldStartLoadWithRequest = env0_16 ? value30 : value;
|
|
webViewProps.mediaPlaybackRequiresUserAction = false;
|
|
webViewProps.ignoreSilentHardwareSwitch = ignoreSilentHardwareSwitch;
|
|
webViewProps.allowsInlineMediaPlayback = true;
|
|
webViewProps.minimumFontSize = 1;
|
|
webViewProps.bounces = false;
|
|
webViewProps.allowsProtectedMedia = true;
|
|
value = <WebView {...webViewProps} />;
|
|
r1 = value;
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function useHasInvalidUrlErrorState() { // fn#82314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:7586, offset: 0x01ef308d, size: 91 bytes, params: 1, frame: 15
|
|
const value3 = env0_5(env0_6.useState(false), 2);
|
|
const property = value3[0];
|
|
const object2 = {hasInvalidUrlError: property, setHasInvalidUrlError: value3[1]};
|
|
object2.hadInvalidUrlError = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property);
|
|
return object2;
|
|
}
|
|
|
|
function EmbeddedActivityWebView(a0) { // fn#82315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:7754, offset: 0x01ef30e8, size: 293 bytes, params: 2, frame: 25
|
|
const channelId = a0.channelId;
|
|
const currentEmbeddedActivity = a0.currentEmbeddedActivity;
|
|
const applicationId = a0.applicationId;
|
|
const object3 = {'channelId': 0, 'currentEmbeddedActivity': 0, 'applicationId': 0};
|
|
silentSetPrototypeOf(object3, null, undefined);
|
|
const value = copyDataProperties({}, a0, object3, undefined);
|
|
const {hasInvalidUrlError, setHasInvalidUrlError, hadInvalidUrlError} = useHasInvalidUrlErrorState();
|
|
const object4 = {};
|
|
if (currentEmbeddedActivity != null) {
|
|
if (currentEmbeddedActivity.customId != null) {
|
|
object4.custom_id = currentEmbeddedActivity.customId;
|
|
}
|
|
if (currentEmbeddedActivity.referrerId != null) {
|
|
object4.referrer_id = currentEmbeddedActivity.referrerId;
|
|
}
|
|
}
|
|
env0_6.useEffect(_fun82316, [hasInvalidUrlError, hadInvalidUrlError, channelId, applicationId,
|
|
currentEmbeddedActivity]);
|
|
return (
|
|
<BaseActivityWebView
|
|
hasFrameId={hasFrameId}
|
|
getOrCreateFrameId={getOrCreateFrameId}
|
|
releaseFrameId={releaseFrameId}
|
|
hasInvalidUrlError={hasInvalidUrlError}
|
|
setHasInvalidUrlError={setHasInvalidUrlError}
|
|
hadInvalidUrlError={hadInvalidUrlError}
|
|
deepLinkQueryParams={object4}
|
|
applicationId={applicationId}
|
|
channelId={channelId}
|
|
{...value}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun82282() { // fn#82282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:1996, offset: 0x01ef2459, size: 62 bytes, params: 1, frame: 12
|
|
var r0;
|
|
var value;
|
|
if (webViewKey != null) {
|
|
r0 = getOrCreateFrameId();
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = require(491) /* metro dependency 491 */;
|
|
value = value.v4();
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun82283() { // fn#82283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2096, offset: 0x01ef2497, size: 60 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var value3;
|
|
var moduleValue;
|
|
if (webViewKey != null) {
|
|
value3 = environment.__proto__;
|
|
moduleValue = require(5269) /* metro dependency 5269 */;
|
|
r0 = moduleValue.getWebViewProxy(webViewKey);
|
|
} else {
|
|
r0 = undefined;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun82284() { // fn#82284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2210, offset: 0x01ef24d3, size: 89 bytes, params: 1, frame: 14
|
|
var value3;
|
|
var ComponentDispatch;
|
|
if (!(env0_16 && webViewKey != null)) {
|
|
value3 = environment.__proto__;
|
|
ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
ComponentDispatch.dispatch(ComponentActions.IFRAME_MOUNT, {id: env0_17});
|
|
}
|
|
}
|
|
|
|
function _fun82285() { // fn#82285, offset: 0x01ef252c, size: 11 bytes, params: 1, frame: 1
|
|
return _fun82286;
|
|
}
|
|
|
|
function _fun82287() { // fn#82287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2614, offset: 0x01ef2586, size: 21 bytes, params: 1, frame: 9
|
|
_fun82288()();
|
|
}
|
|
|
|
function _fun82292({nativeEvent}) { // fn#82292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3282, offset: 0x01ef2756, size: 86 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__;
|
|
const binding = env1_15;
|
|
const warn = binding.warn;
|
|
const applicationIdBinding = applicationId;
|
|
const JSON = global.JSON;
|
|
Reflect.apply(warn, binding,
|
|
['activity WebView error for appId ' + applicationIdBinding + '. ' + JSON.stringify(nativeEvent)]);
|
|
}
|
|
|
|
function _fun82293({nativeEvent}) { // fn#82293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3401, offset: 0x01ef27ac, size: 86 bytes, params: 2, frame: 17
|
|
const value = environment.__proto__;
|
|
const binding = env1_15;
|
|
const warn = binding.warn;
|
|
const applicationIdBinding = applicationId;
|
|
const JSON = global.JSON;
|
|
Reflect.apply(warn, binding,
|
|
['activity WebView render process gone for appId ' + applicationIdBinding + '. ' + JSON.stringify(nativeEvent)]);
|
|
}
|
|
|
|
function _fun82294() { // fn#82294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3534, offset: 0x01ef2802, size: 218 bytes, params: 1, frame: 18
|
|
const binding = env1_15;
|
|
const warn = binding.warn;
|
|
const applicationIdBinding = applicationId;
|
|
Reflect.apply(warn, binding, ['activity WebView content process terminated for appId ' + applicationIdBinding]);
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED = AnalyticEvents.ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED;
|
|
Reflect.apply(track, defaultImport, [ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED,
|
|
{application_id: applicationIdBinding, channel_id: channelId, guild_id: guildId,
|
|
activity_session_id: activitySessionId}]);
|
|
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
const dispatch = ComponentDispatch.dispatch;
|
|
const IFRAME_UNMOUNT = ComponentActions.IFRAME_UNMOUNT;
|
|
Reflect.apply(dispatch, ComponentDispatch, [IFRAME_UNMOUNT, {id: env0_17}]);
|
|
releaseFrameId();
|
|
if (env0_20 != null) {
|
|
env0_20.releaseWebView();
|
|
}
|
|
onActivityCrash();
|
|
}
|
|
|
|
function _fun82296() { // fn#82296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3941, offset: 0x01ef28ef, size: 79 bytes, params: 1, frame: 13
|
|
var URL;
|
|
var value;
|
|
var binding;
|
|
var prototype;
|
|
var value2;
|
|
var uRL;
|
|
var value3;
|
|
var error;
|
|
try {
|
|
URL = global.URL;
|
|
value = environment;
|
|
binding = env0_24;
|
|
prototype = URL.prototype;
|
|
value2 = Object.create(prototype, {constructor: {value: URL}});
|
|
uRL = new URL();
|
|
value3 = uRL instanceof Object ? uRL : value2;
|
|
binding = env0_19;
|
|
binding(value3);
|
|
} catch (error) {
|
|
value = environment;
|
|
if (!useActivityUrlOverride) {
|
|
throw error;
|
|
}
|
|
setHasInvalidUrlError(true);
|
|
}
|
|
}
|
|
|
|
function _fun82297() { // fn#82297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4030, offset: 0x01ef293e, size: 219 bytes, params: 1, frame: 18
|
|
var defaultImport;
|
|
var show;
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (!hadInvalidUrlError && hasInvalidUrlError) {
|
|
value = environment.__proto__;
|
|
defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
show = defaultImport.show;
|
|
object2 = {};
|
|
object2.title = intl.string(t.PtobXW);
|
|
object2.body = intl.string(t['55iAUT']);
|
|
object2.confirmText = intl.string(t.BddRzS);
|
|
Reflect.apply(show, defaultImport, [object2]);
|
|
}
|
|
}
|
|
|
|
function _fun82298() { // fn#82298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4412, offset: 0x01ef2a19, size: 58 bytes, params: 1, frame: 9
|
|
if (env0_28) {
|
|
var env0_0 = ["'self'"];
|
|
var parseCsp = function(a0, a1) {
|
|
var r0;
|
|
var value = a1.match(a0);
|
|
if (value === null) {
|
|
r0 = [];
|
|
} else if (value.length >= 2) {
|
|
value = value[1].split(' ');
|
|
value = value.filter(_fun82300);
|
|
r0 = value;
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
return r0;
|
|
};
|
|
_fun82301()();
|
|
}
|
|
}
|
|
|
|
function _fun82306(a0) { // fn#82306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4997, offset: 0x01ef2c69, size: 310 bytes, params: 2, frame: 18
|
|
var r3;
|
|
var r1;
|
|
var value4;
|
|
var RegExp;
|
|
var prototype;
|
|
var value5;
|
|
var regExp;
|
|
var value6;
|
|
var test;
|
|
var url;
|
|
var value7;
|
|
var value12;
|
|
var origin;
|
|
var pathname;
|
|
const mainDocumentURL = a0.mainDocumentURL;
|
|
var value;
|
|
if (env0_27 != null) {
|
|
reducibleJoin3: while (true) {
|
|
if (mainDocumentURL == null) {
|
|
break reducibleJoin3;
|
|
}
|
|
if (mainDocumentURL !== env0_27) {
|
|
value = environment.__proto__;
|
|
Linking.openURL(a0.url);
|
|
return false;
|
|
}
|
|
break reducibleJoin3;
|
|
}
|
|
}
|
|
value = _createForOfIteratorHelperLoose_82276(env0_30);
|
|
const value3 = value();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
r3 = value3;
|
|
reducibleLoop4: while (true) {
|
|
value4 = r3.value;
|
|
RegExp = global.RegExp;
|
|
prototype = RegExp.prototype;
|
|
value5 = Object.create(prototype, {constructor: {value: RegExp}});
|
|
regExp = new RegExp();
|
|
value6 = regExp instanceof Object ? regExp : value5;
|
|
test = value6.test;
|
|
url = a0.url;
|
|
if (Reflect.apply(test, value6, [url])) {
|
|
return true;
|
|
}
|
|
value7 = value();
|
|
done = value7.done;
|
|
if (done) {
|
|
break reducibleLoop4;
|
|
}
|
|
r3 = value7;
|
|
continue reducibleLoop4;
|
|
}
|
|
}
|
|
value = Reflect.apply((importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe, value,
|
|
[DeveloperActivityShelfStore.getActivityUrlOverride() ?? '']);
|
|
const defaultImport = importDefault(1471) /* metro dependency 1471: URLUtils */;
|
|
const value10 = defaultImport.toURLSafe(a0.url);
|
|
const value11 = value != null;
|
|
reducibleJoin10: while (true) {
|
|
if (value11) {
|
|
value12 = value10 != null;
|
|
r1 = value12;
|
|
break reducibleJoin10;
|
|
}
|
|
r1 = value11;
|
|
break reducibleJoin10;
|
|
}
|
|
reducibleJoin12: while (true) {
|
|
if (r1) {
|
|
origin = value.origin;
|
|
pathname = value.pathname;
|
|
value = origin + pathname;
|
|
origin = value10.origin;
|
|
pathname = value10.pathname;
|
|
value = value === origin + pathname;
|
|
r1 = value;
|
|
break reducibleJoin12;
|
|
}
|
|
break reducibleJoin12;
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function _fun82307(a0) { // fn#82307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5440, offset: 0x01ef2d9f, size: 66 bytes, params: 2, frame: 13
|
|
var injectJavaScript;
|
|
var value;
|
|
const current = env0_33.current;
|
|
if (current != null) {
|
|
injectJavaScript = current.injectJavaScript;
|
|
value = environment.__proto__;
|
|
value = importDefault(8071) /* metro dependency 8071: getPostMessageJavaScript */;
|
|
Reflect.apply(injectJavaScript, current, [value(a0)]);
|
|
}
|
|
}
|
|
|
|
function _fun82308(a0) { // fn#82308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5528, offset: 0x01ef2de1, size: 160 bytes, params: 2, frame: 17
|
|
var JSON;
|
|
var value2;
|
|
var value6;
|
|
var value7;
|
|
var defaultImport;
|
|
if (webViewKey == null) {
|
|
JSON = global.JSON;
|
|
value2 = JSON.parse(a0.nativeEvent.data);
|
|
if (typeof value2 === 'object' && env0_18?.origin != null) {
|
|
value6 = environment.__proto__;
|
|
value7 = undefined;
|
|
defaultImport = importDefault(8072) /* metro dependency 8072: WebViewPostMessageTransport */;
|
|
defaultImport.handleMessage(value2, env0_18 == null ? value7 : env0_18.origin, env0_34);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun82309() { // fn#82309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5738, offset: 0x01ef2e81, size: 43 bytes, params: 1, frame: 9
|
|
if (env0_32) {
|
|
if (env0_20 != null) {
|
|
_fun82310()();
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun82316() { // fn#82316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8084, offset: 0x01ef320d, size: 155 bytes, params: 1, frame: 16
|
|
var value3;
|
|
var defaultImport;
|
|
var value4;
|
|
if (!hadInvalidUrlError && hasInvalidUrlError) {
|
|
if (channelId != null) {
|
|
value3 = environment.__proto__;
|
|
defaultImport = importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */;
|
|
defaultImport.selectParticipant(channelId, null);
|
|
}
|
|
value4 = environment.__proto__;
|
|
(importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).leaveActivity({location: currentEmbeddedActivity?.location,
|
|
|
|
applicationId: applicationId, showFeedback: false});
|
|
}
|
|
}
|
|
|
|
function EmbeddedActivityWebViewHasFrameId() { // fn#82317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8284, owner: EmbeddedActivityWebView.hasFrameId, offset: 0x01ef32a8, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).hasFrameId();
|
|
}
|
|
|
|
function EmbeddedActivityWebViewGetOrCreateFrameId() { // fn#82318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8329, owner: EmbeddedActivityWebView.getOrCreateFrameId, offset: 0x01ef32cd, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).getOrCreateFrameId();
|
|
}
|
|
|
|
function EmbeddedActivityWebViewReleaseFrameId() { // fn#82319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8378, owner: EmbeddedActivityWebView.releaseFrameId, offset: 0x01ef32f2, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).releaseFrameId();
|
|
}
|
|
|
|
function _fun82286() { // fn#82286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2315, offset: 0x01ef2537, size: 79 bytes, params: 1, frame: 14
|
|
var value2;
|
|
var ComponentDispatch;
|
|
if (webViewKey == null) {
|
|
value2 = environment.__proto__.__proto__;
|
|
ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
|
|
ComponentDispatch.dispatch(ComponentActions.IFRAME_UNMOUNT, {id: env1_17});
|
|
}
|
|
}
|
|
|
|
function _fun82288() { // fn#82288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2625, offset: 0x01ef259b, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env2_4(_fun82290);
|
|
return _fun82291;
|
|
}
|
|
|
|
function parseCsp(a0, a1) { // fn#82299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4450, offset: 0x01ef2a53, size: 85 bytes, params: 3, frame: 12
|
|
var r0;
|
|
let value = a1.match(a0);
|
|
if (value === null) {
|
|
r0 = [];
|
|
} else if (value.length >= 2) {
|
|
value = value[1].split(' ');
|
|
value = value.filter(_fun82300);
|
|
r0 = value;
|
|
} else {
|
|
r0 = [];
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun82301() { // fn#82301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4554, offset: 0x01ef2ac1, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env2_4(_fun82303);
|
|
return _fun82305;
|
|
}
|
|
|
|
function _fun82310() { // fn#82310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5765, offset: 0x01ef2eac, size: 36 bytes, params: 1, frame: 12
|
|
const env0_0 = env2_4(_fun82312);
|
|
return _fun82313;
|
|
}
|
|
|
|
function* _fun82290() { // fn#82290, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2645, offset: 0x01ef25ca, size: 396 bytes, params: 1, frame: 23
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
let binding = env4_0;
|
|
const value3 = undefined;
|
|
const stableSafeAreaInsets = binding(env4_3[15]).getStableSafeAreaInsets();
|
|
const current = env3_25.current;
|
|
const object2 = {};
|
|
binding = env4_19;
|
|
const left = current == null ? value3 : current.left;
|
|
const left2 = stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.left;
|
|
const value7 = 0;
|
|
object2.left = binding(left, left2 ?? value7);
|
|
object2.right = env4_19(current == null ? value3 : current.right,
|
|
(stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.right) ?? value7);
|
|
object2.top = env4_19(current == null ? value3 : current.top,
|
|
(stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.top) ?? value7);
|
|
object2.bottom = env4_19(current == null ? value3 : current.bottom,
|
|
(stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.bottom) ?? value7);
|
|
yield env4_1(env4_3[18])({iFrameUri: env3_24, iFrameSandboxAttributes: env3_23, referrerPolicy: ActivityPlatform,
|
|
insets: object2, messageForDisallowedNavigationError: env4_16 ? value3 : env4_10});
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (value != null) {
|
|
useHasInvalidUrlErrorState(value);
|
|
} else {
|
|
DeveloperActivityShelfStore();
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
function _fun82300(a0) { // fn#82300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4528, offset: 0x01ef2aa8, size: 25 bytes, params: 2, frame: 11
|
|
const binding = env1_0;
|
|
return !binding.includes(a0);
|
|
}
|
|
|
|
function* _fun82303() { // fn#82303, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4574, offset: 0x01ef2af0, size: 289 bytes, params: 1, frame: 20
|
|
var environment;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var binding = env3_6;
|
|
var HermesInternal = global.HermesInternal;
|
|
var concat = HermesInternal.concat;
|
|
var value3 = 'https://' + binding + '.' + 'discordsays.com';
|
|
var HTTP = env4_0(env4_3[23]).HTTP;
|
|
var get = HTTP.get;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
yield Reflect.apply(get, HTTP, [{url: '' + value3 + '/.discord/csp', rejectWithError: false}]);
|
|
var value5 = undefined;
|
|
if (false) {
|
|
return value5;
|
|
}
|
|
var property = value5.headers['content-security-policy'];
|
|
items = ['about:blank', 'file://*'];
|
|
items[2] = value3;
|
|
arraySpread(items, getOrCreateFrameId(RegExp('child-src (.*?);', ''), property), arraySpread(items,
|
|
getOrCreateFrameId(RegExp('frame-src (.*?);', ''), property), 3, concat), concat);
|
|
env3_31(items.map(_fun82304));
|
|
env3_29(true);
|
|
}
|
|
}
|
|
|
|
function* _fun82312() { // fn#82312, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5785, offset: 0x01ef2edb, size: 434 bytes, params: 1, frame: 25
|
|
var left;
|
|
var left2;
|
|
var right;
|
|
var right2;
|
|
var top;
|
|
var top2;
|
|
var bottom;
|
|
var bottom2;
|
|
var left3;
|
|
var right3;
|
|
var top3;
|
|
var bottom3;
|
|
var injectJavaScript;
|
|
var binding2;
|
|
var property;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var value9;
|
|
var value10;
|
|
var error;
|
|
var current;
|
|
var binding3;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
const r13 = DISALLOWED_NAVIGATION_ERROR_CLOSE_ACTIVITY ? {'top': 0, 'bottom': 0, 'left': 0, 'right': 0} : env3_22;
|
|
const object2 = {type: 'safeAreaUpdateEvent'};
|
|
const object4 = {};
|
|
let binding = env4_19;
|
|
reducibleJoin6: while (true) {
|
|
if (AnalyticEvents == null) {
|
|
left = value;
|
|
break reducibleJoin6;
|
|
}
|
|
left = AnalyticEvents.left;
|
|
break reducibleJoin6;
|
|
}
|
|
reducibleJoin8: while (true) {
|
|
if (r13 == null) {
|
|
left2 = value;
|
|
break reducibleJoin8;
|
|
}
|
|
left3 = r13.left;
|
|
left2 = left3;
|
|
break reducibleJoin8;
|
|
}
|
|
const value5 = 0;
|
|
object4.left = binding(left, left2 ?? value5);
|
|
binding = env4_19;
|
|
reducibleJoin11: while (true) {
|
|
if (AnalyticEvents == null) {
|
|
right = value;
|
|
break reducibleJoin11;
|
|
}
|
|
right = AnalyticEvents.right;
|
|
break reducibleJoin11;
|
|
}
|
|
reducibleJoin13: while (true) {
|
|
if (r13 == null) {
|
|
right2 = value;
|
|
break reducibleJoin13;
|
|
}
|
|
right3 = r13.right;
|
|
right2 = right3;
|
|
break reducibleJoin13;
|
|
}
|
|
object4.right = binding(right, right2 ?? value5);
|
|
binding = env4_19;
|
|
reducibleJoin16: while (true) {
|
|
if (AnalyticEvents == null) {
|
|
top = value;
|
|
break reducibleJoin16;
|
|
}
|
|
top = AnalyticEvents.top;
|
|
break reducibleJoin16;
|
|
}
|
|
reducibleJoin18: while (true) {
|
|
if (r13 == null) {
|
|
top2 = value;
|
|
break reducibleJoin18;
|
|
}
|
|
top3 = r13.top;
|
|
top2 = top3;
|
|
break reducibleJoin18;
|
|
}
|
|
object4.top = binding(top, top2 ?? value5);
|
|
binding = env4_19;
|
|
reducibleJoin21: while (true) {
|
|
if (AnalyticEvents == null) {
|
|
bottom = value;
|
|
break reducibleJoin21;
|
|
}
|
|
bottom = AnalyticEvents.bottom;
|
|
break reducibleJoin21;
|
|
}
|
|
reducibleJoin23: while (true) {
|
|
if (r13 == null) {
|
|
bottom2 = value;
|
|
break reducibleJoin23;
|
|
}
|
|
bottom3 = r13.bottom;
|
|
bottom2 = bottom3;
|
|
break reducibleJoin23;
|
|
}
|
|
object4.bottom = binding(bottom, bottom2 ?? value5);
|
|
object2.data = {insets: object4};
|
|
reducibleJoin26: while (true) {
|
|
reduciblePort41: while (true) {
|
|
exceptionLanding39: while (true) {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
break reducibleJoin26;
|
|
}
|
|
current = env3_33.current;
|
|
reducibleJoin41: while (true) {
|
|
if (current == null) {
|
|
break reducibleJoin41;
|
|
}
|
|
binding = env3_34;
|
|
binding3 = env4_1;
|
|
binding(binding3(env4_3[26])(object2));
|
|
break reducibleJoin41;
|
|
}
|
|
break reduciblePort41;
|
|
}
|
|
return value;
|
|
}
|
|
try {
|
|
injectJavaScript = BaseActivityWebView.injectJavaScript;
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
binding = env4_1;
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
binding2 = env4_3;
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
property = binding2[26];
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
value6 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
value7 = value6(object2);
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
try {
|
|
value8 = Reflect.apply(injectJavaScript, BaseActivityWebView, [value7]);
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
yield value8;
|
|
try {
|
|
value9 = undefined;
|
|
value10 = false;
|
|
} catch (error) {
|
|
break exceptionLanding39;
|
|
}
|
|
return value10 ? value9 : value;
|
|
}
|
|
|
|
function _fun82304(a0) { // fn#82304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4851, offset: 0x01ef2c11, size: 88 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__;
|
|
value = env5_1(env5_3[24]);
|
|
value = value(a0);
|
|
value = value.replace(RegExp('\\\\\\*', 'g'), '.*');
|
|
return '^' + value;
|
|
}
|
|
|