=u)a.apply(null,i),s=l;else{var g;c=setTimeout(function(){return h.apply(void 0,i)},u-(l-((g=s)!=null?g:0)))}}return h}()}return o}()},90286:function(y,n){"use strict";n.__esModule=!0,n.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(E,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=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);/**
* 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(p,m){return p+m},o=function(p,m){return p-m},a=function(p,m){return p*m},u=function(p,m){return p/m},s=n.vecAdd=function(){function v(){for(var p=arguments.length,m=new Array(p),C=0;C=c.length?{done:!0}:{done:!1,value:c[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(c,h){if(c){if(typeof c=="string")return a(c,h);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,h):void 0}}function a(c,h){(h==null||h>c.length)&&(h=c.length);for(var f=0,i=Array(h);f=c.length?{done:!0}:{done:!1,value:c[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(c,h){if(c){if(typeof c=="string")return a(c,h);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,h):void 0}}function a(c,h){(h==null||h>c.length)&&(h=c.length);for(var f=0,i=Array(h);f0&&f.node.currentTime>=f.options.end;i&&f.stop()}},1e3)}var h=c.prototype;return h.destroy=function(){function f(){this.node&&(this.node.stop(),document.removeChild(this.node),clearInterval(this.playbackInterval))}return f}(),h.play=function(){function f(i,d){d===void 0&&(d={}),this.node&&(u.log("playing",i,d),this.options=d,this.node.src=i)}return f}(),h.stop=function(){function f(){if(this.node){if(this.playing)for(var i=r(this.onStopSubscribers),d;!(d=i()).done;){var l=d.value;l()}u.log("stopping"),this.playing=!1,this.node.src=""}}return f}(),h.setVolume=function(){function f(i){this.node&&(this.volume=i,this.node.volume=i)}return f}(),h.onPlay=function(){function f(i){this.node&&this.onPlaySubscribers.push(i)}return f}(),h.onStop=function(){function f(i){this.node&&this.onStopSubscribers.push(i)}return f}(),c}()},70949:function(E,n){"use strict";n.__esModule=!0,n.audioReducer=void 0;/**
+*/var u=(0,e.createLogger)("AudioPlayer"),s=n.AudioPlayer=function(){function c(){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(){u.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 l=d.value;l()}}),this.node.addEventListener("ended",function(){u.log("ended"),f.stop()}),this.node.addEventListener("error",function(i){f.playing&&(u.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 h=c.prototype;return h.destroy=function(){function f(){this.node&&(this.node.stop(),document.removeChild(this.node),clearInterval(this.playbackInterval))}return f}(),h.play=function(){function f(i,d){d===void 0&&(d={}),this.node&&(u.log("playing",i,d),this.options=d,this.node.src=i)}return f}(),h.stop=function(){function f(){if(this.node){if(this.playing)for(var i=r(this.onStopSubscribers),d;!(d=i()).done;){var l=d.value;l()}u.log("stopping"),this.playing=!1,this.node.src=""}}return f}(),h.setVolume=function(){function f(i){this.node&&(this.volume=i,this.node.volume=i)}return f}(),h.onPlay=function(){function f(i){this.node&&this.onPlaySubscribers.push(i)}return f}(),h.onStop=function(){function f(i){this.node&&this.onStopSubscribers.push(i)}return f}(),c}()},70949:function(y,n){"use strict";n.__esModule=!0,n.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 u=a.type,s=a.payload;return u==="audio/playing"?Object.assign({},o,{visible:!0,playing:!0}):u==="audio/stopped"?Object.assign({},o,{visible:!1,playing:!1}):u==="audio/playMusic"?Object.assign({},o,{meta:s}):u==="audio/stopMusic"?Object.assign({},o,{visible:!1,playing:!1,meta:null}):u==="audio/toggle"?Object.assign({},o,{visible:!o.visible}):o}return r}()},32559:function(E,n){"use strict";n.__esModule=!0,n.selectAudio=void 0;/**
+ */var t={visible:!1,playing:!1,track:null},e=n.audioReducer=function(){function r(o,a){o===void 0&&(o=t);var u=a.type,s=a.payload;return u==="audio/playing"?Object.assign({},o,{visible:!0,playing:!0}):u==="audio/stopped"?Object.assign({},o,{visible:!1,playing:!1}):u==="audio/playMusic"?Object.assign({},o,{meta:s}):u==="audio/stopMusic"?Object.assign({},o,{visible:!1,playing:!1,meta:null}):u==="audio/toggle"?Object.assign({},o,{visible:!o.visible}):o}return r}()},32559:function(y,n){"use strict";n.__esModule=!0,n.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(E,n,t){"use strict";n.__esModule=!0,n.ChatPageSettings=void 0;var e=t(89005),r=t(85307),o=t(36036),a=t(37152),u=t(69126),s=t(23429);/**
+ */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),u=t(69126),s=t(23429);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var c=n.ChatPageSettings=function(){function h(f,i){var d=(0,r.useSelector)(i,s.selectCurrentChatPage),l=(0,r.useDispatch)(i);return(0,e.createComponentVNode)(2,o.Section,{fill:!0,children:[(0,e.createComponentVNode)(2,o.Stack,{align:"center",children:[!d.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:d.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{grow:!0,ml:.5,children:(0,e.createComponentVNode)(2,o.Input,{width:"100%",value:d.name,onChange:function(){function g(v,p){return l((0,a.updateChatPage)({pageId:d.id,name:p}))}return g}()})}),!d.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:d.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.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 l((0,a.updateChatPage)({pageId:d.id,hideUnreadCount:!d.hideUnreadCount}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.createComponentVNode)(2,o.Button,{content:"Remove",icon:"times",color:"red",disabled:d.isMain,onClick:function(){function g(){return l((0,a.removeChatPage)({pageId:d.id}))}return g}()})})]}),(0,e.createComponentVNode)(2,o.Divider),(0,e.createComponentVNode)(2,o.Section,{title:"Messages to display",level:2,children:[u.MESSAGE_TYPES.filter(function(g){return!g.important&&!g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return l((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)}),(0,e.createComponentVNode)(2,o.Collapsible,{mt:1,color:"transparent",title:"Admin stuff",children:u.MESSAGE_TYPES.filter(function(g){return!g.important&&g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return l((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)})})]})]})}return h}()},44675:function(E,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 u(h,f){h.prototype=Object.create(f.prototype),h.prototype.constructor=h,s(h,f)}function s(h,f){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,d){return i.__proto__=d,i},s(h,f)}/**
+ */var c=n.ChatPageSettings=function(){function h(f,i){var d=(0,r.useSelector)(i,s.selectCurrentChatPage),l=(0,r.useDispatch)(i);return(0,e.createComponentVNode)(2,o.Section,{fill:!0,children:[(0,e.createComponentVNode)(2,o.Stack,{align:"center",children:[!d.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:d.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{grow:!0,ml:.5,children:(0,e.createComponentVNode)(2,o.Input,{width:"100%",value:d.name,onChange:function(){function g(v,p){return l((0,a.updateChatPage)({pageId:d.id,name:p}))}return g}()})}),!d.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:d.id}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.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 l((0,a.updateChatPage)({pageId:d.id,hideUnreadCount:!d.hideUnreadCount}))}return g}()})}),(0,e.createComponentVNode)(2,o.Stack.Item,{children:(0,e.createComponentVNode)(2,o.Button,{content:"Remove",icon:"times",color:"red",disabled:d.isMain,onClick:function(){function g(){return l((0,a.removeChatPage)({pageId:d.id}))}return g}()})})]}),(0,e.createComponentVNode)(2,o.Divider),(0,e.createComponentVNode)(2,o.Section,{title:"Messages to display",level:2,children:[u.MESSAGE_TYPES.filter(function(g){return!g.important&&!g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return l((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)}),(0,e.createComponentVNode)(2,o.Collapsible,{mt:1,color:"transparent",title:"Admin stuff",children:u.MESSAGE_TYPES.filter(function(g){return!g.important&&g.admin}).map(function(g){return(0,e.createComponentVNode)(2,o.Button.Checkbox,{checked:d.acceptedTypes[g.type],onClick:function(){function v(){return l((0,a.toggleAcceptedType)({pageId:d.id,type:g.type}))}return v}(),children:g.name},g.type)})})]})]})}return h}()},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 u(h,f){h.prototype=Object.create(f.prototype),h.prototype.constructor=h,s(h,f)}function s(h,f){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,d){return i.__proto__=d,i},s(h,f)}/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
-*/var c=n.ChatPanel=function(h){function f(){var d;return d=h.call(this)||this,d.ref=(0,e.createRef)(),d.state={scrollTracking:!0},d.handleScrollTrackingChange=function(l){return d.setState({scrollTracking:l})},d}u(f,h);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(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 d}(),i.render=function(){function d(){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 d}(),f}(e.Component)},41125:function(E,n,t){"use strict";n.__esModule=!0,n.ChatTabs=void 0;var e=t(89005),r=t(85307),o=t(36036),a=t(37152),u=t(23429),s=t(36471);/**
+*/var c=n.ChatPanel=function(h){function f(){var d;return d=h.call(this)||this,d.ref=(0,e.createRef)(),d.state={scrollTracking:!0},d.handleScrollTrackingChange=function(l){return d.setState({scrollTracking:l})},d}u(f,h);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(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 d}(),i.render=function(){function d(){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 d}(),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),u=t(23429),s=t(36471);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var c=function(i){var d=i.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(d,99)})},h=n.ChatTabs=function(){function f(i,d){var l=(0,r.useSelector)(d,u.selectChatPages),g=(0,r.useSelector)(d,u.selectCurrentChatPage),v=(0,r.useDispatch)(d);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(p){return(0,e.createComponentVNode)(2,o.Tabs.Tab,{selected:p===g,rightSlot:!p.hideUnreadCount&&p.unreadCount>0&&(0,e.createComponentVNode)(2,c,{value:p.unreadCount}),onClick:function(){function m(){return v((0,a.changeChatPage)({pageId:p.id}))}return m}(),children:p.name},p.id)})})}),(0,e.createComponentVNode)(2,o.Flex.Item,{ml:1,children:(0,e.createComponentVNode)(2,o.Button,{color:"transparent",icon:"plus",onClick:function(){function p(){v((0,a.addChatPage)()),v((0,s.openChatSettings)())}return p}()})})]})}return f}()},37152:function(E,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 c=function(i){var d=i.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(d,99)})},h=n.ChatTabs=function(){function f(i,d){var l=(0,r.useSelector)(d,u.selectChatPages),g=(0,r.useSelector)(d,u.selectCurrentChatPage),v=(0,r.useDispatch)(d);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(p){return(0,e.createComponentVNode)(2,o.Tabs.Tab,{selected:p===g,rightSlot:!p.hideUnreadCount&&p.unreadCount>0&&(0,e.createComponentVNode)(2,c,{value:p.unreadCount}),onClick:function(){function m(){return v((0,a.changeChatPage)({pageId:p.id}))}return m}(),children:p.name},p.id)})})}),(0,e.createComponentVNode)(2,o.Flex.Item,{ml:1,children:(0,e.createComponentVNode)(2,o.Button,{color:"transparent",icon:"plus",onClick:function(){function p(){v((0,a.addChatPage)()),v((0,s.openChatSettings)())}return p}()})})]})}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);/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
- */var o=n.loadChat=(0,e.createAction)("chat/load"),a=n.rebuildChat=(0,e.createAction)("chat/rebuild"),u=n.clearChat=(0,e.createAction)("chat/clear"),s=n.updateMessageCount=(0,e.createAction)("chat/updateMessageCount"),c=n.addChatPage=(0,e.createAction)("chat/addPage",function(){return{payload:(0,r.createPage)()}}),h=n.changeChatPage=(0,e.createAction)("chat/changePage"),f=n.updateChatPage=(0,e.createAction)("chat/updatePage"),i=n.toggleAcceptedType=(0,e.createAction)("chat/toggleAcceptedType"),d=n.removeChatPage=(0,e.createAction)("chat/removePage"),l=n.changeScrollTracking=(0,e.createAction)("chat/changeScrollTracking"),g=n.saveChatToDisk=(0,e.createAction)("chat/saveToDisk"),v=n.moveChatPageLeft=(0,e.createAction)("chat/movePageLeft"),p=n.moveChatPageRight=(0,e.createAction)("chat/movePageRight")},69126:function(E,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_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=n.loadChat=(0,e.createAction)("chat/load"),a=n.rebuildChat=(0,e.createAction)("chat/rebuild"),u=n.clearChat=(0,e.createAction)("chat/clear"),s=n.updateMessageCount=(0,e.createAction)("chat/updateMessageCount"),c=n.addChatPage=(0,e.createAction)("chat/addPage",function(){return{payload:(0,r.createPage)()}}),h=n.changeChatPage=(0,e.createAction)("chat/changePage"),f=n.updateChatPage=(0,e.createAction)("chat/updatePage"),i=n.toggleAcceptedType=(0,e.createAction)("chat/toggleAcceptedType"),d=n.removeChatPage=(0,e.createAction)("chat/removePage"),l=n.changeScrollTracking=(0,e.createAction)("chat/changeScrollTracking"),g=n.saveChatToDisk=(0,e.createAction)("chat/saveToDisk"),v=n.moveChatPageLeft=(0,e.createAction)("chat/movePageLeft"),p=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_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;/**
* @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,u=n.COMBINE_MAX_MESSAGES=5,s=n.IMAGE_RETRY_DELAY=250,c=n.IMAGE_RETRY_LIMIT=10,h=n.IMAGE_RETRY_MESSAGE_AGE=6e4,f=n.MESSAGE_TYPE_UNKNOWN="unknown",i=n.MESSAGE_TYPE_INTERNAL="internal",d=n.MESSAGE_TYPE_SYSTEM="system",l=n.MESSAGE_TYPE_LOCALCHAT="localchat",g=n.MESSAGE_TYPE_RADIO="radio",v=n.MESSAGE_TYPE_INFO="info",p=n.MESSAGE_TYPE_WARNING="warning",m=n.MESSAGE_TYPE_DEADCHAT="deadchat",C=n.MESSAGE_TYPE_OOC="ooc",I=n.MESSAGE_TYPE_ADMINPM="adminpm",A=n.MESSAGE_TYPE_MENTORPM="mentorpm",b=n.MESSAGE_TYPE_COMBAT="combat",y=n.MESSAGE_TYPE_ADMINCHAT="adminchat",S=n.MESSAGE_TYPE_MENTORCHAT="mentorchat",T=n.MESSAGE_TYPE_EVENTCHAT="eventchat",N=n.MESSAGE_TYPE_ADMINLOG="adminlog",M=n.MESSAGE_TYPE_ATTACKLOG="attacklog",w=n.MESSAGE_TYPE_DEBUG="debug",L=n.MESSAGE_TYPES=[{type:d,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"},{type:v,name:"Info",description:"Non-urgent messages from the game and items",selector:".notice:not(.pm), .adminnotice, .info, .sinister, .cult"},{type:p,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:C,name:"OOC",description:"The bluewall of global OOC messages",selector:".ooc, .adminooc"},{type:I,name:"Admin PMs",description:"Messages to/from admins (adminhelp)",selector:".adminpm, .adminhelp, .adminticket, .adminticketalt"},{type:A,name:"Mentor PMs",description:"Messages to/from mentors (mentorhelp)",selector:".mentorpm, .mentorhelp"},{type:b,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:y,name:"Admin Chat",description:"ASAY messages",selector:".admin_channel, .adminsay",admin:!0},{type:S,name:"Mentor Chat",description:"MSAY messages",selector:".mentor_channel",admin:!0},{type:N,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:w,name:"Debug Log",description:"DEBUG: SSPlanets subsystem Recover().",selector:".pr_announce, .debug",admin:!0}]},96835:function(E,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 u=t(40147);n.chatReducer=u.chatReducer},84807:function(E,n,t){"use strict";n.__esModule=!0,n.chatMiddleware=void 0;var e=i(t(22734)),r=t(27108),o=t(36471),a=t(77034),u=t(37152),s=t(69126),c=t(41950),h=t(15916),f=t(23429);function i(y){return y&&y.__esModule?y:{default:y}}function d(y,S){var T=typeof Symbol!="undefined"&&y[Symbol.iterator]||y["@@iterator"];if(T)return(T=T.call(y)).next.bind(T);if(Array.isArray(y)||(T=l(y))||S&&y&&typeof y.length=="number"){T&&(y=T);var N=0;return function(){return N>=y.length?{done:!0}:{done:!1,value:y[N++]}}}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(y,S){if(y){if(typeof y=="string")return g(y,S);var T={}.toString.call(y).slice(8,-1);return T==="Object"&&y.constructor&&(T=y.constructor.name),T==="Map"||T==="Set"?Array.from(y):T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T)?g(y,S):void 0}}function g(y,S){(S==null||S>y.length)&&(S=y.length);for(var T=0,N=Array(S);T=0;--mt){var at=this.tryEntries[mt],vt=at.completion;if(at.tryLoc==="root")return ft("end");if(at.tryLoc<=this.prev){var It=N.call(at,"catchLoc"),Q=N.call(at,"finallyLoc");if(It&&Q){if(this.prev=0;--ft){var mt=this.tryEntries[ft];if(mt.tryLoc<=this.prev&&N.call(mt,"finallyLoc")&&this.prev=0;--et){var ft=this.tryEntries[et];if(ft.finallyLoc===J)return this.complete(ft.completion,ft.afterLoc),Pt(ft),$}}return X}(),catch:function(){function X(J){for(var et=this.tryEntries.length-1;et>=0;--et){var ft=this.tryEntries[et];if(ft.tryLoc===J){var mt=ft.completion;if(mt.type==="throw"){var at=mt.arg;Pt(ft)}return at}}throw Error("illegal catch attempt")}return X}(),delegateYield:function(){function X(J,et,ft){return this.delegate={iterator:rt(J),resultName:et,nextLoc:ft},this.method==="next"&&(this.arg=y),$}return X}()},S}function p(y,S,T,N,M,w,L){try{var B=y[w](L),V=B.value}catch(j){return void T(j)}B.done?S(V):Promise.resolve(V).then(N,M)}function m(y){return function(){var S=this,T=arguments;return new Promise(function(N,M){var w=y.apply(S,T);function L(V){p(w,N,M,L,B,"next",V)}function B(V){p(w,N,M,L,B,"throw",V)}L(void 0)})}}/**
+ */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,u=n.COMBINE_MAX_MESSAGES=5,s=n.IMAGE_RETRY_DELAY=250,c=n.IMAGE_RETRY_LIMIT=10,h=n.IMAGE_RETRY_MESSAGE_AGE=6e4,f=n.MESSAGE_TYPE_UNKNOWN="unknown",i=n.MESSAGE_TYPE_INTERNAL="internal",d=n.MESSAGE_TYPE_SYSTEM="system",l=n.MESSAGE_TYPE_LOCALCHAT="localchat",g=n.MESSAGE_TYPE_RADIO="radio",v=n.MESSAGE_TYPE_INFO="info",p=n.MESSAGE_TYPE_WARNING="warning",m=n.MESSAGE_TYPE_DEADCHAT="deadchat",C=n.MESSAGE_TYPE_OOC="ooc",I=n.MESSAGE_TYPE_ADMINPM="adminpm",A=n.MESSAGE_TYPE_MENTORPM="mentorpm",b=n.MESSAGE_TYPE_COMBAT="combat",E=n.MESSAGE_TYPE_ADMINCHAT="adminchat",S=n.MESSAGE_TYPE_MENTORCHAT="mentorchat",T=n.MESSAGE_TYPE_EVENTCHAT="eventchat",N=n.MESSAGE_TYPE_ADMINLOG="adminlog",M=n.MESSAGE_TYPE_ATTACKLOG="attacklog",R=n.MESSAGE_TYPE_DEBUG="debug",L=n.MESSAGE_TYPES=[{type:d,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"},{type:v,name:"Info",description:"Non-urgent messages from the game and items",selector:".notice:not(.pm), .adminnotice, .info, .sinister, .cult"},{type:p,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:C,name:"OOC",description:"The bluewall of global OOC messages",selector:".ooc, .adminooc"},{type:I,name:"Admin PMs",description:"Messages to/from admins (adminhelp)",selector:".adminpm, .adminhelp, .adminticket, .adminticketalt"},{type:A,name:"Mentor PMs",description:"Messages to/from mentors (mentorhelp)",selector:".mentorpm, .mentorhelp"},{type:b,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:S,name:"Mentor Chat",description:"MSAY messages",selector:".mentor_channel",admin:!0},{type:N,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 u=t(40147);n.chatReducer=u.chatReducer},84807:function(y,n,t){"use strict";n.__esModule=!0,n.chatMiddleware=void 0;var e=i(t(22734)),r=t(27108),o=t(36471),a=t(77034),u=t(37152),s=t(69126),c=t(41950),h=t(15916),f=t(23429);function i(E){return E&&E.__esModule?E:{default:E}}function d(E,S){var T=typeof Symbol!="undefined"&&E[Symbol.iterator]||E["@@iterator"];if(T)return(T=T.call(E)).next.bind(T);if(Array.isArray(E)||(T=l(E))||S&&E&&typeof E.length=="number"){T&&(E=T);var N=0;return function(){return N>=E.length?{done:!0}:{done:!1,value:E[N++]}}}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,S){if(E){if(typeof E=="string")return g(E,S);var T={}.toString.call(E).slice(8,-1);return T==="Object"&&E.constructor&&(T=E.constructor.name),T==="Map"||T==="Set"?Array.from(E):T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T)?g(E,S):void 0}}function g(E,S){(S==null||S>E.length)&&(S=E.length);for(var T=0,N=Array(S);T=0;--mt){var at=this.tryEntries[mt],vt=at.completion;if(at.tryLoc==="root")return ft("end");if(at.tryLoc<=this.prev){var It=N.call(at,"catchLoc"),Q=N.call(at,"finallyLoc");if(It&&Q){if(this.prev=0;--ft){var mt=this.tryEntries[ft];if(mt.tryLoc<=this.prev&&N.call(mt,"finallyLoc")&&this.prev=0;--et){var ft=this.tryEntries[et];if(ft.finallyLoc===J)return this.complete(ft.completion,ft.afterLoc),Pt(ft),$}}return X}(),catch:function(){function X(J){for(var et=this.tryEntries.length-1;et>=0;--et){var ft=this.tryEntries[et];if(ft.tryLoc===J){var mt=ft.completion;if(mt.type==="throw"){var at=mt.arg;Pt(ft)}return at}}throw Error("illegal catch attempt")}return X}(),delegateYield:function(){function X(J,et,ft){return this.delegate={iterator:rt(J),resultName:et,nextLoc:ft},this.method==="next"&&(this.arg=E),$}return X}()},S}function p(E,S,T,N,M,R,L){try{var B=E[R](L),x=B.value}catch(j){return void T(j)}B.done?S(x):Promise.resolve(x).then(N,M)}function m(E){return function(){var S=this,T=arguments;return new Promise(function(N,M){var R=E.apply(S,T);function L(x){p(R,N,M,L,B,"next",x)}function B(x){p(R,N,M,L,B,"throw",x)}L(void 0)})}}/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
-*/var C=["a","iframe","link","video"],I=function(){var y=m(v().mark(function(){function S(T){var N,M,w;return v().wrap(function(){function L(B){for(;;)switch(B.prev=B.next){case 0:N=(0,f.selectChat)(T.getState()),M=Math.max(0,h.chatRenderer.messages.length-s.MAX_PERSISTED_MESSAGES),w=h.chatRenderer.messages.slice(M).map(function(V){return(0,c.serializeMessage)(V)}),r.storage.set("chat-state",N),r.storage.set("chat-messages",w);case 5:case"end":return B.stop()}}return L}(),S)}return S}()));return function(){function S(T){return y.apply(this,arguments)}return S}()}(),A=function(){var y=m(v().mark(function(){function S(T){var N,M,w,L,B,V,j;return v().wrap(function(){function x(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,Promise.all([r.storage.get("chat-state"),r.storage.get("chat-messages")]);case 2:if(N=Y.sent,M=N[0],w=N[1],!(M&&M.version<=4)){Y.next=8;break}return T.dispatch((0,u.loadChat)()),Y.abrupt("return");case 8:if(w){for(L=d(w);!(B=L()).done;)V=B.value,V.html&&(V.html=e.default.sanitize(V.html,{FORBID_TAGS:C}));j=[].concat(w,[(0,c.createMessage)({type:"internal/reconnected"})]),h.chatRenderer.processBatch(j,{prepend:!0})}T.dispatch((0,u.loadChat)(M));case 10:case"end":return Y.stop()}}return x}(),S)}return S}()));return function(){function S(T){return y.apply(this,arguments)}return S}()}(),b=n.chatMiddleware=function(){function y(S){var T=!1,N=!1,M=[],w=[];return h.chatRenderer.events.on("batchProcessed",function(L){N&&S.dispatch((0,u.updateMessageCount)(L))}),h.chatRenderer.events.on("scrollTrackingChanged",function(L){S.dispatch((0,u.changeScrollTracking)(L))}),setInterval(function(){return I(S)},s.MESSAGE_SAVE_INTERVAL),function(L){return function(B){var V=B.type,j=B.payload;if(T||(T=!0,A(S)),V==="chat/message"){var x;try{x=JSON.parse(j)}catch(tt){return}var Y=x.sequence;if(M.includes(Y))return;var D=M.length;t:if(D>0){if(w.includes(Y)){w.splice(w.indexOf(Y),1);break t}var U=M[D-1]+1;if(Y!==U)for(var G=U;G=l.length?{done:!0}:{done:!1,value:l[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 a(l,g){if(l){if(typeof l=="string")return u(l,g);var v={}.toString.call(l).slice(8,-1);return v==="Object"&&l.constructor&&(v=l.constructor.name),v==="Map"||v==="Set"?Array.from(l):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?u(l,g):void 0}}function u(l,g){(g==null||g>l.length)&&(g=l.length);for(var v=0,p=Array(g);v0){if(R.includes(Y)){R.splice(R.indexOf(Y),1);break t}var V=M[D-1]+1;if(Y!==V)for(var G=V;G=l.length?{done:!0}:{done:!1,value:l[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 a(l,g){if(l){if(typeof l=="string")return u(l,g);var v={}.toString.call(l).slice(8,-1);return v==="Object"&&l.constructor&&(v=l.constructor.name),v==="Map"||v==="Set"?Array.from(l):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?u(l,g):void 0}}function u(l,g){(g==null||g>l.length)&&(g=l.length);for(var v=0,p=Array(g);v=l.length?{done:!0}:{done:!1,value:l[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 c(l,g){if(l){if(typeof l=="string")return h(l,g);var v={}.toString.call(l).slice(8,-1);return v==="Object"&&l.constructor&&(v=l.constructor.name),v==="Map"||v==="Set"?Array.from(l):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?h(l,g):void 0}}function h(l,g){(g==null||g>l.length)&&(g=l.length);for(var v=0,p=Array(g);v0&&(W[ht.id]=Object.assign({},ht,{unreadCount:ht.unreadCount+k}))}return Object.assign({},g,{pageById:W})}if(p===e.addChatPage.type){var ot;return Object.assign({},g,{currentPageId:m.id,pages:[].concat(g.pages,[m.id]),pageById:Object.assign({},g.pageById,(ot={},ot[m.id]=m,ot))})}if(p===e.changeChatPage.type){var pt,Ot=m.pageId,Nt=Object.assign({},g.pageById[Ot],{unreadCount:0});return Object.assign({},g,{currentPageId:Ot,pageById:Object.assign({},g.pageById,(pt={},pt[Ot]=Nt,pt))})}if(p===e.updateChatPage.type){var Pt,dt=m.pageId,rt=u(m,o),X=Object.assign({},g.pageById[dt],rt);return Object.assign({},g,{pageById:Object.assign({},g.pageById,(Pt={},Pt[dt]=X,Pt))})}if(p===e.toggleAcceptedType.type){var J,et=m.pageId,ft=m.type,mt=Object.assign({},g.pageById[et]);return mt.acceptedTypes=Object.assign({},mt.acceptedTypes),mt.acceptedTypes[ft]=!mt.acceptedTypes[ft],Object.assign({},g,{pageById:Object.assign({},g.pageById,(J={},J[et]=mt,J))})}if(p===e.removeChatPage.type){var at=m.pageId,vt=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)});return delete vt.pageById[at],vt.pages=vt.pages.filter(function(At){return At!==at}),vt.pages.length===0&&(vt.pages.push(f.id),vt.pageById[f.id]=f,vt.currentPageId=f.id),(!vt.currentPageId||vt.currentPageId===at)&&(vt.currentPageId=vt.pages[0]),vt}if(p===e.moveChatPageLeft.type){var It=m.pageId,Q=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),ct=Q.pageById[It],yt=Q.pages.indexOf(ct.id),Tt=yt-1;if(yt>0&&Tt>0){var Dt=Q.pages[yt];Q.pages[yt]=Q.pages[Tt],Q.pages[Tt]=Dt}return Q}if(p===e.moveChatPageRight.type){var jt=m.pageId,Ct=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),lt=Ct.pageById[jt],gt=Ct.pages.indexOf(lt.id),bt=gt+1;if(gt>0&&bt=b.length?{done:!0}:{done:!1,value:b[T++]}}}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 h(b,y){if(b){if(typeof b=="string")return f(b,y);var S={}.toString.call(b).slice(8,-1);return S==="Object"&&b.constructor&&(S=b.constructor.name),S==="Map"||S==="Set"?Array.from(b):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?f(b,y):void 0}}function f(b,y){(y==null||y>b.length)&&(y=b.length);for(var S=0,T=Array(y);S=l.length?{done:!0}:{done:!1,value:l[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 c(l,g){if(l){if(typeof l=="string")return h(l,g);var v={}.toString.call(l).slice(8,-1);return v==="Object"&&l.constructor&&(v=l.constructor.name),v==="Map"||v==="Set"?Array.from(l):v==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(v)?h(l,g):void 0}}function h(l,g){(g==null||g>l.length)&&(g=l.length);for(var v=0,p=Array(g);v0&&(W[ht.id]=Object.assign({},ht,{unreadCount:ht.unreadCount+k}))}return Object.assign({},g,{pageById:W})}if(p===e.addChatPage.type){var ot;return Object.assign({},g,{currentPageId:m.id,pages:[].concat(g.pages,[m.id]),pageById:Object.assign({},g.pageById,(ot={},ot[m.id]=m,ot))})}if(p===e.changeChatPage.type){var pt,Ot=m.pageId,Nt=Object.assign({},g.pageById[Ot],{unreadCount:0});return Object.assign({},g,{currentPageId:Ot,pageById:Object.assign({},g.pageById,(pt={},pt[Ot]=Nt,pt))})}if(p===e.updateChatPage.type){var Pt,dt=m.pageId,rt=u(m,o),X=Object.assign({},g.pageById[dt],rt);return Object.assign({},g,{pageById:Object.assign({},g.pageById,(Pt={},Pt[dt]=X,Pt))})}if(p===e.toggleAcceptedType.type){var J,et=m.pageId,ft=m.type,mt=Object.assign({},g.pageById[et]);return mt.acceptedTypes=Object.assign({},mt.acceptedTypes),mt.acceptedTypes[ft]=!mt.acceptedTypes[ft],Object.assign({},g,{pageById:Object.assign({},g.pageById,(J={},J[et]=mt,J))})}if(p===e.removeChatPage.type){var at=m.pageId,vt=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)});return delete vt.pageById[at],vt.pages=vt.pages.filter(function(At){return At!==at}),vt.pages.length===0&&(vt.pages.push(f.id),vt.pageById[f.id]=f,vt.currentPageId=f.id),(!vt.currentPageId||vt.currentPageId===at)&&(vt.currentPageId=vt.pages[0]),vt}if(p===e.moveChatPageLeft.type){var It=m.pageId,Q=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),ct=Q.pageById[It],yt=Q.pages.indexOf(ct.id),Tt=yt-1;if(yt>0&&Tt>0){var Dt=Q.pages[yt];Q.pages[yt]=Q.pages[Tt],Q.pages[Tt]=Dt}return Q}if(p===e.moveChatPageRight.type){var jt=m.pageId,Ct=Object.assign({},g,{pages:[].concat(g.pages),pageById:Object.assign({},g.pageById)}),lt=Ct.pageById[jt],gt=Ct.pages.indexOf(lt.id),bt=gt+1;if(gt>0&&bt=b.length?{done:!0}:{done:!1,value:b[T++]}}}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 h(b,E){if(b){if(typeof b=="string")return f(b,E);var S={}.toString.call(b).slice(8,-1);return S==="Object"&&b.constructor&&(S=b.constructor.name),S==="Map"||S==="Set"?Array.from(b):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?f(b,E):void 0}}function f(b,E){(E==null||E>b.length)&&(E=b.length);for(var S=0,T=Array(E);S=a.IMAGE_RETRY_LIMIT){i.error("failed to load an image after "+T+" attempts");return}var N=S.src;S.src=null,S.src=N+"#"+T,S.setAttribute("data-reload-n",T+1)},a.IMAGE_RETRY_DELAY)},C=function(y){var S=y.node,T=y.times;if(!(!S||!T)){var N=S.querySelector(".Chat__badge"),M=N||document.createElement("div");M.textContent=T,M.className=(0,r.classes)(["Chat__badge","Chat__badge--animate"]),requestAnimationFrame(function(){M.className="Chat__badge"}),N||S.appendChild(M)}},I=function(){function b(){var S=this;this.loaded=!1,this.rootNode=null,this.queue=[],this.messages=[],this.visibleMessages=[],this.page=null,this.events=new e.EventEmitter,this.scrollNode=null,this.scrollTracking=!0,this.handleScroll=function(T){var N=S.scrollNode,M=N.scrollHeight,w=N.scrollTop+N.offsetHeight,L=Math.abs(M-w)0&&(this.processBatch(this.queue),this.queue=[])}return S}(),y.assignStyle=function(){function S(T){T===void 0&&(T={});for(var N=0,M=Object.keys(T);N{}[\]:;'"|~`_\-\\/]/g,G=String(B).split(/[,|]/).map(function(ot){return ot.trim()}).filter(function(ot){return ot&&ot.length>1&&D.test(ot)&&((D.lastIndex=0)||!0)}),K,$;if(G.length!==0){for(var W=[],tt=c(G),ut;!(ut=tt()).done;){var ht=ut.value;if(ht.charAt(0)==="/"&&ht.charAt(ht.length-1)==="/"){var k=ht.substring(1,ht.length-1);if(/^(\[.*\]|\\.|.)$/.test(k))continue;W.push(k)}else K||(K=[]),ht=ht.replace(U,"\\$&"),K.push(ht)}var Z=W.join("|"),nt="g"+(Y?"":"i");try{if(Z)$=new RegExp("("+Z+")",nt);else{var st=(x?"\\b":"")+"("+K.join("|")+")"+(x?"\\b":"");$=new RegExp(st,nt)}}catch(ot){$=null}M.highlightParsers||(M.highlightParsers=[]),M.highlightParsers.push({highlightWords:K,highlightRegex:$,highlightColor:V,highlightWholeMessage:j})}})}return S}(),y.scrollToBottom=function(){function S(){this.scrollNode.scrollTop=this.scrollNode.scrollHeight}return S}(),y.changePage=function(){function S(T){if(!this.isReady()){this.page=T,this.tryFlushQueue();return}this.page=T,this.rootNode.textContent="",this.visibleMessages=[];for(var N=document.createDocumentFragment(),M,w=c(this.messages),L;!(L=w()).done;){var B=L.value;(0,u.canPageAcceptType)(T,B.type)&&(M=B.node,N.appendChild(M),this.visibleMessages.push(B))}M&&(this.rootNode.appendChild(N),M.scrollIntoView())}return S}(),y.getCombinableMessage=function(){function S(T){for(var N=Date.now(),M=this.visibleMessages.length,w=M-1,L=Math.max(0,M-a.COMBINE_MAX_MESSAGES),B=w;B>=L;B--){var V=this.visibleMessages[B],j=!V.type.startsWith(a.MESSAGE_TYPE_INTERNAL)&&(0,u.isSameMessage)(V,T)&&N0){this.visibleMessages=T.slice(N);for(var M=0;M0&&(this.messages=this.messages.slice(L),i.log("pruned "+L+" stored messages"))}}}return S}(),y.rebuildChat=function(){function S(){if(this.isReady()){for(var T=Math.max(0,this.messages.length-a.MAX_VISIBLE_MESSAGES),N=this.messages.slice(T),M=c(N),w;!(w=M()).done;){var L=w.value;L.node=void 0}this.rootNode.textContent="",this.messages=[],this.visibleMessages=[],this.processBatch(N,{notifyListeners:!1})}}return S}(),y.clearChat=function(){function S(){var T=this.visibleMessages;this.visibleMessages=[];for(var N=0;N\n\n\n\n'+V+"
\n\n