mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 18:57:12 +01:00
1 line
119 KiB
Plaintext
1 line
119 KiB
Plaintext
{"version":3,"file":"532.5ff953a5af12d8af60a9.js","mappings":";wUAqCAA,EAAAA,EAAAA,IAAW,aAAa,CAACC,EAAQC,EAASC,KACxC,MAAM,kBAAEC,GAAsBH,EAAOI,WAErC,OAAQF,EAAO,UACb,IAAK,mCACHD,EAAQI,4BAA4B,CAAEC,OAAO,IAC7C,MAEF,IAAK,yBACH,IAAKJ,EAAOK,SAAWJ,EAAmB,MAC1C,KAAKK,EAAAA,EAAAA,IAA2BR,EAAQG,EAAmBD,EAAOK,QAAS,MAE3E,OAAOE,EAAAA,EAAAA,IAA2BT,EAAQG,EAAmBD,EAAOK,QAAQG,EAAAA,EAAAA,IAAKR,EAAQ,CAAC,QAAS,YAErG,IAAK,iCACH,IAAKC,EAAmB,MAExB,GAA+B,iBAA3BD,EAAOS,gBAAoC,CAC7CV,EAAQW,eAAe,CAAEC,eAAe,IACxC,MAGF,OAAOC,EAAAA,EAAAA,IAAgBd,EAAQG,EAAmB,CAChDQ,gBAAiBT,EAAOS,gBACxBI,kBAAmBb,EAAOa,oBAG9B,IAAK,8BAA+B,CAClC,MAAM,YAAEC,EAAF,aAAeC,GAAiBf,EAClCC,IAAsBa,IACnBE,EAAAA,EAAAA,mCAAkCD,GAEzC,MAEF,IAAK,4BAA6B,CAChC,GAAIf,EAAOiB,KAAKC,OAAQ,CACtBnB,EAAQoB,iBAAiB,CAAEC,QAAS,2CACpCrB,EAAQW,iBACR,OAEGW,EAAAA,EAAAA,iCAAgCrB,EAAOiB,KAAMjB,EAAOsB,cAEzD,MAAMC,GAAYC,EAAAA,EAAAA,IAAsB1B,GACpCyB,MAAAA,GAAAA,EAAWR,cAAgBU,OAAOC,KAAKH,EAAUR,cAAcY,OAAS,IACrEX,EAAAA,EAAAA,mCAAkCS,OAAOG,OAAOL,EAAUR,eAEjE,YAONlB,EAAAA,EAAAA,IAA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,EAAEpK,gCAAgC+C,mBAAmB,IAAIqH,EAAErH,mBAAmBlB,cAAc,IAAIuI,EAAEvI,cAAc2Y,WAAW,IAAIpQ,EAAEoQ,WAAW5M,eAAe,IAAIxD,EAAEwD,eAAepL,UAAU,IAAI4H,EAAE5H,UAAUL,gBAAgB,IAAIiI,EAAEjI,gBAAgBF,aAAa,IAAImI,EAAEnI,aAAa5C,eAAe,IAAI+K,EAAE/K,eAAeM,kCAAkC,IAAIyK,EAAEzK,kCAAkCoT,kBAAkB,IAAI3I,EAAE2I,kBAAkBC,cAAc,IAAI5I,EAAE4I,cAAc+H,uBAAuB,IAAI3Q,EAAE2Q,uBAAuBtI,yBAAyB,IAAI+C,EAAE/C,yBAAyB3G,UAAU,IAAI0J,EAAE1J,YAAY,IAAI1B,EAAEqL,EAAE,wBAAwBD,EAAEC,EAAE,kBAAkBA,EAAE,mBAAlsB,GAAwtB,IAAIK,EAAE5N,EAAEqY,EAAQ,IAAIzK,KAAKF,EAAE1N,EAAE4N,GAAGF,EAAEE,GAAGF,EAAEmL,YAAY3gB,OAAOogB,eAAetY,EAAE,aAAa,CAACnJ,OAAM,KAA1nf","sources":["webpack://telegram-t/./src/modules/actions/api/calls.async.ts","webpack://telegram-t/./src/util/vibrate.ts","webpack://telegram-t/./src/components/common/AnimatedIcon.tsx","webpack://telegram-t/./src/components/calls/group/MicrophoneButton.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantMenu.tsx","webpack://telegram-t/./src/components/calls/group/OutlinedMicrophoneIcon.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipant.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantList.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantVideo.tsx","webpack://telegram-t/./src/components/calls/group/GroupCallParticipantStreams.tsx","webpack://telegram-t/./src/components/calls/group/GroupCall.tsx","webpack://telegram-t/./src/components/calls/ActiveCallHeader.tsx","webpack://telegram-t/./src/components/calls/CallFallbackConfirm.tsx","webpack://telegram-t/./src/components/common/helpers/animatedAssets.ts","webpack://telegram-t/./src/lib/secret-sauce/index.js"],"sourcesContent":["import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn';\nimport {\n joinGroupCall,\n startSharingScreen,\n leaveGroupCall,\n toggleStream,\n isStreamEnabled,\n setVolume,\n handleUpdateGroupCallParticipants, handleUpdateGroupCallConnection,\n} from '../../../lib/secret-sauce';\n\nimport { ApiUpdate } from '../../../api/types';\n\nimport { GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectCurrentMessageList, selectUser } from '../../selectors';\nimport {\n selectActiveGroupCall,\n selectCallFallbackChannelTitle,\n selectGroupCallParticipant,\n} from '../../selectors/calls';\nimport {\n removeGroupCall,\n updateActiveGroupCall,\n updateGroupCall,\n updateGroupCallParticipant,\n} from '../../reducers/calls';\nimport { omit } from '../../../util/iteratees';\nimport { getServerTime } from '../../../util/serverTime';\nimport { fetchFile } from '../../../util/files';\nimport { getGroupCallAudioContext, getGroupCallAudioElement, removeGroupCallAudioElement } from '../ui/calls';\nimport { loadFullChat } from './chats';\n\nimport callFallbackAvatarPath from '../../../assets/call-fallback-avatar.png';\n\nconst FALLBACK_INVITE_EXPIRE_SECONDS = 1800; // 30 min\n\naddReducer('apiUpdate', (global, actions, update: ApiUpdate) => {\n const { activeGroupCallId } = global.groupCalls;\n\n switch (update['@type']) {\n case 'updateGroupCallLeavePresentation': {\n actions.toggleGroupCallPresentation({ value: false });\n break;\n }\n case 'updateGroupCallStreams': {\n if (!update.userId || !activeGroupCallId) break;\n if (!selectGroupCallParticipant(global, activeGroupCallId, update.userId)) break;\n\n return updateGroupCallParticipant(global, activeGroupCallId, update.userId, omit(update, ['@type', 'userId']));\n }\n case 'updateGroupCallConnectionState': {\n if (!activeGroupCallId) break;\n\n if (update.connectionState === 'disconnected') {\n actions.leaveGroupCall({ isFromLibrary: true });\n break;\n }\n\n return updateGroupCall(global, activeGroupCallId, {\n connectionState: update.connectionState,\n isSpeakerDisabled: update.isSpeakerDisabled,\n });\n }\n case 'updateGroupCallParticipants': {\n const { groupCallId, participants } = update;\n if (activeGroupCallId === groupCallId) {\n void handleUpdateGroupCallParticipants(participants);\n }\n break;\n }\n case 'updateGroupCallConnection': {\n if (update.data.stream) {\n actions.showNotification({ message: 'Big live streams are not yet supported' });\n actions.leaveGroupCall();\n break;\n }\n void handleUpdateGroupCallConnection(update.data, update.presentation);\n\n const groupCall = selectActiveGroupCall(global);\n if (groupCall?.participants && Object.keys(groupCall.participants).length > 0) {\n void handleUpdateGroupCallParticipants(Object.values(groupCall.participants));\n }\n break;\n }\n }\n\n return undefined;\n});\n\naddReducer('leaveGroupCall', (global, actions, payload) => {\n const {\n isFromLibrary, shouldDiscard, shouldRemove, rejoin,\n } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n setGlobal(updateActiveGroupCall(global, { connectionState: 'disconnected' }, groupCall.participantsCount - 1));\n\n (async () => {\n await callApi('leaveGroupCall', {\n call: groupCall,\n });\n\n let shouldResetFallbackState = false;\n if (shouldDiscard) {\n global = getGlobal();\n\n if (global.groupCalls.fallbackChatId === groupCall.chatId) {\n shouldResetFallbackState = true;\n\n global.groupCalls.fallbackUserIdsToRemove?.forEach((userId) => {\n actions.deleteChatMember({ chatId: global.groupCalls.fallbackChatId, userId });\n });\n }\n\n await callApi('discardGroupCall', {\n call: groupCall,\n });\n }\n\n global = getGlobal();\n if (shouldRemove) {\n global = removeGroupCall(global, groupCall.id);\n }\n\n removeGroupCallAudioElement();\n\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n isGroupCallPanelHidden: true,\n activeGroupCallId: undefined,\n ...(shouldResetFallbackState && {\n fallbackChatId: undefined,\n fallbackUserIdsToRemove: undefined,\n }),\n },\n });\n\n if (!isFromLibrary) {\n leaveGroupCall();\n }\n\n if (rejoin) {\n actions.joinGroupCall(rejoin);\n }\n })();\n});\n\naddReducer('toggleGroupCallVideo', (global) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n await toggleStream('video');\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n videoStopped: !isStreamEnabled('video'),\n participant: user,\n });\n })();\n});\n\naddReducer('requestToSpeak', (global, actions, payload) => {\n const { value } = payload || { value: true };\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n raiseHand: value,\n participant: user,\n });\n});\n\naddReducer('setGroupCallParticipantVolume', (global, actions, payload) => {\n const { participantId, volume } = payload!;\n\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId);\n if (!user || !groupCall) {\n return;\n }\n\n setVolume(participantId, Math.floor(volume / GROUP_CALL_VOLUME_MULTIPLIER) / 100);\n\n void callApi('editGroupCallParticipant', {\n call: groupCall,\n volume: Number(volume),\n participant: user,\n });\n});\n\naddReducer('toggleGroupCallMute', (global, actions, payload) => {\n const { participantId, value } = payload || {};\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, participantId || global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const muted = value === undefined ? isStreamEnabled('audio', user.id) : value;\n\n if (!participantId) {\n await toggleStream('audio');\n } else {\n setVolume(participantId, muted ? 0 : 1);\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n muted,\n participant: user,\n });\n })();\n});\n\naddReducer('toggleGroupCallPresentation', (global, actions, payload) => {\n const groupCall = selectActiveGroupCall(global);\n const user = selectUser(global, global.currentUserId!);\n if (!user || !groupCall) {\n return;\n }\n\n (async () => {\n const value = payload?.value !== undefined ? payload?.value : !isStreamEnabled('presentation');\n if (value) {\n const params = await startSharingScreen();\n if (!params) {\n return;\n }\n\n await callApi('joinGroupCallPresentation', {\n call: groupCall,\n params,\n });\n } else {\n await toggleStream('presentation', false);\n await callApi('leaveGroupCallPresentation', {\n call: groupCall,\n });\n }\n\n await callApi('editGroupCallParticipant', {\n call: groupCall,\n presentationPaused: !isStreamEnabled('presentation'),\n participant: user,\n });\n })();\n});\n\naddReducer('connectToActiveGroupCall', (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) return;\n\n if (groupCall.connectionState === 'discarded') {\n actions.showNotification({ message: 'This voice chat is not active' });\n return;\n }\n\n const audioElement = getGroupCallAudioElement();\n const audioContext = getGroupCallAudioContext();\n\n if (!audioElement || !audioContext) {\n return;\n }\n\n const {\n currentUserId,\n } = global;\n\n if (!currentUserId) return;\n\n (async () => {\n const params = await joinGroupCall(currentUserId, audioContext, audioElement, actions.apiUpdate);\n\n const result = await callApi('joinGroupCall', {\n call: groupCall,\n params,\n inviteHash: groupCall.inviteHash,\n });\n\n if (!result) return;\n\n actions.loadMoreGroupCallParticipants();\n\n if (groupCall.chatId) {\n const chat = selectChat(getGlobal(), groupCall.chatId);\n if (!chat) return;\n await loadFullChat(chat);\n }\n })();\n});\n\naddReducer('inviteToCallFallback', (global, actions, payload) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n if (!chatId) {\n return;\n }\n\n const user = selectUser(global, chatId);\n if (!user) {\n return;\n }\n\n const { shouldRemove } = payload;\n\n (async () => {\n const fallbackChannelTitle = selectCallFallbackChannelTitle(global);\n\n let fallbackChannel = Object.values(global.chats.byId).find((channel) => {\n return (\n channel.title === fallbackChannelTitle\n && channel.isCreator\n && !channel.isRestricted\n );\n });\n if (!fallbackChannel) {\n fallbackChannel = await callApi('createChannel', {\n title: fallbackChannelTitle,\n users: [user],\n });\n\n if (!fallbackChannel) {\n return;\n }\n\n const photo = await fetchFile(callFallbackAvatarPath, 'avatar.png');\n void callApi('editChatPhoto', {\n chatId: fallbackChannel.id,\n accessHash: fallbackChannel.accessHash,\n photo,\n });\n } else {\n actions.updateChatMemberBannedRights({\n chatId: fallbackChannel.id,\n userId: chatId,\n bannedRights: {},\n });\n\n void callApi('addChatMembers', fallbackChannel, [user], true);\n }\n\n const inviteLink = await callApi('updatePrivateLink', {\n chat: fallbackChannel,\n usageLimit: 1,\n expireDate: getServerTime(global.serverTimeOffset) + FALLBACK_INVITE_EXPIRE_SECONDS,\n });\n if (!inviteLink) {\n return;\n }\n\n if (shouldRemove) {\n global = getGlobal();\n const fallbackUserIdsToRemove = global.groupCalls.fallbackUserIdsToRemove || [];\n setGlobal({\n ...global,\n groupCalls: {\n ...global.groupCalls,\n fallbackChatId: fallbackChannel.id,\n fallbackUserIdsToRemove: [...fallbackUserIdsToRemove, chatId],\n },\n });\n }\n\n actions.sendMessage({ text: `Join a call: ${inviteLink}` });\n actions.openChat({ id: fallbackChannel.id });\n actions.createGroupCall({ chatId: fallbackChannel.id });\n actions.closeCallFallbackConfirm();\n })();\n});\n","export const vibrateShort = () => {\n navigator.vibrate?.(50);\n};\n","import React, {\n FC, memo, useEffect, useState,\n} from '../../lib/teact/teact';\n\nimport getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';\n\nimport AnimatedSticker from './AnimatedSticker';\n\ntype OwnProps = {\n name: keyof typeof ANIMATED_STICKERS_PATHS;\n size: number;\n playSegment?: [number, number];\n color?: [number, number, number];\n};\n\nconst AnimatedIcon: FC<OwnProps> = ({\n size,\n name,\n playSegment,\n color,\n}) => {\n const [iconData, setIconData] = useState<Record<string, any>>();\n\n useEffect(() => {\n getAnimationData(name).then(setIconData);\n }, [name]);\n\n return (\n <AnimatedSticker\n id={name}\n play\n noLoop\n playSegment={playSegment}\n size={size}\n speed={1}\n animationData={iconData}\n color={color}\n />\n );\n};\n\nexport default memo(AnimatedIcon);\n","import { GroupCallConnectionState } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { vibrateShort } from '../../../util/vibrate';\nimport usePrevious from '../../../hooks/usePrevious';\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../../modules/selectors/calls';\nimport useLang from '../../../hooks/useLang';\n\nimport AnimatedIcon from '../../common/AnimatedIcon';\n\nimport './MicrophoneButton.scss';\n\nconst CONNECTION_STATE_DEFAULT = 'discarded';\n\ntype StateProps = {\n connectionState?: GroupCallConnectionState;\n hasRequestedToSpeak: boolean;\n isMuted?: boolean;\n canSelfUnmute?: boolean;\n noAudioStream: boolean;\n};\n\nconst REQUEST_TO_SPEAK_THROTTLE = 3000;\nconst HOLD_TO_SPEAK_TIME = 200;\nconst ICON_SIZE = 48;\n\nconst MicrophoneButton: FC<StateProps> = ({\n noAudioStream,\n canSelfUnmute,\n isMuted,\n hasRequestedToSpeak,\n connectionState,\n}) => {\n const {\n toggleGroupCallMute,\n requestToSpeak,\n playGroupCallSound,\n } = getDispatch();\n\n const lang = useLang();\n const muteMouseDownState = useRef('up');\n\n const [isRequestingToSpeak, setIsRequestingToSpeak] = useState(false);\n const isConnecting = connectionState !== 'connected';\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevShouldRaiseHand = usePrevious(shouldRaiseHand);\n\n useEffect(() => {\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n playGroupCallSound('allowTalk');\n }\n }, [playGroupCallSound, prevShouldRaiseHand, shouldRaiseHand]);\n\n // Voice mini\n // unmuted -> muted [69, 99]\n // muted -> unmuted [36, 69]\n // raise -> muted [0, 36]\n // muted -> raise [99, 136]\n // unmuted -> raise [136, 172]\n // TODO should probably move to other component\n const playSegment: [number, number] = useMemo(() => {\n if (isRequestingToSpeak) {\n const r = Math.floor(Math.random() * 100);\n return (r < 32 ? [0, 120]\n : (r < 64 ? [120, 240]\n : (r < 97 ? [240, 420]\n : [420, 540]\n )\n )\n );\n }\n if (!prevShouldRaiseHand && shouldRaiseHand) {\n return noAudioStream ? [99, 135] : [136, 172];\n }\n if (prevShouldRaiseHand && !shouldRaiseHand) {\n return [0, 36];\n }\n if (!shouldRaiseHand) {\n return noAudioStream ? [69, 99] : [36, 69];\n }\n return [0, 0];\n }, [prevShouldRaiseHand, isRequestingToSpeak, noAudioStream, shouldRaiseHand]);\n\n const animatedIconName = isRequestingToSpeak ? 'HandFilled' : 'VoiceMini';\n\n const toggleMute = () => {\n vibrateShort();\n toggleGroupCallMute();\n };\n\n const handleMouseDownMute = () => {\n if (shouldRaiseHand) {\n if (isRequestingToSpeak) return;\n vibrateShort();\n requestToSpeak();\n setIsRequestingToSpeak(true);\n setTimeout(() => {\n setIsRequestingToSpeak(false);\n }, REQUEST_TO_SPEAK_THROTTLE);\n return;\n }\n muteMouseDownState.current = 'down';\n if (noAudioStream) {\n setTimeout(() => {\n if (muteMouseDownState.current === 'down') {\n muteMouseDownState.current = 'hold';\n toggleMute();\n }\n }, HOLD_TO_SPEAK_TIME);\n }\n };\n\n const handleMouseUpMute = () => {\n if (shouldRaiseHand) {\n return;\n }\n toggleMute();\n muteMouseDownState.current = 'up';\n };\n\n const buttonText = useMemo(() => {\n return lang(\n hasRequestedToSpeak ? 'VoipMutedTapedForSpeak' : (\n shouldRaiseHand ? 'VoipMutedByAdmin' : (\n noAudioStream ? 'VoipUnmute' : 'VoipTapToMute'\n )\n ),\n );\n }, [hasRequestedToSpeak, noAudioStream, lang, shouldRaiseHand]);\n\n return (\n <div className=\"button-wrapper microphone-wrapper\">\n <button\n className={buildClassName(\n 'MicrophoneButton',\n noAudioStream && 'crossed',\n canSelfUnmute && 'can-self-unmute',\n isConnecting && 'is-connecting',\n shouldRaiseHand && 'muted-by-admin',\n )}\n onMouseDown={handleMouseDownMute}\n onMouseUp={handleMouseUpMute}\n >\n <AnimatedIcon\n name={animatedIconName}\n size={ICON_SIZE}\n playSegment={playSegment}\n />\n </button>\n <div className=\"button-text\">\n {buttonText}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n const groupCall = selectActiveGroupCall(global);\n\n const { connectionState } = groupCall || {};\n const meParticipant = groupCall && selectGroupCallParticipant(global, groupCall.id, global.currentUserId!);\n\n const {\n raiseHandRating, hasAudioStream, canSelfUnmute, isMuted,\n } = meParticipant || {};\n\n return {\n connectionState: connectionState || CONNECTION_STATE_DEFAULT,\n hasRequestedToSpeak: Boolean(raiseHandRating),\n noAudioStream: !hasAudioStream,\n canSelfUnmute,\n isMuted,\n };\n },\n)(MicrophoneButton));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport useThrottle from '../../../hooks/useThrottle';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\nimport { selectIsAdminInActiveGroupCall } from '../../../modules/selectors/calls';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Menu from '../../ui/Menu';\nimport MenuItem from '../../ui/MenuItem';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport DeleteMemberModal from '../../right/DeleteMemberModal';\n\nimport './GroupCallParticipantMenu.scss';\n\nconst SPEAKER_ICON_DISABLED_SEGMENT: [number, number] = [0, 17];\nconst SPEAKER_ICON_ENABLED_SEGMENT: [number, number] = [17, 34];\n\ntype OwnProps = {\n participant?: GroupCallParticipant;\n closeDropdown: VoidFunction;\n isDropdownOpen: boolean;\n anchor?: IAnchorPosition;\n};\n\ntype StateProps = {\n isAdmin: boolean;\n};\n\nconst VOLUME_ZERO = 0;\nconst VOLUME_LOW = 50;\nconst VOLUME_MEDIUM = 100;\nconst VOLUME_NORMAL = 150;\n\nconst VOLUME_CHANGE_THROTTLE = 500;\n\nconst SPEAKER_ICON_SIZE = 24;\n\nconst GroupCallParticipantMenu: FC<OwnProps & StateProps> = ({\n participant,\n closeDropdown,\n isDropdownOpen,\n anchor,\n isAdmin,\n}) => {\n const {\n toggleGroupCallMute,\n setGroupCallParticipantVolume,\n toggleGroupCallPanel,\n openChat,\n requestToSpeak,\n } = getDispatch();\n\n const lang = useLang();\n const [isDeleteUserModalOpen, openDeleteUserModal, closeDeleteUserModal] = useFlag();\n\n const id = participant?.id;\n const {\n isMutedByMe, isMuted, isSelf, canSelfUnmute,\n } = participant || {};\n const isRaiseHand = Boolean(participant?.raiseHandRating);\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n\n const [localVolume, setLocalVolume] = useState(\n isMutedByMe ? VOLUME_ZERO : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER),\n );\n\n useEffect(() => {\n setLocalVolume(isMutedByMe\n ? VOLUME_ZERO\n : ((participant?.volume || GROUP_CALL_DEFAULT_VOLUME) / GROUP_CALL_VOLUME_MULTIPLIER));\n // We only want to initialize local volume when switching participants and ignore following updates from server\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [id]);\n\n const runThrottled = useThrottle(VOLUME_CHANGE_THROTTLE);\n\n const handleRemove = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n openDeleteUserModal();\n closeDropdown();\n }, [openDeleteUserModal, closeDropdown]);\n\n const handleCancelRequestToSpeak = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n requestToSpeak({\n value: false,\n });\n closeDropdown();\n }, [requestToSpeak, closeDropdown]);\n\n const handleMute = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n closeDropdown();\n\n if (!isAdmin) {\n setLocalVolume(isMutedByMe ? GROUP_CALL_DEFAULT_VOLUME / GROUP_CALL_VOLUME_MULTIPLIER : VOLUME_ZERO);\n }\n\n toggleGroupCallMute({\n participantId: id,\n value: isAdmin ? !shouldRaiseHand : !isMutedByMe,\n });\n }, [closeDropdown, toggleGroupCallMute, id, isAdmin, shouldRaiseHand, isMutedByMe]);\n\n const handleOpenProfile = useCallback((e: React.SyntheticEvent<any>) => {\n e.stopPropagation();\n toggleGroupCallPanel();\n openChat({\n id,\n });\n closeDropdown();\n }, [toggleGroupCallPanel, closeDropdown, openChat, id]);\n\n const isLocalVolumeZero = localVolume === VOLUME_ZERO;\n const speakerIconPlaySegment = isLocalVolumeZero ? SPEAKER_ICON_DISABLED_SEGMENT : SPEAKER_ICON_ENABLED_SEGMENT;\n\n const handleChangeVolume = (e: React.ChangeEvent<HTMLInputElement>) => {\n const value = Number(e.target.value);\n setLocalVolume(value);\n runThrottled(() => {\n if (value === VOLUME_ZERO) {\n toggleGroupCallMute({\n participantId: id,\n value: true,\n });\n } else {\n setGroupCallParticipantVolume({\n participantId: id,\n volume: Math.floor(value * GROUP_CALL_VOLUME_MULTIPLIER),\n });\n }\n });\n };\n\n return (\n <div>\n <Menu\n isOpen={isDropdownOpen}\n positionX=\"right\"\n autoClose\n style={anchor ? `right: 1rem; top: ${anchor.y}px;` : undefined}\n onClose={closeDropdown}\n className=\"participant-menu\"\n >\n {!isSelf && !shouldRaiseHand && (\n <div className=\"group\">\n <div className={buildClassName(\n 'volume-control',\n localVolume < VOLUME_LOW && 'low',\n localVolume >= VOLUME_LOW && localVolume < VOLUME_MEDIUM && 'medium',\n localVolume >= VOLUME_MEDIUM && localVolume < VOLUME_NORMAL && 'normal',\n localVolume >= VOLUME_NORMAL && 'high',\n )}\n >\n <input\n type=\"range\"\n min=\"0\"\n max=\"200\"\n value={localVolume}\n onChange={handleChangeVolume}\n />\n <div className=\"info\">\n <AnimatedIcon\n name=\"Speaker\"\n playSegment={speakerIconPlaySegment}\n size={SPEAKER_ICON_SIZE}\n />\n <span>{localVolume}%</span>\n </div>\n </div>\n </div>\n )}\n <div className=\"group\">\n {(isRaiseHand && isSelf) && (\n <MenuItem\n icon=\"stop-raising-hand\"\n onClick={handleCancelRequestToSpeak}\n >\n {lang('VoipGroupCancelRaiseHand')}\n </MenuItem>\n )}\n {!isSelf && <MenuItem icon=\"user\" onClick={handleOpenProfile}>{lang('VoipGroupOpenProfile')}</MenuItem>}\n {!isSelf && (\n // TODO cross mic\n <MenuItem\n icon={isMuted ? (isAdmin ? 'allow-speak' : 'microphone-alt') : 'microphone-alt'}\n onClick={handleMute}\n >\n {isAdmin\n ? lang(shouldRaiseHand ? 'VoipGroupAllowToSpeak' : 'VoipMute')\n : lang(isMutedByMe ? 'VoipGroupUnmuteForMe' : 'VoipGroupMuteForMe')}\n </MenuItem>\n )}\n {!isSelf && isAdmin && (\n // TODO replace with hand\n <MenuItem icon=\"delete-user\" destructive onClick={handleRemove}>\n {lang('VoipGroupUserRemove')}\n </MenuItem>\n )}\n </div>\n </Menu>\n\n {!isSelf && isAdmin && (\n <DeleteMemberModal\n isOpen={isDeleteUserModalOpen}\n userId={id}\n onClose={closeDeleteUserModal}\n />\n )}\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n return {\n isAdmin: selectIsAdminInActiveGroupCall(global),\n };\n },\n)(GroupCallParticipantMenu));\n","import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport usePrevious from '../../../hooks/usePrevious';\n\ntype OwnProps = {\n participant: GroupCallParticipant;\n noColor?: boolean;\n};\n\nconst OutlinedMicrophoneIcon: FC<OwnProps> = ({\n participant,\n noColor,\n}) => {\n const { isMuted, isMutedByMe } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n const prevIsRaiseHand = usePrevious(isRaiseHand);\n const canSelfUnmute = !!participant?.canSelfUnmute;\n const shouldRaiseHand = !canSelfUnmute && isMuted;\n const prevIsMuted = usePrevious(isMuted);\n\n const playSegment: [number, number] = useMemo(() => {\n if (isMuted && !prevIsMuted) {\n return [43, 64];\n }\n\n if (!isMuted && prevIsMuted) {\n return [22, 42];\n }\n\n if (isRaiseHand && !prevIsRaiseHand) {\n return [65, 84];\n }\n\n if (!shouldRaiseHand && prevIsRaiseHand) {\n return [0, 21];\n }\n\n // TODO cancel request to speak should play in reverse\n // if (!isRaiseHand && prevIsRaiseHand) {\n // return [84, 65];\n // }\n\n return isMuted ? [22, 23] : [43, 44];\n // eslint-disable-next-line\n }, [isMuted, shouldRaiseHand, isRaiseHand]);\n\n const microphoneColor: [number, number, number] | undefined = useMemo(() => {\n return noColor ? [0xff, 0xff, 0xff] : (\n isRaiseHand ? [0x4d, 0xa6, 0xe0]\n : (shouldRaiseHand || isMutedByMe ? [0xFF, 0x70, 0x6F] : (\n isSpeaking ? [0x57, 0xBC, 0x6C] : [0x84, 0x8D, 0x94]\n ))\n );\n }, [noColor, isRaiseHand, shouldRaiseHand, isMutedByMe, isSpeaking]);\n\n return (\n <AnimatedIcon\n name=\"VoiceOutlined\"\n playSegment={playSegment}\n size={28}\n color={microphoneColor}\n />\n );\n};\n\nexport default memo(OutlinedMicrophoneIcon);\n","import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useMemo, useRef,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\nimport OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';\n\nimport './GroupCallParticipant.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n};\n\nconst GroupCallParticipant: FC<OwnProps & StateProps> = ({\n openParticipantMenu,\n participant,\n user,\n chat,\n}) => {\n // eslint-disable-next-line no-null/no-null\n const anchorRef = useRef<HTMLDivElement>(null);\n const lang = useLang();\n\n const { isSelf, isMutedByMe, isMuted } = participant;\n const isSpeaking = (participant.amplitude || 0) > THRESHOLD;\n const isRaiseHand = Boolean(participant.raiseHandRating);\n\n const handleOnClick = () => {\n if (isSelf) return;\n openParticipantMenu(anchorRef.current!, participant);\n };\n\n const [aboutText, aboutColor] = useMemo(() => {\n if (isSelf) {\n return [lang('ThisIsYou'), 'blue'];\n }\n if (isMutedByMe) {\n return [lang('VoipGroupMutedForMe'), 'red'];\n }\n return isRaiseHand\n ? [lang('WantsToSpeak'), 'blue']\n : (!isMuted && isSpeaking ? [\n participant.volume && participant.volume !== GROUP_CALL_DEFAULT_VOLUME\n ? lang('SpeakingWithVolume',\n (participant.volume / GROUP_CALL_VOLUME_MULTIPLIER).toString())\n .replace('%%', '%') : lang('Speaking'),\n 'green',\n ]\n : (participant.about ? [participant.about, ''] : [lang('Listening'), 'blue']));\n }, [isSpeaking, participant.volume, lang, isSelf, isMutedByMe, isRaiseHand, isMuted, participant.about]);\n\n if (!user && !chat) {\n return undefined;\n }\n\n const name = user ? `${user.firstName || ''} ${user.lastName || ''}` : chat?.title;\n\n return (\n <div\n className={buildClassName(\n 'GroupCallParticipant',\n participant.canSelfUnmute && 'can-self-unmute',\n )}\n onClick={handleOnClick}\n ref={anchorRef}\n >\n <Avatar user={user} chat={chat} size=\"medium\" />\n <div className=\"info\">\n <span className=\"name\">{name}</span>\n <span className={buildClassName('about', aboutColor)}>{aboutText}</span>\n </div>\n <div className=\"microphone\">\n <OutlinedMicrophoneIcon participant={participant} />\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { participant }): StateProps => {\n return {\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n };\n },\n)(GroupCallParticipant));\n","import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useMemo } from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\n\nimport useLang from '../../../hooks/useLang';\nimport { selectActiveGroupCall } from '../../../modules/selectors/calls';\nimport useInfiniteScroll from '../../../hooks/useInfiniteScroll';\n\nimport GroupCallParticipant from './GroupCallParticipant';\nimport InfiniteScroll from '../../ui/InfiniteScroll';\n\ntype OwnProps = {\n openParticipantMenu: (anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => void;\n};\n\ntype StateProps = {\n participantsCount: number;\n participants?: Record<string, TypeGroupCallParticipant>;\n canInvite?: boolean;\n};\n\nconst GroupCallParticipantList: FC<OwnProps & StateProps> = ({\n participants,\n participantsCount,\n openParticipantMenu,\n}) => {\n const {\n createGroupCallInviteLink,\n loadMoreGroupCallParticipants,\n } = getDispatch();\n\n const lang = useLang();\n\n const participantsIds = useMemo(() => {\n return Object.keys(participants || {});\n }, [participants]);\n\n const [viewportIds, getMore] = useInfiniteScroll(\n loadMoreGroupCallParticipants,\n participantsIds,\n participantsIds.length >= participantsCount,\n );\n\n return (\n <div className=\"participants\">\n <div className=\"invite-btn\" onClick={createGroupCallInviteLink}>\n <div className=\"icon\">\n <i className=\"icon-add-user\" />\n </div>\n <div className=\"text\">{lang('VoipGroupInviteMember')}</div>\n </div>\n\n <InfiniteScroll\n items={viewportIds}\n onLoadMore={getMore}\n >\n {viewportIds?.map(\n (participantId) => (\n participants![participantId] && (\n <GroupCallParticipant\n key={participantId}\n openParticipantMenu={openParticipantMenu}\n participant={participants![participantId]}\n />\n )\n ),\n )}\n </InfiniteScroll>\n\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { participantsCount, participants } = selectActiveGroupCall(global) || {};\n\n return {\n participants,\n participantsCount: participantsCount || 0,\n };\n },\n)(GroupCallParticipantList));\n","import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce';\nimport React, { FC, memo, useCallback } from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\n\nimport { ApiChat, ApiUser } from '../../../api/types';\n\nimport buildClassName from '../../../util/buildClassName';\nimport { selectChat, selectUser } from '../../../modules/selectors';\nimport useLang from '../../../hooks/useLang';\nimport { ENABLE_THUMBNAIL_VIDEO } from '../../../config';\n\nimport Avatar from '../../common/Avatar';\n\nimport './GroupCallParticipantVideo.scss';\n\ntype OwnProps = {\n participant: TypeGroupCallParticipant;\n type: 'video' | 'presentation';\n onClick?: (id: string, type: 'video' | 'presentation') => void;\n isFullscreen?: boolean;\n};\n\ntype StateProps = {\n user?: ApiUser;\n chat?: ApiChat;\n currentUserId?: string;\n isActive?: boolean;\n};\n\nconst GroupCallParticipantVideo: FC<OwnProps & StateProps> = ({\n type,\n onClick,\n user,\n chat,\n isActive,\n isFullscreen,\n}) => {\n const lang = useLang();\n\n const handleClick = useCallback(() => {\n if (onClick) {\n onClick(user?.id || chat!.id, type);\n }\n }, [chat, onClick, type, user?.id]);\n\n if (!user && !chat) return undefined;\n\n const streams = getUserStreams(user?.id || chat!.id);\n\n return (\n <div\n className={buildClassName('GroupCallParticipantVideo', isActive && 'active')}\n onClick={handleClick}\n >\n {isFullscreen && (\n <button className=\"back-button\">\n <i className=\"icon-arrow-left\" />\n {lang('Back')}\n </button>\n )}\n <Avatar user={user} chat={chat} className=\"thumbnail-avatar\" />\n {ENABLE_THUMBNAIL_VIDEO && (\n <div className=\"thumbnail-wrapper\">\n <video className=\"thumbnail\" muted autoPlay playsInline srcObject={streams?.[type]} />\n </div>\n )}\n <video className=\"video\" muted autoPlay playsInline srcObject={streams?.[type]} />\n <div className=\"info\">\n <i className=\"icon-microphone-alt\" />\n <span className=\"name\">{user?.firstName || chat?.title}</span>\n {type === 'presentation' && <i className=\"last-icon icon-active-sessions\" />}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { participant }): StateProps => {\n return {\n currentUserId: global.currentUserId,\n user: participant.isUser ? selectUser(global, participant.id) : undefined,\n chat: !participant.isUser ? selectChat(global, participant.id) : undefined,\n isActive: (participant.amplitude || 0) > THRESHOLD,\n };\n },\n)(GroupCallParticipantVideo));\n","import { GroupCallParticipant } from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useMemo, useState,\n} from '../../../lib/teact/teact';\nimport { withGlobal } from '../../../lib/teact/teactn';\nimport GroupCallParticipantVideo from './GroupCallParticipantVideo';\nimport { selectActiveGroupCall } from '../../../modules/selectors/calls';\nimport buildClassName from '../../../util/buildClassName';\n\ntype OwnProps = {\n onDoubleClick?: VoidFunction;\n};\n\ntype StateProps = {\n participants?: Record<string, GroupCallParticipant>;\n};\n\ntype SelectedVideo = {\n type: 'video' | 'presentation';\n id: string;\n};\n\nconst GroupCallParticipantStreams: FC<OwnProps & StateProps> = ({\n participants,\n onDoubleClick,\n}) => {\n const [selectedVideo, setSelectedVideo] = useState<SelectedVideo | undefined>(undefined);\n const presentationParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasPresentationStream);\n }, [participants]);\n const videoParticipants = useMemo(() => {\n return Object.values(participants || {}).filter((l) => l.hasVideoStream);\n }, [participants]);\n\n const totalVideoCount = videoParticipants.length + presentationParticipants.length;\n // TODO replace with more adequate solution.\n // There's a max of 30 videos or so right now\n const columnCount = totalVideoCount <= 2 ? 1 : (\n totalVideoCount <= 6 ? 2 : (\n totalVideoCount <= 9 ? 3 : 4\n )\n );\n\n const shouldSpanLastVideo = totalVideoCount === 3 || (columnCount === 2 && totalVideoCount % 2 !== 0);\n\n const handleClickVideo = useCallback((id: string, type: 'video' | 'presentation') => {\n if (!selectedVideo || (id !== selectedVideo.id || type !== selectedVideo.type)) {\n setSelectedVideo({\n id,\n type,\n });\n } else {\n setSelectedVideo(undefined);\n }\n }, [selectedVideo]);\n\n return (\n <div className=\"streams\" onDoubleClick={onDoubleClick}>\n <div\n className={buildClassName(\n 'videos',\n shouldSpanLastVideo && 'span-last-video',\n )}\n // @ts-ignore teact feature\n style={`--column-count: ${selectedVideo ? 1 : columnCount}`}\n >\n {selectedVideo && (\n <GroupCallParticipantVideo\n key={selectedVideo.id}\n isFullscreen\n onClick={handleClickVideo}\n participant={participants![selectedVideo.id]}\n type={selectedVideo.type}\n />\n )}\n\n {!selectedVideo ? presentationParticipants.map((participant) => (\n <GroupCallParticipantVideo\n key={participant.id}\n onClick={handleClickVideo}\n participant={participant}\n type=\"presentation\"\n />\n )) : undefined}\n {!selectedVideo ? videoParticipants.map((participant) => (\n <GroupCallParticipantVideo\n key={participant.id}\n onClick={handleClickVideo}\n participant={participant}\n type=\"video\"\n />\n )) : undefined}\n </div>\n </div>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { participants } = selectActiveGroupCall(global) || {};\n return {\n participants,\n };\n },\n)(GroupCallParticipantStreams));\n","import {\n GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,\n IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker,\n} from '../../../lib/secret-sauce';\nimport React, {\n FC, memo, useCallback, useEffect, useMemo, useRef, useState,\n} from '../../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../../lib/teact/teactn';\nimport '../../../modules/actions/calls';\n\nimport { IAnchorPosition } from '../../../types';\n\nimport {\n IS_ANDROID,\n IS_IOS,\n IS_REQUEST_FULLSCREEN_SUPPORTED,\n IS_SINGLE_COLUMN_LAYOUT,\n} from '../../../util/environment';\nimport buildClassName from '../../../util/buildClassName';\nimport {\n selectGroupCall,\n selectGroupCallParticipant,\n selectIsAdminInActiveGroupCall,\n} from '../../../modules/selectors/calls';\nimport useFlag from '../../../hooks/useFlag';\nimport useLang from '../../../hooks/useLang';\n\nimport Loading from '../../ui/Loading';\nimport Button from '../../ui/Button';\nimport DropdownMenu from '../../ui/DropdownMenu';\nimport MenuItem from '../../ui/MenuItem';\nimport Modal from '../../ui/Modal';\nimport MicrophoneButton from './MicrophoneButton';\nimport AnimatedIcon from '../../common/AnimatedIcon';\nimport Checkbox from '../../ui/Checkbox';\nimport GroupCallParticipantMenu from './GroupCallParticipantMenu';\nimport GroupCallParticipantList from './GroupCallParticipantList';\nimport GroupCallParticipantStreams from './GroupCallParticipantStreams';\n\nimport './GroupCall.scss';\n\nconst CAMERA_FLIP_PLAY_SEGMENT: [number, number] = [0, 10];\nconst PARTICIPANT_HEIGHT = 60;\n\nexport type OwnProps = {\n groupCallId: string;\n};\n\ntype StateProps = {\n isGroupCallPanelHidden: boolean;\n connectionState: GroupCallConnectionState;\n title?: string;\n meParticipant?: TypeGroupCallParticipant;\n participantsCount?: number;\n isSpeakerEnabled?: boolean;\n isAdmin: boolean;\n participants: Record<string, TypeGroupCallParticipant>;\n};\n\nconst GroupCall: FC<OwnProps & StateProps> = ({\n groupCallId,\n isGroupCallPanelHidden,\n connectionState,\n isSpeakerEnabled,\n title,\n meParticipant,\n isAdmin,\n participants,\n\n}) => {\n const {\n toggleGroupCallVideo,\n toggleGroupCallPresentation,\n leaveGroupCall,\n toggleGroupCallPanel,\n connectToActiveGroupCall,\n playGroupCallSound,\n } = getDispatch();\n\n const lang = useLang();\n // eslint-disable-next-line no-null/no-null\n const containerRef = useRef<HTMLDivElement>(null);\n\n const [isLeaving, setIsLeaving] = useState(false);\n const [isFullscreen, openFullscreen, closeFullscreen] = useFlag();\n const [isSidebarOpen, openSidebar, closeSidebar] = useFlag(true);\n const hasVideoParticipants = participants && Object.values(participants).some((l) => l.video || l.presentation);\n const isLandscape = isFullscreen && !IS_SINGLE_COLUMN_LAYOUT && hasVideoParticipants;\n\n const [participantMenu, setParticipantMenu] = useState<{\n participant: TypeGroupCallParticipant;\n anchor: IAnchorPosition;\n } | undefined>();\n const [isParticipantMenuOpen, openParticipantMenu, closeParticipantMenu] = useFlag();\n\n const [isConfirmLeaveModalOpen, openConfirmLeaveModal, closeConfirmLeaveModal] = useFlag();\n const [isEndGroupCallModal, setIsEndGroupCallModal] = useState(false);\n const [shouldEndGroupCall, setShouldEndGroupCall] = useState(false);\n\n const hasVideo = meParticipant?.hasVideoStream;\n const hasPresentation = meParticipant?.hasPresentationStream;\n const isConnecting = connectionState !== 'connected';\n const canSelfUnmute = meParticipant?.canSelfUnmute;\n const shouldRaiseHand = !canSelfUnmute && meParticipant?.isMuted;\n\n const handleOpenParticipantMenu = useCallback((anchor: HTMLDivElement, participant: TypeGroupCallParticipant) => {\n const rect = anchor.getBoundingClientRect();\n const container = containerRef.current!;\n\n setParticipantMenu({\n anchor: { x: rect.left, y: rect.top - container.offsetTop + PARTICIPANT_HEIGHT },\n participant,\n });\n\n openParticipantMenu();\n }, [openParticipantMenu]);\n\n useEffect(() => {\n if (connectionState === 'connected') {\n playGroupCallSound({ sound: 'join' });\n } else if (connectionState === 'reconnecting') {\n playGroupCallSound({ sound: 'connecting' });\n }\n }, [connectionState, playGroupCallSound]);\n\n const handleCloseConfirmLeaveModal = () => {\n closeConfirmLeaveModal();\n setIsEndGroupCallModal(false);\n };\n\n const MainButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {\n return ({ onTrigger, isOpen }) => (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n className={isOpen ? 'active' : undefined}\n onClick={onTrigger}\n ariaLabel={lang('AccDescrMoreOptions')}\n >\n <i className=\"icon-more\" />\n </Button>\n );\n }, [lang]);\n\n const handleToggleFullscreen = useCallback(() => {\n if (!containerRef.current) return;\n\n if (isFullscreen) {\n document.exitFullscreen().then(closeFullscreen);\n } else {\n containerRef.current.requestFullscreen().then(openFullscreen);\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleToggleSidebar = () => {\n if (isSidebarOpen) {\n closeSidebar();\n } else {\n openSidebar();\n }\n };\n\n const handleStreamsDoubleClick = useCallback(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return;\n\n if (!isFullscreen) {\n closeSidebar();\n handleToggleFullscreen();\n } else {\n handleToggleFullscreen();\n }\n }, [closeSidebar, handleToggleFullscreen, isFullscreen]);\n\n const toggleFullscreen = useCallback(() => {\n if (isFullscreen) {\n closeFullscreen();\n } else {\n openFullscreen();\n }\n }, [closeFullscreen, isFullscreen, openFullscreen]);\n\n const handleClose = () => {\n toggleGroupCallPanel();\n if (isFullscreen) {\n closeFullscreen();\n }\n };\n\n useEffect(() => {\n if (!IS_REQUEST_FULLSCREEN_SUPPORTED) return undefined;\n const container = containerRef.current;\n if (!container) return undefined;\n\n container.addEventListener('fullscreenchange', toggleFullscreen);\n\n return () => {\n container.removeEventListener('fullscreenchange', toggleFullscreen);\n };\n }, [toggleFullscreen]);\n\n const handleClickVideoOrSpeaker = () => {\n if (shouldRaiseHand) {\n toggleSpeaker();\n } else {\n toggleGroupCallVideo();\n }\n };\n\n useEffect(() => {\n connectToActiveGroupCall();\n }, [connectToActiveGroupCall, groupCallId]);\n\n const endGroupCall = () => {\n setIsEndGroupCallModal(true);\n setShouldEndGroupCall(true);\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n };\n\n const handleLeaveGroupCall = () => {\n if (isAdmin && !isConfirmLeaveModalOpen) {\n openConfirmLeaveModal();\n if (isFullscreen) {\n handleToggleFullscreen();\n }\n return;\n }\n playGroupCallSound({ sound: 'leave' });\n setIsLeaving(true);\n closeConfirmLeaveModal();\n };\n\n const handleCloseAnimationEnd = () => {\n if (isLeaving) {\n leaveGroupCall({\n shouldDiscard: shouldEndGroupCall,\n });\n }\n };\n\n return (\n <Modal\n isOpen={!isGroupCallPanelHidden && !isLeaving}\n onClose={toggleGroupCallPanel}\n className={buildClassName(\n 'GroupCall',\n IS_SINGLE_COLUMN_LAYOUT && 'single-column',\n isLandscape && 'landscape',\n !isSidebarOpen && 'no-sidebar',\n )}\n dialogRef={containerRef}\n onCloseAnimationEnd={handleCloseAnimationEnd}\n >\n <div className=\"header\">\n <h3>{title || lang('VoipGroupVoiceChat')}</h3>\n {IS_REQUEST_FULLSCREEN_SUPPORTED && (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleToggleFullscreen}\n ariaLabel={lang(isFullscreen ? 'AccExitFullscreen' : 'AccSwitchToFullscreen')}\n >\n <i className={isFullscreen ? 'icon-smallscreen' : 'icon-fullscreen'} />\n </Button>\n )}\n {isLandscape && (\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleToggleSidebar}\n >\n <i className=\"icon-sidebar\" />\n </Button>\n )}\n {((IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand) || isAdmin) && (\n <DropdownMenu\n positionX=\"right\"\n trigger={MainButton}\n >\n {IS_SCREENSHARE_SUPPORTED && !shouldRaiseHand && (\n <MenuItem\n icon=\"share-screen\"\n onClick={toggleGroupCallPresentation}\n >\n {lang(hasPresentation ? 'VoipChatStopScreenCapture' : 'VoipChatStartScreenCapture')}\n </MenuItem>\n )}\n {isAdmin && (\n <MenuItem\n icon=\"phone-discard-outline\"\n onClick={endGroupCall}\n destructive\n >\n {lang('VoipGroupLeaveAlertEndChat')}\n </MenuItem>\n )}\n </DropdownMenu>\n )}\n <Button\n round\n size=\"smaller\"\n color=\"translucent\"\n onClick={handleClose}\n >\n <i className=\"icon-close\" />\n </Button>\n </div>\n\n <div className=\"scrollable custom-scroll\">\n <GroupCallParticipantStreams onDoubleClick={handleStreamsDoubleClick} />\n\n {(!isLandscape || isSidebarOpen)\n && <GroupCallParticipantList openParticipantMenu={handleOpenParticipantMenu} />}\n </div>\n\n <GroupCallParticipantMenu\n participant={participantMenu?.participant}\n anchor={participantMenu?.anchor}\n isDropdownOpen={isParticipantMenuOpen}\n closeDropdown={closeParticipantMenu}\n />\n\n <div className=\"buttons\">\n {isConnecting && <Loading />}\n\n <div className=\"button-wrapper\">\n <div className=\"video-buttons\">\n {hasVideo && (IS_ANDROID || IS_IOS) && (\n <button className=\"smaller-button\" onClick={switchCameraInput}>\n <AnimatedIcon name=\"CameraFlip\" playSegment={CAMERA_FLIP_PLAY_SEGMENT} size={24} />\n </button>\n )}\n <button\n className={buildClassName(\n 'small-button',\n shouldRaiseHand ? 'speaker' : 'camera',\n (hasVideo || (shouldRaiseHand && isSpeakerEnabled)) && 'active',\n )}\n onClick={handleClickVideoOrSpeaker}\n >\n <i className={shouldRaiseHand ? 'icon-speaker' : (hasVideo ? 'icon-video-stop' : 'icon-video')} />\n </button>\n </div>\n\n <div className=\"button-text\">\n {lang(shouldRaiseHand ? 'VoipSpeaker' : 'VoipCamera')}\n </div>\n </div>\n\n <MicrophoneButton />\n\n <div className=\"button-wrapper\">\n <button className=\"small-button leave\" onClick={handleLeaveGroupCall}>\n <i className=\"icon-phone-discard\" />\n </button>\n\n <div className=\"button-text\">\n {lang('VoipGroupLeave')}\n </div>\n </div>\n </div>\n\n <Modal\n isOpen={isConfirmLeaveModalOpen}\n onClose={handleCloseConfirmLeaveModal}\n className=\"error\"\n title={lang(isEndGroupCallModal ? 'VoipGroupEndAlertTitle' : 'VoipGroupLeaveAlertTitle')}\n >\n <p>{lang(isEndGroupCallModal ? 'VoipGroupEndAlertText' : 'VoipGroupLeaveAlertText')}</p>\n {!isEndGroupCallModal && (\n <Checkbox\n label={lang('VoipGroupEndChat')}\n checked={shouldEndGroupCall}\n onCheck={setShouldEndGroupCall}\n />\n )}\n <Button isText className=\"confirm-dialog-button\" onClick={handleLeaveGroupCall}>\n {lang(isEndGroupCallModal ? 'VoipGroupEnd' : 'VoipGroupLeave')}\n </Button>\n <Button isText className=\"confirm-dialog-button\" onClick={handleCloseConfirmLeaveModal}>\n {lang('Cancel')}\n </Button>\n </Modal>\n </Modal>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { groupCallId }): StateProps => {\n const {\n connectionState, title, isSpeakerDisabled, participants, participantsCount,\n } = selectGroupCall(global, groupCallId)! || {};\n\n return {\n connectionState,\n title,\n isSpeakerEnabled: !isSpeakerDisabled,\n participantsCount,\n meParticipant: selectGroupCallParticipant(global, groupCallId, global.currentUserId!),\n isGroupCallPanelHidden: !!global.groupCalls.isGroupCallPanelHidden,\n isAdmin: selectIsAdminInActiveGroupCall(global),\n participants,\n };\n },\n)(GroupCall));\n","import { GroupCallParticipant } from '../../lib/secret-sauce';\nimport React, {\n FC, memo, useEffect,\n} from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport { ApiGroupCall } from '../../api/types';\n\nimport { selectActiveGroupCall, selectGroupCallParticipant } from '../../modules/selectors/calls';\nimport buildClassName from '../../util/buildClassName';\nimport useLang from '../../hooks/useLang';\n\nimport './ActiveCallHeader.scss';\n\ntype StateProps = {\n isGroupCallPanelHidden?: boolean;\n meParticipant: GroupCallParticipant;\n groupCall?: ApiGroupCall;\n};\n\nconst ActiveCallHeader: FC<StateProps> = ({\n groupCall,\n meParticipant,\n isGroupCallPanelHidden,\n}) => {\n const { toggleGroupCallPanel } = getDispatch();\n\n const lang = useLang();\n\n useEffect(() => {\n document.body.classList.toggle('has-group-call-header', isGroupCallPanelHidden);\n\n return () => {\n document.body.classList.toggle('has-group-call-header', false);\n };\n }, [isGroupCallPanelHidden]);\n\n if (!groupCall || !meParticipant) return undefined;\n\n return (\n <div\n className={buildClassName(\n 'ActiveCallHeader',\n isGroupCallPanelHidden && 'open',\n )}\n onClick={toggleGroupCallPanel}\n >\n <span className=\"title\">{groupCall.title || lang('VoipGroupVoiceChat')}</span>\n </div>\n );\n};\n\nexport default memo(withGlobal(\n (global): StateProps => {\n return {\n groupCall: selectActiveGroupCall(global),\n isGroupCallPanelHidden: global.groupCalls.isGroupCallPanelHidden,\n meParticipant: selectGroupCallParticipant(global, global.groupCalls.activeGroupCallId!, global.currentUserId!),\n };\n },\n)(ActiveCallHeader));\n","import React, { FC, memo, useState } from '../../lib/teact/teact';\nimport { getDispatch, withGlobal } from '../../lib/teact/teactn';\n\nimport ConfirmDialog from '../ui/ConfirmDialog';\nimport Checkbox from '../ui/Checkbox';\nimport { selectCallFallbackChannelTitle } from '../../modules/selectors/calls';\nimport { getUserFullName } from '../../modules/helpers';\nimport { selectCurrentMessageList, selectUser } from '../../modules/selectors';\nimport useCurrentOrPrev from '../../hooks/useCurrentOrPrev';\n\nexport type OwnProps = {\n isOpen: boolean;\n};\n\ninterface StateProps {\n userFullName?: string;\n channelTitle: string;\n}\n\nconst CallFallbackConfirm: FC<OwnProps & StateProps> = ({\n isOpen,\n channelTitle,\n userFullName,\n}) => {\n const {\n closeCallFallbackConfirm,\n inviteToCallFallback,\n } = getDispatch();\n\n const [shouldRemove, setShouldRemove] = useState(true);\n const renderingUserFullName = useCurrentOrPrev(userFullName, true);\n\n return (\n <ConfirmDialog\n title=\"Start Call\"\n isOpen={isOpen}\n confirmHandler={() => {\n inviteToCallFallback({ shouldRemove });\n }}\n onClose={closeCallFallbackConfirm}\n >\n <p>The call will be started in a private channel <b>{channelTitle}</b>.</p>\n <Checkbox\n label={`Remove ${renderingUserFullName} from this channel after the call`}\n checked={shouldRemove}\n onCheck={setShouldRemove}\n />\n </ConfirmDialog>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global): StateProps => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const user = chatId ? selectUser(global, chatId) : undefined;\n\n return {\n userFullName: user ? getUserFullName(user) : undefined,\n channelTitle: selectCallFallbackChannelTitle(global),\n };\n },\n)(CallFallbackConfirm));\n","import { ApiMediaFormat } from '../../../api/types';\n\nimport * as mediaLoader from '../../../util/mediaLoader';\n\n// @ts-ignore\nimport MonkeyIdle from '../../../assets/TwoFactorSetupMonkeyIdle.tgs';\n// @ts-ignore\nimport MonkeyTracking from '../../../assets/TwoFactorSetupMonkeyTracking.tgs';\n// @ts-ignore\nimport MonkeyClose from '../../../assets/TwoFactorSetupMonkeyClose.tgs';\n// @ts-ignore\nimport MonkeyPeek from '../../../assets/TwoFactorSetupMonkeyPeek.tgs';\n// @ts-ignore\nimport FoldersAll from '../../../assets/FoldersAll.tgs';\n// @ts-ignore\nimport FoldersNew from '../../../assets/FoldersNew.tgs';\n// @ts-ignore\nimport DiscussionGroups from '../../../assets/DiscussionGroupsDucks.tgs';\n// @ts-ignore\nimport CameraFlip from '../../../assets/animatedIcons/CameraFlip.tgs';\n// @ts-ignore\nimport HandFilled from '../../../assets/animatedIcons/HandFilled.tgs';\n// @ts-ignore\nimport HandOutline from '../../../assets/animatedIcons/HandOutline.tgs';\n// @ts-ignore\nimport Speaker from '../../../assets/animatedIcons/Speaker.tgs';\n// @ts-ignore\nimport VoiceAllowTalk from '../../../assets/animatedIcons/VoiceAllowTalk.tgs';\n// @ts-ignore\nimport VoiceMini from '../../../assets/animatedIcons/VoiceMini.tgs';\n// @ts-ignore\nimport VoiceMuted from '../../../assets/animatedIcons/VoiceMuted.tgs';\n// @ts-ignore\nimport VoiceOutlined from '../../../assets/animatedIcons/VoiceOutlined.tgs';\n\nexport const ANIMATED_STICKERS_PATHS = {\n MonkeyIdle,\n MonkeyTracking,\n MonkeyClose,\n MonkeyPeek,\n FoldersAll,\n FoldersNew,\n DiscussionGroups,\n CameraFlip,\n HandFilled,\n HandOutline,\n Speaker,\n VoiceAllowTalk,\n VoiceMini,\n VoiceMuted,\n VoiceOutlined,\n};\n\nexport default function getAnimationData(name: keyof typeof ANIMATED_STICKERS_PATHS) {\n const path = ANIMATED_STICKERS_PATHS[name].replace(window.location.origin, '');\n\n return mediaLoader.fetch(`file${path}`, ApiMediaFormat.Lottie);\n}\n","/*! For license information please see index.js.LICENSE.txt */\n(()=>{\"use strict\";var e={\"./src/blacksilence.ts\":(e,t,n)=>{n.r(t),n.d(t,{silence:()=>a,black:()=>i});const a=e=>{const t=e.createOscillator(),n=t.connect(e.createMediaStreamDestination());return t.start(),new MediaStream([Object.assign(n.stream.getAudioTracks()[0],{enabled:!1})])},i=({width:e=640,height:t=480}={})=>{const n=Object.assign(document.createElement(\"canvas\"),{width:e,height:t}),a=n.getContext(\"2d\");if(!a)throw Error(\"Cannot create canvas ctx\");a.fillRect(0,0,e,t);const i=n.captureStream();return new MediaStream([Object.assign(i.getVideoTracks()[0],{enabled:!1})])}},\"./src/buildSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=(e,t=!1,n=!1)=>{const i=[],r=e=>{i.push(e)},{sessionId:s,ssrcs:o,audioExtensions:c,videoExtensions:d,audioPayloadTypes:p,videoPayloadTypes:u,transport:{ufrag:l,pwd:m,fingerprints:f,candidates:g}}=e;r(\"v=0\"),r(`o=- ${s} 2 IN IP4 0.0.0.0`),r(\"s=-\"),r(\"t=0 0\"),r(`a=group:BUNDLE ${o.map((e=>e.endpoint)).join(\" \")}${n?\"\":\" 2\"}`),r(\"a=ice-lite\");const S=e=>{let t=\"\";t+=\"a=candidate:\",t+=`${e.foundation} ${e.component} ${e.protocol} ${e.priority} ${e.ip} ${e.port} typ ${e.type}`,\"rel-addr\"in e&&(t+=` raddr ${e[\"rel-addr\"]} rport ${e[\"rel-port\"]}`),t+=` generation ${e.generation}`,r(t)},v=()=>{r(`a=ice-ufrag:${l}`),r(`a=ice-pwd:${m}`),f.forEach((e=>{r(`a=fingerprint:${e.hash} ${e.fingerprint}`),r(\"a=setup:passive\")})),g.forEach(S)},h=e=>{const{channels:t,id:n,name:a,clockrate:i,parameters:s}=e;var o=t?`/${t}`:\"\";r(`a=rtpmap:${n} ${a}/${i}${o}`),s&&(o=Object.keys(s).map((e=>`${e}=${s[e]};`)).join(\" \"),r(`a=fmtp:${n} ${o}`)),e[\"rtcp-fbs\"]?.forEach((e=>{r(`a=rtcp-fb:${n} ${e.type}${e.subtype?` ${e.subtype}`:\"\"}`)}))};return e=e=>{const n=e.isVideo?u:p;var i=e.isVideo?\"video\":\"audio\";r(`m=${i} ${e.isMain?1:0} RTP/SAVPF ${n.map((e=>e.id)).join(\" \")}`),r(\"c=IN IP4 0.0.0.0\"),r(\"b=AS:1300\"),r(`a=mid:${e.endpoint}`),r(\"a=rtcp-mux\"),n.forEach(h),r(\"a=rtcp:1 IN IP4 0.0.0.0\"),e.isVideo&&r(\"a=rtcp-rsize\"),(e.isVideo?d:c).forEach((({id:e,uri:t})=>{r(`a=extmap:${e} ${t}`)})),e.isRemoved?r(\"a=inactive\"):(v(),t?r(\"a=recvonly\"):(e.isMain?r(\"a=sendrecv\"):(r(\"a=sendonly\"),r(\"a=bundle-only\")),e.sourceGroups.forEach((t=>{r(`a=ssrc-group:${t.semantics} ${t.sources.map(a.fromTelegramSource).join(\" \")}`),t.sources.forEach((t=>{t=(0,a.fromTelegramSource)(t),r(`a=ssrc:${t} cname:${e.endpoint}`),r(`a=ssrc:${t} msid:${e.endpoint} ${e.endpoint}`),r(`a=ssrc:${t} mslabel:${e.endpoint}`),r(`a=ssrc:${t} label:${e.endpoint}`)}))}))))},o.filter((e=>\"0\"===e.endpoint||\"1\"===e.endpoint)).map(e),n||(r(\"m=application 1 UDP/DTLS/SCTP webrtc-datachannel\"),r(\"c=IN IP4 0.0.0.0\"),v(),r(\"a=ice-options:trickle\"),r(\"a=mid:\"+(n?\"1\":\"2\")),r(\"a=sctp-port:5000\"),r(\"a=max-message-size:262144\")),o.filter((e=>\"0\"!==e.endpoint&&\"1\"!==e.endpoint)).map(e),`${i.join(\"\\n\")}\\n`}},\"./src/parseSdp.ts\":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var a=n(\"./src/utils.ts\");const i=e=>{if(!e||!e.sdp)throw Error(\"Failed parsing SDP: session description is null\");const t=e.sdp.split(\"\\r\\nm=\").map(((e,t)=>0===t?e:`m=${e}`)).reduce(((e,t)=>(e[t.match(/^m=(.+?)\\s/)?.[1]||\"header\"]=t.split(\"\\r\\n\").filter(Boolean),e)),{});var n=(e,n)=>n?t[n]?.find((t=>t.startsWith(e)))?.substr(e.length):Object.values(t).map((t=>t.find((t=>t.startsWith(e)))?.substr(e.length))).filter(Boolean)[0];const i=n(\"a=ssrc:\",\"audio\");var r=i&&Number(i.split(\" \")[0]);const s=n(\"a=ssrc-group:\",\"video\")?.split(\" \")||void 0;if(!s)throw Error(\"Failed parsing SDP: no video ssrc\");var[o,c]=n(\"a=fingerprint:\")?.split(\" \")||[];if(!o||!c)throw Error(\"Failed parsing SDP: no fingerprint\");if(e=n(\"a=ice-ufrag:\"),n=n(\"a=ice-pwd:\"),!e||!n)throw Error(\"Failed parsing SDP: no ICE ufrag or pwd\");return{fingerprints:[{fingerprint:c,hash:o,setup:\"active\"}],pwd:n,ufrag:e,...r&&{ssrc:(0,a.toTelegramSource)(r)},...s&&{\"ssrc-groups\":[{semantics:s[0],sources:s.slice(1,s.length).map(Number).map(a.toTelegramSource)}]}}}},\"./src/secretsauce.ts\":(e,t,n)=>{n.r(t),n.d(t,{getDevices:()=>async function(e,t=!0){return(await navigator.mediaDevices.enumerateDevices()).filter((n=>n.kind===`${e}${t?\"input\":\"output\"}`))},toggleSpeaker:()=>function(){o&&(o.isSpeakerDisabled=!o.isSpeakerDisabled,o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:\"connected\",isSpeakerDisabled:o.isSpeakerDisabled}),o.participantFunctions&&Object.values(o.participantFunctions).forEach((e=>{e.toggleMute?.(!!o?.isSpeakerDisabled)})))},toggleNoiseSuppression:()=>function(){if(o&&o.myId&&o.streams){const n=o.streams[o.myId].audio;if(n){const a=n.getTracks()[0];var e,t;a&&(({echoCancellation:e,noiseSuppression:t}=a.getConstraints()),a.applyConstraints({echoCancellation:!e,noiseSuppression:!t}))}}},getUserStreams:()=>d,setVolume:()=>function(e,t){const n=o?.participantFunctions?.[e];n&&n.setVolume?.(t)},isStreamEnabled:()=>p,switchCameraInput:()=>async function(){if(o?.myId&&o.connection&&o.streams&&o.facingMode){const e=d(o.myId)?.video;if(e){const t=e.getTracks()[0];if(t){const e=o.connection.getSenders().find((e=>t.id===e.track?.id));if(e){o.facingMode=\"environment\"===o.facingMode?\"user\":\"environment\";try{const t=await l(\"video\",o.facingMode);await e.replaceTrack(t.getTracks()[0]),o.streams[o.myId].video=t}catch(e){}}}}}},toggleStream:()=>m,leaveGroupCall:()=>g,handleUpdateGroupCallParticipants:()=>async function(e){if(o){const{participants:a,conference:r,connection:s,myId:c}=o;if(a&&r&&s&&r.ssrcs&&r.transport&&c)if(e.find((e=>e.isSelf&&e.source!==o?.conference?.ssrcs?.find((e=>e.isMain&&!e.isVideo))?.sourceGroups[0].sources[0])))g();else{const a=[];if(e.forEach((e=>{if(e.isSelf)e.isMuted&&!e.canSelfUnmute&&(m(\"audio\",!1),m(\"video\",!1),m(\"presentation\",!1));else{var t=e.isLeft;const n=e.isMuted||e.isMutedByMe,i=!e.isVideoJoined||!e.video||t,s=!e.presentation||t;let o=!1,c=!1,d=!1;r.ssrcs.filter((t=>t.userId===e.id)).forEach((t=>{t.isVideo||(t.sourceGroups[0].sources[0]===e.source&&(c=!0),t.isRemoved=n),t.isVideo&&(t.isPresentation||(e.video&&t.endpoint===e.video.endpoint&&(o=!0),t.isRemoved=i),t.isPresentation&&(e.presentation&&t.endpoint===e.presentation.endpoint&&(d=!0),t.isRemoved=s))})),n||c||r.ssrcs.push({userId:e.id,isMain:!1,endpoint:`audio${e.source}`,isVideo:!1,sourceGroups:[{semantics:\"FID\",sources:[e.source]}]}),i||o||!e.video||(a.push(e.video.endpoint),r.ssrcs.push({userId:e.id,isMain:!1,endpoint:e.video.endpoint,isVideo:!0,sourceGroups:e.video.sourceGroups})),s||d||!e.presentation||r.ssrcs.push({isPresentation:!0,userId:e.id,isMain:!1,endpoint:e.presentation.endpoint,isVideo:!0,sourceGroups:e.presentation.sourceGroups})}})),o.updatingParticipantsQueue)o.updatingParticipantsQueue.push(r);else{o.updatingParticipantsQueue=[],e=(0,i.default)(r),await s.setRemoteDescription({type:\"offer\",sdp:e});try{var t=await s.createAnswer();if(await s.setLocalDescription(t),u(c),0<o.updatingParticipantsQueue.length)for(const e of o.updatingParticipantsQueue){await s.setRemoteDescription({type:\"offer\",sdp:(0,i.default)(e)});var n=await s.createAnswer();await s.setLocalDescription(n),u(c)}o.updatingParticipantsQueue=void 0}catch(e){console.error(e)}}}}},handleUpdateGroupCallConnection:()=>async function(e,t){if(o){var n=t?o.screenshareConference:o.conference;const r=t?o.screenshareConnection:o.connection;if(n&&r&&n.ssrcs){var a=Date.now();e={...n,transport:e.transport,sessionId:a,audioExtensions:e.audio?.[\"rtp-hdrexts\"],audioPayloadTypes:e.audio?.[\"payload-types\"],videoExtensions:e.video?.[\"rtp-hdrexts\"],videoPayloadTypes:e.video?.[\"payload-types\"]};o={...o,...t?{screenshareConference:e}:{conference:e}};try{await r.setRemoteDescription({type:\"answer\",sdp:(0,i.default)(e,!0,t)})}catch(e){console.error(e)}}}},startSharingScreen:()=>async function(){if(o)try{const e=await l(\"presentation\");return e?(e.getTracks()[0].onended=()=>{o&&o.myId&&(o.streams?.[o.myId].presentation,u(o.myId),c())},new Promise((t=>{var{connection:n,dataChannel:t}=h([e],t,!0);o={...o,screenshareConnection:n,screenshareDataChannel:t}}))):void 0}catch(e){return}},joinGroupCall:()=>function(e,t,n,a){if(o)throw Error(\"Already in call\");f(\"connecting\");var i=new MediaStream;return n.srcObject=i,n.play().catch((e=>console.warn(e))),o={onUpdate:a,participants:[],myId:e,speaking:{},silence:(0,r.silence)(t),black:(0,r.black)({width:640,height:480}),analyserInterval:setInterval(S,1e3),audioElement:n,audioContext:t,mediaStream:i},new Promise((e=>{o={...o,...h([o.silence,o.black],e)}}))}});var a=n(\"./src/parseSdp.ts\"),i=n(\"./src/buildSdp.ts\"),r=n(\"./src/blacksilence.ts\"),s=n(\"./src/utils.ts\");let o;function c(e){o&&(o.screenshareDataChannel?.close(),o.screenshareConnection?.close(),e||o.onUpdate?.({\"@type\":\"updateGroupCallLeavePresentation\"}))}function d(e){return o?.streams?.[e]}function p(e,t){const n=(t=t||o?.myId)&&d(t)?.[e];return!!n&&n.getTracks()[0]?.enabled}function u(e){o?.onUpdate?.({\"@type\":\"updateGroupCallStreams\",userId:e,hasAudioStream:p(\"audio\",e),hasVideoStream:p(\"video\",e),hasPresentationStream:p(\"presentation\",e),amplitude:o.speaking?.[e]})}function l(e,t=\"user\"){return\"presentation\"===e?navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0}):navigator.mediaDevices.getUserMedia({audio:\"audio\"===e&&{...s.IS_ECHO_CANCELLATION_SUPPORTED&&{echoCancellation:!0},...s.IS_NOISE_SUPPRESSION_SUPPORTED&&{noiseSuppression:!0}},video:\"video\"===e&&{facingMode:t}})}async function m(e,t){if(o&&o.myId&&o.connection&&o.streams){const n=d(o.myId)?.[e];if(n){const a=n.getTracks()[0];if(a){const n=[...o.connection.getSenders(),...o.screenshareConnection?.getSenders()||[]].find((e=>a.id===e.track?.id));if(n){t=void 0===t?!a.enabled:t;try{if(t&&!a.enabled){const t=await l(e);if(await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e)o.facingMode=\"user\";else if(\"audio\"===e){const e=o.audioContext;if(!e)return;const n=e.createMediaStreamSource(t),a=e.createAnalyser();a.minDecibels=-100,a.maxDecibels=-30,a.smoothingTimeConstant=.05,a.fftSize=1024,n.connect(a),o={...o,participantFunctions:{...o.participantFunctions,[o.myId]:{...o.participantFunctions?.[o.myId],getCurrentAmplitude:()=>{var e=new Uint8Array(a.frequencyBinCount);return a.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}}else if(!t&&a.enabled){a.stop();const t=\"audio\"===e?o.silence:o.black;if(!t)return;await n.replaceTrack(t.getTracks()[0]),o.streams[o.myId][e]=t,\"video\"===e&&(o.facingMode=void 0)}u(o.myId),\"presentation\"!==e||t||c(!0)}catch(e){}}}}}}function f(e){o?.onUpdate?.({\"@type\":\"updateGroupCallConnectionState\",connectionState:e})}function g(){o&&(o.myId&&o.streams?.[o.myId]&&Object.values(o.streams[o.myId]||{}).forEach((e=>{e?.getTracks().forEach((e=>{e.stop()}))})),c(!0),o.dataChannel?.close(),o.connection?.close(),f(\"disconnected\"),o.analyserInterval&&clearInterval(o.analyserInterval),o=void 0)}function S(){o&&o.participantFunctions&&Object.keys(o.participantFunctions).forEach((e=>{const t=o.participantFunctions[Number(e)].getCurrentAmplitude;var n,a;t&&(n=t(),a=o.speaking[e]||0,((o.speaking[e]=n)>s.THRESHOLD&&a<=s.THRESHOLD||n<=s.THRESHOLD&&a>s.THRESHOLD)&&u(e))}))}function v(e){if(o&&o.audioElement&&o.audioContext&&o.mediaStream){var t=o.conference?.ssrcs?.find((t=>t.endpoint===e.track.id));if(t&&t.userId){const{userId:a,isPresentation:i}=t;var n=o.participants?.find((e=>e.id===a));const r=\"video\"===e.track.kind?i?\"presentation\":\"video\":\"audio\";if(e.track.onended=()=>{o?.streams?.[a][r],u(a)},t=e.streams[0],\"audio\"===e.track.kind){const e=o.mediaStream,i=new window.AudioContext,r=i.createMediaStreamSource(t),c=i.createGain();c.gain.value=(n?.volume||1e4)/1e4;const d=i.createGain();c.gain.value=1;const p=i.createAnalyser();p.minDecibels=-100,p.maxDecibels=-30,p.smoothingTimeConstant=.05,p.fftSize=1024,r.connect(p).connect(d).connect(c).connect(i.destination),e.addTrack(r.mediaStream.getAudioTracks()[0]);const u=new Audio;u.srcObject=t,u.muted=!0,u.remove(),o={...o,participantFunctions:{...o.participantFunctions,[a]:{...o.participantFunctions?.[a],setVolume:e=>{c.gain.value=1<e?2*e:e},toggleMute:e=>{d.gain.value=e?0:1},getCurrentAmplitude:()=>{var e=new Uint8Array(p.frequencyBinCount);return p.getByteFrequencyData(e),(0,s.getAmplitude)(e,1.5)}}}}}o={...o,streams:{...o.streams,[a]:{...o.streams?.[a],[r]:t}}},u(a)}}}function h(e,t,n=!1){const i=new RTCPeerConnection;var r=n?void 0:function(e){const t=e.createDataChannel(\"data\",{id:0});return t.onopen=()=>{},t.onmessage=e=>{JSON.parse(e.data).colibriClass},t.onerror=e=>{console.log(\"%conerror\",\"background: green; font-size: 5em\"),console.error(e)},t}(i);return e.forEach((e=>e.getTracks().forEach((t=>{i.addTrack(t,e)})))),n||(i.oniceconnectionstatechange=()=>{var e=i.iceConnectionState;\"connected\"===e||\"completed\"===e?f(\"connected\"):\"checking\"===e||\"new\"===e?f(\"connecting\"):\"disconnected\"===i.iceConnectionState&&f(\"reconnecting\")}),i.ontrack=v,i.onnegotiationneeded=async()=>{if(o){var r=o.myId;if(r){var s=await i.createOffer({offerToReceiveVideo:!0,offerToReceiveAudio:!n});if(await i.setLocalDescription(s),s.sdp){var c=(0,a.default)(s),d=n?void 0:{userId:\"\",sourceGroups:[{semantics:\"FID\",sources:[c.ssrc||0]}],isRemoved:n,isMain:!0,isVideo:!1,isPresentation:n,endpoint:n?\"1\":\"0\"},p=c[\"ssrc-groups\"]&&{isPresentation:n,userId:\"\",sourceGroups:c[\"ssrc-groups\"],isMain:!0,isVideo:!0,endpoint:n?\"0\":\"1\"};s=n?o.screenshareConference:o.conference;const i=[];n?(p&&i.push(p),d&&i.push(d)):(d&&i.push(d),p&&i.push(p)),d=e.find((e=>\"audio\"===e.getTracks()[0].kind)),p=e.find((e=>\"video\"===e.getTracks()[0].kind)),o={...o,...n?{screenshareConference:{...s,ssrcs:i}}:{conference:{...s,ssrcs:i}},streams:{...o.streams,[r]:{...o.streams?.[r],...d&&{audio:d},...!n&&p?{video:p}:{presentation:p}}}},u(r),t(c)}}}},{connection:i,dataChannel:r}}},\"./src/types.ts\":(e,t,n)=>{n.r(t)},\"./src/utils.ts\":(e,t,n)=>{function a(){var{userAgent:e,platform:t}=window.navigator;let n;return-1!==[\"Macintosh\",\"MacIntel\",\"MacPPC\",\"Mac68K\"].indexOf(t)?n=\"macOS\":-1!==[\"iPhone\",\"iPad\",\"iPod\"].indexOf(t)?n=\"iOS\":-1!==[\"Win32\",\"Win64\",\"Windows\",\"WinCE\"].indexOf(t)?n=\"Windows\":/Android/.test(e)?n=\"Android\":/Linux/.test(t)&&(n=\"Linux\"),n}n.r(t),n.d(t,{toTelegramSource:()=>function(e){return e<<0},fromTelegramSource:()=>function(e){return e>>>0},getAmplitude:()=>function(e,t=3){if(!e)return 0;var n=e.length;let a=0;for(let t=0;t<n;t++)a+=e[t]*e[t];var i=Math.sqrt(a/n)/255;return Math.min(1,i*t)},getPlatform:()=>a,THRESHOLD:()=>i,PLATFORM_ENV:()=>r,IS_MAC_OS:()=>s,IS_IOS:()=>o,IS_SCREENSHARE_SUPPORTED:()=>c,IS_ECHO_CANCELLATION_SUPPORTED:()=>d,IS_NOISE_SUPPRESSION_SUPPORTED:()=>p});const i=.1,r=a(),s=\"macOS\"===r,o=\"iOS\"===r,c=\"getDisplayMedia\"in(navigator?.mediaDevices||{}),d=navigator?.mediaDevices?.getSupportedConstraints().echoCancellation,p=navigator?.mediaDevices?.getSupportedConstraints().noiseSuppression}},t={};function n(a){var i=t[a];return void 0!==i||(i=t[a]={exports:{}},e[a](i,i.exports,n)),i.exports}n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})};var a={};(()=>{n.r(a),n.d(a,{handleUpdateGroupCallConnection:()=>e.handleUpdateGroupCallConnection,startSharingScreen:()=>e.startSharingScreen,joinGroupCall:()=>e.joinGroupCall,getDevices:()=>e.getDevices,getUserStreams:()=>e.getUserStreams,setVolume:()=>e.setVolume,isStreamEnabled:()=>e.isStreamEnabled,toggleStream:()=>e.toggleStream,leaveGroupCall:()=>e.leaveGroupCall,handleUpdateGroupCallParticipants:()=>e.handleUpdateGroupCallParticipants,switchCameraInput:()=>e.switchCameraInput,toggleSpeaker:()=>e.toggleSpeaker,toggleNoiseSuppression:()=>e.toggleNoiseSuppression,IS_SCREENSHARE_SUPPORTED:()=>t.IS_SCREENSHARE_SUPPORTED,THRESHOLD:()=>t.THRESHOLD});var e=n(\"./src/secretsauce.ts\"),t=n(\"./src/utils.ts\");n(\"./src/types.ts\")})();var i,r=exports;for(i in a)r[i]=a[i];a.__esModule&&Object.defineProperty(r,\"__esModule\",{value:!0})})();"],"names":["addReducer","global","actions","update","activeGroupCallId","groupCalls","toggleGroupCallPresentation","value","userId","selectGroupCallParticipant","updateGroupCallParticipant","omit","connectionState","leaveGroupCall","isFromLibrary","updateGroupCall","isSpeakerDisabled","groupCallId","participants","handleUpdateGroupCallParticipants","data","stream","showNotification","message","handleUpdateGroupCallConnection","presentation","groupCall","selectActiveGroupCall","Object","keys","length","values","payload","shouldDiscard","shouldRemove","rejoin","setGlobal","updateActiveGroupCall","participantsCount","callApi","call","shouldResetFallbackState","getGlobal","fallbackChatId","chatId","fallbackUserIdsToRemove","forEach","deleteChatMember","removeGroupCall","id","removeGroupCallAudioElement","isGroupCallPanelHidden","undefined","joinGroupCall","user","selectUser","currentUserId","toggleStream","videoStopped","isStreamEnabled","participant","raiseHand","participantId","volume","setVolume","Math","floor","GROUP_CALL_VOLUME_MULTIPLIER","Number","muted","params","startSharingScreen","presentationPaused","audioElement","getGroupCallAudioElement","audioContext","getGroupCallAudioContext","apiUpdate","inviteHash","loadMoreGroupCallParticipants","chat","selectChat","loadFullChat","selectCurrentMessageList","fallbackChannelTitle","selectCallFallbackChannelTitle","fallbackChannel","chats","byId","find","channel","title","isCreator","isRestricted","updateChatMemberBannedRights","bannedRights","users","photo","fetchFile","callFallbackAvatarPath","accessHash","inviteLink","usageLimit","expireDate","getServerTime","serverTimeOffset","sendMessage","text","openChat","createGroupCall","closeCallFallbackConfirm","vibrateShort","navigator","vibrate","memo","size","name","playSegment","color","iconData","setIconData","useState","useEffect","getAnimationData","then","AnimatedSticker","play","noLoop","speed","animationData","withGlobal","meParticipant","raiseHandRating","hasAudioStream","canSelfUnmute","isMuted","hasRequestedToSpeak","Boolean","noAudioStream","toggleGroupCallMute","requestToSpeak","playGroupCallSound","getDispatch","lang","useLang","muteMouseDownState","useRef","isRequestingToSpeak","setIsRequestingToSpeak","isConnecting","shouldRaiseHand","prevShouldRaiseHand","usePrevious","useMemo","r","random","animatedIconName","toggleMute","buttonText","className","buildClassName","onMouseDown","setTimeout","current","onMouseUp","SPEAKER_ICON_DISABLED_SEGMENT","SPEAKER_ICON_ENABLED_SEGMENT","isAdmin","selectIsAdminInActiveGroupCall","closeDropdown","isDropdownOpen","anchor","setGroupCallParticipantVolume","toggleGroupCallPanel","isDeleteUserModalOpen","openDeleteUserModal","closeDeleteUserModal","useFlag","isMutedByMe","isSelf","isRaiseHand","localVolume","setLocalVolume","GROUP_CALL_DEFAULT_VOLUME","runThrottled","useThrottle","handleRemove","useCallback","e","stopPropagation","handleCancelRequestToSpeak","handleMute","handleOpenProfile","speakerIconPlaySegment","Menu","isOpen","positionX","autoClose","style","y","onClose","type","min","max","onChange","target","MenuItem","icon","onClick","destructive","DeleteMemberModal","noColor","isSpeaking","amplitude","THRESHOLD","prevIsRaiseHand","prevIsMuted","microphoneColor","isUser","openParticipantMenu","anchorRef","aboutText","aboutColor","toString","replace","about","firstName","lastName","ref","Avatar","createGroupCallInviteLink","participantsIds","viewportIds","getMore","useInfiniteScroll","InfiniteScroll","items","onLoadMore","map","key","isActive","isFullscreen","handleClick","streams","getUserStreams","ENABLE_THUMBNAIL_VIDEO","autoPlay","playsInline","srcObject","onDoubleClick","selectedVideo","setSelectedVideo","presentationParticipants","filter","l","hasPresentationStream","videoParticipants","hasVideoStream","totalVideoCount","columnCount","shouldSpanLastVideo","handleClickVideo","CAMERA_FLIP_PLAY_SEGMENT","selectGroupCall","isSpeakerEnabled","toggleGroupCallVideo","connectToActiveGroupCall","containerRef","isLeaving","setIsLeaving","openFullscreen","closeFullscreen","isSidebarOpen","openSidebar","closeSidebar","hasVideoParticipants","some","video","isLandscape","IS_SINGLE_COLUMN_LAYOUT","participantMenu","setParticipantMenu","isParticipantMenuOpen","closeParticipantMenu","isConfirmLeaveModalOpen","openConfirmLeaveModal","closeConfirmLeaveModal","isEndGroupCallModal","setIsEndGroupCallModal","shouldEndGroupCall","setShouldEndGroupCall","hasVideo","hasPresentation","handleOpenParticipantMenu","rect","getBoundingClientRect","container","x","left","top","offsetTop","sound","handleCloseConfirmLeaveModal","MainButton","onTrigger","Button","round","ariaLabel","handleToggleFullscreen","document","exitFullscreen","requestFullscreen","handleStreamsDoubleClick","IS_REQUEST_FULLSCREEN_SUPPORTED","toggleFullscreen","addEventListener","removeEventListener","handleLeaveGroupCall","Modal","dialogRef","onCloseAnimationEnd","IS_SCREENSHARE_SUPPORTED","DropdownMenu","trigger","Loading","IS_ANDROID","IS_IOS","switchCameraInput","toggleSpeaker","Checkbox","label","checked","onCheck","isText","body","classList","toggle","userFullName","getUserFullName","channelTitle","inviteToCallFallback","setShouldRemove","renderingUserFullName","useCurrentOrPrev","ConfirmDialog","confirmHandler","ANIMATED_STICKERS_PATHS","MonkeyIdle","MonkeyTracking","MonkeyClose","MonkeyPeek","FoldersAll","FoldersNew","DiscussionGroups","CameraFlip","HandFilled","HandOutline","Speaker","VoiceAllowTalk","VoiceMini","VoiceMuted","VoiceOutlined","path","window","location","origin","mediaLoader","ApiMediaFormat","t","n","d","silence","a","black","i","createOscillator","connect","createMediaStreamDestination","start","MediaStream","assign","getAudioTracks","enabled","width","height","createElement","getContext","Error","fillRect","captureStream","getVideoTracks","default","push","sessionId","s","ssrcs","o","audioExtensions","c","videoExtensions","audioPayloadTypes","p","videoPayloadTypes","u","transport","ufrag","pwd","m","fingerprints","f","candidates","g","endpoint","join","S","foundation","component","protocol","priority","ip","port","generation","v","hash","fingerprint","h","channels","clockrate","parameters","subtype","isVideo","isMain","uri","isRemoved","sourceGroups","semantics","sources","fromTelegramSource","sdp","split","reduce","match","startsWith","substr","setup","ssrc","toTelegramSource","slice","getDevices","async","mediaDevices","enumerateDevices","kind","onUpdate","participantFunctions","toggleNoiseSuppression","myId","audio","getTracks","echoCancellation","noiseSuppression","getConstraints","applyConstraints","connection","facingMode","getSenders","track","replaceTrack","conference","source","isLeft","isVideoJoined","isPresentation","updatingParticipantsQueue","setRemoteDescription","createAnswer","setLocalDescription","console","error","screenshareConference","screenshareConnection","Date","now","onended","Promise","dataChannel","screenshareDataChannel","catch","warn","speaking","analyserInterval","setInterval","mediaStream","close","getDisplayMedia","getUserMedia","IS_ECHO_CANCELLATION_SUPPORTED","IS_NOISE_SUPPRESSION_SUPPORTED","createMediaStreamSource","createAnalyser","minDecibels","maxDecibels","smoothingTimeConstant","fftSize","getCurrentAmplitude","Uint8Array","frequencyBinCount","getByteFrequencyData","getAmplitude","stop","clearInterval","AudioContext","createGain","gain","destination","addTrack","Audio","remove","RTCPeerConnection","createDataChannel","onopen","onmessage","JSON","parse","colibriClass","onerror","log","oniceconnectionstatechange","iceConnectionState","ontrack","onnegotiationneeded","createOffer","offerToReceiveVideo","offerToReceiveAudio","userAgent","platform","indexOf","test","sqrt","getPlatform","PLATFORM_ENV","IS_MAC_OS","getSupportedConstraints","exports","defineProperty","enumerable","get","prototype","hasOwnProperty","Symbol","toStringTag","__esModule"],"sourceRoot":""} |