217 lines
15 KiB
TypeScript
217 lines
15 KiB
TypeScript
/* Metro module 10279; source: modules/user_profile/native/UserProfileVoiceSettings.tsx; dependencies: [31, 27, 4613, 4259, 3784, 661, 482, 33, 4501, 8514, 566, 4802, 9293, 10272, 8899, 6815, 1244, 9252, 10280, 10282, 10284, 10286, 9759, 7684, 4573, 8796, 9322, 7972, 4080, 9279, 9275, 2] */
|
|
function _fun79755(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:6, offset: 0x01e60d73, size: 367 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
|
|
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const env0_7 = (require(661) /* metro dependency 661: Constants */).VideoToggleState;
|
|
const env0_8 = (require(482) /* metro dependency 482: Constants */).Permissions;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_9 = value.jsx;
|
|
const env0_10 = value.jsxs;
|
|
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({card: {paddingBottom: 0},
|
|
cardTitle: {marginBottom: 0}, volumeSlider: {paddingVertical: 20},
|
|
disableVideoSublabel: {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/native/UserProfileVoiceSettings.tsx');
|
|
exports.default = UserProfileVoiceSettings;
|
|
}
|
|
|
|
function UserVoiceSettings({user, channel, style}) { // fn#79756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:404, offset: 0x01e60ee2, size: 1543 bytes, params: 2, frame: 35
|
|
var r2;
|
|
var r0;
|
|
var push;
|
|
const UserProfileFormRow = (require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileFormRow;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var object2;
|
|
var items2;
|
|
var UserProfileCard;
|
|
const styles = useStyles();
|
|
const userProfileAnalyticsContextModule = require(8514) /* metro dependency 8514: UserProfileAnalyticsContext */;
|
|
const useUserProfileAnalyticsContext = userProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const env0_2 = Reflect.apply(useUserProfileAnalyticsContext, userProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const {localVolume, isLocalMute, isLocalVideoDisabled, isLocalVideoAutoDisabled,
|
|
supportsDisableLocalVideo} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([MediaEngineStore],
|
|
_fun79757);
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun79758);
|
|
const value4 = (importDefault(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */)(user.id,
|
|
channel.id);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SoundboardStore], function() {
|
|
return SoundboardStore.isLocalSoundboardMuted(user.id);
|
|
});
|
|
const value6 = (require(9293) /* metro dependency 9293: useIsSecureFramesUIEnabled */).useIsSecureFramesUIEnabled({channelId: channel.id});
|
|
items3 = [((Component) => <Component style={styles.volumeSlider} value={localVolume} onValueChange={function(a0) {
|
|
trackUserProfileAction({action: 'SET_VOLUME'});
|
|
importDefault(dependencyMap[14]).setLocalVolume(user.id, a0);
|
|
}} key="set-volume" />)(importDefault(10272) /* metro dependency 10272: VolumeSlider */)];
|
|
if (!(value3 ? channel.isGuildStageVoice() && value4 !== (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates.ON_STAGE : !value3)) {
|
|
push = items3.push;
|
|
string = intl.string;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow label={isLocalMute ? Reflect.apply(string, intl,
|
|
[t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={isLocalMute ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={function() {
|
|
trackUserProfileAction({action: 'MUTE'});
|
|
importDefault(dependencyMap[14]).toggleLocalMute(user.id);
|
|
}} key="mute" />]);
|
|
}
|
|
push = items3.push;
|
|
string = intl.string;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow label={value5 ? Reflect.apply(string, intl,
|
|
[t['639hQT']]) : Reflect.apply(string, intl,
|
|
[t.LxhEuG])} icon={value5 ? (require(10282) /* metro dependency 10282: SoundboardSlashIcon */).SoundboardSlashIcon : (require(10284) /* metro dependency 10284: SoundboardIcon */).SoundboardIcon} onPress={function() {
|
|
trackUserProfileAction({action: 'MUTE_SOUNDBOARD'});
|
|
importDefault(dependencyMap[14]).toggleLocalSoundboardMute(user.id);
|
|
}} key="mute-soundboard" />]);
|
|
if (supportsDisableLocalVideo) {
|
|
push = items3.push;
|
|
object2 = {};
|
|
string = intl.string;
|
|
object2.label = isLocalVideoDisabled ? Reflect.apply(string, intl, [t['xc+Psz']]) : Reflect.apply(string, intl,
|
|
[t['4MMsWF']]);
|
|
object2.icon = isLocalVideoDisabled ? (require(10286) /* metro dependency 10286: VideoSlashIcon */).VideoSlashIcon : (require(9759) /* metro dependency 9759: VideoIcon */).VideoIcon;
|
|
if (isLocalVideoAutoDisabled) {
|
|
var viewBindingProps = {style: styles.disableVideoSublabel};
|
|
items2 = [((CircleErrorIcon) => <CircleErrorIcon size="xxs" color="text-feedback-warning" />)((require(7684) /* metro dependency 7684: CircleErrorIcon */).CircleErrorIcon)];
|
|
items2[1] = ((Text) => <Text variant="text-xs/medium" color="text-feedback-warning">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.m2Hyj0)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
|
|
r2 = <View {...viewBindingProps}>{items2}</View>;
|
|
} else {
|
|
r2 = isLocalVideoAutoDisabled;
|
|
}
|
|
object2.sublabel = r2;
|
|
object2.onPress = onPress_79763;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow {...object2} key="disable-video" />]);
|
|
}
|
|
if (value6) {
|
|
items3.push(<UserProfileFormRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8ErYvY'])} icon={(require(9322) /* metro dependency 9322: ShieldLockIcon */).ShieldLockIcon} hint={(require(7972) /* metro dependency 7972: native */).FormArrow} onPress={function() {
|
|
trackUserProfileAction({action: 'VIEW_SECURE_FRAMES_VERIFICATION_CODE'});
|
|
importDefault(dependencyMap[28]).hideActionSheet();
|
|
importDefault(dependencyMap[29]).openSecureFramesUserVerificationModal(user.id, channel.id, _fun79766);
|
|
}} key="view-secure-frames-verification-code" />);
|
|
}
|
|
if (items3.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
UserProfileCard = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
r0 = <UserProfileCard style={[styles.card,
|
|
style]} title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.NiTd0e)} titleStyle={styles.cardTitle}>{((UserProfileCardRows) => <UserProfileCardRows>{items3}</UserProfileCardRows>)((require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileCardRows)}</UserProfileCard>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function CurrentUserVoiceSettings({user, channel, style}) { // fn#79767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3196, offset: 0x01e61828, size: 574 bytes, params: 2, frame: 29
|
|
var r0;
|
|
var defaultImport2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const UserProfileCardRows = (require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileCardRows;
|
|
const UserProfileFormRow = (require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileFormRow;
|
|
const styles = useStyles();
|
|
const userProfileAnalyticsContextModule = require(8514) /* metro dependency 8514: UserProfileAnalyticsContext */;
|
|
const useUserProfileAnalyticsContext = userProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const env0_1 = Reflect.apply(useUserProfileAnalyticsContext, userProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([MediaEngineStore], function() {
|
|
return MediaEngineStore.isSelfMute();
|
|
});
|
|
if ((require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun79769)) {
|
|
if (channel.isGuildStageVoice()) {
|
|
if ((importDefault(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */)(user.id,
|
|
channel.id) !== (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates.ON_STAGE) {
|
|
r0 = null;
|
|
} else {
|
|
defaultImport2 = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
var defaultImport2Props2 = {style: [styles.card, style], title: intl.string(t.NiTd0e),
|
|
titleStyle: styles.cardTitle};
|
|
string = intl.string;
|
|
r0 = ((Component) => <Component {...defaultImport2Props2}><UserProfileCardRows><UserProfileFormRow label={value2 ? Reflect.apply(string,
|
|
|
|
|
|
|
|
intl, [t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={value2 ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={onPress_79770} key="mute" /></UserProfileCardRows></Component>)(defaultImport2);
|
|
}
|
|
} else {
|
|
defaultImport2 = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
var defaultImport2Props2 = {style: [styles.card, style], title: intl.string(t.NiTd0e),
|
|
titleStyle: styles.cardTitle};
|
|
string = intl.string;
|
|
r0 = ((Component) => <Component {...defaultImport2Props2}><UserProfileCardRows><UserProfileFormRow label={value2 ? Reflect.apply(string,
|
|
|
|
|
|
intl, [t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={value2 ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={onPress_79770} key="mute" /></UserProfileCardRows></Component>)(defaultImport2);
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function UserProfileVoiceSettings({user, currentUser, channel, style}) { // fn#79771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:4066, offset: 0x01e61aeb, size: 108 bytes, params: 2, frame: 16
|
|
return user.id === currentUser.id ? <CurrentUserVoiceSettings user={currentUser} channel={channel} style={style} /> : <UserVoiceSettings user={user} channel={channel} style={style} />;
|
|
}
|
|
|
|
function _fun79757() { // fn#79757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:576, offset: 0x01e614e9, size: 133 bytes, params: 1, frame: 14
|
|
const object2 = {};
|
|
const getLocalVolume = MediaEngineStore.getLocalVolume;
|
|
const userBinding = user;
|
|
object2.localVolume = Reflect.apply(getLocalVolume, MediaEngineStore, [userBinding.id]);
|
|
object2.isLocalMute = MediaEngineStore.isLocalMute(userBinding.id);
|
|
object2.isLocalVideoDisabled = MediaEngineStore.isLocalVideoDisabled(userBinding.id);
|
|
object2.isLocalVideoAutoDisabled = MediaEngineStore.isLocalVideoAutoDisabled(userBinding.id);
|
|
object2.supportsDisableLocalVideo = MediaEngineStore.supportsDisableLocalVideo();
|
|
return object2;
|
|
}
|
|
|
|
function _fun79758() { // fn#79758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:968, offset: 0x01e6156e, size: 55 bytes, params: 1, frame: 14
|
|
return channel.isPrivate() || PermissionStore.can(Permissions.SPEAK, channel);
|
|
}
|
|
|
|
function UserVoiceSettingsOnPress_79763() { // fn#79763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2370, owner: UserVoiceSettings.onPress, offset: 0x01e6169c, size: 144 bytes, params: 1, frame: 17
|
|
var defaultImport;
|
|
trackUserProfileAction({action: 'DISABLE_VIDEO'});
|
|
if (isLocalVideoAutoDisabled) {
|
|
(require(8796) /* metro dependency 8796: UserProfileAlertUtils */).confirmVideoUnstableConnection(function() {
|
|
return importDefault(dependencyMap[14]).setDisableLocalVideo(user.id, VideoToggleState.MANUAL_ENABLED);
|
|
});
|
|
} else {
|
|
defaultImport = importDefault(8899) /* metro dependency 8899: AudioActionCreators */;
|
|
defaultImport.setDisableLocalVideo(user.id,
|
|
isLocalVideoDisabled ? VideoToggleState.MANUAL_ENABLED : VideoToggleState.DISABLED);
|
|
}
|
|
}
|
|
|
|
function UserVoiceSettingsOnPress_79765() { // fn#79765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2742, owner: UserVoiceSettings.onPress, offset: 0x01e61769, size: 113 bytes, params: 1, frame: 16
|
|
trackUserProfileAction({action: 'VIEW_SECURE_FRAMES_VERIFICATION_CODE'});
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
const defaultImport2 = importDefault(9279) /* metro dependency 9279: SecureFramesPlatformUtilsNative */;
|
|
defaultImport2.openSecureFramesUserVerificationModal(user.id, channel.id, _fun79766);
|
|
}
|
|
|
|
function _fun79769() { // fn#79769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3425, offset: 0x01e61a79, size: 55 bytes, params: 1, frame: 14
|
|
return channel.isPrivate() || PermissionStore.can(Permissions.SPEAK, channel);
|
|
}
|
|
|
|
function CurrentUserVoiceSettingsOnPress() { // fn#79770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3901, owner: CurrentUserVoiceSettings.onPress, offset: 0x01e61ab0, size: 59 bytes, params: 1, frame: 12
|
|
trackUserProfileAction({action: 'MUTE'});
|
|
const value = environment.__proto__;
|
|
(importDefault(8899) /* metro dependency 8899: AudioActionCreators */).toggleSelfMute();
|
|
}
|
|
|
|
function _fun79766() { // fn#79766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2883, offset: 0x01e617da, size: 78 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
const validateSecureFramesKeyConsistent = value.validateSecureFramesKeyConsistent;
|
|
const channelBinding = channel;
|
|
return Reflect.apply(validateSecureFramesKeyConsistent, value, [{userId: user.id, channelId: channelBinding.id,
|
|
guildId: channelBinding.guild_id}]);
|
|
}
|
|
|