@memori.ai/memori-react 1.0.0-alpha.1
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/LICENSE +18 -0
- package/README.md +55 -0
- package/dist/components/Auth/Auth.css +57 -0
- package/dist/components/Auth/Auth.d.ts +16 -0
- package/dist/components/Auth/Auth.js +70 -0
- package/dist/components/Auth/Auth.js.map +1 -0
- package/dist/components/Auth/Auth.stories.d.ts +8 -0
- package/dist/components/Auth/Auth.stories.js +60 -0
- package/dist/components/Auth/Auth.stories.js.map +1 -0
- package/dist/components/Auth/Auth.test.d.ts +1 -0
- package/dist/components/Auth/Auth.test.js +23 -0
- package/dist/components/Auth/Auth.test.js.map +1 -0
- package/dist/components/Avatar/Avatar.css +151 -0
- package/dist/components/Avatar/Avatar.d.ts +19 -0
- package/dist/components/Avatar/Avatar.js +80 -0
- package/dist/components/Avatar/Avatar.js.map +1 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +8 -0
- package/dist/components/Avatar/Avatar.stories.js +92 -0
- package/dist/components/Avatar/Avatar.stories.js.map +1 -0
- package/dist/components/Avatar/Avatar.test.d.ts +1 -0
- package/dist/components/Avatar/Avatar.test.js +38 -0
- package/dist/components/Avatar/Avatar.test.js.map +1 -0
- package/dist/components/AvatarView/AvatarView.stories.d.ts +9 -0
- package/dist/components/AvatarView/AvatarView.stories.js +94 -0
- package/dist/components/AvatarView/AvatarView.stories.js.map +1 -0
- package/dist/components/AvatarView/components/avatar.d.ts +10 -0
- package/dist/components/AvatarView/components/avatar.js +38 -0
- package/dist/components/AvatarView/components/avatar.js.map +1 -0
- package/dist/components/AvatarView/components/loader.d.ts +6 -0
- package/dist/components/AvatarView/components/loader.js +15 -0
- package/dist/components/AvatarView/components/loader.js.map +1 -0
- package/dist/components/AvatarView/index.d.ts +13 -0
- package/dist/components/AvatarView/index.js +24 -0
- package/dist/components/AvatarView/index.js.map +1 -0
- package/dist/components/AvatarView/utils/useEyeBlink.d.ts +2 -0
- package/dist/components/AvatarView/utils/useEyeBlink.js +40 -0
- package/dist/components/AvatarView/utils/useEyeBlink.js.map +1 -0
- package/dist/components/AvatarView/utils/useHeadMovement.d.ts +2 -0
- package/dist/components/AvatarView/utils/useHeadMovement.js +53 -0
- package/dist/components/AvatarView/utils/useHeadMovement.js.map +1 -0
- package/dist/components/AvatarView/utils/useMouthSpeaking.d.ts +2 -0
- package/dist/components/AvatarView/utils/useMouthSpeaking.js +58 -0
- package/dist/components/AvatarView/utils/useMouthSpeaking.js.map +1 -0
- package/dist/components/AvatarView/utils/utils.d.ts +13 -0
- package/dist/components/AvatarView/utils/utils.js +42 -0
- package/dist/components/AvatarView/utils/utils.js.map +1 -0
- package/dist/components/Blob/Blob.css +249 -0
- package/dist/components/Blob/Blob.d.ts +7 -0
- package/dist/components/Blob/Blob.js +17 -0
- package/dist/components/Blob/Blob.js.map +1 -0
- package/dist/components/Blob/Blob.stories.d.ts +6 -0
- package/dist/components/Blob/Blob.stories.js +30 -0
- package/dist/components/Blob/Blob.stories.js.map +1 -0
- package/dist/components/Blob/Blob.test.d.ts +1 -0
- package/dist/components/Blob/Blob.test.js +15 -0
- package/dist/components/Blob/Blob.test.js.map +1 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.css +40 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.d.ts +11 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.js +39 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.js.map +1 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.d.ts +8 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.js +40 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.js.map +1 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.test.d.ts +1 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.test.js +23 -0
- package/dist/components/BlockedMemoriBadge/BlockedMemoriBadge.test.js.map +1 -0
- package/dist/components/ChangeMode/ChangeMode.css +22 -0
- package/dist/components/ChangeMode/ChangeMode.d.ts +8 -0
- package/dist/components/ChangeMode/ChangeMode.js +17 -0
- package/dist/components/ChangeMode/ChangeMode.js.map +1 -0
- package/dist/components/ChangeMode/ChangeMode.stories.d.ts +6 -0
- package/dist/components/ChangeMode/ChangeMode.stories.js +34 -0
- package/dist/components/ChangeMode/ChangeMode.stories.js.map +1 -0
- package/dist/components/ChangeMode/ChangeMode.test.d.ts +1 -0
- package/dist/components/ChangeMode/ChangeMode.test.js +15 -0
- package/dist/components/ChangeMode/ChangeMode.test.js.map +1 -0
- package/dist/components/Chat/Chat.css +117 -0
- package/dist/components/Chat/Chat.d.ts +35 -0
- package/dist/components/Chat/Chat.js +125 -0
- package/dist/components/Chat/Chat.js.map +1 -0
- package/dist/components/Chat/Chat.stories.d.ts +13 -0
- package/dist/components/Chat/Chat.stories.js +162 -0
- package/dist/components/Chat/Chat.stories.js.map +1 -0
- package/dist/components/Chat/Chat.test.d.ts +1 -0
- package/dist/components/Chat/Chat.test.js +52 -0
- package/dist/components/Chat/Chat.test.js.map +1 -0
- package/dist/components/ChatBubble/ChatBubble.css +159 -0
- package/dist/components/ChatBubble/ChatBubble.d.ts +11 -0
- package/dist/components/ChatBubble/ChatBubble.js +41 -0
- package/dist/components/ChatBubble/ChatBubble.js.map +1 -0
- package/dist/components/ChatBubble/ChatBubble.stories.d.ts +6 -0
- package/dist/components/ChatBubble/ChatBubble.stories.js +56 -0
- package/dist/components/ChatBubble/ChatBubble.stories.js.map +1 -0
- package/dist/components/ChatBubble/ChatBubble.test.d.ts +1 -0
- package/dist/components/ChatBubble/ChatBubble.test.js +26 -0
- package/dist/components/ChatBubble/ChatBubble.test.js.map +1 -0
- package/dist/components/ChatInputs/ChatInputs.css +21 -0
- package/dist/components/ChatInputs/ChatInputs.d.ts +19 -0
- package/dist/components/ChatInputs/ChatInputs.js +21 -0
- package/dist/components/ChatInputs/ChatInputs.js.map +1 -0
- package/dist/components/ChatInputs/ChatInputs.stories.d.ts +9 -0
- package/dist/components/ChatInputs/ChatInputs.stories.js +90 -0
- package/dist/components/ChatInputs/ChatInputs.stories.js.map +1 -0
- package/dist/components/ChatInputs/ChatInputs.test.d.ts +1 -0
- package/dist/components/ChatInputs/ChatInputs.test.js +30 -0
- package/dist/components/ChatInputs/ChatInputs.test.js.map +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.css +88 -0
- package/dist/components/ChatTextArea/ChatTextArea.d.ts +12 -0
- package/dist/components/ChatTextArea/ChatTextArea.js +28 -0
- package/dist/components/ChatTextArea/ChatTextArea.js.map +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.stories.d.ts +7 -0
- package/dist/components/ChatTextArea/ChatTextArea.stories.js +42 -0
- package/dist/components/ChatTextArea/ChatTextArea.stories.js.map +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.test.d.ts +1 -0
- package/dist/components/ChatTextArea/ChatTextArea.test.js +24 -0
- package/dist/components/ChatTextArea/ChatTextArea.test.js.map +1 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.css +11 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.d.ts +9 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.js +21 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.js.map +1 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.stories.d.ts +5 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.stories.js +45 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.stories.js.map +1 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.test.d.ts +1 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.test.js +11 -0
- package/dist/components/CustomGLBModelViewer/ModelViewer.test.js.map +1 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +9 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js +36 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.css +22 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.d.ts +15 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.js +45 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.js.map +1 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.stories.d.ts +8 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.stories.js +56 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.stories.js.map +1 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.test.d.ts +1 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.test.js +37 -0
- package/dist/components/ExportHistoryButton/ExportHistoryButton.test.js.map +1 -0
- package/dist/components/Header/Header.css +58 -0
- package/dist/components/Header/Header.d.ts +18 -0
- package/dist/components/Header/Header.js +27 -0
- package/dist/components/Header/Header.js.map +1 -0
- package/dist/components/Header/Header.stories.d.ts +10 -0
- package/dist/components/Header/Header.stories.js +101 -0
- package/dist/components/Header/Header.stories.js.map +1 -0
- package/dist/components/Header/Header.test.d.ts +1 -0
- package/dist/components/Header/Header.test.js +39 -0
- package/dist/components/Header/Header.test.js.map +1 -0
- package/dist/components/MediaWidget/LinkItemWidget.css +35 -0
- package/dist/components/MediaWidget/LinkItemWidget.d.ts +27 -0
- package/dist/components/MediaWidget/LinkItemWidget.js +71 -0
- package/dist/components/MediaWidget/LinkItemWidget.js.map +1 -0
- package/dist/components/MediaWidget/LinkItemWidget.stories.d.ts +5 -0
- package/dist/components/MediaWidget/LinkItemWidget.stories.js +58 -0
- package/dist/components/MediaWidget/LinkItemWidget.stories.js.map +1 -0
- package/dist/components/MediaWidget/LinkItemWidget.test.d.ts +1 -0
- package/dist/components/MediaWidget/LinkItemWidget.test.js +29 -0
- package/dist/components/MediaWidget/LinkItemWidget.test.js.map +1 -0
- package/dist/components/MediaWidget/MediaItemWidget.css +62 -0
- package/dist/components/MediaWidget/MediaItemWidget.d.ts +17 -0
- package/dist/components/MediaWidget/MediaItemWidget.js +144 -0
- package/dist/components/MediaWidget/MediaItemWidget.js.map +1 -0
- package/dist/components/MediaWidget/MediaItemWidget.stories.d.ts +6 -0
- package/dist/components/MediaWidget/MediaItemWidget.stories.js +86 -0
- package/dist/components/MediaWidget/MediaItemWidget.stories.js.map +1 -0
- package/dist/components/MediaWidget/MediaItemWidget.test.d.ts +1 -0
- package/dist/components/MediaWidget/MediaItemWidget.test.js +90 -0
- package/dist/components/MediaWidget/MediaItemWidget.test.js.map +1 -0
- package/dist/components/MediaWidget/MediaWidget.css +121 -0
- package/dist/components/MediaWidget/MediaWidget.d.ts +14 -0
- package/dist/components/MediaWidget/MediaWidget.js +29 -0
- package/dist/components/MediaWidget/MediaWidget.js.map +1 -0
- package/dist/components/MediaWidget/MediaWidget.stories.d.ts +8 -0
- package/dist/components/MediaWidget/MediaWidget.stories.js +103 -0
- package/dist/components/MediaWidget/MediaWidget.stories.js.map +1 -0
- package/dist/components/MediaWidget/MediaWidget.test.d.ts +1 -0
- package/dist/components/MediaWidget/MediaWidget.test.js +34 -0
- package/dist/components/MediaWidget/MediaWidget.test.js.map +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.css +199 -0
- package/dist/components/MemoriWidget/MemoriWidget.d.ts +43 -0
- package/dist/components/MemoriWidget/MemoriWidget.js +1371 -0
- package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -0
- package/dist/components/MemoriWidget/MemoriWidget.stories.d.ts +9 -0
- package/dist/components/MemoriWidget/MemoriWidget.stories.js +67 -0
- package/dist/components/MemoriWidget/MemoriWidget.stories.js.map +1 -0
- package/dist/components/PositionDrawer/PositionDrawer.d.ts +3 -0
- package/dist/components/PositionDrawer/PositionDrawer.js +8 -0
- package/dist/components/PositionDrawer/PositionDrawer.js.map +1 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.css +47 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.d.ts +8 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.js +23 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.js.map +1 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.stories.d.ts +6 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.stories.js +40 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.stories.js.map +1 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.test.d.ts +1 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.test.js +15 -0
- package/dist/components/SendOnEnterMenu/SendOnEnterMenu.test.js.map +1 -0
- package/dist/components/ShareButton/ShareButton.css +57 -0
- package/dist/components/ShareButton/ShareButton.d.ts +13 -0
- package/dist/components/ShareButton/ShareButton.js +112 -0
- package/dist/components/ShareButton/ShareButton.js.map +1 -0
- package/dist/components/ShareButton/ShareButton.stories.d.ts +7 -0
- package/dist/components/ShareButton/ShareButton.stories.js +47 -0
- package/dist/components/ShareButton/ShareButton.stories.js.map +1 -0
- package/dist/components/ShareButton/ShareButton.test.d.ts +1 -0
- package/dist/components/ShareButton/ShareButton.test.js +31 -0
- package/dist/components/ShareButton/ShareButton.test.js.map +1 -0
- package/dist/components/Snippet/Snippet.css +35 -0
- package/dist/components/Snippet/Snippet.d.ts +10 -0
- package/dist/components/Snippet/Snippet.js +40 -0
- package/dist/components/Snippet/Snippet.js.map +1 -0
- package/dist/components/Snippet/Snippet.stories.d.ts +73 -0
- package/dist/components/Snippet/Snippet.stories.js +247 -0
- package/dist/components/Snippet/Snippet.stories.js.map +1 -0
- package/dist/components/Snippet/Snippet.test.d.ts +1 -0
- package/dist/components/Snippet/Snippet.test.js +114 -0
- package/dist/components/Snippet/Snippet.test.js.map +1 -0
- package/dist/components/StartPanel/StartPanel.css +121 -0
- package/dist/components/StartPanel/StartPanel.d.ts +23 -0
- package/dist/components/StartPanel/StartPanel.js +95 -0
- package/dist/components/StartPanel/StartPanel.js.map +1 -0
- package/dist/components/StartPanel/StartPanel.stories.d.ts +10 -0
- package/dist/components/StartPanel/StartPanel.stories.js +163 -0
- package/dist/components/StartPanel/StartPanel.stories.js.map +1 -0
- package/dist/components/StartPanel/StartPanel.test.d.ts +1 -0
- package/dist/components/StartPanel/StartPanel.test.js +44 -0
- package/dist/components/StartPanel/StartPanel.test.js.map +1 -0
- package/dist/components/UploadMenu/UploadMenu.css +46 -0
- package/dist/components/UploadMenu/UploadMenu.d.ts +9 -0
- package/dist/components/UploadMenu/UploadMenu.js +24 -0
- package/dist/components/UploadMenu/UploadMenu.js.map +1 -0
- package/dist/components/UploadMenu/UploadMenu.stories.d.ts +6 -0
- package/dist/components/UploadMenu/UploadMenu.stories.js +41 -0
- package/dist/components/UploadMenu/UploadMenu.stories.js.map +1 -0
- package/dist/components/UploadMenu/UploadMenu.test.d.ts +1 -0
- package/dist/components/UploadMenu/UploadMenu.test.js +23 -0
- package/dist/components/UploadMenu/UploadMenu.test.js.map +1 -0
- package/dist/components/icons/Close.d.ts +6 -0
- package/dist/components/icons/Close.js +8 -0
- package/dist/components/icons/Close.js.map +1 -0
- package/dist/components/icons/Copy.d.ts +6 -0
- package/dist/components/icons/Copy.js +8 -0
- package/dist/components/icons/Copy.js.map +1 -0
- package/dist/components/icons/Download.d.ts +6 -0
- package/dist/components/icons/Download.js +8 -0
- package/dist/components/icons/Download.js.map +1 -0
- package/dist/components/icons/Edit.d.ts +6 -0
- package/dist/components/icons/Edit.js +8 -0
- package/dist/components/icons/Edit.js.map +1 -0
- package/dist/components/icons/Expand.d.ts +6 -0
- package/dist/components/icons/Expand.js +8 -0
- package/dist/components/icons/Expand.js.map +1 -0
- package/dist/components/icons/Eye.d.ts +6 -0
- package/dist/components/icons/Eye.js +8 -0
- package/dist/components/icons/Eye.js.map +1 -0
- package/dist/components/icons/EyeInvisible.d.ts +6 -0
- package/dist/components/icons/EyeInvisible.js +9 -0
- package/dist/components/icons/EyeInvisible.js.map +1 -0
- package/dist/components/icons/Facebook.d.ts +6 -0
- package/dist/components/icons/Facebook.js +8 -0
- package/dist/components/icons/Facebook.js.map +1 -0
- package/dist/components/icons/File.d.ts +6 -0
- package/dist/components/icons/File.js +8 -0
- package/dist/components/icons/File.js.map +1 -0
- package/dist/components/icons/FileExcel.d.ts +6 -0
- package/dist/components/icons/FileExcel.js +8 -0
- package/dist/components/icons/FileExcel.js.map +1 -0
- package/dist/components/icons/FilePdf.d.ts +6 -0
- package/dist/components/icons/FilePdf.js +8 -0
- package/dist/components/icons/FilePdf.js.map +1 -0
- package/dist/components/icons/FileWord.d.ts +6 -0
- package/dist/components/icons/FileWord.js +8 -0
- package/dist/components/icons/FileWord.js.map +1 -0
- package/dist/components/icons/Fullscreen.d.ts +6 -0
- package/dist/components/icons/Fullscreen.js +8 -0
- package/dist/components/icons/Fullscreen.js.map +1 -0
- package/dist/components/icons/FullscreenExit.d.ts +6 -0
- package/dist/components/icons/FullscreenExit.js +8 -0
- package/dist/components/icons/FullscreenExit.js.map +1 -0
- package/dist/components/icons/Link.d.ts +6 -0
- package/dist/components/icons/Link.js +8 -0
- package/dist/components/icons/Link.js.map +1 -0
- package/dist/components/icons/Linkedin.d.ts +6 -0
- package/dist/components/icons/Linkedin.js +8 -0
- package/dist/components/icons/Linkedin.js.map +1 -0
- package/dist/components/icons/Loading.d.ts +8 -0
- package/dist/components/icons/Loading.js +12 -0
- package/dist/components/icons/Loading.js.map +1 -0
- package/dist/components/icons/Mail.d.ts +6 -0
- package/dist/components/icons/Mail.js +8 -0
- package/dist/components/icons/Mail.js.map +1 -0
- package/dist/components/icons/MapMarker.d.ts +6 -0
- package/dist/components/icons/MapMarker.js +8 -0
- package/dist/components/icons/MapMarker.js.map +1 -0
- package/dist/components/icons/Message.d.ts +6 -0
- package/dist/components/icons/Message.js +8 -0
- package/dist/components/icons/Message.js.map +1 -0
- package/dist/components/icons/Minus.d.ts +6 -0
- package/dist/components/icons/Minus.js +8 -0
- package/dist/components/icons/Minus.js.map +1 -0
- package/dist/components/icons/MinusCircle.d.ts +6 -0
- package/dist/components/icons/MinusCircle.js +9 -0
- package/dist/components/icons/MinusCircle.js.map +1 -0
- package/dist/components/icons/PaperClip.d.ts +6 -0
- package/dist/components/icons/PaperClip.js +8 -0
- package/dist/components/icons/PaperClip.js.map +1 -0
- package/dist/components/icons/Picture.d.ts +6 -0
- package/dist/components/icons/Picture.js +8 -0
- package/dist/components/icons/Picture.js.map +1 -0
- package/dist/components/icons/Plus.d.ts +6 -0
- package/dist/components/icons/Plus.js +9 -0
- package/dist/components/icons/Plus.js.map +1 -0
- package/dist/components/icons/Send.d.ts +6 -0
- package/dist/components/icons/Send.js +8 -0
- package/dist/components/icons/Send.js.map +1 -0
- package/dist/components/icons/Setting.d.ts +6 -0
- package/dist/components/icons/Setting.js +8 -0
- package/dist/components/icons/Setting.js.map +1 -0
- package/dist/components/icons/Share.d.ts +6 -0
- package/dist/components/icons/Share.js +8 -0
- package/dist/components/icons/Share.js.map +1 -0
- package/dist/components/icons/Sound.d.ts +6 -0
- package/dist/components/icons/Sound.js +8 -0
- package/dist/components/icons/Sound.js.map +1 -0
- package/dist/components/icons/SoundDeactivated.d.ts +6 -0
- package/dist/components/icons/SoundDeactivated.js +8 -0
- package/dist/components/icons/SoundDeactivated.js.map +1 -0
- package/dist/components/icons/Telegram.d.ts +6 -0
- package/dist/components/icons/Telegram.js +8 -0
- package/dist/components/icons/Telegram.js.map +1 -0
- package/dist/components/icons/Translation.d.ts +6 -0
- package/dist/components/icons/Translation.js +9 -0
- package/dist/components/icons/Translation.js.map +1 -0
- package/dist/components/icons/Twitter.d.ts +6 -0
- package/dist/components/icons/Twitter.js +8 -0
- package/dist/components/icons/Twitter.js.map +1 -0
- package/dist/components/icons/User.d.ts +6 -0
- package/dist/components/icons/User.js +8 -0
- package/dist/components/icons/User.js.map +1 -0
- package/dist/components/icons/Warning.d.ts +6 -0
- package/dist/components/icons/Warning.js +8 -0
- package/dist/components/icons/Warning.js.map +1 -0
- package/dist/components/icons/WhatsApp.d.ts +6 -0
- package/dist/components/icons/WhatsApp.js +9 -0
- package/dist/components/icons/WhatsApp.js.map +1 -0
- package/dist/components/icons/icons.stories.d.ts +8 -0
- package/dist/components/icons/icons.stories.js +42 -0
- package/dist/components/icons/icons.stories.js.map +1 -0
- package/dist/components/icons/loading.css +14 -0
- package/dist/components/layouts/Default.d.ts +16 -0
- package/dist/components/layouts/Default.js +16 -0
- package/dist/components/layouts/Default.js.map +1 -0
- package/dist/components/ui/Button.css +138 -0
- package/dist/components/ui/Button.d.ts +22 -0
- package/dist/components/ui/Button.js +27 -0
- package/dist/components/ui/Button.js.map +1 -0
- package/dist/components/ui/Button.stories.d.ts +17 -0
- package/dist/components/ui/Button.stories.js +141 -0
- package/dist/components/ui/Button.stories.js.map +1 -0
- package/dist/components/ui/Button.test.d.ts +1 -0
- package/dist/components/ui/Button.test.js +64 -0
- package/dist/components/ui/Button.test.js.map +1 -0
- package/dist/components/ui/Card.css +60 -0
- package/dist/components/ui/Card.d.ts +13 -0
- package/dist/components/ui/Card.js +20 -0
- package/dist/components/ui/Card.js.map +1 -0
- package/dist/components/ui/Card.stories.d.ts +10 -0
- package/dist/components/ui/Card.stories.js +84 -0
- package/dist/components/ui/Card.stories.js.map +1 -0
- package/dist/components/ui/Card.test.d.ts +1 -0
- package/dist/components/ui/Card.test.js +40 -0
- package/dist/components/ui/Card.test.js.map +1 -0
- package/dist/components/ui/Checkbox.css +111 -0
- package/dist/components/ui/Checkbox.d.ts +9 -0
- package/dist/components/ui/Checkbox.js +15 -0
- package/dist/components/ui/Checkbox.js.map +1 -0
- package/dist/components/ui/Checkbox.stories.d.ts +8 -0
- package/dist/components/ui/Checkbox.stories.js +53 -0
- package/dist/components/ui/Checkbox.stories.js.map +1 -0
- package/dist/components/ui/Checkbox.test.d.ts +1 -0
- package/dist/components/ui/Checkbox.test.js +23 -0
- package/dist/components/ui/Checkbox.test.js.map +1 -0
- package/dist/components/ui/Drawer.css +138 -0
- package/dist/components/ui/Drawer.d.ts +19 -0
- package/dist/components/ui/Drawer.js +39 -0
- package/dist/components/ui/Drawer.js.map +1 -0
- package/dist/components/ui/Drawer.stories.d.ts +12 -0
- package/dist/components/ui/Drawer.stories.js +138 -0
- package/dist/components/ui/Drawer.stories.js.map +1 -0
- package/dist/components/ui/Drawer.test.d.ts +1 -0
- package/dist/components/ui/Drawer.test.js +64 -0
- package/dist/components/ui/Drawer.test.js.map +1 -0
- package/dist/components/ui/Message.d.ts +18 -0
- package/dist/components/ui/Message.js +14 -0
- package/dist/components/ui/Message.js.map +1 -0
- package/dist/components/ui/Modal.css +98 -0
- package/dist/components/ui/Modal.d.ts +17 -0
- package/dist/components/ui/Modal.js +35 -0
- package/dist/components/ui/Modal.js.map +1 -0
- package/dist/components/ui/Modal.stories.d.ts +12 -0
- package/dist/components/ui/Modal.stories.js +128 -0
- package/dist/components/ui/Modal.stories.js.map +1 -0
- package/dist/components/ui/Modal.test.d.ts +1 -0
- package/dist/components/ui/Modal.test.js +60 -0
- package/dist/components/ui/Modal.test.js.map +1 -0
- package/dist/components/ui/Spin.css +29 -0
- package/dist/components/ui/Spin.d.ts +10 -0
- package/dist/components/ui/Spin.js +16 -0
- package/dist/components/ui/Spin.js.map +1 -0
- package/dist/components/ui/Spin.stories.d.ts +7 -0
- package/dist/components/ui/Spin.stories.js +54 -0
- package/dist/components/ui/Spin.stories.js.map +1 -0
- package/dist/components/ui/Spin.test.d.ts +1 -0
- package/dist/components/ui/Spin.test.js +32 -0
- package/dist/components/ui/Spin.test.js.map +1 -0
- package/dist/components/ui/Tooltip.css +78 -0
- package/dist/components/ui/Tooltip.d.ts +12 -0
- package/dist/components/ui/Tooltip.js +15 -0
- package/dist/components/ui/Tooltip.js.map +1 -0
- package/dist/components/ui/Tooltip.stories.d.ts +8 -0
- package/dist/components/ui/Tooltip.stories.js +49 -0
- package/dist/components/ui/Tooltip.stories.js.map +1 -0
- package/dist/components/ui/Tooltip.test.d.ts +1 -0
- package/dist/components/ui/Tooltip.test.js +26 -0
- package/dist/components/ui/Tooltip.test.js.map +1 -0
- package/dist/helpers/configuration.d.ts +5 -0
- package/dist/helpers/configuration.js +28 -0
- package/dist/helpers/configuration.js.map +1 -0
- package/dist/helpers/constants.d.ts +19 -0
- package/dist/helpers/constants.js +112 -0
- package/dist/helpers/constants.js.map +1 -0
- package/dist/helpers/error.d.ts +2 -0
- package/dist/helpers/error.js +131 -0
- package/dist/helpers/error.js.map +1 -0
- package/dist/helpers/media.d.ts +8 -0
- package/dist/helpers/media.js +34 -0
- package/dist/helpers/media.js.map +1 -0
- package/dist/helpers/statistics.d.ts +13 -0
- package/dist/helpers/statistics.js +216 -0
- package/dist/helpers/statistics.js.map +1 -0
- package/dist/helpers/translations.d.ts +6 -0
- package/dist/helpers/translations.js +29 -0
- package/dist/helpers/translations.js.map +1 -0
- package/dist/helpers/utils.d.ts +23 -0
- package/dist/helpers/utils.js +129 -0
- package/dist/helpers/utils.js.map +1 -0
- package/dist/i18n.d.ts +2 -0
- package/dist/i18n.js +27 -0
- package/dist/i18n.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/en.json +189 -0
- package/dist/locales/it.json +189 -0
- package/dist/mocks/data.d.ts +9 -0
- package/dist/mocks/data.js +197 -0
- package/dist/mocks/data.js.map +1 -0
- package/esm/components/Auth/Auth.css +57 -0
- package/esm/components/Auth/Auth.d.ts +16 -0
- package/esm/components/Auth/Auth.js +65 -0
- package/esm/components/Auth/Auth.js.map +1 -0
- package/esm/components/Auth/Auth.stories.d.ts +8 -0
- package/esm/components/Auth/Auth.stories.js +56 -0
- package/esm/components/Auth/Auth.stories.js.map +1 -0
- package/esm/components/Auth/Auth.test.d.ts +1 -0
- package/esm/components/Auth/Auth.test.js +20 -0
- package/esm/components/Auth/Auth.test.js.map +1 -0
- package/esm/components/Avatar/Avatar.css +151 -0
- package/esm/components/Avatar/Avatar.d.ts +19 -0
- package/esm/components/Avatar/Avatar.js +77 -0
- package/esm/components/Avatar/Avatar.js.map +1 -0
- package/esm/components/Avatar/Avatar.stories.d.ts +8 -0
- package/esm/components/Avatar/Avatar.stories.js +88 -0
- package/esm/components/Avatar/Avatar.stories.js.map +1 -0
- package/esm/components/Avatar/Avatar.test.d.ts +1 -0
- package/esm/components/Avatar/Avatar.test.js +35 -0
- package/esm/components/Avatar/Avatar.test.js.map +1 -0
- package/esm/components/AvatarView/AvatarView.stories.d.ts +9 -0
- package/esm/components/AvatarView/AvatarView.stories.js +90 -0
- package/esm/components/AvatarView/AvatarView.stories.js.map +1 -0
- package/esm/components/AvatarView/components/avatar.d.ts +10 -0
- package/esm/components/AvatarView/components/avatar.js +34 -0
- package/esm/components/AvatarView/components/avatar.js.map +1 -0
- package/esm/components/AvatarView/components/loader.d.ts +6 -0
- package/esm/components/AvatarView/components/loader.js +12 -0
- package/esm/components/AvatarView/components/loader.js.map +1 -0
- package/esm/components/AvatarView/index.d.ts +13 -0
- package/esm/components/AvatarView/index.js +20 -0
- package/esm/components/AvatarView/index.js.map +1 -0
- package/esm/components/AvatarView/utils/useEyeBlink.d.ts +2 -0
- package/esm/components/AvatarView/utils/useEyeBlink.js +37 -0
- package/esm/components/AvatarView/utils/useEyeBlink.js.map +1 -0
- package/esm/components/AvatarView/utils/useHeadMovement.d.ts +2 -0
- package/esm/components/AvatarView/utils/useHeadMovement.js +50 -0
- package/esm/components/AvatarView/utils/useHeadMovement.js.map +1 -0
- package/esm/components/AvatarView/utils/useMouthSpeaking.d.ts +2 -0
- package/esm/components/AvatarView/utils/useMouthSpeaking.js +55 -0
- package/esm/components/AvatarView/utils/useMouthSpeaking.js.map +1 -0
- package/esm/components/AvatarView/utils/utils.d.ts +13 -0
- package/esm/components/AvatarView/utils/utils.js +33 -0
- package/esm/components/AvatarView/utils/utils.js.map +1 -0
- package/esm/components/Blob/Blob.css +249 -0
- package/esm/components/Blob/Blob.d.ts +7 -0
- package/esm/components/Blob/Blob.js +14 -0
- package/esm/components/Blob/Blob.js.map +1 -0
- package/esm/components/Blob/Blob.stories.d.ts +6 -0
- package/esm/components/Blob/Blob.stories.js +26 -0
- package/esm/components/Blob/Blob.stories.js.map +1 -0
- package/esm/components/Blob/Blob.test.d.ts +1 -0
- package/esm/components/Blob/Blob.test.js +12 -0
- package/esm/components/Blob/Blob.test.js.map +1 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.css +40 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.d.ts +11 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.js +36 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.js.map +1 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.d.ts +8 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.js +36 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.js.map +1 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.test.d.ts +1 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.test.js +20 -0
- package/esm/components/BlockedMemoriBadge/BlockedMemoriBadge.test.js.map +1 -0
- package/esm/components/ChangeMode/ChangeMode.css +22 -0
- package/esm/components/ChangeMode/ChangeMode.d.ts +8 -0
- package/esm/components/ChangeMode/ChangeMode.js +14 -0
- package/esm/components/ChangeMode/ChangeMode.js.map +1 -0
- package/esm/components/ChangeMode/ChangeMode.stories.d.ts +6 -0
- package/esm/components/ChangeMode/ChangeMode.stories.js +30 -0
- package/esm/components/ChangeMode/ChangeMode.stories.js.map +1 -0
- package/esm/components/ChangeMode/ChangeMode.test.d.ts +1 -0
- package/esm/components/ChangeMode/ChangeMode.test.js +12 -0
- package/esm/components/ChangeMode/ChangeMode.test.js.map +1 -0
- package/esm/components/Chat/Chat.css +117 -0
- package/esm/components/Chat/Chat.d.ts +35 -0
- package/esm/components/Chat/Chat.js +122 -0
- package/esm/components/Chat/Chat.js.map +1 -0
- package/esm/components/Chat/Chat.stories.d.ts +13 -0
- package/esm/components/Chat/Chat.stories.js +158 -0
- package/esm/components/Chat/Chat.stories.js.map +1 -0
- package/esm/components/Chat/Chat.test.d.ts +1 -0
- package/esm/components/Chat/Chat.test.js +49 -0
- package/esm/components/Chat/Chat.test.js.map +1 -0
- package/esm/components/ChatBubble/ChatBubble.css +159 -0
- package/esm/components/ChatBubble/ChatBubble.d.ts +11 -0
- package/esm/components/ChatBubble/ChatBubble.js +38 -0
- package/esm/components/ChatBubble/ChatBubble.js.map +1 -0
- package/esm/components/ChatBubble/ChatBubble.stories.d.ts +6 -0
- package/esm/components/ChatBubble/ChatBubble.stories.js +52 -0
- package/esm/components/ChatBubble/ChatBubble.stories.js.map +1 -0
- package/esm/components/ChatBubble/ChatBubble.test.d.ts +1 -0
- package/esm/components/ChatBubble/ChatBubble.test.js +23 -0
- package/esm/components/ChatBubble/ChatBubble.test.js.map +1 -0
- package/esm/components/ChatInputs/ChatInputs.css +21 -0
- package/esm/components/ChatInputs/ChatInputs.d.ts +19 -0
- package/esm/components/ChatInputs/ChatInputs.js +18 -0
- package/esm/components/ChatInputs/ChatInputs.js.map +1 -0
- package/esm/components/ChatInputs/ChatInputs.stories.d.ts +9 -0
- package/esm/components/ChatInputs/ChatInputs.stories.js +86 -0
- package/esm/components/ChatInputs/ChatInputs.stories.js.map +1 -0
- package/esm/components/ChatInputs/ChatInputs.test.d.ts +1 -0
- package/esm/components/ChatInputs/ChatInputs.test.js +27 -0
- package/esm/components/ChatInputs/ChatInputs.test.js.map +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.css +88 -0
- package/esm/components/ChatTextArea/ChatTextArea.d.ts +12 -0
- package/esm/components/ChatTextArea/ChatTextArea.js +25 -0
- package/esm/components/ChatTextArea/ChatTextArea.js.map +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.stories.d.ts +7 -0
- package/esm/components/ChatTextArea/ChatTextArea.stories.js +38 -0
- package/esm/components/ChatTextArea/ChatTextArea.stories.js.map +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.test.d.ts +1 -0
- package/esm/components/ChatTextArea/ChatTextArea.test.js +21 -0
- package/esm/components/ChatTextArea/ChatTextArea.test.js.map +1 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.css +11 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.d.ts +9 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.js +18 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.js.map +1 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.stories.d.ts +5 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.stories.js +41 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.stories.js.map +1 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.test.d.ts +1 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.test.js +8 -0
- package/esm/components/CustomGLBModelViewer/ModelViewer.test.js.map +1 -0
- package/esm/components/ErrorBoundary/ErrorBoundary.d.ts +9 -0
- package/esm/components/ErrorBoundary/ErrorBoundary.js +33 -0
- package/esm/components/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.css +22 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.d.ts +15 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.js +42 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.js.map +1 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.stories.d.ts +8 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.stories.js +52 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.stories.js.map +1 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.test.d.ts +1 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.test.js +34 -0
- package/esm/components/ExportHistoryButton/ExportHistoryButton.test.js.map +1 -0
- package/esm/components/Header/Header.css +58 -0
- package/esm/components/Header/Header.d.ts +18 -0
- package/esm/components/Header/Header.js +24 -0
- package/esm/components/Header/Header.js.map +1 -0
- package/esm/components/Header/Header.stories.d.ts +10 -0
- package/esm/components/Header/Header.stories.js +97 -0
- package/esm/components/Header/Header.stories.js.map +1 -0
- package/esm/components/Header/Header.test.d.ts +1 -0
- package/esm/components/Header/Header.test.js +36 -0
- package/esm/components/Header/Header.test.js.map +1 -0
- package/esm/components/MediaWidget/LinkItemWidget.css +35 -0
- package/esm/components/MediaWidget/LinkItemWidget.d.ts +27 -0
- package/esm/components/MediaWidget/LinkItemWidget.js +66 -0
- package/esm/components/MediaWidget/LinkItemWidget.js.map +1 -0
- package/esm/components/MediaWidget/LinkItemWidget.stories.d.ts +5 -0
- package/esm/components/MediaWidget/LinkItemWidget.stories.js +54 -0
- package/esm/components/MediaWidget/LinkItemWidget.stories.js.map +1 -0
- package/esm/components/MediaWidget/LinkItemWidget.test.d.ts +1 -0
- package/esm/components/MediaWidget/LinkItemWidget.test.js +26 -0
- package/esm/components/MediaWidget/LinkItemWidget.test.js.map +1 -0
- package/esm/components/MediaWidget/MediaItemWidget.css +62 -0
- package/esm/components/MediaWidget/MediaItemWidget.d.ts +17 -0
- package/esm/components/MediaWidget/MediaItemWidget.js +139 -0
- package/esm/components/MediaWidget/MediaItemWidget.js.map +1 -0
- package/esm/components/MediaWidget/MediaItemWidget.stories.d.ts +6 -0
- package/esm/components/MediaWidget/MediaItemWidget.stories.js +82 -0
- package/esm/components/MediaWidget/MediaItemWidget.stories.js.map +1 -0
- package/esm/components/MediaWidget/MediaItemWidget.test.d.ts +1 -0
- package/esm/components/MediaWidget/MediaItemWidget.test.js +87 -0
- package/esm/components/MediaWidget/MediaItemWidget.test.js.map +1 -0
- package/esm/components/MediaWidget/MediaWidget.css +121 -0
- package/esm/components/MediaWidget/MediaWidget.d.ts +14 -0
- package/esm/components/MediaWidget/MediaWidget.js +26 -0
- package/esm/components/MediaWidget/MediaWidget.js.map +1 -0
- package/esm/components/MediaWidget/MediaWidget.stories.d.ts +8 -0
- package/esm/components/MediaWidget/MediaWidget.stories.js +99 -0
- package/esm/components/MediaWidget/MediaWidget.stories.js.map +1 -0
- package/esm/components/MediaWidget/MediaWidget.test.d.ts +1 -0
- package/esm/components/MediaWidget/MediaWidget.test.js +31 -0
- package/esm/components/MediaWidget/MediaWidget.test.js.map +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.css +199 -0
- package/esm/components/MemoriWidget/MemoriWidget.d.ts +43 -0
- package/esm/components/MemoriWidget/MemoriWidget.js +1368 -0
- package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -0
- package/esm/components/MemoriWidget/MemoriWidget.stories.d.ts +9 -0
- package/esm/components/MemoriWidget/MemoriWidget.stories.js +63 -0
- package/esm/components/MemoriWidget/MemoriWidget.stories.js.map +1 -0
- package/esm/components/PositionDrawer/PositionDrawer.d.ts +3 -0
- package/esm/components/PositionDrawer/PositionDrawer.js +5 -0
- package/esm/components/PositionDrawer/PositionDrawer.js.map +1 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.css +47 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.d.ts +8 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.js +20 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.js.map +1 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.stories.d.ts +6 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.stories.js +36 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.stories.js.map +1 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.test.d.ts +1 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.test.js +12 -0
- package/esm/components/SendOnEnterMenu/SendOnEnterMenu.test.js.map +1 -0
- package/esm/components/ShareButton/ShareButton.css +57 -0
- package/esm/components/ShareButton/ShareButton.d.ts +13 -0
- package/esm/components/ShareButton/ShareButton.js +109 -0
- package/esm/components/ShareButton/ShareButton.js.map +1 -0
- package/esm/components/ShareButton/ShareButton.stories.d.ts +7 -0
- package/esm/components/ShareButton/ShareButton.stories.js +43 -0
- package/esm/components/ShareButton/ShareButton.stories.js.map +1 -0
- package/esm/components/ShareButton/ShareButton.test.d.ts +1 -0
- package/esm/components/ShareButton/ShareButton.test.js +28 -0
- package/esm/components/ShareButton/ShareButton.test.js.map +1 -0
- package/esm/components/Snippet/Snippet.css +35 -0
- package/esm/components/Snippet/Snippet.d.ts +10 -0
- package/esm/components/Snippet/Snippet.js +37 -0
- package/esm/components/Snippet/Snippet.js.map +1 -0
- package/esm/components/Snippet/Snippet.stories.d.ts +73 -0
- package/esm/components/Snippet/Snippet.stories.js +243 -0
- package/esm/components/Snippet/Snippet.stories.js.map +1 -0
- package/esm/components/Snippet/Snippet.test.d.ts +1 -0
- package/esm/components/Snippet/Snippet.test.js +111 -0
- package/esm/components/Snippet/Snippet.test.js.map +1 -0
- package/esm/components/StartPanel/StartPanel.css +121 -0
- package/esm/components/StartPanel/StartPanel.d.ts +23 -0
- package/esm/components/StartPanel/StartPanel.js +92 -0
- package/esm/components/StartPanel/StartPanel.js.map +1 -0
- package/esm/components/StartPanel/StartPanel.stories.d.ts +10 -0
- package/esm/components/StartPanel/StartPanel.stories.js +159 -0
- package/esm/components/StartPanel/StartPanel.stories.js.map +1 -0
- package/esm/components/StartPanel/StartPanel.test.d.ts +1 -0
- package/esm/components/StartPanel/StartPanel.test.js +41 -0
- package/esm/components/StartPanel/StartPanel.test.js.map +1 -0
- package/esm/components/UploadMenu/UploadMenu.css +46 -0
- package/esm/components/UploadMenu/UploadMenu.d.ts +9 -0
- package/esm/components/UploadMenu/UploadMenu.js +21 -0
- package/esm/components/UploadMenu/UploadMenu.js.map +1 -0
- package/esm/components/UploadMenu/UploadMenu.stories.d.ts +6 -0
- package/esm/components/UploadMenu/UploadMenu.stories.js +37 -0
- package/esm/components/UploadMenu/UploadMenu.stories.js.map +1 -0
- package/esm/components/UploadMenu/UploadMenu.test.d.ts +1 -0
- package/esm/components/UploadMenu/UploadMenu.test.js +20 -0
- package/esm/components/UploadMenu/UploadMenu.test.js.map +1 -0
- package/esm/components/icons/Close.d.ts +6 -0
- package/esm/components/icons/Close.js +5 -0
- package/esm/components/icons/Close.js.map +1 -0
- package/esm/components/icons/Copy.d.ts +6 -0
- package/esm/components/icons/Copy.js +5 -0
- package/esm/components/icons/Copy.js.map +1 -0
- package/esm/components/icons/Download.d.ts +6 -0
- package/esm/components/icons/Download.js +5 -0
- package/esm/components/icons/Download.js.map +1 -0
- package/esm/components/icons/Edit.d.ts +6 -0
- package/esm/components/icons/Edit.js +5 -0
- package/esm/components/icons/Edit.js.map +1 -0
- package/esm/components/icons/Expand.d.ts +6 -0
- package/esm/components/icons/Expand.js +5 -0
- package/esm/components/icons/Expand.js.map +1 -0
- package/esm/components/icons/Eye.d.ts +6 -0
- package/esm/components/icons/Eye.js +5 -0
- package/esm/components/icons/Eye.js.map +1 -0
- package/esm/components/icons/EyeInvisible.d.ts +6 -0
- package/esm/components/icons/EyeInvisible.js +6 -0
- package/esm/components/icons/EyeInvisible.js.map +1 -0
- package/esm/components/icons/Facebook.d.ts +6 -0
- package/esm/components/icons/Facebook.js +5 -0
- package/esm/components/icons/Facebook.js.map +1 -0
- package/esm/components/icons/File.d.ts +6 -0
- package/esm/components/icons/File.js +5 -0
- package/esm/components/icons/File.js.map +1 -0
- package/esm/components/icons/FileExcel.d.ts +6 -0
- package/esm/components/icons/FileExcel.js +5 -0
- package/esm/components/icons/FileExcel.js.map +1 -0
- package/esm/components/icons/FilePdf.d.ts +6 -0
- package/esm/components/icons/FilePdf.js +5 -0
- package/esm/components/icons/FilePdf.js.map +1 -0
- package/esm/components/icons/FileWord.d.ts +6 -0
- package/esm/components/icons/FileWord.js +5 -0
- package/esm/components/icons/FileWord.js.map +1 -0
- package/esm/components/icons/Fullscreen.d.ts +6 -0
- package/esm/components/icons/Fullscreen.js +5 -0
- package/esm/components/icons/Fullscreen.js.map +1 -0
- package/esm/components/icons/FullscreenExit.d.ts +6 -0
- package/esm/components/icons/FullscreenExit.js +5 -0
- package/esm/components/icons/FullscreenExit.js.map +1 -0
- package/esm/components/icons/Link.d.ts +6 -0
- package/esm/components/icons/Link.js +5 -0
- package/esm/components/icons/Link.js.map +1 -0
- package/esm/components/icons/Linkedin.d.ts +6 -0
- package/esm/components/icons/Linkedin.js +5 -0
- package/esm/components/icons/Linkedin.js.map +1 -0
- package/esm/components/icons/Loading.d.ts +8 -0
- package/esm/components/icons/Loading.js +9 -0
- package/esm/components/icons/Loading.js.map +1 -0
- package/esm/components/icons/Mail.d.ts +6 -0
- package/esm/components/icons/Mail.js +5 -0
- package/esm/components/icons/Mail.js.map +1 -0
- package/esm/components/icons/MapMarker.d.ts +6 -0
- package/esm/components/icons/MapMarker.js +5 -0
- package/esm/components/icons/MapMarker.js.map +1 -0
- package/esm/components/icons/Message.d.ts +6 -0
- package/esm/components/icons/Message.js +5 -0
- package/esm/components/icons/Message.js.map +1 -0
- package/esm/components/icons/Minus.d.ts +6 -0
- package/esm/components/icons/Minus.js +5 -0
- package/esm/components/icons/Minus.js.map +1 -0
- package/esm/components/icons/MinusCircle.d.ts +6 -0
- package/esm/components/icons/MinusCircle.js +6 -0
- package/esm/components/icons/MinusCircle.js.map +1 -0
- package/esm/components/icons/PaperClip.d.ts +6 -0
- package/esm/components/icons/PaperClip.js +5 -0
- package/esm/components/icons/PaperClip.js.map +1 -0
- package/esm/components/icons/Picture.d.ts +6 -0
- package/esm/components/icons/Picture.js +5 -0
- package/esm/components/icons/Picture.js.map +1 -0
- package/esm/components/icons/Plus.d.ts +6 -0
- package/esm/components/icons/Plus.js +6 -0
- package/esm/components/icons/Plus.js.map +1 -0
- package/esm/components/icons/Send.d.ts +6 -0
- package/esm/components/icons/Send.js +5 -0
- package/esm/components/icons/Send.js.map +1 -0
- package/esm/components/icons/Setting.d.ts +6 -0
- package/esm/components/icons/Setting.js +5 -0
- package/esm/components/icons/Setting.js.map +1 -0
- package/esm/components/icons/Share.d.ts +6 -0
- package/esm/components/icons/Share.js +5 -0
- package/esm/components/icons/Share.js.map +1 -0
- package/esm/components/icons/Sound.d.ts +6 -0
- package/esm/components/icons/Sound.js +5 -0
- package/esm/components/icons/Sound.js.map +1 -0
- package/esm/components/icons/SoundDeactivated.d.ts +6 -0
- package/esm/components/icons/SoundDeactivated.js +5 -0
- package/esm/components/icons/SoundDeactivated.js.map +1 -0
- package/esm/components/icons/Telegram.d.ts +6 -0
- package/esm/components/icons/Telegram.js +5 -0
- package/esm/components/icons/Telegram.js.map +1 -0
- package/esm/components/icons/Translation.d.ts +6 -0
- package/esm/components/icons/Translation.js +6 -0
- package/esm/components/icons/Translation.js.map +1 -0
- package/esm/components/icons/Twitter.d.ts +6 -0
- package/esm/components/icons/Twitter.js +5 -0
- package/esm/components/icons/Twitter.js.map +1 -0
- package/esm/components/icons/User.d.ts +6 -0
- package/esm/components/icons/User.js +5 -0
- package/esm/components/icons/User.js.map +1 -0
- package/esm/components/icons/Warning.d.ts +6 -0
- package/esm/components/icons/Warning.js +5 -0
- package/esm/components/icons/Warning.js.map +1 -0
- package/esm/components/icons/WhatsApp.d.ts +6 -0
- package/esm/components/icons/WhatsApp.js +6 -0
- package/esm/components/icons/WhatsApp.js.map +1 -0
- package/esm/components/icons/icons.stories.d.ts +8 -0
- package/esm/components/icons/icons.stories.js +38 -0
- package/esm/components/icons/icons.stories.js.map +1 -0
- package/esm/components/icons/loading.css +14 -0
- package/esm/components/layouts/Default.d.ts +16 -0
- package/esm/components/layouts/Default.js +13 -0
- package/esm/components/layouts/Default.js.map +1 -0
- package/esm/components/ui/Button.css +138 -0
- package/esm/components/ui/Button.d.ts +22 -0
- package/esm/components/ui/Button.js +24 -0
- package/esm/components/ui/Button.js.map +1 -0
- package/esm/components/ui/Button.stories.d.ts +17 -0
- package/esm/components/ui/Button.stories.js +137 -0
- package/esm/components/ui/Button.stories.js.map +1 -0
- package/esm/components/ui/Button.test.d.ts +1 -0
- package/esm/components/ui/Button.test.js +61 -0
- package/esm/components/ui/Button.test.js.map +1 -0
- package/esm/components/ui/Card.css +60 -0
- package/esm/components/ui/Card.d.ts +13 -0
- package/esm/components/ui/Card.js +17 -0
- package/esm/components/ui/Card.js.map +1 -0
- package/esm/components/ui/Card.stories.d.ts +10 -0
- package/esm/components/ui/Card.stories.js +80 -0
- package/esm/components/ui/Card.stories.js.map +1 -0
- package/esm/components/ui/Card.test.d.ts +1 -0
- package/esm/components/ui/Card.test.js +37 -0
- package/esm/components/ui/Card.test.js.map +1 -0
- package/esm/components/ui/Checkbox.css +111 -0
- package/esm/components/ui/Checkbox.d.ts +9 -0
- package/esm/components/ui/Checkbox.js +12 -0
- package/esm/components/ui/Checkbox.js.map +1 -0
- package/esm/components/ui/Checkbox.stories.d.ts +8 -0
- package/esm/components/ui/Checkbox.stories.js +49 -0
- package/esm/components/ui/Checkbox.stories.js.map +1 -0
- package/esm/components/ui/Checkbox.test.d.ts +1 -0
- package/esm/components/ui/Checkbox.test.js +20 -0
- package/esm/components/ui/Checkbox.test.js.map +1 -0
- package/esm/components/ui/Drawer.css +138 -0
- package/esm/components/ui/Drawer.d.ts +19 -0
- package/esm/components/ui/Drawer.js +36 -0
- package/esm/components/ui/Drawer.js.map +1 -0
- package/esm/components/ui/Drawer.stories.d.ts +12 -0
- package/esm/components/ui/Drawer.stories.js +134 -0
- package/esm/components/ui/Drawer.stories.js.map +1 -0
- package/esm/components/ui/Drawer.test.d.ts +1 -0
- package/esm/components/ui/Drawer.test.js +61 -0
- package/esm/components/ui/Drawer.test.js.map +1 -0
- package/esm/components/ui/Message.d.ts +18 -0
- package/esm/components/ui/Message.js +10 -0
- package/esm/components/ui/Message.js.map +1 -0
- package/esm/components/ui/Modal.css +98 -0
- package/esm/components/ui/Modal.d.ts +17 -0
- package/esm/components/ui/Modal.js +32 -0
- package/esm/components/ui/Modal.js.map +1 -0
- package/esm/components/ui/Modal.stories.d.ts +12 -0
- package/esm/components/ui/Modal.stories.js +124 -0
- package/esm/components/ui/Modal.stories.js.map +1 -0
- package/esm/components/ui/Modal.test.d.ts +1 -0
- package/esm/components/ui/Modal.test.js +57 -0
- package/esm/components/ui/Modal.test.js.map +1 -0
- package/esm/components/ui/Spin.css +29 -0
- package/esm/components/ui/Spin.d.ts +10 -0
- package/esm/components/ui/Spin.js +13 -0
- package/esm/components/ui/Spin.js.map +1 -0
- package/esm/components/ui/Spin.stories.d.ts +7 -0
- package/esm/components/ui/Spin.stories.js +50 -0
- package/esm/components/ui/Spin.stories.js.map +1 -0
- package/esm/components/ui/Spin.test.d.ts +1 -0
- package/esm/components/ui/Spin.test.js +29 -0
- package/esm/components/ui/Spin.test.js.map +1 -0
- package/esm/components/ui/Tooltip.css +78 -0
- package/esm/components/ui/Tooltip.d.ts +12 -0
- package/esm/components/ui/Tooltip.js +12 -0
- package/esm/components/ui/Tooltip.js.map +1 -0
- package/esm/components/ui/Tooltip.stories.d.ts +8 -0
- package/esm/components/ui/Tooltip.stories.js +45 -0
- package/esm/components/ui/Tooltip.stories.js.map +1 -0
- package/esm/components/ui/Tooltip.test.d.ts +1 -0
- package/esm/components/ui/Tooltip.test.js +23 -0
- package/esm/components/ui/Tooltip.test.js.map +1 -0
- package/esm/helpers/configuration.d.ts +5 -0
- package/esm/helpers/configuration.js +23 -0
- package/esm/helpers/configuration.js.map +1 -0
- package/esm/helpers/constants.d.ts +19 -0
- package/esm/helpers/constants.js +109 -0
- package/esm/helpers/constants.js.map +1 -0
- package/esm/helpers/error.d.ts +2 -0
- package/esm/helpers/error.js +127 -0
- package/esm/helpers/error.js.map +1 -0
- package/esm/helpers/media.d.ts +8 -0
- package/esm/helpers/media.js +30 -0
- package/esm/helpers/media.js.map +1 -0
- package/esm/helpers/statistics.d.ts +13 -0
- package/esm/helpers/statistics.js +204 -0
- package/esm/helpers/statistics.js.map +1 -0
- package/esm/helpers/translations.d.ts +6 -0
- package/esm/helpers/translations.js +25 -0
- package/esm/helpers/translations.js.map +1 -0
- package/esm/helpers/utils.d.ts +23 -0
- package/esm/helpers/utils.js +117 -0
- package/esm/helpers/utils.js.map +1 -0
- package/esm/i18n.d.ts +2 -0
- package/esm/i18n.js +24 -0
- package/esm/i18n.js.map +1 -0
- package/esm/index.d.ts +29 -0
- package/esm/index.js +87 -0
- package/esm/index.js.map +1 -0
- package/esm/locales/en.json +189 -0
- package/esm/locales/it.json +189 -0
- package/esm/mocks/data.d.ts +9 -0
- package/esm/mocks/data.js +194 -0
- package/esm/mocks/data.js.map +1 -0
- package/package.json +266 -0
- package/src/components/Auth/Auth.css +57 -0
- package/src/components/Auth/Auth.stories.tsx +83 -0
- package/src/components/Auth/Auth.test.tsx +59 -0
- package/src/components/Auth/Auth.tsx +172 -0
- package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +143 -0
- package/src/components/Avatar/Avatar.css +151 -0
- package/src/components/Avatar/Avatar.stories.tsx +116 -0
- package/src/components/Avatar/Avatar.test.tsx +85 -0
- package/src/components/Avatar/Avatar.tsx +178 -0
- package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +181 -0
- package/src/components/AvatarView/AvatarView.stories.tsx +119 -0
- package/src/components/AvatarView/components/avatar.tsx +59 -0
- package/src/components/AvatarView/components/loader.tsx +28 -0
- package/src/components/AvatarView/index.tsx +64 -0
- package/src/components/AvatarView/utils/useEyeBlink.ts +48 -0
- package/src/components/AvatarView/utils/useHeadMovement.ts +72 -0
- package/src/components/AvatarView/utils/useMouthSpeaking.ts +68 -0
- package/src/components/AvatarView/utils/utils.ts +55 -0
- package/src/components/Blob/Blob.css +249 -0
- package/src/components/Blob/Blob.stories.tsx +36 -0
- package/src/components/Blob/Blob.test.tsx +13 -0
- package/src/components/Blob/Blob.tsx +25 -0
- package/src/components/Blob/__snapshots__/Blob.test.tsx.snap +56 -0
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +40 -0
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +45 -0
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.test.tsx +44 -0
- package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx +70 -0
- package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +162 -0
- package/src/components/ChangeMode/ChangeMode.css +22 -0
- package/src/components/ChangeMode/ChangeMode.stories.tsx +44 -0
- package/src/components/ChangeMode/ChangeMode.test.tsx +17 -0
- package/src/components/ChangeMode/ChangeMode.tsx +48 -0
- package/src/components/ChangeMode/__snapshots__/ChangeMode.test.tsx.snap +105 -0
- package/src/components/Chat/Chat.css +117 -0
- package/src/components/Chat/Chat.stories.tsx +187 -0
- package/src/components/Chat/Chat.test.tsx +230 -0
- package/src/components/Chat/Chat.tsx +299 -0
- package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +3581 -0
- package/src/components/ChatBubble/ChatBubble.css +159 -0
- package/src/components/ChatBubble/ChatBubble.stories.tsx +63 -0
- package/src/components/ChatBubble/ChatBubble.test.tsx +40 -0
- package/src/components/ChatBubble/ChatBubble.tsx +118 -0
- package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +60 -0
- package/src/components/ChatInputs/ChatInputs.css +21 -0
- package/src/components/ChatInputs/ChatInputs.stories.tsx +105 -0
- package/src/components/ChatInputs/ChatInputs.test.tsx +79 -0
- package/src/components/ChatInputs/ChatInputs.tsx +83 -0
- package/src/components/ChatInputs/__snapshots__/ChatInputs.test.tsx.snap +375 -0
- package/src/components/ChatTextArea/ChatTextArea.css +88 -0
- package/src/components/ChatTextArea/ChatTextArea.stories.tsx +51 -0
- package/src/components/ChatTextArea/ChatTextArea.test.tsx +43 -0
- package/src/components/ChatTextArea/ChatTextArea.tsx +65 -0
- package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +125 -0
- package/src/components/CustomGLBModelViewer/ModelViewer.css +11 -0
- package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +58 -0
- package/src/components/CustomGLBModelViewer/ModelViewer.test.tsx +13 -0
- package/src/components/CustomGLBModelViewer/ModelViewer.tsx +38 -0
- package/src/components/CustomGLBModelViewer/__snapshots__/ModelViewer.test.tsx.snap +20 -0
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +54 -0
- package/src/components/ExportHistoryButton/ExportHistoryButton.css +22 -0
- package/src/components/ExportHistoryButton/ExportHistoryButton.stories.tsx +68 -0
- package/src/components/ExportHistoryButton/ExportHistoryButton.test.tsx +67 -0
- package/src/components/ExportHistoryButton/ExportHistoryButton.tsx +105 -0
- package/src/components/ExportHistoryButton/__snapshots__/ExportHistoryButton.test.tsx.snap +239 -0
- package/src/components/Header/Header.css +58 -0
- package/src/components/Header/Header.stories.tsx +114 -0
- package/src/components/Header/Header.test.tsx +114 -0
- package/src/components/Header/Header.tsx +99 -0
- package/src/components/Header/__snapshots__/Header.test.tsx.snap +430 -0
- package/src/components/MediaWidget/LinkItemWidget.css +35 -0
- package/src/components/MediaWidget/LinkItemWidget.stories.tsx +60 -0
- package/src/components/MediaWidget/LinkItemWidget.test.tsx +33 -0
- package/src/components/MediaWidget/LinkItemWidget.tsx +176 -0
- package/src/components/MediaWidget/MediaItemWidget.css +62 -0
- package/src/components/MediaWidget/MediaItemWidget.stories.tsx +97 -0
- package/src/components/MediaWidget/MediaItemWidget.test.tsx +120 -0
- package/src/components/MediaWidget/MediaItemWidget.tsx +342 -0
- package/src/components/MediaWidget/MediaWidget.css +121 -0
- package/src/components/MediaWidget/MediaWidget.stories.tsx +117 -0
- package/src/components/MediaWidget/MediaWidget.test.tsx +40 -0
- package/src/components/MediaWidget/MediaWidget.tsx +84 -0
- package/src/components/MediaWidget/__snapshots__/LinkItemWidget.test.tsx.snap +253 -0
- package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +604 -0
- package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +196 -0
- package/src/components/MemoriWidget/MemoriWidget.css +199 -0
- package/src/components/MemoriWidget/MemoriWidget.stories.tsx +73 -0
- package/src/components/MemoriWidget/MemoriWidget.tsx +2037 -0
- package/src/components/PositionDrawer/PositionDrawer.tsx +9 -0
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.css +47 -0
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +52 -0
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.test.tsx +17 -0
- package/src/components/SendOnEnterMenu/SendOnEnterMenu.tsx +74 -0
- package/src/components/SendOnEnterMenu/__snapshots__/SendOnEnterMenu.test.tsx.snap +49 -0
- package/src/components/ShareButton/ShareButton.css +57 -0
- package/src/components/ShareButton/ShareButton.stories.tsx +52 -0
- package/src/components/ShareButton/ShareButton.test.tsx +33 -0
- package/src/components/ShareButton/ShareButton.tsx +198 -0
- package/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap +211 -0
- package/src/components/Snippet/Snippet.css +35 -0
- package/src/components/Snippet/Snippet.stories.tsx +273 -0
- package/src/components/Snippet/Snippet.test.tsx +147 -0
- package/src/components/Snippet/Snippet.tsx +70 -0
- package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +2776 -0
- package/src/components/StartPanel/StartPanel.css +121 -0
- package/src/components/StartPanel/StartPanel.stories.tsx +181 -0
- package/src/components/StartPanel/StartPanel.test.tsx +113 -0
- package/src/components/StartPanel/StartPanel.tsx +246 -0
- package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +369 -0
- package/src/components/UploadMenu/UploadMenu.css +46 -0
- package/src/components/UploadMenu/UploadMenu.stories.tsx +55 -0
- package/src/components/UploadMenu/UploadMenu.test.tsx +34 -0
- package/src/components/UploadMenu/UploadMenu.tsx +66 -0
- package/src/components/UploadMenu/__snapshots__/UploadMenu.test.tsx.snap +137 -0
- package/src/components/icons/Close.tsx +23 -0
- package/src/components/icons/Copy.tsx +17 -0
- package/src/components/icons/Download.tsx +23 -0
- package/src/components/icons/Edit.tsx +17 -0
- package/src/components/icons/Expand.tsx +23 -0
- package/src/components/icons/Eye.tsx +17 -0
- package/src/components/icons/EyeInvisible.tsx +24 -0
- package/src/components/icons/Facebook.tsx +23 -0
- package/src/components/icons/File.tsx +17 -0
- package/src/components/icons/FileExcel.tsx +23 -0
- package/src/components/icons/FilePdf.tsx +23 -0
- package/src/components/icons/FileWord.tsx +23 -0
- package/src/components/icons/Fullscreen.tsx +23 -0
- package/src/components/icons/FullscreenExit.tsx +23 -0
- package/src/components/icons/Link.tsx +17 -0
- package/src/components/icons/Linkedin.tsx +23 -0
- package/src/components/icons/Loading.tsx +29 -0
- package/src/components/icons/Mail.tsx +17 -0
- package/src/components/icons/MapMarker.tsx +26 -0
- package/src/components/icons/Message.tsx +23 -0
- package/src/components/icons/Minus.tsx +23 -0
- package/src/components/icons/MinusCircle.tsx +24 -0
- package/src/components/icons/PaperClip.tsx +23 -0
- package/src/components/icons/Picture.tsx +23 -0
- package/src/components/icons/Plus.tsx +18 -0
- package/src/components/icons/Send.tsx +17 -0
- package/src/components/icons/Setting.tsx +23 -0
- package/src/components/icons/Share.tsx +23 -0
- package/src/components/icons/Sound.tsx +23 -0
- package/src/components/icons/SoundDeactivated.tsx +27 -0
- package/src/components/icons/Telegram.tsx +26 -0
- package/src/components/icons/Translation.tsx +24 -0
- package/src/components/icons/Twitter.tsx +23 -0
- package/src/components/icons/User.tsx +17 -0
- package/src/components/icons/Warning.tsx +23 -0
- package/src/components/icons/WhatsApp.tsx +24 -0
- package/src/components/icons/icons.stories.tsx +65 -0
- package/src/components/icons/loading.css +14 -0
- package/src/components/layouts/Default.tsx +52 -0
- package/src/components/ui/Button.css +138 -0
- package/src/components/ui/Button.stories.tsx +155 -0
- package/src/components/ui/Button.test.tsx +74 -0
- package/src/components/ui/Button.tsx +78 -0
- package/src/components/ui/Card.css +60 -0
- package/src/components/ui/Card.stories.tsx +94 -0
- package/src/components/ui/Card.test.tsx +47 -0
- package/src/components/ui/Card.tsx +45 -0
- package/src/components/ui/Checkbox.css +111 -0
- package/src/components/ui/Checkbox.stories.tsx +58 -0
- package/src/components/ui/Checkbox.test.tsx +23 -0
- package/src/components/ui/Checkbox.tsx +38 -0
- package/src/components/ui/Drawer.css +138 -0
- package/src/components/ui/Drawer.stories.tsx +180 -0
- package/src/components/ui/Drawer.test.tsx +126 -0
- package/src/components/ui/Drawer.tsx +122 -0
- package/src/components/ui/Message.tsx +12 -0
- package/src/components/ui/Modal.css +98 -0
- package/src/components/ui/Modal.stories.tsx +169 -0
- package/src/components/ui/Modal.test.tsx +111 -0
- package/src/components/ui/Modal.tsx +111 -0
- package/src/components/ui/Spin.css +29 -0
- package/src/components/ui/Spin.stories.tsx +62 -0
- package/src/components/ui/Spin.test.tsx +41 -0
- package/src/components/ui/Spin.tsx +32 -0
- package/src/components/ui/Tooltip.css +78 -0
- package/src/components/ui/Tooltip.stories.tsx +59 -0
- package/src/components/ui/Tooltip.test.tsx +50 -0
- package/src/components/ui/Tooltip.tsx +34 -0
- package/src/components/ui/__snapshots__/Button.test.tsx.snap +204 -0
- package/src/components/ui/__snapshots__/Card.test.tsx.snap +321 -0
- package/src/components/ui/__snapshots__/Checkbox.test.tsx.snap +105 -0
- package/src/components/ui/__snapshots__/Drawer.test.tsx.snap +67 -0
- package/src/components/ui/__snapshots__/Modal.test.tsx.snap +59 -0
- package/src/components/ui/__snapshots__/Spin.test.tsx.snap +193 -0
- package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +87 -0
- package/src/helpers/configuration.ts +21 -0
- package/src/helpers/constants.ts +111 -0
- package/src/helpers/error.ts +142 -0
- package/src/helpers/media.ts +40 -0
- package/src/helpers/statistics.ts +252 -0
- package/src/helpers/translations.ts +41 -0
- package/src/helpers/utils.ts +151 -0
- package/src/i18n.ts +26 -0
- package/src/index.tsx +179 -0
- package/src/locales/en.json +204 -0
- package/src/locales/it.json +204 -0
- package/src/mocks/data.ts +214 -0
|
@@ -0,0 +1,1371 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const memori_api_client_1 = tslib_1.__importDefault(require("@memori.ai/memori-api-client"));
|
|
7
|
+
const standardized_audio_context_1 = require("standardized-audio-context");
|
|
8
|
+
const speechSdk = tslib_1.__importStar(require("microsoft-cognitiveservices-speech-sdk"));
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
|
+
const Message_1 = tslib_1.__importDefault(require("../ui/Message"));
|
|
11
|
+
const Chat_1 = tslib_1.__importDefault(require("../Chat/Chat"));
|
|
12
|
+
const StartPanel_1 = tslib_1.__importDefault(require("../StartPanel/StartPanel"));
|
|
13
|
+
const Avatar_1 = tslib_1.__importDefault(require("../Avatar/Avatar"));
|
|
14
|
+
const ChangeMode_1 = tslib_1.__importDefault(require("../ChangeMode/ChangeMode"));
|
|
15
|
+
const Default_1 = tslib_1.__importDefault(require("../layouts/Default"));
|
|
16
|
+
const translations_1 = require("../../helpers/translations");
|
|
17
|
+
const configuration_1 = require("../../helpers/configuration");
|
|
18
|
+
const utils_1 = require("../../helpers/utils");
|
|
19
|
+
const constants_1 = require("../../helpers/constants");
|
|
20
|
+
const error_1 = require("../../helpers/error");
|
|
21
|
+
const statistics_1 = require("../../helpers/statistics");
|
|
22
|
+
const Header_1 = tslib_1.__importDefault(require("../Header/Header"));
|
|
23
|
+
require("./MemoriWidget.css");
|
|
24
|
+
const getMemoriState = (integrationId) => {
|
|
25
|
+
var _a;
|
|
26
|
+
let widget = integrationId
|
|
27
|
+
? document.querySelector(`.memori-landing-experience[data-memori-integration="${integrationId}"]`)
|
|
28
|
+
: document.querySelector('.memori-landing-experience');
|
|
29
|
+
let widgetInner = (widget !== null && widget !== void 0 ? widget : document).querySelector('div[data-memori-engine-state]');
|
|
30
|
+
if (!widgetInner)
|
|
31
|
+
return null;
|
|
32
|
+
let engineState = (_a = widgetInner.dataset) === null || _a === void 0 ? void 0 : _a.memoriEngineState;
|
|
33
|
+
if (!engineState)
|
|
34
|
+
return null;
|
|
35
|
+
let dialogState = JSON.parse(engineState);
|
|
36
|
+
return dialogState;
|
|
37
|
+
};
|
|
38
|
+
function setNativeValue(element, value) {
|
|
39
|
+
var _a, _b, _c, _d;
|
|
40
|
+
const valueSetter = (_b = (_a = Object === null || Object === void 0 ? void 0 : Object.getOwnPropertyDescriptor) === null || _a === void 0 ? void 0 : _a.call(Object, element, 'value')) === null || _b === void 0 ? void 0 : _b.set;
|
|
41
|
+
const prototype = Object.getPrototypeOf(element);
|
|
42
|
+
const prototypeValueSetter = (_d = (_c = Object === null || Object === void 0 ? void 0 : Object.getOwnPropertyDescriptor) === null || _c === void 0 ? void 0 : _c.call(Object, prototype, 'value')) === null || _d === void 0 ? void 0 : _d.set;
|
|
43
|
+
if (prototypeValueSetter &&
|
|
44
|
+
valueSetter &&
|
|
45
|
+
valueSetter !== prototypeValueSetter) {
|
|
46
|
+
prototypeValueSetter.call(element, value);
|
|
47
|
+
}
|
|
48
|
+
else if (valueSetter) {
|
|
49
|
+
valueSetter.call(element, value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const typeMessage = (message) => {
|
|
53
|
+
let textarea = document.querySelector('fieldset#chat-fieldset textarea');
|
|
54
|
+
if (!textarea)
|
|
55
|
+
return;
|
|
56
|
+
setNativeValue(textarea, message);
|
|
57
|
+
textarea.dispatchEvent(new Event('input', { bubbles: true }));
|
|
58
|
+
setTimeout(() => {
|
|
59
|
+
let sendButton = document.querySelector('fieldset#chat-fieldset textarea + button');
|
|
60
|
+
if (!sendButton)
|
|
61
|
+
return;
|
|
62
|
+
sendButton.click();
|
|
63
|
+
}, 100);
|
|
64
|
+
};
|
|
65
|
+
window.getMemoriState = getMemoriState;
|
|
66
|
+
window.typeMessage = typeMessage;
|
|
67
|
+
const silenceSeconds = [2, 3, 5, 10, 15, 20, 30, 60];
|
|
68
|
+
let recognizer;
|
|
69
|
+
let speechConfig;
|
|
70
|
+
let speechSynthesizer;
|
|
71
|
+
let audioDestination;
|
|
72
|
+
const MemoriWidget = ({ memori: initialMemori, memoriConfigs, memoriLang, integration, showInstruct = false, showShare = true, preview = false, embed = false, showInputs = true, showDates = false, showContextPerLine = false, showSettings = false, secret, baseUrl = 'https://app.twincreator.com', apiUrl = 'https://backend.memori.ai', initialContextVars, initialQuestion, ogImage, sessionID: initialSessionID, tenant, personification, AZURE_COGNITIVE_SERVICES_TTS_KEY, }) => {
|
|
73
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _t, _u;
|
|
74
|
+
const { t, i18n } = (0, react_i18next_1.useTranslation)();
|
|
75
|
+
const client = (0, memori_api_client_1.default)(apiUrl);
|
|
76
|
+
const { initSession, postTextEnteredEvent, postPlaceChangedEvent, postTimeoutEvent, postTagChangedEvent, getSession, getContentQualityIndexes, } = client;
|
|
77
|
+
const [memori, setMemori] = (0, react_1.useState)(initialMemori);
|
|
78
|
+
const [instruct, setInstruct] = (0, react_1.useState)(false);
|
|
79
|
+
const [clickedStart, setClickedStart] = (0, react_1.useState)(false);
|
|
80
|
+
const [gotErrorInOpening, setGotErrorInOpening] = (0, react_1.useState)(false);
|
|
81
|
+
const language = (_d = (_c = (_b = (_a = memoriConfigs === null || memoriConfigs === void 0 ? void 0 : memoriConfigs.find(c => c.memoriConfigID === memori.memoriConfigurationID)) === null || _a === void 0 ? void 0 : _a.culture) === null || _b === void 0 ? void 0 : _b.split('-')) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase();
|
|
82
|
+
const [userLang, setUserLang] = (0, react_1.useState)((_k = (_j = (_h = memoriLang !== null && memoriLang !== void 0 ? memoriLang : (_g = (_f = memori === null || memori === void 0 ? void 0 : memori.culture) === null || _f === void 0 ? void 0 : _f.split('-')) === null || _g === void 0 ? void 0 : _g[0]) !== null && _h !== void 0 ? _h : language) !== null && _j !== void 0 ? _j : i18n.language) !== null && _k !== void 0 ? _k : 'IT');
|
|
83
|
+
const integrationConfig = (integration === null || integration === void 0 ? void 0 : integration.customData)
|
|
84
|
+
? JSON.parse(integration.customData)
|
|
85
|
+
: null;
|
|
86
|
+
const isMultilanguageEnabled = !!(integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.multilanguage);
|
|
87
|
+
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
88
|
+
const [memoriTyping, setMemoriTyping] = (0, react_1.useState)(false);
|
|
89
|
+
const [hasUserActivatedSpeak, setHasUserActivatedSpeak] = (0, react_1.useState)(false);
|
|
90
|
+
const [hasUserActivatedListening, setHasUserActivatedListening] = (0, react_1.useState)(false);
|
|
91
|
+
const [showPositionDrawer, setShowPositionDrawer] = (0, react_1.useState)(false);
|
|
92
|
+
const [showSettingsDrawer, setShowSettingsDrawer] = (0, react_1.useState)(false);
|
|
93
|
+
const [showChatHistory, setShowChatHistory] = (0, react_1.useState)(false);
|
|
94
|
+
const [muteSpeaker, setMuteSpeaker] = (0, react_1.useState)(false);
|
|
95
|
+
const [continuousSpeech, setContinuousSpeech] = (0, react_1.useState)(false);
|
|
96
|
+
const [continuousSpeechTimeout, setContinuousSpeechTimeout] = (0, react_1.useState)(3);
|
|
97
|
+
const [isPlayingAudio, setIsPlayingAudio] = (0, react_1.useState)(false);
|
|
98
|
+
(0, react_1.useEffect)(() => {
|
|
99
|
+
setIsPlayingAudio(!!speechSynthesizer);
|
|
100
|
+
}, [speechSynthesizer]);
|
|
101
|
+
(0, react_1.useEffect)(() => {
|
|
102
|
+
setMuteSpeaker((0, configuration_1.getLocalConfig)('muteSpeaker', false));
|
|
103
|
+
setContinuousSpeech((0, configuration_1.getLocalConfig)('continuousSpeech', false));
|
|
104
|
+
setContinuousSpeechTimeout((0, configuration_1.getLocalConfig)('continuousSpeechTimeout', 3));
|
|
105
|
+
}, []);
|
|
106
|
+
const [isClient, setIsClient] = (0, react_1.useState)(false);
|
|
107
|
+
(0, react_1.useEffect)(() => {
|
|
108
|
+
setIsClient(true);
|
|
109
|
+
}, []);
|
|
110
|
+
const [memoriPwd, setMemoriPwd] = (0, react_1.useState)(secret);
|
|
111
|
+
const [memoriTokens, setMemoriTokens] = (0, react_1.useState)();
|
|
112
|
+
const [authModalState, setAuthModalState] = (0, react_1.useState)(null);
|
|
113
|
+
const [position, _setPosition] = (0, react_1.useState)();
|
|
114
|
+
const applyPosition = async (venue, sessionID) => {
|
|
115
|
+
var _a;
|
|
116
|
+
const session = sessionID !== null && sessionID !== void 0 ? sessionID : sessionId;
|
|
117
|
+
if (venue && session) {
|
|
118
|
+
const { currentState, ...response } = await postPlaceChangedEvent({
|
|
119
|
+
sessionId: session,
|
|
120
|
+
placeName: venue.placeName,
|
|
121
|
+
latitude: venue.latitude,
|
|
122
|
+
longitude: venue.longitude,
|
|
123
|
+
uncertaintyKm: (_a = venue.uncertainty) !== null && _a !== void 0 ? _a : 0,
|
|
124
|
+
});
|
|
125
|
+
if (currentState && response.resultCode === 0) {
|
|
126
|
+
setCurrentDialogState({ ...currentDialogState, ...currentState });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const setPosition = (venue) => {
|
|
131
|
+
_setPosition(venue);
|
|
132
|
+
applyPosition(venue);
|
|
133
|
+
};
|
|
134
|
+
const [userMessage, setUserMessage] = (0, react_1.useState)('');
|
|
135
|
+
const onChangeUserMessage = (value) => {
|
|
136
|
+
if (!value || value === '\n' || value.trim() === '') {
|
|
137
|
+
setUserMessage('');
|
|
138
|
+
resetInteractionTimeout();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
setUserMessage(value);
|
|
142
|
+
clearInteractionTimeout();
|
|
143
|
+
};
|
|
144
|
+
const [listening, setListening] = (0, react_1.useState)(false);
|
|
145
|
+
const [history, setHistory] = (0, react_1.useState)([]);
|
|
146
|
+
const pushMessage = (message) => {
|
|
147
|
+
setHistory(history => [...history, { ...message }]);
|
|
148
|
+
};
|
|
149
|
+
const sendMessage = async (text, media, newSessionId, translate = true, translatedText) => {
|
|
150
|
+
var _a, _b, _c, _d, _f;
|
|
151
|
+
if (!sessionId || !(text === null || text === void 0 ? void 0 : text.length))
|
|
152
|
+
return;
|
|
153
|
+
pushMessage({
|
|
154
|
+
text: text,
|
|
155
|
+
translatedText,
|
|
156
|
+
fromUser: true,
|
|
157
|
+
media: media !== null && media !== void 0 ? media : [],
|
|
158
|
+
initial: !!newSessionId,
|
|
159
|
+
});
|
|
160
|
+
setMemoriTyping(true);
|
|
161
|
+
const language = (_d = (_c = (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language) !== null && _d !== void 0 ? _d : 'IT';
|
|
162
|
+
let msg = text;
|
|
163
|
+
if (translate &&
|
|
164
|
+
!instruct &&
|
|
165
|
+
isMultilanguageEnabled &&
|
|
166
|
+
userLang.toUpperCase() !== language.toUpperCase()) {
|
|
167
|
+
const translation = await (0, translations_1.getTranslation)(text, language, userLang, baseUrl);
|
|
168
|
+
msg = translation.text;
|
|
169
|
+
}
|
|
170
|
+
const { currentState, ...response } = await postTextEnteredEvent({
|
|
171
|
+
sessionId: newSessionId !== null && newSessionId !== void 0 ? newSessionId : sessionId,
|
|
172
|
+
text: msg,
|
|
173
|
+
});
|
|
174
|
+
if (response.resultCode === 0 && currentState) {
|
|
175
|
+
const emission = (_f = currentState.emission) !== null && _f !== void 0 ? _f : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
|
|
176
|
+
if (currentState.state === 'X4' && memori.giverTag) {
|
|
177
|
+
const { currentState, ...resp } = await postTagChangedEvent(sessionId, memori.giverTag);
|
|
178
|
+
if (resp.resultCode === 0) {
|
|
179
|
+
setCurrentDialogState(currentState);
|
|
180
|
+
if (currentState.emission) {
|
|
181
|
+
pushMessage({
|
|
182
|
+
text: currentState.emission,
|
|
183
|
+
media: currentState.media,
|
|
184
|
+
fromUser: false,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
console.error(response, resp);
|
|
190
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(resp.resultCode), { ns: 'common' }));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else if (currentState.state === 'X2d' && memori.giverTag) {
|
|
194
|
+
const { currentState, ...resp } = await postTextEnteredEvent({
|
|
195
|
+
sessionId: newSessionId !== null && newSessionId !== void 0 ? newSessionId : sessionId,
|
|
196
|
+
text: Math.random()
|
|
197
|
+
.toString()
|
|
198
|
+
.substring(2, 8),
|
|
199
|
+
});
|
|
200
|
+
if (resp.resultCode === 0) {
|
|
201
|
+
const { currentState, ...resp } = await postTagChangedEvent(sessionId, memori.giverTag);
|
|
202
|
+
if (resp.resultCode === 0) {
|
|
203
|
+
setCurrentDialogState(currentState);
|
|
204
|
+
if (currentState.emission) {
|
|
205
|
+
pushMessage({
|
|
206
|
+
text: currentState.emission,
|
|
207
|
+
media: currentState.media,
|
|
208
|
+
fromUser: false,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
console.error(response, resp);
|
|
214
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(resp.resultCode), { ns: 'common' }));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
console.error(response, resp);
|
|
219
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(resp.resultCode), { ns: 'common' }));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else if (userLang.toLowerCase() !== language.toLowerCase() &&
|
|
223
|
+
emission &&
|
|
224
|
+
!instruct &&
|
|
225
|
+
isMultilanguageEnabled) {
|
|
226
|
+
translateDialogState(currentState, userLang);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
setCurrentDialogState({
|
|
230
|
+
...currentState,
|
|
231
|
+
emission,
|
|
232
|
+
});
|
|
233
|
+
if (emission)
|
|
234
|
+
pushMessage({
|
|
235
|
+
text: emission,
|
|
236
|
+
media: currentState.media,
|
|
237
|
+
fromUser: false,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
setHistory(h => [...h.slice(0, h.length - 1)]);
|
|
243
|
+
reopenSession(false, memoriPwd || memori.secretToken, memoriTokens, instruct && memori.giverTag ? memori.giverTag : undefined, instruct && memori.giverPIN ? memori.giverPIN : undefined, initialContextVars, initialQuestion).then(sessionID => {
|
|
244
|
+
console.info('session timeout');
|
|
245
|
+
if (sessionID) {
|
|
246
|
+
setTimeout(() => {
|
|
247
|
+
sendMessage(text, media, sessionID);
|
|
248
|
+
}, 500);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
setMemoriTyping(false);
|
|
253
|
+
};
|
|
254
|
+
const translateDialogState = async (state, userLang) => {
|
|
255
|
+
var _a, _b, _c, _d, _f, _g;
|
|
256
|
+
const language = (_d = (_c = (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language) !== null && _d !== void 0 ? _d : 'IT';
|
|
257
|
+
const emission = (_f = state.emission) !== null && _f !== void 0 ? _f : currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission;
|
|
258
|
+
let translatedState = { ...state };
|
|
259
|
+
let translatedMsg = null;
|
|
260
|
+
if (!emission ||
|
|
261
|
+
instruct ||
|
|
262
|
+
language.toUpperCase() === userLang.toUpperCase() ||
|
|
263
|
+
!isMultilanguageEnabled) {
|
|
264
|
+
translatedState = { ...state, emission };
|
|
265
|
+
if (emission) {
|
|
266
|
+
translatedMsg = {
|
|
267
|
+
text: emission,
|
|
268
|
+
media: state.media,
|
|
269
|
+
fromUser: false,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
const t = await (0, translations_1.getTranslation)(emission, userLang, language, baseUrl);
|
|
275
|
+
if (state.hints && state.hints.length > 0) {
|
|
276
|
+
const translatedHints = await Promise.all(((_g = state.hints) !== null && _g !== void 0 ? _g : []).map(async (hint) => {
|
|
277
|
+
var _a;
|
|
278
|
+
const tHint = await (0, translations_1.getTranslation)(hint, userLang, language, baseUrl);
|
|
279
|
+
return {
|
|
280
|
+
text: (_a = tHint === null || tHint === void 0 ? void 0 : tHint.text) !== null && _a !== void 0 ? _a : hint,
|
|
281
|
+
originalText: hint,
|
|
282
|
+
};
|
|
283
|
+
}));
|
|
284
|
+
translatedState = {
|
|
285
|
+
...state,
|
|
286
|
+
emission: t.text,
|
|
287
|
+
translatedHints,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
translatedState = {
|
|
292
|
+
...state,
|
|
293
|
+
emission: t.text,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
if (t.text.length > 0)
|
|
297
|
+
translatedMsg = {
|
|
298
|
+
text: t.text,
|
|
299
|
+
media: state.media,
|
|
300
|
+
fromUser: false,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
setCurrentDialogState(translatedState);
|
|
304
|
+
if (translatedMsg) {
|
|
305
|
+
pushMessage(translatedMsg);
|
|
306
|
+
}
|
|
307
|
+
return translatedState;
|
|
308
|
+
};
|
|
309
|
+
const [sessionId, setSessionId] = (0, react_1.useState)(initialSessionID);
|
|
310
|
+
const [currentDialogState, setCurrentDialogState] = (0, react_1.useState)();
|
|
311
|
+
const fetchSession = async (params) => {
|
|
312
|
+
var _a, _b, _c, _d, _f;
|
|
313
|
+
if (memori.privacyType !== 'PUBLIC' && !memori.secretToken) {
|
|
314
|
+
setAuthModalState('password');
|
|
315
|
+
}
|
|
316
|
+
setLoading(true);
|
|
317
|
+
try {
|
|
318
|
+
if (!memori.giverTag && !!((_a = memori.receivedInvitations) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
319
|
+
let giverInvitation = memori.receivedInvitations.find((i) => i.type === 'GIVER' && i.state === 'ACCEPTED');
|
|
320
|
+
if (giverInvitation) {
|
|
321
|
+
memori.giverTag = giverInvitation.tag;
|
|
322
|
+
memori.giverPIN = giverInvitation.pin;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const session = await initSession(params);
|
|
326
|
+
if ((session === null || session === void 0 ? void 0 : session.sessionID) &&
|
|
327
|
+
(session === null || session === void 0 ? void 0 : session.currentState) &&
|
|
328
|
+
session.resultCode === 0) {
|
|
329
|
+
setSessionId(session.sessionID);
|
|
330
|
+
const language = (_f = (_d = (_c = (_b = memori.culture) === null || _b === void 0 ? void 0 : _b.split('-')) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : i18n.language) !== null && _f !== void 0 ? _f : 'IT';
|
|
331
|
+
if (!instruct &&
|
|
332
|
+
isMultilanguageEnabled &&
|
|
333
|
+
userLang.toLowerCase() !== language.toLowerCase()) {
|
|
334
|
+
translateDialogState(session.currentState, userLang).then(state => {
|
|
335
|
+
if (state === null || state === void 0 ? void 0 : state.emission) {
|
|
336
|
+
history.length <= 1
|
|
337
|
+
? setHistory([
|
|
338
|
+
{
|
|
339
|
+
text: state.emission,
|
|
340
|
+
media: state.media,
|
|
341
|
+
fromUser: false,
|
|
342
|
+
initial: true,
|
|
343
|
+
},
|
|
344
|
+
])
|
|
345
|
+
: pushMessage({
|
|
346
|
+
text: state.emission,
|
|
347
|
+
media: state.media,
|
|
348
|
+
fromUser: false,
|
|
349
|
+
initial: true,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
setCurrentDialogState(session.currentState);
|
|
356
|
+
if (session.currentState.emission) {
|
|
357
|
+
history.length <= 1
|
|
358
|
+
? setHistory([
|
|
359
|
+
{
|
|
360
|
+
text: session.currentState.emission,
|
|
361
|
+
media: session.currentState.media,
|
|
362
|
+
fromUser: false,
|
|
363
|
+
initial: true,
|
|
364
|
+
},
|
|
365
|
+
])
|
|
366
|
+
: pushMessage({
|
|
367
|
+
text: session.currentState.emission,
|
|
368
|
+
media: session.currentState.media,
|
|
369
|
+
fromUser: false,
|
|
370
|
+
initial: true,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (position)
|
|
375
|
+
applyPosition(position, session.sessionID);
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
console.error(session);
|
|
379
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(session === null || session === void 0 ? void 0 : session.resultCode), { ns: 'common' }));
|
|
380
|
+
setGotErrorInOpening(true);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
catch (err) {
|
|
384
|
+
console.error(err);
|
|
385
|
+
new Error('Error fetching session');
|
|
386
|
+
}
|
|
387
|
+
setLoading(false);
|
|
388
|
+
};
|
|
389
|
+
const reopenSession = async (updateDialogState = false, password, recoveryTokens, tag, pin, initialContextVars, initialQuestion) => {
|
|
390
|
+
var _a;
|
|
391
|
+
setLoading(true);
|
|
392
|
+
try {
|
|
393
|
+
const { sessionID, currentState, ...response } = await initSession({
|
|
394
|
+
memoriID: (_a = memori.engineMemoriID) !== null && _a !== void 0 ? _a : '',
|
|
395
|
+
password,
|
|
396
|
+
recoveryTokens,
|
|
397
|
+
tag,
|
|
398
|
+
pin,
|
|
399
|
+
initialContextVars,
|
|
400
|
+
initialQuestion,
|
|
401
|
+
});
|
|
402
|
+
if (sessionID && currentState && response.resultCode === 0) {
|
|
403
|
+
setSessionId(sessionID);
|
|
404
|
+
if (updateDialogState) {
|
|
405
|
+
setCurrentDialogState(currentState);
|
|
406
|
+
if (currentState.emission) {
|
|
407
|
+
history.length <= 1
|
|
408
|
+
? setHistory([
|
|
409
|
+
{
|
|
410
|
+
text: currentState.emission,
|
|
411
|
+
media: currentState.media,
|
|
412
|
+
fromUser: false,
|
|
413
|
+
},
|
|
414
|
+
])
|
|
415
|
+
: pushMessage({
|
|
416
|
+
text: currentState.emission,
|
|
417
|
+
media: currentState.media,
|
|
418
|
+
fromUser: false,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (position)
|
|
423
|
+
applyPosition(position, sessionID);
|
|
424
|
+
setLoading(false);
|
|
425
|
+
return sessionID;
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
console.error(response);
|
|
429
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(response.resultCode), { ns: 'common' }));
|
|
430
|
+
setGotErrorInOpening(true);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch (err) {
|
|
434
|
+
console.error(err);
|
|
435
|
+
}
|
|
436
|
+
setLoading(false);
|
|
437
|
+
return null;
|
|
438
|
+
};
|
|
439
|
+
(0, react_1.useEffect)(() => {
|
|
440
|
+
if (!initialSessionID) {
|
|
441
|
+
fetchSession({
|
|
442
|
+
memoriID: memori.engineMemoriID,
|
|
443
|
+
initialContextVars: initialContextVars || {},
|
|
444
|
+
initialQuestion,
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}, []);
|
|
448
|
+
const changeTag = async (memoriId, sessionId, tag, pin) => {
|
|
449
|
+
var _a;
|
|
450
|
+
if (!memoriId || !sessionId) {
|
|
451
|
+
console.error('CHANGETAG/Session not found');
|
|
452
|
+
return Promise.reject('Session not found');
|
|
453
|
+
}
|
|
454
|
+
try {
|
|
455
|
+
const { currentState, resultCode } = await postTagChangedEvent(sessionId, tag !== null && tag !== void 0 ? tag : constants_1.anonTag);
|
|
456
|
+
if (resultCode === 0) {
|
|
457
|
+
let textResult = 0;
|
|
458
|
+
if (tag !== constants_1.anonTag &&
|
|
459
|
+
pin &&
|
|
460
|
+
(currentState.state === 'X1a' || currentState.state === 'X1b')) {
|
|
461
|
+
const { resultCode: textResultCode } = await postTextEnteredEvent({
|
|
462
|
+
sessionId,
|
|
463
|
+
text: pin !== null && pin !== void 0 ? pin : '',
|
|
464
|
+
});
|
|
465
|
+
textResult = textResultCode;
|
|
466
|
+
}
|
|
467
|
+
if (textResult === 0) {
|
|
468
|
+
const { currentState, ...response } = await getSession(sessionId);
|
|
469
|
+
if (response.resultCode === 0 && !!currentState) {
|
|
470
|
+
return {
|
|
471
|
+
currentState,
|
|
472
|
+
sessionId,
|
|
473
|
+
...response,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else if ([400, 401, 403, 404, 500].includes(resultCode)) {
|
|
478
|
+
console.warn('[APPCONTEXT/CHANGETAG]', resultCode);
|
|
479
|
+
fetchSession({
|
|
480
|
+
memoriID: (_a = memori.engineMemoriID) !== null && _a !== void 0 ? _a : '',
|
|
481
|
+
password: memori.secretToken,
|
|
482
|
+
tag: memori.giverTag,
|
|
483
|
+
pin: memori.giverPIN,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
else if (!!currentState) {
|
|
487
|
+
return {
|
|
488
|
+
currentState,
|
|
489
|
+
sessionId,
|
|
490
|
+
resultCode,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
catch (_e) {
|
|
496
|
+
let err = _e;
|
|
497
|
+
console.error('[APPCONTEXT/CHANGETAG]', err);
|
|
498
|
+
return Promise.reject(err);
|
|
499
|
+
}
|
|
500
|
+
return null;
|
|
501
|
+
};
|
|
502
|
+
const restoreGiverTag = async () => {
|
|
503
|
+
if (sessionId && memori.giverTag && memori.giverPIN) {
|
|
504
|
+
setHistory([]);
|
|
505
|
+
await changeTag(memori.engineMemoriID, sessionId, memori.giverTag, memori.giverPIN);
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
(0, react_1.useEffect)(() => {
|
|
509
|
+
return () => {
|
|
510
|
+
if (!currentDialogState ||
|
|
511
|
+
(currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.currentTag) !== memori.giverTag)
|
|
512
|
+
restoreGiverTag();
|
|
513
|
+
};
|
|
514
|
+
}, []);
|
|
515
|
+
const [userInteractionTimeout, setUserInteractionTimeout] = (0, react_1.useState)();
|
|
516
|
+
const timeoutRef = (0, react_1.useRef)();
|
|
517
|
+
const clearInteractionTimeout = () => {
|
|
518
|
+
if (userInteractionTimeout) {
|
|
519
|
+
clearTimeout(userInteractionTimeout);
|
|
520
|
+
setUserInteractionTimeout(undefined);
|
|
521
|
+
}
|
|
522
|
+
if (timeoutRef === null || timeoutRef === void 0 ? void 0 : timeoutRef.current) {
|
|
523
|
+
clearTimeout(timeoutRef.current);
|
|
524
|
+
timeoutRef.current = undefined;
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
const resetInteractionTimeout = () => {
|
|
528
|
+
clearInteractionTimeout();
|
|
529
|
+
if ((currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.acceptsTimeout) &&
|
|
530
|
+
!speechSynthesizer &&
|
|
531
|
+
!isPlayingAudio &&
|
|
532
|
+
!userMessage.length &&
|
|
533
|
+
!listening)
|
|
534
|
+
setInteractionTimeout();
|
|
535
|
+
};
|
|
536
|
+
const handleTimeout = async () => {
|
|
537
|
+
if (!!speechSynthesizer ||
|
|
538
|
+
isPlayingAudio ||
|
|
539
|
+
!!userMessage.length ||
|
|
540
|
+
listening) {
|
|
541
|
+
resetInteractionTimeout();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
else if (sessionId &&
|
|
545
|
+
hasUserActivatedSpeak &&
|
|
546
|
+
(currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.acceptsTimeout)) {
|
|
547
|
+
const { currentState, ...response } = await postTimeoutEvent(sessionId);
|
|
548
|
+
if (response.resultCode === 0 && currentState) {
|
|
549
|
+
const emission = currentState.emission;
|
|
550
|
+
if (!instruct &&
|
|
551
|
+
isMultilanguageEnabled &&
|
|
552
|
+
userLang !== (i18n === null || i18n === void 0 ? void 0 : i18n.language) &&
|
|
553
|
+
emission &&
|
|
554
|
+
emission.length > 0) {
|
|
555
|
+
translateDialogState({ ...currentState, emission: emission }, userLang);
|
|
556
|
+
}
|
|
557
|
+
else if (emission && emission.length > 0) {
|
|
558
|
+
pushMessage({
|
|
559
|
+
text: emission,
|
|
560
|
+
media: currentState.media,
|
|
561
|
+
fromUser: false,
|
|
562
|
+
});
|
|
563
|
+
setCurrentDialogState(currentState);
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
setCurrentDialogState({
|
|
567
|
+
...currentState,
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
const setInteractionTimeout = () => {
|
|
574
|
+
let timeoutLimit = 40000;
|
|
575
|
+
let timeoutMinLimit = 25000;
|
|
576
|
+
let timeout = Math.floor(Math.random() * (timeoutLimit - timeoutMinLimit)) +
|
|
577
|
+
timeoutMinLimit;
|
|
578
|
+
if (currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission) {
|
|
579
|
+
let readTime = currentDialogState.emission.length / 26.5;
|
|
580
|
+
timeout = timeout + readTime * 1000;
|
|
581
|
+
}
|
|
582
|
+
let uiTimeout = setTimeout(handleTimeout, timeout);
|
|
583
|
+
setUserInteractionTimeout(uiTimeout);
|
|
584
|
+
timeoutRef.current = uiTimeout;
|
|
585
|
+
};
|
|
586
|
+
(0, react_1.useEffect)(() => {
|
|
587
|
+
if (!!userMessage.length || isPlayingAudio)
|
|
588
|
+
clearInteractionTimeout();
|
|
589
|
+
if (sessionId && !!!userMessage.length)
|
|
590
|
+
resetInteractionTimeout();
|
|
591
|
+
}, [
|
|
592
|
+
currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.acceptsTimeout,
|
|
593
|
+
currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.state,
|
|
594
|
+
isPlayingAudio,
|
|
595
|
+
sessionId,
|
|
596
|
+
history,
|
|
597
|
+
userMessage,
|
|
598
|
+
]);
|
|
599
|
+
(0, react_1.useEffect)(() => {
|
|
600
|
+
return () => {
|
|
601
|
+
setHasUserActivatedSpeak(false);
|
|
602
|
+
setClickedStart(false);
|
|
603
|
+
clearInteractionTimeout();
|
|
604
|
+
timeoutRef.current = undefined;
|
|
605
|
+
};
|
|
606
|
+
}, []);
|
|
607
|
+
const initializeTTS = () => {
|
|
608
|
+
if (!AZURE_COGNITIVE_SERVICES_TTS_KEY)
|
|
609
|
+
return;
|
|
610
|
+
speechConfig = speechSdk.SpeechConfig.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY, 'eastus');
|
|
611
|
+
speechConfig.speechSynthesisLanguage = getCultureCodeByLanguage(userLang);
|
|
612
|
+
speechConfig.speechSynthesisVoiceName = getTTSVoice(userLang);
|
|
613
|
+
if ((0, utils_1.hasTouchscreen)())
|
|
614
|
+
speechConfig.speechSynthesisOutputFormat =
|
|
615
|
+
speechSdk.SpeechSynthesisOutputFormat.Audio16Khz32KBitRateMonoMp3;
|
|
616
|
+
let memoriAudioElement = document.getElementById('memori-audio');
|
|
617
|
+
if (memoriAudioElement && window.navigator.userAgent.includes('Safari')) {
|
|
618
|
+
memoriAudioElement.muted = false;
|
|
619
|
+
memoriAudioElement
|
|
620
|
+
.play()
|
|
621
|
+
.then(async () => {
|
|
622
|
+
try {
|
|
623
|
+
const context = new standardized_audio_context_1.AudioContext();
|
|
624
|
+
let buffer = context.createBuffer(1, 1, 22050);
|
|
625
|
+
let source = context.createBufferSource();
|
|
626
|
+
source.buffer = buffer;
|
|
627
|
+
source.connect(context.destination);
|
|
628
|
+
}
|
|
629
|
+
catch (e) {
|
|
630
|
+
console.error(e);
|
|
631
|
+
}
|
|
632
|
+
})
|
|
633
|
+
.catch((e) => {
|
|
634
|
+
console.error('error playing intro audio', e);
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
(0, react_1.useEffect)(() => {
|
|
639
|
+
return () => {
|
|
640
|
+
if (audioDestination)
|
|
641
|
+
audioDestination.pause();
|
|
642
|
+
if (speechSynthesizer) {
|
|
643
|
+
speechSynthesizer.close();
|
|
644
|
+
speechSynthesizer = null;
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
}, []);
|
|
648
|
+
const getTTSVoice = (0, react_1.useCallback)((lang) => {
|
|
649
|
+
var _a, _b, _c, _d;
|
|
650
|
+
let voice = '';
|
|
651
|
+
let voiceLang = ((_d = (_c = lang !== null && lang !== void 0 ? lang : (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language) !== null && _d !== void 0 ? _d : 'IT').toUpperCase();
|
|
652
|
+
switch (voiceLang) {
|
|
653
|
+
case 'IT':
|
|
654
|
+
voice = `${memori.voiceType === 'MALE'
|
|
655
|
+
? 'it-IT-DiegoNeural'
|
|
656
|
+
: 'it-IT-ElsaNeural'}`;
|
|
657
|
+
break;
|
|
658
|
+
case 'DE':
|
|
659
|
+
voice = `${memori.voiceType === 'MALE'
|
|
660
|
+
? 'de-DE-ConradNeural'
|
|
661
|
+
: 'de-DE-KatjaNeural'}`;
|
|
662
|
+
break;
|
|
663
|
+
case 'EN':
|
|
664
|
+
voice = `${memori.voiceType === 'MALE'
|
|
665
|
+
? 'en-GB-RyanNeural'
|
|
666
|
+
: 'en-GB-SoniaNeural'}`;
|
|
667
|
+
break;
|
|
668
|
+
case 'ES':
|
|
669
|
+
voice = `${memori.voiceType === 'MALE'
|
|
670
|
+
? 'es-ES-AlvaroNeural'
|
|
671
|
+
: 'es-ES-ElviraNeural'}`;
|
|
672
|
+
break;
|
|
673
|
+
case 'FR':
|
|
674
|
+
voice = `${memori.voiceType === 'MALE'
|
|
675
|
+
? 'fr-FR-HenriNeural'
|
|
676
|
+
: 'fr-FR-DeniseNeural'}`;
|
|
677
|
+
break;
|
|
678
|
+
case 'PT':
|
|
679
|
+
voice = `${memori.voiceType === 'MALE'
|
|
680
|
+
? 'pt-PT-DuarteNeural'
|
|
681
|
+
: 'pt-PT-RaquelNeural'}`;
|
|
682
|
+
break;
|
|
683
|
+
case 'UK':
|
|
684
|
+
voice = `${memori.voiceType === 'MALE'
|
|
685
|
+
? 'uk-UA-OstapNeural'
|
|
686
|
+
: 'uk-UA-PolinaNeural'}`;
|
|
687
|
+
break;
|
|
688
|
+
case 'RU':
|
|
689
|
+
voice = `${memori.voiceType === 'MALE'
|
|
690
|
+
? 'ru-RU-DmitryNeural'
|
|
691
|
+
: 'ru-RU-SvetlanaNeural'}`;
|
|
692
|
+
break;
|
|
693
|
+
default:
|
|
694
|
+
voice = `${memori.voiceType === 'MALE'
|
|
695
|
+
? 'it-IT-DiegoNeural'
|
|
696
|
+
: 'it-IT-IsabellaNeural'}`;
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
return voice;
|
|
700
|
+
}, [memori.voiceType, i18n.language, memori.culture]);
|
|
701
|
+
const getCultureCodeByLanguage = (lang) => {
|
|
702
|
+
var _a, _b, _c;
|
|
703
|
+
let voice = '';
|
|
704
|
+
let voiceLang = ((_c = lang !== null && lang !== void 0 ? lang : (_b = (_a = memori.culture) === null || _a === void 0 ? void 0 : _a.split('-')) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : i18n.language,
|
|
705
|
+
'IT').toUpperCase();
|
|
706
|
+
switch (voiceLang) {
|
|
707
|
+
case 'IT':
|
|
708
|
+
voice = 'it-IT';
|
|
709
|
+
break;
|
|
710
|
+
case 'DE':
|
|
711
|
+
voice = 'de-DE';
|
|
712
|
+
break;
|
|
713
|
+
case 'EN':
|
|
714
|
+
voice = 'en-GB';
|
|
715
|
+
break;
|
|
716
|
+
case 'ES':
|
|
717
|
+
voice = 'es-ES';
|
|
718
|
+
break;
|
|
719
|
+
case 'FR':
|
|
720
|
+
voice = 'fr-FR';
|
|
721
|
+
break;
|
|
722
|
+
case 'PT':
|
|
723
|
+
voice = 'pt-PT';
|
|
724
|
+
break;
|
|
725
|
+
case 'UK':
|
|
726
|
+
voice = 'uk-UK';
|
|
727
|
+
break;
|
|
728
|
+
case 'RU':
|
|
729
|
+
voice = 'ru-RU';
|
|
730
|
+
break;
|
|
731
|
+
default:
|
|
732
|
+
voice = 'it-IT';
|
|
733
|
+
break;
|
|
734
|
+
}
|
|
735
|
+
return voice;
|
|
736
|
+
};
|
|
737
|
+
const [phonemesMap, setPhonemesMap] = (0, react_1.useState)();
|
|
738
|
+
const fetchLexiconJSON = async () => {
|
|
739
|
+
try {
|
|
740
|
+
const lexiconReq = await fetch(`${baseUrl || 'https://app.twincreator.com'}/api/lexiconmap`);
|
|
741
|
+
const lexicon = await lexiconReq.json();
|
|
742
|
+
return lexicon;
|
|
743
|
+
}
|
|
744
|
+
catch (err) {
|
|
745
|
+
console.error(err);
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
(0, react_1.useEffect)(() => {
|
|
749
|
+
fetchLexiconJSON().then(lexicon => {
|
|
750
|
+
setPhonemesMap(lexicon);
|
|
751
|
+
});
|
|
752
|
+
}, []);
|
|
753
|
+
const replaceTextWithPhonemes = (text, lang) => {
|
|
754
|
+
var _a;
|
|
755
|
+
if (!phonemesMap)
|
|
756
|
+
return text;
|
|
757
|
+
const phonemes = {
|
|
758
|
+
...((_a = phonemesMap.common) !== null && _a !== void 0 ? _a : {}),
|
|
759
|
+
...((tenant === null || tenant === void 0 ? void 0 : tenant.id) && phonemesMap[tenant.id] ? phonemesMap[tenant.id] : {}),
|
|
760
|
+
};
|
|
761
|
+
const phonemesPairs = Object.keys(phonemes).map(word => {
|
|
762
|
+
var _a;
|
|
763
|
+
const phoneme = (_a = phonemes[word][lang]) !== null && _a !== void 0 ? _a : phonemes[word].default;
|
|
764
|
+
return { word, phoneme };
|
|
765
|
+
});
|
|
766
|
+
const ssmlText = phonemesPairs.reduce((acc, { word, phoneme }) => {
|
|
767
|
+
return acc.replace(new RegExp(word, 'gi'), `<phoneme alphabet="ipa" ph="${phoneme}">${word}</phoneme>`);
|
|
768
|
+
}, text);
|
|
769
|
+
return ssmlText;
|
|
770
|
+
};
|
|
771
|
+
const speak = (text, fireListeningEvent = true) => {
|
|
772
|
+
if (!AZURE_COGNITIVE_SERVICES_TTS_KEY)
|
|
773
|
+
return;
|
|
774
|
+
if (preview || !hasUserActivatedSpeak)
|
|
775
|
+
return;
|
|
776
|
+
if (audioDestination)
|
|
777
|
+
audioDestination.pause();
|
|
778
|
+
if (speechSynthesizer) {
|
|
779
|
+
speechSynthesizer.close();
|
|
780
|
+
speechSynthesizer = null;
|
|
781
|
+
}
|
|
782
|
+
if (muteSpeaker && fireListeningEvent) {
|
|
783
|
+
setTimeout(() => {
|
|
784
|
+
document.dispatchEvent(new Event('endSpeakStartListen'));
|
|
785
|
+
}, 3000);
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
else if (muteSpeaker) {
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
audioDestination = new speechSdk.SpeakerAudioDestination();
|
|
792
|
+
let audioConfig = speechSdk.AudioConfig.fromSpeakerOutput(audioDestination);
|
|
793
|
+
speechSynthesizer = new speechSdk.SpeechSynthesizer(speechConfig, audioConfig);
|
|
794
|
+
audioDestination.onAudioEnd = () => {
|
|
795
|
+
setIsPlayingAudio(false);
|
|
796
|
+
if (fireListeningEvent) {
|
|
797
|
+
document.dispatchEvent(new Event('endSpeakStartListen'));
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
setIsPlayingAudio(true);
|
|
801
|
+
speechSynthesizer.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${getCultureCodeByLanguage(userLang)}"><voice name="${getTTSVoice(userLang)}"><s>${replaceTextWithPhonemes(text, userLang.toLowerCase())}</s></voice></speak>`, result => {
|
|
802
|
+
if (result) {
|
|
803
|
+
try {
|
|
804
|
+
if (speechSynthesizer) {
|
|
805
|
+
speechSynthesizer.close();
|
|
806
|
+
speechSynthesizer = null;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
catch (e) {
|
|
810
|
+
console.error('speak error: ', e);
|
|
811
|
+
window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
|
|
812
|
+
setIsPlayingAudio(false);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
setIsPlayingAudio(false);
|
|
817
|
+
}
|
|
818
|
+
}, error => {
|
|
819
|
+
console.error('speak:', error);
|
|
820
|
+
window.speechSynthesis.speak(new SpeechSynthesisUtterance(text));
|
|
821
|
+
setIsPlayingAudio(false);
|
|
822
|
+
});
|
|
823
|
+
};
|
|
824
|
+
(0, react_1.useEffect)(() => {
|
|
825
|
+
let textarea = document.querySelector('#chat-fieldset textarea');
|
|
826
|
+
if (textarea)
|
|
827
|
+
textarea.focus();
|
|
828
|
+
}, [currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission]);
|
|
829
|
+
const [transcript, setTranscript] = (0, react_1.useState)('');
|
|
830
|
+
const resetTranscript = () => setTranscript('');
|
|
831
|
+
const [transcriptTimeout, setTranscriptTimeout,] = (0, react_1.useState)(null);
|
|
832
|
+
const setListeningTimeout = () => {
|
|
833
|
+
let timeout = setTimeout(async () => {
|
|
834
|
+
clearListening();
|
|
835
|
+
const message = (0, utils_1.stripDuplicates)(transcript);
|
|
836
|
+
if (message.length > 0) {
|
|
837
|
+
sendMessage(message);
|
|
838
|
+
resetTranscript();
|
|
839
|
+
setUserMessage('');
|
|
840
|
+
}
|
|
841
|
+
else if (listening) {
|
|
842
|
+
resetInteractionTimeout();
|
|
843
|
+
}
|
|
844
|
+
}, continuousSpeechTimeout * 1000);
|
|
845
|
+
setTranscriptTimeout(timeout);
|
|
846
|
+
};
|
|
847
|
+
const clearListeningTimeout = () => {
|
|
848
|
+
if (transcriptTimeout) {
|
|
849
|
+
clearTimeout(transcriptTimeout);
|
|
850
|
+
setTranscriptTimeout(null);
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
const resetListeningTimeout = () => {
|
|
854
|
+
clearListeningTimeout();
|
|
855
|
+
if (continuousSpeech)
|
|
856
|
+
setListeningTimeout();
|
|
857
|
+
};
|
|
858
|
+
(0, react_1.useEffect)(() => {
|
|
859
|
+
resetListeningTimeout();
|
|
860
|
+
resetInteractionTimeout();
|
|
861
|
+
if ((transcript === null || transcript === void 0 ? void 0 : transcript.length) > 0) {
|
|
862
|
+
const transcriptMessage = (0, utils_1.stripDuplicates)(transcript);
|
|
863
|
+
if (transcriptMessage.length > 0)
|
|
864
|
+
setUserMessage(transcriptMessage);
|
|
865
|
+
}
|
|
866
|
+
}, [transcript]);
|
|
867
|
+
const startListening = () => {
|
|
868
|
+
if (!AZURE_COGNITIVE_SERVICES_TTS_KEY)
|
|
869
|
+
return;
|
|
870
|
+
clearListening();
|
|
871
|
+
setTranscript('');
|
|
872
|
+
try {
|
|
873
|
+
navigator.mediaDevices
|
|
874
|
+
.getUserMedia({ audio: true })
|
|
875
|
+
.then(function (_stream) {
|
|
876
|
+
if (!speechConfig) {
|
|
877
|
+
speechConfig = speechSdk.SpeechConfig.fromSubscription(AZURE_COGNITIVE_SERVICES_TTS_KEY, 'eastus');
|
|
878
|
+
speechConfig.speechRecognitionLanguage = getCultureCodeByLanguage(userLang);
|
|
879
|
+
}
|
|
880
|
+
const audioConfig = speechSdk.AudioConfig.fromDefaultMicrophoneInput();
|
|
881
|
+
recognizer = new speechSdk.SpeechRecognizer(speechConfig, audioConfig);
|
|
882
|
+
setListening(true);
|
|
883
|
+
recognizer.recognized = (_s, e) => {
|
|
884
|
+
var _a;
|
|
885
|
+
if (e.result.reason === speechSdk.ResultReason.RecognizedSpeech) {
|
|
886
|
+
setTranscript((_a = e.result.text) !== null && _a !== void 0 ? _a : '');
|
|
887
|
+
}
|
|
888
|
+
else if (e.result.reason === speechSdk.ResultReason.NoMatch) {
|
|
889
|
+
console.debug('NOMATCH: Speech could not be recognized.');
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
recognizer.canceled = (_s, e) => {
|
|
893
|
+
if (e.reason === speechSdk.CancellationReason.Error) {
|
|
894
|
+
console.debug(`"CANCELED: ErrorCode=${e.errorCode}`);
|
|
895
|
+
console.debug(`"CANCELED: ErrorDetails=${e.errorDetails}`);
|
|
896
|
+
console.debug('CANCELED: Did you set the speech resource key and region values?');
|
|
897
|
+
}
|
|
898
|
+
stopListening();
|
|
899
|
+
};
|
|
900
|
+
recognizer.sessionStopped = (_s, _e) => {
|
|
901
|
+
if (recognizer)
|
|
902
|
+
recognizer.stopContinuousRecognitionAsync();
|
|
903
|
+
};
|
|
904
|
+
recognizer.startContinuousRecognitionAsync();
|
|
905
|
+
})
|
|
906
|
+
.catch(console.error);
|
|
907
|
+
}
|
|
908
|
+
catch (error) {
|
|
909
|
+
console.error(error);
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
const stopListening = () => {
|
|
913
|
+
if (recognizer) {
|
|
914
|
+
recognizer.stopContinuousRecognitionAsync();
|
|
915
|
+
recognizer.close();
|
|
916
|
+
recognizer = null;
|
|
917
|
+
setListening(false);
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
const clearListening = () => {
|
|
921
|
+
stopListening();
|
|
922
|
+
clearListeningTimeout();
|
|
923
|
+
};
|
|
924
|
+
const resetListening = () => {
|
|
925
|
+
if (listening) {
|
|
926
|
+
clearListening();
|
|
927
|
+
resetTranscript();
|
|
928
|
+
setUserMessage('');
|
|
929
|
+
startListening();
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
(0, react_1.useEffect)(() => {
|
|
933
|
+
return () => clearListening();
|
|
934
|
+
}, []);
|
|
935
|
+
(0, react_1.useEffect)(() => {
|
|
936
|
+
if ((currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.state) === 'Z0')
|
|
937
|
+
clearListening();
|
|
938
|
+
}, [currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.state]);
|
|
939
|
+
(0, react_1.useEffect)(() => {
|
|
940
|
+
if (hasUserActivatedSpeak &&
|
|
941
|
+
!preview &&
|
|
942
|
+
!muteSpeaker &&
|
|
943
|
+
history.length > 0 &&
|
|
944
|
+
(currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.emission)) {
|
|
945
|
+
speak(currentDialogState.emission, currentDialogState.state !== 'Z0');
|
|
946
|
+
}
|
|
947
|
+
}, [currentDialogState, hasUserActivatedSpeak]);
|
|
948
|
+
const [requestedListening, setRequestedListening] = (0, react_1.useState)(false);
|
|
949
|
+
const onEndSpeakStartListen = (0, react_1.useCallback)((_e) => {
|
|
950
|
+
if (isPlayingAudio && speechSynthesizer) {
|
|
951
|
+
speechSynthesizer.close();
|
|
952
|
+
speechSynthesizer = null;
|
|
953
|
+
}
|
|
954
|
+
if (continuousSpeech &&
|
|
955
|
+
(hasUserActivatedListening || !requestedListening)) {
|
|
956
|
+
setRequestedListening(true);
|
|
957
|
+
startListening();
|
|
958
|
+
}
|
|
959
|
+
}, [continuousSpeech, hasUserActivatedListening]);
|
|
960
|
+
(0, react_1.useEffect)(() => {
|
|
961
|
+
if (!isPlayingAudio && continuousSpeech && hasUserActivatedListening)
|
|
962
|
+
startListening();
|
|
963
|
+
else if (isPlayingAudio && listening) {
|
|
964
|
+
stopListening();
|
|
965
|
+
}
|
|
966
|
+
}, [isPlayingAudio]);
|
|
967
|
+
(0, react_1.useEffect)(() => {
|
|
968
|
+
document.addEventListener('endSpeakStartListen', onEndSpeakStartListen);
|
|
969
|
+
return () => {
|
|
970
|
+
document.removeEventListener('endSpeakStartListen', onEndSpeakStartListen);
|
|
971
|
+
};
|
|
972
|
+
}, [onEndSpeakStartListen]);
|
|
973
|
+
(0, react_1.useEffect)(() => {
|
|
974
|
+
resetListening();
|
|
975
|
+
}, [language]);
|
|
976
|
+
const [sendOnEnter, setSendOnEnter] = (0, react_1.useState)('keypress');
|
|
977
|
+
(0, react_1.useEffect)(() => {
|
|
978
|
+
const stored = (0, configuration_1.getLocalConfig)('sendOnEnter', 'keypress');
|
|
979
|
+
setSendOnEnter(stored);
|
|
980
|
+
}, []);
|
|
981
|
+
(0, react_1.useEffect)(() => {
|
|
982
|
+
(0, configuration_1.setLocalConfig)('sendOnEnter', sendOnEnter);
|
|
983
|
+
}, [sendOnEnter]);
|
|
984
|
+
const [attachmentsMenuOpen, setAttachmentsMenuOpen] = (0, react_1.useState)();
|
|
985
|
+
const globalBackground = integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.globalBackground;
|
|
986
|
+
const globalBackgroundUrl = globalBackground
|
|
987
|
+
? `url(${globalBackground})`
|
|
988
|
+
: null;
|
|
989
|
+
const integrationProperties = (integration
|
|
990
|
+
? {
|
|
991
|
+
'--memori-chat-bubble-bg': '#fff',
|
|
992
|
+
...(integrationConfig && !showInstruct
|
|
993
|
+
? { '--memori-text-color': (_l = integrationConfig.textColor) !== null && _l !== void 0 ? _l : '#000' }
|
|
994
|
+
: {}),
|
|
995
|
+
...((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.buttonBgColor)
|
|
996
|
+
? {
|
|
997
|
+
'--memori-button-bg': integrationConfig.buttonBgColor,
|
|
998
|
+
'--memori-button-hover-brightness': '1.2',
|
|
999
|
+
'--ant-primary-color': integrationConfig.buttonBgColor,
|
|
1000
|
+
'--ant-primary-color-hover': integrationConfig.buttonBgColor,
|
|
1001
|
+
'--ant-primary-4': integrationConfig.buttonBgColor,
|
|
1002
|
+
'--ant-primary-5': integrationConfig.buttonBgColor,
|
|
1003
|
+
'--ant-primary-7': integrationConfig.buttonBgColor,
|
|
1004
|
+
}
|
|
1005
|
+
: {
|
|
1006
|
+
'--memori-button-hover-brightness': '1',
|
|
1007
|
+
}),
|
|
1008
|
+
...((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.buttonTextColor)
|
|
1009
|
+
? {
|
|
1010
|
+
'--memori-button-text': integrationConfig.buttonTextColor,
|
|
1011
|
+
'--ant-primary-text': integrationConfig.buttonTextColor,
|
|
1012
|
+
}
|
|
1013
|
+
: {}),
|
|
1014
|
+
...((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.blurBackground)
|
|
1015
|
+
? {
|
|
1016
|
+
'--memori-blur-background': '5px',
|
|
1017
|
+
}
|
|
1018
|
+
: {
|
|
1019
|
+
'--memori-blur-background': '0px',
|
|
1020
|
+
}),
|
|
1021
|
+
...((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.innerBgColor)
|
|
1022
|
+
? {
|
|
1023
|
+
'--memori-inner-bg': `rgba(${integrationConfig.innerBgColor === 'dark'
|
|
1024
|
+
? '0, 0, 0'
|
|
1025
|
+
: '255, 255, 255'}, ${(_m = integrationConfig.innerBgAlpha) !== null && _m !== void 0 ? _m : 0.4})`,
|
|
1026
|
+
'--memori-inner-content-pad': '1.5rem',
|
|
1027
|
+
'--memori-nav-bg-image': 'none',
|
|
1028
|
+
'--memori-nav-bg': `rgba(${integrationConfig.innerBgColor === 'dark'
|
|
1029
|
+
? '0, 0, 0'
|
|
1030
|
+
: '255, 255, 255'}, ${(_o = integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.innerBgAlpha) !== null && _o !== void 0 ? _o : 0.4})`,
|
|
1031
|
+
}
|
|
1032
|
+
: {
|
|
1033
|
+
'--memori-inner-content-pad': '0px',
|
|
1034
|
+
}),
|
|
1035
|
+
}
|
|
1036
|
+
: {});
|
|
1037
|
+
const integrationStylesheet = `
|
|
1038
|
+
${preview ? '#preview' : ':root'} {
|
|
1039
|
+
${Object.entries(integrationProperties)
|
|
1040
|
+
.map(([key, value]) => `${key}: ${value};`)
|
|
1041
|
+
.join('\n')}
|
|
1042
|
+
}
|
|
1043
|
+
`;
|
|
1044
|
+
const [avatar3dVisible, setAvatar3dVisible] = (0, react_1.useState)(true);
|
|
1045
|
+
const [gamificationLevel, setGamificationLevel] = (0, react_1.useState)();
|
|
1046
|
+
const getGamificationPoints = async (memoriID) => {
|
|
1047
|
+
let gamificationPoints;
|
|
1048
|
+
let unansQuestions;
|
|
1049
|
+
try {
|
|
1050
|
+
const { contentQualityIndex, answerQualityIndex, unansweredQuestions, ...cqResp } = await getContentQualityIndexes(memoriID);
|
|
1051
|
+
if (cqResp.resultCode === 0) {
|
|
1052
|
+
gamificationPoints = contentQualityIndex;
|
|
1053
|
+
unansQuestions = unansweredQuestions;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
catch (_e) {
|
|
1057
|
+
let err = _e;
|
|
1058
|
+
console.error('[APPCONTEXT/QUERYGAMIFICATIONPOINTS]', err);
|
|
1059
|
+
}
|
|
1060
|
+
return {
|
|
1061
|
+
points: gamificationPoints !== null && gamificationPoints !== void 0 ? gamificationPoints : 0,
|
|
1062
|
+
unansweredQuestions: unansQuestions !== null && unansQuestions !== void 0 ? unansQuestions : 0,
|
|
1063
|
+
};
|
|
1064
|
+
};
|
|
1065
|
+
(0, react_1.useEffect)(() => {
|
|
1066
|
+
if (memori.engineMemoriID) {
|
|
1067
|
+
getGamificationPoints(memori.engineMemoriID)
|
|
1068
|
+
.then(value => {
|
|
1069
|
+
setGamificationLevel((0, statistics_1.getGamificationLevel)(value.points));
|
|
1070
|
+
})
|
|
1071
|
+
.catch(console.error);
|
|
1072
|
+
}
|
|
1073
|
+
}, [memori.engineMemoriID]);
|
|
1074
|
+
(0, react_1.useEffect)(() => {
|
|
1075
|
+
if (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.seoTitle) {
|
|
1076
|
+
let meta = document.createElement('meta');
|
|
1077
|
+
meta.setAttribute('property', 'og:title');
|
|
1078
|
+
meta.setAttribute('content', integrationConfig.seoTitle);
|
|
1079
|
+
document.head.append(meta);
|
|
1080
|
+
}
|
|
1081
|
+
if (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.seoDescription) {
|
|
1082
|
+
let meta = document.createElement('meta');
|
|
1083
|
+
meta.setAttribute('property', 'og:description');
|
|
1084
|
+
meta.setAttribute('content', integrationConfig.seoDescription);
|
|
1085
|
+
document.head.append(meta);
|
|
1086
|
+
}
|
|
1087
|
+
if (integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.seoUrl) {
|
|
1088
|
+
let meta = document.createElement('meta');
|
|
1089
|
+
meta.setAttribute('property', 'og:url');
|
|
1090
|
+
meta.setAttribute('content', integrationConfig.seoUrl);
|
|
1091
|
+
document.head.append(meta);
|
|
1092
|
+
}
|
|
1093
|
+
let image = ogImage || memori.avatarURL;
|
|
1094
|
+
if ((integrationConfig === null || integrationConfig === void 0 ? void 0 : integrationConfig.seoImageShowAvatar) && image) {
|
|
1095
|
+
let meta = document.createElement('meta');
|
|
1096
|
+
meta.setAttribute('property', 'og:image');
|
|
1097
|
+
meta.setAttribute('content', image);
|
|
1098
|
+
document.head.append(meta);
|
|
1099
|
+
}
|
|
1100
|
+
}, [integrationConfig, memori.avatarURL, ogImage]);
|
|
1101
|
+
const selectReceiverTag = async (tag) => {
|
|
1102
|
+
var _a;
|
|
1103
|
+
if (!sessionId)
|
|
1104
|
+
return;
|
|
1105
|
+
try {
|
|
1106
|
+
const { currentState, ...resp } = await postTagChangedEvent(sessionId, tag);
|
|
1107
|
+
if (resp.resultCode === 0) {
|
|
1108
|
+
pushMessage({
|
|
1109
|
+
text: tag,
|
|
1110
|
+
fromUser: true,
|
|
1111
|
+
});
|
|
1112
|
+
if (currentState.state === 'X4' && memori.giverTag) {
|
|
1113
|
+
const { currentState, ...resp } = await client.postTagChangedEvent(sessionId, memori.giverTag);
|
|
1114
|
+
if (resp.resultCode === 0) {
|
|
1115
|
+
setCurrentDialogState(currentState);
|
|
1116
|
+
if (currentState.emission) {
|
|
1117
|
+
pushMessage({
|
|
1118
|
+
text: currentState.emission,
|
|
1119
|
+
media: currentState.media,
|
|
1120
|
+
fromUser: false,
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
else {
|
|
1125
|
+
console.error(resp);
|
|
1126
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(resp.resultCode), {
|
|
1127
|
+
ns: 'common',
|
|
1128
|
+
}));
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
setCurrentDialogState(currentState);
|
|
1133
|
+
if (currentState.emission) {
|
|
1134
|
+
pushMessage({
|
|
1135
|
+
text: currentState.emission,
|
|
1136
|
+
media: currentState.media,
|
|
1137
|
+
fromUser: false,
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
else {
|
|
1143
|
+
console.error(resp, tag, (_a = currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.knownTags) === null || _a === void 0 ? void 0 : _a[tag]);
|
|
1144
|
+
Message_1.default.error(t((0, error_1.getErrori18nKey)(resp.resultCode), { ns: 'common' }));
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
catch (e) {
|
|
1148
|
+
let err = e;
|
|
1149
|
+
console.error(err);
|
|
1150
|
+
Message_1.default.error(err.message);
|
|
1151
|
+
}
|
|
1152
|
+
};
|
|
1153
|
+
const simulateUserPrompt = (text, translatedText) => {
|
|
1154
|
+
stopListening();
|
|
1155
|
+
sendMessage(text, undefined, undefined, false, translatedText);
|
|
1156
|
+
};
|
|
1157
|
+
const onClickStart = async () => {
|
|
1158
|
+
setClickedStart(true);
|
|
1159
|
+
initializeTTS();
|
|
1160
|
+
if ((!sessionId &&
|
|
1161
|
+
((memori.privacyType === 'SECRET' && !memori.secretToken) ||
|
|
1162
|
+
(memori.privacyType === 'PRIVATE' && !memori.secretToken))) ||
|
|
1163
|
+
(!sessionId && gotErrorInOpening)) {
|
|
1164
|
+
setAuthModalState('password');
|
|
1165
|
+
setClickedStart(false);
|
|
1166
|
+
}
|
|
1167
|
+
else if (!sessionId) {
|
|
1168
|
+
console.info('No session ID');
|
|
1169
|
+
setClickedStart(false);
|
|
1170
|
+
setGotErrorInOpening(true);
|
|
1171
|
+
return;
|
|
1172
|
+
}
|
|
1173
|
+
else {
|
|
1174
|
+
try {
|
|
1175
|
+
if (!instruct && personification) {
|
|
1176
|
+
try {
|
|
1177
|
+
if (!embed) {
|
|
1178
|
+
setHistory([]);
|
|
1179
|
+
console.debug('change tag #1');
|
|
1180
|
+
await changeTag(memori.engineMemoriID, sessionId, '-');
|
|
1181
|
+
const session = await changeTag(memori.engineMemoriID, sessionId, personification.tag, personification.pin);
|
|
1182
|
+
if (session && session.resultCode === 0) {
|
|
1183
|
+
translateDialogState(session.currentState, userLang).finally(() => {
|
|
1184
|
+
setHasUserActivatedSpeak(true);
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
else {
|
|
1188
|
+
console.error('session #1', session);
|
|
1189
|
+
throw new Error('No session');
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
else {
|
|
1193
|
+
if (currentDialogState) {
|
|
1194
|
+
setHistory([]);
|
|
1195
|
+
translateDialogState(currentDialogState, userLang).finally(() => {
|
|
1196
|
+
setHasUserActivatedSpeak(true);
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
else {
|
|
1200
|
+
setHasUserActivatedSpeak(true);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
catch (e) {
|
|
1205
|
+
console.error('session #2', e);
|
|
1206
|
+
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, personification.tag, personification.pin).then(() => {
|
|
1207
|
+
setHasUserActivatedSpeak(true);
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
else if (!instruct && (currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.currentTag) !== constants_1.anonTag) {
|
|
1212
|
+
try {
|
|
1213
|
+
if (!embed) {
|
|
1214
|
+
setHistory([]);
|
|
1215
|
+
console.debug('change tag #2');
|
|
1216
|
+
await changeTag(memori.engineMemoriID, sessionId, '-');
|
|
1217
|
+
const session = await changeTag(memori.engineMemoriID, sessionId, constants_1.anonTag);
|
|
1218
|
+
if (session && session.resultCode === 0) {
|
|
1219
|
+
translateDialogState(session.currentState, userLang).finally(() => {
|
|
1220
|
+
setHasUserActivatedSpeak(true);
|
|
1221
|
+
});
|
|
1222
|
+
}
|
|
1223
|
+
else {
|
|
1224
|
+
console.error('session #3', session);
|
|
1225
|
+
throw new Error('No session');
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
else {
|
|
1229
|
+
if (currentDialogState) {
|
|
1230
|
+
setHistory([]);
|
|
1231
|
+
translateDialogState(currentDialogState, userLang).finally(() => {
|
|
1232
|
+
setHasUserActivatedSpeak(true);
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
setHasUserActivatedSpeak(true);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
catch (e) {
|
|
1241
|
+
console.error('session #4', e);
|
|
1242
|
+
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, undefined, undefined, initialContextVars, initialQuestion).then(() => {
|
|
1243
|
+
setHasUserActivatedSpeak(true);
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
else if (instruct &&
|
|
1248
|
+
memori.giverTag &&
|
|
1249
|
+
(currentDialogState === null || currentDialogState === void 0 ? void 0 : currentDialogState.currentTag) !== memori.giverTag) {
|
|
1250
|
+
try {
|
|
1251
|
+
if (!embed) {
|
|
1252
|
+
setHistory([]);
|
|
1253
|
+
console.debug('change tag #3');
|
|
1254
|
+
await changeTag(memori.engineMemoriID, sessionId, '-');
|
|
1255
|
+
const session = await changeTag(memori.engineMemoriID, sessionId, memori.giverTag, memori.giverPIN);
|
|
1256
|
+
if (session && session.resultCode === 0) {
|
|
1257
|
+
translateDialogState(session.currentState, userLang).finally(() => {
|
|
1258
|
+
setHasUserActivatedSpeak(true);
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
else {
|
|
1262
|
+
console.error('session #5', session);
|
|
1263
|
+
throw new Error('No session');
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
if (currentDialogState) {
|
|
1268
|
+
setHistory([]);
|
|
1269
|
+
translateDialogState(currentDialogState, userLang).finally(() => {
|
|
1270
|
+
setHasUserActivatedSpeak(true);
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
else {
|
|
1274
|
+
setHasUserActivatedSpeak(true);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
catch (e) {
|
|
1279
|
+
console.error('session #6', e);
|
|
1280
|
+
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, memori === null || memori === void 0 ? void 0 : memori.giverTag, memori === null || memori === void 0 ? void 0 : memori.giverPIN, initialContextVars, initialQuestion).then(() => {
|
|
1281
|
+
setHasUserActivatedSpeak(true);
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
else {
|
|
1286
|
+
try {
|
|
1287
|
+
if (!embed) {
|
|
1288
|
+
setHistory([]);
|
|
1289
|
+
console.debug('change tag #4');
|
|
1290
|
+
await changeTag(memori.engineMemoriID, sessionId, '-');
|
|
1291
|
+
const session = await changeTag(memori.engineMemoriID, sessionId, instruct
|
|
1292
|
+
? memori.giverTag
|
|
1293
|
+
: personification
|
|
1294
|
+
? personification.tag
|
|
1295
|
+
: constants_1.anonTag, instruct
|
|
1296
|
+
? memori.giverPIN
|
|
1297
|
+
: personification
|
|
1298
|
+
? personification.pin
|
|
1299
|
+
: undefined);
|
|
1300
|
+
if (session && session.resultCode === 0) {
|
|
1301
|
+
translateDialogState(session.currentState, userLang).finally(() => {
|
|
1302
|
+
setHasUserActivatedSpeak(true);
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
else {
|
|
1306
|
+
console.error('session #7', session);
|
|
1307
|
+
throw new Error('No session');
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
else {
|
|
1311
|
+
if (currentDialogState) {
|
|
1312
|
+
setHistory([]);
|
|
1313
|
+
translateDialogState(currentDialogState, userLang).finally(() => {
|
|
1314
|
+
setHasUserActivatedSpeak(true);
|
|
1315
|
+
});
|
|
1316
|
+
}
|
|
1317
|
+
else {
|
|
1318
|
+
setHasUserActivatedSpeak(true);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
catch (e) {
|
|
1323
|
+
console.error('session #8', e);
|
|
1324
|
+
reopenSession(true, memori === null || memori === void 0 ? void 0 : memori.secretToken, undefined, memori === null || memori === void 0 ? void 0 : memori.giverTag, memori === null || memori === void 0 ? void 0 : memori.giverPIN, initialContextVars, initialQuestion).then(() => {
|
|
1325
|
+
setHasUserActivatedSpeak(true);
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
catch (e) {
|
|
1331
|
+
let err = e;
|
|
1332
|
+
console.error('session #0', err);
|
|
1333
|
+
reopenSession(true, memori.secretToken, undefined, memori.giverTag, memori.giverPIN, initialContextVars, initialQuestion);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
const header = (react_1.default.createElement(Header_1.default, { memori: memori, history: history, showShare: showShare, position: position, setShowPositionDrawer: setShowPositionDrawer, setShowSettingsDrawer: setShowSettingsDrawer, speakerMuted: muteSpeaker, setSpeakerMuted: setMuteSpeaker, showSettings: showSettings, hasUserActivatedSpeak: hasUserActivatedSpeak }));
|
|
1338
|
+
const avatar = (react_1.default.createElement(Avatar_1.default, { memori: memori, integration: integration, integrationConfig: integrationConfig, tenant: tenant, instruct: instruct, avatar3dVisible: avatar3dVisible, setAvatar3dVisible: setAvatar3dVisible, hasUserActivatedSpeak: hasUserActivatedSpeak, isPlayingAudio: isPlayingAudio, baseUrl: baseUrl }));
|
|
1339
|
+
const startPanel = (react_1.default.createElement(StartPanel_1.default, { memori: memori, tenant: tenant, gamificationLevel: gamificationLevel, language: language, userLang: userLang, setUserLang: setUserLang, baseUrl: baseUrl, position: position, openPositionDrawer: () => setShowPositionDrawer(true), integrationConfig: integrationConfig, instruct: instruct, sessionId: sessionId, clickedStart: clickedStart, onClickStart: onClickStart }));
|
|
1340
|
+
const chat = sessionId ? (react_1.default.createElement(Chat_1.default, { memori: memori, sessionID: sessionId, tenant: tenant, translateTo: isMultilanguageEnabled &&
|
|
1341
|
+
userLang.toUpperCase() !==
|
|
1342
|
+
((_u = ((_t = (_r = (_q = (_p = memori.culture) === null || _p === void 0 ? void 0 : _p.split('-')) === null || _q === void 0 ? void 0 : _q[0]) !== null && _r !== void 0 ? _r : i18n.language) !== null && _t !== void 0 ? _t : 'IT')) === null || _u === void 0 ? void 0 : _u.toUpperCase())
|
|
1343
|
+
? userLang
|
|
1344
|
+
: undefined, baseUrl: baseUrl, memoriTyping: memoriTyping, history: history, dialogState: currentDialogState, setDialogState: setCurrentDialogState, pushMessage: pushMessage, simulateUserPrompt: simulateUserPrompt, showDates: showDates, showContextPerLine: showContextPerLine, client: client, selectReceiverTag: selectReceiverTag, preview: preview, sendOnEnter: sendOnEnter, setSendOnEnter: setSendOnEnter, attachmentsMenuOpen: attachmentsMenuOpen, setAttachmentsMenuOpen: setAttachmentsMenuOpen, instruct: instruct, showInputs: showInputs, userMessage: userMessage, onChangeUserMessage: onChangeUserMessage, sendMessage: (msg) => {
|
|
1345
|
+
stopListening();
|
|
1346
|
+
sendMessage(msg);
|
|
1347
|
+
setUserMessage('');
|
|
1348
|
+
resetTranscript();
|
|
1349
|
+
}, stopListening: stopListening, resetTranscript: resetTranscript })) : null;
|
|
1350
|
+
const integrationBackground = integration && globalBackgroundUrl ? (react_1.default.createElement("div", { className: "memori--global-background" },
|
|
1351
|
+
react_1.default.createElement("div", { className: "memori--global-background-image", style: { backgroundImage: globalBackgroundUrl } }))) : null;
|
|
1352
|
+
const integrationStyle = integration ? (react_1.default.createElement("style", { dangerouslySetInnerHTML: { __html: integrationStylesheet } })) : null;
|
|
1353
|
+
const onChangeMode = (mode) => {
|
|
1354
|
+
setInstruct(mode === 'instruct');
|
|
1355
|
+
setHasUserActivatedSpeak(false);
|
|
1356
|
+
setClickedStart(false);
|
|
1357
|
+
};
|
|
1358
|
+
const changeMode = (react_1.default.createElement(ChangeMode_1.default, { instruct: instruct, onChangeMode: onChangeMode }));
|
|
1359
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)('memori', 'memori-widget', {
|
|
1360
|
+
'memori--preview': preview,
|
|
1361
|
+
'memori--embed': embed,
|
|
1362
|
+
'memori--with-integration': integration,
|
|
1363
|
+
'memori--active': hasUserActivatedSpeak,
|
|
1364
|
+
}), "data-memori-engine-state": JSON.stringify({
|
|
1365
|
+
...currentDialogState,
|
|
1366
|
+
sessionID: sessionId,
|
|
1367
|
+
}) },
|
|
1368
|
+
react_1.default.createElement(Default_1.default, { header: header, avatar: avatar, chat: chat, startPanel: startPanel, integrationStyle: integrationStyle, integrationBackground: integrationBackground, changeMode: changeMode, sessionId: sessionId, hasUserActivatedSpeak: hasUserActivatedSpeak, showInstruct: showInstruct, loading: loading })));
|
|
1369
|
+
};
|
|
1370
|
+
exports.default = MemoriWidget;
|
|
1371
|
+
//# sourceMappingURL=MemoriWidget.js.map
|