telegram-tt/dist/9970.9e76fbb3596b6579deb3.js.map
Alexander Zinchuk d29e7b05f3 [Build]
2022-07-08 16:49:16 +02:00

1 line
101 KiB
Plaintext

{"version":3,"file":"9970.9e76fbb3596b6579deb3.js","mappings":"oNAyBA,MAqCA,GAAeA,EAAAA,EAAAA,KAAKC,EAAAA,EAAAA,KAClB,CAACC,EAAD,KAAoC,IAA3B,OAAEC,GAAyB,EAClC,MAAMC,GAAOC,EAAAA,EAAAA,IAAkBH,GACzBI,EAAOH,IAAUI,EAAAA,EAAAA,IAAWL,EAAQC,GAG1C,MAAO,CACLC,KAAAA,EACAI,YAJkBF,GAAOG,EAAAA,EAAAA,IAAuBH,QAAQI,KAJ1CT,EArCiC,IAM/C,IANgD,OACpDU,EADoD,KAEpDP,EAFoD,OAGpDD,EAHoD,YAIpDK,EAJoD,QAKpDI,GACI,EACJ,MAAM,iBAAEC,IAAqBC,EAAAA,EAAAA,MAEvBC,GAAOC,EAAAA,EAAAA,KAEPC,GAAyBC,EAAAA,EAAAA,KAAY,KACzCL,EAAiB,CAAEM,OAAQf,EAAMgB,GAAIjB,OAAAA,IACrCS,MACC,CAACR,EAAMS,EAAkBD,EAAST,IAErC,GAAKC,GAASD,EAId,OACE,mBAAC,IAAD,CACEQ,OAAQA,EACRC,QAASA,EACTS,QAASJ,EACTK,UAAU,SACVC,MAAOR,EAAK,wBAEZ,6BAAIS,EAAAA,EAAAA,GAAWT,EAAK,8BAA+BP,KACnD,mBAAC,IAAD,CAAQiB,MAAM,SAASH,UAAU,wBAAwBI,QAAM,EAACC,QAASV,GACtEF,EAAK,mBAER,mBAAC,IAAD,CAAQO,UAAU,wBAAwBI,QAAM,EAACC,QAASf,GAAUG,EAAK,iB,qOCb/E,MAGMa,GAA8BC,EAAAA,EAAAA,KAAUC,GAAOA,KAAM,KAAM,GAC3DC,GAA8BC,EAAAA,EAAAA,KAAUF,GAAOA,KAAM,KAAK,GAAO,GA0/BvEG,eAAeC,EACbC,EAAiCC,EAAmB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EExI,KAAcwI,EAAOG,eAAe,gBAAmBC,IAAqBA,EAEnE,qBAAXyK,IACE7K,EAAOG,eAAe,cAAgBH,EAAOG,eAAe,cAC9DU,EAAoB,CAClB5J,SAAU4T,EACV/J,WAAYC,GAAaC,IAElB8J,EACTzK,EAAsB,CAAEyK,MAAAA,EAAOtT,YAAAA,EAAaD,OAAAA,IAE5C4J,EAAmB,CACjBlK,SAAU4T,EACV7Q,UAAW0G,OAAOqK,GAClBpK,UAAWD,OAAOE,GAClB9I,WAAYsJ,EACZ5J,YAAAA,EACAD,OAAAA,KAIN,MAEF,IAAK,cAAe,CAClB,MAAM,KACJwT,EADI,QACE1H,GACJrD,EAEJ/F,EAAa,CACXxI,OAAS,IAAG4R,IACZ3R,GAAIqZ,IAEN,MAEF,IAAK,KAoBL,IAAK,QACL,IAAK,MAIL,IAAK,QAUL,QAGE,MAhCF,IAAK,OAAQ,CACX,MAAM,OAAEC,GAAWhL,EAEnBO,EAAiB,CAAE5B,KAAMqM,IACzB,MAEF,IAAK,cAAe,CAClB,MAAM,IAAEC,GAAQjL,EAEhBQ,EAAwB,CACtBhK,oBAAqByU,IAEvB,MAYF,IAAK,UAAW,CACd,MAAM,KAAE/J,GAASlB,EACjBiB,EAAY,CAAEC,KAAAA,IACd","sources":["webpack://telegram-t/./src/components/right/DeleteMemberModal.tsx","webpack://telegram-t/./src/global/actions/api/chats.ts","webpack://telegram-t/./src/global/actions/ui/calls.ts","webpack://telegram-t/./src/global/reducers/calls.ts","webpack://telegram-t/./src/global/selectors/calls.ts","webpack://telegram-t/./src/util/deeplink.ts"],"sourcesContent":["import type { FC } from '../../lib/teact/teact';\nimport React, { useCallback, memo } from '../../lib/teact/teact';\nimport { getActions, withGlobal } from '../../global';\n\nimport type { ApiChat } from '../../api/types';\n\nimport { selectCurrentChat, selectUser } from '../../global/selectors';\nimport { getUserFirstOrLastName } from '../../global/helpers';\nimport renderText from '../common/helpers/renderText';\nimport useLang from '../../hooks/useLang';\n\nimport Modal from '../ui/Modal';\nimport Button from '../ui/Button';\n\nexport type OwnProps = {\n isOpen: boolean;\n userId?: string;\n onClose: () => void;\n};\n\ntype StateProps = {\n chat?: ApiChat;\n contactName?: string;\n};\n\nconst DeleteMemberModal: FC<OwnProps & StateProps> = ({\n isOpen,\n chat,\n userId,\n contactName,\n onClose,\n}) => {\n const { deleteChatMember } = getActions();\n\n const lang = useLang();\n\n const handleDeleteChatMember = useCallback(() => {\n deleteChatMember({ chatId: chat!.id, userId });\n onClose();\n }, [chat, deleteChatMember, onClose, userId]);\n\n if (!chat || !userId) {\n return undefined;\n }\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onClose}\n onEnter={handleDeleteChatMember}\n className=\"delete\"\n title={lang('GroupRemoved.Remove')}\n >\n <p>{renderText(lang('PeerInfo.Confirm.RemovePeer', contactName))}</p>\n <Button color=\"danger\" className=\"confirm-dialog-button\" isText onClick={handleDeleteChatMember}>\n {lang('lng_box_remove')}\n </Button>\n <Button className=\"confirm-dialog-button\" isText onClick={onClose}>{lang('Cancel')}</Button>\n </Modal>\n );\n};\n\nexport default memo(withGlobal<OwnProps>(\n (global, { userId }): StateProps => {\n const chat = selectCurrentChat(global);\n const user = userId && selectUser(global, userId);\n const contactName = user ? getUserFirstOrLastName(user) : undefined;\n\n return {\n chat,\n contactName,\n };\n },\n)(DeleteMemberModal));\n","import {\n addActionHandler, getActions, getGlobal, setGlobal,\n} from '../../index';\n\nimport type {\n ApiChat, ApiUser, ApiChatFolder, ApiError,\n} from '../../../api/types';\nimport { MAIN_THREAD_ID } from '../../../api/types';\nimport { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types';\nimport type { GlobalActions } from '../../types';\n\nimport {\n ARCHIVED_FOLDER_ID,\n TOP_CHAT_MESSAGES_PRELOAD_LIMIT,\n CHAT_LIST_LOAD_SLICE,\n RE_TG_LINK,\n SERVICE_NOTIFICATIONS_USER_ID,\n TMP_CHAT_ID, ALL_FOLDER_ID, DEBUG,\n} from '../../../config';\nimport { callApi } from '../../../api/gramjs';\nimport {\n addChats, addUsers, addUserStatuses, replaceThreadParam,\n updateChatListIds, updateChats, updateChat, updateChatListSecondaryInfo,\n updateManagementProgress, leaveChat, replaceUsers, replaceUserStatuses,\n replaceChats, replaceChatListIds, addChatMembers,\n} from '../../reducers';\nimport {\n selectChat, selectUser, selectChatListType, selectIsChatPinned,\n selectChatFolder, selectSupportChat, selectChatByUsername, selectThreadTopMessageId,\n selectCurrentMessageList, selectThreadInfo, selectCurrentChat, selectLastServiceNotification,\n selectVisibleUsers, selectUserByPhoneNumber,\n} from '../../selectors';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { debounce, pause, throttle } from '../../../util/schedulers';\nimport {\n isChatSummaryOnly, isChatArchived, isChatBasicGroup, isUserBot, isChatChannel, isChatSuperGroup,\n} from '../../helpers';\nimport { processDeepLink } from '../../../util/deeplink';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { selectGroupCall } from '../../selectors/calls';\nimport { getOrderedIds } from '../../../util/folderManager';\nimport * as langProvider from '../../../util/langProvider';\nimport { selectCurrentLimit } from '../../selectors/limits';\n\nconst TOP_CHAT_MESSAGES_PRELOAD_INTERVAL = 100;\nconst INFINITE_LOOP_MARKER = 100;\n\nconst runThrottledForLoadTopChats = throttle((cb) => cb(), 3000, true);\nconst runDebouncedForLoadFullChat = debounce((cb) => cb(), 500, false, true);\n\naddActionHandler('preloadTopChatMessages', async (global, actions) => {\n const preloadedChatIds = new Set<string>();\n\n for (let i = 0; i < TOP_CHAT_MESSAGES_PRELOAD_LIMIT; i++) {\n await pause(TOP_CHAT_MESSAGES_PRELOAD_INTERVAL);\n\n const { chatId: currentChatId } = selectCurrentMessageList(global) || {};\n const folderAllOrderedIds = getOrderedIds(ALL_FOLDER_ID);\n const nextChatId = folderAllOrderedIds?.find((id) => id !== currentChatId && !preloadedChatIds.has(id));\n if (!nextChatId) {\n return;\n }\n\n preloadedChatIds.add(nextChatId);\n\n actions.loadViewportMessages({ chatId: nextChatId, threadId: MAIN_THREAD_ID });\n }\n});\n\naddActionHandler('openChat', (global, actions, payload) => {\n const { id, threadId = MAIN_THREAD_ID } = payload;\n if (!id) {\n return;\n }\n\n const { currentUserId } = global;\n const chat = selectChat(global, id);\n\n if (chat?.hasUnreadMark) {\n actions.toggleChatUnread({ id });\n }\n\n // Please telegram send us some updates about linked chat 🙏\n if (chat?.lastMessage?.threadInfo) {\n actions.requestThreadInfoUpdate({\n chatId: chat.lastMessage.threadInfo.chatId,\n threadId: chat.lastMessage.threadInfo.threadId,\n });\n }\n\n if (!chat) {\n if (id === currentUserId) {\n void callApi('fetchChat', { type: 'self' });\n } else {\n const user = selectUser(global, id);\n if (user) {\n void callApi('fetchChat', { type: 'user', user });\n }\n }\n } else if (isChatSummaryOnly(chat) && !chat.isMin) {\n actions.requestChatUpdate({ chatId: id });\n }\n\n if (threadId !== MAIN_THREAD_ID) {\n const topMessageId = selectThreadTopMessageId(global, id, threadId);\n if (!topMessageId) {\n actions.requestThreadInfoUpdate({ chatId: id, threadId });\n }\n }\n});\n\naddActionHandler('openLinkedChat', async (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n const chatFullInfo = await callApi('fetchFullChat', chat);\n\n if (chatFullInfo?.fullInfo?.linkedChatId) {\n actions.openChat({ id: chatFullInfo.fullInfo.linkedChatId });\n }\n});\n\naddActionHandler('focusMessageInComments', async (global, actions, payload) => {\n const { chatId, threadId, messageId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId });\n if (!result) {\n return;\n }\n\n actions.focusMessage({ chatId, threadId, messageId });\n});\n\naddActionHandler('openSupportChat', async (global, actions) => {\n const chat = selectSupportChat(global);\n if (chat) {\n actions.openChat({ id: chat.id, shouldReplaceHistory: true });\n return;\n }\n\n actions.openChat({ id: TMP_CHAT_ID, shouldReplaceHistory: true });\n\n const result = await callApi('fetchChat', { type: 'support' });\n if (result) {\n actions.openChat({ id: result.chatId, shouldReplaceHistory: true });\n }\n});\n\naddActionHandler('loadAllChats', async (global, actions, payload) => {\n const listType = payload.listType as 'active' | 'archived';\n const { onReplace } = payload;\n let { shouldReplace } = payload;\n let i = 0;\n\n while (shouldReplace || !getGlobal().chats.isFullyLoaded[listType]) {\n if (i++ >= INFINITE_LOOP_MARKER) {\n if (DEBUG) {\n // eslint-disable-next-line no-console\n console.error('`actions/loadAllChats`: Infinite loop detected');\n }\n\n return;\n }\n\n global = getGlobal();\n\n if (global.connectionState !== 'connectionStateReady' || global.authState !== 'authorizationStateReady') {\n return;\n }\n\n const listIds = !shouldReplace && global.chats.listIds[listType];\n const oldestChat = listIds\n ? listIds\n /* eslint-disable @typescript-eslint/no-loop-func */\n .map((id) => global.chats.byId[id])\n .filter((chat) => Boolean(chat?.lastMessage) && !selectIsChatPinned(global, chat.id))\n /* eslint-enable @typescript-eslint/no-loop-func */\n .sort((chat1, chat2) => (chat1.lastMessage!.date - chat2.lastMessage!.date))[0]\n : undefined;\n\n await loadChats(listType, oldestChat?.id, oldestChat?.lastMessage!.date, shouldReplace);\n\n if (shouldReplace) {\n onReplace?.();\n shouldReplace = false;\n }\n }\n});\n\naddActionHandler('loadFullChat', (global, actions, payload) => {\n const { chatId, force } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (force) {\n loadFullChat(chat);\n } else {\n runDebouncedForLoadFullChat(() => loadFullChat(chat));\n }\n});\n\naddActionHandler('loadTopChats', () => {\n runThrottledForLoadTopChats(() => loadChats('active'));\n});\n\naddActionHandler('requestChatUpdate', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n void callApi('requestChatUpdate', {\n chat,\n serverTimeOffset,\n ...(chatId === SERVICE_NOTIFICATIONS_USER_ID && {\n lastLocalMessage: selectLastServiceNotification(global)?.message,\n }),\n });\n});\n\naddActionHandler('updateChatMutedState', (global, actions, payload) => {\n const { serverTimeOffset } = global;\n const { chatId, isMuted } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateChat(global, chatId, { isMuted }));\n void callApi('updateChatMutedState', { chat, isMuted, serverTimeOffset });\n});\n\naddActionHandler('createChannel', (global, actions, payload) => {\n const {\n title, about, photo, memberIds,\n } = payload!;\n\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter<ApiUser>(Boolean as any);\n\n void createChannel(title, members, about, photo);\n});\n\naddActionHandler('joinChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const { id: channelId, accessHash } = chat;\n\n if (!(channelId && accessHash)) {\n return;\n }\n\n void joinChannel(channelId, accessHash);\n});\n\naddActionHandler('deleteChatUser', (global, actions, payload) => {\n const { chatId, userId }: { chatId: string; userId: string } = payload!;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChatUser', { chat, user });\n});\n\naddActionHandler('deleteChat', (global, actions, payload) => {\n const { chatId }: { chatId: string } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n void callApi('deleteChat', { chatId: chat.id });\n});\n\naddActionHandler('leaveChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('leaveChannel', { channelId, accessHash });\n }\n});\n\naddActionHandler('deleteChannel', (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n global = leaveChat(global, chatId);\n setGlobal(global);\n\n if (selectCurrentMessageList(global)?.chatId === chatId) {\n actions.openChat({ id: undefined });\n }\n\n const { id: channelId, accessHash } = chat;\n if (channelId && accessHash) {\n void callApi('deleteChannel', { channelId, accessHash });\n }\n});\n\naddActionHandler('createGroupChat', (global, actions, payload) => {\n const { title, memberIds, photo } = payload!;\n const members = (memberIds as string[])\n .map((id) => selectUser(global, id))\n .filter<ApiUser>(Boolean as any);\n\n void createGroupChat(title, members, photo);\n});\n\naddActionHandler('toggleChatPinned', (global, actions, payload) => {\n const { id, folderId } = payload!;\n const chat = selectChat(global, id);\n if (!chat) {\n return;\n }\n\n const limit = selectCurrentLimit(global, 'dialogFolderPinned');\n\n if (folderId) {\n const folder = selectChatFolder(global, folderId);\n if (folder) {\n const shouldBePinned = !selectIsChatPinned(global, id, folderId);\n\n const { pinnedChatIds, includedChatIds } = folder;\n const newPinnedIds = shouldBePinned\n ? [id, ...(pinnedChatIds || [])]\n : (pinnedChatIds || []).filter((pinnedId) => pinnedId !== id);\n\n // With both Pin and Unpin we need to re-add a user to the included group\n const newIncludedChatIds = [id, ...includedChatIds];\n\n void callApi('editChatFolder', {\n id: folderId,\n folderUpdate: {\n ...folder,\n pinnedChatIds: newPinnedIds,\n includedChatIds: newIncludedChatIds,\n },\n });\n }\n } else {\n const listType = selectChatListType(global, id);\n const isPinned = selectIsChatPinned(global, id, listType === 'archived' ? ARCHIVED_FOLDER_ID : undefined);\n\n const ids = global.chats.orderedPinnedIds[listType === 'archived' ? 'archived' : 'active'];\n if ((ids?.length || 0) >= limit && !isPinned) {\n actions.openLimitReachedModal({\n limit: 'dialogFolderPinned',\n });\n return;\n }\n void callApi('toggleChatPinned', { chat, shouldBePinned: !isPinned });\n }\n});\n\naddActionHandler('toggleChatArchived', (global, actions, payload) => {\n const { id } = payload!;\n const chat = selectChat(global, id);\n if (chat) {\n void callApi('toggleChatArchived', {\n chat,\n folderId: isChatArchived(chat) ? 0 : ARCHIVED_FOLDER_ID,\n });\n }\n});\n\naddActionHandler('loadChatFolders', () => {\n void loadChatFolders();\n});\n\naddActionHandler('loadRecommendedChatFolders', () => {\n void loadRecommendedChatFolders();\n});\n\naddActionHandler('editChatFolders', (global, actions, payload) => {\n const { chatId, idsToRemove, idsToAdd } = payload!;\n const limit = selectCurrentLimit(global, 'dialogFiltersChats');\n\n const isLimitReached = (idsToAdd as number[])\n .some((id) => selectChatFolder(global, id)!.includedChatIds.length >= limit);\n if (isLimitReached) {\n actions.openLimitReachedModal({ limit: 'dialogFiltersChats' });\n return;\n }\n\n (idsToRemove as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n pinnedChatIds: folder.pinnedChatIds?.filter((pinnedId) => pinnedId !== chatId),\n includedChatIds: folder.includedChatIds.filter((includedId) => includedId !== chatId),\n },\n });\n }\n });\n\n (idsToAdd as number[]).forEach(async (id) => {\n const folder = selectChatFolder(global, id);\n if (folder) {\n await callApi('editChatFolder', {\n id,\n folderUpdate: {\n ...folder,\n includedChatIds: folder.includedChatIds.concat(chatId),\n },\n });\n }\n });\n});\n\naddActionHandler('editChatFolder', (global, actions, payload) => {\n const { id, folderUpdate } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void callApi('editChatFolder', {\n id,\n folderUpdate: {\n id,\n emoticon: folder.emoticon,\n pinnedChatIds: folder.pinnedChatIds,\n ...folderUpdate,\n },\n });\n }\n});\n\naddActionHandler('addChatFolder', (global, actions, payload) => {\n const { folder } = payload!;\n const { orderedIds, byId } = global.chatFolders;\n\n const limit = selectCurrentLimit(global, 'dialogFilters');\n if (Object.keys(byId).length >= limit) {\n actions.openLimitReachedModal({\n limit: 'dialogFilters',\n });\n return;\n }\n\n const maxId = Math.max(...(orderedIds || []), ARCHIVED_FOLDER_ID);\n\n void createChatFolder(folder, maxId);\n});\n\naddActionHandler('deleteChatFolder', (global, actions, payload) => {\n const { id } = payload!;\n const folder = selectChatFolder(global, id);\n\n if (folder) {\n void deleteChatFolder(id);\n }\n});\n\naddActionHandler('toggleChatUnread', (global, actions, payload) => {\n const { id } = payload!;\n const { serverTimeOffset } = global;\n const chat = selectChat(global, id);\n if (chat) {\n if (chat.unreadCount) {\n void callApi('markMessageListRead', { serverTimeOffset, chat, threadId: MAIN_THREAD_ID });\n } else {\n void callApi('toggleDialogUnread', {\n chat,\n hasUnreadMark: !chat.hasUnreadMark,\n });\n }\n }\n});\n\naddActionHandler('openChatByInvite', async (global, actions, payload) => {\n const { hash } = payload!;\n\n const result = await callApi('openChatByInvite', hash);\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.chatId });\n});\n\naddActionHandler('openChatByPhoneNumber', async (global, actions, payload) => {\n const { phoneNumber, startAttach, attach } = payload!;\n\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByPhoneNumber(phoneNumber);\n if (!chat) {\n actions.openPreviousChat();\n actions.showNotification({\n message: langProvider.getTranslation('lng_username_by_phone_not_found').replace('{phone}', phoneNumber),\n });\n return;\n }\n\n actions.openChat({ id: chat.id });\n\n if (attach) {\n openAttachMenuFromLink(actions, chat.id, attach, startAttach);\n }\n});\n\naddActionHandler('openTelegramLink', (global, actions, payload) => {\n const { url } = payload!;\n if (url.match(RE_TG_LINK)) {\n processDeepLink(url.match(RE_TG_LINK)[0]);\n return;\n }\n\n const uri = new URL(url.startsWith('http') ? url : `https://${url}`);\n const [part1, part2, part3] = uri.pathname.split('/').filter(Boolean).map((l) => decodeURI(l));\n const params = Object.fromEntries(uri.searchParams);\n\n let hash: string | undefined;\n if (part1 === 'joinchat') {\n hash = part2;\n }\n\n const startAttach = params.hasOwnProperty('startattach') && !params.startattach ? true : params.startattach;\n\n if (part1.match(/^\\+([0-9]+)(\\?|$)/)) {\n actions.openChatByPhoneNumber({\n phoneNumber: part1.substr(1, part1.length - 1),\n startAttach,\n attach: params.attach,\n });\n return;\n }\n\n if (part1.startsWith(' ') || part1.startsWith('+')) {\n hash = part1.substr(1, part1.length - 1);\n }\n\n if (hash) {\n actions.openChatByInvite({ hash });\n return;\n }\n\n if (part1 === 'addstickers') {\n actions.openStickerSetShortName({\n stickerSetShortName: part2,\n });\n return;\n }\n\n const chatOrChannelPostId = part2 || undefined;\n const messageId = part3 ? Number(part3) : undefined;\n const commentId = params.comment ? Number(params.comment) : undefined;\n\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n actions.joinVoiceChatByLink({\n username: part1,\n inviteHash: params.voicechat || params.livestream,\n });\n } else if (part1 === 'c' && chatOrChannelPostId && messageId) {\n const chatId = `-${chatOrChannelPostId}`;\n const chat = selectChat(global, chatId);\n if (!chat) {\n actions.showNotification({ message: 'Chat does not exist' });\n return;\n }\n\n actions.focusMessage({\n chatId,\n messageId,\n });\n } else if (part1 === 'invoice') {\n actions.openInvoice({\n slug: part2,\n });\n } else {\n actions.openChatByUsername({\n username: part1,\n messageId: messageId || Number(chatOrChannelPostId),\n commentId,\n startParam: params.start,\n startAttach,\n attach: params.attach,\n });\n }\n});\n\naddActionHandler('acceptInviteConfirmation', async (global, actions, payload) => {\n const { hash } = payload!;\n const result = await callApi('importChatInvite', { hash });\n if (!result) {\n return;\n }\n\n actions.openChat({ id: result.id });\n});\n\naddActionHandler('openChatByUsername', async (global, actions, payload) => {\n const {\n username, messageId, commentId, startParam, startAttach, attach,\n } = payload!;\n\n const chat = selectCurrentChat(global);\n\n if (!commentId) {\n if (chat && chat.username === username && !startAttach && !startParam) {\n actions.focusMessage({ chatId: chat.id, messageId });\n return;\n }\n await openChatByUsername(actions, username, messageId, startParam, startAttach, attach);\n return;\n }\n\n const { chatId, type } = selectCurrentMessageList(global) || {};\n const usernameChat = selectChatByUsername(global, username);\n if (chatId && usernameChat && type === 'thread') {\n const threadInfo = selectThreadInfo(global, chatId, messageId);\n\n if (threadInfo && threadInfo.chatId === chatId) {\n actions.focusMessage({\n chatId: threadInfo.chatId,\n threadId: threadInfo.threadId,\n messageId: commentId,\n });\n return;\n }\n }\n\n if (!messageId) return;\n\n void openCommentsByUsername(actions, username, messageId, commentId);\n});\n\naddActionHandler('togglePreHistoryHidden', async (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n\n let chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n if (isChatBasicGroup(chat)) {\n chat = await migrateChat(chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n void callApi('togglePreHistoryHidden', { chat, isEnabled });\n});\n\naddActionHandler('updateChatDefaultBannedRights', (global, actions, payload) => {\n const { chatId, bannedRights } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('updateChatDefaultBannedRights', { chat, bannedRights });\n});\n\naddActionHandler('updateChatMemberBannedRights', async (global, actions, payload) => {\n const { chatId, userId, bannedRights } = payload!;\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n if (isChatBasicGroup(chat)) {\n chat = await migrateChat(chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatMemberBannedRights', { chat, user, bannedRights });\n\n global = getGlobal();\n\n const chatAfterUpdate = selectChat(global, chatId);\n\n if (!chatAfterUpdate || !chatAfterUpdate.fullInfo) {\n return;\n }\n\n const { members, kickedMembers } = chatAfterUpdate.fullInfo;\n\n const isBanned = Boolean(bannedRights.viewMessages);\n const isUnblocked = !Object.keys(bannedRights).length;\n\n setGlobal(updateChat(global, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(members && isBanned && {\n members: members.filter((m) => m.userId !== userId),\n }),\n ...(members && !isBanned && {\n members: members.map((m) => (\n m.userId === userId\n ? { ...m, bannedRights }\n : m\n )),\n }),\n ...(isUnblocked && kickedMembers && {\n kickedMembers: kickedMembers.filter((m) => m.userId !== userId),\n }),\n },\n }));\n});\n\naddActionHandler('updateChatAdmin', async (global, actions, payload) => {\n const {\n chatId, userId, adminRights, customTitle,\n } = payload!;\n\n let chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n if (!chat || !user) {\n return;\n }\n\n if (isChatBasicGroup(chat)) {\n chat = await migrateChat(chat);\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n await callApi('updateChatAdmin', {\n chat, user, adminRights, customTitle,\n });\n\n const chatAfterUpdate = await callApi('fetchFullChat', chat);\n if (!chatAfterUpdate?.fullInfo) {\n return;\n }\n\n const { adminMembers } = chatAfterUpdate.fullInfo;\n const isDismissed = !Object.keys(adminRights).length;\n\n global = getGlobal();\n\n setGlobal(updateChat(global, chatId, {\n fullInfo: {\n ...chatAfterUpdate.fullInfo,\n ...(adminMembers && isDismissed && {\n adminMembers: adminMembers.filter((m) => m.userId !== userId),\n }),\n ...(adminMembers && !isDismissed && {\n adminMembers: adminMembers.map((m) => (\n m.userId === userId\n ? { ...m, adminRights, customTitle }\n : m\n )),\n }),\n },\n }));\n});\n\naddActionHandler('updateChat', async (global, actions, payload) => {\n const {\n chatId, title, about, photo,\n } = payload!;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.InProgress));\n\n await Promise.all([\n chat.title !== title\n ? callApi('updateChatTitle', chat, title)\n : undefined,\n chat.fullInfo && chat.fullInfo.about !== about\n ? callApi('updateChatAbout', chat, about)\n : undefined,\n photo\n ? callApi('editChatPhoto', { chatId, accessHash: chat.accessHash, photo })\n : undefined,\n ]);\n\n setGlobal(updateManagementProgress(getGlobal(), ManagementProgress.Complete));\n});\n\naddActionHandler('toggleSignatures', (global, actions, payload) => {\n const { chatId, isEnabled } = payload!;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleSignatures', { chat, isEnabled });\n});\n\naddActionHandler('loadGroupsForDiscussion', async (global) => {\n const groups = await callApi('fetchGroupsForDiscussion');\n if (!groups) {\n return;\n }\n\n const addedById = groups.reduce((result, group) => {\n if (group) {\n result[group.id] = group;\n }\n\n return result;\n }, {} as Record<string, ApiChat>);\n\n global = getGlobal();\n global = addChats(global, addedById);\n setGlobal({\n ...global,\n chats: {\n ...global.chats,\n forDiscussionIds: Object.keys(addedById),\n },\n });\n});\n\naddActionHandler('linkDiscussionGroup', async (global, actions, payload) => {\n const { channelId, chatId } = payload!;\n\n const channel = selectChat(global, channelId);\n let chat = selectChat(global, chatId);\n if (!channel || !chat) {\n return;\n }\n\n if (isChatBasicGroup(chat)) {\n chat = await migrateChat(chat);\n\n if (!chat) {\n return;\n }\n\n actions.openChat({ id: chat.id });\n }\n\n let { fullInfo } = chat;\n if (!fullInfo) {\n const fullChat = await callApi('fetchFullChat', chat);\n if (!fullChat) {\n return;\n }\n\n fullInfo = fullChat.fullInfo;\n }\n\n if (fullInfo!.isPreHistoryHidden) {\n await callApi('togglePreHistoryHidden', { chat, isEnabled: false });\n }\n\n void callApi('setDiscussionGroup', { channel, chat });\n});\n\naddActionHandler('unlinkDiscussionGroup', async (global, actions, payload) => {\n const { channelId } = payload!;\n\n const channel = selectChat(global, channelId);\n if (!channel) {\n return;\n }\n\n let chat: ApiChat | undefined;\n if (channel.fullInfo?.linkedChatId) {\n chat = selectChat(global, channel.fullInfo.linkedChatId);\n }\n\n await callApi('setDiscussionGroup', { channel });\n if (chat) {\n loadFullChat(chat);\n }\n});\n\naddActionHandler('setActiveChatFolder', (global, actions, payload) => {\n const maxFolders = selectCurrentLimit(global, 'dialogFilters');\n\n const isBlocked = payload + 1 > maxFolders;\n\n if (isBlocked) {\n actions.openLimitReachedModal({\n limit: 'dialogFilters',\n });\n return undefined;\n }\n\n return {\n ...global,\n chatFolders: {\n ...global.chatFolders,\n activeChatFolder: payload,\n },\n };\n});\n\naddActionHandler('resetOpenChatWithText', (global) => {\n return {\n ...global,\n openChatWithText: undefined,\n };\n});\n\naddActionHandler('loadMoreMembers', async (global) => {\n const { chatId } = selectCurrentMessageList(global) || {};\n const chat = chatId ? selectChat(global, chatId) : undefined;\n if (!chat || isChatBasicGroup(chat)) {\n return;\n }\n\n const offset = (chat.fullInfo?.members?.length) || undefined;\n const result = await callApi('fetchMembers', chat.id, chat.accessHash!, 'recent', offset);\n if (!result) {\n return;\n }\n\n const { members, users, userStatusesById } = result;\n if (!members || !members.length) {\n return;\n }\n\n global = getGlobal();\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n global = addUserStatuses(global, userStatusesById);\n global = addChatMembers(global, chat, members);\n setGlobal(global);\n});\n\naddActionHandler('addChatMembers', async (global, actions, payload) => {\n const { chatId, memberIds } = payload;\n const chat = selectChat(global, chatId);\n const users = (memberIds as string[]).map((userId) => selectUser(global, userId)).filter<ApiUser>(Boolean as any);\n\n if (!chat || !users.length) {\n return;\n }\n\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Loading);\n await callApi('addChatMembers', chat, users);\n actions.setNewChatMembersDialogState(NewChatMembersProgress.Closed);\n loadFullChat(chat);\n});\n\naddActionHandler('deleteChatMember', async (global, actions, payload) => {\n const { chatId, userId } = payload;\n const chat = selectChat(global, chatId);\n const user = selectUser(global, userId);\n\n if (!chat || !user) {\n return;\n }\n\n await callApi('deleteChatMember', chat, user);\n loadFullChat(chat);\n});\n\naddActionHandler('toggleIsProtected', (global, actions, payload) => {\n const { chatId, isProtected } = payload;\n const chat = selectChat(global, chatId);\n\n if (!chat) {\n return;\n }\n\n void callApi('toggleIsProtected', { chat, isProtected });\n});\n\naddActionHandler('setChatEnabledReactions', async (global, actions, payload) => {\n const { chatId, enabledReactions } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) return;\n\n await callApi('setChatEnabledReactions', {\n chat,\n enabledReactions,\n });\n\n void loadFullChat(chat);\n});\n\naddActionHandler('loadChatSettings', async (global, actions, payload) => {\n const { chatId } = payload!;\n const chat = selectChat(global, chatId);\n if (!chat) return;\n\n const settings = await callApi('fetchChatSettings', chat);\n if (!settings) return;\n\n setGlobal(updateChat(getGlobal(), chat.id, { settings }));\n});\n\naddActionHandler('toggleJoinToSend', async (global, actions, payload) => {\n const { chatId, isEnabled } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) return;\n if (!isChatSuperGroup(chat) && !isChatChannel(chat)) return;\n\n await callApi('toggleJoinToSend', chat, isEnabled);\n});\n\naddActionHandler('toggleJoinRequest', async (global, actions, payload) => {\n const { chatId, isEnabled } = payload;\n const chat = selectChat(global, chatId);\n if (!chat) return;\n if (!isChatSuperGroup(chat) && !isChatChannel(chat)) return;\n\n await callApi('toggleJoinRequest', chat, isEnabled);\n});\n\nasync function loadChats(\n listType: 'active' | 'archived', offsetId?: string, offsetDate?: number, shouldReplace = false,\n) {\n let global = getGlobal();\n\n const result = await callApi('fetchChats', {\n limit: CHAT_LIST_LOAD_SLICE,\n offsetDate,\n archived: listType === 'archived',\n withPinned: shouldReplace,\n serverTimeOffset: global.serverTimeOffset,\n lastLocalServiceMessage: selectLastServiceNotification(global)?.message,\n });\n\n if (!result) {\n return;\n }\n\n const { chatIds } = result;\n\n if (chatIds.length > 0 && chatIds[0] === offsetId) {\n chatIds.shift();\n }\n\n global = getGlobal();\n\n if (shouldReplace && listType === 'active') {\n const currentChat = selectCurrentChat(global);\n const visibleChats = currentChat ? [currentChat] : [];\n\n const visibleUsers = selectVisibleUsers(global) || [];\n if (global.currentUserId && global.users.byId[global.currentUserId]) {\n visibleUsers.push(global.users.byId[global.currentUserId]);\n }\n\n global = replaceUsers(global, buildCollectionByKey(visibleUsers.concat(result.users), 'id'));\n global = replaceUserStatuses(global, result.userStatusesById);\n global = replaceChats(global, buildCollectionByKey(visibleChats.concat(result.chats), 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else if (shouldReplace && listType === 'archived') {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = replaceChatListIds(global, listType, chatIds);\n } else {\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addUserStatuses(global, result.userStatusesById);\n global = updateChats(global, buildCollectionByKey(result.chats, 'id'));\n global = updateChatListIds(global, listType, chatIds);\n }\n\n global = updateChatListSecondaryInfo(global, listType, result);\n\n Object.keys(result.draftsById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'draft', result.draftsById[chatId],\n );\n });\n\n Object.keys(result.replyingToById).forEach((chatId) => {\n global = replaceThreadParam(\n global, chatId, MAIN_THREAD_ID, 'replyingToId', result.replyingToById[chatId],\n );\n });\n\n if (chatIds.length === 0 && !global.chats.isFullyLoaded[listType]) {\n global = {\n ...global,\n chats: {\n ...global.chats,\n isFullyLoaded: {\n ...global.chats.isFullyLoaded,\n [listType]: true,\n },\n },\n };\n }\n\n setGlobal(global);\n}\n\nexport async function loadFullChat(chat: ApiChat) {\n const result = await callApi('fetchFullChat', chat);\n if (!result) {\n return undefined;\n }\n\n const {\n users, userStatusesById, fullInfo, groupCall, membersCount,\n } = result;\n\n let global = getGlobal();\n if (users) {\n global = addUsers(global, buildCollectionByKey(users, 'id'));\n }\n\n if (userStatusesById) {\n global = addUserStatuses(global, userStatusesById);\n }\n\n if (groupCall) {\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(groupCall, ['connectionState']),\n undefined,\n existingGroupCall ? undefined : groupCall.participantsCount,\n );\n }\n\n global = updateChat(global, chat.id, {\n fullInfo,\n ...(membersCount && { membersCount }),\n });\n\n setGlobal(global);\n\n const stickerSet = fullInfo.stickerSet;\n if (stickerSet) {\n getActions().loadStickers({\n stickerSetId: stickerSet.id,\n stickerSetAccessHash: stickerSet.accessHash,\n stickerSetShortName: stickerSet.shortName,\n });\n }\n\n return result;\n}\n\nasync function createChannel(title: string, users: ApiUser[], about?: string, photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n let createdChannel: ApiChat | undefined;\n\n try {\n createdChannel = await callApi('createChannel', { title, about, users });\n } catch (error) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatCreation: {\n progress: ChatCreationProgress.Error,\n },\n });\n\n if ((error as ApiError).message === 'CHANNELS_TOO_MUCH') {\n getActions().openLimitReachedModal({ limit: 'channels' });\n } else {\n getActions().showDialog({ data: { ...(error as ApiError), hasErrorKey: true } });\n }\n }\n\n if (!createdChannel) {\n return;\n }\n\n const { id: channelId, accessHash } = createdChannel;\n\n let global = getGlobal();\n global = updateChat(global, channelId, createdChannel);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChannel ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getActions().openChat({ id: channelId, shouldReplaceHistory: true });\n\n if (channelId && accessHash && photo) {\n await callApi('editChatPhoto', { chatId: channelId, accessHash, photo });\n }\n}\n\nasync function joinChannel(channelId: string, accessHash: string) {\n try {\n await callApi('joinChannel', { channelId, accessHash });\n } catch (error) {\n if ((error as ApiError).message === 'CHANNELS_TOO_MUCH') {\n getActions().openLimitReachedModal({ limit: 'channels' });\n } else {\n getActions().showDialog({ data: { ...(error as ApiError), hasErrorKey: true } });\n }\n }\n}\n\nasync function createGroupChat(title: string, users: ApiUser[], photo?: File) {\n setGlobal({\n ...getGlobal(),\n chatCreation: {\n progress: ChatCreationProgress.InProgress,\n },\n });\n\n try {\n const createdChat = await callApi('createGroupChat', {\n title,\n users,\n });\n\n if (!createdChat) {\n return;\n }\n\n const { id: chatId } = createdChat;\n\n let global = getGlobal();\n global = updateChat(global, chatId, createdChat);\n global = {\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: createdChat ? ChatCreationProgress.Complete : ChatCreationProgress.Error,\n },\n };\n setGlobal(global);\n getActions()\n .openChat({\n id: chatId,\n shouldReplaceHistory: true,\n });\n\n if (chatId && photo) {\n await callApi('editChatPhoto', {\n chatId,\n photo,\n });\n }\n } catch (e: any) {\n if (e.message === 'USERS_TOO_FEW') {\n const global = getGlobal();\n setGlobal({\n ...global,\n chatCreation: {\n ...global.chatCreation,\n progress: ChatCreationProgress.Error,\n error: 'CreateGroupError',\n },\n });\n }\n }\n}\n\nexport async function migrateChat(chat: ApiChat): Promise<ApiChat | undefined> {\n try {\n const supergroup = await callApi('migrateChat', chat);\n\n return supergroup;\n } catch (error) {\n if ((error as ApiError).message === 'CHANNELS_TOO_MUCH') {\n getActions().openLimitReachedModal({ limit: 'channels' });\n } else {\n getActions().showDialog({ data: { ...(error as ApiError), hasErrorKey: true } });\n }\n\n return undefined;\n }\n}\n\nasync function loadChatFolders() {\n const chatFolders = await callApi('fetchChatFolders');\n\n if (chatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n ...chatFolders,\n },\n });\n }\n}\n\nasync function loadRecommendedChatFolders() {\n const recommendedChatFolders = await callApi('fetchRecommendedChatFolders');\n\n if (recommendedChatFolders) {\n const global = getGlobal();\n\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommendedChatFolders,\n },\n });\n }\n}\n\nasync function createChatFolder(folder: ApiChatFolder, maxId: number) {\n // Clear fields from recommended folders\n const { id: recommendedId, description, ...newFolder } = folder;\n\n await callApi('editChatFolder', {\n id: maxId + 1,\n folderUpdate: {\n id: maxId + 1,\n ...newFolder,\n },\n });\n\n if (!description) {\n return;\n }\n\n const global = getGlobal();\n const { recommended } = global.chatFolders;\n\n if (recommended) {\n setGlobal({\n ...global,\n chatFolders: {\n ...global.chatFolders,\n recommended: recommended.filter(({ id }) => id !== recommendedId),\n },\n });\n }\n}\n\nasync function deleteChatFolder(id: number) {\n await callApi('deleteChatFolder', id);\n}\n\nexport async function fetchChatByUsername(\n username: string,\n) {\n const global = getGlobal();\n const localChat = selectChatByUsername(global, username);\n if (localChat && !localChat.isMin) {\n return localChat;\n }\n\n const chat = await callApi('getChatByUsername', username);\n if (!chat) {\n return undefined;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n return chat;\n}\n\nexport async function fetchChatByPhoneNumber(phoneNumber: string) {\n const global = getGlobal();\n const localUser = selectUserByPhoneNumber(global, phoneNumber);\n if (localUser && !localUser.isMin) {\n return selectChat(global, localUser.id);\n }\n\n const chat = await callApi('getChatByPhoneNumber', phoneNumber);\n if (!chat) {\n return undefined;\n }\n\n setGlobal(updateChat(getGlobal(), chat.id, chat));\n\n return chat;\n}\n\nasync function openChatByUsername(\n actions: GlobalActions,\n username: string,\n channelPostId?: number,\n startParam?: string,\n startAttach?: string | boolean,\n attach?: string,\n) {\n // Attach in the current chat\n if (startAttach && !attach) {\n const chat = await fetchChatByUsername(username);\n\n if (!chat) return;\n const global = getGlobal();\n const user = selectUser(global, chat.id);\n\n if (!user) return;\n const isBot = isUserBot(user);\n if (!isBot || !user.isAttachMenuBot) {\n actions.showNotification({ message: langProvider.getTranslation('WebApp.AddToAttachmentUnavailableError') });\n return;\n }\n\n const currentChat = selectCurrentChat(global);\n\n if (!currentChat) return;\n\n actions.callAttachMenuBot({\n botId: user.id,\n chatId: currentChat.id,\n ...(typeof startAttach === 'string' && { startParam: startAttach }),\n });\n return;\n }\n\n // Open temporary empty chat to make the click response feel faster\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.openPreviousChat();\n actions.showNotification({ message: 'User does not exist' });\n return;\n }\n\n if (channelPostId) {\n actions.focusMessage({ chatId: chat.id, messageId: channelPostId });\n } else {\n actions.openChat({ id: chat.id });\n }\n if (startParam) {\n actions.startBot({ botId: chat.id, param: startParam });\n }\n\n if (attach) {\n openAttachMenuFromLink(actions, chat.id, attach, startAttach);\n }\n}\n\nasync function openAttachMenuFromLink(\n actions: GlobalActions,\n chatId: string, attach: string, startAttach?: string | boolean,\n) {\n const botChat = await fetchChatByUsername(attach);\n if (!botChat) return;\n const botUser = selectUser(getGlobal(), botChat.id);\n if (!botUser || !botUser.isAttachMenuBot) {\n actions.showNotification({ message: langProvider.getTranslation('WebApp.AddToAttachmentUnavailableError') });\n return;\n }\n\n actions.callAttachMenuBot({\n botId: botUser.id,\n chatId,\n ...(typeof startAttach === 'string' && { startParam: startAttach }),\n });\n}\n\nasync function openCommentsByUsername(\n actions: GlobalActions,\n username: string,\n messageId: number,\n commentId: number,\n) {\n actions.openChat({ id: TMP_CHAT_ID });\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) return;\n\n const global = getGlobal();\n\n const threadInfo = selectThreadInfo(global, chat.id, messageId);\n let discussionChatId: string | undefined;\n\n if (!threadInfo) {\n const result = await callApi('requestThreadInfoUpdate', { chat, threadId: messageId });\n if (!result) return;\n\n discussionChatId = result.discussionChatId;\n } else {\n discussionChatId = threadInfo.chatId;\n }\n\n if (!discussionChatId) return;\n\n actions.focusMessage({\n chatId: discussionChatId,\n threadId: messageId,\n messageId: Number(commentId),\n });\n}\n","import { addActionHandler, getGlobal, setGlobal } from '../../index';\nimport { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../../selectors/calls';\nimport { callApi } from '../../../api/gramjs';\nimport { selectChat, selectUser } from '../../selectors';\nimport { copyTextToClipboard } from '../../../util/clipboard';\nimport type { ApiGroupCall } from '../../../api/types';\nimport { updateGroupCall } from '../../reducers/calls';\nimport { buildCollectionByKey, omit } from '../../../util/iteratees';\nimport { addChats, addUsers } from '../../reducers';\nimport { fetchChatByUsername, loadFullChat } from '../api/chats';\nimport safePlay from '../../../util/safePlay';\nimport { ARE_CALLS_SUPPORTED } from '../../../util/environment';\nimport * as langProvider from '../../../util/langProvider';\nimport type { CallSound } from '../../types';\n\n// Workaround for Safari not playing audio without user interaction\nlet audioElement: HTMLAudioElement | undefined;\nlet audioContext: AudioContext | undefined;\n\nlet sounds: Record<CallSound, HTMLAudioElement>;\nlet initializationPromise: Promise<void> | undefined = Promise.resolve();\n\nexport const initializeSoundsForSafari = () => {\n if (!initializationPromise) return Promise.resolve();\n\n const joinAudio = new Audio('./voicechat_join.mp3');\n const connectingAudio = new Audio('./voicechat_connecting.mp3');\n connectingAudio.loop = true;\n const leaveAudio = new Audio('./voicechat_leave.mp3');\n const allowTalkAudio = new Audio('./voicechat_onallowtalk.mp3');\n const busyAudio = new Audio('./call_busy.mp3');\n const connectAudio = new Audio('./call_connect.mp3');\n const endAudio = new Audio('./call_end.mp3');\n const incomingAudio = new Audio('./call_incoming.mp3');\n incomingAudio.loop = true;\n const ringingAudio = new Audio('./call_ringing.mp3');\n ringingAudio.loop = true;\n\n sounds = {\n join: joinAudio,\n allowTalk: allowTalkAudio,\n leave: leaveAudio,\n connecting: connectingAudio,\n incoming: incomingAudio,\n end: endAudio,\n connect: connectAudio,\n busy: busyAudio,\n ringing: ringingAudio,\n };\n\n initializationPromise = Promise.all(Object.values(sounds).map((l) => {\n l.muted = true;\n l.volume = 0.0001;\n return l.play().then(() => {\n l.pause();\n l.volume = 1;\n l.currentTime = 0;\n l.muted = false;\n });\n })).then(() => {\n initializationPromise = undefined;\n });\n\n return initializationPromise;\n};\n\nasync function fetchGroupCall(groupCall: Partial<ApiGroupCall>) {\n const result = await callApi('getGroupCall', {\n call: groupCall,\n });\n\n if (!result) return undefined;\n\n let global = getGlobal();\n\n const existingGroupCall = selectGroupCall(global, groupCall.id!);\n\n global = updateGroupCall(\n global,\n groupCall.id!,\n omit(result.groupCall, ['connectionState']),\n undefined,\n existingGroupCall?.isLoaded ? undefined : result.groupCall.participantsCount,\n );\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n\n return result.groupCall;\n}\n\nasync function fetchGroupCallParticipants(groupCall: Partial<ApiGroupCall>, nextOffset?: string) {\n const result = await callApi('fetchGroupCallParticipants', {\n call: groupCall as ApiGroupCall,\n offset: nextOffset,\n });\n\n if (!result) return;\n\n let global = getGlobal();\n\n global = addUsers(global, buildCollectionByKey(result.users, 'id'));\n global = addChats(global, buildCollectionByKey(result.chats, 'id'));\n\n setGlobal(global);\n}\n\naddActionHandler('toggleGroupCallPanel', (global) => {\n return {\n ...global,\n isCallPanelVisible: !global.isCallPanelVisible,\n };\n});\n\naddActionHandler('subscribeToGroupCallUpdates', async (global, actions, payload) => {\n const { subscribed, id } = payload!;\n const groupCall = selectGroupCall(global, id);\n\n if (!groupCall) return;\n\n if (subscribed) {\n await fetchGroupCall(groupCall);\n await fetchGroupCallParticipants(groupCall);\n }\n\n await callApi('toggleGroupCallStartSubscription', {\n subscribed,\n call: groupCall,\n });\n});\n\naddActionHandler('createGroupCall', async (global, actions, payload) => {\n const { chatId } = payload;\n\n const chat = selectChat(global, chatId);\n if (!chat) {\n return;\n }\n\n const result = await callApi('createGroupCall', {\n peer: chat,\n });\n\n if (!result) return;\n\n global = getGlobal();\n setGlobal(updateGroupCall(global, result.id, {\n ...result,\n chatId,\n }));\n\n actions.joinGroupCall({ id: result.id, accessHash: result.accessHash });\n});\n\naddActionHandler('createGroupCallInviteLink', async (global, actions) => {\n const groupCall = selectActiveGroupCall(global);\n\n if (!groupCall || !groupCall.chatId) {\n return;\n }\n\n const chat = selectChat(global, groupCall.chatId);\n if (!chat) {\n return;\n }\n\n const canInvite = Boolean(chat.username);\n\n let { inviteLink } = chat.fullInfo!;\n if (canInvite) {\n inviteLink = await callApi('exportGroupCallInvite', {\n call: groupCall,\n canSelfUnmute: false,\n });\n }\n\n if (!inviteLink) {\n return;\n }\n\n copyTextToClipboard(inviteLink);\n actions.showNotification({\n message: 'Link copied to clipboard',\n });\n});\n\naddActionHandler('joinVoiceChatByLink', async (global, actions, payload) => {\n const { username, inviteHash } = payload!;\n\n const chat = await fetchChatByUsername(username);\n\n if (!chat) {\n actions.showNotification({ message: langProvider.getTranslation('NoUsernameFound') });\n return;\n }\n\n const full = await loadFullChat(chat);\n\n if (full?.groupCall) {\n actions.joinGroupCall({ id: full.groupCall.id, accessHash: full.groupCall.accessHash, inviteHash });\n }\n});\n\naddActionHandler('joinGroupCall', async (global, actions, payload) => {\n if (!ARE_CALLS_SUPPORTED) return;\n\n if (global.phoneCall) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n const {\n chatId, id, accessHash, inviteHash,\n } = payload;\n\n createAudioElement();\n\n await initializeSoundsForSafari();\n const { groupCalls: { activeGroupCallId } } = global;\n let groupCall = id ? selectGroupCall(global, id) : selectChatGroupCall(global, chatId);\n\n if (groupCall?.id === activeGroupCallId) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (activeGroupCallId) {\n actions.leaveGroupCall({\n rejoin: payload,\n });\n return;\n }\n\n if (groupCall && activeGroupCallId === groupCall.id) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n if (!groupCall && (!id || !accessHash)) {\n groupCall = await fetchGroupCall({\n id,\n accessHash,\n });\n }\n\n if (!groupCall) return;\n\n global = getGlobal();\n global = updateGroupCall(\n global,\n groupCall.id,\n {\n ...groupCall,\n inviteHash,\n },\n undefined,\n groupCall.participantsCount + 1,\n );\n global = {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n activeGroupCallId: groupCall.id,\n },\n isCallPanelVisible: false,\n };\n setGlobal(global);\n});\n\naddActionHandler('playGroupCallSound', (global, actions, payload) => {\n const { sound } = payload!;\n\n if (!sounds[sound]) {\n return;\n }\n\n const doPlay = () => {\n if (sound !== 'connecting') {\n sounds.connecting.pause();\n }\n if (sound !== 'incoming') {\n sounds.incoming.pause();\n }\n if (sound !== 'ringing') {\n sounds.ringing.pause();\n }\n safePlay(sounds[sound]);\n };\n\n if (initializationPromise) {\n initializationPromise.then(doPlay);\n } else {\n doPlay();\n }\n});\n\naddActionHandler('loadMoreGroupCallParticipants', (global) => {\n const groupCall = selectActiveGroupCall(global);\n if (!groupCall) {\n return;\n }\n\n void fetchGroupCallParticipants(groupCall, groupCall.nextOffset);\n});\n\naddActionHandler('requestCall', async (global, actions, payload) => {\n const { userId, isVideo } = payload;\n\n if (global.phoneCall) {\n actions.toggleGroupCallPanel();\n return;\n }\n\n const user = selectUser(global, userId);\n\n if (!user) {\n return;\n }\n\n await initializeSoundsForSafari();\n\n setGlobal({\n ...getGlobal(),\n phoneCall: {\n id: '',\n state: 'requesting',\n participantId: userId,\n isVideo,\n adminId: global.currentUserId,\n },\n isCallPanelVisible: false,\n });\n});\n\nfunction createAudioContext() {\n return (new (window.AudioContext || (window as any).webkitAudioContext)());\n}\n\nconst silence = (ctx: AudioContext) => {\n const oscillator = ctx.createOscillator();\n const dst = oscillator.connect(ctx.createMediaStreamDestination());\n oscillator.start();\n return new MediaStream([Object.assign((dst as any).stream.getAudioTracks()[0], { enabled: false })]);\n};\n\nfunction createAudioElement() {\n const ctx = createAudioContext();\n audioElement = new Audio();\n audioContext = ctx;\n audioElement.srcObject = silence(ctx);\n safePlay(audioElement);\n}\n\nexport function getGroupCallAudioElement() {\n return audioElement;\n}\n\nexport function getGroupCallAudioContext() {\n return audioContext;\n}\n\nexport function removeGroupCallAudioElement() {\n audioElement?.pause();\n audioContext = undefined;\n audioElement = undefined;\n}\n","import type { GroupCallParticipant } from '../../lib/secret-sauce';\nimport type { GlobalState } from '../types';\nimport type { ApiGroupCall } from '../../api/types';\nimport { selectGroupCall } from '../selectors/calls';\nimport { omit } from '../../util/iteratees';\nimport { updateChat } from './chats';\nimport { selectChat } from '../selectors';\n\nexport function updateGroupCall(\n global: GlobalState,\n groupCallId: string,\n groupCallUpdate: Partial<ApiGroupCall>,\n addToParticipantCount?: number,\n resetParticipantCount?: number,\n): GlobalState {\n const unfiltered = Object.values({\n ...global.groupCalls.byId[groupCallId]?.participants,\n ...groupCallUpdate.participants,\n });\n const filtered = unfiltered.filter((l) => !l.isLeft);\n const participants = filtered.reduce((acc: Record<string, GroupCallParticipant>, el) => {\n acc[el.id] = el;\n return acc;\n }, {});\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...global.groupCalls.byId,\n [groupCallId]: {\n ...global.groupCalls.byId[groupCallId],\n ...omit(groupCallUpdate, ['participantsCount']),\n ...(addToParticipantCount && {\n participantsCount: global.groupCalls.byId[groupCallId].participantsCount + addToParticipantCount,\n }),\n ...(resetParticipantCount !== undefined && {\n participantsCount: resetParticipantCount,\n }),\n participants,\n },\n },\n },\n };\n}\n\nexport function removeGroupCall(\n global: GlobalState,\n groupCallId: string,\n): GlobalState {\n const groupCall = selectGroupCall(global, groupCallId);\n if (groupCall && groupCall.chatId) {\n const chat = selectChat(global, groupCall.chatId);\n if (chat) {\n global = updateChat(global, groupCall.chatId, {\n fullInfo: {\n ...chat.fullInfo,\n groupCallId: undefined,\n },\n });\n }\n }\n\n return {\n ...global,\n groupCalls: {\n ...global.groupCalls,\n byId: {\n ...omit(global.groupCalls.byId, [groupCallId.toString()]),\n },\n },\n };\n}\n\nexport function updateActiveGroupCall(\n global: GlobalState,\n groupCallUpdate: Partial<ApiGroupCall>,\n resetParticipantCount?: number,\n): GlobalState {\n if (!global.groupCalls.activeGroupCallId) {\n return global;\n }\n\n return updateGroupCall(global,\n global.groupCalls.activeGroupCallId,\n groupCallUpdate,\n undefined,\n resetParticipantCount);\n}\n\nexport function updateGroupCallParticipant(\n global: GlobalState,\n groupCallId: string,\n userId: string,\n participantUpdate: Partial<GroupCallParticipant>,\n noUpdateCount = false,\n) {\n const groupCall = selectGroupCall(global, groupCallId);\n if (!groupCall) {\n return global;\n }\n\n return updateGroupCall(global, groupCallId, {\n participants: {\n ...groupCall.participants,\n [userId]: {\n ...groupCall.participants[userId],\n ...participantUpdate,\n },\n },\n }, participantUpdate.isLeft\n ? (noUpdateCount ? 0 : -1)\n : (groupCall.participants[userId] || noUpdateCount ? 0 : 1));\n}\n","import type { GlobalState } from '../types';\nimport { selectChat } from './chats';\nimport { isChatBasicGroup } from '../helpers';\nimport { selectUser } from './users';\n\nexport function selectChatGroupCall(global: GlobalState, chatId: string) {\n const chat = selectChat(global, chatId);\n if (!chat || !chat.fullInfo || !chat.fullInfo.groupCallId) return undefined;\n\n return selectGroupCall(global, chat.fullInfo.groupCallId);\n}\n\nexport function selectGroupCall(global: GlobalState, groupCallId: string) {\n return global.groupCalls.byId[groupCallId];\n}\n\nexport function selectGroupCallParticipant(global: GlobalState, groupCallId: string, participantId: string) {\n return selectGroupCall(global, groupCallId)?.participants[participantId];\n}\n\nexport function selectIsAdminInActiveGroupCall(global: GlobalState): boolean {\n const chatId = selectActiveGroupCall(global)?.chatId;\n\n if (!chatId) return false;\n\n const chat = selectChat(global, chatId);\n if (!chat) return false;\n\n return (isChatBasicGroup(chat) && chat.isCreator) || Boolean(chat.adminRights?.manageCall);\n}\n\nexport function selectActiveGroupCall(global: GlobalState) {\n const { groupCalls: { activeGroupCallId } } = global;\n if (!activeGroupCallId) {\n return undefined;\n }\n\n return selectGroupCall(global, activeGroupCallId);\n}\n\nexport function selectPhoneCallUser(global: GlobalState) {\n const { phoneCall, currentUserId } = global;\n if (!phoneCall || !phoneCall.participantId || !phoneCall.adminId) {\n return undefined;\n }\n\n const id = phoneCall.adminId === currentUserId ? phoneCall.participantId : phoneCall.adminId;\n return selectUser(global, id);\n}\n","import { getActions } from '../global';\nimport { IS_SAFARI } from './environment';\n\ntype DeepLinkMethod = 'resolve' | 'login' | 'passport' | 'settings' | 'join' | 'addstickers' | 'setlanguage' |\n'addtheme' | 'confirmphone' | 'socks' | 'proxy' | 'privatepost' | 'bg' | 'share' | 'msg' | 'msg_url' | 'invoice';\n\nexport const processDeepLink = (url: string) => {\n const {\n protocol, searchParams, pathname, hostname,\n } = new URL(url);\n\n if (protocol !== 'tg:') return;\n\n const {\n openChatByInvite,\n openChatByUsername,\n openChatByPhoneNumber,\n openStickerSetShortName,\n focusMessage,\n joinVoiceChatByLink,\n openInvoice,\n } = getActions();\n\n // Safari thinks the path in tg://path links is hostname for some reason\n const method = (IS_SAFARI ? hostname : pathname).replace(/^\\/\\//, '') as DeepLinkMethod;\n const params: Record<string, string> = {};\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n switch (method) {\n case 'resolve': {\n const {\n domain, phone, post, comment, voicechat, livestream, start, startattach, attach,\n } = params;\n\n const startAttach = params.hasOwnProperty('startattach') && !startattach ? true : startattach;\n\n if (domain !== 'telegrampassport') {\n if (params.hasOwnProperty('voicechat') || params.hasOwnProperty('livestream')) {\n joinVoiceChatByLink({\n username: domain,\n inviteHash: voicechat || livestream,\n });\n } else if (phone) {\n openChatByPhoneNumber({ phone, startAttach, attach });\n } else {\n openChatByUsername({\n username: domain,\n messageId: Number(post),\n commentId: Number(comment),\n startParam: start,\n startAttach,\n attach,\n });\n }\n }\n break;\n }\n case 'privatepost': {\n const {\n post, channel,\n } = params;\n\n focusMessage({\n chatId: `-${channel}`,\n id: post,\n });\n break;\n }\n case 'bg': {\n // const {\n // slug, color, rotation, mode, intensity, bg_color: bgColor, gradient,\n // } = params;\n break;\n }\n case 'join': {\n const { invite } = params;\n\n openChatByInvite({ hash: invite });\n break;\n }\n case 'addstickers': {\n const { set } = params;\n\n openStickerSetShortName({\n stickerSetShortName: set,\n });\n break;\n }\n case 'share':\n case 'msg': {\n // const { url, text } = params;\n break;\n }\n case 'login': {\n // const { code, token } = params;\n break;\n }\n\n case 'invoice': {\n const { slug } = params;\n openInvoice({ slug });\n break;\n }\n default:\n // Unsupported deeplink\n\n break;\n }\n};\n"],"names":["memo","withGlobal","global","userId","chat","selectCurrentChat","user","selectUser","contactName","getUserFirstOrLastName","undefined","isOpen","onClose","deleteChatMember","getActions","lang","useLang","handleDeleteChatMember","useCallback","chatId","id","onEnter","className","title","renderText","color","isText","onClick","runThrottledForLoadTopChats","throttle","cb","runDebouncedForLoadFullChat","debounce","async","loadChats","listType","offsetId","offsetDate","shouldReplace","getGlobal","result","callApi","limit","CHAT_LIST_LOAD_SLICE","archived","withPinned","serverTimeOffset","lastLocalServiceMessage","selectLastServiceNotification","message","chatIds","length","shift","currentChat","visibleChats","visibleUsers","selectVisibleUsers","currentUserId","users","byId","push","replaceUsers","buildCollectionByKey","concat","replaceUserStatuses","userStatusesById","replaceChats","chats","replaceChatListIds","addUsers","addUserStatuses","updateChats","updateChatListIds","updateChatListSecondaryInfo","Object","keys","draftsById","forEach","replaceThreadParam","MAIN_THREAD_ID","replyingToById","isFullyLoaded","setGlobal","loadFullChat","fullInfo","groupCall","membersCount","existingGroupCall","selectGroupCall","updateGroupCall","omit","participantsCount","updateChat","stickerSet","loadStickers","stickerSetId","stickerSetAccessHash","accessHash","stickerSetShortName","shortName","migrateChat","error","openLimitReachedModal","showDialog","data","hasErrorKey","fetchChatByUsername","username","localChat","selectChatByUsername","isMin","openAttachMenuFromLink","actions","attach","startAttach","botChat","botUser","isAttachMenuBot","callAttachMenuBot","botId","startParam","showNotification","langProvider","addActionHandler","preloadedChatIds","Set","i","TOP_CHAT_MESSAGES_PRELOAD_LIMIT","pause","currentChatId","selectCurrentMessageList","folderAllOrderedIds","getOrderedIds","ALL_FOLDER_ID","nextChatId","find","has","add","loadViewportMessages","threadId","payload","selectChat","hasUnreadMark","toggleChatUnread","lastMessage","threadInfo","requestThreadInfoUpdate","isChatSummaryOnly","requestChatUpdate","type","selectThreadTopMessageId","chatFullInfo","linkedChatId","openChat","messageId","focusMessage","selectSupportChat","shouldReplaceHistory","TMP_CHAT_ID","onReplace","DEBUG","console","connectionState","authState","listIds","oldestChat","map","filter","Boolean","selectIsChatPinned","sort","chat1","chat2","date","force","SERVICE_NOTIFICATIONS_USER_ID","lastLocalMessage","isMuted","about","photo","memberIds","createdChannel","chatCreation","progress","ChatCreationProgress","channelId","createChannel","joinChannel","leaveChat","createdChat","e","createGroupChat","folderId","selectCurrentLimit","folder","selectChatFolder","shouldBePinned","pinnedChatIds","includedChatIds","newPinnedIds","pinnedId","newIncludedChatIds","folderUpdate","selectChatListType","isPinned","ARCHIVED_FOLDER_ID","ids","orderedPinnedIds","isChatArchived","chatFolders","loadChatFolders","recommendedChatFolders","recommended","loadRecommendedChatFolders","idsToRemove","idsToAdd","some","includedId","emoticon","orderedIds","maxId","recommendedId","description","newFolder","createChatFolder","Math","max","deleteChatFolder","unreadCount","hash","phoneNumber","localUser","selectUserByPhoneNumber","fetchChatByPhoneNumber","openPreviousChat","replace","url","match","RE_TG_LINK","processDeepLink","uri","URL","startsWith","part1","part2","part3","pathname","split","l","decodeURI","params","fromEntries","searchParams","hasOwnProperty","startattach","openChatByPhoneNumber","substr","openChatByInvite","openStickerSetShortName","chatOrChannelPostId","Number","commentId","comment","joinVoiceChatByLink","inviteHash","voicechat","livestream","openInvoice","slug","openChatByUsername","start","channelPostId","isUserBot","startBot","param","usernameChat","selectThreadInfo","discussionChatId","openCommentsByUsername","isEnabled","isChatBasicGroup","bannedRights","chatAfterUpdate","members","kickedMembers","isBanned","viewMessages","isUnblocked","m","adminRights","customTitle","adminMembers","isDismissed","updateManagementProgress","ManagementProgress","Promise","all","groups","addedById","reduce","group","addChats","forDiscussionIds","channel","fullChat","isPreHistoryHidden","activeChatFolder","openChatWithText","offset","addChatMembers","setNewChatMembersDialogState","NewChatMembersProgress","isProtected","enabledReactions","settings","isChatSuperGroup","isChatChannel","audioElement","audioContext","sounds","initializationPromise","resolve","initializeSoundsForSafari","joinAudio","Audio","connectingAudio","loop","leaveAudio","allowTalkAudio","busyAudio","connectAudio","endAudio","incomingAudio","ringingAudio","join","allowTalk","leave","connecting","incoming","end","connect","busy","ringing","values","muted","volume","play","then","currentTime","fetchGroupCall","call","isLoaded","fetchGroupCallParticipants","nextOffset","getGroupCallAudioElement","getGroupCallAudioContext","removeGroupCallAudioElement","isCallPanelVisible","subscribed","peer","joinGroupCall","selectActiveGroupCall","canInvite","inviteLink","canSelfUnmute","copyTextToClipboard","full","ARE_CALLS_SUPPORTED","phoneCall","toggleGroupCallPanel","ctx","window","AudioContext","webkitAudioContext","srcObject","oscillator","createOscillator","dst","createMediaStreamDestination","MediaStream","assign","stream","getAudioTracks","enabled","silence","safePlay","createAudioElement","groupCalls","activeGroupCallId","selectChatGroupCall","leaveGroupCall","rejoin","sound","doPlay","isVideo","state","participantId","adminId","groupCallId","groupCallUpdate","addToParticipantCount","resetParticipantCount","participants","isLeft","acc","el","removeGroupCall","toString","updateActiveGroupCall","updateGroupCallParticipant","participantUpdate","noUpdateCount","selectGroupCallParticipant","selectIsAdminInActiveGroupCall","isCreator","manageCall","selectPhoneCallUser","protocol","hostname","method","IS_SAFARI","value","key","domain","phone","post","invite","set"],"sourceRoot":""}