=1-t)return U[K-1];var q=W%1,ut=W|0;return H.lerp(U[ut],U[ut+1],q)}return L}(),H}(),r=function(F,L,x){return L===void 0&&(L=0),x===void 0&&(x=Math.pow(10,L)),Math.round(x*F)/x},o={grad:360/400,turn:360,rad:360/(Math.PI*2)},a=e.hexToHsva=function(){function H(F){return P(s(F))}return H}(),s=e.hexToRgba=function(){function H(F){return F[0]==="#"&&(F=F.substring(1)),F.length<6?{r:parseInt(F[0]+F[0],16),g:parseInt(F[1]+F[1],16),b:parseInt(F[2]+F[2],16),a:F.length===4?r(parseInt(F[3]+F[3],16)/255,2):1}:{r:parseInt(F.substring(0,2),16),g:parseInt(F.substring(2,4),16),b:parseInt(F.substring(4,6),16),a:F.length===8?r(parseInt(F.substring(6,8),16)/255,2):1}}return H}(),u=e.parseHue=function(){function H(F,L){return L===void 0&&(L="deg"),Number(F)*(o[L]||1)}return H}(),l=e.hslaStringToHsva=function(){function H(F){var L=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,x=L.exec(F);return x?f({h:u(x[1],x[2]),s:Number(x[3]),l:Number(x[4]),a:x[5]===void 0?1:Number(x[5])/(x[6]?100:1)}):{h:0,s:0,v:0,a:1}}return H}(),p=e.hslStringToHsva=l,f=e.hslaToHsva=function(){function H(F){var L=F.h,x=F.s,U=F.l,K=F.a;return x*=(U<50?U:100-U)/100,{h:L,s:x>0?2*x/(U+x)*100:0,v:U+x,a:K}}return H}(),i=e.hsvaToHex=function(){function H(F){return A(m(F))}return H}(),d=e.hsvaToHsla=function(){function H(F){var L=F.h,x=F.s,U=F.v,K=F.a,W=(200-x)*U/100;return{h:r(L),s:r(W>0&&W<200?x*U/100/(W<=100?W:200-W)*100:0),l:r(W/2),a:r(K,2)}}return H}(),c=e.hsvaToHslString=function(){function H(F){var L=d(F),x=L.h,U=L.s,K=L.l;return"hsl("+x+", "+U+"%, "+K+"%)"}return H}(),g=e.hsvaToHsvString=function(){function H(F){var L=M(F),x=L.h,U=L.s,K=L.v;return"hsv("+x+", "+U+"%, "+K+"%)"}return H}(),v=e.hsvaToHsvaString=function(){function H(F){var L=M(F),x=L.h,U=L.s,K=L.v,W=L.a;return"hsva("+x+", "+U+"%, "+K+"%, "+W+")"}return H}(),h=e.hsvaToHslaString=function(){function H(F){var L=d(F),x=L.h,U=L.s,K=L.l,W=L.a;return"hsla("+x+", "+U+"%, "+K+"%, "+W+")"}return H}(),m=e.hsvaToRgba=function(){function H(F){var L=F.h,x=F.s,U=F.v,K=F.a;L=L/360*6,x=x/100,U=U/100;var W=Math.floor(L),q=U*(1-x),ut=U*(1-(L-W)*x),ct=U*(1-(1-L+W)*x),Q=W%6;return{r:[U,ut,q,q,ct,U][Q]*255,g:[ct,U,U,ut,q,q][Q]*255,b:[q,q,ct,U,U,ut][Q]*255,a:r(K,2)}}return H}(),b=e.hsvaToRgbString=function(){function H(F){var L=m(F),x=L.r,U=L.g,K=L.b;return"rgb("+r(x)+", "+r(U)+", "+r(K)+")"}return H}(),I=e.hsvaToRgbaString=function(){function H(F){var L=m(F),x=L.r,U=L.g,K=L.b,W=L.a;return"rgba("+r(x)+", "+r(U)+", "+r(K)+", "+r(W,2)+")"}return H}(),O=e.hsvaStringToHsva=function(){function H(F){var L=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,x=L.exec(F);return x?M({h:u(x[1],x[2]),s:Number(x[3]),v:Number(x[4]),a:x[5]===void 0?1:Number(x[5])/(x[6]?100:1)}):{h:0,s:0,v:0,a:1}}return H}(),T=e.hsvStringToHsva=O,E=e.rgbaStringToHsva=function(){function H(F){var L=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i,x=L.exec(F);return x?P({r:Number(x[1])/(x[2]?100/255:1),g:Number(x[3])/(x[4]?100/255:1),b:Number(x[5])/(x[6]?100/255:1),a:x[7]===void 0?1:Number(x[7])/(x[8]?100:1)}):{h:0,s:0,v:0,a:1}}return H}(),C=e.rgbStringToHsva=E,S=function(F){var L=F.toString(16);return L.length<2?"0"+L:L},A=e.rgbaToHex=function(){function H(F){var L=F.r,x=F.g,U=F.b,K=F.a,W=K<1?S(r(K*255)):"";return"#"+S(r(L))+S(r(x))+S(r(U))+W}return H}(),P=e.rgbaToHsva=function(){function H(F){var L=F.r,x=F.g,U=F.b,K=F.a,W=Math.max(L,x,U),q=W-Math.min(L,x,U),ut=q?W===L?(x-U)/q:W===x?2+(U-L)/q:4+(L-x)/q:0;return{h:60*(ut<0?ut+6:ut),s:W?q/W*100:0,v:W/255*100,a:K}}return H}(),M=e.roundHsva=function(){function H(F){return{h:r(F.h),s:r(F.s),v:r(F.v),a:r(F.a,2)}}return H}(),R=e.rgbaToRgb=function(){function H(F){var L=F.r,x=F.g,U=F.b;return{r:L,g:x,b:U}}return H}(),V=e.hslaToHsl=function(){function H(F){var L=F.h,x=F.s,U=F.l;return{h:L,s:x,l:U}}return H}(),j=e.hsvaToHsv=function(){function H(F){var L=M(F),x=L.h,U=L.s,K=L.v;return{h:x,s:U,v:K}}return H}(),$=/^#?([0-9A-F]{3,8})$/i,G=e.validHex=function(){function H(F,L){var x=$.exec(F),U=x?x[1].length:0;return U===3||U===6||!!L&&U===4||!!L&&U===8}return H}()},92868:function(y,e){"use strict";e.__esModule=!0,e.EventEmitter=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t=n.EventEmitter=function(){function e(){this.listeners={}}var r=e.prototype;return r.on=function(){function o(a,s){this.listeners[a]=this.listeners[a]||[],this.listeners[a].push(s)}return o}(),r.off=function(){function o(a,s){var i=this.listeners[a];if(!i)throw new Error('There is no listeners for "'+a+'"');this.listeners[a]=i.filter(function(c){return c!==s})}return o}(),r.emit=function(){function o(a){var s=this.listeners[a];if(s){for(var i=arguments.length,c=new Array(i>1?i-1:0),p=1;p1?u-1:0),p=1;p1?p-1:0),u=1;u1?f-1:0),v=1;v1?p-1:0),i=1;i1?f-1:0),d=1;dv?v:f}return p}(),e=n.clamp01=function(){function p(f){return f<0?0:f>1?1:f}return p}(),r=n.scale=function(){function p(f,u,v){return(f-u)/(v-u)}return p}(),o=n.round=function(){function p(f,u){if(!f||isNaN(f))return f;var v,l,g,d;return u|=0,v=Math.pow(10,u),f*=v,d=+(f>0)|-(f<0),g=Math.abs(f%1)>=.4999999999854481,l=Math.floor(f),g&&(f=l+(d>0)),(g?f:Math.round(f))/v}return p}(),a=n.toFixed=function(){function p(f,u){return u===void 0&&(u=0),Number(f).toFixed(Math.max(u,0))}return p}(),s=n.inRange=function(){function p(f,u){return u&&f>=u[0]&&f<=u[1]}return p}(),i=n.keyOfMatchingRange=function(){function p(f,u){for(var v=0,l=Object.keys(u);vd?d:f}return p}(),n=e.clamp01=function(){function p(f){return f<0?0:f>1?1:f}return p}(),r=e.scale=function(){function p(f,i,d){return(f-i)/(d-i)}return p}(),o=e.round=function(){function p(f,i){if(!f||isNaN(f))return f;var d,c,g,v;return i|=0,d=Math.pow(10,i),f*=d,v=+(f>0)|-(f<0),g=Math.abs(f%1)>=.4999999999854481,c=Math.floor(f),g&&(f=c+(v>0)),(g?f:Math.round(f))/d}return p}(),a=e.toFixed=function(){function p(f,i){return i===void 0&&(i=0),Number(f).toFixed(Math.max(i,0))}return p}(),s=e.inRange=function(){function p(f,i){return i&&f>=i[0]&&f<=i[1]}return p}(),u=e.keyOfMatchingRange=function(){function p(f,i){for(var d=0,c=Object.keys(i);d1?d-1:0),m=1;m1?b-1:0),A=1;A=0;--nt){var ht=this.tryEntries[nt],Et=ht.completion;if(ht.tryLoc==="root")return q("end");if(ht.tryLoc<=this.prev){var ut=C.call(ht,"catchLoc"),yt=C.call(ht,"finallyLoc");if(ut&&yt){if(this.prev=0;--q){var nt=this.tryEntries[q];if(nt.tryLoc<=this.prev&&C.call(nt,"finallyLoc")&&this.prev=0;--k){var q=this.tryEntries[k];if(q.finallyLoc===tt)return this.complete(q.completion,q.afterLoc),rt(q),U}}return ot}(),catch:function(){function ot(tt){for(var k=this.tryEntries.length-1;k>=0;--k){var q=this.tryEntries[k];if(q.tryLoc===tt){var nt=q.completion;if(nt.type==="throw"){var ht=nt.arg;rt(q)}return ht}}throw Error("illegal catch attempt")}return ot}(),delegateYield:function(){function ot(tt,k,q){return this.delegate={iterator:mt(tt),resultName:k,nextLoc:q},this.method==="next"&&(this.arg=O),U}return ot}()},T}function e(O,T,E,C,b,P,A){try{var M=O[P](A),R=M.value}catch(D){return void E(D)}M.done?T(R):Promise.resolve(R).then(C,b)}function r(O){return function(){var T=this,E=arguments;return new Promise(function(C,b){var P=O.apply(T,E);function A(R){e(P,C,b,A,M,"next",R)}function M(R){e(P,C,b,A,M,"throw",R)}A(void 0)})}}/**
+ */var r=e.createStore=function(){function p(f,i){if(i)return i(p)(f);var d,c=[],g=function(){function m(){return d}return m}(),v=function(){function m(b){c.push(b)}return m}(),h=function(){function m(b){d=f(d,b);for(var I=0;I1?v-1:0),m=1;m1?S-1:0),P=1;P=0;--nt){var pt=this.tryEntries[nt],Et=pt.completion;if(pt.tryLoc==="root")return tt("end");if(pt.tryLoc<=this.prev){var st=C.call(pt,"catchLoc"),yt=C.call(pt,"finallyLoc");if(st&&yt){if(this.prev=0;--tt){var nt=this.tryEntries[tt];if(nt.tryLoc<=this.prev&&C.call(nt,"finallyLoc")&&this.prev=0;--k){var tt=this.tryEntries[k];if(tt.finallyLoc===et)return this.complete(tt.completion,tt.afterLoc),rt(tt),x}}return ot}(),catch:function(){function ot(et){for(var k=this.tryEntries.length-1;k>=0;--k){var tt=this.tryEntries[k];if(tt.tryLoc===et){var nt=tt.completion;if(nt.type==="throw"){var pt=nt.arg;rt(tt)}return pt}}throw Error("illegal catch attempt")}return ot}(),delegateYield:function(){function ot(et,k,tt){return this.delegate={iterator:mt(et),resultName:k,nextLoc:tt},this.method==="next"&&(this.arg=O),x}return ot}()},T}function n(O,T,E,C,S,A,P){try{var M=O[A](P),R=M.value}catch(V){return void E(V)}M.done?T(R):Promise.resolve(R).then(C,S)}function r(O){return function(){var T=this,E=arguments;return new Promise(function(C,S){var A=O.apply(T,E);function P(R){n(A,C,S,P,M,"next",R)}function M(R){n(A,C,S,P,M,"throw",R)}P(void 0)})}}/**
* Browser-agnostic abstraction of key-value web storage.
*
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var o=n.IMPL_MEMORY=0,a=n.IMPL_HUB_STORAGE=1,s=n.IMPL_INDEXED_DB=2,i=1,c="para-tgui",p="storage-v1",f="readonly",u="readwrite",v=function(T){return function(){try{return!!T()}catch(E){return!1}}},l=v(function(){return window.hubStorage&&window.hubStorage.getItem}),g=v(function(){return(window.indexedDB||window.msIndexedDB)&&(window.IDBTransaction||window.msIDBTransaction)}),d=function(){function O(){this.impl=o,this.store={}}var T=O.prototype;return T.get=function(){var E=r(t().mark(function(){function b(P){return t().wrap(function(){function A(M){for(;;)switch(M.prev=M.next){case 0:return M.abrupt("return",this.store[P]);case 1:case"end":return M.stop()}}return A}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.set=function(){var E=r(t().mark(function(){function b(P,A){return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:this.store[P]=A;case 1:case"end":return R.stop()}}return M}(),b,this)}return b}()));function C(b,P){return E.apply(this,arguments)}return C}(),T.remove=function(){var E=r(t().mark(function(){function b(P){return t().wrap(function(){function A(M){for(;;)switch(M.prev=M.next){case 0:this.store[P]=void 0;case 1:case"end":return M.stop()}}return A}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.clear=function(){var E=r(t().mark(function(){function b(){return t().wrap(function(){function P(A){for(;;)switch(A.prev=A.next){case 0:this.store={};case 1:case"end":return A.stop()}}return P}(),b,this)}return b}()));function C(){return E.apply(this,arguments)}return C}(),O}(),h=function(){function O(){this.impl=a}var T=O.prototype;return T.get=function(){var E=r(t().mark(function(){function b(P){var A;return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,window.hubStorage.getItem("paradise-"+P);case 2:if(A=R.sent,typeof A!="string"){R.next=5;break}return R.abrupt("return",JSON.parse(A));case 5:case"end":return R.stop()}}return M}(),b)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.set=function(){function E(C,b){window.hubStorage.setItem("paradise-"+C,JSON.stringify(b))}return E}(),T.remove=function(){function E(C){window.hubStorage.removeItem("paradise-"+C)}return E}(),T.clear=function(){function E(){window.hubStorage.clear()}return E}(),O}(),m=function(){function O(){this.impl=s,this.dbPromise=new Promise(function(E,C){var b=window.indexedDB||window.msIndexedDB,P=b.open(c,i);P.onupgradeneeded=function(){try{P.result.createObjectStore(p)}catch(A){C(new Error("Failed to upgrade IDB: "+P.error))}},P.onsuccess=function(){return E(P.result)},P.onerror=function(){C(new Error("Failed to open IDB: "+P.error))}})}var T=O.prototype;return T.getStore=function(){var E=r(t().mark(function(){function b(P){return t().wrap(function(){function A(M){for(;;)switch(M.prev=M.next){case 0:return M.abrupt("return",this.dbPromise.then(function(R){return R.transaction(p,P).objectStore(p)}));case 1:case"end":return M.stop()}}return A}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.get=function(){var E=r(t().mark(function(){function b(P){var A;return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,this.getStore(f);case 2:return A=R.sent,R.abrupt("return",new Promise(function(D,x){var V=A.get(P);V.onsuccess=function(){return D(V.result)},V.onerror=function(){return x(V.error)}}));case 4:case"end":return R.stop()}}return M}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.set=function(){var E=r(t().mark(function(){function b(P,A){var M;return t().wrap(function(){function R(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,this.getStore(u);case 2:M=D.sent,M.put(A,P);case 4:case"end":return D.stop()}}return R}(),b,this)}return b}()));function C(b,P){return E.apply(this,arguments)}return C}(),T.remove=function(){var E=r(t().mark(function(){function b(P){var A;return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,this.getStore(u);case 2:A=R.sent,A.delete(P);case 4:case"end":return R.stop()}}return M}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.clear=function(){var E=r(t().mark(function(){function b(){var P;return t().wrap(function(){function A(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,this.getStore(u);case 2:P=M.sent,P.clear();case 4:case"end":return M.stop()}}return A}(),b,this)}return b}()));function C(){return E.apply(this,arguments)}return C}(),O}(),S=function(){function O(){this.backendPromise=r(t().mark(function(){function E(){var C;return t().wrap(function(){function b(P){for(;;)switch(P.prev=P.next){case 0:if(!(!Byond.TRIDENT&&l())){P.next=2;break}return P.abrupt("return",new h);case 2:if(!g()){P.next=12;break}return P.prev=3,C=new m,P.next=7,C.dbPromise;case 7:return P.abrupt("return",C);case 10:P.prev=10,P.t0=P.catch(3);case 12:return P.abrupt("return",new d);case 13:case"end":return P.stop()}}return b}(),E,null,[[3,10]])}return E}()))()}var T=O.prototype;return T.get=function(){var E=r(t().mark(function(){function b(P){var A;return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,this.backendPromise;case 2:return A=R.sent,R.abrupt("return",A.get(P));case 4:case"end":return R.stop()}}return M}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.set=function(){var E=r(t().mark(function(){function b(P,A){var M;return t().wrap(function(){function R(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,this.backendPromise;case 2:return M=D.sent,D.abrupt("return",M.set(P,A));case 4:case"end":return D.stop()}}return R}(),b,this)}return b}()));function C(b,P){return E.apply(this,arguments)}return C}(),T.remove=function(){var E=r(t().mark(function(){function b(P){var A;return t().wrap(function(){function M(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,this.backendPromise;case 2:return A=R.sent,R.abrupt("return",A.remove(P));case 4:case"end":return R.stop()}}return M}(),b,this)}return b}()));function C(b){return E.apply(this,arguments)}return C}(),T.clear=function(){var E=r(t().mark(function(){function b(){var P;return t().wrap(function(){function A(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,this.backendPromise;case 2:return P=M.sent,M.abrupt("return",P.clear());case 4:case"end":return M.stop()}}return A}(),b,this)}return b}()));function C(){return E.apply(this,arguments)}return C}(),O}(),I=n.storage=new S},25328:function(y,n){"use strict";n.__esModule=!0,n.toTitleCase=n.multiline=n.decodeHtmlEntities=n.createSearch=n.createGlobPattern=n.capitalize=n.buildQueryString=void 0;function t(u,v){var l=typeof Symbol!="undefined"&&u[Symbol.iterator]||u["@@iterator"];if(l)return(l=l.call(u)).next.bind(l);if(Array.isArray(u)||(l=e(u))||v&&u&&typeof u.length=="number"){l&&(u=l);var g=0;return function(){return g>=u.length?{done:!0}:{done:!1,value:u[g++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(u,v){if(u){if(typeof u=="string")return r(u,v);var l={}.toString.call(u).slice(8,-1);return l==="Object"&&u.constructor&&(l=u.constructor.name),l==="Map"||l==="Set"?Array.from(u):l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?r(u,v):void 0}}function r(u,v){(v==null||v>u.length)&&(v=u.length);for(var l=0,g=Array(v);l=i.length?{done:!0}:{done:!1,value:i[g++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(i,d){if(i){if(typeof i=="string")return r(i,d);var c={}.toString.call(i).slice(8,-1);return c==="Object"&&i.constructor&&(c=i.constructor.name),c==="Map"||c==="Set"?Array.from(i):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?r(i,d):void 0}}function r(i,d){(d==null||d>i.length)&&(d=i.length);for(var c=0,g=Array(d);c",apos:"'"};return v.replace(/
/gi,"\n").replace(/<\/?[a-z0-9-_]+[^>]*>/gi,"").replace(l,function(d,h){return g[h]}).replace(/?([0-9]+);/gi,function(d,h){var m=parseInt(h,10);return String.fromCharCode(m)}).replace(/?([0-9a-f]+);/gi,function(d,h){var m=parseInt(h,16);return String.fromCharCode(m)})}return u}(),f=n.buildQueryString=function(){function u(v){return Object.keys(v).map(function(l){return encodeURIComponent(l)+"="+encodeURIComponent(v[l])}).join("&")}return u}()},69214:function(y,n){"use strict";n.__esModule=!0,n.throttle=n.sleep=n.debounce=void 0;/**
+ */var o=e.multiline=function(){function i(d){if(Array.isArray(d))return i(d.join(""));for(var c=d.split("\n"),g,v=t(c),h;!(h=v()).done;)for(var m=h.value,b=0;b",apos:"'"};return d.replace(/
/gi,"\n").replace(/<\/?[a-z0-9-_]+[^>]*>/gi,"").replace(c,function(v,h){return g[h]}).replace(/?([0-9]+);/gi,function(v,h){var m=parseInt(h,10);return String.fromCharCode(m)}).replace(/?([0-9a-f]+);/gi,function(v,h){var m=parseInt(h,16);return String.fromCharCode(m)})}return i}(),f=e.buildQueryString=function(){function i(d){return Object.keys(d).map(function(c){return encodeURIComponent(c)+"="+encodeURIComponent(d[c])}).join("&")}return i}()},69214:function(y,e){"use strict";e.__esModule=!0,e.throttle=e.sleep=e.debounce=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t=n.debounce=function(){function o(a,s,i){i===void 0&&(i=!1);var c;return function(){for(var p=arguments.length,f=new Array(p),u=0;u=s)a.apply(null,u),i=l;else{var g;c=setTimeout(function(){return p.apply(void 0,u)},s-(l-((g=i)!=null?g:0)))}}return p}()}return o}()},90286:function(y,n){"use strict";n.__esModule=!0,n.createUuid=void 0;/**
+ */var t=e.debounce=function(){function o(a,s,u){u===void 0&&(u=!1);var l;return function(){for(var p=arguments.length,f=new Array(p),i=0;i
=s)a.apply(null,i),u=c;else{var g;l=setTimeout(function(){return p.apply(void 0,i)},s-(c-((g=u)!=null?g:0)))}}return p}()}return o}()},90286:function(y,e){"use strict";e.__esModule=!0,e.createUuid=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t=n.createUuid=function(){function e(){var r=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var a=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(o==="x"?a:a&3|8).toString(16)})}return e}()},97450:function(y,n,t){"use strict";n.__esModule=!0,n.vecSubtract=n.vecScale=n.vecNormalize=n.vecMultiply=n.vecLength=n.vecInverse=n.vecDivide=n.vecAdd=void 0;var e=t(88510);/**
+ */var t=e.createUuid=function(){function n(){var r=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){var a=(r+Math.random()*16)%16|0;return r=Math.floor(r/16),(o==="x"?a:a&3|8).toString(16)})}return n}()},97450:function(y,e,t){"use strict";e.__esModule=!0,e.vecSubtract=e.vecScale=e.vecNormalize=e.vecMultiply=e.vecLength=e.vecInverse=e.vecDivide=e.vecAdd=void 0;var n=t(88510);/**
* N-dimensional vector manipulation functions.
*
* Vectors are plain number arrays, i.e. [x, y, z].
@@ -66,178 +66,178 @@
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var r=function(h,m){return h+m},o=function(h,m){return h-m},a=function(h,m){return h*m},s=function(h,m){return h/m},i=n.vecAdd=function(){function d(){for(var h=arguments.length,m=new Array(h),S=0;S=c.length?{done:!0}:{done:!1,value:c[u++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(c,p){if(c){if(typeof c=="string")return a(c,p);var f={}.toString.call(c).slice(8,-1);return f==="Object"&&c.constructor&&(f=c.constructor.name),f==="Map"||f==="Set"?Array.from(c):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?a(c,p):void 0}}function a(c,p){(p==null||p>c.length)&&(p=c.length);for(var f=0,u=Array(p);f=l.length?{done:!0}:{done:!1,value:l[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function o(l,p){if(l){if(typeof l=="string")return a(l,p);var f={}.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?a(l,p):void 0}}function a(l,p){(p==null||p>l.length)&&(p=l.length);for(var f=0,i=Array(p);f
0&&f.node.currentTime>=f.options.end;u&&f.stop()}},1e3)}var p=c.prototype;return p.destroy=function(){function f(){this.node&&(this.node.stop(),document.removeChild(this.node),clearInterval(this.playbackInterval))}return f}(),p.play=function(){function f(u,v){v===void 0&&(v={}),this.node&&(s.log("playing",u,v),this.options=v,this.node.src=u)}return f}(),p.stop=function(){function f(){if(this.node){if(this.playing)for(var u=r(this.onStopSubscribers),v;!(v=u()).done;){var l=v.value;l()}s.log("stopping"),this.playing=!1,this.node.src=""}}return f}(),p.setVolume=function(){function f(u){this.node&&(this.volume=u,this.node.volume=u)}return f}(),p.onPlay=function(){function f(u){this.node&&this.onPlaySubscribers.push(u)}return f}(),p.onStop=function(){function f(u){this.node&&this.onStopSubscribers.push(u)}return f}(),c}()},70949:function(y,n){"use strict";n.__esModule=!0,n.audioReducer=void 0;/**
+*/var s=(0,n.createLogger)("AudioPlayer"),u=e.AudioPlayer=function(){function l(){var f=this;this.node=document.createElement("audio"),this.node.style.setProperty("display","none"),document.body.appendChild(this.node),this.playing=!1,this.volume=1,this.options={},this.onPlaySubscribers=[],this.onStopSubscribers=[],this.node.addEventListener("canplaythrough",function(){s.log("canplaythrough"),f.playing=!0,f.node.playbackRate=f.options.pitch||1,f.node.currentTime=f.options.start||0,f.node.volume=f.volume,f.node.play();for(var i=r(f.onPlaySubscribers),d;!(d=i()).done;){var c=d.value;c()}}),this.node.addEventListener("ended",function(){s.log("ended"),f.stop()}),this.node.addEventListener("error",function(i){f.playing&&(s.log("playback error",i.error),f.stop())}),this.playbackInterval=setInterval(function(){if(f.playing){var i=f.options.end>0&&f.node.currentTime>=f.options.end;i&&f.stop()}},1e3)}var p=l.prototype;return p.destroy=function(){function f(){this.node&&(this.node.stop(),document.removeChild(this.node),clearInterval(this.playbackInterval))}return f}(),p.play=function(){function f(i,d){d===void 0&&(d={}),this.node&&(s.log("playing",i,d),this.options=d,this.node.src=i)}return f}(),p.stop=function(){function f(){if(this.node){if(this.playing)for(var i=r(this.onStopSubscribers),d;!(d=i()).done;){var c=d.value;c()}s.log("stopping"),this.playing=!1,this.node.src=""}}return f}(),p.setVolume=function(){function f(i){this.node&&(this.volume=i,this.node.volume=i)}return f}(),p.onPlay=function(){function f(i){this.node&&this.onPlaySubscribers.push(i)}return f}(),p.onStop=function(){function f(i){this.node&&this.onStopSubscribers.push(i)}return f}(),l}()},70949:function(y,e){"use strict";e.__esModule=!0,e.audioReducer=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t={visible:!1,playing:!1,track:null},e=n.audioReducer=function(){function r(o,a){o===void 0&&(o=t);var s=a.type,i=a.payload;return s==="audio/playing"?Object.assign({},o,{visible:!0,playing:!0}):s==="audio/stopped"?Object.assign({},o,{visible:!1,playing:!1}):s==="audio/playMusic"?Object.assign({},o,{meta:i}):s==="audio/stopMusic"?Object.assign({},o,{visible:!1,playing:!1,meta:null}):s==="audio/toggle"?Object.assign({},o,{visible:!o.visible}):o}return r}()},32559:function(y,n){"use strict";n.__esModule=!0,n.selectAudio=void 0;/**
+ */var t={visible:!1,playing:!1,track:null},n=e.audioReducer=function(){function r(o,a){o===void 0&&(o=t);var s=a.type,u=a.payload;return s==="audio/playing"?Object.assign({},o,{visible:!0,playing:!0}):s==="audio/stopped"?Object.assign({},o,{visible:!1,playing:!1}):s==="audio/playMusic"?Object.assign({},o,{meta:u}):s==="audio/stopMusic"?Object.assign({},o,{visible:!1,playing:!1,meta:null}):s==="audio/toggle"?Object.assign({},o,{visible:!o.visible}):o}return r}()},32559:function(y,e){"use strict";e.__esModule=!0,e.selectAudio=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t=n.selectAudio=function(){function e(r){return r.audio}return e}()},15039:function(y,n,t){"use strict";n.__esModule=!0,n.ChatPageSettings=void 0;var e=t(89005),r=t(85307),o=t(36036),a=t(37152),s=t(69126),i=t(23429);/**
+ */var t=e.selectAudio=function(){function n(r){return r.audio}return n}()},15039:function(y,e,t){"use strict";e.__esModule=!0,e.ChatPageSettings=void 0;var n=t(89005),r=t(85307),o=t(36036),a=t(37152),s=t(69126),u=t(23429);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var c=n.ChatPageSettings=function(){function p(f,u){var v=(0,r.useSelector)(u,i.selectCurrentChatPage),l=(0,r.useDispatch)(u);return(0,e.createComponentVNode)(2,o.Section,{fill:!0,children:[(0,e.createComponentVNode)(2,o.Stack,{align:"center",children:[!v.isMain&&(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.createComponentVNode)(2,o.Button,{tooltip:"Reorder tab to the left",icon:"angle-left",onClick:function(){function g(){return l((0,a.moveChatPageLeft)({pageId:v.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{grow:!0,ml:.5,children:(0,e.createComponentVNode)(2,o.Input,{width:"100%",value:v.name,onChange:function(){function g(d,h){return l((0,a.updateChatPage)({pageId:v.id,name:h}))}return g}()})}),!v.isMain&&(0,e.createComponentVNode)(2,o.Stack.Item,{ml:.5,children:(0,e.createComponentVNode)(2,o.Button,{tooltip:"Reorder tab to the right",icon:"angle-right",onClick:function(){function g(){return l((0,a.moveChatPageRight)({pageId:v.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.createComponentVNode)(2,o.Button.Checkbox,{content:"Mute",checked:v.hideUnreadCount,icon:v.hideUnreadCount?"bell-slash":"bell",tooltip:"Disables unread counter",onClick:function(){function g(){return l((0,a.updateChatPage)({pageId:v.id,hideUnreadCount:!v.hideUnreadCount}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.createComponentVNode)(2,o.Button,{content:"Remove",icon:"times",color:"red",disabled:v.isMain,onClick:function(){function g(){return l((0,a.removeChatPage)({pageId:v.id}))}return g}()})})]}),(0,e.createComponentVNode)(2,o.Divider),(0,e.createComponentVNode)(2,o.Section,{title:"Messages to display",level:2,children:[s.MESSAGE_TYPES.filter(function(g){return!g.important&&!g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:v.acceptedTypes[g.type],onClick:function(){function d(){return l((0,a.toggleAcceptedType)({pageId:v.id,type:g.type}))}return d}(),children:g.name},g.type)}),(0,e.createComponentVNode)(2,o.Collapsible,{mt:1,color:"transparent",title:"Admin stuff",children:s.MESSAGE_TYPES.filter(function(g){return!g.important&&g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:v.acceptedTypes[g.type],onClick:function(){function d(){return l((0,a.toggleAcceptedType)({pageId:v.id,type:g.type}))}return d}(),children:g.name},g.type)})})]})]})}return p}()},44675:function(y,n,t){"use strict";n.__esModule=!0,n.ChatPanel=void 0;var e=t(89005),r=t(35840),o=t(36036),a=t(15916);function s(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,i(p,f)}function i(p,f){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,v){return u.__proto__=v,u},i(p,f)}/**
+ */var l=e.ChatPageSettings=function(){function p(f,i){var d=(0,r.useSelector)(i,u.selectCurrentChatPage),c=(0,r.useDispatch)(i);return(0,n.createComponentVNode)(2,o.Section,{fill:!0,children:[(0,n.createComponentVNode)(2,o.Stack,{align:"center",children:[!d.isMain&&(0,n.createComponentVNode)(2,o.Stack.Item,{children:(0,n.createComponentVNode)(2,o.Button,{tooltip:"Reorder tab to the left",icon:"angle-left",onClick:function(){function g(){return c((0,a.moveChatPageLeft)({pageId:d.id}))}return g}()})}),(0,n.createComponentVNode)(2,o.Stack.Item,{grow:!0,ml:.5,children:(0,n.createComponentVNode)(2,o.Input,{width:"100%",value:d.name,onChange:function(){function g(v,h){return c((0,a.updateChatPage)({pageId:d.id,name:h}))}return g}()})}),!d.isMain&&(0,n.createComponentVNode)(2,o.Stack.Item,{ml:.5,children:(0,n.createComponentVNode)(2,o.Button,{tooltip:"Reorder tab to the right",icon:"angle-right",onClick:function(){function g(){return c((0,a.moveChatPageRight)({pageId:d.id}))}return g}()})}),(0,n.createComponentVNode)(2,o.Stack.Item,{children:(0,n.createComponentVNode)(2,o.Button.Checkbox,{content:"Mute",checked:d.hideUnreadCount,icon:d.hideUnreadCount?"bell-slash":"bell",tooltip:"Disables unread counter",onClick:function(){function g(){return c((0,a.updateChatPage)({pageId:d.id,hideUnreadCount:!d.hideUnreadCount}))}return g}()})}),(0,n.createComponentVNode)(2,o.Stack.Item,{children:(0,n.createComponentVNode)(2,o.Button,{content:"Remove",icon:"times",color:"red",disabled:d.isMain,onClick:function(){function g(){return c((0,a.removeChatPage)({pageId:d.id}))}return g}()})})]}),(0,n.createComponentVNode)(2,o.Divider),(0,n.createComponentVNode)(2,o.Section,{title:"Messages to display",level:2,children:[s.MESSAGE_TYPES.filter(function(g){return!g.important&&!g.admin}).map(function(g){return(0,n.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return c((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)}),(0,n.createComponentVNode)(2,o.Collapsible,{mt:1,color:"transparent",title:"Admin stuff",children:s.MESSAGE_TYPES.filter(function(g){return!g.important&&g.admin}).map(function(g){return(0,n.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return c((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)})})]})]})}return p}()},44675:function(y,e,t){"use strict";e.__esModule=!0,e.ChatPanel=void 0;var n=t(89005),r=t(35840),o=t(36036),a=t(15916);function s(p,f){p.prototype=Object.create(f.prototype),p.prototype.constructor=p,u(p,f)}function u(p,f){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,d){return i.__proto__=d,i},u(p,f)}/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
-*/var c=n.ChatPanel=function(p){function f(){var v;return v=p.call(this)||this,v.ref=(0,e.createRef)(),v.state={scrollTracking:!0},v.handleScrollTrackingChange=function(l){return v.setState({scrollTracking:l})},v}s(f,p);var u=f.prototype;return u.componentDidMount=function(){function v(){a.chatRenderer.mount(this.ref.current),a.chatRenderer.events.on("scrollTrackingChanged",this.handleScrollTrackingChange),this.componentDidUpdate()}return v}(),u.componentWillUnmount=function(){function v(){a.chatRenderer.events.off("scrollTrackingChanged",this.handleScrollTrackingChange)}return v}(),u.componentDidUpdate=function(){function v(l){requestAnimationFrame(function(){a.chatRenderer.ensureScrollTracking()});var g=!l||(0,r.shallowDiffers)(this.props,l);g&&a.chatRenderer.assignStyle({width:"100%","white-space":"pre-wrap","font-size":this.props.fontSize,"line-height":this.props.lineHeight})}return v}(),u.render=function(){function v(){var l=this.state.scrollTracking;return(0,e.createFragment)([(0,e.createVNode)(1,"div","Chat",null,1,null,null,this.ref),!l&&(0,e.createComponentVNode)(2,o.Button,{className:"Chat__scrollButton",icon:"arrow-down",onClick:function(){function g(){return a.chatRenderer.scrollToBottom()}return g}(),children:"Scroll to bottom"})],0)}return v}(),f}(e.Component)},41125:function(y,n,t){"use strict";n.__esModule=!0,n.ChatTabs=void 0;var e=t(89005),r=t(85307),o=t(36036),a=t(37152),s=t(23429),i=t(36471);/**
+*/var l=e.ChatPanel=function(p){function f(){var d;return d=p.call(this)||this,d.ref=(0,n.createRef)(),d.state={scrollTracking:!0},d.handleScrollTrackingChange=function(c){return d.setState({scrollTracking:c})},d}s(f,p);var i=f.prototype;return i.componentDidMount=function(){function d(){a.chatRenderer.mount(this.ref.current),a.chatRenderer.events.on("scrollTrackingChanged",this.handleScrollTrackingChange),this.componentDidUpdate()}return d}(),i.componentWillUnmount=function(){function d(){a.chatRenderer.events.off("scrollTrackingChanged",this.handleScrollTrackingChange)}return d}(),i.componentDidUpdate=function(){function d(c){requestAnimationFrame(function(){a.chatRenderer.ensureScrollTracking()});var g=!c||(0,r.shallowDiffers)(this.props,c);g&&a.chatRenderer.assignStyle({width:"100%","white-space":"pre-wrap","font-size":this.props.fontSize,"line-height":this.props.lineHeight})}return d}(),i.render=function(){function d(){var c=this.state.scrollTracking;return(0,n.createFragment)([(0,n.createVNode)(1,"div","Chat",null,1,null,null,this.ref),!c&&(0,n.createComponentVNode)(2,o.Button,{className:"Chat__scrollButton",icon:"arrow-down",onClick:function(){function g(){return a.chatRenderer.scrollToBottom()}return g}(),children:"Scroll to bottom"})],0)}return d}(),f}(n.Component)},41125:function(y,e,t){"use strict";e.__esModule=!0,e.ChatTabs=void 0;var n=t(89005),r=t(85307),o=t(36036),a=t(37152),s=t(23429),u=t(36471);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var c=function(u){var v=u.value;return(0,e.createComponentVNode)(2,o.Box,{style:{"font-size":"0.7em","border-radius":"0.25em",width:"1.7em","line-height":"1.55em","background-color":"crimson",color:"#fff"},children:Math.min(v,99)})},p=n.ChatTabs=function(){function f(u,v){var l=(0,r.useSelector)(v,s.selectChatPages),g=(0,r.useSelector)(v,s.selectCurrentChatPage),d=(0,r.useDispatch)(v);return(0,e.createComponentVNode)(2,o.Flex,{align:"center",children:[(0,e.createComponentVNode)(2,o.Flex.Item,{children:(0,e.createComponentVNode)(2,o.Tabs,{textAlign:"center",children:l.map(function(h){return(0,e.createComponentVNode)(2,o.Tabs.Tab,{selected:h===g,rightSlot:!h.hideUnreadCount&&h.unreadCount>0&&(0,e.createComponentVNode)(2,c,{value:h.unreadCount}),onClick:function(){function m(){return d((0,a.changeChatPage)({pageId:h.id}))}return m}(),children:h.name},h.id)})})}),(0,e.createComponentVNode)(2,o.Flex.Item,{ml:1,children:(0,e.createComponentVNode)(2,o.Button,{color:"transparent",icon:"plus",onClick:function(){function h(){d((0,a.addChatPage)()),d((0,i.openChatSettings)())}return h}()})})]})}return f}()},37152:function(y,n,t){"use strict";n.__esModule=!0,n.updateMessageCount=n.updateChatPage=n.toggleAcceptedType=n.saveChatToDisk=n.removeChatPage=n.rebuildChat=n.moveChatPageRight=n.moveChatPageLeft=n.loadChat=n.clearChat=n.changeScrollTracking=n.changeChatPage=n.addChatPage=void 0;var e=t(85307),r=t(41950);/**
+ */var l=function(i){var d=i.value;return(0,n.createComponentVNode)(2,o.Box,{style:{"font-size":"0.7em","border-radius":"0.25em",width:"1.7em","line-height":"1.55em","background-color":"crimson",color:"#fff"},children:Math.min(d,99)})},p=e.ChatTabs=function(){function f(i,d){var c=(0,r.useSelector)(d,s.selectChatPages),g=(0,r.useSelector)(d,s.selectCurrentChatPage),v=(0,r.useDispatch)(d);return(0,n.createComponentVNode)(2,o.Flex,{align:"center",children:[(0,n.createComponentVNode)(2,o.Flex.Item,{children:(0,n.createComponentVNode)(2,o.Tabs,{textAlign:"center",children:c.map(function(h){return(0,n.createComponentVNode)(2,o.Tabs.Tab,{selected:h===g,rightSlot:!h.hideUnreadCount&&h.unreadCount>0&&(0,n.createComponentVNode)(2,l,{value:h.unreadCount}),onClick:function(){function m(){return v((0,a.changeChatPage)({pageId:h.id}))}return m}(),children:h.name},h.id)})})}),(0,n.createComponentVNode)(2,o.Flex.Item,{ml:1,children:(0,n.createComponentVNode)(2,o.Button,{color:"transparent",icon:"plus",onClick:function(){function h(){v((0,a.addChatPage)()),v((0,u.openChatSettings)())}return h}()})})]})}return f}()},37152:function(y,e,t){"use strict";e.__esModule=!0,e.updateMessageCount=e.updateChatPage=e.toggleAcceptedType=e.saveChatToDisk=e.removeChatPage=e.rebuildChat=e.moveChatPageRight=e.moveChatPageLeft=e.loadChat=e.clearChat=e.changeScrollTracking=e.changeChatPage=e.addChatPage=void 0;var n=t(85307),r=t(41950);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var o=n.loadChat=(0,e.createAction)("chat/load"),a=n.rebuildChat=(0,e.createAction)("chat/rebuild"),s=n.clearChat=(0,e.createAction)("chat/clear"),i=n.updateMessageCount=(0,e.createAction)("chat/updateMessageCount"),c=n.addChatPage=(0,e.createAction)("chat/addPage",function(){return{payload:(0,r.createPage)()}}),p=n.changeChatPage=(0,e.createAction)("chat/changePage"),f=n.updateChatPage=(0,e.createAction)("chat/updatePage"),u=n.toggleAcceptedType=(0,e.createAction)("chat/toggleAcceptedType"),v=n.removeChatPage=(0,e.createAction)("chat/removePage"),l=n.changeScrollTracking=(0,e.createAction)("chat/changeScrollTracking"),g=n.saveChatToDisk=(0,e.createAction)("chat/saveToDisk"),d=n.moveChatPageLeft=(0,e.createAction)("chat/movePageLeft"),h=n.moveChatPageRight=(0,e.createAction)("chat/movePageRight")},69126:function(y,n){"use strict";n.__esModule=!0,n.MESSAGE_TYPE_WARNING=n.MESSAGE_TYPE_UNKNOWN=n.MESSAGE_TYPE_SYSTEM=n.MESSAGE_TYPE_RADIO=n.MESSAGE_TYPE_OOC=n.MESSAGE_TYPE_MENTORPM=n.MESSAGE_TYPE_MENTORCHAT=n.MESSAGE_TYPE_LOCALCHAT=n.MESSAGE_TYPE_INTERNAL=n.MESSAGE_TYPE_INFO=n.MESSAGE_TYPE_EVENTCHAT=n.MESSAGE_TYPE_DEVCHAT=n.MESSAGE_TYPE_DEBUG=n.MESSAGE_TYPE_DEADCHAT=n.MESSAGE_TYPE_COMBAT=n.MESSAGE_TYPE_ATTACKLOG=n.MESSAGE_TYPE_ADMINPM=n.MESSAGE_TYPE_ADMINLOG=n.MESSAGE_TYPE_ADMINCHAT=n.MESSAGE_TYPES=n.MESSAGE_SAVE_INTERVAL=n.MESSAGE_PRUNE_INTERVAL=n.MAX_VISIBLE_MESSAGES=n.MAX_PERSISTED_MESSAGES=n.IMAGE_RETRY_MESSAGE_AGE=n.IMAGE_RETRY_LIMIT=n.IMAGE_RETRY_DELAY=n.COMBINE_MAX_TIME_WINDOW=n.COMBINE_MAX_MESSAGES=void 0;/**
+ */var o=e.loadChat=(0,n.createAction)("chat/load"),a=e.rebuildChat=(0,n.createAction)("chat/rebuild"),s=e.clearChat=(0,n.createAction)("chat/clear"),u=e.updateMessageCount=(0,n.createAction)("chat/updateMessageCount"),l=e.addChatPage=(0,n.createAction)("chat/addPage",function(){return{payload:(0,r.createPage)()}}),p=e.changeChatPage=(0,n.createAction)("chat/changePage"),f=e.updateChatPage=(0,n.createAction)("chat/updatePage"),i=e.toggleAcceptedType=(0,n.createAction)("chat/toggleAcceptedType"),d=e.removeChatPage=(0,n.createAction)("chat/removePage"),c=e.changeScrollTracking=(0,n.createAction)("chat/changeScrollTracking"),g=e.saveChatToDisk=(0,n.createAction)("chat/saveToDisk"),v=e.moveChatPageLeft=(0,n.createAction)("chat/movePageLeft"),h=e.moveChatPageRight=(0,n.createAction)("chat/movePageRight")},69126:function(y,e){"use strict";e.__esModule=!0,e.MESSAGE_TYPE_WARNING=e.MESSAGE_TYPE_UNKNOWN=e.MESSAGE_TYPE_SYSTEM=e.MESSAGE_TYPE_RADIO=e.MESSAGE_TYPE_OOC=e.MESSAGE_TYPE_MENTORPM=e.MESSAGE_TYPE_MENTORCHAT=e.MESSAGE_TYPE_LOCALCHAT=e.MESSAGE_TYPE_INTERNAL=e.MESSAGE_TYPE_INFO=e.MESSAGE_TYPE_EVENTCHAT=e.MESSAGE_TYPE_DEVCHAT=e.MESSAGE_TYPE_DEBUG=e.MESSAGE_TYPE_DEADCHAT=e.MESSAGE_TYPE_COMBAT=e.MESSAGE_TYPE_ATTACKLOG=e.MESSAGE_TYPE_ADMINPM=e.MESSAGE_TYPE_ADMINLOG=e.MESSAGE_TYPE_ADMINCHAT=e.MESSAGE_TYPES=e.MESSAGE_SAVE_INTERVAL=e.MESSAGE_PRUNE_INTERVAL=e.MAX_VISIBLE_MESSAGES=e.MAX_PERSISTED_MESSAGES=e.IMAGE_RETRY_MESSAGE_AGE=e.IMAGE_RETRY_LIMIT=e.IMAGE_RETRY_DELAY=e.COMBINE_MAX_TIME_WINDOW=e.COMBINE_MAX_MESSAGES=void 0;/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var t=n.MAX_VISIBLE_MESSAGES=2500,e=n.MAX_PERSISTED_MESSAGES=1e3,r=n.MESSAGE_SAVE_INTERVAL=1e4,o=n.MESSAGE_PRUNE_INTERVAL=6e4,a=n.COMBINE_MAX_TIME_WINDOW=5e3,s=n.COMBINE_MAX_MESSAGES=5,i=n.IMAGE_RETRY_DELAY=250,c=n.IMAGE_RETRY_LIMIT=10,p=n.IMAGE_RETRY_MESSAGE_AGE=6e4,f=n.MESSAGE_TYPE_UNKNOWN="unknown",u=n.MESSAGE_TYPE_INTERNAL="internal",v=n.MESSAGE_TYPE_SYSTEM="system",l=n.MESSAGE_TYPE_LOCALCHAT="localchat",g=n.MESSAGE_TYPE_RADIO="radio",d=n.MESSAGE_TYPE_INFO="info",h=n.MESSAGE_TYPE_WARNING="warning",m=n.MESSAGE_TYPE_DEADCHAT="deadchat",S=n.MESSAGE_TYPE_OOC="ooc",I=n.MESSAGE_TYPE_ADMINPM="adminpm",O=n.MESSAGE_TYPE_MENTORPM="mentorpm",T=n.MESSAGE_TYPE_COMBAT="combat",E=n.MESSAGE_TYPE_ADMINCHAT="adminchat",C=n.MESSAGE_TYPE_MENTORCHAT="mentorchat",b=n.MESSAGE_TYPE_DEVCHAT="devchat",P=n.MESSAGE_TYPE_EVENTCHAT="eventchat",A=n.MESSAGE_TYPE_ADMINLOG="adminlog",M=n.MESSAGE_TYPE_ATTACKLOG="attacklog",R=n.MESSAGE_TYPE_DEBUG="debug",D=n.MESSAGE_TYPES=[{type:v,name:"System Messages",description:"Messages from your client, always enabled",selector:".boldannounceooc",important:!0},{type:l,name:"Local",description:"In-character local messages (say, emote, etc)",selector:".say, .emote"},{type:g,name:"Radio",description:"All departments of radio messages",selector:".alert, .syndradio, .centradio, .airadio, .entradio, .comradio, .secradio, .engradio, .medradio, .sciradio, .supradio, .srvradio, .expradio, .radio, .deptradio, .newscaster, .proradio"},{type:d,name:"Info",description:"Non-urgent messages from the game and items",selector:".notice:not(.pm), .adminnotice, .info, .sinister, .cult"},{type:h,name:"Warnings",description:"Urgent messages from the game and items",selector:".warning:not(.pm), .critical, .userdanger, .italics, .boldannounceic, .boldwarning"},{type:m,name:"Deadchat",description:"All of deadchat",selector:".deadsay"},{type:S,name:"OOC",description:"The bluewall of global OOC messages",selector:".ooc, .adminooc, .interface"},{type:I,name:"Admin PMs",description:"Messages to/from admins (adminhelp)",selector:".adminpm, .adminhelp, .adminticket, .adminticketalt"},{type:O,name:"Mentor PMs",description:"Messages to/from mentors (mentorhelp)",selector:".mentorpm, .mentorhelp"},{type:T,name:"Combat Log",description:"Urist McTraitor has stabbed you with a knife!",selector:".danger"},{type:f,name:"Unsorted",description:"Everything we could not sort, always enabled"},{type:E,name:"Admin Chat",description:"ASAY messages",selector:".admin_channel, .adminsay",admin:!0},{type:C,name:"Mentor Chat",description:"MSAY messages",selector:".mentor_channel",admin:!0},{type:b,name:"Developer Chat",description:"DEVSAY messages",selector:".dev_channel",admin:!0},{type:A,name:"Admin Log",description:"ADMIN LOG: Urist McAdmin has jumped to coordinates X, Y, Z",selector:".log_message",admin:!0},{type:M,name:"Attack Log",description:"Urist McTraitor has shot John Doe",admin:!0},{type:R,name:"Debug Log",description:"DEBUG: SSPlanets subsystem Recover().",selector:".pr_announce, .debug",admin:!0}]},96835:function(y,n,t){"use strict";n.__esModule=!0,n.chatReducer=n.chatMiddleware=n.ChatTabs=n.ChatPanel=n.ChatPageSettings=void 0;var e=t(15039);n.ChatPageSettings=e.ChatPageSettings;var r=t(44675);n.ChatPanel=r.ChatPanel;var o=t(41125);n.ChatTabs=o.ChatTabs;var a=t(84807);n.chatMiddleware=a.chatMiddleware;var s=t(40147);n.chatReducer=s.chatReducer},84807:function(y,n,t){"use strict";n.__esModule=!0,n.chatMiddleware=void 0;var e=u(t(22734)),r=t(27108),o=t(36471),a=t(77034),s=t(37152),i=t(69126),c=t(41950),p=t(15916),f=t(23429);function u(E){return E&&E.__esModule?E:{default:E}}function v(E,C){var b=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(b)return(b=b.call(E)).next.bind(b);if(Array.isArray(E)||(b=l(E))||C&&E&&typeof E.length=="number"){b&&(E=b);var P=0;return function(){return P>=E.length?{done:!0}:{done:!1,value:E[P++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(E,C){if(E){if(typeof E=="string")return g(E,C);var b={}.toString.call(E).slice(8,-1);return b==="Object"&&E.constructor&&(b=E.constructor.name),b==="Map"||b==="Set"?Array.from(E):b==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?g(E,C):void 0}}function g(E,C){(C==null||C>E.length)&&(C=E.length);for(var b=0,P=Array(C);b=0;--Et){var ut=this.tryEntries[Et],yt=ut.completion;if(ut.tryLoc==="root")return ht("end");if(ut.tryLoc<=this.prev){var Pt=P.call(ut,"catchLoc"),bt=P.call(ut,"finallyLoc");if(Pt&&bt){if(this.prev=0;--ht){var Et=this.tryEntries[ht];if(Et.tryLoc<=this.prev&&P.call(Et,"finallyLoc")&&this.prev=0;--nt){var ht=this.tryEntries[nt];if(ht.finallyLoc===q)return this.complete(ht.completion,ht.afterLoc),mt(ht),z}}return k}(),catch:function(){function k(q){for(var nt=this.tryEntries.length-1;nt>=0;--nt){var ht=this.tryEntries[nt];if(ht.tryLoc===q){var Et=ht.completion;if(Et.type==="throw"){var ut=Et.arg;mt(ht)}return ut}}throw Error("illegal catch attempt")}return k}(),delegateYield:function(){function k(q,nt,ht){return this.delegate={iterator:tt(q),resultName:nt,nextLoc:ht},this.method==="next"&&(this.arg=E),z}return k}()},C}function h(E,C,b,P,A,M,R){try{var D=E[M](R),x=D.value}catch(V){return void b(V)}D.done?C(x):Promise.resolve(x).then(P,A)}function m(E){return function(){var C=this,b=arguments;return new Promise(function(P,A){var M=E.apply(C,b);function R(x){h(M,P,A,R,D,"next",x)}function D(x){h(M,P,A,R,D,"throw",x)}R(void 0)})}}/**
+ */var t=e.MAX_VISIBLE_MESSAGES=2500,n=e.MAX_PERSISTED_MESSAGES=1e3,r=e.MESSAGE_SAVE_INTERVAL=1e4,o=e.MESSAGE_PRUNE_INTERVAL=6e4,a=e.COMBINE_MAX_TIME_WINDOW=5e3,s=e.COMBINE_MAX_MESSAGES=5,u=e.IMAGE_RETRY_DELAY=250,l=e.IMAGE_RETRY_LIMIT=10,p=e.IMAGE_RETRY_MESSAGE_AGE=6e4,f=e.MESSAGE_TYPE_UNKNOWN="unknown",i=e.MESSAGE_TYPE_INTERNAL="internal",d=e.MESSAGE_TYPE_SYSTEM="system",c=e.MESSAGE_TYPE_LOCALCHAT="localchat",g=e.MESSAGE_TYPE_RADIO="radio",v=e.MESSAGE_TYPE_INFO="info",h=e.MESSAGE_TYPE_WARNING="warning",m=e.MESSAGE_TYPE_DEADCHAT="deadchat",b=e.MESSAGE_TYPE_OOC="ooc",I=e.MESSAGE_TYPE_ADMINPM="adminpm",O=e.MESSAGE_TYPE_MENTORPM="mentorpm",T=e.MESSAGE_TYPE_COMBAT="combat",E=e.MESSAGE_TYPE_ADMINCHAT="adminchat",C=e.MESSAGE_TYPE_MENTORCHAT="mentorchat",S=e.MESSAGE_TYPE_DEVCHAT="devchat",A=e.MESSAGE_TYPE_EVENTCHAT="eventchat",P=e.MESSAGE_TYPE_ADMINLOG="adminlog",M=e.MESSAGE_TYPE_ATTACKLOG="attacklog",R=e.MESSAGE_TYPE_DEBUG="debug",V=e.MESSAGE_TYPES=[{type:d,name:"System Messages",description:"Messages from your client, always enabled",selector:".boldannounceooc",important:!0},{type:c,name:"Local",description:"In-character local messages (say, emote, etc)",selector:".say, .emote"},{type:g,name:"Radio",description:"All departments of radio messages",selector:".alert, .syndradio, .centradio, .airadio, .entradio, .comradio, .secradio, .engradio, .medradio, .sciradio, .supradio, .srvradio, .expradio, .radio, .deptradio, .newscaster, .proradio"},{type:v,name:"Info",description:"Non-urgent messages from the game and items",selector:".notice:not(.pm), .adminnotice, .info, .sinister, .cult"},{type:h,name:"Warnings",description:"Urgent messages from the game and items",selector:".warning:not(.pm), .critical, .userdanger, .italics, .boldannounceic, .boldwarning"},{type:m,name:"Deadchat",description:"All of deadchat",selector:".deadsay"},{type:b,name:"OOC",description:"The bluewall of global OOC messages",selector:".ooc, .adminooc, .interface"},{type:I,name:"Admin PMs",description:"Messages to/from admins (adminhelp)",selector:".adminpm, .adminhelp, .adminticket, .adminticketalt"},{type:O,name:"Mentor PMs",description:"Messages to/from mentors (mentorhelp)",selector:".mentorpm, .mentorhelp"},{type:T,name:"Combat Log",description:"Urist McTraitor has stabbed you with a knife!",selector:".danger"},{type:f,name:"Unsorted",description:"Everything we could not sort, always enabled"},{type:E,name:"Admin Chat",description:"ASAY messages",selector:".admin_channel, .adminsay",admin:!0},{type:C,name:"Mentor Chat",description:"MSAY messages",selector:".mentor_channel",admin:!0},{type:S,name:"Developer Chat",description:"DEVSAY messages",selector:".dev_channel",admin:!0},{type:P,name:"Admin Log",description:"ADMIN LOG: Urist McAdmin has jumped to coordinates X, Y, Z",selector:".log_message",admin:!0},{type:M,name:"Attack Log",description:"Urist McTraitor has shot John Doe",admin:!0},{type:R,name:"Debug Log",description:"DEBUG: SSPlanets subsystem Recover().",selector:".pr_announce, .debug",admin:!0}]},96835:function(y,e,t){"use strict";e.__esModule=!0,e.chatReducer=e.chatMiddleware=e.ChatTabs=e.ChatPanel=e.ChatPageSettings=void 0;var n=t(15039);e.ChatPageSettings=n.ChatPageSettings;var r=t(44675);e.ChatPanel=r.ChatPanel;var o=t(41125);e.ChatTabs=o.ChatTabs;var a=t(84807);e.chatMiddleware=a.chatMiddleware;var s=t(40147);e.chatReducer=s.chatReducer},84807:function(y,e,t){"use strict";e.__esModule=!0,e.chatMiddleware=void 0;var n=i(t(22734)),r=t(27108),o=t(36471),a=t(77034),s=t(37152),u=t(69126),l=t(41950),p=t(15916),f=t(23429);function i(E){return E&&E.__esModule?E:{default:E}}function d(E,C){var S=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(S)return(S=S.call(E)).next.bind(S);if(Array.isArray(E)||(S=c(E))||C&&E&&typeof E.length=="number"){S&&(E=S);var A=0;return function(){return A>=E.length?{done:!0}:{done:!1,value:E[A++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(E,C){if(E){if(typeof E=="string")return g(E,C);var S={}.toString.call(E).slice(8,-1);return S==="Object"&&E.constructor&&(S=E.constructor.name),S==="Map"||S==="Set"?Array.from(E):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?g(E,C):void 0}}function g(E,C){(C==null||C>E.length)&&(C=E.length);for(var S=0,A=Array(C);S=0;--Et){var st=this.tryEntries[Et],yt=st.completion;if(st.tryLoc==="root")return pt("end");if(st.tryLoc<=this.prev){var Pt=A.call(st,"catchLoc"),Ct=A.call(st,"finallyLoc");if(Pt&&Ct){if(this.prev=0;--pt){var Et=this.tryEntries[pt];if(Et.tryLoc<=this.prev&&A.call(Et,"finallyLoc")&&this.prev=0;--nt){var pt=this.tryEntries[nt];if(pt.finallyLoc===tt)return this.complete(pt.completion,pt.afterLoc),mt(pt),K}}return k}(),catch:function(){function k(tt){for(var nt=this.tryEntries.length-1;nt>=0;--nt){var pt=this.tryEntries[nt];if(pt.tryLoc===tt){var Et=pt.completion;if(Et.type==="throw"){var st=Et.arg;mt(pt)}return st}}throw Error("illegal catch attempt")}return k}(),delegateYield:function(){function k(tt,nt,pt){return this.delegate={iterator:et(tt),resultName:nt,nextLoc:pt},this.method==="next"&&(this.arg=E),K}return k}()},C}function h(E,C,S,A,P,M,R){try{var V=E[M](R),j=V.value}catch($){return void S($)}V.done?C(j):Promise.resolve(j).then(A,P)}function m(E){return function(){var C=this,S=arguments;return new Promise(function(A,P){var M=E.apply(C,S);function R(j){h(M,A,P,R,V,"next",j)}function V(j){h(M,A,P,R,V,"throw",j)}R(void 0)})}}/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
-*/var S=["a","iframe","link","video"],I=function(){var E=m(d().mark(function(){function C(b){var P,A,M;return d().wrap(function(){function R(D){for(;;)switch(D.prev=D.next){case 0:P=(0,f.selectChat)(b.getState()),A=Math.max(0,p.chatRenderer.messages.length-i.MAX_PERSISTED_MESSAGES),M=p.chatRenderer.messages.slice(A).map(function(x){return(0,c.serializeMessage)(x)}),r.storage.set("chat-state",P),r.storage.set("chat-messages",M);case 5:case"end":return D.stop()}}return R}(),C)}return C}()));return function(){function C(b){return E.apply(this,arguments)}return C}()}(),O=function(){var E=m(d().mark(function(){function C(b){var P,A,M,R,D,x,V;return d().wrap(function(){function Y($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Promise.all([r.storage.get("chat-state"),r.storage.get("chat-messages")]);case 2:if(P=$.sent,A=P[0],M=P[1],!(A&&A.version<=4)){$.next=8;break}return b.dispatch((0,s.loadChat)()),$.abrupt("return");case 8:if(M){for(R=v(M);!(D=R()).done;)x=D.value,x.html&&(x.html=e.default.sanitize(x.html,{FORBID_TAGS:S}));V=[].concat(M,[(0,c.createMessage)({type:"internal/reconnected"})]),p.chatRenderer.processBatch(V,{prepend:!0})}b.dispatch((0,s.loadChat)(A));case 10:case"end":return $.stop()}}return Y}(),C)}return C}()));return function(){function C(b){return E.apply(this,arguments)}return C}()}(),T=n.chatMiddleware=function(){function E(C){var b=!1,P=!1,A=[],M=[];return p.chatRenderer.events.on("batchProcessed",function(R){P&&C.dispatch((0,s.updateMessageCount)(R))}),p.chatRenderer.events.on("scrollTrackingChanged",function(R){C.dispatch((0,s.changeScrollTracking)(R))}),setInterval(function(){return I(C)},i.MESSAGE_SAVE_INTERVAL),function(R){return function(D){var x=D.type,V=D.payload;if(b||(b=!0,O(C)),x==="chat/message"){var Y;try{Y=JSON.parse(V)}catch(et){return}var $=Y.sequence;if(A.includes($))return;var j=A.length;t:if(j>0){if(M.includes($)){M.splice(M.indexOf($),1);break t}var F=A[j-1]+1;if($!==F)for(var U=F;U<$;U++)M.push(U),Byond.sendMessage("chat/resend",U)}p.chatRenderer.processBatch([Y.content]);return}if(x===s.loadChat.type){R(D);var K=(0,f.selectCurrentChatPage)(C.getState());p.chatRenderer.changePage(K),p.chatRenderer.onStateLoaded(),P=!0;return}if(x===s.changeChatPage.type||x===s.addChatPage.type||x===s.removeChatPage.type||x===s.toggleAcceptedType.type||x===s.moveChatPageLeft.type||x===s.moveChatPageRight.type){R(D);var z=(0,f.selectCurrentChatPage)(C.getState());p.chatRenderer.changePage(z);return}if(x===s.rebuildChat.type)return p.chatRenderer.rebuildChat(),R(D);if(x===o.updateSettings.type||x===o.loadSettings.type||x===o.addHighlightSetting.type||x===o.removeHighlightSetting.type||x===o.updateHighlightSetting.type){R(D);var W=(0,a.selectSettings)(C.getState());p.chatRenderer.setHighlight(W.highlightSettings,W.highlightSettingById);return}if(x==="roundrestart")return I(C),R(D);if(x===s.saveChatToDisk.type){p.chatRenderer.saveToDisk();return}if(x===s.clearChat.type){p.chatRenderer.clearChat();return}return R(D)}}}return E}()},41950:function(y,n,t){"use strict";n.__esModule=!0,n.serializeMessage=n.isSameMessage=n.createPage=n.createMessage=n.createMainPage=n.canPageAcceptType=void 0;var e=t(90286),r=t(69126);function o(l,g){var d=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(d)return(d=d.call(l)).next.bind(d);if(Array.isArray(l)||(d=a(l))||g&&l&&typeof l.length=="number"){d&&(l=d);var h=0;return function(){return h>=l.length?{done:!0}:{done:!1,value:l[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(l,g){if(l){if(typeof l=="string")return s(l,g);var d={}.toString.call(l).slice(8,-1);return d==="Object"&&l.constructor&&(d=l.constructor.name),d==="Map"||d==="Set"?Array.from(l):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?s(l,g):void 0}}function s(l,g){(g==null||g>l.length)&&(g=l.length);for(var d=0,h=Array(g);d0){if(M.includes(H)){M.splice(M.indexOf(H),1);break t}var L=P[F-1]+1;if(H!==L)for(var x=L;x=c.length?{done:!0}:{done:!1,value:c[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(c,g){if(c){if(typeof c=="string")return s(c,g);var v={}.toString.call(c).slice(8,-1);return v==="Object"&&c.constructor&&(v=c.constructor.name),v==="Map"||v==="Set"?Array.from(c):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?s(c,g):void 0}}function s(c,g){(g==null||g>c.length)&&(g=c.length);for(var v=0,h=Array(g);v=l.length?{done:!0}:{done:!1,value:l[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(l,g){if(l){if(typeof l=="string")return p(l,g);var d={}.toString.call(l).slice(8,-1);return d==="Object"&&l.constructor&&(d=l.constructor.name),d==="Map"||d==="Set"?Array.from(l):d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d)?p(l,g):void 0}}function p(l,g){(g==null||g>l.length)&&(g=l.length);for(var d=0,h=Array(g);d0&&(W[ct.id]=Object.assign({},ct,{unreadCount:ct.unreadCount+J}))}return Object.assign({},g,{pageById:W})}if(h===e.addChatPage.type){var pt;return Object.assign({},g,{currentPageId:m.id,pages:[].concat(g.pages,[m.id]),pageById:Object.assign({},g.pageById,(pt={},pt[m.id]=m,pt))})}if(h===e.changeChatPage.type){var _,rt=m.pageId,it=Object.assign({},g.pageById[rt],{unreadCount:0});return Object.assign({},g,{currentPageId:rt,pageById:Object.assign({},g.pageById,(_={},_[rt]=it,_))})}if(h===e.updateChatPage.type){var mt,ot=m.pageId,tt=s(m,o),k=Object.assign({},g.pageById[ot],tt);return Object.assign({},g,{pageById:Object.assign({},g.pageById,(mt={},mt[ot]=k,mt))})}if(h===e.toggleAcceptedType.type){var q,nt=m.pageId,ht=m.type,Et=Object.assign({},g.pageById[nt]);return Et.acceptedTypes=Object.assign({},Et.acceptedTypes),Et.acceptedTypes[ht]=!Et.acceptedTypes[ht],Object.assign({},g,{pageById:Object.assign({},g.pageById,(q={},q[nt]=Et,q))})}if(h===e.removeChatPage.type){var ut=m.pageId,yt=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)});return delete yt.pageById[ut],yt.pages=yt.pages.filter(function(Nt){return Nt!==ut}),yt.pages.length===0&&(yt.pages.push(f.id),yt.pageById[f.id]=f,yt.currentPageId=f.id),(!yt.currentPageId||yt.currentPageId===ut)&&(yt.currentPageId=yt.pages[0]),yt}if(h===e.moveChatPageLeft.type){var Pt=m.pageId,bt=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),st=bt.pageById[Pt],gt=bt.pages.indexOf(st.id),It=gt-1;if(gt>0&&It>0){var Lt=bt.pages[gt];bt.pages[gt]=bt.pages[It],bt.pages[It]=Lt}return bt}if(h===e.moveChatPageRight.type){var Vt=m.pageId,Ot=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),ft=Ot.pageById[Vt],St=Ot.pages.indexOf(ft.id),At=St+1;if(St>0&&At=b.length?{done:!0}:{done:!1,value:b[M++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(b,P){if(b){if(typeof b=="string")return v(b,P);var A={}.toString.call(b).slice(8,-1);return A==="Object"&&b.constructor&&(A=b.constructor.name),A==="Map"||A==="Set"?Array.from(b):A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A)?v(b,P):void 0}}function v(b,P){(P==null||P>b.length)&&(P=b.length);for(var A=0,M=Array(P);A=c.length?{done:!0}:{done:!1,value:c[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(c,g){if(c){if(typeof c=="string")return p(c,g);var v={}.toString.call(c).slice(8,-1);return v==="Object"&&c.constructor&&(v=c.constructor.name),v==="Map"||v==="Set"?Array.from(c):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?p(c,g):void 0}}function p(c,g){(g==null||g>c.length)&&(g=c.length);for(var v=0,h=Array(g);v0&&(W[ct.id]=Object.assign({},ct,{unreadCount:ct.unreadCount+Q}))}return Object.assign({},g,{pageById:W})}if(h===n.addChatPage.type){var dt;return Object.assign({},g,{currentPageId:m.id,pages:[].concat(g.pages,[m.id]),pageById:Object.assign({},g.pageById,(dt={},dt[m.id]=m,dt))})}if(h===n.changeChatPage.type){var _,rt=m.pageId,it=Object.assign({},g.pageById[rt],{unreadCount:0});return Object.assign({},g,{currentPageId:rt,pageById:Object.assign({},g.pageById,(_={},_[rt]=it,_))})}if(h===n.updateChatPage.type){var mt,ot=m.pageId,et=s(m,o),k=Object.assign({},g.pageById[ot],et);return Object.assign({},g,{pageById:Object.assign({},g.pageById,(mt={},mt[ot]=k,mt))})}if(h===n.toggleAcceptedType.type){var tt,nt=m.pageId,pt=m.type,Et=Object.assign({},g.pageById[nt]);return Et.acceptedTypes=Object.assign({},Et.acceptedTypes),Et.acceptedTypes[pt]=!Et.acceptedTypes[pt],Object.assign({},g,{pageById:Object.assign({},g.pageById,(tt={},tt[nt]=Et,tt))})}if(h===n.removeChatPage.type){var st=m.pageId,yt=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)});return delete yt.pageById[st],yt.pages=yt.pages.filter(function(Nt){return Nt!==st}),yt.pages.length===0&&(yt.pages.push(f.id),yt.pageById[f.id]=f,yt.currentPageId=f.id),(!yt.currentPageId||yt.currentPageId===st)&&(yt.currentPageId=yt.pages[0]),yt}if(h===n.moveChatPageLeft.type){var Pt=m.pageId,Ct=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),lt=Ct.pageById[Pt],gt=Ct.pages.indexOf(lt.id),It=gt-1;if(gt>0&&It>0){var Lt=Ct.pages[gt];Ct.pages[gt]=Ct.pages[It],Ct.pages[It]=Lt}return Ct}if(h===n.moveChatPageRight.type){var Vt=m.pageId,Ot=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),vt=Ot.pageById[Vt],St=Ot.pages.indexOf(vt.id),At=St+1;if(St>0&&At=S.length?{done:!0}:{done:!1,value:S[M++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(S,A){if(S){if(typeof S=="string")return d(S,A);var P={}.toString.call(S).slice(8,-1);return P==="Object"&&S.constructor&&(P=S.constructor.name),P==="Map"||P==="Set"?Array.from(S):P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P)?d(S,A):void 0}}function d(S,A){(A==null||A>S.length)&&(A=S.length);for(var P=0,M=Array(A);P=s.IMAGE_RETRY_LIMIT){l.error("failed to load an image after "+M+" attempts");return}var R=A.src;A.src=null,A.src=R+"#"+M,A.setAttribute("data-reload-n",M+1)},s.IMAGE_RETRY_DELAY)},T=function(P){var A=P.node,M=P.times;if(!(!A||!M)){var R=A.querySelector(".Chat__badge"),D=R||document.createElement("div");D.textContent=M,D.className="Chat__badge",R||A.appendChild(D)}},E=function(){function b(){var A=this;this.loaded=!1,this.rootNode=null,this.queue=[],this.messages=[],this.visibleMessages=[],this.page=null,this.events=new r.EventEmitter,this.scrollNode=null,this.scrollTracking=!0,this.handleScroll=function(M){var R=A.scrollNode,D=R.scrollHeight,x=R.scrollTop+R.offsetHeight,V=Math.abs(D-x)0&&(this.processBatch(this.queue),this.queue=[])}return A}(),P.assignStyle=function(){function A(M){M===void 0&&(M={});for(var R=0,D=Object.keys(M);R{}[\]:;'"|~`_\-\\/]/g,W=String(Y).split(/[,|]/).map(function(it){return it.trim()}).filter(function(it){return it&&it.length>1&&K.test(it)&&((K.lastIndex=0)||!0)}),et,lt;if(W.length!==0){for(var ct=[],J=f(W),X;!(X=J()).done;){var at=X.value;if(at.charAt(0)==="/"&&at.charAt(at.length-1)==="/"){var dt=at.substring(1,at.length-1);if(/^(\[.*\]|\\.|.)$/.test(dt))continue;ct.push(dt)}else et||(et=[]),at=at.replace(z,"\\$&"),et.push(at)}var pt=ct.join("|"),_="g"+(U?"":"i");try{if(pt)lt=new RegExp("("+pt+")",_);else{var rt=(F?"\\b":"")+"("+et.join("|")+")"+(F?"\\b":"");lt=new RegExp(rt,_)}}catch(it){lt=null}D.highlightParsers||(D.highlightParsers=[]),D.highlightParsers.push({highlightWords:et,highlightRegex:lt,highlightColor:$,highlightWholeMessage:j})}})}return A}(),P.scrollToBottom=function(){function A(){this.scrollNode.scrollTop=this.scrollNode.scrollHeight}return A}(),P.changePage=function(){function A(M){if(!this.isReady()){this.page=M,this.tryFlushQueue();return}this.page=M,this.rootNode.textContent="",this.visibleMessages=[];for(var R=document.createDocumentFragment(),D,x=f(this.messages),V;!(V=x()).done;){var Y=V.value;(0,i.canPageAcceptType)(M,Y.type)&&(D=Y.node,R.appendChild(D),this.visibleMessages.push(Y))}D&&(this.rootNode.appendChild(R),D.scrollIntoView())}return A}(),P.getCombinableMessage=function(){function A(M,R,D,x){for(var V=D;V>=x;V--){var Y=this.visibleMessages[V],$=!Y.type.startsWith(s.MESSAGE_TYPE_INTERNAL)&&(0,i.isSameMessage)(Y,M)&&R0){this.visibleMessages=M.slice(R);for(var D=0;D0&&(this.messages=this.messages.slice(V),l.log("pruned "+V+" stored messages"))}}}return A}(),P.rebuildChat=function(){function A(){if(this.isReady()){for(var M=Math.max(0,this.messages.length-s.MAX_VISIBLE_MESSAGES),R=this.messages.slice(M),D=f(R),x;!(x=D()).done;){var V=x.value;V.node=void 0}this.rootNode.textContent="",this.messages=[],this.visibleMessages=[],this.processBatch(R,{notifyListeners:!1})}}return A}(),P.clearChat=function(){function A(){var M=this.visibleMessages;this.visibleMessages=[];for(var R=0;R\n\n\n\n'+$+"
\n\n