Files
discord-decomp/sources/modules/user_profile/native/UserProfileActivityButtons.tsx
T
2026-07-28 01:06:53 +03:00

857 lines
40 KiB
TypeScript

/* Metro module 10256; source: modules/user_profile/native/UserProfileActivityButtons.tsx; dependencies: [5, 31, 1378, 1379, 5040, 4111, 1867, 6877, 3784, 3793, 1934, 6876, 4297, 661, 6868, 33, 4501, 697, 6771, 3774, 632, 10257, 10258, 6885, 4578, 1244, 8840, 8109, 4080, 10265, 6887, 1305, 8381, 10216, 3853, 10266, 8419, 5080, 5176, 4008, 8113, 7709, 4915, 1423, 9354, 7007, 8846, 10218, 1471, 8872, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import EmbeddedActivitiesStore from '../../activities/EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import Linking from '../../../lib/native/Linking.tsx'; /* Metro dependency 3853 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import GuildMemberCountStore from '../../../stores/GuildMemberCountStore.tsx'; /* Metro dependency 4111 */
import VoiceStateStore from '../../../stores/VoiceStateStore.tsx'; /* Metro dependency 4297 */
import Platforms from '../../../lib/Platforms.tsx'; /* Metro dependency 4915 */
import ConnectedAccountsStore from '../../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import SelfPresenceStore from '../../../stores/SelfPresenceStore.tsx'; /* Metro dependency 6876 */
import LocalActivityStore from '../../../stores/LocalActivityStore.tsx'; /* Metro dependency 6877 */
import HandleJoinEmbeddedActivity from '../../activities/handleJoinEmbeddedActivity.tsx'; /* Metro dependency 8109 */
import GetActivityChannelId from '../../activities/utils/getActivityChannelId.tsx'; /* Metro dependency 10257 */
import GetActivityJoinability from '../../activities/utils/getActivityJoinability.tsx'; /* Metro dependency 10258 */
import GamesActionCreatorsNative from '../../../actions/GamesActionCreators.native.tsx'; /* Metro dependency 10265 */
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 UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as AvatarUtilsModule from '../../../utils/AvatarUtils.tsx'; /* Metro dependency 1423 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as YouBarExperimentModule from '../../main_tabs_v2/YouBarExperiment.tsx'; /* Metro dependency 5176 */
import * as GetActivityJoinabilityModule from '../../activities/utils/getActivityJoinability.tsx'; /* Metro dependency 10258 */
function _fun79633(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:6, offset: 0x01e5bcd2, size: 534 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
ReactModule;
let value = ConstantsModule;
const env0_15 = value.PlatformTypes;
const env0_16 = value.UserSettingsSections;
value = require(6868) /* metro dependency 6868: SpotifyConstants */;
const env0_17 = value.SpotifyEndpoints;
const env0_18 = value.SpotifyResourceTypes;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const CONTROL_SECONDARY_TEXT_DEFAULT = (Native).colors.CONTROL_SECONDARY_TEXT_DEFAULT;
const env0_20 = Reflect.apply(createStyles, value, [{icon: {tintColor: CONTROL_SECONDARY_TEXT_DEFAULT}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileActivityButtons.tsx');
exports.JoinActivityButton = JoinActivityButton;
exports.JoinGameActivityButton = JoinGameActivityButton;
exports.PlayOnSpotifyButton = PlayOnSpotifyButton;
exports.WatchActivityButton = WatchActivityButton;
exports.VoiceChannelButtons = VoiceChannelButtons;
exports.ConnectPlatformButton = ConnectPlatformButton;
exports.CustomActivityButton = CustomActivityButton;
function JoinActivityButton({user, currentUser, activity, application, onAction}) { // fn#79634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:560, offset: 0x01e5bee8, size: 707 bytes, params: 2, frame: 24
var r0;
const ActivityJoinability = (GetActivityJoinabilityModule).ActivityJoinability;
var Button;
var JOINED;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const env0_5 = (UseAnalyticsLocations)().analyticsLocations;
const env0_6 = (require(3774) /* metro dependency 3774: embeddedActivityLocationUtils */).getEmbeddedActivityLocationChannelId(EmbeddedActivitiesStore.getEmbeddedActivityForUserId(user.id,
application?.id)?.location);
let useStateFromStores = UseStateFromStoresModule.useStateFromStores;
const env0_7 = Reflect.apply(useStateFromStores, UseStateFromStoresModule, [[], _fun79635]);
useStateFromStores = UseStateFromStoresModule.useStateFromStores;
object = [ChannelStore];
object[1] = GuildStore;
object[2] = GuildMemberCountStore;
object[3] = RelationshipStore;
object[4] = SelectedChannelStore;
object[5] = VoiceStateStore;
object[6] = PermissionStore;
object[7] = LocalActivityStore;
object[8] = SelfPresenceStore;
object[9] = EmbeddedActivitiesStore;
const value5 = Reflect.apply(useStateFromStores, UseStateFromStoresModule, [object, _fun79636]);
if ((importDefault(6885) /* metro dependency 6885: isEmbeddedActivity */)(activity)) {
if (application != null) {
if (value5 === ActivityJoinability.CANNOT_JOIN) {
r0 = null;
} else {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
object = {};
JOINED = ActivityJoinability.JOINED;
object.text = value5 === JOINED ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DPfdsq) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4i2vj+']);
object.icon = ((AppsIcon) => <AppsIcon size="sm" color="white" />)((require(8840) /* metro dependency 8840: AppsIcon */).AppsIcon);
object.variant = 'active';
JOINED = ActivityJoinability.JOINED;
object.disabled = value5 === JOINED;
object.onPress = onPress_79637;
r0 = <Button {...object} />;
}
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
function _fun79635() { // fn#79635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:852, offset: 0x01e5c1ab, size: 67 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (GetActivityChannelId)({channelId: env0_6,
userId: user.id, activity: activity});
}
function _fun79636() { // fn#79636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:958, offset: 0x01e5c1ee, size: 176 bytes, params: 1, frame: 14
return (GetActivityJoinability)({isEmbedded: true, user: user,
currentUser: currentUser, activity: activity, application: application, channelId: env0_7,
ChannelStore: ChannelStore, GuildStore: GuildStore, GuildMemberCountStore: GuildMemberCountStore,
RelationshipStore: RelationshipStore, SelectedChannelStore: SelectedChannelStore,
VoiceStateStore: VoiceStateStore, PermissionStore: PermissionStore, LocalActivityStore: LocalActivityStore,
SelfPresenceStore: SelfPresenceStore, EmbeddedActivitiesStore: EmbeddedActivitiesStore});
}
function JoinActivityButtonOnPress() { // fn#79637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:1593, owner: JoinActivityButton.onPress, offset: 0x01e5c29e, size: 118 bytes, params: 1, frame: 15
onAction({action: 'PRESS_JOIN_BUTTON'});
(HandleJoinEmbeddedActivity)({applicationId: application.id,
activityChannelId: env0_7, locationObject: {}, analyticsLocations: analyticsLocations});
(ActionSheetActionCreators).hideActionSheet();
}
}
function JoinGameActivityButton({user, currentUser, activity, application, onAction}) { // fn#79638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:1781, offset: 0x01e5c314, size: 527 bytes, params: 2, frame: 24
var r8;
var r0;
const ActivityJoinability = (GetActivityJoinabilityModule).ActivityJoinability;
var Button;
var JOINED;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const env0_5 = (UseAnalyticsLocations)().analyticsLocations;
const object = {};
object.id = application.id;
object.deeplink_uri = application.deepLinkUri;
const value2 = (UseStateFromStoresModule).useStateFromStores([ChannelStore,
GuildStore, GuildMemberCountStore, RelationshipStore, SelectedChannelStore, VoiceStateStore, PermissionStore,
LocalActivityStore, SelfPresenceStore, EmbeddedActivitiesStore], _fun79639);
if (application == null) {
r0 = null;
} else if (value2 === ActivityJoinability.CANNOT_JOIN) {
r0 = null;
} else {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
JOINED = ActivityJoinability.JOINED;
r8 = value2 === JOINED ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DPfdsq) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.VJlc0S);
JOINED = ActivityJoinability.JOINED;
r0 = (
<Button
text={r8}
variant="active"
disabled={value2 === JOINED}
onPress={onPress_79640}
/>
);
}
return r0;
function _fun79639() { // fn#79639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:2001, offset: 0x01e5c523, size: 174 bytes, params: 1, frame: 14
return (GetActivityJoinability)({user: user,
currentUser: currentUser, activity: activity, application: application, channelId: null, isEmbedded: false,
ChannelStore: ChannelStore, GuildStore: GuildStore, GuildMemberCountStore: GuildMemberCountStore,
RelationshipStore: RelationshipStore, SelectedChannelStore: SelectedChannelStore,
VoiceStateStore: VoiceStateStore, PermissionStore: PermissionStore, LocalActivityStore: LocalActivityStore,
SelfPresenceStore: SelfPresenceStore, EmbeddedActivitiesStore: EmbeddedActivitiesStore});
}
function JoinGameActivityButtonOnPress() { // fn#79640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:2576, owner: JoinGameActivityButton.onPress, offset: 0x01e5c5d1, size: 153 bytes, params: 1, frame: 18
onAction({action: 'PRESS_JOIN_BUTTON'});
const defaultImport = GamesActionCreatorsNative;
const join = defaultImport.join;
const activityBinding = activity;
Reflect.apply(join, defaultImport, [{userId: user.id, sessionId: activityBinding.session_id, application: env0_6,
channelId: null, messageId: null, applicationActivity: activityBinding, source: 'UserProfile',
analyticsLocations: analyticsLocations}]);
(ActionSheetActionCreators).hideActionSheet();
}
}
function PlayOnSpotifyButton({activity, onAction}) { // fn#79641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:2826, offset: 0x01e5c66a, size: 317 bytes, params: 2, frame: 24
var r0;
var Button;
var intl;
const styles = useStyles();
if ((importDefault(6887) /* metro dependency 6887: isListeningOnSpotify */)(activity)) {
if (activity.sync_id != null) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
<Button
text={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.LEgD7t,
{platform: activity.name})}
icon={((Icon) => <Icon size={(require(1305) /* metro dependency 1305: native */).Icon.Sizes.SMALL} source={importDefault(8381) /* metro dependency 8381 */} disableColor style={styles.icon} />)((require(1305) /* metro dependency 1305: native */).Icon)}
variant="secondary"
onPress={Module00005(_fun79643)}
/>
);
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
function* _fun79643() { // fn#79643, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:3156, offset: 0x01e5c7b2, size: 194 bytes, params: 1, frame: 20
var r3;
var binding;
var binding2;
var property;
var value4;
var canOpenSpotifyUrl;
var canOpenSpotifyUrl2;
var value5;
var value6;
var binding3;
var value7;
var attributeInstall;
var openURL;
var APP_STORE;
var openUrl;
var TRACK;
var error;
if (false) {
return undefined;
}
value = environment.__proto__;
require({action: 'PRESS_PLAY_ON_SPOTIFY_BUTTON'});
try {
binding = env2_0;
} catch (error) {
return undefined;
}
try {
binding2 = env2_2;
} catch (error) {
return undefined;
}
try {
property = binding2[33];
} catch (error) {
return undefined;
}
try {
value4 = binding(property);
} catch (error) {
return undefined;
}
try {
canOpenSpotifyUrl = value4.canOpenSpotifyUrl;
} catch (error) {
return undefined;
}
try {
canOpenSpotifyUrl2 = Reflect.apply(canOpenSpotifyUrl, value4, []);
} catch (error) {
return undefined;
}
yield canOpenSpotifyUrl2;
try {
value5 = undefined;
value6 = false;
} catch (error) {
return undefined;
}
if (value6) {
return value5;
}
try {
binding = env2_0;
} catch (error) {
return undefined;
}
try {
binding3 = env2_2;
} catch (error) {
return undefined;
}
try {
property = binding3[33];
} catch (error) {
return undefined;
}
try {
value7 = binding(property);
} catch (error) {
return undefined;
}
if (value5) {
try {
openUrl = value7.openUrl;
} catch (error) {
return undefined;
}
try {
binding = env2_18;
} catch (error) {
return undefined;
}
try {
TRACK = binding.TRACK;
} catch (error) {
return undefined;
}
try {
} catch (error) {
return undefined;
}
try {
value = Reflect.apply(openUrl, value7, [value5, TRACK, importDefault]);
r3 = value;
} catch (error) {
return undefined;
}
} else {
try {
attributeInstall = value7.attributeInstall;
} catch (error) {
return undefined;
}
try {
Reflect.apply(attributeInstall, value7, []);
} catch (error) {
return undefined;
}
try {
binding = env2_1;
} catch (error) {
return undefined;
}
try {
property = binding3[34];
} catch (error) {
return undefined;
}
try {
value = binding(property);
} catch (error) {
return undefined;
}
try {
openURL = value.openURL;
} catch (error) {
return undefined;
}
try {
binding = env2_17;
} catch (error) {
return undefined;
}
try {
APP_STORE = binding.APP_STORE;
} catch (error) {
return undefined;
}
try {
value = Reflect.apply(openURL, value, [APP_STORE]);
r3 = value;
} catch (error) {
return undefined;
}
}
return r3;
}
}
function WatchActivityButton({activity, onAction}) { // fn#79644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:3399, offset: 0x01e5c874, size: 197 bytes, params: 2, frame: 20
var r0;
var Button;
var intl;
if ((importDefault(8419) /* metro dependency 8419: isStreaming */)(activity)) {
if ((importDefault(10266) /* metro dependency 10266: getStreamURL */)(activity) != null) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = (
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.I6JG46)}
variant="secondary"
onPress={onPress_79645}
/>
);
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
function WatchActivityButtonOnPress() { // fn#79645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:3591, owner: WatchActivityButton.onPress, offset: 0x01e5c939, size: 66 bytes, params: 1, frame: 13
onAction({action: 'PRESS_WATCH_BUTTON'});
(Linking).openURL(env0_1);
}
}
function VoiceChannelButtons({channel, isInChannel, onAction}) { // fn#79646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:3680, offset: 0x01e5c97b, size: 475 bytes, params: 2, frame: 25
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const env0_2 = (UseAnalyticsLocations)().newestAnalyticsLocation;
const isGuildStageVoice2 = channel.isGuildStageVoice();
const Button = (ButtonNativeModule).Button;
const isDM2 = channel.isDM();
return (
<Button
text={isInChannel ? isDM2 || channel.isGroupDM() ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7hwn2A']) : isGuildStageVoice2 ? intl.string(t.Acqcot) : intl.string(t.BXxdl7) : isDM2 || channel.isGroupDM() ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ozoE2A) : isGuildStageVoice2 ? intl.string(t['7vb2cc']) : intl.string(t['96ANUN'])}
variant={isInChannel ? 'secondary' : 'active'}
grow
onPress={onPress_79647}
/>
);
function VoiceChannelButtonsOnPress() { // fn#79647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:4193, owner: VoiceChannelButtons.onPress, offset: 0x01e5cb56, size: 315 bytes, params: 1, frame: 17
var r2;
var rootNavigationRef;
var value5;
var currentRoute;
var moduleValue2;
var moduleValue3;
const onActionBinding = onAction;
const value2 = undefined;
onActionBinding({action: 'PRESS_JOIN_CALL_BUTTON'});
(ActionSheetActionCreators).hideActionSheet();
(ModalActionCreators).popAll();
const YouBarExperiment = (YouBarExperimentModule).YouBarExperiment;
const getConfig = YouBarExperiment.getConfig;
if (Reflect.apply(getConfig, YouBarExperiment, [{location: 'VoiceChannelButtons'}]).enabled) {
rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
value5 = (rootNavigationRef == null ? value2 : rootNavigationRef.isReady()) === true;
if (value5) {
currentRoute = rootNavigationRef.getCurrentRoute();
r2 = (currentRoute == null ? value2 : currentRoute.name) === 'you';
} else {
r2 = value5;
}
if (r2) {
rootNavigationRef.goBack();
}
}
if (Module00005) {
moduleValue3 = require(8113) /* metro dependency 8113: StageChannelModalActionCreators */;
moduleValue3.connectAndOpen(channel);
} else {
moduleValue2 = require(7709) /* metro dependency 7709: PrivateChannelCallUtils */;
moduleValue2.openGuildVoiceModal(channel, newestAnalyticsLocation);
}
return value2;
}
}
function ConnectPlatformButton({type, onAction}) { // fn#79648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:4594, offset: 0x01e5cc91, size: 396 bytes, params: 2, frame: 23
const styles = useStyles();
const env0_2 = (UseAnalyticsLocations)().newestAnalyticsLocation;
const useStateFromStores = UseStateFromStoresModule.useStateFromStores;
if (Reflect.apply(useStateFromStores, UseStateFromStoresModule, [[ConnectedAccountsStore], function() {
return ConnectedAccountsStore.getAccount(null, type) != null;
}])) {
return null;
}
const value2 = (Platforms).get(type);
const Button = (ButtonNativeModule).Button;
const intl = (IndexNativeModule).intl;
const formatToPlainString = intl.formatToPlainString;
const XWSHTb = (IndexNativeModule).t.XWSHTb;
const object2 = {};
object2.platform = value2.name;
const Icon = (NativeModule).Icon;
const Icon2 = (NativeModule).Icon;
const Sizes = Icon2.Sizes;
const SMALL = Sizes.SMALL;
return (
<Button
text={Reflect.apply(formatToPlainString, intl, [XWSHTb, object2])}
icon={<Icon
size={SMALL}
source={AvatarUtilsModule.makeSource(value2.icon.whitePNG)}
disableColor
style={styles.icon}
/>}
variant="secondary"
onPress={onPress_79650}
/>
);
function ConnectPlatformButtonOnPress() { // fn#79650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:5054, owner: ConnectPlatformButton.onPress, offset: 0x01e5ce3f, size: 118 bytes, params: 1, frame: 15
const onActionBinding = onAction;
const typeBinding = type;
const PLAYSTATION = PlatformTypes.PLAYSTATION;
onActionBinding({action: typeBinding !== PLAYSTATION ? 'PRESS_CONNECT_XBOX_BUTTON' : 'PRESS_CONNECT_PLAYSTATION_BUTTON'});
(importDefault(9354) /* metro dependency 9354: authorizeConnectionNative */)({platformType: Module00005.type,
location: newestAnalyticsLocation, onClose: function() {
return require(dependencyMap[45]).openUserSettings({screen: UserSettingsSections.CONNECTIONS});
}});
}
}
function CustomActivityButton({user, activity, index, onAction}) { // fn#79652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:5284, offset: 0x01e5ceec, size: 253 bytes, params: 2, frame: 22
var r7;
var r0;
var Button;
var intl;
const buttons = activity.buttons;
const value = null;
if (value == buttons) {
r0 = value;
} else if (index >= activity.buttons.length) {
r0 = value;
} else {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
if ((importDefault(8846) /* metro dependency 8846: isCrunchyrollActivity */)(activity)) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r7 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.I6JG46);
} else {
r7 = activity.buttons[index];
}
r0 = (
<Button
text={r7}
variant="secondary"
onPress={onAction(_fun79654)}
/>
);
}
return r0;
function* _fun79654() { // fn#79654, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:5523, offset: 0x01e5cff4, size: 354 bytes, params: 1, frame: 21
var protocol;
var hostname;
var binding2;
var property;
var value5;
var getMetadata;
var id;
var value6;
var value7;
var value8;
var button_urls;
var length;
var value9;
var value10;
var binding3;
var property2;
var value11;
var safeParseWithQuery;
var value12;
var value13;
var value14;
var value15;
var value16;
var binding4;
var value17;
var format;
var value18;
var value19;
var handleClick;
var onConfirm_796552;
var error;
let value = undefined;
if (true) {
value = undefined;
var env0_0;
var binding = env1_3;
var object = {action: 'PRESS_CUSTOM_BUTTON'};
binding(object);
reducibleJoin4: while (true) {
reduciblePort69: while (true) {
exceptionLanding68: while (true) {
try {
binding = env2_0;
} catch (error) {
break exceptionLanding68;
}
break reducibleJoin4;
}
break reduciblePort69;
}
return value;
}
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding68;
}
try {
property = binding2[47];
} catch (error) {
break exceptionLanding68;
}
try {
value5 = binding(property);
} catch (error) {
break exceptionLanding68;
}
try {
getMetadata = value5.getMetadata;
} catch (error) {
break exceptionLanding68;
}
try {
} catch (error) {
break exceptionLanding68;
}
try {
} catch (error) {
break exceptionLanding68;
}
try {
id = require.id;
} catch (error) {
break exceptionLanding68;
}
try {
value6 = Reflect.apply(getMetadata, value5, [importDefault, id]);
} catch (error) {
break exceptionLanding68;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
break exceptionLanding68;
}
if (value8) {
return value7;
}
try {
button_urls = value7.button_urls;
} catch (error) {
break exceptionLanding68;
}
try {
length = button_urls.length;
} catch (error) {
break exceptionLanding68;
}
try {
} catch (error) {
break exceptionLanding68;
}
try {
value9 = length <= dependencyMap;
} catch (error) {
break exceptionLanding68;
}
if (value9) {
return value;
}
try {
button_urls = value7.button_urls;
} catch (error) {
break exceptionLanding68;
}
try {
} catch (error) {
break exceptionLanding68;
}
try {
property = button_urls[dependencyMap];
} catch (error) {
break exceptionLanding68;
}
try {
value10 = typeof property !== 'string';
} catch (error) {
break exceptionLanding68;
}
if (value10) {
return value;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding68;
}
try {
binding3 = env2_2;
} catch (error) {
break exceptionLanding68;
}
try {
property2 = binding3[48];
} catch (error) {
break exceptionLanding68;
}
try {
value11 = binding(property2);
} catch (error) {
break exceptionLanding68;
}
try {
safeParseWithQuery = value11.safeParseWithQuery;
} catch (error) {
break exceptionLanding68;
}
try {
value12 = Reflect.apply(safeParseWithQuery, value11, [property]);
} catch (error) {
break exceptionLanding68;
}
try {
value13 = value12 == null;
} catch (error) {
break exceptionLanding68;
}
reducibleJoin38: while (true) {
if (value13) {
protocol = value;
break reducibleJoin38;
}
try {
protocol = value12.protocol;
} catch (error) {
break exceptionLanding68;
}
break reducibleJoin38;
}
try {
value14 = protocol == null;
} catch (error) {
break exceptionLanding68;
}
if (!value14) {
try {
value15 = value12 == null;
} catch (error) {
break exceptionLanding68;
}
reducibleJoin44: while (true) {
if (value15) {
hostname = value;
break reducibleJoin44;
}
try {
hostname = value12.hostname;
} catch (error) {
break exceptionLanding68;
}
break reducibleJoin44;
}
try {
value16 = hostname == null;
} catch (error) {
break exceptionLanding68;
}
reducibleJoin64: while (true) {
if (!value16) {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding68;
}
try {
binding4 = env2_2;
} catch (error) {
break exceptionLanding68;
}
try {
property = binding4[48];
} catch (error) {
break exceptionLanding68;
}
try {
value17 = binding(property);
} catch (error) {
break exceptionLanding68;
}
try {
format = value17.format;
} catch (error) {
break exceptionLanding68;
}
try {
value18 = Reflect.apply(format, value17, [value12]);
} catch (error) {
break exceptionLanding68;
}
try {
env0_0 = value18;
} catch (error) {
break exceptionLanding68;
}
try {
binding = env2_0;
} catch (error) {
break exceptionLanding68;
}
try {
property = binding4[49];
} catch (error) {
break exceptionLanding68;
}
try {
value19 = binding(property);
} catch (error) {
break exceptionLanding68;
}
try {
handleClick = value19.handleClick;
} catch (error) {
break exceptionLanding68;
}
try {
object = {};
} catch (error) {
break exceptionLanding68;
}
try {
object.href = value18;
} catch (error) {
break exceptionLanding68;
}
try {
onConfirm_796552 = onConfirm_79655;
} catch (error) {
break exceptionLanding68;
}
try {
object.onConfirm = onConfirm_796552;
} catch (error) {
break exceptionLanding68;
}
try {
object.trusted = false;
} catch (error) {
break exceptionLanding68;
}
try {
Reflect.apply(handleClick, value19, [object]);
} catch (error) {
break exceptionLanding68;
}
return value;
}
break reducibleJoin64;
}
}
}
return value;
function onConfirm_79655() { // fn#79655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10442:5880, offset: 0x01e5d156, size: 45 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__.__proto__;
return env3_1(env3_2[34]).openURL(env0_0);
}
}
}
}
global.__d(_fun79633, 10256, [5, 31, 1378, 1379, 5040, 4111, 1867, 6877, 3784, 3793, 1934, 6876, 4297, 661, 6868,
33, 4501, 697, 6771, 3774, 632, 10257, 10258, 6885, 4578, 1244, 8840, 8109, 4080, 10265, 6887, 1305, 8381,
10216, 3853, 10266, 8419, 5080, 5176, 4008, 8113, 7709, 4915, 1423, 9354, 7007, 8846, 10218, 1471, 8872,
2]) /* metro module 10256, dependencies: [5, 31, 1378, 1379, 5040, 4111, 1867, 6877, 3784, 3793, 1934, 6876, 4297, 661, 6868, 33, 4501, 697, 6771, 3774, 632, 10257, 10258, 6885, 4578, 1244, 8840, 8109, 4080, 10265, 6887, 1305, 8381, 10216, 3853, 10266, 8419, 5080, 5176, 4008, 8113, 7709, 4915, 1423, 9354, 7007, 8846, 10218, 1471, 8872, 2] */;