/* Minification failed. Returning unminified contents.
(2,20522-20523): run-time error JS1195: Expected expression: >
 */
(function(n){n.fn.emoji=function(t){var u={button:"&#x1F642;",place:"before",emojis:["&#x1F642;","&#x1F641;","&#x1f600;","&#x1f601;","&#x1f602;","&#x1f603;","&#x1f604;","&#x1f605;","&#x1f606;","&#x1f607;","&#x1f608;","&#x1f609;","&#x1f60a;","&#x1f60b;","&#x1f60c;","&#x1f60d;","&#x1f60e;","&#x1f60f;","&#x1f610;","&#x1f611;","&#x1f612;","&#x1f613;","&#x1f614;","&#x1f615;","&#x1f616;","&#x1f617;","&#x1f618;","&#x1f619;","&#x1f61a;","&#x1f61b;","&#x1f61c;","&#x1f61d;","&#x1f61e;","&#x1f61f;","&#x1f620;","&#x1f621;","&#x1f622;","&#x1f623;","&#x1f624;","&#x1f625;","&#x1f626;","&#x1f627;","&#x1f628;","&#x1f629;","&#x1f62a;","&#x1f62b;","&#x1f62c;","&#x1f62d;","&#x1f62e;","&#x1f62f;","&#x1f630;","&#x1f631;","&#x1f632;","&#x1f633;","&#x1f634;","&#x1f635;","&#x1f636;","&#x1f637;","&#x1f638;","&#x1f639;","&#x1f63a;","&#x1f63b;","&#x1f63c;","&#x1f63d;","&#x1f63e;","&#x1f63f;","&#x1f640;","&#x1f643;","&#x1f4a9;","&#x1f644;","&#x2620;","&#x1F44C;","&#x1F44D;","&#x1F44E;","&#x1F648;","&#x1F649;","&#x1F64A;"],fontSize:"20px",listCSS:{position:"absolute",border:"1px solid gray","background-color":"#fff",display:"none"},rowSize:10},i={},r;if(t)for(r in u)i[r]=t[r]?t[r]:u[r];else i=u;return this.each(function(t,r){function s(){f.show();o.focus();setTimeout(function(){n(document).on("click",h);e.off("click",s)},1)}function h(){f.hide();e.on("click",s);n(document).off("click",h)}function c(n){if(!(r.textLength>r.maxLength-2)){if(r.selectionStart||r.selectionStart=="0"){var t=r.selectionStart,i=r.selectionEnd;r.value=r.value.substring(0,t)+n.currentTarget.innerHTML+r.value.substring(i,r.value.length)}else r.value+=n.currentTarget.innerHTML;h();o.focus();r.selectionStart=t+2;r.selectionEnd=i+2}}var o=n(r),e=n("<span>",{title:"Emojis"}).html(i.button).css({cursor:"pointer","font-size":i.fontSize}).on("click",s),f=n("<div>").css(u.listCSS).css(i.listCSS);for(var t in i.emojis)t>0&&t%i.rowSize==0&&n("<br>").appendTo(f),n("<span>").html(i.emojis[t]).css({cursor:"pointer","font-size":i.fontSize}).on("click",c).appendTo(f);i.place==="before"?e.insertBefore(this):e.insertAfter(this);f.insertAfter(o)}),this}})(jQuery);;
+function(n,t){"use strict";var i=n.ContractFX=n.ContractFX||{},r;i.Controls=i.Controls||{};r=i.Controls.ERFx=i.Controls.ERFx||{};r.Comments=function(i,r,u,f,e,o,s,h,c,l,a,v){var y,w;this.containerId=i;this.container=t("#"+i);this.noResponce=t("#"+r);this.isAuth=o.toLowerCase();this.userId=h;this.ownerID=c;this.moderatorId=l;this.isStreaming=s.toLowerCase();y=this;this.chat=t.connection.commentHub;this.isConnected=!1;this.isLoadingComments=!1;this.isTheEnd=!1;this.TotalCount=0;this.commentsId=u;this.channelName=f;this.commentCount=30;typeof a!="undefined"&&a>0&&(this.commentCount=a);this.repliesCount=10;typeof v!="undefined"&&v>0&&(this.repliesCount=v);this.isLoadBottom=!1;this.isFirstLoad=!0;this.notificationMessageId=0;this.notificationRepliesId=0;this.idIntervals=0;this.clientTZOffset=(new Date).getTimezoneOffset();this.clientTZHour=this.clientTZOffset/60;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t(function(){function i(){var o=document.createDocumentFragment(),s=document.createElement("div"),t=document.createElement("div"),r,i,u,f,e;return t.setAttribute("class","d-flex align-items-center"),r=document.createElement("A"),r.setAttribute("href","#"),r.setAttribute("onclick","k12PopupEFX.Hide(); ShowLoginPopup(ContractFX.Controls.Auth.LoginPopup.TYPE_CLIENT); return false;"),r.setAttribute("style","margin-right: 4px; padding:10px 0; font-size: 16px;"),r.innerText="Sign In",i=document.createElement("A"),i.setAttribute("href","#"),n.location.pathname.indexOf("view")!==-1?i.setAttribute("onclick","k12PopupEFX.Hide(); window.location.href = window.location.origin + '/AttendeeReg.aspx?rs=1&view=' +   window.location.pathname.replace('/view/', '')"):i.setAttribute("onclick","k12PopupEFX.Hide(); window.location.href = window.location.origin + '/AttendeeReg.aspx'"),i.setAttribute("style","margin-left: 4px; padding: 10px 0; font-size: 16px;"),i.innerText="Sign Up ",u=document.createElement("span"),u.innerHTML="You must ",f=document.createElement("span"),f.innerHTML=" to use comments.",e=document.createElement("span"),e.innerText="/",t.appendChild(u),t.appendChild(i),t.appendChild(e),t.appendChild(r),t.appendChild(f),o.appendChild(t),s.appendChild(o),s.children}var u,r;y.container.show();y.noResponce.hide();o.toLowerCase()==="false"?y.container.find(".js--send-comment").click(function(){k12PopupEFX.btnContinue.SetText("Ok");k12PopupEFX.Alert(i(),undefined,360)}):y.container.find(".js--txt-comment-message").emoji();y.chat.client.errorOccured=function(n){k12PopupEFX.Alert(n)};y.chat.client.broadcastComment=function(n){if(n.FK_OnlineChatMessageReplyTo>0){var t=y.container.find(".comment[id="+n.FK_OnlineChatMessageReplyTo+"]").first();y.addRepliesToChat(n,t,!0,!1,!0)}else y.addMessageObj(n,!1);y.TotalCount++;y.changeCount()};y.chat.client.editMessage=function(n){var t=y.findComment(n.ID);t.find(".js--comment-text > span").first().html(n.MessageText);t.find(".js--comment-edit-label").first().show()};y.chat.client.deleteComment=function(n){var t=y.findComment(n.ID),i;y.userId==y.ownerID||y.moderatorId>0?(t.find(".js--comment-text > span").html('"Deleted message"'),t.find(".js--comment-text > span").addClass("messageFromServer"),t.find(".js--reply-btn").remove(),y.hideDeleteBtn(t),y.hideEditBtn(t),y.hideCopyBtn(t),i=t.find(".js--menu-container").first(),i.children(".comment-menu__row:not(.hidden)").length<=0&&t.find(".js--toggle-menu-btn").addClass("hidden")):(t.remove(),n.FK_OnlineChatMessageReplyTo==0&&y.userId!=y.ownerID&&y.container.find(".js--comment-selected-label").hide())};y.chat.client.banUserHub=function(n){var t=y.container.find(".js--author > span:contains("+n.SavedAuthorName+")").closest(".comment");t.each(function(n){y.showUnbanBtn($(t[n]));c==h&&y.hidePromoteBtn($(t[n]))});y.showPopUpInMessages(n,"User "+n.SavedAuthorName+" has been banned.")};y.chat.client.unbanUserHub=function(n){var t=y.container.find(".js--author > span:contains("+n.SavedAuthorName+")").closest(".comment");t.each(function(n){y.showBanBtn($(t[n]));c==h&&y.showPromoteBtn($(t[n]))});y.showPopUpInMessages(n,"User "+n.SavedAuthorName+" has been unblocked.")};y.chat.client.promoteUserHub=function(n){var t=y.container.find(".js--author > span:contains("+n.SavedAuthorName+")").closest(".comment");t.each(function(n){$(t[n]).find(".js--moderator-label").first().removeClass("hidden");y.showDemoteBtn($(t[n]))});y.showPopUpInMessages(n,"User "+n.SavedAuthorName+" has been promoted to Moderator.")};y.chat.client.demoteUserHub=function(n){var t=y.container.find(".js--author > span:contains("+n.SavedAuthorName+")").closest(".comment");t.each(function(n){$(t[n]).find(".js--moderator-label").first().addClass("hidden");y.showPromoteBtn($(t[n]))});y.showPopUpInMessages(n,"User "+n.SavedAuthorName+" has been demoted from Moderator.")};y.chat.client.enabledCommentsAfterStopStream=function(){$("#divComments").removeClass("hidden-tab");y.textFielFocus();y.isStreamEnd=!0;y.isStreaming="false"};y.isStreaming.toLowerCase()=="false"&&y.InitLoadingMessages();$("#divComments").hasClass("hidden-tab")||p.has("m")&&(u=$(location).attr("href"),y.notificationMessageId=p.get("m").split("/")[0],y.notificationRepliesId=p.get("m").split("/")[1]);r=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});r.done(function(){y.chat.server.joinComment(y.commentsId);y.container.find(".js--send-comment-btn").click(function(){var u,n,r;if(y.IsValidMessage()){let i=0;u=!0;try{n=y.container.find(".js--txt-comment-message").val();n=n.replaceAll("<","&lt").replaceAll(">","&gt");y.chat.server.sendComment(n,i,f);y.ClearCommentInput()}catch(e){r=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});r.done(function(){var n=y.container.find(".js--txt-comment-message").val();n=n.replaceAll("<","&lt").replaceAll(">","&gt");y.chat.server.sendComment(n,i,f);y.ClearCommentInput()})}y.container.find(".js--send-comment-row").hide()}else o.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(i(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.")})});y.container.find(".js--send-comment-text-field").click(function(){y.textFielFocus()});y.container.find(".js--cancel-btn").click(function(){y.container.find(".js--send-comment-row").hide();y.ClearCommentInput()});y.container.find(".js--order-by").click(function(){var n=y.container.find(".js--order-by-menu");n.toggle("fast");let t=y.container.find(".js--order-by");$(document).mouseup(function(i){n.css("display")!="none"&&(n.is(i.target)||n.has(i.target).length!==0||t.is(i.target)||t.has(i.target).length!==0||n.hide())});y.container.find(".js--old-first").click(function(){var n=y.container.find(".comment:not(.js--comment-base)");y.showLoadPanel();y.container.find(".js--order-by span").first().text("Older first");y.isLoadBottom=!0;y.container.find(".js--comment-selected-label").hide();y.GetNextMessages(0,n);n.remove()});y.container.find(".js--new-first").click(function(){var n=y.container.find(".comment:not(.js--comment-base)");y.showLoadPanel();y.container.find(".js--order-by span").first().text("Newer first");y.isLoadBottom=!1;y.container.find(".js--comment-selected-label").hide();y.GetNextMessages(0,n);n.remove()})})});this.addMessageObj=function(n,t,i){var e=!0,u=y.container.find(".js--comment-container"),r=y.initCommentField(n),o;r.find(".js--txt-reply-message").emoji();i&&(u=y.container.find(".js--selected-comment-container"),y.container.find(".js--comment-selected-label").show(),y.ScrollToSelectedComment());n.HasReplies&&r.find(".js-toggle-replies-top").show();let s=r.find(".js-toggle-replies");s.click(function(){y.loadReplies(r,n,e);e=!1});let h=r.find(".js--more-replies");h.click(function(){y.loadMoreReplies(r,n)});let c=r.find(".js--reply-btn");c.click(function(){y.ReplyTo(r,n)});let l=r.find(".js--cancel-reply-btn");l.click(function(){y.cancelReply(r,n)});let a=r.find(".js--send-reply-btn");a.click(function(){y.sendReply(r,n)});let v=r.find(".js--delete-btn");v.click(function(){y.deleteComment(r,n)});let p=r.find(".js--ban-btn");p.click(function(){y.banUser(r,n)});let w=r.find(".js--unblock-btn");w.click(function(){y.unbanUser(r,n)});let b=r.find(".js--copy-btn");b.click(function(){y.copyText(r,n)});let k=r.find(".js--edit-btn");k.click(function(){y.editComment(r,n)});let d=r.find(".js--promote-btn");d.click(function(){y.promoteToModerator(r,n)});let g=r.find(".js--demote-btn");g.click(function(){y.demoteFromModerator(r,n)});let f=r.find(".js--toggle-menu-btn");f.click(function(){var n=r.find(".js--menu-container").first();n.children(".comment-menu__row:not(.hidden)").length<=0&&f.addClass("hidden");n.toggle("fast")});$(document).mouseup(function(n){let t=r.find(".js--menu-container"),i=r.find(".js--toggle-menu-btn").first();t.css("display")!="none"&&(t.is(n.target)||t.has(n.target).length!==0||i.is(n.target)||i.has(n.target).length!==0||t.hide())});o=r.find(".js--menu-container").first();o.children(".comment-menu__row:not(.hidden)").length<=0&&f.addClass("hidden");n.ID!=y.notificationMessageId&&r.show();t?u.append(r):u.prepend(r)};this.addRepliesToChat=function(n,t,i,r,u){var e=t.find(".js--reply-from-server"),f=y.initCommentField(n),o;f.find(".js--comment-bottom").remove();f.find(".js--comment-replies").remove();i?t.find(".js--more-replies").hide():t.find(".js--more-replies").show();let s=f.find(".js--cancel-reply-btn");s.click(function(){y.cancelReply(f,n)});let h=f.find(".js--send-reply-btn");h.click(function(){y.sendReply(f,n)});let c=f.find(".js--delete-btn");c.click(function(){y.deleteComment(f,n)});let l=f.find(".js--ban-btn");l.click(function(){y.banUser(f,n)});let a=f.find(".js--unblock-btn");a.click(function(){y.unbanUser(f,n)});let v=f.find(".js--copy-btn");v.click(function(){y.copyText(f,n)});let p=f.find(".js--edit-btn");p.click(function(){y.editComment(f,n)});let w=f.find(".js--promote-btn");w.click(function(){y.promoteToModerator(f,n)});let b=f.find(".js--demote-btn");b.click(function(){y.demoteFromModerator(f,n)});let k=f.find(".js--toggle-menu-btn");k.click(function(){f.find(".js--menu-container").first().toggle("fast")});$(document).mouseup(function(n){let t=f.find(".js--menu-container"),i=f.find(".js--toggle-menu-btn");t.css("display")!="none"&&(t.is(n.target)||t.has(n.target).length!==0||i.is(n.target)||i.has(n.target).length!==0||t.hide())});f.show();r?e.prepend(f):u?(o=t.find(".js--reply-from-hub").last(),o.append(f),t.find(".js-reply-all").show(),o.show()):(e.append(f),e.show())};this.loadMoreReplies=function(n,t){let i=n.find(".js--reply-from-server");var r=i.find(".comment").last(),u=r.attr("id"),f=n.find(".js--reply-from-hub");f.find(".comment").remove();y.GetRepliedMessages(t.ID,n,u,!1);n.find(".js-toggle-replies-bottom").show()};this.ReplyTo=function(n){y.container.find(".js--comment-reply").hide();y.container.find(".js--send-comment-row").hide();y.container.find(".js--reply-btn").show();n.find(".js--reply-btn").hide();var t=n.find(".js--comment-reply").first();t.show();t.find(".js--txt-reply-message").focus()};this.cancelReply=function(n){y.container.find(".js--txt-reply-message").val("").text("").focus();n.find(".js--comment-reply").hide();n.find(".js--reply-btn").show();var t=n.find(".js--txt-reply-message"),i=t.attr("isEdit");i!=null&&(t.removeAttr("isEdit"),n.find(".js--send-reply-btn").text("Add reply"),n.find(".js--send-reply-btn").prop("title","Send reply"))};this.sendReply=function(n,i){var r=n.find(".js--txt-reply-message"),e=r.attr("isEdit"),f,u;if(e!=null)if(r.removeAttr("isEdit"),n.find(".js--send-reply-btn").text("Add reply"),n.find(".js--send-reply-btn").prop("title","Send reply"),y.IsValidReplyMessage(n)){let f=i.ID;try{y.chat.server.editComment(r.val(),i.ID,y.channelName,y.userId);y.ClearReplyInput(n)}catch(s){u=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});u.done(function(){y.chat.server.editComment(r.val(),i.ID,y.channelName,y.userId);y.ClearReplyInput(n)})}n.find(".js--comment-reply").hide();n.find(".js--reply-btn").show()}else o.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(SignInAndUpBtn(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.");else if(y.IsValidReplyMessage(n)){let r=i.ID;n.find(".js--comment-reply").hide();n.find(".js--reply-btn").show();try{f=n.find(".js--txt-reply-message").val();f=f.replaceAll("<","&lt").replaceAll(">","&gt");y.chat.server.sendComment(f,r,y.channelName);y.ClearReplyInput(n)}catch(s){u=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});u.done(function(){var t=n.find(".js--txt-reply-message").val();t=t.replaceAll("<","&lt").replaceAll(">","&gt");y.chat.server.sendComment(t,r,y.channelName);y.ClearReplyInput(n)})}}else o.toLowerCase()==="false"?(k12PopupEFX.btnContinue.SetText("Ok"),k12PopupEFX.Alert(SignInAndUpBtn(),undefined,360)):k12PopupEFX.Alert("Please, Enter Your Message.")};this.promoteToModerator=function(n,i){k12PopupEFX.Confirm("Do you want to promote this user to moderator?",function(){if(i.ID>0)try{y.chat.server.promoteToModerator(f,i.ID,h)}catch(r){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.promoteToModerator(f,i.ID,h)})}else k12PopupEFX.Alert("Please, Select Message")})};this.demoteFromModerator=function(n,i){k12PopupEFX.Confirm("Do you want to Demote this user from moderators?",function(){if(i.ID>0)try{y.chat.server.demoteFromModerator(f,i.ID,h)}catch(r){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.demoteFromModerator(f,i.ID,h)})}else k12PopupEFX.Alert("Please, Select Message")})};this.banUser=function(n,i){k12PopupEFX.Confirm("Do you want to ban this user?",function(){if(i.ID>0)try{y.chat.server.banUser(f,i.ID,h)}catch(r){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.banUser(f,i.ID,h)})}else k12PopupEFX.Alert("Please, Select Message")})};this.unbanUser=function(n,i){k12PopupEFX.Confirm("Unblock this user?",function(){if(i.ID>0)try{y.chat.server.unblockUser(f,i.ID,h)}catch(r){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.unblockUser(f,i.ID,h)})}else k12PopupEFX.Alert("Please, Select Message")})};this.copyText=function(n,t){if(!t.IsDeleted){var i=document.createElement("textarea");document.body.appendChild(i);i.value=y.findComment(t.ID).find(".js--comment-text > span").html();i.select();document.execCommand("copy");document.body.removeChild(i)}n.find(".js--menu-container").first().toggle("fast");y.showPopUpInMessages(t,"Message copied")};this.editComment=function(n,t){y.ReplyTo(n,t);var i=n.find(".js--txt-reply-message");i.val(n.find(".js--comment-text > span").first().text());n.find(".js--menu-container").first().toggle("fast");n.find(".js--send-reply-btn > span").text("Edit");n.find(".js--send-reply-btn").prop("title","Edit");i.attr("isEdit",!0)};this.deleteComment=function(n,i){k12PopupEFX.Confirm("Do you want to delete this message?",function(){if(i.ID>0)try{y.chat.server.delete(i.ID,f,h)}catch(r){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.delete(i.ID,f,h)})}else k12PopupEFX.Alert("Please, Select Message")})};this.GetNextMessages=function(n,t){if(!y.isLoadingComments){y.isLoadingComments=!0;y.showLoadIndicator();(n<=0||n=="undefined"||n==null)&&(n=0);$.ajax({type:"POST",url:e+"/Services/EventsService.asmx/GetComments",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({chatid:y.commentsId,fromMessageId:n,size:y.commentCount,channel:y.channelName,notificationMessageId:0,isLoadBottom:y.isLoadBottom,isFirstLoad:y.isFirstLoad}),dataType:"json",success:function(n){if(n!=null)if(typeof n.d.Result!="undefined"&&n.d.Result!=null&&typeof n.d.Result.length!="undefined"&&n.d.Result.length!=null&&n.d.Result.length>0)y.PushMessagesToChat(n.d.Result,!0);else y.isTheEnd=!0;else y.isTheEnd=!0;y.isFirstLoad&&(y.TotalCount=n.d.TotalCount,y.changeCount());y.notificationMessageId!=null&&y.notificationMessageId>0&&(y.GetSelectedComment(y.commentsId,y.notificationMessageId),y.notificationMessageId=0);y.isLoadingComments=!1;y.hideLoadIndicator();t!=null&&(t.remove(),y.hideLoadPanel());y.isFirstLoad=!1},error:function(){console.error("GetComments Service not Responding");y.isLoadingComments=!1;y.hideLoadIndicator()}})}};this.GetRepliedMessages=function(n,t,i,r){var f,u;y.showLoadRepliesIndicator(t);f=0;(i==null||i=="undefined")&&(i=0);u=!1;$.ajax({type:"POST",url:e+"/Services/EventsService.asmx/GetRepliedMessages",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({messageId:n,lastRepliesId:i,size:y.repliesCount,channel:y.channelName,notificationMessageId:f}),dataType:"json",success:function(n){n!=null?typeof n.d!="undefined"&&n.d!=null&&typeof n.d.length!="undefined"&&n.d.length!=null&&n.d.length>0?(n.d.length<y.repliesCount&&(u=!0),y.PushRepliesToChat(n.d,t,u,r)):t.find(".js--more-replies").hide():y.hideLoadRepliesIndicator(t);y.hideLoadRepliesIndicator(t)},error:function(){console.error("GetOnlineChatReplies Service not Responding")}})};this.GetSelectedComment=function(n,t){var i=!0;$.ajax({type:"POST",url:e+"/Services/EventsService.asmx/GetSelectedComment",contentType:"application/json; charset=utf-8","async":!0,data:JSON.stringify({id:t,chatId:n,channel:y.channelName}),dataType:"json",success:function(n){if(n!=null){var t=!1;n.d.FK_OnlineChatMessageReplyTo==0?y.PushMessagesToChat(n.d,t,i):y.PushRepliesToChat(n.d,null,!0,t,i)}else y.isTheEnd=!0;y.notificationRepliesId!=null&&y.notificationRepliesId>0&&(y.GetSelectedComment(y.notificationRepliesId),y.notificationRepliesId=0)},error:function(){console.error("GetSelectedComment Service not Responding");y.isLoadingComments=!1;y.hideLoadIndicator()}})};this.PushMessagesToChat=function(n,t,i){var r,u;if(i==null||n.IsDeleted&&y.userId!=y.ownerID||y.addMessageObj(n,t,i),i=!1,n!=null)for(r=0;r<n.length;r++)u=n[r],u!=null&&y.addMessageObj(u,t)};this.PushRepliesToChat=function(n,t,i,r,u){var o,f,e;for(u==null||n.IsDeleted&&n.FK_GlobalAccess!=y.ownerID||(o=y.container.find(".js--selected-comment-container"),t=o.find(".comment").first(),y.addRepliesToChat(n,t,i,r,!0)),f=0;f<n.length;f++)e=n[f],e!=null&&y.addRepliesToChat(e,t,i,r)};this.InitLoadingMessages=function(){y.GetNextMessages(0);t(document).scroll(function(){var e=this,r=$(document).scrollTop(),u=$(document).height(),f=$(n).height(),i,t;if(!y.isTheEnd&&u-r<f*2){let n=y.container.find(".js--comment-container");if(i=n.find(".comment").last(),t=i.attr("id"),t==null){y.isTheEnd;return}y.GetNextMessages(t)}})};let p=new URLSearchParams(n.location.search);p.has("m")&&(w=$(location).attr("href"),y.notificationMessageId=p.get("m").split("/")[0],y.notificationRepliesId=p.get("m").split("/")[1]);this.initCommentField=function(n){var t=y.container.find(".js--comment-base").clone(),i,r;t.find(".js--author > span").text(n.Author);t.find(".js--comment-text > span").html(n.MessageText);t.attr("id",n.ID);try{let u=new Date(Date.parse(n.CreationDateJsFormat)).toUTCString();i=this.getUsersLocalTime(new Date(new Date(u).getTime()-y.clientTZOffset*6e4));r=y.timeSince(n.CreationDateUNIX,n.CurrentServerTime);t.find(".js--send-date").attr("title",i);t.find(".js--send-date > span").text(r)}catch(u){t.find(".js--send-date > span").text(n.CreationDateStr+" (GMT)");t.find(".js--send-date > span").text(n.CreationDateStr+" (GMT)")}return t.removeClass("js--comment-base"),n.FK_GlobalAccess==y.ownerID&&t.find(".js--admin-label").removeClass("hidden"),n.IsModerator&&t.find(".js--moderator-label").removeClass("hidden"),n.IsEdited&&t.find(".js--comment-edit-label").show(),(h==c||l>0&&!n.IsModerator&&n.FK_GlobalAccess!=c)&&n.FK_GlobalAccess!=h&&(n.IsBanned?y.showUnbanBtn(t):y.showBanBtn(t)),(h==c||n.FK_GlobalAccess==h||n.FK_GlobalAccess!=c&&l>0&&!n.IsModerator)&&!n.IsDeleted&&y.showDeleteBtn(t),h!=c||n.FK_GlobalAccess==c||n.IsBanned||(n.IsModerator?y.showDemoteBtn(t):n.IsBanned||y.showPromoteBtn(t)),n.IsDeleted||y.showCopyBtn(t),n.FK_GlobalAccess!=h||n.IsDeleted||y.showEditBtn(t),n.IsDeleted&&(t.find(".js--comment-text > span").addClass("messageFromServer"),t.find(".js--reply-btn").remove()),t};this.timeZoneAbbreviated=function(){let n=(new Date).toString().match(/\((.+)\)/);return n.includes(" ")?n.split(" ").map(([n])=>n).join(""):n};this.getUsersLocalTime=function(n){var i=new Date,t=" "+y.clientTZHour;return t=y.clientTZHour<0?" +"+Math.abs(y.clientTZHour):y.clientTZHour==0?"":" -"+y.clientTZHour,i.getDate()==n.getDate()?this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")":i.getFullYear()==n.getFullYear()?n.getDate()+" "+this.months[n.getMonth()]+" "+this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")":n.getDate()+" "+this.months[n.getMonth()]+" "+n.getFullYear()+", "+this.custTime(n.getHours(),n.getMinutes(),n.getSeconds())+" (GMT"+t+")"};this.custTime=function(n,t,i){return("0"+n).slice(-2)+":"+("0"+t).slice(-2)+":"+("0"+i).slice(-2)};this.toTimestamp=function(n){var t=Date.parse(n);return t/1e3};this.timeSince=function(n,t){var e,r;t=="0"&&(t=Math.floor((new Date).getTime()));var o=[[60,"seconds",1],[120,"1 minute ago","1 minute from now"],[3600,"minutes",60],[7200,"1 hour ago","1 hour from now"],[86400,"hours",3600],[172800,"Yesterday","Tomorrow"],[604800,"days",86400],[1209600,"Last week","Next week"],[2419200,"weeks",604800],[4838400,"Last month","Next month"],[29030400,"months",2419200],[58060800,"Last year","Next year"],[290304e4,"years",29030400],[580608e4,"Last century","Next century"],[580608e5,"centuries",290304e4]],i=(t-n)/1e3,u="ago",f=1;if(i>=0&&i<15)return"Just now";for(i<0&&(i=Math.abs(i),u="from now",f=2),e=0;r=o[e++];)if(i<r[0])return typeof r[2]=="string"?r[f]:Math.floor(i/r[2])+" "+r[1]+" "+u;return n};this.loadReplies=function(n,t,i){let r=n.find(".js--reply-from-server");if(r.css("display")=="none"){if(i){var u=n.find(".js--reply-from-hub");u.find(".comment").remove();y.GetRepliedMessages(t.ID,n,0,!0);i=!1}y.changeViewReplies(!0,n)}else y.changeViewReplies(!1,n);n.find(".js--reply-from-server").toggle("fast")};this.changeViewReplies=function(n,t){n?(t.find(".js-toggle-replies-bottom").html("&#11165 Hide replies &#11165"),t.find(".js-toggle-replies-top").html("&#11165 Hide replies &#11165"),t.find(".js-reply-all").show()):(t.find(".js-toggle-replies-top").html("&#11167 View replies &#11167"),t.find(".js-toggle-replies-bottom").html("&#11167 View replies &#11167"),t.find(".js-reply-all").toggle("fast"))};this.ClearCommentInput=function(){y.container.find(".js--txt-comment-message").val("").text("")};this.ClearReplyInput=function(n){n.find(".js--txt-reply-message").val("").text("")};this.IsValidMessage=function(){var n=y.container.find(".js--txt-comment-message").val();return n&&n!=null&&n.length!=null&&n.length>0&&n.replace(/^\s+|\s+$/g,"").length!=0};this.IsValidReplyMessage=function(n){var t=n.find(".js--txt-reply-message").val();return t&&t!=null&&t.length!=null&&t.length>0&&t.replace(/^\s+|\s+$/g,"").length!=0};this.showLoadIndicator=function(){y.container.find(".js--loading-indicator").show()};this.hideLoadIndicator=function(){y.container.find(".js--loading-indicator").hide()};this.showLoadRepliesIndicator=function(n){n.find(".js--loading-comment-indicator").show()};this.hideLoadRepliesIndicator=function(n){n.find(".js--loading-comment-indicator").hide()};this.showLoadPanel=function(){y.container.find(".js--loading-panel").show()};this.hideLoadPanel=function(){y.container.find(".js--loading-panel").hide()};this.showDeleteBtn=function(n){n.find(".js--delete-btn").first().removeClass("hidden")};this.hideDeleteBtn=function(n){n.find(".js--delete-btn").first().addClass("hidden")};this.showCopyBtn=function(n){n.find(".js--copy-btn").first().removeClass("hidden")};this.hideCopyBtn=function(n){n.find(".js--copy-btn").first().addClass("hidden")};this.showBanBtn=function(n){n.find(".js--ban-btn").first().removeClass("hidden");n.find(".js--unblock-btn").first().addClass("hidden")};this.showUnbanBtn=function(n){n.find(".js--unblock-btn").first().removeClass("hidden");n.find(".js--ban-btn").first().addClass("hidden")};this.showPromoteBtn=function(n){n.find(".js--promote-btn").first().removeClass("hidden");n.find(".js--demote-btn").first().addClass("hidden")};this.showDemoteBtn=function(n){n.find(".js--demote-btn").first().removeClass("hidden");n.find(".js--promote-btn").first().addClass("hidden")};this.hidePromoteBtn=function(n){n.find(".js--promote-btn").first().addClass("hidden")};this.showEditBtn=function(n){n.find(".js--edit-btn").removeClass("hidden")};this.hideEditBtn=function(n){n.find(".js--edit-btn").addClass("hidden")};this.findComment=function(n){return y.container.find(".comment[id="+n+"]")};this.changeCount=function(){y.container.find(".js--total-count > span").text(y.TotalCount);y.container.find(".js--top-row").show()};this.DisabledComments=function(){y.container.find(".js--send-comment").addClass("disabled")};this.EnabledComments=function(){y.container.find(".js--send-comment").rremoveClass("disabled")};this.EnabledCommentsAfterStopStream=function(){try{y.chat.server.enableCommentsSection()}catch(i){var n=t.connection.hub.start({transport:["serverSentEvents","foreverFrame","longPolling"]});n.done(function(){y.chat.server.enableCommentsSection()})}};this.textFielFocus=function(){y.container.find(".js--send-comment-text-field > textarea").focus();y.container.find(".js--comment-reply").hide();y.container.find(".js--reply-btn").show();y.container.find(".js--send-comment-row").show()};this.showPopUpInMessages=function(n,t){var r,i;y.container.find(".js--comments-body-popup").hide();r=y.findComment(n.ID);r.find(".js--comments-body-popup > span").first().text(t);i=r.find(".js--comments-body-popup").first();i.hide();i.toggle("fast");clearTimeout(y.idIntervals);y.idIntervals=setTimeout(y.PopUpInMessagesTimeout,2e3,i)};this.PopUpInMessagesTimeout=function(n){n.css("display")!="none"&&n.toggle("fast")};this.showPopUp=function(n){var t=y.container.find(".js--comments-popup");t.hide();t.toggle("fast");y.container.find(".js--comments-popup > span").text(n);clearTimeout(y.idIntervals);y.idIntervals=setTimeout(y.PopUpTimeout,3e3)};this.PopUpTimeout=function(){var n=y.container.find(".js--comments-popup");n.css("display")!="none"&&n.toggle("fast")};this.ScrollToSelectedComment=function(){var n=$("html,body");let t=y.container.find(".js--send-comment");n.scrollTop(t.offset().top-n.offset().top+n.scrollTop())}}}(window,jQuery,moment);;
