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B,OAAQF,CAAS,EDGjB,CAAgBohB,GAC5Be,GAAkB,OAAmBnD,GACrCoD,EAAe,KACrB,GAAId,EAAW,CACX,IAAKc,EACD,KAAM,2DAEV,OAAOhe,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGid,GAAYc,EACvD,CACA,GAAIf,EAAW,CACX,IAAKc,EACD,KAAM,sCAEV,OAAO/d,OAAOC,OAAOD,OAAOC,OAAO,CAAC,EAAGgd,GAAYc,EACvD,CACA,MAAKf,GAAiBD,EAIZ,qGAHA,iJAIV,C","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/providers/ChatClientProvider.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/providers/ChatThreadClientProvider.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/ChatClientState.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/Constants.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/Logger.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/ChatContext.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedIterator.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/StatefulChatThreadClient.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListMessages.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListParticipants.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListReadReceipts.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedListThreads.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/baseSelectors.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/sendBoxSelector.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/utils/constants.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/utils/compareMessages.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/typingIndicatorSelector.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/chatParticipantListSelector.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/errorBarSelector.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/hooks/useHandlers.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/communication-react/src/mergedHooks.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/chat-component-bindings/src/hooks/useSelector.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { createContext, useContext } from 'react';\n/**\n * @private\n */\nexport const ChatClientContext = createContext(undefined);\n/**\n * A {@link React.Context} that stores a {@link StatefulChatClient}.\n *\n * Chat components from this package must be wrapped with a {@link ChatClientProvider}.\n *\n * @public\n */\nexport const ChatClientProvider = (props) => {\n return React.createElement(ChatClientContext.Provider, { value: props.chatClient }, props.children);\n};\n/**\n * Hook to obtain {@link StatefulChatClient} from the provider.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useChatClient = () => {\n const chatClient = useContext(ChatClientContext);\n if (!chatClient) {\n throw 'Please wrap components with ChatClientProvider and initialize a chat client before calling the hook!';\n }\n return chatClient;\n};\n//# sourceMappingURL=ChatClientProvider.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { createContext, useContext } from 'react';\n/**\n * @private\n */\nexport const ChatThreadClientContext = createContext(undefined);\n/**\n * A {@link React.Context} that stores a {@link @azure/communication-chat#ChatThreadClient}.\n *\n * Chat components from this package must be wrapped with a {@link ChatThreadClientProvider}.\n *\n * @public\n */\nexport const ChatThreadClientProvider = (props) => {\n return React.createElement(ChatThreadClientContext.Provider, { value: props.chatThreadClient }, props.children);\n};\n/**\n * Hook to obtain {@link @azure/communication-chat#ChatThreadClient} from the provider.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useChatThreadClient = () => {\n const chatThreadClient = useContext(ChatThreadClientContext);\n if (!chatThreadClient) {\n throw 'Please wrap components with ChatThreadClientProvider and initialize a chat thread client before calling the hook.';\n }\n return chatThreadClient;\n};\n//# sourceMappingURL=ChatThreadClientProvider.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * Error thrown from failed {@link StatefulChatClient} methods.\n *\n * @public\n */\nexport class ChatError extends Error {\n constructor(target, innerError, timestamp) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp !== null && timestamp !== void 0 ? timestamp : new Date(Date.now());\n this.name = 'ChatError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n//# sourceMappingURL=ChatClientState.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport const Constants = {\n TYPING_INDICATOR_MAINTAIN_TIME: 8 * 1000,\n DUMMY_DATE: new Date(0)\n};\n//# sourceMappingURL=Constants.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createClientLogger } from '@azure/logger';\n/**\n * @private\n */\nexport const chatStatefulLogger = createClientLogger('communication-react:chat-stateful');\n//# sourceMappingURL=Logger.js.map","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * @private\n */\nexport class ResourceDownloadQueue {\n constructor(context, authentication) {\n this._messagesNeedingResourceRetrieval = [];\n this.isActive = false;\n this._requestsToCancel = {};\n this._context = context;\n this._credential = authentication.credential;\n this._endpoint = authentication.endpoint;\n }\n containsMessageWithSameAttachments(message) {\n var _a, _b, _c;\n let contains = false;\n const incomingAttachment = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;\n if (incomingAttachment) {\n for (const m of this._messagesNeedingResourceRetrieval) {\n const existingAttachment = (_c = (_b = m.content) === null || _b === void 0 ? void 0 : _b.attachments) !== null && _c !== void 0 ? _c : [];\n contains = incomingAttachment.every((element, index) => element === existingAttachment[index]);\n if (contains) {\n break;\n }\n }\n }\n return contains;\n }\n addMessage(message) {\n // make a copy of message and add to queue\n const copy = Object.assign({}, message);\n this._messagesNeedingResourceRetrieval.push(copy);\n }\n startQueue(threadId, operation, options) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.isActive) {\n return;\n }\n while (this._messagesNeedingResourceRetrieval.length > 0) {\n this.isActive = true;\n let message = this._messagesNeedingResourceRetrieval.shift();\n if (!message) {\n this.isActive = false;\n continue;\n }\n if (options) {\n const singleUrl = options.singleUrl;\n message = yield this.downloadSingleUrl(message, singleUrl, operation);\n }\n else {\n message = yield this.downloadAllPreviewUrls(message, operation);\n }\n this._context.setChatMessage(threadId, message);\n this.isActive = false;\n }\n });\n }\n cancelAllRequests() {\n for (const cancelation of Object.values(this._requestsToCancel)) {\n cancelation.abortController.abort();\n }\n this._requestsToCancel = {};\n }\n cancelRequest(url) {\n var _a;\n if (this._requestsToCancel[url]) {\n (_a = this._requestsToCancel[url]) === null || _a === void 0 ? void 0 : _a.abortController.abort();\n delete this._requestsToCancel[url];\n }\n }\n downloadSingleUrl(message, resourceUrl, operation) {\n return __awaiter(this, void 0, void 0, function* () {\n const response = {\n sourceUrl: ''\n };\n try {\n const abortController = new AbortController();\n const blobUrl = yield this.downloadResource(operation, resourceUrl, abortController);\n response.sourceUrl = blobUrl;\n }\n catch (error) {\n response.error = error;\n delete this._requestsToCancel[resourceUrl];\n }\n message = Object.assign(Object.assign({}, message), { resourceCache: Object.assign(Object.assign({}, message.resourceCache), { [resourceUrl]: response }) });\n return message;\n });\n }\n downloadAllPreviewUrls(message, operation) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a;\n const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;\n if (message.type === 'html' && attachments) {\n if (message.resourceCache === undefined) {\n message.resourceCache = {};\n }\n for (const attachment of attachments) {\n if (attachment.previewUrl && attachment.attachmentType === 'image') {\n const response = {\n sourceUrl: ''\n };\n try {\n const abortController = new AbortController();\n const blobUrl = yield this.downloadResource(operation, attachment.previewUrl, abortController);\n response.sourceUrl = blobUrl;\n }\n catch (error) {\n response.error = error;\n delete this._requestsToCancel[attachment.previewUrl];\n }\n message.resourceCache[attachment.previewUrl] = response;\n }\n }\n }\n return message;\n });\n }\n downloadResource(operation, url, abortController) {\n return __awaiter(this, void 0, void 0, function* () {\n this._requestsToCancel[url] = {\n src: url,\n abortController\n };\n const blobUrl = yield operation(url, {\n credential: this._credential,\n endpoint: this._endpoint\n }, {\n abortController\n });\n delete this._requestsToCancel[url];\n return blobUrl;\n });\n }\n}\n/**\n * @private\n */\nexport const fetchImageSource = (src, authentication, options) => __awaiter(void 0, void 0, void 0, function* () {\n function fetchWithAuthentication(url, token, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const headers = new Headers();\n headers.append('Authorization', `Bearer ${token}`);\n return yield fetchWithTimeout(url, {\n timeout: options.timeout,\n headers,\n abortController: options.abortController\n });\n });\n }\n function fetchWithTimeout(resource, options) {\n return __awaiter(this, void 0, void 0, function* () {\n // default timeout is 30 seconds\n const { timeout = 30000, abortController } = options;\n const id = setTimeout(() => {\n abortController.abort();\n }, timeout);\n const response = yield fetch(resource, Object.assign(Object.assign({}, options), { signal: abortController.signal }));\n clearTimeout(id);\n return response;\n });\n }\n const fetchUrl = new URL(src);\n const endpoint = new URL(authentication.endpoint);\n let token = '';\n if (fetchUrl.hostname === endpoint.hostname && fetchUrl.protocol === 'https:') {\n token = (yield authentication.credential.getToken()).token;\n }\n const response = yield fetchWithAuthentication(src, token, options);\n if (response.status >= 400) {\n throw new Error(`Failed to fetch image source. Status code: ${response.status}`);\n }\n const blob = yield response.blob();\n return URL.createObjectURL(blob);\n});\n//# sourceMappingURL=ResourceDownloadQueue.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { EventEmitter } from 'events';\nimport { enableMapSet, enablePatches, produce } from 'immer';\nimport { ChatError } from './ChatClientState';\nimport { createClientLogger, getLogLevel } from '@azure/logger';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { Constants } from './Constants';\nimport { chatStatefulLogger } from './Logger';\nimport { ResourceDownloadQueue, fetchImageSource } from './ResourceDownloadQueue';\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n/**\n * @internal\n */\nexport class ChatContext {\n constructor(maxListeners, credential, endpoint) {\n this._state = {\n userId: {\n id: ''\n },\n displayName: '',\n threads: {},\n latestErrors: {}\n };\n this._batchMode = false;\n this.typingIndicatorInterval = undefined;\n this._inlineImageQueue = undefined;\n this._fullsizeImageQueue = undefined;\n this._logger = createClientLogger('communication-react:chat-context');\n this._emitter = new EventEmitter();\n if (credential) {\n this._inlineImageQueue = new ResourceDownloadQueue(this, {\n credential,\n endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : ''\n });\n this._fullsizeImageQueue = new ResourceDownloadQueue(this, {\n credential,\n endpoint: endpoint !== null && endpoint !== void 0 ? endpoint : ''\n });\n }\n if (maxListeners) {\n this._emitter.setMaxListeners(maxListeners);\n }\n }\n getState() {\n return this._state;\n }\n modifyState(modifier) {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (!this._batchMode && this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n dispose() {\n this.modifyState((draft) => {\n var _a, _b;\n (_a = this._inlineImageQueue) === null || _a === void 0 ? void 0 : _a.cancelAllRequests();\n (_b = this._fullsizeImageQueue) === null || _b === void 0 ? void 0 : _b.cancelAllRequests();\n Object.values(draft.threads).forEach(thread => {\n Object.values(thread.chatMessages).forEach(message => {\n const cache = message.resourceCache;\n if (cache) {\n Object.values(cache).forEach(resource => {\n if (resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n });\n }\n message.resourceCache = undefined;\n });\n });\n });\n // Any item in queue should be removed.\n }\n downloadResourceToCache(threadId, messageId, resourceUrl) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a;\n let message = (_a = this.getState().threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[messageId];\n if (message && this._fullsizeImageQueue) {\n if (!message.resourceCache) {\n message = Object.assign(Object.assign({}, message), { resourceCache: {} });\n }\n // Need to discuss retry logic in case of failure\n this._fullsizeImageQueue.addMessage(message);\n yield this._fullsizeImageQueue.startQueue(threadId, fetchImageSource, {\n singleUrl: resourceUrl\n });\n }\n });\n }\n removeResourceFromCache(threadId, messageId, resourceUrl) {\n this.modifyState((draft) => {\n var _a, _b, _c;\n const message = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[messageId];\n if (message && this._fullsizeImageQueue && this._fullsizeImageQueue.containsMessageWithSameAttachments(message)) {\n (_b = this._fullsizeImageQueue) === null || _b === void 0 ? void 0 : _b.cancelRequest(resourceUrl);\n }\n else if (message && this._inlineImageQueue && this._inlineImageQueue.containsMessageWithSameAttachments(message)) {\n (_c = this._inlineImageQueue) === null || _c === void 0 ? void 0 : _c.cancelRequest(resourceUrl);\n }\n if (message && message.resourceCache && message.resourceCache[resourceUrl]) {\n const resource = message.resourceCache[resourceUrl];\n if (resource === null || resource === void 0 ? void 0 : resource.sourceUrl) {\n URL.revokeObjectURL(resource.sourceUrl);\n }\n delete message.resourceCache[resourceUrl];\n }\n });\n }\n setThread(threadId, threadState) {\n this.modifyState((draft) => {\n draft.threads[threadId] = threadState;\n });\n }\n createThread(threadId, properties) {\n this.modifyState((draft) => {\n draft.threads[threadId] = {\n chatMessages: {},\n threadId: threadId,\n properties: properties,\n participants: {},\n readReceipts: [],\n typingIndicators: [],\n latestReadTime: new Date(0)\n };\n });\n }\n updateChatConfig(userId, displayName) {\n this.modifyState((draft) => {\n draft.displayName = displayName;\n draft.userId = userId;\n });\n }\n createThreadIfNotExist(threadId, properties) {\n const exists = Object.prototype.hasOwnProperty.call(this.getState().threads, threadId);\n if (!exists) {\n this.createThread(threadId, properties);\n return true;\n }\n return false;\n }\n updateThread(threadId, properties) {\n this.modifyState((draft) => {\n const thread = draft.threads[threadId];\n if (thread) {\n thread.properties = properties;\n }\n });\n }\n updateThreadTopic(threadId, topic) {\n this.modifyState((draft) => {\n if (topic === undefined) {\n return;\n }\n const thread = draft.threads[threadId];\n if (thread && !thread.properties) {\n thread.properties = {\n topic: topic\n };\n }\n else if (thread && thread.properties) {\n thread.properties.topic = topic;\n }\n });\n }\n deleteThread(threadId) {\n this.modifyState((draft) => {\n const thread = draft.threads[threadId];\n if (thread) {\n delete draft.threads[threadId];\n }\n });\n }\n setChatMessages(threadId, messages) {\n this.modifyState((draft) => {\n const threadState = draft.threads[threadId];\n if (threadState) {\n threadState.chatMessages = messages;\n }\n // remove typing indicator when receive messages\n const thread = draft.threads[threadId];\n if (thread) {\n for (const message of Object.values(messages)) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n }\n });\n }\n updateChatMessageContent(threadId, messagesId, content) {\n this.modifyState((draft) => {\n var _a;\n const chatMessage = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[messagesId];\n if (chatMessage) {\n if (!chatMessage.content) {\n chatMessage.content = {};\n }\n chatMessage.content.message = content;\n }\n });\n }\n deleteLocalMessage(threadId, localId) {\n let localMessageDeleted = false;\n this.modifyState((draft) => {\n var _a;\n const chatMessages = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages;\n const message = chatMessages ? chatMessages[localId] : undefined;\n if (chatMessages && message && message.clientMessageId) {\n delete chatMessages[message.clientMessageId];\n localMessageDeleted = true;\n }\n });\n return localMessageDeleted;\n }\n deleteMessage(threadId, id) {\n this.modifyState((draft) => {\n var _a;\n const chatMessages = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages;\n if (chatMessages) {\n delete chatMessages[id];\n }\n });\n }\n setParticipant(threadId, participant) {\n this.modifyState((draft) => {\n var _a;\n const participants = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.participants;\n if (participants) {\n participants[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n });\n }\n setParticipants(threadId, participants) {\n this.modifyState((draft) => {\n var _a;\n const participantsMap = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.participants;\n if (participantsMap) {\n for (const participant of participants) {\n participantsMap[toFlatCommunicationIdentifier(participant.id)] = participant;\n }\n }\n });\n }\n deleteParticipants(threadId, participantIds) {\n this.modifyState((draft) => {\n var _a;\n const participants = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.participants;\n if (participants) {\n participantIds.forEach(id => {\n delete participants[toFlatCommunicationIdentifier(id)];\n });\n }\n });\n }\n deleteParticipant(threadId, participantId) {\n this.modifyState((draft) => {\n var _a;\n const participants = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.participants;\n if (participants) {\n delete participants[toFlatCommunicationIdentifier(participantId)];\n }\n });\n }\n addReadReceipt(threadId, readReceipt) {\n this.modifyState((draft) => {\n const thread = draft.threads[threadId];\n const readReceipts = thread === null || thread === void 0 ? void 0 : thread.readReceipts;\n if (thread && readReceipts) {\n // TODO(prprabhu): Replace `this.getState()` with `draft`?\n if (readReceipt.sender !== this.getState().userId && thread.latestReadTime < readReceipt.readOn) {\n thread.latestReadTime = readReceipt.readOn;\n }\n readReceipts.push(readReceipt);\n }\n });\n }\n startTypingIndicatorCleanUp() {\n if (this.typingIndicatorInterval) {\n return;\n }\n this.typingIndicatorInterval = window.setInterval(() => {\n let isTypingActive = false;\n this.modifyState((draft) => {\n for (const thread of Object.values(draft.threads)) {\n const filteredTypingIndicators = thread.typingIndicators.filter(typingIndicator => {\n const timeGap = Date.now() - typingIndicator.receivedOn.getTime();\n return timeGap < Constants.TYPING_INDICATOR_MAINTAIN_TIME;\n });\n if (thread.typingIndicators.length !== filteredTypingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n if (thread.typingIndicators.length > 0) {\n isTypingActive = true;\n }\n }\n });\n if (!isTypingActive && this.typingIndicatorInterval) {\n window.clearInterval(this.typingIndicatorInterval);\n this.typingIndicatorInterval = undefined;\n }\n }, 1000);\n }\n addTypingIndicator(threadId, typingIndicator) {\n this.modifyState((draft) => {\n const thread = draft.threads[threadId];\n if (thread) {\n const typingIndicators = thread.typingIndicators;\n typingIndicators.push(typingIndicator);\n }\n });\n // Make sure we only maintain a period of typing indicator for perf purposes\n this.startTypingIndicatorCleanUp();\n }\n setChatMessage(threadId, message) {\n this.parseAttachments(threadId, message);\n const { id: messageId, clientMessageId } = message;\n if (messageId || clientMessageId) {\n this.modifyState((draft) => {\n var _a;\n const threadMessages = (_a = draft.threads[threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages;\n const isLocalIdInMap = threadMessages && clientMessageId && threadMessages[clientMessageId];\n const messageKey = !messageId || isLocalIdInMap ? clientMessageId : messageId;\n if (threadMessages && messageKey) {\n threadMessages[messageKey] = message;\n }\n // remove typing indicator when receive a message from a user\n const thread = draft.threads[threadId];\n if (thread) {\n this.filterTypingIndicatorForUser(thread, message.sender);\n }\n });\n }\n }\n parseAttachments(threadId, message) {\n var _a;\n const attachments = (_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments;\n if (message.type === 'html' && attachments && attachments.length > 0) {\n if (this._inlineImageQueue && !this._inlineImageQueue.containsMessageWithSameAttachments(message) && message.resourceCache === undefined) {\n // Need to discuss retry logic in case of failure\n this._inlineImageQueue.addMessage(message);\n this._inlineImageQueue.startQueue(threadId, fetchImageSource);\n }\n }\n }\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param f Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n withAsyncErrorTeedToState(f, target) {\n return (...args) => __awaiter(this, void 0, void 0, function* () {\n try {\n return yield f(...args);\n }\n catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n });\n }\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param f Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws ChatError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n withErrorTeedToState(f, target) {\n return (...args) => {\n try {\n chatStatefulLogger.info(`Chat stateful client target function called: ${target}`);\n return f(...args);\n }\n catch (error) {\n const chatError = toChatError(target, error);\n this.setLatestError(target, chatError);\n throw chatError;\n }\n };\n }\n setLatestError(target, error) {\n this.modifyState((draft) => {\n draft.latestErrors[target] = error;\n });\n }\n // This is a mutating function, only use it inside of a produce() function\n filterTypingIndicatorForUser(thread, userId) {\n if (!userId) {\n return;\n }\n const typingIndicators = thread.typingIndicators;\n const userIdAsKey = toFlatCommunicationIdentifier(userId);\n const filteredTypingIndicators = typingIndicators.filter(typingIndicator => toFlatCommunicationIdentifier(typingIndicator.sender) !== userIdAsKey);\n if (filteredTypingIndicators.length !== typingIndicators.length) {\n thread.typingIndicators = filteredTypingIndicators;\n }\n }\n /**\n * Batch updates to minimize `stateChanged` events across related operations.\n *\n * - A maximum of one `stateChanged` event is emitted, at the end of the operations.\n * - No `stateChanged` event is emitted if the state did not change through the operations.\n * - In case of an exception, state is reset to the prior value and no `stateChanged` event is emitted.\n *\n * All operations finished in this batch should be synchronous.\n * This function is not reentrant -- do not call batch() from within another batch().\n */\n batch(operations) {\n if (this._batchMode) {\n throw new Error('batch() called from within another batch()');\n }\n this._batchMode = true;\n const priorState = this._state;\n try {\n operations();\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n catch (e) {\n this._state = priorState;\n if (getLogLevel() === 'verbose') {\n this._logger.warning(`State rollback to: ${_safeJSONStringify(priorState)}`);\n }\n throw e;\n }\n finally {\n this._batchMode = false;\n }\n }\n onStateChange(handler) {\n this._emitter.on('stateChanged', handler);\n }\n offStateChange(handler) {\n this._emitter.off('stateChanged', handler);\n }\n}\nconst toChatError = (target, error) => {\n if (error instanceof Error) {\n return new ChatError(target, error);\n }\n return new ChatError(target, new Error(`${error}`));\n};\n//# sourceMappingURL=ChatContext.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport const convertChatMessage = (message, status = 'delivered', clientMessageId) => {\n return Object.assign(Object.assign({}, message), { clientMessageId: clientMessageId, status });\n};\n//# sourceMappingURL=convertChatMessage.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { convertChatMessage } from './convertChatMessage';\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n/**\n * @private\n */\nexport class EventSubscriber {\n constructor(chatClient, chatContext) {\n this.convertEventToChatMessage = (event) => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n this.convertEventType = (type) => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n }\n else {\n return 'text';\n }\n };\n this.onChatMessageReceived = (event) => {\n var _a;\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = (_a = this.chatContext.getState().threads[event.threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n this.onChatMessageDeleted = (event) => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n this.onChatMessageEdited = (event) => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n this.onParticipantsAdded = (event) => {\n const participantsToAdd = event.participantsAdded.map(participant => (Object.assign(Object.assign({}, participant), { shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined })));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter(this, void 0, void 0, function* () {\n var _a, e_1, _b, _c;\n try {\n for (var _d = true, _e = __asyncValues(this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) {\n _c = _f.value;\n _d = false;\n const message = _c;\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, Object.assign(Object.assign({}, message), { status: 'delivered' }));\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_d && !_a && (_b = _e.return)) yield _b.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n this.onParticipantsRemoved = (event) => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n this.onReadReceiptReceived = (event) => {\n const readReceipt = Object.assign(Object.assign({}, event), { sender: event.sender, readOn: new Date(event.readOn) });\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n this.onTypingIndicatorReceived = (typingIndicator) => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n this.onChatThreadCreated = (event) => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n this.onChatThreadDeleted = (event) => {\n this.chatContext.deleteThread(event.threadId);\n };\n this.onChatThreadPropertiesUpdated = (event) => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n this.subscribe = () => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n this.unsubscribe = () => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n}\n//# sourceMappingURL=EventSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * Create a decorated iterator\n * returned iterators.\n *\n * @param iteratorCreator the function to create the original iterator\n * @param context chatContext\n * @param decorateFn the function for the decorating behavior\n */\nexport const createDecoratedIterator = (iteratorCreator, context, decorateFn) => {\n return (...args) => {\n const threadsIterator = iteratorCreator(...args);\n return {\n next() {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield threadsIterator.next();\n if (!result.done && result.value) {\n decorateFn(result.value, context);\n }\n return result;\n });\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings = {}) => {\n const pages = threadsIterator.byPage(settings);\n return {\n next() {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield pages.next();\n const page = result.value;\n if (!result.done && result.value) {\n context.batch(() => {\n for (const item of page) {\n decorateFn(item, context);\n }\n });\n }\n return result;\n });\n },\n [Symbol.asyncIterator]() {\n return this;\n }\n };\n }\n };\n };\n};\n/**\n *\n * @param iteratorCreator Function that creates the base iteartor\n * @param context The ChatContext that stores all internal state.\n * @param target See {@link ChatContext.asyncTeeErrorToState}.\n * @returns A function to create an iterator that handles errors when iterting over the iterator from `iteratorCreator`.\n */\nexport const createErrorHandlingIterator = (iteratorCreator, context, target) => {\n return (...args) => {\n const innerIter = iteratorCreator(...args);\n return {\n next: context.withAsyncErrorTeedToState(innerIter.next.bind(innerIter), target),\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings = {}) => {\n const pages = innerIter.byPage(settings);\n return {\n next: context.withAsyncErrorTeedToState(pages.next.bind(pages), target),\n [Symbol.asyncIterator]() {\n return this;\n }\n };\n }\n };\n };\n};\n//# sourceMappingURL=createDecoratedIterator.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { getIdentifierKind } from '@azure/communication-common';\nimport { nanoid } from 'nanoid';\nimport { createDecoratedListMessages } from './iterators/createDecoratedListMessages';\nimport { createDecoratedListReadReceipts } from './iterators/createDecoratedListReadReceipts';\nimport { createDecoratedListParticipants } from './iterators/createDecoratedListParticipants';\nimport { convertChatMessage } from './convertChatMessage';\nclass ProxyChatThreadClient {\n constructor(context) {\n this._context = context;\n }\n get(chatThreadClient, prop) {\n switch (prop) {\n case 'listMessages':\n {\n return createDecoratedListMessages(chatThreadClient, this._context);\n }\n case 'getMessage':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const message = yield chatThreadClient.getMessage(...args);\n this._context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));\n return message;\n }), 'ChatThreadClient.getMessage');\n }\n case 'sendMessage':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n var _a;\n // Retry logic?\n const [request, options] = args;\n const { content } = request;\n const clientMessageId = nanoid(); // Generate a local short uuid for message\n const newMessage = {\n content: {\n message: content\n },\n clientMessageId,\n id: '',\n type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : 'text',\n sequenceId: '',\n version: '',\n createdOn: new Date(),\n status: 'sending',\n senderDisplayName: this._context.getState().displayName,\n sender: this._context.getState().userId,\n metadata: options === null || options === void 0 ? void 0 : options.metadata\n };\n this._context.setChatMessage(chatThreadClient.threadId, newMessage);\n let result = undefined;\n try {\n result = yield chatThreadClient.sendMessage(...args);\n }\n catch (e) {\n this._context.setChatMessage(chatThreadClient.threadId, Object.assign(Object.assign({}, newMessage), { status: 'failed' }));\n throw e;\n }\n if (result === null || result === void 0 ? void 0 : result.id) {\n this._context.batch(() => {\n if (!result) {\n return;\n }\n this._context.setChatMessage(chatThreadClient.threadId, Object.assign(Object.assign({}, newMessage), { clientMessageId: undefined, status: 'delivered', id: result.id }));\n this._context.deleteLocalMessage(chatThreadClient.threadId, clientMessageId);\n });\n }\n return result;\n }), 'ChatThreadClient.sendMessage');\n }\n case 'addParticipants':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const result = yield chatThreadClient.addParticipants(...args);\n const [addRequest] = args;\n const participantsToAdd = addRequest.participants;\n this._context.setParticipants(chatThreadClient.threadId, participantsToAdd);\n return result;\n }), 'ChatThreadClient.addParticipants');\n }\n case 'deleteMessage':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n // DeleteMessage is able to either delete local one(for failed message) or synced message\n const [messageId] = args;\n if (this._context.deleteLocalMessage(chatThreadClient.threadId, messageId)) {\n return {};\n }\n const result = yield chatThreadClient.deleteMessage(...args);\n this._context.deleteMessage(chatThreadClient.threadId, messageId);\n return result;\n }), 'ChatThreadClient.deleteMessage');\n }\n case 'listParticipants':\n {\n return createDecoratedListParticipants(chatThreadClient, this._context);\n }\n case 'listReadReceipts':\n {\n return createDecoratedListReadReceipts(chatThreadClient, this._context);\n }\n case 'sendTypingNotification':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n return yield chatThreadClient.sendTypingNotification(...args);\n }), 'ChatThreadClient.sendTypingNotification');\n }\n case 'removeParticipant':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const result = yield chatThreadClient.removeParticipant(...args);\n const [removeIdentifier] = args;\n this._context.deleteParticipant(chatThreadClient.threadId, getIdentifierKind(removeIdentifier));\n return result;\n }), 'ChatThreadClient.removeParticipant');\n }\n case 'updateMessage':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const result = yield chatThreadClient.updateMessage(...args);\n const [messageId, updateOption] = args;\n this._context.updateChatMessageContent(chatThreadClient.threadId, messageId, updateOption === null || updateOption === void 0 ? void 0 : updateOption.content);\n return result;\n }), 'ChatThreadClient.updateMessage');\n }\n case 'updateTopic':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const result = yield chatThreadClient.updateTopic(...args);\n const [topic] = args;\n this._context.updateThreadTopic(chatThreadClient.threadId, topic);\n return result;\n }), 'ChatThreadClient.updateTopic');\n }\n case 'getProperties':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const result = yield chatThreadClient.getProperties(...args);\n this._context.updateThread(chatThreadClient.threadId, result);\n return result;\n }), 'ChatThreadClient.getProperties');\n }\n default:\n return Reflect.get(chatThreadClient, prop);\n }\n }\n}\n/**\n * @private\n */\nexport const chatThreadClientDeclaratify = (chatThreadClient, context) => {\n context.createThreadIfNotExist(chatThreadClient.threadId);\n return new Proxy(chatThreadClient, new ProxyChatThreadClient(context));\n};\n//# sourceMappingURL=StatefulChatThreadClient.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { convertChatMessage } from '../convertChatMessage';\nimport { createDecoratedIterator, createErrorHandlingIterator } from './createDecoratedIterator';\n/**\n * @private\n */\nexport const createDecoratedListMessages = (chatThreadClient, context) => {\n const setMessage = (message, context) => {\n context.setChatMessage(chatThreadClient.threadId, convertChatMessage(message));\n };\n return createDecoratedIterator(createErrorHandlingIterator(context.withErrorTeedToState(chatThreadClient.listMessages.bind(chatThreadClient), 'ChatThreadClient.listMessages'), context, 'ChatThreadClient.listMessages'), context, setMessage);\n};\n//# sourceMappingURL=createDecoratedListMessages.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createDecoratedIterator, createErrorHandlingIterator } from './createDecoratedIterator';\n/**\n * @private\n */\nexport const createDecoratedListParticipants = (chatThreadClient, context) => {\n const setParticipant = (participant, context) => {\n context.setParticipant(chatThreadClient.threadId, participant);\n };\n return createDecoratedIterator(createErrorHandlingIterator(context.withErrorTeedToState(chatThreadClient.listParticipants.bind(chatThreadClient), 'ChatThreadClient.listParticipants'), context, 'ChatThreadClient.listParticipants'), context, setParticipant);\n};\n//# sourceMappingURL=createDecoratedListParticipants.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createDecoratedIterator, createErrorHandlingIterator } from './createDecoratedIterator';\n/**\n * @private\n */\nexport const createDecoratedListReadReceipts = (chatThreadClient, context) => {\n const setReadReceipt = (readReceipt, context) => {\n context.addReadReceipt(chatThreadClient.threadId, Object.assign({}, readReceipt));\n };\n return createDecoratedIterator(createErrorHandlingIterator(context.withErrorTeedToState(chatThreadClient.listReadReceipts.bind(chatThreadClient), 'ChatThreadClient.listReadReceipts'), context, 'ChatThreadClient.listReadReceipts'), context, setReadReceipt);\n};\n//# sourceMappingURL=createDecoratedListReadReceipts.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ChatClient } from '@azure/communication-chat';\nimport { _getApplicationId } from \"../../acs-ui-common/src\";\nimport { ChatContext } from './ChatContext';\nimport { EventSubscriber } from './EventSubscriber';\nimport { chatThreadClientDeclaratify } from './StatefulChatThreadClient';\nimport { createDecoratedListThreads } from './iterators/createDecoratedListThreads';\nimport { getIdentifierKind } from '@azure/communication-common';\nimport { chatStatefulLogger } from './Logger';\nconst proxyChatClient = {\n get: function (chatClient, prop, receiver) {\n // skip receiver.context call to avoid recursive bugs\n if (prop === 'context') {\n return Reflect.get(chatClient, prop);\n }\n const context = receiver.context;\n switch (prop) {\n case 'createChatThread':\n {\n return context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield chatClient.createChatThread(...args);\n const thread = result.chatThread;\n if (thread) {\n const [request] = args;\n context.createThread(thread.id, {\n topic: request.topic\n });\n }\n return result;\n });\n }, 'ChatClient.createChatThread');\n }\n case 'deleteChatThread':\n {\n return context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = yield chatClient.deleteChatThread(...args);\n context.deleteThread(args[0]);\n return result;\n });\n }, 'ChatClient.deleteChatThread');\n }\n case 'listChatThreads':\n {\n return createDecoratedListThreads(chatClient, context);\n }\n case 'getChatThreadClient':\n {\n return function (...args) {\n const chatThreadClient = chatClient.getChatThreadClient(...args);\n // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.\n // A new thread might be created here, but the properties will never be fetched.\n return chatThreadClientDeclaratify(chatThreadClient, context);\n };\n }\n case 'startRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n const ret = yield chatClient.startRealtimeNotifications(...args);\n if (!receiver.eventSubscriber) {\n receiver.eventSubscriber = new EventSubscriber(chatClient, context);\n }\n return ret;\n });\n }, 'ChatClient.startRealtimeNotifications');\n }\n case 'stopRealtimeNotifications':\n {\n return context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n const ret = yield chatClient.stopRealtimeNotifications(...args);\n if (receiver.eventSubscriber) {\n receiver.eventSubscriber.unsubscribe();\n receiver.eventSubscriber = undefined;\n }\n return ret;\n });\n }, 'ChatClient.stopRealtimeNotifications');\n }\n default:\n return Reflect.get(chatClient, prop);\n }\n }\n};\n/**\n * Creates a stateful ChatClient {@link StatefulChatClient} by proxying ChatClient\n * {@link @azure/communication-chat#ChatClient} with ProxyChatClient {@link ProxyChatClient} which then allows access\n * to state in a declarative way.\n *\n * @public\n */\nexport const createStatefulChatClient = (args, options) => {\n return _createStatefulChatClientInner(args, options);\n};\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulChatClientInner = (args, options, telemetryImplementationHint = 'StatefulComponents') => {\n chatStatefulLogger.info(`Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);\n const tweakedOptions = Object.assign(Object.assign({}, options), { chatClientOptions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.chatClientOptions), { userAgentOptions: {\n userAgentPrefix: _getApplicationId(telemetryImplementationHint)\n } }) });\n return _createStatefulChatClientWithDeps(new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions), args, tweakedOptions);\n};\n/**\n * Internal implementation of {@link createStatefulChatClient} for dependency injection.\n *\n * Used by tests. Should not be exported out of this package.\n * @internal\n */\nexport const _createStatefulChatClientWithDeps = (chatClient, args, options) => {\n const context = new ChatContext(options === null || options === void 0 ? void 0 : options.maxStateChangeListeners, args.credential, args.endpoint);\n let eventSubscriber;\n context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);\n const proxy = new Proxy(chatClient, proxyChatClient);\n Object.defineProperty(proxy, 'context', {\n configurable: false,\n get: () => context\n });\n Object.defineProperty(proxy, 'eventSubscriber', {\n configurable: false,\n get: () => eventSubscriber,\n set: (val) => {\n eventSubscriber = val;\n }\n });\n Object.defineProperty(proxy, 'dispose', {\n configurable: false,\n value: () => context === null || context === void 0 ? void 0 : context.dispose()\n });\n Object.defineProperty(proxy, 'downloadResourceToCache', {\n configurable: false,\n value: (threadId, messageId, resourceUrl) => context === null || context === void 0 ? void 0 : context.downloadResourceToCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'removeResourceFromCache', {\n configurable: false,\n value: (threadId, messageId, resourceUrl) => context === null || context === void 0 ? void 0 : context.removeResourceFromCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'getState', {\n configurable: false,\n value: () => context === null || context === void 0 ? void 0 : context.getState()\n });\n Object.defineProperty(proxy, 'onStateChange', {\n configurable: false,\n value: (handler) => context === null || context === void 0 ? void 0 : context.onStateChange(handler)\n });\n Object.defineProperty(proxy, 'offStateChange', {\n configurable: false,\n value: (handler) => context === null || context === void 0 ? void 0 : context.offStateChange(handler)\n });\n return proxy;\n};\n//# sourceMappingURL=StatefulChatClient.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createDecoratedIterator, createErrorHandlingIterator } from './createDecoratedIterator';\n/**\n * @private\n */\nexport const createDecoratedListThreads = (chatClient, context) => {\n const setThreadProperties = (chatThreadItem, context) => {\n const properties = {\n topic: chatThreadItem.topic\n };\n if (!context.createThreadIfNotExist(chatThreadItem.id, properties)) {\n context.updateThread(chatThreadItem.id, properties);\n }\n };\n return createDecoratedIterator(createErrorHandlingIterator(context.withErrorTeedToState(chatClient.listChatThreads.bind(chatClient), 'ChatClient.listChatThreads'), context, 'ChatClient.listChatThreads'), context, setThreadProperties);\n};\n//# sourceMappingURL=createDecoratedListThreads.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/**\n * @private\n */\nexport const getUserId = (state) => toFlatCommunicationIdentifier(state.userId);\n/**\n * @private\n */\nexport const getDisplayName = (state) => state.displayName;\n/**\n * @private\n */\nexport const getChatMessages = (state, props) => { var _a; return props.threadId && ((_a = state.threads[props.threadId]) === null || _a === void 0 ? void 0 : _a.chatMessages) || {}; };\n/**\n * @private\n */\nexport const getParticipants = (state, props) => { var _a; return props.threadId && ((_a = state.threads[props.threadId]) === null || _a === void 0 ? void 0 : _a.participants) || {}; };\n/**\n * @private\n */\nexport const getReadReceipts = (state, props) => {\n var _a;\n return (_a = state.threads[props === null || props === void 0 ? void 0 : props.threadId]) === null || _a === void 0 ? void 0 : _a.readReceipts;\n};\n/**\n * @private\n */\nexport const getIsLargeGroup = (state, props) => {\n var _a;\n const participants = (_a = state.threads[props.threadId]) === null || _a === void 0 ? void 0 : _a.participants;\n return !!participants && Object.values(participants).length > 20;\n};\n/**\n * @private\n */\nexport const getLatestReadTime = (state, props) => { var _a; return props.threadId && ((_a = state.threads[props.threadId]) === null || _a === void 0 ? void 0 : _a.latestReadTime) || new Date(0); };\n/**\n * @private\n */\nexport const getTypingIndicators = (state, props) => {\n var _a;\n return props.threadId && ((_a = state.threads[props.threadId]) === null || _a === void 0 ? void 0 : _a.typingIndicators) || [];\n};\n/**\n * @private\n */\nexport const getLatestErrors = (state) => state.latestErrors;\n//# sourceMappingURL=baseSelectors.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createSelector } from 'reselect';\nimport { getDisplayName, getUserId } from './baseSelectors';\n/**\n * Selector for {@link SendBox} component.\n *\n * @public\n */\nexport const sendBoxSelector = createSelector([getUserId, getDisplayName], (userId, displayName) => ({\n displayName: displayName,\n userId: userId\n}));\n//# sourceMappingURL=sendBoxSelector.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport const MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS = 8000;\n/**\n * @private\n */\nexport const PARTICIPANTS_THRESHOLD = 20;\n/**\n * @private\n */\nexport const MINUTE_IN_MS = 1000 * 60;\n/**\n * @private\n */\nexport const DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL = 'https://go.microsoft.com/fwlink/?LinkId=2132837';\n/**\n * @private\n *\n * TODO: Import enum from @azure/communication-chat when ChatMessageType shows up in new release version\n * (or define our type to decouple)\n */\nexport const ACSKnownMessageType = {\n text: 'text',\n html: 'html',\n richtextHtml: 'richtext/html',\n topicUpdated: 'topicUpdated',\n participantAdded: 'participantAdded',\n participantRemoved: 'participantRemoved'\n};\n//# sourceMappingURL=constants.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport const compareMessages = (firstMessage, secondMessage) => {\n const firstDate = new Date(firstMessage.createdOn).getTime();\n const secondDate = new Date(secondMessage.createdOn).getTime();\n // Workaround to get a stable order of message before we can get sequenceId from chat service.\n // MessageIds are generated by time order the message persist, a good candidate other than time\n const idDelta = firstMessage.messageId && secondMessage.messageId ? Number.parseInt(firstMessage.messageId) - Number.parseInt(secondMessage.messageId) : 0;\n return firstDate - secondDate === 0 ? idDelta : firstDate - secondDate;\n};\n//# sourceMappingURL=compareMessages.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { getChatMessages, getIsLargeGroup, getLatestReadTime, getParticipants, getReadReceipts, getUserId } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { memoizeFnAll } from \"../../acs-ui-common/src\";\nimport { createSelector } from 'reselect';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\nconst memoizedAllConvertChatMessage = memoizeFnAll((_key, chatMessage, userId, isSeen, isLargeGroup) => {\n const messageType = chatMessage.type.toLowerCase();\n if (messageType === ACSKnownMessageType.text || messageType === ACSKnownMessageType.richtextHtml || messageType === ACSKnownMessageType.html) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n }\n else {\n return convertToUiSystemMessage(chatMessage);\n }\n});\nconst extractAttachmentMetadata = (metadata) => {\n const attachmentMetadata = metadata.fileSharingMetadata;\n if (!attachmentMetadata) {\n return [];\n }\n try {\n return JSON.parse(attachmentMetadata);\n }\n catch (e) {\n console.error(e);\n return [];\n }\n};\nconst extractTeamsAttachmentsMetadata = (rawAttachments) => {\n const attachments = [];\n rawAttachments.forEach(rawAttachment => {\n var _a;\n const attachmentType = rawAttachment.attachmentType;\n if (attachmentType === 'file') {\n attachments.push({\n id: rawAttachment.id,\n name: (_a = rawAttachment.name) !== null && _a !== void 0 ? _a : '',\n url: extractAttachmentUrl(rawAttachment)\n });\n }\n });\n return {\n attachments\n };\n};\nconst extractAttachmentUrl = (attachment) => {\n return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';\n};\nconst processChatMessageContent = (message) => {\n var _a, _b, _c, _d;\n let content = (_a = message.content) === null || _a === void 0 ? void 0 : _a.message;\n if (((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments) && ((_c = message.content) === null || _c === void 0 ? void 0 : _c.attachments.length) > 0 && sanitizedMessageContentType(message.type).includes('html')) {\n const attachments = (_d = message.content) === null || _d === void 0 ? void 0 : _d.attachments;\n // Fill in the src here\n if (content) {\n const document = new DOMParser().parseFromString(content !== null && content !== void 0 ? content : '', 'text/html');\n document.querySelectorAll('img').forEach(img => {\n var _a, _b, _c;\n const attachmentPreviewUrl = (_a = attachments.find(attachment => attachment.id === img.id)) === null || _a === void 0 ? void 0 : _a.previewUrl;\n if (attachmentPreviewUrl) {\n const resourceCache = (_b = message.resourceCache) === null || _b === void 0 ? void 0 : _b[attachmentPreviewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n const brokenImageView = getBrokenImageViewNode(img);\n (_c = img.parentElement) === null || _c === void 0 ? void 0 : _c.replaceChild(brokenImageView, img);\n }\n else {\n // else in loading or success state\n img.setAttribute('src', src);\n }\n setImageWidthAndHeight(img);\n }\n });\n content = document.body.innerHTML;\n }\n const teamsImageHtmlContent = attachments.filter(attachment => { var _a, _b; return attachment.attachmentType === 'image' && attachment.previewUrl !== undefined && !((_b = (_a = message.content) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.includes(attachment.id)); }).map(attachment => generateImageAttachmentImgHtml(message, attachment)).join('');\n if (teamsImageHtmlContent) {\n return (content !== null && content !== void 0 ? content : '') + teamsImageHtmlContent;\n }\n }\n return content;\n};\nconst generateImageAttachmentImgHtml = (message, attachment) => {\n var _a;\n if (attachment.previewUrl !== undefined) {\n const contentType = extractAttachmentContentTypeFromName(attachment.name);\n const resourceCache = (_a = message.resourceCache) === null || _a === void 0 ? void 0 : _a[attachment.previewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n return `\\r\\n

${getBrokenImageViewNode().outerHTML}

`;\n }\n // else in loading or success state\n return `\\r\\n

\"image\"

`;\n }\n return '';\n};\nconst getResourceSourceUrl = (result) => {\n if (result) {\n if (!result.error && result.sourceUrl) {\n // return sourceUrl for success state\n return result.sourceUrl;\n }\n else {\n // return undefined for error state\n return undefined;\n }\n }\n // return empty string for loading state\n return '';\n};\nconst extractAttachmentContentTypeFromName = (name) => {\n if (name === undefined) {\n return '';\n }\n const indexOfLastDot = name.lastIndexOf('.');\n if (indexOfLastDot === undefined || indexOfLastDot < 0) {\n return '';\n }\n const contentType = name.substring(indexOfLastDot + 1);\n return contentType;\n};\nconst setImageWidthAndHeight = (img) => {\n if (img) {\n // define aspect ratio explicitly to prevent image not being displayed correctly\n // in safari, this includes image placeholder for loading state\n const width = img.width;\n const height = img.height;\n img.style.aspectRatio = `${width}/${height}`;\n }\n};\nconst extractAttachmentsMetadata = (message) => {\n var _a, _b;\n let attachments = [];\n if (message.metadata) {\n attachments = attachments.concat(extractAttachmentMetadata(message.metadata));\n }\n if ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments) {\n const teamsAttachments = extractTeamsAttachmentsMetadata((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments);\n attachments = attachments.concat(teamsAttachments.attachments);\n }\n return {\n attachments: attachments.length > 0 ? attachments : undefined\n };\n};\nconst convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const { attachments } = extractAttachmentsMetadata(message);\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: processChatMessageContent(message),\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n attachments\n };\n};\nconst convertToUiSystemMessage = (message) => {\n var _a, _b, _c, _d, _e;\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants: (_c = (_b = (_a = message.content) === null || _a === void 0 ? void 0 : _a.participants) === null || _b === void 0 ? void 0 : _b.filter((participant) => participant.displayName && participant.displayName !== '').map((participant) => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n }))) !== null && _c !== void 0 ? _c : [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n }\n else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: (_e = (_d = message.content) === null || _d === void 0 ? void 0 : _d.topic) !== null && _e !== void 0 ? _e : '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage) => { var _a; return !!((_a = chatMessage.content) === null || _a === void 0 ? void 0 : _a.participants) && chatMessage.content.participants.some((p) => !!p.displayName); };\n/**\n *\n * @private\n */\nexport const messageThreadSelectorWithThread = () => createSelector([getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants], (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts = [], participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find(p => 'microsoftTeamsUserId' in p.id) !== undefined;\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop ? undefined : Object.values(participants).filter(p => p.displayName && p.displayName !== '').length;\n // creating key value pairs of senderID: last read message information\n const readReceiptsBySenderId = {};\n // readReceiptsBySenderId[senderID] gets updated every time a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts.filter(r => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId).forEach(r => {\n var _a, _b;\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: (_b = (_a = participants[toFlatCommunicationIdentifier(r.sender)]) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : ''\n };\n });\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage(memoizedFn => Object.values(chatMessages).filter(message => message.type.toLowerCase() === ACSKnownMessageType.text || message.type.toLowerCase() === ACSKnownMessageType.richtextHtml || message.type.toLowerCase() === ACSKnownMessageType.html || message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message) || message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined).filter(isMessageValidToRender).map(message => {\n var _a;\n return memoizedFn((_a = message.id) !== null && _a !== void 0 ? _a : message.clientMessageId, message, userId, message.createdOn <= latestReadTime, isLargeGroup);\n }));\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n});\nconst sanitizedMessageContentType = (type) => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html' ? lowerCaseType : 'unknown';\n};\nconst getBrokenImageViewNode = (img) => {\n var _a;\n const wrapper = document.createElement('div');\n Array.from((_a = img === null || img === void 0 ? void 0 : img.attributes) !== null && _a !== void 0 ? _a : []).forEach(attr => {\n var _a;\n wrapper.setAttribute(attr.nodeName, (_a = attr.nodeValue) !== null && _a !== void 0 ? _a : '');\n });\n wrapper.setAttribute('class', 'broken-image-wrapper');\n wrapper.setAttribute('data-ui-id', 'broken-image-icon');\n return wrapper;\n};\nconst isMessageValidToRender = (message) => {\n var _a, _b, _c, _d;\n if (message.deletedOn) {\n return false;\n }\n if (((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.fileSharingMetadata) || ((_c = (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments) === null || _c === void 0 ? void 0 : _c.length)) {\n return true;\n }\n return !!(message.content && ((_d = message.content) === null || _d === void 0 ? void 0 : _d.message) !== '');\n};\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector = messageThreadSelectorWithThread();\n//# sourceMappingURL=messageThreadSelector.js.map","import { compareMessages } from './compareMessages';\nimport { MINUTE_IN_MS } from './constants';\n/**\n * @private\n */\nexport const updateMessagesWithAttached = (chatMessagesWithStatus) => {\n chatMessagesWithStatus.sort(compareMessages);\n chatMessagesWithStatus.forEach((message, index, messages) => {\n var _a, _b;\n if (message.messageType === 'chat') {\n /**\n * Attached === true means it is within a group of messages in the current order\n * Attached === top/bottom means it is on the top/bottom boundary\n * Attached === false means it is just a single message\n * A group of messages: continuous messages that belong to the same sender and not intercepted by other senders.\n */\n let attached = false;\n const previousMessage = index > 0 ? messages[index - 1] : undefined;\n const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];\n const previousSenderId = (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.messageType) === 'chat' ? previousMessage.senderId : undefined;\n const nextSenderId = (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.messageType) === 'chat' ? nextMessage.senderId : undefined;\n const timediff = new Date((_a = message === null || message === void 0 ? void 0 : message.createdOn) !== null && _a !== void 0 ? _a : '').getTime() - new Date((_b = previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.createdOn) !== null && _b !== void 0 ? _b : '').getTime();\n const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes\n if (previousSenderId !== message.senderId) {\n attached = message.senderId === nextSenderId ? 'top' : false;\n }\n else if (diffMins && diffMins >= 5) {\n // if there are more than or equal to 5 mins time gap between messages do not attach and show time stamp\n attached = false;\n }\n else {\n attached = message.senderId === nextSenderId ? true : 'bottom';\n }\n message.attached = attached;\n }\n });\n};\n//# sourceMappingURL=updateMessagesWithAttached.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { getTypingIndicators, getParticipants, getUserId } from './baseSelectors';\nimport { createSelector } from 'reselect';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS, PARTICIPANTS_THRESHOLD } from './utils/constants';\nconst filterTypingIndicators = (typingIndicators, userId) => {\n const filteredTypingIndicators = [];\n const seen = new Set();\n const date8SecondsAgo = new Date(Date.now() - MINIMUM_TYPING_INTERVAL_IN_MILLISECONDS);\n const reversedTypingIndicators = typingIndicators.toReversed();\n for (const typingIndicator of reversedTypingIndicators) {\n if (toFlatCommunicationIdentifier(typingIndicator.sender) === userId) {\n continue;\n }\n if (typingIndicator.receivedOn < date8SecondsAgo) {\n continue;\n }\n if (seen.has(toFlatCommunicationIdentifier(typingIndicator.sender))) {\n continue;\n }\n seen.add(toFlatCommunicationIdentifier(typingIndicator.sender));\n filteredTypingIndicators.push(typingIndicator);\n }\n return filteredTypingIndicators;\n};\nconst convertSdkTypingIndicatorsToCommunicationParticipants = (typingIndicators, participants) => {\n return typingIndicators.map(typingIndicator => {\n var _a;\n return ({\n userId: toFlatCommunicationIdentifier(typingIndicator.sender),\n displayName: (_a = participants[toFlatCommunicationIdentifier(typingIndicator.sender)]) === null || _a === void 0 ? void 0 : _a.displayName\n });\n });\n};\n/**\n * Selector for {@link TypingIndicator} component.\n *\n * @public\n */\nexport const typingIndicatorSelector = createSelector([getTypingIndicators, getParticipants, getUserId], (typingIndicators, participants, userId) => {\n // if the participant size reaches the threshold then return no typing users\n if (Object.values(participants).length >= PARTICIPANTS_THRESHOLD) {\n return {\n typingUsers: []\n };\n }\n // filter typing indicators to remove those that are from the duplicate users or current user as well as those older than a threshold\n const filteredTypingIndicators = filterTypingIndicators(typingIndicators, userId);\n const typingUsers = convertSdkTypingIndicatorsToCommunicationParticipants(filteredTypingIndicators, participants);\n return {\n typingUsers\n };\n});\n//# sourceMappingURL=typingIndicatorSelector.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { getUserId, getDisplayName, getParticipants } from './baseSelectors';\nimport * as reselect from 'reselect';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { getIdentifierKind } from '@azure/communication-common';\nconst convertChatParticipantsToCommunicationParticipants = (chatParticipants) => {\n return chatParticipants.map((participant) => {\n return {\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName,\n // ACS users can not remove Teams users.\n // Removing phone numbers or unknown types of users is undefined.\n isRemovable: getIdentifierKind(participant.id).kind === 'communicationUser'\n };\n });\n};\n/**\n * get the moderator to help updating its display name if they are the local user or removing them from list of participants otherwise\n */\nconst getModerator = (participants) => {\n return participants.find(p => p.displayName === undefined);\n};\n/**\n * Selector for {@link ParticipantList} component.\n *\n * @public\n */\nexport const chatParticipantListSelector = reselect.createSelector([getUserId, getParticipants, getDisplayName], (userId, chatParticipants, displayName) => {\n let participants = convertChatParticipantsToCommunicationParticipants(Object.values(chatParticipants));\n // Update the moderator display name if they are the local user, otherwise remove them from list of participants\n const moderator = getModerator(participants);\n if ((moderator === null || moderator === void 0 ? void 0 : moderator.userId) === userId) {\n moderator.displayName = displayName;\n }\n else {\n participants = participants.filter(p => p.displayName);\n }\n return {\n myUserId: userId,\n participants: participants\n };\n});\n//# sourceMappingURL=chatParticipantListSelector.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { getLatestErrors } from './baseSelectors';\nimport { createSelector } from 'reselect';\n/**\n * Select the first fiew active errors from the state for the {@link ErrorBar} component.\n *\n * In case there are many errors, only a few top errors are returned to avoid\n * filling up the UI with too many errors.\n *\n * Invariants:\n * - {@link ErrorType} is never repeated in the returned errors.\n * - Errors are returned in a fixed order by {@link ErrorType}.\n *\n * @public\n */\nexport const errorBarSelector = createSelector([getLatestErrors], (latestErrors) => {\n var _a;\n // The order in which the errors are returned is significant: The `ErrorBar` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages = [];\n let specificSendMessageErrorSeen = false;\n {\n const error = latestUnableToReachChatServiceError(latestErrors);\n if (error !== undefined) {\n activeErrorMessages.push(error);\n }\n }\n {\n const error = latestAccessDeniedError(latestErrors);\n if (error !== undefined) {\n activeErrorMessages.push(error);\n }\n }\n const sendMessageError = latestErrors['ChatThreadClient.sendMessage'];\n {\n const error = latestNotInThisThreadError(latestErrors);\n if (error !== undefined) {\n if (sendMessageError !== undefined) {\n activeErrorMessages.push({\n type: 'sendMessageNotInChatThread',\n // Set the latest timestamp of all the errors that translated to an active error.\n timestamp: sendMessageError.timestamp > ((_a = error.timestamp) !== null && _a !== void 0 ? _a : 0) ? sendMessageError.timestamp : error.timestamp\n });\n specificSendMessageErrorSeen = true;\n }\n else {\n activeErrorMessages.push(error);\n }\n }\n }\n if (!specificSendMessageErrorSeen && sendMessageError !== undefined) {\n activeErrorMessages.push({\n type: 'sendMessageGeneric',\n timestamp: sendMessageError.timestamp\n });\n }\n // We only return the first few errors to avoid filling up the UI with too many `MessageBar`s.\n activeErrorMessages.splice(maxErrorCount);\n return {\n activeErrorMessages: activeErrorMessages\n };\n});\nconst maxErrorCount = 3;\nconst accessErrorTargets = ['ChatThreadClient.getProperties', 'ChatThreadClient.listMessages', 'ChatThreadClient.listParticipants', 'ChatThreadClient.sendMessage', 'ChatThreadClient.sendTypingNotification'];\nconst latestUnableToReachChatServiceError = (latestErrors) => {\n return latestActiveErrorSatisfying(latestErrors, 'unableToReachChatService', (error) => {\n return !!error && !!error.innerError && 'code' in error.innerError && error.innerError.code === 'REQUEST_SEND_ERROR';\n });\n};\nconst latestAccessDeniedError = (latestErrors) => {\n return latestActiveErrorSatisfying(latestErrors, 'accessDenied', (error) => {\n return !!error && !!error.innerError && 'statusCode' in error.innerError && error.innerError.statusCode === 401;\n });\n};\nconst latestNotInThisThreadError = (latestErrors) => {\n return latestActiveErrorSatisfying(latestErrors, 'userNotInChatThread', (error) => {\n if (!error || !error.innerError) {\n return false;\n }\n // Explicitly ignore 400 REST error when listParticipants() is called and a BotContact MRI is found in the participants.\n // This check should be removed when the chat SDK has handled this issue. Note: The this does not stop the error being logged to the console.\n // To the best of our ability we have confirmed this to have no impact on the participantList returned (all valid participants are still returned), nor\n // does it have an impact on the participant list updating on other participants joining/leaving or on individual participant actions like removeParticipant.\n if (isErrorDueToBotContact(error)) {\n return false;\n }\n // Chat service returns 403 if a user has been removed from a thread.\n // Chat service returns either 400 or 404 if the thread ID is malformed, depending on how the thread ID is malformed.\n return [400, 403, 404].some(statusCode => 'statusCode' in error.innerError && error.innerError.statusCode === statusCode);\n });\n};\nconst botContactMRIPrefix = '28:';\nconst isErrorDueToBotContact = (error) => 'statusCode' in error.innerError && error.innerError.statusCode === 400 && error.innerError.message.includes(`Identifier format is not supported (${botContactMRIPrefix}`);\nconst latestActiveErrorSatisfying = (errors, activeErrorType, predicate) => {\n const activeErrorMessages = [];\n for (const target of accessErrorTargets) {\n const error = errors[target];\n if (predicate(error)) {\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: error.timestamp\n });\n }\n }\n if (activeErrorMessages.length === 0) {\n return undefined;\n }\n // We're actually sure that both timestamps will always exist, because we set them above.\n activeErrorMessages.sort((a, b) => { var _a, _b, _c, _d; return ((_b = (_a = a.timestamp) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) - ((_d = (_c = b.timestamp) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0); });\n return activeErrorMessages[activeErrorMessages.length - 1];\n};\n//# sourceMappingURL=errorBarSelector.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from \"../../../react-components/src\";\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { sendBoxSelector } from '../sendBoxSelector';\nimport { messageThreadSelectorWithThread } from '../messageThreadSelector';\nimport { typingIndicatorSelector } from '../typingIndicatorSelector';\nimport { chatParticipantListSelector } from '../chatParticipantListSelector';\nimport { errorBarSelector } from '../errorBarSelector';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n/**\n * Primary hook to get all hooks necessary for a chat Component.\n *\n * Most straightforward usage of chat components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = (component) => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers(component);\n if (props !== undefined) {\n return Object.assign(Object.assign({}, props), handlers);\n }\n return undefined;\n};\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const getSelector = (component) => {\n return findSelector(component);\n};\nconst messageThreadSelectorsByThread = {};\nconst findSelector = (component) => {\n // For the message thread selector we need to create a new one for each thread\n // If we have just one for the entire app, then we will have updates when not expecting due to\n // the arguments changing\n const getMessageThreadSelector = () => {\n var _a, _b;\n const threadId = (_b = (_a = useContext(ChatThreadClientContext)) === null || _a === void 0 ? void 0 : _a.threadId) !== null && _b !== void 0 ? _b : 'default-id-when-not-in-provider';\n let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n if (!messageThreadSelectorImpl) {\n messageThreadSelectorImpl = messageThreadSelectorWithThread();\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorImpl;\n }\n return messageThreadSelectorImpl;\n };\n switch (component) {\n case SendBox:\n return sendBoxSelector;\n case MessageThread:\n return getMessageThreadSelector();\n case TypingIndicator:\n return typingIndicatorSelector;\n case ParticipantList:\n return chatParticipantListSelector;\n case ErrorBar:\n return errorBarSelector;\n }\n return undefined;\n};\n//# sourceMappingURL=usePropsFor.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { fromFlatCommunicationIdentifier } from \"../../../acs-ui-common/src\";\nimport memoizeOne from 'memoize-one';\n/**\n * Create the default implementation of {@link ChatHandlers}.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * Returned object is memoized to avoid rerenders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClient) => {\n let messageIterator = undefined;\n let readReceiptIterator = undefined;\n return {\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onSendMessage: function (content, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const sendMessageRequest = {\n content,\n senderDisplayName: chatClient.getState().displayName\n };\n yield chatThreadClient.sendMessage(sendMessageRequest, options);\n });\n },\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onUpdateMessage: function (messageId, content) {\n return __awaiter(this, void 0, void 0, function* () {\n const updateMessageOptions = {\n content\n };\n yield chatThreadClient.updateMessage(messageId, updateMessageOptions);\n });\n },\n onDeleteMessage: (messageId) => __awaiter(void 0, void 0, void 0, function* () {\n yield chatThreadClient.deleteMessage(messageId);\n }),\n // This handler is designed for chatThread to consume\n onMessageSeen: (chatMessageId) => __awaiter(void 0, void 0, void 0, function* () {\n yield chatThreadClient.sendReadReceipt({\n chatMessageId\n });\n }),\n onTyping: () => __awaiter(void 0, void 0, void 0, function* () {\n yield chatThreadClient.sendTypingNotification();\n }),\n onRemoveParticipant: (userId) => __awaiter(void 0, void 0, void 0, function* () {\n yield chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));\n }),\n updateThreadTopicName: (topicName) => __awaiter(void 0, void 0, void 0, function* () {\n yield chatThreadClient.updateTopic(topicName);\n }),\n onLoadPreviousChatMessages: (messagesToLoad) => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c;\n if (messageIterator === undefined) {\n // Lazy definition so that errors in the method call are reported correctly.\n // Also allows recovery via retries in case of transient errors.\n messageIterator = chatThreadClient.listMessages({\n maxPageSize: 50\n });\n }\n if (readReceiptIterator === undefined) {\n readReceiptIterator = chatThreadClient.listReadReceipts();\n }\n // get the earliest message time\n let remainingMessagesToGet = messagesToLoad;\n let isAllChatMessagesLoaded = false;\n let earliestTime = Number.MAX_SAFE_INTEGER;\n while (remainingMessagesToGet >= 1) {\n const message = yield messageIterator.next();\n if ((_a = message === null || message === void 0 ? void 0 : message.value) === null || _a === void 0 ? void 0 : _a.id) {\n if (parseInt(message.value.id) < earliestTime) {\n earliestTime = parseInt(message.value.id);\n }\n }\n if (((_b = message.value) === null || _b === void 0 ? void 0 : _b.type) && message.value.type === 'text') {\n remainingMessagesToGet--;\n }\n // We have traversed all messages in this thread\n if (message.done) {\n isAllChatMessagesLoaded = true;\n break;\n }\n }\n // keep fetching read receipts until read receipt time < earlist message time\n let readReceipt = yield readReceiptIterator.next();\n while (!readReceipt.done && parseInt((_c = readReceipt === null || readReceipt === void 0 ? void 0 : readReceipt.value) === null || _c === void 0 ? void 0 : _c.chatMessageId) >= earliestTime) {\n readReceipt = yield readReceiptIterator.next();\n }\n return isAllChatMessagesLoaded;\n })\n };\n});\n/**\n * Create a set of default handlers for given component.\n *\n * Returned object is memoized (with reference to the arguments) to avoid\n * renders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlersForComponent = (chatClient, chatThreadClient, _) => {\n return createDefaultChatHandlers(chatClient, chatThreadClient);\n};\n//# sourceMappingURL=createHandlers.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createDefaultChatHandlersForComponent } from '../handlers/createHandlers';\nimport { ChatClientContext } from '../providers/ChatClientProvider';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n/**\n * Hook to obtain a handler for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useHandlers = (component) => {\n const chatClient = useContext(ChatClientContext);\n const chatThreadClient = useContext(ChatThreadClientContext);\n if (!chatThreadClient || !chatClient) {\n return undefined;\n }\n return createDefaultChatHandlersForComponent(chatClient, chatThreadClient, component);\n};\n//# sourceMappingURL=useHandlers.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { getCallingSelector, useCallingHandlers, useCallingSelector } from \"../../calling-component-bindings/src\";\nimport { getChatSelector, useChatHandlers, useChatSelector } from \"../../chat-component-bindings/src\";\n/**\n * Hook to obtain a selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useSelector = (selector, selectorProps, type) => {\n // Because of react hooks rules, hooks can't be conditionally called\n // We call both call and chat hooks and detect current context\n // Return undefined and skip execution when not in that context\n const callingMode = !type || type === 'calling';\n const chatMode = !type || type === 'chat';\n const callProps = useCallingSelector(callingMode ? selector : undefined, selectorProps);\n const chatProps = useChatSelector(chatMode ? selector : undefined, selectorProps);\n return callProps !== null && callProps !== void 0 ? callProps : chatProps;\n};\n/**\n * Primary hook to get all hooks necessary for a React Component from this library.\n *\n * To call this hook, the component requires to be wrapped under these providers:\n *\n * 1. For chat components: {@link ChatClientProvider} and {@link ChatThreadClientProvider}.\n *\n * 2. For calling components: {@link CallClientProvider}, {@link CallAgentProvider} and {@link CallAgentProvider}.\n *\n * Most straightforward usage of a components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return \n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = (component, type) => {\n const callingSelector = type === 'calling' || !type ? getCallingSelector(component) : undefined;\n const chatSelector = type === 'chat' || !type ? getChatSelector(component) : undefined;\n const callProps = useCallingSelector(callingSelector);\n const chatProps = useChatSelector(chatSelector);\n const callingHandlers = useCallingHandlers(component);\n const chatHandlers = useChatHandlers(component);\n if (chatProps) {\n if (!chatHandlers) {\n throw 'Please initialize chatClient and chatThreadClient first!';\n }\n return Object.assign(Object.assign({}, chatProps), chatHandlers);\n }\n if (callProps) {\n if (!callingHandlers) {\n throw 'Please initialize callClient first!';\n }\n return Object.assign(Object.assign({}, callProps), callingHandlers);\n }\n if (!chatSelector && !callingSelector) {\n throw \"Can't find corresponding selector for this component. Please check the supported components from Azure Communication UI Feature Component List.\";\n }\n else {\n throw 'Could not find props for this component, ensure the component is wrapped by appropriate providers.';\n }\n};\n//# sourceMappingURL=mergedHooks.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ChatClientContext } from '../providers/ChatClientProvider';\nimport { useState, useEffect, useRef, useMemo, useContext } from 'react';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\n/**\n * Hook to obtain a selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useSelector = (selector, selectorProps) => {\n var _a;\n const chatClient = useContext(ChatClientContext);\n const threadId = (_a = useContext(ChatThreadClientContext)) === null || _a === void 0 ? void 0 : _a.threadId;\n // Keeps track of whether the current component is mounted or not. If it has unmounted, make sure we do not modify the\n // state or it will cause React warnings in the console. https://skype.visualstudio.com/SPOOL/_workitems/edit/2453212\n const mounted = useRef(false);\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n });\n const threadConfigProps = useMemo(() => ({\n threadId\n }), [threadId]);\n const [props, setProps] = useState(chatClient && selector ? selector(chatClient.getState(), selectorProps !== null && selectorProps !== void 0 ? selectorProps : threadConfigProps) : undefined);\n const propRef = useRef(props);\n propRef.current = props;\n useEffect(() => {\n if (!chatClient || !selector) {\n return;\n }\n const onStateChange = (state) => {\n const newProps = selector(state, selectorProps !== null && selectorProps !== void 0 ? selectorProps : threadConfigProps);\n if (propRef.current !== newProps) {\n setProps(newProps);\n }\n };\n chatClient.onStateChange(onStateChange);\n return () => {\n chatClient.offStateChange(onStateChange);\n };\n }, [chatClient, selector, selectorProps, threadConfigProps]);\n return selector ? props : undefined;\n};\n//# sourceMappingURL=useSelector.js.map"],"names":["ChatClientContext","createContext","undefined","ChatClientProvider","props","Provider","value","chatClient","children","ChatThreadClientContext","ChatThreadClientProvider","chatThreadClient","ChatError","Error","constructor","target","innerError","timestamp","super","this","Date","now","name","message","Constants","chatStatefulLogger","createClientLogger","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","apply","ResourceDownloadQueue","context","authentication","_messagesNeedingResourceRetrieval","isActive","_requestsToCancel","_context","_credential","credential","_endpoint","endpoint","containsMessageWithSameAttachments","_a","_b","_c","contains","incomingAttachment","content","attachments","m","existingAttachment","every","element","index","addMessage","copy","Object","assign","push","startQueue","threadId","operation","options","length","shift","singleUrl","downloadSingleUrl","downloadAllPreviewUrls","setChatMessage","cancelAllRequests","cancelation","values","abortController","abort","cancelRequest","url","resourceUrl","response","sourceUrl","AbortController","blobUrl","downloadResource","error","resourceCache","type","attachment","previewUrl","attachmentType","src","fetchImageSource","fetchUrl","URL","token","hostname","protocol","getToken","headers","Headers","append","resource","timeout","id","setTimeout","fetch","signal","clearTimeout","fetchWithTimeout","fetchWithAuthentication","status","blob","createObjectURL","ChatContext","maxListeners","_state","userId","displayName","threads","latestErrors","_batchMode","typingIndicatorInterval","_inlineImageQueue","_fullsizeImageQueue","_logger","_emitter","EventEmitter","setMaxListeners","getState","modifyState","modifier","priorState","patches","getLogLevel","info","emit","dispose","draft","forEach","thread","chatMessages","cache","revokeObjectURL","downloadResourceToCache","messageId","removeResourceFromCache","setThread","threadState","createThread","properties","participants","readReceipts","typingIndicators","latestReadTime","updateChatConfig","createThreadIfNotExist","prototype","hasOwnProperty","call","updateThread","updateThreadTopic","topic","deleteThread","setChatMessages","messages","filterTypingIndicatorForUser","sender","updateChatMessageContent","messagesId","chatMessage","deleteLocalMessage","localId","localMessageDeleted","clientMessageId","deleteMessage","setParticipant","participant","setParticipants","participantsMap","deleteParticipants","participantIds","deleteParticipant","participantId","addReadReceipt","readReceipt","readOn","startTypingIndicatorCleanUp","window","setInterval","isTypingActive","filteredTypingIndicators","filter","typingIndicator","receivedOn","getTime","clearInterval","addTypingIndicator","parseAttachments","threadMessages","isLocalIdInMap","messageKey","withAsyncErrorTeedToState","f","args","chatError","toChatError","setLatestError","withErrorTeedToState","userIdAsKey","batch","operations","warning","onStateChange","handler","on","offStateChange","off","convertChatMessage","__asyncValues","o","Symbol","asyncIterator","TypeError","i","__values","iterator","verb","n","v","d","settle","EventSubscriber","chatContext","convertEventToChatMessage","event","version","convertEventType","senderDisplayName","sequenceId","createdOn","editedOn","metadata","lowerCaseType","toLowerCase","onChatMessageReceived","messageEventType","newMessage","existingMessage","onChatMessageDeleted","onChatMessageEdited","editedMessage","onParticipantsAdded","participantsToAdd","participantsAdded","map","shareHistoryTime","fetchLastParticipantMessage","actionType","e_1","_f","_d","_e","getChatThreadClient","listMessages","startTime","e_1_1","return","onParticipantsRemoved","participantsRemoved","currentUserId","find","onReadReceiptReceived","onTypingIndicatorReceived","onChatThreadCreated","onChatThreadDeleted","onChatThreadPropertiesUpdated","subscribe","unsubscribe","createDecoratedIterator","iteratorCreator","decorateFn","threadsIterator","byPage","settings","pages","page","item","createErrorHandlingIterator","innerIter","bind","ProxyChatThreadClient","get","prop","createDecoratedListMessages","getMessage","request","sendMessage","addParticipants","addRequest","listParticipants","createDecoratedListParticipants","listReadReceipts","createDecoratedListReadReceipts","sendTypingNotification","removeParticipant","removeIdentifier","updateMessage","updateOption","updateTopic","getProperties","Reflect","proxyChatClient","receiver","createChatThread","chatThread","deleteChatThread","listChatThreads","chatThreadItem","createDecoratedListThreads","Proxy","chatThreadClientDeclaratify","ret","startRealtimeNotifications","eventSubscriber","stopRealtimeNotifications","createStatefulChatClient","_createStatefulChatClientInner","telemetryImplementationHint","tweakedOptions","chatClientOptions","userAgentOptions","userAgentPrefix","_createStatefulChatClientWithDeps","maxStateChangeListeners","proxy","defineProperty","configurable","set","val","getUserId","state","getDisplayName","getChatMessages","getParticipants","getReadReceipts","getIsLargeGroup","getLatestReadTime","sendBoxSelector","ACSKnownMessageType","compareMessages","firstMessage","secondMessage","firstDate","secondDate","idDelta","Number","parseInt","memoizedAllConvertChatMessage","memoizeFnAll","_key","isSeen","isLargeGroup","messageType","convertToUiChatMessage","convertToUiSystemMessage","extractAttachmentUrl","processChatMessageContent","sanitizedMessageContentType","includes","document","DOMParser","parseFromString","querySelectorAll","img","attachmentPreviewUrl","getResourceSourceUrl","brokenImageView","getBrokenImageViewNode","parentElement","replaceChild","setAttribute","setImageWidthAndHeight","body","innerHTML","teamsImageHtmlContent","generateImageAttachmentImgHtml","join","contentType","extractAttachmentContentTypeFromName","outerHTML","indexOfLastDot","lastIndexOf","substring","width","height","style","aspectRatio","extractAttachmentsMetadata","concat","attachmentMetadata","fileSharingMetadata","JSON","parse","console","extractAttachmentMetadata","teamsAttachments","rawAttachments","rawAttachment","extractTeamsAttachmentsMetadata","messageSenderId","senderId","deletedOn","mine","systemMessageType","iconName","hasValidParticipant","some","p","messageThreadSelectorWithThread","participantCount","readReceiptsBySenderId","r","lastReadMessage","chatMessageId","convertedMessages","memoizedFn","isMessageValidToRender","chatMessagesWithStatus","sort","attached","previousMessage","nextMessage","previousSenderId","nextSenderId","timediff","diffMins","Math","round","showMessageStatus","wrapper","createElement","Array","from","attributes","attr","nodeName","nodeValue","typingIndicatorSelector","typingUsers","seen","Set","date8SecondsAgo","reversedTypingIndicators","toReversed","has","add","filterTypingIndicators","convertSdkTypingIndicatorsToCommunicationParticipants","chatParticipantListSelector","chatParticipants","isRemovable","kind","convertChatParticipantsToCommunicationParticipants","moderator","getModerator","myUserId","errorBarSelector","activeErrorMessages","specificSendMessageErrorSeen","latestUnableToReachChatServiceError","latestAccessDeniedError","sendMessageError","latestNotInThisThreadError","splice","maxErrorCount","accessErrorTargets","latestActiveErrorSatisfying","code","statusCode","isErrorDueToBotContact","errors","activeErrorType","predicate","a","b","getSelector","component","findSelector","messageThreadSelectorsByThread","SendBox","S","MessageThread","useContext","messageThreadSelectorImpl","getMessageThreadSelector","TypingIndicator","ParticipantList","ErrorBar","createDefaultChatHandlers","messageIterator","readReceiptIterator","onSendMessage","sendMessageRequest","onUpdateMessage","updateMessageOptions","onDeleteMessage","onMessageSeen","sendReadReceipt","onTyping","onRemoveParticipant","updateThreadTopicName","topicName","onLoadPreviousChatMessages","messagesToLoad","maxPageSize","remainingMessagesToGet","isAllChatMessagesLoaded","earliestTime","MAX_SAFE_INTEGER","_","createDefaultChatHandlersForComponent","callingSelector","chatSelector","callProps","chatProps","selector","selectorProps","mounted","useRef","useEffect","current","threadConfigProps","useMemo","setProps","useState","propRef","newProps","callingHandlers","chatHandlers"],"sourceRoot":""}