/*! @proximus/guidedcontact 1.5.0 2023-09-27 13:56:29 */ var GuidedContact=GuidedContact||{};GuidedContact=function(a){"use strict";function b(){c(),GuidedContact.Showhide.bindPanel()}function c(){for(var b=document.querySelectorAll("["+a+"]"),c=0;c',d=d.replace(/\%id/g,this.sources[a].token).replace(/\%label/g,this.sources[a].label);var e=document.createElement("div");e.className="row",e.innerHTML=d.replace(/\%gridColumn/g,c).replace(/\%uuid/g,this.uuid),this.context.appendChild(e)},attachEvents:function(){this.getChatQueue().push(["_onEvent","button_shown",this.onChatReady(this)]),this.getChatQueue().push(["_onEvent","message_received",this.checkChatBci(this)]),jQuery(document).off("click.guidedContact").on("click.guidedContact",".jsrs-gc-start-chat",this.onClickChatItem(this))},toggleChatItems:function(a){for(var b=this.context.querySelectorAll(".dimelo_chat_item_markup"),c=0,d=b.length;cg?(c=e,e=g,g=c):e===g&&f>h&&(c=f,f=h,h=c);var i=new Date,j=new Date(i.getFullYear(),i.getMonth(),i.getDate(),e,f),k=new Date(i.getFullYear(),i.getMonth(),i.getDate(),g,h);return Date.now()>=j.getTime()&&Date.now()-1&&(a.needsBci=!0);var e=a.context.querySelector("#dimelo_chat_button_"+c);e&&(jQuery(e).trigger("click"),d&&inception.sendTmsEvent("open","clicktochat",d),a.toggleChatItems(!1))}}},onPanelExpandOpen:function(a){return function(b,c){a.panelAvailable||inception.sendTmsEvent("click","contactpage","gotochat_unavailable"),c.innerHTML=c.innerHTML.replace(/data-radio-id/gi,"id"),history.pushState({},document.title,location.pathname),a.chatRefresh&&jQuery(a.chatRefresh).off("click.guidedContact").on("click.guidedContact",a.onRefresh(a))}},onRefresh:function(a){return function(){if(!a.chatRefresh)return!0;""!==location.search&&location.search.indexOf("?")>-1?location.replace(location+"&"+a.chatRefreshParamUrl):location.replace(location+"?"+a.chatRefreshParamUrl)}},checkChatBci:function(a){return function(){a.needsBci&&inception.clickToApps.getInstance("chat").getBciLead(),a.needsBci=!1}}};var GuidedContact=GuidedContact||{};GuidedContact.Chatbot={init:digitalAssistantTools.openChatBot};var GuidedContactFlow=function(a){this.context=a,this.panelId=this.getPanelId(),this.attachEvents()};GuidedContactFlow.prototype={getPanelId:function(){return $(this.context).data("expand-panel")},getInitString:function(){return $(this.context).attr("data-flow-initstring")},getGuidedContactHtml:function(){var a="";return a+='
',a+="",a+="",a+="
"},compileDirective:function(a){if(!a)return!1;inception.ngCompileDirective(a)},handlePanelOpen:function(a){return function(b,c){c.querySelector(".row .columns").innerHTML+=a.getGuidedContactHtml(),a.compileDirective($(c))}},attachEvents:function(){$(this.context).on("rslib.panelExpand.open",this.handlePanelOpen(this))}};var GuidedContact=GuidedContact||{};GuidedContact.Showhide=function(a,b,c,d,e){function f(){t(),g()}function g(){h(),$(a).on(e,m),$(c).on(e,function(a){a.preventDefault(),p(),t(),$(c).hide()}),$(".jsrs-expand-panel").on("rslib.panelExpand.open."+e,k),$(".jsrs-expand-panel").on("rslib.panelExpand.close."+e,k),$(".jsrs-expand-panel").on("rslib.panelExpand.open.keypress.guidedcontact",k),$(".jsrs-expand-panel").on("rslib.panelExpand.close.keypress.guidedcontact",k)}function h(){$(a).off(e,m),$(c).off(e),$(d).off(e),$(".jsrs-expand-panel").off("rslib.panelExpand.open."+e,k),$(".jsrs-expand-panel").off("rslib.panelExpand.close."+e)}function i(a,b){for(var c=0;c640?inception.scrollToElement(a[1],80):inception.scrollToElement(a[1],20)}function r(a){var b=a[1].querySelector(".jsrs-gc-start-chat");if(b){var c=a[1].className.replace("panelExpand","").replace("Chat",""),d=c+"-"+(b.getAttributeNode("disabled")?"disabled":"enabled");inception.sendTmsEvent("click",w,d)}}function s(){$(".jsrs-expand-panel").off("rslib.panelExpand.open.showhide").on("rslib.panelExpand.open.showhide",function(){f()}),$(".jsrs-expand-panel").off("rslib.panelExpand.close.showhide").on("rslib.panelExpand.close.showhide",function(){setTimeout(function(){p(),$(c).hide()},300)})}function t(){for(var b=$(a),c=0,d=b.length;c