@azure/communication-react 1.17.0-alpha-202405310013 → 1.17.0-alpha-202406020014

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/communication-react.d.ts +19 -0
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-anI3y0oU.js → ChatMessageComponentAsRichTextEditBox-BQpOd_cF.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-anI3y0oU.js.map → ChatMessageComponentAsRichTextEditBox-BQpOd_cF.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CZ0LZbKA.js → RichTextSendBoxWrapper-CBQNEhRD.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-CZ0LZbKA.js.map → RichTextSendBoxWrapper-CBQNEhRD.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-BqQ1gXi4.js → index-xYWFdTrM.js} +209 -110
  7. package/dist/dist-cjs/communication-react/index-xYWFdTrM.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +15 -3
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +18 -6
  15. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  16. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  18. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +2 -0
  20. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +1 -0
  22. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +4 -2
  23. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +24 -4
  25. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +5 -2
  27. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +2 -2
  29. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +1 -0
  31. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +20 -2
  32. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +4 -0
  34. package/dist/dist-esm/react-components/src/components/VideoGallery.js +7 -2
  35. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/index.js +0 -3
  37. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +7 -1
  39. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +10 -16
  41. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
  44. package/dist/dist-esm/react-components/src/theming/icons.js +3 -4
  45. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +1 -1
  47. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +0 -2
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -0
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +11 -5
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +6 -0
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +18 -4
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +5 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +2 -0
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +36 -2
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +5 -2
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.d.ts +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.js.map +1 -1
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js +0 -8
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js +1 -9
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +1 -6
  72. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  74. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  77. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  79. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js +1 -9
  82. package/dist/dist-esm/react-composites/src/composites/common/StarSurvey.js.map +1 -1
  83. package/dist/dist-esm/react-composites/src/composites/common/Survey.js +0 -19
  84. package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -1
  85. package/dist/dist-esm/react-composites/src/composites/common/SurveyContent.js +1 -11
  86. package/dist/dist-esm/react-composites/src/composites/common/SurveyContent.js.map +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js +1 -8
  88. package/dist/dist-esm/react-composites/src/composites/common/TagsSurvey.js.map +1 -1
  89. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
  90. package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js +0 -4
  91. package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js.map +1 -1
  92. package/package.json +6 -6
  93. package/dist/dist-cjs/communication-react/index-BqQ1gXi4.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,WAAW,EAAgB,KAAK,EAAS,MAAM,iBAAiB,CAAC;AAK1E,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAEnH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAAE,aAAa,EAAe,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAM3E,OAAO,EAIL,QAAQ,EACT,yCAAmC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,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,UAAU,KAAK,eAAe,CAAC,CAAC,CACpF,CAAC;IACF,OAAO,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC;AAC3F,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,YAAmD,EAAW,EAAE;IAC3F,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,YAAmD,EAAW,EAAE;IACjG,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,UAAU,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,CAAC,CAAC;AAClF,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAAmC,EAAW,EAAE;IAC1E,6CAA6C,CAAC,mDAAmD;IACjG,OAAO,IAAI,KAAK,MAAM,CAAC;IACvB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallCompositePage } from '../CallComposite';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey } from '@azure/communication-calling';\nimport { CallState } from '@azure/communication-calling';\nimport { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatComposite, ChatAdapter } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport {\n ParticipantMenuItemsCallback,\n _useContainerHeight,\n _useContainerWidth,\n useTheme\n} from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeInner, CallCompositeOptions } from '../CallComposite/CallComposite';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite/CallComposite';\nimport { LocalVideoTileOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport { CommonCallControlOptions } from '../common/types/CommonCallControlOptions';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';\nimport { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';\nimport { InjectedSidePaneProps } from '../CallComposite/components/SidePane/SidePaneProvider';\nimport { isDisabled } from '../CallComposite/utils';\nimport {\n CustomCallControlButtonCallback,\n CustomCallControlButtonCallbackArgs\n} from '../common/ControlBar/CustomButton';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { CallControlOptions } from '../CallComposite/types/CallControlOptions';\nimport { useUnreadMessagesTracker } from './ChatButton/useUnreadMessagesTracker';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentOptions } from '@internal/react-components';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n attachmentOptions?: AttachmentOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /* @conditional-compile-remove(end-of-call-survey) */\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /* @conditional-compile-remove(spotlight) */\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n /**\n * enables rich text editor for the edit box\n * @defaultValue `false`\n *\n * @beta\n */\n richTextEditor?: boolean;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions?: AttachmentOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n localVideoTile?: boolean | LocalVideoTileOptions;\n galleryOptions?: {\n layout?: VideoGalleryLayout;\n };\n /* @conditional-compile-remove(end-of-call-survey) */\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n logo?: {\n url: string;\n alt?: string;\n shape?: 'unset' | 'circle';\n };\n backgroundImage?: {\n url: string;\n };\n /* @conditional-compile-remove(spotlight) */\n spotlight?: {\n hideSpotlightButtons?: boolean;\n };\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n /* @conditional-compile-remove(end-of-call-survey) */\n const { surveyOptions } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [isChatInitialized, setIsChatInitialized] = useState(false);\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [isChatOpen, setIsChatOpen] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n setIsChatInitialized(newState.chat ? true : false);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const chatAdapter: ChatAdapter = useMemo(() => {\n return new CallWithChatBackedChatAdapter(callWithChatAdapter);\n }, [callWithChatAdapter]);\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const closeChat = useCallback(() => {\n setIsChatOpen(false);\n }, []);\n const openChat = useCallback(() => {\n setIsChatOpen(true);\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }, [compositeParentDivId]);\n\n const isOnHold = isOnHoldTrampoline(currentPage);\n useEffect(() => {\n if (isOnHold) {\n closeChat();\n }\n }, [closeChat, isOnHold]);\n\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const toggleChat = useCallback(() => {\n isChatOpen || !hasJoinedCall ? closeChat() : openChat();\n }, [closeChat, hasJoinedCall, isChatOpen, openChat]);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const theme = useTheme();\n const commonButtonStyles = useMemo(\n () => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [mobileView, theme]\n );\n\n const showChatButton = checkShowChatButton(props.callControls);\n const chatButtonDisabled =\n showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall || isOnHold);\n const chatTabHeaderProps = useMemo(\n () =>\n mobileView && showChatButton\n ? {\n onClick: toggleChat,\n disabled: chatButtonDisabled\n }\n : undefined,\n [chatButtonDisabled, mobileView, toggleChat, showChatButton]\n );\n\n const unreadChatMessagesCount = useUnreadMessagesTracker(chatAdapter, isChatOpen, isChatInitialized);\n\n const customChatButton: CustomCallControlButtonCallback = useCallback(\n (args: CustomCallControlButtonCallbackArgs) => ({\n placement: mobileView ? 'primary' : 'secondary',\n onRenderButton: () => (\n <ChatButtonWithUnreadMessagesBadge\n checked={isChatOpen}\n showLabel={args.displayType !== 'compact'}\n onClick={toggleChat}\n disabled={chatButtonDisabled}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n unreadChatMessagesCount={unreadChatMessagesCount}\n // As chat is disabled when on hold, we don't want to show the unread badge when on hold\n hideUnreadChatMessagesBadge={isOnHold}\n disableTooltip={mobileView}\n />\n )\n }),\n [\n callWithChatStrings.chatButtonNewMessageNotificationLabel,\n chatButtonStrings,\n commonButtonStyles,\n isChatOpen,\n chatButtonDisabled,\n mobileView,\n toggleChat,\n unreadChatMessagesCount,\n isOnHold\n ]\n );\n\n const callControlOptionsFromProps = useMemo(\n () => ({\n ...(typeof props.callControls === 'object' ? props.callControls : {})\n }),\n [props.callControls]\n );\n\n const injectedCustomButtonsFromProps = useMemo(() => {\n return [...(callControlOptionsFromProps.onFetchCustomButtonProps ?? [])];\n }, [callControlOptionsFromProps]);\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls:\n props.callControls === false\n ? false\n : ({\n ...callControlOptionsFromProps,\n onFetchCustomButtonProps: [\n ...(showChatButton ? [customChatButton] : []),\n ...injectedCustomButtonsFromProps\n ],\n legacyControlBarExperience: false\n } as CallControlOptions),\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick,\n remoteVideoTileMenuOptions: props.remoteVideoTileMenuOptions,\n\n galleryOptions: props.galleryOptions,\n localVideoTile: props.localVideoTile,\n /* @conditional-compile-remove(end-of-call-survey) */\n surveyOptions: surveyOptions,\n branding: {\n logo: props.logo,\n backgroundImage: props.backgroundImage\n },\n /* @conditional-compile-remove(spotlight) */\n spotlight: props.spotlight\n }),\n [\n props.callControls,\n callControlOptionsFromProps,\n showChatButton,\n customChatButton,\n injectedCustomButtonsFromProps,\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick,\n\n props.galleryOptions,\n props.localVideoTile,\n props.remoteVideoTileMenuOptions,\n /* @conditional-compile-remove(end-of-call-survey) */\n surveyOptions,\n props.logo,\n props.backgroundImage,\n /* @conditional-compile-remove(spotlight) */\n props.spotlight\n ]\n );\n\n const onRenderChatContent = useCallback(\n (): JSX.Element => (\n <ChatComposite\n adapter={chatAdapter}\n fluentTheme={theme}\n options={{\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions: props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor: props.richTextEditor\n }}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n ),\n [\n chatAdapter,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n props.attachmentOptions,\n props.onFetchAvatarPersonaData,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */ props.richTextEditor,\n theme\n ]\n );\n\n const sidePaneHeaderRenderer = useCallback(\n () => (\n <SidePaneHeader\n headingText={callWithChatStrings.chatPaneTitle}\n onClose={closeChat}\n dismissSidePaneButtonAriaLabel={callWithChatStrings.dismissSidePaneButtonLabel ?? ''}\n mobileView={mobileView}\n />\n ),\n [callWithChatStrings.chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]\n );\n\n const sidePaneContentRenderer = useMemo(\n () => (hasJoinedCall ? onRenderChatContent : undefined),\n [hasJoinedCall, onRenderChatContent]\n );\n\n const sidePaneRenderer = useMemo(\n () => ({\n contentRenderer: sidePaneContentRenderer,\n headerRenderer: sidePaneHeaderRenderer,\n id: 'chat'\n }),\n [sidePaneContentRenderer, sidePaneHeaderRenderer]\n );\n\n const overrideSidePaneProps: InjectedSidePaneProps = useMemo(\n () => ({\n renderer: sidePaneRenderer,\n isActive: isChatOpen,\n persistRenderingWhenClosed: true\n }),\n [isChatOpen, sidePaneRenderer]\n );\n\n const onSidePaneIdChange = useCallback(\n (sidePaneId: string | undefined) => {\n // If the pane is switched to something other than chat, removing rendering chat.\n if (sidePaneId && sidePaneId !== 'chat') {\n closeChat();\n }\n },\n [closeChat]\n );\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n callAdapter.on('callEnded', closeChat);\n return () => {\n callAdapter.off('callEnded', closeChat);\n };\n }, [callAdapter, closeChat]);\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item grow styles={callCompositeContainerStyles(mobileView)}>\n <CallCompositeInner\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n callInvitationUrl={props.joinInvitationURL}\n overrideSidePane={overrideSidePaneProps}\n onSidePaneIdChange={onSidePaneIdChange}\n mobileChatTabHeader={chatTabHeaderProps}\n onCloseChatPane={closeChat}\n />\n </Stack.Item>\n </Stack>\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions={options?.attachmentOptions}\n localVideoTile={options?.localVideoTile}\n galleryOptions={options?.galleryOptions}\n logo={options?.branding?.logo}\n backgroundImage={options?.branding?.backgroundImage}\n /* @conditional-compile-remove(end-of-call-survey) */\n surveyOptions={options?.surveyOptions}\n /* @conditional-compile-remove(spotlight) */\n spotlight={options?.spotlight}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');\n};\n\nconst checkShowChatButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst checkChatButtonIsDisabled = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n return typeof callControls === 'object' && isDisabled(callControls?.chatButton);\n};\n\nconst isOnHoldTrampoline = (page: CallCompositePage | undefined): boolean => {\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return page === 'hold';\n return false;\n};\n"]}
1
+ {"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MA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ent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallCompositePage } from '../CallComposite';\nimport { CallSurvey } from '@azure/communication-calling';\nimport { CallState } from '@azure/communication-calling';\nimport { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatComposite, ChatAdapter } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport {\n ParticipantMenuItemsCallback,\n _useContainerHeight,\n _useContainerWidth,\n useTheme\n} from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeInner, CallCompositeOptions } from '../CallComposite/CallComposite';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite/CallComposite';\nimport { LocalVideoTileOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport { CommonCallControlOptions } from '../common/types/CommonCallControlOptions';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';\nimport { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';\nimport { InjectedSidePaneProps } from '../CallComposite/components/SidePane/SidePaneProvider';\nimport { isDisabled } from '../CallComposite/utils';\nimport {\n CustomCallControlButtonCallback,\n CustomCallControlButtonCallbackArgs\n} from '../common/ControlBar/CustomButton';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { CallControlOptions } from '../CallComposite/types/CallControlOptions';\nimport { useUnreadMessagesTracker } from './ChatButton/useUnreadMessagesTracker';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentOptions } from '@internal/react-components';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n attachmentOptions?: AttachmentOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /* @conditional-compile-remove(spotlight) */\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n /**\n * enables rich text editor for the edit box\n * @defaultValue `false`\n *\n * @beta\n */\n richTextEditor?: boolean;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions?: AttachmentOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n localVideoTile?: boolean | LocalVideoTileOptions;\n galleryOptions?: {\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n logo?: {\n url: string;\n alt?: string;\n shape?: 'unset' | 'circle';\n };\n backgroundImage?: {\n url: string;\n };\n /* @conditional-compile-remove(spotlight) */\n spotlight?: {\n hideSpotlightButtons?: boolean;\n };\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const { surveyOptions } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [isChatInitialized, setIsChatInitialized] = useState(false);\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [isChatOpen, setIsChatOpen] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n setIsChatInitialized(newState.chat ? true : false);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const chatAdapter: ChatAdapter = useMemo(() => {\n return new CallWithChatBackedChatAdapter(callWithChatAdapter);\n }, [callWithChatAdapter]);\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const closeChat = useCallback(() => {\n setIsChatOpen(false);\n }, []);\n const openChat = useCallback(() => {\n setIsChatOpen(true);\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }, [compositeParentDivId]);\n\n const isOnHold = isOnHoldTrampoline(currentPage);\n useEffect(() => {\n if (isOnHold) {\n closeChat();\n }\n }, [closeChat, isOnHold]);\n\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const toggleChat = useCallback(() => {\n isChatOpen || !hasJoinedCall ? closeChat() : openChat();\n }, [closeChat, hasJoinedCall, isChatOpen, openChat]);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const theme = useTheme();\n const commonButtonStyles = useMemo(\n () => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [mobileView, theme]\n );\n\n const showChatButton = checkShowChatButton(props.callControls);\n const chatButtonDisabled =\n showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall || isOnHold);\n const chatTabHeaderProps = useMemo(\n () =>\n mobileView && showChatButton\n ? {\n onClick: toggleChat,\n disabled: chatButtonDisabled\n }\n : undefined,\n [chatButtonDisabled, mobileView, toggleChat, showChatButton]\n );\n\n const unreadChatMessagesCount = useUnreadMessagesTracker(chatAdapter, isChatOpen, isChatInitialized);\n\n const customChatButton: CustomCallControlButtonCallback = useCallback(\n (args: CustomCallControlButtonCallbackArgs) => ({\n placement: mobileView ? 'primary' : 'secondary',\n onRenderButton: () => (\n <ChatButtonWithUnreadMessagesBadge\n checked={isChatOpen}\n showLabel={args.displayType !== 'compact'}\n onClick={toggleChat}\n disabled={chatButtonDisabled}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n unreadChatMessagesCount={unreadChatMessagesCount}\n // As chat is disabled when on hold, we don't want to show the unread badge when on hold\n hideUnreadChatMessagesBadge={isOnHold}\n disableTooltip={mobileView}\n />\n )\n }),\n [\n callWithChatStrings.chatButtonNewMessageNotificationLabel,\n chatButtonStrings,\n commonButtonStyles,\n isChatOpen,\n chatButtonDisabled,\n mobileView,\n toggleChat,\n unreadChatMessagesCount,\n isOnHold\n ]\n );\n\n const callControlOptionsFromProps = useMemo(\n () => ({\n ...(typeof props.callControls === 'object' ? props.callControls : {})\n }),\n [props.callControls]\n );\n\n const injectedCustomButtonsFromProps = useMemo(() => {\n return [...(callControlOptionsFromProps.onFetchCustomButtonProps ?? [])];\n }, [callControlOptionsFromProps]);\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls:\n props.callControls === false\n ? false\n : ({\n ...callControlOptionsFromProps,\n onFetchCustomButtonProps: [\n ...(showChatButton ? [customChatButton] : []),\n ...injectedCustomButtonsFromProps\n ],\n legacyControlBarExperience: false\n } as CallControlOptions),\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick,\n remoteVideoTileMenuOptions: props.remoteVideoTileMenuOptions,\n\n galleryOptions: props.galleryOptions,\n localVideoTile: props.localVideoTile,\n surveyOptions: surveyOptions,\n branding: {\n logo: props.logo,\n backgroundImage: props.backgroundImage\n },\n /* @conditional-compile-remove(spotlight) */\n spotlight: props.spotlight\n }),\n [\n props.callControls,\n callControlOptionsFromProps,\n showChatButton,\n customChatButton,\n injectedCustomButtonsFromProps,\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick,\n props.galleryOptions,\n props.localVideoTile,\n props.remoteVideoTileMenuOptions,\n surveyOptions,\n props.logo,\n props.backgroundImage,\n /* @conditional-compile-remove(spotlight) */\n props.spotlight\n ]\n );\n\n const onRenderChatContent = useCallback(\n (): JSX.Element => (\n <ChatComposite\n adapter={chatAdapter}\n fluentTheme={theme}\n options={{\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions: props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor: props.richTextEditor\n }}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n ),\n [\n chatAdapter,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n props.attachmentOptions,\n props.onFetchAvatarPersonaData,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */ props.richTextEditor,\n theme\n ]\n );\n\n const sidePaneHeaderRenderer = useCallback(\n () => (\n <SidePaneHeader\n headingText={callWithChatStrings.chatPaneTitle}\n onClose={closeChat}\n dismissSidePaneButtonAriaLabel={callWithChatStrings.dismissSidePaneButtonLabel ?? ''}\n mobileView={mobileView}\n />\n ),\n [callWithChatStrings.chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]\n );\n\n const sidePaneContentRenderer = useMemo(\n () => (hasJoinedCall ? onRenderChatContent : undefined),\n [hasJoinedCall, onRenderChatContent]\n );\n\n const sidePaneRenderer = useMemo(\n () => ({\n contentRenderer: sidePaneContentRenderer,\n headerRenderer: sidePaneHeaderRenderer,\n id: 'chat'\n }),\n [sidePaneContentRenderer, sidePaneHeaderRenderer]\n );\n\n const overrideSidePaneProps: InjectedSidePaneProps = useMemo(\n () => ({\n renderer: sidePaneRenderer,\n isActive: isChatOpen,\n persistRenderingWhenClosed: true\n }),\n [isChatOpen, sidePaneRenderer]\n );\n\n const onSidePaneIdChange = useCallback(\n (sidePaneId: string | undefined) => {\n // If the pane is switched to something other than chat, removing rendering chat.\n if (sidePaneId && sidePaneId !== 'chat') {\n closeChat();\n }\n },\n [closeChat]\n );\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n callAdapter.on('callEnded', closeChat);\n return () => {\n callAdapter.off('callEnded', closeChat);\n };\n }, [callAdapter, closeChat]);\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item grow styles={callCompositeContainerStyles(mobileView)}>\n <CallCompositeInner\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n callInvitationUrl={props.joinInvitationURL}\n overrideSidePane={overrideSidePaneProps}\n onSidePaneIdChange={onSidePaneIdChange}\n mobileChatTabHeader={chatTabHeaderProps}\n onCloseChatPane={closeChat}\n />\n </Stack.Item>\n </Stack>\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions={options?.attachmentOptions}\n localVideoTile={options?.localVideoTile}\n galleryOptions={options?.galleryOptions}\n logo={options?.branding?.logo}\n backgroundImage={options?.branding?.backgroundImage}\n surveyOptions={options?.surveyOptions}\n /* @conditional-compile-remove(spotlight) */\n spotlight={options?.spotlight}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');\n};\n\nconst checkShowChatButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst checkChatButtonIsDisabled = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n return typeof callControls === 'object' && isDisabled(callControls?.chatButton);\n};\n\nconst isOnHoldTrampoline = (page: CallCompositePage | undefined): boolean => {\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return page === 'hold';\n return false;\n};\n"]}
@@ -140,6 +140,7 @@ export declare class AzureCommunicationCallWithChatAdapter implements CallWithCh
140
140
  startSpotlight(userIds?: string[]): Promise<void>;
141
141
  stopSpotlight(userIds?: string[]): Promise<void>;
142
142
  stopAllSpotlight(): Promise<void>;
143
+ muteParticipant(userId: string): Promise<void>;
143
144
  on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;
144
145
  on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;
145
146
  on(event: 'callEnded', listener: CallEndedListener): void;
@@ -469,7 +469,6 @@ export class AzureCommunicationCallWithChatAdapter {
469
469
  updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
470
470
  return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
471
471
  }
472
- /* @conditional-compile-remove(end-of-call-survey) */
473
472
  submitSurvey(survey) {
474
473
  return __awaiter(this, void 0, void 0, function* () {
475
474
  return this.callAdapter.submitSurvey(survey);
@@ -493,6 +492,12 @@ export class AzureCommunicationCallWithChatAdapter {
493
492
  return this.callAdapter.stopAllSpotlight();
494
493
  });
495
494
  }
495
+ /* @conditional-compile-remove(soft-mute) */
496
+ muteParticipant(userId) {
497
+ return __awaiter(this, void 0, void 0, function* () {
498
+ return this.callAdapter.muteParticipant(userId);
499
+ });
500
+ }
496
501
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
497
502
  on(event, listener) {
498
503
  switch (event) {
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationCallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAkDlC,OAAO,EACL,yCAAyC,EAEzC,iDAAiD,EACjD,iDAAiD,EAClD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,6CAA6C,EAC7C,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ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MAAM,6CAA6C,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACtG,OAAO,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7E,CAAC,CAAA,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wDAAwD,GAAG,CACtE,WAAwB,EACxB,WAAwB,EACH,EAAE,CAAC,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9F,MAAM,qBAAqB,GAAG,CAC5B,OAGwE,EACmC,EAAE;IAC7G,OAAO,aAAa,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CACpC,OAGwE,EACxE,OAA6B,EACT,EAAE;IACtB,IAAI,aAAa,IAAI,OAAO,EAAE,CAAC;QAC7B,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,8CAA8C,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACD,8CAA8C;IAC9C,IAAI,WAAW,IAAI,OAAO,EAAE,CAAC;QAC3B,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n\nimport {\n AudioDeviceInfo,\n Call,\n CallAgent,\n GroupCallLocator,\n PermissionConstraints,\n PropertyChangedEvent,\n TeamsMeetingLinkLocator,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(meeting-id) */\nimport { TeamsMeetingIdLocator } from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-upload) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport {\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n IsMutedChangedListener,\n CallIdChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n DisplayNameChangedListener,\n IsSpeakingChangedListener,\n CallAdapter,\n CallAdapterState,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageReceivedListener,\n MessageReadListener,\n ChatAdapter,\n ChatAdapterState,\n ParticipantsRemovedListener,\n ParticipantsAddedListener,\n MessageEditedListener,\n MessageDeletedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapter, CallWithChatEvent, ChatInitializedListener } from './CallWithChatAdapter';\nimport {\n callWithChatAdapterStateFromBackingStates,\n CallWithChatAdapterState,\n mergeCallAdapterStateIntoCallWithChatAdapterState,\n mergeChatAdapterStateIntoCallWithChatAdapterState\n} from '../state/CallWithChatAdapterState';\nimport {\n _createAzureCommunicationChatAdapterInner,\n _createLazyAzureCommunicationChatAdapterInner,\n createAzureCommunicationChatAdapterFromClient\n} from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';\nimport { EventEmitter } from 'events';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { getChatThreadFromTeamsLink } from './parseTeamsUrl';\nimport { AdapterError } from '../../common/adapters';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { CallParticipantsLocator } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport { _createAzureCommunicationCallAdapterInner } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport {\n CallAdapterLocator,\n createAzureCommunicationCallAdapterFromClient\n} from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport { StatefulCallClient } from '@internal/calling-stateful-client';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatThreadClient } from '@azure/communication-chat';\nimport { useEffect, useRef, useState } from 'react';\nimport { _toCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\n\nimport { AzureCommunicationCallAdapterOptions } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport {\n IsCaptionsActiveChangedListener,\n CaptionsReceivedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(spotlight) */\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\ntype CallWithChatAdapterStateChangedHandler = (newState: CallWithChatAdapterState) => void;\n\n/** Context of Call with Chat, which is a centralized context for all state updates */\nclass CallWithChatContext {\n private emitter = new EventEmitter();\n private state: CallWithChatAdapterState;\n\n constructor(clientState: CallWithChatAdapterState, maxListeners = 50) {\n this.state = clientState;\n this.emitter.setMaxListeners(maxListeners);\n }\n\n public onStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallWithChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallWithChatAdapterState {\n return this.state;\n }\n\n public updateClientState(clientState: CallWithChatAdapterState): void {\n this.setState(clientState);\n }\n\n public updateClientStateWithChatState(chatAdapterState: ChatAdapterState): void {\n this.updateClientState(mergeChatAdapterStateIntoCallWithChatAdapterState(this.state, chatAdapterState));\n }\n\n public updateClientStateWithCallState(callAdapterState: CallAdapterState): void {\n this.updateClientState(mergeCallAdapterStateIntoCallWithChatAdapterState(this.state, callAdapterState));\n }\n}\n\n/**\n * CallWithChat adapter backed by Azure Communication Services.\n * Created for easy use with the {@link CallWithChatComposite}.\n */\nexport class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapter {\n private callAdapter: CallAdapter;\n private chatAdapter: ChatAdapter | undefined;\n private context: CallWithChatContext;\n private emitter: EventEmitter = new EventEmitter();\n private onChatStateChange: (newChatAdapterState: ChatAdapterState) => void;\n private onCallStateChange: (newChatAdapterState: CallAdapterState) => void;\n private isAdapterDisposed: boolean = false;\n\n constructor(callAdapter: CallAdapter, chatAdapter?: ChatAdapter) {\n this.bindPublicMethods();\n this.callAdapter = callAdapter;\n this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter));\n\n const onChatStateChange = (newChatAdapterState: ChatAdapterState): void => {\n this.context.updateClientStateWithChatState(newChatAdapterState);\n };\n\n this.onChatStateChange = onChatStateChange;\n if (chatAdapter) {\n this.updateChatAdapter(chatAdapter);\n }\n\n const onCallStateChange = (newCallAdapterState: CallAdapterState): void => {\n this.context.updateClientStateWithCallState(newCallAdapterState);\n };\n\n this.callAdapter.onStateChange(onCallStateChange);\n this.onCallStateChange = onCallStateChange;\n }\n\n public setChatAdapterPromise(chatAdapter: Promise<ChatAdapter>): void {\n chatAdapter.then((adapter) => {\n if (!this.isAdapterDisposed) {\n this.updateChatAdapter(adapter);\n }\n });\n }\n\n private updateChatAdapter(chatAdapter: ChatAdapter): void {\n this.chatAdapter = chatAdapter;\n this.chatAdapter.onStateChange(this.onChatStateChange);\n this.context.updateClientStateWithChatState(chatAdapter.getState());\n this.emitter.emit('chatInitialized', this.chatAdapter);\n }\n\n private bindPublicMethods(): void {\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.startCall.bind(this);\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.raiseHand.bind(this);\n this.lowerHand.bind(this);\n this.onReactionClick.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.disposeScreenShareStreamView.bind(this);\n this.fetchInitialData.bind(this);\n this.sendMessage.bind(this);\n this.sendReadReceipt.bind(this);\n this.sendTypingIndicator.bind(this);\n this.loadPreviousChatMessages.bind(this);\n this.updateMessage.bind(this);\n this.deleteMessage.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n this.sendDtmfTone.bind(this);\n /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.bind(this);\n this.startCaptions.bind(this);\n this.stopCaptions.bind(this);\n this.setSpokenLanguage.bind(this);\n this.setCaptionLanguage.bind(this);\n this.startVideoBackgroundEffect.bind(this);\n\n this.stopVideoBackgroundEffects.bind(this);\n\n this.updateBackgroundPickerImages.bind(this);\n }\n\n /** Join existing Call. */\n public joinCall(options?: boolean | JoinCallOptions): Call | undefined {\n if (typeof options === 'boolean') {\n return this.callAdapter.joinCall(options);\n } else {\n return this.callAdapter.joinCall(options);\n }\n }\n /** Leave current Call. */\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n // Only remove self from the GroupCall. Contoso must manage access to Chat.\n await this.callAdapter.leaveCall(forEveryone);\n }\n\n /** Start a new Call. */\n public startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: StartCallIdentifier[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: string[] | StartCallIdentifier[], options?: StartCallOptions): Call | undefined {\n if (participants.length === 0) {\n throw new Error('At least one participant is required to start a call');\n }\n if (typeof participants[0] === 'string') {\n return this.callAdapter.startCall(participants as string[], options);\n } else {\n return this.callAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n }\n /**\n * Subscribe to state change events.\n * @param handler - handler to be called when the state changes. This is passed the new state.\n */\n public onStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n /**\n * Unsubscribe to state change events.\n * @param handler - handler to be no longer called when state changes.\n */\n public offStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n /** Get current Call and Chat state. */\n public getState(): CallWithChatAdapterState {\n return this.context.getState();\n }\n /** Dispose of the current CallWithChatAdapter. */\n public dispose(): void {\n this.isAdapterDisposed = true;\n if (this.chatAdapter) {\n this.chatAdapter.offStateChange(this.onChatStateChange);\n this.chatAdapter.dispose();\n }\n this.callAdapter.offStateChange(this.onCallStateChange);\n this.callAdapter.dispose();\n }\n /** Remove a participant from the Call only. */\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callAdapter.removeParticipant(participant);\n }\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.setCamera(device, options);\n }\n /** Set the microphone to be used in the Call. */\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setMicrophone(device);\n }\n /** Set the speaker to be used in the Call. */\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setSpeaker(device);\n }\n public async askDevicePermission(constraints: PermissionConstraints): Promise<void> {\n await this.callAdapter.askDevicePermission(constraints);\n }\n /** Query for available cameras. */\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.callAdapter.queryCameras();\n }\n /** Query for available microphones. */\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.queryMicrophones();\n }\n /** Query for available speakers. */\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.querySpeakers();\n }\n /** Start the camera for the user in the Call. */\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.startCamera(options);\n }\n /** Stop the camera for the user in the Call. */\n public async stopCamera(): Promise<void> {\n await this.callAdapter.stopCamera();\n }\n /** Mute the user in the Call. */\n public async mute(): Promise<void> {\n await this.callAdapter.mute();\n }\n /** Unmute the user in the Call. */\n public async unmute(): Promise<void> {\n await this.callAdapter.unmute();\n }\n /** Trigger the user to start screen share. */\n public async startScreenShare(): Promise<void> {\n await this.callAdapter.startScreenShare();\n }\n /** Stop the current active screen share. */\n public async stopScreenShare(): Promise<void> {\n await this.callAdapter.stopScreenShare();\n }\n /** Raise hand for local user. */\n public async raiseHand(): Promise<void> {\n await this.callAdapter.raiseHand();\n }\n /** Lower hand for local user. */\n public async lowerHand(): Promise<void> {\n await this.callAdapter.lowerHand();\n }\n /** Reaction clicked by the local user. */\n public async onReactionClick(reaction: Reaction): Promise<void> {\n await this.callAdapter.onReactionClick(reaction);\n }\n /** Create a stream view for a remote participants video feed. */\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n return await this.callAdapter.createStreamView(remoteUserId, options);\n }\n /** Dispose of a created stream view of a remote participants video feed. */\n public async disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.disposeStreamView(remoteUserId, options);\n }\n /** Dispose of a remote screen share */\n public async disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n /** Dispose of a remote video stream */\n public async disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n /** Dispose of the local video stream */\n public async disposeLocalVideoStreamView(): Promise<void> {\n await this.callAdapter.disposeLocalVideoStreamView();\n }\n /** Fetch initial Call and Chat data such as chat messages. */\n public async fetchInitialData(): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.fetchInitialData();\n });\n }\n /** Send a chat message. */\n public async sendMessage(\n content: string,\n /* @conditional-compile-remove(attachment-upload) */\n options?: MessageOptions\n ): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendMessage(content, /* @conditional-compile-remove(attachment-upload) */ options);\n });\n }\n /** Send a chat read receipt. */\n public async sendReadReceipt(chatMessageId: string): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendReadReceipt(chatMessageId);\n });\n }\n /** Send an isTyping indicator. */\n public async sendTypingIndicator(): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendTypingIndicator();\n });\n }\n /** Load previous Chat messages. */\n public async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.loadPreviousChatMessages(messagesToLoad);\n });\n }\n /** Update an existing message. */\n public async updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(attachment-upload) */ MessageOptions\n ): Promise<void> {\n return this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.updateMessage(messageId, content, options);\n });\n }\n /** Delete an existing message. */\n public async deleteMessage(messageId: string): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.deleteMessage(messageId);\n });\n }\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.downloadResourceToCache(resourceDetails);\n });\n }\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.removeResourceFromCache(resourceDetails);\n });\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n return await this.callAdapter.holdCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n return await this.callAdapter.resumeCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isCommunicationUserIdentifier(participant)) {\n return await this.callAdapter.addParticipant(participant);\n } else {\n return await this.callAdapter.addParticipant(participant, options);\n }\n }\n\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n return await this.callAdapter.sendDtmfTone(dtmfTone);\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callAdapter.allowUnsupportedBrowserVersion();\n }\n\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n await this.callAdapter.startCaptions(options);\n }\n\n public async stopCaptions(): Promise<void> {\n await this.callAdapter.stopCaptions();\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callAdapter.setSpokenLanguage(language);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n return await this.callAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n /* @conditional-compile-remove(end-of-call-survey) */\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callAdapter.submitSurvey(survey);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.startSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.stopSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopAllSpotlight(): Promise<void> {\n return this.callAdapter.stopAllSpotlight();\n }\n\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: CallWithChatEvent, listener: any): void {\n switch (event) {\n case 'callParticipantsJoined':\n this.callAdapter.on('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.on('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.on('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.on('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.on('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.on('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.on('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.on('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.on('selectedSpeakerChanged', listener);\n break;\n case 'captionsReceived':\n this.callAdapter.on('captionsReceived', listener);\n break;\n case 'isCaptionsActiveChanged':\n this.callAdapter.on('isCaptionsActiveChanged', listener);\n break;\n case 'isCaptionLanguageChanged':\n this.callAdapter.on('isCaptionLanguageChanged', listener);\n break;\n case 'isSpokenLanguageChanged':\n this.callAdapter.on('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageReceived', listener);\n });\n break;\n case 'messageEdited':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageEdited', listener);\n });\n break;\n case 'messageDeleted':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageDeleted', listener);\n });\n break;\n case 'messageSent':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageSent', listener);\n });\n break;\n case 'messageRead':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageRead', listener);\n });\n break;\n case 'chatParticipantsAdded':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('participantsAdded', listener);\n });\n break;\n case 'chatParticipantsRemoved':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('participantsRemoved', listener);\n });\n break;\n case 'callError':\n this.callAdapter.on('error', listener);\n break;\n case 'chatError':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('error', listener);\n });\n break;\n case 'chatInitialized':\n this.emitter.on(event, listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: CallWithChatEvent, listener: any): void {\n switch (event as unknown) {\n case 'callParticipantsJoined':\n this.callAdapter.off('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.off('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.off('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.off('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.off('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.off('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.off('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.off('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.off('selectedSpeakerChanged', listener);\n break;\n case 'captionsReceived':\n this.callAdapter.off('captionsReceived', listener);\n break;\n case 'isCaptionsActiveChanged':\n this.callAdapter.off('isCaptionsActiveChanged', listener);\n break;\n case 'isCaptionLanguageChanged':\n this.callAdapter.off('isCaptionLanguageChanged', listener);\n break;\n case 'isSpokenLanguageChanged':\n this.callAdapter.off('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageReceived', listener);\n });\n break;\n case 'messageEdited':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageEdited', listener);\n });\n break;\n case 'messageDeleted':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageDeleted', listener);\n });\n break;\n case 'messageSent':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageSent', listener);\n });\n break;\n case 'messageRead':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageRead', listener);\n });\n break;\n case 'chatParticipantsAdded':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('participantsAdded', listener);\n });\n break;\n case 'chatParticipantsRemoved':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('participantsRemoved', listener);\n });\n break;\n case 'callError':\n this.callAdapter.off('error', listener);\n break;\n case 'chatError':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('error', listener);\n });\n break;\n case 'chatInitialized':\n this.emitter.off(event, listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private executeWithResolvedChatAdapter(callback: (adapter: ChatAdapter) => any): any {\n if (!this.chatAdapter) {\n console.error('Chat is not initialized');\n } else {\n return callback(this.chatAdapter);\n }\n }\n}\n\n/**\n * Provides a way to get the chat thread ID for a given locator.\n *\n * @private\n */\nexport interface ChatThreadProvider {\n isCallInfoRequired(): boolean;\n getChatThreadPromise(): Promise<string>;\n getChatThread(): string;\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Group Call with an associated Chat thread.\n * @private\n */\nexport class CallAndChatProvider implements ChatThreadProvider {\n public locator: CallAndChatLocator;\n\n constructor(locator: CallAndChatLocator) {\n this.locator = locator;\n }\n public isCallInfoRequired(): boolean {\n return false;\n }\n public async getChatThreadPromise(): Promise<string> {\n return this.getChatThread();\n }\n\n public getChatThread(): string {\n return this.locator.chatThreadId;\n }\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting with an associated Chat thread.\n *\n * @private\n */\nexport class TeamsMeetingLinkProvider implements ChatThreadProvider {\n public locator: TeamsMeetingLinkLocator;\n /** @conditional-compile-remove(meeting-id) */\n private callAdapterPromise: Promise<CallAdapter>;\n /** @conditional-compile-remove(meeting-id) */\n private callAdapterSubscription?: (state: CallAdapterState) => void;\n\n constructor(\n locator: TeamsMeetingLinkLocator,\n /** @conditional-compile-remove(meeting-id) */ callAdapterPromise: Promise<CallAdapter>\n ) {\n this.locator = locator;\n /** @conditional-compile-remove(meeting-id) */\n this.callAdapterPromise = callAdapterPromise;\n }\n\n public isCallInfoRequired(): boolean {\n return true;\n }\n\n public getChatThread(): string {\n /** @conditional-compile-remove(meeting-id) */\n throw new Error('Chat thread ID should be retrieved from call.callInfo using method getChatThreadPromise');\n return getChatThreadFromTeamsLink(this.locator.meetingLink);\n }\n\n public async getChatThreadPromise(): Promise<string> {\n /** @conditional-compile-remove(meeting-id) */\n {\n // Wait for the call to be connected and get the chat thread ID from `call.callInfo`.\n const chatThreadPromise = new Promise<string>((resolve) => {\n this.callAdapterPromise.then((callAdapter) => {\n // Ensure function is idempotent by removing any existing subscription.\n this.callAdapterSubscription && callAdapter.offStateChange(this.callAdapterSubscription);\n\n this.callAdapterSubscription = (state: CallAdapterState): void => {\n if (state.call?.state === 'Connected' && state.call.info?.threadId) {\n this.callAdapterSubscription && callAdapter.offStateChange(this.callAdapterSubscription);\n this.callAdapterSubscription = undefined;\n\n resolve(state.call.info?.threadId);\n }\n };\n callAdapter.onStateChange(this.callAdapterSubscription);\n });\n });\n\n return chatThreadPromise;\n }\n\n return getChatThreadFromTeamsLink(this.locator.meetingLink);\n }\n}\n\n/** @conditional-compile-remove(meeting-id) */\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting using meeting id.\n *\n * @private\n */\nexport class TeamsMeetingIdProvider implements ChatThreadProvider {\n public locator: TeamsMeetingIdLocator;\n private callAdapter: Promise<CallAdapter>;\n\n constructor(locator: TeamsMeetingIdLocator, callAdapter: Promise<CallAdapter>) {\n this.locator = locator;\n this.callAdapter = callAdapter;\n }\n public isCallInfoRequired(): boolean {\n return true;\n }\n public getChatThread(): string {\n throw new Error('Chat thread ID is not available for Teams meeting ID');\n }\n\n /**\n * Wait call to be connected to get thread ID.\n * @returns the chat thread ID for the given meeting ID.\n */\n public async getChatThreadPromise(): Promise<string> {\n return new Promise<string>((resolve) => {\n const stateChangeListener = (state: CallAdapterState): void => {\n if (state.call?.state === 'Connected' && state.call.info?.threadId) {\n this.callAdapter.then((adapter) => {\n adapter.offStateChange(stateChangeListener);\n });\n resolve(state.call.info?.threadId);\n }\n };\n\n this.callAdapter.then((adapter) => {\n const callState = adapter.getState().call?.state;\n const threadId = adapter.getState().call?.info?.threadId;\n if (callState === 'Connected' && threadId) {\n resolve(threadId);\n } else {\n adapter.onStateChange(stateChangeListener);\n }\n });\n });\n }\n}\n\n/**\n * Combination of available adapters for use in {@link createAzureCommunicationCallWithChatAdapter}.\n * @public\n */\nexport type CommunicationAdapter =\n | CallAndChatProvider\n | TeamsMeetingLinkProvider\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdProvider;\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Call with an associated Chat thread.\n *\n * @public\n */\nexport interface CallAndChatLocator {\n /** Locator used by {@link createAzureCommunicationCallWithChatAdapter} to locate the call to join */\n callLocator: GroupCallLocator | /* @conditional-compile-remove(teams-adhoc-call) */ CallParticipantsLocator;\n /** Chat thread ID used by {@link createAzureCommunicationCallWithChatAdapter} to locate the chat thread to join */\n chatThreadId: string;\n}\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapter}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a CallWithChatAdapter backed by Azure Communication services\n * to plug into the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapter = async ({\n userId,\n displayName,\n credential,\n endpoint,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter> => {\n const callAdapterLocator = isTeamsMeetingLocator(locator) ? locator : locator.callLocator;\n const callAdapter = _createAzureCommunicationCallAdapterInner({\n userId,\n displayName,\n credential,\n locator: callAdapterLocator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n options: callAdapterOptions,\n telemetryImplementationHint: 'CallWithChat' as _TelemetryImplementationHint\n });\n\n const chatThreadAdapter = _createChatThreadAdapterInner(locator, callAdapter);\n if (chatThreadAdapter.isCallInfoRequired()) {\n const callWithChatAdapter = new AzureCommunicationCallWithChatAdapter(await callAdapter);\n const chatAdapterPromise = _createLazyAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n chatThreadAdapter.getChatThreadPromise(),\n 'CallWithChat' as _TelemetryImplementationHint\n );\n callWithChatAdapter.setChatAdapterPromise(chatAdapterPromise);\n return callWithChatAdapter;\n } else {\n const chatAdapter = _createAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n chatThreadAdapter.getChatThread(),\n 'CallWithChat' as _TelemetryImplementationHint\n );\n\n return new AzureCommunicationCallWithChatAdapter(await callAdapter, await chatAdapter);\n }\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallWithChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallWithChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallWithChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallWithChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallWithChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>\n): CallWithChatAdapter | undefined => {\n const {\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallWithChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallWithChatAdapter | undefined>(undefined);\n const creatingAdapterRef = useRef<boolean>(false);\n\n const afterCreateRef = useRef<((adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>) | undefined>(\n undefined\n );\n const beforeDisposeRef = useRef<((adapter: CallWithChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n if (creatingAdapterRef.current) {\n console.warn(\n 'Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page'\n );\n return;\n }\n creatingAdapterRef.current = true;\n let newAdapter = await createAzureCommunicationCallWithChatAdapter({\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n callAdapterOptions\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapterFromClient}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterFromClientArgs = {\n callLocator: CallAdapterLocator | TeamsMeetingLinkLocator;\n callAgent: CallAgent;\n callClient: StatefulCallClient;\n chatClient: StatefulChatClient;\n chatThreadClient: ChatThreadClient;\n\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient} and {@link StatefulCallClient}.\n * Please note that chatThreadClient has to be created by StatefulChatClient via chatClient.getChatThreadClient(chatThreadId) API.\n * Consider using {@link createAzureCommunicationCallWithChatAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapterFromClients = async ({\n callClient,\n callAgent,\n callLocator,\n chatClient,\n chatThreadClient,\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter> => {\n const callAdapter = await createAzureCommunicationCallAdapterFromClient(\n callClient,\n callAgent,\n callLocator,\n\n callAdapterOptions\n );\n const chatAdapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * Create a {@link CallWithChatAdapter} from the underlying adapters.\n *\n * This is an internal factory function used by browser tests to inject fake adapters for call and chat.\n *\n * @internal\n */\nexport const _createAzureCommunicationCallWithChatAdapterFromAdapters = (\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapter => new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n\nconst isTeamsMeetingLocator = (\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator\n): locator is TeamsMeetingLinkLocator | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator => {\n return 'meetingLink' in locator || 'meetingId' in locator;\n};\n\nconst _createChatThreadAdapterInner = (\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator,\n adapter: Promise<CallAdapter>\n): ChatThreadProvider => {\n if ('meetingLink' in locator) {\n return new TeamsMeetingLinkProvider(locator, /** @conditional-compile-remove(meeting-id) */ adapter);\n }\n /** @conditional-compile-remove(meeting-id) */\n if ('meetingId' in locator) {\n return new TeamsMeetingIdProvider(locator, adapter);\n }\n return new CallAndChatProvider(locator);\n};\n"]}
1
+ {"version":3,"file":"AzureCommunicationCallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAkDlC,OAAO,EACL,yCAAyC,EAEzC,iDAAiD,EACjD,iDAAiD,EAClD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,6CAA6C,EAC7C,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,6CAA6C;AAC7C,OAAO,EAEL,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAM7D,OAAO,EAAE,yCAAyC,EAAE,MAAM,2DAA2D,CAAC;AAEtH,OAAO,EAEL,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AAInE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,O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,CACtE,WAAwB,EACxB,WAAwB,EACH,EAAE,CAAC,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9F,MAAM,qBAAqB,GAAG,CAC5B,OAGwE,EACmC,EAAE;IAC7G,OAAO,aAAa,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CACpC,OAGwE,EACxE,OAA6B,EACT,EAAE;IACtB,IAAI,aAAa,IAAI,OAAO,EAAE,CAAC;QAC7B,OAAO,IAAI,wBAAwB,CAAC,OAAO,EAAE,8CAA8C,CAAC,OAAO,CAAC,CAAC;IACvG,CAAC;IACD,8CAA8C;IAC9C,IAAI,WAAW,IAAI,OAAO,EAAE,CAAC;QAC3B,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n\nimport {\n AudioDeviceInfo,\n Call,\n CallAgent,\n GroupCallLocator,\n PermissionConstraints,\n PropertyChangedEvent,\n TeamsMeetingLinkLocator,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(meeting-id) */\nimport { TeamsMeetingIdLocator } from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-upload) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport {\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n IsMutedChangedListener,\n CallIdChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n DisplayNameChangedListener,\n IsSpeakingChangedListener,\n CallAdapter,\n CallAdapterState,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageReceivedListener,\n MessageReadListener,\n ChatAdapter,\n ChatAdapterState,\n ParticipantsRemovedListener,\n ParticipantsAddedListener,\n MessageEditedListener,\n MessageDeletedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapter, CallWithChatEvent, ChatInitializedListener } from './CallWithChatAdapter';\nimport {\n callWithChatAdapterStateFromBackingStates,\n CallWithChatAdapterState,\n mergeCallAdapterStateIntoCallWithChatAdapterState,\n mergeChatAdapterStateIntoCallWithChatAdapterState\n} from '../state/CallWithChatAdapterState';\nimport {\n _createAzureCommunicationChatAdapterInner,\n _createLazyAzureCommunicationChatAdapterInner,\n createAzureCommunicationChatAdapterFromClient\n} from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';\nimport { EventEmitter } from 'events';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { getChatThreadFromTeamsLink } from './parseTeamsUrl';\nimport { AdapterError } from '../../common/adapters';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { CallParticipantsLocator } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport { _createAzureCommunicationCallAdapterInner } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport {\n CallAdapterLocator,\n createAzureCommunicationCallAdapterFromClient\n} from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport { StatefulCallClient } from '@internal/calling-stateful-client';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatThreadClient } from '@azure/communication-chat';\nimport { useEffect, useRef, useState } from 'react';\nimport { _toCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\n\nimport { AzureCommunicationCallAdapterOptions } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport {\n IsCaptionsActiveChangedListener,\n CaptionsReceivedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(spotlight) */\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\ntype CallWithChatAdapterStateChangedHandler = (newState: CallWithChatAdapterState) => void;\n\n/** Context of Call with Chat, which is a centralized context for all state updates */\nclass CallWithChatContext {\n private emitter = new EventEmitter();\n private state: CallWithChatAdapterState;\n\n constructor(clientState: CallWithChatAdapterState, maxListeners = 50) {\n this.state = clientState;\n this.emitter.setMaxListeners(maxListeners);\n }\n\n public onStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallWithChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallWithChatAdapterState {\n return this.state;\n }\n\n public updateClientState(clientState: CallWithChatAdapterState): void {\n this.setState(clientState);\n }\n\n public updateClientStateWithChatState(chatAdapterState: ChatAdapterState): void {\n this.updateClientState(mergeChatAdapterStateIntoCallWithChatAdapterState(this.state, chatAdapterState));\n }\n\n public updateClientStateWithCallState(callAdapterState: CallAdapterState): void {\n this.updateClientState(mergeCallAdapterStateIntoCallWithChatAdapterState(this.state, callAdapterState));\n }\n}\n\n/**\n * CallWithChat adapter backed by Azure Communication Services.\n * Created for easy use with the {@link CallWithChatComposite}.\n */\nexport class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapter {\n private callAdapter: CallAdapter;\n private chatAdapter: ChatAdapter | undefined;\n private context: CallWithChatContext;\n private emitter: EventEmitter = new EventEmitter();\n private onChatStateChange: (newChatAdapterState: ChatAdapterState) => void;\n private onCallStateChange: (newChatAdapterState: CallAdapterState) => void;\n private isAdapterDisposed: boolean = false;\n\n constructor(callAdapter: CallAdapter, chatAdapter?: ChatAdapter) {\n this.bindPublicMethods();\n this.callAdapter = callAdapter;\n this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter));\n\n const onChatStateChange = (newChatAdapterState: ChatAdapterState): void => {\n this.context.updateClientStateWithChatState(newChatAdapterState);\n };\n\n this.onChatStateChange = onChatStateChange;\n if (chatAdapter) {\n this.updateChatAdapter(chatAdapter);\n }\n\n const onCallStateChange = (newCallAdapterState: CallAdapterState): void => {\n this.context.updateClientStateWithCallState(newCallAdapterState);\n };\n\n this.callAdapter.onStateChange(onCallStateChange);\n this.onCallStateChange = onCallStateChange;\n }\n\n public setChatAdapterPromise(chatAdapter: Promise<ChatAdapter>): void {\n chatAdapter.then((adapter) => {\n if (!this.isAdapterDisposed) {\n this.updateChatAdapter(adapter);\n }\n });\n }\n\n private updateChatAdapter(chatAdapter: ChatAdapter): void {\n this.chatAdapter = chatAdapter;\n this.chatAdapter.onStateChange(this.onChatStateChange);\n this.context.updateClientStateWithChatState(chatAdapter.getState());\n this.emitter.emit('chatInitialized', this.chatAdapter);\n }\n\n private bindPublicMethods(): void {\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.startCall.bind(this);\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.raiseHand.bind(this);\n this.lowerHand.bind(this);\n this.onReactionClick.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.disposeScreenShareStreamView.bind(this);\n this.fetchInitialData.bind(this);\n this.sendMessage.bind(this);\n this.sendReadReceipt.bind(this);\n this.sendTypingIndicator.bind(this);\n this.loadPreviousChatMessages.bind(this);\n this.updateMessage.bind(this);\n this.deleteMessage.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n this.sendDtmfTone.bind(this);\n /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.bind(this);\n this.startCaptions.bind(this);\n this.stopCaptions.bind(this);\n this.setSpokenLanguage.bind(this);\n this.setCaptionLanguage.bind(this);\n this.startVideoBackgroundEffect.bind(this);\n\n this.stopVideoBackgroundEffects.bind(this);\n\n this.updateBackgroundPickerImages.bind(this);\n }\n\n /** Join existing Call. */\n public joinCall(options?: boolean | JoinCallOptions): Call | undefined {\n if (typeof options === 'boolean') {\n return this.callAdapter.joinCall(options);\n } else {\n return this.callAdapter.joinCall(options);\n }\n }\n /** Leave current Call. */\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n // Only remove self from the GroupCall. Contoso must manage access to Chat.\n await this.callAdapter.leaveCall(forEveryone);\n }\n\n /** Start a new Call. */\n public startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: StartCallIdentifier[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: string[] | StartCallIdentifier[], options?: StartCallOptions): Call | undefined {\n if (participants.length === 0) {\n throw new Error('At least one participant is required to start a call');\n }\n if (typeof participants[0] === 'string') {\n return this.callAdapter.startCall(participants as string[], options);\n } else {\n return this.callAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n }\n /**\n * Subscribe to state change events.\n * @param handler - handler to be called when the state changes. This is passed the new state.\n */\n public onStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n /**\n * Unsubscribe to state change events.\n * @param handler - handler to be no longer called when state changes.\n */\n public offStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n /** Get current Call and Chat state. */\n public getState(): CallWithChatAdapterState {\n return this.context.getState();\n }\n /** Dispose of the current CallWithChatAdapter. */\n public dispose(): void {\n this.isAdapterDisposed = true;\n if (this.chatAdapter) {\n this.chatAdapter.offStateChange(this.onChatStateChange);\n this.chatAdapter.dispose();\n }\n this.callAdapter.offStateChange(this.onCallStateChange);\n this.callAdapter.dispose();\n }\n /** Remove a participant from the Call only. */\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callAdapter.removeParticipant(participant);\n }\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.setCamera(device, options);\n }\n /** Set the microphone to be used in the Call. */\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setMicrophone(device);\n }\n /** Set the speaker to be used in the Call. */\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setSpeaker(device);\n }\n public async askDevicePermission(constraints: PermissionConstraints): Promise<void> {\n await this.callAdapter.askDevicePermission(constraints);\n }\n /** Query for available cameras. */\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.callAdapter.queryCameras();\n }\n /** Query for available microphones. */\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.queryMicrophones();\n }\n /** Query for available speakers. */\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.querySpeakers();\n }\n /** Start the camera for the user in the Call. */\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.startCamera(options);\n }\n /** Stop the camera for the user in the Call. */\n public async stopCamera(): Promise<void> {\n await this.callAdapter.stopCamera();\n }\n /** Mute the user in the Call. */\n public async mute(): Promise<void> {\n await this.callAdapter.mute();\n }\n /** Unmute the user in the Call. */\n public async unmute(): Promise<void> {\n await this.callAdapter.unmute();\n }\n /** Trigger the user to start screen share. */\n public async startScreenShare(): Promise<void> {\n await this.callAdapter.startScreenShare();\n }\n /** Stop the current active screen share. */\n public async stopScreenShare(): Promise<void> {\n await this.callAdapter.stopScreenShare();\n }\n /** Raise hand for local user. */\n public async raiseHand(): Promise<void> {\n await this.callAdapter.raiseHand();\n }\n /** Lower hand for local user. */\n public async lowerHand(): Promise<void> {\n await this.callAdapter.lowerHand();\n }\n /** Reaction clicked by the local user. */\n public async onReactionClick(reaction: Reaction): Promise<void> {\n await this.callAdapter.onReactionClick(reaction);\n }\n /** Create a stream view for a remote participants video feed. */\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n return await this.callAdapter.createStreamView(remoteUserId, options);\n }\n /** Dispose of a created stream view of a remote participants video feed. */\n public async disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.disposeStreamView(remoteUserId, options);\n }\n /** Dispose of a remote screen share */\n public async disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n /** Dispose of a remote video stream */\n public async disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n /** Dispose of the local video stream */\n public async disposeLocalVideoStreamView(): Promise<void> {\n await this.callAdapter.disposeLocalVideoStreamView();\n }\n /** Fetch initial Call and Chat data such as chat messages. */\n public async fetchInitialData(): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.fetchInitialData();\n });\n }\n /** Send a chat message. */\n public async sendMessage(\n content: string,\n /* @conditional-compile-remove(attachment-upload) */\n options?: MessageOptions\n ): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendMessage(content, /* @conditional-compile-remove(attachment-upload) */ options);\n });\n }\n /** Send a chat read receipt. */\n public async sendReadReceipt(chatMessageId: string): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendReadReceipt(chatMessageId);\n });\n }\n /** Send an isTyping indicator. */\n public async sendTypingIndicator(): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.sendTypingIndicator();\n });\n }\n /** Load previous Chat messages. */\n public async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.loadPreviousChatMessages(messagesToLoad);\n });\n }\n /** Update an existing message. */\n public async updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(attachment-upload) */ MessageOptions\n ): Promise<void> {\n return this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.updateMessage(messageId, content, options);\n });\n }\n /** Delete an existing message. */\n public async deleteMessage(messageId: string): Promise<void> {\n return await this.executeWithResolvedChatAdapter((adapter) => {\n return adapter.deleteMessage(messageId);\n });\n }\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.downloadResourceToCache(resourceDetails);\n });\n }\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.removeResourceFromCache(resourceDetails);\n });\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n return await this.callAdapter.holdCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n return await this.callAdapter.resumeCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isCommunicationUserIdentifier(participant)) {\n return await this.callAdapter.addParticipant(participant);\n } else {\n return await this.callAdapter.addParticipant(participant, options);\n }\n }\n\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n return await this.callAdapter.sendDtmfTone(dtmfTone);\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callAdapter.allowUnsupportedBrowserVersion();\n }\n\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n await this.callAdapter.startCaptions(options);\n }\n\n public async stopCaptions(): Promise<void> {\n await this.callAdapter.stopCaptions();\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callAdapter.setSpokenLanguage(language);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n return await this.callAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callAdapter.submitSurvey(survey);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.startSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.stopSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopAllSpotlight(): Promise<void> {\n return this.callAdapter.stopAllSpotlight();\n }\n\n /* @conditional-compile-remove(soft-mute) */\n public async muteParticipant(userId: string): Promise<void> {\n return this.callAdapter.muteParticipant(userId);\n }\n\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: CallWithChatEvent, listener: any): void {\n switch (event) {\n case 'callParticipantsJoined':\n this.callAdapter.on('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.on('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.on('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.on('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.on('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.on('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.on('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.on('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.on('selectedSpeakerChanged', listener);\n break;\n case 'captionsReceived':\n this.callAdapter.on('captionsReceived', listener);\n break;\n case 'isCaptionsActiveChanged':\n this.callAdapter.on('isCaptionsActiveChanged', listener);\n break;\n case 'isCaptionLanguageChanged':\n this.callAdapter.on('isCaptionLanguageChanged', listener);\n break;\n case 'isSpokenLanguageChanged':\n this.callAdapter.on('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageReceived', listener);\n });\n break;\n case 'messageEdited':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageEdited', listener);\n });\n break;\n case 'messageDeleted':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageDeleted', listener);\n });\n break;\n case 'messageSent':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageSent', listener);\n });\n break;\n case 'messageRead':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('messageRead', listener);\n });\n break;\n case 'chatParticipantsAdded':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('participantsAdded', listener);\n });\n break;\n case 'chatParticipantsRemoved':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('participantsRemoved', listener);\n });\n break;\n case 'callError':\n this.callAdapter.on('error', listener);\n break;\n case 'chatError':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.on('error', listener);\n });\n break;\n case 'chatInitialized':\n this.emitter.on(event, listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: CallWithChatEvent, listener: any): void {\n switch (event as unknown) {\n case 'callParticipantsJoined':\n this.callAdapter.off('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.off('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.off('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.off('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.off('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.off('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.off('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.off('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.off('selectedSpeakerChanged', listener);\n break;\n case 'captionsReceived':\n this.callAdapter.off('captionsReceived', listener);\n break;\n case 'isCaptionsActiveChanged':\n this.callAdapter.off('isCaptionsActiveChanged', listener);\n break;\n case 'isCaptionLanguageChanged':\n this.callAdapter.off('isCaptionLanguageChanged', listener);\n break;\n case 'isSpokenLanguageChanged':\n this.callAdapter.off('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageReceived', listener);\n });\n break;\n case 'messageEdited':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageEdited', listener);\n });\n break;\n case 'messageDeleted':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageDeleted', listener);\n });\n break;\n case 'messageSent':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageSent', listener);\n });\n break;\n case 'messageRead':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('messageRead', listener);\n });\n break;\n case 'chatParticipantsAdded':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('participantsAdded', listener);\n });\n break;\n case 'chatParticipantsRemoved':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('participantsRemoved', listener);\n });\n break;\n case 'callError':\n this.callAdapter.off('error', listener);\n break;\n case 'chatError':\n this.executeWithResolvedChatAdapter((adapter) => {\n adapter.off('error', listener);\n });\n break;\n case 'chatInitialized':\n this.emitter.off(event, listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private executeWithResolvedChatAdapter(callback: (adapter: ChatAdapter) => any): any {\n if (!this.chatAdapter) {\n console.error('Chat is not initialized');\n } else {\n return callback(this.chatAdapter);\n }\n }\n}\n\n/**\n * Provides a way to get the chat thread ID for a given locator.\n *\n * @private\n */\nexport interface ChatThreadProvider {\n isCallInfoRequired(): boolean;\n getChatThreadPromise(): Promise<string>;\n getChatThread(): string;\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Group Call with an associated Chat thread.\n * @private\n */\nexport class CallAndChatProvider implements ChatThreadProvider {\n public locator: CallAndChatLocator;\n\n constructor(locator: CallAndChatLocator) {\n this.locator = locator;\n }\n public isCallInfoRequired(): boolean {\n return false;\n }\n public async getChatThreadPromise(): Promise<string> {\n return this.getChatThread();\n }\n\n public getChatThread(): string {\n return this.locator.chatThreadId;\n }\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting with an associated Chat thread.\n *\n * @private\n */\nexport class TeamsMeetingLinkProvider implements ChatThreadProvider {\n public locator: TeamsMeetingLinkLocator;\n /** @conditional-compile-remove(meeting-id) */\n private callAdapterPromise: Promise<CallAdapter>;\n /** @conditional-compile-remove(meeting-id) */\n private callAdapterSubscription?: (state: CallAdapterState) => void;\n\n constructor(\n locator: TeamsMeetingLinkLocator,\n /** @conditional-compile-remove(meeting-id) */ callAdapterPromise: Promise<CallAdapter>\n ) {\n this.locator = locator;\n /** @conditional-compile-remove(meeting-id) */\n this.callAdapterPromise = callAdapterPromise;\n }\n\n public isCallInfoRequired(): boolean {\n return true;\n }\n\n public getChatThread(): string {\n /** @conditional-compile-remove(meeting-id) */\n throw new Error('Chat thread ID should be retrieved from call.callInfo using method getChatThreadPromise');\n return getChatThreadFromTeamsLink(this.locator.meetingLink);\n }\n\n public async getChatThreadPromise(): Promise<string> {\n /** @conditional-compile-remove(meeting-id) */\n {\n // Wait for the call to be connected and get the chat thread ID from `call.callInfo`.\n const chatThreadPromise = new Promise<string>((resolve) => {\n this.callAdapterPromise.then((callAdapter) => {\n // Ensure function is idempotent by removing any existing subscription.\n this.callAdapterSubscription && callAdapter.offStateChange(this.callAdapterSubscription);\n\n this.callAdapterSubscription = (state: CallAdapterState): void => {\n if (state.call?.state === 'Connected' && state.call.info?.threadId) {\n this.callAdapterSubscription && callAdapter.offStateChange(this.callAdapterSubscription);\n this.callAdapterSubscription = undefined;\n\n resolve(state.call.info?.threadId);\n }\n };\n callAdapter.onStateChange(this.callAdapterSubscription);\n });\n });\n\n return chatThreadPromise;\n }\n\n return getChatThreadFromTeamsLink(this.locator.meetingLink);\n }\n}\n\n/** @conditional-compile-remove(meeting-id) */\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Teams meeting using meeting id.\n *\n * @private\n */\nexport class TeamsMeetingIdProvider implements ChatThreadProvider {\n public locator: TeamsMeetingIdLocator;\n private callAdapter: Promise<CallAdapter>;\n\n constructor(locator: TeamsMeetingIdLocator, callAdapter: Promise<CallAdapter>) {\n this.locator = locator;\n this.callAdapter = callAdapter;\n }\n public isCallInfoRequired(): boolean {\n return true;\n }\n public getChatThread(): string {\n throw new Error('Chat thread ID is not available for Teams meeting ID');\n }\n\n /**\n * Wait call to be connected to get thread ID.\n * @returns the chat thread ID for the given meeting ID.\n */\n public async getChatThreadPromise(): Promise<string> {\n return new Promise<string>((resolve) => {\n const stateChangeListener = (state: CallAdapterState): void => {\n if (state.call?.state === 'Connected' && state.call.info?.threadId) {\n this.callAdapter.then((adapter) => {\n adapter.offStateChange(stateChangeListener);\n });\n resolve(state.call.info?.threadId);\n }\n };\n\n this.callAdapter.then((adapter) => {\n const callState = adapter.getState().call?.state;\n const threadId = adapter.getState().call?.info?.threadId;\n if (callState === 'Connected' && threadId) {\n resolve(threadId);\n } else {\n adapter.onStateChange(stateChangeListener);\n }\n });\n });\n }\n}\n\n/**\n * Combination of available adapters for use in {@link createAzureCommunicationCallWithChatAdapter}.\n * @public\n */\nexport type CommunicationAdapter =\n | CallAndChatProvider\n | TeamsMeetingLinkProvider\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdProvider;\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Call with an associated Chat thread.\n *\n * @public\n */\nexport interface CallAndChatLocator {\n /** Locator used by {@link createAzureCommunicationCallWithChatAdapter} to locate the call to join */\n callLocator: GroupCallLocator | /* @conditional-compile-remove(teams-adhoc-call) */ CallParticipantsLocator;\n /** Chat thread ID used by {@link createAzureCommunicationCallWithChatAdapter} to locate the chat thread to join */\n chatThreadId: string;\n}\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapter}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a CallWithChatAdapter backed by Azure Communication services\n * to plug into the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapter = async ({\n userId,\n displayName,\n credential,\n endpoint,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter> => {\n const callAdapterLocator = isTeamsMeetingLocator(locator) ? locator : locator.callLocator;\n const callAdapter = _createAzureCommunicationCallAdapterInner({\n userId,\n displayName,\n credential,\n locator: callAdapterLocator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n options: callAdapterOptions,\n telemetryImplementationHint: 'CallWithChat' as _TelemetryImplementationHint\n });\n\n const chatThreadAdapter = _createChatThreadAdapterInner(locator, callAdapter);\n if (chatThreadAdapter.isCallInfoRequired()) {\n const callWithChatAdapter = new AzureCommunicationCallWithChatAdapter(await callAdapter);\n const chatAdapterPromise = _createLazyAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n chatThreadAdapter.getChatThreadPromise(),\n 'CallWithChat' as _TelemetryImplementationHint\n );\n callWithChatAdapter.setChatAdapterPromise(chatAdapterPromise);\n return callWithChatAdapter;\n } else {\n const chatAdapter = _createAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n chatThreadAdapter.getChatThread(),\n 'CallWithChat' as _TelemetryImplementationHint\n );\n\n return new AzureCommunicationCallWithChatAdapter(await callAdapter, await chatAdapter);\n }\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallWithChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallWithChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallWithChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallWithChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallWithChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>\n): CallWithChatAdapter | undefined => {\n const {\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallWithChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallWithChatAdapter | undefined>(undefined);\n const creatingAdapterRef = useRef<boolean>(false);\n\n const afterCreateRef = useRef<((adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>) | undefined>(\n undefined\n );\n const beforeDisposeRef = useRef<((adapter: CallWithChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n if (creatingAdapterRef.current) {\n console.warn(\n 'Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page'\n );\n return;\n }\n creatingAdapterRef.current = true;\n let newAdapter = await createAzureCommunicationCallWithChatAdapter({\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n callAdapterOptions\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n callAdapterOptions\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapterFromClient}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterFromClientArgs = {\n callLocator: CallAdapterLocator | TeamsMeetingLinkLocator;\n callAgent: CallAgent;\n callClient: StatefulCallClient;\n chatClient: StatefulChatClient;\n chatThreadClient: ChatThreadClient;\n\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient} and {@link StatefulCallClient}.\n * Please note that chatThreadClient has to be created by StatefulChatClient via chatClient.getChatThreadClient(chatThreadId) API.\n * Consider using {@link createAzureCommunicationCallWithChatAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapterFromClients = async ({\n callClient,\n callAgent,\n callLocator,\n chatClient,\n chatThreadClient,\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter> => {\n const callAdapter = await createAzureCommunicationCallAdapterFromClient(\n callClient,\n callAgent,\n callLocator,\n\n callAdapterOptions\n );\n const chatAdapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * Create a {@link CallWithChatAdapter} from the underlying adapters.\n *\n * This is an internal factory function used by browser tests to inject fake adapters for call and chat.\n *\n * @internal\n */\nexport const _createAzureCommunicationCallWithChatAdapterFromAdapters = (\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapter => new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n\nconst isTeamsMeetingLocator = (\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator\n): locator is TeamsMeetingLinkLocator | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator => {\n return 'meetingLink' in locator || 'meetingId' in locator;\n};\n\nconst _createChatThreadAdapterInner = (\n locator:\n | CallAndChatLocator\n | TeamsMeetingLinkLocator\n | /** @conditional-compile-remove(meeting-id) */ TeamsMeetingIdLocator,\n adapter: Promise<CallAdapter>\n): ChatThreadProvider => {\n if ('meetingLink' in locator) {\n return new TeamsMeetingLinkProvider(locator, /** @conditional-compile-remove(meeting-id) */ adapter);\n }\n /** @conditional-compile-remove(meeting-id) */\n if ('meetingId' in locator) {\n return new TeamsMeetingIdProvider(locator, adapter);\n }\n return new CallAndChatProvider(locator);\n};\n"]}