"use strict";(function(){ var m;function p(a){this.id=a;this.version=0}p.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);this.version=Math.max(this.version,b)};function aa(a){this.a=a.desc;this.name=a.name;this.type=a.type;this.usage=a.usage;this.N=a.category}function ba(){this.b={};this.a=[]} ba.prototype.update=function(a,b){this.b=JSON.parse(a.emoji_use);a.highlight_words?this.a=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.a=a.highlights);this.version=Math.max(this.version,b)};function ca(){this.o=null;this.m={};this.a={};this.b=null;this.l={version:0,data:{}};this.i={version:0,data:{}};this.c={};this.w=0}"undefined"!==typeof module&&(module.J.ya=ca,module.J.za=p,module.J.Ba=aa);function t(a){this.id=a;this.D=!1;this.a=this.b=0;this.i={};this.version=0} t.prototype.update=function(a,b,c){void 0!==a.name&&(this.name=a.name);void 0!==a.is_archived&&(this.l=a.is_archived);void 0!==a.is_member&&(this.w=a.is_member);void 0!==a.last_read&&(this.b=Math.max(parseFloat(a.last_read),this.b));void 0!==a.last_msg&&(this.a=parseFloat(a.last_msg));void 0!==a.is_private&&(this.o=a.is_private);a.latest&&(this.a=parseFloat(a.latest.ts));void 0!==a.is_starred&&(this.D=a.is_starred);if(a.members&&(this.i={},a.members))for(var d=0,e=a.members.length;dthis.c;)this.a.shift();return e||0}; function fa(a){for(var b=D.b[G.id],c=0,d=b.a.length;c=b.a[c].s;c++)if(b.a[c].s===a)return b.a[c];return null}function ea(a){a.a.sort(function(a,c){return a.s-c.s})}y.prototype=Object.create(x.prototype);y.prototype.constructor=y;A.prototype=Object.create(x.prototype);A.prototype.constructor=A;"undefined"!==typeof module&&(module.J={Da:x,Ca:y,Ea:A,Ha:C});function ga(a){this.id=a;this.b={small:"",va:""};this.m={};this.l=this.a=null;this.version=0}ga.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);void 0!==a.deleted&&(this.i=a.deleted);void 0!==a.status&&(this.status=a.status);void 0!==a.presence&&(this.c="away"!==a.presence);void 0!==a.isPresent&&(this.c=a.isPresent);a.isBot&&(this.w=a.isBot);a.profile&&(this.b.small=a.profile.icon_small,this.b.va=a.profile.icon_large);this.version=Math.max(this.version,b)}; "undefined"!==typeof module&&(module.J.Aa=ga);var H={},I;function ha(){if(!c){for(var a=0,b=navigator.languages.length;ab.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()? "hier, "+a.toLocaleTimeString():a.toLocaleString()},f:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !"}};H.en={xa:"Unknown member",wa:"Unknown channel",ia:"New message",ha:"Network",O:"(edited)",ka:"(only visible to you)",D:"Starred",m:"Channels",ma:"Direct messages",ok:"Ok",da:"Cancel",V:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(1E3*a);b.setHours(0);b.setMinutes(0);b.setSeconds(0);b.setMilliseconds(0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?"yesterday, "+a.toLocaleTimeString(): a.toLocaleString()},f:{fileUploadCancel:"Cancel",neterror:"Cannot connect to chat !"}};var J=function(){function a(a){this.text="";this.g=a}function b(a,b,c){this.L=b;this.h=null;this.j=[];this.a=c||"";this.$="<"===this.a;this.X="*"===this.a;this.Z="_"===this.a;this.ba="~"===this.a||"-"===this.a;this.aa=">"===this.a;this.i=":"===this.a;this.o="`"===this.a;this.Y="```"===this.a;this.g=a;this.w=null;this.b=!1}function c(a){this.text=a;this.a=null}b.prototype.ea=function(){return this.X&&!!this.b||this.g instanceof b&&this.g.ea()};b.prototype.ja=function(){return this.Z&&!!this.b||this.g instanceof b&&this.g.ja()};b.prototype.na=function(){return this.ba&&!!this.b||this.g instanceof b&&this.g.na()};b.prototype.l=function(){return this.i&&!!this.b||this.g instanceof b&&this.g.l()};b.prototype.fa=function(){return this.o&&!!this.b||this.g instanceof b&&this.g.fa()};b.prototype.ga=function(){return this.Y&&!!this.b||this.g instanceof b&&this.g.ga()};b.prototype.oa=function(){for(var a=0,c=this.j.length;a"===a[b])return!0;if(a.substr(b,this.a.length)===this.a){if(this.h&&this.oa())return this.h.ca();if(this.sa())return!0}return!1};b.prototype.sa=function(){for(var a=this;a;){for(var c=0,f=a.j.length;c=d||"a"<=d&&"z">=d||"0"<=d&&"9">=d||-1!=="\u00e0\u00e8\u00ec\u00f2\u00f9\u00c0\u00c8\u00cc\u00d2\u00d9\u00e1\u00e9\u00ed\u00f3\u00fa\u00fd\u00c1\u00c9\u00cd\u00d3\u00da\u00dd\u00e2\u00ea\u00ee\u00f4\u00fb\u00c2\u00ca\u00ce\u00d4\u00db\u00e3\u00f1\u00f5\u00c3\u00d1\u00d5\u00e4\u00eb\u00ef\u00f6\u00fc\u00ff\u00c4\u00cb\u00cf\u00d6\u00dc\u0178\u00e7\u00c7\u00df\u00d8\u00f8\u00c5\u00e5\u00c6\u00e6\u0153".indexOf(d); if("```"===b.substr(c,3))return"```";if(-1!==["`","\n"].indexOf(b[c])||-1!==["*","~","-","_"].indexOf(b[c])&&(d||-1!=="*`~-_:<".split("").indexOf(b[c+1]))||-1!==[":","<"].indexOf(b[c])&&d)return b[c]}return null};a.prototype.c=function(a,b){this.text+=a[b];return 1};b.prototype.c=function(c,e){var d=this.h&&this.h.pa?this.h.pa(c,e):null;if(d)return c=this.h.a.length,this.h.qa(e),d instanceof b&&(this.h=d,this.j.push(d)),c;if(!this.h||this.h.b||this.h instanceof a||this.h.ta(c,e)){if(d=this.ua(c,e))return this.h= new b(this,e,d),this.j.push(this.h),this.h.a.length;if(!this.h||this.h.b)this.h=new a(this),this.j.push(this.h);return this.h.c(c,e)}d=this.h.L+1;this.ra().U(this.h.L);this.h=new a(this);this.h.c(c,d-1);this.j.pop();this.j.push(this.h);return d-e};b.prototype.qa=function(a){for(var b=this;b;)b.b=a,b=b.w};b.prototype.ra=function(){for(var a=this;a.g&&a.g instanceof b;)a=a.g;return a};b.prototype.U=function(a){this.b&&this.b>=a&&(this.b=!1);this.j.forEach(function(c){c instanceof b&&c.U(a)})};a.prototype.innerHTML= function(){return this.g.l()?":"+this.text+":":this.text};a.prototype.outerHTML=function(){var a="span",b=[];this.g.ga()?b.push("codeblock"):this.g.fa()?b.push("code"):(this.$&&(a="a"),this.g.ea()&&b.push("bold"),this.g.ja()&&b.push("italic"),this.g.na()&&b.push("strike"),this.g.l()&&b.push("emoji"));return"<"+a+(b.length?' class="'+b.join(" ")+'"':"")+">"+this.innerHTML()+""};b.prototype.outerHTML=function(){var a="";this.aa&&(a+='');this.j.forEach(function(b){a+=b.outerHTML()}); this.aa&&(a+="");return a};c.prototype.c=function(a){for(var b=this.text.length;aa.b&&(b.classList.add("unread"),0<=M.indexOf(a)&&b.classList.add("unreadHi"));b&&(a.D?c.push(b):f.push(b))}}else b=document.createElement("li"),g=document.createElement("a"),b.id="room_"+a.id,g.href="#"+a.id,a.o?(b.className="slack-context-room slack-group",b.dataset.count=Object.keys(a.i||{}).length):b.className="slack-context-room slack-channel",G===a&&b.classList.add("selected"),g.textContent=a.name,b.appendChild(za()),b.appendChild(g),a.a>a.b&&(b.classList.add("unread"), 0<=M.indexOf(a)&&b.classList.add("unreadHi")),b&&(a.D?c.push(b):a.o?e.push(b):d.push(b))});c.length&&a.appendChild(Aa(I.D));c.forEach(function(b){a.appendChild(b)});d.length&&a.appendChild(Aa(I.m));d.forEach(function(b){a.appendChild(b)});e.forEach(function(b){a.appendChild(b)});f.length&&a.appendChild(Aa(I.ma));f.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Ba();N();Ca(function(a){document.getElementById("slackCtx").style.backgroundImage= "url("+a+")"})}function Da(){var a=D.a.c,b;for(b in D.a.b.m)if(!D.a.b.m[b].l){var c=document.getElementById("room_"+b);a[b]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing")}for(var d in D.a.a)(b=D.a.a[d].l)&&!b.l&&(c=document.getElementById("room_"+b.id))&&(a[b.id]?c.classList.add("slack-context-typing"):c.classList.remove("slack-context-typing"));Ea()} function Ea(){var a=D.a.c;document.getElementById("whoistyping").textContent="";if(G&&a[G.id]){var b=document.createDocumentFragment(),c=!1,d;for(d in a[G.id])(a=D.a.a[d])?b.appendChild(Fa(a)):c=!0;c&&(D.c=0);document.getElementById("whoistyping").appendChild(b)}}function Ga(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");N()} function Ha(){var a=G.name||(G.c?G.c.name:void 0);if(!a){var b=[];G.i.forEach(function(a){b.push(a.name)});a=b.join(", ")}document.getElementById("currentRoomTitle").textContent=a;Ia();O();document.getElementById("fileUploadContainer").classList.add("hidden");Ja();P&&(P=null,Q());R&&(R=null,Q());Ea()} function Q(){if(P){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){P=null;Q()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(P.H())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()} function S(){if(R){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){R=null;S()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(R.H());document.getElementById("msgInput").value=R.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";O()} window.toggleReaction=function(a,b,c){var d=D.b[a];if(d){a:{for(var e=0,f=d.a.length;ed.b&&a++}a&&(b="("+a+") - ");Ma(0,a)}D.a.o&&(b+=D.a.o.name);document.title=b} function Na(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(xa+3E4Math.abs(d-b.s)&&!(b instanceof y)?e.classList.add("slackmsg-same-ts"):d=b.s:(d=b.s,g=!0);(!c||c.s<=G.b)&&b.s>G.b?k.classList.add("slackmsg-first-unread"):k.classList.remove("slackmsg-first-unread");if(b instanceof y)e=c=null,d=0,a.appendChild(k),f=null;else{if(g||!f){var g=D.a.a[b.C],n=b.username,h=document.createElement("div"), r=document.createElement("div"),q=document.createElement("span");h.M=document.createElement("img");h.M.className="slackmsg-author-img";q.className="slackmsg-author-name";g?(q.textContent=g.name,h.M.src=g.b.small):(q.textContent=n||"?",h.M.src="");r.appendChild(h.M);r.appendChild(q);r.className="slackmsg-author";h.className="slackmsg-authorGroup";h.appendChild(r);h.content=document.createElement("div");h.content.className="slackmsg-author-messages";h.appendChild(h.content);f=h;wa.push(f);a.appendChild(f)}c= b;e=k;f.content.appendChild(k)}}});b=document.getElementById("chatWindow");b.textContent="";b.appendChild(a);b.scrollTop=b.scrollHeight-b.clientHeight;window.hasFocus&&Ja()} function Oa(a){function b(a,b){for(b=b||a.target;b!==a.currentTarget&&b;){if(b.classList.contains("slackmsg-item"))return b.id;b=b.parentElement}}for(var c,d,e=a.target;e!==a.currentTarget&&e&&!e.classList.contains("slackmsg-hover");){if(e.parentElement&&e.classList.contains("slackmsg-attachment-actions-item")){d=b(a,e);var f=e.dataset.attachmentIndex,g=e.dataset.actionIndex;d&&void 0!==f&&void 0!==g&&(d=parseFloat(d.split("_")[1]),(c=fa(d))&&c.u[f]&&c.u[f].actions&&c.u[f].actions[g]&&Pa(c,c.u[f], c.u[f].actions[g]))}else if(e.parentElement&&e.parentElement.classList.contains("slackmsg-hover")){if(d=b(a,e))d=parseFloat(d.split("_")[1]),(c=fa(d))&&e.classList.contains("slackmsg-hover-reply")?(R&&(R=null,S()),P!==c&&(P=c,Q())):c&&e.classList.contains("slackmsg-hover-reaction")?Qa.R(document.body,function(a){a&&Ka(G.id,c.id,a)}):c&&e.classList.contains("slackmsg-hover-edit")?(P&&(P=null,Q()),R!==c&&(R=c,S())):c&&e.classList.contains("slackmsg-hover-remove")&&(P&&(P=null,Q()),R&&(R=null,S()),Ra(c)); break}e=e.parentElement}}function Pa(a,b,c){function d(){var d=JSON.stringify({actions:[c],attachment_id:b.id,callback_id:b.callback_id,channel_id:e,is_ephemeral:a instanceof A,message_ts:a.id}),g=a.C,k=new FormData,l=new XMLHttpRequest;k.append("payload",d);k.append("service_id",g);l.open("POST","api/attachmentAction");l.send(k)}var e=G.id;c.confirm?va(ua(new ia(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).R():d()} function O(){document.getElementById("msgInput").focus()}function Ba(){var a=document.location.hash.substr(1),b=D.a.m[a];b&&b!==G?Sa(b):(a=D.a.a[a])&&a.o&&Sa(a.o)}function Ta(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;wa.forEach(function(b){var c=b.M,d=c.clientHeight;b=b.getBoundingClientRect();c.style.top=Math.max(0,Math.min(a-b.top,b.height-d-d/2))+"px"})} document.addEventListener("DOMContentLoaded",function(){ha();document.getElementById("chatWindow").addEventListener("click",Oa);window.addEventListener("hashchange",function(){document.location.hash&&"#"===document.location.hash[0]&&Ba()});document.getElementById("fileUploadCancel").addEventListener("click",function(a){a.preventDefault();document.getElementById("fileUploadError").classList.add("hidden");document.getElementById("fileUploadContainer").classList.add("hidden");document.getElementById("fileUploadInput").value= "";return!1});document.getElementById("fileUploadForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("fileUploadInput");var b=a.value;b&&(b=b.substr(b.lastIndexOf("\\")+1),Ua(b,a.files[0],function(a){var b=document.getElementById("fileUploadError");a?(b.textContent=a,b.classList.remove("hidden")):(b.classList.add("hidden"),document.getElementById("fileUploadInput").value="",document.getElementById("fileUploadContainer").classList.add("hidden"))}));return!1}); document.getElementById("attachFile").addEventListener("click",function(a){a.preventDefault();G&&document.getElementById("fileUploadContainer").classList.remove("hidden");return!1});document.getElementById("msgForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("msgInput");G&&a.value&&Va(a.value)&&(a.value="",P&&(P=null,Q()),R&&(R=null,Q()),document.getElementById("slashList").textContent="");O();return!1});window.addEventListener("blur",function(){window.hasFocus= !1});window.addEventListener("focus",function(){window.hasFocus=!0;xa=0;G&&Ja();O()});document.getElementById("chatWindow").addEventListener("scroll",Ta);var a=0;document.getElementById("msgInput").addEventListener("input",function(){if(G){var b=Date.now();a+3E3"+c.outerHTML+ "":a.style.backgroundImage='url("smile.svg")';(c=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML=""+c.outerHTML+"":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){Qa.R(document.body,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");O()})})}else a.classList.add("hidden")})();Za()});function za(){var a=document.createElement("span"),b=document.createElement("span"),c=document.createElement("span"),d=document.createElement("span");a.className="typing-container";b.className="typing-dot1";c.className="typing-dot2";d.className="typing-dot3";b.textContent=c.textContent=d.textContent=".";a.appendChild(b);a.appendChild(c);a.appendChild(d);return a}var Aa=function(){var a={};return function(b){var c=a[b];c||(c=a[b]=document.createElement("header"),c.textContent=b);return c}}(); function $a(a){var b=a.b,c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("ul"),f=document.createElement("li");c.u=document.createElement("ul");c.A=document.createElement("ul");c.s=document.createElement("div");c.W=document.createElement("div");c.T=document.createElement("span");c.id=b+"_"+a.id;c.className="slackmsg-item";c.s.className="slackmsg-ts";c.W.className="slackmsg-msg";c.T.className="slackmsg-author-name";e.className="slackmsg-hover";f.className="slackmsg-hover-reply"; e.appendChild(f);if("makeEmoji"in window){var g=document.createElement("li"),k=window.makeEmoji("arrow_heading_down"),l=window.makeEmoji("smile"),n=window.makeEmoji("pencil2"),b=window.makeEmoji("x");g.className="slackmsg-hover-reaction";l?(g.classList.add("emoji-small"),g.appendChild(l)):g.style.backgroundImage='url("smile.svg")';k?(f.classList.add("emoji-small"),f.appendChild(k)):f.style.backgroundImage='url("repl.svg")';e.appendChild(g);a.C===D.a.b.id&&(a=document.createElement("li"),a.className= "slackmsg-hover-edit",n?a.classList.add("emoji-small"):a.style.backgroundImage='url("edit.svg")',a.appendChild(n),e.appendChild(a),a=document.createElement("li"),a.className="slackmsg-hover-remove",b?a.classList.add("emoji-small"):a.style.backgroundImage='url("remove.svg")',a.appendChild(b),e.appendChild(a))}else f.style.backgroundImage='url("repl.svg")',a.C===D.a.b.id&&(a=document.createElement("li"),a.className="slackmsg-hover-edit",a.style.backgroundImage='url("edit.svg")',e.appendChild(a),a=document.createElement("li"), a.className="slackmsg-hover-remove",a.style.backgroundImage='url("remove.svg")',e.appendChild(a));d.appendChild(c.T);d.appendChild(c.W);d.appendChild(c.s);d.appendChild(c.u);b=document.createElement("div");b.innerHTML=I.O;b.className="slackmsg-edited";d.appendChild(b);d.appendChild(c.A);d.className="slackmsg-content";c.u.className="slackmsg-attachments";c.A.className="slackmsg-reactions";c.appendChild(d);c.appendChild(e);return c} function ab(a){var b={good:"#2fa44f",warning:"#de9e31",danger:"#d50200"};if(a){if("#"===a[0])return a;if(b[a])return b[a]}return"#e3e4e6"} function bb(a,b){var c=document.createElement("li"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("a"),g=document.createElement("div"),k=document.createElement("img"),l=document.createElement("a"),n=document.createElement("div"),h=document.createElement("div"),r=document.createElement("div"),q=document.createElement("img"),u=document.createElement("div");c.className="slackmsg-attachment";d.style.borderColor=ab(a.color||"");d.className="slackmsg-attachment-block"; e.className="slackmsg-attachment-pretext";a.pretext?e.innerHTML=J(a.pretext):e.classList.add("hidden");f.target="_blank";a.title?(f.innerHTML=J(a.title),a.title_link&&(f.href=a.title_link),f.className="slackmsg-attachment-title"):f.className="hidden slackmsg-attachment-title";l.target="_blank";g.className="slackmsg-author";a.author_name&&(l.innerHTML=J(a.author_name),l.href=a.author_link||"",l.className="slackmsg-author-name",k.className="slackmsg-author-img",a.author_icon&&(k.src=a.author_icon,g.appendChild(k)), g.appendChild(l));r.className="slackmsg-attachment-thumb";a.thumb_url?(k=document.createElement("img"),k.src=a.thumb_url,r.appendChild(k),d.classList.add("has-thumb"),a.video_html&&(r.dataset.video=a.video_html)):r.classList.add("hidden");n.className="slackmsg-attachment-content";k=J(a.text||"");h.className="slackmsg-attachment-text";k&&""!=k?h.innerHTML=k:h.classList.add("hidden");q.className="slackmsg-attachment-img";a.image_url?q.src=a.image_url:q.classList.add("hidden");u.className="slackmsg-attachment-footer"; a.footer&&(k=document.createElement("span"),k.className="slackmsg-attachment-footer-text",k.innerHTML=J(a.footer),a.footer_icon&&(l=document.createElement("img"),l.src=a.footer_icon,l.className="slackmsg-attachment-footer-icon",u.appendChild(l)),u.appendChild(k));a.ts&&(k=document.createElement("span"),k.className="slackmsg-ts",k.innerHTML=I.V(a.ts),u.appendChild(k));n.appendChild(r);n.appendChild(h);d.appendChild(f);d.appendChild(g);d.appendChild(n);d.appendChild(q);if(a.fields&&a.fields.length){var v= document.createElement("ul");d.appendChild(v);v.className="slackmsg-attachment-fields";a.fields.forEach(function(a){var b=a.title||"",c=a.value||"";a=!!a["short"];var d=document.createElement("li"),e=document.createElement("div"),f=document.createElement("div");d.className="field";a||d.classList.add("field-long");e.className="field-title";e.textContent=b;f.className="field-text";f.innerHTML=J(c);d.appendChild(e);d.appendChild(f);d&&v.appendChild(d)})}if(a.actions&&a.actions.length)for(f=document.createElement("ul"), f.className="slackmsg-attachment-actions "+qa,d.appendChild(f),g=0,n=a.actions.length;gc.bottom||a.screenXc.right)&&b()});n.className="emojibar-overlay";l.className="emojibar";h.className="emojibar-emojis";F.className="emojibar-detail";L.className="emojibar-detail-img";V.className="emojibar-detail-name";r.className=q.className="emojibar-list";u.className="emojibar-search";F.appendChild(L);F.appendChild(V); h.appendChild(g(window.emojiProviderHeader));h.appendChild(r);h.appendChild(g("emojicustom.png"));h.appendChild(q);l.appendChild(h);l.appendChild(F);l.appendChild(u);u.addEventListener("keyup",function(){d()});l.addEventListener("mousemove",function(b){a(b,function(a){var b=a?v[a]||B[a]:null;b?(L.innerHTML=b.f.outerHTML,V.textContent=":"+a+":"):(L.textContent="",V.textContent="")})});l.addEventListener("click",function(b){a(b,function(a){a&&c()&&E&&E(a)})});return{isSupported:k,R:function(a,b){return k()? (E=b,a.appendChild(n),a.appendChild(l),u.value="",d(),u.focus(),!0):!1},search:d,close:b}}();var D,M=[];function db(){this.c=0;this.a=new ca;this.b={}} db.prototype.update=function(a){var b=Date.now();a.v&&(this.c=a.v);if(a["static"]){var c=this.a,d=a["static"],e=Date.now();if(d.users)for(var f=0,g=d.users.length;fa.b){var c=new XMLHttpRequest;c.open("POST","api/markread?room="+a.id+"&ts="+a.a,!0);c.send(null);a.b=a.a}0<=b&&(M.splice(b,1),N());a=document.getElementById("room_"+a.id);a.classList.remove("unread");a.classList.remove("unreadHi")}D=new db;var Ca=function(){function a(a,b){b.sort(function(){return Math.random()-.5});for(var c=0,d=20;dd/(c.height*c.width))for(e=0;e",author_icon:e.b.small,text:c.text,footer:f,ts:c.s}]))}d.open("POST",a,!0);d.send(null);return!0}function Ra(a){var b=new XMLHttpRequest;b.open("DELETE","api/msg?room="+G.id+"&ts="+a.id,!0);b.send(null)} function Ka(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)};function U(a,b,c,d){C.call(this,a,b,c,d)}U.prototype=Object.create(C.prototype);U.prototype.constructor=U;U.prototype.b=function(a,b){return!0===a.isMeMessage?new W(this.id,a,b):!0===a.isNotice?new X(this.id,a,b):new Y(this.id,a,b)}; var Z={B:function(a){a.F=!0;return a},K:function(a){a.f&&a.f.parentElement&&(a.f.remove(),delete a.f);return a},I:function(a){a.f?a.F&&(a.F=!1,a.G()):a.S().G();return a.f},G:function(a){var b=D.a.a[a.C];a.f.s.innerHTML=I.V(a.s);a.f.W.innerHTML=J(a.text);a.f.T.textContent=b?b.name:a.username||"?";for(var b=document.createDocumentFragment(),c=0,d=a.u.length;c