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,OAAxEA,IAAO/Q,SAASwR,2BAA2BC,UAAW,YAAyB,GAAKV,KACtF,cAGA,OAAOC,GACP,C,wBC/CAjH,OAAO+G,QAAU,SAASzV,KAC1BA,MAAQA,IAAM,CAAC,GACf,IAAI0V,IAAKC,IAAM,GACf,KAAM3V,IACN2V,KAAO,mBACa,OAAlBD,IAAM,MAAmB,GAAKA,KAChC,MACoB,OAAlBA,IAAM,MAAmB,GAAKA,KAChC,YAGA,OAAOC,GACP,C,wBCZAjH,OAAO+G,QAAU,SAASzV,KAC1BA,MAAQA,IAAM,CAAC,GACf,IAAI0V,IAAKC,IAAM,GAAIC,IAAMC,MAAMC,UAAUC,KACzC,SAASC,QAAUL,KAAOC,IAAIK,KAAKC,UAAW,GAAI,CAClD,KAAMlW,IACN2V,KAAO,4CACU,OAAfD,IAAM,IAAgB,GAAKA,KAC7B,gKACe,GAAXxQ,SACJyQ,KAAO,oBAGO,GAAVzQ,SACJyQ,KAAO,sBAGHzQ,OAAS,IAAgB,GAAXA,UAClByQ,KAAO,mBAEPA,KAAO,oMACU,OAAfD,IAAM,IAAgB,GAAKA,KAC7B,yEACiB,OAAfA,IAAM,IAAgB,GAAKA,KAC7B,+NACsC,OAApCA,IAAM,wBAAqC,GAAKA,KAClD,6OACoB,OAAlBA,IAAM,MAAmB,GAAKA,KAChC,2HACkB,OAAhBA,IAAM,IAAiB,GAAKA,KAC9B,6EACkB,OAAhBA,IAAM,IAAiB,GAAKA,KAC9B,4QACiB,OAAfA,IAAM,IAAgB,GAAKA,KAC7B,wHACiB,OAAfA,IAAM,IAAgB,GAAKA,KAC7B,qfAC0E,OAAxEA,IAAO/Q,SAASwR,2BAA2BC,UAAW,YAAyB,GAAKV,KACtF,cAGA,OAAOC,GACP,C","sources":["webpack://apexchatwidgets/./widgets/core/callIfExists.js","webpack://apexchatwidgets/./widgets/core/hooks/AddorRemoveClass.js","webpack://apexchatwidgets/./widgets/core/hooks/IsTransferChatActionExists.js","webpack://apexchatwidgets/./widgets/core/hooks/getItemValues.js","webpack://apexchatwidgets/./widgets/core/hooks/isCallConnectActionNotAvailable.js","webpack://apexchatwidgets/./widgets/core/hooks/getScriptForIframe.js","webpack://apexchatwidgets/./widgets/questiontypes/QuestionTypeRenderer.js","webpack://apexchatwidgets/./widgets/questiontypes/ImportFactories/ImportQuestypeTemplateFactory.js","webpack://apexchatwidgets/./widgets/questiontypes/QuestionTypeVersion.js","webpack://apexchatwidgets/./widgets/templates/question_types/calendar_date_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/multiple_choice_display_as_list_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/multiple_choice_options_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/multiple_choice_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/none_question_type_message_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/calendar_date_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/multiple_choice_display_as_list_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/multiple_choice_options_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/multiple_choice_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/none_question_type_message_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/text_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/time_calendar_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/time_options_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/prechat_rounded_theme/time_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/text_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/time_calendar_question_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/time_options_template.ejs","webpack://apexchatwidgets/./widgets/templates/question_types/time_question_template.ejs"],"sourcesContent":["const callIfExists = (cb, scope, extraArgs) => {\r\n if (cb && typeof cb === 'function') {\r\n cb.bind2(scope, extraArgs)();\r\n }\r\n};\r\nexport default callIfExists;\r\n","/**\r\n * A utility function to Add or Remove class on selected element\r\n */\r\nconst AddorRemoveClass = (element, className, add) => {\r\n if (!element) {\r\n return;\r\n }\r\n if (add) {\r\n element.addClass(className);\r\n return;\r\n }\r\n\r\n if (typeof element.removeClass === 'function') {\r\n element.removeClass(className);\r\n } else {\r\n element.classList.remove(className);\r\n }\r\n};\r\nexport default AddorRemoveClass;\r\n","import { AgentScriptActionType } from '../enums/Enum';\r\n\r\nconst IsTransferChatActionExists = (option, el) => {\r\n let isExist = false;\r\n option.actions.filter((action) => {\r\n if (action.actionType === AgentScriptActionType.transferToLiveAgent) {\r\n el.setAttribute('data-action-type', 'transfer-chat');\r\n isExist = true;\r\n }\r\n });\r\n return isExist;\r\n};\r\nexport default IsTransferChatActionExists;\r\n","const getItemValues = (obj) => {\r\n let values = '';\r\n if (obj) {\r\n for (let i = 0; i < obj.length; i++) {\r\n if (i === 0) {\r\n values = obj[i].option ? obj[i].option : obj[i];\r\n continue;\r\n }\r\n const val = obj[i].option ? obj[i].option : obj[i];\r\n values += `, ${val}`;\r\n }\r\n }\r\n return values;\r\n};\r\nexport default getItemValues;\r\n","/**\r\n * Check if call connect available on QT option\r\n */\r\nconst isCallConnectActionNotAvailable = function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n // hasCallConnectAction is for current QT while hasNextCallConnectAction is for next mapped Question\r\n return (\r\n (option.hasCallConnectAction && !option.isCallConnectAvailable) ||\r\n (option.hasNextCallConnectAction && !option.isNextCallConnectAvailable)\r\n );\r\n};\r\nexport default isCallConnectActionNotAvailable;\r\n","/*\r\nOnly responsible to append inside an iframe\r\nRequired: iframeId\r\n*/\r\nconst getScriptForIframe = (url, scriptId, iframeId) => new Promise((resolve, reject) => {\r\n const iFrame = document.getElementById(iframeId);\r\n let framedoc = iFrame.contentDocument;\r\n if (!framedoc && iFrame.contentWindow) {\r\n framedoc = iFrame.contentWindow.document;\r\n }\r\n const script = framedoc.createElement('script');\r\n script.type = 'text/javascript';\r\n script.src = url;\r\n script.id = scriptId;\r\n framedoc.body.appendChild(script);\r\n\r\n script.onload = script.onreadystatechange = function () {\r\n framedoc.body.removeChild(script);\r\n resolve(this);\r\n };\r\n});\r\nexport default getScriptForIframe;\r\n","\r\nimport BaseClass from '../core/BaseClass';\r\nimport QuestionTypeVersion from './QuestionTypeVersion';\r\nimport WidgetTypes from '../core/enums/WidgetTypes';\r\nimport TempCache from '../core/enums/TempCache';\r\nimport ParticipantIds from '../core/enums/ParticipantIds';\r\nimport getItemValues from '../core/hooks/getItemValues';\r\nimport IsTransferChatActionExists from '../core/hooks/IsTransferChatActionExists';\r\nimport callIfExists from '../core/callIfExists';\r\nimport ManageFocusOnKeyEvents from '../core/hooks/ManageFocusOnKeyEvents';\r\nimport { ScriptVisitorResponseStatus, ScriptsQuestionType } from '../core/enums/Enum';\r\nimport isCallConnectActionNotAvailable from '../core/hooks/isCallConnectActionNotAvailable';\r\nimport isLastMessage from '../core/hooks/isLastMessage';\r\nimport TempStorageCache from '../core/hooks/TempStorageCache';\r\nimport getScriptForIframe from '../core/hooks/getScriptForIframe';\r\nimport getStyleForIframe from '../core/hooks/getStyleForIframe';\r\nimport ImportQuestypeTemplateFactory from './ImportFactories/ImportQuestypeTemplateFactory';\r\nimport AddorRemoveClass from '../core/hooks/AddorRemoveClass';\r\nimport observe from '../core/hooks/observe';\r\nimport WidgetStates from '../core/hooks/WidgetStates';\r\nimport isAcceptKey from '../core/hooks/isAcceptKey';\r\nimport removeClass from '../core/hooks/removeClass';\r\nimport logIt from '../../logIt';\r\n\r\nexport default class QuestionTypeRenderer extends BaseClass {\r\n /**\r\n 1. sets up options along with DOM context\r\n 2. initializes some variables for Q type processing: e.g. preText, template, answers[], etc\r\n */\r\n\r\n constructor(options) {\r\n super(options);\r\n const me = this;\r\n\r\n me.options = options;\r\n const templates = ImportQuestypeTemplateFactory(me.options.widgetType == WidgetTypes.PreChat);\r\n Object.assign(this, {\r\n questionTypeTextTemplate: templates.questionTypeTextTemplate,\r\n questionTypeTimeTemplate: templates.questionTypeTimeTemplate,\r\n questionTypeMultipleChoiceAsListTemplate: templates.questionTypeMultipleChoiceAsListTemplate,\r\n questionTypeMultipleChoiceOptionsTemplate: templates.questionTypeMultipleChoiceOptionsTemplate,\r\n questionTypeNoneTemplate: templates.questionTypeNoneTemplate,\r\n questionTypeCalendarDateTemplate: templates.questionTypeCalendarDateTemplate,\r\n questionTypeTimeOptionsTemplate: templates.questionTypeTimeOptionsTemplate,\r\n questionTypeTimeCalendarTemplate: templates.questionTypeTimeCalendarTemplate,\r\n questionTypeMultipleChoiceTemplate: templates.questionTypeMultipleChoiceTemplate\r\n });\r\n me.context = options.context;\r\n me.isBottomSheetSupported = options.isBottomSheetSupported;\r\n // private variables\r\n // me.preText = '';//no longer needed in V3\r\n me.template = null;\r\n me.answers = [];\r\n\r\n me.CHATLOG_ID = -1;\r\n // a new property introduced to decouple individual QT handling\r\n me.renderer = null;\r\n me.version = options.version ? options.version : QuestionTypeVersion.Classical;\r\n me.isLiveAgentAvailable = function (option) {\r\n if (!option) {\r\n return;\r\n }\r\n return option.isTransferToLiveAgent;\r\n };\r\n me.isLastMessageOperatorNotAvailable = function (msgObj) {\r\n if (\r\n !ApexChat.allHistoryMessages ||\r\n (ApexChat.allHistoryMessages && ApexChat.allHistoryMessages.length == 0)\r\n ) {\r\n //if no messages in history that means message is from Predefined or message before chat start so set its always true\r\n return true;\r\n }\r\n var allChatMsgs = ApexChat.allHistoryMessages.filter(function (message) {\r\n return message.text === ApexChat.operatorNotAvailableMessage;\r\n });\r\n return allChatMsgs.length > 0;\r\n };\r\n me.isAgentLastMessage = function (msgObj) {\r\n if (\r\n !ApexChat.allHistoryMessages ||\r\n (ApexChat.allHistoryMessages && ApexChat.allHistoryMessages.length == 0)\r\n ) {\r\n //if no messages in history that means message is from Predefined or message before chat start so set its always true\r\n return true;\r\n }\r\n var allAgentMsgs = ApexChat.allHistoryMessages.filter(function (message) {\r\n return (\r\n message.userId != ParticipantIds.pokeMessage &&\r\n message.participantDisplayName !== 'Visitor'\r\n );\r\n });\r\n var lastAgentMsgId =\r\n allAgentMsgs.length > 0 && allAgentMsgs[allAgentMsgs.length - 1].id;\r\n return lastAgentMsgId == msgObj.id;\r\n };\r\n }\r\n\r\n setVersion(ver) {\r\n this.version = ver;\r\n }\r\n\r\n isQuestionTypeOptionsAvailable(msgObj) {\r\n let flag = true;\r\n switch (msgObj.questionType) {\r\n case ScriptsQuestionType.TrueOrFalse:\r\n case ScriptsQuestionType.MultipleChoice:\r\n case ScriptsQuestionType.AllThatApply: {\r\n if (msgObj.options == '') {\r\n flag = false;\r\n }\r\n }\r\n }\r\n return flag;\r\n }\r\n\r\n autoScroll() {\r\n // allow a scroller to be set independant of the message container\r\n // arrived...\r\n const me = this;\r\n const scroller = me.$('#apexchat .apexchat_scroller', me.context);\r\n if (scroller.length) {\r\n scroller.prop('scrollTop', scroller.prop('scrollHeight'));\r\n } else if (me.options && me.options.messagesContainer) {\r\n me.options.messagesContainer.scrollTop = me.options.messagesContainer.scrollHeight;\r\n }\r\n }\r\n\r\n /**\r\n rendering a Q type onMessageArrived\r\n */\r\n async renderMessage(msgObj, callback, cbArg) {\r\n\r\n //todo: refactor this code to separate this function from this class\r\n const me = this;\r\n const mqtMeta = { instruction: '' }; // this is the only change in the existing QuestionTypeRenderer codebase: added a JOSN to keep the right instruction text\r\n const questionTypeDiv = document.createElement('div');\r\n // apex-css-no-bgColor\r\n\r\n questionTypeDiv.className =\r\n 'apexchat_auto_genned_message_wrapper apexchat_question_type_main_div apex-bot apexchat_message_left';\r\n\r\n questionTypeDiv.id = `apexchat_chatlog_${msgObj.id}`;\r\n // only PreChat Elements it would be available.\r\n // if (ApexChat.preChatElement) {\r\n // TODO: [Refactoring required; need to move these widget specific code inside child classes.].\r\n if (\r\n ApexChat.preChatElement &&\r\n me.state.widget != WidgetTypes.EPUIController &&\r\n me.state.getStateValue(WidgetTypes.PreChat) === WidgetStates.ShownMaximized\r\n ) {\r\n const element = me.$(ApexChat.preChatElement).find('#apexchat_prechat_message')[0];\r\n element.innerHTML = '';\r\n me.options.messagesContainer = element;\r\n ApexChat.preChatElement = null;\r\n }\r\n function isTransferChatActionExists(option, el) {\r\n let isExist = false;\r\n option.actions.filter((action) => {\r\n if (action.actionType === AgentScriptActionType.transferToLiveAgent) {\r\n el.data('actionType', 'transfer-chat');\r\n isExist = true;\r\n }\r\n });\r\n return isExist;\r\n }\r\n const module = await import(\r\n /* webpackChunkName: \"questionTypeRendererFactory\" */ './QuestionTypeRendererFactory'\r\n );\r\n const QuestionTypeRendererFactory = module.default;\r\n me.questionTypeRendererFactory = new QuestionTypeRendererFactory();\r\n\r\n me.renderer = await me.questionTypeRendererFactory.create(\r\n Object.assign(me.options, {\r\n version: me.version,\r\n msg: msgObj,\r\n wrapper: questionTypeDiv,\r\n container: me.options.messagesContainer,\r\n // container: me.options.elements.messagesContainerSelector,\r\n $: me.$,\r\n context: me.context,\r\n applyNewDateTime: me.options.applyNewDateTime,\r\n isBottomSheetSupported: me.isBottomSheetSupported,\r\n isFromPreChat:\r\n (me.options &&\r\n me.options.preChat &&\r\n me.options.preChat.msg &&\r\n me.options.preChat.msg.isFromPreChat) ||\r\n msgObj.isFromPreChat,\r\n updateCallback() {\r\n me.CHATLOG_ID = msgObj.id;\r\n }\r\n })\r\n );\r\n\r\n const data = {\r\n msgObj,\r\n questionTypeDiv,\r\n model: me.options.model\r\n };\r\n function renderDateTimeQT(type) {\r\n if (\r\n me.options.widgetType !== WidgetTypes.PreChat &&\r\n me.options.widgetType !== WidgetTypes.VideoGreetInvitation &&\r\n me.options.model.widget !== WidgetTypes.Windowed &&\r\n ApexChat.flatPickr === undefined\r\n ) {\r\n const lazyLoadScript = getScriptForIframe(\r\n 'https://d3b4i635mede5k.cloudfront.net/flatpickr.js',\r\n 'flatpickr_js',\r\n me.options.iframeId || me.options.model.iframeId\r\n );\r\n const lazyLoadCss = getStyleForIframe(\r\n 'https://d3b4i635mede5k.cloudfront.net/flatpickr.css',\r\n 'flatpickr_css',\r\n me.options.iframeId || me.options.model.iframeId\r\n );\r\n Promise.all([lazyLoadCss, lazyLoadScript]).then((value) => {\r\n ApexChat.flatPickr = value[1];\r\n if (me.renderer) {\r\n me.renderer.render({\r\n onSelect: me.sendResponse\r\n });\r\n mqtMeta.instruction = msgObj.questionPlaceholder || type;\r\n }\r\n me.options.afterFlatPickerLoaded();\r\n me.bindControls(msgObj);\r\n });\r\n } else if (me.renderer) {\r\n me.renderer.render({\r\n onSelect: me.sendResponse\r\n });\r\n mqtMeta.instruction = msgObj.questionPlaceholder || type;\r\n }\r\n }\r\n const getTimeIntervals = (abbreviation) => {\r\n const businessStartTime = 9;\r\n const businessEndTime = 17;\r\n const data = [];\r\n for (let i = businessStartTime; i < businessEndTime; i++) {\r\n const prevtime = `${i > 12 ? i - 12 : i}:00`;\r\n for (let j = 0; j < 4; j++) {\r\n var postfix = ` AM ${abbreviation}`;\r\n if (i >= 12) {\r\n // 12 pm is noon\r\n postfix = ` PM ${abbreviation}`;\r\n }\r\n const time = `${i == 0 ? 12 : i > 12 ? i - 12 : i}:${j == 0 ? 10 : (j * 15).toString()\r\n }${postfix}`;\r\n data.push(`${prevtime} to ${time}`);\r\n }\r\n data.push(`${prevtime} to ${i + 1 > 12 ? i + 1 - 12 : i + 1}:00${postfix}`);\r\n }\r\n return data;\r\n };\r\n switch (msgObj.questionType) {\r\n case ScriptsQuestionType.TrueOrFalse:\r\n if (me.renderer) {\r\n me.renderer.render();\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n var options = ApexChat.TryParse(data.msgObj.options);\r\n var yesButton = me.context.getElementById(`apexchat-btn-yes-${msgObj.id}`);\r\n var noButton = me.context.getElementById(`apexchat-btn-no-${msgObj.id}`);\r\n IsTransferChatActionExists(options[0], yesButton);\r\n IsTransferChatActionExists(options[1], noButton);\r\n\r\n logIt(\r\n `isLiveAgentAvailable:: in True option case: ${options[0].isTransferToLiveAgent}`\r\n );\r\n logIt(\r\n `isLiveAgentAvailable:: in False option case: ${options[1].isTransferToLiveAgent}`\r\n );\r\n\r\n if (\r\n yesButton &&\r\n options[0].text === msgObj.yesText &&\r\n !me.isLiveAgentAvailable(options[0])\r\n ) {\r\n me.$(yesButton)\r\n .disable({\r\n applyGrayBackground: false,\r\n elementQT: yesButton,\r\n tabIndex: 0\r\n })\r\n .addClass('apexchat_disabled_qt_options');\r\n }\r\n if (\r\n noButton &&\r\n options[1].text === msgObj.noText &&\r\n !me.isLiveAgentAvailable(options[1])\r\n ) {\r\n me.$(noButton)\r\n .disable({ applyGrayBackground: true, elementQT: noButton, tabIndex: 0 })\r\n .addClass('apexchat_disabled_qt_options');\r\n }\r\n break;\r\n case ScriptsQuestionType.MultipleChoice:\r\n // me.options = Object.assign(me.options, ApexChat.getPreloadedChatOptions());\r\n var template = data.msgObj.questionTypeDisplayListForVisitor\r\n ? me.questionTypeMultipleChoiceAsListTemplate\r\n : me.questionTypeMultipleChoiceTemplate;\r\n me.template = template(data.msgObj);\r\n\r\n if (data.msgObj.questionTypeDisplayListForVisitor) {\r\n if (me.renderer) {\r\n me.renderer.render({\r\n onSelect: me.sendResponse\r\n });\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n } else {\r\n // Fill options div\r\n var selectOptions = document.createElement('div');\r\n var options = {};\r\n if (me.renderer && me.renderer.listOptions) {\r\n options = me.renderer.listOptions;\r\n } else {\r\n options = ApexChat.TryParse(data.msgObj.options);\r\n }\r\n if (options) {\r\n for (var i = 0; i < options.length; i++) {\r\n // parse the text in case if there is encoded html coming along\r\n let optionDecoded = options[i].option;\r\n if (\r\n options[i].option.indexOf('<') > -1 ||\r\n options[i].option.indexOf('>') > -1\r\n ) {\r\n optionDecoded = me.$('
').html(options[i].option).text();\r\n }\r\n const styleConfig = me.getOptionStyles(\r\n options[i].agentScriptOptionStyles,\r\n data.msgObj.id,\r\n i + 1\r\n );\r\n selectOptions.innerHTML += me.questionTypeMultipleChoiceOptionsTemplate({\r\n messageId: data.msgObj.id,\r\n id: i + 1,\r\n name: optionDecoded,\r\n styles: styleConfig ? styleConfig.styles : '',\r\n fontStyle: styleConfig ? styleConfig.fontStyle : ''\r\n });\r\n }\r\n me.applyTemplate(data.questionTypeDiv, selectOptions);\r\n for (var i = 0; i < options.length; i++) {\r\n // Handle button click\r\n const radioButton = me.context.getElementById(\r\n `apexchat_question_type_multiple_choice_radio_parent_option_label_${msgObj.id\r\n }_${i + 1}`\r\n );\r\n var radioButtonParent = me.context.querySelectorAll(\r\n `#apexchat_question_type_multiple_choice_options_div_${msgObj.id} .apexchat_question_type_multiple_choice_radio`\r\n )[0];\r\n if (radioButton) {\r\n IsTransferChatActionExists(options[i], radioButton);\r\n logIt(\r\n `isLiveAgentAvailable:: in option : ${radioButton.innerText}: ${options[i].isTransferToLiveAgent}`\r\n );\r\n // attach handlers: mouse and keyboard based\r\n if (\r\n isCallConnectActionNotAvailable(options[i]) ||\r\n !me.isLiveAgentAvailable(options[i])\r\n ) {\r\n // CHAT-7911 Disabled option if call connect is not available\r\n me.$(radioButton, me.context)\r\n .disable({ applyGrayBackground: true })\r\n .addClass('apexchat_disabled_qt_options');\r\n continue;\r\n }\r\n observe(\r\n radioButton,\r\n 'click',\r\n me.sendResponse.bind2(me, msgObj, options[i].option)\r\n );\r\n observe(radioButton, 'keyup', function (e) {\r\n if (!me.$(`#${e.target.id}> input:radio`).prop('checked')) {\r\n me.manageQtFocus.bind2(this, e, {\r\n msg: msgObj,\r\n text: e.currentTarget.innerText,\r\n context: me,\r\n eventType: 'sendResponse',\r\n muteElements: ['.apexchat_question_type_update_button']\r\n })(); // muting elements on selector wise\r\n }\r\n if (e.keyCode == 9 || e.code == 'tab') {\r\n radioButtonParent.addClass('apexchat_element_on_focus');\r\n }\r\n });\r\n observe(radioButton, 'blur', (e) => {\r\n radioButtonParent.classList.remove('apexchat_element_on_focus');\r\n });\r\n }\r\n }\r\n }\r\n if (me.renderer) {\r\n me.renderer.displaySkipOption();\r\n }\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n break;\r\n case ScriptsQuestionType.AllThatApply:\r\n // Select template that appear as check box list vertically when questionTypeDisplayListForVisitor is true\r\n // Else Select template that appear as bubble style checkboxes\r\n // me.options = Object.assign(me.options, ApexChat.getPreloadedChatOptions());\r\n if (data.msgObj.questionTypeDisplayListForVisitor && me.isBottomSheetSupported) {\r\n if (me.renderer) {\r\n me.renderer.render({\r\n onSelect: me.sendResponse\r\n });\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n } else if (me.renderer) {\r\n me.renderer.render();\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n break;\r\n case ScriptsQuestionType.Text:\r\n if (msgObj.visitorResponseTypes) {\r\n if (me.renderer) {\r\n me.renderer.render({\r\n onSelect: me.sendResponse.bind2(me)\r\n });\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n }\r\n break;\r\n case ScriptsQuestionType.FullText: // use this input field for fulltext\r\n me.template = me.questionTypeTextTemplate(data.msgObj);\r\n me.applyTemplate(data.questionTypeDiv);\r\n mqtMeta.isFullText = true;\r\n mqtMeta.isFromPreChat = true;\r\n break;\r\n case ScriptsQuestionType.CalendarDate:\r\n if (me.isBottomSheetSupported && me.options.applyNewDateTime) {\r\n renderDateTimeQT(me.getQTPlaceHolder(msgObj.questionType));\r\n break;\r\n } else {\r\n data.msgObj.questionPlaceholder = '';\r\n me.template = me.questionTypeCalendarDateTemplate(\r\n data.msgObj\r\n );\r\n me.applyTemplate(data.questionTypeDiv);\r\n var calendarInput = me.$(\r\n `#apexchat_question_type_time_calendar_input_control_${msgObj.id}`,\r\n me.context\r\n );\r\n ManageFocusOnKeyEvents(calendarInput);\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n break;\r\n case ScriptsQuestionType.Time:\r\n if (me.isBottomSheetSupported && me.options.applyNewDateTime) {\r\n renderDateTimeQT(me.getQTPlaceHolder(msgObj.questionType));\r\n break;\r\n } else {\r\n me.template = me.questionTypeTimeTemplate(data.msgObj);\r\n const intervals = getTimeIntervals(me.options.questionTypeTimeZoneAbbreviation);\r\n // Fill options div\r\n var selectOptions = document.createElement('div');\r\n if (selectOptions) {\r\n for (var i = 0; i < intervals.length; i++) {\r\n selectOptions.innerHTML +=\r\n me.questionTypeTimeOptionsTemplate(\r\n { name: intervals[i] }\r\n );\r\n }\r\n }\r\n me.applyTemplate(data.questionTypeDiv, selectOptions);\r\n window.setTimeout(() => {\r\n // wait for time input field to render\r\n const timeInput = me.$(\r\n `#apexchat_question_type_time_select_control_${msgObj.id} .apexchat_dropSelect_elements`,\r\n me.context\r\n );\r\n if (timeInput) {\r\n timeInput.addClass('apexchat-element-outline-remove');\r\n timeInput.on('keyup blur', (e) => {\r\n // apply apexchat-element-outline-remove which help us to hide blue border where unnecessary appeared, blue border should appear when we press tab on particular field\r\n if (e.type == 'keyup' && (e.keyCode == 9 || e.code == 'tab')) {\r\n AddorRemoveClass(\r\n timeInput,\r\n 'apexchat-element-outline-remove',\r\n false\r\n );\r\n }\r\n if (e.type == 'blur') {\r\n // when focus removed from element, so blue border should not appear.\r\n AddorRemoveClass(\r\n timeInput,\r\n 'apexchat-element-outline-remove',\r\n true\r\n );\r\n }\r\n });\r\n }\r\n }, TempCache.RENDER_QT_TIME);\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n }\r\n\r\n break;\r\n case ScriptsQuestionType.TimeCalendar:\r\n if (me.isBottomSheetSupported && me.options.applyNewDateTime) {\r\n renderDateTimeQT(me.getQTPlaceHolder(msgObj.questionType));\r\n break;\r\n } else {\r\n me.template =\r\n me.questionTypeTimeCalendarTemplate(\r\n data.msgObj\r\n );\r\n const intervals = getTimeIntervals(me.options.questionTypeTimeZoneAbbreviation);\r\n // Fill options div\r\n var selectOptions = document.createElement('div');\r\n if (selectOptions) {\r\n for (var i = 0; i < intervals.length; i++) {\r\n selectOptions.innerHTML +=\r\n me.questionTypeTimeOptionsTemplate(\r\n { name: intervals[i] }\r\n );\r\n }\r\n }\r\n me.applyTemplate(data.questionTypeDiv, selectOptions);\r\n var calendarInput = me.$(\r\n `#apexchat_question_type_time_calendar_input_control_${msgObj.id}`,\r\n me.context\r\n );\r\n ManageFocusOnKeyEvents(calendarInput);\r\n ManageFocusOnKeyEvents(calendarInput);\r\n window.setTimeout(() => {\r\n // wait for time input field to render\r\n const timeInput = me.$(\r\n `#apexchat_question_type_time_calendar_select_control_${msgObj.id} .apexchat_dropSelect_elements`,\r\n me.context\r\n );\r\n if (timeInput) {\r\n timeInput.addClass('apexchat-element-outline-remove');\r\n timeInput.on('keyup blur', (e) => {\r\n // apply apexchat-element-outline-remove which help us to hide blue border where unnecessary appeared, blue border should appear when we press tab on particular field\r\n if (e.type == 'keyup' && (e.keyCode == 9 || e.code == 'tab')) {\r\n AddorRemoveClass(\r\n timeInput,\r\n 'apexchat-element-outline-remove',\r\n false\r\n );\r\n }\r\n if (e.type == 'blur') {\r\n AddorRemoveClass(\r\n timeInput,\r\n 'apexchat-element-outline-remove',\r\n true\r\n );\r\n }\r\n });\r\n }\r\n }, TempCache.RENDER_QT_TIME);\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n break;\r\n }\r\n case ScriptsQuestionType.AppointmentScheduler:\r\n if (me.renderer) {\r\n me.renderer.render({\r\n onAutoScroll: me.autoScroll.bind2(me)\r\n });\r\n }\r\n mqtMeta.instruction = me.getQTPlaceHolder(msgObj.questionType);\r\n\r\n break;\r\n case ScriptsQuestionType.VideoGreet:\r\n if (me.renderer) {\r\n me.renderer.render();\r\n }\r\n break;\r\n case ScriptsQuestionType.None:\r\n data.msgObj.userId = data.msgObj.userId || 0;\r\n me.template = me.questionTypeNoneTemplate(data.msgObj);\r\n me.applyTemplate(data.questionTypeDiv);\r\n break;\r\n default:\r\n break;\r\n }\r\n if (!mqtMeta.isFullText) {\r\n // bind buttons: Confirm, Skip, Yes, No, Update\r\n me.bindControls(msgObj);\r\n }\r\n\r\n let skipButton = me.context.querySelector('.apexchat_skip_input');\r\n if (skipButton) {\r\n skipButton.style.display = 'none'; // hide FT skip input button when other QT's skip button displayed\r\n }\r\n if (msgObj.questionType == ScriptsQuestionType.Text && msgObj.isFromPreChat) {\r\n if (ApexChat.ContactInfo) {\r\n if (!me.$('#apexchat_contact_qt_btn_' + msgObj.id, me.context).is(':visible')) {\r\n me.$('#livechat_send_message_button', me.context).trigger('click');\r\n } else {\r\n me.$('#apexchat_contact_qt_btn_' + msgObj.id, me.context).trigger('click');\r\n }\r\n }\r\n } else {\r\n me.setVisitorSelection(msgObj);\r\n }\r\n ApexChat.storageAPI.Store('questionTypeId', msgObj.id);\r\n ManageFocusOnKeyEvents(me.context.querySelector('.apexchat_participant_display_text'));\r\n // update log_id in these scenarios:\r\n // 1.checking visitor want to update this question,\r\n // 2. when an anwsered QT is loaded from EP to DOM or\r\n // 3. an answered QT is loaded after DOM reload\r\n me.CHATLOG_ID =\r\n msgObj.visitorResponseStatus == ScriptVisitorResponseStatus.Updating ||\r\n msgObj.visitorResponseStatus == ScriptVisitorResponseStatus.Answered\r\n ? msgObj.id\r\n : -1;\r\n logIt('plugging custom dd....');\r\n me.plugCustomDropbown(msgObj);\r\n // call extra functon newly added to plug new behavior after a message is rendered\r\n if (callback && typeof callback === 'function') {\r\n callback({ meta: mqtMeta, msg: msgObj, cb: cbArg });\r\n }\r\n // render agent script documents\r\n if (data.msgObj && data.msgObj.agentScriptDocuments && data.msgObj.isDocument) {\r\n import(\r\n /* webpackChunkName: \"FilesToQuestionTypesRenderer\" */ './FilesToQuestionTypesRenderer'\r\n ).then((module) => {\r\n const FilesToQuestionTypesRenderer = module.default;\r\n const filesToQTTypesRenderer = new FilesToQuestionTypesRenderer(\r\n Object.assign(me.options, data)\r\n );\r\n filesToQTTypesRenderer.render(data.questionTypeDiv);\r\n });\r\n }\r\n }\r\n\r\n renderSelection(msgObj) {\r\n // This method is only run for TF selection from preChat CHAT-7045\r\n const sender = {\r\n target: {}\r\n }; // creating a fake object model for sender.\r\n sender.target.textContent = msgObj.msgText;\r\n this.renderer && this.renderer.onSelection(sender, msgObj, msgObj.msgText);\r\n }\r\n\r\n /**\r\n * This function is handling the visitor selection of TF, MC, ATA etc question type.\r\n * @param {msgObj} question type message detail\r\n */\r\n async setVisitorSelection(msgObj) {\r\n const me = this;\r\n if (isLastMessage(msgObj) && !msgObj.visitorSelectedOptions) {\r\n // if this QT the v last msg; then it must be unanswered? show it as new-born baby\r\n return;\r\n }\r\n if (me.isLastMessageOperatorNotAvailable(msgObj) && !msgObj.visitorSelectedOptions) {\r\n // if this QT the v last msg; then it must be unanswered? show it as new-born baby\r\n return;\r\n }\r\n if (\r\n msgObj.visitorSelectedOptions &&\r\n msgObj.visitorSelectedOptions.indexOf &&\r\n msgObj.visitorSelectedOptions.indexOf('\\\\') != -1\r\n ) {\r\n msgObj.visitorSelectedOptions = msgObj.visitorSelectedOptions.replaceAll('\\\\', '\\\\\\\\');\r\n }\r\n const selectedOptions = ApexChat.TryParse(msgObj.visitorSelectedOptions);\r\n if (selectedOptions) {\r\n me.continueMappingForVisitorSelection(msgObj, selectedOptions);\r\n //Web to SMS form\r\n var isWebToSmsOptionSelected =\r\n isLastMessage(msgObj) && msgObj.questionType == ScriptsQuestionType.MultipleChoice;\r\n var isSmsBottomSheetOpenedBeforeRefresh =\r\n selectedOptions[0] &&\r\n msgObj.questionType == ScriptsQuestionType.MultipleChoice &&\r\n ApexChat.localStorageAPI.Get('sms_bottomsheet_opened') == 'true';\r\n if (isWebToSmsOptionSelected || isSmsBottomSheetOpenedBeforeRefresh) {\r\n const selection = me.getSelectedOption(selectedOptions[0].option, msgObj);\r\n me.checkConvertToSms(selection);\r\n }\r\n }\r\n // For any past QT whether answered/unanswered: show selection (if answered), disable (always) and hide Send/Cancel buttons (always)\r\n\r\n const module = await import(\r\n /* webpackChunkName: \"setSelectionOrDisable\" */ '../core/hooks/setSelectionOrDisable'\r\n );\r\n const setSelectionOrDisable = module.default;\r\n setSelectionOrDisable(me, msgObj, selectedOptions, true);\r\n me.hideButtons(msgObj);\r\n me.hideSkipButton(); // hide skip button when user submit the response.\r\n }\r\n\r\n hideButtons(msgObj) {\r\n const me = this;\r\n // Show Update button for updating response later on\r\n // var updateButton = me.$('#apexchat-btn-update-' + msgObj.id, me.context);\r\n // if (updateButton && me.options.isUpdateSupported) {\r\n // me.$(updateButton).show();\r\n // }\r\n // Hide confirm/okay button\r\n const confirmButtonDiv = me.$(\r\n `#apexchat_question_type_div_confirm_button_${msgObj.id}`,\r\n me.context\r\n );\r\n if (confirmButtonDiv) {\r\n me.$(confirmButtonDiv).hide();\r\n }\r\n // hide skip/close buttons\r\n const closeButtonDiv = me.$(\r\n `#apexchat_question_type_div_close_button_${msgObj.id}`,\r\n me.context\r\n );\r\n if (closeButtonDiv) {\r\n me.$(closeButtonDiv).hide();\r\n }\r\n }\r\n\r\n continueMappingForVisitorSelection(msgObj, selectedItem) {\r\n const me = this;\r\n if (msgObj.shouldContinueMapping) {\r\n // get QT selected items\r\n const selectedQTOptions = me.getQTSelectedOptions(selectedItem);\r\n // send response to server, bring next mapped question IF ANY.\r\n const response = {\r\n chatId: msgObj.chatId,\r\n isSkipped: false,\r\n answers: selectedQTOptions.selectedOptions,\r\n msgText: selectedQTOptions.selectedOptionText,\r\n agentScriptAnswerId: msgObj.scriptAnswerId,\r\n chatLogId: msgObj.id,\r\n shouldRenderResponseAsText:\r\n (msgObj.questionTypeDisplayListForVisitor && me.isBottomSheetSupported) ||\r\n me.renderQTResponseAsText(msgObj),\r\n contactInfo: ApexChat.ContactInfo || '',\r\n questionType: msgObj.questionType\r\n };\r\n response.questionTypeChatLogIdToBeUpdated = msgObj.id;\r\n ApexChat.ContactInfo = '';\r\n me.options.responseCallback\r\n ? me.options.responseCallback(response)\r\n : (function () {\r\n console.log('No callback defined for sending Q type response');\r\n })();\r\n }\r\n }\r\n\r\n renderQTResponseAsText(msgObj) {\r\n const me = this;\r\n let flag = false;\r\n\r\n switch (msgObj.questionType) {\r\n case ScriptsQuestionType.TrueOrFalse:\r\n case ScriptsQuestionType.MultipleChoice:\r\n case ScriptsQuestionType.AllThatApply:\r\n case ScriptsQuestionType.TimeCalendar:\r\n case ScriptsQuestionType.CalendarDate:\r\n case ScriptsQuestionType.Time:\r\n case ScriptsQuestionType.Text: {\r\n flag = true;\r\n }\r\n }\r\n return flag;\r\n }\r\n\r\n getQTSelectedOptions(selectedItem) {\r\n let selectedOptions = '';\r\n let selectedOptionText = '';\r\n // check selected item length\r\n if (selectedItem && selectedItem.length > 0) {\r\n for (let i = 0; i <= selectedItem.length - 1; i++) {\r\n if (i == 0) {\r\n selectedOptions = `[{ \"option\": \"${selectedItem[i].option}\"}`;\r\n selectedOptionText = selectedItem[i].option;\r\n } else {\r\n selectedOptions += `,{ \"option\": \"${selectedItem[i].option}\"}`;\r\n selectedOptionText += `,${selectedItem[i].option}`;\r\n }\r\n }\r\n selectedOptions += ']';\r\n }\r\n\r\n return { selectedOptions, selectedOptionText };\r\n }\r\n\r\n //* *// insert attached files with MC options */\r\n applyMCWithFileTemplate(questionTypeDiv, selectOptions, files) {\r\n var me = this;\r\n questionTypeDiv.innerHTML = selectOptions\r\n ? me.template.replace('apexchat_options_div', selectOptions.innerHTML)\r\n : me.template;\r\n // if (files){\r\n\r\n // questionTypeDiv.innerHTML = (files) ? questionTypeDiv.innerHTML.replace('apexchat_files_div', files.innerHTML) : me.template;\r\n // } else {\r\n // questionTypeDiv.innerHTML = questionTypeDiv.innerHTML.replace('apexchat_files_div', '')\r\n // }\r\n me.options.messagesContainer.appendChild(questionTypeDiv);\r\n }\r\n\r\n applyTemplate(questionTypeDiv, selectOptions) {\r\n // Apply template\r\n const me = this;\r\n questionTypeDiv.innerHTML = selectOptions\r\n ? me.template.replace('apexchat_options_div', selectOptions.innerHTML)\r\n : me.template;\r\n me.options.messagesContainer.appendChild(questionTypeDiv);\r\n }\r\n\r\n /**\r\n Clears UI after sending response\r\n */\r\n hideAll(id, context) {\r\n const me = this;\r\n context = context || me.context;\r\n // TrueOrFalse - btns\r\n me.$(`#apexchat-btn-yes-${id}`, context).hide();\r\n me.$(`#apexchat-btn-no-${id}`, context).hide();\r\n // MultipleChoice- btns\r\n me.$(`#apexchat_question_type_multiple_choice_options_div_${id}`, context).hide();\r\n // general - btns\r\n me.$(`#apexchat_question_type_div_confirm_button_${id}`, context).hide();\r\n me.$(`#apexchat_question_type_div_close_button_${id}`, context).hide();\r\n // All that Apply\r\n me.$(`#apexchat_question_type_all_that_apply_options_div_${id}`, context).hide();\r\n // Text\r\n me.$(`#apexchat_question_type_text_input_${id}`, context).hide();\r\n // Calender Date\r\n me.$(`#apexchat_question_type_calendar_input_${id}`, context).hide();\r\n // Time\r\n me.$(`#apexchat_question_type_time_${id}`, context).hide();\r\n // TimeCalendar\r\n me.$(`#apexchat_question_type_time_calendar_input_div_${id}`, context).hide();\r\n me.$(`#apexchat_question_type_time_calendar_select_div_${id}`, context).hide();\r\n // when closing prechat msg IFrame should resize.\r\n me.postMessage({\r\n event: 'prechat-auto-resizing',\r\n data: {\r\n isResetIframe: true,\r\n hidePreChatMessages: true,\r\n isSingleMsg: true,\r\n hideCloseButton: true // we need to hide close button\r\n }\r\n });\r\n }\r\n\r\n manageQtFocus(e, options) {\r\n const me = this;\r\n var doOnAcceptKey =\r\n options && options.onAccept\r\n ? options.onAccept\r\n : function () {\r\n /* do nothing */\r\n };\r\n if (isAcceptKey(e)) {\r\n if (!options.context.$(this, options.context.context).isDisabled()) {\r\n // if element is disabled it should not work using keyboard\r\n options.isNotSend\r\n ? doOnAcceptKey.bind2(me, e, options)()\r\n : options.context[options.eventType](e, options.msg, options.text);\r\n options.context.$(this, options.context.context).blur();\r\n // we prevent vox to read element.\r\n options.context.muteAllElements(options);\r\n setTimeout(() => {\r\n // we enabled vox to read element.\r\n options.context.unmuteAllElements(options);\r\n }, 500);\r\n }\r\n }\r\n // else {\r\n // ApexChat.manageFocus(e, this);\r\n // }\r\n }\r\n\r\n /*\r\n Using this function we prevent vox to read element. \r\n */\r\n muteAllElements(options) {\r\n for (let i = 0; i < options.muteElements.length; i++) {\r\n options.context\r\n .$(options.muteElements[i], options.context.context)\r\n .attr('aria-hidden', true);\r\n }\r\n }\r\n\r\n /*\r\n Using this function we enabled vox to read element. \r\n */\r\n unmuteAllElements(options) {\r\n for (let i = 0; i < options.muteElements.length; i++) {\r\n options.context\r\n .$(options.muteElements[i], options.context.context)\r\n .attr('aria-hidden', false);\r\n }\r\n }\r\n\r\n /**\r\n \r\n does the job of event-binding of buttons: Yes/No/Confirm/Skip/Update\r\n */\r\n onUpdateEvent(sender, message, callback) {\r\n const me = this;\r\n if (message.questionType === ScriptsQuestionType.TrueOrFalse) {\r\n const yesButton = me.context.getElementById(`apexchat-btn-yes-${message.id}`);\r\n if (yesButton) {\r\n yesButton.style.display = 'block';\r\n yesButton.style.pointerEvents = 'auto';\r\n }\r\n const noButton = me.$(`#apexchat-btn-no-${message.id}`, me.context);\r\n if (noButton) {\r\n me.$(noButton).show();\r\n me.$(noButton).css('pointer-events', 'auto');\r\n }\r\n callIfExists(callback, me, message);\r\n } else if (message.questionType === ScriptsQuestionType.MultipleChoice) {\r\n var mainDiv = me.$(\r\n `#apexchat_question_type_multiple_choice_options_div_${message.id}`,\r\n me.context\r\n );\r\n var okBtn = me.$(\r\n `#apexchat_question_type_div_confirm_button_${message.id}`,\r\n me.context\r\n );\r\n const idSelectControl = me.$(\r\n `#apexchat_question_type_multiple_choice_as_list_select_control_${message.id}`,\r\n me.context\r\n );\r\n if (mainDiv) {\r\n me.$(mainDiv).show();\r\n var children = mainDiv.children();\r\n for (var i = 0; i < children.length; i++) {\r\n var childOption = children[i];\r\n // me.$(childOption).children('input:checked').each(function () {\r\n // me.$(this).prop('checked', false);\r\n // });\r\n me.$(childOption).show();\r\n }\r\n if (okBtn) {\r\n me.$(okBtn).show();\r\n }\r\n if (idSelectControl) {\r\n idSelectControl.enable();\r\n }\r\n }\r\n } else if (message.questionType === ScriptsQuestionType.AllThatApply) {\r\n var mainDiv = me.$(\r\n `#apexchat_question_type_all_that_apply_options_div_${message.id}`,\r\n me.context\r\n );\r\n var okBtn = me.$(\r\n `#apexchat_question_type_div_confirm_button_${message.id}`,\r\n me.context\r\n );\r\n if (mainDiv) {\r\n me.$(mainDiv).show();\r\n var children = mainDiv.children();\r\n for (var i = 0; i < children.length; i++) {\r\n var childOption = children[i];\r\n // me.$(childOption).children('input:checked').each(function () {\r\n // me.$(this).prop('checked', false);\r\n // });\r\n me.$(childOption).show();\r\n }\r\n // enable all that apply options\r\n me.$(mainDiv).enable();\r\n }\r\n if (okBtn) {\r\n me.$(okBtn).show();\r\n }\r\n }\r\n // Set chat log id of Question Type in order to send it alongwith chosen answer in order to udating the last meassage;\r\n me.CHATLOG_ID = message.id;\r\n // hiding update button\r\n const confirmButton = me.context.getElementById(`apexchat-btn-confirm-${message.id}`);\r\n // checking okay button exist in quick reply Make send button behave like QuickReply Okay button\r\n if (confirmButton) {\r\n if (me.options.sendButton) {\r\n const sendBtn = me.options.sendButton;\r\n TempStorageCache.add('QuestionTypeCurrentMessage', message);\r\n TempStorageCache.add('QuestionTypeRenderer', me);\r\n observe(sendBtn, 'click', me.sendBtnClick);\r\n }\r\n }\r\n me.$(sender.currentTarget).parent().hide();\r\n // indicate at DB that visitor is clearing last selections for updating\r\n // me.answers.push({ option: 'cancelQtAns' });\r\n // me.clearToUpdate(message);\r\n }\r\n\r\n sendBtnClick(e) {\r\n const me = TempStorageCache.get('QuestionTypeRenderer'); // using stored context of 'me' as on click we lose the context\r\n if (me) {\r\n // check me exists or not\r\n me.sendResponse(e, TempStorageCache.get('QuestionTypeCurrentMessage'), '', false);\r\n }\r\n }\r\n\r\n bindControls(msgObj) {\r\n //todo: refactor this function\r\n // Confirm btton for question type handling\r\n const me = this;\r\n const confirmButton = me.context.getElementById(`apexchat-btn-confirm-${msgObj.id}`);\r\n if (confirmButton) {\r\n observe(confirmButton, 'click', me.sendResponse.bind2(me, msgObj, '', false));\r\n // apply ADA\r\n observe(confirmButton, 'keyup', function (e) {\r\n me.manageQtFocus.bind2(this, e, {\r\n msg: msgObj,\r\n context: me,\r\n eventType: 'sendResponse',\r\n muteElements: ['.apexchat_question_type_update_button']\r\n })(); // muting elements on selector wise\r\n // if (isAcceptKey(e)) {\r\n // me.sendResponse.bind2(me, e, msgObj)();\r\n // } else {\r\n // //ApexChat.manageFocus(e, this);\r\n // }\r\n });\r\n ManageFocusOnKeyEvents(confirmButton);\r\n // Make send button behave like QuickReply Okay button;ref. CHAT-4294\r\n if (me.options.sendButton && isLastMessage(msgObj)) {\r\n const sendBtn = me.options.sendButton;\r\n TempStorageCache.add('QuestionTypeCurrentMessage', msgObj);\r\n TempStorageCache.add('QuestionTypeRenderer', me);\r\n // if response is submitted successfully from the prechat\r\n // don't need to bind again click event on the send button\r\n // only need to check ATA Non List QT's\r\n if (msgObj && msgObj.questionType == ScriptsQuestionType.AllThatApply) {\r\n const selectedOptions = ApexChat.TryParse(msgObj.visitorSelectedOptions);\r\n if (!selectedOptions) {\r\n observe(sendBtn, 'click', me.sendBtnClick);\r\n }\r\n } else {\r\n observe(sendBtn, 'click', me.sendBtnClick);\r\n }\r\n }\r\n }\r\n const skipButton = me.context.getElementById(`apexchat_skip_question_${msgObj.id}`);\r\n if (skipButton) {\r\n observe(\r\n skipButton,\r\n 'click',\r\n me.sendResponse.bind2(me, msgObj, \"Visitor didn't answer this question!\", true)\r\n );\r\n // apply ADA\r\n observe(skipButton, 'keyup', (e) => {\r\n if (isAcceptKey(e)) {\r\n me.sendResponse.bind2(\r\n me,\r\n e,\r\n msgObj,\r\n \"Visitor didn't answer this question!\",\r\n true\r\n )();\r\n } else {\r\n // ApexChat.manageFocus(e, this);\r\n }\r\n });\r\n }\r\n const yesButton = me.context.getElementById(`apexchat-btn-yes-${msgObj.id}`);\r\n if (yesButton) {\r\n observe(yesButton, 'click', me.sendResponse.bind2(me, msgObj, msgObj.yesText));\r\n observe(yesButton, 'keyup', function (e) {\r\n if (me.$(this).css('pointer-events') != 'none') {\r\n me.manageQtFocus.bind2(this, e, {\r\n msg: msgObj,\r\n text: msgObj.yesText,\r\n context: me,\r\n eventType: 'sendResponse',\r\n muteElements: [\r\n '.apexchat_question_type_update_button',\r\n '.apexchat_question_type_true_or_false'\r\n ]\r\n })(); // muting elements on selector wise\r\n }\r\n });\r\n ManageFocusOnKeyEvents(yesButton);\r\n }\r\n const noButton = me.context.getElementById(`apexchat-btn-no-${msgObj.id}`);\r\n if (noButton) {\r\n observe(noButton, 'click', me.sendResponse.bind2(me, msgObj, msgObj.noText));\r\n observe(noButton, 'keyup', function (e) {\r\n if (me.$(this).css('pointer-events') != 'none') {\r\n me.manageQtFocus.bind2(this, e, {\r\n msg: msgObj,\r\n text: msgObj.noText,\r\n context: me,\r\n eventType: 'sendResponse',\r\n muteElements: [\r\n '.apexchat_question_type_update_button',\r\n '.apexchat_question_type_true_or_false'\r\n ]\r\n })(); // muting elements on selector wise\r\n }\r\n });\r\n ManageFocusOnKeyEvents(noButton);\r\n }\r\n // Hide initially\r\n const updateButtonId = `apexchat-btn-update-${msgObj.id}`;\r\n const updateBtnContainer = me.context.getElementById(updateButtonId);\r\n const updateButton = me.context.querySelector(\r\n `#apexchat-btn-update-${msgObj.id} .apexchat_question_type_update_button`\r\n );\r\n if (updateBtnContainer) {\r\n observe(updateButton, 'click', me.onUpdateEvent.bind2(me, msgObj));\r\n updateBtnContainer.style.display = 'none';\r\n // apply ADA\r\n observe(updateButton, 'keyup', function (e) {\r\n me.manageQtFocus.bind2(this, e, {\r\n msg: msgObj,\r\n context: me,\r\n eventType: 'onUpdateEvent',\r\n muteElements: [`#apexchat-btn-confirm-${msgObj.id}`]\r\n })(); // muting elements on selector wise\r\n // if (isAcceptKey(e)) {\r\n // me.onUpdateEvent.bind2(me, e, msgObj)();\r\n // } else {\r\n // //ApexChat.manageFocus(e, this);\r\n // }\r\n });\r\n }\r\n }\r\n sendResponse(sender, message, text, isSkipped) {\r\n sender.stopPropagation();\r\n sender.preventDefault(); // hack for fire fox\r\n var currentTarget = sender.currentTarget;\r\n import(\r\n /* webpackChunkName: \"sendQuetionTypeResponse\" */ '../core/hooks/sendQuetionTypeResponse'\r\n ).then((module) => {\r\n const sendQuetionTypeResponse = module.default;\r\n var sender2 = { ...sender };\r\n sender2.currentTarget = currentTarget;\r\n sendQuetionTypeResponse(this, sender2, message, text, isSkipped);\r\n });\r\n }\r\n bindUpdateClick(msgObj, clickHandler) {\r\n const me = this;\r\n const updateButtonId = `apexchat-btn-update-${msgObj.id}`;\r\n const updateButton = me.context.getElementById(updateButtonId);\r\n if (updateButton) {\r\n observe(\r\n updateButton,\r\n 'click',\r\n me.onUpdateEvent.bind2(me, msgObj, clickHandler)\r\n );\r\n // me.$(updateButton).hide();\r\n }\r\n }\r\n\r\n /**\r\n responses and then call the responseCallback passing that response\r\n */\r\n\r\n clearToUpdate(message) {\r\n const me = this;\r\n const response = {\r\n chatId: me.options.chatId,\r\n agentScriptAnswerId: message.scriptAnswerId,\r\n chatLogId: message.id,\r\n isUpdating: true\r\n };\r\n // make selected option part of Q-type response\r\n response.answers = JSON.stringify(me.answers);\r\n // make selected option flat string text for DB dsiplay area\r\n response.msgText = getItemValues(me.answers);\r\n // CHATLOG_ID will be set 0 in case of first time chosen answer of QT\r\n if (me.CHATLOG_ID == -1) {\r\n me.CHATLOG_ID = 0;\r\n }\r\n response.questionTypeChatLogIdToBeUpdated = me.CHATLOG_ID;\r\n me.options.responseCallback\r\n ? me.options.responseCallback(response)\r\n : (function () {\r\n console.log('No callback defined for sending Q type update');\r\n })();\r\n // reset and clear things\r\n me.answers = [];\r\n $txt.val('');\r\n }\r\n\r\n /**\r\n disables or hides Question Type controls for any further interaction after submit\r\n */\r\n afterSubmit() {\r\n const me = this;\r\n me.$('.update_dot', me.context).each(function (index) {\r\n me.$(this).hide();\r\n });\r\n me.$('.apexchat_question_type_update_button', me.context).each(function (index) {\r\n me.$(this).hide().parent().hide();\r\n });\r\n me.$('.apexchat_question_type_styled_input_container', me.context).each(function (index) {\r\n me.$(this).disable();\r\n });\r\n me.$('.apexchat_dynamic_question_type_input_controls', me.context).each(function (index) {\r\n me.$(this).disable();\r\n });\r\n me.$('.apexchat_question_confirm_or_skip_padding', me.context).each(function (index) {\r\n me.$(this).hide();\r\n });\r\n me.$('.apexchat_contact_qt_wrapper', me.context).hide();\r\n me.$('.apexchat_question_type_true_or_false', me.context).each(function (index) {\r\n me.$(this).disable({ recursively: true });\r\n });\r\n me.hideSkipButton(); // hide skip button when user submit the response.\r\n }\r\n\r\n hideSkipButton() {\r\n const me = this;\r\n if (me.options && me.options.msg && me.options.msg.isSkippable) {\r\n const skipButton = me.$(`#apexchat_skip_question_${me.options.msg.id}`, me.context);\r\n if (me.$(skipButton).is(':visible')) {\r\n skipButton.hide(); // hide skip button\r\n }\r\n }\r\n }\r\n\r\n // remove old classes and plugin new control; ref. CHAT-4778\r\n plugCustomDropbown(m) {\r\n const me = this;\r\n // MC\r\n removeClass(\r\n me.context.getElementById(`apexchat_question_type_multiple_choice_options_div_${m.id}`),\r\n 'apexchat_question_scripts_multiple_choice_as_list'\r\n );\r\n removeClass(\r\n me.context.getElementById(\r\n `apexchat_question_type_multiple_choice_as_list_select_control_${m.id}`\r\n ),\r\n 'apexchat_dynamic_question_type_input_controls'\r\n );\r\n me.context.getElementById(\r\n `apexchat_question_type_multiple_choice_as_list_select_control_${m.id}`\r\n );\r\n // TODO\r\n // .apexChatDropSelect({\r\n // context: me.context,\r\n // className: 'apexchat_question_type_dropSelect'\r\n // });\r\n // Time\r\n removeClass(\r\n me.context.getElementById(`apexchat_question_type_time_select_control_${m.id}`),\r\n 'apexchat_dynamic_question_type_input_controls'\r\n );\r\n removeClass(\r\n me.context.getElementById(`apexchat_question_type_time_${m.id}`),\r\n 'apexchat_question_scripts_time'\r\n );\r\n // TODO\r\n // me.$(`#apexchat_question_type_time_select_control_${m.id}`, me.context).apexChatDropSelect({\r\n // context: me.context,\r\n // className: 'apexchat_question_type_dropSelect',\r\n // width: '250px'\r\n // });\r\n\r\n // Time of Calender\r\n removeClass(\r\n me.context.getElementById(\r\n `apexchat_question_type_time_calendar_select_control_${m.id}`\r\n ),\r\n 'apexchat_dynamic_question_type_input_controls'\r\n );\r\n removeClass(\r\n me.context.getElementById(`apexchat_question_type_time_calendar_select_div_${m.id}`),\r\n 'apexchat_question_scripts_time_calendar'\r\n );\r\n //TODO\r\n // me.$(\r\n // `#apexchat_question_type_time_calendar_select_control_${m.id}`,\r\n // me.context\r\n // ).apexChatDropSelect({\r\n // context: me.context,\r\n // className: 'apexchat_question_type_dropSelect',\r\n // width: '250px'\r\n // });\r\n\r\n // to hide box, uncomment below\r\n // var apexchat_question_type_single_col = $('#apexchat_question_type_multiple_choice_options_div_' + m.id).parent();\r\n // ApexChat.addClass(apexchat_question_type_single_col[0], 'apexchat_transparent_question_type');\r\n }\r\n\r\n setContext(context) {\r\n this.context = context;\r\n }\r\n\r\n getContext() {\r\n return this.context;\r\n }\r\n\r\n getContextId() {\r\n return this.context.querySelector('div').id;\r\n }\r\n\r\n /**\r\n * After selection of multiple choice, hide last selected RD MC.\r\n * @param {object} msg- Message object\r\n */\r\n afterMCSelectionRD(msg) {\r\n const me = this;\r\n if (msg.questionType === ScriptsQuestionType.MultipleChoice) {\r\n const mcRadioContainer = me.$(\r\n '.apexchat_question_type_styled_input_container',\r\n me.context\r\n );\r\n const mcRadioLastContainer = mcRadioContainer.length - 1;\r\n if (mcRadioContainer[mcRadioLastContainer]) {\r\n mcRadioContainer[mcRadioLastContainer].remove();\r\n }\r\n }\r\n }\r\n\r\n isLastUnAnsweredMessage(msgObj, selectedOptions) {\r\n const me = this;\r\n const isLastMsg = me.isAgentLastMessage(msgObj);\r\n // checking visitor response\r\n if (\r\n (msgObj.visitorResponseStatus == ScriptVisitorResponseStatus.UnAnswered ||\r\n msgObj.visitorResponseStatus == ScriptVisitorResponseStatus.Updating) &&\r\n isLastMsg\r\n ) {\r\n return true;\r\n }\r\n // checking visitor select any option\r\n if (!msgObj.visitorSelectedOptions && isLastMsg) {\r\n return true;\r\n }\r\n // checking & validation of JSON as checking length\r\n if ((!selectedOptions || selectedOptions.length == 0) && isLastMsg) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n","import questionTypeMultipleChoiceAsListTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/multiple_choice_display_as_list_question_template.ejs';\r\nimport questionTypeMultipleChoiceOptionsTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/multiple_choice_options_template.ejs';\r\nimport questionTypeNoneTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/none_question_type_message_template.ejs';\r\nimport questionTypeCalendarDateTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/calendar_date_question_template.ejs';\r\nimport questionTypeTimeOptionsTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/time_options_template.ejs';\r\nimport questionTypeTimeCalendarTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/time_calendar_question_template.ejs';\r\nimport questionTypeMultipleChoiceTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/multiple_choice_question_template.ejs';\r\nimport questionTypeTextTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/text_question_template.ejs';\r\nimport questionTypeTimeTemplatePrechat from '../../templates/question_types/prechat_rounded_theme/time_question_template.ejs';\r\n\r\nimport questionTypeTextTemplate from '../../templates/question_types/text_question_template.ejs';\r\nimport questionTypeTimeTemplate from '../../templates/question_types/time_question_template.ejs';\r\nimport questionTypeMultipleChoiceAsListTemplate from '../../templates/question_types/multiple_choice_display_as_list_question_template.ejs';\r\nimport questionTypeMultipleChoiceOptionsTemplate from '../../templates/question_types/multiple_choice_options_template.ejs';\r\nimport questionTypeNoneTemplate from '../../templates/question_types/none_question_type_message_template.ejs';\r\nimport questionTypeCalendarDateTemplate from '../../templates/question_types/calendar_date_question_template.ejs';\r\nimport questionTypeTimeOptionsTemplate from '../../templates/question_types/time_options_template.ejs';\r\nimport questionTypeTimeCalendarTemplate from '../../templates/question_types/time_calendar_question_template.ejs';\r\nimport questionTypeMultipleChoiceTemplate from '../../templates/question_types/multiple_choice_question_template.ejs';\r\n\r\nconst ImportQuestypeTemplateFactory = (isFromPreChat) => {\r\n if (isFromPreChat) {\r\n return {\r\n questionTypeTextTemplate: questionTypeTextTemplatePrechat,\r\n questionTypeTimeTemplate: questionTypeTimeTemplatePrechat,\r\n questionTypeMultipleChoiceAsListTemplate:\r\n questionTypeMultipleChoiceAsListTemplatePrechat,\r\n questionTypeMultipleChoiceOptionsTemplate:\r\n questionTypeMultipleChoiceOptionsTemplatePrechat,\r\n questionTypeNoneTemplate: questionTypeNoneTemplatePrechat,\r\n questionTypeCalendarDateTemplate: questionTypeCalendarDateTemplatePrechat,\r\n questionTypeTimeOptionsTemplate: questionTypeTimeOptionsTemplatePrechat,\r\n questionTypeTimeCalendarTemplate: questionTypeTimeCalendarTemplatePrechat,\r\n questionTypeMultipleChoiceTemplate: questionTypeMultipleChoiceTemplatePrechat\r\n };\r\n }\r\n return {\r\n questionTypeTextTemplate,\r\n questionTypeTimeTemplate,\r\n questionTypeMultipleChoiceAsListTemplate,\r\n questionTypeMultipleChoiceOptionsTemplate,\r\n questionTypeNoneTemplate,\r\n questionTypeCalendarDateTemplate,\r\n questionTypeTimeOptionsTemplate,\r\n questionTypeTimeCalendarTemplate,\r\n questionTypeMultipleChoiceTemplate\r\n };\r\n};\r\nexport default ImportQuestypeTemplateFactory;\r\n","const QuestionTypeVersion = {\r\n Classical: 0,\r\n RoundedDynamic: 1\r\n};\r\nexport default QuestionTypeVersion;\r\n","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += ' \\r\\n \\r\\n\\r\\n ' +\n((__t = ( ApexChat.getCurrentFormatedDateTime(createdOn, 'hh:mmtt' ) )) == null ? '' : __t) +\n'\\r\\n\\r\\n';\n\n}\nreturn __p\n}","module.exports = function(obj) {\nobj || (obj = {});\nvar __t, __p = '', __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\nwith (obj) {\n__p += '\\r\\n