(this.webpackJsonphal_frontend=this.webpackJsonphal_frontend||[]).push([[0],{100:function(e,t,n){},124:function(e,t,n){},125:function(e,t,n){},126:function(e,t,n){},128:function(e,t,n){},129:function(e,t,n){"use strict";n.r(t);var a=n(0),s=n.n(a),i=n(26),o=n.n(i),r=n(8),c=n.n(r),l=n(2),u=n(3),h=n(6),p=n(5),d=n(10),m=n(7),b=n(135),g=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getUserId",value:function(){var e=this.getUserIdFromStorage();return e||(e=Object(b.a)(),this.saveUserIdToStorage(e)),e}}]),t}(function(){function e(t){Object(l.a)(this,e),this.storageService=t}return Object(u.a)(e,[{key:"getUserId",value:function(){throw Error("Not implemented")}},{key:"getUserIdFromStorage",value:function(){return this.storageService.getUserId()}},{key:"saveUserIdToStorage",value:function(e){this.storageService.setUserId(e)}}]),e}()),f=n(35),v=n.n(f),y={standaloneAppUrl:"/bot/standalone",contextTimeoutInMills:6e5,events:{RESET_CONVERSATION:"RESET_CONVERSATION",MENU_ITEM:"MENU_ITEM"},actions:{MENU_ACTION:"drawer-menu-item"}},w=function(){function e(t,n,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window;Object(l.a)(this,e),this.HEADERS={"Content-Type":"application/json","Cache-control":"no-cache"},this.sessionId="",this.storageService=t,this.userId=n.getUserId(),this.appUrl=s.location.href,this.apiBaseUrl="https://api-annalytx-dev.k8sdev.infolytx.tech/api/",this.communicationMode=a.getCommunicationMode()}return Object(u.a)(e,[{key:"init",value:function(){var e,t;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e=this._getInitRequestData(),n.next=3,c.a.awrap(v.a.post(this.apiBaseUrl+"init",e,this.HEADERS));case 3:return t=n.sent,this.sessionId=t.data.data.session_id,this.action=t.data.data.action,this.context=t.data.data.context,this.storageService.setDialogAction(t.data.data.action),n.abrupt("return",t);case 9:case"end":return n.stop()}}),null,this)}},{key:"query",value:function(e){var t,n;return c.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=this._getQueryRequestData(e),a.next=3,c.a.awrap(v.a.post(this.apiBaseUrl+"query",t,this.HEADERS));case 3:if(800!==(n=a.sent).data.header.code){a.next=12;break}return this.sessionId=n.data.data.session_id,this.action=n.data.data.action,this.context=n.data.data.context,this.storageService.setDialogAction(n.data.data.action),a.abrupt("return",n);case 12:throw n.data.header.message;case 13:case"end":return a.stop()}}),null,this)}},{key:"_getInitRequestData",value:function(){var e={};return e.appURL=this.appUrl,e.user_id=this.userId,e.session_id=this.sessionId,e.communication_mode=this.communicationMode,e}},{key:"_getQueryRequestData",value:function(e){var t=e;return t.user_id=this.userId,t.session_id=this.sessionId,t.communication_mode=this.communicationMode,t.event in y.events||(t.context=this.context,t.action=this.storageService.getDialogAction()),t}}]),e}(),E={dialogAction:"".concat("hal_frontend",".dialog_action"),fileName:"".concat("hal_frontend",".file_name"),fileType:"".concat("hal_frontend",".file_type"),fileContent:"".concat("hal_frontend",".file_content"),userId:"".concat("hal_frontend",".user_id")},O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:localStorage;Object(l.a)(this,e),this.storage=t}return Object(u.a)(e,[{key:"getDialogAction",value:function(){return this.storage.getItem(E.dialogAction)}},{key:"setDialogAction",value:function(e){this.storage.setItem(E.dialogAction,e)}},{key:"setFile",value:function(e,t,n){this.storage.setItem(E.fileName,e),this.storage.setItem(E.fileType,t),this.storage.setItem(E.fileContent,n)}},{key:"getFile",value:function(){var e=this.storage.getItem(E.fileName),t=this.storage.getItem(E.fileType),n=this.storage.getItem(E.fileContent);return e&&t&&n?{fileName:e,fileType:t,fileContent:n}:null}},{key:"clearFile",value:function(){this.storage.removeItem(E.fileName),this.storage.removeItem(E.fileType),this.storage.removeItem(E.fileContent)}},{key:"setUserId",value:function(e){this.storage.setItem(E.userId,e)}},{key:"getUserId",value:function(){return this.storage.getItem(E.userId)}}]),e}(),S=function e(){Object(l.a)(this,e)};S.TEXT="text",S.VOICE="voice";var C=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;Object(l.a)(this,e),this.DEFAULT_COMMUNICATION_MODE=S.TEXT,this.COMMUNICATION_MODE_PARAM_NAME="communication_mode",this.windowObject=t}return Object(u.a)(e,[{key:"getCommunicationMode",value:function(){return new URLSearchParams(this.windowObject.location.search).get(this.COMMUNICATION_MODE_PARAM_NAME)===S.VOICE?S.VOICE:S.TEXT}}]),e}(),k=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Object(l.a)(this,e),this.messageText=t,this.isUserMessage=n,this.images=[],this.buttons=[],this.discovery=[],this.followUpText="",this.datetimeInput="",this.checkboxItems=[],this.dropdownOptions=[],this.fileUploadOptions=[]}return Object(u.a)(e,[{key:"setImage",value:function(e){this.images=e}},{key:"setDiscovery",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.discovery=e,this.followUpText=t}},{key:"setFileUpload",value:function(e){this.fileUploadOptions=e}},{key:"setButton",value:function(e){this.buttons=e}},{key:"setButtonClickHandler",value:function(e){this.onOptionButtonClick=e}},{key:"setCheckbox",value:function(e){this.checkboxItems=e}},{key:"setCheckboxSubmitHandler",value:function(e){this.onCheckboxSubmit=e}},{key:"setDatetime",value:function(e){this.datetimeInput=e}},{key:"setDatetimeSubmitHandler",value:function(e){this.onDatetimeInputSubmit=e}},{key:"setDropdown",value:function(e){this.dropdownOptions=e}},{key:"setDropdownSubmitHandler",value:function(e){this.onDropdownSubmit=e}}]),e}(),T=function(){function e(t,n){Object(l.a)(this,e),this.preprocessorConfig=t.preprocessorConfig,this.postprocessorConfig=t.postprocessorConfig,this.preprocess=this.preprocess.bind(this),this.postprocess=this.postprocess.bind(this),this.storageService=n}return Object(u.a)(e,[{key:"process",value:function(e,t){var n=this.storageService.getDialogAction();return null!=t[n]?t[n].process(e):e}},{key:"preprocess",value:function(e){return this.process(e,this.preprocessorConfig)}},{key:"postprocess",value:function(e){return this.process(e,this.postprocessorConfig),e}}]),e}(),I=function(){function e(t){Object(l.a)(this,e),this.storageService=t,this.preprocessorConfig=this.getPreprocessorConfig(),this.postprocessorConfig=this.getPostprocessorConfig()}return Object(u.a)(e,[{key:"getPreprocessorConfig",value:function(){throw Error("Not implemented")}},{key:"getPostprocessorConfig",value:function(){throw Error("Not implemented")}}]),e}(),A=function(){function e(t){Object(l.a)(this,e),this.storageService=t}return Object(u.a)(e,[{key:"process",value:function(e){var t=e.data.data.reply,n=this.storageService.getFile();if(n){var a=this.getImageTag(n),s=t.replace("$image",a);e.data.data.reply=s,this.storageService.setDialogAction(""),this.storageService.clearFile()}}},{key:"getImageTag",value:function(e){if(!e.fileType||!e.fileContent)throw Error("Invalid image file");var t="data:".concat(e.fileType,";base64,").concat(e.fileContent);return"
")}}]),e}(),_=function(){function e(t){Object(l.a)(this,e),this.storageService=t}return Object(u.a)(e,[{key:"process",value:function(e){var t=this.storageService.getFile();return t&&(e.data={file_type:t.fileType,file_content:t.fileContent}),e}}]),e}(),j=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getPreprocessorConfig",value:function(){return{"snowsupport_get.remark":new _(this.storageService)}}},{key:"getPostprocessorConfig",value:function(){return{"snowsupport.show_summary":new A(this.storageService)}}}]),t}(I),x=function(){function e(t){Object(l.a)(this,e),this.storageService=t}return Object(u.a)(e,[{key:"process",value:function(e){var t=this.storageService.getFile();return t&&(e.data={file_name:t.fileName,file_content:t.fileContent},this.storageService.clearFile()),e}}]),e}(),M=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getPreprocessorConfig",value:function(){return{"anna_recruitment.coverLetter":new x(this.storageService)}}},{key:"getPostprocessorConfig",value:function(){return{}}}]),t}(I),N=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getPreprocessorConfig",value:function(){return{}}},{key:"getPostprocessorConfig",value:function(){return{}}}]),t}(I),P=function(){function e(){Object(l.a)(this,e)}return Object(u.a)(e,null,[{key:"getProcessorHandlerForAgent",value:function(e,t){switch(e){case"infolytx":var n=new M(t);return new T(n,t);case"clara":var a=new N(t);return new T(a,t);case"snowsupport":var s=new j(t);return new T(s,t);default:return null}}}]),e}(),B=function(){function e(t,n,a){Object(l.a)(this,e),this.botService=t,this.storageService=n,this.handleUserMessage=a;this.processorHandler=P.getProcessorHandlerForAgent("infolytx",this.storageService)}return Object(u.a)(e,[{key:"getMessages",value:function(){return c.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:throw Error("Not implemented");case 1:case"end":return e.stop()}}))}},{key:"prepareWelcomeMessagesFromResponse",value:function(e){var t=e.data.data,n=t.welcome_message,a=t.reply,s=t.welcome_button,i=new k(n=n||a);return i.setButton(s),i.setButtonClickHandler(this.handleUserMessage),[i]}},{key:"prepareQueryMessagesFromResponse",value:function(e){var t=[],n=e.data.data.reply,a=e.data.data.ir;return n?t=this.getTextMessagesFromResponse(e):a&&a.length>0&&(t=this.getDiscoveryMessagesFromResponse(e)),t}},{key:"getTextMessagesFromResponse",value:function(e){var t,n=[],a=e.data.data,s=a.reply,i=a.images,o=a.file_upload_options,r=a.suggestion_buttons,c=a.checkbox_options,l=a.datetime_options,u=a.dropdown_options;return(t=new k(s)).setImage(i),t.setFileUpload(o),t.setButton(r),t.setButtonClickHandler(this.handleUserMessage),t.setCheckbox(c),t.setCheckboxSubmitHandler(this.handleUserMessage),t.setDatetime(l),t.setDatetimeSubmitHandler(this.handleUserMessage),t.setDropdown(u),t.setDropdownSubmitHandler(this.handleUserMessage),n.push(t),n}},{key:"getDiscoveryMessagesFromResponse",value:function(e){var t,n=[];return e.data.data.ir.forEach((function(e){(t=new k).setDiscovery(e),n.push(t)})),n}},{key:"getErrorMessages",value:function(e){console.error(e);return[new k("I'm sorry, there seems to have been an issue. Please try again.")]}}]),e}(),U=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getMessages",value:function(e){var t,n,a;return c.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,t={text:encodeURIComponent(e),context:this.botService.context},n=this.getPreprocessedData(t),s.next=5,c.a.awrap(this.botService.query(n));case 5:return a=s.sent,a=this.getPostprocessedResponse(a),s.abrupt("return",this.prepareQueryMessagesFromResponse(a));case 10:return s.prev=10,s.t0=s.catch(0),s.abrupt("return",this.getErrorMessages(s.t0));case 13:case"end":return s.stop()}}),null,this,[[0,10]])}},{key:"getPreprocessedData",value:function(e){var t=e;return this.hasProcessorHandler()&&(t=this.processorHandler.preprocess(e)),t}},{key:"getPostprocessedResponse",value:function(e){var t=e;return this.hasProcessorHandler()&&(t=this.processorHandler.postprocess(e)),t}},{key:"hasProcessorHandler",value:function(){return void 0!==this.processorHandler}}]),t}(B),R=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getMessages",value:function(){var e;return c.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,c.a.awrap(this.botService.init());case 3:return e=t.sent,t.abrupt("return",this.prepareWelcomeMessagesFromResponse(e));case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",this.getErrorMessages(t.t0));case 10:case"end":return t.stop()}}),null,this,[[0,7]])}}]),t}(B),D=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getMessages",value:function(){var e,t;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e={text:".",event:y.events.RESET_CONVERSATION},n.next=4,c.a.awrap(this.botService.query(e));case 4:return t=n.sent,n.abrupt("return",this.prepareQueryMessagesFromResponse(t));case 8:return n.prev=8,n.t0=n.catch(0),n.abrupt("return",this.getErrorMessages(n.t0));case 11:case"end":return n.stop()}}),null,this,[[0,8]])}}]),t}(B),F=function(){function e(t){Object(l.a)(this,e),this.file={},this.storageService=t,this.readAndSaveFile=this.readAndSaveFile.bind(this)}return Object(u.a)(e,[{key:"readAndSaveFile",value:function(t,n){var a,s,i;return c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(a=e._getFileExtension(t.name),n.map((function(e){return e.toLowerCase()})).includes(a.toLowerCase())){o.next=4;break}return o.abrupt("return",{success:!1,message:"File type is not supported."});case 4:if(2,!(t.size>2e6)){o.next=7;break}return o.abrupt("return",{success:!1,message:"File size must be under ".concat(2,"MB.")});case 7:return o.prev=7,o.next=10,c.a.awrap(this.asyncFileReader(t));case 10:return s=o.sent,i=e._getFileContentWithoutPreamble(s),this.storageService.setFile(t.name,t.type,i),o.abrupt("return",{success:!0});case 16:throw o.prev=16,o.t0=o.catch(7),console.error(o.t0),o.t0;case 20:case"end":return o.stop()}}),null,this,[[7,16]])}},{key:"asyncFileReader",value:function(e){return c.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t,n){var a=new FileReader;a.onerror=n,a.onload=function(){t(a.result)},a.readAsDataURL(e)})));case 1:case"end":return t.stop()}}))}}],[{key:"_getFileExtension",value:function(e){return e.split(".").pop()}},{key:"_getFileContentWithoutPreamble",value:function(e){var t=e.indexOf(",");if(t<0)return e;var n=t+1;return e.substring(n)}}]),e}(),L=function(e){function t(){var e,n;Object(l.a)(this,t);for(var a=arguments.length,s=new Array(a),i=0;i0?"btn-toolbar":"";return s.a.createElement("span",{className:i},a)}}]),t}(a.Component)),Y=function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).state={selectedIndex:"-1"},n.handleButtonClick=n.handleButtonClick.bind(Object(d.a)(n)),n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"handleButtonClick",value:function(e){this.props.active&&(this.props.onOptionButtonClick(e.target.textContent),this.setState({selectedIndex:e.target.id}))}},{key:"render",value:function(){return s.a.createElement(W,{buttons:this.props.buttons,selectedIndex:this.state.selectedIndex,handleButtonClick:this.handleButtonClick})}}]),t}(a.Component),z=n(15),Q=n(37),q=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this;if(0===this.props.checkboxItems.length)return null;var t={color:"#555",marginLeft:"-23px",marginRight:"10px"},n=this.props.checkboxItems.map((function(n,a){return s.a.createElement("label",{htmlFor:n.id,key:a,className:"chatbot-checkbox-label"},s.a.createElement("input",{id:n.id,"data-index":a,type:"checkbox",className:"chatbot-checkbox",onChange:e.props.onCheckboxItemChange,checked:n.checked}),s.a.createElement(z.a,{style:t,icon:!0===n.checked?Q.a:Q.b}),n.text)})),a=s.a.createElement("button",{className:"chat-bot-choice-btn chatbot-btn btn btn-md ".concat(this.props.isSubmitted?"active":""),style:this.props.isSubmitted?{backgroundColor:"#3188ac",borderColor:"#3188ac"}:{borderColor:"#3188ac"},onClick:this.props.onCheckboxSubmit},this.props.buttonText);return s.a.createElement("div",{style:{marginTop:"6px"}},n,a)}}]),t}(a.Component),G=function(e){function t(e){var n;Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).selectedItemsToString=function(e){var t=[];return e.map((function(e){return e.checked?t.push(e.text):null})),t.join(", ")};var a=[];if(e.checkboxItems){var s=(new Date).getTime();a=e.checkboxItems.map((function(e,t){return{id:s+t,text:e,checked:!1}}))}return n.handleCheckboxItemChange=n.handleCheckboxItemChange.bind(Object(d.a)(n)),n.handleCheckboxSubmit=n.handleCheckboxSubmit.bind(Object(d.a)(n)),n.state={buttonText:"Next",isSubmitted:!1,checkboxItems:a},n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"handleCheckboxItemChange",value:function(e){if(this.props.active){var t=e.target.getAttribute("data-index");this.setState((function(e){return e.checkboxItems[t].checked=!e.checkboxItems[t].checked,{checkboxItems:e.checkboxItems}}))}else e.target.checked=!e.target.checked}},{key:"handleCheckboxSubmit",value:function(){if(this.props.active){var e=this.selectedItemsToString(this.state.checkboxItems);0===e.length&&(e=this.state.buttonText),this.props.onCheckboxSubmit(e),this.setState({isSubmitted:!0})}}},{key:"render",value:function(){return s.a.createElement(q,{checkboxItems:this.state.checkboxItems,isSubmitted:this.state.isSubmitted,buttonText:this.state.buttonText,onCheckboxItemChange:this.handleCheckboxItemChange,onCheckboxSubmit:this.handleCheckboxSubmit})}}]),t}(a.Component),V=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){if(!this.props.images)return null;var e=this.props.images.map((function(e,t){return s.a.createElement("div",{className:"row no-margin-horizontal",key:t},s.a.createElement("div",{className:"col-xs-6"},s.a.createElement("div",{className:"thumbnail chatbot-thumbnail sm-shadow"},s.a.createElement("a",{className:"chatbot-link",target:"_blank",href:e.link_url,rel:"noopener noreferrer"},s.a.createElement("img",{src:e.image_url,alt:e.caption}),s.a.createElement("div",{className:"caption"},s.a.createElement("b",null," ",e.caption," "),e.finish||e.warranty?s.a.createElement("hr",{className:"light-margin-vertical"}):null,e.warranty?s.a.createElement("div",null," ",e.warranty," ",s.a.createElement("br",null)," "):null,e.finish)))))}));return e.length>0?s.a.createElement("div",{className:"no-padding row container-fluid margin-top"},e):null}}]),t}(a.Component),X=n(24),K=n(27),J=n.n(K),Z=n(58),$=n.n(Z);n(92),n(93);var ee=function(e){return Object(a.useEffect)((function(){var e=document.querySelector("input.numInput.flatpickr-hour");e&&e.setAttribute("disabled",!0);var t=document.querySelector("input.numInput.flatpickr-minute");t&&t.setAttribute("disabled",!0)})),s.a.createElement("div",{className:"light-margin-vertical chatbot-datetime-input-container"},e.isSubmitted?null:s.a.createElement(s.a.Fragment,null,s.a.createElement($.a,{options:{inline:!0,mode:"single",minuteIncrement:1,enableTime:e.showTime,minDate:e.minDatetime,maxDate:e.maxDatetime,onChange:e.handleDatetimeInputChange},value:J()(e.selectedDatetime,e.datetimeFormatString).format()}),s.a.createElement("br",null)),s.a.createElement("div",{className:"chatbot-datetime-input-group form-inline"},s.a.createElement("input",{className:"form-control chatbot-datetime-input",value:e.selectedDatetime,readOnly:!0,disabled:!0}),s.a.createElement("button",{className:"btn btn-md ".concat(e.isSubmitted?"active":""),onClick:e.handleDatetimeInputSubmit,style:e.isSubmitted?{backgroundColor:"#3188ac",color:"white"}:{borderColor:"#3188ac"}},e.buttonText)))},te=function(){function e(){Object(l.a)(this,e)}return Object(u.a)(e,null,[{key:"isValidDateTimeObject",value:function(e){return!(!Array.isArray(e)||0===e.length||!(e[0]instanceof Date))}}]),e}();te.getCurrentDate=function(e,t){if(null==t)return e;var n=e.getTime()+6e4*e.getTimezoneOffset();return new Date(n+36e5*t)},te.getFormattedDatetimeForSelectedDateObject=function(e,t){if(!te.isValidDateTimeObject(e))throw Error("Invalid datetimeObj");return J()(e[0]).format(t)},te.submitDateTimeInput=function(e,t,n){return!!t&&(n(e),!0)};var ne=function(e){var t=new Date,n=null;void 0!==Object({NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_CLIENT:"infolytx",REACT_APP_IMG_SOURCE:"infolytx",REACT_APP_WEBSITE_TITLE:"Anna Lytx",REACT_APP_SUB_TITLE:"Data is at the heart of what we do",REACT_APP_WAITING_MESSAGE:"Agent is thinking",REACT_APP_API_BASE:"https://api-annalytx-dev.k8sdev.infolytx.tech/api/",REACT_APP_DEFAULT_ERROR_MESSAGE:"I'm sorry, there seems to have been an issue. Please try again.",REACT_APP_DEFAULT_OPTION_SUBMIT_TEXT:"Next",REACT_APP_PRIMARY_COLOR:"#3188ac",REACT_APP_CHAT_BUBBLE_SHOULD_DELAY:"true",REACT_APP_CHAT_BUBBLE_DELAY_IN_MILISECONDS:"2000",REACT_APP_NOTIFICATION_ENABLED:"true",REACT_APP_NOTIFICATION_DELAY_IN_MILISECONDS:"5000",REACT_APP_NOTIFICATION_BUBBLE_TEXT:"Hi, I'm Anna! How can I help you with Infolytx?",REACT_APP_SHOULD_SHOW_MENU:"true",REACT_APP_MENU_ITEMS:"About Us,Career,Focus Areas,Solutions,Development Process,Clients"}).REACT_APP_LOCALIZATION_OFFSET&&(n=parseInt(Object({NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_CLIENT:"infolytx",REACT_APP_IMG_SOURCE:"infolytx",REACT_APP_WEBSITE_TITLE:"Anna Lytx",REACT_APP_SUB_TITLE:"Data is at the heart of what we do",REACT_APP_WAITING_MESSAGE:"Agent is thinking",REACT_APP_API_BASE:"https://api-annalytx-dev.k8sdev.infolytx.tech/api/",REACT_APP_DEFAULT_ERROR_MESSAGE:"I'm sorry, there seems to have been an issue. Please try again.",REACT_APP_DEFAULT_OPTION_SUBMIT_TEXT:"Next",REACT_APP_PRIMARY_COLOR:"#3188ac",REACT_APP_CHAT_BUBBLE_SHOULD_DELAY:"true",REACT_APP_CHAT_BUBBLE_DELAY_IN_MILISECONDS:"2000",REACT_APP_NOTIFICATION_ENABLED:"true",REACT_APP_NOTIFICATION_DELAY_IN_MILISECONDS:"5000",REACT_APP_NOTIFICATION_BUBBLE_TEXT:"Hi, I'm Anna! How can I help you with Infolytx?",REACT_APP_SHOULD_SHOW_MENU:"true",REACT_APP_MENU_ITEMS:"About Us,Career,Focus Areas,Solutions,Development Process,Clients"}).REACT_APP_LOCALIZATION_OFFSET));var i=te.getCurrentDate(t,n),o=J()(i).format("MMM D, YYYY h:mm A"),r=Object(a.useState)(!1),c=Object(X.a)(r,2),l=c[0],u=c[1],h=Object(a.useState)(o),p=Object(X.a)(h,2),d=p[0],m=p[1],b=Object(a.useState)("Next"),g=Object(X.a)(b,1)[0];if(!e.datetimeInput)return null;var f=new Date(e.datetimeInput.start),v=i;return s.a.createElement(ee,{showTime:!0,maxDatetime:v,minDatetime:f,buttonText:g,isSubmitted:l,selectedDatetime:d,datetimeFormatString:"MMM D, YYYY h:mm A",handleDatetimeInputChange:function(e){var t=te.getFormattedDatetimeForSelectedDateObject(e,"MMM D, YYYY h:mm A");m(t)},handleDatetimeInputSubmit:function(){var t=te.submitDateTimeInput(d,e.active,e.onDatetimeInputSubmit);u(t)}})},ae=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){return this.props.text&&this.props.text.length>0?s.a.createElement("div",{className:"overrided-html",dangerouslySetInnerHTML:{__html:this.props.convertLinkToOpenNewTab(this.props.text)}}):null}}]),t}(a.Component),se=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"convertLinkToOpenNewTab",value:function(e){if(e.indexOf("/,"g");do{if(t=a.exec(e)){var s=t[0];if(s.indexOf("http")>=0){var i=s.replace(/=0){var t="translateX(-".concat(e.slideTranslation,"px)");this.scrollerStyle={transform:t,WebkitTransform:t,msTransform:t}}}},{key:"getItems",value:function(){return this.props.discoveryItems.results.map((function(e,t){return s.a.createElement("div",{key:t,className:"chatbot-dicovery-card"},s.a.createElement("div",{className:"chatbot-dicovery-card-title"},e.title),s.a.createElement("div",{className:"chatbot-dicovery-card-description"},e.description),s.a.createElement("div",{className:"chatbot-dicovery-card-link"},s.a.createElement("a",{href:e.link,target:"_blank",rel:"noopener noreferrer"},e.link)))}))}},{key:"render",value:function(){var e=this.getItems(),t=0===this.props.shownCard?{opacity:"0"}:{};return s.a.createElement("div",{id:"chatbotWebcardsComponent"},s.a.createElement("div",{className:"light-margin-bottom"},this.props.discoveryItems.text),s.a.createElement("div",{className:"chatbot-discovery-result-container"},s.a.createElement("div",{className:"chatbot-discovery-arrow-container"},s.a.createElement("div",{onClick:this.props.onClickLeftArrow,style:t,className:"chatbot-web-results-arrow-left chatbot-web-results-arrow"},s.a.createElement(z.a,{style:this.leftArrowIconStyle,icon:le.b})),s.a.createElement("div",{onClick:this.props.onClickRightArrow,hidden:this.props.shownCard===this.props.discoveryItems.results.length-1,className:"chatbot-web-results-arrow-right chatbot-web-results-arrow"},s.a.createElement(z.a,{style:this.rightArrowIconStyle,icon:le.c}))),s.a.createElement(ce.a,{onSwipeRight:this.props.onClickLeftArrow,onSwipeLeft:this.props.onClickRightArrow},s.a.createElement("div",{className:"chatbot-web-results-scrolling-div faster-transition",style:this.scrollerStyle},e))))}}]),t}(s.a.Component),he=function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).state={shownCard:0,slideTranslation:0,chatBubbleWidth:0},n.clickLeftArrow=n.clickLeftArrow.bind(Object(d.a)(n)),n.clickRightArrow=n.clickRightArrow.bind(Object(d.a)(n)),n.document=e.document||document,n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this.getChatBubbleWidth();this.setState({chatBubbleWidth:e})}},{key:"clickLeftArrow",value:function(e){if(0!==this.state.shownCard){var t=this.state.shownCard-1,n=t*(e-30);this.setState({shownCard:t,slideTranslation:n})}}},{key:"clickRightArrow",value:function(e){if(this.state.shownCard!==this.props.discoveryItems.results.length-1){var t=this.state.shownCard+1,n=t*(e-30);this.setState({shownCard:t,slideTranslation:n})}}},{key:"getSubstring",value:function(e,t){return e.length>t?e.substring(0,t)+"...":e}},{key:"hasUnevenHeight",value:function(e){var t=!0,n=!1,a=void 0;try{for(var s,i=e[Symbol.iterator]();!(t=(s=i.next()).done);t=!0)if(s.value.title.length>45)return!0}catch(o){n=!0,a=o}finally{try{t||null==i.return||i.return()}finally{if(n)throw a}}return!1}},{key:"getChatBubbleWidth",value:function(){var e=this.document.getElementsByClassName("chat-bubble")[0];return e?e.getBoundingClientRect().width:0}},{key:"render",value:function(){var e=this;if(!this.props.discoveryItems||0===this.props.discoveryItems.length)return null;var t=this.state.chatBubbleWidth;return s.a.createElement(ue,{shownCard:this.state.shownCard,getSubstring:this.getSubstring,onClickLeftArrow:function(){return e.clickLeftArrow(t)},onClickRightArrow:function(){return e.clickRightArrow(t)},discoveryItems:this.props.discoveryItems,slideTranslation:this.state.slideTranslation,chatBubbleWidth:t})}}]),t}(s.a.Component);n(96);function pe(e){var t=s.a.createElement("select",{disabled:e.isSubmitted,className:"chatbot-dropdown",ref:e.dropdownElementRef,style:{borderColor:"#3188ac"}},e.dropdownOptions.map((function(e,t){return s.a.createElement("option",{className:"chatbot-dropdown-item",key:t,value:e},e)}))),n=s.a.createElement("button",{className:"chat-bot-choice-btn chatbot-btn btn btn-md ".concat(e.isSubmitted?"active":""),style:e.isSubmitted?{backgroundColor:"#3188ac",borderColor:"#3188ac"}:{borderColor:"#3188ac"},onClick:e.handleDropdownSubmit},e.buttonText);return s.a.createElement("div",{className:"Bot-Option-Dropdown-View"},t,n)}function de(e){if(!e.dropdownOptions||0===e.dropdownOptions.length)return null;var t=s.a.createRef();return s.a.createElement(pe,{buttonText:"Next",isSubmitted:!e.active,dropdownElementRef:t,dropdownOptions:e.dropdownOptions,handleDropdownSubmit:function(){if(e.active){var n=t.current.value;e.onDropdownSubmit(n)}}})}n(97);var me=function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).state={hasError:!1,elevation:n.props.elevation||1},n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"getShadowClassName",value:function(e){switch(e){case 1:return"sm-shadow";case 2:return"lg-shadow";default:return"sm-shadow"}}},{key:"render",value:function(){var e=this,t={backgroundColor:"#3188ac"},n=function(t){return s.a.createElement("div",{className:"inline-flex"},s.a.createElement("div",{className:"float-left"},s.a.createElement("div",{className:"chat-icon bot-icon"})),s.a.createElement("div",{className:"".concat(e.getShadowClassName(e.state.elevation)," chat-bubble chat-bubble-bot tri-right left-top float-left")},s.a.createElement(se,{text:t}),s.a.createElement(V,{images:e.props.message.images}),s.a.createElement(he,{discoveryItems:e.props.message.discovery}),e.props.message.followUpText?s.a.createElement("div",null,s.a.createElement("br",null),s.a.createElement(se,{text:e.props.message.followUpText})):null,s.a.createElement(ne,{active:e.props.active,datetimeInput:e.props.message.datetimeInput,onDatetimeInputSubmit:e.props.message.onDatetimeInputSubmit}),s.a.createElement(oe,{active:e.props.active,allowedFileTypes:e.props.message.fileUploadOptions,onFileChange:e.props.onFileChange}),s.a.createElement(Y,{active:e.props.active,onOptionButtonClick:e.props.message.onOptionButtonClick,buttons:e.props.message.buttons}),s.a.createElement(G,{active:e.props.active,onCheckboxSubmit:e.props.message.onCheckboxSubmit,checkboxItems:e.props.message.checkboxItems}),s.a.createElement(de,{active:e.props.active,onDropdownSubmit:e.props.message.onDropdownSubmit,dropdownOptions:e.props.message.dropdownOptions}),e.props.children))},a=s.a.createElement("div",{className:"inline-flex"},s.a.createElement("div",{className:"sm-shadow chat-bubble chat-bubble-user float-right",style:t},this.props.message.messageText),s.a.createElement("div",{className:"float-right"},s.a.createElement("div",{className:"float-right chat-icon user-icon",style:t},s.a.createElement(z.a,{icon:le.j,style:{marginBottom:"3px"}})))),i=this.props.message.isUserMessage?a:n(this.props.message.messageText),o=this.props.message.isUserMessage?"user-message":"bot-message";return s.a.createElement("div",{className:"row no-margin-horizontal ".concat(o)},this.state.hasError?n("I'm sorry, there seems to have been an issue. Please try again."):i)}}],[{key:"getDerivedStateFromError",value:function(e){return{hasError:!0}}}]),t}(a.Component),be=(n(98),function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=s.a.createElement(me,{message:{userMessage:!1}},s.a.createElement("div",{className:"chatbot-loading-div"}));return s.a.createElement("div",null,this.props.show?e:null)}}]),t}(a.Component)),ge=function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"scrollToMessagesBottom",value:function(){var e=document.querySelector("#chatbotMessagesBody");e&&(e.scrollTop=this.messagesEnd.offsetTop)}},{key:"componentDidUpdate",value:function(){this.scrollToMessagesBottom()}},{key:"render",value:function(){var e=this,t={height:this.props.height},n=this.props.messages.map((function(t,n){return s.a.createElement(me,{onFileChange:e.props.handleFileUpload,key:n,message:t,active:e.props.messages.length===n+1})}));return s.a.createElement("div",{id:"chatbotMessagesBody",className:"chatbot-body padding",style:t},s.a.createElement("div",{id:"chatbotMessages",ref:function(t){e.chatbotMessages=t}},n,s.a.createElement(be,{show:this.props.showAgentThinking})),s.a.createElement("div",{ref:function(t){return e.messagesEnd=t},id:"messagesEndDiv",style:{position:"relative",bottom:0,left:0}}))}}]),t}(a.Component),fe=(n(99),function(e){function t(){return Object(l.a)(this,t),Object(h.a)(this,Object(p.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this;return s.a.createElement("div",{ref:"header",id:"chatbotHeader",style:{backgroundColor:"#3188ac"}},e.props.closeChatbotPopup?s.a.createElement("div",null,s.a.createElement(z.a,{style:{float:"right",marginTop:"4px",cursor:"pointer"},onClick:e.props.closeChatbotPopup,icon:le.i}),s.a.createElement(z.a,{size:"xs",style:{float:"right",marginTop:"6px",marginRight:"10px",cursor:"pointer"},onClick:e.props.onRefreshed,icon:le.h})):null,s.a.createElement("div",{style:{fontSize:"large"}},"Anna Lytx"))}}]),t}(s.a.Component)),ve=(n(100),n(60)),ye=n.n(ve),we=n(138),Ee=n(137),Oe=n(133),Se=n(134),Ce=n(136),ke=function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).state={userInput:"",showSpeechButton:n.handleShowSpeechButton(!0),showSpeechButtonTooltip:!1},n.handleChange=n.handleChange.bind(Object(d.a)(n)),n.handleSubmit=n.handleSubmit.bind(Object(d.a)(n)),n.toggleListening=n.toggleListening.bind(Object(d.a)(n)),n.handleKeyPress=n.handleKeyPress.bind(Object(d.a)(n)),n.handleItemClick=n.handleItemClick.bind(Object(d.a)(n)),n.toggleSpeechButtonTooltip=n.toggleSpeechButtonTooltip.bind(Object(d.a)(n)),n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"handleShowSpeechButton",value:function(e){return this.props.browserSupportsSpeechRecognition&&e}},{key:"handleItemClick",value:function(e){this.setState({userInput:""});var t={};t.text=e,t.action=y.actions.MENU_ACTION,t.event=y.events.MENU_ITEM,this.props.onMenuItemSubmit(t)}},{key:"handleKeyPress",value:function(e){13!==e.keyCode&&13!==e.which||this.handleSubmit(e)}},{key:"handleChange",value:function(e){var t=e.target.value,n=this.handleShowSpeechButton(!0);this.props.stopListening(),t&&(n=this.handleShowSpeechButton(!1)),this.setState({showSpeechButton:n,userInput:t})}},{key:"handleSubmit",value:function(e){e.preventDefault(),this.setState({showSpeechButton:this.handleShowSpeechButton(!0)});var t=this.getUserTextAndClearInput();t&&this.props.onUserInputSubmit(t)}},{key:"toggleListening",value:function(){this.props.listening?(this.props.stopListening(),this.props.transcript&&this.props.onUserInputSubmit(this.props.transcript)):this.props.startListening()}},{key:"toggleSpeechButtonTooltip",value:function(){this.setState({showSpeechButtonTooltip:!this.state.showSpeechButtonTooltip})}},{key:"getUserTextAndClearInput",value:function(){var e=this.state.userInput;return this.setState({userInput:""}),e}},{key:"getMenu",value:function(){var e=this,t="About Us,Career,Focus Areas,Solutions,Development Process,Clients".split(",");return s.a.createElement("div",{className:"dropup float-left",style:{width:"15%",height:"50px"}},s.a.createElement(we.a,{style:{width:"100%",height:"100%"}},s.a.createElement(Ee.a,{className:"drawer-button"},s.a.createElement(z.a,{icon:le.a})),s.a.createElement(Oe.a,null,s.a.createElement(Se.a,{onClick:this.props.onRefreshed},"Refresh"),s.a.createElement(Se.a,{divider:!0}),t.map((function(t,n){return s.a.createElement(Se.a,{key:n,onClick:function(n){return e.handleItemClick(t)}},t)})))))}},{key:"getSpeechButtonIcon",value:function(){return this.props.listening?s.a.createElement(z.a,{icon:le.g}):s.a.createElement(z.a,{style:{fontSize:"large"},icon:le.e})}},{key:"render",value:function(){var e=this,t={fontSize:this.props.isMobile?"16px":"1em"},n={backgroundColor:"#3188ac"},a=this.state.userInput.length>100?this.state.userInput.length:"";return s.a.createElement("div",null,this.getMenu(),s.a.createElement("div",{style:{position:"absolute",bottom:55,right:5,textAlign:"right",fontSize:"0.9em",color:"#9c9c9c"}}," ",a," "),s.a.createElement("input",{id:"chatbot-user-input",ref:function(t){return e.inputBar=t},style:t,autoComplete:"off",value:this.state.userInput,onChange:this.handleChange,onKeyPress:this.handleKeyPress,className:"chatbot-footer-input",placeholder:"Type your message here..."}),this.state.showSpeechButton?s.a.createElement("div",{onClick:this.toggleListening,id:"userInputSendButton",style:n},this.getSpeechButtonIcon(),s.a.createElement(Ce.a,{placement:"top",isOpen:this.state.showSpeechButtonTooltip,target:"userInputSendButton",toggle:this.toggleSpeechButtonTooltip},"Press on the microphone icon to begin speaking. Press again when done.")):s.a.createElement("div",{onClick:this.handleSubmit,id:"userInputSendButton",style:n},s.a.createElement(z.a,{icon:le.f})))}}]),t}(a.Component),Te=ye()({autoStart:!1,continuous:!1})(ke),Ie=(n(124),function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).window=e.window||window,n.state={messages:[],isAgentThinking:!0,isFetchingWelcomeMessage:!1},n.showUserMessage=n.showUserMessage.bind(Object(d.a)(n)),n.setContextTimeout=n.setContextTimeout.bind(Object(d.a)(n)),n.showBotQueryMessage=n.showBotQueryMessage.bind(Object(d.a)(n)),n.handleNewUserMessage=n.handleNewUserMessage.bind(Object(d.a)(n)),n.showBotTimeoutMessage=n.showBotTimeoutMessage.bind(Object(d.a)(n)),n.handleUserInputSubmit=n.handleUserInputSubmit.bind(Object(d.a)(n)),n.showFileUploadMessage=n.showFileUploadMessage.bind(Object(d.a)(n)),n.restart=n.restart.bind(Object(d.a)(n)),n.handleMenuItemSubmit=n.handleMenuItemSubmit.bind(Object(d.a)(n)),n.sessionStorageService=new O(sessionStorage),n.localStorageService=new O(localStorage),n.userService=new g(n.localStorageService),n.communicationService=new C,n.botService=new w(n.sessionStorageService,n.userService,n.communicationService),n.botWelcomeMessageService=new R(n.botService,n.sessionStorageService,n.handleNewUserMessage),n.botQueryMessageService=new U(n.botService,n.sessionStorageService,n.handleNewUserMessage),n.botTimeoutMessageService=new D(n.botService,n.sessionStorageService,n.handleNewUserMessage),n.botFileUploadMessageService=new L(n.botService,n.sessionStorageService,n.handleNewUserMessage),n.botEventQueryMessageService=new H(n.botService,n.sessionStorageService,n.handleNewUserMessage),n.conversationResetTimer=void 0,n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){console.log("From componentDidMount"),this.showBotWelcomeMessageAtTheFirstTime()}},{key:"componentDidUpdate",value:function(e,t){console.log("From componentDidUpdate",e,t,this.props,this.state),this.showBotWelcomeMessageAtTheFirstTime()}},{key:"showBotWelcomeMessageAtTheFirstTime",value:function(){this.props.isShown&&0===this.state.messages.length&&!this.state.isFetchingWelcomeMessage&&this.showBotWelcomeMessage()}},{key:"showBotWelcomeMessage",value:function(){var e;return c.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setState({isFetchingWelcomeMessage:!0}),t.next=3,c.a.awrap(this.botWelcomeMessageService.getMessages());case 3:e=t.sent,this.showBotMessages(e);case 5:case"end":return t.stop()}}),null,this)}},{key:"showBotQueryMessage",value:function(e){var t;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return this.setState({isAgentThinking:!0}),n.next=3,c.a.awrap(this.botQueryMessageService.getMessages(e));case 3:t=n.sent,this.showBotMessages(t);case 5:case"end":return n.stop()}}),null,this)}},{key:"showBotEventQueryMessage",value:function(e){var t;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return this.setState({isAgentThinking:!0}),n.next=3,c.a.awrap(this.botEventQueryMessageService.getMessages(e));case 3:t=n.sent,this.showBotMessages(t);case 5:case"end":return n.stop()}}),null,this)}},{key:"showBotMessages",value:function(e){this.setState((function(t){return{messages:t.messages.concat(e),isAgentThinking:!1,isFetchingWelcomeMessage:!1}}))}},{key:"handleUserInputSubmit",value:function(e){this.state.isAgentThinking||this.handleNewUserMessage(e)}},{key:"handleMenuItemSubmit",value:function(e){this.state.isAgentThinking||(this.showUserMessage(e.text),this.showBotEventQueryMessage(e),this.setContextTimeout())}},{key:"showFileUploadMessage",value:function(e,t){var n,a,s,i;return c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return this.setState({isAgentThinking:!0}),n=this.state.messages,a=e[0],o.next=5,c.a.awrap(this.botFileUploadMessageService.getMessages(n,a,t));case 5:s=o.sent,i=this.botFileUploadMessageService.getFileUploadStatus(),this.showBotMessages(s),i.success&&this.showBotQueryMessage("upload");case 9:case"end":return o.stop()}}),null,this)}},{key:"handleNewUserMessage",value:function(e){this.showUserMessage(e),this.showBotQueryMessage(e),this.setContextTimeout()}},{key:"showUserMessage",value:function(e){var t=new k(e,!0);this.setState((function(e){return{messages:e.messages.concat(t)}}))}},{key:"setContextTimeout",value:function(){this.window.clearTimeout(this.conversationResetTimer),this.conversationResetTimer=this.window.setTimeout(this.showBotTimeoutMessage,y.contextTimeoutInMills)}},{key:"showBotTimeoutMessage",value:function(){var e;return c.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setState({isAgentThinking:!0}),t.next=3,c.a.awrap(this.botTimeoutMessageService.getMessages());case 3:e=t.sent,this.showBotMessages(e);case 5:case"end":return t.stop()}}),null,this)}},{key:"restart",value:function(){this.state.isAgentThinking||(this.setState({messages:[],isAgentThinking:!0,isFetchingWelcomeMessage:!1}),this.window.clearTimeout(this.conversationResetTimer))}},{key:"render",value:function(){var e=this.props.isMobile,t=this.state.messages,n=this.state.userInput,a=this.state.isAgentThinking,i=this.props.isDesktopAndPopup,o=this.props.chatbotBodyHeight,r=this.props.isShown?{opacity:1,visibility:"visible"}:{opacity:0,visibility:"hidden"},c="transition "+(i?"chatbot-popup-fixed":"chatbot-fullscreen");return s.a.createElement("div",{style:r,className:c},s.a.createElement(fe,{closeChatbotPopup:this.props.hideBot,onRefreshed:this.restart}),s.a.createElement(ge,{showAgentThinking:a,height:o,messages:t,userInput:n,handleFileUpload:this.showFileUploadMessage}),s.a.createElement(Te,{isMobile:e,userInput:n,onUserInputSubmit:this.handleUserInputSubmit,onMenuItemSubmit:this.handleMenuItemSubmit,onRefreshed:this.restart}))}}]),t}(a.Component)),Ae=function(){function e(){Object(l.a)(this,e)}return Object(u.a)(e,null,[{key:"isMobile",value:function(){return/Mobi/.test(navigator.userAgent)||window.parent.innerWidth<500}}]),e}();n(125);var _e,je=(_e=Ie,function(e){function t(e){var n;Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).chatbotPopupButtonHeight=210,n.totalHeightsToRemove=90,n.updateUiConfigs();var a=n.getChatbotBodyHeight();return n.state={chatbotBodyHeight:a},n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){this.setupWindowResizeHandler()}},{key:"componentDidUpdate",value:function(){this.resizeParentIframe()}},{key:"setupWindowResizeHandler",value:function(){var e=this;this.windowObject.addEventListener("resize",(function(){e.handleWindowSizeChange()}))}},{key:"handleWindowSizeChange",value:function(){this.updateUiConfigs();var e=this.getChatbotBodyHeight();this.setChatbotBodyHeight(e)}},{key:"setChatbotBodyHeight",value:function(e){this.setState({chatbotBodyHeight:e})}},{key:"updateUiConfigs",value:function(){this.windowObject=this.props.window||window,this.isMobile=Ae.isMobile(),this.isPopup=this.props.isPopup||!1,this.isDesktopAndPopup=!this.isMobile&&this.isPopup}},{key:"getIframeHeight",value:function(){return this.isDesktopAndPopup?"calc(100vh - ".concat(this.totalHeightsToRemove,"px)"):this.windowObject.innerHeight-110}},{key:"getChatbotBodyHeight",value:function(){return this.isDesktopAndPopup?this.getChatbotBodyHeightDesktop():this.getChatbotBodyHeightMobile()}},{key:"getChatbotBodyHeightDesktop",value:function(){return"calc(100vh - ".concat(this.chatbotPopupButtonHeight,"px)")}},{key:"getChatbotBodyHeightMobile",value:function(){return"calc(100vh - ".concat(this.totalHeightsToRemove,"px)")}},{key:"resizeParentIframe",value:function(){var e=this.windowObject.parent.document.getElementById("itx-widget");e&&(this.windowObject.innerHeight=this.windowObject.parent.innerHeight,this.windowObject.innerWidth=this.windowObject.parent.innerWidth,this.windowObject.parent.document.body.style.maxHeight="",this.windowObject.parent.document.body.style.overflow="",this.windowObject.parent.document.documentElement.style.overflow="",this.props.isShown?this.isMobile?(e.style.width="100%",e.style.height="100%",this.windowObject.parent.document.body.style.maxHeight="100vh",this.windowObject.parent.document.body.style.overflow="hidden",this.windowObject.parent.document.documentElement.style.overflow="hidden"):(e.style.width="430px",e.style.height=this.getIframeHeight()):(e.style.width="90px",e.style.height="90px"))}},{key:"render",value:function(){return s.a.createElement(_e,Object.assign({},this.props,{isMobile:this.isMobile,isDesktopAndPopup:this.isDesktopAndPopup,chatbotBodyHeight:this.state.chatbotBodyHeight}))}}]),t}(a.Component)),xe=(n(126),function(e){function t(e){var n;return Object(l.a)(this,t),(n=Object(h.a)(this,Object(p.a)(t).call(this,e))).state={shouldShowNotification:!1,notificationSound:!1,notificationText:!1},n}return Object(m.a)(t,e),Object(u.a)(t,[{key:"componentDidMount",value:function(){var e=this;setTimeout((function(){e.setState({shouldShowNotification:!0})}),"5000")}},{key:"getNotification",value:function(){return s.a.createElement("div",null,this.getNotificationSound(),this.getNotificationTextBubble())}},{key:"getNotificationSound",value:function(){return s.a.createElement("iframe",{title:"Notification Sound",src:"https://dpsrpkmui3m6x.cloudfront.net/Audios/notification.mp3",allow:"autoplay",className:"hidden",id:"iframeAudio"})}},{key:"getNotificationTextBubble",value:function(){var e=this;return s.a.createElement("div",{className:"notification-bubble"},s.a.createElement("div",{className:"float-right remove-notification-bubble",onClick:function(){e.setState({shouldShowNotification:!1})}},s.a.createElement(z.a,{icon:le.i,style:{color:"white"}})),s.a.createElement(me,{message:new k("Hi, I'm Anna! How can I help you with Infolytx?",!1),elevation:2}))}},{key:"render",value:function(){if(Ae.isMobile()&&this.props.isShown)return null;var e=this.props.isShown?le.i:le.d;return s.a.createElement("div",{className:"chatbot-popup-button-container transition"},s.a.createElement("div",{onClick:this.props.onClick,style:{backgroundColor:"#3188ac"},className:"chatbot-popup-button transition"},s.a.createElement(z.a,{icon:e})),this.props.shouldNotify&&this.state.shouldShowNotification?this.getNotification():null)}}]),t}(a.Component));var Me=function(){var e=Object(a.useState)(!1),t=Object(X.a)(e,2),n=t[0],i=t[1],o=Object(a.useState)(!0),r=Object(X.a)(o,2),c=r[0],l=r[1];return s.a.createElement(s.a.Fragment,null,s.a.createElement(xe,{isShown:n,shouldNotify:c,onClick:function(){i(!n),l(!1)}}),s.a.createElement(je,{isPopup:!0,isShown:n,hideBot:function(){return i(!1)}}))};n(127);n(128);var Ne=document.getElementById("botContainer");function Pe(e,t){Ne.className=t,o.a.render(e,Ne)}window.location.pathname.includes(y.standaloneAppUrl)||"standalone"===Object({NODE_ENV:"production",PUBLIC_URL:"",REACT_APP_CLIENT:"infolytx",REACT_APP_IMG_SOURCE:"infolytx",REACT_APP_WEBSITE_TITLE:"Anna Lytx",REACT_APP_SUB_TITLE:"Data is at the heart of what we do",REACT_APP_WAITING_MESSAGE:"Agent is thinking",REACT_APP_API_BASE:"https://api-annalytx-dev.k8sdev.infolytx.tech/api/",REACT_APP_DEFAULT_ERROR_MESSAGE:"I'm sorry, there seems to have been an issue. Please try again.",REACT_APP_DEFAULT_OPTION_SUBMIT_TEXT:"Next",REACT_APP_PRIMARY_COLOR:"#3188ac",REACT_APP_CHAT_BUBBLE_SHOULD_DELAY:"true",REACT_APP_CHAT_BUBBLE_DELAY_IN_MILISECONDS:"2000",REACT_APP_NOTIFICATION_ENABLED:"true",REACT_APP_NOTIFICATION_DELAY_IN_MILISECONDS:"5000",REACT_APP_NOTIFICATION_BUBBLE_TEXT:"Hi, I'm Anna! How can I help you with Infolytx?",REACT_APP_SHOULD_SHOW_MENU:"true",REACT_APP_MENU_ITEMS:"About Us,Career,Focus Areas,Solutions,Development Process,Clients"}).REACT_APP_DEFAULT_MODE?Pe(s.a.createElement(je,{isShown:!0}),"chatbot-fullscreen"):function(){setTimeout(Pe,"2000",s.a.createElement(Me,null),"chatbot-popup")}()},63:function(e,t,n){e.exports=n(129)},85:function(e,t,n){},93:function(e,t,n){},94:function(e,t,n){},96:function(e,t,n){},97:function(e,t,n){},98:function(e,t,n){},99:function(e,t,n){}},[[63,1,2]]]);
//# sourceMappingURL=main.8090d794.chunk.js.map