Ver Fonte

[add][Refs #34] list pinned messages in roominfo panel

isundil há 8 anos atrás
pai
commit
f1e9abe8ae
9 ficheiros alterados com 205 adições e 125 exclusões
  1. 18 0
      cli/data.js
  2. 6 0
      cli/lang/en.js
  3. 6 0
      cli/lang/fr.js
  4. 3 0
      cli/resources.js
  5. 33 4
      cli/roomInfo.js
  6. 6 2
      cli/ui.js
  7. 115 113
      srv/public/mimouchat.min.js
  8. 6 4
      srv/public/style.css
  9. 12 2
      srv/src/room.js

+ 18 - 0
cli/data.js

@@ -72,7 +72,25 @@ SlackWrapper.prototype.update = function(data) {
                 ctx = new SimpleChatSystem();
                 this.context.push(ctx);
             }
+            var pins = {};
+            if (data["static"][i]["channels"])
+                data["static"][i]["channels"].forEach(function(chanInfo) {
+                    if (chanInfo["pins"]) {
+                        pins[chanInfo["id"]] = chanInfo["pins"];
+                        chanInfo["pins"] = undefined;
+                    }
+                });
             ctx.getChatContext().updateStatic(data["static"][i], now);
+            for (var chanId in pins) {
+                var msgs = [],
+                    histo = this.history[chanId];
+                if (!histo)
+                    histo = this.history[chanId] = new UiRoomHistory(chanId, 250, null, now);
+                pins[chanId].forEach(function(msg) {
+                    msgs.push(histo.messageFactory(msg, now));
+                });
+                ctx.getChatContext().channels[chanId].pins = msgs;
+            }
         }
     }
     this.context.foreachChannels(function(chan) {

+ 6 - 0
cli/lang/en.js

@@ -63,6 +63,12 @@ lang["en"] = {
     }
 };
 
+lang["en"].pinCount = function(count) {
+    if (count === 0)
+        return "No pinned messages";
+    return count + (count === 1 ? " pinned message" : " pinned messages");
+};
+
 lang["en"].edited = function(ts) {
     return "(edited " +lang["en"].formatDate(ts) +")";
 };

+ 6 - 0
cli/lang/fr.js

@@ -63,6 +63,12 @@ lang["fr"] = {
     }
 };
 
+lang["fr"].pinCount = function(count) {
+    if (count === 0)
+        return "Pas de message épinglé";
+    return count + (count === 1 ? " message épinglé" : " messages épinglés");
+};
+
 lang["fr"].edited = function(ts) {
     return "(edité " +lang["fr"].formatDate(ts) +")";
 };

+ 3 - 0
cli/resources.js

@@ -107,6 +107,9 @@ var R = {
                 purposeCreator: "roominfo-purpose-creator",
                 userCount: "roominfo-usercount",
                 userList: "roominfo-userlist",
+                pinCount: "roominfo-pincount",
+                pinList: "roominfo-pinlist",
+                pinItem: "roominfo-pinlist-item",
                 author: "roominfo-author",
                 phone: "roominfo-phone",
                 type: {

+ 33 - 4
cli/roomInfo.js

@@ -23,6 +23,10 @@ var roomInfo = (function() {
         /** @const @type {Element} */
         purposeDetails = document.createElement("span"),
         /** @const @type {Element} */
+        pinCount = document.createElement("div"),
+        /** @const @type {Element} */
+        pinList = document.createElement("ul"),
+        /** @const @type {Element} */
         userCount = document.createElement("div"),
         /** @const @type {Element} */
         userList = document.createElement("ul"),
@@ -36,6 +40,8 @@ var roomInfo = (function() {
     topicDom.className = R.klass.chatList.roomInfo.topic;
     purposeDom.className = R.klass.chatList.roomInfo.purpose;
     phone.className = R.klass.chatList.roomInfo.phone;
+    pinCount.className = R.klass.chatList.roomInfo.pinCount;
+    pinList.className = R.klass.chatList.roomInfo.pinList;
     userCount.className = R.klass.chatList.roomInfo.userCount;
     userList.className = R.klass.chatList.roomInfo.userList;
     purposeDetails.className = topicDetails.className = R.klass.chatList.roomInfo.author;
@@ -50,11 +56,30 @@ var roomInfo = (function() {
     section.appendChild(topicDom);
     section.appendChild(phone);
     section.appendChild(purposeDom);
+    section.appendChild(pinCount);
+    section.appendChild(pinList);
     section.appendChild(userCount);
     section.appendChild(userList);
 
     var updateCommon = function() {
         headerContent.textContent = currentChan.name;
+        if (currentChan.pins) {
+            pinCount.textContent = locale.pinCount(currentChan.pins.length);
+            pinCount.classList.remove(R.klass.hidden);
+            pinList.classList.remove(R.klass.hidden);
+            var pinFrag = document.createDocumentFragment();
+            currentChan.pins.forEach(function(uiMsg) {
+                var li = document.createElement("li");
+                li.className = R.klass.chatList.roomInfo.pinItem;
+                li.appendChild(uiMsg.getDom());
+                pinFrag.appendChild(li);
+            });
+            pinList.textContent = '';
+            pinList.appendChild(pinFrag);
+        } else {
+            pinCount.classList.add(R.klass.hidden);
+            pinList.classList.add(R.klass.hidden);
+        }
 
     }, updateForChannel = function() {
         var ctx = currentChatCtx.getChatContext();
@@ -75,8 +100,6 @@ var roomInfo = (function() {
         }
         domHeader.style.backgroundImage = "";
         headerContent.classList.remove(R.klass.presenceIndicator);
-        userCount.classList.remove(R.klass.hidden);
-        userList.classList.remove(R.klass.hidden);
 
         dom.classList.add(R.klass.chatList.roomInfo.type.channel);
         dom.classList.remove(R.klass.chatList.roomInfo.type.user);
@@ -94,8 +117,6 @@ var roomInfo = (function() {
         phone.textContent = currentChan.user.phone || "";
         purposeContent.textContent = currentChan.user.goal || "";
         purposeDom.classList.remove(R.klass.hidden);
-        userCount.classList.add(R.klass.hidden);
-        userList.classList.add(R.klass.hidden);
 
         dom.classList.remove(R.klass.chatList.roomInfo.type.channel);
         dom.classList.add(R.klass.chatList.roomInfo.type.user);
@@ -129,6 +150,14 @@ var roomInfo = (function() {
         hide: function() {
             dom.classList.add(R.klass.hidden);
             return this;
+        },
+        isParentOf: function(_dom) {
+            while (_dom) {
+                if (_dom === dom)
+                    return true;
+                _dom = _dom.parentNode;
+            }
+            return false;
         }
     }
 })();

+ 6 - 2
cli/ui.js

@@ -563,14 +563,18 @@ document.addEventListener('DOMContentLoaded', function() {
                     href = href.substr(sepPosition +1);
                     var channelCtx = DATA.context.getChannelContext(href);
                     if (channelCtx) {
-                        roomInfo.populate(channelCtx, channelCtx.getChatContext().channels[href]).show(t);
+                        if (!roomInfo.isParentOf(t))
+                            roomInfo.populate(channelCtx, channelCtx.getChatContext().channels[href]).show(t);
+                        console.log("out");
                         return;
                     }
                     channelCtx = DATA.context.getUserContext(href);
                     if (channelCtx) {
                         var room = channelCtx.getChatContext().users[href].privateRoom;
                         if (room) {
-                            roomInfo.populate(channelCtx, room).show(t);
+                            if (!roomInfo.isParentOf(t))
+                                roomInfo.populate(channelCtx, room).show(t);
+                            console.log("out");
                             return;
                         }
                     }

+ 115 - 113
srv/public/mimouchat.min.js

@@ -1,124 +1,126 @@
 "use strict";(function(){
 var p;function aa(a){this.id=a;this.version=0}aa.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);this.version=Math.max(this.version,b)};function ba(a){this.a=a.desc;this.name=a.name;this.type=a.type;this.usage=a.usage;this.U=a.category}function ca(){this.a={};this.B=[];this.version=0}
-ca.prototype.update=function(a,b){a.emoji_use&&(this.a=JSON.parse(a.emoji_use));a.highlight_words?this.B=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.B=a.highlights);this.version=Math.max(this.version,b)};function da(){this.a=null;this.l={};this.j={};this.self=null;this.b={version:0,data:{}};this.i={version:0,data:{}};this.u={};this.Y={};this.o=0}function fa(a,b){return b.pv?new t(b.id,a.j[b.user]):new v(b.id)}
-function ga(a,b,c){var d=d||"";b.team&&(a.a||(a.a=new aa(b.team.id)),a.a.update(b.team,c));if(b.users)for(var e=0,f=b.users.length;e<f;e++){var g=a.j[d+b.users[e].id];g||(g=a.j[d+b.users[e].id]=new ha(b.users[e].id));g.update(b.users[e],c)}if(b.channels)for(e=0,f=b.channels.length;e<f;e++)(g=a.l[d+b.channels[e].id])||(g=a.l[d+b.channels[e].id]=fa(a,b.channels[e])),g.update(b.channels[e],a,c,d);b.emojis&&(a.b.data=b.emojis,a.b.version=c);if(void 0!==b.commands){a.i.data={};for(e in b.commands)a.i.data[e]=
-new ba(b.commands[e]);a.i.version=c}b.self&&(a.self=a.j[d+b.self.id]||null,a.self.R||(a.self.R=new ca),b.self.prefs&&a.self.R.update(b.self.prefs,c));b.capacities&&(a.Y={},b.capacities.forEach(function(a){this.Y[a]=!0},a));a.o=Math.max(a.o,c)}"undefined"!==typeof module&&(module.H.tb=da,module.H.ub=aa,module.H.wb=ba);function v(a){this.id=a;this.A=!1;this.C=0;this.j={};this.version=0}
-v.prototype.update=function(a,b,c,d){d=d||"";void 0!==a.name&&(this.name=a.name);void 0!==a.is_archived&&(this.ca=a.is_archived);void 0!==a.is_member&&(this.M=a.is_member);void 0!==a.last_read&&(this.C=Math.max(parseFloat(a.last_read),this.C));void 0!==a.last_msg&&(this.P=parseFloat(a.last_msg));void 0!==a.is_private&&(this.b=a.is_private);this.A=!!a.is_starred;if(a.members&&(this.j={},a.members))for(var e=0,f=a.members.length;e<f;e++){var g=b.j[d+a.members[e]];this.j[g.id]=g;g.l[this.id]=this}a.topic&&
-(this.ka=a.topic.value,this.o=b.j[d+a.topic.creator],this.ba=a.topic.last_set);a.purpose&&(this.ha=a.purpose.value,this.i=b.j[d+a.purpose.creator],this.$=a.purpose.last_set);this.version=Math.max(this.version,c)};function ia(a,b){var c=ja;return{name:c.ea(b,a.name),mb:c.ea(b,Object.values(a.j),function(a){return a?a.getName():null}),ka:c.ea(b,a.ka),ha:c.ea(b,a.ha)}}function t(a,b){v.call(this,a);this.a=b;this.name=b.getName();this.b=!0;b.V=this}t.prototype=Object.create(v.prototype);
-t.prototype.constructor=t;"undefined"!==typeof module&&(module.H.Cb=v,module.H.Bb=t);function x(a,b){this.J=a.user;this.username=a.username;this.id=a.id||a.ts;this.m=parseFloat(a.ts);this.text="";this.s=[];this.A=a.is_starred||!1;this.i=this.F=!1;this.D={};this.version=b;this.update(a,b)}function y(a,b){x.call(this,a,b)}function z(a,b){x.call(this,a,b)}
-x.prototype.update=function(a,b){if(a){if(this.text=a.text||"",a.attachments&&(this.s=a.attachments),this.A=!!a.is_starred,this.F=void 0===a.edited?!1:a.edited,this.i=!!a.removed,a.reactions){var c={};a.reactions.forEach(function(a){c[a.name]=[];a.users.forEach(function(b){c[a.name].push(b)})});this.D=c}}else this.i=!0;this.version=b};function B(a,b,c,d,e){this.id="string"===typeof a?a:a.id;this.a=[];this.b=c;this.cb=0;this.o=b;d&&ka(this,d,e)}
-function ka(a,b,c){var d=0;b.forEach(function(a){d=Math.max(this.push(a,c),d)}.bind(a));la(a);return d}B.prototype.i=function(a,b){return!0===a.isMeMessage?new y(a,b):!0===a.isNotice?new z(a,b):new x(a,b)};
-B.prototype.push=function(a,b){for(var c,d=!1,e,f=0,g=this.a.length;f<g;f++)if(c=this.a[f],c.id===a.id){e=c.update(a,b);d=!0;break}d||(c=this.i(a,b),this.a.push(c),e=c.m);for(;this.a.length>this.o;)this.a.shift();if(this.b)for(a=0;a<this.a.length;a++)this.a[a].version<b-this.b&&this.a.splice(a--,1);return e||0};function ma(a){return a.a[a.a.length-1]}function na(a,b){for(var c=0,d=a.a.length;c<d;c++)if(a.a[c].id==b)return a.a[c];return null}function la(a){a.a.sort(function(a,c){return a.m-c.m})}
-y.prototype=Object.create(x.prototype);y.prototype.constructor=y;z.prototype=Object.create(x.prototype);z.prototype.constructor=z;"undefined"!==typeof module&&(module.H={yb:x,xb:y,Ab:z,Db:B});function ha(a){this.id=a;this.l={};this.V=this.R=null;this.version=0}
-ha.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);void 0!==a.deleted&&(this.Oa=a.deleted);void 0!==a.status&&(this.status=a.status);void 0!==a.goal&&(this.ib=a.goal);void 0!==a.phone&&(this.ob=a.phone);void 0!==a.first_name&&(this.Qa=a.first_name);void 0!==a.last_name&&(this.Ua=a.last_name);void 0!==a.real_name&&(this.ab=a.real_name);void 0!==a.isPresent&&(this.wa=a.isPresent);a.isBot&&(this.kb=a.isBot);this.version=Math.max(this.version,b)};
-ha.prototype.getName=function(){return this.name||this.ab||this.Qa||this.Ua};"undefined"!==typeof module&&(module.H.vb=ha);function oa(){this.a=[]}oa.prototype.push=function(a){this.a.push(a)};function pa(a,b){for(var c=0,d=a.a.length;c<d;c++)if(b===qa(a.a[c]))return a.a[c];return null}function ra(a,b){for(var c=0,d=a.a.length;c<d;c++){var e=a.a[c],f;for(f in e.l)if(!0===b(e.l[f],f))return}}function sa(a){for(var b=E.context,c=0,d=b.a.length;c<d&&!0!==a(b.a[c]);c++);}function G(a,b){for(var c=0,d=a.a.length;c<d;c++)if(a.a[c].l[b])return a.a[c];return null}
-function ta(a){for(var b=E.context,c=0,d=b.a.length;c<d;c++){var e=b.a[c].l[a];if(e)return e}return null}function ua(a){for(var b=E.context,c=[],d=0,e=b.a.length;d<e;d++){var f=b.a[d].l,g;for(g in f)a&&!a(f[g],b.a[d],g)||c.push(g)}return c}function H(a){for(var b=E.context,c=0,d=b.a.length;c<d;c++){var e=b.a[c].j[a];if(e)return e}return null}"undefined"!==typeof module&&(module.H.zb=oa);var ja=function(){function a(b,c,d){if(Array.isArray(c)){for(var e=0,f=0,g=c.length;f<g;f++){var h=a(b,c[f],d);if(1===h)return 1;e=Math.max(h,e)}return e}return(c=d?d(c):c)&&void 0!==b&&null!==b?b.length?-1===c.indexOf(b)?0:b.length/c.length:1:0}return{ea:a}}();"undefined"!==typeof module&&(module.H.Eb=ja);var I={},J,va=[];function wa(){if(!c){for(var a=0,b=navigator.languages.length;a<b;a++)if(I.hasOwnProperty(navigator.languages[a])){var c=navigator.languages[a];break}c||(c="en")}J=I[c];console.log("Loading language pack: "+c);if(J.c)for(var d in J.c)if(c=document.getElementById(d))c.textContent=J.c[d];va.forEach(function(a){a()})};I.fr={sb:"Utilisateur inconnu",rb:"Channel inconnu",Wa:"Nouveau message",message:"Message",Va:"Reseau",Xa:"(visible seulement par vous)",A:"Favoris",l:"Discutions",$a:"Discutions priv\u00e9es",bb:"Partage sa position GPS",ok:"Ok",Pa:"Annuler",L:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(a);b.setHours(0,0,0,0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?"hier, "+a.toLocaleTimeString():
-a.toLocaleString()},sa:function(a,b){return a+"/"+b},c:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !",ctxMenuSettings:"Configuration",settingTitle:"Configuration","setting-menu-services":"Services","settings-services-title":"Services","setting-menu-display":"Affichage","settings-display-title":"Affichage","setting-menu-privacy":"Vie priv\u00e9e","settings-privacy-title":"Vie priv\u00e9e",settingCommit:"Appliquer","settings-serviceAddButton":"Ajouter un service","settings-serviceListEmpty":"Vous n'avez pas encore ajout\u00e9 de service. Ajouter un service pour continuer.",
-"settings-serviceAddConfirm":"Suivant"}};I.fr.F=function(a){return"(edit&eacute; "+I.fr.L(a)+")"};I.fr.za=function(a,b){return"par "+a.getName()+" le "+I.fr.L(b)};I.en={sb:"Unknown member",rb:"Unknown channel",Wa:"New message",message:"Message",Va:"Network",Xa:"(only visible to you)",A:"Starred",l:"Channels",$a:"Direct messages",bb:"Share your GPS location",ok:"Ok",Pa:"Cancel",L:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(a);b.setHours(0,0,0,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()},
-sa:function(a,b){return a+"/"+b},c:{fileUploadCancel:"Cancel",neterror:"Cannot connect to chat !",ctxMenuSettings:"Settings",settingTitle:"Settings","setting-menu-services":"Services","settings-services-title":"Services","setting-menu-display":"Display","settings-display-title":"Display","setting-menu-privacy":"Privacy","settings-privacy-title":"Privacy",settingCommit:"Apply","settings-serviceAddButton":"Add a service","settings-serviceListEmpty":"You don't have any service yet. Please add a service to continue.",
-"settings-serviceAddConfirm":"Next"}};I.en.F=function(a){return"(edited "+I.en.L(a)+")"};I.en.za=function(a,b){return"by "+a.getName()+" on "+I.en.L(b)};var xa=function(){function a(a){this.text="";this.g=a}function b(b,c,d){this.X=c;this.f=null;this.h=[];this.a=d||"";this.na="<"===this.a;this.xa="*"===this.a;this.ma="_"===this.a;this.oa="~"===this.a||"-"===this.a;this.i=">"===this.a||"&gt;"===this.a;this.M=":"===this.a;this.Aa="`"===this.a;this.La="```"===this.a;this.Ba="\n"===this.a;this.la=void 0!==d&&-1!==m.B.indexOf(d);this.g=b;this.pa=null;this.b=this.Ba||this.la?c+d.length-1:!1;this.la&&(this.f=new a(this),this.h.push(this.f),this.f.text=d)}
-function c(a){return"A"<=a&&"Z">=a||"a"<=a&&"z">=a||"0"<=a&&"9">=a||-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(a)}function d(a){a=a||n;for(var c=0,e=a.h.length;c<e;c++){var l=
-a.h[c];if(l instanceof b)if(l.b){if(l=d(l))return l}else return l}return null}function e(a,c){a.g instanceof b&&(a.g.h.splice(a.g.h.indexOf(a)+(c?1:0)),a.g.f=a.g.h[a.g.h.length-1],e(a.g,!0))}function f(a){return a}function g(a){return{link:a,text:a,Sa:!1}}var h,n,m={B:[],Z:f,ja:f,ga:g};b.prototype.Da=function(){return this.xa&&!!this.b||this.g instanceof b&&this.g.Da()};b.prototype.Ga=function(){return this.ma&&!!this.b||this.g instanceof b&&this.g.Ga()};b.prototype.Ha=function(){return this.oa&&
-!!this.b||this.g instanceof b&&this.g.Ha()};b.prototype.ua=function(){return this.M&&!!this.b||this.g instanceof b&&this.g.ua()};b.prototype.Fa=function(){return this.la&&!!this.b||this.g instanceof b&&this.g.Fa()};b.prototype.Ea=function(){return this.Aa&&!!this.b||this.g instanceof b&&this.g.Ea()};b.prototype.ba=function(){return this.La&&!!this.b||this.g instanceof b&&this.g.ba()};b.prototype.Ia=function(){for(var a=0,c=this.h.length;a<c;a++)if(this.h[a]instanceof b&&(!this.h[a].b||this.h[a].Ia()))return!0;
-return!1};b.prototype.Ja=function(a){if("<"===this.a&&">"===h[a])return!0;var b=c(h[a-1]);if(!this.i&&h.substr(a,this.a.length)===this.a){if(!b&&(this.xa||this.ma||this.oa))return!1;if(this.f&&this.Ia())return this.f.Ma();if(this.eb())return!0}return"\n"===h[a]&&this.i?!0:!1};b.prototype.eb=function(){for(var a=this;a;){for(var c=0,d=a.h.length;c<d;c++)if(a.h[c]instanceof b||a.h[c].text.length)return!0;a=a.pa}return!1};b.prototype.Ma=function(){var a=new b(this.g,this.X,this.a);a.pa=this;this.f&&
-this.f instanceof b&&(a.f=this.f.Ma(),a.h=[a.f]);return a};b.prototype.fb=function(a){return this.M&&(" "===h[a]||"\t"===h[a])||(this.M||this.na||this.xa||this.ma||this.oa||this.Aa)&&"\n"===h[a]?!1:!0};b.prototype.gb=function(b){if(this.Aa||this.M||this.La||this.na)return null;if(!this.f||this.f.b||this.f instanceof a){var d=c(h[b-1]),e=c(h[b+1]);if("```"===h.substr(b,3))return"```";var f=n.va();if(void 0===f||f){if("&gt;"===h.substr(b,4))return"&gt;";if(">"===h[b])return h[b]}if("`"===h[b]&&!d||
-"\n"===h[b]||!(-1===["*","~","-","_"].indexOf(h[b])||!e&&void 0!==h[b+1]&&-1==="*~-_<&".split("").indexOf(h[b+1])||d&&void 0!==h[b-1]&&-1==="*~-_<&".split("").indexOf(h[b-1]))||-1!==[":"].indexOf(h[b])&&e||-1!==["<"].indexOf(h[b]))return h[b];d=0;for(e=m.B.length;d<e;d++)if(f=m.B[d],h.substr(b,f.length)===f)return f}return null};a.prototype.va=function(){if(""!==this.text.trim())return!1};b.prototype.va=function(){for(var a=this.h.length-1;0<=a;a--){var b=this.h[a].va();if(void 0!==b)return b}if(this.Ba||
-this.i)return!0};a.prototype.o=function(a){this.text+=h[a];return 1};b.prototype.o=function(c){var d=this.f&&!this.f.b&&this.f.Ja?this.f.Ja(c):null;if(d){var e=this.f.a.length;this.f.Ca(c);d instanceof b&&(this.f=d,this.h.push(d));return e}if(!this.f||this.f.b||this.f instanceof a||this.f.fb(c)){if(d=this.gb(c))return this.f=new b(this,c,d),this.h.push(this.f),this.f.a.length;if(!this.f||this.f.b)this.f=new a(this),this.h.push(this.f);return this.f.o(c)}d=this.f.X+1;n.$(this.f.X);this.f=new a(this);
-this.f.o(d-1);this.h.pop();this.h.push(this.f);return d-c};b.prototype.Ca=function(a){for(var b=this;b;)b.b=a,b=b.pa};b.prototype.$=function(a){this.b&&this.b>=a&&(this.b=!1);this.h.forEach(function(c){c instanceof b&&c.$(a)})};a.prototype.innerHTML=function(){if(this.g.ua()){for(var a=this.g;a&&!a.M;)a=a.g;if(a){var a=a.a+this.text+a.a,b=m.Z(a);return b?b:a}return(a=m.Z(this.text))?a:this.text}if(this.g.ba()){if("undefined"!==typeof hljs)try{return a=this.text.match(/^\w+/),hljs.configure({useBR:!0,
-tabReplace:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"}),a&&hljs.getLanguage(a[0])?hljs.fixMarkup(hljs.highlight(a[0],this.text.substr(a[0].length)).value):hljs.fixMarkup(hljs.highlightAuto(this.text).value)}catch(q){console.error(q)}return this.text.replace(/\n/g,"<br/>")}return m.ja(this.text)};a.prototype.outerHTML=function(){var a="span",b=[],c="";if(this.g.ba()){a="pre";b.push("codeblock");var d=this.innerHTML()}else this.g.Ea()?(b.push("code"),d=this.innerHTML()):(this.g.na&&(d=m.ga(this.text))?
-(a="a",c=' href="'+d.link+'"',d.Sa||(c+=' target="_blank"'),d=m.ja(d.text)):d=this.innerHTML(),this.g.Da()&&b.push("bold"),this.g.Ga()&&b.push("italic"),this.g.Ha()&&b.push("strike"),this.g.ua()&&b.push("emoji"),this.g.Fa()&&b.push("highlight"));return"<"+a+c+(b.length?' class="'+b.join(" ")+'"':"")+">"+d+"</"+a+">"};b.prototype.outerHTML=function(){var a="";this.i&&(a+='<span class="quote">');this.Ba&&(a+="<br/>");this.h.forEach(function(b){a+=b.outerHTML()});this.i&&(a+="</span>");return a};b.prototype.Ka=
-function(a){this.i&&!this.b&&this.Ca(a);this.h.forEach(function(c){c instanceof b&&c.Ka(a)})};return function(c,k){k||(k={});m.B=k.B||[];m.Z=k.Z||f;m.ja=k.ja||f;m.ga=k.ga||g;h=c;n=new b(this,0);k=0;c=h.length;do{for(;k<c;)k+=n.o(k);n.Ka(h.length);if(k=d()){e(k,!1);n.$(k.X);var l=new a(k.g);l.o(k.X);k.g.h.push(l);k.g.f=l;k=k.X+1}else k=void 0}while(void 0!==k);return n.outerHTML()}}();"undefined"!==typeof module&&(module.H.w=xa);function ya(a,b){this.i=a;this.content=b;this.c=za(this);this.b=Aa(this);this.a=[];this.o=[]}
-function za(a){var b=document.createElement("div"),c=document.createElement("header"),d=document.createElement("span"),e=document.createElement("span"),f=document.createElement("div"),g=document.createElement("footer");b.a=document.createElement("span");b.b=document.createElement("span");d.textContent=a.i;"string"==typeof a.content?f.innerHTML=a.content:f.appendChild(a.content);c.className=Ba;d.className=Ca;e.className=Da;e.textContent="x";c.appendChild(d);c.appendChild(e);b.appendChild(c);f.className=
-Ea;b.appendChild(f);b.b.className=Fa;b.b.textContent=J.Pa;b.b.addEventListener("click",function(){Ga(a,!1)});e.addEventListener("click",function(){Ga(a,!1)});b.a.addEventListener("click",function(){Ga(a,!0)});g.appendChild(b.b);b.a.className=Fa;b.a.textContent=J.ok;g.appendChild(b.a);g.className=Ha+" "+Ia;b.appendChild(g);b.className=Ja;return b}function Ga(a,b){(b?a.a:a.o).forEach(function(a){a()});a.close()}
-function Aa(a){var b=document.createElement("div");b.className=Ka;b.addEventListener("click",function(){Ga(this,!1)}.bind(a));return b}function La(a,b,c){a.c.a.textContent=b;a.c.b.textContent=c;return a}ya.prototype.ia=function(a){a=a||document.body;a.appendChild(this.b);a.appendChild(this.c);return this};ya.prototype.close=function(){this.c.remove();this.b.remove();return this};function Ma(a,b){a.a.push(b);return a};var Fa="button",Ha="button-container",Ja="dialog",Ka="dialog-overlay",Ba="dialog-title",Ca="dialog-title-label",Da="dialog-title-close",Ea="dialog-body",Ia="dialog-footer";var Na=[],Oa=0;
-function Pa(){var a=document.createDocumentFragment(),b=ua(function(a){return!a.ca&&!1!==a.M}),c=[],d=[],e=[],f=[],g={};b.sort(function(a,b){if(a[0]!==b[0])return a[0]-b[0];var c=G(E.context,a),d=G(E.context,b);a=c.l[a];b=d.l[b];return a.name===b.name?(g[a.id]=J.sa(c.a.name,a.name),g[b.id]=J.sa(d.a.name,b.name),c.a.name.localeCompare(d.a.name)):a.name.localeCompare(b.name)});b.forEach(function(a){a=ta(a);if(a instanceof t){var b;if(b=!a.a.Oa){var h=g[a.id];b=document.createElement("li");var l=document.createElement("a");
-b.id="room_"+a.id;l.href="#"+a.id;b.className="chat-context-room chat-ims presence-indicator";l.textContent=h||a.a.getName();b.appendChild(Qa());b.appendChild(l);a.a.wa||b.classList.add("presence-away");K===a&&b.classList.add("selected");a.P>a.C&&(b.classList.add("unread"),b.classList.add("unreadHi"));b=h=b}b&&(a.A?c.push(h):f.push(h))}else if(h=g[a.id],b=document.createElement("li"),l=document.createElement("a"),b.id="room_"+a.id,l.href="#"+a.id,a.b?(b.className="chat-context-room chat-group",b.dataset.count=
-Object.keys(a.j||{}).length):b.className="chat-context-room chat-channel",K===a&&b.classList.add("selected"),l.textContent=h||a.name,b.appendChild(Qa()),b.appendChild(l),a.P>a.C&&(b.classList.add("unread"),0<=L.indexOf(a)&&b.classList.add("unreadHi")),h=b)a.A?c.push(h):a.b?e.push(h):d.push(h)});c.length&&a.appendChild(Ra(J.A));c.forEach(function(b){a.appendChild(b)});d.length&&a.appendChild(Ra(J.l));d.forEach(function(b){a.appendChild(b)});e.forEach(function(b){a.appendChild(b)});f.length&&a.appendChild(Ra(J.$a));
-f.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Sa.apply(document.getElementById("chanSearch"));Ta();P();Q&&Ua(Q.a.id,Q.j,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"})}
-function Va(){sa(function(a){var b=a.u,c;for(c in a.self.l)if(!a.self.l[c].ca){var d=document.getElementById("room_"+c);b[c]?d.classList.add("chat-context-typing"):d.classList.remove("chat-context-typing")}for(var e in a.j)(c=a.j[e].V)&&!c.ca&&(d=document.getElementById("room_"+c.id))&&(b[c.id]?d.classList.add("chat-context-typing"):d.classList.remove("chat-context-typing"))});Wa()}
-function Wa(){var a;document.getElementById("whoistyping").textContent="";if(Q&&K&&(a=Q.u[K.id])){var b=document.createDocumentFragment(),c=!1,d;for(d in a)(a=H(d))?b.appendChild(Xa(a)):c=!0;c&&(E.b=0);document.getElementById("whoistyping").appendChild(b)}}function Ya(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");P()}
-function Za(){var a=K.name||(K.a?K.a.getName():void 0);if(!a){console.error("No name provided for ",K);var a=[],b;for(b in K.j)a.push(K.j[b].getName());a=a.join(", ")}document.getElementById("currentRoomTitle").textContent=a;R();S();document.getElementById("fileUploadContainer").classList.add("hidden");$a();T&&(T=null,U());V&&(V=null,U());P();Wa()}
-function U(){if(T){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){T=null;U()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(T.K())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";S()}
-function ab(){if(V){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){V=null;ab()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(V.K());document.getElementById("msgInput").value=V.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";S()}
-window.toggleReaction=function(a,b,c){var d=E.a[a],e,f;(d=E.a[a])&&(e=na(d,b))&&(f=G(E.context,a))&&(e.D[c]&&-1!==e.D[c].indexOf(f.self.id)?(d=new XMLHttpRequest,d.open("DELETE","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0),d.send(null)):bb(a,b,c))};
-function cb(a){a:{var b={};if(Q)for(var c=Q;!b[a];){if(c=c.b.data[a])if("alias:"==c.substr(0,6))b[a]=!0,a=c.substr(6);else{a=document.createElement("span");a.className="emoji-custom emoji";a.style.backgroundImage="url('"+c+"')";break a}break}}"string"===typeof a&&"makeEmoji"in window&&(a=window.makeEmoji(a));return"string"===typeof a?null:a}function db(a,b){document.getElementById("linkFavicon").href=a||b?"favicon.png?h="+a+"&m="+b:"favicon_ok.png"}
-function P(){var a=L.length,b="";if(W)b="!"+J.Va+" - Mimouchat",document.getElementById("linkFavicon").href="favicon_err.png";else if(a)b="(!"+a+")",db(a,a);else{var c=0;ra(E.context,function(a){a.P>a.C&&c++});c&&(b="("+c+")");db(0,c)}!b.length&&K&&(b=K.name);document.title=b.length?b:"Mimouchat"}
-function eb(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(Oa+3E4<a){var b=new Notification(J.Wa);Oa=a;setTimeout(function(){b.close()},5E3)}}else"denied"!==Notification.permission&&Notification.requestPermission()}
-function R(){var a=document.createDocumentFragment(),b=K.id,c=null,d=0,e=null,f;K.A?document.getElementById("chatSystemContainer").classList.add("starred"):document.getElementById("chatSystemContainer").classList.remove("starred");Na=[];E.a[b]&&E.a[b].a.forEach(function(b){if(b.i)b.W();else{var g=b.N(),n=!1;c&&c.J===b.J&&b.J?30>Math.abs(d-b.m)&&!(b instanceof y)?e.classList.add("chatmsg-same-ts"):d=b.m:(d=b.m,n=!0);(!c||c.m<=K.C)&&b.m>K.C?g.classList.add("chatmsg-first-unread"):g.classList.remove("chatmsg-first-unread");
-if(b instanceof y)e=c=null,d=0,a.appendChild(g),f=null;else{if(n||!f){var n=H(b.J),m=b.username,l=document.createElement("div"),k=document.createElement("div"),q=document.createElement("a"),u=document.createElement("img");l.da=document.createElement("span");l.da.className="chatmsg-author-img-wrapper";u.className="chatmsg-author-img";q.className="chatmsg-author-name";q.href="#"+n.id;n?(q.textContent=n.getName(),u.src="api/avatar?user="+n.id):(q.textContent=m||"?",u.src="");l.da.appendChild(u);k.appendChild(l.da);
-k.appendChild(q);k.className="chatmsg-author";l.className="chatmsg-authorGroup";l.appendChild(k);l.content=document.createElement("div");l.content.className="chatmsg-author-messages";l.appendChild(l.content);f=l;Na.push(f);a.appendChild(f)}c=b;e=g;f.content.appendChild(g)}}});b=document.getElementById("chatWindow");b.textContent="";b.appendChild(a);b.scrollTop=b.scrollHeight-b.clientHeight;fb();window.hasFocus&&$a()}
-function gb(a,b){if(a.classList.contains("chatmsg-hover-reply"))V&&(V=null,ab()),T!==b&&(T=b,U());else if(a.classList.contains("chatmsg-hover-reaction")){var c=K.id,d=b.id;hb.ia(document.body,Q,function(a){a&&bb(c,d,a)})}else a.classList.contains("chatmsg-hover-edit")?(T&&(T=null,U()),V!==b&&(V=b,ab())):a.classList.contains("chatmsg-hover-star")?b.A?ib(b):jb(b):a.classList.contains("chatmsg-hover-pin")?b.pinned?kb(b):lb(b):a.classList.contains("chatmsg-hover-remove")&&(T&&(T=null,U()),V&&(V=null,
+ca.prototype.update=function(a,b){a.emoji_use&&(this.a=JSON.parse(a.emoji_use));a.highlight_words?this.B=(a.highlight_words||"").split(",").filter(function(a){return""!==a.trim()}):a.highlights&&(this.B=a.highlights);this.version=Math.max(this.version,b)};function da(){this.a=null;this.l={};this.j={};this.self=null;this.b={version:0,data:{}};this.h={version:0,data:{}};this.u={};this.Y={};this.o=0}function fa(a,b){return b.pv?new u(b.id,a.j[b.user]):new v(b.id)}
+function ga(a,b,c){var d=d||"";b.team&&(a.a||(a.a=new aa(b.team.id)),a.a.update(b.team,c));if(b.users)for(var e=0,f=b.users.length;e<f;e++){var g=a.j[d+b.users[e].id];g||(g=a.j[d+b.users[e].id]=new ha(b.users[e].id));g.update(b.users[e],c)}if(b.channels)for(e=0,f=b.channels.length;e<f;e++)(g=a.l[d+b.channels[e].id])||(g=a.l[d+b.channels[e].id]=fa(a,b.channels[e])),g.update(b.channels[e],a,c,d);b.emojis&&(a.b.data=b.emojis,a.b.version=c);if(void 0!==b.commands){a.h.data={};for(e in b.commands)a.h.data[e]=
+new ba(b.commands[e]);a.h.version=c}b.self&&(a.self=a.j[d+b.self.id]||null,a.self.R||(a.self.R=new ca),b.self.prefs&&a.self.R.update(b.self.prefs,c));b.capacities&&(a.Y={},b.capacities.forEach(function(a){this.Y[a]=!0},a));a.o=Math.max(a.o,c)}"undefined"!==typeof module&&(module.H.vb=da,module.H.wb=aa,module.H.yb=ba);function v(a){this.id=a;this.A=!1;this.C=0;this.j={};this.version=0}
+v.prototype.update=function(a,b,c,d){d=d||"";void 0!==a.name&&(this.name=a.name);void 0!==a.is_archived&&(this.da=a.is_archived);void 0!==a.is_member&&(this.$=a.is_member);void 0!==a.last_read&&(this.C=Math.max(parseFloat(a.last_read),this.C));void 0!==a.last_msg&&(this.P=parseFloat(a.last_msg));void 0!==a.is_private&&(this.b=a.is_private);void 0!==a.pins&&(this.h=a.pins);this.A=!!a.is_starred;if(a.members&&(this.j={},a.members))for(var e=0,f=a.members.length;e<f;e++){var g=b.j[d+a.members[e]];this.j[g.id]=
+g;g.l[this.id]=this}a.topic&&(this.la=a.topic.value,this.I=b.j[d+a.topic.creator],this.ca=a.topic.last_set);a.purpose&&(this.ia=a.purpose.value,this.o=b.j[d+a.purpose.creator],this.ba=a.purpose.last_set);this.version=Math.max(this.version,c)};function ia(a,b){var c=ja;return{name:c.fa(b,a.name),ob:c.fa(b,Object.values(a.j),function(a){return a?a.getName():null}),la:c.fa(b,a.la),ia:c.fa(b,a.ia)}}function u(a,b){v.call(this,a);this.a=b;this.name=b.getName();this.b=!0;b.V=this}u.prototype=Object.create(v.prototype);
+u.prototype.constructor=u;"undefined"!==typeof module&&(module.H.Eb=v,module.H.Db=u);function y(a,b){this.L=a.user;this.username=a.username;this.id=a.id||a.ts;this.m=parseFloat(a.ts);this.text="";this.s=[];this.A=a.is_starred||!1;this.h=this.F=!1;this.D={};this.version=b;this.update(a,b)}function z(a,b){y.call(this,a,b)}function B(a,b){y.call(this,a,b)}
+y.prototype.update=function(a,b){if(a){if(this.text=a.text||"",a.attachments&&(this.s=a.attachments),this.A=!!a.is_starred,this.F=void 0===a.edited?!1:a.edited,this.h=!!a.removed,a.reactions){var c={};a.reactions.forEach(function(a){c[a.name]=[];a.users.forEach(function(b){c[a.name].push(b)})});this.D=c}}else this.h=!0;this.version=b};function C(a,b,c,d,e){this.id="string"===typeof a?a:a.id;this.a=[];this.h=c;this.fb=0;this.o=b;d&&ka(this,d,e)}
+function ka(a,b,c){var d=0;b.forEach(function(a){d=Math.max(this.push(a,c),d)}.bind(a));la(a);return d}C.prototype.b=function(a,b){return!0===a.isMeMessage?new z(a,b):!0===a.isNotice?new B(a,b):new y(a,b)};
+C.prototype.push=function(a,b){for(var c,d=!1,e,f=0,g=this.a.length;f<g;f++)if(c=this.a[f],c.id===a.id){e=c.update(a,b);d=!0;break}d||(c=this.b(a,b),this.a.push(c),e=c.m);for(;this.a.length>this.o;)this.a.shift();if(this.h)for(a=0;a<this.a.length;a++)this.a[a].version<b-this.h&&this.a.splice(a--,1);return e||0};function ma(a){return a.a[a.a.length-1]}function na(a,b){for(var c=0,d=a.a.length;c<d;c++)if(a.a[c].id==b)return a.a[c];return null}function la(a){a.a.sort(function(a,c){return a.m-c.m})}
+z.prototype=Object.create(y.prototype);z.prototype.constructor=z;B.prototype=Object.create(y.prototype);B.prototype.constructor=B;"undefined"!==typeof module&&(module.H={Ab:y,zb:z,Cb:B,Fb:C});function ha(a){this.id=a;this.l={};this.V=this.R=null;this.version=0}
+ha.prototype.update=function(a,b){void 0!==a.name&&(this.name=a.name);void 0!==a.deleted&&(this.Oa=a.deleted);void 0!==a.status&&(this.status=a.status);void 0!==a.goal&&(this.kb=a.goal);void 0!==a.phone&&(this.qb=a.phone);void 0!==a.first_name&&(this.Qa=a.first_name);void 0!==a.last_name&&(this.Va=a.last_name);void 0!==a.real_name&&(this.cb=a.real_name);void 0!==a.isPresent&&(this.wa=a.isPresent);a.isBot&&(this.mb=a.isBot);this.version=Math.max(this.version,b)};
+ha.prototype.getName=function(){return this.name||this.cb||this.Qa||this.Va};"undefined"!==typeof module&&(module.H.xb=ha);function oa(){this.a=[]}oa.prototype.push=function(a){this.a.push(a)};function pa(a,b){for(var c=0,d=a.a.length;c<d;c++)if(b===qa(a.a[c]))return a.a[c];return null}function ra(a,b){for(var c=0,d=a.a.length;c<d;c++){var e=a.a[c],f;for(f in e.l)if(!0===b(e.l[f],f))return}}function sa(a){for(var b=E.context,c=0,d=b.a.length;c<d&&!0!==a(b.a[c]);c++);}function F(a,b){for(var c=0,d=a.a.length;c<d;c++)if(a.a[c].l[b])return a.a[c];return null}
+function ta(a){for(var b=E.context,c=0,d=b.a.length;c<d;c++){var e=b.a[c].l[a];if(e)return e}return null}function ua(a){for(var b=E.context,c=[],d=0,e=b.a.length;d<e;d++){var f=b.a[d].l,g;for(g in f)a&&!a(f[g],b.a[d],g)||c.push(g)}return c}function H(a){for(var b=E.context,c=0,d=b.a.length;c<d;c++){var e=b.a[c].j[a];if(e)return e}return null}"undefined"!==typeof module&&(module.H.Bb=oa);var ja=function(){function a(b,c,d){if(Array.isArray(c)){for(var e=0,f=0,g=c.length;f<g;f++){var h=a(b,c[f],d);if(1===h)return 1;e=Math.max(h,e)}return e}return(c=d?d(c):c)&&void 0!==b&&null!==b?b.length?-1===c.indexOf(b)?0:b.length/c.length:1:0}return{fa:a}}();"undefined"!==typeof module&&(module.H.Gb=ja);var I={},K,va=[];function wa(){if(!c){for(var a=0,b=navigator.languages.length;a<b;a++)if(I.hasOwnProperty(navigator.languages[a])){var c=navigator.languages[a];break}c||(c="en")}K=I[c];console.log("Loading language pack: "+c);if(K.c)for(var d in K.c)if(c=document.getElementById(d))c.textContent=K.c[d];va.forEach(function(a){a()})};I.fr={ub:"Utilisateur inconnu",tb:"Channel inconnu",Xa:"Nouveau message",message:"Message",Wa:"Reseau",Ya:"(visible seulement par vous)",A:"Favoris",l:"Discutions",bb:"Discutions priv\u00e9es",eb:"Partage sa position GPS",ok:"Ok",Pa:"Annuler",N:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(a);b.setHours(0,0,0,0);c.setTime(b.getTime());c.setDate(c.getDate()-1);return a.getTime()>b.getTime()?a.toLocaleTimeString():a.getTime()>c.getTime()?"hier, "+a.toLocaleTimeString():
+a.toLocaleString()},ta:function(a,b){return a+"/"+b},c:{fileUploadCancel:"Annuler",neterror:"Impossible de se connecter au chat !",ctxMenuSettings:"Configuration",settingTitle:"Configuration","setting-menu-services":"Services","settings-services-title":"Services","setting-menu-display":"Affichage","settings-display-title":"Affichage","setting-menu-privacy":"Vie priv\u00e9e","settings-privacy-title":"Vie priv\u00e9e",settingCommit:"Appliquer","settings-serviceAddButton":"Ajouter un service","settings-serviceListEmpty":"Vous n'avez pas encore ajout\u00e9 de service. Ajouter un service pour continuer.",
+"settings-serviceAddConfirm":"Suivant"}};I.fr.Za=function(a){return 0===a?"Pas de message \u00e9pingl\u00e9":a+(1===a?" message \u00e9pingl\u00e9":" messages \u00e9pingl\u00e9s")};I.fr.F=function(a){return"(edit&eacute; "+I.fr.N(a)+")"};I.fr.za=function(a,b){return"par "+a.getName()+" le "+I.fr.N(b)};I.en={ub:"Unknown member",tb:"Unknown channel",Xa:"New message",message:"Message",Wa:"Network",Ya:"(only visible to you)",A:"Starred",l:"Channels",bb:"Direct messages",eb:"Share your GPS location",ok:"Ok",Pa:"Cancel",N:function(a){"string"!==typeof a&&(a=parseFloat(a));var b=new Date,c=new Date;a=new Date(a);b.setHours(0,0,0,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()},
+ta:function(a,b){return a+"/"+b},c:{fileUploadCancel:"Cancel",neterror:"Cannot connect to chat !",ctxMenuSettings:"Settings",settingTitle:"Settings","setting-menu-services":"Services","settings-services-title":"Services","setting-menu-display":"Display","settings-display-title":"Display","setting-menu-privacy":"Privacy","settings-privacy-title":"Privacy",settingCommit:"Apply","settings-serviceAddButton":"Add a service","settings-serviceListEmpty":"You don't have any service yet. Please add a service to continue.",
+"settings-serviceAddConfirm":"Next"}};I.en.Za=function(a){return 0===a?"No pinned messages":a+(1===a?" pinned message":" pinned messages")};I.en.F=function(a){return"(edited "+I.en.N(a)+")"};I.en.za=function(a,b){return"by "+a.getName()+" on "+I.en.N(b)};var xa=function(){function a(a){this.text="";this.g=a}function b(b,c,d){this.X=c;this.f=null;this.i=[];this.a=d||"";this.oa="<"===this.a;this.xa="*"===this.a;this.na="_"===this.a;this.pa="~"===this.a||"-"===this.a;this.h=">"===this.a||"&gt;"===this.a;this.I=":"===this.a;this.Aa="`"===this.a;this.La="```"===this.a;this.Ba="\n"===this.a;this.ma=void 0!==d&&-1!==n.B.indexOf(d);this.g=b;this.qa=null;this.b=this.Ba||this.ma?c+d.length-1:!1;this.ma&&(this.f=new a(this),this.i.push(this.f),this.f.text=d)}
+function c(a){return"A"<=a&&"Z">=a||"a"<=a&&"z">=a||"0"<=a&&"9">=a||-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(a)}function d(a){a=a||l;for(var c=0,e=a.i.length;c<e;c++){var m=
+a.i[c];if(m instanceof b)if(m.b){if(m=d(m))return m}else return m}return null}function e(a,c){a.g instanceof b&&(a.g.i.splice(a.g.i.indexOf(a)+(c?1:0)),a.g.f=a.g.i[a.g.i.length-1],e(a.g,!0))}function f(a){return a}function g(a){return{link:a,text:a,Sa:!1}}var h,l,n={B:[],Z:f,ka:f,ha:g};b.prototype.Da=function(){return this.xa&&!!this.b||this.g instanceof b&&this.g.Da()};b.prototype.Ga=function(){return this.na&&!!this.b||this.g instanceof b&&this.g.Ga()};b.prototype.Ha=function(){return this.pa&&
+!!this.b||this.g instanceof b&&this.g.Ha()};b.prototype.ca=function(){return this.I&&!!this.b||this.g instanceof b&&this.g.ca()};b.prototype.Fa=function(){return this.ma&&!!this.b||this.g instanceof b&&this.g.Fa()};b.prototype.Ea=function(){return this.Aa&&!!this.b||this.g instanceof b&&this.g.Ea()};b.prototype.ba=function(){return this.La&&!!this.b||this.g instanceof b&&this.g.ba()};b.prototype.Ia=function(){for(var a=0,c=this.i.length;a<c;a++)if(this.i[a]instanceof b&&(!this.i[a].b||this.i[a].Ia()))return!0;
+return!1};b.prototype.Ja=function(a){if("<"===this.a&&">"===h[a])return!0;var b=c(h[a-1]);if(!this.h&&h.substr(a,this.a.length)===this.a){if(!b&&(this.xa||this.na||this.pa))return!1;if(this.f&&this.Ia())return this.f.Ma();if(this.gb())return!0}return"\n"===h[a]&&this.h?!0:!1};b.prototype.gb=function(){for(var a=this;a;){for(var c=0,d=a.i.length;c<d;c++)if(a.i[c]instanceof b||a.i[c].text.length)return!0;a=a.qa}return!1};b.prototype.Ma=function(){var a=new b(this.g,this.X,this.a);a.qa=this;this.f&&
+this.f instanceof b&&(a.f=this.f.Ma(),a.i=[a.f]);return a};b.prototype.hb=function(a){return this.I&&(" "===h[a]||"\t"===h[a])||(this.I||this.oa||this.xa||this.na||this.pa||this.Aa)&&"\n"===h[a]?!1:!0};b.prototype.ib=function(b){if(this.Aa||this.I||this.La||this.oa)return null;if(!this.f||this.f.b||this.f instanceof a){var d=c(h[b-1]),e=c(h[b+1]);if("```"===h.substr(b,3))return"```";var f=l.va();if(void 0===f||f){if("&gt;"===h.substr(b,4))return"&gt;";if(">"===h[b])return h[b]}if("`"===h[b]&&!d||
+"\n"===h[b]||!(-1===["*","~","-","_"].indexOf(h[b])||!e&&void 0!==h[b+1]&&-1==="*~-_<&".split("").indexOf(h[b+1])||d&&void 0!==h[b-1]&&-1==="*~-_<&".split("").indexOf(h[b-1]))||-1!==[":"].indexOf(h[b])&&e||-1!==["<"].indexOf(h[b]))return h[b];d=0;for(e=n.B.length;d<e;d++)if(f=n.B[d],h.substr(b,f.length)===f)return f}return null};a.prototype.va=function(){if(""!==this.text.trim())return!1};b.prototype.va=function(){for(var a=this.i.length-1;0<=a;a--){var b=this.i[a].va();if(void 0!==b)return b}if(this.Ba||
+this.h)return!0};a.prototype.o=function(a){this.text+=h[a];return 1};b.prototype.o=function(c){var d=this.f&&!this.f.b&&this.f.Ja?this.f.Ja(c):null;if(d){var e=this.f.a.length;this.f.Ca(c);d instanceof b&&(this.f=d,this.i.push(d));return e}if(!this.f||this.f.b||this.f instanceof a||this.f.hb(c)){if(d=this.ib(c))return this.f=new b(this,c,d),this.i.push(this.f),this.f.a.length;if(!this.f||this.f.b)this.f=new a(this),this.i.push(this.f);return this.f.o(c)}d=this.f.X+1;l.$(this.f.X);this.f=new a(this);
+this.f.o(d-1);this.i.pop();this.i.push(this.f);return d-c};b.prototype.Ca=function(a){for(var b=this;b;)b.b=a,b=b.qa};b.prototype.$=function(a){this.b&&this.b>=a&&(this.b=!1);this.i.forEach(function(c){c instanceof b&&c.$(a)})};a.prototype.innerHTML=function(){if(this.g.ca()){for(var a=this.g;a&&!a.I;)a=a.g;if(a){var a=a.a+this.text+a.a,b=n.Z(a);return b?b:a}return(a=n.Z(this.text))?a:this.text}if(this.g.ba()){if("undefined"!==typeof hljs)try{return a=this.text.match(/^\w+/),hljs.configure({useBR:!0,
+tabReplace:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"}),a&&hljs.getLanguage(a[0])?hljs.fixMarkup(hljs.highlight(a[0],this.text.substr(a[0].length)).value):hljs.fixMarkup(hljs.highlightAuto(this.text).value)}catch(q){console.error(q)}return this.text.replace(/\n/g,"<br/>")}return n.ka(this.text)};a.prototype.outerHTML=function(){var a="span",b=[],c="";if(this.g.ba()){a="pre";b.push("codeblock");var d=this.innerHTML()}else this.g.Ea()?(b.push("code"),d=this.innerHTML()):(this.g.oa&&(d=n.ha(this.text))?
+(a="a",c=' href="'+d.link+'"',d.Sa||(c+=' target="_blank"'),d=n.ka(d.text)):d=this.innerHTML(),this.g.Da()&&b.push("bold"),this.g.Ga()&&b.push("italic"),this.g.Ha()&&b.push("strike"),this.g.ca()&&b.push("emoji"),this.g.Fa()&&b.push("highlight"));return"<"+a+c+(b.length?' class="'+b.join(" ")+'"':"")+">"+d+"</"+a+">"};b.prototype.outerHTML=function(){var a="";this.h&&(a+='<span class="quote">');this.Ba&&(a+="<br/>");this.i.forEach(function(b){a+=b.outerHTML()});this.h&&(a+="</span>");return a};b.prototype.Ka=
+function(a){this.h&&!this.b&&this.Ca(a);this.i.forEach(function(c){c instanceof b&&c.Ka(a)})};return function(c,k){k||(k={});n.B=k.B||[];n.Z=k.Z||f;n.ka=k.ka||f;n.ha=k.ha||g;h=c;l=new b(this,0);k=0;c=h.length;do{for(;k<c;)k+=l.o(k);l.Ka(h.length);if(k=d()){e(k,!1);l.$(k.X);var m=new a(k.g);m.o(k.X);k.g.i.push(m);k.g.f=m;k=k.X+1}else k=void 0}while(void 0!==k);return l.outerHTML()}}();"undefined"!==typeof module&&(module.H.w=xa);function ya(a,b){this.h=a;this.content=b;this.c=za(this);this.b=Aa(this);this.a=[];this.o=[]}
+function za(a){var b=document.createElement("div"),c=document.createElement("header"),d=document.createElement("span"),e=document.createElement("span"),f=document.createElement("div"),g=document.createElement("footer");b.a=document.createElement("span");b.b=document.createElement("span");d.textContent=a.h;"string"==typeof a.content?f.innerHTML=a.content:f.appendChild(a.content);c.className=Ba;d.className=Ca;e.className=Da;e.textContent="x";c.appendChild(d);c.appendChild(e);b.appendChild(c);f.className=
+Ea;b.appendChild(f);b.b.className=Fa;b.b.textContent=K.Pa;b.b.addEventListener("click",function(){Ga(a,!1)});e.addEventListener("click",function(){Ga(a,!1)});b.a.addEventListener("click",function(){Ga(a,!0)});g.appendChild(b.b);b.a.className=Fa;b.a.textContent=K.ok;g.appendChild(b.a);g.className=Ha+" "+Ia;b.appendChild(g);b.className=Ja;return b}function Ga(a,b){(b?a.a:a.o).forEach(function(a){a()});a.close()}
+function Aa(a){var b=document.createElement("div");b.className=Ka;b.addEventListener("click",function(){Ga(this,!1)}.bind(a));return b}function La(a,b,c){a.c.a.textContent=b;a.c.b.textContent=c;return a}ya.prototype.ja=function(a){a=a||document.body;a.appendChild(this.b);a.appendChild(this.c);return this};ya.prototype.close=function(){this.c.remove();this.b.remove();return this};function Ma(a,b){a.a.push(b);return a};var Fa="button",Ha="button-container",Ja="dialog",Ka="dialog-overlay",Ba="dialog-title",Ca="dialog-title-label",Da="dialog-title-close",Ea="dialog-body",Ia="dialog-footer";var Na=[],Oa=0;
+function Pa(){var a=document.createDocumentFragment(),b=ua(function(a){return!a.da&&!1!==a.$}),c=[],d=[],e=[],f=[],g={};b.sort(function(a,b){if(a[0]!==b[0])return a[0]-b[0];var c=F(E.context,a),d=F(E.context,b);a=c.l[a];b=d.l[b];return a.name===b.name?(g[a.id]=K.ta(c.a.name,a.name),g[b.id]=K.ta(d.a.name,b.name),c.a.name.localeCompare(d.a.name)):a.name.localeCompare(b.name)});b.forEach(function(a){a=ta(a);if(a instanceof u){var b;if(b=!a.a.Oa){var h=g[a.id];b=document.createElement("li");var m=document.createElement("a");
+b.id="room_"+a.id;m.href="#"+a.id;b.className="chat-context-room chat-ims presence-indicator";m.textContent=h||a.a.getName();b.appendChild(Qa());b.appendChild(m);a.a.wa||b.classList.add("presence-away");L===a&&b.classList.add("selected");a.P>a.C&&(b.classList.add("unread"),b.classList.add("unreadHi"));b=h=b}b&&(a.A?c.push(h):f.push(h))}else if(h=g[a.id],b=document.createElement("li"),m=document.createElement("a"),b.id="room_"+a.id,m.href="#"+a.id,a.b?(b.className="chat-context-room chat-group",b.dataset.count=
+Object.keys(a.j||{}).length):b.className="chat-context-room chat-channel",L===a&&b.classList.add("selected"),m.textContent=h||a.name,b.appendChild(Qa()),b.appendChild(m),a.P>a.C&&(b.classList.add("unread"),0<=M.indexOf(a)&&b.classList.add("unreadHi")),h=b)a.A?c.push(h):a.b?e.push(h):d.push(h)});c.length&&a.appendChild(Ra(K.A));c.forEach(function(b){a.appendChild(b)});d.length&&a.appendChild(Ra(K.l));d.forEach(function(b){a.appendChild(b)});e.forEach(function(b){a.appendChild(b)});f.length&&a.appendChild(Ra(K.bb));
+f.forEach(function(b){a.appendChild(b)});document.getElementById("chanList").textContent="";document.getElementById("chanList").appendChild(a);Sa.apply(document.getElementById("chanSearch"));Ta();O();P&&Ua(P.a.id,P.j,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"})}
+function Va(){sa(function(a){var b=a.u,c;for(c in a.self.l)if(!a.self.l[c].da){var d=document.getElementById("room_"+c);b[c]?d.classList.add("chat-context-typing"):d.classList.remove("chat-context-typing")}for(var e in a.j)(c=a.j[e].V)&&!c.da&&(d=document.getElementById("room_"+c.id))&&(b[c.id]?d.classList.add("chat-context-typing"):d.classList.remove("chat-context-typing"))});Wa()}
+function Wa(){var a;document.getElementById("whoistyping").textContent="";if(P&&L&&(a=P.u[L.id])){var b=document.createDocumentFragment(),c=!1,d;for(d in a)(a=H(d))?b.appendChild(Xa(a)):c=!0;c&&(E.b=0);document.getElementById("whoistyping").appendChild(b)}}function Ya(a){a?document.body.classList.remove("no-network"):document.body.classList.add("no-network");O()}
+function Za(){var a=L.name||(L.a?L.a.getName():void 0);if(!a){console.error("No name provided for ",L);var a=[],b;for(b in L.j)a.push(L.j[b].getName());a=a.join(", ")}document.getElementById("currentRoomTitle").textContent=a;Q();S();document.getElementById("fileUploadContainer").classList.add("hidden");$a();T&&(T=null,U());V&&(V=null,U());O();Wa()}
+function U(){if(T){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){T=null;U()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(T.M())}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";S()}
+function ab(){if(V){document.body.classList.add("replyingTo");var a=document.getElementById("replyToContainer"),b=document.createElement("a");b.addEventListener("click",function(){V=null;ab()});b.className="replyto-close";b.textContent="x";a.textContent="";a.appendChild(b);a.appendChild(V.M());document.getElementById("msgInput").value=V.text}else document.body.classList.remove("replyingTo"),document.getElementById("replyToContainer").textContent="";S()}
+window.toggleReaction=function(a,b,c){var d=E.a[a],e,f;(d=E.a[a])&&(e=na(d,b))&&(f=F(E.context,a))&&(e.D[c]&&-1!==e.D[c].indexOf(f.self.id)?(d=new XMLHttpRequest,d.open("DELETE","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0),d.send(null)):bb(a,b,c))};
+function cb(a){a:{var b={};if(P)for(var c=P;!b[a];){if(c=c.b.data[a])if("alias:"==c.substr(0,6))b[a]=!0,a=c.substr(6);else{a=document.createElement("span");a.className="emoji-custom emoji";a.style.backgroundImage="url('"+c+"')";break a}break}}"string"===typeof a&&"makeEmoji"in window&&(a=window.makeEmoji(a));return"string"===typeof a?null:a}function db(a,b){document.getElementById("linkFavicon").href=a||b?"favicon.png?h="+a+"&m="+b:"favicon_ok.png"}
+function O(){var a=M.length,b="";if(W)b="!"+K.Wa+" - Mimouchat",document.getElementById("linkFavicon").href="favicon_err.png";else if(a)b="(!"+a+")",db(a,a);else{var c=0;ra(E.context,function(a){a.P>a.C&&c++});c&&(b="("+c+")");db(0,c)}!b.length&&L&&(b=L.name);document.title=b.length?b:"Mimouchat"}
+function eb(){if("Notification"in window)if("granted"===Notification.permission){var a=Date.now();if(Oa+3E4<a){var b=new Notification(K.Xa);Oa=a;setTimeout(function(){b.close()},5E3)}}else"denied"!==Notification.permission&&Notification.requestPermission()}
+function Q(){var a=document.createDocumentFragment(),b=L.id,c=null,d=0,e=null,f;L.A?document.getElementById("chatSystemContainer").classList.add("starred"):document.getElementById("chatSystemContainer").classList.remove("starred");Na=[];E.a[b]&&E.a[b].a.forEach(function(b){if(b.h)b.W();else{var g=b.J(),l=!1;c&&c.L===b.L&&b.L?30>Math.abs(d-b.m)&&!(b instanceof z)?e.classList.add("chatmsg-same-ts"):d=b.m:(d=b.m,l=!0);(!c||c.m<=L.C)&&b.m>L.C?g.classList.add("chatmsg-first-unread"):g.classList.remove("chatmsg-first-unread");
+if(b instanceof z)e=c=null,d=0,a.appendChild(g),f=null;else{if(l||!f){var l=H(b.L),n=b.username,m=document.createElement("div"),k=document.createElement("div"),q=document.createElement("a"),t=document.createElement("img");m.ea=document.createElement("span");m.ea.className="chatmsg-author-img-wrapper";t.className="chatmsg-author-img";q.className="chatmsg-author-name";q.href="#"+l.id;l?(q.textContent=l.getName(),t.src="api/avatar?user="+l.id):(q.textContent=n||"?",t.src="");m.ea.appendChild(t);k.appendChild(m.ea);
+k.appendChild(q);k.className="chatmsg-author";m.className="chatmsg-authorGroup";m.appendChild(k);m.content=document.createElement("div");m.content.className="chatmsg-author-messages";m.appendChild(m.content);f=m;Na.push(f);a.appendChild(f)}c=b;e=g;f.content.appendChild(g)}}});b=document.getElementById("chatWindow");b.textContent="";b.appendChild(a);b.scrollTop=b.scrollHeight-b.clientHeight;fb();window.hasFocus&&$a()}
+function gb(a,b){if(a.classList.contains("chatmsg-hover-reply"))V&&(V=null,ab()),T!==b&&(T=b,U());else if(a.classList.contains("chatmsg-hover-reaction")){var c=L.id,d=b.id;hb.ja(document.body,P,function(a){a&&bb(c,d,a)})}else a.classList.contains("chatmsg-hover-edit")?(T&&(T=null,U()),V!==b&&(V=b,ab())):a.classList.contains("chatmsg-hover-star")?b.A?ib(b):jb(b):a.classList.contains("chatmsg-hover-pin")?b.pinned?kb(b):lb(b):a.classList.contains("chatmsg-hover-remove")&&(T&&(T=null,U()),V&&(V=null,
 ab()),mb(b))}
-function nb(a){function b(a,b){for(b=b||a.target;b!==a.currentTarget&&b;){if(b.id&&b.classList.contains("chatmsg-item"))return b.id;b=b.parentElement}}for(var c=a.target;c!==a.currentTarget&&c&&!c.classList.contains("chatmsg-hover");){var d;if(c.parentElement&&c.classList.contains("chatmsg-attachment-actions-item")){var e=c.dataset.attachmentIndex,f=c.dataset.actionIndex;if((d=b(a,c))&&void 0!==e&&void 0!==f){d=d.substr(d.lastIndexOf("_")+1);(a=na(E.a[K.id],d))&&a.s[e]&&a.s[e].actions&&a.s[e].actions[f]&&
-ob(a,a.s[e],a.s[e].actions[f]);break}}if(c.parentElement&&c.parentElement.classList.contains("chatmsg-hover")){if(d=b(a,c))d=d.substr(d.lastIndexOf("_")+1),(a=na(E.a[K.id],d))&&gb(c,a);break}c=c.parentElement}}
-function ob(a,b,c){function d(){var d={actions:[c],attachment_id:b.id,callback_id:b.callback_id,channel_id:e,is_ephemeral:a instanceof z,message_ts:a.id},g=new XMLHttpRequest;g.open("POST","api/attachmentAction?serviceId="+a.J);g.send(JSON.stringify(d))}var e=K.id;c.confirm?Ma(La(new ya(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).ia():d()}function S(){document.getElementById("msgInput").focus()}
-function fb(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;Na.forEach(function(b){var c=b.da,d=c.clientHeight;b=b.getBoundingClientRect();c.style.top=Math.max(0,Math.min(a-b.top,b.height-d-d/2))+"px"})}
+function nb(a){function b(a,b){for(b=b||a.target;b!==a.currentTarget&&b;){if(b.id&&b.classList.contains("chatmsg-item"))return b.id;b=b.parentElement}}for(var c=a.target;c!==a.currentTarget&&c&&!c.classList.contains("chatmsg-hover");){var d;if(c.parentElement&&c.classList.contains("chatmsg-attachment-actions-item")){var e=c.dataset.attachmentIndex,f=c.dataset.actionIndex;if((d=b(a,c))&&void 0!==e&&void 0!==f){d=d.substr(d.lastIndexOf("_")+1);(a=na(E.a[L.id],d))&&a.s[e]&&a.s[e].actions&&a.s[e].actions[f]&&
+ob(a,a.s[e],a.s[e].actions[f]);break}}if(c.parentElement&&c.parentElement.classList.contains("chatmsg-hover")){if(d=b(a,c))d=d.substr(d.lastIndexOf("_")+1),(a=na(E.a[L.id],d))&&gb(c,a);break}c=c.parentElement}}
+function ob(a,b,c){function d(){var d={actions:[c],attachment_id:b.id,callback_id:b.callback_id,channel_id:e,is_ephemeral:a instanceof B,message_ts:a.id},g=new XMLHttpRequest;g.open("POST","api/attachmentAction?serviceId="+a.L);g.send(JSON.stringify(d))}var e=L.id;c.confirm?Ma(La(new ya(c.confirm.title,c.confirm.text),c.confirm.ok_text,c.confirm.dismiss_text),d).ja():d()}function S(){document.getElementById("msgInput").focus()}
+function fb(){var a=document.getElementById("chatWindow").getBoundingClientRect().top;Na.forEach(function(b){var c=b.ea,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(){wa();pb();var a=document.getElementById("chanSearch");a.addEventListener("input",Sa);a.addEventListener("blur",Sa);document.getElementById("chatWindow").addEventListener("click",nb);window.addEventListener("hashchange",function(){document.location.hash&&"#"===document.location.hash[0]&&Ta()});document.addEventListener("mouseover",function(a){for(a=a.target;a&&a!==this;){if("A"===a.nodeName){var b=a.href,c=b.indexOf("#");if(0<=c){b=b.substr(c+
-1);if(c=G(E.context,b)){X.Ya(c,c.l[b]).show(a);return}a:{for(var c=E.context,f=0,g=c.a.length;f<g;f++)if(c.a[f].j[b]){c=c.a[f];break a}c=null}if(c&&(b=c.j[b].V)){X.Ya(c,b).show(a);return}}break}a=a.parentElement}X.ta()});document.addEventListener("mouseleave",function(){X.ta()});document.getElementById("currentRoomStar").addEventListener("click",function(a){a.preventDefault();K&&(K.A?(a=new XMLHttpRequest,a.open("POST","api/unstarChannel?room="+K.id,!0)):(a=new XMLHttpRequest,a.open("POST","api/starChannel?room="+
-K.id,!0)),a.send(null));return!1});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("ctxMenuSettings").addEventListener("click",function(a){a.preventDefault();qb.display()});document.getElementById("fileUploadForm").addEventListener("submit",
-function(a){a.preventDefault();a=document.getElementById("fileUploadInput");var b=a.value;b&&(b=b.substr(b.lastIndexOf("\\")+1),rb(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();
-K&&document.getElementById("fileUploadContainer").classList.remove("hidden");return!1});document.getElementById("msgForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("msgInput");K&&a.value&&sb(a.value)&&(a.value="",T&&(T=null,U()),V&&(V=null,U()),document.getElementById("slashList").textContent="");S();return!1});window.addEventListener("blur",function(){window.hasFocus=!1});window.addEventListener("focus",function(){window.hasFocus=!0;Oa=0;K&&$a();S()});document.getElementById("chatWindow").addEventListener("scroll",
-fb);var b=0;document.getElementById("msgInput").addEventListener("input",function(){if(K){var a=Date.now();b+3E3<a&&(Q.self.wa||K instanceof t)&&(tb(),b=a);var a=[],d=this.value;if("/"===this.value[0]){var e=d.indexOf(" "),f=-1!==e,e=-1===e?d.length:e,d=d.substr(0,e);if(f){var g=ub.Ra(d);g&&a.push(g)}else a=ub.hb(d);var g=Q?Q.i.data:{};for(n in g){var h=g[n];(!f&&h.name.substr(0,e)===d||f&&h.name===d)&&a.push(h)}}a.sort(function(a,b){return a.U.localeCompare(b.U)||a.name.localeCompare(b.name)});var n=
-document.getElementById("slashList");var e=document.createDocumentFragment();n.textContent="";f=0;for(d=a.length;f<d;f++){g=a[f];if(m!==g.U){var m=g.U;e.appendChild(vb(g.U))}e.appendChild(wb(g))}n.appendChild(e)}});window.hasFocus=!0;(function(){var a=document.getElementById("emojiButton");if("makeEmoji"in window){var b=window.makeEmoji("smile");b?a.innerHTML="<span class='emoji-small'>"+b.outerHTML+"</span>":a.style.backgroundImage='url("smile.svg")';(b=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML=
-"<span class='emoji-small'>"+b.outerHTML+"</span>":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){Q&&hb.ia(document.body,Q,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");S()})})}else a.classList.add("hidden")})();xb()});var qb=function(){function a(a){c&&(document.getElementById("settings").classList.remove("display-"+c),document.getElementById("setting-menu-"+c).classList.remove("selected"),document.getElementById("settings-serviceAddSection").classList.add("hidden"));document.getElementById("settings").classList.add("display-"+a);document.getElementById("setting-menu-"+a).classList.add("selected");c=a}var b=!1,c=null,d={S:"services",display:"display",Fb:"privacy"};document.getElementById("settingMenuItems").addEventListener("click",
+1);if(c=F(E.context,b)){X.Ta(a)||X.$a(c,c.l[b]).show(a);console.log("out");return}a:{for(var c=E.context,f=0,g=c.a.length;f<g;f++)if(c.a[f].j[b]){c=c.a[f];break a}c=null}if(c&&(b=c.j[b].V)){X.Ta(a)||X.$a(c,b).show(a);console.log("out");return}}break}a=a.parentElement}X.ua()});document.addEventListener("mouseleave",function(){X.ua()});document.getElementById("currentRoomStar").addEventListener("click",function(a){a.preventDefault();L&&(L.A?(a=new XMLHttpRequest,a.open("POST","api/unstarChannel?room="+
+L.id,!0)):(a=new XMLHttpRequest,a.open("POST","api/starChannel?room="+L.id,!0)),a.send(null));return!1});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("ctxMenuSettings").addEventListener("click",function(a){a.preventDefault();
+qb.display()});document.getElementById("fileUploadForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("fileUploadInput");var b=a.value;b&&(b=b.substr(b.lastIndexOf("\\")+1),rb(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();L&&document.getElementById("fileUploadContainer").classList.remove("hidden");return!1});document.getElementById("msgForm").addEventListener("submit",function(a){a.preventDefault();a=document.getElementById("msgInput");L&&a.value&&sb(a.value)&&(a.value="",T&&(T=null,U()),V&&(V=null,U()),document.getElementById("slashList").textContent="");S();return!1});window.addEventListener("blur",function(){window.hasFocus=
+!1});window.addEventListener("focus",function(){window.hasFocus=!0;Oa=0;L&&$a();S()});document.getElementById("chatWindow").addEventListener("scroll",fb);var b=0;document.getElementById("msgInput").addEventListener("input",function(){if(L){var a=Date.now();b+3E3<a&&(P.self.wa||L instanceof u)&&(tb(),b=a);var a=[],d=this.value;if("/"===this.value[0]){var e=d.indexOf(" "),f=-1!==e,e=-1===e?d.length:e,d=d.substr(0,e);if(f){var g=ub.Ra(d);g&&a.push(g)}else a=ub.jb(d);var g=P?P.h.data:{};for(l in g){var h=
+g[l];(!f&&h.name.substr(0,e)===d||f&&h.name===d)&&a.push(h)}}a.sort(function(a,b){return a.U.localeCompare(b.U)||a.name.localeCompare(b.name)});var l=document.getElementById("slashList");var e=document.createDocumentFragment();l.textContent="";f=0;for(d=a.length;f<d;f++){g=a[f];if(n!==g.U){var n=g.U;e.appendChild(vb(g.U))}e.appendChild(wb(g))}l.appendChild(e)}});window.hasFocus=!0;(function(){var a=document.getElementById("emojiButton");if("makeEmoji"in window){var b=window.makeEmoji("smile");b?a.innerHTML=
+"<span class='emoji-small'>"+b.outerHTML+"</span>":a.style.backgroundImage='url("smile.svg")';(b=window.makeEmoji("paperclip"))?document.getElementById("attachFile").innerHTML="<span class='emoji-small'>"+b.outerHTML+"</span>":document.getElementById("attachFile").style.backgroundImage='url("public/paperclip.svg")';a.addEventListener("click",function(){P&&hb.ja(document.body,P,function(a){a&&(document.getElementById("msgInput").value+=":"+a+":");S()})})}else a.classList.add("hidden")})();xb()});var qb=function(){function a(a){c&&(document.getElementById("settings").classList.remove("display-"+c),document.getElementById("setting-menu-"+c).classList.remove("selected"),document.getElementById("settings-serviceAddSection").classList.add("hidden"));document.getElementById("settings").classList.add("display-"+a);document.getElementById("setting-menu-"+a).classList.add("selected");c=a}var b=!1,c=null,d={S:"services",display:"display",Hb:"privacy"};document.getElementById("settingMenuItems").addEventListener("click",
 function(b){for(var c=b.target;b.currentTarget!==c&&c;c=c.parentNode)if(c.dataset&&c.dataset.target)for(var e in d)if(d[e]===c.dataset.target){a(d[e]);return}});document.getElementById("settings-serviceAddButton").addEventListener("click",function(a){a.preventDefault();document.getElementById("settings-serviceAddSection").classList.remove("hidden");return!1});document.getElementById("settings-serviceAddConfirm").addEventListener("click",function(a){a.preventDefault();document.location.href=document.getElementById("settings-serviceAddServiceList").value;
-return!1});return{display:function(c){b||(document.getElementById("settings").classList.remove("hidden"),b=!0);a(c||d.S);return this},qb:function(){return this},nb:d}}();function yb(a){if(void 0!==a.latitude&&void 0!==a.longitude&&-90<=a.latitude&&90>=a.latitude&&-180<=a.longitude&&180>=a.longitude){var b=0,c=function(a,b,c,d){return new Promise(function(e,f){var g=new Image;g.addEventListener("load",function(){d.O=g;e(d)});g.addEventListener("error",function(){console.warn("Error loading tile ",{zoom:a,x:b,y:c});f(g)});g.crossOrigin="anonymous";g.src="https://c.tile.openstreetmap.org/"+a+"/"+b+"/"+c+".png"})},d=document.createElement("canvas"),e=document.createElement("canvas");
-d.height=d.width=e.height=e.width=300;var f=d.getContext("2d"),g=e.getContext("2d"),h=function(a,b,c){a=a*Math.PI/180;b=b*Math.PI/180;c=c*Math.PI/180;return Math.abs(6371E3*Math.acos(Math.pow(Math.sin(a),2)+Math.pow(Math.cos(a),2)*Math.cos(c-b)))},n=function(a,d,e,k){g.fillStyle="#808080";g.fillRect(0,0,300,300);f.fillStyle="#808080";f.fillRect(0,0,300,300);var n=Math.pow(2,a),l=(e+180)/360*n,m=(1-Math.log(Math.tan(d*Math.PI/180)+1/Math.cos(d*Math.PI/180))/Math.PI)/2*n,q=Math.floor(l),F=Math.floor(m),
-ea=k?100*k/h(180/Math.PI*Math.atan(.5*(Math.exp(Math.PI-2*Math.PI*F/n)-Math.exp(-(Math.PI-2*Math.PI*F/n)))),q/n*360-180,(q+1)/n*360-180):0;d=b;for(e=0;3>e;e++)for(k=0;3>k;k++)c(a,q+e-1,F+k-1,{jb:e,lb:k,cb:d}).then(function(a){if(a.cb===b){g.drawImage(a.O,100*a.jb,100*a.lb,100,100);a=l-q;var c=m-F;a=100*a+100;c=100*c+100;f.putImageData(g.getImageData(0,0,300,300),0,0);void 0!==ea&&(f.beginPath(),f.arc(a,c,Math.max(ea,10),0,2*Math.PI,!1),f.lineWidth=2,f.fillStyle="rgba(244, 146, 66, 0.4)",f.strokeStyle=
-"rgba(244, 146, 66, 0.8)",f.stroke(),f.fill());if(void 0===ea||25<ea)f.strokeStyle="rgba(244, 146, 66, 1)",f.beginPath(),f.moveTo(a-5,c-5),f.lineTo(a+5,c+5),f.stroke(),f.moveTo(a+5,c-5),f.lineTo(a-5,c+5),f.stroke()}})},m,l=function(c){c=Math.max(4,Math.min(19,c));m!==c&&(b++,m=c,n(m,Number(a.latitude),Number(a.longitude),Number(a.accuracy)))};l(12);var e=document.createElement("div"),k=document.createElement("div"),q=document.createElement("button"),u=document.createElement("button");e.className=
-"OSM-wrapper";d.className="OSM-canvas";k.className="OSM-controls";u.className="OSM-controls-zoomMin";q.className="OSM-controls-zoomPlus";u.addEventListener("click",function(){l(m-1)});q.addEventListener("click",function(){l(m+1)});k.appendChild(u);k.appendChild(q);e.appendChild(d);e.appendChild(k);return e}};function Qa(){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 Ra=function(){var a={};return function(b){var c=a[b];c||(c=a[b]=document.createElement("header"),c.textContent=b);return c}}();
-function zb(a){var b=a.b,c=document.createElement("div"),d=document.createElement("div");c.aa=document.createElement("ul");c.s=document.createElement("ul");c.D=document.createElement("ul");c.m=document.createElement("div");c.ya=document.createElement("div");c.ra=document.createElement("span");c.id=b+"_"+a.id;c.className="chatmsg-item";c.m.className="chatmsg-ts";c.ya.className="chatmsg-msg";c.ra.className="chatmsg-author-name";var b=c.aa,e=a.context.Y;a:{for(var f=E.context,g=0,h=f.a.length;g<h;g++)if(f.a[g].self.id===
-a.J){a=!0;break a}a=!1}e.replyToMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-reply",f.style.backgroundImage='url("repl.svg")',b.appendChild(f));e.reactMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-reaction",f.style.backgroundImage='url("smile.svg")',b.appendChild(f));if(a&&e.editMsg||e.editOtherMsg)f=document.createElement("li"),f.className="chatmsg-hover-edit",f.style.backgroundImage='url("edit.svg")',b.appendChild(f);e.starMsg&&(b.fa=document.createElement("li"),
-b.fa.className="chatmsg-hover-star",b.appendChild(b.fa));e.pinMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-pin",b.appendChild(f),f.style.backgroundImage='url("pin.svg")');if(a&&e.removeMsg||e.moderate)e=document.createElement("li"),e.className="chatmsg-hover-remove",e.style.backgroundImage='url("remove.svg")',b.appendChild(e);c.aa.className="chatmsg-hover";d.appendChild(c.ra);d.appendChild(c.ya);d.appendChild(c.m);d.appendChild(c.s);c.F=document.createElement("div");c.F.className=
+return!1});return{display:function(c){b||(document.getElementById("settings").classList.remove("hidden"),b=!0);a(c||d.S);return this},sb:function(){return this},pb:d}}();function yb(a){if(void 0!==a.latitude&&void 0!==a.longitude&&-90<=a.latitude&&90>=a.latitude&&-180<=a.longitude&&180>=a.longitude){var b=0,c=function(a,b,c,d){return new Promise(function(e,f){var g=new Image;g.addEventListener("load",function(){d.O=g;e(d)});g.addEventListener("error",function(){console.warn("Error loading tile ",{zoom:a,x:b,y:c});f(g)});g.crossOrigin="anonymous";g.src="https://c.tile.openstreetmap.org/"+a+"/"+b+"/"+c+".png"})},d=document.createElement("canvas"),e=document.createElement("canvas");
+d.height=d.width=e.height=e.width=300;var f=d.getContext("2d"),g=e.getContext("2d"),h=function(a,b,c){a=a*Math.PI/180;b=b*Math.PI/180;c=c*Math.PI/180;return Math.abs(6371E3*Math.acos(Math.pow(Math.sin(a),2)+Math.pow(Math.cos(a),2)*Math.cos(c-b)))},l=function(a,d,e,l){g.fillStyle="#808080";g.fillRect(0,0,300,300);f.fillStyle="#808080";f.fillRect(0,0,300,300);var m=Math.pow(2,a),k=(e+180)/360*m,n=(1-Math.log(Math.tan(d*Math.PI/180)+1/Math.cos(d*Math.PI/180))/Math.PI)/2*m,q=Math.floor(k),G=Math.floor(n),
+ea=l?100*l/h(180/Math.PI*Math.atan(.5*(Math.exp(Math.PI-2*Math.PI*G/m)-Math.exp(-(Math.PI-2*Math.PI*G/m)))),q/m*360-180,(q+1)/m*360-180):0;d=b;for(e=0;3>e;e++)for(l=0;3>l;l++)c(a,q+e-1,G+l-1,{lb:e,nb:l,fb:d}).then(function(a){if(a.fb===b){g.drawImage(a.O,100*a.lb,100*a.nb,100,100);a=k-q;var c=n-G;a=100*a+100;c=100*c+100;f.putImageData(g.getImageData(0,0,300,300),0,0);void 0!==ea&&(f.beginPath(),f.arc(a,c,Math.max(ea,10),0,2*Math.PI,!1),f.lineWidth=2,f.fillStyle="rgba(244, 146, 66, 0.4)",f.strokeStyle=
+"rgba(244, 146, 66, 0.8)",f.stroke(),f.fill());if(void 0===ea||25<ea)f.strokeStyle="rgba(244, 146, 66, 1)",f.beginPath(),f.moveTo(a-5,c-5),f.lineTo(a+5,c+5),f.stroke(),f.moveTo(a+5,c-5),f.lineTo(a-5,c+5),f.stroke()}})},n,m=function(c){c=Math.max(4,Math.min(19,c));n!==c&&(b++,n=c,l(n,Number(a.latitude),Number(a.longitude),Number(a.accuracy)))};m(12);var e=document.createElement("div"),k=document.createElement("div"),q=document.createElement("button"),t=document.createElement("button");e.className=
+"OSM-wrapper";d.className="OSM-canvas";k.className="OSM-controls";t.className="OSM-controls-zoomMin";q.className="OSM-controls-zoomPlus";t.addEventListener("click",function(){m(n-1)});q.addEventListener("click",function(){m(n+1)});k.appendChild(t);k.appendChild(q);e.appendChild(d);e.appendChild(k);return e}};function Qa(){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 Ra=function(){var a={};return function(b){var c=a[b];c||(c=a[b]=document.createElement("header"),c.textContent=b);return c}}();
+function zb(a){var b=a.b,c=document.createElement("div"),d=document.createElement("div");c.aa=document.createElement("ul");c.s=document.createElement("ul");c.D=document.createElement("ul");c.m=document.createElement("div");c.ya=document.createElement("div");c.sa=document.createElement("span");c.id=b+"_"+a.id;c.className="chatmsg-item";c.m.className="chatmsg-ts";c.ya.className="chatmsg-msg";c.sa.className="chatmsg-author-name";var b=c.aa,e=a.context.Y;a:{for(var f=E.context,g=0,h=f.a.length;g<h;g++)if(f.a[g].self.id===
+a.L){a=!0;break a}a=!1}e.replyToMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-reply",f.style.backgroundImage='url("repl.svg")',b.appendChild(f));e.reactMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-reaction",f.style.backgroundImage='url("smile.svg")',b.appendChild(f));if(a&&e.editMsg||e.editOtherMsg)f=document.createElement("li"),f.className="chatmsg-hover-edit",f.style.backgroundImage='url("edit.svg")',b.appendChild(f);e.starMsg&&(b.ga=document.createElement("li"),
+b.ga.className="chatmsg-hover-star",b.appendChild(b.ga));e.pinMsg&&(f=document.createElement("li"),f.className="chatmsg-hover-pin",b.appendChild(f),f.style.backgroundImage='url("pin.svg")');if(a&&e.removeMsg||e.moderate)e=document.createElement("li"),e.className="chatmsg-hover-remove",e.style.backgroundImage='url("remove.svg")',b.appendChild(e);c.aa.className="chatmsg-hover";d.appendChild(c.sa);d.appendChild(c.ya);d.appendChild(c.m);d.appendChild(c.s);c.F=document.createElement("div");c.F.className=
 "chatmsg-edited";d.appendChild(c.F);d.appendChild(c.D);d.className="chatmsg-content";c.s.className="chatmsg-attachments";c.D.className="chatmsg-reactions";c.appendChild(d);c.appendChild(c.aa);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,c){var d=document.createElement("li"),e=document.createElement("div"),f=document.createElement("div"),g=document.createElement("a"),h=document.createElement("div"),n=document.createElement("img"),m=document.createElement("a"),l=document.createElement("div"),k=document.createElement("div"),q=document.createElement("div"),u=document.createElement("img"),w=document.createElement("div");d.className="chatmsg-attachment";e.style.borderColor=Ab(b.color||"");e.className="chatmsg-attachment-block";
-f.className="chatmsg-attachment-pretext";b.pretext?f.innerHTML=a.w(b.pretext):f.classList.add("hidden");g.target="_blank";b.title?(g.innerHTML=a.w(b.title),b.title_link&&(g.href=b.title_link),g.className="chatmsg-attachment-title"):g.className="hidden chatmsg-attachment-title";m.target="_blank";h.className="chatmsg-author";b.author_name&&(m.innerHTML=a.w(b.author_name),m.href=b.author_link||"",m.className="chatmsg-author-name",n.className="chatmsg-author-img",b.author_icon&&(n.src=b.author_icon,h.appendChild(n)),
-h.appendChild(m));q.className="chatmsg-attachment-thumb";b.thumb_url?(n=document.createElement("img"),n.src=b.thumb_url,q.appendChild(n),e.classList.add("has-thumb"),b.video_html&&(q.dataset.video=b.video_html)):q.classList.add("hidden");l.className="chatmsg-attachment-content";n=a.w(b.text||"");k.className="chatmsg-attachment-text";n&&""!=n?k.innerHTML=n:k.classList.add("hidden");l.appendChild(q);l.appendChild(k);b.geo&&(k=yb(b.geo))&&l.appendChild(k);u.className="chatmsg-attachment-img";b.image_url?
-u.src=b.image_url:u.classList.add("hidden");w.className="chatmsg-attachment-footer";b.footer&&(k=document.createElement("span"),k.className="chatmsg-attachment-footer-text",k.innerHTML=a.w(b.footer),b.footer_icon&&(q=document.createElement("img"),q.src=b.footer_icon,q.className="chatmsg-attachment-footer-icon",w.appendChild(q)),w.appendChild(k));b.ts&&(k=document.createElement("span"),k.className="chatmsg-ts",k.innerHTML=J.L(b.ts),w.appendChild(k));e.appendChild(g);e.appendChild(h);e.appendChild(l);
-e.appendChild(u);if(b.fields&&b.fields.length){var r=document.createElement("ul");e.appendChild(r);r.className="chatmsg-attachment-fields";b.fields.forEach(function(b){var c=b.title||"",d=b.value||"";b=!!b["short"];var e=document.createElement("li"),f=document.createElement("div"),g=document.createElement("div");e.className="field";b||e.classList.add("field-long");f.className="field-title";f.textContent=c;g.className="field-text";g.innerHTML=a.w(d);e.appendChild(f);e.appendChild(g);e&&r.appendChild(e)})}if(b.actions&&
-b.actions.length)for(g=document.createElement("ul"),g.className="chatmsg-attachment-actions "+Ha,e.appendChild(g),h=0,l=b.actions.length;h<l;h++)(u=b.actions[h])&&(u=Cb(c,h,u))&&g.appendChild(u);e.appendChild(w);d.appendChild(f);d.appendChild(e);return d}
+function Bb(a,b,c){var d=document.createElement("li"),e=document.createElement("div"),f=document.createElement("div"),g=document.createElement("a"),h=document.createElement("div"),l=document.createElement("img"),n=document.createElement("a"),m=document.createElement("div"),k=document.createElement("div"),q=document.createElement("div"),t=document.createElement("img"),w=document.createElement("div");d.className="chatmsg-attachment";e.style.borderColor=Ab(b.color||"");e.className="chatmsg-attachment-block";
+f.className="chatmsg-attachment-pretext";b.pretext?f.innerHTML=a.w(b.pretext):f.classList.add("hidden");g.target="_blank";b.title?(g.innerHTML=a.w(b.title),b.title_link&&(g.href=b.title_link),g.className="chatmsg-attachment-title"):g.className="hidden chatmsg-attachment-title";n.target="_blank";h.className="chatmsg-author";b.author_name&&(n.innerHTML=a.w(b.author_name),n.href=b.author_link||"",n.className="chatmsg-author-name",l.className="chatmsg-author-img",b.author_icon&&(l.src=b.author_icon,h.appendChild(l)),
+h.appendChild(n));q.className="chatmsg-attachment-thumb";b.thumb_url?(l=document.createElement("img"),l.src=b.thumb_url,q.appendChild(l),e.classList.add("has-thumb"),b.video_html&&(q.dataset.video=b.video_html)):q.classList.add("hidden");m.className="chatmsg-attachment-content";l=a.w(b.text||"");k.className="chatmsg-attachment-text";l&&""!=l?k.innerHTML=l:k.classList.add("hidden");m.appendChild(q);m.appendChild(k);b.geo&&(k=yb(b.geo))&&m.appendChild(k);t.className="chatmsg-attachment-img";b.image_url?
+t.src=b.image_url:t.classList.add("hidden");w.className="chatmsg-attachment-footer";b.footer&&(k=document.createElement("span"),k.className="chatmsg-attachment-footer-text",k.innerHTML=a.w(b.footer),b.footer_icon&&(q=document.createElement("img"),q.src=b.footer_icon,q.className="chatmsg-attachment-footer-icon",w.appendChild(q)),w.appendChild(k));b.ts&&(k=document.createElement("span"),k.className="chatmsg-ts",k.innerHTML=K.N(b.ts),w.appendChild(k));e.appendChild(g);e.appendChild(h);e.appendChild(m);
+e.appendChild(t);if(b.fields&&b.fields.length){var x=document.createElement("ul");e.appendChild(x);x.className="chatmsg-attachment-fields";b.fields.forEach(function(b){var c=b.title||"",d=b.value||"";b=!!b["short"];var e=document.createElement("li"),f=document.createElement("div"),g=document.createElement("div");e.className="field";b||e.classList.add("field-long");f.className="field-title";f.textContent=c;g.className="field-text";g.innerHTML=a.w(d);e.appendChild(f);e.appendChild(g);e&&x.appendChild(e)})}if(b.actions&&
+b.actions.length)for(g=document.createElement("ul"),g.className="chatmsg-attachment-actions "+Ha,e.appendChild(g),h=0,m=b.actions.length;h<m;h++)(t=b.actions[h])&&(t=Cb(c,h,t))&&g.appendChild(t);e.appendChild(w);d.appendChild(f);d.appendChild(e);return d}
 function Cb(a,b,c){var d=document.createElement("li"),e=Ab(c.style);d.textContent=c.text;e!==Ab()&&(d.style.color=e);d.style.borderColor=e;d.dataset.attachmentIndex=a;d.dataset.actionIndex=b;d.className="chatmsg-attachment-actions-item "+Fa;return d}function Xa(a){var b=document.createElement("li"),c=document.createElement("span");c.textContent=a.getName();b.appendChild(Qa());b.appendChild(c);return b}
 function vb(a){var b=document.createElement("lh");b.textContent=a;b.className="chat-command-header";return b}
-function wb(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("span"),e=document.createElement("span");c.textContent=a.name;d.textContent=a.usage;e.textContent=a.a;b.appendChild(c);b.appendChild(d);b.appendChild(e);b.className="chat-command-item";c.className="chat-command-name";d.className="chat-command-usage";e.className="chat-command-desc";return b};var hb=function(){function a(a,b){for(a=a.target;a!==m&&a&&"LI"!==a.nodeName;)a=a.parentElement;a&&"LI"===a.nodeName&&a.id&&"emojibar-"===a.id.substr(0,9)?b(a.id.substr(9)):b(null)}function b(){r={};k.textContent="";window.emojiProviderHeader&&(k.appendChild(h(window.emojiProviderHeader)),q.textContent="",k.appendChild(q));k.appendChild(h("emojicustom.png"));k.appendChild(u)}function c(){if(!d())return!1;N&&N(null);return!0}function d(){return m.parentElement?(m.parentElement.removeChild(l),m.parentElement.removeChild(m),
-!0):!1}function e(a){var b=0;a=void 0===a?w.value:a;if(n()){var c=0,d=window.searchEmojis(a),e=f(d,O?O.self.R.a:[]),k;for(h in r)r[h].visible&&(r[h].visible=!1,q.removeChild(r[h].c));var h=0;for(k=e.length;h<k;h++){var l=e[h].name,m=r[l];if(!m){var m=r,F=l;var C=l;var l=window.makeEmoji(d[l]),N=document.createElement("span");N.appendChild(l);N.className="emoji-medium";C=g(C,N);m=m[F]=C}m.visible||(m.visible=!0,q.appendChild(m.c));c++}b+=c}h=b;c=0;for(D in A)A[D].visible&&(A[D].visible=!1,u.removeChild(A[D].c));
-if(O){d=f(O.b.data,O?O.self.R.a:[]);var D=0;for(b=d.length;D<b;D++)F=d[D].name,""!==a&&F.substr(0,a.length)!==a||"alias:"===O.b.data[F].substr(0,6)||(e=A[F],e||(e=A,m=k=F,F=O.b.data[F],C=document.createElement("span"),l=document.createElement("span"),C.className="emoji emoji-custom",C.style.backgroundImage='url("'+F+'")',l.appendChild(C),l.className="emoji-medium",m=g(m,l),e=e[k]=m),e.visible||(e.visible=!0,u.appendChild(e.c)),c++);D=c}else D=0;return h+D}function f(a,b){var c=[],d;for(d in a){var e=
-{name:d,Za:0,count:0};if(a[d].names)for(var f=0,g=a[d].names.length;f<g;f++)e.count+=b[a[d].names[f]]||0;c.push(e)}return c=c.sort(function(a,b){var c=b.count-a.count;return c?c:a.Za-b.Za})}function g(a,b){var c=document.createElement("li");c.appendChild(b);c.className="emojibar-list-item";c.id="emojibar-"+a;return{visible:!1,c:c}}function h(a){var b=document.createElement("img"),c=document.createElement("div");b.src=a;c.appendChild(b);c.className="emojibar-header";return c}function n(){return"searchEmojis"in
-window}var m=document.createElement("div"),l=document.createElement("div"),k=document.createElement("div"),q=document.createElement("ul"),u=document.createElement("ul"),w=document.createElement("input"),r={},A={},M=document.createElement("div"),C=document.createElement("span"),D=document.createElement("span"),N,O;l.addEventListener("click",function(a){var b=m.getBoundingClientRect();(a.screenY<b.top||a.screenY>b.bottom||a.screenX<b.left||a.screenX>b.right)&&c()});l.className="emojibar-overlay";m.className=
-"emojibar";k.className="emojibar-emojis";q.className=u.className="emojibar-list";w.className="emojibar-search";M.className="emojibar-detail";C.className="emojibar-detail-img";D.className="emojibar-detail-name";M.appendChild(C);M.appendChild(D);b();m.appendChild(k);m.appendChild(M);m.appendChild(w);w.addEventListener("keyup",function(){e()});m.addEventListener("mousemove",function(b){a(b,function(a){var b=a?r[a]||A[a]:null;b?(C.innerHTML=b.c.outerHTML,D.textContent=":"+a+":"):(C.textContent="",D.textContent=
-"")})});m.addEventListener("click",function(b){a(b,function(a){a&&d()&&N&&N(a)})});return{isSupported:n,ia:function(a,b,c){return n()?(O=b,N=c,a.appendChild(l),a.appendChild(m),w.value="",e(),w.focus(),!0):!1},search:e,close:c,reset:function(){b();e()}}}();var E,L=[];function Db(){da.call(this)}Db.prototype=Object.create(da.prototype);Db.prototype.constructor=Db;function qa(a){return a.a?a.a.id:null}function Eb(){this.b=0;this.context=new oa;this.a={}}
-Eb.prototype.update=function(a){var b=Date.now();a.v&&(this.b=a.v);if(a["static"])for(e in a["static"]){var c=pa(this.context,e);c||(c=new Db,this.context.push(c));ga(c,a["static"][e],b)}ra(this.context,function(a){a.P===a.C&&(a=L.indexOf(a),-1!==a&&L.splice(a,1))});if(a.live){for(e in a.live)(c=this.a[e])?ka(c,a.live[e],b):c=this.a[e]=new Y(e,250,a.live[e],b);for(var d in a.live){var e=G(this.context,d);(c=e.l[d])?(this.a[d].a.length&&(c.P=Math.max(c.P,ma(this.a[d]).m)),c.ca||(Fb(e,c,a.live[d]),
-K&&a.live[K.id]&&R())):E.b=0}}a["static"]&&Pa();var f=!1;a.typing&&this.context.a.forEach(function(c){var d=f,e=a.typing,g=!1;if(c.u)for(var l in c.u)e[l]||(delete c.u[l],g=!0);if(e)for(l in e)if(c.l[l]){c.u[l]||(c.u[l]={});for(var k in e[l])c.u[l][k]||(g=!0),c.u[l][k]=b}f=d|g},this);(a["static"]||f)&&Va();a.config&&(Gb=new Hb(a.config),Ib()&&qb.qb(!1).display(qb.nb.S),Jb());if(Q&&K&&a["static"]&&a["static"][Q.a.id]&&a["static"][Q.a.id].channels&&a["static"][Q.a.id].channels)for(d=a["static"][Q.a.id].channels,
-e=0,c=d.length;e<c;e++)if(d[e].id===K.id){R();break}};setInterval(function(){var a=!1,b=Date.now();sa(function(c){var d=!1,e;for(e in c.u){var f=!0,g;for(g in c.u[e])c.u[e][g]+3E3<b?(delete c.u[e][g],d=!0):f=!1;f&&(delete c.u[e],d=!0)}d&&(a=!0)});a&&Va()},1E3);
-function Fb(a,b,c){if(b!==K||!window.hasFocus){var d=new RegExp("<@"+a.self.id),e=!1,f=!1,g=!1;c.forEach(function(c){if(!(parseFloat(c.ts)<=b.C)){f=!0;var h;if(!(h=b instanceof t)&&(h=c.text)&&!(h=c.text.match(d)))a:{h=a.self.R.B;for(var m=0,l=h.length;m<l;m++)if(-1!==c.text.indexOf(h[m])){h=!0;break a}h=!1}h&&(-1===L.indexOf(b)&&(g=!0,L.push(b)),e=!0)}});if(f){P();if(c=document.getElementById("room_"+b.id))c.classList.add("unread"),e&&c.classList.add("unreadHi");g&&!window.hasFocus&&eb()}}}
-function $a(){var a=K,b=L.indexOf(a);if(a.P>a.C){var c=E.a[a.id];if(c&&(c=c.a[c.a.length-1])){var d=new XMLHttpRequest;d.open("POST","api/markread?room="+a.id+"&id="+c.id+"&ts="+c.m,!0);d.send(null);a.C=c.m}}0<=b&&(L.splice(b,1),P());a=document.getElementById("room_"+a.id);a.classList.remove("unread");a.classList.remove("unreadHi")}E=new Eb;var Ua=function(){function a(a,c){c.sort(function(){return Math.random()-.5});for(var d=0,e=20;e<m-40;e+=k)for(var f=0;f+k<=l;f+=k)g(a,c[d],e,f),d++,d===c.length&&(c.sort(b),d=0)}function b(a,b){return a.O?b.O?Math.random()-.5:-1:1}function c(a,b){for(var e=0,f=a.length;e<f;e++)if(void 0===a[e].O){d(a[e].src,function(d){a[e].O=d;c(a,b)});return}var g=[];a.forEach(function(a){a.O&&g.push(a.O)});b(g)}function d(a,b){var c=new XMLHttpRequest;c.responseType="blob";c.onreadystatechange=function(){if(4===
+function wb(a){var b=document.createElement("li"),c=document.createElement("span"),d=document.createElement("span"),e=document.createElement("span");c.textContent=a.name;d.textContent=a.usage;e.textContent=a.a;b.appendChild(c);b.appendChild(d);b.appendChild(e);b.className="chat-command-item";c.className="chat-command-name";d.className="chat-command-usage";e.className="chat-command-desc";return b};var hb=function(){function a(a,b){for(a=a.target;a!==n&&a&&"LI"!==a.nodeName;)a=a.parentElement;a&&"LI"===a.nodeName&&a.id&&"emojibar-"===a.id.substr(0,9)?b(a.id.substr(9)):b(null)}function b(){x={};k.textContent="";window.emojiProviderHeader&&(k.appendChild(h(window.emojiProviderHeader)),q.textContent="",k.appendChild(q));k.appendChild(h("emojicustom.png"));k.appendChild(t)}function c(){if(!d())return!1;D&&D(null);return!0}function d(){return n.parentElement?(n.parentElement.removeChild(m),n.parentElement.removeChild(n),
+!0):!1}function e(a){var b=0;a=void 0===a?w.value:a;if(l()){var c=0,d=window.searchEmojis(a),e=f(d,N?N.self.R.a:[]),m;for(h in x)x[h].visible&&(x[h].visible=!1,q.removeChild(x[h].c));var h=0;for(m=e.length;h<m;h++){var k=e[h].name,r=x[k];if(!r){var r=x,G=k;var n=k;var k=window.makeEmoji(d[k]),R=document.createElement("span");R.appendChild(k);R.className="emoji-medium";n=g(n,R);r=r[G]=n}r.visible||(r.visible=!0,q.appendChild(r.c));c++}b+=c}h=b;c=0;for(D in A)A[D].visible&&(A[D].visible=!1,t.removeChild(A[D].c));
+if(N){d=f(N.b.data,N?N.self.R.a:[]);var D=0;for(b=d.length;D<b;D++)G=d[D].name,""!==a&&G.substr(0,a.length)!==a||"alias:"===N.b.data[G].substr(0,6)||(e=A[G],e||(e=A,r=m=G,G=N.b.data[G],n=document.createElement("span"),k=document.createElement("span"),n.className="emoji emoji-custom",n.style.backgroundImage='url("'+G+'")',k.appendChild(n),k.className="emoji-medium",r=g(r,k),e=e[m]=r),e.visible||(e.visible=!0,t.appendChild(e.c)),c++);D=c}else D=0;return h+D}function f(a,b){var c=[],d;for(d in a){var e=
+{name:d,ab:0,count:0};if(a[d].names)for(var f=0,g=a[d].names.length;f<g;f++)e.count+=b[a[d].names[f]]||0;c.push(e)}return c=c.sort(function(a,b){var c=b.count-a.count;return c?c:a.ab-b.ab})}function g(a,b){var c=document.createElement("li");c.appendChild(b);c.className="emojibar-list-item";c.id="emojibar-"+a;return{visible:!1,c:c}}function h(a){var b=document.createElement("img"),c=document.createElement("div");b.src=a;c.appendChild(b);c.className="emojibar-header";return c}function l(){return"searchEmojis"in
+window}var n=document.createElement("div"),m=document.createElement("div"),k=document.createElement("div"),q=document.createElement("ul"),t=document.createElement("ul"),w=document.createElement("input"),x={},A={},J=document.createElement("div"),r=document.createElement("span"),R=document.createElement("span"),D,N;m.addEventListener("click",function(a){var b=n.getBoundingClientRect();(a.screenY<b.top||a.screenY>b.bottom||a.screenX<b.left||a.screenX>b.right)&&c()});m.className="emojibar-overlay";n.className=
+"emojibar";k.className="emojibar-emojis";q.className=t.className="emojibar-list";w.className="emojibar-search";J.className="emojibar-detail";r.className="emojibar-detail-img";R.className="emojibar-detail-name";J.appendChild(r);J.appendChild(R);b();n.appendChild(k);n.appendChild(J);n.appendChild(w);w.addEventListener("keyup",function(){e()});n.addEventListener("mousemove",function(b){a(b,function(a){var b=a?x[a]||A[a]:null;b?(r.innerHTML=b.c.outerHTML,R.textContent=":"+a+":"):(r.textContent="",R.textContent=
+"")})});n.addEventListener("click",function(b){a(b,function(a){a&&d()&&D&&D(a)})});return{isSupported:l,ja:function(a,b,c){return l()?(N=b,D=c,a.appendChild(m),a.appendChild(n),w.value="",e(),w.focus(),!0):!1},search:e,close:c,reset:function(){b();e()}}}();var E,M=[];function Db(){da.call(this)}Db.prototype=Object.create(da.prototype);Db.prototype.constructor=Db;function qa(a){return a.a?a.a.id:null}function Eb(){this.b=0;this.context=new oa;this.a={}}
+Eb.prototype.update=function(a){var b=Date.now();a.v&&(this.b=a.v);if(a["static"])for(l in a["static"]){var c=pa(this.context,l);c||(c=new Db,this.context.push(c));var d={};a["static"][l].channels&&a["static"][l].channels.forEach(function(a){a.pins&&(d[a.id]=a.pins,a.pins=void 0)});ga(c,a["static"][l],b);for(var e in d){var f=[],g=this.a[e];g||(g=this.a[e]=new Y(e,250,null,b));d[e].forEach(function(a){f.push(g.b(a,b))});c.l[e].h=f}}ra(this.context,function(a){a.P===a.C&&(a=M.indexOf(a),-1!==a&&M.splice(a,
+1))});if(a.live){for(l in a.live)(c=this.a[l])?ka(c,a.live[l],b):c=this.a[l]=new Y(l,250,a.live[l],b);for(var h in a.live){var l=F(this.context,h);(c=l.l[h])?(this.a[h].a.length&&(c.P=Math.max(c.P,ma(this.a[h]).m)),c.da||(Fb(l,c,a.live[h]),L&&a.live[L.id]&&Q())):E.b=0}}a["static"]&&Pa();var n=!1;a.typing&&this.context.a.forEach(function(c){var d=n,e=a.typing,f=!1;if(c.u)for(var g in c.u)e[g]||(delete c.u[g],f=!0);if(e)for(g in e)if(c.l[g]){c.u[g]||(c.u[g]={});for(var h in e[g])c.u[g][h]||(f=!0),c.u[g][h]=
+b}n=d|f},this);(a["static"]||n)&&Va();a.config&&(Gb=new Hb(a.config),Ib()&&qb.sb(!1).display(qb.pb.S),Jb());if(P&&L&&a["static"]&&a["static"][P.a.id]&&a["static"][P.a.id].channels&&a["static"][P.a.id].channels)for(h=a["static"][P.a.id].channels,l=0,c=h.length;l<c;l++)if(h[l].id===L.id){Q();break}};
+setInterval(function(){var a=!1,b=Date.now();sa(function(c){var d=!1,e;for(e in c.u){var f=!0,g;for(g in c.u[e])c.u[e][g]+3E3<b?(delete c.u[e][g],d=!0):f=!1;f&&(delete c.u[e],d=!0)}d&&(a=!0)});a&&Va()},1E3);
+function Fb(a,b,c){if(b!==L||!window.hasFocus){var d=new RegExp("<@"+a.self.id),e=!1,f=!1,g=!1;c.forEach(function(c){if(!(parseFloat(c.ts)<=b.C)){f=!0;var h;if(!(h=b instanceof u)&&(h=c.text)&&!(h=c.text.match(d)))a:{h=a.self.R.B;for(var n=0,m=h.length;n<m;n++)if(-1!==c.text.indexOf(h[n])){h=!0;break a}h=!1}h&&(-1===M.indexOf(b)&&(g=!0,M.push(b)),e=!0)}});if(f){O();if(c=document.getElementById("room_"+b.id))c.classList.add("unread"),e&&c.classList.add("unreadHi");g&&!window.hasFocus&&eb()}}}
+function $a(){var a=L,b=M.indexOf(a);if(a.P>a.C){var c=E.a[a.id];if(c&&(c=c.a[c.a.length-1])){var d=new XMLHttpRequest;d.open("POST","api/markread?room="+a.id+"&id="+c.id+"&ts="+c.m,!0);d.send(null);a.C=c.m}}0<=b&&(M.splice(b,1),O());a=document.getElementById("room_"+a.id);a.classList.remove("unread");a.classList.remove("unreadHi")}E=new Eb;var Ua=function(){function a(a,c){c.sort(function(){return Math.random()-.5});for(var d=0,e=20;e<n-40;e+=k)for(var f=0;f+k<=m;f+=k)g(a,c[d],e,f),d++,d===c.length&&(c.sort(b),d=0)}function b(a,b){return a.O?b.O?Math.random()-.5:-1:1}function c(a,b){for(var e=0,f=a.length;e<f;e++)if(void 0===a[e].O){d(a[e].src,function(d){a[e].O=d;c(a,b)});return}var g=[];a.forEach(function(a){a.O&&g.push(a.O)});b(g)}function d(a,b){var c=new XMLHttpRequest;c.responseType="blob";c.onreadystatechange=function(){if(4===
 c.readyState)if(c.response){var a=new Image;a.onload=function(){var c=document.createElement("canvas");c.height=c.width=w;c=c.getContext("2d");c.drawImage(a,0,0,w,w);var c=c.getImageData(0,0,w,w),d=0,e;for(e=0;e<c.width*c.height*4;e+=4)c.data[e]=c.data[e+1]=c.data[e+2]=(c.data[e]+c.data[e+1]+c.data[e+2])/3,c.data[e+3]=50,d+=c.data[e];if(50>d/(c.height*c.width))for(e=0;e<c.width*c.height*4;e+=4)c.data[e]=c.data[e+1]=c.data[e+2]=255-c.data[e];b(c)};a.onerror=function(){b(null)};a.src=window.URL.createObjectURL(c.response)}else b(null)};
-c.open("GET",a,!0);c.send(null)}function e(){var a=n.createLinearGradient(0,0,0,l);a.addColorStop(0,"#4D394B");a.addColorStop(1,"#201820");n.fillStyle=a;n.fillRect(0,0,m,l);return n.getImageData(0,0,m,l)}function f(a,b){for(var c=(a.height-b.height)/2,d=0;d<b.height;d++)for(var e=0;e<b.width;e++){var f=b.data[4*(d*b.width+e)]/255,g=4*((d+c)*a.width+e+c);a.data[g]*=f;a.data[g+1]*=f;a.data[g+2]*=f}return a}function g(a,b,c,d){var e=Math.floor(d);a=[a.data[e*m*4+0],a.data[e*m*4+1],a.data[e*m*4+2]];n.fillStyle=
-"#"+(1.1*a[0]<<16|1.1*a[1]<<8|1.1*a[2]).toString(16);n.beginPath();n.moveTo(c+k/2,d+q);n.lineTo(c-q+k,d+k/2);n.lineTo(c+k/2,d-q+k);n.lineTo(c+q,d+k/2);n.closePath();n.fill();n.putImageData(f(n.getImageData(c+q,d+q,u,u),b),c+q,d+q)}var h=document.createElement("canvas"),n=h.getContext("2d"),m=h.width=250,l=h.height=290,k=(m-40)/3,q=.1*k,u=Math.floor(k-2*q),w=.5*u,r={},A={},M={};return function(b,d,f){if(r[b])f(r[b]);else if(M[b])A[b]?A[b].push(f):A[b]=[f];else{var g=e(),k=[];M[b]=!0;A[b]?A[b].push(f):
-A[b]=[f];for(var l in d)d[l].Oa||d[l].kb||k.push({src:"api/avatar?user="+d[l].id});c(k,function(c){a(g,c);r[b]=h.toDataURL();A[b].forEach(function(a){a(r[b])})})}}}();var W=0,K=null,Q=null,T=null,V=null;function pb(){var a=new XMLHttpRequest;a.timeout=6E4;a.onreadystatechange=function(){if(4===a.readyState){var b=document.createElement("script"),c=document.createElement("link");b.innerHTML=a.response;b.language="text/javascript";c.href="hljs-androidstudio.css";c.rel="stylesheet";document.head.appendChild(c);document.body.appendChild(b)}};a.open("GET","highlight.pack.js",!0);a.send(null)}
-function Kb(){var a=K,b=new XMLHttpRequest;b.open("GET","api/hist?room="+a.id,!0);b.onreadystatechange=function(){if(4===b.readyState&&b.response){var c=b.response;try{c=JSON.parse(c)}catch(e){}var d=E.a[a.id];d?d=!!ka(d,c,Date.now()):(E.a[a.id]=new Y(a,100,c,Date.now()),d=!0);d&&(Fb(G(E.context,a.id),a,c),a===K&&R())}};b.send(null)}
-function Lb(a){var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState)if(b.status){var c=null,d=2===Math.floor(b.status/100);if(d){W&&(W=0,Ya(!0));c=b.response;try{c=JSON.parse(c)}catch(e){c=null}}else W?(W+=Math.floor((W||5)/2),W=Math.min(60,W)):(W=5,Ya(!1));a(d,c)}else W&&(W=0,Ya(!0)),Lb(a)};b.open("GET","api?v="+E.b,!0);b.send(null)}function tb(){var a=new XMLHttpRequest;a.open("POST","api/typing?room="+K.id,!0);a.send(null)}
+c.open("GET",a,!0);c.send(null)}function e(){var a=l.createLinearGradient(0,0,0,m);a.addColorStop(0,"#4D394B");a.addColorStop(1,"#201820");l.fillStyle=a;l.fillRect(0,0,n,m);return l.getImageData(0,0,n,m)}function f(a,b){for(var c=(a.height-b.height)/2,d=0;d<b.height;d++)for(var e=0;e<b.width;e++){var f=b.data[4*(d*b.width+e)]/255,g=4*((d+c)*a.width+e+c);a.data[g]*=f;a.data[g+1]*=f;a.data[g+2]*=f}return a}function g(a,b,c,d){var e=Math.floor(d);a=[a.data[e*n*4+0],a.data[e*n*4+1],a.data[e*n*4+2]];l.fillStyle=
+"#"+(1.1*a[0]<<16|1.1*a[1]<<8|1.1*a[2]).toString(16);l.beginPath();l.moveTo(c+k/2,d+q);l.lineTo(c-q+k,d+k/2);l.lineTo(c+k/2,d-q+k);l.lineTo(c+q,d+k/2);l.closePath();l.fill();l.putImageData(f(l.getImageData(c+q,d+q,t,t),b),c+q,d+q)}var h=document.createElement("canvas"),l=h.getContext("2d"),n=h.width=250,m=h.height=290,k=(n-40)/3,q=.1*k,t=Math.floor(k-2*q),w=.5*t,x={},A={},J={};return function(b,d,f){if(x[b])f(x[b]);else if(J[b])A[b]?A[b].push(f):A[b]=[f];else{var g=e(),k=[];J[b]=!0;A[b]?A[b].push(f):
+A[b]=[f];for(var l in d)d[l].Oa||d[l].mb||k.push({src:"api/avatar?user="+d[l].id});c(k,function(c){a(g,c);x[b]=h.toDataURL();A[b].forEach(function(a){a(x[b])})})}}}();var W=0,L=null,P=null,T=null,V=null;function pb(){var a=new XMLHttpRequest;a.timeout=6E4;a.onreadystatechange=function(){if(4===a.readyState){var b=document.createElement("script"),c=document.createElement("link");b.innerHTML=a.response;b.language="text/javascript";c.href="hljs-androidstudio.css";c.rel="stylesheet";document.head.appendChild(c);document.body.appendChild(b)}};a.open("GET","highlight.pack.js",!0);a.send(null)}
+function Kb(){var a=L,b=new XMLHttpRequest;b.open("GET","api/hist?room="+a.id,!0);b.onreadystatechange=function(){if(4===b.readyState&&b.response){var c=b.response;try{c=JSON.parse(c)}catch(e){}var d=E.a[a.id];d?d=!!ka(d,c,Date.now()):(E.a[a.id]=new Y(a,100,c,Date.now()),d=!0);d&&(Fb(F(E.context,a.id),a,c),a===L&&Q())}};b.send(null)}
+function Lb(a){var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState)if(b.status){var c=null,d=2===Math.floor(b.status/100);if(d){W&&(W=0,Ya(!0));c=b.response;try{c=JSON.parse(c)}catch(e){c=null}}else W?(W+=Math.floor((W||5)/2),W=Math.min(60,W)):(W=5,Ya(!1));a(d,c)}else W&&(W=0,Ya(!0)),Lb(a)};b.open("GET","api?v="+E.b,!0);b.send(null)}function tb(){var a=new XMLHttpRequest;a.open("POST","api/typing?room="+L.id,!0);a.send(null)}
 function Mb(a,b){a?(b&&E.update(b),xb()):setTimeout(xb,1E3*W)}function xb(){Lb(Mb)}
-function Nb(a){K&&(document.getElementById("room_"+K.id).classList.remove("selected"),document.getElementById("chatSystemContainer").classList.add("no-room-selected"));document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");K=a;Q=G(E.context,a.id);Za();X.ta();Ua(Q.a.id,Q.j,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"});(!E.a[K.id]||100>E.a[K.id].a.length)&&Kb();document.getElementById("chatSystemContainer").classList.remove("no-room-selected")}
-function Ta(){var a=document.location.hash.substr(1),b=ta(a);b&&b!==K?Nb(b):(a=H(a))&&a.V&&Nb(a.V)}function rb(a,b,c){var d=K;new FileReader;var e=new FormData,f=new XMLHttpRequest;e.append("file",b);e.append("filename",a);f.onreadystatechange=function(){4===f.readyState&&(204===f.status?c(null):c(f.statusText))};f.open("POST","api/file?room="+d.id);f.send(e)}
-function Ob(a,b,c){var d=new XMLHttpRequest;b="api/msg?room="+a.id+"&text="+encodeURIComponent(b);c&&(b+="&attachments="+encodeURIComponent(JSON.stringify([{fallback:c.text,author_name:H(c.J).getName(),text:c.text,footer:a.b?J.message:a.name,ts:c.m}])));d.open("POST",b,!0);d.send(null)}
-function sb(a){if(V){var b=new XMLHttpRequest;b.open("PUT","api/msg?room="+K.id+"&ts="+V.id+"&text="+encodeURIComponent(a),!0);b.send(null);return!0}if("/"===a[0]){var c=a.indexOf(" "),b=a.substr(0,-1===c?void 0:c);a=-1===c?"":a.substr(c);var c=Q,d=ub.Ra(b);return d?(d.exec(c,K,a.trim()),!0):c&&(b=c.i.data[b])?(c=new XMLHttpRequest,c.open("POST","api/cmd?room="+K.id+"&cmd="+encodeURIComponent(b.name.substr(1))+"&args="+encodeURIComponent(a.trim()),!0),c.send(null),!0):!1}Ob(K,a,T);return!0}
-function mb(a){var b=new XMLHttpRequest;b.open("DELETE","api/msg?room="+K.id+"&ts="+a.id,!0);b.send(null)}function lb(a){var b=new XMLHttpRequest;b.open("POST","api/pinMsg?room="+K.id+"&msgId="+a.id,!0);b.send(null)}function jb(a){var b=new XMLHttpRequest;b.open("POST","api/starMsg?room="+K.id+"&msgId="+a.id,!0);b.send(null)}function kb(a){var b=new XMLHttpRequest;b.open("DELETE","api/pinMsg?room="+K.id+"&msgId="+a.id,!0);b.send(null)}
-function ib(a){var b=new XMLHttpRequest;b.open("DELETE","api/starMsg?room="+K.id+"&msgId="+a.id,!0);b.send(null)}function bb(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)}
-function Sa(){var a={},b=[],c=this.value;ra(E.context,function(b){a[b.id]=ia(b,c)});for(var d in a){var e=document.getElementById("room_"+d);e&&(a[d].name+a[d].mb+a[d].ka+a[d].ha?(e.classList.remove("hidden"),b.push(d)):e.classList.add("hidden"))}};var Pb={emojione_v2_3:{Ta:"emojione_v2.3.sprites.js",Na:"emojione_v2.3.sprites.css",name:"Emojione v2.3"},emojione_v3:{Ta:"emojione_v3.sprites.js",Na:"emojione_v3.sprites.css",name:"Emojione v3"}},Qb=Pb.emojione_v2_3,Rb;
-function Sb(a){if(Rb!==a){console.log("Loading emoji pack "+a.name);var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState){var c=document.createElement("script"),d=document.createElement("link");c.innerHTML=b.response;c.language="text/javascript";d.href=a.Na;d.rel="stylesheet";document.head.appendChild(d);document.body.appendChild(c);for(var e in E.a)Tb(E.a[e]);K&&R();hb.reset()}};b.open("GET",a.Ta,!0);b.send(null);Rb=a}}
-function Jb(){a:{var a=Gb;for(var b in a.S){var c=a.S[b].emojiProvider;if(c&&Pb[c]){a=c;break a}}a=void 0}Sb(a&&Pb[a]?Pb[a]:Qb)};var X=function(){function a(){d.textContent=r.name;if(r instanceof t)c.style.backgroundImage="url(api/avatar?size=l&user="+r.a.id+")",g.textContent=(r.a.ab||(r.a.Qa||"")+" "+r.a.Ua).trim(),d.classList.add("presence-indicator"),r.a.wa?d.classList.remove("presence-away"):d.classList.add("presence-away"),f.classList.remove("hidden"),n.classList.remove("hidden"),n.textContent=r.a.ob||"",l.textContent=r.a.ib||"",m.classList.remove("hidden"),q.classList.add("hidden"),u.classList.add("hidden"),b.classList.remove("roominfo-channel"),
-b.classList.add("roominfo-user");else{var a=w;a.Y.topic?(f.classList.remove("hidden"),g.textContent=r.ka||"",h.textContent=r.o?J.za(r.o,r.ba):""):f.classList.add("hidden");a.Y.purpose?(m.classList.remove("hidden"),l.textContent=r.ha||"",k.textContent=r.i?J.za(r.i,r.$):""):m.classList.add("hidden");c.style.backgroundImage="";d.classList.remove("presence-indicator");q.classList.remove("hidden");u.classList.remove("hidden");b.classList.add("roominfo-channel");b.classList.remove("roominfo-user")}}var b=
-document.createElement("div"),c=document.createElement("header"),d=document.createElement("h3"),e=document.createElement("div"),f=document.createElement("div"),g=document.createElement("span"),h=document.createElement("span"),n=document.createElement("div"),m=document.createElement("div"),l=document.createElement("span"),k=document.createElement("span"),q=document.createElement("div"),u=document.createElement("ul"),w,r;b.className="chat-context-roominfo";c.className="roominfo-title";f.className="roominfo-topic";
-m.className="roominfo-purpose";n.className="roominfo-phone";q.className="roominfo-usercount";u.className="roominfo-userlist";k.className=h.className="roominfo-author";c.appendChild(d);b.appendChild(c);b.appendChild(e);f.appendChild(g);f.appendChild(h);m.appendChild(l);m.appendChild(k);e.appendChild(f);e.appendChild(n);e.appendChild(m);e.appendChild(q);e.appendChild(u);return{Ya:function(b,c){w=b;r=c;a();return this},update:function(){a();return this},show:function(a){a.appendChild(b);b.classList.remove("hidden");
-return this},ta:function(){b.classList.add("hidden");return this}}}();function Y(a,b,c,d){B.call(this,a,b,0,c,d)}Y.prototype=Object.create(B.prototype);Y.prototype.constructor=Y;Y.prototype.i=function(a,b){return!0===a.isMeMessage?new Ub(this.id,a,b):!0===a.isNotice?new Vb(this.id,a,b):new Wb(this.id,a,b)};function Tb(a){a.a.forEach(function(a){a.G()})}
-var Z=function(){function a(a,d){return xa(d,{B:a.context.self.R.B,Z:function(a){":"===a[0]&&":"===a[a.length-1]&&(a=a.substr(1,a.length-2));if(a=cb(a)){var b=document.createElement("span");b.className="emoji-small";b.appendChild(a);return b.outerHTML}return null},ga:function(c){return b(a,c)}})}function b(a,b){var c=b.indexOf("|");if(-1===c)var d=b;else{d=b.substr(0,c);var g=b.substr(c+1)}if("@"===d[0])if(d=qa(a.context)+"|"+d.substr(1),g=H(d))a=!0,d="#"+g.V.id,g="@"+g.getName();else return null;
-else if("#"===d[0])if(d=qa(a.context)+"|"+d.substr(1),g=ta(d))a=!0,d="#"+d,g="#"+g.name;else return null;else{if(!d.match(/^(https?|mailto):\/\//i))return null;a=!1}return{link:d,text:g||d,Sa:a}}return{G:function(a){a.T=!0;return a},W:function(a){a.c&&a.c.parentElement&&(a.c.remove(),delete a.c);return a},N:function(a){a.c?a.T&&(a.T=!1,a.I()):a.qa().I();return a.c},I:function(b){var c=H(b.J);b.c.m.innerHTML=J.L(b.m);b.c.ya.innerHTML=a(b,b.text);b.c.ra.textContent=c?c.getName():b.username||"?";for(var c=
-document.createDocumentFragment(),e=0,f=b.s.length;e<f;e++){var g=b.s[e];g&&(g=Bb(b,g,e))&&c.appendChild(g)}b.c.s.textContent="";b.c.s.appendChild(c);c=b.b;e=document.createDocumentFragment();if(b.D)for(var h in b.D){var f=c,g=b.id,n=h,m=b.D[h],l=cb(n);if(l){for(var k=document.createElement("li"),q=document.createElement("a"),u=document.createElement("span"),w=document.createElement("span"),r=[],A=0,M=m.length;A<M;A++){var C=H(m[A]);C&&r.push(C.getName())}r.sort();w.textContent=r.join(", ");u.appendChild(l);
-u.className="emoji-small";q.href="javascript:toggleReaction('"+f+"', '"+g+"', '"+n+"')";q.appendChild(u);q.appendChild(w);k.className="chatmsg-reaction-item";k.appendChild(q);f=k}else console.warn("Reaction id not found: "+n),f=null;f&&e.appendChild(f)}b.c.D.textContent="";b.c.D.appendChild(e);b.c.aa.fa&&(b.c.aa.fa.style.backgroundImage=b.A?'url("star_full.png")':'url("star_empty.png")');b.F&&(b.c.F.innerHTML=J.F(b.F),b.c.classList.add("edited"));return b},K:function(a){return a.c.cloneNode(!0)},
-w:function(b,d){return a(b,d)}}}();function Ub(a,b,c){x.call(this,b,c);this.context=G(E.context,a);this.b=a;this.c=Z.c;this.T=Z.T}Ub.prototype=Object.create(y.prototype);p=Ub.prototype;p.constructor=Ub;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){return Z.W(this)};p.N=function(){return Z.N(this)};p.qa=function(){this.c=zb(this);this.c.classList.add("chatmsg-me_message");return this};p.K=function(){return Z.K(this)};p.I=function(){Z.I(this);return this};
-p.update=function(a,b){y.prototype.update.call(this,a,b);this.G()};function Wb(a,b,c){x.call(this,b,c);this.context=G(E.context,a);this.b=a;this.c=Z.c;this.T=Z.T}Wb.prototype=Object.create(x.prototype);p=Wb.prototype;p.constructor=Wb;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){return Z.W(this)};p.N=function(){return Z.N(this)};p.qa=function(){this.c=zb(this);return this};p.K=function(){return Z.K(this)};p.I=function(){Z.I(this);return this};
-p.update=function(a,b){x.prototype.update.call(this,a,b);this.G();if(a=this.text.match(/^<?https:\/\/www\.openstreetmap\.org\/\?mlat=(-?[0-9\.]+)(&amp;|&)mlon=(-?[0-9\.]+)(&amp;|&)macc=([0-9\.]+)[^\s]*/))this.text=this.text.substr(0,a.index)+this.text.substr(a.index+a[0].length).trim(),this.s.unshift({color:"#008000",text:a[0],footer:"Open Street Map",footer_icon:"https://www.openstreetmap.org/assets/favicon-32x32-36d06d8a01933075bc7093c9631cffd02d49b03b659f767340f256bb6839d990.png",geo:{latitude:a[1],
-longitude:a[3],accuracy:a[5]}})};function Vb(a,b,c){x.call(this,b,c);this.context=G(E.context,a);this.b=a;this.a=null;this.T=!0}Vb.prototype=Object.create(z.prototype);p=Vb.prototype;p.constructor=Vb;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){this.a&&this.a.parentElement&&(this.a.remove(),delete this.a);this.c&&delete this.c;return this};p.N=function(){Z.N(this);return this.a};p.K=function(){return this.a.cloneNode(!0)};
-p.qa=function(){this.c=zb(this);this.a=document.createElement("span");this.c.classList.add("chatmsg-notice");this.a.className="chatmsg-notice";this.a.textContent=J.Xa;this.a.appendChild(this.c);return this};p.I=function(){Z.I(this);return this};p.update=function(a,b){z.prototype.update.call(this,a,b);this.G()};function Ib(){var a=Gb.S,b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0};var Gb;function Hb(a){this.S={};for(var b=0,c=a.length;b<c;b++)if(null===a[b].service&&null===a[b].device){var d=void 0,e=JSON.parse(a[b].config);if(e.services)for(d in e.services)this.S[d]=e.services[d]}};var ub=function(){var a=[];return{Ra:function(b){for(var c=0,d=a.length;c<d;c++)if(-1!==a[c].names.indexOf(b))return a[c];return null},hb:function(b){var c=[];a.forEach(function(a){for(var d=0,f=a.names.length;d<f;d++)if(a.names[d].substr(0,b.length)===b){c.push(a);break}});return c},pb:function(b){b.U="client";b.exec=b.exec.bind(b);a.push(b)}}}();function Xb(){return new Promise(function(a,b){"geolocation"in window.navigator?navigator.geolocation.getCurrentPosition(function(c){c?a(c):b("denied")}):b("geolocation not available")})}
-va.push(function(){ub.pb({name:"/sherlock",names:["/sherlock","/sharelock"],usage:"",description:J.bb,exec:function(a,b){Xb().then(function(a){var c=a.coords.latitude,e=a.coords.longitude;Ob(b,"https://www.openstreetmap.org/?mlat="+c+"&mlon="+e+"&macc="+a.coords.accuracy+"#map=17/"+c+"/"+e)}).catch(function(a){console.error("Error: ",a)})}})});
+function Nb(a){L&&(document.getElementById("room_"+L.id).classList.remove("selected"),document.getElementById("chatSystemContainer").classList.add("no-room-selected"));document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");L=a;P=F(E.context,a.id);Za();X.ua();Ua(P.a.id,P.j,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"});(!E.a[L.id]||100>E.a[L.id].a.length)&&Kb();document.getElementById("chatSystemContainer").classList.remove("no-room-selected")}
+function Ta(){var a=document.location.hash.substr(1),b=ta(a);b&&b!==L?Nb(b):(a=H(a))&&a.V&&Nb(a.V)}function rb(a,b,c){var d=L;new FileReader;var e=new FormData,f=new XMLHttpRequest;e.append("file",b);e.append("filename",a);f.onreadystatechange=function(){4===f.readyState&&(204===f.status?c(null):c(f.statusText))};f.open("POST","api/file?room="+d.id);f.send(e)}
+function Ob(a,b,c){var d=new XMLHttpRequest;b="api/msg?room="+a.id+"&text="+encodeURIComponent(b);c&&(b+="&attachments="+encodeURIComponent(JSON.stringify([{fallback:c.text,author_name:H(c.L).getName(),text:c.text,footer:a.b?K.message:a.name,ts:c.m}])));d.open("POST",b,!0);d.send(null)}
+function sb(a){if(V){var b=new XMLHttpRequest;b.open("PUT","api/msg?room="+L.id+"&ts="+V.id+"&text="+encodeURIComponent(a),!0);b.send(null);return!0}if("/"===a[0]){var c=a.indexOf(" "),b=a.substr(0,-1===c?void 0:c);a=-1===c?"":a.substr(c);var c=P,d=ub.Ra(b);return d?(d.exec(c,L,a.trim()),!0):c&&(b=c.h.data[b])?(c=new XMLHttpRequest,c.open("POST","api/cmd?room="+L.id+"&cmd="+encodeURIComponent(b.name.substr(1))+"&args="+encodeURIComponent(a.trim()),!0),c.send(null),!0):!1}Ob(L,a,T);return!0}
+function mb(a){var b=new XMLHttpRequest;b.open("DELETE","api/msg?room="+L.id+"&ts="+a.id,!0);b.send(null)}function lb(a){var b=new XMLHttpRequest;b.open("POST","api/pinMsg?room="+L.id+"&msgId="+a.id,!0);b.send(null)}function jb(a){var b=new XMLHttpRequest;b.open("POST","api/starMsg?room="+L.id+"&msgId="+a.id,!0);b.send(null)}function kb(a){var b=new XMLHttpRequest;b.open("DELETE","api/pinMsg?room="+L.id+"&msgId="+a.id,!0);b.send(null)}
+function ib(a){var b=new XMLHttpRequest;b.open("DELETE","api/starMsg?room="+L.id+"&msgId="+a.id,!0);b.send(null)}function bb(a,b,c){var d=new XMLHttpRequest;d.open("POST","api/reaction?room="+a+"&msg="+b+"&reaction="+encodeURIComponent(c),!0);d.send(null)}
+function Sa(){var a={},b=[],c=this.value;ra(E.context,function(b){a[b.id]=ia(b,c)});for(var d in a){var e=document.getElementById("room_"+d);e&&(a[d].name+a[d].ob+a[d].la+a[d].ia?(e.classList.remove("hidden"),b.push(d)):e.classList.add("hidden"))}};var Pb={emojione_v2_3:{Ua:"emojione_v2.3.sprites.js",Na:"emojione_v2.3.sprites.css",name:"Emojione v2.3"},emojione_v3:{Ua:"emojione_v3.sprites.js",Na:"emojione_v3.sprites.css",name:"Emojione v3"}},Qb=Pb.emojione_v2_3,Rb;
+function Sb(a){if(Rb!==a){console.log("Loading emoji pack "+a.name);var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState){var c=document.createElement("script"),d=document.createElement("link");c.innerHTML=b.response;c.language="text/javascript";d.href=a.Na;d.rel="stylesheet";document.head.appendChild(d);document.body.appendChild(c);for(var e in E.a)Tb(E.a[e]);L&&Q();hb.reset()}};b.open("GET",a.Ua,!0);b.send(null);Rb=a}}
+function Jb(){a:{var a=Gb;for(var b in a.S){var c=a.S[b].emojiProvider;if(c&&Pb[c]){a=c;break a}}a=void 0}Sb(a&&Pb[a]?Pb[a]:Qb)};var X=function(){function a(){b();if(r instanceof u)d.style.backgroundImage="url(api/avatar?size=l&user="+r.a.id+")",h.textContent=(r.a.cb||(r.a.Qa||"")+" "+r.a.Va).trim(),e.classList.add("presence-indicator"),r.a.wa?e.classList.remove("presence-away"):e.classList.add("presence-away"),g.classList.remove("hidden"),n.classList.remove("hidden"),n.textContent=r.a.qb||"",k.textContent=r.a.kb||"",m.classList.remove("hidden"),c.classList.remove("roominfo-channel"),c.classList.add("roominfo-user");else{var a=
+J;a.Y.topic?(g.classList.remove("hidden"),h.textContent=r.la||"",l.textContent=r.I?K.za(r.I,r.ca):""):g.classList.add("hidden");a.Y.purpose?(m.classList.remove("hidden"),k.textContent=r.ia||"",q.textContent=r.o?K.za(r.o,r.ba):""):m.classList.add("hidden");d.style.backgroundImage="";e.classList.remove("presence-indicator");c.classList.add("roominfo-channel");c.classList.remove("roominfo-user")}}function b(){e.textContent=r.name;if(r.h){t.textContent=K.Za(r.h.length);t.classList.remove("hidden");w.classList.remove("hidden");
+var a=document.createDocumentFragment();r.h.forEach(function(b){var c=document.createElement("li");c.className="roominfo-pinlist-item";c.appendChild(b.J());a.appendChild(c)});w.textContent="";w.appendChild(a)}else t.classList.add("hidden"),w.classList.add("hidden")}var c=document.createElement("div"),d=document.createElement("header"),e=document.createElement("h3"),f=document.createElement("div"),g=document.createElement("div"),h=document.createElement("span"),l=document.createElement("span"),n=document.createElement("div"),
+m=document.createElement("div"),k=document.createElement("span"),q=document.createElement("span"),t=document.createElement("div"),w=document.createElement("ul"),x=document.createElement("div"),A=document.createElement("ul"),J,r;c.className="chat-context-roominfo";d.className="roominfo-title";g.className="roominfo-topic";m.className="roominfo-purpose";n.className="roominfo-phone";t.className="roominfo-pincount";w.className="roominfo-pinlist";x.className="roominfo-usercount";A.className="roominfo-userlist";
+q.className=l.className="roominfo-author";d.appendChild(e);c.appendChild(d);c.appendChild(f);g.appendChild(h);g.appendChild(l);m.appendChild(k);m.appendChild(q);f.appendChild(g);f.appendChild(n);f.appendChild(m);f.appendChild(t);f.appendChild(w);f.appendChild(x);f.appendChild(A);return{$a:function(b,c){J=b;r=c;a();return this},update:function(){a();return this},show:function(a){a.appendChild(c);c.classList.remove("hidden");return this},ua:function(){c.classList.add("hidden");return this},Ta:function(a){for(;a;){if(a===
+c)return!0;a=a.parentNode}return!1}}}();function Y(a,b,c,d){C.call(this,a,b,0,c,d)}Y.prototype=Object.create(C.prototype);Y.prototype.constructor=Y;Y.prototype.b=function(a,b){return!0===a.isMeMessage?new Ub(this.id,a,b):!0===a.isNotice?new Vb(this.id,a,b):new Wb(this.id,a,b)};function Tb(a){a.a.forEach(function(a){a.G()})}
+var Z=function(){function a(a,d){return xa(d,{B:a.context.self.R.B,Z:function(a){":"===a[0]&&":"===a[a.length-1]&&(a=a.substr(1,a.length-2));if(a=cb(a)){var b=document.createElement("span");b.className="emoji-small";b.appendChild(a);return b.outerHTML}return null},ha:function(c){return b(a,c)}})}function b(a,b){var c=b.indexOf("|");if(-1===c)var d=b;else{d=b.substr(0,c);var g=b.substr(c+1)}if("@"===d[0])if(d=qa(a.context)+"|"+d.substr(1),g=H(d))a=!0,d="#"+g.V.id,g="@"+g.getName();else return null;
+else if("#"===d[0])if(d=qa(a.context)+"|"+d.substr(1),g=ta(d))a=!0,d="#"+d,g="#"+g.name;else return null;else{if(!d.match(/^(https?|mailto):\/\//i))return null;a=!1}return{link:d,text:g||d,Sa:a}}return{G:function(a){a.T=!0;return a},W:function(a){a.c&&a.c.parentElement&&(a.c.remove(),delete a.c);return a},J:function(a){a.c?a.T&&(a.T=!1,a.K()):a.ra().K();return a.c},K:function(b){var c=H(b.L);b.c.m.innerHTML=K.N(b.m);b.c.ya.innerHTML=a(b,b.text);b.c.sa.textContent=c?c.getName():b.username||"?";for(var c=
+document.createDocumentFragment(),e=0,f=b.s.length;e<f;e++){var g=b.s[e];g&&(g=Bb(b,g,e))&&c.appendChild(g)}b.c.s.textContent="";b.c.s.appendChild(c);c=b.b;e=document.createDocumentFragment();if(b.D)for(var h in b.D){var f=c,g=b.id,l=h,n=b.D[h],m=cb(l);if(m){for(var k=document.createElement("li"),q=document.createElement("a"),t=document.createElement("span"),w=document.createElement("span"),x=[],A=0,J=n.length;A<J;A++){var r=H(n[A]);r&&x.push(r.getName())}x.sort();w.textContent=x.join(", ");t.appendChild(m);
+t.className="emoji-small";q.href="javascript:toggleReaction('"+f+"', '"+g+"', '"+l+"')";q.appendChild(t);q.appendChild(w);k.className="chatmsg-reaction-item";k.appendChild(q);f=k}else console.warn("Reaction id not found: "+l),f=null;f&&e.appendChild(f)}b.c.D.textContent="";b.c.D.appendChild(e);b.c.aa.ga&&(b.c.aa.ga.style.backgroundImage=b.A?'url("star_full.png")':'url("star_empty.png")');b.F&&(b.c.F.innerHTML=K.F(b.F),b.c.classList.add("edited"));return b},M:function(a){return a.c.cloneNode(!0)},
+w:function(b,d){return a(b,d)}}}();function Ub(a,b,c){y.call(this,b,c);this.context=F(E.context,a);this.b=a;this.c=Z.c;this.T=Z.T}Ub.prototype=Object.create(z.prototype);p=Ub.prototype;p.constructor=Ub;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){return Z.W(this)};p.J=function(){return Z.J(this)};p.ra=function(){this.c=zb(this);this.c.classList.add("chatmsg-me_message");return this};p.M=function(){return Z.M(this)};p.K=function(){Z.K(this);return this};
+p.update=function(a,b){z.prototype.update.call(this,a,b);this.G()};function Wb(a,b,c){y.call(this,b,c);this.context=F(E.context,a);this.b=a;this.c=Z.c;this.T=Z.T}Wb.prototype=Object.create(y.prototype);p=Wb.prototype;p.constructor=Wb;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){return Z.W(this)};p.J=function(){return Z.J(this)};p.ra=function(){this.c=zb(this);return this};p.M=function(){return Z.M(this)};p.K=function(){Z.K(this);return this};
+p.update=function(a,b){y.prototype.update.call(this,a,b);this.G();if(a=this.text.match(/^<?https:\/\/www\.openstreetmap\.org\/\?mlat=(-?[0-9\.]+)(&amp;|&)mlon=(-?[0-9\.]+)(&amp;|&)macc=([0-9\.]+)[^\s]*/))this.text=this.text.substr(0,a.index)+this.text.substr(a.index+a[0].length).trim(),this.s.unshift({color:"#008000",text:a[0],footer:"Open Street Map",footer_icon:"https://www.openstreetmap.org/assets/favicon-32x32-36d06d8a01933075bc7093c9631cffd02d49b03b659f767340f256bb6839d990.png",geo:{latitude:a[1],
+longitude:a[3],accuracy:a[5]}})};function Vb(a,b,c){y.call(this,b,c);this.context=F(E.context,a);this.b=a;this.a=null;this.T=!0}Vb.prototype=Object.create(B.prototype);p=Vb.prototype;p.constructor=Vb;p.G=function(){return Z.G(this)};p.w=function(a){return Z.w(this,a)};p.W=function(){this.a&&this.a.parentElement&&(this.a.remove(),delete this.a);this.c&&delete this.c;return this};p.J=function(){Z.J(this);return this.a};p.M=function(){return this.a.cloneNode(!0)};
+p.ra=function(){this.c=zb(this);this.a=document.createElement("span");this.c.classList.add("chatmsg-notice");this.a.className="chatmsg-notice";this.a.textContent=K.Ya;this.a.appendChild(this.c);return this};p.K=function(){Z.K(this);return this};p.update=function(a,b){B.prototype.update.call(this,a,b);this.G()};function Ib(){var a=Gb.S,b;for(b in a)if(a.hasOwnProperty(b))return!1;return!0};var Gb;function Hb(a){this.S={};for(var b=0,c=a.length;b<c;b++)if(null===a[b].service&&null===a[b].device){var d=void 0,e=JSON.parse(a[b].config);if(e.services)for(d in e.services)this.S[d]=e.services[d]}};var ub=function(){var a=[];return{Ra:function(b){for(var c=0,d=a.length;c<d;c++)if(-1!==a[c].names.indexOf(b))return a[c];return null},jb:function(b){var c=[];a.forEach(function(a){for(var d=0,f=a.names.length;d<f;d++)if(a.names[d].substr(0,b.length)===b){c.push(a);break}});return c},rb:function(b){b.U="client";b.exec=b.exec.bind(b);a.push(b)}}}();function Xb(){return new Promise(function(a,b){"geolocation"in window.navigator?navigator.geolocation.getCurrentPosition(function(c){c?a(c):b("denied")}):b("geolocation not available")})}
+va.push(function(){ub.rb({name:"/sherlock",names:["/sherlock","/sharelock"],usage:"",description:K.eb,exec:function(a,b){Xb().then(function(a){var c=a.coords.latitude,e=a.coords.longitude;Ob(b,"https://www.openstreetmap.org/?mlat="+c+"&mlon="+e+"&macc="+a.coords.accuracy+"#map=17/"+c+"/"+e)}).catch(function(a){console.error("Error: ",a)})}})});
 })();

+ 6 - 4
srv/public/style.css

@@ -49,11 +49,13 @@ button, .button { border: 1px solid black; border-radius: 3px; background: rgb(2
 .chat-context .chat-context-roominfo { position: fixed; display: block; left: 235px; width: 400px; top: 0; bottom: 0; z-index: 100; background-color: #4D394B; color: white; overflow: auto; }
 .chatsystem-content .chat-context-roominfo { position: absolute; display: block; width: 400px; z-index: 100; background-color: #4D394B; color: white; overflow: auto; }
 .roominfo-title { background-position: center center; background-size: cover; padding: 250px 15px 0 15px; font-size: 1.75em; }
-.roominfo-topic,.roominfo-purpose,.roominfo-phone { margin: 20px 15px 0 15px; }
+.roominfo-topic,.roominfo-purpose,.roominfo-phone,.roominfo-pincount { margin: 20px 15px 0 15px; }
 .roominfo-topic *,.roominfo-purpose * { display: block; }
-.roominfo-author { color: #c1c1c1; }
+.roominfo-author, .chat-context-roominfo .chatmsg-author-name, .chat-context-roominfo .chatmsg-content a  { color: #c1c1c1; }
 .roominfo-channel .roominfo-phone { display: none; }
-.roominfo-user .roominfo-author { display: none; }
+.roominfo-user .roominfo-author, .roominfo-user .roominfo-usercount, .roominfo-user .roominfo-userlist { display: none; }
+.roominfo-pinlist { list-style: none; }
+.roominfo-pinlist-item:not(:first-child) { margin-top: 15px; }
 
 @media screen and (max-width: 635px) {
     .chat-context-roominfo { position: static; width: 100%; display: block; color: white; }
@@ -91,7 +93,7 @@ button, .button { border: 1px solid black; border-radius: 3px; background: rgb(2
 .chatmsg-authorGroup, .chatmsg-me_message { padding: 10px; }
 .chatmsg-authorGroup .chatmsg-item { padding: 4px 10px; }
 .chatmsg-item { display: flex; position: relative; }
-.chatmsg-item:hover { background: #F9F9F9; }
+.chatsystem-content .chatmsg-item:hover { background: #F9F9F9; }
 .chatmsg-item.chatmsg-first-unread { border-top: 1px solid rgba(255,135,109,.5); }
 .chatmsg-item.chatmsg-first-unread::before { display: inline-block; position: absolute; right: 0; top: -0.8em; content: "New"; color: rgba(255,135,109,.5); background: white; padding: 0 5px 0 3px; font-style: italic; }
 .chatmsg-content { display: inline-block; width: 100%; }

+ 12 - 2
srv/src/room.js

@@ -73,7 +73,7 @@ Room.prototype.toStatic = function(t) {
         ,"last_msg": this.lastMsg
         ,"is_private": this.isPrivate
         ,"is_starred": this.starred || undefined
-        ,"pins": this.pins
+        ,"pins": this.exposePins()
     };
     if (this.isMember) {
         res["members"] = this.users ? Object.keys(this.users) : [];
@@ -130,6 +130,16 @@ Room.prototype.update = function(chanData, ctx, t, idPrefix) {
     this.version = Math.max(this.version, t);
 };
 
+Room.prototype.exposePins = function() {
+    if (this.pins) {
+        var msgs = [];
+        this.pins.forEach(function(msg) {
+            msgs.push(msg.toStatic());
+        });
+        return msgs;
+    }
+};
+
 Room.prototype.matchString = function(str, Utils) {
     return {
         name: Utils.getClosestDistanceString(str, this.name),
@@ -168,7 +178,7 @@ PrivateMessageRoom.prototype.toStatic = function(t) {
         ,"last_msg": this.lastMsg
         ,"pv": true
         ,"is_starred": this.starred || undefined
-        ,"pins": this.pins
+        ,"pins": this.exposePins()
     };
 };