From 6f3fa7b975098e67889c767fca56689d39b92bf3 Mon Sep 17 00:00:00 2001 From: nzambello Date: Mon, 5 Feb 2024 12:59:22 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=207b94b?= =?UTF-8?q?cf8d0e34c034ee386386ed51fc74f68ba0f=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...adbdb5a.iframe.bundle.js => 2224.a6a75f6e.iframe.bundle.js | 2 +- ...f1d511a.iframe.bundle.js => 2922.9354f8d0.iframe.bundle.js | 2 +- ...mponents-Snippet-Snippet-stories.545b6adf.iframe.bundle.js | 4 ++-- ...ppet-Snippet-stories.545b6adf.iframe.bundle.js.LICENSE.txt | 0 ...ts-StartPanel-StartPanel-stories.1f96ae9a.iframe.bundle.js | 4 ++-- ...l-StartPanel-stories.1f96ae9a.iframe.bundle.js.LICENSE.txt | 0 components-Typing-Typing-stories.3b30fc94.iframe.bundle.js | 1 - components-Typing-Typing-stories.53bc301f.iframe.bundle.js | 1 + iframe.html | 4 ++-- index-stories.3db426db.iframe.bundle.js | 1 - index-stories.81559141.iframe.bundle.js | 1 + index.json | 2 +- main.18a48be8.iframe.bundle.js | 1 + main.caabcea8.iframe.bundle.js | 1 - project.json | 2 +- ...iframe.bundle.js => runtime~main.7a3bbcc7.iframe.bundle.js | 2 +- stories.json | 2 +- 17 files changed, 15 insertions(+), 15 deletions(-) rename 2224.0adbdb5a.iframe.bundle.js => 2224.a6a75f6e.iframe.bundle.js (78%) rename 2922.7f1d511a.iframe.bundle.js => 2922.9354f8d0.iframe.bundle.js (95%) rename components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js => components-Snippet-Snippet-stories.545b6adf.iframe.bundle.js (95%) rename components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js.LICENSE.txt => components-Snippet-Snippet-stories.545b6adf.iframe.bundle.js.LICENSE.txt (100%) rename components-StartPanel-StartPanel-stories.18b8b877.iframe.bundle.js => components-StartPanel-StartPanel-stories.1f96ae9a.iframe.bundle.js (75%) rename components-StartPanel-StartPanel-stories.18b8b877.iframe.bundle.js.LICENSE.txt => components-StartPanel-StartPanel-stories.1f96ae9a.iframe.bundle.js.LICENSE.txt (100%) delete mode 100644 components-Typing-Typing-stories.3b30fc94.iframe.bundle.js create mode 100644 components-Typing-Typing-stories.53bc301f.iframe.bundle.js delete mode 100644 index-stories.3db426db.iframe.bundle.js create mode 100644 index-stories.81559141.iframe.bundle.js create mode 100644 main.18a48be8.iframe.bundle.js delete mode 100644 main.caabcea8.iframe.bundle.js rename runtime~main.df7b5c74.iframe.bundle.js => runtime~main.7a3bbcc7.iframe.bundle.js (98%) diff --git a/2224.0adbdb5a.iframe.bundle.js b/2224.a6a75f6e.iframe.bundle.js similarity index 78% rename from 2224.0adbdb5a.iframe.bundle.js rename to 2224.a6a75f6e.iframe.bundle.js index c4eee462..3c785daf 100644 --- a/2224.0adbdb5a.iframe.bundle.js +++ b/2224.a6a75f6e.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2224],{"./src/components/Chat/Chat.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_helpers_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/helpers/utils.ts"),_helpers_media__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/helpers/media.ts"),_ChatBubble_ChatBubble__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ChatBubble/ChatBubble.tsx"),_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/MediaWidget/MediaWidget.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Button.tsx"),_ChatInputs_ChatInputs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ChatInputs/ChatInputs.tsx"),_Typing_Typing__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/Typing/Typing.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/helpers/constants.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Chat=({memori,tenant,sessionID,baseUrl,apiUrl,translateTo,memoriTyping,typingText,showTypingText=!1,history=[],authToken,dialogState,simulateUserPrompt,showDates=!1,showContextPerLine=!1,showAIicon=!0,selectReceiverTag,preview=!1,instruct=!1,showInputs=!0,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",sendOnEnter,setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,userMessage="",onChangeUserMessage,sendMessage,listening,isPlayingAudio,stopAudio,startListening,stopListening,resetTranscript,customMediaRenderer,user,userAvatar,experts})=>{const scrollToBottom=()=>{setTimeout((()=>{document.querySelector(".memori-chat--content")?.scrollTo(0,document.querySelector(".memori-chat--content")?.scrollHeight??0)}),200)};(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!preview&&scrollToBottom()}),[history,preview]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--wrapper",{"memori-chat-wrapper--translate":translateTo}),id:"chat-wrapper",lang:translateTo?.toUpperCase(),"data-memori-lang":memori.culture?.split("-")?.[0]?.toUpperCase()??"EN",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--history",{"memori-chat--history-touch":(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--content",{"memori-chat--content-touch":(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--cover"),style:{backgroundImage:`url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_10__.v)({type:"cover",tenantID:tenant?.id,resourceURI:memori.coverURL,baseURL:baseUrl,apiURL:apiUrl})}"), url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_10__.v)({type:"cover",tenantID:tenant?.id,baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl})}")`}}),history.map(((message,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatBubble_ChatBubble__WEBPACK_IMPORTED_MODULE_3__.Z,{isFirst:0===index,message,memori,tenant,baseUrl,apiUrl,simulateUserPrompt,showAIicon,showFeedback:index===history.length-1&&!message.fromUser&&dialogState?.acceptsFeedback,user,userAvatar,experts}),showDates&&!!message.timestamp&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("small",{className:"memori-chat--timestamp "+(message.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(message.timestamp.endsWith("Z")?message.timestamp:`${message.timestamp}Z`))}),showContextPerLine&&!!Object.keys(message.contextVars??{}).length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(message.contextVars??{}).map((key=>"-"===message.contextVars?.[key]?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--context-tag-text",children:key})},key):"✔️"===message.contextVars?.[key]?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--context-tag-text",children:key})},key):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("span",{className:"memori-chat--context-tag-text",children:[key,": ",message.contextVars?.[key]]})},key)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__.Z,{simulateUserPrompt,media:message?.media?.filter((m=>"text/html"!==m.mimeType&&"text/plain"!==m.mimeType)),links:message?.media?.filter((m=>"text/html"===m.mimeType)),sessionID,baseUrl,apiUrl,translateTo,customMediaRenderer})]},index))),dialogState?.hints&&dialogState.hints.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__.Z,{simulateUserPrompt,hints:dialogState.translatedHints?dialogState.translatedHints:dialogState.hints.map((h=>({text:h,originalText:h})))}),!!memoriTyping&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Typing_Typing__WEBPACK_IMPORTED_MODULE_7__.Z,{useDefaultSentences:showTypingText,lang:translateTo?"it"===translateTo.toLowerCase()?"it":"en":"it"===memori.culture?.split("-")?.[0]?.toLowerCase()?"it":"en",sentence:typingText,sentences:memori.enableBoardOfExperts?_helpers_constants__WEBPACK_IMPORTED_MODULE_8__.DZ:void 0},typingText),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===dialogState?.state&&sessionID&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(dialogState.knownTags??{}).filter((t=>t!==memori.giverTag)).map((tag=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--known-tag-icon",children:tag}),className:"memori-chat--known-tag",onClick:()=>selectReceiverTag(tag),children:dialogState.knownTags?.[tag]},tag)))}),showInputs&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatInputs_ChatInputs__WEBPACK_IMPORTED_MODULE_6__.Z,{userMessage,onChangeUserMessage,dialogState,instruct,authToken,sendMessage,microphoneMode,sendOnEnter,setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,onTextareaPressEnter:()=>{"keypress"===sendOnEnter&&userMessage?.length>0&&(stopListening(),sendMessage(userMessage),onChangeUserMessage(""),resetTranscript())},onTextareaFocus:()=>{stopListening(),(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()&&window.innerWidth<=768&&(document.getElementById("chat-wrapper")?.classList?.add("chat-focused"),document.querySelector(".memori.memori-widget")?.classList?.add("chat-focused"),setTimeout((()=>{scrollToBottom()}),300))},onTextareaBlur:()=>{document.getElementById("chat-wrapper")?.classList?.contains("chat-focused")&&(document.getElementById("chat-wrapper")?.classList.remove("chat-focused"),document.querySelector(".memori.memori-widget")?.classList?.remove("chat-focused"),scrollToBottom())},startListening,stopListening,stopAudio,listening,isPlayingAudio,showMicrophone})]})};Chat.displayName="Chat";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(Chat);try{Chat.displayName="Chat",Chat.__docgenInfo={description:"",displayName:"Chat",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!0,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},memoriTyping:{defaultValue:null,description:"",name:"memoriTyping",required:!1,type:{name:"boolean"}},typingText:{defaultValue:null,description:"",name:"typingText",required:!1,type:{name:"string"}},showTypingText:{defaultValue:{value:"false"},description:"",name:"showTypingText",required:!1,type:{name:"boolean"}},history:{defaultValue:{value:"[]"},description:"",name:"history",required:!1,type:{name:"Message[]"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}},dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},setDialogState:{defaultValue:null,description:"",name:"setDialogState",required:!0,type:{name:"(dialogState: DialogState) => void"}},pushMessage:{defaultValue:null,description:"",name:"pushMessage",required:!0,type:{name:"(message: Message) => void"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!0,type:{name:"(text: string, translatedText?: string | undefined) => void"}},showDates:{defaultValue:{value:"false"},description:"",name:"showDates",required:!1,type:{name:"boolean"}},showContextPerLine:{defaultValue:{value:"false"},description:"",name:"showContextPerLine",required:!1,type:{name:"boolean"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},client:{defaultValue:null,description:"",name:"client",required:!0,type:{name:'{ constants: { HOSTNAME: string; BACKEND_URL: string; ENGINE_URL: string; allowedMediaTypes: string[]; anonTag: "👤"; }; asset: { getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: ResourceURLParams) => string; }; ... 111 more ...; backend: { ...; }; }'}},selectReceiverTag:{defaultValue:null,description:"",name:"selectReceiverTag",required:!0,type:{name:"(tag: string) => Promise"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},showInputs:{defaultValue:{value:"true"},description:"",name:"showInputs",required:!1,type:{name:"boolean"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},resetTranscript:{defaultValue:null,description:"",name:"resetTranscript",required:!0,type:{name:"() => void"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}},layout:{defaultValue:null,description:"",name:"layout",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}},experts:{defaultValue:null,description:"",name:"experts",required:!1,type:{name:"ExpertReference[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Chat/Chat.tsx#Chat"]={docgenInfo:Chat.__docgenInfo,name:"Chat",path:"src/components/Chat/Chat.tsx#Chat"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatBubble/ChatBubble.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/media.ts"),_icons_User__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/User.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/AI.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),marked__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/marked/lib/marked.esm.js"),dompurify__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/dompurify/dist/purify.js"),_helpers_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/helpers/utils.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");marked__WEBPACK_IMPORTED_MODULE_6__.TU.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(href,title,text){const cleanHref=(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_8__.bw)(href);if(null===cleanHref)return text;let out='",out}}});const ChatBubble=({message,memori,tenant,baseUrl,apiUrl,showFeedback,simulateUserPrompt,showAIicon=!0,isFirst=!1,user,userAvatar,experts})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_10__.$)(),renderedText=(0,dompurify__WEBPACK_IMPORTED_MODULE_7__.sanitize)(marked__WEBPACK_IMPORTED_MODULE_6__.TU.parse(message.translatedText??message.text),{ADD_ATTR:["target"]});return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:[(message.initial||isFirst)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u,{show:!0,appear:!0,as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt}),children:[!message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),title:message.emitter?.length&&memori.enableBoardOfExperts?message.emitter:memori.name,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:message.emitter?.length&&memori.enableBoardOfExperts?message.emitter:memori.name,src:message.emitter?.length&&memori.enableBoardOfExperts&&experts?.find((e=>e.name===message.emitter))?`${apiUrl}/api/v1/memoriai/memori/avatar/${experts.find((e=>e.name===message.emitter))?.expertMemoriID}`:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl}),onError:e=>{e.currentTarget.src=memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl}),e.currentTarget.onerror=null}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble",{"memori-chat--user-bubble":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt,"memori-chat--ai-generated":message.generatedByAI&&showAIicon,"memori-chat--with-feedback":showFeedback}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{dangerouslySetInnerHTML:{__html:renderedText}}),(message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:"memori-chat--bubble-addon",children:[showFeedback&&!!simulateUserPrompt&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__.Z,{memori,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:msg=>{msg&&simulateUserPrompt(msg)}}),message.generatedByAI&&showAIicon&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__.Z,{align:"left",content:t("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_3__.default,{title:t("generatedByAI")||void 0})})})]})]}),message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:userAvatar&&"string"==typeof userAvatar||!userAvatar&&user?.avatarURL?.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:user?.userName??"User",src:userAvatar??user?.avatarURL})}):userAvatar?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:userAvatar}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_User__WEBPACK_IMPORTED_MODULE_2__.default,{})})})]})]})},__WEBPACK_DEFAULT_EXPORT__=ChatBubble;try{ChatBubble.displayName="ChatBubble",ChatBubble.__docgenInfo={description:"",displayName:"ChatBubble",props:{message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"Message"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},showFeedback:{defaultValue:null,description:"",name:"showFeedback",required:!1,type:{name:"boolean"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!1,type:{name:"((msg: string) => void)"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},isFirst:{defaultValue:{value:"false"},description:"",name:"isFirst",required:!1,type:{name:"boolean"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}},experts:{defaultValue:null,description:"",name:"experts",required:!1,type:{name:"ExpertReference[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatBubble/ChatBubble.tsx#ChatBubble"]={docgenInfo:ChatBubble.__docgenInfo,name:"ChatBubble",path:"src/components/ChatBubble/ChatBubble.tsx#ChatBubble"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatInputs/ChatInputs.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx"),_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ChatTextArea/ChatTextArea.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Button.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Send__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/Send.tsx"),_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/MicrophoneButton/MicrophoneButton.tsx"),classnames__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__),_icons_Microphone__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Microphone.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs=({dialogState,sendOnEnter="click",setSendOnEnter,userMessage="",onChangeUserMessage,sendMessage,onTextareaFocus,onTextareaBlur,onTextareaPressEnter,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",listening=!1,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_9__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===dialogState?.state||"X3"===dialogState?.state,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_1__.Z,{sendOnEnter,setSendOnEnter}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_2__.Z,{value:userMessage,onChange:onChangeUserMessage,onPressEnter:onTextareaPressEnter,onFocus:onTextareaFocus,onBlur:onTextareaBlur,disabled:["R2","R3","R4","R5","G3","X3"].includes(dialogState?.state||"")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_3__.Z,{shape:"circle",primary:!!userMessage?.length,disabled:!userMessage||0===userMessage.length,className:"memori-chat-inputs--send",onClick:()=>{sendMessage(userMessage),stopAudio(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:t("send")||"Send",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Send__WEBPACK_IMPORTED_MODULE_4__.default,{})}),showMicrophone&&"HOLD_TO_TALK"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_5__.Z,{listening,startListening,stopListening:()=>{stopListening(),userMessage?.length&&sendMessage(userMessage)},stopAudio}),showMicrophone&&"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_3__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_6___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{listening?stopListening():(stopAudio(),startListening())},shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_7__.default,{})})]})};ChatInputs.displayName="ChatInputs";const __WEBPACK_DEFAULT_EXPORT__=ChatInputs;try{ChatInputs.displayName="ChatInputs",ChatInputs.__docgenInfo={description:"",displayName:"ChatInputs",props:{dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},instruct:{defaultValue:null,description:"",name:"instruct",required:!1,type:{name:"boolean"}},sendOnEnter:{defaultValue:{value:"click"},description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},onTextareaFocus:{defaultValue:null,description:"",name:"onTextareaFocus",required:!0,type:{name:"() => void"}},onTextareaBlur:{defaultValue:null,description:"",name:"onTextareaBlur",required:!0,type:{name:"() => void"}},onTextareaPressEnter:{defaultValue:null,description:"",name:"onTextareaPressEnter",required:!0,type:{name:"(e: KeyboardEvent) => void"}},listening:{defaultValue:{value:"false"},description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatInputs/ChatInputs.tsx#ChatInputs"]={docgenInfo:ChatInputs.__docgenInfo,name:"ChatInputs",path:"src/components/ChatInputs/ChatInputs.tsx#ChatInputs"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatTextArea/ChatTextArea.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Expand__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Expand.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatTextArea=({disabled=!1,value,onChange,onPressEnter,onFocus,onBlur})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[expanded,setExpanded]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{"data-testid":"chat-textarea",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea",{"memori-chat-textarea--expanded":expanded,"memori-chat-textarea--disabled":disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("textarea",{className:"memori-chat-textarea--input",disabled,value,onChange:e=>{onChange(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&onPressEnter&&onPressEnter(e)},onFocus,onBlur}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea--expand-button"),onClick:()=>setExpanded(!expanded),padded:!1,ghost:!0,title:expanded?t("collapse")||"Collapse":t("expand")||"Expand",icon:expanded?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Expand__WEBPACK_IMPORTED_MODULE_3__.default,{})})})]})})};ChatTextArea.displayName="ChatTextArea";const __WEBPACK_DEFAULT_EXPORT__=ChatTextArea;try{ChatTextArea.displayName="ChatTextArea",ChatTextArea.__docgenInfo={description:"",displayName:"ChatTextArea",props:{disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: string) => void"}},onPressEnter:{defaultValue:null,description:"",name:"onPressEnter",required:!1,type:{name:"((e: KeyboardEvent) => void)"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"((e: FocusEvent) => void)"}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"((e: FocusEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"]={docgenInfo:ChatTextArea.__docgenInfo,name:"ChatTextArea",path:"src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/LinkItemWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>RenderLinkItem,Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Link__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Link.tsx"),classnames__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__),ellipsed__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/ellipsed/lib/ellipsed.js"),_ui_Card__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Card.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const RenderLinkItem=({isChild=!1,item,baseUrl,onLinkPreviewInfo,descriptionOneLine=!1})=>{const[link,setLink]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),normURL=item.url?.startsWith("http")||!item.url||0===item.url?.length?item.url:`https://${item.url}`;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{let normURL=item.url?.startsWith("http")||!item.url||0===item.url?.length?item.url:`https://${item.url}`;normURL&&normURL!==link?.urlKey&&(async(url,baseUrl)=>{try{const data=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(url)}`);return await data.json()}catch(err){return console.error("getSiteInfo",err),null}})(normURL,baseUrl).then((siteInfo=>{setLink(siteInfo?{...siteInfo,urlKey:normURL}:null),onLinkPreviewInfo&&siteInfo&&onLinkPreviewInfo(siteInfo)}))}),[item?.url,baseUrl,onLinkPreviewInfo]);const title=item.title&&item.title.length>0?item.title:link?.title,description=link?.description,video=link?.video,image=link?.image??link?.images?.[0];return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{setTimeout((()=>{(0,ellipsed__WEBPACK_IMPORTED_MODULE_3__.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[description,item.mediumID]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("a",{href:normURL,target:"_blank",rel:"noopener noreferrer",className:classnames__WEBPACK_IMPORTED_MODULE_2___default()("memori-link-item--link",{"memori-link-item--link--child":isChild}),onClick:e=>{isChild||(e.preventDefault(),e.stopPropagation(),window.open(normURL,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,className:classnames__WEBPACK_IMPORTED_MODULE_2___default()("memori-link-item--card",{"memori-link-item--card-description-oneline":descriptionOneLine,"memori-link-item--card-has-image":image,"memori-link-item--card-has-video":video}),cover:video?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("iframe",{width:"100%",height:"100%",src:video,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):image?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,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",srcSet:image.includes("data:image")?void 0:image,alt:item.title}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_1__.default,{className:"memori-link-item--icon"})}),title,description})})};RenderLinkItem.displayName="RenderLinkItem";const LinkItemWidget=({items,baseUrl,descriptionOneLine=!1,onLinkPreviewInfo})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-link-items--grid",children:items.map(((item,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*index,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(RenderLinkItem,{item,baseUrl,descriptionOneLine,onLinkPreviewInfo})},item.mediumID)))})});LinkItemWidget.displayName="LinkItemWidget";const __WEBPACK_DEFAULT_EXPORT__=LinkItemWidget;try{RenderLinkItem.displayName="RenderLinkItem",RenderLinkItem.__docgenInfo={description:"",displayName:"RenderLinkItem",props:{baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},descriptionOneLine:{defaultValue:{value:"false"},description:"",name:"descriptionOneLine",required:!1,type:{name:"boolean"}},onLinkPreviewInfo:{defaultValue:null,description:"",name:"onLinkPreviewInfo",required:!1,type:{name:"((linkPreviewInfo: ILinkPreviewInfo) => void)"}},item:{defaultValue:null,description:"",name:"item",required:!0,type:{name:"Medium"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/LinkItemWidget.tsx#RenderLinkItem"]={docgenInfo:RenderLinkItem.__docgenInfo,name:"RenderLinkItem",path:"src/components/MediaWidget/LinkItemWidget.tsx#RenderLinkItem"})}catch(__react_docgen_typescript_loader_error){}try{LinkItemWidget.displayName="LinkItemWidget",LinkItemWidget.__docgenInfo={description:"",displayName:"LinkItemWidget",props:{isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},items:{defaultValue:null,description:"",name:"items",required:!0,type:{name:"Medium[]"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},descriptionOneLine:{defaultValue:{value:"false"},description:"",name:"descriptionOneLine",required:!1,type:{name:"boolean"}},onLinkPreviewInfo:{defaultValue:null,description:"",name:"onLinkPreviewInfo",required:!1,type:{name:"((linkPreviewInfo: ILinkPreviewInfo) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/LinkItemWidget.tsx#LinkItemWidget"]={docgenInfo:LinkItemWidget.__docgenInfo,name:"LinkItemWidget",path:"src/components/MediaWidget/LinkItemWidget.tsx#LinkItemWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/MediaWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_LinkItemWidget__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/MediaWidget/LinkItemWidget.tsx"),_MediaItemWidget__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/MediaWidget/MediaItemWidget.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MediaWidget=({hints=[],links=[],media=[],simulateUserPrompt=()=>{},sessionID,baseUrl,apiUrl,translateTo,customMediaRenderer})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[showHints,setShowHints]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0),[hintsPagination,setHintsPagination]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(6);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{setShowHints(!0)}),[hints]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-media-widget",children:[media?.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_MediaItemWidget__WEBPACK_IMPORTED_MODULE_3__.Z,{items:media,sessionID,translateTo,baseURL:baseUrl,apiURL:apiUrl,customMediaRenderer}),links?.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_LinkItemWidget__WEBPACK_IMPORTED_MODULE_2__.Z,{items:links,baseUrl}),hints?.length>0&&showHints&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:hints.slice(0,hintsPagination).map(((item,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-media--hint"),primary:!0,onClick:()=>{simulateUserPrompt(item.originalText,item.text),setShowHints(!1)},onTouchEnd:()=>{simulateUserPrompt(item.originalText,item.text),setShowHints(!1)},children:item.text},item.text+index)},item.text+index)))}),hints.length>hintsPagination&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-hints--show-more",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>setHintsPagination(hintsPagination+6),children:t("expand")||"Expand"})})]})]})};MediaWidget.displayName="MediaWidget";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(MediaWidget);try{MediaWidget.displayName="MediaWidget",MediaWidget.__docgenInfo={description:"",displayName:"MediaWidget",props:{hints:{defaultValue:{value:"[]"},description:"",name:"hints",required:!1,type:{name:"TranslatedHint[]"}},links:{defaultValue:{value:"[]"},description:"",name:"links",required:!1,type:{name:"Medium[]"}},media:{defaultValue:{value:"[]"},description:"",name:"media",required:!1,type:{name:"Medium[]"}},simulateUserPrompt:{defaultValue:{value:"() => {}"},description:"",name:"simulateUserPrompt",required:!1,type:{name:"((item: string, translatedItem?: string) => void)"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaWidget.tsx#MediaWidget"]={docgenInfo:MediaWidget.__docgenInfo,name:"MediaWidget",path:"src/components/MediaWidget/MediaWidget.tsx#MediaWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MicrophoneButton/MicrophoneButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Microphone.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MicrophoneButton=({listening,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[micBtnTooltip,setMicBtnTooltip]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),intervalRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),startHold=e=>{e.preventDefault(),setMicBtnTooltip(t("write_and_speak.holdToSpeak")||"Hold to record"),intervalRef.current||(intervalRef.current=setTimeout((()=>{stopAudio(),setMicBtnTooltip(t("write_and_speak.releaseToEndListening")||"Release to end listening"),startListening()}),300))},stopHold=()=>{intervalRef.current&&(clearTimeout(intervalRef.current),intervalRef.current=null),stopListening(),setMicBtnTooltip(void 0)};return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>stopHold()),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{visible:!!micBtnTooltip,content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span",{children:micBtnTooltip||t("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:startHold,onTouchStart:startHold,onMouseUp:stopHold,onMouseLeave:stopHold,onTouchEnd:stopHold,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__.default,{})})})};MicrophoneButton.displayName="MicrophoneButton";const __WEBPACK_DEFAULT_EXPORT__=MicrophoneButton;try{MicrophoneButton.displayName="MicrophoneButton",MicrophoneButton.__docgenInfo={description:"",displayName:"MicrophoneButton",props:{listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"]={docgenInfo:MicrophoneButton.__docgenInfo,name:"MicrophoneButton",path:"src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const SendOnEnterMenu=({sendOnEnter,setSendOnEnter})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-send-on-enter-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-menu--overlay",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E,{value:sendOnEnter,onChange:setSendOnEnter,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"keypress",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnKeypress")})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"click",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnClick")})})})]})})]})};SendOnEnterMenu.displayName="SendOnEnterMenu";const __WEBPACK_DEFAULT_EXPORT__=SendOnEnterMenu;try{SendOnEnterMenu.displayName="SendOnEnterMenu",SendOnEnterMenu.__docgenInfo={description:"",displayName:"SendOnEnterMenu",props:{sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!0,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(value: "keypress" | "click") => void'}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"]={docgenInfo:SendOnEnterMenu.__docgenInfo,name:"SendOnEnterMenu",path:"src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Typing/Typing.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const defaultSentences={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},getSeparatorString=(seconds=3)=>new Array(20*seconds).fill(" ").join(""),Typing=({useDefaultSentences=!1,lang="en",sentence,sentences})=>{const[index,setIndex]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),[text,setText]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(sentences?.[lang]?.length?`${sentences[lang][0].text.endsWith("...")?sentences[lang][0].text:`${sentences[lang][0].text}...`}${getSeparatorString(sentences[lang][0].delayAfter)}`:sentence?`${sentence.endsWith("...")?sentence:`${sentence}...`}${getSeparatorString()}`:""),[shownText,setShownText]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const interval=setInterval((()=>{const letter=text[shownText.length];if(void 0!==letter&&text.length>0)setShownText((prev=>prev+letter));else if(sentences?.[lang]?.length&&indexclearInterval(interval)})),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"memori-chat--bubble",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div",{id:"wave",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"})]}),text.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:shownText})]})})};Typing.displayName="Typing";const __WEBPACK_DEFAULT_EXPORT__=Typing;try{Typing.displayName="Typing",Typing.__docgenInfo={description:"",displayName:"Typing",props:{useDefaultSentences:{defaultValue:{value:"false"},description:"",name:"useDefaultSentences",required:!1,type:{name:"boolean"}},lang:{defaultValue:{value:"en"},description:"",name:"lang",required:!1,type:{name:"enum",value:[{value:'"en"'},{value:'"it"'}]}},sentence:{defaultValue:null,description:"",name:"sentence",required:!1,type:{name:"string"}},sentences:{defaultValue:null,description:"",name:"sentences",required:!1,type:{name:"{ [lang: string]: { text: string; delayAfter: number; }[]; }"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Typing/Typing.tsx#Typing"]={docgenInfo:Typing.__docgenInfo,name:"Typing",path:"src/components/Typing/Typing.tsx#Typing"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/AI.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AI=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});AI.displayName="AI";const __WEBPACK_DEFAULT_EXPORT__=AI;try{AI.displayName="AI",AI.__docgenInfo={description:"",displayName:"AI",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/AI.tsx#AI"]={docgenInfo:AI.__docgenInfo,name:"AI",path:"src/components/icons/AI.tsx#AI"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Expand.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Expand=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});Expand.displayName="Expand";const __WEBPACK_DEFAULT_EXPORT__=Expand;try{Expand.displayName="Expand",Expand.__docgenInfo={description:"",displayName:"Expand",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Expand.tsx#Expand"]={docgenInfo:Expand.__docgenInfo,name:"Expand",path:"src/components/icons/Expand.tsx#Expand"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Microphone.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Microphone=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});Microphone.displayName="Microphone";const __WEBPACK_DEFAULT_EXPORT__=Microphone;try{Microphone.displayName="Microphone",Microphone.__docgenInfo={description:"",displayName:"Microphone",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Microphone.tsx#Microphone"]={docgenInfo:Microphone.__docgenInfo,name:"Microphone",path:"src/components/icons/Microphone.tsx#Microphone"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Send.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Send=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});Send.displayName="Send";const __WEBPACK_DEFAULT_EXPORT__=Send;try{Send.displayName="Send",Send.__docgenInfo={description:"",displayName:"Send",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Send.tsx#Send"]={docgenInfo:Send.__docgenInfo,name:"Send",path:"src/components/icons/Send.tsx#Send"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/User.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const User=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});User.displayName="User";const __WEBPACK_DEFAULT_EXPORT__=User;try{User.displayName="User",User.__docgenInfo={description:"",displayName:"User",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/User.tsx#User"]={docgenInfo:User.__docgenInfo,name:"User",path:"src/components/icons/User.tsx#User"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Dt:()=>isAndroid,Tt:()=>isiOS,bw:()=>cleanUrl,h:()=>stripEmojis,vw:()=>stripDuplicates,xZ:()=>hasTouchscreen});__webpack_require__("./node_modules/react/index.js");const hasTouchscreen=()=>{let hasTouchScreen=!1;if("maxTouchPoints"in navigator)hasTouchScreen=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)hasTouchScreen=navigator.msMaxTouchPoints>0;else{const mQ=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(mQ&&"(pointer:coarse)"===mQ.media)hasTouchScreen=!!mQ.matches;else if("orientation"in window)hasTouchScreen=!0;else{var UA=navigator?.userAgent;hasTouchScreen=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA)}}return hasTouchScreen},isiOS=()=>{let platform=navigator?.userAgentData?.platform||navigator?.platform||"unknown",userAgent=navigator?.userAgent||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(platform)||userAgent.includes("Mac")&&"ontouchend"in document},isAndroid=()=>"android"===(navigator?.userAgentData?.platform||navigator?.platform||"unknown").toLowerCase()||navigator.userAgent.includes("Android");const stripDuplicates=text=>text.slice(0,text.length/2).trim().toLowerCase()===text.slice(text.length/2+1).trim().toLowerCase()?text.slice(0,text.length/2):text,stripEmojis=text=>text.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim();function cleanUrl(href){try{href=encodeURI(href).replace(/%25/g,"%")}catch(e){return null}return href}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2224],{"./src/components/Chat/Chat.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_helpers_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/helpers/utils.ts"),_helpers_media__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./src/helpers/media.ts"),_ChatBubble_ChatBubble__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ChatBubble/ChatBubble.tsx"),_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/MediaWidget/MediaWidget.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Button.tsx"),_ChatInputs_ChatInputs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/ChatInputs/ChatInputs.tsx"),_Typing_Typing__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/Typing/Typing.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/helpers/constants.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Chat=({memori,tenant,sessionID,baseUrl,apiUrl,translateTo,memoriTyping,typingText,showTypingText=!1,history=[],authToken,dialogState,simulateUserPrompt,showDates=!1,showContextPerLine=!1,showAIicon=!0,selectReceiverTag,preview=!1,instruct=!1,showInputs=!0,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",sendOnEnter,setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,userMessage="",onChangeUserMessage,sendMessage,listening,isPlayingAudio,stopAudio,startListening,stopListening,resetTranscript,customMediaRenderer,user,userAvatar,experts})=>{const scrollToBottom=()=>{setTimeout((()=>{document.querySelector(".memori-chat--content")?.scrollTo(0,document.querySelector(".memori-chat--content")?.scrollHeight??0)}),200)};(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{!preview&&scrollToBottom()}),[history,preview]);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--wrapper",{"memori-chat-wrapper--translate":translateTo}),id:"chat-wrapper",lang:translateTo?.toUpperCase(),"data-memori-lang":memori.culture?.split("-")?.[0]?.toUpperCase()??"EN",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--history",{"memori-chat--history-touch":(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--content",{"memori-chat--content-touch":(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--cover"),style:{backgroundImage:`url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_10__.v)({type:"cover",tenantID:tenant?.id,resourceURI:memori.coverURL,baseURL:baseUrl,apiURL:apiUrl})}"), url("${(0,_helpers_media__WEBPACK_IMPORTED_MODULE_10__.v)({type:"cover",tenantID:tenant?.id,baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl})}")`}}),history.map(((message,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatBubble_ChatBubble__WEBPACK_IMPORTED_MODULE_3__.Z,{isFirst:0===index,message,memori,tenant,baseUrl,apiUrl,simulateUserPrompt,showAIicon,showFeedback:index===history.length-1&&!message.fromUser&&dialogState?.acceptsFeedback,user,userAvatar,experts}),showDates&&!!message.timestamp&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("small",{className:"memori-chat--timestamp "+(message.fromUser?"text-right":"text-left"),children:new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(message.timestamp.endsWith("Z")?message.timestamp:`${message.timestamp}Z`))}),showContextPerLine&&!!Object.keys(message.contextVars??{}).length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-vars",children:Object.keys(message.contextVars??{}).map((key=>"-"===message.contextVars?.[key]?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--context-tag-text",children:key})},key):"✔️"===message.contextVars?.[key]?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--context-tag-text",children:key})},key):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--context-tag",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("span",{className:"memori-chat--context-tag-text",children:[key,": ",message.contextVars?.[key]]})},key)))}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__.Z,{simulateUserPrompt,media:message?.media?.filter((m=>"text/html"!==m.mimeType&&"text/plain"!==m.mimeType)),links:message?.media?.filter((m=>"text/html"===m.mimeType)),sessionID,baseUrl,apiUrl,translateTo,customMediaRenderer})]},index))),dialogState?.hints&&dialogState.hints.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_MediaWidget_MediaWidget__WEBPACK_IMPORTED_MODULE_4__.Z,{simulateUserPrompt,hints:dialogState.translatedHints?dialogState.translatedHints:dialogState.hints.map((h=>({text:h,originalText:h})))}),!!memoriTyping&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Typing_Typing__WEBPACK_IMPORTED_MODULE_7__.Z,{useDefaultSentences:showTypingText,lang:translateTo?"it"===translateTo.toLowerCase()?"it":"en":"it"===memori.culture?.split("-")?.[0]?.toLowerCase()?"it":"en",sentence:typingText,sentences:memori.enableBoardOfExperts?_helpers_constants__WEBPACK_IMPORTED_MODULE_8__.DZ:void 0},typingText),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{id:"end-messages-ref"})]})}),"X3"===dialogState?.state&&sessionID&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--known-tags",children:Object.keys(dialogState.knownTags??{}).filter((t=>t!==memori.giverTag)).map((tag=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_5__.Z,{icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:"memori-chat--known-tag-icon",children:tag}),className:"memori-chat--known-tag",onClick:()=>selectReceiverTag(tag),children:dialogState.knownTags?.[tag]},tag)))}),showInputs&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ChatInputs_ChatInputs__WEBPACK_IMPORTED_MODULE_6__.Z,{userMessage,onChangeUserMessage,dialogState,instruct,authToken,sendMessage,microphoneMode,sendOnEnter,setSendOnEnter,attachmentsMenuOpen,setAttachmentsMenuOpen,onTextareaPressEnter:()=>{"keypress"===sendOnEnter&&userMessage?.length>0&&(stopListening(),sendMessage(userMessage),onChangeUserMessage(""),resetTranscript())},onTextareaFocus:()=>{stopListening(),(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_2__.xZ)()&&window.innerWidth<=768&&(document.getElementById("chat-wrapper")?.classList?.add("chat-focused"),document.querySelector(".memori.memori-widget")?.classList?.add("chat-focused"),setTimeout((()=>{scrollToBottom()}),300))},onTextareaBlur:()=>{document.getElementById("chat-wrapper")?.classList?.contains("chat-focused")&&(document.getElementById("chat-wrapper")?.classList.remove("chat-focused"),document.querySelector(".memori.memori-widget")?.classList?.remove("chat-focused"),scrollToBottom())},startListening,stopListening,stopAudio,listening,isPlayingAudio,showMicrophone})]})};Chat.displayName="Chat";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(Chat);try{Chat.displayName="Chat",Chat.__docgenInfo={description:"",displayName:"Chat",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!0,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},memoriTyping:{defaultValue:null,description:"",name:"memoriTyping",required:!1,type:{name:"boolean"}},typingText:{defaultValue:null,description:"",name:"typingText",required:!1,type:{name:"string"}},showTypingText:{defaultValue:{value:"false"},description:"",name:"showTypingText",required:!1,type:{name:"boolean"}},history:{defaultValue:{value:"[]"},description:"",name:"history",required:!1,type:{name:"Message[]"}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}},dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},setDialogState:{defaultValue:null,description:"",name:"setDialogState",required:!0,type:{name:"(dialogState: DialogState) => void"}},pushMessage:{defaultValue:null,description:"",name:"pushMessage",required:!0,type:{name:"(message: Message) => void"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!0,type:{name:"(text: string, translatedText?: string | undefined) => void"}},showDates:{defaultValue:{value:"false"},description:"",name:"showDates",required:!1,type:{name:"boolean"}},showContextPerLine:{defaultValue:{value:"false"},description:"",name:"showContextPerLine",required:!1,type:{name:"boolean"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},client:{defaultValue:null,description:"",name:"client",required:!0,type:{name:'{ constants: { HOSTNAME: string; BACKEND_URL: string; ENGINE_URL: string; allowedMediaTypes: string[]; anonTag: "👤"; }; asset: { getResourceUrl: ({ type, resourceURI, sessionID, baseURL, }: ResourceURLParams) => string; }; ... 111 more ...; backend: { ...; }; }'}},selectReceiverTag:{defaultValue:null,description:"",name:"selectReceiverTag",required:!0,type:{name:"(tag: string) => Promise"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},instruct:{defaultValue:{value:"false"},description:"",name:"instruct",required:!1,type:{name:"boolean"}},showInputs:{defaultValue:{value:"true"},description:"",name:"showInputs",required:!1,type:{name:"boolean"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},resetTranscript:{defaultValue:null,description:"",name:"resetTranscript",required:!0,type:{name:"() => void"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}},layout:{defaultValue:null,description:"",name:"layout",required:!0,type:{name:"enum",value:[{value:"undefined"},{value:'"DEFAULT"'},{value:'"FULLPAGE"'},{value:'"TOTEM"'},{value:'"CHAT"'},{value:'"WEBSITE_ASSISTANT"'}]}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}},experts:{defaultValue:null,description:"",name:"experts",required:!1,type:{name:"ExpertReference[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Chat/Chat.tsx#Chat"]={docgenInfo:Chat.__docgenInfo,name:"Chat",path:"src/components/Chat/Chat.tsx#Chat"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatBubble/ChatBubble.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_headlessui_react__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/media.ts"),_icons_User__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/User.tsx"),_icons_AI__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/AI.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/FeedbackButtons/FeedbackButtons.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),marked__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/marked/lib/marked.esm.js"),dompurify__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/dompurify/dist/purify.js"),_helpers_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/helpers/utils.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");marked__WEBPACK_IMPORTED_MODULE_6__.TU.use({async:!1,gfm:!0,pedantic:!0,renderer:{link(href,title,text){const cleanHref=(0,_helpers_utils__WEBPACK_IMPORTED_MODULE_8__.bw)(href);if(null===cleanHref)return text;let out='",out}}});const ChatBubble=({message,memori,tenant,baseUrl,apiUrl,showFeedback,simulateUserPrompt,showAIicon=!0,isFirst=!1,user,userAvatar,experts})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_10__.$)(),renderedText=(0,dompurify__WEBPACK_IMPORTED_MODULE_7__.sanitize)(marked__WEBPACK_IMPORTED_MODULE_6__.TU.parse(message.translatedText??message.text),{ADD_ATTR:["target"]});return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:[(message.initial||isFirst)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:"memori-chat--bubble-initial"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u,{show:!0,appear:!0,as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt}),children:[!message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),title:message.emitter?.length&&memori.enableBoardOfExperts?message.emitter:memori.name,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:message.emitter?.length&&memori.enableBoardOfExperts?message.emitter:memori.name,src:message.emitter?.length&&memori.enableBoardOfExperts&&experts?.find((e=>e.name===message.emitter))?`${apiUrl}/api/v1/memoriai/memori/avatar/${experts.find((e=>e.name===message.emitter))?.expertMemoriID}`:memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl,apiURL:apiUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl||"https://app.twincreator.com",apiURL:apiUrl}),onError:e=>{e.currentTarget.src=memori.avatarURL&&memori.avatarURL.length>0?(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({type:"avatar",tenantID:tenant?.id,resourceURI:memori.avatarURL,baseURL:baseUrl}):(0,_helpers_media__WEBPACK_IMPORTED_MODULE_12__.v)({tenantID:tenant?.id,type:"avatar",baseURL:baseUrl}),e.currentTarget.onerror=null}})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat--bubble",{"memori-chat--user-bubble":!!message.fromUser,"memori-chat--with-addon":message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt,"memori-chat--ai-generated":message.generatedByAI&&showAIicon,"memori-chat--with-feedback":showFeedback}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(message.fromUser?"30":"-30"),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{dangerouslySetInnerHTML:{__html:renderedText}}),(message.generatedByAI&&showAIicon||showFeedback&&simulateUserPrompt)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:"memori-chat--bubble-addon",children:[showFeedback&&!!simulateUserPrompt&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_FeedbackButtons_FeedbackButtons__WEBPACK_IMPORTED_MODULE_5__.Z,{memori,className:"memori-chat--bubble-feedback",dropdown:!0,onNegativeClick:msg=>{msg&&simulateUserPrompt(msg)}}),message.generatedByAI&&showAIicon&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_4__.Z,{align:"left",content:t("generatedByAI"),className:"memori-chat--bubble-ai-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_AI__WEBPACK_IMPORTED_MODULE_3__.default,{title:t("generatedByAI")||void 0})})})]})]}),message.fromUser&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.Fragment,{children:userAvatar&&"string"==typeof userAvatar||!userAvatar&&user?.avatarURL?.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("img",{className:"memori-chat--bubble-avatar-img",alt:user?.userName??"User",src:userAvatar??user?.avatarURL})}):userAvatar?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:userAvatar}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_11__.u.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(message.fromUser?"translate-x-15":"translate-x--15"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_icons_User__WEBPACK_IMPORTED_MODULE_2__.default,{})})})]})]})},__WEBPACK_DEFAULT_EXPORT__=ChatBubble;try{ChatBubble.displayName="ChatBubble",ChatBubble.__docgenInfo={description:"",displayName:"ChatBubble",props:{message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"Message"}},memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},tenant:{defaultValue:null,description:"",name:"tenant",required:!1,type:{name:"Tenant"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},showFeedback:{defaultValue:null,description:"",name:"showFeedback",required:!1,type:{name:"boolean"}},simulateUserPrompt:{defaultValue:null,description:"",name:"simulateUserPrompt",required:!1,type:{name:"((msg: string) => void)"}},showAIicon:{defaultValue:{value:"true"},description:"",name:"showAIicon",required:!1,type:{name:"boolean"}},isFirst:{defaultValue:{value:"false"},description:"",name:"isFirst",required:!1,type:{name:"boolean"}},userAvatar:{defaultValue:null,description:"",name:"userAvatar",required:!1,type:{name:"string | Element"}},user:{defaultValue:null,description:"",name:"user",required:!1,type:{name:"User"}},experts:{defaultValue:null,description:"",name:"experts",required:!1,type:{name:"ExpertReference[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatBubble/ChatBubble.tsx#ChatBubble"]={docgenInfo:ChatBubble.__docgenInfo,name:"ChatBubble",path:"src/components/ChatBubble/ChatBubble.tsx#ChatBubble"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatInputs/ChatInputs.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx"),_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ChatTextArea/ChatTextArea.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Button.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_icons_Send__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/Send.tsx"),_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/MicrophoneButton/MicrophoneButton.tsx"),classnames__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_6__),_icons_Microphone__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/Microphone.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatInputs=({dialogState,sendOnEnter="click",setSendOnEnter,userMessage="",onChangeUserMessage,sendMessage,onTextareaFocus,onTextareaBlur,onTextareaPressEnter,showMicrophone=!1,microphoneMode="HOLD_TO_TALK",listening=!1,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_9__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===dialogState?.state||"X3"===dialogState?.state,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SendOnEnterMenu_SendOnEnterMenu__WEBPACK_IMPORTED_MODULE_1__.Z,{sendOnEnter,setSendOnEnter}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ChatTextArea_ChatTextArea__WEBPACK_IMPORTED_MODULE_2__.Z,{value:userMessage,onChange:onChangeUserMessage,onPressEnter:onTextareaPressEnter,onFocus:onTextareaFocus,onBlur:onTextareaBlur,disabled:["R2","R3","R4","R5","G3","X3"].includes(dialogState?.state||"")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_3__.Z,{shape:"circle",primary:!!userMessage?.length,disabled:!userMessage||0===userMessage.length,className:"memori-chat-inputs--send",onClick:()=>{sendMessage(userMessage),stopAudio(),speechSynthesis.speak(new SpeechSynthesisUtterance(""))},title:t("send")||"Send",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Send__WEBPACK_IMPORTED_MODULE_4__.default,{})}),showMicrophone&&"HOLD_TO_TALK"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_MicrophoneButton_MicrophoneButton__WEBPACK_IMPORTED_MODULE_5__.Z,{listening,startListening,stopListening:()=>{stopListening(),userMessage?.length&&sendMessage(userMessage)},stopAudio}),showMicrophone&&"CONTINUOUS"===microphoneMode&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_3__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_6___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onClick:()=>{listening?stopListening():(stopAudio(),startListening())},shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_7__.default,{})})]})};ChatInputs.displayName="ChatInputs";const __WEBPACK_DEFAULT_EXPORT__=ChatInputs;try{ChatInputs.displayName="ChatInputs",ChatInputs.__docgenInfo={description:"",displayName:"ChatInputs",props:{dialogState:{defaultValue:null,description:"",name:"dialogState",required:!1,type:{name:"DialogState"}},instruct:{defaultValue:null,description:"",name:"instruct",required:!1,type:{name:"boolean"}},sendOnEnter:{defaultValue:{value:"click"},description:"",name:"sendOnEnter",required:!1,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(sendOnEnter: "keypress" | "click") => void'}},attachmentsMenuOpen:{defaultValue:null,description:"",name:"attachmentsMenuOpen",required:!1,type:{name:"enum",value:[{value:'"link"'},{value:'"media"'}]}},setAttachmentsMenuOpen:{defaultValue:null,description:"",name:"setAttachmentsMenuOpen",required:!0,type:{name:'(attachmentsMenuOpen: "link" | "media") => void'}},userMessage:{defaultValue:{value:""},description:"",name:"userMessage",required:!1,type:{name:"string"}},onChangeUserMessage:{defaultValue:null,description:"",name:"onChangeUserMessage",required:!0,type:{name:"(userMessage: string) => void"}},sendMessage:{defaultValue:null,description:"",name:"sendMessage",required:!0,type:{name:"(msg: string) => void"}},onTextareaFocus:{defaultValue:null,description:"",name:"onTextareaFocus",required:!0,type:{name:"() => void"}},onTextareaBlur:{defaultValue:null,description:"",name:"onTextareaBlur",required:!0,type:{name:"() => void"}},onTextareaPressEnter:{defaultValue:null,description:"",name:"onTextareaPressEnter",required:!0,type:{name:"(e: KeyboardEvent) => void"}},listening:{defaultValue:{value:"false"},description:"",name:"listening",required:!1,type:{name:"boolean"}},isPlayingAudio:{defaultValue:null,description:"",name:"isPlayingAudio",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}},showMicrophone:{defaultValue:{value:"false"},description:"",name:"showMicrophone",required:!1,type:{name:"boolean"}},microphoneMode:{defaultValue:{value:"HOLD_TO_TALK"},description:"",name:"microphoneMode",required:!1,type:{name:"enum",value:[{value:'"HOLD_TO_TALK"'},{value:'"CONTINUOUS"'}]}},authToken:{defaultValue:null,description:"",name:"authToken",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatInputs/ChatInputs.tsx#ChatInputs"]={docgenInfo:ChatInputs.__docgenInfo,name:"ChatInputs",path:"src/components/ChatInputs/ChatInputs.tsx#ChatInputs"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ChatTextArea/ChatTextArea.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Expand__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Expand.tsx"),_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/icons/FullscreenExit.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ChatTextArea=({disabled=!1,value,onChange,onPressEnter,onFocus,onBlur})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[expanded,setExpanded]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{"data-testid":"chat-textarea",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea",{"memori-chat-textarea--expanded":expanded,"memori-chat-textarea--disabled":disabled}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-chat-textarea--inner",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("textarea",{className:"memori-chat-textarea--input",disabled,value,onChange:e=>{onChange(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&onPressEnter&&onPressEnter(e)},onFocus,onBlur}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-chat-textarea--expand",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-chat-textarea--expand-button"),onClick:()=>setExpanded(!expanded),padded:!1,ghost:!0,title:expanded?t("collapse")||"Collapse":t("expand")||"Expand",icon:expanded?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_FullscreenExit__WEBPACK_IMPORTED_MODULE_4__.default,{}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Expand__WEBPACK_IMPORTED_MODULE_3__.default,{})})})]})})};ChatTextArea.displayName="ChatTextArea";const __WEBPACK_DEFAULT_EXPORT__=ChatTextArea;try{ChatTextArea.displayName="ChatTextArea",ChatTextArea.__docgenInfo={description:"",displayName:"ChatTextArea",props:{disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},value:{defaultValue:null,description:"",name:"value",required:!0,type:{name:"string"}},onChange:{defaultValue:null,description:"",name:"onChange",required:!0,type:{name:"(value: string) => void"}},onPressEnter:{defaultValue:null,description:"",name:"onPressEnter",required:!1,type:{name:"((e: KeyboardEvent) => void)"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"((e: FocusEvent) => void)"}},onBlur:{defaultValue:null,description:"",name:"onBlur",required:!1,type:{name:"((e: FocusEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"]={docgenInfo:ChatTextArea.__docgenInfo,name:"ChatTextArea",path:"src/components/ChatTextArea/ChatTextArea.tsx#ChatTextArea"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/FeedbackButtons/FeedbackButtons.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Tooltip.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Feedback.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");const feedbackMsgs={"it-IT":"Non è quello che ti ho chiesto","fr-FR":"Ce n'est pas ce que je t'ai demandé","en-GB":"It's not what I asked"},feedbackMsgsHelpers={"it-IT":"La risposta non era corretta","fr-FR":"La réponse n'était pas correcte","en-GB":"The answer was not correct"},dislikeMsgs={"it-IT":"Non mi è piaciuta la risposta","fr-FR":"Je n'ai pas aimé la réponse","en-GB":"I didn't like the answer"},FeedbackButtons=({memori,className,onNegativeClick,toggle=!1,dropdown=!1})=>{const[clicked,setClicked]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),culture="it-IT"===memori.culture?"it-IT":"fr-FR"===memori.culture?"fr-FR":"en-GB",feedbackMsg=feedbackMsgs[culture],feedbackMsgHelper=feedbackMsgsHelpers[culture],dislikeMsg=dislikeMsgs[culture];return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div",{className:"memori-chat--feedback"+(className?` ${className}`:""),children:dropdown?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-chat--feedback-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,shape:"circle",title:"Feedback",className:"memori-chat--feedback-menu-button",disabled:!!clicked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"transition ease-out duration-200",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-chat--feedback-menu-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-chat--feedback-menu-items-container",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("up"===clicked&&toggle?void 0:"up")},children:dislikeMsg})},"ok"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:({active})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("button",{className:"memori-chat--feedback-menu-item"+(active?" memori-chat--feedback-menu-item-active":""),onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},children:feedbackMsgHelper})},"no")]})})})]}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_1__.Z,{align:"left",content:"Feedback",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{title:"Feedback",onClick:()=>{setClicked("down"===clicked&&toggle?void 0:"down"),onNegativeClick(feedbackMsg)},ghost:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Feedback__WEBPACK_IMPORTED_MODULE_3__.default,{className:clicked?"memori-chat--feedback-clicked":void 0})})})})};FeedbackButtons.displayName="FeedbackButtons";const __WEBPACK_DEFAULT_EXPORT__=FeedbackButtons;try{FeedbackButtons.displayName="FeedbackButtons",FeedbackButtons.__docgenInfo={description:"",displayName:"FeedbackButtons",props:{memori:{defaultValue:null,description:"",name:"memori",required:!0,type:{name:"Memori"}},onNegativeClick:{defaultValue:null,description:"",name:"onNegativeClick",required:!0,type:{name:"(msg?: string | undefined) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},toggle:{defaultValue:{value:"false"},description:"",name:"toggle",required:!1,type:{name:"boolean"}},dropdown:{defaultValue:{value:"false"},description:"",name:"dropdown",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"]={docgenInfo:FeedbackButtons.__docgenInfo,name:"FeedbackButtons",path:"src/components/FeedbackButtons/FeedbackButtons.tsx#FeedbackButtons"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/LinkItemWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{$:()=>RenderLinkItem,Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Link__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Link.tsx"),classnames__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__),ellipsed__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/ellipsed/lib/ellipsed.js"),_ui_Card__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Card.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const RenderLinkItem=({isChild=!1,item,baseUrl,onLinkPreviewInfo,descriptionOneLine=!1})=>{const[link,setLink]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),normURL=item.url?.startsWith("http")||!item.url||0===item.url?.length?item.url:`https://${item.url}`;(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{let normURL=item.url?.startsWith("http")||!item.url||0===item.url?.length?item.url:`https://${item.url}`;normURL&&normURL!==link?.urlKey&&(async(url,baseUrl)=>{try{const data=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(url)}`);return await data.json()}catch(err){return console.error("getSiteInfo",err),null}})(normURL,baseUrl).then((siteInfo=>{setLink(siteInfo?{...siteInfo,urlKey:normURL}:null),onLinkPreviewInfo&&siteInfo&&onLinkPreviewInfo(siteInfo)}))}),[item?.url,baseUrl,onLinkPreviewInfo]);const title=item.title&&item.title.length>0?item.title:link?.title,description=link?.description,video=link?.video,image=link?.image??link?.images?.[0];return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{setTimeout((()=>{(0,ellipsed__WEBPACK_IMPORTED_MODULE_3__.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[description,item.mediumID]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("a",{href:normURL,target:"_blank",rel:"noopener noreferrer",className:classnames__WEBPACK_IMPORTED_MODULE_2___default()("memori-link-item--link",{"memori-link-item--link--child":isChild}),onClick:e=>{isChild||(e.preventDefault(),e.stopPropagation(),window.open(normURL,"_blank",`toolbar=yes,top=${.1*window.innerHeight},left=${.1*window.innerWidth},width=${.8*window.innerWidth},height=${.8*window.innerHeight}`))},children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,className:classnames__WEBPACK_IMPORTED_MODULE_2___default()("memori-link-item--card",{"memori-link-item--card-description-oneline":descriptionOneLine,"memori-link-item--card-has-image":image,"memori-link-item--card-has-video":video}),cover:video?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("iframe",{width:"100%",height:"100%",src:video,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):image?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("img",{className:"memori-link-item--card-cover-img",src:"data:image/png;base64,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",srcSet:image.includes("data:image")?void 0:image,alt:item.title}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-link-item--card-cover-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Link__WEBPACK_IMPORTED_MODULE_1__.default,{className:"memori-link-item--icon"})}),title,description})})};RenderLinkItem.displayName="RenderLinkItem";const LinkItemWidget=({items,baseUrl,descriptionOneLine=!1,onLinkPreviewInfo})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u,{appear:!0,show:!0,as:"div",className:"memori-link-items",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-link-items--grid",children:items.map(((item,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.u.Child,{as:"div",className:"memori-link-item",enter:"ease-out duration-500 delay-"+100*index,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(RenderLinkItem,{item,baseUrl,descriptionOneLine,onLinkPreviewInfo})},item.mediumID)))})});LinkItemWidget.displayName="LinkItemWidget";const __WEBPACK_DEFAULT_EXPORT__=LinkItemWidget;try{RenderLinkItem.displayName="RenderLinkItem",RenderLinkItem.__docgenInfo={description:"",displayName:"RenderLinkItem",props:{baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},descriptionOneLine:{defaultValue:{value:"false"},description:"",name:"descriptionOneLine",required:!1,type:{name:"boolean"}},onLinkPreviewInfo:{defaultValue:null,description:"",name:"onLinkPreviewInfo",required:!1,type:{name:"((linkPreviewInfo: ILinkPreviewInfo) => void)"}},item:{defaultValue:null,description:"",name:"item",required:!0,type:{name:"Medium"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/LinkItemWidget.tsx#RenderLinkItem"]={docgenInfo:RenderLinkItem.__docgenInfo,name:"RenderLinkItem",path:"src/components/MediaWidget/LinkItemWidget.tsx#RenderLinkItem"})}catch(__react_docgen_typescript_loader_error){}try{LinkItemWidget.displayName="LinkItemWidget",LinkItemWidget.__docgenInfo={description:"",displayName:"LinkItemWidget",props:{isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},items:{defaultValue:null,description:"",name:"items",required:!0,type:{name:"Medium[]"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},descriptionOneLine:{defaultValue:{value:"false"},description:"",name:"descriptionOneLine",required:!1,type:{name:"boolean"}},onLinkPreviewInfo:{defaultValue:null,description:"",name:"onLinkPreviewInfo",required:!1,type:{name:"((linkPreviewInfo: ILinkPreviewInfo) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/LinkItemWidget.tsx#LinkItemWidget"]={docgenInfo:LinkItemWidget.__docgenInfo,name:"LinkItemWidget",path:"src/components/MediaWidget/LinkItemWidget.tsx#LinkItemWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/MediaWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_LinkItemWidget__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/MediaWidget/LinkItemWidget.tsx"),_MediaItemWidget__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/MediaWidget/MediaItemWidget.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MediaWidget=({hints=[],links=[],media=[],simulateUserPrompt=()=>{},sessionID,baseUrl,apiUrl,translateTo,customMediaRenderer})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[showHints,setShowHints]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!0),[hintsPagination,setHintsPagination]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(6);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{setShowHints(!0)}),[hints]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div",{className:"memori-media-widget",children:[media?.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_MediaItemWidget__WEBPACK_IMPORTED_MODULE_3__.Z,{items:media,sessionID,translateTo,baseURL:baseUrl,apiURL:apiUrl,customMediaRenderer}),links?.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_LinkItemWidget__WEBPACK_IMPORTED_MODULE_2__.Z,{items:links,baseUrl}),hints?.length>0&&showHints&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u,{appear:!0,show:!0,as:"ul",className:"memori-media--hints",children:hints.slice(0,hintsPagination).map(((item,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:"li",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-media--hint"),primary:!0,onClick:()=>{simulateUserPrompt(item.originalText,item.text),setShowHints(!1)},onTouchEnd:()=>{simulateUserPrompt(item.originalText,item.text),setShowHints(!1)},children:item.text},item.text+index)},item.text+index)))}),hints.length>hintsPagination&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-hints--show-more",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{className:"memori-hints--show-more-button",id:"showMoreHints",onClick:()=>setHintsPagination(hintsPagination+6),children:t("expand")||"Expand"})})]})]})};MediaWidget.displayName="MediaWidget";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(MediaWidget);try{MediaWidget.displayName="MediaWidget",MediaWidget.__docgenInfo={description:"",displayName:"MediaWidget",props:{hints:{defaultValue:{value:"[]"},description:"",name:"hints",required:!1,type:{name:"TranslatedHint[]"}},links:{defaultValue:{value:"[]"},description:"",name:"links",required:!1,type:{name:"Medium[]"}},media:{defaultValue:{value:"[]"},description:"",name:"media",required:!1,type:{name:"Medium[]"}},simulateUserPrompt:{defaultValue:{value:"() => {}"},description:"",name:"simulateUserPrompt",required:!1,type:{name:"((item: string, translatedItem?: string) => void)"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},baseUrl:{defaultValue:null,description:"",name:"baseUrl",required:!1,type:{name:"string"}},apiUrl:{defaultValue:null,description:"",name:"apiUrl",required:!1,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaWidget.tsx#MediaWidget"]={docgenInfo:MediaWidget.__docgenInfo,name:"MediaWidget",path:"src/components/MediaWidget/MediaWidget.tsx#MediaWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MicrophoneButton/MicrophoneButton.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/icons/Microphone.tsx"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/ui/Tooltip.tsx"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const MicrophoneButton=({listening,stopAudio,startListening,stopListening})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)(),[micBtnTooltip,setMicBtnTooltip]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),intervalRef=(0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null),startHold=e=>{e.preventDefault(),setMicBtnTooltip(t("write_and_speak.holdToSpeak")||"Hold to record"),intervalRef.current||(intervalRef.current=setTimeout((()=>{stopAudio(),setMicBtnTooltip(t("write_and_speak.releaseToEndListening")||"Release to end listening"),startListening()}),300))},stopHold=()=>{intervalRef.current&&(clearTimeout(intervalRef.current),intervalRef.current=null),stopListening(),setMicBtnTooltip(void 0)};return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>()=>stopHold()),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Tooltip__WEBPACK_IMPORTED_MODULE_3__.Z,{visible:!!micBtnTooltip,content:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span",{children:micBtnTooltip||t("write_and_speak.pressAndHoldToSpeak")||"Press and hold to speak"}),align:"topLeft",className:"memori-mic-btn-tooltip",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{primary:!0,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":listening}),title:listening?t("write_and_speak.micButtonPopoverListening")||"Listening":t("write_and_speak.micButtonPopover")||"Start listening",onMouseDown:startHold,onTouchStart:startHold,onMouseUp:stopHold,onMouseLeave:stopHold,onTouchEnd:stopHold,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Microphone__WEBPACK_IMPORTED_MODULE_1__.default,{})})})};MicrophoneButton.displayName="MicrophoneButton";const __WEBPACK_DEFAULT_EXPORT__=MicrophoneButton;try{MicrophoneButton.displayName="MicrophoneButton",MicrophoneButton.__docgenInfo={description:"",displayName:"MicrophoneButton",props:{listening:{defaultValue:null,description:"",name:"listening",required:!1,type:{name:"boolean"}},stopAudio:{defaultValue:null,description:"",name:"stopAudio",required:!0,type:{name:"() => void"}},startListening:{defaultValue:null,description:"",name:"startListening",required:!0,type:{name:"() => void"}},stopListening:{defaultValue:null,description:"",name:"stopListening",required:!0,type:{name:"() => void"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"]={docgenInfo:MicrophoneButton.__docgenInfo,name:"MicrophoneButton",path:"src/components/MicrophoneButton/MicrophoneButton.tsx#MicrophoneButton"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/SendOnEnterMenu/SendOnEnterMenu.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _headlessui_react__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/@headlessui/react/dist/components/menu/menu.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@headlessui/react/dist/components/radio-group/radio-group.js"),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_i18next__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),_ui_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const SendOnEnterMenu=({sendOnEnter,setSendOnEnter})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_4__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v,{as:"div",className:"memori-send-on-enter-menu",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Button,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button"),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-button--icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{style:{display:"block",width:"1rem",height:"1rem"},children:"…"})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Items,{className:"memori-menu--overlay",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E,{value:sendOnEnter,onChange:setSendOnEnter,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"keypress",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnKeypress")})})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_6__.E.Option,{value:"click",className:"memori-menu--option",children:({checked})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_5__.v.Item,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{className:"memori-menu--button",ghost:!0,outlined:checked,icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-menu--icon",children:checked?"✓":""}),children:t("widget.sendOnClick")})})})]})})]})};SendOnEnterMenu.displayName="SendOnEnterMenu";const __WEBPACK_DEFAULT_EXPORT__=SendOnEnterMenu;try{SendOnEnterMenu.displayName="SendOnEnterMenu",SendOnEnterMenu.__docgenInfo={description:"",displayName:"SendOnEnterMenu",props:{sendOnEnter:{defaultValue:null,description:"",name:"sendOnEnter",required:!0,type:{name:"enum",value:[{value:'"keypress"'},{value:'"click"'}]}},setSendOnEnter:{defaultValue:null,description:"",name:"setSendOnEnter",required:!0,type:{name:'(value: "keypress" | "click") => void'}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"]={docgenInfo:SendOnEnterMenu.__docgenInfo,name:"SendOnEnterMenu",path:"src/components/SendOnEnterMenu/SendOnEnterMenu.tsx#SendOnEnterMenu"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Typing/Typing.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const defaultSentences={en:[{delayAfter:3,text:"Generating an accurate and fancy response..."},{delayAfter:3,text:"Generating a response that will blow your mind..."},{delayAfter:3,text:"Generating a response that will make you smile..."},{delayAfter:3,text:"Thinking of a response..."},{delayAfter:3,text:"Thinking of a response that will make you smile..."},{delayAfter:3,text:"Gathering my thoughts..."},{delayAfter:3,text:"Gathering my thoughts to give you a response..."}],it:[{delayAfter:3,text:"Sto generando una risposta accurata e fantasiosa..."},{delayAfter:3,text:"Sto generando una risposta che ti farà impazzire..."},{delayAfter:3,text:"Sto generando una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto pensando ad una risposta..."},{delayAfter:3,text:"Sto pensando ad una risposta che ti farà sorridere..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri..."},{delayAfter:3,text:"Sto raccogliendo i miei pensieri per darti una risposta..."}]},getSeparatorString=(seconds=3)=>new Array(20*seconds).fill(" ").join(""),Typing=({useDefaultSentences=!1,lang="en",sentence,sentences})=>{const[index,setIndex]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),[text,setText]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(sentences?.[lang]?.length?`${sentences[lang][0].text.endsWith("...")||!sentences[lang][0].text.length?sentences[lang][0].text:`${sentences[lang][0].text}...`}${getSeparatorString(sentences[lang][0].delayAfter)}`:sentence?`${sentence.endsWith("...")||!sentence.length?sentence:`${sentence}...`}${getSeparatorString()}`:""),[shownText,setShownText]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const interval=setInterval((()=>{const letter=text[shownText.length];if(void 0!==letter&&text.length>0)setShownText((prev=>prev+letter));else if(sentences?.[lang]?.length&&indexclearInterval(interval)})),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"memori-chat--bubble",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div",{className:"memori-chat--bubble-typing",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div",{id:"wave",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span",{className:"dot"})]}),text.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:shownText})]})})};Typing.displayName="Typing";const __WEBPACK_DEFAULT_EXPORT__=Typing;try{Typing.displayName="Typing",Typing.__docgenInfo={description:"",displayName:"Typing",props:{useDefaultSentences:{defaultValue:{value:"false"},description:"",name:"useDefaultSentences",required:!1,type:{name:"boolean"}},lang:{defaultValue:{value:"en"},description:"",name:"lang",required:!1,type:{name:"enum",value:[{value:'"en"'},{value:'"it"'}]}},sentence:{defaultValue:null,description:"",name:"sentence",required:!1,type:{name:"string"}},sentences:{defaultValue:null,description:"",name:"sentences",required:!1,type:{name:"{ [lang: string]: { text: string; delayAfter: number; }[]; }"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Typing/Typing.tsx#Typing"]={docgenInfo:Typing.__docgenInfo,name:"Typing",path:"src/components/Typing/Typing.tsx#Typing"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/AI.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const AI=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("g",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M0 4a4 4 0 014-4h16a4 4 0 014 4v16a4 4 0 01-4 4H4a4 4 0 01-4-4zm4-2.4A2.4 2.4 0 001.6 4v16A2.4 2.4 0 004 22.4h16a2.4 2.4 0 002.4-2.4V4A2.4 2.4 0 0020 1.6z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M9.715 8.442a.798.798 0 00-1.43 0l-3.2 6.4a.799.799 0 101.431.716l.579-1.158h3.811l.578 1.158a.8.8 0 001.431-.716zm.391 4.358L9 10.589 7.894 12.8z",clipRule:"evenodd"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fillRule:"evenodd",d:"M17 8c.552 0 1 .358 1 .8v6.4c0 .442-.448.8-1 .8s-1-.358-1-.8V8.8c0-.442.448-.8 1-.8z",clipRule:"evenodd"})]})});AI.displayName="AI";const __WEBPACK_DEFAULT_EXPORT__=AI;try{AI.displayName="AI",AI.__docgenInfo={description:"",displayName:"AI",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/AI.tsx#AI"]={docgenInfo:AI.__docgenInfo,name:"AI",path:"src/components/icons/AI.tsx#AI"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Expand.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Expand=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"})});Expand.displayName="Expand";const __WEBPACK_DEFAULT_EXPORT__=Expand;try{Expand.displayName="Expand",Expand.__docgenInfo={description:"",displayName:"Expand",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Expand.tsx#Expand"]={docgenInfo:Expand.__docgenInfo,name:"Expand",path:"src/components/icons/Expand.tsx#Expand"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Feedback.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Feedback=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className,"aria-label":title,children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9-4h2v2h-2zm0-6h2v4h-2z"})]});Feedback.displayName="Feedback";const __WEBPACK_DEFAULT_EXPORT__=Feedback;try{Feedback.displayName="Feedback",Feedback.__docgenInfo={description:"",displayName:"Feedback",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Feedback.tsx#Feedback"]={docgenInfo:Feedback.__docgenInfo,name:"Feedback",path:"src/components/icons/Feedback.tsx#Feedback"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Microphone.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Microphone=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"})});Microphone.displayName="Microphone";const __WEBPACK_DEFAULT_EXPORT__=Microphone;try{Microphone.displayName="Microphone",Microphone.__docgenInfo={description:"",displayName:"Microphone",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Microphone.tsx#Microphone"]={docgenInfo:Microphone.__docgenInfo,name:"Microphone",path:"src/components/icons/Microphone.tsx#Microphone"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Send.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Send=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"})});Send.displayName="Send";const __WEBPACK_DEFAULT_EXPORT__=Send;try{Send.displayName="Send",Send.__docgenInfo={description:"",displayName:"Send",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Send.tsx#Send"]={docgenInfo:Send.__docgenInfo,name:"Send",path:"src/components/icons/Send.tsx#Send"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/User.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const User=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"})});User.displayName="User";const __WEBPACK_DEFAULT_EXPORT__=User;try{User.displayName="User",User.__docgenInfo={description:"",displayName:"User",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/User.tsx#User"]={docgenInfo:User.__docgenInfo,name:"User",path:"src/components/icons/User.tsx#User"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Tooltip.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Tooltip=({content,className,align="right",disabled=!1,visible=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-tooltip",`memori-tooltip--align-${align}`,className,{"memori-tooltip--disabled":disabled,"memori-tooltip--visible":visible}),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--content",children:content}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"memori-tooltip--trigger",children})]});Tooltip.displayName="Tooltip";const __WEBPACK_DEFAULT_EXPORT__=Tooltip;try{Tooltip.displayName="Tooltip",Tooltip.__docgenInfo={description:"",displayName:"Tooltip",props:{content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"Element | ReactNode"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},align:{defaultValue:{value:"right"},description:"",name:"align",required:!1,type:{name:"enum",value:[{value:'"left"'},{value:'"right"'},{value:'"topLeft"'},{value:'"topRight"'}]}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},visible:{defaultValue:{value:"false"},description:"",name:"visible",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Tooltip.tsx#Tooltip"]={docgenInfo:Tooltip.__docgenInfo,name:"Tooltip",path:"src/components/ui/Tooltip.tsx#Tooltip"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/utils.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Dt:()=>isAndroid,Tt:()=>isiOS,bw:()=>cleanUrl,h:()=>stripEmojis,vw:()=>stripDuplicates,xZ:()=>hasTouchscreen});__webpack_require__("./node_modules/react/index.js");const hasTouchscreen=()=>{let hasTouchScreen=!1;if("maxTouchPoints"in navigator)hasTouchScreen=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)hasTouchScreen=navigator.msMaxTouchPoints>0;else{const mQ=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(mQ&&"(pointer:coarse)"===mQ.media)hasTouchScreen=!!mQ.matches;else if("orientation"in window)hasTouchScreen=!0;else{var UA=navigator?.userAgent;hasTouchScreen=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(UA)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(UA)}}return hasTouchScreen},isiOS=()=>{let platform=navigator?.userAgentData?.platform||navigator?.platform||"unknown",userAgent=navigator?.userAgent||"unknown";return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(platform)||userAgent.includes("Mac")&&"ontouchend"in document},isAndroid=()=>"android"===(navigator?.userAgentData?.platform||navigator?.platform||"unknown").toLowerCase()||navigator.userAgent.includes("Android");const stripDuplicates=text=>text.slice(0,text.length/2).trim().toLowerCase()===text.slice(text.length/2+1).trim().toLowerCase()?text.slice(0,text.length/2):text,stripEmojis=text=>text.replaceAll(/[^\p{L}\p{N}\p{P}\p{Z}^$\n]/gu,"").trim();function cleanUrl(href){try{href=encodeURI(href).replace(/%25/g,"%")}catch(e){return null}return href}}}]); \ No newline at end of file diff --git a/2922.7f1d511a.iframe.bundle.js b/2922.9354f8d0.iframe.bundle.js similarity index 95% rename from 2922.7f1d511a.iframe.bundle.js rename to 2922.9354f8d0.iframe.bundle.js index cb9896ba..07740cd4 100644 --- a/2922.7f1d511a.iframe.bundle.js +++ b/2922.9354f8d0.iframe.bundle.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2922],{"./src/components/CustomGLBModelViewer/ModelViewer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ModelViewer=({src,poster,alt=""})=>((0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const script=document.createElement("script");return script.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",script.type="module",document.head.appendChild(script),()=>{document.head.removeChild(script)}}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"model-viewer",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("model-viewer",{src,"ios-src":"",poster,alt,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));ModelViewer.displayName="ModelViewer";const __WEBPACK_DEFAULT_EXPORT__=ModelViewer;try{ModelViewer.displayName="ModelViewer",ModelViewer.__docgenInfo={description:"",displayName:"ModelViewer",props:{src:{defaultValue:null,description:"",name:"src",required:!0,type:{name:"string"}},poster:{defaultValue:null,description:"",name:"poster",required:!0,type:{name:"string"}},alt:{defaultValue:{value:""},description:"",name:"alt",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"]={docgenInfo:ModelViewer.__docgenInfo,name:"ModelViewer",path:"src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/MediaItemWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/helpers/media.ts"),_helpers_translations__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/translations.ts"),_helpers_constants__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/helpers/constants.ts"),_CustomGLBModelViewer_ModelViewer__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/CustomGLBModelViewer/ModelViewer.tsx"),_Snippet_Snippet__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/Snippet/Snippet.tsx"),_ui_Card__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Card.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Modal.tsx"),_icons_File__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/File.tsx"),_icons_FilePdf__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/FilePdf.tsx"),_icons_FileExcel__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/FileExcel.tsx"),_icons_FileWord__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/FileWord.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react/jsx-runtime.js");const RenderMediaItem=({isChild=!1,item,sessionID,tenantID,preview=!1,baseURL,apiURL,onClick,customMediaRenderer})=>{const url=(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({resourceURI:item.url,sessionID,tenantID,baseURL,apiURL}),customRenderer=customMediaRenderer?.(item.mimeType);if(customRenderer)return customRenderer;switch(item.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,onClick:e=>{isChild&&e.preventDefault(),onClick&&(e.preventDefault(),onClick(item.mediumID))},target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("picture",{className:"memori-media-item--figure",children:[!preview&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("source",{srcSet:[url,item.url,item.content].join(", "),type:item.mimeType}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img",{alt:item.title,src:"data:image/png;base64,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"}),item.title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:item.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FileWord__WEBPACK_IMPORTED_MODULE_9__.default,{className:"memori-media-item--icon"}),title:item.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FileExcel__WEBPACK_IMPORTED_MODULE_8__.default,{className:"memori-media-item--icon"}),title:item.title})});case"application/pdf":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FilePdf__WEBPACK_IMPORTED_MODULE_7__.default,{className:"memori-media-item--icon"}),title:item.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,onClick:e=>{isChild&&e.preventDefault(),onClick&&(e.preventDefault(),onClick(item.mediumID))},target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:url,title:item.title}),title:item.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:url}),title:item.title})});case"model/gltf-binary":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CustomGLBModelViewer_ModelViewer__WEBPACK_IMPORTED_MODULE_2__.Z,{src:url,alt:"",poster:"data:image/png;base64,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"});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_File__WEBPACK_IMPORTED_MODULE_6__.default,{className:"memori-media-item--icon"}),title:item.title})})}},MediaItemWidget=({items,sessionID,tenantID,translateTo,baseURL,apiURL,customMediaRenderer})=>{const[media,setMedia]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(items),[openModalMedium,setOpenModalMedium]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),translateMediaCaptions=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((async()=>{if(!translateTo)return;const translatedMedia=await Promise.all((items??[]).map((async media=>{if(!media.title)return media;try{const tTitle=await(0,_helpers_translations__WEBPACK_IMPORTED_MODULE_12__.i)(media.title,translateTo);return{...media,title:tTitle.text??media.title}}catch(e){return console.error(e),media}})));setMedia(translatedMedia)}),[translateTo,items]);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{translateTo&&translateMediaCaptions()}),[translateTo,translateMediaCaptions]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div",{className:"memori-media-items--grid",children:media.filter((m=>!m.properties?.executable&&!_helpers_constants__WEBPACK_IMPORTED_MODULE_1__.JM.map((l=>l.mimeType)).includes(m.mimeType))).sort(((a,b)=>a.creationTimestamp>b.creationTimestamp?1:a.creationTimestamp(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*index,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(RenderMediaItem,{isChild:!0,sessionID,tenantID,baseURL,apiURL,onClick:mediumID=>{setOpenModalMedium(media.find((m=>m.mediumID===mediumID)))},item:{...item,title:item.title,url:item.url,content:item.content},customMediaRenderer})},item.url+"&index="+index)))}),media.filter((m=>!m.properties?.executable&&_helpers_constants__WEBPACK_IMPORTED_MODULE_1__.JM.map((l=>l.mimeType)).includes(m.mimeType))).map((medium=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_Snippet_Snippet__WEBPACK_IMPORTED_MODULE_3__.Z,{medium},medium.mediumID)},medium.mediumID))),media.filter((m=>"text/css"===m.mimeType&&!!m.properties?.executable)).map((medium=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("style",{dangerouslySetInnerHTML:{__html:medium.content||""}},medium.mediumID))),openModalMedium?.mediumID&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_5__.Z,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!openModalMedium,onClose:()=>setOpenModalMedium(void 0),footer:null,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(RenderMediaItem,{isChild:!0,sessionID,tenantID,baseURL,apiURL,item:{...openModalMedium,title:openModalMedium.title,url:openModalMedium.url,content:openModalMedium.content},customMediaRenderer})})]})};MediaItemWidget.displayName="MediaItemWidget";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(MediaItemWidget);try{RenderMediaItem.displayName="RenderMediaItem",RenderMediaItem.__docgenInfo={description:"",displayName:"RenderMediaItem",props:{isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},item:{defaultValue:null,description:"",name:"item",required:!0,type:{name:"Medium"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},baseURL:{defaultValue:null,description:"",name:"baseURL",required:!1,type:{name:"string"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((mediumID: string) => void)"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaItemWidget.tsx#RenderMediaItem"]={docgenInfo:RenderMediaItem.__docgenInfo,name:"RenderMediaItem",path:"src/components/MediaWidget/MediaItemWidget.tsx#RenderMediaItem"})}catch(__react_docgen_typescript_loader_error){}try{MediaItemWidget.displayName="MediaItemWidget",MediaItemWidget.__docgenInfo={description:"",displayName:"MediaItemWidget",props:{items:{defaultValue:null,description:"",name:"items",required:!0,type:{name:"Medium[]"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!1,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},baseURL:{defaultValue:null,description:"",name:"baseURL",required:!1,type:{name:"string"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaItemWidget.tsx#MediaItemWidget"]={docgenInfo:MediaItemWidget.__docgenInfo,name:"MediaItemWidget",path:"src/components/MediaWidget/MediaItemWidget.tsx#MediaItemWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Snippet/Snippet.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Copy__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Copy.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/constants.ts"),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/esm/prism-async-light.js"),react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.js"),react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/tsx.js"),react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/json.js"),react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/scss.js"),react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/bash.js"),react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/python.js"),react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/cpp.js"),react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/php.js"),react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/ruby.js"),react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/sql.js"),react_i18next__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("tsx",react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("json",react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("scss",react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("bash",react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("python",react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("cpp",react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("php",react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("ruby",react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("sql",react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__.Z);const Snippet=({medium,className,preview=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_15__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet--content",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z,{"aria-labelledby":`#snippet-${medium.mediumID}`,className,style:react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__.pJ,showLineNumbers:!0,language:_helpers_constants__WEBPACK_IMPORTED_MODULE_3__.JM.find((l=>medium.mimeType===l.mimeType))?.lang??"text",children:medium.content?.length&&medium.content.length>200&&preview?`${medium.content.slice(0,200)}\n...`:`${medium.content}`}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:t("copy")||"Copy",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Copy__WEBPACK_IMPORTED_MODULE_2__.default,{}),onClick:()=>navigator.clipboard.writeText(medium.content??"")})]}),!!medium.title?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{id:`snippet-${medium.mediumID}`,className:"memori-snippet--caption",children:medium.title})]})};Snippet.displayName="Snippet";const __WEBPACK_DEFAULT_EXPORT__=Snippet;try{Snippet.displayName="Snippet",Snippet.__docgenInfo={description:"",displayName:"Snippet",props:{medium:{defaultValue:null,description:"",name:"medium",required:!0,type:{name:"Medium"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Snippet/Snippet.tsx#Snippet"]={docgenInfo:Snippet.__docgenInfo,name:"Snippet",path:"src/components/Snippet/Snippet.tsx#Snippet"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Close.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Close=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});Close.displayName="Close";const __WEBPACK_DEFAULT_EXPORT__=Close;try{Close.displayName="Close",Close.__docgenInfo={description:"",displayName:"Close",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Close.tsx#Close"]={docgenInfo:Close.__docgenInfo,name:"Close",path:"src/components/icons/Close.tsx#Close"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Copy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Copy=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});Copy.displayName="Copy";const __WEBPACK_DEFAULT_EXPORT__=Copy;try{Copy.displayName="Copy",Copy.__docgenInfo={description:"",displayName:"Copy",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Copy.tsx#Copy"]={docgenInfo:Copy.__docgenInfo,name:"Copy",path:"src/components/icons/Copy.tsx#Copy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/File.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const File=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});File.displayName="File";const __WEBPACK_DEFAULT_EXPORT__=File;try{File.displayName="File",File.__docgenInfo={description:"",displayName:"File",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/File.tsx#File"]={docgenInfo:File.__docgenInfo,name:"File",path:"src/components/icons/File.tsx#File"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FileExcel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FileExcel=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});FileExcel.displayName="FileExcel";const __WEBPACK_DEFAULT_EXPORT__=FileExcel;try{FileExcel.displayName="FileExcel",FileExcel.__docgenInfo={description:"",displayName:"FileExcel",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FileExcel.tsx#FileExcel"]={docgenInfo:FileExcel.__docgenInfo,name:"FileExcel",path:"src/components/icons/FileExcel.tsx#FileExcel"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FilePdf.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FilePdf=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});FilePdf.displayName="FilePdf";const __WEBPACK_DEFAULT_EXPORT__=FilePdf;try{FilePdf.displayName="FilePdf",FilePdf.__docgenInfo={description:"",displayName:"FilePdf",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FilePdf.tsx#FilePdf"]={docgenInfo:FilePdf.__docgenInfo,name:"FilePdf",path:"src/components/icons/FilePdf.tsx#FilePdf"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FileWord.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FileWord=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});FileWord.displayName="FileWord";const __WEBPACK_DEFAULT_EXPORT__=FileWord;try{FileWord.displayName="FileWord",FileWord.__docgenInfo={description:"",displayName:"FileWord",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FileWord.tsx#FileWord"]={docgenInfo:FileWord.__docgenInfo,name:"FileWord",path:"src/components/icons/FileWord.tsx#FileWord"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Card.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_Spin__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Spin.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Card=({loading=!1,className,title,description,cover,hoverable=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-card",className,{"memori-card--loading":loading,"memori-card--with-cover":cover,"memori-card--hoverable":hoverable}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_2__.Z,{spinning:loading,children:[cover&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-card--cover",children:cover}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"memori-card--content",children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("h3",{className:"memori-card--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{className:"memori-card--description",children:description}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-card--children",children})]})]})});Card.displayName="Card";const __WEBPACK_DEFAULT_EXPORT__=Card;try{Card.displayName="Card",Card.__docgenInfo={description:"",displayName:"Card",props:{loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"string"}},cover:{defaultValue:null,description:"",name:"cover",required:!1,type:{name:"Element | ReactNode"}},hoverable:{defaultValue:{value:"false"},description:"",name:"hoverable",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Card.tsx#Card"]={docgenInfo:Card.__docgenInfo,name:"Card",path:"src/components/ui/Card.tsx#Card"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/components/dialog/dialog.js"),_Spin__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Spin.tsx"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Close__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Close.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Modal=({open=!1,onClose,className,title,description,children,footer,loading=!1,closable=!0,width="100%",widthMd="100%"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u,{appear:!0,show:open,as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V,{open,onClose,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-modal",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--backdrop"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--container",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Panel,{className:"memori-modal--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${width};\n --memori-modal--width-md: ${widthMd};\n }\n `}}),closable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--close",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,padded:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Close__WEBPACK_IMPORTED_MODULE_3__.default,{}),title:t("close")||"Close",onClick:()=>onClose(!1)})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_1__.Z,{spinning:loading,children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Title,{className:"memori-modal--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Description,{className:"memori-modal--description",children:description}),children,footer&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--footer",children:footer})]})]})})})})]})})};Modal.displayName="Modal";const __WEBPACK_DEFAULT_EXPORT__=Modal;try{Modal.displayName="Modal",Modal.__docgenInfo={description:"",displayName:"Modal",props:{open:{defaultValue:{value:"false"},description:"",name:"open",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(value: boolean) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"Element | ReactNode"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"Element | ReactNode"}},footer:{defaultValue:null,description:"",name:"footer",required:!1,type:{name:"Element | ReactNode"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},closable:{defaultValue:{value:"true"},description:"",name:"closable",required:!1,type:{name:"boolean"}},width:{defaultValue:{value:"100%"},description:"",name:"width",required:!1,type:{name:"string"}},widthMd:{defaultValue:{value:"100%"},description:"",name:"widthMd",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Modal.tsx#Modal"]={docgenInfo:Modal.__docgenInfo,name:"Modal",path:"src/components/ui/Modal.tsx#Modal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{DZ:()=>boardOfExpertsLoadingSentences,JM:()=>prismSyntaxLangs,QV:()=>anonTag,cG:()=>chatLanguages});const chatLanguages=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],anonTag="👤",prismSyntaxLangs=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],boardOfExpertsLoadingSentences={it:[{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png?v=20231208`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/helpers/translations.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{i:()=>getTranslation});const dialogKeywords=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],getTranslation=async(text,to,from,baseUrl)=>{const fromLanguage=dialogKeywords.indexOf(text.toLowerCase())>-1?"IT":from?.toUpperCase(),deeplResult=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(text)}&target_lang=${to.toUpperCase()}${fromLanguage?`&source_lang=${fromLanguage}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),deeplResponse=await deeplResult.json();return deeplResponse?.translations?.[0]}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[2922],{"./src/components/CustomGLBModelViewer/ModelViewer.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const ModelViewer=({src,poster,alt=""})=>((0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{const script=document.createElement("script");return script.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",script.type="module",document.head.appendChild(script),()=>{document.head.removeChild(script)}}),[]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:"model-viewer",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("model-viewer",{src,"ios-src":"",poster,alt,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})}));ModelViewer.displayName="ModelViewer";const __WEBPACK_DEFAULT_EXPORT__=ModelViewer;try{ModelViewer.displayName="ModelViewer",ModelViewer.__docgenInfo={description:"",displayName:"ModelViewer",props:{src:{defaultValue:null,description:"",name:"src",required:!0,type:{name:"string"}},poster:{defaultValue:null,description:"",name:"poster",required:!0,type:{name:"string"}},alt:{defaultValue:{value:""},description:"",name:"alt",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"]={docgenInfo:ModelViewer.__docgenInfo,name:"ModelViewer",path:"src/components/CustomGLBModelViewer/ModelViewer.tsx#ModelViewer"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/MediaWidget/MediaItemWidget.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_media__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./src/helpers/media.ts"),_helpers_translations__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./src/helpers/translations.ts"),_helpers_constants__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/helpers/constants.ts"),_CustomGLBModelViewer_ModelViewer__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/CustomGLBModelViewer/ModelViewer.tsx"),_Snippet_Snippet__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/Snippet/Snippet.tsx"),_ui_Card__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./src/components/ui/Card.tsx"),_ui_Modal__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./src/components/ui/Modal.tsx"),_icons_File__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./src/components/icons/File.tsx"),_icons_FilePdf__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./src/components/icons/FilePdf.tsx"),_icons_FileExcel__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./src/components/icons/FileExcel.tsx"),_icons_FileWord__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./src/components/icons/FileWord.tsx"),_headlessui_react__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react/jsx-runtime.js");const RenderMediaItem=({isChild=!1,item,sessionID,tenantID,preview=!1,baseURL,apiURL,onClick,customMediaRenderer})=>{const url=(0,_helpers_media__WEBPACK_IMPORTED_MODULE_11__.v)({resourceURI:item.url,sessionID,tenantID,baseURL,apiURL}),customRenderer=customMediaRenderer?.(item.mimeType);if(customRenderer)return customRenderer;switch(item.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,onClick:e=>{isChild&&e.preventDefault(),onClick&&(e.preventDefault(),onClick(item.mediumID))},target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("picture",{className:"memori-media-item--figure",children:[!preview&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("source",{srcSet:[url,item.url,item.content].join(", "),type:item.mimeType}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("img",{alt:item.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),item.title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("figcaption",{className:"memori-media-item--figure-caption",children:item.title})]})})});case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FileWord__WEBPACK_IMPORTED_MODULE_9__.default,{className:"memori-media-item--icon"}),title:item.title})});case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FileExcel__WEBPACK_IMPORTED_MODULE_8__.default,{className:"memori-media-item--icon"}),title:item.title})});case"application/pdf":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_FilePdf__WEBPACK_IMPORTED_MODULE_7__.default,{className:"memori-media-item--icon"}),title:item.title})});case"video/mp4":case"video/avi":case"video/mpeg":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,onClick:e=>{isChild&&e.preventDefault(),onClick&&(e.preventDefault(),onClick(item.mediumID))},target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("video",{style:{width:"100%",height:"100%"},controls:!0,src:url,title:item.title}),title:item.title})});case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("audio",{style:{width:"100%",height:"100%"},controls:!0,src:url}),title:item.title})});case"model/gltf-binary":return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CustomGLBModelViewer_ModelViewer__WEBPACK_IMPORTED_MODULE_2__.Z,{src:url,alt:"",poster:"data:image/png;base64,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"});default:return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("a",{className:"memori-media-item--link",href:url,target:"_blank",rel:"noopener noreferrer",title:item.title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Card__WEBPACK_IMPORTED_MODULE_4__.Z,{hoverable:!0,cover:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_icons_File__WEBPACK_IMPORTED_MODULE_6__.default,{className:"memori-media-item--icon"}),title:item.title})})}},MediaItemWidget=({items,sessionID,tenantID,translateTo,baseURL,apiURL,customMediaRenderer})=>{const[media,setMedia]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(items),[openModalMedium,setOpenModalMedium]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),translateMediaCaptions=(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((async()=>{if(!translateTo)return;const translatedMedia=await Promise.all((items??[]).map((async media=>{if(!media.title)return media;try{const tTitle=await(0,_helpers_translations__WEBPACK_IMPORTED_MODULE_12__.i)(media.title,translateTo);return{...media,title:tTitle.text??media.title}}catch(e){return console.error(e),media}})));setMedia(translatedMedia)}),[translateTo,items]);return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{translateTo&&translateMediaCaptions()}),[translateTo,translateMediaCaptions]),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u,{appear:!0,show:!0,as:"div",className:"memori-media-items",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div",{className:"memori-media-items--grid",children:media.filter((m=>!m.properties?.executable&&!_helpers_constants__WEBPACK_IMPORTED_MODULE_1__.JM.map((l=>l.mimeType)).includes(m.mimeType))).sort(((a,b)=>a.creationTimestamp>b.creationTimestamp?1:a.creationTimestamp(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u.Child,{as:"div",className:"memori-media-item",enter:"ease-out duration-500 delay-"+100*index,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(RenderMediaItem,{isChild:!0,sessionID,tenantID,baseURL,apiURL,onClick:mediumID=>{setOpenModalMedium(media.find((m=>m.mediumID===mediumID)))},item:{...item,title:item.title,url:item.url,content:item.content},customMediaRenderer})},item.url+"&index="+index)))}),media.filter((m=>!m.properties?.executable&&_helpers_constants__WEBPACK_IMPORTED_MODULE_1__.JM.map((l=>l.mimeType)).includes(m.mimeType))).map((medium=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_13__.u.Child,{as:"div",className:"memori-media-item--snippet",enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_Snippet_Snippet__WEBPACK_IMPORTED_MODULE_3__.Z,{medium},medium.mediumID)},medium.mediumID))),media.filter((m=>"text/css"===m.mimeType&&!!m.properties?.executable)).map((medium=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("style",{dangerouslySetInnerHTML:{__html:medium.content||""}},medium.mediumID))),openModalMedium?.mediumID&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_ui_Modal__WEBPACK_IMPORTED_MODULE_5__.Z,{width:"100%",widthMd:"100%",className:"memori-media-item--modal",open:!!openModalMedium,onClose:()=>setOpenModalMedium(void 0),footer:null,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(RenderMediaItem,{isChild:!0,sessionID,tenantID,baseURL,apiURL,item:{...openModalMedium,title:openModalMedium.title,url:openModalMedium.url,content:openModalMedium.content},customMediaRenderer})})]})};MediaItemWidget.displayName="MediaItemWidget";const __WEBPACK_DEFAULT_EXPORT__=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(MediaItemWidget);try{RenderMediaItem.displayName="RenderMediaItem",RenderMediaItem.__docgenInfo={description:"",displayName:"RenderMediaItem",props:{isChild:{defaultValue:{value:"false"},description:"",name:"isChild",required:!1,type:{name:"boolean"}},item:{defaultValue:null,description:"",name:"item",required:!0,type:{name:"Medium"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}},baseURL:{defaultValue:null,description:"",name:"baseURL",required:!1,type:{name:"string"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((mediumID: string) => void)"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaItemWidget.tsx#RenderMediaItem"]={docgenInfo:RenderMediaItem.__docgenInfo,name:"RenderMediaItem",path:"src/components/MediaWidget/MediaItemWidget.tsx#RenderMediaItem"})}catch(__react_docgen_typescript_loader_error){}try{MediaItemWidget.displayName="MediaItemWidget",MediaItemWidget.__docgenInfo={description:"",displayName:"MediaItemWidget",props:{items:{defaultValue:null,description:"",name:"items",required:!0,type:{name:"Medium[]"}},sessionID:{defaultValue:null,description:"",name:"sessionID",required:!1,type:{name:"string"}},tenantID:{defaultValue:null,description:"",name:"tenantID",required:!1,type:{name:"string"}},translateTo:{defaultValue:null,description:"",name:"translateTo",required:!1,type:{name:"string"}},baseURL:{defaultValue:null,description:"",name:"baseURL",required:!1,type:{name:"string"}},apiURL:{defaultValue:null,description:"",name:"apiURL",required:!1,type:{name:"string"}},customMediaRenderer:{defaultValue:null,description:"",name:"customMediaRenderer",required:!1,type:{name:"((mimeType: string) => Element | null)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/MediaWidget/MediaItemWidget.tsx#MediaItemWidget"]={docgenInfo:MediaItemWidget.__docgenInfo,name:"MediaItemWidget",path:"src/components/MediaWidget/MediaItemWidget.tsx#MediaItemWidget"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Snippet/Snippet.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Copy__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Copy.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/constants.ts"),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/esm/prism-async-light.js"),react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.js"),react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/tsx.js"),react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/json.js"),react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/scss.js"),react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/bash.js"),react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/python.js"),react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/cpp.js"),react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/php.js"),react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/ruby.js"),react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/sql.js"),react_i18next__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("tsx",react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("json",react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("scss",react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("bash",react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("python",react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("cpp",react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("php",react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("ruby",react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("sql",react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__.Z);const Snippet=({medium,className,preview=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_15__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet--content",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z,{"aria-labelledby":`#snippet-${medium.mediumID}`,className,style:react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__.pJ,showLineNumbers:!0,language:_helpers_constants__WEBPACK_IMPORTED_MODULE_3__.JM.find((l=>medium.mimeType===l.mimeType))?.lang??"text",children:medium.content?.length&&medium.content.length>200&&preview?`${medium.content.slice(0,200)}\n...`:`${medium.content}`}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:t("copy")||"Copy",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Copy__WEBPACK_IMPORTED_MODULE_2__.default,{}),onClick:()=>navigator.clipboard.writeText(medium.content??"")})]}),!!medium.title?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{id:`snippet-${medium.mediumID}`,className:"memori-snippet--caption",children:medium.title})]})};Snippet.displayName="Snippet";const __WEBPACK_DEFAULT_EXPORT__=Snippet;try{Snippet.displayName="Snippet",Snippet.__docgenInfo={description:"",displayName:"Snippet",props:{medium:{defaultValue:null,description:"",name:"medium",required:!0,type:{name:"Medium"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Snippet/Snippet.tsx#Snippet"]={docgenInfo:Snippet.__docgenInfo,name:"Snippet",path:"src/components/Snippet/Snippet.tsx#Snippet"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Close.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Close=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"})});Close.displayName="Close";const __WEBPACK_DEFAULT_EXPORT__=Close;try{Close.displayName="Close",Close.__docgenInfo={description:"",displayName:"Close",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Close.tsx#Close"]={docgenInfo:Close.__docgenInfo,name:"Close",path:"src/components/icons/Close.tsx#Close"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Copy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Copy=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});Copy.displayName="Copy";const __WEBPACK_DEFAULT_EXPORT__=Copy;try{Copy.displayName="Copy",Copy.__docgenInfo={description:"",displayName:"Copy",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Copy.tsx#Copy"]={docgenInfo:Copy.__docgenInfo,name:"Copy",path:"src/components/icons/Copy.tsx#Copy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/File.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const File=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});File.displayName="File";const __WEBPACK_DEFAULT_EXPORT__=File;try{File.displayName="File",File.__docgenInfo={description:"",displayName:"File",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/File.tsx#File"]={docgenInfo:File.__docgenInfo,name:"File",path:"src/components/icons/File.tsx#File"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FileExcel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FileExcel=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"})});FileExcel.displayName="FileExcel";const __WEBPACK_DEFAULT_EXPORT__=FileExcel;try{FileExcel.displayName="FileExcel",FileExcel.__docgenInfo={description:"",displayName:"FileExcel",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FileExcel.tsx#FileExcel"]={docgenInfo:FileExcel.__docgenInfo,name:"FileExcel",path:"src/components/icons/FileExcel.tsx#FileExcel"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FilePdf.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FilePdf=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"})});FilePdf.displayName="FilePdf";const __WEBPACK_DEFAULT_EXPORT__=FilePdf;try{FilePdf.displayName="FilePdf",FilePdf.__docgenInfo={description:"",displayName:"FilePdf",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FilePdf.tsx#FilePdf"]={docgenInfo:FilePdf.__docgenInfo,name:"FilePdf",path:"src/components/icons/FilePdf.tsx#FilePdf"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/FileWord.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const FileWord=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"})});FileWord.displayName="FileWord";const __WEBPACK_DEFAULT_EXPORT__=FileWord;try{FileWord.displayName="FileWord",FileWord.__docgenInfo={description:"",displayName:"FileWord",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/FileWord.tsx#FileWord"]={docgenInfo:FileWord.__docgenInfo,name:"FileWord",path:"src/components/icons/FileWord.tsx#FileWord"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Card.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_Spin__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Spin.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Card=({loading=!1,className,title,description,cover,hoverable=!1,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-card",className,{"memori-card--loading":loading,"memori-card--with-cover":cover,"memori-card--hoverable":hoverable}),children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_2__.Z,{spinning:loading,children:[cover&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-card--cover",children:cover}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:"memori-card--content",children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("h3",{className:"memori-card--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p",{className:"memori-card--description",children:description}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-card--children",children})]})]})});Card.displayName="Card";const __WEBPACK_DEFAULT_EXPORT__=Card;try{Card.displayName="Card",Card.__docgenInfo={description:"",displayName:"Card",props:{loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"string"}},cover:{defaultValue:null,description:"",name:"cover",required:!1,type:{name:"Element | ReactNode"}},hoverable:{defaultValue:{value:"false"},description:"",name:"hoverable",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Card.tsx#Card"]={docgenInfo:Card.__docgenInfo,name:"Card",path:"src/components/ui/Card.tsx#Card"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Modal.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/@headlessui/react/dist/components/transitions/transition.js"),_headlessui_react__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/@headlessui/react/dist/components/dialog/dialog.js"),_Spin__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Spin.tsx"),_Button__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Close__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/components/icons/Close.tsx"),react_i18next__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),classnames__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Modal=({open=!1,onClose,className,title,description,children,footer,loading=!1,closable=!0,width="100%",widthMd="100%"})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_6__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u,{appear:!0,show:open,as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V,{open,onClose,className:classnames__WEBPACK_IMPORTED_MODULE_4___default()("memori-modal",className),children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--backdrop"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--container",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--container-scrollable",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_7__.u.Child,{as:react__WEBPACK_IMPORTED_MODULE_0__.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Panel,{className:"memori-modal--panel",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${width};\n --memori-modal--width-md: ${widthMd};\n }\n `}}),closable&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--close",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_2__.Z,{ghost:!0,padded:!0,shape:"circle",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_icons_Close__WEBPACK_IMPORTED_MODULE_3__.default,{}),title:t("close")||"Close",onClick:()=>onClose(!1)})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_Spin__WEBPACK_IMPORTED_MODULE_1__.Z,{spinning:loading,children:[title&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Title,{className:"memori-modal--title",children:title}),description&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_headlessui_react__WEBPACK_IMPORTED_MODULE_8__.V.Description,{className:"memori-modal--description",children:description}),children,footer&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div",{className:"memori-modal--footer",children:footer})]})]})})})})]})})};Modal.displayName="Modal";const __WEBPACK_DEFAULT_EXPORT__=Modal;try{Modal.displayName="Modal",Modal.__docgenInfo={description:"",displayName:"Modal",props:{open:{defaultValue:{value:"false"},description:"",name:"open",required:!1,type:{name:"boolean"}},onClose:{defaultValue:null,description:"",name:"onClose",required:!0,type:{name:"(value: boolean) => void"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"Element | ReactNode"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"Element | ReactNode"}},footer:{defaultValue:null,description:"",name:"footer",required:!1,type:{name:"Element | ReactNode"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},closable:{defaultValue:{value:"true"},description:"",name:"closable",required:!1,type:{name:"boolean"}},width:{defaultValue:{value:"100%"},description:"",name:"width",required:!1,type:{name:"string"}},widthMd:{defaultValue:{value:"100%"},description:"",name:"widthMd",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Modal.tsx#Modal"]={docgenInfo:Modal.__docgenInfo,name:"Modal",path:"src/components/ui/Modal.tsx#Modal"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Spin.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Spin=({spinning=!1,primary=!1,className,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div",{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-spin",className,{"memori-spin--spinning":spinning,"memori-spin--primary":primary}),children:[children,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div",{className:"memori-spin--spinner",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})})]});Spin.displayName="Spin";const __WEBPACK_DEFAULT_EXPORT__=Spin;try{Spin.displayName="Spin",Spin.__docgenInfo={description:"",displayName:"Spin",props:{spinning:{defaultValue:{value:"false"},description:"",name:"spinning",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Spin.tsx#Spin"]={docgenInfo:Spin.__docgenInfo,name:"Spin",path:"src/components/ui/Spin.tsx#Spin"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{DZ:()=>boardOfExpertsLoadingSentences,JM:()=>prismSyntaxLangs,QV:()=>anonTag,cG:()=>chatLanguages});const chatLanguages=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],anonTag="👤",prismSyntaxLangs=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],boardOfExpertsLoadingSentences={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]}},"./src/helpers/media.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>getResourceUrl});const getResourceUrl=({type,resourceURI,sessionID,baseURL="",apiURL=""})=>{let defaultUri="cover"===type?`${baseURL}/images/memoriCover.png`:`${baseURL}/images/memoriAvatar.png?v=20231208`;try{return resourceURI&&0!==resourceURI.length?resourceURI.includes("memoriai/memory")&&!resourceURI.includes("memori-ai-session-id")&&sessionID?`${resourceURI}?memori-ai-session-id=${sessionID}`:(resourceURI.startsWith("https://")||resourceURI.startsWith("http://"))&&(new URL(resourceURI).hostname.includes("memori.ai")||new URL(resourceURI).hostname.includes("aclambda.online"))?`${resourceURI}${resourceURI.endsWith("/")||!sessionID?"":"/"}${sessionID||""}`:resourceURI.startsWith("cloud://")?`${apiURL?.replace(/v2/,"v1")||""}/CloudAsset/${resourceURI.replace("cloud://","")}`:resourceURI.startsWith("guid://")?`${apiURL?.replace(/v2/,"v1")||""}/GuidAsset/${resourceURI.replace("guid://","")}`:resourceURI||defaultUri:defaultUri}catch(e){return resourceURI||defaultUri}}},"./src/helpers/translations.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{i:()=>getTranslation});const dialogKeywords=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],getTranslation=async(text,to,from,baseUrl)=>{const fromLanguage=dialogKeywords.indexOf(text.toLowerCase())>-1?"IT":from?.toUpperCase(),deeplResult=await fetch(`${baseUrl||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(text)}&target_lang=${to.toUpperCase()}${fromLanguage?`&source_lang=${fromLanguage}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),deeplResponse=await deeplResult.json();return deeplResponse?.translations?.[0]}}}]); \ No newline at end of file diff --git a/components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js b/components-Snippet-Snippet-stories.545b6adf.iframe.bundle.js similarity index 95% rename from components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js rename to components-Snippet-Snippet-stories.545b6adf.iframe.bundle.js index d4164f3c..752785ee 100644 --- a/components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js +++ b/components-Snippet-Snippet-stories.545b6adf.iframe.bundle.js @@ -1,2 +1,2 @@ -/*! For license information please see components-Snippet-Snippet-stories.3e25aa69.iframe.bundle.js.LICENSE.txt */ -(self.webpackChunk_memori_ai_memori_react=self.webpackChunk_memori_ai_memori_react||[]).push([[9410],{"./src/components/Snippet/Snippet.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Bash:()=>Bash,CSS:()=>CSS,CSharp:()=>CSharp,Default:()=>Default,HTML:()=>HTML,JSON:()=>JSON,JSXReact:()=>JSXReact,JavaScript:()=>JavaScript,PHP:()=>PHP,Preview:()=>Preview,Python:()=>Python,Ruby:()=>Ruby,SQL:()=>SQL,TypeScript:()=>TypeScript,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Snippet_stories});__webpack_require__("./node_modules/react/index.js");var I18nWrapper=__webpack_require__("./src/I18nWrapper.tsx"),Snippet=__webpack_require__("./src/components/Snippet/Snippet.tsx"),constants=__webpack_require__("./src/helpers/constants.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Snippet_Snippet=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Snippet/Snippet.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Snippet_Snippet.Z,options);Snippet_Snippet.Z&&Snippet_Snippet.Z.locals&&Snippet_Snippet.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const SnippetCode="import type { Medium } from 'types';\nimport { prismSyntaxLangs } from 'helpers/constants';\nimport { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { atomDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';\nimport tsx from 'react-syntax-highlighter/dist/cjs/languages/prism/tsx';\nimport scss from 'react-syntax-highlighter/dist/cjs/languages/prism/scss';\nimport bash from 'react-syntax-highlighter/dist/cjs/languages/prism/bash';\nimport python from 'react-syntax-highlighter/dist/cjs/languages/prism/python';\nimport cpp from 'react-syntax-highlighter/dist/cjs/languages/prism/cpp';\n\ninterface Props {\n medium: Medium;\n preview?: boolean;\n}\n\n// These have to match prismSyntaxLangs\nSyntaxHighlighter.registerLanguage('tsx', tsx);\nSyntaxHighlighter.registerLanguage('scss', scss);\nSyntaxHighlighter.registerLanguage('bash', bash);\nSyntaxHighlighter.registerLanguage('python', python);\nSyntaxHighlighter.registerLanguage('cpp', cpp);\n\nconst Snippet = ({ medium, preview = false }: Props) => {\n return (\n \n medium.mimeType === l.mimeType,\n )?.lang ?? 'text'\n }\n >\n {medium.content?.length && medium.content.length > 200 && preview\n ? `${medium.content.slice(0, 200)}\\n...`\n : `${medium.content}`}\n \n );\n};\n\nexport default Snippet;\n",Snippet_stories={title:"Snippet",component:Snippet.Z,argTypes:{mimeType:{control:{type:"select",options:constants.JM.map((l=>l.mimeType))}},content:{control:{type:"text"}},preview:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(I18nWrapper.Z,{children:(0,jsx_runtime.jsx)(Snippet.Z,{...args,medium:{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:args.mimeType,title:"Snippet",content:args.content}})});Template.displayName="Template";const Default=Template.bind({});Default.args={mimeType:"text/plain",content:"Some text",preview:!1};const JavaScript=Template.bind({});JavaScript.args={mimeType:"text/javascript",content:"console.log('Hello World!');",preview:!1};const JSXReact=Template.bind({});JSXReact.args={mimeType:"text/javascript",content:SnippetCode,preview:!1};const Preview=Template.bind({});Preview.args={mimeType:"text/javascript",content:SnippetCode,preview:!0};const CSS=Template.bind({});CSS.args={mimeType:"text/css",content:"body {\n background-color: #f00;\n}",preview:!1};const HTML=Template.bind({});HTML.args={mimeType:"application/xml",content:"\n\n \n Page Title\n \n \n

This is a Heading

\n

This is a paragraph.

\n \n",preview:!1};const TypeScript=Template.bind({});TypeScript.args={mimeType:"text/ecmascript",content:"import type { Medium } from 'types';\n\ninterface Props {\n medium: Medium;\n preview?: boolean;\n}\n\nconst Snippet = ({ medium, preview = false }: Props) => (\n
\n

{medium.content}

\n
\n);\n\nexport default Snippet;\n ",preview:!1};const JSON=Template.bind({});JSON.args={mimeType:"application/json",content:'{\n "name": "John Doe",\n "age": 43,\n "city": "New York",\n "items": [\n {\n "name": "Item 1",\n "price": 10\n },\n {\n "name": "Item 2",\n "price": 20\n }\n ]\n}\n ',preview:!1};const Python=Template.bind({});Python.args={mimeType:"text/x-python",content:"from plone import api\n\ndef get_user():\n return api.user.get_current()\n\ndef get_homepage():\n return api.portal.get_navigation_root(get_user())\n ",preview:!1};const Bash=Template.bind({});Bash.args={mimeType:"application/x-sh",content:'#!/bin/bash\n\necho "Hello World!"\n\nfor i in {1..10}\ndo\n echo $i\ndone\n ',preview:!1};const CSharp=Template.bind({});CSharp.args={mimeType:"text/x-c++src",content:'using System;\n\nnamespace HelloWorld\n{\n class Hello\n {\n static void Main()\n {\n Console.WriteLine("Hello World!");\n Console.WriteLine("Press any key to exit.");\n Console.ReadKey();\n }\n }\n}\n ',preview:!1};const PHP=Template.bind({});PHP.args={mimeType:"application/x-php",content:"$name = 'David';\n$limit = 1;\n// Prepare query\n$stmt = $mysqli->prepare('SELECT age, address FROM students WHERE name = ? LIMIT ?');\n// data types: i = integer, s = string, d = double, b = blog\n$stmt->bind_param('si', $name, $limit);\n// Execute query\n$stmt->execute();\n// Bind the result\n$stmt->bind_result($age, address);\n",preview:!1};const SQL=Template.bind({});SQL.args={mimeType:"text/x-sql",content:"SELECT * FROM table;\n\nSELECT * FROM table WHERE id = 1;\n\nSELECT * FROM table WHERE id = 1 AND name = 'John';\n ",preview:!1};const Ruby=Template.bind({});Ruby.args={mimeType:"text/x-ruby",content:"puts 'Hello World!'\n\nfor i in 1..10\n puts i\nend\n\nputs 'Bye!'\n ",preview:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => \n \n ",...Default.parameters?.docs?.source}}},JavaScript.parameters={...JavaScript.parameters,docs:{...JavaScript.parameters?.docs,source:{originalSource:"args => \n \n ",...JavaScript.parameters?.docs?.source}}},JSXReact.parameters={...JSXReact.parameters,docs:{...JSXReact.parameters?.docs,source:{originalSource:"args => \n \n ",...JSXReact.parameters?.docs?.source}}},Preview.parameters={...Preview.parameters,docs:{...Preview.parameters?.docs,source:{originalSource:"args => \n \n ",...Preview.parameters?.docs?.source}}},CSS.parameters={...CSS.parameters,docs:{...CSS.parameters?.docs,source:{originalSource:"args => \n \n ",...CSS.parameters?.docs?.source}}},HTML.parameters={...HTML.parameters,docs:{...HTML.parameters?.docs,source:{originalSource:"args => \n \n ",...HTML.parameters?.docs?.source}}},TypeScript.parameters={...TypeScript.parameters,docs:{...TypeScript.parameters?.docs,source:{originalSource:"args => \n \n ",...TypeScript.parameters?.docs?.source}}},JSON.parameters={...JSON.parameters,docs:{...JSON.parameters?.docs,source:{originalSource:"args => \n \n ",...JSON.parameters?.docs?.source}}},Python.parameters={...Python.parameters,docs:{...Python.parameters?.docs,source:{originalSource:"args => \n \n ",...Python.parameters?.docs?.source}}},Bash.parameters={...Bash.parameters,docs:{...Bash.parameters?.docs,source:{originalSource:"args => \n \n ",...Bash.parameters?.docs?.source}}},CSharp.parameters={...CSharp.parameters,docs:{...CSharp.parameters?.docs,source:{originalSource:"args => \n \n ",...CSharp.parameters?.docs?.source}}},PHP.parameters={...PHP.parameters,docs:{...PHP.parameters?.docs,source:{originalSource:"args => \n \n ",...PHP.parameters?.docs?.source}}},SQL.parameters={...SQL.parameters,docs:{...SQL.parameters?.docs,source:{originalSource:"args => \n \n ",...SQL.parameters?.docs?.source}}},Ruby.parameters={...Ruby.parameters,docs:{...Ruby.parameters?.docs,source:{originalSource:"args => \n \n ",...Ruby.parameters?.docs?.source}}};const __namedExportsOrder=["Default","JavaScript","JSXReact","Preview","CSS","HTML","TypeScript","JSON","Python","Bash","CSharp","PHP","SQL","Ruby"]},"./src/I18nWrapper.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/I18nextProvider.js"),_i18n__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/i18n.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const I18nWrapper=({children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_i18next__WEBPACK_IMPORTED_MODULE_3__.a,{i18n:_i18n__WEBPACK_IMPORTED_MODULE_1__.Z,children});I18nWrapper.displayName="I18nWrapper";const __WEBPACK_DEFAULT_EXPORT__=I18nWrapper;try{I18nWrapper.displayName="I18nWrapper",I18nWrapper.__docgenInfo={description:"",displayName:"I18nWrapper",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/I18nWrapper.tsx#I18nWrapper"]={docgenInfo:I18nWrapper.__docgenInfo,name:"I18nWrapper",path:"src/I18nWrapper.tsx#I18nWrapper"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Snippet/Snippet.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Copy__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Copy.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/constants.ts"),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/esm/prism-async-light.js"),react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.js"),react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/tsx.js"),react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/json.js"),react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/scss.js"),react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/bash.js"),react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/python.js"),react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/cpp.js"),react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/php.js"),react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/ruby.js"),react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/sql.js"),react_i18next__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("tsx",react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("json",react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("scss",react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("bash",react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("python",react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("cpp",react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("php",react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("ruby",react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("sql",react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__.Z);const Snippet=({medium,className,preview=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_15__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet--content",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z,{"aria-labelledby":`#snippet-${medium.mediumID}`,className,style:react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__.pJ,showLineNumbers:!0,language:_helpers_constants__WEBPACK_IMPORTED_MODULE_3__.JM.find((l=>medium.mimeType===l.mimeType))?.lang??"text",children:medium.content?.length&&medium.content.length>200&&preview?`${medium.content.slice(0,200)}\n...`:`${medium.content}`}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:t("copy")||"Copy",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Copy__WEBPACK_IMPORTED_MODULE_2__.default,{}),onClick:()=>navigator.clipboard.writeText(medium.content??"")})]}),!!medium.title?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{id:`snippet-${medium.mediumID}`,className:"memori-snippet--caption",children:medium.title})]})};Snippet.displayName="Snippet";const __WEBPACK_DEFAULT_EXPORT__=Snippet;try{Snippet.displayName="Snippet",Snippet.__docgenInfo={description:"",displayName:"Snippet",props:{medium:{defaultValue:null,description:"",name:"medium",required:!0,type:{name:"Medium"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Snippet/Snippet.tsx#Snippet"]={docgenInfo:Snippet.__docgenInfo,name:"Snippet",path:"src/components/Snippet/Snippet.tsx#Snippet"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Copy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Copy=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});Copy.displayName="Copy";const __WEBPACK_DEFAULT_EXPORT__=Copy;try{Copy.displayName="Copy",Copy.__docgenInfo={description:"",displayName:"Copy",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Copy.tsx#Copy"]={docgenInfo:Copy.__docgenInfo,name:"Copy",path:"src/components/icons/Copy.tsx#Copy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{DZ:()=>boardOfExpertsLoadingSentences,JM:()=>prismSyntaxLangs,QV:()=>anonTag,cG:()=>chatLanguages});const chatLanguages=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],anonTag="👤",prismSyntaxLangs=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],boardOfExpertsLoadingSentences={it:[{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Bash:()=>Bash,CSS:()=>CSS,CSharp:()=>CSharp,Default:()=>Default,HTML:()=>HTML,JSON:()=>JSON,JSXReact:()=>JSXReact,JavaScript:()=>JavaScript,PHP:()=>PHP,Preview:()=>Preview,Python:()=>Python,Ruby:()=>Ruby,SQL:()=>SQL,TypeScript:()=>TypeScript,__namedExportsOrder:()=>__namedExportsOrder,default:()=>Snippet_stories});__webpack_require__("./node_modules/react/index.js");var I18nWrapper=__webpack_require__("./src/I18nWrapper.tsx"),Snippet=__webpack_require__("./src/components/Snippet/Snippet.tsx"),constants=__webpack_require__("./src/helpers/constants.ts"),injectStylesIntoStyleTag=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),Snippet_Snippet=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/Snippet/Snippet.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(Snippet_Snippet.Z,options);Snippet_Snippet.Z&&Snippet_Snippet.Z.locals&&Snippet_Snippet.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const SnippetCode="import type { Medium } from 'types';\nimport { prismSyntaxLangs } from 'helpers/constants';\nimport { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';\nimport { atomDark } from 'react-syntax-highlighter/dist/cjs/styles/prism';\nimport tsx from 'react-syntax-highlighter/dist/cjs/languages/prism/tsx';\nimport scss from 'react-syntax-highlighter/dist/cjs/languages/prism/scss';\nimport bash from 'react-syntax-highlighter/dist/cjs/languages/prism/bash';\nimport python from 'react-syntax-highlighter/dist/cjs/languages/prism/python';\nimport cpp from 'react-syntax-highlighter/dist/cjs/languages/prism/cpp';\n\ninterface Props {\n medium: Medium;\n preview?: boolean;\n}\n\n// These have to match prismSyntaxLangs\nSyntaxHighlighter.registerLanguage('tsx', tsx);\nSyntaxHighlighter.registerLanguage('scss', scss);\nSyntaxHighlighter.registerLanguage('bash', bash);\nSyntaxHighlighter.registerLanguage('python', python);\nSyntaxHighlighter.registerLanguage('cpp', cpp);\n\nconst Snippet = ({ medium, preview = false }: Props) => {\n return (\n \n medium.mimeType === l.mimeType,\n )?.lang ?? 'text'\n }\n >\n {medium.content?.length && medium.content.length > 200 && preview\n ? `${medium.content.slice(0, 200)}\\n...`\n : `${medium.content}`}\n \n );\n};\n\nexport default Snippet;\n",Snippet_stories={title:"Snippet",component:Snippet.Z,argTypes:{mimeType:{control:{type:"select",options:constants.JM.map((l=>l.mimeType))}},content:{control:{type:"text"}},preview:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},Template=args=>(0,jsx_runtime.jsx)(I18nWrapper.Z,{children:(0,jsx_runtime.jsx)(Snippet.Z,{...args,medium:{mediumID:"95226d7e-7bae-465e-8b80-995587bb5971",mimeType:args.mimeType,title:"Snippet",content:args.content}})});Template.displayName="Template";const Default=Template.bind({});Default.args={mimeType:"text/plain",content:"Some text",preview:!1};const JavaScript=Template.bind({});JavaScript.args={mimeType:"text/javascript",content:"console.log('Hello World!');",preview:!1};const JSXReact=Template.bind({});JSXReact.args={mimeType:"text/javascript",content:SnippetCode,preview:!1};const Preview=Template.bind({});Preview.args={mimeType:"text/javascript",content:SnippetCode,preview:!0};const CSS=Template.bind({});CSS.args={mimeType:"text/css",content:"body {\n background-color: #f00;\n}",preview:!1};const HTML=Template.bind({});HTML.args={mimeType:"application/xml",content:"\n\n \n Page Title\n \n \n

This is a Heading

\n

This is a paragraph.

\n \n",preview:!1};const TypeScript=Template.bind({});TypeScript.args={mimeType:"text/ecmascript",content:"import type { Medium } from 'types';\n\ninterface Props {\n medium: Medium;\n preview?: boolean;\n}\n\nconst Snippet = ({ medium, preview = false }: Props) => (\n
\n

{medium.content}

\n
\n);\n\nexport default Snippet;\n ",preview:!1};const JSON=Template.bind({});JSON.args={mimeType:"application/json",content:'{\n "name": "John Doe",\n "age": 43,\n "city": "New York",\n "items": [\n {\n "name": "Item 1",\n "price": 10\n },\n {\n "name": "Item 2",\n "price": 20\n }\n ]\n}\n ',preview:!1};const Python=Template.bind({});Python.args={mimeType:"text/x-python",content:"from plone import api\n\ndef get_user():\n return api.user.get_current()\n\ndef get_homepage():\n return api.portal.get_navigation_root(get_user())\n ",preview:!1};const Bash=Template.bind({});Bash.args={mimeType:"application/x-sh",content:'#!/bin/bash\n\necho "Hello World!"\n\nfor i in {1..10}\ndo\n echo $i\ndone\n ',preview:!1};const CSharp=Template.bind({});CSharp.args={mimeType:"text/x-c++src",content:'using System;\n\nnamespace HelloWorld\n{\n class Hello\n {\n static void Main()\n {\n Console.WriteLine("Hello World!");\n Console.WriteLine("Press any key to exit.");\n Console.ReadKey();\n }\n }\n}\n ',preview:!1};const PHP=Template.bind({});PHP.args={mimeType:"application/x-php",content:"$name = 'David';\n$limit = 1;\n// Prepare query\n$stmt = $mysqli->prepare('SELECT age, address FROM students WHERE name = ? LIMIT ?');\n// data types: i = integer, s = string, d = double, b = blog\n$stmt->bind_param('si', $name, $limit);\n// Execute query\n$stmt->execute();\n// Bind the result\n$stmt->bind_result($age, address);\n",preview:!1};const SQL=Template.bind({});SQL.args={mimeType:"text/x-sql",content:"SELECT * FROM table;\n\nSELECT * FROM table WHERE id = 1;\n\nSELECT * FROM table WHERE id = 1 AND name = 'John';\n ",preview:!1};const Ruby=Template.bind({});Ruby.args={mimeType:"text/x-ruby",content:"puts 'Hello World!'\n\nfor i in 1..10\n puts i\nend\n\nputs 'Bye!'\n ",preview:!1},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => \n \n ",...Default.parameters?.docs?.source}}},JavaScript.parameters={...JavaScript.parameters,docs:{...JavaScript.parameters?.docs,source:{originalSource:"args => \n \n ",...JavaScript.parameters?.docs?.source}}},JSXReact.parameters={...JSXReact.parameters,docs:{...JSXReact.parameters?.docs,source:{originalSource:"args => \n \n ",...JSXReact.parameters?.docs?.source}}},Preview.parameters={...Preview.parameters,docs:{...Preview.parameters?.docs,source:{originalSource:"args => \n \n ",...Preview.parameters?.docs?.source}}},CSS.parameters={...CSS.parameters,docs:{...CSS.parameters?.docs,source:{originalSource:"args => \n \n ",...CSS.parameters?.docs?.source}}},HTML.parameters={...HTML.parameters,docs:{...HTML.parameters?.docs,source:{originalSource:"args => \n \n ",...HTML.parameters?.docs?.source}}},TypeScript.parameters={...TypeScript.parameters,docs:{...TypeScript.parameters?.docs,source:{originalSource:"args => \n \n ",...TypeScript.parameters?.docs?.source}}},JSON.parameters={...JSON.parameters,docs:{...JSON.parameters?.docs,source:{originalSource:"args => \n \n ",...JSON.parameters?.docs?.source}}},Python.parameters={...Python.parameters,docs:{...Python.parameters?.docs,source:{originalSource:"args => \n \n ",...Python.parameters?.docs?.source}}},Bash.parameters={...Bash.parameters,docs:{...Bash.parameters?.docs,source:{originalSource:"args => \n \n ",...Bash.parameters?.docs?.source}}},CSharp.parameters={...CSharp.parameters,docs:{...CSharp.parameters?.docs,source:{originalSource:"args => \n \n ",...CSharp.parameters?.docs?.source}}},PHP.parameters={...PHP.parameters,docs:{...PHP.parameters?.docs,source:{originalSource:"args => \n \n ",...PHP.parameters?.docs?.source}}},SQL.parameters={...SQL.parameters,docs:{...SQL.parameters?.docs,source:{originalSource:"args => \n \n ",...SQL.parameters?.docs?.source}}},Ruby.parameters={...Ruby.parameters,docs:{...Ruby.parameters?.docs,source:{originalSource:"args => \n \n ",...Ruby.parameters?.docs?.source}}};const __namedExportsOrder=["Default","JavaScript","JSXReact","Preview","CSS","HTML","TypeScript","JSON","Python","Bash","CSharp","PHP","SQL","Ruby"]},"./src/I18nWrapper.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_i18next__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react-i18next/dist/es/I18nextProvider.js"),_i18n__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/i18n.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const I18nWrapper=({children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(react_i18next__WEBPACK_IMPORTED_MODULE_3__.a,{i18n:_i18n__WEBPACK_IMPORTED_MODULE_1__.Z,children});I18nWrapper.displayName="I18nWrapper";const __WEBPACK_DEFAULT_EXPORT__=I18nWrapper;try{I18nWrapper.displayName="I18nWrapper",I18nWrapper.__docgenInfo={description:"",displayName:"I18nWrapper",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/I18nWrapper.tsx#I18nWrapper"]={docgenInfo:I18nWrapper.__docgenInfo,name:"I18nWrapper",path:"src/I18nWrapper.tsx#I18nWrapper"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/Snippet/Snippet.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var _ui_Button__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/components/ui/Button.tsx"),_icons_Copy__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Copy.tsx"),_helpers_constants__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./src/helpers/constants.ts"),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/esm/prism-async-light.js"),react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/styles/prism/index.js"),react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/tsx.js"),react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/json.js"),react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/scss.js"),react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/bash.js"),react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/python.js"),react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/cpp.js"),react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/php.js"),react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/ruby.js"),react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./node_modules/react-syntax-highlighter/dist/cjs/languages/prism/sql.js"),react_i18next__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/react-i18next/dist/es/useTranslation.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/jsx-runtime.js");react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("tsx",react_syntax_highlighter_dist_cjs_languages_prism_tsx__WEBPACK_IMPORTED_MODULE_6__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("json",react_syntax_highlighter_dist_cjs_languages_prism_json__WEBPACK_IMPORTED_MODULE_7__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("scss",react_syntax_highlighter_dist_cjs_languages_prism_scss__WEBPACK_IMPORTED_MODULE_8__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("bash",react_syntax_highlighter_dist_cjs_languages_prism_bash__WEBPACK_IMPORTED_MODULE_9__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("python",react_syntax_highlighter_dist_cjs_languages_prism_python__WEBPACK_IMPORTED_MODULE_10__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("cpp",react_syntax_highlighter_dist_cjs_languages_prism_cpp__WEBPACK_IMPORTED_MODULE_11__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("php",react_syntax_highlighter_dist_cjs_languages_prism_php__WEBPACK_IMPORTED_MODULE_12__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("ruby",react_syntax_highlighter_dist_cjs_languages_prism_ruby__WEBPACK_IMPORTED_MODULE_13__.Z),react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z.registerLanguage("sql",react_syntax_highlighter_dist_cjs_languages_prism_sql__WEBPACK_IMPORTED_MODULE_14__.Z);const Snippet=({medium,className,preview=!1})=>{const{t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_15__.$)();return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div",{className:"memori-snippet--content",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_syntax_highlighter__WEBPACK_IMPORTED_MODULE_5__.Z,{"aria-labelledby":`#snippet-${medium.mediumID}`,className,style:react_syntax_highlighter_dist_cjs_styles_prism__WEBPACK_IMPORTED_MODULE_16__.pJ,showLineNumbers:!0,language:_helpers_constants__WEBPACK_IMPORTED_MODULE_3__.JM.find((l=>medium.mimeType===l.mimeType))?.lang??"text",children:medium.content?.length&&medium.content.length>200&&preview?`${medium.content.slice(0,200)}\n...`:`${medium.content}`}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ui_Button__WEBPACK_IMPORTED_MODULE_1__.Z,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:t("copy")||"Copy",icon:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_icons_Copy__WEBPACK_IMPORTED_MODULE_2__.default,{}),onClick:()=>navigator.clipboard.writeText(medium.content??"")})]}),!!medium.title?.length&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p",{id:`snippet-${medium.mediumID}`,className:"memori-snippet--caption",children:medium.title})]})};Snippet.displayName="Snippet";const __WEBPACK_DEFAULT_EXPORT__=Snippet;try{Snippet.displayName="Snippet",Snippet.__docgenInfo={description:"",displayName:"Snippet",props:{medium:{defaultValue:null,description:"",name:"medium",required:!0,type:{name:"Medium"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},preview:{defaultValue:{value:"false"},description:"",name:"preview",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/Snippet/Snippet.tsx#Snippet"]={docgenInfo:Snippet.__docgenInfo,name:"Snippet",path:"src/components/Snippet/Snippet.tsx#Snippet"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Copy.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Copy=({className,title})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className,"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})});Copy.displayName="Copy";const __WEBPACK_DEFAULT_EXPORT__=Copy;try{Copy.displayName="Copy",Copy.__docgenInfo={description:"",displayName:"Copy",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Copy.tsx#Copy"]={docgenInfo:Copy.__docgenInfo,name:"Copy",path:"src/components/icons/Copy.tsx#Copy"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/icons/Loading.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Loading=({className,title,loading=!0})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("svg",{...title?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,{"memori-loading-icon":loading}),"aria-label":title,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"})});Loading.displayName="Loading";const __WEBPACK_DEFAULT_EXPORT__=Loading;try{Loading.displayName="Loading",Loading.__docgenInfo={description:"",displayName:"Loading",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},loading:{defaultValue:{value:"true"},description:"",name:"loading",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/icons/Loading.tsx#Loading"]={docgenInfo:Loading.__docgenInfo,name:"Loading",path:"src/components/icons/Loading.tsx#Loading"})}catch(__react_docgen_typescript_loader_error){}},"./src/components/ui/Button.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});__webpack_require__("./node_modules/react/index.js");var classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__),_icons_Loading__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/icons/Loading.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");const Button=({primary=!1,outlined=!1,ghost=!1,padded=!0,shape="rounded",danger=!1,loading=!1,disabled=!1,block=!1,icon,className,title,id,htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,children})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("button",{id,type:htmlType,onClick,onMouseDown,onMouseUp,onMouseLeave,onTouchStart,onTouchEnd,title,disabled:loading||disabled,className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("memori-button",{"memori-button--primary":primary,"memori-button--outlined":outlined,"memori-button--ghost":ghost,"memori-button--square":"square"===shape,"memori-button--rounded":"rounded"===shape,"memori-button--circle":"circle"===shape,"memori-button--padded":padded,"memori-button--block":block,"memori-button--with-icon":(icon||loading)&&children,"memori-button--icon-only":(icon||loading)&&!children,"memori-button--danger":danger,"memori-button--loading":loading},className),children:[icon&&!loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon",children:icon}),loading&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span",{className:"memori-button--icon loading-icon",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_icons_Loading__WEBPACK_IMPORTED_MODULE_2__.default,{loading:!0})}),children]});Button.displayName="Button";const __WEBPACK_DEFAULT_EXPORT__=Button;try{Button.displayName="Button",Button.__docgenInfo={description:"",displayName:"Button",props:{primary:{defaultValue:{value:"false"},description:"",name:"primary",required:!1,type:{name:"boolean"}},outlined:{defaultValue:{value:"false"},description:"",name:"outlined",required:!1,type:{name:"boolean"}},ghost:{defaultValue:{value:"false"},description:"",name:"ghost",required:!1,type:{name:"boolean"}},padded:{defaultValue:{value:"true"},description:"",name:"padded",required:!1,type:{name:"boolean"}},block:{defaultValue:{value:"false"},description:"",name:"block",required:!1,type:{name:"boolean"}},icon:{defaultValue:null,description:"",name:"icon",required:!1,type:{name:"ReactNode"}},shape:{defaultValue:{value:"rounded"},description:"",name:"shape",required:!1,type:{name:"enum",value:[{value:'"square"'},{value:'"rounded"'},{value:'"circle"'}]}},danger:{defaultValue:{value:"false"},description:"",name:"danger",required:!1,type:{name:"boolean"}},loading:{defaultValue:{value:"false"},description:"",name:"loading",required:!1,type:{name:"boolean"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},id:{defaultValue:null,description:"",name:"id",required:!1,type:{name:"string"}},htmlType:{defaultValue:null,description:"",name:"htmlType",required:!1,type:{name:"enum",value:[{value:'"button"'},{value:'"submit"'},{value:'"reset"'}]}},onClick:{defaultValue:null,description:"",name:"onClick",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseDown:{defaultValue:null,description:"",name:"onMouseDown",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseUp:{defaultValue:null,description:"",name:"onMouseUp",required:!1,type:{name:"((event: MouseEvent) => void)"}},onMouseLeave:{defaultValue:null,description:"",name:"onMouseLeave",required:!1,type:{name:"((event: MouseEvent) => void)"}},onTouchStart:{defaultValue:null,description:"",name:"onTouchStart",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}},onTouchEnd:{defaultValue:null,description:"",name:"onTouchEnd",required:!1,type:{name:"((event: TouchEvent | MouseEvent) => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/ui/Button.tsx#Button"]={docgenInfo:Button.__docgenInfo,name:"Button",path:"src/components/ui/Button.tsx#Button"})}catch(__react_docgen_typescript_loader_error){}},"./src/helpers/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{DZ:()=>boardOfExpertsLoadingSentences,JM:()=>prismSyntaxLangs,QV:()=>anonTag,cG:()=>chatLanguages});const chatLanguages=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"},{value:"PL",label:"Polski"},{value:"FI",label:"Suomi"}],anonTag="👤",prismSyntaxLangs=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}],boardOfExpertsLoadingSentences={it:[{text:"",delayAfter:10},{text:"Cerco l'esperto più adatto",delayAfter:5},{text:"Contatto l'esperto",delayAfter:3},{text:"Spiego all'esperto la domanda",delayAfter:2},{text:"L'esperto sta preparando una risposta",delayAfter:6},{text:"Genero una risposta adatta",delayAfter:3}],en:[{text:"",delayAfter:10},{text:"I'm looking for the most suitable expert",delayAfter:5},{text:"I'm contacting the expert",delayAfter:3},{text:"I'm explaining the question to the expert",delayAfter:2},{text:"The expert is preparing an answer",delayAfter:6},{text:"I am generating a suitable answer",delayAfter:3}]}},"./node_modules/classnames/index.js":(module,exports)=>{var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";var hasOwn={}.hasOwnProperty;function classNames(){for(var classes=[],i=0;i{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>_slicedToArray});var arrayWithHoles=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");var unsupportedIterableToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js"),nonIterableRest=__webpack_require__("./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");function _slicedToArray(arr,i){return(0,arrayWithHoles.Z)(arr)||function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}(arr,i)||(0,unsupportedIterableToArray.Z)(arr,i)||(0,nonIterableRest.Z)()}},"./src/components/StartPanel/StartPanel.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{BoardOfExpert:()=>BoardOfExpert,Default:()=>Default,Instruct:()=>Instruct,PositionRequired:()=>PositionRequired,WithAllTheBadges:()=>WithAllTheBadges,WithCompletionProviderDown:()=>WithCompletionProviderDown,WithCompletionsEnabled:()=>WithCompletionsEnabled,WithDeepThoughtEnabled:()=>WithDeepThoughtEnabled,WithGamificationLevel:()=>WithGamificationLevel,WithIntegration:()=>WithIntegration,WithNSFWFlag:()=>WithNSFWFlag,__namedExportsOrder:()=>__namedExportsOrder,default:()=>StartPanel_stories});__webpack_require__("./node_modules/react/index.js");var I18nWrapper=__webpack_require__("./src/I18nWrapper.tsx"),data=__webpack_require__("./src/mocks/data.ts"),StartPanel=__webpack_require__("./src/components/StartPanel/StartPanel.tsx"),injectStylesIntoStyleTag=(__webpack_require__("./src/i18n.ts"),__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js")),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),styleDomAPI=__webpack_require__("./node_modules/style-loader/dist/runtime/styleDomAPI.js"),styleDomAPI_default=__webpack_require__.n(styleDomAPI),insertBySelector=__webpack_require__("./node_modules/style-loader/dist/runtime/insertBySelector.js"),insertBySelector_default=__webpack_require__.n(insertBySelector),setAttributesWithoutAttributes=__webpack_require__("./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js"),setAttributesWithoutAttributes_default=__webpack_require__.n(setAttributesWithoutAttributes),insertStyleElement=__webpack_require__("./node_modules/style-loader/dist/runtime/insertStyleElement.js"),insertStyleElement_default=__webpack_require__.n(insertStyleElement),styleTagTransform=__webpack_require__("./node_modules/style-loader/dist/runtime/styleTagTransform.js"),styleTagTransform_default=__webpack_require__.n(styleTagTransform),StartPanel_StartPanel=__webpack_require__("./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[7].use[1]!./src/components/StartPanel/StartPanel.css"),options={};options.styleTagTransform=styleTagTransform_default(),options.setAttributes=setAttributesWithoutAttributes_default(),options.insert=insertBySelector_default().bind(null,"head"),options.domAPI=styleDomAPI_default(),options.insertStyleElement=insertStyleElement_default();injectStylesIntoStyleTag_default()(StartPanel_StartPanel.Z,options);StartPanel_StartPanel.Z&&StartPanel_StartPanel.Z.locals&&StartPanel_StartPanel.Z.locals;var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");const StartPanel_stories={title:"Widget/Start panel",component:StartPanel.Z,argTypes:{showShare:{control:{type:"boolean"}}},parameters:{controls:{expanded:!0}}},integrationConfig={...JSON.parse(data.WM.customData??"{}"),avatarURL:JSON.parse(data.WM.customData??"{}").avatarURL?.split("#")?.[0]+"#"+new Date(Date.now()).getTime()},integrationProperties={"--memori-chat-bubble-bg":"#fff",...integrationConfig?.buttonBgColor?{"--memori-button-bg":integrationConfig.buttonBgColor,"--memori-primary":integrationConfig.buttonBgColor}:{},...integrationConfig?.buttonTextColor?{"--memori-button-text":integrationConfig.buttonTextColor,"--memori-text-color":integrationConfig.buttonTextColor}:{},...integrationConfig?.blurBackground?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...integrationConfig?.innerBgColor?{"--memori-inner-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig.innerBgAlpha??.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===integrationConfig.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${integrationConfig?.innerBgAlpha??.4})`}:{"--memori-inner-content-pad":"0px"}},integrationStylesheet=`\n #root, .memori-widget {\n ${Object.entries(integrationProperties).map((([key,value])=>`${key}: ${value};`)).join("\n")}\n }\n `,Template=args=>(0,jsx_runtime.jsx)(I18nWrapper.Z,{children:(0,jsx_runtime.jsxs)("div",{style:{maxWidth:"600px",margin:"auto"},children:[args.integrationConfig&&(0,jsx_runtime.jsx)("style",{dangerouslySetInnerHTML:{__html:integrationStylesheet}}),(0,jsx_runtime.jsx)(StartPanel.Z,{...args})]})});Template.displayName="Template";const Default=Template.bind({});Default.args={memori:{...data.jF,enableCompletions:!1},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithGamificationLevel=Template.bind({});WithGamificationLevel.args={memori:{...data.jF,enableCompletions:!1},tenant:data.cm,gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithCompletionsEnabled=Template.bind({});WithCompletionsEnabled.args={memori:{...data.jF,enableCompletions:!0},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithNSFWFlag=Template.bind({});WithNSFWFlag.args={memori:{...data.jF,nsfw:!0,enableCompletions:!1},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithAllTheBadges=Template.bind({});WithAllTheBadges.args={memori:{...data.jF,enableCompletions:!0,nsfw:!0},gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithDeepThoughtEnabled=Template.bind({});WithDeepThoughtEnabled.args={memori:{...data.jF,enableDeepThought:!0},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{},isUserLoggedIn:!0};const BoardOfExpert=Template.bind({});BoardOfExpert.args={memori:{...data.jF,enableBoardOfExperts:!0,enableCompletions:!0},gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const Instruct=Template.bind({});Instruct.args={memori:data.jF,tenant:data.cm,gamificationLevel:{points:61,pointsForCurrentBadge:60,badge:"🌍"},language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!0,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const PositionRequired=Template.bind({});PositionRequired.args={memori:{...data.jF,needsPosition:!0},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!0,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithIntegration=Template.bind({});WithIntegration.args={memori:data.jF,tenant:data.cm,integrationConfig,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{}};const WithCompletionProviderDown=Template.bind({});WithCompletionProviderDown.args={memori:{...data.jF,enableCompletions:!1,completionProvider:"OpenAI"},tenant:data.cm,language:"it",userLang:"en",setUserLang:()=>{},openPositionDrawer:()=>{},instruct:!1,sessionId:data.M9,clickedStart:!1,onClickStart:()=>{},_TEST_forceProviderStatus:"major"},Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"args => \n
\n {args.integrationConfig &&