@azure/communication-react 1.18.0-alpha-202406250013 → 1.18.0-alpha-202406260014
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.
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-D8CIuj9U.js → ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js} +2 -2
 - package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-D8CIuj9U.js.map → ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js.map} +1 -1
 - package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D0jx96DX.js → RichTextSendBoxWrapper-D-KYGmZ9.js} +2 -2
 - package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D0jx96DX.js.map → RichTextSendBoxWrapper-D-KYGmZ9.js.map} +1 -1
 - package/dist/dist-cjs/communication-react/{index-D40Kfey5.js → index-DCf8u3Nr.js} +33 -9
 - package/dist/dist-cjs/communication-react/index-DCf8u3Nr.js.map +1 -0
 - package/dist/dist-cjs/communication-react/index.js +1 -1
 - package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
 - package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +1 -1
 - package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +6 -2
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.d.ts +2 -0
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +20 -0
 - package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
 - package/package.json +6 -6
 - package/dist/dist-cjs/communication-react/index-D40Kfey5.js.map +0 -1
 
| 
         @@ -4,7 +4,7 @@ var react = require('@fluentui/react'); 
     | 
|
| 
       4 
4 
     | 
    
         
             
            var reactChat = require('@fluentui-contrib/react-chat');
         
     | 
| 
       5 
5 
     | 
    
         
             
            var reactComponents = require('@fluentui/react-components');
         
     | 
| 
       6 
6 
     | 
    
         
             
            require('@azure/communication-common');
         
     | 
| 
       7 
     | 
    
         
            -
            var index = require('./index- 
     | 
| 
      
 7 
     | 
    
         
            +
            var index = require('./index-DCf8u3Nr.js');
         
     | 
| 
       8 
8 
     | 
    
         
             
            var React = require('react');
         
     | 
| 
       9 
9 
     | 
    
         
             
            require('reselect');
         
     | 
| 
       10 
10 
     | 
    
         
             
            require('@azure/communication-calling');
         
     | 
| 
         @@ -151,4 +151,4 @@ const ChatMessageComponentAsRichTextEditBox = (props) => { 
     | 
|
| 
       151 
151 
     | 
    
         | 
| 
       152 
152 
     | 
    
         
             
            exports.ChatMessageComponentAsRichTextEditBox = ChatMessageComponentAsRichTextEditBox;
         
     | 
| 
       153 
153 
     | 
    
         
             
            exports.default = ChatMessageComponentAsRichTextEditBox;
         
     | 
| 
       154 
     | 
    
         
            -
            //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox- 
     | 
| 
      
 154 
     | 
    
         
            +
            //# sourceMappingURL=ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-D8CIuj9U.js","sources":["../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\nimport {\n  getMessageState,\n  onRenderCancelIcon,\n  onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport {\n  attachmentMetadataReducer,\n  getMessageWithAttachmentMetadata,\n  doesMessageContainMultipleAttachments\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n  onCancel?: (messageId: string) => void;\n  onSubmit: (\n    text: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata?: AttachmentMetadata[]\n  ) => void;\n  message: ChatMessage;\n  strings: MessageThreadStrings;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onPaste?: (event: { content: DocumentFragment }) => void;\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n  props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n  const {\n    onCancel,\n    onSubmit,\n    strings,\n    message,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    onPaste\n  } = props;\n\n  const [textValue, setTextValue] = useState<string>(message.content || '');\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const [attachmentMetadata, handleAttachmentAction] = useReducer(\n    attachmentMetadataReducer,\n    getMessageWithAttachmentMetadata(message) ?? []\n  );\n  const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n  const theme = useTheme();\n  const messageState = useMemo(() => {\n    return getMessageState(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata ?? []);\n  }, [/* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata, textValue]);\n\n  const submitEnabled = messageState === 'OK';\n\n  const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n  const chatMyMessageStyles = useChatMyMessageStyles();\n  const locale = useLocale().strings;\n\n  const setText = useCallback((newValue?: string): void => {\n    setTextValue(newValue ?? '');\n  }, []);\n\n  useEffect(() => {\n    editTextFieldRef.current?.focus();\n  }, []);\n\n  const textTooLongMessage = useMemo(() => {\n    return messageState === 'too long'\n      ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n      : undefined;\n  }, [messageState, strings.editBoxTextLimit]);\n\n  const iconClassName = useCallback(\n    (isHover: boolean) => {\n      const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n      return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n    },\n    [theme.palette.accent, theme.palette.neutralSecondary]\n  );\n\n  const onRenderThemedCancelIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderCancelIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  const onRenderThemedSubmitIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderSubmitIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const hasMultipleAttachments = useMemo(() => {\n    return doesMessageContainMultipleAttachments(message);\n  }, [message]);\n\n  const actionButtons = useMemo(() => {\n    return (\n      <Stack horizontal>\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxCancelButton}\n          tooltipContent={strings.editBoxCancelButton}\n          onRenderIcon={onRenderThemedCancelIcon}\n          onClick={() => {\n            onCancel && onCancel(message.messageId);\n          }}\n          id={'dismissIconWrapper'}\n          data-testId={strings.editBoxCancelButton}\n        />\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxSubmitButton}\n          tooltipContent={strings.editBoxSubmitButton}\n          onRenderIcon={onRenderThemedSubmitIcon}\n          onClick={(e) => {\n            // it's very important to pass an empty attachment here\n            // so when user removes all attachments, UI can reflect it instantly\n            // if you set it to undefined, the attachments pre-edited would still be there\n            // until edit message event is received\n            submitEnabled &&\n              onSubmit(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata);\n            e.stopPropagation();\n          }}\n          id={'submitIconWrapper'}\n          data-testId={strings.editBoxSubmitButton}\n        />\n      </Stack>\n    );\n  }, [\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata,\n    message.messageId,\n    onCancel,\n    onRenderThemedCancelIcon,\n    onRenderThemedSubmitIcon,\n    onSubmit,\n    strings.editBoxCancelButton,\n    strings.editBoxSubmitButton,\n    submitEnabled,\n    textValue\n  ]);\n  const richTextLocaleStrings = useMemo(() => {\n    /* @conditional-compile-remove(rich-text-editor) */\n    return { ...locale.richTextSendBox, ...strings };\n    return locale.sendBox;\n  }, [\n    /* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox,\n    /* @conditional-compile-remove(rich-text-editor) */ strings,\n    locale.sendBox\n  ]);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onCancelAttachmentUpload = useCallback((attachmentId: string) => {\n    // edit box only capable of removing attachments\n    // we need to expand attachment actions\n    // if we want to support more actions e.g. add\n    handleAttachmentAction({ type: 'remove', id: attachmentId });\n  }, []);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onRenderAttachmentUploads = useCallback(() => {\n    return (\n      <Stack className={attachmentUploadCardsStyles}>\n        <FluentV9ThemeProvider v8Theme={theme}>\n          <_AttachmentUploadCards\n            attachments={attachmentMetadata}\n            onCancelAttachmentUpload={onCancelAttachmentUpload}\n          />\n        </FluentV9ThemeProvider>\n      </Stack>\n    );\n  }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n  const getContent = (): JSX.Element => {\n    return (\n      <Stack className={mergeStyles(editBoxWidthStyles)}>\n        <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n        <RichTextInputBoxComponent\n          placeholderText={strings.editBoxPlaceholderText}\n          onChange={setText}\n          editorComponentRef={editTextFieldRef}\n          initialContent={message.content}\n          strings={richTextLocaleStrings}\n          disabled={false}\n          actionComponents={actionButtons}\n          richTextEditorStyleProps={editBoxRichTextEditorStyle}\n          isHorizontalLayoutDisabled={true}\n          /* @conditional-compile-remove(file-sharing-acs) */\n          onRenderAttachmentUploads={onRenderAttachmentUploads}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */\n          onPaste={onPaste}\n        />\n      </Stack>\n    );\n  };\n\n  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n  return (\n    <ChatMyMessage\n      attached={attached}\n      root={{\n        className: mergeClasses(\n          chatMyMessageStyles.root,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined\n        )\n      }}\n      body={{\n        className: mergeClasses(\n          editContainerStyles.body,\n          attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n        )\n      }}\n    >\n      {getContent()}\n    </ChatMyMessage>\n  );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"],"names":["useState","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAuDA;;AAEG;AACU,MAAA,qCAAqC,GAAG,CACnD,KAAiD,KAClC;;AACf,IAAA,MAAM,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO;;IAEP,OAAO,EACR,GAAG,KAAK,CAAC;AAEV,IAAA,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAGA,cAAQ,CAAS,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;;AAE1E,IAAA,MAAM,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,GAAGC,gBAAU,CAC7DC,+BAAyB,EACzB,CAAA,EAAA,GAAAC,sCAAgC,CAAC,OAAO,CAAC,MAAI,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAA,EAAE,CAChD,CAAC;IACF,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAA6B,IAAI,CAAC,CAAC;AACxE,IAAA,MAAM,KAAK,GAAGC,cAAQ,EAAE,CAAC;AACzB,IAAA,MAAM,YAAY,GA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AE;AACJ,YAAA,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI;;YAExB,sBAAsB,GAAG,mBAAmB,CAAC,mBAAmB,GAAG,SAAS,CAC7E;AACF,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEA,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
         
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js","sources":["../../../../react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { ChatMyMessage } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useTheme } from '../../../theming';\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { editBoxWidthStyles, richTextEditBoxActionButtonIcon } from '../../styles/EditBox.styles';\nimport { InputBoxButton } from '../../InputBoxButton';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { useChatMyMessageStyles } from '../../styles/MessageThread.styles';\nimport { ChatMessage } from '../../../types';\nimport { _AttachmentUploadCards } from '../../Attachment/AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { useChatMessageRichTextEditContainerStyles } from '../../styles/ChatMessageComponent.styles';\nimport { MAXIMUM_LENGTH_OF_MESSAGE } from '../../utils/SendBoxUtils';\nimport {\n  getMessageState,\n  onRenderCancelIcon,\n  onRenderSubmitIcon\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport {\n  attachmentMetadataReducer,\n  getMessageWithAttachmentMetadata,\n  doesMessageContainMultipleAttachments\n} from '../../utils/ChatMessageComponentAsEditBoxUtils';\nimport { RichTextEditorComponentRef } from '../../RichTextEditor/RichTextEditor';\nimport { RichTextInputBoxComponent } from '../../RichTextEditor/RichTextInputBoxComponent';\nimport { editBoxRichTextEditorStyle, richTextActionButtonsStyle } from '../../styles/RichTextEditor.styles';\nimport { RichTextSendBoxErrors } from '../../RichTextEditor/RichTextSendBoxErrors';\nimport { useLocale } from '../../../localization';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { FluentV9ThemeProvider } from '../../../theming/FluentV9ThemeProvider';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { attachmentUploadCardsStyles } from '../../styles/SendBox.styles';\n\n/** @private */\nexport type ChatMessageComponentAsRichTextEditBoxProps = {\n  onCancel?: (messageId: string) => void;\n  onSubmit: (\n    text: string,\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata?: AttachmentMetadata[]\n  ) => void;\n  message: ChatMessage;\n  strings: MessageThreadStrings;\n  /* @conditional-compile-remove(rich-text-editor-image-upload) */\n  onPaste?: (event: { content: DocumentFragment }) => void;\n};\n\n/**\n * @private\n */\nexport const ChatMessageComponentAsRichTextEditBox = (\n  props: ChatMessageComponentAsRichTextEditBoxProps\n): JSX.Element => {\n  const {\n    onCancel,\n    onSubmit,\n    strings,\n    message,\n    /* @conditional-compile-remove(rich-text-editor-image-upload) */\n    onPaste\n  } = props;\n\n  const [textValue, setTextValue] = useState<string>(message.content || '');\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const [attachmentMetadata, handleAttachmentAction] = useReducer(\n    attachmentMetadataReducer,\n    getMessageWithAttachmentMetadata(message) ?? []\n  );\n  const editTextFieldRef = React.useRef<RichTextEditorComponentRef>(null);\n  const theme = useTheme();\n  const messageState = useMemo(() => {\n    return getMessageState(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata ?? []);\n  }, [/* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata, textValue]);\n\n  const submitEnabled = messageState === 'OK';\n\n  const editContainerStyles = useChatMessageRichTextEditContainerStyles();\n  const chatMyMessageStyles = useChatMyMessageStyles();\n  const locale = useLocale().strings;\n\n  const setText = useCallback((newValue?: string): void => {\n    setTextValue(newValue ?? '');\n  }, []);\n\n  useEffect(() => {\n    editTextFieldRef.current?.focus();\n  }, []);\n\n  const textTooLongMessage = useMemo(() => {\n    return messageState === 'too long'\n      ? _formatString(strings.editBoxTextLimit, { limitNumber: `${MAXIMUM_LENGTH_OF_MESSAGE}` })\n      : undefined;\n  }, [messageState, strings.editBoxTextLimit]);\n\n  const iconClassName = useCallback(\n    (isHover: boolean) => {\n      const color = isHover ? theme.palette.accent : theme.palette.neutralSecondary;\n      return mergeStyles(richTextEditBoxActionButtonIcon, { color });\n    },\n    [theme.palette.accent, theme.palette.neutralSecondary]\n  );\n\n  const onRenderThemedCancelIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderCancelIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  const onRenderThemedSubmitIcon = useCallback(\n    (isHover: boolean) => {\n      return onRenderSubmitIcon(iconClassName(isHover));\n    },\n    [iconClassName]\n  );\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const hasMultipleAttachments = useMemo(() => {\n    return doesMessageContainMultipleAttachments(message);\n  }, [message]);\n\n  const actionButtons = useMemo(() => {\n    return (\n      <Stack horizontal>\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxCancelButton}\n          tooltipContent={strings.editBoxCancelButton}\n          onRenderIcon={onRenderThemedCancelIcon}\n          onClick={() => {\n            onCancel && onCancel(message.messageId);\n          }}\n          id={'dismissIconWrapper'}\n          data-testId={strings.editBoxCancelButton}\n        />\n        <InputBoxButton\n          className={richTextActionButtonsStyle}\n          ariaLabel={strings.editBoxSubmitButton}\n          tooltipContent={strings.editBoxSubmitButton}\n          onRenderIcon={onRenderThemedSubmitIcon}\n          onClick={(e) => {\n            // it's very important to pass an empty attachment here\n            // so when user removes all attachments, UI can reflect it instantly\n            // if you set it to undefined, the attachments pre-edited would still be there\n            // until edit message event is received\n            submitEnabled &&\n              onSubmit(textValue, /* @conditional-compile-remove(file-sharing-acs) */ attachmentMetadata);\n            e.stopPropagation();\n          }}\n          id={'submitIconWrapper'}\n          data-testId={strings.editBoxSubmitButton}\n        />\n      </Stack>\n    );\n  }, [\n    /* @conditional-compile-remove(file-sharing-acs) */\n    attachmentMetadata,\n    message.messageId,\n    onCancel,\n    onRenderThemedCancelIcon,\n    onRenderThemedSubmitIcon,\n    onSubmit,\n    strings.editBoxCancelButton,\n    strings.editBoxSubmitButton,\n    submitEnabled,\n    textValue\n  ]);\n  const richTextLocaleStrings = useMemo(() => {\n    /* @conditional-compile-remove(rich-text-editor) */\n    return { ...locale.richTextSendBox, ...strings };\n    return locale.sendBox;\n  }, [\n    /* @conditional-compile-remove(rich-text-editor) */ locale.richTextSendBox,\n    /* @conditional-compile-remove(rich-text-editor) */ strings,\n    locale.sendBox\n  ]);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onCancelAttachmentUpload = useCallback((attachmentId: string) => {\n    // edit box only capable of removing attachments\n    // we need to expand attachment actions\n    // if we want to support more actions e.g. add\n    handleAttachmentAction({ type: 'remove', id: attachmentId });\n  }, []);\n\n  /* @conditional-compile-remove(file-sharing-acs) */\n  const onRenderAttachmentUploads = useCallback(() => {\n    return (\n      <Stack className={attachmentUploadCardsStyles}>\n        <FluentV9ThemeProvider v8Theme={theme}>\n          <_AttachmentUploadCards\n            attachments={attachmentMetadata}\n            onCancelAttachmentUpload={onCancelAttachmentUpload}\n          />\n        </FluentV9ThemeProvider>\n      </Stack>\n    );\n  }, [attachmentMetadata, onCancelAttachmentUpload, theme]);\n\n  const getContent = (): JSX.Element => {\n    return (\n      <Stack className={mergeStyles(editBoxWidthStyles)}>\n        <RichTextSendBoxErrors textTooLongMessage={textTooLongMessage} systemMessage={message.failureReason} />\n        <RichTextInputBoxComponent\n          placeholderText={strings.editBoxPlaceholderText}\n          onChange={setText}\n          editorComponentRef={editTextFieldRef}\n          initialContent={message.content}\n          strings={richTextLocaleStrings}\n          disabled={false}\n          actionComponents={actionButtons}\n          richTextEditorStyleProps={editBoxRichTextEditorStyle}\n          isHorizontalLayoutDisabled={true}\n          /* @conditional-compile-remove(file-sharing-acs) */\n          onRenderAttachmentUploads={onRenderAttachmentUploads}\n          /* @conditional-compile-remove(rich-text-editor-image-upload) */\n          onPaste={onPaste}\n        />\n      </Stack>\n    );\n  };\n\n  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n  return (\n    <ChatMyMessage\n      attached={attached}\n      root={{\n        className: mergeClasses(\n          chatMyMessageStyles.root,\n          /* @conditional-compile-remove(file-sharing-acs) */\n          hasMultipleAttachments ? chatMyMessageStyles.multipleAttachments : undefined\n        )\n      }}\n      body={{\n        className: mergeClasses(\n          editContainerStyles.body,\n          attached !== 'top' ? editContainerStyles.bodyAttached : undefined\n        )\n      }}\n    >\n      {getContent()}\n    </ChatMyMessage>\n  );\n};\n\nexport default ChatMessageComponentAsRichTextEditBox;\n"],"names":["useState","useReducer","attachmentMetadataReducer","getMessageWithAttachmentMetadata","useTheme","useMemo","getMessageState","useChatMessageRichTextEditContainerStyles","useChatMyMessageStyles","useLocale","useCallback","useEffect","_formatString","MAXIMUM_LENGTH_OF_MESSAGE","mergeStyles","richTextEditBoxActionButtonIcon","onRenderCancelIcon","onRenderSubmitIcon","doesMessageContainMultipleAttachments","Stack","InputBoxButton","richTextActionButtonsStyle","attachmentUploadCardsStyles","FluentV9ThemeProvider","_AttachmentUploadCards","editBoxWidthStyles","RichTextSendBoxErrors","RichTextInputBoxComponent","editBoxRichTextEditorStyle","ChatMyMessage","mergeClasses"],"mappings":";;;;;;;;;;;;;;;;;;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CAAC,aAAa,EAAI,CAAA;AACvG,YAAA,KAAA,CAAA,aAAA,CAACC,+BAAyB,EACxB,EAAA,eAAe,EAAE,OAAO,CAAC,sBAAsB,EAC/C,QAAQ,EAAE,OAAO,EACjB,kBAAkB,EAAE,gBAAgB,EACpC,cAAc,EAAE,OAAO,CAAC,OAAO,EAC/B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,KAAK,EACf,gBAAgB,EAAE,aAAa,EAC/B,wBAAwB,EAAEC,gCAA0B,EACpD,0BAA0B,EAAE,IAAI;;AAEhC,gBAAA,yBAAyB,EAAE,yBAAyB;;AAEpD,gBAAA,OAAO,EAAE,OAAO,EAChB,CAAA,CACI,EACR;AACJ,KAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACzG,QACE,oBAACC,uBAAa,EAAA,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE;AACJ,YAAA,SAAS,EAAEC,4BAAY,CACrB,mBAAmB,CAAC,IAAI;;YAExB,sBAAsB,GAAG,mBAAmB,CAAC,mBAAmB,GAAG,SAAS,CAC7E;AACF,SAAA,EACD,IAAI,EAAE;YACJ,SAAS,EAAEA,4BAAY,CACrB,mBAAmB,CAAC,IAAI,EACxB,QAAQ,KAAK,KAAK,GAAG,mBAAmB,CAAC,YAAY,GAAG,SAAS,CAClE;AACF,SAAA,EAAA,EAEA,UAAU,EAAE,CACC,EAChB;AACJ;;;;;"}
         
     | 
| 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            'use strict';
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            var React = require('react');
         
     | 
| 
       4 
     | 
    
         
            -
            var index = require('./index- 
     | 
| 
      
 4 
     | 
    
         
            +
            var index = require('./index-DCf8u3Nr.js');
         
     | 
| 
       5 
5 
     | 
    
         
             
            require('@fluentui/react');
         
     | 
| 
       6 
6 
     | 
    
         
             
            require('@fluentui/react-components');
         
     | 
| 
       7 
7 
     | 
    
         
             
            require('@fluentui-contrib/react-chat');
         
     | 
| 
         @@ -50,4 +50,4 @@ const RichTextSendBoxWrapper = (props) => { 
     | 
|
| 
       50 
50 
     | 
    
         
             
            };
         
     | 
| 
       51 
51 
     | 
    
         | 
| 
       52 
52 
     | 
    
         
             
            exports.RichTextSendBoxWrapper = RichTextSendBoxWrapper;
         
     | 
| 
       53 
     | 
    
         
            -
            //# sourceMappingURL=RichTextSendBoxWrapper- 
     | 
| 
      
 53 
     | 
    
         
            +
            //# sourceMappingURL=RichTextSendBoxWrapper-D-KYGmZ9.js.map
         
     | 
| 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            {"version":3,"file":"RichTextSendBoxWrapper- 
     | 
| 
      
 1 
     | 
    
         
            +
            {"version":3,"file":"RichTextSendBoxWrapper-D-KYGmZ9.js","sources":["../../../../react-composites/src/composites/common/RichTextSendBoxWrapper.tsx"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport React from 'react';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { usePropsFor } from '../ChatComposite/hooks/usePropsFor';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { RichTextSendBox, RichTextSendBoxProps } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\n/**\n * @private\n *\n * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox\n * before lazyLoading is done\n */\nexport const RichTextSendBoxWrapper = (props: RichTextSendBoxProps): JSX.Element => {\n  const richTextSendBoxProps = usePropsFor(RichTextSendBox);\n\n  return <RichTextSendBox {...richTextSendBoxProps} {...props} />;\n};\n"],"names":["usePropsFor","RichTextSendBox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAOA;AACA;;;;;AAKG;AACU,MAAA,sBAAsB,GAAG,CAAC,KAA2B,KAAiB;AACjF,IAAA,MAAM,oBAAoB,GAAGA,iBAAW,CAACC,qBAAe,CAAC,CAAC;AAE1D,IAAA,OAAO,oBAACA,qBAAe,EAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,oBAAoB,EAAM,KAAK,EAAI,CAAC;AAClE;;;;"}
         
     | 
| 
         @@ -175,7 +175,7 @@ function getDefaultExportFromCjs (x) { 
     | 
|
| 
       175 
175 
     | 
    
         
             
            // Copyright (c) Microsoft Corporation.
         
     | 
| 
       176 
176 
     | 
    
         
             
            // Licensed under the MIT License.
         
     | 
| 
       177 
177 
     | 
    
         
             
            // GENERATED FILE. DO NOT EDIT MANUALLY.
         
     | 
| 
       178 
     | 
    
         
            -
            var telemetryVersion = '1.18.0-alpha- 
     | 
| 
      
 178 
     | 
    
         
            +
            var telemetryVersion = '1.18.0-alpha-202406260014';
         
     | 
| 
       179 
179 
     | 
    
         | 
| 
       180 
180 
     | 
    
         | 
| 
       181 
181 
     | 
    
         
             
            var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
         
     | 
| 
         @@ -11635,7 +11635,7 @@ const richTextBorderBoxStyle = (props) => { 
     | 
|
| 
       11635 
11635 
     | 
    
         
             
                    ? disabledStyles
         
     | 
| 
       11636 
11636 
     | 
    
         
             
                    : borderEditBoxStyle(Object.assign(Object.assign({}, props), { 
         
     | 
| 
       11637 
11637 
     | 
    
         
             
                        // should always be false as we don't want to show the border when there is an error
         
     | 
| 
       11638 
     | 
    
         
            -
                        hasErrorMessage: false, defaultBorderColor: props.theme.palette. 
     | 
| 
      
 11638 
     | 
    
         
            +
                        hasErrorMessage: false, defaultBorderColor: props.theme.palette.neutralSecondary })));
         
     | 
| 
       11639 
11639 
     | 
    
         
             
            };
         
     | 
| 
       11640 
11640 
     | 
    
         | 
| 
       11641 
11641 
     | 
    
         
             
            // Copyright (c) Microsoft Corporation.
         
     | 
| 
         @@ -13939,7 +13939,7 @@ class _ErrorBoundary extends React.Component { 
     | 
|
| 
       13939 
13939 
     | 
    
         
             
            // Copyright (c) Microsoft Corporation.
         
     | 
| 
       13940 
13940 
     | 
    
         
             
            // Licensed under the MIT License.
         
     | 
| 
       13941 
13941 
     | 
    
         
             
            /* @conditional-compile-remove(rich-text-editor) */
         
     | 
| 
       13942 
     | 
    
         
            -
            const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox- 
     | 
| 
      
 13942 
     | 
    
         
            +
            const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js'); }));
         
     | 
| 
       13943 
13943 
     | 
    
         
             
            /**
         
     | 
| 
       13944 
13944 
     | 
    
         
             
             * @private
         
     | 
| 
       13945 
13945 
     | 
    
         
             
             * Use this function to load RoosterJS dependencies early in the lifecycle.
         
     | 
| 
         @@ -13947,7 +13947,7 @@ const ChatMessageComponentAsRichTextEditBox = React.lazy(() => Promise.resolve() 
     | 
|
| 
       13947 
13947 
     | 
    
         
             
             *
         
     | 
| 
       13948 
13948 
     | 
    
         
             
             * @conditional-compile-remove(rich-text-editor)
         
     | 
| 
       13949 
13949 
     | 
    
         
             
             */
         
     | 
| 
       13950 
     | 
    
         
            -
            const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox- 
     | 
| 
      
 13950 
     | 
    
         
            +
            const loadChatMessageComponentAsRichTextEditBox = () => Promise.resolve().then(function () { return require('./ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js'); });
         
     | 
| 
       13951 
13951 
     | 
    
         
             
            /**
         
     | 
| 
       13952 
13952 
     | 
    
         
             
             * @private
         
     | 
| 
       13953 
13953 
     | 
    
         
             
             */
         
     | 
| 
         @@ -28357,7 +28357,7 @@ const AttachmentDownloadErrorBar = (props) => { 
     | 
|
| 
       28357 
28357 
     | 
    
         
             
            /**
         
     | 
| 
       28358 
28358 
     | 
    
         
             
             * Wrapper for RichTextSendBox component to allow us to use usePropsFor with richTextSendBox with lazy loading
         
     | 
| 
       28359 
28359 
     | 
    
         
             
             */
         
     | 
| 
       28360 
     | 
    
         
            -
            const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper- 
     | 
| 
      
 28360 
     | 
    
         
            +
            const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-D-KYGmZ9.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper })));
         
     | 
| 
       28361 
28361 
     | 
    
         
             
            /**
         
     | 
| 
       28362 
28362 
     | 
    
         
             
             * @private
         
     | 
| 
       28363 
28363 
     | 
    
         
             
             * Use this function to load RoosterJS dependencies early in the lifecycle.
         
     | 
| 
         @@ -28365,7 +28365,7 @@ const RichTextSendBoxWrapper = React.lazy(() => Promise.resolve().then(function 
     | 
|
| 
       28365 
28365 
     | 
    
         
             
             *
         
     | 
| 
       28366 
28366 
     | 
    
         
             
            /* @conditional-compile-remove(rich-text-editor-composite-support)
         
     | 
| 
       28367 
28367 
     | 
    
         
             
             */
         
     | 
| 
       28368 
     | 
    
         
            -
            const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper- 
     | 
| 
      
 28368 
     | 
    
         
            +
            const loadRichTextSendBox = () => Promise.resolve().then(function () { return require('./RichTextSendBoxWrapper-D-KYGmZ9.js'); }).then((module) => ({ default: module.RichTextSendBoxWrapper }));
         
     | 
| 
       28369 
28369 
     | 
    
         
             
            /**
         
     | 
| 
       28370 
28370 
     | 
    
         
             
             * @private
         
     | 
| 
       28371 
28371 
     | 
    
         
             
             */
         
     | 
| 
         @@ -37821,25 +37821,30 @@ const CALL_TRANSFER_SUBCODE = 7015; 
     | 
|
| 
       37821 
37821 
     | 
    
         
             
             */
         
     | 
| 
       37822 
37822 
     | 
    
         
             
            class CallingSoundSubscriber {
         
     | 
| 
       37823 
37823 
     | 
    
         
             
                constructor(call, callee, sounds) {
         
     | 
| 
      
 37824 
     | 
    
         
            +
                    this.playingSounds = false;
         
     | 
| 
       37824 
37825 
     | 
    
         
             
                    this.onCallStateChanged = () => {
         
     | 
| 
       37825 
37826 
     | 
    
         
             
                        this.call.on('stateChanged', () => {
         
     | 
| 
       37826 
37827 
     | 
    
         
             
                            var _a, _b, _c, _d, _e, _f, _g;
         
     | 
| 
       37827 
37828 
     | 
    
         
             
                            if (shouldPlayRinging(this.call, this.callee) && ((_a = this.soundsLoaded) === null || _a === void 0 ? void 0 : _a.callRingingSound)) {
         
     | 
| 
       37828 
37829 
     | 
    
         
             
                                this.soundsLoaded.callRingingSound.loop = true;
         
     | 
| 
       37829 
37830 
     | 
    
         
             
                                this.playSound(this.soundsLoaded.callRingingSound);
         
     | 
| 
      
 37831 
     | 
    
         
            +
                                this.playingSounds = true;
         
     | 
| 
       37830 
37832 
     | 
    
         
             
                            }
         
     | 
| 
       37831 
37833 
     | 
    
         
             
                            if (!shouldPlayRinging(this.call, this.callee) && ((_b = this.soundsLoaded) === null || _b === void 0 ? void 0 : _b.callRingingSound)) {
         
     | 
| 
       37832 
37834 
     | 
    
         
             
                                this.soundsLoaded.callRingingSound.loop = false;
         
     | 
| 
       37833 
37835 
     | 
    
         
             
                                this.soundsLoaded.callRingingSound.pause();
         
     | 
| 
      
 37836 
     | 
    
         
            +
                                this.playingSounds = false;
         
     | 
| 
       37834 
37837 
     | 
    
         
             
                            }
         
     | 
| 
       37835 
37838 
     | 
    
         
             
                            if (this.call.state === 'Disconnected') {
         
     | 
| 
       37836 
37839 
     | 
    
         
             
                                if (((_c = this.soundsLoaded) === null || _c === void 0 ? void 0 : _c.callBusySound) && ((_d = this.call.callEndReason) === null || _d === void 0 ? void 0 : _d.code) === CALL_REJECTED_CODE) {
         
     | 
| 
       37837 
37840 
     | 
    
         
             
                                    this.playSound(this.soundsLoaded.callBusySound);
         
     | 
| 
      
 37841 
     | 
    
         
            +
                                    this.playingSounds = true;
         
     | 
| 
       37838 
37842 
     | 
    
         
             
                                }
         
     | 
| 
       37839 
37843 
     | 
    
         
             
                                else if (((_e = this.soundsLoaded) === null || _e === void 0 ? void 0 : _e.callEndedSound) &&
         
     | 
| 
       37840 
37844 
     | 
    
         
             
                                    ((_f = this.call.callEndReason) === null || _f === void 0 ? void 0 : _f.code) === CALL_ENDED_CODE &&
         
     | 
| 
       37841 
37845 
     | 
    
         
             
                                    ((_g = this.call.callEndReason) === null || _g === void 0 ? void 0 : _g.subCode) !== CALL_TRANSFER_SUBCODE) {
         
     | 
| 
       37842 
37846 
     | 
    
         
             
                                    this.playSound(this.soundsLoaded.callEndedSound);
         
     | 
| 
      
 37847 
     | 
    
         
            +
                                    this.playingSounds = true;
         
     | 
| 
       37843 
37848 
     | 
    
         
             
                                }
         
     | 
| 
       37844 
37849 
     | 
    
         
             
                            }
         
     | 
| 
       37845 
37850 
     | 
    
         
             
                        });
         
     | 
| 
         @@ -37861,6 +37866,21 @@ class CallingSoundSubscriber { 
     | 
|
| 
       37861 
37866 
     | 
    
         
             
                        this.soundsLoaded.callRingingSound.pause();
         
     | 
| 
       37862 
37867 
     | 
    
         
             
                    }
         
     | 
| 
       37863 
37868 
     | 
    
         
             
                }
         
     | 
| 
      
 37869 
     | 
    
         
            +
                pauseSounds() {
         
     | 
| 
      
 37870 
     | 
    
         
            +
                    var _a, _b, _c;
         
     | 
| 
      
 37871 
     | 
    
         
            +
                    if ((_a = this.soundsLoaded) === null || _a === void 0 ? void 0 : _a.callRingingSound) {
         
     | 
| 
      
 37872 
     | 
    
         
            +
                        this.soundsLoaded.callRingingSound.pause();
         
     | 
| 
      
 37873 
     | 
    
         
            +
                        this.playingSounds = false;
         
     | 
| 
      
 37874 
     | 
    
         
            +
                    }
         
     | 
| 
      
 37875 
     | 
    
         
            +
                    if ((_b = this.soundsLoaded) === null || _b === void 0 ? void 0 : _b.callEndedSound) {
         
     | 
| 
      
 37876 
     | 
    
         
            +
                        this.soundsLoaded.callEndedSound.pause();
         
     | 
| 
      
 37877 
     | 
    
         
            +
                        this.playingSounds = false;
         
     | 
| 
      
 37878 
     | 
    
         
            +
                    }
         
     | 
| 
      
 37879 
     | 
    
         
            +
                    if ((_c = this.soundsLoaded) === null || _c === void 0 ? void 0 : _c.callBusySound) {
         
     | 
| 
      
 37880 
     | 
    
         
            +
                        this.soundsLoaded.callBusySound.pause();
         
     | 
| 
      
 37881 
     | 
    
         
            +
                        this.playingSounds = false;
         
     | 
| 
      
 37882 
     | 
    
         
            +
                    }
         
     | 
| 
      
 37883 
     | 
    
         
            +
                }
         
     | 
| 
       37864 
37884 
     | 
    
         
             
                loadSounds(sounds) {
         
     | 
| 
       37865 
37885 
     | 
    
         
             
                    var _a, _b, _c;
         
     | 
| 
       37866 
37886 
     | 
    
         
             
                    let callEndedSound;
         
     | 
| 
         @@ -38106,7 +38126,7 @@ class AzureCommunicationCallAdapter { 
     | 
|
| 
       38106 
38126 
     | 
    
         
             
                    this.context = new CallContext(callClient.getState(), !!isTeamsCall, isTeamsMeeting, isRoomsCall, options, this.targetCallees);
         
     | 
| 
       38107 
38127 
     | 
    
         
             
                    this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));
         
     | 
| 
       38108 
38128 
     | 
    
         
             
                    const onStateChange = (clientState) => {
         
     | 
| 
       38109 
     | 
    
         
            -
                        var _a, _b, _c;
         
     | 
| 
      
 38129 
     | 
    
         
            +
                        var _a, _b, _c, _d, _e;
         
     | 
| 
       38110 
38130 
     | 
    
         
             
                        // unsubscribe when the instance gets disposed
         
     | 
| 
       38111 
38131 
     | 
    
         
             
                        if (!this) {
         
     | 
| 
       38112 
38132 
     | 
    
         
             
                            callClient.offStateChange(onStateChange);
         
     | 
| 
         @@ -38120,8 +38140,12 @@ class AzureCommunicationCallAdapter { 
     | 
|
| 
       38120 
38140 
     | 
    
         
             
                        if ((_a = this.call) === null || _a === void 0 ? void 0 : _a.id) {
         
     | 
| 
       38121 
38141 
     | 
    
         
             
                            this.context.setCurrentCallId(this.call.id);
         
     | 
| 
       38122 
38142 
     | 
    
         
             
                        }
         
     | 
| 
      
 38143 
     | 
    
         
            +
                        // if the call hits the connected state we want to pause all calling sounds if playing.
         
     | 
| 
      
 38144 
     | 
    
         
            +
                        if (((_b = this.call) === null || _b === void 0 ? void 0 : _b.state) === 'Connected' && ((_c = this.callingSoundSubscriber) === null || _c === void 0 ? void 0 : _c.playingSounds)) {
         
     | 
| 
      
 38145 
     | 
    
         
            +
                            this.callingSoundSubscriber.pauseSounds();
         
     | 
| 
      
 38146 
     | 
    
         
            +
                        }
         
     | 
| 
       38123 
38147 
     | 
    
         
             
                        // If the call connects we need to clean up any previous unparentedViews
         
     | 
| 
       38124 
     | 
    
         
            -
                        if (((( 
     | 
| 
      
 38148 
     | 
    
         
            +
                        if ((((_d = this.call) === null || _d === void 0 ? void 0 : _d.state) === 'InLobby' || ((_e = this.call) === null || _e === void 0 ? void 0 : _e.state) === 'Connected') &&
         
     | 
| 
       38125 
38149 
     | 
    
         
             
                            this.callClient.getState().deviceManager.unparentedViews.length > 0) {
         
     | 
| 
       38126 
38150 
     | 
    
         
             
                            this.callClient.getState().deviceManager.unparentedViews.forEach((view) => {
         
     | 
| 
       38127 
38151 
     | 
    
         
             
                                this.callClient.disposeView(undefined, undefined, view);
         
     | 
| 
         @@ -41673,4 +41697,4 @@ exports.useTeamsCall = useTeamsCall; 
     | 
|
| 
       41673 
41697 
     | 
    
         
             
            exports.useTeamsCallAdapter = useTeamsCallAdapter;
         
     | 
| 
       41674 
41698 
     | 
    
         
             
            exports.useTeamsCallAgent = useTeamsCallAgent;
         
     | 
| 
       41675 
41699 
     | 
    
         
             
            exports.useTheme = useTheme;
         
     | 
| 
       41676 
     | 
    
         
            -
            //# sourceMappingURL=index- 
     | 
| 
      
 41700 
     | 
    
         
            +
            //# sourceMappingURL=index-DCf8u3Nr.js.map
         
     |