function Tooltip(e,t,n,r){this.tooltipPosition=e,this.tooltipKey=t,this.timeOut=n,this.iconClass=r,this.text=funcObj.langCon.getString(this.tooltipKey),this.shown=!1,this.selector="",this.isCurrentlyShowing=!1;if(this.text===undefined||this.text===null)throw new Error("Tooltip text not found in language lookup!");Tooltip.prototype.show=function(e){this.selector=e;var t=this,n=_.template(tooltip_view_template)({tooltipKey:this.tooltipKey,iconClass:this.iconClass,tooltipText:this.text});n=$.parseHTML(n),$(e).append(n);if(this.tooltipPosition)$(n).css(this.tooltipPosition);else{var r=$(e).width(),i=$(e+" .tooltip").width(),s=r-i;$(e+" .tooltip").css({left:(s-30)/2+"px",right:(s-30)/2+"px",top:"14rem"})}this.timeOut!==null&&(this.interval=setTimeout(function(){t.hide()},this.timeOut)),setTimeout(function(){app.Models.MainLayoutModel.get("deviceTray")&&$(e+" .tooltip").css({opacity:1})},2e3),t.isCurrentlyShowing=!0},Tooltip.prototype.hide=function(){var e=$("#"+this.tooltipKey);e.css({opacity:0}),this.interval&&clearInterval(this.interval),setTimeout(function(){e.remove()},300),this.isCurrentlyShowing=!1,this.shown=!0}}function TooltipService(){function t(){this.tooltips=[new Tooltip({bottom:"4rem",right:"3.5rem"},"tooltipScroll",1e4,"chevron_down"),new Tooltip(null,"tooltipSwipe",1e4,"chevron_left")],this.tooltips.forEach(function(t){e[t.tooltipKey]=t})}function n(t,n){var r=e[t];if(r.shown||r.isCurrentlyShowing)return;return r.show(n),r}function r(t){var n=e[t];n.isCurrentlyShowing&&n.hide(),this.commit()}function i(){var e=[];return tooltips.forEach(function(t){t.shown&&e.push(t.tooltipKey)}),e=e.join(","),e}function s(){funcObj.appcomm.appSend({method:"getData",params:{name:"tooltipsTracker"},id:null},function(t){if(t!==null){var n=t.split(",");n.forEach(function(t){e[t].shown=!0})}})}function o(){var e=this.getSerializedString();funcObj.appcomm.appSend({method:"setData",params:{name:"tooltipsTracker",value:e},id:null})}this.commit=o,this.showTooltip=n,this.closeTooltip=r,this.setFromSerializedString=s,this.getSerializedString=i;var e={};t(),this.setFromSerializedString()};