This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,8 @@
// Metro module 8859 (f8860).
import Dispatcher from "../../../Dispatcher";
export function setAudioOutputDevice(a0) {
Dispatcher.dispatch({
type: "NATIVE_AUDIO_SET_OUTPUT_DEVICE",
device: a0
});
}
@@ -0,0 +1,86 @@
// Metro module 8835 (f8836).
import { NativeEventEmitter } from "react-native";
import { RTCConnectionStates } from "../../../Constants";
import { MediaEngineContextTypes } from "../../../_bundle/Module4250";
import Module8836, { getInvalidAndroidDevice, AudioDeviceType } from "../../../_bundle/Module8836";
import Module12 from "../../../_bundle/Module12";
import SentryUtils_native from "../../../utils/SentryUtils.native";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c5760_5 = new NativeEventEmitter(Module8836);
const devices = [];
let invalidAndroidDevice = getInvalidAndroidDevice();
let invalidAndroidDevice2 = getInvalidAndroidDevice();
let c5760_9 = false;
class AudioManagerStore extends Module589.Store {
static displayName = "AudioManagerStore";
initialize() {
Module8836.getAudioDevices().then((result) => {
devices = result;
this.emitChange();
c5760_5.addListener("android-audio-devices-updated", (a0) => {
devices = a0.devices;
this.emitChange();
});
});
Module8836.getActiveAudioDevice().then((result) => {
invalidAndroidDevice = result;
this.emitChange();
c5760_5.addListener("android-active-audio-device-changed", (a0) => {
invalidAndroidDevice = a0.device;
this.emitChange();
});
});
Module8836.setSCORetryCount(4);
}
getAudioDevices() {
return devices;
}
getActiveAudioDevice() {
return invalidAndroidDevice;
}
getRequestedActiveAudioDevice() {
return invalidAndroidDevice2;
}
}
const audioManagerStore = new AudioManagerStore(Dispatcher, {
RTC_CONNECTION_STATE: function handleRTCConnectionStateUpdate(a0) {
if (a0.context !== MediaEngineContextTypes.DEFAULT) {
return false;
}
const state = a0.state;
if (RTCConnectionStates.CONNECTING === state) {
c5760_9 = true;
Module8836.setCommunicationModeOn(true);
if (invalidAndroidDevice !== invalidAndroidDevice2 && invalidAndroidDevice2.simpleDeviceType !== AudioDeviceType.INVALID) {
if (Module12.isString(invalidAndroidDevice2)) {
SentryUtils_native.captureMessage("AudioManagerStore received a string for an android audio device", {
extra: {
deviceString: invalidAndroidDevice2
}
});
} else {
Module8836.setActiveAudioDevice(invalidAndroidDevice2);
}
}
} else if (RTCConnectionStates.DISCONNECTED === state && !a0.willReconnect) {
c5760_9 = false;
Module8836.setCommunicationModeOn(false);
}
},
NATIVE_AUDIO_SET_OUTPUT_DEVICE: function handleSetActiveAudioDevice({ device }) {
invalidAndroidDevice2 = device;
if (c5760_9) {
if (Module12.isString(device)) {
SentryUtils_native.captureMessage("AudioManagerStore received a string for an android audio device", {
extra: {
deviceString: device
}
});
} else {
Module8836.setActiveAudioDevice(device);
}
}
}
});
export default audioManagerStore;
@@ -0,0 +1,58 @@
// Metro module 16135 (f16136).
import { NativeModules } from "react-native";
import EmbeddedActivitiesStore from "../../activities/EmbeddedActivitiesStore";
import StageChannelRoleStore from "../../stage_channels/StageChannelRoleStore";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import ChannelStore from "../../../stores/ChannelStore";
import MediaEngineStore from "../../../stores/MediaEngineStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import AppStateStore from "../../../stores/native/AppStateStore";
import { AppStates } from "../../../Constants";
import { isAndroid } from "../../../utils/PlatformUtils";
import * as _VoicePermissionManager from "../VoicePermissionManager";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
let c11556_12, VOICE;
const handleAVAudioSessionMode = function handleAVAudioSessionMode() {
let DEFAULT;
L14: {
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
if (channel == null) {
DEFAULT = c11556_12.AVAudioSessionMode.DEFAULT;
} else {
const r15 = ApplicationStreamingStore.getAllActiveStreams().length > 0 || VoiceStateStore.hasVideo(channel.id) || MediaEngineStore.isVideoEnabled();
const r23 = EmbeddedActivitiesStore.getCurrentEmbeddedActivity() != null;
if (!r15 && !r23) {
const shouldImmediatelyRequestVoicePermissions = _VoicePermissionManager.shouldImmediatelyRequestVoicePermissions(AuthenticationStore.getId(), channel.id);
const AVAudioSessionMode = c11556_12.AVAudioSessionMode;
if (shouldImmediatelyRequestVoicePermissions) {
DEFAULT = AVAudioSessionMode.VOICE;
break L14;
}
DEFAULT = AVAudioSessionMode.LISTEN;
break L14;
}
DEFAULT = c11556_12.AVAudioSessionMode.VIDEO;
}
}
if (VOICE !== DEFAULT && AppStateStore.getState() === AppStates.ACTIVE) {
VOICE = DEFAULT;
c11556_12.setAVAudioSessionMode(DEFAULT);
}
};
c11556_12 = isAndroid() ? {
setAVAudioSessionMode: () => {},
AVAudioSessionMode: {
VOICE: "AVAudioSessionModeVoiceChat",
VIDEO: "AVAudioSessionModeVideoChat",
LISTEN: "AVAudioSessionModeSpokenAudio",
DEFAULT: "AVAudioSessionModeDefault"
}
} : NativeModules.VoiceEngine;
VOICE = c11556_12.AVAudioSessionMode.VOICE;
class AudioSessionModeManager extends AutomaticLifecycleManager {
stores = new Map().set(ApplicationStreamingStore, handleAVAudioSessionMode).set(VoiceStateStore, handleAVAudioSessionMode).set(MediaEngineStore, handleAVAudioSessionMode).set(StageChannelRoleStore, handleAVAudioSessionMode).set(EmbeddedActivitiesStore, handleAVAudioSessionMode);
}
const audioSessionModeManager = new AudioSessionModeManager();
export default audioSessionModeManager;
@@ -0,0 +1,88 @@
// Metro module 12852 (f12853).
import ChannelRTCStore from "../../calls/ChannelRTCStore";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import CallStore from "../../../stores/CallStore";
import RTCConnectionStore from "../../../stores/RTCConnectionStore";
import { EMPTY_STRING_SNOWFLAKE_ID, RTCConnectionStates } from "../../../Constants";
import { ParticipantTypes } from "../../calls/CallConstants";
import { useStateFromStoresArray, useStateFromStores } from "../../../_bundle/Module589";
import useVoiceStateForRemoteSession from "../../game_console/hooks/useVoiceStateForRemoteSession";
let c8861_10 = {
...{
initialized: false,
callId: void 0
}
};
let c8861_11 = {
DISCONNECTED: "disconneted",
DISCONNECTING: "disconnecting",
CONNECTING: "connecting",
RINGING: "ringing",
CONNECTED: "connected"
};
export default function _default(r13 = EMPTY_STRING_SNOWFLAKE_ID) {
let CONNECTING, initialized;
let c20254_2, stateFromStores;
const EMPTY_STRING_SNOWFLAKE_ID2 = r13;
let r10 = arguments[1];
if (r10 === void 0) {
r10 = false;
}
let r5 = arguments[2];
if (r5 === void 0) {
r5 = false;
}
c20254_2 = void 0;
stateFromStores = void 0;
const id = AuthenticationStore.getId();
const stateFromStoresArray = useStateFromStoresArray([CallStore], () => {
const call = CallStore.getCall(EMPTY_STRING_SNOWFLAKE_ID2);
const r8 = call != null ? call.ringing.filter((item) => item !== id) : [];
c8861_10.initialized = c8861_10.initialized || r8.length > 0;
return r8;
}, [EMPTY_STRING_SNOWFLAKE_ID2, id]);
const r30 = ChannelRTCStore.getParticipants(EMPTY_STRING_SNOWFLAKE_ID2).filter((item) => item.type !== ParticipantTypes.ACTIVITY && item.user.id !== id);
const voiceStateForRemoteSession = useVoiceStateForRemoteSession();
c20254_2 = voiceStateForRemoteSession;
stateFromStores = useStateFromStores([RTCConnectionStore], RTCConnectionStore.getRTCConnectionId, []);
const stateFromStores2 = useStateFromStores([RTCConnectionStore], () => {
if (c20254_2?.channelId === EMPTY_STRING_SNOWFLAKE_ID2) {
c8861_10.initialized = true;
return RTCConnectionStates.RTC_CONNECTED;
}
const callId = c8861_10.callId;
if (!(stateFromStores != null && callId === stateFromStores)) {
c8861_10.initialized = false;
}
c8861_10.callId = stateFromStores;
const state = RTCConnectionStore.getState();
c8861_10.initialized = c8861_10.initialized || state !== RTCConnectionStates.DISCONNECTED && state !== RTCConnectionStates.RTC_DISCONNECTED;
return state;
}, [stateFromStores, voiceStateForRemoteSession, EMPTY_STRING_SNOWFLAKE_ID2]);
const initialized2 = c8861_10.initialized || r5;
L18: {
c8861_10.initialized = initialized2;
CONNECTING = c8861_11.CONNECTING;
initialized = c8861_10.initialized;
if (r10) {
CONNECTING = c8861_11.DISCONNECTING;
} else {
if (initialized && stateFromStores2 === RTCConnectionStates.DISCONNECTED) {
CONNECTING = c8861_11.DISCONNECTED;
break L18;
}
if (stateFromStoresArray.length > 0 && r30.length === stateFromStoresArray.length) {
CONNECTING = c8861_11.RINGING;
break L18;
}
if (stateFromStores2 === RTCConnectionStates.RTC_CONNECTED) {
CONNECTING = c8861_11.CONNECTED;
}
}
}
return {
state: CONNECTING,
initialized
};
};
export { c8861_11 as CallStates };
+322
View File
@@ -0,0 +1,322 @@
// Metro module 8831 (f8832).
import { useState, useCallback, useEffect } from "react";
import { NativeModules } from "react-native";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import ChannelStore from "../../../stores/ChannelStore";
import MediaEngineStore from "../../../stores/MediaEngineStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import AudioRouteStore_native from "../AudioRouteStore.native";
import AudioManagerStore_android from "./AudioManagerStore.android";
import { NativePermissionTypes } from "../../native_permissions/NativePermissionConstants";
import { getChannelVideoLimit } from "../../video_calls/useChannelVideoLimit";
import AlertActionCreators from "../../../actions/native/AlertActionCreators";
import { intl, t } from "../../../intl/index.native";
import NativePermissionUtils from "../../native_permissions/NativePermissionUtils";
import AudioActionCreators from "../../../actions/AudioActionCreators";
import { getErrorInfo, AVError } from "../../errors/av_errors/AVError";
import { dismissGlobalKeyboard } from "../../../utils/native/KeyboardManagerUtils";
import { dismissVoiceChannelScreens } from "../../../utils/native/PrivateChannelCallUtils";
import SelectedChannelActionCreators from "../../../actions/SelectedChannelActionCreators";
import Module12 from "../../../_bundle/Module12";
import Module8853 from "../../../_bundle/Module8853";
import Module8854 from "../../../_bundle/Module8854";
import Module8855 from "../../../_bundle/Module8855";
import { isAndroid } from "../../../utils/PlatformUtils";
import { useStateFromStoresObject, useStateFromStores } from "../../../_bundle/Module589";
import { showAudioOutputSelector } from "./audio_output_selector/showAudioOutputSelector";
import { AudioDeviceType } from "../../../_bundle/Module8836";
import * as _useIsVideoMode from "../../video_calls/native/useIsVideoMode";
import useIsVideoMode from "../../video_calls/native/useIsVideoMode";
import { RouteTypes } from "../VoiceCallTypes";
let c5758_18, c5758_19, c5758_20;
let c5758_17 = Module12.debounce((a0) => {
const AudioRoutePicker = NativeModules.AudioRoutePicker;
if (AudioRoutePicker != null) {
AudioRoutePicker.handleAudioRoute(a0);
}
}, 250);
c5758_18 = Module12.debounce((a0) => {
a0();
}, 1);
c5758_19 = {
EARPIECE: Module8853,
BLUETOOTH_HEADSET: Module8854,
WIRED_HEADSET: Module8855,
SPEAKERPHONE: Module8855,
INVALID: Module8855
};
c5758_20 = {
TYPE_UNKNOWN: 0,
0: "TYPE_UNKNOWN",
TYPE_BUILTIN_EARPIECE: 1,
1: "TYPE_BUILTIN_EARPIECE",
TYPE_BUILTIN_SPEAKER: 2,
2: "TYPE_BUILTIN_SPEAKER",
TYPE_WIRED_HEADSET: 3,
3: "TYPE_WIRED_HEADSET",
TYPE_WIRED_HEADPHONES: 4,
4: "TYPE_WIRED_HEADPHONES",
TYPE_LINE_ANALOG: 5,
5: "TYPE_LINE_ANALOG",
TYPE_LINE_DIGITAL: 6,
6: "TYPE_LINE_DIGITAL",
TYPE_BLUETOOTH_SCO: 7,
7: "TYPE_BLUETOOTH_SCO",
TYPE_BLUETOOTH_A2DP: 8,
8: "TYPE_BLUETOOTH_A2DP",
TYPE_HDMI: 9,
9: "TYPE_HDMI",
TYPE_HDMI_ARC: 10,
10: "TYPE_HDMI_ARC",
TYPE_USB_DEVICE: 11,
11: "TYPE_USB_DEVICE",
TYPE_USB_ACCESSORY: 12,
12: "TYPE_USB_ACCESSORY",
TYPE_DOCK: 13,
13: "TYPE_DOCK",
TYPE_FM: 14,
14: "TYPE_FM",
TYPE_BUILTIN_MIC: 15,
15: "TYPE_BUILTIN_MIC",
TYPE_FM_TUNER: 16,
16: "TYPE_FM_TUNER",
TYPE_TV_TUNER: 17,
17: "TYPE_TV_TUNER",
TYPE_TELEPHONY: 18,
18: "TYPE_TELEPHONY",
TYPE_AUX_LINE: 19,
19: "TYPE_AUX_LINE",
TYPE_IP: 20,
20: "TYPE_IP",
TYPE_BUS: 21,
21: "TYPE_BUS",
TYPE_USB_HEADSET: 22,
22: "TYPE_USB_HEADSET",
TYPE_HEARING_AID: 23,
23: "TYPE_HEARING_AID",
TYPE_BUILTIN_SPEAKER_SAFE: 24,
24: "TYPE_BUILTIN_SPEAKER_SAFE",
TYPE_REMOTE_SUBMIX: 25,
25: "TYPE_REMOTE_SUBMIX",
TYPE_BLE_HEADSET: 26,
26: "TYPE_BLE_HEADSET",
TYPE_BLE_SPEAKER: 27,
27: "TYPE_BLE_SPEAKER",
TYPE_ECHO_REFERENCE: 28,
28: "TYPE_ECHO_REFERENCE",
TYPE_HDMI_EARC: 29,
29: "TYPE_HDMI_EARC",
TYPE_BLE_BROADCAST: 30,
30: "TYPE_BLE_BROADCAST",
TYPE_DOCK_ANALOG: 31,
31: "TYPE_DOCK_ANALOG"
};
const r131 = isAndroid() ? () => useStateFromStoresObject([AudioManagerStore_android], () => {
let r14 = AudioManagerStore_android.getActiveAudioDevice()?.simpleDeviceType;
if (r14 == null) {
r14 = AudioDeviceType.INVALID;
}
return {
isAudioRouteEnabled: true,
toggleAudio: showAudioOutputSelector,
routeSource: c5758_19[r14]
};
}, []) : () => {
let isEnabled, isVideoMode;
const stateFromStoresObject = useStateFromStoresObject([ChannelStore, SelectedChannelStore, ApplicationStreamingStore, VoiceStateStore, MediaEngineStore, AudioRouteStore_native], () => {
const isVideoMode2 = _useIsVideoMode.isVideoMode(ChannelStore, SelectedChannelStore, ApplicationStreamingStore, VoiceStateStore, MediaEngineStore);
const currentRouteType = AudioRouteStore_native.getCurrentRouteType();
let isEnabled2 = currentRouteType === RouteTypes.SPEAKER;
const isBluetoothRoute = currentRouteType === RouteTypes.BLUETOOTH;
if (!isEnabled2) {
isEnabled2 = isBluetoothRoute;
}
if (!isEnabled2) {
isEnabled2 = isVideoMode2;
}
return {
isEnabled: isEnabled2,
isVideoMode: isVideoMode2,
isBluetoothRoute
};
});
isEnabled = stateFromStoresObject.isEnabled;
isVideoMode = stateFromStoresObject.isVideoMode;
const isBluetoothRoute = stateFromStoresObject.isBluetoothRoute;
const [state, setState] = useState(isEnabled);
const callback = useCallback(() => {
if (!AudioRouteStore_native.getMultipleRoutesAvailable()) {
c5758_18.cancel();
if (!isVideoMode) {
setState(!state);
}
}
c5758_17(!state);
}, [state, isVideoMode]);
useEffect(() => {
if (!AudioRouteStore_native.getMultipleRoutesAvailable() && !isVideoMode) {
c5758_18(() => setState(isEnabled));
} else {
setState(isEnabled);
}
}, [isEnabled, isVideoMode]);
return {
isAudioRouteEnabled: state,
toggleAudio: callback,
routeSource: isBluetoothRoute ? Module8854 : Module8855
};
};
export async function handleToggleVideo(c26289_0, c26289_1) {
let c26289_3;
let c29982_1, c29982_2, c29982_3, c29982_4, c29982_5;
c26289_3 = void 0;
c29982_1 = void 0;
let c29982_0 = c26289_0;
if (c26289_1 !== void 0) {
c29982_1 = c26289_1;
c29982_2 = void 0;
c29982_3 = void 0;
c29982_4 = void 0;
c29982_5 = void 0;
} else {
c29982_1 = true;
c29982_2 = void 0;
c29982_3 = void 0;
c29982_4 = void 0;
c29982_5 = void 0;
}
await void 0;
c29982_2 = MediaEngineStore.isVideoEnabled();
c29982_3 = getChannelVideoLimit(c29982_0);
c29982_4 = c29982_3.reachedLimit;
c29982_5 = c29982_3.limit;
if (c29982_4) {
if (c29982_1) {
AlertActionCreators.show({
title: intl.string(t["3ffmE+"]),
body: intl.formatToPlainString(t.x9mtl4, {
limit: c29982_5.toString()
})
});
}
} else if (c29982_2) {
AudioActionCreators.setVideoEnabled(false);
} else if (await NativePermissionUtils.requestPermission(NativePermissionTypes.CAMERA)) {
AudioActionCreators.setVideoEnabled(true);
}
}
export function handleToggleSelfDeaf() {
AudioActionCreators.toggleSelfDeaf();
}
export function handleToggleSelfMute() {
NativePermissionUtils.requestPermission(NativePermissionTypes.AUDIO, {
showAuthorizationError: true
});
AudioActionCreators.toggleSelfMute();
}
export function showSuppressedAlert() {
AlertActionCreators.show({
title: intl.string(t.FJSZVM),
body: intl.string(t.etJjgW),
hideActionSheet: false
});
}
export function showServerMuteAlert() {
AlertActionCreators.show({
title: intl.string(t["+JQCa/"]),
body: intl.string(t.hsNm7d),
hideActionSheet: false
});
}
export function showServerDeafenAlert() {
AlertActionCreators.show({
title: intl.string(t.QZ7WSS),
body: intl.string(t.Tl9JpL),
hideActionSheet: false
});
}
export function showCameraDisabledAlert() {
AlertActionCreators.show({
title: intl.string(t.OYzPcW),
body: intl.string(t.oBH7Y2),
hideActionSheet: false
});
}
export function showScreenshareDisabledAlert() {
AlertActionCreators.show({
title: intl.string(t["/x4knx"]),
body: intl.string(t.PpfzUE),
hideActionSheet: false
});
}
export function showMinOSScreenshareRequirementAlert() {
const r24 = intl.formatToPlainString(t.ejOT95, {
errorCode: getErrorInfo(AVError.SCREENSHARE_OS_NOT_SUPPORTED)?.errorCode
});
AlertActionCreators.show({
title: intl.string(t.oblMYa),
body: `${intl.string(t.Wnhd3q)}
${r24}`,
hideActionSheet: false
});
}
export function showTabletRequirementAlert() {
AlertActionCreators.show({
title: intl.string(t["1N0dxa"]),
body: intl.string(t.qqDFVb),
hideActionSheet: false
});
}
export function handleDisconnect(a0) {
dismissGlobalKeyboard();
dismissVoiceChannelScreens(a0, () => {
SelectedChannelActionCreators.selectVoiceChannel(null);
});
}
export { c5758_19 as audioDeviceToIconMap };
export function getAudioDeviceToDisplayText(a0) {
const r3 = {
EARPIECE: intl.string(t.Ouoi6E),
BLUETOOTH_HEADSET: intl.string(t.i6eV3z),
WIRED_HEADSET: intl.string(t.Dluojr),
SPEAKERPHONE: intl.string(t.snEhlu),
INVALID: intl.string(t.kCBL6t)
};
return a0.deviceType === c5758_20.TYPE_BLE_HEADSET ? intl.string(t.BtXSp9) : r3[a0.simpleDeviceType];
}
export { r131 as useMaskedSpeakerStates };
export const useImmediateMaskedSpeakerStates = () => {
let c16819_0, c16819_1;
const stateFromStores = useStateFromStores([AudioRouteStore_native], () => AudioRouteStore_native.getCurrentRouteType());
const isVideoMode2 = useIsVideoMode();
c16819_0 = isVideoMode2;
let r12 = stateFromStores === RouteTypes.SPEAKER;
const r2 = stateFromStores === RouteTypes.BLUETOOTH;
if (!r12) {
r12 = r2;
}
if (!r12) {
r12 = isVideoMode2;
}
c16819_1 = r12;
const [state2, setState2] = useState(r12);
const callback = useCallback(() => {
if (!AudioRouteStore_native.getMultipleRoutesAvailable()) {
c5758_18.cancel();
if (!c16819_0) {
setState2(!state2);
}
}
c5758_17(!state2);
}, [state2, isVideoMode2]);
useEffect(() => {
setState2(c16819_1);
}, [r12, isVideoMode2]);
return {
isAudioRouteEnabled: state2,
toggleAudio: callback,
routeSource: r2 ? Module8854 : Module8855
};
};
@@ -0,0 +1,15 @@
// Metro module 10135 (f10136).
import { AlertModal, AlertActionButton } from "../../../design/components/AlertModal/native/AlertModal.native";
import { intl, t } from "../../../intl/index.native";
import { AlertActions } from "../../../design/components/AlertModal/native/AlertModal.native";
import { openAlert } from "../../../design/components/AlertModal/native/useAlertStore.native";
const ConfirmStartCall = function ConfirmStartCall(props) {
const onConfirm = props.onConfirm;
return <AlertModal title={intl.string(t.HlAPoq)} content={intl.string(t["cRW4D/"])} actions={<AlertActions>
<AlertActionButton key="confirm" variant="active" text={intl.string(t.rimG2R)} onPress={onConfirm} />
<AlertActionButton key="cancel" variant="secondary" text={intl.string(t["ETE/oC"])} />
</AlertActions>} />;
};
export function confirmStartCall(a0) {
openAlert("start-voice-call", <ConfirmStartCall onConfirm={a0} />);
}
@@ -0,0 +1,24 @@
// Metro module 16303 (f16304).
import { NativeModules } from "react-native";
import EmbeddedActivitiesStore from "../../activities/EmbeddedActivitiesStore";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import RTCConnectionStore from "../../../stores/RTCConnectionStore";
import AudioRouteStore_native from "../AudioRouteStore.native";
import { isIOS } from "../../../utils/PlatformUtils";
import Module16304 from "../../../_bundle/Module16304";
import { RouteTypes } from "../VoiceCallTypes";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
let ProximitySensorManager2;
const handleChange = function handleChange() {
const currentRouteType = AudioRouteStore_native.getCurrentRouteType();
const isConnected = RTCConnectionStore.isConnected();
const r3 = EmbeddedActivitiesStore.getCurrentEmbeddedActivity() != null;
const r4 = ApplicationStreamingStore.getAllActiveStreams().length > 0;
ProximitySensorManager2.setProximityMonitoringEnabled(currentRouteType === RouteTypes.RECEIVER && isConnected && (isIOS() || (r3 ? !r3 : !r4)));
};
ProximitySensorManager2 = isIOS() ? NativeModules.ProximitySensorManager : Module16304;
class ProximitySensorManager extends AutomaticLifecycleManager {
stores = new Map().set(AudioRouteStore_native, handleChange).set(RTCConnectionStore, handleChange);
}
const proximitySensorManager = new ProximitySensorManager();
export default proximitySensorManager;
@@ -0,0 +1,30 @@
// Metro module 12823 (f12824).
import MediaEngineStore from "../../../stores/MediaEngineStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import LifecycleManager from "../../../lib/LifecycleManager";
import Dispatcher from "../../../Dispatcher";
import { dismissVoiceChannelScreens, openChannelCallModal } from "../../../utils/native/PrivateChannelCallUtils";
class VoiceActionSheetManager extends LifecycleManager {
channel = null;
handleOpenChannelCallModal = () => {
const channel = this.channel;
if (channel != null) {
Dispatcher.wait(() => {
dismissVoiceChannelScreens(channel);
openChannelCallModal(channel);
});
this.terminate();
}
};
_initialize(a0) {
this.channel = a0;
VoiceStateStore.addChangeListener(this.handleOpenChannelCallModal);
MediaEngineStore.addChangeListener(this.handleOpenChannelCallModal);
}
_terminate() {
VoiceStateStore.removeChangeListener(this.handleOpenChannelCallModal);
MediaEngineStore.removeChangeListener(this.handleOpenChannelCallModal);
}
}
const voiceActionSheetManager = new VoiceActionSheetManager();
export default voiceActionSheetManager;
@@ -0,0 +1,244 @@
// Metro module 13517 (f13518).
import { processColor } from "react-native";
import EmbeddedActivitiesStore from "../../activities/EmbeddedActivitiesStore";
import "../../applications/ApplicationStore";
import ApplicationStreamingStore from "../../../stores/ApplicationStreamingStore";
import "../../../stores/ChannelStore";
import MediaEngineStore from "../../../stores/MediaEngineStore";
import RTCConnectionStore from "../../../stores/RTCConnectionStore";
import "../../../stores/RelationshipStore";
import "../../../stores/UserStore";
import "../../../Constants";
import Module712 from "../../../_bundle/Module712";
import { ServiceNotificationIcon } from "../../foreground_service/mobile/ForegroundServiceManagerTypes";
import LifecycleManager from "../../../lib/LifecycleManager";
function $mk91419($env) {
return () => {
const r3 = $env.$parent[9];
const channelId = r3.getChannelId();
const state = r3.getState();
const r4 = $env[0];
if (!(r4.state.channelId === channelId && r4.state.connectionState === state)) {
r4.handleUpdate({
...r4.state,
channelId,
connectionState: state
});
}
};
}
function $mk91420($env) {
return () => {
const r3 = $env.$parent;
const r8 = r3[8];
const selfMute = r8.isSelfMute() || r8.isSelfMutedTemporarily();
const deafened = r8.isSelfDeaf() || r8.isDeaf();
const r5 = $env;
const mode = r8.getMode();
const PUSH_TO_TALK = r3[12].PUSH_TO_TALK;
const r18 = r5[0];
let r0 = r18.state.selfMute === selfMute && r18.state.deafened === deafened;
const isPushToTalk = mode === PUSH_TO_TALK;
if (r0) {
r0 = r18.state.isPushToTalk === isPushToTalk;
}
if (!r0) {
r18.handleUpdate({
...r18.state,
selfMute,
deafened,
isPushToTalk
});
}
};
}
function $mk91421($env) {
return () => {
const r3 = $env[0];
if (r3.state.channelId != null) {
r3.handleUpdate({
...r3.state,
embeddedActivity: $env.$parent[4].getCurrentEmbeddedActivity()
});
}
};
}
function $mk91422($env) {
return () => {
const isStreaming = $env.$parent[6].getCurrentUserActiveStream() != null;
const r3 = $env[0];
if (r3.state.isStreaming !== isStreaming) {
r3.handleUpdate({
...r3.state,
isStreaming
});
}
};
}
function $mk91423($env) {
return ({ deafened, selfMute, isPushToTalk }) => deafened ? [ServiceNotificationIcon.DEAFENED, c9380_14] : selfMute ? [ServiceNotificationIcon.MUTED, c9380_14] : isPushToTalk ? [ServiceNotificationIcon.DEFAULT, c9380_13] : [ServiceNotificationIcon.IDLE, c9380_13];
}
function $mk91424($env) {
return (a0) => {
L33: {
const r4 = $env;
if (a0.connectionState != null) {
const r24 = r4[0];
const icon = r24.getIcon(r24.state);
const r27 = $env.$parent;
const r9 = r27[3];
const r28 = r9(icon, 2);
const r10 = r28[0];
const r29 = r28[1];
const r31 = r9(r24.getIcon(a0), 2);
const icon2 = r31[0];
const color = r31[1];
if (r24.state.channelId === a0.channelId && r24.state.connectionState === a0.connectionState && r24.state.selfMute === a0.selfMute && r24.state.deafened === a0.deafened) {
if (r24.state.embeddedActivity?.compositeInstanceId === a0.embeddedActivity?.compositeInstanceId && r24.state.isStreaming === a0.isStreaming && r10 === icon2 && r29 === color) {
r24.state = a0;
break L33;
}
}
const { channelId, connectionState, selfMute, deafened, embeddedActivity, isStreaming } = a0;
r24.state = a0;
const channel = r27[7].getChannel(channelId);
if (channel != null) {
const r64 = r27[1];
const r65 = r27[2];
const connectionStatusText = r64(r65[14]).getStatus(connectionState).connectionStatusText;
const r70 = embeddedActivity != null;
let r17 = "";
if (r70) {
const application = r27[5].getApplication(embeddedActivity?.applicationId);
r17 = ` - ${r64(r65[15])(application?.name)}`;
}
const r85 = r27[0];
const r91 = r85(r65[16]).computeChannelName(channel, r27[11], r27[10]);
const r100 = {
title: r85(r65[17]).intl.formatToPlainString(r85(r65[17]).t["aUT3+M"], {
callState: connectionStatusText
}),
content: `${r91}${r17}`,
priority: r85(r65[12]).ServiceNotificationPriority.HIGH,
contentAction: r24.createAction(channel, "SelectVoiceChannel", void 0),
auxiliaryActions: null,
type: null,
usesGateway: true,
icon: null,
color: null
};
const auxiliaryActions = [r24.createAction(channel, "Disconnect", r85(r65[17]).intl.string(r85(r65[17]).t["6vrfgt"])), , ,];
const intl = r85(r65[17]).intl;
const r132 = r85(r65[17]).t;
auxiliaryActions[1] = r24.createAction(channel, "ToggleSelfMute", selfMute ? intl.string(r132.YqAjXy) : intl.string(r132.w4m945));
const intl2 = r85(r65[17]).intl;
const r145 = r85(r65[17]).t;
auxiliaryActions[2] = r24.createAction(channel, "ToggleDeafen", deafened ? intl2.string(r145["2US872"]) : intl2.string(r145.wjcRFX));
r100.auxiliaryActions = auxiliaryActions;
const ServiceNotificationType = r85(r65[12]).ServiceNotificationType;
r100.type = isStreaming ? ServiceNotificationType.SCREEN_SHARE : ServiceNotificationType.VOICE_CALL;
r100.icon = icon2;
r100.color = color;
r64(r65[13]).updateServiceHandler(r24.voiceServiceHandlerId, r100);
} else {
(0, r27[1])(r27[2][13]).removeServiceHandler(r24.voiceServiceHandlerId);
}
} else {
r4[0].state = a0;
}
}
};
}
function $mk91425() {
return (a0, a1, a2) => ({
tag: `${a1}${a0.id}`,
taskName: a1,
title: a2,
data: {
channelId: a0.id
}
});
}
let c9381_0, c9380_15, c9380_16;
let env9380;
let env9381;
const r6 = env9380 = {};
const c9380_13 = processColor(Module712.unsafe_rawColors.BRAND_500);
const c9380_14 = processColor(Module712.unsafe_rawColors.RED_NEW_46);
class VoiceNotificationManager {
constructor() {
let env20505;
const r3 = env20505 = {
$parent: env9380
};
env20505[0] = this;
this.voiceServiceHandlerId = 9000;
this.state = {
channelId: void 0,
connectionState: void 0,
selfMute: false,
deafened: false,
isPushToTalk: false,
embeddedActivity: void 0,
isStreaming: false
};
this.handleVoiceStateChange = $mk91419(r3);
this.handleMediaEngineStateChange = $mk91420(r3);
this.handleEmbeddedActivityStateChange = $mk91421(r3);
this.handleApplicationStreamStateChange = $mk91422(r3);
this.getIcon = $mk91423(env9380);
this.handleUpdate = $mk91424(r3);
this.createAction = $mk91425();
}
initialize() {
RTCConnectionStore.addChangeListener(this.handleVoiceStateChange);
MediaEngineStore.addChangeListener(this.handleMediaEngineStateChange);
EmbeddedActivitiesStore.addChangeListener(this.handleEmbeddedActivityStateChange);
ApplicationStreamingStore.addChangeListener(this.handleApplicationStreamStateChange);
}
terminate() {
RTCConnectionStore.removeChangeListener(this.handleVoiceStateChange);
MediaEngineStore.removeChangeListener(this.handleMediaEngineStateChange);
EmbeddedActivitiesStore.removeChangeListener(this.handleEmbeddedActivityStateChange);
ApplicationStreamingStore.removeChangeListener(this.handleApplicationStreamStateChange);
}
}
const r59 = {
__proto__: VoiceNotificationManager.prototype
};
const r60 = env9381 = {
$parent: r6
};
c9381_0 = r59;
r59.voiceServiceHandlerId = 9000;
r59.state = {
channelId: void 0,
connectionState: void 0,
selfMute: false,
deafened: false,
isPushToTalk: false,
embeddedActivity: void 0,
isStreaming: false
};
r59.handleVoiceStateChange = $mk91419(r60);
r59.handleMediaEngineStateChange = $mk91420(r60);
r59.handleEmbeddedActivityStateChange = $mk91421(r60);
r59.handleApplicationStreamStateChange = $mk91422(r60);
r59.getIcon = $mk91423(r6);
r59.handleUpdate = $mk91424(r60);
r59.createAction = $mk91425();
c9380_15 = r59;
class VoiceNotificationLifecycleManager extends LifecycleManager {
constructor() {
super(...arguments);
}
_initialize() {
c9380_15.initialize();
}
_terminate() {
c9380_15.terminate();
}
}
c9380_16 = VoiceNotificationLifecycleManager;
const r78 = new VoiceNotificationLifecycleManager();
export default r78;
@@ -0,0 +1,41 @@
// Metro module 12840 (f12841).
import { useCallback } from "react";
import { View } from "react-native";
import PermissionStore from "../../../../stores/PermissionStore";
import { Permissions } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import useIsVoiceChannelFull from "../../useIsVoiceChannelFull";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { intl, t } from "../../../../intl/index.native";
import { dismissGlobalKeyboard } from "../../../../utils/native/KeyboardManagerUtils";
import SelectedChannelActionCreators from "../../../../actions/SelectedChannelActionCreators";
import { Button } from "../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flexDirection: "row"
}
});
export default function JoinVoiceChannelButton(props) {
let disabled;
const { channel, style } = props;
const styles = useStyles();
const isVoiceChannelFull = useIsVoiceChannelFull(channel);
const stateFromStores = useStateFromStores([PermissionStore], () => !PermissionStore.can(Permissions.CONNECT, channel));
let text = intl.string(t.eIi3Om);
if (isVoiceChannelFull) {
text = intl.string(t.rZfiNq);
disabled = true;
} else {
disabled = false;
if (stateFromStores) {
text = intl.string(t.TVBCKZ);
disabled = true;
}
}
return <View style={[styles.container, style]}>
<Button disabled={disabled} text={text} onPress={useCallback(() => {
dismissGlobalKeyboard();
SelectedChannelActionCreators.selectVoiceChannel(channel.id);
}, [channel.id])} />
</View>;
};
@@ -0,0 +1,54 @@
// Metro module 12822 (f12823).
import { useEffect } from "react";
import { View, StyleSheet } from "react-native";
import SortedVoiceStateStore from "../../../../stores/views/SortedVoiceStateStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { isModalOpen } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { getVoiceChannelKey } from "../../../../utils/native/PrivateChannelCallUtils";
import VoiceActionSheetManager from "../VoiceActionSheetManager";
import NUFChannelsManager from "../../../nuf_channels/native/NUFChannelsManager";
import { ActionSheet } from "../../../../design/components/Sheet/native/ActionSheet.native";
import NUFVoiceChannelsTemplate from "../../../nuf_channels/native/components/NUFVoiceChannelsTemplate";
import GuildEventVoiceBanner from "../../../guild_scheduled_events/native/components/GuildEventVoiceBanner";
import VoiceEmptyState from "./VoiceEmptyState";
import VisualEffectView from "../../../visual_effect_view/native/VisualEffectView";
import VoiceMemberList from "./VoiceMemberList";
const useStyles = createStyles({
container: {
flex: 1
},
visualEffectView: {
...StyleSheet.absoluteFillObject,
overflow: "hidden"
}
});
export default function VoiceActionSheet(props) {
const channel = props.channel;
const styles = useStyles();
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.VOICE_ACTION_SHEET).analyticsLocations;
const stateFromStores = useStateFromStores([SortedVoiceStateStore], () => SortedVoiceStateStore.countVoiceStatesForChannel(channel.id) === 0);
useEffect(() => {
if (!isModalOpen(getVoiceChannelKey(channel.id))) {
VoiceActionSheetManager.initialize(channel);
}
return () => {
VoiceActionSheetManager.terminate();
};
}, [channel]);
return <AnalyticsLocationProvider value={analyticsLocations}>
{NUFChannelsManager.requiresVoiceChannelsOnboard() ? <ActionSheet>
<NUFVoiceChannelsTemplate channel={channel} />
</ActionSheet> : stateFromStores ? <ActionSheet>
<GuildEventVoiceBanner channel={channel} />
<VoiceEmptyState channel={channel} />
</ActionSheet> : <ActionSheet scrollable startExpanded>
<View style={styles.container}>
<VisualEffectView blurTheme="dark" style={styles.visualEffectView} />
<VoiceMemberList channel={channel} />
</View>
</ActionSheet>}
</AnalyticsLocationProvider>;
};
@@ -0,0 +1,112 @@
// Metro module 12851 (f12852).
import { View } from "react-native";
import EmbeddedActivitiesStore from "../../../activities/EmbeddedActivitiesStore";
import GuildStore from "../../../../stores/GuildStore";
import PermissionStore from "../../../../stores/PermissionStore";
import { AnalyticsPages, InstantInviteSources, Permissions } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import CallStateHooks, { CallStates } from "../CallStateHooks";
import OngoingCallStatusLabel from "../components/OngoingCallStatusLabel";
import { Text } from "../../../../design/components/Text/native/Text";
import OngoingCallTimer from "../components/OngoingCallTimer";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useIsVoiceChannelFull from "../../useIsVoiceChannelFull";
import useChannelName from "../../../channel/useChannelName";
import { showInstantInviteActionSheet } from "../../../instant_invite/native/InstantInviteUtils";
import { intl, t } from "../../../../intl/index.native";
import { navigateToNewGroupDM } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { Icon } from "../../../../design/void/native";
import isRoleRequired from "../../../channel/isRoleRequired";
import Module12856 from "../../../../_bundle/Module12856";
import Module10805 from "../../../../_bundle/Module10805";
import Module10223 from "../../../../_bundle/Module10223";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
let useStyles, AddMemberButton, IconButton;
const PrivateChannelSubtitle = function PrivateChannelSubtitle(props) {
const channel2 = props.channel;
const styles = useStyles();
const state = CallStateHooks(channel2.id).state;
return <View style={styles.subtitleWrapper}>
<OngoingCallStatusLabel useAllAloneText={false} channel={channel2} voiceState={state} style={styles.subtitle} />
{state === CallStates.CONNECTED && <Text style={styles.subtitle} variant="text-xs/medium" color="text-overlay-light">{" - "}</Text>}
{state === CallStates.CONNECTED && <OngoingCallTimer channelId={channel2.id} style={styles.subtitle} />}
</View>;
};
export function VoiceChannelHeader(props) {
let stateFromStores;
const channel = props.channel;
stateFromStores = void 0;
const styles = useStyles();
const stateFromStores2 = useStateFromStores([GuildStore], () => GuildStore.getGuild(channel.getGuildId()));
const isVoiceChannelFull = useIsVoiceChannelFull(channel);
stateFromStores = useStateFromStores([EmbeddedActivitiesStore], () => EmbeddedActivitiesStore.getSelfEmbeddedActivityForChannel(channel.id), [channel]);
const channelName = useChannelName(channel);
let r17 = stateFromStores2?.name;
let onPress = PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, channel) ? isVoiceChannelFull ? null : () => showInstantInviteActionSheet(channel, {
source: InstantInviteSources.VOICE_CHANNEL,
targetApplicationId: stateFromStores?.applicationId
}) : null;
const isPrivate = channel.isPrivate();
let r19 = channelName;
if (isPrivate) {
r19 = intl.formatToPlainString(t["8bn8Br"], {
count: channel.recipients.length + 1
});
r17 = <PrivateChannelSubtitle channel={channel} />;
onPress = () => navigateToNewGroupDM(channel.id, AnalyticsPages.CHANNEL_CALL);
}
const r81 = [<Icon size={Icon.Sizes.MEDIUM} source={isRoleRequired(channel) ? Module12856 : Module10805} disableColor style={styles.icons} />, , ,];
let r84 = r19;
if (typeof r84 === "string") {
r84 = <Text lineClamp={1} lineBreakMode="tail" variant="text-md/semibold" color="text-overlay-light">{r19}</Text>;
}
const r89 = [r84, ,];
let r90 = r17;
if (typeof r90 === "string") {
r90 = <Text lineClamp={1} lineBreakMode="tail" variant="text-xs/medium" color="text-overlay-light">{r17}</Text>;
}
r89[1] = r90;
r81[1] = <View style={styles.middle}>{r89}</View>;
r81[2] = <View style={styles.icons}>
{onPress != null && <AddMemberButton onPress={onPress} />}
</View>;
return <View style={styles.container}>{r81}</View>;
}
AddMemberButton = function AddMemberButton(props) {
return <IconButton onPress={props.onPress} iconSource={Module10223} iconStyle={useStyles().icons} accessibilityLabel={intl.string(t["6Qgrev"])} />;
};
IconButton = function IconButton(props) {
const onPress = props.onPress;
return <PressableOpacity accessibilityRole="button" accessibilityLabel={props.accessibilityLabel} onPress={onPress} style={props.style}>
<Icon source={props.iconSource} style={props.iconStyle} />
</PressableOpacity>;
};
useStyles = createStyles({
container: {
alignSelf: "stretch",
flexDirection: "row",
paddingVertical: 10,
paddingHorizontal: 16,
alignItems: "center"
},
middle: {
flex: 1,
justifyContent: "space-around",
marginHorizontal: 16
},
icons: {
flexDirection: "row",
tintColor: Module712.colors.WHITE
},
subtitle: {
fontSize: 12,
lineHeight: 16,
color: Module712.colors.WHITE
},
subtitleWrapper: {
flexDirection: "row"
}
});
export default VoiceChannelHeader;
export { IconButton };
@@ -0,0 +1,43 @@
// Metro module 12838 (f12839).
import { View } from "react-native";
import { Fonts } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import TextStyles from "../../../rebrand/native/TextStyles";
import Module712 from "../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { ThemedEmptyState } from "../../../../design/void/native";
import { intl, t } from "../../../../intl/index.native";
import Module12839 from "../../../../_bundle/Module12839";
import JoinVoiceChannelButton from "./JoinVoiceChannelButton";
const useStyles = createStyles({
container: {
justifyContent: "center"
},
button: {
paddingHorizontal: 12,
paddingTop: 16
},
emptyTitle: {
...TextStyles(Fonts.DISPLAY_EXTRABOLD, Module712.colors.MOBILE_TEXT_HEADING_PRIMARY, 18),
textTransform: "none",
lineHeight: 24
},
emptyBody: {
...TextStyles(Fonts.PRIMARY_MEDIUM, Module712.colors.TEXT_SUBTLE, 16),
lineHeight: 20,
fontWeight: "600"
}
});
export default function VoiceEmptyState(props) {
const channel = props.channel;
const styles = useStyles();
return <View style={[styles.container, {
paddingBottom: useSafeAreaInsets_native().bottom
}]}>
<ThemedEmptyState title={intl.string(t["/HABZo"])} body={intl.string(t["5Jy2FY"])} lightSource={Module12839} darkSource={Module12839} titleStyle={styles.emptyTitle} bodyStyle={styles.emptyBody} imageStyle={{
marginBottom: 16,
marginTop: 20
}} />
<JoinVoiceChannelButton channel={channel} style={styles.button} />
</View>;
};
@@ -0,0 +1,106 @@
// Metro module 16178 (f16179).
import { AnalyticEvents } from "../../../../Constants";
import { AudioFeedbackOption, ConnectionFeedbackOption, FeedbackCategory, FeedbackType, PeopleFeedbackOption, VideoFeedbackOption } from "../../../feedback/Constants";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { intl, t } from "../../../../intl/index.native";
import Feedback_messages from "../../../feedback/intl/Feedback.messages";
import { getConnectionFeedbackOptions, getAudioFeedbackOptions, getVideoFeedbackOptions, getPeopleFeedbackOptions, processOptOut } from "../../../feedback/FeedbackUtils";
import FeedbackActionSheetV2 from "../../../feedback/native/FeedbackActionSheetV2";
import trackVoiceFeedback from "../../trackVoiceFeedback";
import { shouldShowLogUploadForCategory } from "../../../feedback/shouldShowLogUploadForCategory";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { presentFeedbackSent } from "../../../toast/native/ToastUtils";
const trackOpen = function trackOpen() {
AnalyticsUtils.track(AnalyticEvents.OPEN_POPOUT, {
type: "Call Session Feedback"
});
};
export default function VoiceFeedbackActionSheet(props) {
const analyticsData = props.analyticsData;
const headerLabel = intl.string(t.Ss6tlb);
const ratingBody = intl.string(t.tLi4cR);
const r10 = {
value: FeedbackCategory.CONNECTION,
label: intl.string(Feedback_messages.FVhMw6),
problemsHeader: intl.string(t.FJmoxF),
problemOptions: getConnectionFeedbackOptions(),
freeformConfig: {
value: ConnectionFeedbackOption.FREEFORM,
label: intl.string(t.emlT91)
}
};
const r9 = {
value: FeedbackCategory.AUDIO,
label: intl.string(Feedback_messages.PL2l6A),
problemsHeader: intl.string(t.FJmoxF),
problemOptions: getAudioFeedbackOptions({
isMobile: true
}),
freeformConfig: {
value: AudioFeedbackOption.FREEFORM,
label: intl.string(t.emlT91)
}
};
const r100 = {
value: FeedbackCategory.VIDEO,
label: intl.string(Feedback_messages["0WFzPh"]),
problemsHeader: intl.string(t.FJmoxF),
problemOptions: getVideoFeedbackOptions(),
freeformConfig: {
value: VideoFeedbackOption.FREEFORM,
label: intl.string(t.emlT91)
}
};
const r134 = {
value: FeedbackCategory.PEOPLE,
label: intl.string(Feedback_messages.Moa3W9),
problemsHeader: intl.string(t.FJmoxF),
problemOptions: getPeopleFeedbackOptions(),
freeformConfig: {
value: PeopleFeedbackOption.FREEFORM,
label: intl.string(t.emlT91)
}
};
return <FeedbackActionSheetV2 headerLabel={headerLabel} showHeaderCloseButton ratingBody={ratingBody} categoriesHeader={intl.string(Feedback_messages.tq8598)} optionsTree={[r10, r9, r100, r134]} trackOpen={trackOpen} trackReport={function trackReport(a0) {
const { rating, category, reason, dontShowAgain } = a0;
let feedback = a0.feedback;
if (dontShowAgain) {
processOptOut({
feedbackType: FeedbackType.VOICE,
location: "VoiceFeedbackActionSheet"
});
}
L17: {
if (rating != null) {
const CALL_REPORT_PROBLEM = AnalyticEvents.CALL_REPORT_PROBLEM;
let reasonDescription = reason?.value;
if (reasonDescription == null) {
reasonDescription = null;
}
let variant = reason?.variant;
if (variant == null) {
variant = null;
}
if (feedback == null) {
feedback = "";
}
trackVoiceFeedback(CALL_REPORT_PROBLEM, {
rating,
category,
reasonDescription,
variant,
feedback,
analyticsData
});
if (reason != null && shouldShowLogUploadForCategory(rating, category, reason)) {
ActionSheetActionCreators.openLazy(import("../../../feedback/native/UploadLogsActionSheet"), "UploadLogs", {
mediaSessionId: analyticsData.media_session_id,
rtcConnectionId: analyticsData.rtc_connection_id
});
break L17;
}
presentFeedbackSent();
}
}
}} />;
};
@@ -0,0 +1,184 @@
// Metro module 12842 (f12843).
import { Image as Image2, View } from "react-native";
import EmbeddedActivitiesStore from "../../../activities/EmbeddedActivitiesStore";
import ChannelStore from "../../../../stores/ChannelStore";
import UserStore from "../../../../stores/UserStore";
import { getThemedRippleConfig } from "../../../../design/void/Form/native/FormConstants";
import { ACTION_SHEET_MAX_WIDTH } from "../../../action_sheet/native/ActionSheetConstants";
import { AvatarSizes, AVATAR_SIZE_MAP, SummarizedIconRow, OverflowText, CutoutableAvatarImage, CutoutDirection } from "../../../../design/void/native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useGetOrFetchApplications from "../../../applications/useGetOrFetchApplications";
import { isNotNullish } from "../../../../utils/GlobalUtils";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { getEmbeddedActivityLocationGuildId } from "../../../activities/utils/embeddedActivityLocationUtils";
import { useEmbeddedActivityJoinability, EmbeddedActivityJoinability } from "../../../activities/utils/getEmbeddedActivityJoinability";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import Module6614 from "../../../../_bundle/Module6614";
import handlePressJoinActivity from "../../../activities/handlePressJoinActivity";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
import EmbeddedActivityBackgroundImageWithOverlay from "../../../activities/native/EmbeddedActivityBackgroundImageWithOverlay";
import { BaseTextButton } from "../../../../design/components/Button/native/BaseTextButton.native";
const XSMALL = AvatarSizes.XSMALL;
const themedRippleConfig = getThemedRippleConfig({
foreground: true
});
const appIcon = {
width: 32,
height: 32,
marginRight: 16,
borderRadius: 4
};
let c8857_14 = 1.7777777777777777;
const useStyles = createStyles({
voiceMemberItemRow: {
paddingTop: 12,
paddingBottom: 16,
flexDirection: "column",
display: "flex",
justifyContent: "flex-start"
},
innerRow: {
paddingHorizontal: 16,
alignItems: "center"
},
activityDetails: {
marginBottom: 8,
flexDirection: "row",
display: "flex"
},
appIcon,
appIconPlaceholder: {
...appIcon,
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT
},
centerGroup: {
flex: 1,
paddingRight: 4
},
applicationName: {
lineHeight: 20
},
joinButton: {
alignSelf: "center"
},
joinButtonPill: {
borderRadius: 100,
paddingHorizontal: 24
},
joinButtonContainer: {
alignItems: "center",
justifyContent: "center",
display: "flex",
width: "100%",
paddingHorizontal: 16
},
overflow: {
height: AVATAR_SIZE_MAP[XSMALL]
},
overflowBackgroundColor: {
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL
},
overflowBackgroundColorActionSheet: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
}
});
export default function VoiceMemberEmbeddedActivity(props) {
let c20245_2, stateFromStores, stateFromStores2, embeddedActivityLocationGuildId, embeddedActivityJoinability;
const { embeddedActivity, channelId, onItemPress, isActionSheet } = props;
c20245_2 = void 0;
stateFromStores = void 0;
stateFromStores2 = void 0;
embeddedActivityLocationGuildId = void 0;
embeddedActivityJoinability = void 0;
const handleCanJoin2 = function handleCanJoin() {
let r3 = c20245_2;
if (r3 == null) {
r3 = void 0;
}
let r6 = stateFromStores2;
if (stateFromStores2 == null) {
r6 = void 0;
}
onItemPress(stateFromStores, r3, r6);
};
const styles = useStyles();
const [application] = useGetOrFetchApplications([embeddedActivity.applicationId]);
c20245_2 = application;
const items = Array.from(embeddedActivity.userIds).map((item) => UserStore.getUser(item)).filter(isNotNullish);
stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
stateFromStores2 = useStateFromStores([EmbeddedActivitiesStore], () => stateFromStores != null ? EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(stateFromStores.id).find((item) => item.applicationId === c20245_2?.id) : null);
embeddedActivityLocationGuildId = getEmbeddedActivityLocationGuildId(embeddedActivity.location);
embeddedActivityJoinability = useEmbeddedActivityJoinability({
userId: UserStore.getCurrentUser()?.id,
channelId,
application
});
const r80 = Math.min(ACTION_SHEET_MAX_WIDTH, useWindowDimensions_native().width);
const r81 = r80 - 32;
if (application != null && stateFromStores2 != null) {
let source = application.getIconSource(32);
if (source == null) {
source = Module6614;
}
const height = 40 + r81 / c8857_14 + 12 + 16;
const name = application.name;
const width = r80 - 32;
const props2 = {
accessibilityRole: "button",
accessibilityLabel: intl.formatToPlainString(t.Yw5Hr2, {
applicationName: name
}),
androidRippleConfig: themedRippleConfig,
onPress: () => {
handlePressJoinActivity({
embeddedActivityJoinability,
handleCanJoin: handleCanJoin2
});
},
children: null
};
const r123 = [<Image2 style={source === Module6614 ? styles.appIconPlaceholder : styles.appIcon} source={source} />, <View style={styles.centerGroup}>
<Text style={styles.applicationName} variant="text-md/semibold" color="mobile-text-heading-primary">{name}</Text>
</View>, ,];
const overflowStyle = [styles.overflow, ,];
const r137 = isActionSheet ? styles.overflowBackgroundColorActionSheet : styles.overflowBackgroundColor;
const height2 = width / c8857_14;
overflowStyle[1] = r137;
r123[2] = <SummarizedIconRow offsetAmount={-6} overflowStyle={overflowStyle} overflowComponent={OverflowText} items={items} max={5} renderItem={(info, a1) => <CutoutableAvatarImage user={info} guildId={embeddedActivityLocationGuildId} size={XSMALL} cutout={a1 ? void 0 : {
radius: AVATAR_SIZE_MAP[XSMALL] / 2 + 3,
direction: CutoutDirection.RIGHT,
inset: -6
}} />} />;
props2.children = <View style={[styles.voiceMemberItemRow, {
height
}]}>
<View style={[styles.innerRow, styles.activityDetails]}>{r123}</View>
<View style={[styles.innerRow, {
height: height2,
justifyContent: "center"
}]}>
<EmbeddedActivityBackgroundImageWithOverlay application={application} dimensionsStyle={{
position: "absolute",
width,
height: height2
}} borderRadius={8} resizeMode="contain" />
<View style={styles.joinButtonContainer}>
{embeddedActivityJoinability === EmbeddedActivityJoinability.CAN_JOIN ? <BaseTextButton onPress={() => {
handlePressJoinActivity({
embeddedActivityJoinability,
handleCanJoin: handleCanJoin2
});
}} style={styles.joinButton} pillStyle={styles.joinButtonPill} text={intl.string(t["4i2vj+"])} variant="secondary" size="sm" shrink /> : null}
</View>
</View>
</View>;
return <PressableOpacity {...props2} />;
}
return null;
};
export function calculateActivityRowHeight(a0) {
return 40 + (a0 - 32) / c8857_14 + 12 + 16;
}
@@ -0,0 +1,288 @@
// Metro module 12841 (f12842).
import { memo, forwardRef, useCallback } from "react";
import { SectionList, View } from "react-native";
import EmbeddedActivitiesStore from "../../../activities/EmbeddedActivitiesStore";
import UserRecord from "../../../../records/UserRecord";
import ApplicationStreamingStore from "../../../../stores/ApplicationStreamingStore";
import PermissionStore from "../../../../stores/PermissionStore";
import UserStore from "../../../../stores/UserStore";
import SortedVoiceStateStore from "../../../../stores/views/SortedVoiceStateStore";
import { AnalyticsPages, InstantInviteSources, Permissions } from "../../../../Constants";
import { FORM_ROW_VERTICAL_PADDING } from "../../../../design/void/Form/native/FormConstants";
import { ACTION_SHEET_MAX_WIDTH } from "../../../action_sheet/native/ActionSheetConstants";
import { ThemeTypes } from "../../../../_bundle/Module505";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import GuildEventVoiceBanner from "../../../guild_scheduled_events/native/components/GuildEventVoiceBanner";
import useIsVoiceChannelFull from "../../useIsVoiceChannelFull";
import { useStateFromStores, useStateFromStoresArray } from "../../../../_bundle/Module589";
import { FormDivider, FormRow } from "../../../../design/void/Form/native/index";
import { CircularIconButton } from "../../../../design/void/IconButton/native/IconButton";
import { intl, t } from "../../../../intl/index.native";
import Module10223 from "../../../../_bundle/Module10223";
import { navigateToNewGroupDM, useIsModalOpen } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { showInstantInviteActionSheet } from "../../../instant_invite/native/InstantInviteUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { useAnalyticsContext } from "../../../../hooks/analytics";
import useAnalyticsLocations from "../../../app_analytics/useAnalyticsLocations";
import { dismissGlobalKeyboard } from "../../../../utils/native/KeyboardManagerUtils";
import SelectedChannelActionCreators from "../../../../actions/SelectedChannelActionCreators";
import handleJoinEmbeddedActivity from "../../../activities/handleJoinEmbeddedActivity";
import { hideVoiceChannelActionSheet, getVoiceChannelKey } from "../../../../utils/native/PrivateChannelCallUtils";
import VoiceMemberEmbeddedActivity, { calculateActivityRowHeight } from "./VoiceMemberEmbeddedActivity";
import VoiceMemberUser, { DisconnectedUserRow, STREAM_PREVIEW_MARGIN } from "./VoiceMemberUser";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import useSelectedActiveStream from "../../../video_calls/native/useSelectedActiveStream";
import Module12 from "../../../../_bundle/Module12";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import showUserProfileActionSheet from "../../../user_profile/native/showUserProfileActionSheet";
import { ThemeContextProvider } from "../../../../_bundle/Module3901";
import { VoiceChannelHeader } from "./VoiceChannelHeader";
import FastList from "../../../../lib/native/FastList";
let useStyles, Component2, Component, VoiceMemberListSectionHeader, renderSectionHeader, c8856_30, extractKey, VoiceSectionRow;
const ItemSeparator = function ItemSeparator() {
return <FormDivider style={useStyles().rowFormDivider} />;
};
VoiceMemberListSectionHeader = function VoiceMemberListSectionHeader(props) {
const title = props.title;
const styles2 = useStyles();
return <View style={styles2.sectionContainer}>
<Text style={styles2.sectionTitle} variant="text-xs/bold" color="text-default">
{title.toUpperCase()}
</Text>
</View>;
};
renderSectionHeader = function renderSectionHeader(a0) {
const title = a0.section.title;
return title != null ? <VoiceMemberListSectionHeader title={title} /> : null;
};
extractKey = function extractKey(a0) {
return a0 instanceof UserRecord ? a0.id : a0.url !== void 0 && a0.applicationId !== void 0 ? a0.applicationId : a0.user.id;
};
VoiceSectionRow = function VoiceSectionRow(props) {
let _onItemPress2;
const { item, channelId, onPressUser, isActionSheet } = props;
const analyticsContext = useAnalyticsContext();
const analyticsLocations = useAnalyticsLocations().analyticsLocations;
if (item.url !== void 0 && item.applicationId !== void 0) {
_onItemPress2 = function _onItemPress() {
const r9 = async (c30585_0, c30585_1, c30585_2) => {
let c30585_4;
let c31666_0;
L18: {
c30585_4 = void 0;
c31666_0 = c30585_0;
if (c30585_0 != null && c30585_1 != null && c30585_2 != null) {
dismissGlobalKeyboard();
SelectedChannelActionCreators.selectVoiceChannel(c30585_0.id);
await handleJoinEmbeddedActivity({
applicationId: c30585_2.applicationId,
activityChannelId: c30585_0.id,
locationObject: analyticsContext.location,
analyticsLocations
});
if (!isActionSheet) {
break L18;
}
hideVoiceChannelActionSheet(c31666_0);
break L18;
}
return void 0;
}
};
_onItemPress2 = r9;
return r9.apply(this, arguments);
};
return <VoiceMemberEmbeddedActivity embeddedActivity={item} channelId={channelId} onItemPress={function onItemPress(event, a1, a2) {
return _onItemPress2.apply(this, arguments);
}} isActionSheet={isActionSheet} />;
}
return <VoiceMemberUser {...item} onPress={onPressUser} isActionSheet={isActionSheet} />;
};
useStyles = createStyles({
container: {
flex: 1,
flexShrink: 1
},
sectionContainer: {
paddingTop: 16,
paddingHorizontal: 16
},
sectionTitle: {
lineHeight: 16
},
voiceChannelContainer: {
overflow: "hidden",
flexGrow: 1,
flexShrink: 1,
minHeight: 1
},
headerFormDivider: {
marginLeft: 0
},
rowFormDivider: {
marginHorizontal: 16
}
});
Component2 = memo(function(a0) {
return <GuildEventVoiceBanner channel={a0.channel} />;
});
Component = memo(function({ channel }) {
const isVoiceChannelFull = useIsVoiceChannelFull(channel);
const stateFromStores = useStateFromStores([PermissionStore], () => PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, channel) || channel.isPrivate(), [channel]);
return isVoiceChannelFull ? null : stateFromStores ? <>
<ItemSeparator />
<FormRow leading={<CircularIconButton accessibilityLabel={intl.string(t["6Qgrev"])} accessibilityHidden source={Module10223} size={CircularIconButton.Sizes.MEDIUM_32} />} label={intl.string(t["6Qgrev"])} onPress={() => {
if (channel.isPrivate()) {
navigateToNewGroupDM(channel.id, AnalyticsPages.CHANNEL_CALL);
} else {
showInstantInviteActionSheet(channel, {
source: InstantInviteSources.VOICE_CHANNEL
});
}
}} />
</> : null;
});
c8856_30 = {
VOICE: 0,
0: "VOICE",
SPECTATING: 1,
1: "SPECTATING",
DISCONNECTED: 2,
2: "DISCONNECTED"
};
const r85 = forwardRef(function VoiceMemberList(props, a1) {
let sections;
let c20244_5, stateFromStoresArray, c20244_7, c20244_8, callback, callback2;
const { channel: channel2, isActionSheet: isActionSheet3 = true, disableFooter: _disableFooter, ...props2 } = props;
const isActionSheet2 = isActionSheet3;
let disableFooter = props.disableFooter;
if (disableFooter === void 0) {
disableFooter = false;
}
c20244_5 = void 0;
stateFromStoresArray = void 0;
c20244_7 = void 0;
c20244_8 = void 0;
callback = void 0;
callback2 = void 0;
const styles = useStyles();
const analyticsLocations2 = useAnalyticsLocations().analyticsLocations;
let c20244_4 = Math.min(useWindowDimensions_native().width, ACTION_SHEET_MAX_WIDTH);
const stateFromStores = useStateFromStores([SortedVoiceStateStore], () => SortedVoiceStateStore.getVoiceStatesForChannel(channel2), [channel2]);
const selectedActiveStream = useSelectedActiveStream(channel2);
c20244_5 = selectedActiveStream;
stateFromStoresArray = useStateFromStoresArray([ApplicationStreamingStore], () => c20244_5 != null ? ApplicationStreamingStore.getViewerIds(c20244_5) : []);
const isModalOpen = useIsModalOpen(getVoiceChannelKey(channel2.id));
const stateFromStores2 = useStateFromStores([EmbeddedActivitiesStore], () => EmbeddedActivitiesStore.getEmbeddedActivitiesForChannel(channel2.id));
c20244_7 = new Set(stateFromStores.map((stateFromStore) => stateFromStore.voiceState.userId));
const isPrivate = channel2.isPrivate();
const r24 = [];
const data = isPrivate ? channel2.recipients.reduce((acc, recipient) => {
const user = UserStore.getUser(recipient);
if (!(user == null || c20244_7.has(user.id))) {
acc.push(user);
}
return acc;
}, r24) : r24;
L22: {
sections = [];
c20244_8 = sections;
if (selectedActiveStream != null && (stateFromStoresArray != null && isModalOpen)) {
let username = stateFromStores.find((stateFromStore) => stateFromStore.user.id === c20244_5.ownerId)?.nick;
if (username == null) {
username = "";
}
const [data2, r108] = Module12.partition(stateFromStores, (a0) => stateFromStoresArray.includes(a0.user.id));
if (data2.length > 0) {
sections.push({
type: c8856_30.SPECTATING,
title: intl.formatToPlainString(t.Fb0eT9, {
username
}),
data: data2
});
}
if (r108.length > 0) {
sections.push({
type: c8856_30.VOICE,
title: intl.string(t.C7iIKB),
data: stateFromStores2.concat(r108)
});
}
if (!(data.length > 0)) {
break L22;
}
sections.push({
type: c8856_30.DISCONNECTED,
title: intl.string(t.BnSq1I),
data
});
} else {
sections.push({
type: c8856_30.VOICE,
title: null,
data: stateFromStores2.concat(stateFromStores)
});
if (data.length > 0) {
sections.push({
type: c8856_30.DISCONNECTED,
title: null,
data
});
}
}
}
callback = useCallback((a0) => {
ActionSheetActionCreators.hideActionSheet();
showUserProfileActionSheet({
userId: a0.id,
channelId: channel2.id,
isVoiceContext: true,
sourceAnalyticsLocations: analyticsLocations2
});
}, [channel2.id, analyticsLocations2]);
callback2 = useCallback((a0) => {
const item = a0.item;
const type = a0.section.type;
if (c8856_30.VOICE === type) {
return item instanceof UserRecord ? null : <VoiceSectionRow item={item} channelId={channel2.id} onPressUser={callback} isActionSheet={isActionSheet2} />;
}
if (c8856_30.SPECTATING === type) {
return <VoiceMemberUser {...item} onPress={callback} isSpectating isActionSheet={isActionSheet2} />;
}
if (c8856_30.DISCONNECTED === type) {
return <DisconnectedUserRow user={item} channel={channel2} isActionSheet={isActionSheet2} onPress={callback} />;
}
}, [channel2, isActionSheet2, callback]);
return isActionSheet2 ? <ThemeContextProvider theme={ThemeTypes.DARK}>
<View style={styles.container}>
<VoiceChannelHeader channel={channel2} />
<FormDivider style={styles.headerFormDivider} />
<FastList inActionSheet style={styles.voiceChannelContainer} {...props2} renderItem={function renderRow(info, a1) {
const item = c20244_8[info].data[a1];
if (item == null) {
return null;
}
return <>
{callback2({
item,
section: c20244_8[info]
})}
<FormDivider style={styles.rowFormDivider} />
</>;
}} itemSize={function getRowHeight(a0, a1) {
if (a1 == null) {
return 0;
}
const r16 = c20244_8[a0].data[a1];
if (r16 == null) {
return 0;
}
const r12 = 0.5625 * (c20244_4 - 2 * STREAM_PREVIEW_MARGIN) + STREAM_PREVIEW_MARGIN;
const r30 = FORM_ROW_VERTICAL_PADDING + 32;
return r16 instanceof UserRecord ? r30 : r16.url !== void 0 && r16.applicationId !== void 0 ? calculateActivityRowHeight(c20244_4) : r16.voiceState?.selfStream ? r30 + r12 : r30;
}} sections={sections.map((section) => section.data.length)} />
</View>
</ThemeContextProvider> : <SectionList ref={a1} sections={sections} renderSectionHeader={renderSectionHeader} renderItem={callback2} keyExtractor={extractKey} ItemSeparatorComponent={ItemSeparator} ListFooterComponent={disableFooter ? null : <Component channel={channel2} />} ListHeaderComponent={<Component2 channel={channel2} />} stickySectionHeadersEnabled={false} {...props2} />;
});
export default r85;
@@ -0,0 +1,273 @@
// Metro module 12843 (f12844).
import { memo } from "react";
import { View, Platform } from "react-native";
import ThemeStore from "../../../user_settings/ThemeStore";
import AuthenticationStore from "../../../../stores/AuthenticationStore";
import CallStore from "../../../../stores/CallStore";
import ChannelStore from "../../../../stores/ChannelStore";
import GuildMemberStore from "../../../../stores/GuildMemberStore";
import MediaEngineStore from "../../../../stores/MediaEngineStore";
import PresenceStore from "../../../../stores/PresenceStore";
import { Fonts } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useIsSpeaking from "../../../../hooks/useIsSpeaking";
import { useStateFromStores, useStateFromStoresObject } from "../../../../_bundle/Module589";
import { isThemeDark } from "../../../../design/shared";
import Module12844 from "../../../../_bundle/Module12844";
import Module12845 from "../../../../_bundle/Module12845";
import { LegacyText, Avatar, AvatarSizes, Icon, LiveTag } from "../../../../design/void/native";
import Module12846 from "../../../../_bundle/Module12846";
import Module12847 from "../../../../_bundle/Module12847";
import Module12848 from "../../../../_bundle/Module12848";
import Module12849 from "../../../../_bundle/Module12849";
import Module8346 from "../../../../_bundle/Module8346";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { FormSubLabel, FormRow } from "../../../../design/void/Form/native/index";
import { getStreamerActivityByUserId } from "../../../go_live/utils/StreamerApplicationSelectors";
import TouchableStreamPreview from "../../../../components_native/TouchableStreamPreview";
import { isModalOpen } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native";
import { getVoiceChannelKey } from "../../../../utils/native/PrivateChannelCallUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import CallActionCreators from "../../../../actions/CallActionCreators";
import NicknameUtils from "../../../../utils/NicknameUtils";
import { useCanRing } from "../../../calls/useCanRing";
import UserUtils from "../../../../utils/UserUtils";
let useStyles, useStyles2, Component, RingButton, StopRingButton;
const StreamingUserRow = function StreamingUserRow(props) {
const styles = useStyles();
const styles2 = useStyles2();
const { user, channel, isActionSheet } = props;
const stateFromStores = useStateFromStores([PresenceStore], () => getStreamerActivityByUserId(user.id, PresenceStore));
return <>
{[<Component {...props} subLabel={<FormSubLabel text={stateFromStores != null ? intl.format(t["0wJXSh"], {
name: stateFromStores.details != null && stateFromStores.details !== "" ? stateFromStores.details : stateFromStores.name
}) : intl.string(t.eXan7B)} style={isActionSheet ? styles2.labelCallScreen : null} />} />, user.id !== AuthenticationStore.getId() && <View style={styles.streamPreview}>
<TouchableStreamPreview guildId={channel == null ? void 0 : channel.getGuildId()} userId={user.id} disableTransition onPress={() => {
if (channel != null && isModalOpen(getVoiceChannelKey(channel.id))) {
ActionSheetActionCreators.hideActionSheet(getVoiceChannelKey(channel.id));
}
}} />
</View>]}
</>;
};
RingButton = function RingButton(props) {
const { channelId, userId, isActionSheet } = props;
const styles = useStyles();
const styles2 = useStyles2();
return userId == null ? null : channelId == null ? null : <PressableOpacity onPress={() => {
CallActionCreators.ring(channelId, [userId], "voice_user_action_sheet");
}} accessibilityRole="button" style={isActionSheet ? styles2.ringingButton : styles.ringingButton}>
<LegacyText style={isActionSheet ? styles2.ringingButtonLabel : styles.ringingButtonLabel}>
{intl.string(t.bHa9kN)}
</LegacyText>
</PressableOpacity>;
};
StopRingButton = function StopRingButton(props) {
const { channelId: channelId2, userId: userId2, isActionSheet } = props;
const styles = useStyles();
const styles2 = useStyles2();
return userId2 == null ? null : channelId2 == null ? null : <PressableOpacity onPress={() => {
CallActionCreators.stopRinging(channelId2, [userId2]);
}} accessibilityRole="button" style={isActionSheet ? styles2.ringingButton : styles.ringingButton}>
<LegacyText style={isActionSheet ? styles2.ringingButtonLabel : styles.ringingButtonLabel}>
{intl.string(t.ygslb0)}
</LegacyText>
</PressableOpacity>;
};
Platform;
useStyles = createStyles({
row: {
flexDirection: "row"
},
voiceStatusIcon: {
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT,
marginLeft: 8
},
voiceStatusIconMargin: {
marginLeft: 8
},
streamPreview: {
marginHorizontal: 16,
marginBottom: 16,
alignItems: "center",
flex: 1
},
ringingButton: {
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED,
borderRadius: Module712.radii.xs,
height: 32,
alignItems: "center",
justifyContent: "center"
},
ringingButtonLabel: {
fontFamily: Fonts.PRIMARY_SEMIBOLD,
fontSize: 14,
lineHeight: 18,
marginHorizontal: 16,
color: Module712.colors.INTERACTIVE_TEXT_ACTIVE
},
autoDisabledVideo: {
flexDirection: "row",
alignItems: "center"
},
autoDisabledVideoLabel: {
marginLeft: 4
}
});
useStyles2 = createStyles({
labelCallScreen: {
fontFamily: Fonts.PRIMARY_MEDIUM,
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
voiceStatusIcon: {
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT,
marginLeft: 8
},
ringingButton: {
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED,
borderRadius: Module712.radii.xs,
height: 32,
alignItems: "center",
justifyContent: "center"
},
ringingButtonLabel: {
fontFamily: Fonts.PRIMARY_SEMIBOLD,
fontSize: 14,
lineHeight: 18,
marginHorizontal: 16,
color: Module712.colors.INTERACTIVE_TEXT_ACTIVE
}
});
Component = memo(function(a0) {
const { user: user2, name, channel: channel2, voiceState: voiceState2 } = a0;
let withStream = a0.withStream;
if (withStream === void 0) {
withStream = true;
}
const { isSpectating, isActionSheet, onPress: onPress2, user, name: _name, channel, voiceState, withStream: _withStream, ...props } = a0;
const styles = useStyles();
const styles2 = useStyles2();
const id = AuthenticationStore.getId();
const isSpeaking = useIsSpeaking({
userId: user2.id
});
const stateFromStores = useStateFromStores([ThemeStore], () => ThemeStore.theme);
const stateFromStoresObject = useStateFromStoresObject([MediaEngineStore], () => {
let localVideo = id === user2.id;
const r11 = {
isSelfMute: localVideo ? MediaEngineStore.isSelfMute() : localVideo,
localMute: MediaEngineStore.isLocalMute(user2.id),
localDeaf: localVideo ? MediaEngineStore.isSelfDeaf() : localVideo,
localVideo: null,
localVideoDisabled: null,
localVideoAutoDisabled: null
};
if (localVideo) {
localVideo = MediaEngineStore.isVideoEnabled();
}
r11.localVideo = localVideo;
r11.localVideoDisabled = MediaEngineStore.isLocalVideoDisabled(user2.id);
r11.localVideoAutoDisabled = MediaEngineStore.isLocalVideoAutoDisabled(user2.id);
return r11;
});
const { localMute, localDeaf } = stateFromStoresObject;
let localVideo = stateFromStoresObject.localVideo;
const { isSelfMute, localVideoDisabled, localVideoAutoDisabled } = stateFromStoresObject;
const stateFromStores2 = useStateFromStores([GuildMemberStore], () => GuildMemberStore.isGuestOrLurker(channel2?.guild_id, user2.id));
const r66 = localMute || isSelfMute;
if (!localVideo) {
localVideo = localVideoDisabled;
}
const r1 = voiceState2 != null;
let r2 = false;
let r67 = localVideo;
let r30 = localDeaf;
let r31 = r66;
let r68 = false;
let r3 = false;
let disabled = false;
if (r1) {
if (withStream) {
withStream = voiceState2.selfStream;
}
const r69 = r66 ? r66 : voiceState2.isVoiceMuted();
const r71 = localDeaf ? localDeaf : voiceState2.isVoiceDeafened();
const r73 = localVideo ? localVideo : voiceState2.selfVideo;
const sessionId = voiceState2.sessionId;
const r75 = sessionId != null && id === user2.id && sessionId !== AuthenticationStore.getSessionId();
r3 = true;
r2 = r75;
r67 = r73;
r30 = r71;
r31 = r69;
r68 = withStream;
disabled = r2;
}
const style = isActionSheet ? styles2.voiceStatusIcon : styles.voiceStatusIcon;
const props2 = {
onPress: () => onPress2(user2),
label: name,
leading: <Avatar user={user2} guildId={channel2?.guild_id} size={AvatarSizes.REFRESH_MEDIUM_32} speaking={isSpeaking} />,
trailing: null
};
const trailing = r3 ? r2 ? null : <View style={styles.row}>
{isSpectating ? <Icon size={Icon.Sizes.REFRESH_SMALL_16} source={Module12849} style={style} /> : null}
{r31 ? <Icon size={Icon.Sizes.REFRESH_SMALL_16} source={isThemeDark(stateFromStores) ? Module12844 : Module12845} style={styles.voiceStatusIconMargin} color={style.tintColor} disableColor={localMute} /> : null}
{r30 ? <Icon size={Icon.Sizes.REFRESH_SMALL_16} source={Module12846} style={style} /> : null}
{r67 ? <Icon {...localVideoDisabled ? {
size: Icon.Sizes.REFRESH_SMALL_16,
source: Module12847,
style: styles.voiceStatusIconMargin,
disableColor: true
} : {
size: Icon.Sizes.REFRESH_SMALL_16,
source: Module12848,
style
}} /> : null}
{r68 ? <LiveTag style={style} /> : null}
</View> : null;
props2.trailing = trailing;
return <FormRow disabled={disabled} {...props} {...props2} label={<FormRow.Label text={stateFromStores2 ? <>
{name}
<Text variant="text-md/semibold" lineClamp={1} color="status-positive">
{" "}
{intl.string(t["pFO/Ph"])}
</Text>
</> : name} style={isActionSheet ? styles2.labelCallScreen : null} />} subLabel={localVideoAutoDisabled ? <View style={styles.autoDisabledVideo}>
<Icon source={Module8346} size={Icon.Sizes.EXTRA_SMALL} disableColor />
<Text variant="text-xs/medium" color="text-default" style={styles.autoDisabledVideoLabel}>
{intl.string(t.m2Hyj0)}
</Text>
</View> : r2 ? intl.string(t.IyYqqY) : null} />;
});
const r111 = memo(function DisconnectedUserRow(props) {
const { user: user3, channel: channel3, isActionSheet, onPress: onPress3 } = props;
const styles2 = useStyles2();
const stateFromStores = useStateFromStores([CallStore], () => {
const call = CallStore.getCall(channel3.id);
return call != null && call.ringing.includes(user3.id);
}, [channel3.id, user3.id]);
return <FormRow onPress={() => onPress3(user3)} label={<FormRow.Label text={NicknameUtils.getName(channel3.guild_id, channel3.id, user3)} style={isActionSheet ? styles2.labelCallScreen : null} />} leading={<Avatar user={user3} guildId={channel3.guild_id} size={AvatarSizes.REFRESH_MEDIUM_32} />} trailing={useCanRing(user3, "DisconnectedUserRow") ? stateFromStores ? <StopRingButton channelId={channel3.id} userId={user3.id} isActionSheet={isActionSheet} /> : <RingButton channelId={channel3.id} userId={user3.id} isActionSheet={isActionSheet} /> : null} />;
});
const r114 = memo(function VoiceMemberUser(props) {
let r31;
const { voiceState, user: user4 } = props;
let nick = props.nick;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(voiceState?.channelId));
const name = UserUtils.useName(user4);
if (voiceState != null && voiceState.selfStream) {
if (nick == null) {
nick = name;
}
r31 = <StreamingUserRow {...props} name={nick} channel={stateFromStores} />;
} else {
r31 = <Component {...props} name={nick == null ? name : nick} channel={stateFromStores} withStream={false} />;
}
return r31;
});
export default r114;
export const STREAM_PREVIEW_MARGIN = 16;
export { r111 as DisconnectedUserRow };
@@ -0,0 +1,18 @@
// Metro module 8856 (f8857).
import { NativeModules } from "react-native";
import { VOICE_PANEL_AUDIO_OUTPUT_ACTION_SHEET_KEY } from "../../../voice_panel/native/header/VoicePanelHeaderConstants";
import { isAndroid } from "../../../../utils/PlatformUtils";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
export function showAudioOutputSelector(a0, a1) {
if (isAndroid()) {
ActionSheetActionCreators.openLazy(import("../../../voice_panel/native/header/VoicePanelAudioOutputActionSheet"), VOICE_PANEL_AUDIO_OUTPUT_ACTION_SHEET_KEY, {
channelId: a0,
isConnectedToVoiceChannel: a1
});
} else {
const AudioRoutePicker = NativeModules.AudioRoutePicker;
if (AudioRoutePicker != null) {
AudioRoutePicker.showAudioPicker();
}
}
}
@@ -0,0 +1,48 @@
// Metro module 12853 (f12854).
import AuthenticationStore from "../../../../stores/AuthenticationStore";
import CallStore from "../../../../stores/CallStore";
import VoiceStateStore from "../../../../stores/VoiceStateStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { intl, t } from "../../../../intl/index.native";
import { CallStates } from "../CallStateHooks";
import { LegacyText } from "../../../../design/void/native";
export default function OngoingCallStatusLabel(props) {
let r31;
const { style, channel: channel2, voiceState } = props;
let useAllAloneText = props.useAllAloneText;
if (useAllAloneText === void 0) {
useAllAloneText = true;
}
let id;
const channel = channel2;
if (useAllAloneText === void 0) {
useAllAloneText = true;
}
L15: {
id = void 0;
id = AuthenticationStore.getId();
const stateFromStores = useStateFromStores([VoiceStateStore, CallStore], () => {
if (channel == null) {
return false;
}
const r13 = Object.values(VoiceStateStore.getVoiceStatesForChannel(channel.id));
const call = CallStore.getCall(channel.id);
const r2 = call != null && call.ringing.length > 0;
return (r2 ? !r2 : r13.length === 1) && r13[0].userId === id;
}, [id, channel]);
r31 = intl.string(t["1zFMqU"]);
if (CallStates.DISCONNECTING !== voiceState && CallStates.CONNECTED !== voiceState) {
if (CallStates.RINGING === voiceState) {
r31 = intl.string(t.Xuzre8);
break L15;
}
if (CallStates.DISCONNECTED !== voiceState) {
break L15;
}
r31 = intl.string(t["w//7ET"]);
} else {
r31 = stateFromStores && useAllAloneText ? intl.string(t.xNeSms) : intl.string(t["NGg/fm"]);
}
}
return <LegacyText style={style}>{r31}</LegacyText>;
};
@@ -0,0 +1,10 @@
// Metro module 12854 (f12855).
import CallStore from "../../../../stores/CallStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import SnowflakeUtils from "../../../../utils/SnowflakeUtils";
import Timer from "./Timer";
export default function OnGoingCallTimer(props) {
const { style, channelId } = props;
const stateFromStores = useStateFromStores([CallStore], () => CallStore.getCall(channelId)?.messageId, [channelId]);
return <Timer style={style} timestamp={stateFromStores != null ? SnowflakeUtils.extractTimestamp(stateFromStores) : 0} />;
};
@@ -0,0 +1,157 @@
// Metro module 12855 (f12856).
import { PureComponent } from "react";
import Module12 from "../../../../_bundle/Module12";
import { LegacyText } from "../../../../design/void/native";
class Timer extends PureComponent {
static defaultProps = {
hideMinutes: false,
hideHours: false
};
_incrementSecond = () => {
const state = this.state;
const { seconds, minutes, hours } = state;
let seconds2 = seconds + 1;
let hours2 = hours;
let minutes2 = minutes;
if (seconds2 >= 60) {
let r12 = minutes + 1;
let r13 = hours;
if (r12 >= 60) {
r13 = hours + 1;
r12 = 0;
}
seconds2 = 0;
hours2 = r13;
minutes2 = r12;
}
this.setState({
seconds: seconds2,
minutes: minutes2,
hours: hours2
});
};
_decrementSecond = () => {
let r15, r16;
const state = this.state;
const { seconds, minutes, hours } = state;
let r0 = seconds - 1;
let hours2 = hours;
let minutes2 = minutes;
let seconds2 = r0;
if (seconds2 < 1) {
if (minutes >= 1) {
r16 = minutes - 1;
r0 = 59;
r15 = hours;
} else {
const r5 = minutes < 1 && hours >= 1;
r15 = hours;
r16 = minutes;
if (r5) {
r15 = hours - 1;
r16 = 59;
r0 = 59;
}
}
hours2 = r15;
minutes2 = r16;
seconds2 = r0;
}
if (seconds2 <= 0) {
clearInterval(this._timerId);
this._timerId = null;
const onComplete = this.props.onComplete;
if (onComplete != null) {
onComplete();
}
} else {
this.setState({
seconds: seconds2,
minutes: minutes2,
hours: hours2
});
}
};
constructor(a0) {
super(a0);
const { seconds, minutes, hours, timestamp } = a0;
let hours2 = hours;
let minutes2 = minutes;
let seconds2 = seconds;
if (timestamp != null) {
hours2 = hours;
minutes2 = minutes;
seconds2 = seconds;
if (timestamp > 0) {
const r1 = Math.max(0, Date.now() - timestamp) / 1000;
const r35 = Math;
const r38 = r1 % 86400;
hours2 = r35.floor(r38 / 3600);
const r40 = Math;
const r42 = r38 % 3600;
minutes2 = r40.floor(r42 / 60);
seconds2 = Math.floor(r42 % 60);
}
}
if (seconds2 == null) {
seconds2 = 0;
}
if (minutes2 == null) {
minutes2 = 0;
}
if (hours2 == null) {
hours2 = 0;
}
this.state = {
seconds: seconds2,
minutes: minutes2,
hours: hours2
};
}
componentDidMount() {
const countdown = this.props.countdown;
const r6 = setInterval;
if (countdown) {
this._timerId = r6(this._decrementSecond, 1000);
} else {
this._timerId = r6(this._incrementSecond, 1000);
}
}
componentWillUnmount() {
clearInterval(this._timerId);
this._timerId = null;
}
render() {
let r8, r23, r28, r41;
const props = this.props;
const { style, hideHours, hideMinutes } = props;
const state = this.state;
const { seconds, minutes, hours } = state;
if (hideHours) {
r8 = "";
if (hours !== 0) {
r23 = Module12.padStart(String(hours), 2, "0");
r8 = `${r23}:`;
}
} else {
r23 = Module12.padStart(String(hours), 2, "0");
r8 = `${r23}:`;
}
if (hideMinutes) {
r28 = "";
if (minutes !== 0) {
r41 = Module12.padStart(String(minutes), 2, "0");
r28 = `${r41}:`;
}
} else {
r41 = Module12.padStart(String(minutes), 2, "0");
r28 = `${r41}:`;
}
return <LegacyText style={style} accessibilityRole="timer">
{r8}
{r28}
{r8.length > 0 ? Module12.padStart(String(seconds), 2, "0") : r28.length > 0 ? Module12.padStart(String(seconds), 2, "0") : seconds}
</LegacyText>;
}
}
export default Timer;