"use strict";(self.webpackChunkLiveHelperChat=self.webpackChunkLiveHelperChat||[]).push([[603],{7603:function(t,i,s){s.r(i),s.d(i,{activityMonitoring:function(){return c}});var e=s(3029),n=s(9530),u=s(5107),a=s(7912),c=new(function(){return(0,n.A)((function t(){(0,e.A)(this,t),this.params={},this.timeoutStatuscheck=null,this.timeoutActivity=null,this.attributes=null,this.userActive=1}),[{key:"attatchActivityListeners",value:function(){var t=this;if(this.params.track_activity){var i=function(){t.resetTimeoutActivity()};this.params.track_mouse&&(u.s.listen(window,"mousemove",i,"lhc_mousemove_w"),u.s.listen(document,"mousemove",i,"lhc_mousemove_d")),u.s.listen(window,"mousedown",i,"lhc_mousedown"),u.s.listen(window,"click",i,"lhc_click"),u.s.listen(window,"scroll",i,"lhc_scroll"),u.s.listen(window,"keypress",i,"lhc_keypress"),u.s.listen(window,"load",i,"lhc_load"),u.s.listen(document,"scroll",i,"lhc_scroll"),u.s.listen(document,"touchstart",i,"lhc_touchstart"),u.s.listen(document,"touchend",i,"lhc_touchend"),this.resetTimeoutActivity()}}},{key:"resetTimeoutActivity",value:function(){var t=this,i=0==this.userActive;this.userActive=1,1==i&&this.syncUserStatus(1),clearTimeout(this.timeoutActivity),this.timeoutActivity=setTimeout((function(){t.userActive=0,t.syncUserStatus(1)}),3e5)}},{key:"setParams",value:function(t,i){this.params=t,this.attributes=i,this.attatchActivityListeners(),this.initMonitoring()}},{key:"initMonitoring",value:function(){var t=this;clearTimeout(this.timeoutStatuscheck),this.timeoutStatuscheck=setTimeout((function(){t.syncUserStatus(0),t.initMonitoring()}),1e3*this.params.timeout)}},{key:"syncUserStatus",value:function(t){var i=this,s=this.attributes.userSession.getSessionAttributes(),e={vid:this.attributes.userSession.getVID(),wopen:this.attributes.widgetStatus.value?1:0,uaction:t,uactiv:this.userActive,dep:this.attributes.department.join(",")};s.id&&s.hash&&(e.hash=s.id+"_"+s.hash),a.q.makeRequest(this.attributes.LHC_API.args.lhc_base_url+this.attributes.lang+"widgetrestapi/chatcheckstatus",{params:e},(function(t){1==t.change_status&&i.attributes.onlineStatus.value!=t.online&&i.attributes.onlineStatus.next(t.online)}))}}])}())}}]);
//# sourceMappingURL=a92366215ad3e9b74e1c.js.map