({\n identityUrl: '',\n apiUrl: '',\n tenant: '',\n graphqlUrl: '',\n appUrl: '',\n orgId: '',\n deploymentId: '',\n queue: '',\n firstName: '',\n lastName: '',\n email: '',\n customerId: -1,\n dataURL: '',\n title: '',\n scriptPath: 'https://apps.mypurecloud.de/widgets/9.0/cxbus.min.js',\n pluginsPath: 'https://apps.mypurecloud.de/widgets/9.0/plugins/',\n language: 'en',\n consultantNumber: 0,\n phoneNumber: '',\n buttonLabel: '',\n dedicatedPage: false,\n maxMessageLength: 500,\n});\n\nexport const ConfigurationProvider = configurationContext.Provider;\n\nexport const useConfiguration = () => useContext(configurationContext);\n","\n import API from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./style.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[2].use[1]!../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./style.css\";\n export default content && content.locals ? content.locals : undefined;\n","import type { AppConfiguration, WebChatForms, FormValidator } from '../types';\nimport type { WebChatFormJSON } from '../types/WebChatFormJSON';\n\nconst requiredValidator =\n (customerId: number): FormValidator =>\n (_, __, input) =>\n customerId > 0 ? true : !!input?.val();\n\nexport const getWebChatForms = (\n { firstName: firstname, lastName: lastname, email, customerId }: AppConfiguration,\n customForm = true,\n): WebChatForms => {\n const formJSON = {\n wrapper: '',\n inputs: [\n {\n id: 'cx_webchat_form_firstname',\n name: 'firstname',\n maxlength: '100',\n placeholder: '@i18n:webchat.ChatFormPlaceholderFirstName',\n label: '@i18n:webchat.ChatFormFirstName',\n validate: requiredValidator(customerId),\n },\n {\n id: 'cx_webchat_form_lastname',\n name: 'lastname',\n maxlength: '100',\n placeholder: '@i18n:webchat.ChatFormPlaceholderLastName',\n label: '@i18n:webchat.ChatFormLastName',\n validate: requiredValidator(customerId),\n },\n {\n id: 'cx_webchat_form_email',\n name: 'email',\n maxlength: '100',\n placeholder: '@i18n:webchat.ChatFormPlaceholderEmail',\n label: '@i18n:webchat.ChatFormEmail',\n },\n ],\n };\n\n return {\n form: {\n autoSubmit: customerId > 0,\n firstname,\n lastname,\n email,\n subject: 'general questions',\n },\n formJSON: (customForm ? formJSON : {}) as WebChatFormJSON,\n };\n};\n","import type { IninServer } from '../types';\n\nexport class GenesysServerProxy implements IninServer {\n // this method used to transfer history from chatbot to genesys-widget\n sendMessage(message: string, isHtml?: boolean): void {\n let text = this.HTML2String(message);\n text = this.RemoveCommands(text);\n text = this.RemoveUrl(text);\n // get only the latest 1000 characters\n text = text.slice(0, 1000);\n window.ori?.genesysPlugin.command('WebChatService.sendMessage', { message: text });\n }\n\n private HTML2String(html: string): string {\n const text = html.replace(/ void,\n setButtonVisibility: (value: boolean) => void,\n) => {\n const ininChat = window.ori?.ininChat;\n\n debug('existing ininchat', ininChat);\n\n const instance = {\n elementId: 'genesys-widget-root',\n events: {\n ...ininChatEvents,\n subscribe: (eventType: string, handler: IninChatSubscribeHandler) => {\n debug(`subscribe to ${eventType}`);\n instance.events.handlers[eventType] = handler;\n },\n unsubscribe: (eventType: string) => {\n debug(`unsubscribe from ${eventType}`);\n delete instance.events.handlers[eventType];\n },\n handlers: {},\n },\n server: new GenesysServerProxy(),\n iFrame: {\n load: handleOpenChat,\n },\n toggleVisibility: (value?: boolean) => {\n debug(`toggle visibility ${value ? 'on' : 'off'}`);\n\n if (value) {\n if (window.ori?.genesysPlugin) {\n window.ori?.genesysPlugin.command('WebChat.show');\n }\n setButtonVisibility(true);\n } else {\n if (window.ori?.genesysPlugin) {\n window.ori?.genesysPlugin.command('WebChat.hide');\n }\n setButtonVisibility(false);\n }\n },\n triggerEvent: (eventType: string, ...params) => {\n debug(`trigger event ${eventType}`, params);\n instance.events.handlers[eventType]?.(params);\n },\n handleClose: () => {\n debug('handle close');\n instance.triggerEvent(instance.events.CLOSE);\n },\n openChatWindow: () => {},\n getChatId: () => '',\n clearUserData: () => {},\n toggle: () => {},\n };\n\n return instance;\n};\n","export const fixAndroidKeyboard = () => {\n const inputClass = 'cx-message-input';\n const chatContainerClass = 'cx-docked-WebChat';\n const inputElement = document.getElementsByClassName(inputClass).length\n ? document.getElementsByClassName(inputClass)[0]\n : undefined;\n const chatContainer = document.getElementsByClassName(chatContainerClass).length\n ? (document.getElementsByClassName(chatContainerClass) as HTMLCollectionOf)[0]\n : undefined;\n\n chatContainer?.classList.add('keyboard-opened');\n\n const isInputClicked = (target) =>\n target === inputElement ||\n (target.nodeName === 'svg' && target.namespaceURI === 'http://www.w3.org/2000/svg') ||\n (target.nodeName === 'path' && target.classList.contains('cx-svg-icon-tone1'));\n\n const toggleHeight = (event) => {\n const isClickedOnInput = isInputClicked(event.target);\n if (isClickedOnInput && !chatContainer?.classList.contains('keyboard-opened')) {\n chatContainer?.classList.add('keyboard-opened');\n }\n if (!isClickedOnInput && chatContainer?.classList.contains('keyboard-opened')) {\n chatContainer?.classList.remove('keyboard-opened');\n }\n };\n if (inputElement) {\n document.addEventListener('click', (event) => toggleHeight(event));\n }\n};\n","/* eslint-disable unicorn/prefer-dom-node-dataset -- Rule is stupid*/\nimport { BubbleHelpFilled } from '@ori-ui/icons';\nimport { SHADOW_LEVEL1, styled } from '@ori-ui/mui';\nimport d from 'debug';\nimport type { FC } from 'react';\nimport { useState, useEffect } from 'react';\n\n// eslint-disable-next-line import/order -- Rule has clashes\nimport { useConfiguration } from '../../contexts';\n\nimport './style.css';\n\nimport type {\n AppConfiguration,\n EngageInviteSettings,\n WebChatServiceStartedEvent,\n} from '../../types';\nimport {\n getWebChatForms,\n getGenesysSettings,\n getIninChat,\n fixAndroidKeyboard,\n ininChatEvents,\n} from '../../utils';\n\nconst Label = styled('div')({\n display: 'block',\n fontWeight: 700,\n opacity: 0,\n paddingRight: '20px',\n transition: 'opacity 0.3s ease-in-out',\n});\n\nconst Button = styled('div')`\n -webkit-box-sizing: border-box;\n -webkit-transition: -webkit-box-shadow .15s, -webkit-transform .15s;\n align-items: center;\n background: ${({ theme }) => theme.palette.secondary.main};\n border-radius: 999px;\n border: 2px solid ${({ theme }) => theme.palette.secondary.main};\n bottom: 10px;\n box-sizing: border-box;\n color: ${({ theme }) => theme.palette.secondary.contrastText};\n cursor: pointer;\n direction: rtl;\n display: flex;\n flex-direction: row;\n height: 45px;\n line-height: 43px;\n max-width: 45px;\n overflow: hidden;\n padding-left: ${({ theme }) => theme.spacing(4)};\n padding-right: 6px;\n padding-top: 1px;\n position: fixed;\n right: 10px;\n text-align: center;\n text-overflow: ellipsis;\n text-transform: uppercase;\n transition: -webkit-box-shadow .15s, -webkit-transform .15s;\n transition: box-shadow .15s, transform .15s, -webkit-box-shadow .15s, -webkit-transform .15s\n transition: box-shadow .15s, transform .15s;\n transition: max-width 0.3s ease-in-out 0.2s;\n vertical-align: middle;\n white-space: nowrap;\n width: auto;\n z-index: 100;\n\n @media screen and (min-width: 1025px) {\n right: 45px;\n }\n\n &:focus,\n &:hover {\n -ms-transform: scale(1.01);\n -webkit-box-shadow: ${SHADOW_LEVEL1};\n -webkit-transform: scale(1.01);\n box-shadow: ${SHADOW_LEVEL1};\n max-width: 250px;\n transform: scale(1.01);\n transition-delay: 0s;\n\n .genesys-widget-label {\n opacity: 1;\n transition-delay: 0.2s;\n }\n }\n`;\n\nconst Icon = styled(BubbleHelpFilled)({\n display: 'flex',\n height: '30px',\n width: '30px',\n});\n\nconst debug = d('genesys-widget:chat-button');\n\nconst publishDataLayerEvent = (event: string) => {\n debug(`publish data layer ${event}`);\n\n window.dataLayer = window.dataLayer || [];\n\n window.dataLayer.push({ event });\n};\n\nconst SESSION_STORE_CONVERSATION_ID_KEY = 'ininChatId';\n\nconst handleWebChatServiceReady = () => {\n debug('webchat service ready');\n\n window.ori?.ininChat?.triggerEvent(ininChatEvents.READY);\n};\n\nconst iframeStyle = {\n width: 0,\n height: 0,\n};\n\nexport const ChatButton: FC = (props) => {\n const [showButton, setShowButton] = useState(null);\n const [isMinimized, setIsMinimized] = useState(false);\n const [sessionStarted, setSessionStarted] = useState(false);\n const [chatWindowOpened, setChatWindowOpened] = useState(false);\n const htmlContainer: HTMLElement | null = document.querySelector('.k-mobile');\n const { buttonLabel, customerId, isChatOpenedByDefault } = props;\n const { maxMessageLength } = useConfiguration();\n\n const handleOpenChat = () => {\n if (chatWindowOpened) {\n debug('reopen chat');\n\n window.ori?.genesysPlugin.command('WebChat.show');\n window.ori?.genesysPlugin.command('WebChat.minimize');\n\n return;\n }\n\n debug('open chat for the first time');\n\n window.ori?.genesysPlugin.command('WebChat.open', getWebChatForms(props));\n };\n\n const handleWebChatOpened = () => {\n debug('webchat opened');\n\n setChatWindowOpened(true);\n setShowButton(false);\n\n if (htmlContainer && htmlContainer.style.overflow !== 'hidden') {\n htmlContainer.style.overflow = 'hidden';\n }\n\n // if (bodyElement && bodyElement.style.overflow !== 'hidden') {\n // bodyElement.style.overflow = 'hidden';\n // }\n\n // attach event to change transcript height if input elemet is focused\n if (/android/i.test(navigator.userAgent)) {\n fixAndroidKeyboard();\n }\n };\n\n const handleWebChatMinimized = () => {\n debug('webchat minimized');\n\n if (htmlContainer && htmlContainer.style.overflow === 'hidden') {\n htmlContainer.style.overflow = 'inherit';\n }\n\n // if (bodyElement && bodyElement.style.overflow === 'hidden') {\n // bodyElement.style.overflow = 'inherit';\n // }\n\n window.ori?.genesysPlugin.command('WebChat.hide');\n setShowButton(true);\n setIsMinimized(true);\n };\n\n const handleWebChatClosed = () => {\n debug('webchat closed');\n\n // window.ori?.genesysPlugin.command('WebChat.minimize');\n\n if (htmlContainer && htmlContainer.style.overflow === 'hidden') {\n htmlContainer.style.overflow = 'inherit';\n }\n\n // if (bodyElement && bodyElement.style.overflow === 'hidden') {\n // bodyElement.style.overflow = 'inherit';\n // }\n\n setChatWindowOpened(false);\n setShowButton(true);\n\n setIsMinimized(false);\n\n if (!sessionStarted) {\n window.ori?.ininChat?.handleClose();\n }\n };\n\n const handleWebChatServiceStarted = (event: WebChatServiceStartedEvent) => {\n debug('webchat service started', event);\n\n // Setting this for the bot chat to be able to switch to genesys widget automatically\n sessionStorage.setItem(SESSION_STORE_CONVERSATION_ID_KEY, event.data.data.conversationId);\n window.ori?.ininChat?.triggerEvent(ininChatEvents.READY);\n\n setSessionStarted(true);\n };\n\n const handleWebChatServiceClientConnected = () => {\n debug('webchat service client connected');\n };\n\n const handleWebChatServiceEnded = () => {\n debug('webchat service ended');\n\n if (htmlContainer && htmlContainer.style.overflow === 'hidden') {\n htmlContainer.style.overflow = 'inherit';\n }\n\n // if (bodyElement && bodyElement.style.overflow === 'hidden') {\n // bodyElement.style.overflow = 'inherit';\n // }\n\n setSessionStarted(false);\n setShowButton(true);\n\n // Remove conversation id so the botchat will activate\n sessionStorage.removeItem(SESSION_STORE_CONVERSATION_ID_KEY);\n };\n\n // Configure localization and optionally bypass form for logged in users\n const handleEngageInvite = (settings: EngageInviteSettings) => {\n debug('engage invite', settings);\n\n try {\n const formsConfig = getWebChatForms(props, false);\n\n settings.options = { ...settings.options, ...formsConfig };\n\n return settings;\n } catch (error) {\n return settings;\n }\n };\n\n const handleInputChange = () => {\n const textArea = document.getElementById('cx_input') as HTMLTextAreaElement | null | undefined;\n const svg = document.querySelector('.cx-send.cx-icon') as HTMLElement | null | undefined;\n if (textArea && svg) {\n const { value } = textArea;\n textArea.setAttribute('data-messagelength', `${value.length}/${maxMessageLength}`);\n svg.setAttribute('data-messagelength', `${(maxMessageLength ?? 140) - value.length}`);\n }\n };\n\n useEffect(() => {\n if (isChatOpenedByDefault) {\n setTimeout(handleOpenChat, 500);\n }\n }, [isChatOpenedByDefault]);\n\n useEffect(\n () => {\n // Check if session exists\n const sessionId = sessionStorage.getItem(SESSION_STORE_CONVERSATION_ID_KEY);\n\n if (sessionId) {\n setSessionStarted(true);\n }\n },\n [\n /* only check on mount */\n ],\n );\n\n // add script from genesys to inject widget to page\n useEffect(() => {\n if (/android/i.test(navigator.userAgent)) {\n document.body.classList.add('device_android');\n }\n\n if (window.ori) {\n window.ori.ininChat = getIninChat(handleOpenChat, setShowButton);\n }\n\n const { scriptPath, pluginsPath, dedicatedPage } = props;\n const script = document.createElement('script');\n\n script.src = scriptPath;\n script.defer = true;\n\n script.addEventListener('load', () => {\n if (!window.ori) {\n window.ori = { genesysPlugin: {} };\n }\n\n const { ori } = window;\n\n // Configure widgets BUS\n // docs: https://all.docs.genesys.com/WID/Current/SDK/GWCBusAPIOverview\n window.CXBus.configure({ debug: false, pluginsPath });\n window.CXBus.loadPlugin('widgets-core');\n window._genesys = getGenesysSettings(props);\n\n // Register custom plugin to handle webchat/engage events\n ori.genesysPlugin = window.CXBus.registerPlugin('OnlineGenesysPlugin');\n\n // Skip chat form for logged in users for PE invitations\n // docs: https://docs.genesys.com/Documentation/GWC/latest/WidgetsAPI/EngagementCommands\n if (customerId > 0) {\n ori.genesysPlugin.before('Engage.invite', handleEngageInvite);\n }\n\n // Register WebChatService event handlers\n // docs: https://docs.genesys.com/Documentation/GWC/latest/WidgetsAPI/WebChatServiceEvents\n // WebChatService is initialized and ready to accept commands.\n ori.genesysPlugin.subscribe('WebChatService.ready', handleWebChatServiceReady);\n\n // Chat session has successfully started.\n ori.genesysPlugin.subscribe('WebChatService.started', handleWebChatServiceStarted);\n\n // Indicates the user has been connected to the chat session.\n ori.genesysPlugin.subscribe(\n 'WebChatService.clientConnected',\n handleWebChatServiceClientConnected,\n );\n\n // Chat session has successfully ended.\n ori.genesysPlugin.subscribe('WebChatService.ended', handleWebChatServiceEnded);\n\n // Register WebChatService event handlers\n // docs: https://docs.genesys.com/Documentation/GWC/latest/WidgetsAPI/WebChatEvents\n // The WebChat widget has appeared on screen.\n ori.genesysPlugin.subscribe('WebChat.opened', handleWebChatOpened);\n\n // The WebChat widget has been removed from the screen.\n ori.genesysPlugin.subscribe('WebChat.closed', handleWebChatClosed);\n\n // The WebChat widget has been changed to a minimized state.\n ori.genesysPlugin.subscribe('WebChat.minimized', handleWebChatMinimized);\n\n // When the webchat service is loaded we publish an event to the dataLayer\n // this should trigger initialization of the Predictive engagement from the GTM\n publishDataLayerEvent('genesysWidgetStart');\n\n // autostart chat\n if (dedicatedPage) {\n setTimeout(handleOpenChat, 2000);\n }\n });\n\n document.addEventListener('keyup', handleInputChange);\n\n document.body.append(script);\n\n return () => script.remove();\n }, []);\n\n return showButton || showButton == null ? (\n <>\n \n \n >\n ) : null;\n};\n","import type { AppConfiguration, GenesysSettings } from '../types';\n\nexport const getGenesysSettings = ({\n appUrl,\n orgId,\n deploymentId,\n queue,\n customerId,\n title,\n dataURL,\n consultantNumber,\n phoneNumber,\n language,\n tenant,\n maxMessageLength,\n}: AppConfiguration): GenesysSettings => {\n const i18nUrl = new URL(appUrl);\n\n return {\n widgets: {\n main: {\n theme: 'light',\n downloadGoogleFont: false,\n lang: language,\n i18n: `${i18nUrl.origin}/static${i18nUrl.pathname}assets/widgets-${language}.i18n.json`,\n webchat: {\n maxMessageLength,\n },\n },\n webchat: {\n maxMessageLength,\n transport: {\n type: 'purecloud-v2-sockets',\n dataURL,\n deploymentKey: deploymentId,\n orgGuid: orgId,\n interactionData: {\n routing: {\n targetType: 'QUEUE',\n targetAddress: queue,\n priority: 2,\n },\n },\n },\n markdown: true,\n userData: {\n customerId: customerId === -1 ? undefined : customerId,\n phoneNumber,\n customField1Label: 'Customer Title',\n customField1: customerId === -1 ? 'Anonymous' : title,\n customField2Label: consultantNumber === 0 ? undefined : 'Consultant Number',\n customField2: consultantNumber === 0 ? undefined : consultantNumber,\n customField3Label: language ? 'Language Code' : undefined,\n customField3: language?.toUpperCase(),\n customField4Label: tenant ? 'Market Code' : undefined,\n customField4: tenant?.toUpperCase(),\n },\n confirmFormCloseEnabled: false,\n },\n },\n };\n};\n","import { Component } from 'react';\n\ninterface ErrorBoundaryProps {\n children: JSX.Element;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nexport class ErrorBoundary extends Component {\n readonly state: ErrorBoundaryState = {};\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n render() {\n const { error } = this.state;\n\n if (error) {\n return (\n \n
Ooops... error found :(
\n
{error.message}
\n
\n );\n }\n\n const { children } = this.props;\n\n return children;\n }\n}\n","import { ThemeProvider } from '@ori-ui/mui';\nimport { TestIdProvider } from '@ori/testid-generator';\nimport type { VFC } from 'react';\nimport { Suspense, useEffect, useState } from 'react';\n\nimport { Loading, ChatButton, ErrorBoundary } from './components';\nimport { ConfigurationProvider } from './contexts';\nimport { arabicStylesComplete, arabicStylesBack } from './styles/arabicStyles';\nimport type { AppConfiguration } from './types';\n\ninterface AppProps {\n configuration: AppConfiguration;\n}\n\nexport const App: VFC = ({ configuration }) => {\n const { tenant, language } = configuration;\n const languageTenant = `${language}-${tenant.toLocaleUpperCase()}`;\n const [openedByDefault, setOpenedByDefault] = useState(false);\n\n useEffect(() => {\n if (languageTenant === 'ar-EG') {\n const style = document.createElement('style');\n style.innerHTML = arabicStylesComplete;\n document.head.append(style);\n }\n\n if (languageTenant === 'fr-MA' || languageTenant === 'en-EG') {\n const style = document.createElement('style');\n style.innerHTML = arabicStylesBack;\n\n document.head.append(style);\n }\n\n const urlSearchParams = new URLSearchParams(window.location.search);\n\n for (const param of urlSearchParams) {\n if (param[0] === 'openChat' && param[1] === 'true') {\n setOpenedByDefault(true);\n }\n }\n }, []);\n\n return (\n \n }>\n \n \n \n \n \n \n \n \n \n );\n};\n","export const arabicStylesBack = `\n.cx-message-text ul,\n.cx-message-text p {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group > .cx-message {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-bubble-arrow,\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-name {\n direction: rtl !important;\n text-align: right !important;\n}\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:last-child .cx-time {\n text-align: right !important;\n}\n\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text ul,\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text ol\n{\n padding-right: 15px !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group > .cx-message .cx-time {\n direction: ltr !important;\n}\n`;\n\nexport const arabicStylesComplete = `\n.cx-message-text ul,\n.cx-message-text p {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-form-inputs {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-form table th {\n padding-right: 0 !important;\n padding-left: 8px !important;\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group > .cx-message {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-bubble-arrow,\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:first-child .cx-name {\n direction: rtl !important;\n text-align: right important;\n}\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text {\n direction: rtl !important;\n text-align: right !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group>.cx-message.cx-participant:last-child .cx-time {\n text-align: right !important;\n}\n\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text ul,\n.cx-widget.cx-theme-light .cx-message .cx-bubble .cx-message-text ol\n{\n padding-right: 15px !important;\n}\n\n.cx-message-input.cx-input.i18n.cx-form-control {\n direction: rtl !important;\n text-align: right !important;\n padding-right: 0px !important;\n padding-left: 50px !important;\n}\n\n.cx-webchat .cx-send {\n left: 0 !important;\n transform: translateX(10px) !important;\n}\n\n.cx-webchat .cx-transcript .cx-message-group > .cx-message .cx-time {\n direction: ltr !important;\n text-align: right !important;\n}\n`;\n","import { OidcUrlHelper } from '@ori/auth';\nimport ReactDOM from 'react-dom';\n\nimport { App } from './App';\nimport type { AppConfiguration } from './types';\n\n// eslint-disable-next-line complexity -- nevermind\nexport const render = (rootElement: HTMLElement): void => {\n // extract token from URL; only on dev machine, not needed elsewhere\n if (__DEV__) {\n const searchParams = new URLSearchParams(window.location.hash.split('?')[1]);\n\n if (searchParams.has('state')) {\n const oidcUrlHelper = new OidcUrlHelper();\n\n oidcUrlHelper.storeTokenFromParams(searchParams);\n }\n }\n\n const settings = JSON.parse(rootElement.dataset.settings ?? '{}');\n const configuration: AppConfiguration = {\n apiUrl: rootElement.dataset.apiUrl ?? '',\n graphqlUrl: `${rootElement.dataset.graphqlUrl ?? ''}graphql`,\n identityUrl: rootElement.dataset.identityUrl ?? '',\n appUrl: rootElement.dataset.appUrl ?? '',\n tenant: rootElement.dataset.tenant ?? '',\n orgId: settings.OrganizationId ?? '',\n deploymentId: settings.DeploymentId ?? '',\n dataURL: settings.DataURL ?? '',\n queue: settings.Queue ?? '',\n firstName: settings.FirstName ?? '',\n lastName: settings.LastName ?? '',\n email: settings.Email ?? '',\n customerId: Number.parseInt(rootElement.dataset.customerId ?? '-1', 10),\n scriptPath: settings.ScriptURL ?? '',\n pluginsPath: settings.PluginsPath ?? '',\n title: settings.Title ?? '',\n consultantNumber: Number.parseInt(settings.ConsultantNumber ?? 0, 10),\n phoneNumber: settings.PhoneNumber,\n language: settings.Language ?? 'pl',\n buttonLabel: settings.ButtonLabel ?? 'Chat with us',\n dedicatedPage: !!settings.DedicatedPage,\n maxMessageLength: 500,\n };\n\n if (configuration.dedicatedPage) {\n // @ts-expect-error\n import('./styles/theme-ori-dedicated.less');\n } else {\n // @ts-expect-error\n import('./styles/theme-ori-light.less');\n }\n ReactDOM.render(, rootElement);\n};\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".is--minimized {\\n background: #fff;\\n color: #000;\\n border-color: #ccc;\\n}\\n\\n.is--minimized path {\\n fill: #000;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/ChatButton/style.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,gBAAgB;EAChB,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,UAAU;AACZ\",\"sourcesContent\":[\".is--minimized {\\n background: #fff;\\n color: #000;\\n border-color: #ccc;\\n}\\n\\n.is--minimized path {\\n fill: #000;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["Root","styled","display","flexDirection","alignItems","justifyContent","height","textAlign","Loading","memo","CircularProgress","color","configurationContext","createContext","identityUrl","apiUrl","tenant","graphqlUrl","appUrl","orgId","deploymentId","queue","firstName","lastName","email","customerId","dataURL","title","scriptPath","pluginsPath","language","consultantNumber","phoneNumber","buttonLabel","dedicatedPage","maxMessageLength","ConfigurationProvider","Provider","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","requiredValidator","_","__","input","val","getWebChatForms","firstname","lastname","customForm","formJSON","wrapper","inputs","id","name","maxlength","placeholder","label","validate","form","autoSubmit","subject","GenesysServerProxy","message","isHtml","text","this","HTML2String","RemoveCommands","RemoveUrl","slice","window","ori","genesysPlugin","command","html","replace","tempDivElement","document","createElement","innerHTML","textContent","str","debug","d","ininChatEvents","INIT","READY","COMPLETE","OPEN_ERROR","CHAT_DISCONNECT","RECONNECT_FAILURE","CLOSE","fixAndroidKeyboard","inputClass","chatContainerClass","inputElement","getElementsByClassName","length","undefined","chatContainer","classList","add","toggleHeight","event","target","isClickedOnInput","nodeName","namespaceURI","contains","remove","addEventListener","Label","fontWeight","opacity","paddingRight","transition","Button","theme","palette","secondary","main","contrastText","spacing","SHADOW_LEVEL1","Icon","BubbleHelpFilled","width","SESSION_STORE_CONVERSATION_ID_KEY","handleWebChatServiceReady","ininChat","triggerEvent","iframeStyle","ChatButton","props","useState","showButton","setShowButton","isMinimized","setIsMinimized","sessionStarted","setSessionStarted","chatWindowOpened","setChatWindowOpened","htmlContainer","querySelector","isChatOpenedByDefault","useContext","handleOpenChat","handleWebChatOpened","style","overflow","test","navigator","userAgent","handleWebChatMinimized","handleWebChatClosed","handleClose","handleWebChatServiceStarted","sessionStorage","setItem","data","conversationId","handleWebChatServiceClientConnected","handleWebChatServiceEnded","removeItem","handleEngageInvite","settings","formsConfig","error","handleInputChange","textArea","getElementById","svg","value","setAttribute","useEffect","setTimeout","getItem","body","setButtonVisibility","instance","elementId","events","subscribe","eventType","handler","handlers","unsubscribe","server","iFrame","load","toggleVisibility","params","openChatWindow","getChatId","clearUserData","toggle","getIninChat","script","src","defer","CXBus","configure","loadPlugin","_genesys","i18nUrl","URL","widgets","downloadGoogleFont","lang","i18n","origin","pathname","webchat","transport","type","deploymentKey","orgGuid","interactionData","routing","targetType","targetAddress","priority","markdown","userData","customField1Label","customField1","customField2Label","customField2","customField3Label","customField3","toUpperCase","customField4Label","customField4","confirmFormCloseEnabled","getGenesysSettings","registerPlugin","before","dataLayer","push","append","className","onClick","ErrorBoundary","state","children","Component","App","configuration","languageTenant","toLocaleUpperCase","openedByDefault","setOpenedByDefault","head","URLSearchParams","location","search","param","Suspense","fallback","ThemeProvider","enableCacheProvider","cacheKey","TestIdProvider","team","project","render","rootElement","JSON","parse","dataset","OrganizationId","DeploymentId","DataURL","Queue","FirstName","LastName","Email","Number","parseInt","ScriptURL","PluginsPath","Title","ConsultantNumber","PhoneNumber","Language","ButtonLabel","DedicatedPage","ReactDOM","___CSS_LOADER_EXPORT___","module"],"sourceRoot":""}