(this.webpackJsonp=this.webpackJsonp||[]).push([[22],{13:function(e,t,s){"use strict";s.r(t),s.d(t,"RootScope",(function(){return o}));var i=s(61),n=s(26);class o extends i.a{constructor(){super(),this._overlayIsActive=!1,this.myId=0,this.idle={isIDLE:!0,deactivated:!1,focusPromise:Promise.resolve(),focusResolve:()=>{}},this.connectionStatus={},this.peerId=0,this.config={forwarded_count_max:100,edit_time_limit:172800,pinned_dialogs_count_max:5,pinned_infolder_count_max:100,message_length_max:4096,caption_length_max:1024},this.addEventListener("peer_changed",e=>{this.peerId=e}),this.addEventListener("user_auth",e=>{this.myId=e.id}),this.addEventListener("connection_status_change",e=>{const t=e;this.connectionStatus[e.name]=t}),this.addEventListener("idle",e=>{e?this.idle.focusPromise=new Promise(e=>{this.idle.focusResolve=e}):this.idle.focusResolve()})}setThemeListener(){try{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{this.systemTheme=e.matches?"night":"day",this.myId?this.dispatchEvent("theme_change"):this.setTheme()};"addEventListener"in e?e.addEventListener("change",t):"addListener"in e&&e.addListener(t),t()}catch(e){}}setTheme(){const e="night"===this.getTheme().name,t=document.head.querySelector('[name="color-scheme"]');t&&t.setAttribute("content",e?"dark":"light"),document.documentElement.classList.toggle("night",e)}get overlayIsActive(){return this._overlayIsActive}set overlayIsActive(e){this._overlayIsActive=e,this.dispatchEvent("overlay_toggle",e)}getTheme(e=("system"===this.settings.theme?this.systemTheme:this.settings.theme)){return this.settings.themes.find(t=>t.name===e)}}const c=new o;n.a.rootScope=c,t.default=c},26:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));const i=s(53).a.debug,n="undefined"!=typeof window?window:self;t.b=i},53:function(e,t,s){"use strict";const i={test:location.search.indexOf("test=1")>0,debug:location.search.indexOf("debug=1")>0,http:!1,ssl:!0,multipleConnections:!0,asServiceWorker:!1};t.a=i},61:function(e,t,s){"use strict";s.d(t,"a",(function(){return i}));class i{constructor(e){this._constructor(e)}_constructor(e=!1){this.reuseResults=e,this.listeners={},this.listenerResults={}}addEventListener(e,t,s){var i,n;(null!==(i=this.listeners[e])&&void 0!==i?i:this.listeners[e]=[]).push({callback:t,options:s}),this.listenerResults.hasOwnProperty(e)&&(t(...this.listenerResults[e]),null===(n=s)||void 0===n?void 0:n.once)&&this.listeners[e].pop()}addMultipleEventsListeners(e){for(const t in e)this.addEventListener(t,e[t])}removeEventListener(e,t,s){this.listeners[e]&&this.listeners[e].findAndSplice(e=>e.callback===t)}dispatchEvent(e,...t){this.reuseResults&&(this.listenerResults[e]=t);const s=[],i=this.listeners[e];if(i){i.slice().forEach(n=>{var o;-1!==i.findIndex(e=>e.callback===n.callback)&&(s.push(n.callback(...t)),(null===(o=n.options)||void 0===o?void 0:o.once)&&this.removeEventListener(e,n.callback))})}return s}cleanup(){this.listeners={},this.listenerResults={}}}}}]);
//# sourceMappingURL=22.4efd5d1d801ca23bda25.chunk.js.map