/* Metro module 8069; source: modules/frames/native/FramesNativeManager.tsx; dependencies: [6, 7, 15, 17, 102, 18, 5, 27, 8065, 661, 4237, 5269, 478, 8070, 8071, 1216, 8072, 4496, 1244, 1360, 8087, 694, 1239, 491, 10655, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Module00102 from '../../../by-id/module-00102.js'; /* Metro dependency 102 */ import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */ import FramesStore from '../FramesStore.tsx'; /* Metro dependency 8065 */ import FramesActionCreatorsNative from '../FramesActionCreators.native.tsx'; /* Metro dependency 8087 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as ConstantsModule2 from '../../activities/Constants.tsx'; /* Metro dependency 4237 */ import * as Module05269Module from '../../../by-id/module-05269.js'; /* Metro dependency 5269 */ function _fun64051(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:6, offset: 0x01b9a00a, size: 475 bytes, params: 8, frame: 21 var nativeEventEmitter; const env0_0 = require; const postMessageToWebView = function() { return _postMessageToWebView.apply(this, arguments); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const NativeEventEmitter = (ReactNativeModule).NativeEventEmitter; const env0_13 = (Module05269Module).getWebViewProxy('FRAME_WEB_VIEW_KEY'); value = require(478) /* metro dependency 478: PlatformUtils */; value = value.isAndroid(); if (value) { nativeEventEmitter = new NativeEventEmitter(importDefault(8070) /* metro dependency 8070: NativeAppLifecycleModule */); } value = importDefault(10655) /* metro dependency 10655: FramesManager */; value = _fun64061(value); value.displayName = 'FramesNativeManager'; value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/frames/native/FramesNativeManager.tsx'); exports.default = value; exports.FRAME_WEB_VIEW_KEY = 'FRAME_WEB_VIEW_KEY'; function _isNativeReflectConstruct_64052() { // fn#64052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:292, offset: 0x01b9a1e5, size: 94 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_64052_isNativeReflectConstruct = function() { return !!result; })(); } function _superPropGet_64055(a0, a1, a2, a3) { // fn#64055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:485, offset: 0x01b9a243, size: 99 bytes, params: 5, frame: 18 let value = a0; const env0_0 = a2; value = Module00017(1 & 3 ? value.prototype : value); value = Module00102(value, a1, a2); return 2 & 3 ? typeof value !== 'function' ? value : _fun64056 : value; function _fun64056(a0) { // fn#64056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:584, offset: 0x00c62408, size: 27 bytes, params: 2, frame: 13 return env0_1.apply(importDefault, a0); } } function _postMessageToWebView() { // fn#64058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:805, offset: 0x01b9a2a6, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun64060).apply(this, arguments); function* _fun64060(a0) { // fn#64060, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:870, offset: 0x01b9a2df, size: 116 bytes, params: 2, frame: 15 var binding; var injectJavaScript; var binding2; var binding3; var property; var value3; var value4; var value5; var value6; var value7; var error; if (true) { value = environment.__proto__.__proto__; try { binding = env2_13; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { injectJavaScript = binding.injectJavaScript; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { binding2 = env2_1; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { binding3 = env2_2; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { property = binding3[14]; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { value3 = binding2(property); } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { value4 = value3(a0); } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } try { value5 = Reflect.apply(injectJavaScript, binding, [value4]); } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } yield value5; try { value6 = undefined; value7 = false; } catch (error) { binding = env2_1; value = binding(env2_2[15]); value.captureException(error); return undefined; } if (value7) { return value6; } } } } function _fun64061(a0) { // fn#64061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:996, offset: 0x01b9a353, size: 256 bytes, params: 2, frame: 16 const FramesNativeManager2 = FramesNativeManager; Inherits(FramesNativeManager2, a0); return CreateClass(FramesNativeManager2, [{key: '_initialize', value: value_64063}, {key: '_terminate', value: value_64066}, {key: 'showRPCDisconnectErrorUI', value: function({code, message}) { var defaultImport = importDefault(dependencyMap[17]); var object = {}; object.title = require(dependencyMap[18]).intl.formatToPlainString(require(dependencyMap[18]).t.hbiAO6, {code: code}); object.body = message; defaultImport.show(object); }}, {key: 'leaveFrame', value: value_64068}, {key: 'clearFrameState', value: value_64069}, {key: 'releaseWebView', value: value_64070}, {key: 'releaseFrameId', value: function() { var frameId = this.frameId; this.frameId = undefined; return frameId; }}, {key: 'hasFrameId', value: function() { return this.frameId != null; }}, {key: 'getOrCreateFrameId', value: value_64073}]); function FramesNativeManager() { // fn#64062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:1008, offset: 0x010e918b, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_3(this, FramesNativeManager); const value3 = env1_6(FramesNativeManager); return env1_5(this, _isNativeReflectConstruct_64052() ? global.Reflect.construct(value3, arguments, env1_6(this).constructor) : value3.apply(this, arguments)); } function value_64063() { // fn#64063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:1322, offset: 0x01b9a453, size: 166 bytes, params: 1, frame: 21 const _superPropGet_64055Binding = _superPropGet_64055; const value3 = undefined; _superPropGet_64055Binding(FramesNativeManager, '_initialize', this, 3)([]); const lifecycleSubscription = this.lifecycleSubscription; if (lifecycleSubscription != null) { lifecycleSubscription.remove(); } this.lifecycleSubscription = env1_14 == null ? value3 : env1_14.addListener('onHostDestroy', _fun64064); const scriptMessageSubscription = this.scriptMessageSubscription; if (scriptMessageSubscription != null) { scriptMessageSubscription.remove(); } const binding = env1_13; this.scriptMessageSubscription = binding.addOnMessageListener(_fun64065); return value3; function _fun64064() { // fn#64064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:1523, offset: 0x01b9a4f9, size: 56 bytes, params: 1, frame: 12 let value = environment.__proto__.__proto__; value = FramesStore.getConnectedFrame(); if (value != null) { env0_0.leaveFrame({applicationId: value.applicationId}); } } function _fun64065(a0) { // fn#64065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:1725, offset: 0x01b9a531, size: 400 bytes, params: 2, frame: 22 var url; var r8; var applicationId; var JSON; var parse; var data; var value2; var value3; var connectedFrame; var value5; var value6; var value7; var property; var defaultImport; var error; var SyntaxError; var value8; var connectedFrame2; var value10; var binding; var object; var defaultImport2; var show; const intl = require(dependencyMap[18]).intl; var string; const t = require(dependencyMap[18]).t; var tYBBWz; var BddRzS; const value = undefined; try { JSON = global.JSON; parse = JSON.parse; data = a0.data; value2 = Reflect.apply(parse, JSON, [data]); value3 = environment.__proto__.__proto__; connectedFrame = FramesStore.getConnectedFrame(); value5 = connectedFrame == null; url = value5 ? value : connectedFrame.url; value6 = typeof value2 === 'object'; if (value6) { value7 = url != null; r8 = value7; } else { r8 = value6; } if (r8) { property = dependencyMap[16]; defaultImport = importDefault(property); defaultImport.handleMessage(value2, url, postMessageToWebView); } } catch (error) { SyntaxError = global.SyntaxError; if (!(error instanceof SyntaxError)) { throw error; } data = a0.data; value8 = environment.__proto__.__proto__; if (data === DISALLOWED_NAVIGATION_ERROR_CLOSE_ACTIVITY) { connectedFrame2 = FramesStore.getConnectedFrame(); applicationId = connectedFrame2 == null ? value : connectedFrame2.applicationId; if (applicationId != null) { value10 = environment; binding = env0_0; binding.leaveFrame({applicationId: applicationId}); defaultImport2 = importDefault(dependencyMap[17]); show = defaultImport2.show; object = {}; string = intl.string; tYBBWz = t.tYBBWz; object.body = Reflect.apply(string, intl, [tYBBWz]); string = intl.string; BddRzS = t.BddRzS; object.confirmText = Reflect.apply(string, intl, [BddRzS]); Reflect.apply(show, defaultImport2, [object]); } } } return value; } } function value_64066() { // fn#64066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:2202, offset: 0x01b9a6c1, size: 88 bytes, params: 1, frame: 17 const value = environment.__proto__; _superPropGet_64055(FramesNativeManager, '_terminate', this, 3)([]); const lifecycleSubscription = this.lifecycleSubscription; if (lifecycleSubscription != null) { lifecycleSubscription.remove(); } const scriptMessageSubscription = this.scriptMessageSubscription; if (scriptMessageSubscription != null) { scriptMessageSubscription.remove(); } } function value_64068({applicationId}) { // fn#64068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:2571, offset: 0x01b9a790, size: 81 bytes, params: 2, frame: 13 this.releaseWebView(); let value = environment.__proto__; value = require(1360) /* metro dependency 1360: GlobalUtils */; if (value.isNotNullish(applicationId)) { this.clearFrameState({applicationId: applicationId}); } } function value_64069({applicationId}) { // fn#64069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:2719, offset: 0x01b9a7e1, size: 94 bytes, params: 2, frame: 16 const value = environment.__proto__; (FramesActionCreatorsNative).stopFrame({applicationId: applicationId}); (Dispatcher).dispatch({'type': 'FRAME_SET_ORIENTATION_LOCK_STATE', 'applicationId': null, 'lockState': null, 'pictureInPictureLockState': null, applicationId: applicationId}); } function value_64070() { // fn#64070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:2938, offset: 0x01b9a83f, size: 93 bytes, params: 1, frame: 16 var value2; var ComponentDispatch; const value = this.releaseFrameId(); if (value != null) { value2 = environment.__proto__; ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch; ComponentDispatch.dispatch(ComponentActions.IFRAME_UNMOUNT, {id: value}); env1_13.releaseWebView(); } return value; } function value_64073() { // fn#64073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8247:3264, offset: 0x01b9a8c0, size: 60 bytes, params: 1, frame: 13 const frameId = this.frameId; if (frameId != null) { return frameId; } let value = environment.__proto__; value = require(491) /* metro dependency 491 */; value = value.v4(); this.frameId = value; return value; } } } global.__d(_fun64051, 8069, [6, 7, 15, 17, 102, 18, 5, 27, 8065, 661, 4237, 5269, 478, 8070, 8071, 1216, 8072, 4496, 1244, 1360, 8087, 694, 1239, 491, 10655, 2]) /* metro module 8069, dependencies: [6, 7, 15, 17, 102, 18, 5, 27, 8065, 661, 4237, 5269, 478, 8070, 8071, 1216, 8072, 4496, 1244, 1360, 8087, 694, 1239, 491, 10655, 2] */;