/*! lp-unified-window 10.43.1 2025-06-05 11:56 */ function LocalizationHelper(e){var a,t={"he-IL":!0,"ar-AE":!0},o={LTR:"lp_ltr",RTL:"lp_rtl"};function s(e){return!0===t[e]}return a=e.util,{applyDirOnElement:function(e,t,i){var n=s(i)?"RTL":"LTR",i=s(i)?"LTR":"RTL";(function(e,t){var i="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿Ⰰ-﬜﷾-﹯﻽-￿",n="֑-߿יִ-﷽ﹰ-ﻼ";e="rtl"===e.toLowerCase()?new RegExp("^[^"+n+"]*["+i+"]"):new RegExp("^[^"+i+"]*["+n+"]");return!e.test(t)})(n,t)?(a.addClass(e,o[n]),a.removeClass(e,o[i])):(a.addClass(e,o[i]),a.removeClass(e,o[n]))},isLanguageRTL:s}}function SurveyManager(s){var a,o,t,r,l,d,c,u,p,h,f;return!!(this!==window&&s&&s.rootElem&&s.survey)&&(t=s&&s.startTabIndex||500,r=N(),l=[],d=[],c=new lpTag.taglets.SurveyLogic(s.survey),u={question:"q_",checkbox:"cb_",radioButton:"rb_",select:"sel_",textArea:"txar_",input:"txt_",label:"lbl_"},p="error",h={info:"lp_survey_info",error:"lp_error",success:"lp_success"},f=(function(e){for(var t=document.createDocumentFragment(),i=0;i(new Date).getMilliseconds(),d.inSample)&&(window.lpTaglogListeners.push(function(e,t,i){var n;t&&o[t]<=d.level&&p&&-1===a.indexOf(s,i)&&(n=t,n={accountId:lpTag.site,appVersion:lpTag.taglets.lpUnifiedWindow.v,context:"webMessaging",immediate:!0,logLevel:t,msg:t+" : "+i+" : "+e,time:(new Date).toISOString(),trace:!1,url:window.location.href},u.push(n))}),g())},error:h,info:function(e,t){i(e,"INFO",t||n)},debug:function(e,t){i(e,"DEBUG",t||n)},setLogLevel:f,logLevels:o,events:t,triggerEvent:function(e){switch(e){case t.APP_STARTED:p=!0;break;case t.APP_ENDED:p=!1}},loggosLogging:d,loggosLogQueue:u}})(),window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.apps={AUTHENTICATION:"authenticationDelegate",STEP_UP:"stepUpManager",CHAT:"API",CHAT_STATE:"ChatStateManager",APPLICATION:"EmbeddedWindowApplication",HEARTBEAT:"HeartBeatManager",UISTATE:"UIStateManager",UNIFIED_WINDOW:"lpUnifiedWindow",SECURE_FORM:"leSecureForm",WINDOW_SDK:"windowSDK",COBROWSE:"cobrowse",RICH_CONTENT:"richContent",FILE_SHARE:"fileShare",QUICK_REPLIES:"quickReplies",MAVEN_PAY:"mavenPay",DATE_PICKER:"datePicker",SCHEDULE_LIST:"scheduleList"},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.events={chat:{ERROR:"error",INITIALIZED:"initialized",BLOD:"blueLightOfDeath(Ended)",CHATTING:"chatting",STATE:"state",CONVERSATION_STATE:"conversationState",DIALOG_STATE:"dialogState",CONVERSATION_CLOSED:"conversationClosed",CHAT_INFO:"chatInfo",USER_INFO:"userInfo",USER_LEFT:"userLeft",ENGAGEMENT_DATA:"engagementData",LINE:"line",COLLABORATION:"collaboration",SECURE_FORM:"leSecureForm",FINISHED_EVENTS_BULK:"finishEventsBulk",AGENT_TYPING:"agentIsTyping",AVAILABILITY:"availability",SURVEY_ERROR:"surveyError",SURVEY_SERVER_ERROR:"surveyServerError",EMAIL_TRANSCRIPT_SUCCESS:"emailTranscriptSuccess",EMAIL_TRANSCRIPT_ERROR:"emailTranscriptError",AUTHENTICATION_ERROR:"authenticationError",START_CHAT_INFO:"startChatInfo",TTR_INFO:"ttrInfo",CSAT_INFO:"csatInfo",BRAND_INFO:"brandInfoReceived",CONVERSATION_OWNER_BRAND_INFO:"conversationOwnerBrandInfoReceived",CONVERSATION_CONTENT:"conversationContent",SUBSCRIBE_MESSAGING_EVENTS_RESPONSE:"subscribeMessagingEventsResponse",CONVERSATION_HISTORY:"conversationHistory",NEW_CONVERSATION_REQUESTED:"newConversationRequested",NEW_CONVERSATION_CREATED:"newConversationCreated",MULTIPLE_CHANNELS_REQUESTED:"multipleChannelsRequested",SESSION_DATA:"sessionData",NO_SESSION:"noSession",FAILED_START_CONVERSATION:"failedStartConversation",FORGET_ME:"forgetMe",SET_REFRESH_MODEL_DELAY:"setRefreshModelDelaySec",CLOSE_WINDOW_FORGET_ME:"closeWindowForgetMe",DELETE_CONVERSATION_SUBSCRIPTION:"onDeletedSubscriptionFromConversation",CONVERSATION_STEP_UP:"onConversationStepUp",SIGNAL_OUT:"SIGNAL_OUT",SIGNAL_IN:"SIGNAL_IN"},socket:{CONNECTED:"socketConnected",INITIALIZED:"socketInitialized",DISCONNECTED:"socketDisconnected",NON_RESPONSIVE:"socketNonResponsive",PING_SUCCESS:"pingSuccess"},application:{PROCESSING:"processing",OFFLINE_SURVEY:"offlineSurvey",PRE_CHAT_SURVEY:"preChatSurvey",POST_CHAT_SURVEY:"postChatSurvey",PRE_SMS_FORM:"preSmsForm",PRE_SMS_FORM_EXIT:"preSmsFormExit",END_CHAT:"endChat",END_SURVEY:"endSurvey",ENDED:"appEnded",DO_HARAKIRI:"doHaraKiri(Seppuku)"},heartBeat:{INIT:"init",FAILED:"failed",RESUMED:"resumed"},uiState:{POP_OUT:"popOut",EMBEDDED_CHANGED:"embeddedChanged",MAXIMIZED:"maximized",MINIMIZED:"minimized",ACTIONS_TOGGLE:"actionsToggle",SEND_BUTTON:"sendButton",INPUT:"input",PAPER_PLANE_BUTTON:"paperPlaneButton",FOCUS_CHANGE_EVENT:"focusChanged",EMOJI_FOCUS_ON_CLICK:"emojiFocus"},chatState:{ENDED:"ended"},unifiedWindow:{MAXIMIZE:"maximize"},viewController:{INITIATE_END_CHAT:"endChatInitiate",CLICKED:"clicked",DIALOG:"dialog",DIALOG_CLOSED:"dialogClosed",DIALOG_STATE_CHANGED:"dialogStateChanged",SLIDER_CLOSED:"sliderClosed",PREPARE_SLIDER_CLOSED_TIMEOUT:"prepareSliderCloseTimeout",SLIDER_VIEW_CHANGE:"sliderViewChange",CLOSE_ACTIONS:"closeActions",VISITOR_HAS_TYPED:"visitorHasTyped",MAXIMIZE_VISIBLE:"maximizeVisible",MINIMIZE_VISIBLE:"minimizeVisible",LINE_ADDED:"lineAdded",LINES_VIEWED:"linesViewed",CONVERSATIONS_VIEWED:"conversationsViewed",RETRY_GET_HISTORY:"retryGetHistory",END_OF_HISTORY:"endOfHistory",CB_OFFER:"cbOffer",THANK_YOU_PAGE:"thankYouPage",SHOW_FORGET_ME:"forgetMeDialog",CLOSE_WINDOW_FORGET_ME:"closeWindowForgetMe",LINE_UPDATE:"lineUpdate",UPDATE_TIME_STAMP:"updateTimeStamp",UPDATE_ACCESSIBILITY_MESSAGE:"updateAccessibilityMessage",SCROLL_CONVERSATION_TO_BOTTOM:"scrollConversationToBottom",FLUTTER_OPEN:"flutterOpen",FLUTTER_CLOSE:"flutterClose",FLUTTER_IS_CLOSED:"flutterIsClosed",FLUTTER_STYLE_UPDATE:"flutterStyleUpdate",DATE_PICKER_SHOW:"DatePickerShow",ADD_PRODUCT_DETAILS:"addProductDetails",SCHEDULE_LIST_SHOW:"ScheduleListShow",HISTORY_TRY_NEXT:"historyTryNext"},coBrowseEvents:{OFFERED:"cobrowseOffered",ACCEPTED:"cobrowseAccepted",DECLINE:"cobrowseDeclined",TIMEOUT:"cobrowseTimeout",INVITED:"cobrowseInvited",STARTED:"sessionStarted",RESUME:"sessionResume",ERROR:"sessionError",CANCELED:"cobrowseCanceled",DIALOG_CREATED:"cobrowseDialogCreated",RENDER_CALL_SCREEN:"cobrowseRenderCallScreen",SLIDER_OPENED:"sliderOpened",MAXIMIZE:"maximize"},widgetSDK:{INIT:"init",PARTICIPANTS:"participants",MESSAGES:"messages",WIDGET_AREA_STATE:"widgetAreaState",CONVERSATION_STATE:"conversationState",CONVERSATION_INFO:"conversationInfo",ENGAGEMENT_INFO:"engagementInfo",NOTIFICATION:"notification",VISITOR_TYPING:"visitorTyping",AGENT_TYPING:"agentTyping",DISPOSED_WIDGET_ID:"disposedWidgetID",INITIATED_WIDGET_ID:"initiatedWidgetID",WIDGET_NOTIFICATION:"widgetNotification"},imageShare:{IMAGE_SELECTED:"imageSelected",FILE_UPLOAD_URL_READY:"fileUrlGenerated",FILE_DONE_UPLOADED:"fileUploaded",FILE_UPLOAD_RETRY:"fileUploadRetry",FILE_DOWNLOAD_REQUEST:"fileDownloadRequest",SHOW_PREVIEW:"showPreview",OVERLAY_CLOSED:"overlayClosed",IMAGE_PREVIEW_CLOSED:"ImagePreviewClosed",IMAGE_PREVIEW_SHOW:"ImagePreviewShow",FILE_VALIDATION:"fileValidation"},richContent:{DISABLE_RICH_CONTENT:"disableRichContent",UPDATE_RICH_CONTENT_LINE:"updateRCLine"},wrapperWindowExtender:{WINDOW_SCALE_SET:"windowScaleSet"},accessibility:{SET_INPUT_FOCUS:"setInputFocus"}},lpTag.unifiedWindow.publicEvents=lpTag.unifiedWindow.publicEvents||{API:{state:[{appName:"lpUnifiedWindow",eventName:"state",data:{state:"data"}},{appName:"ChatAPIV3",eventName:"state",data:"data"}],chatInfo:{appName:"lpUnifiedWindow",eventName:"conversationInfo",data:{agentName:"data.agentName",agentId:"data.agentId",conversationId:"data.rtSessionId",state:"data.chatState",monitoringSessionId:"data.monitoringSessionId",visitorId:"data.visitorId",skill:"data.skill",skillName:"data.skillName",engagementId:"data.engagementId",campaignId:"data.campaignId",language:"data.language",engagementName:"data.engagementName"}}}},lpTag.unifiedWindow.SurveyType={PRE_CHAT:"PreChatSurvey",EXIT_CHAT:"ExitSurvey",OFFLINE:"OfflineSurvey",CSAT:"CSAT",PRE_SMS:"PreSmsSurvey"},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.consts={dialog:{actions:{CONFIRM:"confirm",CANCEL:"cancel"}},views:{TOP_MENU:"topMenu",ACTION_MENU:"actionMenu"},chatEvents:{LINE:"line",INFO:"info",COBROWSE:"cobrowse",SECURE_FORM:"leSecureForm",RICH_CONTENT:"richContent",FILE_SHARING:"hosted/file",MAVEN_PAY:"mavenPay"},errorTypes:{CONNECTION_UNAVAILABLE:"CONNECTION_UNAVAILABLE",AUTH_ERROR:"AUTH_ERROR",FAILED_START_CONVERSATION_ERROR:"FAILED_START_CONVERSATION_ERROR"},authErrorsTypes:{EXPIRED:"expired",INVALID_SESSION:"invalidSession",LOGOUT:"logout"},SecureForm:{LINK_CLICKED:"secureFormClicked",HIDE_CONVO:"hideMessagingConversation"},RichContent:{ACTION:"richContentAction",RICH_CONTENT_LINE:"rich-content",RICH_CONTENT_TYPE:"richcontent",LINK_CLICKED:"richContentLinkClicked"},engagementContainerClass:"LPMcontainer",reCaptchaContainerClass:"reCaptchaContainer",authConnectorTypes:{S2S:0,OAUTH_IMPLICIT:1,OAUTH_CODE:2,STEP_UP:3},defaultRedirectUri:"https://liveperson.net",slider:{viewType:{widgetSDKView:"widgetSDKView",PCIFormView:"pciFormView",CoBrowseInvite:"cobrowseInviteView",CoBrowseCallConnecting:"cobrowseCallConnectingView",RichContentLinkAction:"richContentLinkAction",MavenPayLinkView:"MavenPayLinkView"}},widgetSDK:{WIDGET_NAME:"widgetName",AGENT:"agent",AGENT_ID:"agentId",VISITOR:"visitor",VISITOR_ID:"visitorId",SESSION_ID:"sessionId",MONTORING_SESSION_ID:"monitoringSessionId",ACCOUNT_ID:"accountId",CHANNEL_TYPE_MESSAGING:"messaging",CHANNEL_TYPE_CHAT:"chat",contentType:{text:"text/message",richContent:"text/richContent"}},csatStatus:{FILLED:"FILLED",PARTIALLY_FILLED:"PARTIALLY_FILLED",SKIPPED:"SKIPPED",EMPTY:"EMPTY"},coBrowse:{acceptedCoBrowseModes:["view","shared","follow","VIDEO_CALL","VOICE_CALL"],coBrowseChannelName:"COBROWSE"},engagementTypes:{CHAT_ENGAGEMENT:"chat",MESSAGING_ENGAGEMENT:"messaging"},richContentActionTypes:{LINK:"link",NAVIGATE:"navigate",PUBLISH_TEXT:"publishText",CAROUSEL_OFFSET_CHANGE:"carouselOffsetChange",CHECKED:"checked",SUBMIT_AS_TEXT:"submitAsText",DATE_PICKER:"datePicker",SCHEDULE_SLOT_LIST:"scheduleSlotList",ADD_TO_CART:"addToCart"},fileSharing:{fileAttributes:{TYPE:"type",SIZE:"size"},fallbackThumbnail:{URI:"data:image/png;base64,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",TYPE:"image/png",HEIGHT:90,WIDTH:70}},googleMapsUrl:"https://www.google.com/maps/search/?api=1&",externalTargets:{SMS:0},MavenPay:{LINK_CLICKED:"mavenPayClicked"},stepUpInWaitingState:{appName:"stepUpInWaitingState",storageKey:"-stepUpDataInWaitingState"},messageTypes:{secureForm:"leSecureForm"},fifteenMinutesInMS:9e5},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.hooks={BEFORE_SUBMIT_SURVEY:"BEFORE_SUBMIT_SURVEY",BEFORE_WELCOME_MESSAGE:"BEFORE_WELCOME_MESSAGE",AFTER_GET_SURVEY:"AFTER_GET_SURVEY",BEFORE_SEND_VISITOR_LINE:"BEFORE_SEND_VISITOR_LINE",AFTER_GET_LINES:"AFTER_GET_LINES",AFTER_LOAD_SURVEY:"AFTER_LOAD_SURVEY",AFTER_SUBMIT_SURVEY:"AFTER_SUBMIT_SURVEY",AFTER_ABANDONED_SURVEY:"AFTER_ABANDONED_SURVEY",ON_WINDOW_CLOSED:"ON_WINDOW_CLOSED",ON_ADD_TO_CART:"ON_ADD_TO_CART"},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.CsatDataGenerator=function(e){return{id:0,title:"",header:"",questions:{question:[{type:"CSAT",validationType:"csat",label:e.translate("csatRatingQuestion"),id:0,order:0,mandatory:!1}]}}},lpTag.unifiedWindow.contentTypes={TEXT_PLAIN:"text/plain",EXTERNAL_FILE:"external/file",HOSTED_FILE:"hosted/file",SECURE_FORM_INVITATION:"forms/secure-invitation",SECURE_FORM_SUBMISSION:"forms/secure-submission",SECURE_FORM_UPDATE:"forms/secure-update"},lpTag.unifiedWindow.MessageTypes={CONTENT:"ContentEvent",RICH_CONTENT:"RichContentEvent"},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.structuredContentTypes=lpTag.unifiedWindow.structuredContentTypes||{QUICK_REPLIES:"quickReplies",BUTTON:"button",LIST:"list"},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.State={INIT:"init",INITIALIZED:"initialised",PRE_CHAT:"preChat",REQUESTED:"startChat",CHATTING:"chatting",POST_CHAT:"postChat",PRE_SMS:"preSms",OFFLINE:"offline",WAITING:"waiting",PENDING:"pending",ENDED:"ended",NOT_FOUND:"notfound",APP_ENDED:"applicationEnded",ERROR:"error",RESUME:"resume",PAUSED:"paused",RESUME_PAUSED:"resumepaused",AUTH_ERROR:"authenticationError",CONNECTION_ISSUE:"connectionIssue",RESTART_AUTHENTICATION:"restartAuthentication",STEP_UP_AUTH:"stepUpAuth",INTERACTIVE:"interactive"},lpTag.unifiedWindow.Priority=(function(){var e=lpTag.unifiedWindow.State,t={},i=0;return t[e.INIT]=i++,t[e.INITIALIZED]=i++,t[e.PRE_CHAT]=2,t[e.OFFLINE]=i++,t[e.REQUESTED]=i++,t[e.WAITING]=4,t[e.PENDING]=4,t[e.RESUME]=4,t[e.PAUSED]=4,t[e.RESUME_PAUSED]=4,t[e.CHATTING]=i++,t[e.ENDED]=i++,t[e.POST_CHAT]=i++,t[e.NOT_FOUND]=i++,t[e.ERROR]=+i,t[e.APP_ENDED]=9,t})(),lpTag.unifiedWindow.MessageState={ERROR:"ERROR",PENDING:"PENDING",SENT:"SENT",VIEWED:"VIEWED",ACCEPT:"ACCEPT",READ:"READ",FAILED:"FAILED"},lpTag.unifiedWindow.MessagePriority=(function(){var e=lpTag.unifiedWindow.MessageState,t={},i=0;return t[e.ERROR]=0,t[e.PENDING]=i++,t[e.SENT]=i++,t[e.VIEWED]=i++,t[e.ACCEPT]=i++,t[e.READ]=i++,t[e.READ]=+i,t[e.FAILED]=6,t})(),lpTag.unifiedWindow.secureFormStates={SEND:"send",RECEIVED:"received",VIEWED:"viewed",VIEWED_ON_ANOTHER_TAB:"viewedOnAnotherTab",ABORTED:"aborted",SUBMIT:"submit",ERROR:"error"},lpTag.unifiedWindow.richContentStates={ACTION_EVENT:"actionEvent",PUBLISH_TEXT:"publishText",DISPLAYED:"contentDisplayed",SUBMIT_AS_TEXT:"submitAsText"},lpTag.unifiedWindow.quickRepliesStates={ACTION_EVENT:"actionEvent",PUBLISH_TEXT:"publishText"},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},lpTag.unifiedWindow.welcomeMessageStates=lpTag.unifiedWindow.welcomeMessageStates||{showTiming:{FIRST_TIME:"FIRST_TIME",EVERY_TIME:"EVERY_TIME"}},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.ChatModelPath=lpTag.unifiedWindow.ChatModelPath||function(){var e,t;lpTag.unifiedWindow.chatModelPath||(e={name:"chatModel"},t=window.liveperson.uiframework.latest.LPModel,e.LINES=t.createPath("chat.lines",null,e.name),e.SECURE_FORMS=t.createPath("chat.secureForms",null,e.name),e.AGENT_NAME=t.createPath("chat.agentName",null,e.name),e.VISITOR_NAME=t.createPath("chat.visitorName",null,e.name),e.PARTICIPANTS=t.createPath("chat.participants",null,e.name),e.AGENT_ID=t.createPath("chat.agentId",null,e.name),e.CHAT_ID=t.createPath("chat.chatId",null,e.name),e.CURRENT_DIALOG_TYPE=t.createPath("chat.currentDialogType",null,e.name),e.AGENT_IS_TYPING=t.createPath("chat.agentIsTyping",null,e.name),e.SURVEYS_PRECHAT=t.createPath("chat.surveys.preChat",null,e.name),e.SURVEYS_EXIT=t.createPath("chat.surveys.exit",null,e.name),e.SURVEYS_OFFLINE=t.createPath("chat.surveys.offline",null,e.name),e.TTR=t.createPath("chat.ttr",null,e.name),e.TRANSCRIPT_LOADED=t.createPath("chat.transcriptLoaded",null,e.name),e.SDK_NOTIFICATIONS=t.createPath("windowsdk.notifications",null,e.name),e.SDK_BUTTON_ENABLE=t.createPath("windowsdk.buttonEnable",null,e.name),e.SURVEYS_PRESMS=t.createPath("chat.surveys.preSms",null,e.name),lpTag.unifiedWindow.chatModelPath=e)},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.UIModelPath=lpTag.unifiedWindow.UIModelPath||function(){var e,t;lpTag.unifiedWindow.uiModelPath||(e={name:"uiModel"},t=window.liveperson.uiframework.latest.LPModel,e.STATE=t.createPath("chat.state",null,e.name),e.CONVERSATION_DATA=t.createPath("chat.conversationData",null,e.name),e.AGENT_PICTURE_URL=t.createPath("chat.agentPicUrl",null,e.name),e.VISITOR_TYPING=t.createPath("chat.isVisitorTyping",null,e.name),e.WINDOW_MAXIMIZED=t.createPath("window.maximized",null,e.name),e.ACTIONS_VISIBLE=t.createPath("window.actionsVisible",null,e.name),e.EMOJI_VISIBLE=t.createPath("window.emojisVisible",null,e.name),e.TOP_MENU_VISIBLE=t.createPath("window.topMenuVisible",null,e.name),e.WINDOW_POSITION=t.createPath("window.position",null,e.name),e.WINDOW_SOUND=t.createPath("window.sound",null,e.name),e.EMOJI_MENU=t.createPath("window.emojiMenu",null,e.name),e.WINDOW_EMBEDDED=t.createPath("window.embedded",null,e.name),e.LAST_LINE_VIEWED=t.createPath("window.lastLineViewed",null,e.name),e.ACTION_POPOUT_ENABLE=t.createPath("popout.enable",null,e.name),e.SECURE_FORMS_TAB_HANDLER=t.createPath("collaboration.secureFormsTabHandler",null,e.name),e.IDNV_DATA=t.createPath("collaboration.idnvData",null,e.name),e.WIDGET_SLIDER_VISIBLE=t.createPath("windowsdk.sliderVisible",null,e.name),e.SELECTED_WIDGET_ID=t.createPath("windowsdk.selectedWidgetId",null,e.name),e.DISPOSED_WIDGETS_IDS=t.createPath("windowsdk.disposedWidgetsIds",null,e.name),e.INITIATED_WIDGETS_IDS=t.createPath("windowsdk.InitiatedWidgetsIds",null,e.name),e.WIDGETS_NOTIICATIONS=t.createPath("windowsdk.widgetsNotifications",null,e.name),e.STEP_UP_STATE=t.createPath("chat.stepUpState",null,e.name),e.PRE_SMS_CONTEXT=t.createPath("chat.preSmsContext",null,e.name),e.LAST_VIEWED_TAB=t.createPath("tabs.lastViewedTab",null,e.name),e.TAB_LIST=t.createPath("tabs.list",null,e.name),e.SECURE_FORMS_INVITATIONS=t.createPath("collaboration.sfInvMapping",null,e.name),lpTag.unifiedWindow.uiModelPath=e)},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.WidgetModelPath=lpTag.unifiedWindow.WidgetModelPath||function(){var e,t;lpTag.unifiedWindow.widgetModelPath||(e={name:"WidgetModelPath"},t=window.liveperson.uiframework.latest.LPModel,e.CONVERSATION_ID=t.createPath("conversation.id",null,e.name),e.SESSION_ID=t.createPath("conversation.sessionId",null,e.name),e.DIALOGS=t.createPath("conversation.dialogs",null,e.name),e.WINDOW_UI=t.createPath("ui.window",null,e.name),lpTag.unifiedWindow.widgetModelPath=e)},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.ChatDelegate=lpTag.unifiedWindow.ChatDelegate||function(o,a){var s,n,r,l,d="ChatDelegate",c=lpTag.unifiedWindow.apps.CHAT,i=lpTag.unifiedWindow.apps.UNIFIED_WINDOW,u=lpTag.unifiedWindow.log,p=lpTag.unifiedWindow.State,h=lpTag.unifiedWindow.events.chat,f=(lpTag.taglets.postmessage,0),g=1,t=!1,m={state:p.INTERACTIVE,agent:!1,visitor:!1,bindId:null},v={},w=["line","leCollaboration"],_="@type",C="leCollaboration",T=lpTag.unifiedWindow.applicationUtils,y=lpTag.unifiedWindow.consts.errorTypes;function E(e){r&&r(e||{})}function b(e){l&&l(e||{})}function S(e){o&&("string"==typeof o.svid&&(e.LETagVisitorId=o.svid),"string"==typeof o.ssid&&(e.LETagSessionId=o.ssid),"string"==typeof o.scid)&&(e.LETagContextId=o.scid)}function I(e,t,i){e&&(e.success=t,e.error=i,s.sendCollaboration(e)),u.info("sendCollaboration="+JSON.stringify(e),d)}function N(){s.cancelSurvey()}function x(e,t){n=e,p.NOT_FOUND===n&&(n=p.APP_ENDED),a.trigger({appName:c,eventName:h.STATE,data:n,global:!0}),p.CHATTING===n&&a.trigger({appName:i,eventName:h.ENGAGEMENT_DATA,global:!0,data:{engagementName:o.ename,state:n}}),!t&&p.WAITING!==n&&p.ENDED!==n||(v.chatState=n,M()),p.ENDED===n&&a.trigger({appName:c,eventName:h.BLOD,data:{engagementName:o.ename}})}function A(e){"object"==typeof e&&((v=v||{}).agentName=e&&e.agentName||"",v.agentId=e&&e.agentId||"",v.agentPictureUrl=e&&e.agentPictureUrl||"",v.skillName=e&&e.skillName||"",v.rtSessionId=e&&e.rtSessionId||v.rtSessionId||"",v.chatState=e&&e.chatState||v.chatState||"",v.monitoringSessionId=o&&o.ssid||v.monitoringSessionId||"",v.visitorId=o&&o.svid||v.visitorId||"",v.visitorName=e&&e.visitorName||v.visitorName||"",v.skill=o&&o.skill||v.skill||"",v.engagementId=o&&o.eid||v.engagementId||"",v.campaignId=o&&o.cid||v.campaignId||"",v.language=o&&o.lang||v.language||"",v.engagementName=o&&o.ename||v.engagementName||"",v.lastUpdate=e.lastUpdate||v.lastUpdate||"",M())}function M(){a.trigger({appName:c,eventName:h.CHAT_INFO,data:v})}function L(e){!e||e.error||"ERROR"===e?a.trigger({appName:c,eventName:h.ERROR,data:{errorType:y.CONNECTION_UNAVAILABLE}}):t||(window.recaptchaRendererV2&&s.isCaptchaV2Supported&&s.isCaptchaV2Supported()?(window.recaptchaRenderer=window.recaptchaRendererV2,window.recaptchaRenderer.renderCaptcha(o),window.recaptchaRendererV1.removeFromPage()):window.recaptchaRendererV1&&(window.recaptchaRenderer=window.recaptchaRendererV1),x(p.INIT),a.trigger({appName:c,eventName:h.INITIALIZED}),t=!0)}function D(e){for(var t,i=Array.isArray(e)?e:[e],n=0;ni&&(i=e[n].csat.endTs,t=e[n]);return t})(e.data||e);e&&e.csat&&o.trigger({appName:u,eventName:v.CSAT_INFO,data:e})}function pe(e,t){E.id=e,E.isActive=!0,y.rtSessionId=E.id,t&&t.conversationDetails&&((e=t.conversationDetails.skillId)&&"-1"!==e?y.skill=e:"number"==typeof y.skill?y.skill=y.skill+"":y.skill=void 0)}function he(e){e.dialogId?(b.id=e.dialogId,b.isActive=!0):e.conversation&&(e=e.conversation.conversationDetails&&e.conversation.conversationDetails.dialogs)&&0m[l])&&e(m[t],m[f.ENDED])&&x(0,t,!0)}function Z(){u.info("_tryInitResume",c),J(function(e,t){return e<=t})}function Q(){u.info("_tryEndResume",c),J(function(e,t){return t=m[r]&&r!==t)&&x(0,t)}}))}function ee(e){u.info("_handleNewStateFromModel newState= "+e.newValue,c);var t=l&&r!==l?l:r;if(o.isInitialized()){var i=!1;if(t){if(t!==e.newValue){if(m[t]>m[e.newValue])return;if(t===f.PRE_CHAT)return void o.reInit()}}else i=!0;x(0,e.newValue,i)}}function x(e,t,i){if(r!==t)switch(r=t){case f.INIT:break;case f.INITIALIZED:oe();break;case f.PRE_CHAT:A(i);break;case f.WAITING:case f.RESUME:case f.PAUSED:case f.RESUME_PAUSED:case f.CHATTING:break;case f.ENDED:Ee();break;case f.POST_CHAT:i&&Ee();break;case f.OFFLINE:A(i);break;case f.NOT_FOUND:case f.ERROR:Se();break;case f.APP_ENDED:u.info("_disposeApplication",c),o.disposeVisitor(),n.trigger({appName:c,eventName:p.chatState.ENDED}),Y();break;default:A(i)}}function A(e){e&&oe({resuming:!0})}function te(e){u.info("_submitFinalSurveyCallback: data="+JSON.stringify(e),c),_=!1,e&&e.error&&5===e.error.internalCode?n.trigger({appName:c,eventName:p.chat.SURVEY_ERROR,data:e}):e&&e.error&&10===e.error.internalCode?Ie()&&L({isInvalid:!0}):N(null,f.APP_ENDED)}function ie(e){u.info("_submitFinalSurveyError: data="+JSON.stringify(e),c),_=!1,n.trigger({appName:"survey",eventName:p.chat.SURVEY_SERVER_ERROR,data:e})}function M(e){if(e&&e.error){if(32===e.error.internalCode)return O(),void u.info("_startChatChatError:getOfflineSurvey. internalCode: 32",c);if(5===e.error.internalCode)return void n.trigger({appName:c,eventName:p.chat.SURVEY_ERROR,data:e});if(10===e.error.internalCode)return void(Ie()&&L({isInvalid:!0}))}P(e)}function ne(e){n.trigger({appName:c,eventName:p.chat.EMAIL_TRANSCRIPT_SUCCESS,data:e})}function ae(e){n.trigger({appName:c,eventName:p.chat.EMAIL_TRANSCRIPT_ERROR,data:e})}function oe(e){e=e||{},u.info("_handleInit",c),(!e.resuming&&Ie()?L:se)()}function L(e){e=e||{},window.recaptchaRenderer.showCaptcha({isInvalid:e.isInvalid,themer:a.themer,translator:a.translator,callback:se})}function se(){V.engConf.isOffline?(O(),u.info("_handleInitContinue:getOfflineSurvey. uiState.engConf.isOffline: true",c)):a.conf.unifiedConf.skipAvailabilityCheck?de({availability:!0}):o.getAvailability(de,P)}function re(e){e?(u.info("resumingPolling",c),o.resumePolling()):(u.info("stopPolling",c),o.stopPolling())}function le(e){var t;e.agentPictureUrl&&e.agentName&&((t=s.get(v.AGENT_PICTURE_URL)||{})[e.agentName]=e.agentPictureUrl,s.modify(v.AGENT_PICTURE_URL,t)),e.skillName&&(U=e.skillName)}function de(e){u.info("_availabilitySuccess data="+JSON.stringify(e),c),e&&e.availability?T&&!ce()?(u.info("_startAuthentication",c),ue({context:"onload"}),a.authenticationManager.authenticate(pe,he)):k()&&a.unAuthUserTriesAuth?he(void 0):C?o.getPreChatSurvey(me,ve):o.startChat(null,D,M):(O(),u.info("_availabilitySuccess:getOfflineSurvey. availability: false",c))}function ce(){return s.get(v.STATE)===f.PRE_CHAT&&s.get(v.CONVERSATION_DATA)}function ue(e){u.info("_triggerProcessingEvent data="+JSON.stringify(e),c),n.trigger({appName:g.UNIFIED_WINDOW,eventName:p.application.PROCESSING,data:e})}function pe(e){var t;u.info("_startConversation data="+JSON.stringify(e),c),e&&e.ssoKey&&(t=G(),C&&o.getPreChatSurvey(me,P),t&&i!==f.OFFLINE&&!ce()?o.startChat({conversationData:t},D,M):(t={domain:a.conf.unifiedConf.domain,appKey:a.keys.appKey,connectorId:a.conf.authConf.connector.id,ssoKey:e.ssoKey,redirectUri:e.redirect_uri||null,engConf:a.conf.engConf},o.startConversation(t,C?function(e){u.info("_startConversationSuccess data="+JSON.stringify(e),c),s.modify(v.CONVERSATION_DATA,e)}:function(e){u.info("_startConversationSuccess data="+JSON.stringify(e),c),o.startChat({conversationData:e},D,M)},fe)))}function he(e){u.info("_ssoKeyError data="+JSON.stringify(e),c),ge()}function fe(e){u.info("_startConversationError data="+JSON.stringify(e),c),ge()}function ge(){(r!==f.PRE_CHAT||k()&&a.unAuthUserTriesAuth)&&(O(),u.info("_authenticationErrorCallback:getOfflineSurvey.",c))}function D(e){n.trigger({appName:c,eventName:p.chat.START_CHAT_INFO,data:e.info}),u.info("_startChatSuccess data="+JSON.stringify(e),c)}function me(e){u.info("_getPreChatSuccess data="+JSON.stringify(e),c),e&&e.survey?Te(p.application.PRE_CHAT_SURVEY,w.SURVEYS_PRECHAT,e.survey):o.startChat(null,D,M)}function ve(e){u.info("_getPreChatError data="+JSON.stringify(e),c),o.startChat(null,D,M)}function O(){o.getOfflineSurvey(we,P)}function we(e){u.info("_getOfflineSurveyCallback data="+JSON.stringify(e),c),e&&!e.error&&e.survey?Te(p.application.OFFLINE_SURVEY,w.SURVEYS_OFFLINE,e.survey):P()}function _e(e){u.info("_getPostChatSurveyCallback, survey="+JSON.stringify(e),c),e&&!e.error&&e.survey?Te(p.application.POST_CHAT_SURVEY,w.SURVEYS_EXIT,e.survey):P()}function Ce(e){u.info("_getExitSurveyError, survey="+JSON.stringify(e),c),N(null,f.APP_ENDED)}function Te(e,t,i){i&&i.questions&&i.questions.question&&i.questions.question.forEach(function(e){e.label=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml(e.label).cleanText,e.entry&&e.entry.forEach(function(e){e.displayValue=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml(e.displayValue).cleanText})}),lpTag.hooks&&lpTag.hooks.exec&&(i=(e=lpTag.hooks.exec({name:lpTag.unifiedWindow.hooks.AFTER_GET_SURVEY,data:{surveyType:e,surveyData:i}}))&&e.data&&e.data.surveyData||i),B.modify(t,i)}function ye(e){u.info("_stateListener state="+e,c),N(null,e)}function P(e){u.info("_changeToError err= "+JSON.stringify(e),c),N(e,h.ERROR)}function Ee(){u.info("_checkForPostChatSurvey",c),!(function(){var e;e=!(!y&&F.skill===U)&&(!0===W.postChatSurveyOnNonInteractiveChat||o.isInteractive());return e})()?N(null,f.APP_ENDED):o.getExitSurvey(y,_e,Ce)}function be(){o.setVisitorTyping(!1),o.endChat(null,P)}function Se(){u.info("_handleError",c),N(null,f.APP_ENDED)}function Ie(){return window.recaptchaRenderer}function k(){var e=a&&a.conf&&a.conf.unifiedConf,t=e&&e.external,e=e&&e.authPostVerificationLiveChat;return!t&&e}o=E.apiDelegate,a=E.appContext,n=E.events,a.conf.authConf&&(T=!0),b=(i=s.get(lpTag.unifiedWindow.uiModelPath.STATE))===f.CHATTING||i===f.PRE_CHAT||i===f.OFFLINE||i===f.WAITING,k()&&T&&b&&!a.conf.unifiedConf.external?a.authenticationManager.authenticate(function(e){a.unAuthUserTriesAuth=!e||!e.ssoKey,S()},function(){a.unAuthUserTriesAuth=!0,S()}):S(),this.emailTranscript=function(e,t){e&&o.emailTranscript(e,t,ne,ae)},this.getCurrentState=z,this.getOTK=function(e,t){return o.getOTK(e,t)},this.richContentRequest=function(e,t){u.info("richContentRequest info: "+JSON.stringify(e),c),o.richContentRequest(e,t=t||[])},this.secureFormRequest=function(e,t,i,n){return o.secureFormRequest(e,t,i,n)},this.getOtkJson=function(e){return JSON.stringify({siteId:lpTag.site,chatId:o.getSessionKey&&o.getSessionKey()})},this.dispose=Y},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.SMSDeflectionManager=lpTag.unifiedWindow.SMSDeflectionManager||function(e,t,i,n){var r,a,o,l,s=lpTag.unifiedWindow.apps.CHAT,d=lpTag.unifiedWindow.events.chat,c=lpTag.unifiedWindow.chatModelPath,u=lpTag.unifiedWindow.uiModelPath,p=lpTag.unifiedWindow.apps,h=lpTag.unifiedWindow.events,f=t.chatModel,g=t.uiModel,m=i.engConf||{},v=lpTag.unifiedWindow.consts,w=lpTag.HtmlSanitizerUtils&&lpTag.HtmlSanitizerUtils.sanitizeHtml||function(e){return{cleanText:e}},t=(l=new lpTag.unifiedWindow.helpers.SMSFormHelper,n);function _(){r.getPreSMSForm(function(e){e.error?y():(g.modify(u.STATE,lpTag.unifiedWindow.State.PRE_SMS),f.modify(c.SURVEYS_PRESMS,l.transform(e)))},function(e){y()})}function C(t){var e,i,n,a,o,s;t&&t.survey?(e=m.externalTargets&&m.externalTargets[v.externalTargets.SMS]&&m.externalTargets[v.externalTargets.SMS].brandIdentifier,o=f.get(c.SURVEYS_PRESMS),i=l.getAnswerOfType(o,t.survey.question,l.TYPES.PHONE_NUMBER),n=l.getAnswerOfType(o,t.survey.question,l.TYPES.FIRST_NAME),a=l.getAnswerOfType(o,t.survey.question,l.TYPES.LAST_NAME),o=l.getAnswerOfType(o,t.survey.question,l.TYPES.MESSAGE),i&&e?(s={Body:o?w(o.answer).cleanText:"",From:i.answer,To:e,context:{engagementId:m.eid,campaignId:m.cid,visitorId:m.svid,visitorFirstName:w(n).cleanText?n.answer:"",visitorLastName:a?w(a.answer).cleanText:""}},m.skillId&&(s.context.skillId=m.skillId),r.submitPreSMSForm(s,function(e){g.modify(u.PRE_SMS_CONTEXT,s),g.modify(u.STATE,lpTag.unifiedWindow.State.APP_ENDED),b(t.survey,"success"),E()},function(){y(),b(t.survey,"fail")})):y()):(g.modify(u.STATE,lpTag.unifiedWindow.State.APP_ENDED),E())}function T(){E(),o.trigger({appName:s,eventName:h.viewController.INITIATE_END_CHAT})}function y(){g.modify(u.STATE,lpTag.unifiedWindow.State.CONNECTION_ISSUE)}function E(){o.unbind({appName:s,eventName:d.INITIALIZED,func:_}),o.unbind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM,func:C})}function b(e,t){lpTag.hooks&&lpTag.hooks.exec&&lpTag.hooks.exec({name:lpTag.unifiedWindow.hooks.AFTER_SUBMIT_SURVEY,data:{context:a,surveyType:lpTag.unifiedWindow.SurveyType.PRE_SMS,surveyData:e,status:t}})}r=t.apiDelegate,a=t.appContext,(o=t.events).bind({appName:s,eventName:d.INITIALIZED,func:_}),o.bind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM,func:C}),o.bind({appName:p.UNIFIED_WINDOW,eventName:h.application.PRE_SMS_FORM_EXIT,func:T}),r.initialize()},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.ConversationManager=lpTag.unifiedWindow.ConversationManager||function(V,n,a,$){var F,B,v,U,H,z,j,G,q,r,w,l,d,o,K,Y,s,t,c,u,X,J,Z,Q,p="ConversationManager",h=lpTag.unifiedWindow.apps.CHAT,f=lpTag.unifiedWindow.log,g=lpTag.unifiedWindow.events,m=lpTag.unifiedWindow.uiModelPath,_=lpTag.unifiedWindow.chatModelPath,C=g.chat,ee=g.viewController,T=lpTag.unifiedWindow.State,te=lpTag.unifiedWindow.apps,ie=lpTag.unifiedWindow.consts,y=lpTag.unifiedWindow.consts.chatEvents,e=lpTag.unifiedWindow.events.socket,E=lpTag.AMSStatics.conversation.states,b=lpTag.AMSStatics.dialog,S=lpTag.unifiedWindow.secureFormStates,ne=lpTag.AMSStatics.participant.roles,ae=lpTag.unifiedWindow.consts.errorTypes,oe=lpTag.unifiedWindow.consts.authErrorsTypes,se=lpTag.unifiedWindow.MessageState,I=lpTag.unifiedWindow.contentTypes,re=lpTag.unifiedWindow.MessageTypes,le=lpTag.unifiedWindow.settingsIDs,de=lpTag.unifiedWindow.structuredContentTypes,ce=lpTag.unifiedWindow.quickRepliesStates,ue=lpTag.unifiedWindow.welcomeMessageStates,pe=0,he=4,N=2,fe=3,x=null,A={SYSTEM:"system",AGENT:"agent",VISITOR:"visitor"},ge=!1,me=!1,ve=15e3,we=null,_e=3e5,Ce=lpTag.AMSStatics.dialog.closeReasons,Te=!1,ye=!1,Ee=!1,M={},L={},D={},O={},be={},P={},k=lpTag.unifiedWindow.applicationUtils,Se=[],Ie="@id",Ne=!1,xe=!1,Ae={},Me={},W=[],Le=(lpTag.csds,{csds:{acCdnDomain:"acCdnDomain",acCdnDomainConsumerSdk:"acCdnDomainConsumerSdk",leCdnDomain:"leCdnDomain"},storage:{unauthStorage:{key:"-unAuthJWT",name:"unAuthMessaging"},stepUpStorage:{appName:"StepUP",valueKeys:{lastActiveConvo:"lastActiveConvo"}}}}),De=!1,i=(Me[y.SECURE_FORM]=!0,$),Oe=(f.info("init",p),l=n.uiModel,d=n.chatModel,F=i.stepUpManager,n=i.canEnableOfflineFlow,i);function Pe(){r.unbind({appName:"SessionManager",eventName:C.NO_SESSION,func:Kt}),r.unbind({appName:h,eventName:e.CONNECTED,func:Be}),r.unbind({appName:h,eventName:e.INITIALIZED,func:Ue}),r.unbind({appName:h,eventName:e.DISCONNECTED,func:ze}),r.unbind({appName:h,eventName:e.NON_RESPONSIVE,func:je}),r.unbind({appName:h,eventName:e.PING_SUCCESS,func:He}),r.unbind({appName:h,eventName:C.USER_INFO,func:Je}),r.unbind({appName:h,eventName:C.USER_LEFT,func:Ze}),r.unbind({appName:te.UNIFIED_WINDOW,eventName:g.application.POST_CHAT_SURVEY,func:Bt}),r.unbind({appName:te.UNIFIED_WINDOW,eventName:g.application.END_CHAT,func:zt}),r.unbind({appName:h,eventName:C.CONVERSATION_STATE,func:ct}),r.unbind({appName:h,eventName:C.DIALOG_STATE,func:ut}),r.unbind({appName:h,eventName:C.CONVERSATION_CONTENT,func:Tt}),r.unbind({appName:h,eventName:C.SUBSCRIBE_MESSAGING_EVENTS_RESPONSE,func:yt}),r.unbind({appName:h,eventName:C.CONVERSATION_HISTORY,func:kt}),r.unbind({appName:h,eventName:C.CSAT_INFO,func:ot}),r.unbind({appName:"*",eventName:C.AUTHENTICATION_ERROR,func:rt}),r.unbind({appName:h,eventName:C.NEW_CONVERSATION_REQUESTED,func:qt}),r.unbind({appName:"*",eventName:ee.CONVERSATIONS_VIEWED,func:Wt}),r.unbind({appName:"*",eventName:ee.RETRY_GET_HISTORY,func:bt}),r.unbind({appName:"*",eventName:C.FORGET_ME,func:st}),r.unbind({appName:"*",eventName:"pendingLineSet",func:Ve}),r.unbind({appName:"AMSClient",eventName:C.CONVERSATION_STEP_UP,func:$e}),lpTag.events&&lpTag.events.unbind({appName:"*",eventName:C.SIGNAL_OUT,func:Re})}function ke(e){(t=e)?(f.info("authenticate with data: "+JSON.stringify(t),p),t.type=t.type||k.getPropertyFromObject($,"appContext.conf.authConf.stepUpConnector.type")||k.getPropertyFromObject($,"appContext.conf.authConf.connector.type"),Xe(t)):(f.info("authenticate - error - no authentication data",p),lt())}function We(e){var t=L[e];return M[t]&&M[t].dialogs[e].state===b.states.OPEN}function Re(e){var t=w&&w.conf&&w.conf.unifiedConf;t&&!t.isSignalEnabled||o&&"function"==typeof o.sendSignaledEvent&&o.sendSignaledEvent(e.payload)}function Ve(e){Z=!!e.serverPendingLineExists}function $e(){var e=w&&w.conf&&w.conf.unifiedConf;e&&(e.isConvoSteppedUp=!0)}function Fe(){K={agent:!1,visitor:!1}}function Be(){f.info("_handleSocketConnected",p),F.sendStepUp(),He(),Ge()}function Ue(){f.info("_handleSocketInitialized",p),Te?qe(q):me||(me=!0,r.trigger({appName:h,eventName:C.INITIALIZED}),ye=!0,o.getMyUserProfile(),o.getBrandProfile(),R(T.REQUESTED,null))}function He(){ge&&(ge=!1,j.state===T.CONNECTION_ISSUE&&(j.state=b.states.OPEN),U)&&l.get(m.STATE)===T.CONNECTION_ISSUE&&(j.dialogId=z,ut(j),R(U))}function ze(){f.info("_handleSocketDisconnected",p),xe=!0,D={},q=null,G||ge||(G=setTimeout(function(){je()},ve))}function je(){ge||(ge=!0,D={},H=mt(),z=gt(),M[H]&&M[H].dialogs&&M[H].dialogs[z]&&(j=lpTag.unifiedWindow.applicationUtils.clone(M[H].dialogs[z])),ct({convId:mt(),state:T.CONNECTION_ISSUE}),ut({dialogId:gt(),state:T.CONNECTION_ISSUE}),Ge(),U=l.get(m.STATE),ye?R(T.CONNECTION_ISSUE):dt())}function Ge(){clearTimeout(G),G=null}function qe(e){e&&o.unsubscribeConversations(e),o.subscribeConversations(et)}function Ke(){!w.conf.unifiedConf.poppedOut&&!w.conf.unifiedConf.external||w.conf.unifiedConf.connectorsSfConfig&&w.conf.unifiedConf.connectorsSfConfig.isFormSubmitted?Ye(Xe):Te?R(T.RESTART_AUTHENTICATION,null):window.location.href=w.appConfigurationManager.getExternalResourceURL(w.conf.engConf,w.conf.unifiedConf,w.conf.unifiedConf.poppedOut)}function Ye(e){he<=pe?lt():(pe++,f.info("_restartAuthentication",p),w.authenticationManager.reAuthenticate(e,Ye.bind(this,e)))}function Xe(e){f.info("_ssoKeySuccess data="+JSON.stringify(e),p);var t=e&&e.ssoKey||null,i=e&&e.redirect_uri||null,n=e&&e.type||k.getPropertyFromObject(w,"conf.authConf.stepUpConnector.type")||k.getPropertyFromObject(w,"conf.authConf.connector.type")||null,e=e&&e.code_verifier,a=F&&F.getStepUpFailedStatus();k.getPropertyFromObject(w,"conf.engConf.allowUnauthMsg")?o.createMessagingInstance({authCode:t,redirect_uri:i,authType:n,pingTimeout:ve,forceNewConfig:a,blockHistory:De}):o.createMessagingInstance({authCode:t,redirect_uri:i,authType:n,pingTimeout:ve,forceNewConfig:a,codeVerifier:e})}function Je(e){var t=e;if(t){var e={id:t.userId,type:(function(e){var t;if("string"==typeof e.type)switch(e.type){case"CONTROLLER":t=A.SYSTEM;break;case"CONSUMER":t=A.VISITOR;break;default:t=A.AGENT}else t=e.role?A.AGENT:A.VISITOR;return t})(t),name:t.name,imgUrl:t.imgUrl},i=!1;switch(e.name||(e.type===A.VISITOR?e.name=t.firstName||t.lastName?t.firstName+" "+t.lastName:w.translator.translate("you"):e.name=w.translator.translate("agent")),!(function(e,t){var i=d.get(_.PARTICIPANTS)||{};i[e.id]=e,d.modify(_.PARTICIPANTS,i),t&&t.dialogId&&(e=L[t.dialogId])&&M[e]&&(i=M[e].dialogs[t.dialogId])&&i.participants&&(i.participants.some(function(e){return e.id===t.userId})||i.participants.push({id:t.userId,role:t.type}))})(e,t),e.type){case A.VISITOR:d.get(_.VISITOR_NAME)||(i=!0);break;case A.AGENT:Qe(t)&&(i=!0)}i&&at(e)}Te||(qe(q),me=!(Te=!0))}function Ze(t){var e,i;Qe(t)&&nt(),t&&t.dialogId&&(e=L[t.dialogId])&&M[e]&&(e=M[e].dialogs[t.dialogId])&&e.participants&&(i=e.participants.some(function(e){return e.id===t.pid}))&&"number"==typeof(i=e.participants.indexOf(i))&&e.participants.splice(i,1)}function Qe(e){return e&&(e.type===ne.ASSIGNED_AGENT||e.type===ne.AGENT)&&e.dialogId&&We(e.dialogId)}function et(e){pe=0,q=e.subscriptionId}function tt(){var e=w.themer&&w.themer.getStyle("openingMessage","text"),i={source:A.AGENT,by:w.translator.translate("info"),isWelcomeMessage:!0};if((u=w.conf.windowConf&&w.conf.windowConf.welcomeMessage)?(w.shouldWelcomeMessageBeSent=!0,i.text=u.text,u.quickReplies&&0=fe?(Et(n,!0),!(function(e){return e=L[e],M[e].state===E.OPEN})(a)?(It(),0===Object.keys(D).length&&be[ht(v[0].convId)]&&It(w.conf.unifiedConf.failedToLoadHistory=!0)):dt()):(P[a]?P[a].retries++:P[a]={retries:1},Vt(a)!==n&&Et(n))):(t=D[e.reqId].dialogId,i=1,k.isEmpty(P)||P[t]&&(i=P[t].retries,delete P[t]),a=D[e.reqId].resubscribe,Et(e.reqId),delete be[t],n=setTimeout(function(){P[t]||(P[t]={retries:i}),Tt({dialogId:t})},we),O[t]={dialogId:t,timeoutId:n,resubscribe:a}))}function Et(e,t){t&&D[e]&&D[e].dialogId&&(be[D[e].dialogId]=D[e],t=St(t=D[e].dialogId,!1),M[t].returnedDialogs.allDialogsSuccessful=!1),delete D[e]}function bt(e){if(k.isEmpty(be))Wt(e);else for(var t in be)be.hasOwnProperty(t)&&Vt(t)}function St(e,t){var i;return e?((i=L[e])&&M[i]&&(M[i].returnedDialogs||(M[i].returnedDialogs={allDialogsSuccessful:!1}),M[i].returnedDialogs[e]||(M[i].returnedDialogs[e]={}),M[i].returnedDialogs[e].successful=t),i):null}function It(e){var t;(0===Object.keys(D).length&&0===Object.keys(O).length||e)&&(e=gt()?T.CHATTING:T.WAITING,t=(function(){var s,r=[];Array.isArray(Se)&&Se.forEach(function(e,t){var i,n,a=i=(function(e){var t=e&&e.event||{};{if(t.type!==re.RICH_CONTENT){var i=e,n=i&&i.event||{};switch(!(function(e){return!(!Ae[e.sequence]||e.state!==se.VIEWED&&e.state!==se.ERROR)})(i)||(n.contentType=I.SECURE_FORM_UPDATE),n.contentType){case I.HOSTED_FILE:return(function(e,t){return{type:t,subType:"REGULAR",fileData:e,textType:"file"}})(n.message,I.HOSTED_FILE);case I.EXTERNAL_FILE:return At(w.translator.translate("transcriptForPhotoSharingImage"),y.LINE);case I.TEXT_PLAIN:return At(n.message||"",y.LINE,n.quickReplies);case I.SECURE_FORM_INVITATION:return Mt(i,S.SEND);case I.SECURE_FORM_SUBMISSION:return Mt(i,S.SUBMIT);case I.SECURE_FORM_UPDATE:return Mt(i,i.state);default:return At("string"==typeof n.message?n.message:"",y.LINE)}return}return At(t.content,y.RICH_CONTENT,t.quickReplies)}})(n=e),o=Lt(n)||{},a=(a[Ie]=n.sequence,a.sequenceId=n.sequence,a.originatorId=o.id,a.by=o.name,a.source=o.type,a.time=n.serverTimestamp,a.convId=n.dialogId,a.track=(function(e){var t=L[e.dialogId];if(xt(e)&&x&&v[x]&&t===v[x].convId&&e.dialogId===(function(e){if(M[e]&&M[e].dialogs&&M[e].sortedDialogIds)for(var t=0;ti);a++)n.push(e[a]);return n})(e)).length&&(Rt(e,0,e.length-1,!1),v=e.concat(v),x+=e.length);return e})(e),0<(n=(function(e){var t,i;return t=v&&0=ie.fifteenMinutesInMS?Q:ie.fifteenMinutesInMS,f=Date.now()-Q,g=M[c].endTime&&M[c].endTimet?i.nextOn-t:null:i.nextOff&&i.nextOff>t?i.nextOff-t:null);"number"==typeof n&&(e=Math.min(n+v,36e5),o&&clearTimeout(o),o=setTimeout(g.isEmpty(i)?E:b,e));return a})(i.delay,n,t),i})(f.brandInfo,f.shiftStatus),i=(function(e){return{isUrgent:e.ttrType===d.urgent,isPrioritized:e.ttrType===d.prioritized,isManual:!!e.manualETTR}})(f.urgencyInfo),e=t,e={isUrgent:(i=i).isUrgent,markUrgencyEnabled:!t.onOffHours&&!i.isManual&&!i.isPrioritized},n.modify(c.TTR,e))}function b(){t.getShiftStatus({success:S,error:S})}function S(e){var t=e&&e.body;(m=!g.isEmpty(t)&&200===e.statusCode&&200===e.responseCode)&&(f.shiftStatus=t),E()}e=e,p.info("init",s),"object"==typeof e?(a=e.events,n=e.lpModel,i=e.lppModel,t=e.conversationManager,e.features,a.bind({appName:r,eventName:l.BRAND_INFO,func:T}),_(),i.bind(u.STATE,C),n.bind(c.TRANSCRIPT_LOADED,E)):p.error("init: missing mandatory dependencies.",s),this.dispose=function(){a.unbind({appName:r,eventName:l.BRAND_INFO,func:T}),i.unbind(u.STATE,C),n.unbind(c.TRANSCRIPT_LOADED,E),w()}},window.lpTag=window.lpTag||{},lpTag.unifiedWindow=lpTag.unifiedWindow||{},lpTag.unifiedWindow.HeartBeatManager=lpTag.unifiedWindow.HeartBeatManager||function(e,t){var i,n,a,o,s,r,l,d,c,u,p,h,f,g,m,v=lpTag.unifiedWindow.log,w=lpTag.unifiedWindow.apps,_=w.HEARTBEAT,C=lpTag.unifiedWindow.events,T="UIHeartBeatEmbedded",y="UIHeartBeatPopOut",W=6e4,R=15e3,V=15e3,$=2e3,E=1e3,b=w.UNIFIED_WINDOW;function S(e){v.info("_stop ,preserveTimestamps: "+e,_),c=!0,v.info("_clearTimeouts",_),l&&clearTimeout(l),u&&clearTimeout(u),a||e||(v.info("_clearTimestamps",_),M(),L()),d=!1}function I(e){v.info("_start, preserveTimestamps: "+e,_),i=(new Date).getTime(),S(e),v.info("_resolveApps: initializing apps value - poppedOut = "+a,_),s=a?(o=T,y):(o=y,T),v.info("_resolveApps: resolvedGetApp = "+o+", resolvedSetApp = "+s,_),v.info("_startBeating",_),d=!(c=!1),O(B),P()}function N(e){v.debug("_handleEmbeddedStateChange: embedded="+e,_),e?S():I(!0)}function x(){A(a?C.heartBeat.FAILED:C.application.DO_HARAKIRI)}function A(e,t){g.trigger({appName:_,eventName:e,data:t})}function M(e){v.info("_initPopOutBeat: "+JSON.stringify(e),_),e&&e.timestamp||(v.info("_initPopOutBeat: initializing popout beat value",_),lpTag.taglets.lpSecureStorage.setValue({key:r,site:n,app:b,value:k(0),success:D,error:D,appName:y,domain:m,firstParty:!0}))}function L(){lpTag.taglets.lpSecureStorage.setValue({key:r,site:n,app:b,value:k(0),success:D,error:D,appName:T,domain:m,firstParty:!0})}function F(e){v.info("_initEmbeddedBeat: data="+JSON.stringify(e),_),e&&e.timestamp||(v.info("_initEmbeddedBeat: initializing embedded beat value",_),L())}function D(){v.info("_emptyCallback",_)}function O(e){v.info("_getBeat: got beat",_),l&&clearTimeout(l),c||(a||f.visibilitySupported()&&!f.isHidden()?lpTag.taglets.lpSecureStorage.getValue({key:r,site:n,app:b,success:e,appName:o,domain:m,firstParty:!0}):l=setTimeout(U(e),E))}function B(e){v.info("_validateBeat: data="+JSON.stringify(e),_);var t=(new Date).getTime();c||(!(a||e&&e.timestamp)&&R{{text}}',c={attrs:{type:"data-lp-collab-type",payload:"data-lp-collab-payload",action:"data-lp-action",questionType:"idnv_question",answerType:"idnv_answer"},states:{PENDING:"pending",CANCELLED:"cancelled",SUBMITTED:"submitted",SKIPPED:"skipped"}};function u(e){return p(n.translator.dictionary.getString("idnvFormCancelled"),e,!1)}function p(e,t,i){var n;return i&&(n=c.attrs.action+'="mask"'),o.injectTextObj(d,{payload:t,mask:n,text:e})}function h(e,t){a.modify(l.IDNV_DATA.path+"."+e+".state",t)}function f(e){n.transcriptManager.sendLineSkipLocal({text:e},{error:function(){n.events.trigger({appName:"tooltip",eventName:"show",data:{text:n.translator.translate("idnvSendLineError"),tooltipTimeout:s}})}})}function g(e){var e=e.match(//g);return e&&e[0]&&(e=(function(e,t){var i=new RegExp(t+"=[\"']*[^\"' >]+"),e=e.match(i),i=new RegExp(t+"=[\"' ]*");e=e&&0)/g;function w(){l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.INIT})}function _(e){var t=s.get(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS)||{};t[e]=!0,s.modify(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS,t),o.modify(lpTag.unifiedWindow.chatModelPath.SDK_BUTTON_ENABLE,!0)}function C(){var e=s.get(lpTag.unifiedWindow.uiModelPath.INITIATED_WIDGETS_IDS),t=s.get(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS);if(t&&e)for(var i in t)e[i]=!1;return e||{}}function T(e){"number"==typeof e&&0<=e&&o.modify(lpTag.unifiedWindow.chatModelPath.SDK_NOTIFICATIONS,e)}function y(e){var t,i,n;e&&(c=e.rtSessionId&&!c?e.rtSessionId:c)&&(t=e,n=r.get(h.CONVERSATION_ID),i=r.get(h.SESSION_ID),!n&&t.rtSessionId&&r.modify(h.CONVERSATION_ID,t.rtSessionId),!i&&t.monitoringSessionId&&r.modify(h.SESSION_ID,t.monitoringSessionId),E(e,I(c)),e.agentName&&e.agentId||e.visitorId&&e.visitorName)&&((n=e).agentName&&n.agentId&&b({id:n.agentId,name:n.agentName,type:d.AGENT,imgPath:p.getPropertyFromObject(a,"conf.windowConf.agentUrl")||"",description:p.getPropertyFromObject(a,"conf.windowConf.description")||""}),n.visitorId)&&n.visitorName&&b({id:n.visitorId,name:n.visitorName,type:d.VISITOR})}function E(e,t){var i=r.get(h.CONVERSATION_ID),n=r.get(h.SESSION_ID),a=!1;t&&e&&(e.state&&t.state!==k(e.state)&&(t.state=k(e.state),a=!0),!t.startTime&&e.lastUpdate&&(t.startTime=e.lastUpdate,a=!0),e.skill&&(!t.skill||t.skill.name!==e.skill&&t.skill.id!==e.skill)&&(t.skill=u?{name:"",id:e.skill}:{name:e.skill,id:""},a=!0),e.typing&&(t.typing=e.typing,a=!0),a)&&(r.modify(h.DIALOGS,[t],"id"),l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.CONVERSATION_INFO,data:{conversationId:i,sessionId:n,dialogId:t.id,startTime:t.startTime,state:t.state,dialogType:t.dialogType,channelType:t.channelType,skill:t.skill,typing:t.typing}}))}function b(e){for(var t,i=I(c),n=!1,a=0;a"));return t})(e.text),i.originator={type:e.source,name:e.by},i.state=e.state;break;case f.chat.CHAT_INFO:}return i})(e,f.chat.LINE);n&&(t=n,!(i=I(c))||i.state!==lpTag.WindowSDKAPI.states.ACCEPTED&&i.state!==lpTag.LPWidgetSDK.API.states.IN_QUEUE||(t.originator&&(t.originator.type===d.VISITOR?m.visitor=!0:t.originator.type===d.AGENT&&(m.agent=!0)),m.agent&&m.visitor&&E({state:lpTag.LPWidgetSDK.API.states.INTERACTIVE},i)),(t=I(e.convId))&&(t.messages.push(n),r.modify(h.DIALOGS,[t],"id")),l.trigger({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:f.widgetSDK.MESSAGES,data:n}))}function k(e){var t=lpTag.unifiedWindow.State,i=lpTag.LPWidgetSDK.API.states;switch(e){case t.PRE_CHAT:return i.PRE_CONVERSATION;case t.WAITING:case t.REQUESTED:return i.PENDING;case t.CHATTING:return u?i.IN_QUEUE:i.ACCEPTED;case t.POST_CHAT:return i.POST_CONVERSATION;case t.ENDED:return i.CONVERSATION_ENDED;case t.OFFLINE:return i.OFFLINE;case t.ERROR:case t.NOT_FOUND:return i.ERROR;default:return e}}e=e,n.info("init",i),o=e.lpModel,s=e.lppModel,r=e.wsdkModel,lpTag.LPWidgetSDK.API,t=e.events,l=e.windowSDKEvents,a=e.appContext,d=lpTag.unifiedWindow.consts.widgetSDK,u=p.getPropertyFromObject(a,"conf.engConf.async"),lpTag.unifiedWindow.State,(function(){t.bind({appName:"*",eventName:f.widgetSDK.INIT,context:this,func:w}),g.push(t.bind({appName:"*",eventName:f.widgetSDK.VISITOR_TYPING,context:this,func:D})),g.push(t.bind({appName:"*",eventName:f.chat.LINE,context:this,func:P})),g.push(t.bind({appName:"*",eventName:f.chat.CHAT_INFO,context:this,func:y})),g.push(t.bind({appName:"*",eventName:f.chat.STATE,func:N})),g.push(t.bind({appName:"slider",eventName:f.viewController.SLIDER_VIEW_CHANGE,context:this,func:x})),g.push(t.bind({appName:"slider",eventName:f.viewController.SLIDER_CLOSED,context:this,func:A})),g.push(t.bind({appName:"WrapperWindowExtender",eventName:f.viewController.MINIMIZE_VISIBLE,context:this,func:function(){O(!1)}})),g.push(t.bind({appName:"WrapperWindowExtender",eventName:f.viewController.MAXIMIZE_VISIBLE,context:this,func:function(){O(!0)}})),l.bind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.NOTIFICATION,context:this,func:T}),l.bind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.INITIATED_WIDGET_ID,context:this,func:_}),o.bind(lpTag.unifiedWindow.chatModelPath.AGENT_IS_TYPING,L)})(),this.dispose=function(){n.info("dispose",i),g.forEach(function(e){t.unbind(e)}),l.unbind({appName:lpTag.unifiedWindow.apps.WINDOW_SDK,eventName:lpTag.unifiedWindow.events.widgetSDK.NOTIFICATION,context:this,func:T})},this.getWidgetsStatus=C,this.getLastShownWidgetId=function(){var e=s.get(lpTag.unifiedWindow.uiModelPath.SELECTED_WIDGET_ID),t=s.get(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE);if(e&&t)return e},this.getWidgetsNotifications=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS)||{}},this.getLastSliderState=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE)},this.isWindowMaximized=function(){return s.get(lpTag.unifiedWindow.uiModelPath.WINDOW_MAXIMIZED)},this.setWIdgetsNotifications=function(e){s.removeKey(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS),s.modify(lpTag.unifiedWindow.uiModelPath.WIDGETS_NOTIICATIONS,e)},this.handleWidgetDisposal=function(e){var t,i,n=s.get(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS)||{},a=!1;for(i in n[e]=!1,s.modify(lpTag.unifiedWindow.uiModelPath.DISPOSED_WIDGETS_IDS,n),t=C())if(!0===t[i]){a=!0;break}a||o.modify(lpTag.unifiedWindow.chatModelPath.SDK_BUTTON_ENABLE,!1)},this.onWidgetStateChanged=function(e){s.modify(lpTag.unifiedWindow.uiModelPath.WIDGET_SLIDER_VISIBLE,e)}},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow.AuthenticationManager=window.lpTag.unifiedWindow.AuthenticationManager||function(e){var d,c="AuthenticationManager",u=lpTag.unifiedWindow.log,p=lpTag.taglets.authenticator,h=lpTag.taglets.lpUtil;function f(){var e=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector),e=d.conf.unifiedConf.useOAuth2Standard||e&&e.configuration&&e.configuration.rfcCompliance;return d.conf.authConf&&d.conf.authConf.redirect_uri?d.conf.authConf.redirect_uri:e&&d.conf.unifiedConf.external?location.protocol+"//"+location.host+location.pathname:lpTag.unifiedWindow.consts.defaultRedirectUri}function g(t){return function(e){e&&(e.redirect_uri=e.redirect_uri||f()),t(e)}}d=e.appContext,this.authenticate=function(e,t){u.info("authenticate",c);var i,n,a,o=d.conf.unifiedConf.authToken||d.conf.unifiedConf.poppedOut,s=d.conf.engConf.async&&d.conf.authConf&&d.conf.authConf.ssoKey,r=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector),l=r&&r.configuration&&r.configuration.pkceEnabled;p?(i=f(),n=d.conf.uiState&&d.conf.uiState.chat&&"restartAuthentication"===d.conf.uiState.chat.state,a=decodeURIComponent(window.location.href),l&&(o||s)&&n&&d.conf.unifiedConf.external&&!a.match('"pkce_reauthentication":1')?(n=d.pkceManager.getExternalWindowURLForPKCE(d),window.location.href=n):o?h.runCallback(e,null,{ssoKey:d.conf.unifiedConf.authToken,redirect_uri:i}):s?h.runCallback(e,null,{ssoKey:d.conf.authConf.ssoKey,redirect_uri:i}):d.conf.unifiedConf.pkceRedirectUrl?d.pkceManager.generatePKCE(function(e){e&&(localStorage.setItem("cv",e.code_verifier),window.location.href=d.conf.unifiedConf.pkceRedirectUrl+"&code_challenge="+e.code_challenge+"&code_challenge_method=S256")}):(!(function(e){e=e&&e.configuration;return!e||"lpTag.taglets.unAuthMessaging"===e.jsContext&&"lpTag.taglets.unAuthMessaging.lpUnauthFunction"===e.jsMethodName})(r)&&d.conf.unifiedConf.connectors&&d.conf.unifiedConf.connectors.length&&(a=(function(){var i,e=window.lpTag.identities&&lpTag.identities.safeIdentities||[],t=d.conf.unifiedConf.connectors,n=e.filter(function(e){var e=e.acr,t=parseInt(e,10);return 1!==e.length||0!==t});n.length&&t.forEach(function(t){n.forEach(function(e){t.configuration.issuer===e.iss&&(i=t)})});return i})())&&(r=a),l?d.pkceManager.runPKCE(r,function(){p.getSSOKey(r,g(e),t)}):p.getSSOKey(r,g(e),t))):(u.error("Not authenticator",c),h.runCallback(t))},this.reAuthenticate=function(e,t){var i;u.info("reAuthenticate",c),p&&((i=d.conf.authConf&&(d.conf.authConf.stepUpConnector||d.conf.authConf.connector))&&i.configuration&&i.configuration.pkceEnabled?d.pkceManager.runPKCE(i,function(){p.getSSOKey(i,g(e),t)}):p.getSSOKey(i,g(e),t))},this.isErroneous=function(){if(p)return p.isErroneous();u.error("Not authenticator",c)},this.dispose=function(){u.info("dispose",c)}},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow.StepUpManager=window.lpTag.unifiedWindow.StepUpManager||function(e){var o,s,r,t,i,n,l,d,a,c=lpTag.unifiedWindow.log,u=lpTag.taglets.authenticator,p=lpTag.unifiedWindow.events.chat,h=window.lpTag.taglets.lpSecureStorage,f="StepUpManager",g={},m=!1,v={success:null,fallback:null,error:function(){c.error("failed to stepup, auth error",f),setTimeout(B,0)}},w="onBehalf",_="sub",W="exp",C={outOfAuthArea:-1,noStepUp:0,stepUp:1,alreadySteppedUp:2,stepUpEnded:3,failedStepUp:4},T={},R={idpVersion:"3.0"},y={csds:{idp:"idp",leCdnDomain:"leCdnDomain"},storage:{unauthStorage:{key:"-unAuthJWT",name:"unAuthMessaging"},stepUpStorage:{appName:"StepUP",valueKeys:{lastActiveConvo:"lastActiveConvo",jwt:"-stepUpJWT",lastStepUpState:"lastStepUpState"}}}},E={};function V(e){var t=null;"OPEN"===e.state&&e.convId&&(t=e.convId),h.setValue({app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,key:y.storage.stepUpStorage.valueKeys.lastActiveConvo,appName:y.storage.stepUpStorage.appName,site:E.accountId,value:t,domain:E.secureStorageLocation,success:function(e){c.debug("stored last unauth convo data",f)},error:function(e){c.debug("failed to store last unauth convo data",f)},firstParty:!0}),"CLOSE"===e.state&&(r=C.stepUpEnded,n.modify(lpTag.unifiedWindow.uiModelPath.STEP_UP_STATE,r))}function b(){var e,t="https://"+(m?s.unified.acCdnDomainConsumerSdk:s.unified.acCdnDomain)+"/api/account/"+s.unified.accountId+"/configuration/le-connectors/all-connectors",i=s.unified&&s.unified.connectors,n=(lpTag.identities&&lpTag.identities.safeIdentities||[]).filter(function(e){return"LivePerson"!==e.iss}),a=m?lpTag.taglets.fetch:lpTag.taglets.jsonp;g.authConnector=null,g.unauthConnector=null,i&&i.length?(i.forEach(function(t){O(t)?g.unauthConnector=t:(e=t,n.length&&n.forEach(function(e){t.configuration.issuer===e.iss&&(g.authConnector=t)}))}),g.authConnector||e&&(g.authConnector=e),A()):a.issueCall({url:t,timeout:5e3,retries:0,credentials:m?"omit":void 0,cache:m&&d?d:void 0,success:function(e){(m?e&&e.body:e).forEach(function(e){g[O(e)?"unauthConnector":"authConnector"]=e}),A()},error:function(e){c.info("_getConfiguration - ERROR FROM SERVER",f),e&&e.cspOrNetworkError&&(m=!1,b())}})}function S(t,i){var e=E.authenticationLocation,n=m?lpTag.taglets.fetch:lpTag.taglets.postmessage,a={lp_jwt:t},e=(i.redirect_uri&&(a.redirect_uri=i.redirect_uri),g.authConnector.type===lpTag.unifiedWindow.consts.authConnectorTypes.OAUTH_IMPLICIT?a.id_token=i.ssoKey:a.code=i.ssoKey,i.code_verifier&&(a.code_verifier=i.code_verifier),{url:e,method:"POST",success:function(e){var e=e.body.token,t=L(e,[w,_]),t=(T.unAuthConsuemrId=t[w],T.authConsumerId=t[_],l=e,o&&o.conf);t&&t.authConf&&(t.authConf.stepUpConnector=g.authConnector),t&&t.engConf&&(t.engConf.stepUpConnector=g.authConnector),i.ssoKey&&i.redirect_uri&&window.lpTag.taglets.lpSecureStorage.setValue({app:"monitoringSDK",appName:"lp_monitoringSDK",site:lpTag&&lpTag.site,domain:E.secureStorageLocation,success:function(){},error:function(e){c.error("Error when setting data for SMT - "+e,f)},firstParty:!0,key:"lpsmtAuth",value:{tkn:e,code:i.ssoKey}}),v.success(l)},error:function(e){c.error("failed to get onbehalf jwt from IDP",f),e&&e.cspOrNetworkError?(m=!1,S(t,i)):v.fallback()},data:a});m?(e.headers=e.headers||{},e.headers["Content-Type"]="application/json"):lpTag.taglets.postmessage.isValidRequest(e)||k(),n.issueCall(e)}function I(n){return function(e){var i={},t=g.authConnector&&g.authConnector&&g.authConnector.configuration.pkceEnabled;"object"==typeof e?(i.ssoKey=e.ssoKey,i.redirect_uri=e.redirect_uri):i.ssoKey=e,t?o.pkceManager.getPKCEFromSecureStorage(function(e){e&&e.code_verifier&&(i.code_verifier=e.code_verifier),o.pkceManager.removePKCEFromSecureStorage(),S(n,i)},function(e){c.error("Error when getting PKCE data from storage - "+e,f),S(n,i)}):i.redirect_uri?window.lpTag.taglets.lpSecureStorage.getValue({app:"monitoringSDK",appName:"lp_monitoringSDK",key:"lpsmtAuth",site:lpTag&&lpTag.site,domain:E.secureStorageLocation,success:function(e){var t;e&&e.tkn?(t=L(e.tkn,[W]))&&t.exp&&Date.now()<1e3*t.exp&&v.success(e.tkn):S(n,i)},error:function(e){c.error("Error when getting lpsmtAuth from storage - "+e,f),S(n,i)},firstParty:!0}):S(n,i)}}function $(e){var t=e.body.token,e=g.authConnector&&g.authConnector.configuration.pkceEnabled;o&&o.pkceManager&&e?o.pkceManager.runPKCE(g.authConnector,function(){u.getSSOKey(g.authConnector,I(t),N)}):u.getSSOKey(g.authConnector,I(t),N)}function N(e){c.error("Step up failed to auth with auth connector",f),v.fallback()}function x(t){var e=m?lpTag.taglets.fetch:lpTag.taglets.postmessage,i={url:E.unauthJwtLocation,method:"POST",data:{id_token:t},error:function(e){e&&e.cspOrNetworkError?(m=!1,x(t)):v.fallback()},success:$};m?(i.headers=i.headers||{},i.headers["Content-Type"]="application/json"):lpTag.taglets.postmessage.isValidRequest(i)||k(),e.issueCall(i)}function A(){var e,t;E.authenticationLocation=D(E.idpDomain,{accountId:E.accountId,connectorId:g.authConnector.id}),E.unauthJwtLocation=D(E.idpDomain,{accountId:E.accountId,connectorId:g.unauthConnector.id}),e=y.storage.unauthStorage.key,t=y.storage.unauthStorage.name,window.lpTag.taglets.lpSecureStorage.getValue({key:e,site:E.accountId,app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,success:function(e){var t,i,n,a=lpTag.taglets.lpSecureStorage;"function"==typeof a.isFirstPartyStorageFeatureEnabled&&(t=a.isFirstPartyStorageFeatureEnabled()),e&&t?(i=e,a=y.storage.unauthStorage.key,n=y.storage.unauthStorage.name,window.lpTag.taglets.lpSecureStorage.getValue({key:a,site:E.accountId,app:lpTag.unifiedWindow.apps.UNIFIED_WINDOW,success:function(e){x(P(i)R&&((e=W.clone(w.TAB_LIST)).path=e.path+"."+s[l],c.removeKey(e),s[l]==o)&&c.modify(w.LAST_VIEWED_TAB,"");n()})}function B(){return b.getStorageType(n).lpUnifiedWindow!==b.storageTypes.SESSIONSTORAGE}function O(){var e=function(){var e=0,t=a.get(_.LINES)||[],i=c.get(w.LAST_LINE_VIEWED);if(i)for(var n=t.length-1;0<=n;n--){if(t[n]["@id"]===i["@id"]&&t[n].convId===i.convId)return e;isNaN(t[n]["@id"])||"agent"!==t[n].source||t[n].history||e++}return 0}.call(this),t=void 0===C||C!==e,i=v&&v.isHidden();t&&(i&&0i["@id"]&&t.convId===i.convId&&"agent"===t.source&&!t.update||(function(e,t){if(e.convId!==t.convId&&"agent"===e.source&&!e.update)return 0===e["@id"]&&c.modify(w.LAST_LINE_VIEWED,{"@id":e["@id"],localId:e.localId,convId:e.convId}),1})(n[s],a))||o&&(1>>f,0>>f)*s,d[y+1]=(O*h>>>f)*s,d[y+2]=(P*h>>>f)*s):d[y]=d[y+1]=d[y+2]=0,0===M&&(_[k]=((n=k+p)]+)>((?:.(?!\\<\\/a\\>))*.)","gim")},href:{regexp:new RegExp("href=\"(.*?)\"|href='(.*?)'","gim")},link:{regexp:new RegExp("(?:(?:https?|ftp|file):\\/\\/|www\\.|ftp\\.)(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\\([-A-Z0-9+&@#/%=~_|$?!:,.]*\\)|[A-Z0-9+&@#/%=~_|$])","gim")}},o=[],s=[];function r(e){var t=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"];return t.slice(0,e).map(function(e){return t[Math.random()*t.length|0]}).join("")}function d(e){var t;try{t=lpTag.HtmlSanitizerUtils.sanitizeAndCleanHtml(e)}catch(e){lpTag.unifiedWindow.log.error("_htmlSanitization",e),t=""}return t}function c(e){var t=document.createElement("textarea"),i=(t.innerHTML=e,t.value),t=(t.remove(),i.replace(/[^a-zA-Z0-9.\/:-]/gim,"")),i=-1===e.indexOf("://")&&-1===e.indexOf("www.");return e=-1"===i[o+2]&&(i=i.slice(0,o)+i.slice(o+3)),n.innerHTML+=t,e=c(e).trim(),n.innerHTML+=""+e+""}),i=d(i=i.slice(o)),n.innerHTML+=i,n.children)for(var t=0;t'+e.noun+"";t=t.replace(l.markdownInsideAll.regexp,e)})}var r;return t},textContainsMarkDownSyntax:function(e){return e.match(l.markdownToHtml.regexp)},sanitizeTextFromHTML:d,textContainsAHREFSyntax:function(e){return e.match(l.anchorTagRegex.regexp)}}},window.lpTag=window.lpTag||{},window.lpTag.unifiedWindow=window.lpTag.unifiedWindow||{},(function(){var l;lpTag.unifiedWindow.BaseViewController=window.liveperson.uiframework.latest.ViewController.extend({ControllerName:"BaseViewController",logger:lpTag.unifiedWindow.log,util:lpTag.taglets.lpUtil,uiPath:lpTag.unifiedWindow.uiModelPath,chatPath:lpTag.unifiedWindow.chatModelPath,EventName:lpTag.unifiedWindow.events,appConsts:lpTag.unifiedWindow.consts,VCEvents:lpTag.unifiedWindow.events.viewController,State:lpTag.unifiedWindow.State,prefixPlaceHolder:"{{PREFIX}}",customAnimationDurations:{},animationClasses:{bounce:"lpBounceClass",shakeX:"lpShakeXClass",shakeY:"lpShakeYClass"},LPReadNotificationsTypes:{none:{value:"none"},visual:{value:"visual",templates:{PENDING:"{{iconTitle}}",SENT:"{{iconTitle}}",ACCEPT:"{{iconTitle}}",READ:"{{iconTitle}}",ERROR:"{{iconTitle}}",image_ERROR:"{{iconTitle}}",image_RETRY:"{{iconTitle}}"}},text:{value:"text"}},initialize:function(e){this.uiPath=lpTag.unifiedWindow.uiModelPath,this.chatPath=lpTag.unifiedWindow.chatModelPath,this.appContext=e.appContext,e.appContext&&e.appContext.timeStampManager&&(this.timeStampManager=e.appContext.timeStampManager,this.timeStampGroupingEnabled=this.timeStampManager.timeStampGroupingEnabled()),l.enableStrictCspMode=!!(this.appContext&&this.appContext.conf&&this.appContext.conf.unifiedConf&&this.appContext.conf.unifiedConf.enableStrictCspMode),l.animationCreated||l.enableStrictCspMode||!this.appContext.deviceDetector.isAnimationSupported()||(l.animationPrefix=this.appContext.deviceDetector.getAnimationData().preFix,l.animationsSupported=!0,l.cssAnimation=document.createElement("style"),l.cssAnimation.type="text/css",document.getElementsByTagName("head")[0].appendChild(l.cssAnimation),this.createDefaultAnimations())},render:function(){l.enableStrictCspMode&&this.customize(this.view)}}),(l=lpTag.unifiedWindow.BaseViewController.prototype).templateString=function(e,t){e=window.liveperson.uiframework.latest.ViewController.prototype.templateString.call(this,e,t);return e=l.enableStrictCspMode?(function(e){"string"==typeof e&&(e=(e=e.replace(/(<[^>]+) style=".*?"/gi,"$1")).replace(/<[^>]+ style=".*?" \/>/gi,function(e){return e.replace(/ style=".*?"/gi,"")}));return e})(e):this.customize(e)},l.createDefaultAnimations=function(){l.animationCreated||(this.createKeyframe(this.animationClasses.bounce,[{percent:0,animate:this.prefixPlaceHolder+"transform: scale(1, 1);"},{percent:40,animate:this.prefixPlaceHolder+"transform: scale(1.15, 1.1);"},{percent:100,animate:this.prefixPlaceHolder+"transform: scale(1, 1);"}],500),this.createKeyframe(this.animationClasses.shakeX,[{percent:0,animate:this.prefixPlaceHolder+"transform: translateX(0px);"},{percent:20,animate:this.prefixPlaceHolder+"transform: translateX(-15px);"},{percent:40,animate:this.prefixPlaceHolder+"transform: translateX(15px); "},{percent:60,animate:this.prefixPlaceHolder+"transform: translateX(-10px);"},{percent:80,animate:this.prefixPlaceHolder+"transform: translateX(10px);"},{percent:100,animate:this.prefixPlaceHolder+"transform: translateX(0px);"}],400),this.createKeyframe(this.animationClasses.shakeY,[{percent:0,animate:this.prefixPlaceHolder+"transform: translateY(0px);"},{percent:20,animate:this.prefixPlaceHolder+"transform: translateY(-15px);"},{percent:40,animate:this.prefixPlaceHolder+"transform: translateY(15px); "},{percent:60,animate:this.prefixPlaceHolder+"transform: translateY(-10px);"},{percent:80, animate:this.prefixPlaceHolder+"transform: translateY(10px);"},{percent:100,animate:this.prefixPlaceHolder+"transform: translateY(0px);"}],400),l.animationCreated=!0)},l.createKeyframe=function(e,t,i){if(l.cssAnimation){for(var n="."+e+" {"+l.animationPrefix+"animation: lpanim_"+e+" "+i/1e3+"s 0s 1 ease-in-out;}@"+l.animationPrefix+"keyframes lpanim_"+e+" {",a=0;at[i]?1:0}):t},cloneObj:function(e){return JSON.parse(JSON.stringify(e))},isEmptyLiteral:function(e){for(var t in e)return!1;return!0},isSameObject:f,addClassByArray:function e(t,i){var n;if(h(i))for(var a=0;a":">",'"':""","'":"'","/":"/","`":"`","=":"="};if(e)return e.replace(/[&<>"'`=/]/g,function(e){return t[e]})},createDateFromString:function(e){var t=new Date(e);return isNaN(t)&&(t=new Date,(e=e.match(/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)([.])(\d+)([+-])(\d+):(\d+)/))&&12==e.length&&(t.setUTCFullYear(parseInt(e[1],10)),t.setUTCMonth(parseInt(e[2],10)-1),t.setUTCDate(parseInt(e[3],10)),t.setUTCHours(parseInt(e[4],10)-parseInt(e[9]+"1",10)*parseInt(e[10],10)),t.setUTCMinutes(parseInt(e[5],10)-parseInt(e[9]+"1",10)*parseInt(e[11],10)),t.setUTCSeconds(parseInt(e[6],10))),e=null),t},formatDay:function(e,t,i,n,a,o){var s,r,l,d,c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],u=["Sun","Mon","Tues","Wed","Thurs","Fri","Sat"];if(t)for(var p=0,h=c.length;pdocument.F=Object<\/script>"),e.close(),l=e.F;t--;)delete l.prototype[s[t]];return l()};e.exports=Object.create||function(e,t){var i;return null!==e?(n.prototype=a(e),i=new n,n.prototype=null,i[r]=e):i=l(),void 0===t?i:o(i,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,i){var n=i(5).f,a=i(6),o=i(1)("toStringTag");e.exports=function(e,t,i){e&&!a(e=i?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},function(e,t,i){var n=i(28)("keys"),a=i(18);e.exports=function(e){return n[e]||(n[e]=a(e))}},function(e,t,i){var n=i(0),a=i(4),o=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:i(16)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t){var i=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0"):t},escapeHtml:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return e.replace(/[&<>"'`=/]/g,function(e){return t[e]})},htmlToElement:function(e){var t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},hasClass:function(e,t){return e.classList&&e.classList.contains?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){e.classList?e.classList.add(t):this.hasClass(e,t)||(e.className+=" "+t)},removeClass:function(e,t){e.classList?e.classList.remove(t):this.hasClass(e,t)&&(t=new RegExp("(\\s|^)"+t+"(\\s|$)"),e.className=e.className.replace(t," "))},generateRandomId:function(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)},appendAttributesFromObject:function(t,i){(0,a.default)(i).forEach(function(e){t.setAttribute(e,i[e])})}}},function(e,t,i){e.exports={default:i(66),__esModule:!0}},function(e,t,i){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,i){"use strict";t.__esModule=!0;var i=i(56),a=i&&i.__esModule?i:{default:i};function n(e,t){for(var i=0;i0?(e.index>=e.eventBufferLimit&&(e.index=0),e.fired[e.index]=t,e.index++):e.fired.push(t),e=null}}function l(e,t){var i=!1;if(!t)return u("Ev listen id not spec for unregister","ERROR","Events"),null;for(var n in e)if(e.hasOwnProperty(n))for(var a=0;a0)for(var o=0;o0}function d(t,e,i){return function(){try{t.func.call(t.context,e,i),e=null,t.triggerOnce&&n(t),t=null}catch(e){w.log("Error executing "+i.eventName+" eventId: "+t.id+"e="+e.message,"ERROR","Events")}}}function u(e){w.storeEventData({triggerData:e,eventBufferLimit:o,attrName:r,fired:l,index:v})}var p,o,h,s="Events",r="eventName",f=0,g={},l=[],m="evId_",v=0;h=e&&e.appName||"*",p=!(!e||"boolean"!=typeof e.cloneEventData)&&e.cloneEventData,o=e&&!isNaN(e.eventBufferLimit)?e.eventBufferLimit:-1,this.once=t,this.hasFired=i,this.trigger=a,this.publish=a,this.bind=c,this.register=c,this.unbind=n,this.unregister=n}return t||(e.Events=e.Events||i),i})(t,e,!0)}.apply(i,[n]))&&(e.exports=a)})("undefined"==typeof ChronosRoot?this:ChronosRoot)},function(e,t,i){var n=i(10),a=i(4).document,o=n(a)&&n(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},function(e,t,i){e.exports=!i(2)&&!i(8)(function(){return 7!=Object.defineProperty(i(38)("div"),"a",{get:function(){return 7}}).a})},function(e,t,i){var n=i(20);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,i){"use strict";function v(){return this}var w=i(16),_=i(3),C=i(47),T=i(9),y=i(13),E=i(86),b=i(26),S=i(44),I=i(1)("iterator"),N=!([].keys&&"next"in[].keys());e.exports=function(e,t,i,n,a,o,s){E(i,t,n);function r(e){if(!N&&e in p)return p[e];switch(e){case"keys":case"values":return function(){return new i(this,e)}}return function(){return new i(this,e)}}var l,d,n=t+" Iterator",c="values"==a,u=!1,p=e.prototype,h=p[I]||p["@@iterator"]||a&&p[a],f=h||r(a),g=a?c?r("entries"):f:void 0,m="Array"==t&&p.entries||h;if(m&&(m=S(m.call(new e)))!==Object.prototype&&m.next&&(b(m,n,!0),w||"function"==typeof m[I]||T(m,I,v)),c&&h&&"values"!==h.name&&(u=!0,f=function(){return h.call(this)}),w&&!s||!N&&!u&&p[I]||T(p,I,f),y[t]=f,y[n]=v,a)if(l={values:c?f:r("values"),keys:o?f:r("keys"),entries:g},s)for(d in l)d in p||C(p,d,l[d]);else _(_.P+_.F*(N||u),t,l);return l}},function(e,t,i){var n=i(17),a=i(15),o=i(11),s=i(30),r=i(6),l=i(39),d=Object.getOwnPropertyDescriptor;t.f=i(2)?d:function(e,t){if(e=o(e),t=s(t,!0),l)try{return d(e,t)}catch(e){}if(r(e,t))return a(!n.f.call(e,t),e[t])}},function(e,t,i){var n=i(45),a=i(23).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,a)}},function(e,t,i){var n=i(6),a=i(12),o=i(27)("IE_PROTO"),s=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=a(e),n(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},function(e,t,i){var s=i(6),r=i(11),l=i(78)(!1),d=i(27)("IE_PROTO");e.exports=function(e,t){var i,n=r(e),a=0,o=[];for(i in n)i!=d&&s(n,i)&&o.push(i);for(;t.length>a;)!s(n,i=t[a++])||~l(o,i)||o.push(i);return o}},function(e,t,i){var a=i(3),o=i(0),s=i(8);e.exports=function(e,t){var i=(o.Object||{})[e]||Object[e],n={};n[e]=t(i),a(a.S+a.F*s(function(){i(1)}),"Object",n)}},function(e,t,i){e.exports=i(9)},function(e,t,i){var n=i(29),a=Math.min;e.exports=function(e){return 0=e.length?{value:void 0,done:!0}:(e=n(e,t),this._i+=e.length,{value:e,done:!1})})},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(i(36)),o=n(i(57)),s=n(i(35)),r=n(i(64)),l=n(i(63)),d=n(i(52)),c=n(i(33)),u=i(37),p=(i=Error,(0,l.default)(f,i),f),l=((0,a.default)(h,[{key:"init",value:function(e){e&&(Object.prototype.hasOwnProperty.call(e,"maxAllowedElements")&&(!isNaN(e.maxAllowedElements)&&0this.maxAllowedElements||(i=o,o=this.provider.get(e.type),n=void 0,o&&(n=o(e),n=this.onAfterElementRendered?this.onAfterElementRendered(n,e):n)&&(t.appendChild(n),Array.isArray(e.elements)&&e.elements.forEach(function(e){var t=a.provider.get(e.type);t&&(t(e).classList.contains("lp-json-pollock-layout")||(i+=1),a.renderElement(e,n,i))}),n.afterRender)&&n.afterRender.call(n,e,t))}},{key:"render",value:function(e){var e=c.default.isString(e)?JSON.parse(e):e,t=(this.validate(e),document.createDocumentFragment()),i=document.createElement("div");return i.className="lp-json-pollock",c.default.isLayout(e.type)||(i.className+=" lp-json-pollock-single-element"),t.appendChild(i),this.renderElement(e,i),t}},{key:"validate",value:function(e){if(!c.default.isObject(e))throw new p("JsonPollock::validte - input is not an object");if(this.schemaValidator){e=this.schemaValidator.validate(e);if(!e.valid)throw new p("Schema validation error, see 'errors' for more details",e.errors)}}},{key:"registerAction",value:function(e,t){this.events.bind({eventName:e,func:function(e){t(e)}})}},{key:"unregisterAction",value:function(e){this.events.unbind({eventName:e})}},{key:"unregisterAllActions",value:function(){this.events.unbind({})}},{key:"registerElement",value:function(e,t){this.provider.set(e,t)}}]),h);function h(e){(0,s.default)(this,h),this.events=new u({cloneEventData:!0,appName:"json-pollock"}),this.provider=new d.default(this.events),this.maxAllowedElements=50,this.schemaValidator=e}function f(e,t){(0,s.default)(this,f);e=(0,r.default)(this,(f.__proto__||(0,o.default)(f)).call(this,e));return e.errors=t,e}l.TEMPLATE_TYPES=d.default.TYPES,t.default=l},function(e,t){},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=n(i(53)),l=n(i(62)),d=n(i(65)),c=n(i(34)),o=n(i(35)),s=n(i(36)),u=n(i(110)),w=n(i(33)),r=(i(37),{TEXT:"text",BUTTON:"button",IMAGE:"image",MAP:"map",VERTICAL:"vertical",HORIZONTAL:"horizontal",CAROUSEL:"carousel",CAROUSELSELECT:"carouselSelect",ACCORDIONSELECT:"accordionSelect",SUBMITBUTTON:"submitButton",CHECKBOX:"checkbox",CHECKLIST:"checklist",LIST:"list",SECTION:"section",SECTIONLIST:"sectionList",BUTTONLIST:"buttonList",TABS:"tabs"}),p="data-section-id",i=((0,s.default)(h,[{key:"get",value:function(e){return this.elements[e]}},{key:"set",value:function(e,t){this.elements[e]=t}},{key:"wrapAction",value:function(a,e,o){var s=this;return function(i,n){e&&i&&i.preventDefault&&i.preventDefault(),a.actions instanceof Array&&a.actions.forEach(function(e){var t={actionData:e,metadata:a.metadata,uiEvent:i};o&&(t.groupID=o),n&&(t.formEl=n),s.events.trigger({eventName:e.type,data:t})})}}}]),h);function h(e){var v=this;(0,o.default)(this,h),this.elements={},this.events=e,this.set(r.TEXT,function(e){var t=document.createElement("div"),i=document.createElement("span"),n=e.tooltip?w.default.escapeHtml(e.tooltip):"",a=(t.className="lp-json-pollock-element-text",e.rtl&&(t.dir="rtl",w.default.addClass(t,"direction-rtl")),w.default.styleToCss(e.style)),a=w.default.extractFromStyles(a,"background-color"),o=(t.setAttribute("style",a.extractedStyle),w.default.normalizeHtmlText(u.default.sanitize(e.text)));return i.innerHTML=o,i.setAttribute("style",a.style),i.setAttribute("title",n),e.accessibility&&e.accessibility.web?w.default.appendAttributesFromObject(i,e.accessibility.web):i.setAttribute("aria-label",n),t.appendChild(i),t}),this.set(r.BUTTON,function(o){var e,t=document.createElement("div"),s=(t.className="lp-json-pollock-element-button",o.rtl&&(t.dir="rtl",w.default.addClass(t,"direction-rtl")),document.createElement("button")),i=o.customSettings&&o.customSettings.blockSCWhenNotLastMsg,n=w.default.normalizeHtmlText(u.default.sanitize(o.title)),r=(s.innerHTML=n,o.subtitle&&((n=document.createElement("span")).className="lp-json-pollock-element-button-subtitle",e=w.default.normalizeHtmlText(u.default.sanitize(o.subtitle)),n.innerHTML=e,s.appendChild(n)),o.tooltip&&(s.title=o.tooltip,s.setAttribute("aria-label",o.tooltip)),i&&(s.setAttribute("disabled","true"),s.classList.add("lp-json-pollock-element-submit-button-disabled")),o.accessibility&&o.accessibility.web&&w.default.appendAttributesFromObject(s,o.accessibility.web),o.click);return r&&r.actions&&!i&&(o.ref?s.onclick=function(e,t){var i=[],n=(function e(t){if(t)return t.classList.contains("lp-json-pollock")?t:e(t.parentNode)})(s);if(!n)throw new Error("Cannot find root element selected!");var a=void 0;switch(o.ref.type){case"carouselSelect":a="[data-carousel-name="+o.ref.name+"] [data-selected]";break;case"accordionSelect":a="[data-accordion-name="+o.ref.name+"] [data-accordion-body][data-selected]";break;default:throw new Error("Invalid config ref type is used for the button! Type: "+o.ref.type)}n=(0,c.default)(n.querySelectorAll(a));if(0===n.length)throw new Error("No items has selected!");n=n.map(function(e){return JSON.parse(e.getAttribute("data-metadata")||"[]")}).reduce(function(e,t){return[].concat((0,d.default)(e),(0,d.default)(t))},[]);return i.push.apply(i,(0,d.default)(n)),v.wrapAction((0,l.default)({},r,{metadata:i}))(e,t)}:s.onclick=v.wrapAction(o.click)),"button"!==o.class?(o.style&&(e=w.default.styleToCss(o.style),n=w.default.extractFromStyles(e,"background-color"),s.style.cssText=n.style,t.setAttribute("style",n.extractedStyle)),t.appendChild(s)):((i=document.createElement("div")).className="lp-json-pollock-element-button-button",w.default.addClass(i,"class-button"),o.style&&(e=w.default.styleToCss(o.style),n=w.default.extractFromStyles(e,"background-color"),s.style.cssText=n.style,i.setAttribute("style",n.extractedStyle),""!==(e=w.default.styleToBorder(o.style)))&&i.setAttribute("style",n.extractedStyle+" "+e),i.appendChild(s),t.appendChild(i)),t}),this.set(r.SUBMITBUTTON,function(e){var t=document.createElement("div"),i=(t.className="lp-json-pollock-element-submit-button",e.rtl&&(t.dir="rtl",w.default.addClass(t,"direction-rtl")),document.createElement("input")),n=e.customSettings&&e.customSettings.blockSCWhenNotLastMsg;return i.type="submit",i.value=w.default.normalizeHtmlText(e.title),(e.disabled||n)&&(i.disabled=!0,i.classList.add("lp-json-pollock-element-submit-button-disabled")),e.tooltip&&(i.title=e.tooltip,i.setAttribute("aria-label",e.tooltip)),e.style&&(n=w.default.styleToCss(e.style),n=w.default.extractFromStyles(n,"background-color"),t.setAttribute("style",n.extractedStyle),i.style.cssText=n.style),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(i,e.accessibility.web),e.click&&e.click.actions&&(i.onclick=v.wrapAction(e.click,!0)),t.appendChild(i),t}),this.set(r.CHECKBOX,function(e){var t=w.default.generateRandomId(),n=document.createElement("div"),i=(n.className="lp-json-pollock-element-checkbox",document.createElement("input")),a=w.default.normalizeHtmlText(u.default.sanitize(e.text)),o=e.customSettings&&e.customSettings.blockSCWhenNotLastMsg,s=(i.type="checkbox",i.className="lp-json-pollock-element-checkbox-input",i.id=t,document.createElement("label")),t=(s.className="lp-json-pollock-element-checkbox-label",s.innerHTML+=a,s.setAttribute("for",t),e.rtl&&(s.dir="rtl",w.default.addClass(s,"direction-rtl")),e.tooltip&&(s.title=e.tooltip,s.setAttribute("aria-label",e.tooltip)),o&&i.setAttribute("disabled","true"),e.borderLine&&((a=document.createElement("div")).className="lp-json-pollock-border-element",e.borderColor&&(a.style.borderColor=e.borderColor),n.appendChild(a)),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(s,e.accessibility.web),document.createElement("div"));return t.className="lp-json-pollock-element-checkbox-wrapper",e.rtl&&(t.dir="rtl",w.default.addClass(t,"direction-rtl")),e.style&&(a=w.default.styleToCss(e.style),e=w.default.extractFromStyles(a,"background-color"),s.style.cssText=a,t.setAttribute("style",e.extractedStyle)),t.appendChild(i),t.appendChild(s),n.appendChild(t),n.afterRender=function(e,t){var i=n.getElementsByTagName("input")[0];e.click&&e.click.actions&&!o&&(i.onclick=v.wrapAction(e.click,!1,t.parentElement.getAttribute(p)))},n}),this.set(r.CHECKLIST,function(e){var t=document.createElement("div");return t.className="lp-json-pollock-layout-checklist",t.setAttribute("role","group"),e.padding&&(e=e.padding,t.style.margin=e/2+"px 0px"),t}),this.set(r.SECTION,function(e){var t,i=document.createElement("div");return i.className="lp-json-pollock-layout-section",e.padding&&(t=e.padding,i.style.margin=t/2+"px 0px"),e.sectionID&&i.setAttribute(p,e.sectionID),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(i,e.accessibility.web),i}),this.set(r.SECTIONLIST,function(){var e=document.createElement("div");return e.className="lp-json-pollock-layout-sectionList",e}),this.set(r.BUTTONLIST,function(){var e=document.createElement("div");return e.className="lp-json-pollock-layout-buttonList",e}),this.set(r.LIST,function(){var s=document.createElement("form");return s.className="lp-json-pollock-layout lp-json-pollock-layout-form",s.afterRender=function(){var e=s.querySelectorAll("input");if(0"+u.default.sanitize(e.caption)+""),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(i,e.accessibility.web),i.onload=function(){w.default.removeClass(t,"loading")},i.onerror=function(){w.default.removeClass(t,"loading"),w.default.addClass(t,"error"),t.title="fail to load image",i.style.display="none"},e.click&&e.click.actions&&(i.onclick=v.wrapAction(e.click)),t.appendChild(i),t}),this.set(r.MAP,function(t){var e=t.accessibility&&t.accessibility.web,i=document.createElement("div");return i.className="lp-json-pollock-element-map",t.tooltip&&(i.title=t.tooltip,i.setAttribute("aria-label",t.tooltip)),t.style&&(i.style.cssText=w.default.styleToCss(t.style)),e&&w.default.appendAttributesFromObject(i,t.accessibility.web),e&&e.tabindex||i.setAttribute("tabindex","0"),i.onkeydown=function(e){13!==e.keyCode&&32!==e.keyCode||(e.preventDefault(),window.open("https://www.google.com/maps/search/?api=1&query="+t.la+","+t.lo,"_blank"))},t.click&&t.click.actions?i.onclick=v.wrapAction(t.click):i.onclick=function(){window.open("https://www.google.com/maps/search/?api=1&query="+t.la+","+t.lo,"_blank")},i}),this.set(r.VERTICAL,function(e){var t,i,n=document.createElement("div");return n.className="lp-json-pollock-layout lp-json-pollock-layout-vertical","borderLess"===e.border?w.default.addClass(n,"lp-json-pollock-layout-borderLess"):"dropShadow"===e.border&&w.default.addClass(n,"lp-json-pollock-layout-dropShadow"),"enable"===e.scroll&&(w.default.addClass(n,"lp-json-pollock-layout-vertical-scroll"),e.style&&e.style.size?(i=100,"medium"===(t=e.style.size)?i=300:"large"===t&&(i=500),n.setAttribute("style","height: "+i+"px")):n.setAttribute("style","height: 100px")),e.accessibility&&e.accessibility.web&&w.default.appendAttributesFromObject(n,e.accessibility.web),e.metadata&&n.setAttribute("data-metadata",(0,a.default)(e.metadata)),n}),this.set(r.TABS,function(i){function n(e){for(var t=c.children,i=t[0].children,n=[],a=1;ah.offsetWidth&&(d.style.visibility="hidden",c.style.visibility="hidden"),m=h.children,"rtl"===window.getComputedStyle(c).direction&&(d.style.visibility="visible",c.style.visibility="visible",g=m.length-1,m=[].slice.call(m,0).reverse(),l=-1*(m[g].offsetLeft-(u.offsetWidth-m[g].offsetWidth))+"px",h.style.left=l)},0),c.onclick=function(e){!function(e){g===m.length-1?g=0:g+=1,n(),i.call(this,e)}.call(v,e)},d.onclick=function(e){!function(e){0===g?g=m.length-1:--g,n(),i.call(this,e)}.call(v,e)}}},u}),this.set(r.CAROUSELSELECT,function(n){function i(e,t){t?(e.setAttribute("data-selected","true"),e.classList.add("lp-json-pollock-layout-selected"),n.style&&n.style["border-color-selected"]&&(e.style.borderColor=n.style["border-color-selected"])):(e.removeAttribute("data-selected"),e.classList.remove("lp-json-pollock-layout-selected"),e.style.borderColor="")}function a(e){var t=(function e(t){if(t&&"BUTTON"!==t.tagName)return null!==t.getAttribute("data-carousel-index")?t:e(t.parentNode)})(e.target);t&&("single"===n.selectMode.type&&t.parentNode&&(0,c.default)(t.parentNode.querySelectorAll("[data-carousel-index][data-selected]")).filter(function(e){return e!==t}).forEach(function(e){i(e,!1)}),i(t,"true"!==t.dataset.selected))}var e,o=n.padding||0,s=document.createElement("div"),r=document.createElement("div");return n.accessibility&&n.accessibility.web&&w.default.appendAttributesFromObject(s,n.accessibility.web),n.style&&(e=w.default.styleToCss(n.style),e=w.default.extractFromStyles(e,"background-color"),r.style.cssText=e.style,r.setAttribute("style",e.extractedStyle)),s.afterRender=function(){var e=s.children.length;if(e){for(var t=0;t