/* Metro module 15214; source: components_native/channel_settings/ChannelSettingsChangeRTCRegion.tsx; dependencies: [862, 6, 7, 15, 17, 18, 31, 1379, 15173, 33, 4501, 697, 1244, 8148, 7987, 7988, 7972, 3868, 566, 44, 2] */ 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 Module00044 from '../../by-id/module-00044.js'; /* Metro dependency 44 */ import Native from '../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import Module00862 from '../../by-id/module-00862.js'; /* Metro dependency 862 */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import RegionStore from '../../stores/RegionStore.tsx'; /* Metro dependency 15173 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as NativeModule from '../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as CreateStylesModule from '../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as NativeModule2 from '../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */ import * as TableRadioRowNativeModule from '../../design/components/TableRow/native/TableRadioRow.native.tsx'; /* Metro dependency 7987 */ import * as TableRadioGroupNativeModule from '../../design/components/TableRow/native/TableRadioGroup.native.tsx'; /* Metro dependency 7988 */ function _fun116390(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:6, offset: 0x02487519, size: 409 bytes, params: 8, frame: 23 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; const object2 = {}; const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER; object2.backgroundColor = BACKGROUND_BASE_LOWER; const PX_16 = (Native).space.PX_16; object2.paddingHorizontal = PX_16; const env0_12 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [{form: object2}]); const PureComponent = value.PureComponent; value = _fun116394(PureComponent); const ThemeContext = (NativeModule).ThemeContext; value.contextType = ThemeContext; (FileImportTrackerModule).fileFinishedImporting('components_native/channel_settings/ChannelSettingsChangeRTCRegion.tsx'); exports.default = ConnectedChannelSettingsChangeRTCRegion; function _isNativeReflectConstruct_116391() { // fn#116391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:202, offset: 0x024876b2, 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_116391_isNativeReflectConstruct = function() { return !!result; })(); } function _fun116394(a0) { // fn#116394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:573, offset: 0x02487714, size: 153 bytes, params: 2, frame: 16 const ChannelSettingsChangeRTCRegion2 = ChannelSettingsChangeRTCRegion; Inherits(ChannelSettingsChangeRTCRegion2, a0); return CreateClass(ChannelSettingsChangeRTCRegion2, [{key: 'handleSetRegion', value: value_116399}, {key: 'renderRegion', value: value_116401}, {key: 'renderRegions', value: value_116402}, {key: 'render', value: value_116404}]); function ChannelSettingsChangeRTCRegion(a0) { // fn#116395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:585, offset: 0x024877ad, size: 149 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_4; binding(this, ChannelSettingsChangeRTCRegion); const items2 = []; arraySpread(items2, value, 0, items2); value = env1_7(ChannelSettingsChangeRTCRegion); binding = env1_6; if (_isNativeReflectConstruct_116391()) { Reflect = global.Reflect; value = Reflect.construct(value, items2, env1_7(this).constructor); r0 = value; } else { value = value.apply(this, items2); r0 = value; } value = binding(this, r0); value.state = _fun116396(); return value; function _fun116396() { // fn#116396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:870, offset: 0x02487842, size: 272 bytes, params: 1, frame: 21 var push; var value6; var items2; var value7; const object = {'regions': null, 'submitting': false, 'selectedRegionId': 'AUTOMATIC_RTC_REGION'}; object.regions = []; const value = 'AUTOMATIC_RTC_REGION'; const regionStoreBinding = RegionStore; const getRegions = regionStoreBinding.getRegions; const channel = env0_0.props.channel; const getGuildId = channel.getGuildId; const value4 = Reflect.apply(getRegions, regionStoreBinding, [Reflect.apply(getGuildId, channel, [])]); const value5 = undefined; const intl = require(dependencyMap[12]).intl; const string = intl.string; const JEmsap = require(dependencyMap[12]).t.JEmsap; const items3 = [{'id': 'AUTOMATIC_RTC_REGION', 'name': null, 'sample_hostname': '', 'sample_port': 0, 'vip': false, 'deprecated': false, 'optimal': false, 'hidden': false, name: Reflect.apply(string, intl, [JEmsap])}]; if (value4 != null) { push = items3.push; value6 = value4.filter(function(a0) { return !a0.deprecated && !a0.hidden; }); items2 = []; arraySpread(items2, value6, 0, dependencyMap); apply(push, items2, items3, dependencyMap); value7 = value4.find(_fun116398); object.selectedRegionId = (value7 == null ? value5 : value7.id) ?? value; } object.regions = items3; return object; function _fun116398({id}) { // fn#116398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1213, offset: 0x0248796c, size: 37 bytes, params: 2, frame: 2 return id === env1_0.props.channel.rtcRegion; } } } function value_116399(a0) { // fn#116399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1403, offset: 0x02487991, size: 131 bytes, params: 2, frame: 17 var environment; let value = a0; const state = this.state; const value2 = null; const value3 = 'AUTOMATIC_RTC_REGION'; state.selectedRegionId = value2 != value ? value : value3; const r6 = value !== value3 ? value : value2; value = environment.__proto__; value = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */; value.updateChannel({rtcRegion: r6}); this.setState({submitting: true}, _fun116400); function _fun116400() { // fn#116400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1540, offset: 0x02487a14, size: 72 bytes, params: 1, frame: 15 let value = environment.__proto__.__proto__; value = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */; value.saveChannel(env0_0.props.channel.id, {rtcRegion: env0_1}); } } function value_116401(a0) { // fn#116401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1634, offset: 0x02487a5c, size: 72 bytes, params: 2, frame: 16 const TableRadioRow = (TableRadioRowNativeModule).TableRadioRow; return ( ); } function value_116402() { // fn#116402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1739, offset: 0x02487aa4, size: 144 bytes, params: 1, frame: 17 const value3 = env1_3(this.state.regions).slice(0); const value4 = value3.map(this.renderRegion, this); const TableRadioGroup = (TableRadioGroupNativeModule).TableRadioGroup; return ( {value4} ); function value_116402OnChange(a0) { // fn#116403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1900, owner: value_116402.onChange, offset: 0x02487b34, size: 25 bytes, params: 2, frame: 11 return env0_0.handleSetRegion(a0); } } function value_116404() { // fn#116404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:1974, offset: 0x02487b4d, size: 88 bytes, params: 1, frame: 16 const value2 = env1_12(this.context); const Form = (NativeModule2).Form; return (
{this.renderRegions()}
); } } function ConnectedChannelSettingsChangeRTCRegion({channelId}) { // fn#116405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15411:2249, offset: 0x02487ba5, size: 125 bytes, params: 2, frame: 17 const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() { return ChannelStore.getChannel(channelId); }); (Module00044)(channel != null, 'ConnectedChannelSettingsChangeRTCRegion: channel cannot be undefined'); return ((Component) => )(env0_13); } } global.__d(_fun116390, 15214, [862, 6, 7, 15, 17, 18, 31, 1379, 15173, 33, 4501, 697, 1244, 8148, 7987, 7988, 7972, 3868, 566, 44, 2]) /* metro module 15214, dependencies: [862, 6, 7, 15, 17, 18, 31, 1379, 15173, 33, 4501, 697, 1244, 8148, 7987, 7988, 7972, 3868, 566, 44, 2] */;