16 lines
1002 KiB
JavaScript
16 lines
1002 KiB
JavaScript
function $t(...o){const e=o.reduce((s,n)=>s+(n.byteLength||n.length),0),t=new Uint8Array(e);let a=0;return o.forEach(s=>{t.set(s instanceof ArrayBuffer?new Uint8Array(s):s,a),a+=s.byteLength||s.length}),t}Uint8Array.prototype.concat=function(...o){return $t(this,...o)};Uint8Array.prototype.toJSON=function(){return[...this]};Promise.prototype.finally=Promise.prototype.finally||function(o){const e=t=>Promise.resolve(o()).then(t);return this.then(t=>e(()=>t),t=>e(()=>Promise.reject(t)))};function xn(o){return+o<0}function Ln(o){return+o>=0}String.prototype.toUserId=function(){return(+this).toUserId()};String.prototype.toChatId=function(){return(+this).toChatId()};String.prototype.toPeerId=function(o){return(+this).toPeerId(o)};String.prototype.isPeerId=function(){return/^[\d-]/.test(this.toString())};Number.prototype.toUserId=function(){return+this};Number.prototype.toChatId=function(){return Math.abs(this)};Number.prototype.toPeerId=function(o){return o===void 0?+this:o?-Math.abs(this):+this};Number.prototype.isPeerId=function(){return!0};[["isUser",Ln],["isAnyChat",xn]].forEach(o=>{const e=Array.isArray(o)?o[0]:o,t=Array.isArray(o)?o[1]:o;String.prototype[e]=function(){return t.call(null,this.toString())},Number.prototype[e]=function(){return t.call(null,+this)}});const Ae={test:location.search.indexOf("test=1")>0,debug:location.search.indexOf("debug=1")>0,http:!1,ssl:!0,asServiceWorker:!1,transport:"websocket",noSharedWorker:location.search.indexOf("noSharedWorker=1")>0,multipleTransports:!0};(Ae.http=location.search.indexOf("http=1")>0)&&(Ae.multipleTransports=!1);Ae.multipleTransports&&(Ae.http=!0);Ae.http&&(Ae.transport="https");const qe=Ae.debug,Hi=typeof window<"u"?window:self,Ue=Hi,ks=Date.now()%Math.random()*1e8|0,we=typeof window<"u"?window:self;function Oe(o,e){const t=o.indexOf(e);return(t===-1?void 0:o.splice(t,1))?.[0]}const Fa=typeof ServiceWorkerGlobalScope<"u"&&self instanceof ServiceWorkerGlobalScope,os=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&!Fa,ga=os||Fa,Wi=()=>self.clients.matchAll({includeUncontrolled:!1,type:"window"}),On=(o,...e)=>{try{o.postMessage(...e)}catch(t){console.error("[worker] postMessage error:",t,e)}},Vn=(o,...e)=>{Wi().then(t=>{t.length&&t.slice(o?0:-1).forEach(a=>{On(a,...e)})})},Nn=(...o)=>{On(self,...o)},qn=()=>{};Fa&&Vn.bind(null,!1);Fa&&Vn.bind(null,!0);class ua{constructor(e){this._constructor(e)}_constructor(e){this.reuseResults=e,this.listeners={},this.listenerResults={}}addEventListener(e,t,a){var n;const s={callback:t,options:a};if(((n=this.listeners)[e]??(n[e]=new Set)).add(s),this.listenerResults.hasOwnProperty(e)&&(t(...this.listenerResults[e]),a?.once)){this.listeners[e].delete(s);return}}addMultipleEventsListeners(e){for(const t in e)this.addEventListener(t,e[t])}removeEventListener(e,t,a){if(this.listeners[e]){for(const s of this.listeners[e])if(s.callback===t){this.listeners[e].delete(s);break}}}invokeListenerCallback(e,t,...a){let s,n;try{s=t.callback(...a)}catch(i){n=i}if(t.options?.once&&this.removeEventListener(e,t.callback),n)throw n;return s}_dispatchEvent(e,t,...a){this.reuseResults&&(this.listenerResults[e]=a);const s=t&&[],n=this.listeners[e];if(n)for(const i of n){const r=this.invokeListenerCallback(e,i,...a);s&&s.push(r)}return s}dispatchResultableEvent(e,...t){return this._dispatchEvent(e,!0,...t)}dispatchEvent(e,...t){this._dispatchEvent(e,!1,...t)}cleanup(){this.listeners={},this.listenerResults={}}}const ls={};function Ee(o){return ls[o]??(ls[o]={type:o})}const qa=navigator?navigator.userAgent:null;navigator.userAgent.search(/OS X|iPhone|iPad|iOS/i);navigator.userAgent.toLowerCase().indexOf("android");(()=>{try{return+navigator.userAgent.match(/Chrom(?:e|ium)\/(.+?)(?:\s|\.)/)[1]}catch{}})();const zi="safari"in we||!!(qa&&(/\b(iPad|iPhone|iPod)\b/.test(qa)||qa.match("Safari")&&!qa.match("Chrome"))),Ki=navigator.userAgent.toLowerCase().indexOf("firefox")>-1;(navigator.maxTouchPoints===void 0||navigator.maxTouchPoints>0)&&navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i)!=-1;const Ji=Date.now();function Qa(){return"["+((Date.now()-Ji)/1e3).toFixed(3)+"]"}var ke=(o=>(o[o.None=0]="None",o[o.Error=1]="Error",o[o.Warn=2]="Warn",o[o.Log=4]="Log",o[o.Debug=8]="Debug",o))(ke||{});const Qi=[0,1,2,4,8],Yi=zi||Ki,tn=!Yi,gs={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",fg:{black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},bg:{black:"\x1B[40m",red:"\x1B[41m",green:"\x1B[42m",yellow:"\x1B[43m",blue:"\x1B[44m",magenta:"\x1B[45m",cyan:"\x1B[46m",white:"\x1B[47m"}},$i=[["debug",8],["info",4],["warn",2],["error",1],["assert",1],["trace",4],["group",4],["groupCollapsed",4],["groupEnd",4]];function We(o,e=7,t=!1,a=""){let s;!qe&&!t&&(e=1),tn?a||(Fa?a=gs.fg.yellow:os&&(a=gs.fg.cyan)):a="";const n=a;a?a=`%s ${a}%s`:a="%s";const i=function(...p){return e&4&&console.log(a,Qa(),o,...p)};$i.forEach(([p,d])=>{i[p]=function(...f){return e&d&&console[p](a,Qa(),o,...f)}}),i.setPrefix=function(p){s=p,o="["+p+"]"},i.setPrefix(o),i.setLevel=function(p){e=Qi.slice(0,p+1).reduce((d,f)=>d|f,0)};const r={};return i.bindPrefix=function(p,d=e){return r[p]??(r[p]=We(`${s}] ${tn&&n?gs.reset:""}[${p}`,d,t,n))},i}const Zi=!0;class Gs extends ua{constructor(e){super(!1),this.logSuffix=e,this.onMessage=t=>{const a=t.data,s=t.source||t.currentTarget;this.processTaskMap[a.type](a,s,t)},this.processResultTask=t=>{const{taskId:a,result:s,error:n}=t.payload,i=this.awaiting[a];i&&(this.debug&&this.log.debug("done",i.taskType,s,n),"error"in t.payload?i.reject(n):i.resolve(s),delete this.awaiting[a])},this.processAckTask=t=>{const a=t.payload,s=this.awaiting[a.taskId];if(!s)return;const n=s.resolve,i={cached:a.cached,result:a.cached?"result"in a?Promise.resolve(a.result):Promise.reject(a.error):new Promise((r,p)=>{s.resolve=r,s.reject=p})};n(i),a.cached&&delete this.awaiting[a.taskId]},this.processPingTask=(t,a,s)=>{this.pushTask(this.createTask("pong",void 0),s.source)},this.processPongTask=(t,a,s)=>{const n=this.pingResolves.get(a);n&&(this.pingResolves.delete(a),n())},this.processCloseTask=(t,a,s)=>{this.detachPort(a)},this.processBatchTask=(t,a,s)=>{const n={data:s.data,source:s.source,currentTarget:s.currentTarget};t.payload.forEach(i=>{n.data=i,this.onMessage(n)})},this.processLockTask=(t,a,s)=>{const n=t.payload;this.requestedLocks.has(n)||(this.requestedLocks.set(n,a),navigator.locks.request(n,()=>{this.processCloseTask(void 0,a,void 0),this.requestedLocks.delete(n)}))},this.processInvokeTask=async(t,a,s)=>{const n=t.id,i=t.payload;let r,p,d;i.void||(r={taskId:n},p=this.createTask("result",r)),i.withAck&&(d=this.createTask("ack",{taskId:n,cached:!0}));let f;try{const c=this.listeners[i.type];if(!c?.size)throw new Error("no listener");const l=c.values().next().value;let m=this.invokeListenerCallback(i.type,l,i.payload,a,s);if(i.void)return;if(f=m instanceof Promise,d){const u=!f;if(d.payload.cached=u,u&&(d.payload.result=m),this.pushTask(d,a),u)return}f&&(m=await m),r.result=m}catch(c){if(this.log.error("worker task error:",c,t),i.void)return;if(d&&d.payload.cached){d.payload.error=c,this.pushTask(d,a);return}r.error=c}this.pushTask(p,a)},this.listenPorts=[],this.sendPorts=[],this.pingResolves=new Map,this.taskId=0,this.awaiting={},this.pending=new Map,this.log=We("MP"+(e?"-"+e:"")),this.debug=qe,this.heldLocks=new Map,this.requestedLocks=new Map,this.processTaskMap={result:this.processResultTask,ack:this.processAckTask,invoke:this.processInvokeTask,ping:this.processPingTask,pong:this.processPongTask,close:this.processCloseTask,lock:this.processLockTask,batch:this.processBatchTask}}setOnPortDisconnect(e){this.onPortDisconnect=e}attachPort(e){this.attachListenPort(e),this.attachSendPort(e)}attachListenPort(e){this.listenPorts.push(e),e.addEventListener("message",this.onMessage)}attachSendPort(e){if(this.log.warn("attaching send port"),e.start?.(),this.sendPorts.push(e),typeof window<"u"&&Zi)if("locks"in navigator){const t=["lock",ks,this.logSuffix||"",Math.random()*2147483647|0].join("-");this.log.warn("created lock",t);const a=new Promise(s=>this.heldLocks.set(e,{resolve:s,id:t})).then(()=>this.heldLocks.delete(e));navigator.locks.request(t,()=>(this.resendLockTask(e),a))}else window.addEventListener("beforeunload",()=>{const t=this.createTask("close",void 0);this.postMessage(void 0,t)});this.releasePending()}resendLockTask(e){const t=this.heldLocks.get(e);t&&this.pushTask(this.createTask("lock",t.id),e)}detachPort(e){this.log.warn("disconnecting port"),Oe(this.listenPorts,e),Oe(this.sendPorts,e),e.removeEventListener?.("message",this.onMessage),e.close?.(),this.onPortDisconnect?.(e),this.heldLocks.get(e)?.resolve();const a=Ee("PORT_DISCONNECTED");for(const s in this.awaiting){const n=this.awaiting[s];n.port===e&&(n.reject(a),delete this.awaiting[s])}}postMessage(e,t){(Array.isArray(e)?e:e?[e]:this.sendPorts).forEach(s=>{s.postMessage(t,t.transfer)})}async releasePending(){this.releasingPending||(this.releasingPending=!0,await Promise.resolve(),this.debug&&this.log.debug("releasing tasks, length:",this.pending.size),this.pending.forEach((e,t)=>{let a=e;{let n;a=[],e.forEach(i=>{i.transfer?(n=void 0,a.push(i)):(n||(n=this.createTask("batch",[]),a.push(n)),n.payload.push(i))})}const s=t?[t]:this.sendPorts;s.length&&(a.forEach(n=>{try{this.postMessage(s,n)}catch(i){this.log.error("postMessage error:",i,n,s)}}),this.pending.delete(t))}),this.debug&&this.log.debug("released tasks"),this.releasingPending=!1)}createTask(e,t,a){return{type:e,payload:t,id:this.taskId++,transfer:a}}createInvokeTask(e,t,a,s,n){return this.createTask("invoke",{type:e,payload:t,withAck:a,void:s},n)}pushTask(e,t){let a=this.pending.get(t);a||this.pending.set(t,a=[]),a.push(e),this.releasePending()}invokeVoid(e,t,a,s){const n=this.createInvokeTask(e,t,void 0,!0,s);this.pushTask(n,a)}invoke(e,t,a,s,n){this.debug&&this.log.debug("start",e,t);let i;const r=new Promise((p,d)=>{i=this.createInvokeTask(e,t,a,void 0,n),this.awaiting[i.id]={resolve:p,reject:d,taskType:e,port:s},this.pushTask(i,s)});if(ga){r.finally(()=>{clearInterval(p)});const p=we.setInterval(()=>{this.log.error("task still has no result",i,s)},6e4)}return r}invokeExceptSource(e,t,a){const s=this.sendPorts.slice();Oe(s,a),s.forEach(n=>{this.invokeVoid(e,t,n)})}}class Xi extends Gs{constructor(){super("CRYPTO"),this.lastIndex=-1}invokeCryptoNew({method:e,args:t,transfer:a}){const s={method:e,args:t},n=this.listeners.invoke;if(n?.size){let r=n.values().next().value.callback(s);return!ga&&!(r instanceof Promise)&&(r=Promise.resolve(r)),r}const i=e==="aes-encrypt"||e==="aes-decrypt"?this.lastIndex=(this.lastIndex+1)%this.sendPorts.length:0;return this.invoke("invoke",s,void 0,this.sendPorts[i],a)}invokeCrypto(e,...t){return this.invokeCryptoNew({method:e,args:t})}}const _e=new Xi;Ue&&(Ue.cryptoMessagePort=_e);let jn;function Rt(){return jn}function er(o){return jn=o}const lt=0,Gn=1271266957,tr=777,ar=2666e3,As=777e3,Hn=2147483647,an=20*1024*1024,ba="",sr="default_static",ka=4294967296,Wn=ka+1,nr=!1,ir=new Set(["web","k","z","a"]),ct=0,Dt=1,je=new Set([ct,Dt]),ms=Math.max(...Array.from(je))+1;class Be extends Gs{constructor(){super("MTPROTO"),Be.INSTANCE=this,Ue&&(Ue.mtprotoMessagePort=this)}static getInstance(){return this.INSTANCE}}class zn extends ua{constructor(){super(),this.myId=lt,this.connectionStatus={},this.premium=!1,this.addEventListener("user_auth",({id:e})=>{this.myId=e.toPeerId()}),this.addEventListener("premium_toggle_private",({isNew:e,isPremium:t})=>{this.premium=t,e||this.dispatchEventSingle("premium_toggle",t)}),this.addEventListener("connection_status_change",e=>{this.connectionStatus[e.name]=e}),this.dispatchEvent=(e,...t)=>{super.dispatchEvent(e,...t),Be.getInstance().invokeVoid("event",{name:e,args:t})},ga||this.addEventListener("settings_updated",({settings:e})=>{this.settings=e})}getConnectionStatus(){return this.connectionStatus}getPremium(){return this.premium}dispatchEventSingle(...e){super.dispatchEvent(...e)}}const Vt=new zn;Ue.rootScope=Vt;function Ge(){}const rr={isFulfilled:!1,isRejected:!1,notify:()=>{},notifyAll:function(...o){this.lastNotify=o,this.listeners?.forEach(e=>e(...o))},addNotifyListener:function(o){this.lastNotify&&o(...this.lastNotify),(this.listeners??(this.listeners=[])).push(o)},resolve:function(o){this.isFulfilled||this.isRejected||(this.isFulfilled=!0,this._resolve(o),this.onFinish())},reject:function(...o){this.isRejected||this.isFulfilled||(this.isRejected=!0,this._reject(...o),this.onFinish())},onFinish:function(){this.notify=this.notifyAll=this.lastNotify=null,this.listeners&&(this.listeners.length=0),this.cancel&&(this.cancel=Ge)}};function Pe(){let o,e;const t=new Promise((a,s)=>{o=a,e=s});return Object.assign(t,rr),t._resolve=o,t._reject=e,t}self.deferredPromise=Pe;function ca(o,e,t=!0){let a=null,s,n;const i=()=>{clearInterval(a),a=null},r=(...p)=>{s=!0,n=p,a||(t&&(s=!1,o(...n)),a=setInterval(()=>{if(!s){i();return}s=!1,o(...n)},e))};return r.clear=i,r}function Fs(o,e){if(e)for(const t in e)e[t]!==void 0&&(o[t]=e[t]);return o}const Da=class Da{constructor(e){Fs(this,e),Ae.test&&(this.name+="_test"),this.storageIsAvailable=!0,this.log=We(["IDB",e.name].join("-")),this.log("constructor"),this.openDatabase(!0),Da.INSTANCES.push(this)}isAvailable(){return this.storageIsAvailable}openDatabase(e=!1){if(this.openDbPromise&&!e)return this.openDbPromise;const t=(i,r)=>{const p=Array.from(i.indexNames);for(const d of p)i.deleteIndex(d);if(r.indexes?.length)for(const d of r.indexes)i.indexNames.contains(d.indexName)||i.createIndex(d.indexName,d.keyPath,d.objectParameters)},a=(i,r)=>{const p=i.createObjectStore(r.name);t(p,r)};try{var s=indexedDB.open(this.name,this.version);if(!s)return Promise.reject()}catch(i){return this.log.error("error opening db",i.message),this.storageIsAvailable=!1,Promise.reject(i)}let n=!1;return setTimeout(()=>{n||s.onerror(Ee("IDB_CREATE_TIMEOUT"))},3e3),this.openDbPromise=new Promise((i,r)=>{s.onsuccess=p=>{n=!0;const d=s.result;let f=!1;this.log("Opened"),d.onerror=c=>{this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",c),r(c)},d.onclose=c=>{this.log.error("closed:",c),!f&&this.openDatabase()},d.onabort=c=>{this.log.error("abort:",c);const l=c.target;this.openDatabase(f=!0),l.onerror&&l.onerror(c),d.close()},d.onversionchange=c=>{this.log.error("onversionchange, lol?")},i(this.db=d)},s.onerror=p=>{n=!0,this.storageIsAvailable=!1,this.log.error("Error creating/accessing IndexedDB database",p),r(p)},s.onupgradeneeded=p=>{n=!0,this.log.warn("performing idb upgrade from",p.oldVersion,"to",p.newVersion);const d=p.target,f=d.result;this.stores.forEach(c=>{if(!f.objectStoreNames.contains(c.name))a(f,c);else{const m=d.transaction.objectStore(c.name);t(m,c)}})}})}static create(e){return this.INSTANCES.find(t=>t.name===e.name)??new Da(e)}static closeDatabases(e){this.INSTANCES.forEach(t=>{if(e&&e===t)return;const a=t.db;a&&(a.onclose=()=>{},a.close())})}};Da.INSTANCES=[];let Ya=Da;class or{constructor(e,t){this.storeName=t,this.log=We(["IDB",e.name,t].join("-")),this.idb=Ya.create(e)}delete(e,t){const a=Array.isArray(e);return a||(e=[].concat(e)),this.getObjectStore("readwrite",s=>{const n=e.map(i=>s.delete(i));return a?n:n[0]},"",t)}clear(e){return this.getObjectStore("readwrite",t=>t.clear(),"",e)}save(e,t,a){const s=Array.isArray(e);return s||(e=[].concat(e),t=[].concat(t)),this.getObjectStore("readwrite",n=>{const i=e.map((r,p)=>n.put(t[p],r));return s?i:i[0]},"",a)}get(e,t){const a=Array.isArray(e);if(a){if(!e.length)return Promise.resolve([])}else{if(!e)return;e=[].concat(e)}return this.getObjectStore("readonly",s=>{const n=e.map(i=>s.get(i));return a?n:n[0]},"",t)}getObjectStore(e,t,a,s=this.storeName){let n;return a&&(n=performance.now(),this.log(a+": start")),this.idb.openDatabase().then(i=>new Promise((r,p)=>{const d=i.transaction([s],e,{durability:"relaxed"}),f=()=>{clearTimeout(m),p(d.error)},c=()=>{clearTimeout(m),a&&this.log(a+": end",performance.now()-n);const F=A.map(L=>L.result);r(M?F:F[0])};d.onerror=f;const l=e==="readwrite";l&&(d.oncomplete=()=>c());const m=setTimeout(()=>{this.log.error("transaction not finished",d,a)},1e4),u=t(d.objectStore(s)),M=Array.isArray(u),A=M?u:[].concat(u);if(l)return;const w=A.length;let C=w;const I=()=>{d.error||--C||c()};for(let F=0;F<w;++F){const L=A[F];L.onerror=f,L.onsuccess=I}}))}getAll(e){return this.getObjectStore("readonly",t=>t.getAll(),"",e)}}function sn(){}const hs=16,da=class da{constructor(e,t){this.db=e,this.storeName=t,this.cache={},this.getPromises=new Map,this.keysToSet=new Set,this.saveDeferred=Pe(),this.keysToDelete=new Set,this.deleteDeferred=Pe(),this.storage=new or(e,t),da.STORAGES.length?this.useStorage=da.STORAGES[0].useStorage:this.useStorage=!0,this.savingFreezed=!1,da.STORAGES.push(this),this.saveThrottled=ca(async()=>{const a=this.saveDeferred;this.saveDeferred=Pe();const s=this.keysToSet;if(s.size){const n=Array.from(s.values());s.clear();const i=n.map(r=>this.cache[r]);try{await this.storage.save(n,i)}catch(r){console.error("[AS]: set error:",r,n,i)}}a.resolve(),s.size&&this.saveThrottled()},hs,!1),this.deleteThrottled=ca(async()=>{const a=this.deleteDeferred;this.deleteDeferred=Pe();const s=this.keysToDelete;if(s.size){const n=Array.from(s.values());s.clear();try{await this.storage.delete(n)}catch(i){console.error("[AS]: delete error:",i,n)}}a.resolve(),s.size&&this.deleteThrottled()},hs,!1),this.getThrottled=ca(async()=>{const a=Array.from(this.getPromises.keys());this.storage.get(a).then(s=>{for(let n=0,i=a.length;n<i;++n){const r=a[n],p=this.getPromises.get(r);p&&(p.resolve(this.cache[r]=s[n]),this.getPromises.delete(r))}},s=>{new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE"]).has(s.type)||(this.useStorage=!1,console.error("[AS]: get error:",s,a,t));for(let i=0,r=a.length;i<r;++i){const p=a[i],d=this.getPromises.get(p);d&&(d.resolve(void 0),this.getPromises.delete(p))}}).finally(()=>{this.getPromises.size&&this.getThrottled()})},hs,!1)}isAvailable(){return this.useStorage}getCache(){return this.cache}getFromCache(e){return this.cache[e]}setToCache(e,t){return this.cache[e]=t}async get(e,t=!0){if(this.cache.hasOwnProperty(e)&&t)return this.getFromCache(e);if(this.useStorage){const a=this.getPromises.get(e);if(a)return a;const s=Pe();return this.getPromises.set(e,s),this.getThrottled(),s}}getAll(){return this.storage.getAll().catch(()=>[])}set(e,t=!1){const a=this.useStorage&&!t&&!this.savingFreezed;for(const s in e)if(e.hasOwnProperty(s)){const n=e[s];this.setToCache(s,n),a&&(this.keysToSet.add(s),this.keysToDelete.delete(s),this.saveThrottled())}return a?this.saveDeferred:Promise.resolve()}delete(e,t=!1){return e=""+e,t||delete this.cache[e],this.useStorage&&(this.keysToSet.delete(e),this.keysToDelete.add(e),this.deleteThrottled()),this.useStorage?this.deleteDeferred:Promise.resolve()}clear(e=!1){if(!e)for(const t in this.cache)delete this.cache[t];return this.storage.clear().catch(sn)}static toggleStorage(e,t){return Promise.all(this.STORAGES.map(a=>{if(a.useStorage=e,!(!ga||!t))return e?a.set(a.cache):(a.keysToSet.clear(),a.keysToDelete.clear(),a.getPromises.forEach(s=>s.resolve(void 0)),a.getPromises.clear(),a.clear(!0))})).catch(sn)}static freezeSaving(e,t){this.STORAGES.forEach(a=>a.savingFreezed=!0);try{e()}catch(a){console.error("freezeSaving callback error:",a)}this.STORAGES.forEach(a=>a.savingFreezed=!1)}};da.STORAGES=[];let Gt=da;Ue&&(Ue.AppStorage=Gt);const Hs={name:"tweb",version:7,stores:[{name:"session"},{name:"stickerSets"},{name:"users"},{name:"chats"},{name:"dialogs"},{name:"messages"}]};class pr extends Gt{constructor(){super(Hs,"session")}}const Ht=new pr;Ue.stateStorage=Ht;const Ws="";function $a(...o){return o.join(Ws)}function dr(o){return o.split(Ws)}function fr(o,e,t,a){const s=e.split(Ws),n=s.length;let i=o;for(let p=0;p<n-1;++p){const d=s[p];i=i[d]??(i[d]={})}const r=s[n-1];t===void 0&&a?delete i[r]:i[r]=t}class cr{constructor(){this.state={},this.storage=Ht}getState(){return Promise.resolve(this.state)}setByKey(e,t){fr(this.state,e,t);const a=dr(e)[0];return a==="settings"&&Vt.dispatchEvent("settings_updated",{key:e,value:t,settings:this.state.settings}),this.pushToState(a,this.state[a])}pushToState(e,t,a=!0,s){return a&&(this.state[e]=t),this.setKeyValueToStorage(e,t,s)}setKeyValueToStorage(e,t=this.state[e],a){return Be.getInstance().invokeVoid("mirror",{name:"state",key:e,value:t}),this.storage.set({[e]:t},a)}}const ra=new cr,nn=["web.telegram.org","webk.telegram.org"],rn=Math.min(4,navigator.hardwareConcurrency??4),Ve={id:1025907,hash:"452b0359b988148995f22ff0f4229750",version:"2.1.0",versionFull:"2.1.0 (520)",build:520,langPackVersion:"5.5.8",langPack:"webk",langPackCode:"en",domains:nn,baseDcId:2,isMainDomain:nn.includes(location.hostname),suffix:"K",threads:rn,cryptoWorkers:rn};Ve.isMainDomain&&(Ve.id=2496,Ve.hash="8da85b0d5bfe62527e5b244c209159c3");function rt(o){return new Promise(e=>{setTimeout(e,o)})}class Nt{constructor(e,t,a){this.dcId=e,this.url=t,this.pending=[],this.debug=Ae.debug&&!1;let s=ke.Error|ke.Log;this.debug&&(s|=ke.Debug),this.log=We(`HTTP-${e}`+a,s),this.log("constructor"),this.connected=!1}_send(e,t){this.debug&&this.log.debug("-> body length to send:",e.length);const a=new AbortController,s=setTimeout(()=>a.abort(),3e4);return fetch(this.url,{method:"POST",body:e,mode:t,signal:a.signal}).then(async n=>{if(n.status!==200&&!t)throw n.arrayBuffer().then(r=>{this.log.error("not 200",new TextDecoder("utf-8").decode(new Uint8Array(r)))}),n;this.setConnected(!0);const i=await n.arrayBuffer();return new Uint8Array(i)}).catch(n=>{throw this.setConnected(!1),n}).finally(()=>{clearTimeout(s)})}setConnected(e){this.connected===e||this.destroyed||(this.connected=e,Ae.multipleTransports&&ma.setTransportValue("https",e))}destroy(){this.setConnected(!1),this.destroyed=!0,this.pending.forEach(e=>e.reject()),this.pending.length=0}send(e){if(this.networker)return this._send(e);{const t=new Promise((a,s)=>{this.pending.push({resolve:a,reject:s,body:e})});return this.releasePending(),t}}async releasePending(){if(!this.releasing){this.releasing=!0;for(let e=0;e<this.pending.length;++e){const t=this.pending[e],{body:a,resolve:s}=t;try{const n=await this._send(a);s(n),this.pending.splice(e,1)}catch(n){this.log.error("Send plain request error:",n),await rt(5e3)}--e}this.releasing=!1}}}class lr extends ua{constructor(e,t,a){super(),this.dcId=e,this.url=t,this.debug=Ae.debug&&!1,this.handleOpen=()=>{this.log("opened"),this.debug&&this.log.debug("sending init packet"),this.dispatchEvent("open")},this.handleError=n=>{this.log.error("handleError",n),this.close()},this.handleClose=n=>{this.log("closed",n),this.removeListeners(),this.dispatchEvent("close")},this.handleMessage=n=>{this.debug&&this.log.debug("<-","handleMessage",n.data.byteLength),this.dispatchEvent("message",n.data)},this.send=n=>{this.debug&&this.log.debug("-> body length to send:",n.length),this.ws.send(n)};let s=ke.Error|ke.Log;return this.debug&&(s|=ke.Debug),this.log=We(`WS-${e}`+a,s),this.log("constructor"),this.connect(),this}removeListeners(){this.ws&&(this.ws.removeEventListener("open",this.handleOpen),this.ws.removeEventListener("close",this.handleClose),this.ws.removeEventListener("error",this.handleError),this.ws.removeEventListener("message",this.handleMessage),this.ws=void 0)}connect(){this.ws=new WebSocket(this.url,"binary"),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",this.handleOpen),this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("error",this.handleError),this.ws.addEventListener("message",this.handleMessage)}close(){if(this.ws){this.log("close execution");try{this.ws.close()}catch{}this.handleClose()}}}function Tt(o){if(crypto&&"getRandomValues"in crypto)crypto.getRandomValues(o);else throw new Error("NO_SECURE_RANDOM");return o}class gr{constructor(){this._process=(e,t)=>_e.invokeCryptoNew({method:"aes-ctr-process",args:[{id:this.id,data:e,operation:t}],transfer:[e.buffer]})}async init(e){this.idPromise!==void 0&&this.release();const t=new Uint8Array(64);for(Tt(t);;){const f=t[3]<<24|t[2]<<16|t[1]<<8|t[0],c=t[7]<<24|t[6]<<16|t[5]<<8|t[4];if(t[0]!==239&&f!==1145128264&&f!==1414745936&&f!==542393671&&f!==1230262351&&f!==4008636142&&f!==3722304989&&c!==0)break;Tt(t)}const a=t.slice().reverse(),s=t.slice(8,40),n=t.slice(40,56),i=a.slice(8,40),r=a.slice(40,56),p=this.idPromise=_e.invokeCrypto("aes-ctr-prepare",{encKey:s,encIv:n,decKey:i,decIv:r});this.process=async(f,c)=>(await p,this._process(f,c)),this.id=await p,this.process=this._process,t.set(e.obfuscateTag,56);const d=await this.encode(t.slice());return t.set(d.slice(56,64),56),t}encode(e){return this.process(e,"encrypt")}decode(e){return this.process(e,"decrypt")}async release(){const e=this.idPromise;if(e===void 0)return;this.id=void 0,this.idPromise=void 0;const t=await e;_e.invokeCrypto("aes-ctr-destroy",t)}destroy(){this.release()}}class mr{constructor(){this.tag=239,this.obfuscateTag=new Uint8Array([this.tag,this.tag,this.tag,this.tag])}encodePacket(e){const t=e.byteLength>>2;let a;return t<127?a=new Uint8Array([t]):a=new Uint8Array([127,t&255,t>>8&255,t>>16&255]),a.concat(e)}readPacket(e){let t=e[0];return t>=127?(t=e[1]|e[2]<<8|e[3]<<16,e.slice(4,t<<3)):e.slice(1,t<<3)}}var hr=new mr,Mt=(o=>(o[o.Connected=0]="Connected",o[o.Connecting=1]="Connecting",o[o.Closed=2]="Closed",o[o.TimedOut=3]="TimedOut",o))(Mt||{});function Te(o){const e=o.length,t=new Array(e);for(let a=0;a<e;++a)t[a]=(o[a]<16?"0":"")+(o[a]||0).toString(16);return t.join("")}class ur{constructor(e,t,a,s,n){this.Connection=e,this.dcId=t,this.url=a,this.logSuffix=s,this.retryTimeout=n,this.codec=hr,this.obfuscation=new gr,this.pending=[],this.debug=Ae.debug&&!1,this.connected=!1,this.autoReconnect=!0,this.onOpen=async()=>{this.connected=!0,Ae.multipleTransports&&ma.setTransportOpened("websocket");const r=await this.obfuscation.init(this.codec);this.connected&&(this.connection.send(r),this.networker&&(this.pending.length=0,this.networker.onTransportOpen()),setTimeout(()=>{this.releasePending()},0))},this.onMessage=async r=>{const p=Date.now();let d=await this.obfuscation.decode(new Uint8Array(r));if(d=this.codec.readPacket(d),this.networker){this.networker.onTransportData(d,p);return}const f=this.pending.shift();if(!f){this.debug&&this.log.debug("no pending for res:",Te(d));return}f.resolve(d)},this.onClose=()=>{this.clear();let r,p;if(this.autoReconnect){const d=Date.now(),f=d-this.lastCloseTime;r=!isNaN(f)&&f<this.retryTimeout?this.retryTimeout-f:0,p=d+r}this.networker&&(this.networker.setConnectionStatus(Mt.Closed,p),this.pending.length=0),this.autoReconnect?(this.log("will try to reconnect after timeout:",r/1e3),this.reconnectTimeout=we.setTimeout(this.reconnect,r)):this.log("reconnect isn't needed")},this.reconnect=()=>{if(this.reconnectTimeout!==void 0&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0),!this.connection){if(this.log("trying to reconnect..."),this.lastCloseTime=Date.now(),this.networker)this.networker.setConnectionStatus(Mt.Connecting);else for(const r of this.pending)r.bodySent&&(r.bodySent=!1);this.connect()}};let i=ke.Error|ke.Log;this.debug&&(i|=ke.Debug),this.log=We(`TCP-${t}`+s,i),this.log("constructor"),this.connect()}clear(){Ae.multipleTransports&&this.connected&&ma.setTransportClosed("websocket"),this.connected=!1,this.connection&&(this.connection.removeEventListener("open",this.onOpen),this.connection.removeEventListener("close",this.onClose),this.connection.removeEventListener("message",this.onMessage),this.connection=void 0)}forceReconnect(){this.close(),this.reconnect()}destroy(){this.setAutoReconnect(!1),this.close(),this.obfuscation&&this.obfuscation.destroy(),this.pending.forEach(e=>{e.reject&&e.reject()}),this.pending.length=0}close(){const e=this.connection;if(e){const t=this.connected;this.clear(),t&&(e.addEventListener("message",this.onMessage),e.addEventListener("close",()=>{e.removeEventListener("message",this.onMessage)},{once:!0}),e.close())}}setAutoReconnect(e){this.autoReconnect=e,e?!this.connection&&this.reconnectTimeout===void 0&&this.reconnect():this.reconnectTimeout!==void 0&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0)}connect(){this.connection&&this.close(),this.connection=new this.Connection(this.dcId,this.url,this.logSuffix),this.connection.addEventListener("open",this.onOpen),this.connection.addEventListener("close",this.onClose),this.connection.addEventListener("message",this.onMessage)}changeUrl(e){this.url!==e&&(this.url=e,this.forceReconnect())}encodeBody(e){const t=this.codec.encodePacket(e);return this.obfuscation.encode(t)}send(e){this.debug&&this.log.debug("-> body length to pending:",e.length);const t=void 0;if(this.networker)this.pending.push({body:e,encoded:t}),this.releasePending();else{const a=new Promise((s,n)=>{this.pending.push({resolve:s,reject:n,body:e,encoded:t})});return this.releasePending(),a}}async releasePending(){if(!this.connected||this.releasingPending)return;this.releasingPending=!0;let e=this.pending.length,t=!1;for(let a=0;a<e;++a){const s=this.pending[a];if(!s)break;const{body:n,bodySent:i}=s;if(n&&!i){this.debug&&this.log.debug("-> body length to send:",n.length);const r=s.encoded??(s.encoded=await this.encodeBody(n));if(!this.connected)break;this.connection.send(r),s.resolve?s.bodySent=!0:(this.pending.splice(a--,1),e--),t=!0}}this.releasingPending=void 0,this.pending.length&&t&&this.releasePending()}}const on=Ae.test?"_test":"",yr="_premium",_r=3e3,Pr=3e3;function Kn(o){return o==="client"?"":"-1"}function Jn(o,e,t){const a=Kn(e),s=e!=="client"?"apiws"+on+(t?yr:""):"apiws"+on;return`wss://${Ve.suffix.toLowerCase()}ws${o}${a}.web.telegram.org/${s}`}class Ca{constructor(){this.sslSubdomains=["pluto","venus","aurora","vesta","flora"],this.dcOptions=Ae.test?[{id:1,host:"149.154.175.10",port:80},{id:2,host:"149.154.167.40",port:80},{id:3,host:"149.154.175.117",port:80}]:[{id:1,host:"149.154.175.50",port:80},{id:2,host:"149.154.167.50",port:80},{id:3,host:"149.154.175.100",port:80},{id:4,host:"149.154.167.91",port:80},{id:5,host:"149.154.171.5",port:80}],this.chosenServers={},this.transportSocket=(e,t,a)=>{const s=Jn(e,t,a),n=t==="upload"?"-U":t==="download"?"-D":"",i=t==="client"?_r:Pr;let r;return r=lr,new ur(r,e,s,n,i)},this.transportHTTP=(e,t,a)=>{let s;{const i=Kn(t),r=this.sslSubdomains[e-1]+i,p=Ae.test?"apiw_test1":"apiw1";s="https://"+r+".web.telegram.org/"+p}const n=t==="upload"?"-U":t==="download"?"-D":"";return new Nt(e,s,n)}}chooseServer(e,t="client",a=Ae.transport,s=!0,n){this.chosenServers.hasOwnProperty(a)||(this.chosenServers[a]={client:{},download:{},upload:{}});const i=this.chosenServers[a][t];e in i||(i[e]=[]);const r=i[e];if(!r.length||!s){let p;return p=(a==="websocket"?this.transportSocket:this.transportHTTP)(e,t,n),p?(s&&r.push(p),p):(console.error("No chosenServer!",e),null)}return r[0]}static removeTransport(e,t){for(const a in e)for(const s in e[a])for(const n in e[a][s]){const i=e[a][s][n];Oe(i,t)}}}class Mr extends ua{constructor(){super(!0),this.opened=new Map,this.addEventListener("change",e=>{e.get("websocket")||this.waitForWebSocket()})}async pingTransports(){const e=this.dcConfigurator??(this.dcConfigurator=new Ca),t=2e3,a=this.transports={https:e.chooseServer(Ve.baseDcId,"client","https",!1),websocket:e.chooseServer(Ve.baseDcId,"client","websocket",!1)},s=Pe();this.transports.https._send(new Uint8Array,"no-cors").then(()=>s.resolve(!0),()=>s.resolve(!1)),setTimeout(()=>s.resolve(!1),t);const n=Pe(),i=a.websocket;i.setAutoReconnect(!1),i.connection.addEventListener("close",()=>n.resolve(!1),{once:!0}),i.connection.addEventListener("open",()=>n.resolve(!0),{once:!0}),setTimeout(()=>{n.isFulfilled||n.isRejected||(i.connection&&i.connection.close(),n.resolve(!1))},t);const[r,p]=await Promise.all([s,n]);for(const f in a)a[f].destroy();return{https:r||this.opened.get("https")>0,websocket:p||this.opened.get("websocket")>0}}async waitForWebSocket(){if(!this.pinging){for(this.pinging=!0;;){const{https:e,websocket:t}=await this.pingTransports();if((e||t)&&this.dispatchEvent("transport",t||!e?"websocket":"https"),t)break;await rt(1e4)}this.pinging=!1}}setTransportValue(e,t){let a=this.opened.get(e)||0;a+=t?1:-1,this.opened.set(e,a),this.dispatchEvent("change",this.opened)}setTransportOpened(e){return this.setTransportValue(e,!0)}setTransportClosed(e){return this.setTransportValue(e,!1)}}const vr=new Mr;var ma=vr;const Qn=Pe();class Sr extends Gs{constructor(){super("SERVICE"),Ue&&(Ue.serviceMessagePort=this)}}function Ce(o,e){return o instanceof Promise?o.then(e):e(o)}class ce{setManagers(e){Object.assign(this,e)}}function br(){const o=["users","chats","dialogs"],e={};for(const t of o)e[t]=new Gt(Hs,t);return e}function Cr(o,e,t){const a=performance.now();return(t||console).warn(Qa(),"start",e),o.then(()=>{(t||console).warn(Qa(),"end",e,performance.now()-a)}),o}function Ir(o){return(...e)=>Cr(...e,o)}async function Dr(o){const e=Ir(We("STORAGES-LOADER")),t=Object.keys(o),a=t.map(p=>{const d=o[p].getAll();return e(d,"storage "+p)}),s={},n=await Promise.all(a);for(let p=0,d=t.length;p<d;++p)s[t[p]]=n[p];n.splice(0,t.length);const{storages:i,callback:r}=await Qn;if(i.size){const p=[];for(const d of i)s[d].length=0,p.push(o[d].clear());i.clear(),await Promise.all(p).catch(Ge)}return r(),s}let wr;function kr(o){return wr??(wr=Dr(o))}class Ar extends ce{constructor(){super(),this.log=We("STORAGES"),this.storages=br()}loadStorages(){return kr(this.storages)}async loadStorage(e){return this.loadStorages().then(t=>({storage:this.storages[e],results:t[e]}))}}class Fr extends ce{getState(){return this.apiManager.invokeApi("account.getPassword").then(e=>e)}updateSettings(e={}){return this.getState().then(t=>{let a,s;const n={password:null,new_settings:{_:"account.passwordInputSettings",hint:e.hint,email:e.email}};e.currentPassword?a=this.cryptoWorker.invokeCrypto("computeSRP",e.currentPassword,t,!1):a=Promise.resolve({_:"inputCheckPasswordEmpty"});const i=t.new_algo,r=new Uint8Array(i.salt1.length+32);return Tt(r),r.set(i.salt1,0),i.salt1=r,e.newPassword?s=this.cryptoWorker.invokeCrypto("computeSRP",e.newPassword,t,!0):s=Promise.resolve(new Uint8Array),Promise.all([a,s]).then(p=>{var d;return n.password=p[0],n.new_settings.new_algo=i,n.new_settings.new_password_hash=p[1],(d=n.new_settings).hint??(d.hint=""),this.apiManager.invokeApi("account.updatePasswordSettings",n)})})}getInputCheckPassword(e,t){return this.cryptoWorker.invokeCrypto("computeSRP",e,t,!1)}check(e,t,a={}){return this.getInputCheckPassword(e,t).then(s=>this.apiManager.invokeApi("auth.checkPassword",{password:s},a).then(n=>(n._==="auth.authorization"&&this.apiManager.setUser(n.user),n)))}confirmPasswordEmail(e){return this.apiManager.invokeApi("account.confirmPasswordEmail",{code:e})}resendPasswordEmail(){return this.apiManager.invokeApi("account.resendPasswordEmail")}cancelPasswordEmail(){return this.apiManager.invokeApi("account.cancelPasswordEmail")}}function St(o,e,t){const a=t&&new Set(t),s=p=>Object.keys(p).filter(d=>p[d]!==void 0),n=t?p=>s(p).filter(d=>!a.has(d)):s,i=typeof o;return o&&e&&i==="object"&&i===typeof e?n(o).length===n(e).length&&n(o).every(p=>St(o[p],e[p],t)):o===e}class Er extends ce{constructor(){super(...arguments),this.contexts=new Map,this.links={},this.log=We("RD",void 0,!0)}saveContext(e,t,a){[a,e]=this.getContexts(e),a||(a=new Set,this.contexts.set(e,a)),this.links[Te(e)]=e;for(const s of a)if(St(s,t))return;a.add(t)}getReferenceByLink(e){return this.links[Te(e)]}getContexts(e){return[this.contexts.get(e)||(e=this.getReferenceByLink(e)||e,this.contexts.get(e)),e]}getContext(e){const t=this.getContexts(e);return t[0]?[t[0].values().next().value,t[1]]:void 0}deleteContext(e,t,a){if([a,e]=this.getContexts(e),a){for(const s of a)if(St(s,t))return a.delete(s),a.size||(this.contexts.delete(e),delete this.links[Te(e)]),!0}return!1}refreshReference(e,t){if(this.log("refreshReference: start",e.slice(),t),!t){const n=this.getContext(e);if(!n)return this.log("refreshReference: got no context for reference:",e.slice()),Promise.reject("NO_CONTEXT");[t,e]=n}let a;switch(t?.type){case"message":{a=this.appMessagesManager.reloadMessages(t.peerId,t.messageId,!0);break}case"emojiesSounds":{a=this.refreshEmojiesSoundsPromise||this.appStickersManager.getAnimatedEmojiSounds(!0).then(()=>{this.refreshEmojiesSoundsPromise=void 0});break}case"userFull":{a=Promise.resolve(this.appProfileManager.getProfile(t.userId,!0));break}case"customEmoji":{a=this.appEmojiManager.getCustomEmojiDocuments([t.docId]);break}case"attachMenuBotIcon":{a=this.appAttachMenuBotsManager.getAttachMenuBot(t.botId,!0);break}case"wallPaper":{a=this.appThemesManager.getWallPaperById(t.wallPaperId);break}case"storyItem":{a=Promise.resolve(this.appStoriesManager.getStoryById(t.peerId,t.storyId,!0));break}case"premiumPromo":{a=Promise.resolve(this.appPaymentsManager.getPremiumPromo(!0));break}case"webPage":{a=Promise.resolve(this.appWebPagesManager.getWebPage(t.url));break}case"botApp":{a=Promise.resolve(this.appAttachMenuBotsManager.getBotApp(t.botId,t.appName));break}case"chatInvite":{a=Promise.resolve(this.appChatInvitesManager.checkChatInvite(t.hash));break}case"effects":{a=Promise.resolve(this.appReactionsManager.getAvailableEffects(!0));break}default:return this.log.warn("refreshReference: not implemented context",t),Promise.reject()}const s=Te(e);return this.log("refreshReference: refreshing reference:",s),a.then(()=>{const n=Te(e);if(this.log("refreshReference: refreshed, reference before:",s,"after:",n),s!==n)return e;this.deleteContext(e,t);const i=this.getContext(e);if(i)return this.refreshReference(e,i[0]);throw this.log.error("refreshReference: no new context, reference before:",s,"after:",n,t),Ee("NO_NEW_CONTEXT")})}}function Ie(o){const e=Date.now();return o?e/1e3|0:e}const Ur={Á:"A",Ă:"A",Ắ:"A",Ặ:"A",Ằ:"A",Ẳ:"A",Ẵ:"A",Ǎ:"A",Â:"A",Ấ:"A",Ậ:"A",Ầ:"A",Ẩ:"A",Ẫ:"A",Ä:"A",Ǟ:"A",Ȧ:"A",Ǡ:"A",Ạ:"A",Ȁ:"A",À:"A",Ả:"A",Ȃ:"A",Ā:"A",Ą:"A",Å:"A",Ǻ:"A",Ḁ:"A","Ⱥ":"A",Ã:"A","Ꜳ":"AA",Æ:"AE",Ǽ:"AE",Ǣ:"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY",Ḃ:"B",Ḅ:"B",Ɓ:"B",Ḇ:"B","Ƀ":"B",Ƃ:"B",Ć:"C",Č:"C",Ç:"C",Ḉ:"C",Ĉ:"C",Ċ:"C",Ƈ:"C","Ȼ":"C",Ď:"D",Ḑ:"D",Ḓ:"D",Ḋ:"D",Ḍ:"D",Ɗ:"D",Ḏ:"D",Dz:"D",Dž:"D",Đ:"D",Ƌ:"D",DZ:"DZ",DŽ:"DZ",É:"E",Ĕ:"E",Ě:"E",Ȩ:"E",Ḝ:"E",Ê:"E",Ế:"E",Ệ:"E",Ề:"E",Ể:"E",Ễ:"E",Ḙ:"E",Ë:"E",Ė:"E",Ẹ:"E",Ȅ:"E",È:"E",Ẻ:"E",Ȇ:"E",Ē:"E",Ḗ:"E",Ḕ:"E",Ę:"E","Ɇ":"E",Ẽ:"E",Ḛ:"E","Ꝫ":"ET",Ḟ:"F",Ƒ:"F",Ǵ:"G",Ğ:"G",Ǧ:"G",Ģ:"G",Ĝ:"G",Ġ:"G",Ɠ:"G",Ḡ:"G",Ǥ:"G",Ḫ:"H",Ȟ:"H",Ḩ:"H",Ĥ:"H","Ⱨ":"H",Ḧ:"H",Ḣ:"H",Ḥ:"H",Ħ:"H",Í:"I",Ĭ:"I",Ǐ:"I",Î:"I",Ï:"I",Ḯ:"I",İ:"I",Ị:"I",Ȉ:"I",Ì:"I",Ỉ:"I",Ȋ:"I",Ī:"I",Į:"I",Ɨ:"I",Ĩ:"I",Ḭ:"I","Ꝺ":"D","Ꝼ":"F","Ᵹ":"G","Ꞃ":"R","Ꞅ":"S","Ꞇ":"T","Ꝭ":"IS",Ĵ:"J","Ɉ":"J",Ḱ:"K",Ǩ:"K",Ķ:"K","Ⱪ":"K","Ꝃ":"K",Ḳ:"K",Ƙ:"K",Ḵ:"K","Ꝁ":"K","Ꝅ":"K",Ĺ:"L","Ƚ":"L",Ľ:"L",Ļ:"L",Ḽ:"L",Ḷ:"L",Ḹ:"L","Ⱡ":"L","Ꝉ":"L",Ḻ:"L",Ŀ:"L","Ɫ":"L",Lj:"L",Ł:"L",LJ:"LJ",Ḿ:"M",Ṁ:"M",Ṃ:"M","Ɱ":"M",Ń:"N",Ň:"N",Ņ:"N",Ṋ:"N",Ṅ:"N",Ṇ:"N",Ǹ:"N",Ɲ:"N",Ṉ:"N","Ƞ":"N",Nj:"N",Ñ:"N",NJ:"NJ",Ó:"O",Ŏ:"O",Ǒ:"O",Ô:"O",Ố:"O",Ộ:"O",Ồ:"O",Ổ:"O",Ỗ:"O",Ö:"O",Ȫ:"O",Ȯ:"O",Ȱ:"O",Ọ:"O",Ő:"O",Ȍ:"O",Ò:"O",Ỏ:"O",Ơ:"O",Ớ:"O",Ợ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ȏ:"O","Ꝋ":"O","Ꝍ":"O",Ō:"O",Ṓ:"O",Ṑ:"O",Ɵ:"O",Ǫ:"O",Ǭ:"O",Ø:"O",Ǿ:"O",Õ:"O",Ṍ:"O",Ṏ:"O",Ȭ:"O",Ƣ:"OI","Ꝏ":"OO",Ɛ:"E",Ɔ:"O",Ȣ:"OU",Ṕ:"P",Ṗ:"P","Ꝓ":"P",Ƥ:"P","Ꝕ":"P","Ᵽ":"P","Ꝑ":"P","Ꝙ":"Q","Ꝗ":"Q",Ŕ:"R",Ř:"R",Ŗ:"R",Ṙ:"R",Ṛ:"R",Ṝ:"R",Ȑ:"R",Ȓ:"R",Ṟ:"R","Ɍ":"R","Ɽ":"R","Ꜿ":"C",Ǝ:"E",Ś:"S",Ṥ:"S",Š:"S",Ṧ:"S",Ş:"S",Ŝ:"S",Ș:"S",Ṡ:"S",Ṣ:"S",Ṩ:"S","ẞ":"SS",Ť:"T",Ţ:"T",Ṱ:"T",Ț:"T","Ⱦ":"T",Ṫ:"T",Ṭ:"T",Ƭ:"T",Ṯ:"T",Ʈ:"T",Ŧ:"T","Ɐ":"A","Ꞁ":"L",Ɯ:"M","Ʌ":"V","Ꜩ":"TZ",Ú:"U",Ŭ:"U",Ǔ:"U",Û:"U",Ṷ:"U",Ü:"U",Ǘ:"U",Ǚ:"U",Ǜ:"U",Ǖ:"U",Ṳ:"U",Ụ:"U",Ű:"U",Ȕ:"U",Ù:"U",Ủ:"U",Ư:"U",Ứ:"U",Ự:"U",Ừ:"U",Ử:"U",Ữ:"U",Ȗ:"U",Ū:"U",Ṻ:"U",Ų:"U",Ů:"U",Ũ:"U",Ṹ:"U",Ṵ:"U","Ꝟ":"V",Ṿ:"V",Ʋ:"V",Ṽ:"V","Ꝡ":"VY",Ẃ:"W",Ŵ:"W",Ẅ:"W",Ẇ:"W",Ẉ:"W",Ẁ:"W","Ⱳ":"W",Ẍ:"X",Ẋ:"X",Ý:"Y",Ŷ:"Y",Ÿ:"Y",Ẏ:"Y",Ỵ:"Y",Ỳ:"Y",Ƴ:"Y",Ỷ:"Y","Ỿ":"Y",Ȳ:"Y","Ɏ":"Y",Ỹ:"Y",Ź:"Z",Ž:"Z",Ẑ:"Z","Ⱬ":"Z",Ż:"Z",Ẓ:"Z",Ȥ:"Z",Ẕ:"Z",Ƶ:"Z",IJ:"IJ",Œ:"OE","ᴀ":"A","ᴁ":"AE",ʙ:"B","ᴃ":"B","ᴄ":"C","ᴅ":"D","ᴇ":"E","ꜰ":"F",ɢ:"G",ʛ:"G",ʜ:"H",ɪ:"I",ʁ:"R","ᴊ":"J","ᴋ":"K",ʟ:"L","ᴌ":"L","ᴍ":"M",ɴ:"N","ᴏ":"O",ɶ:"OE","ᴐ":"O","ᴕ":"OU","ᴘ":"P",ʀ:"R","ᴎ":"N","ᴙ":"R","ꜱ":"S","ᴛ":"T","ⱻ":"E","ᴚ":"R","ᴜ":"U","ᴠ":"V","ᴡ":"W",ʏ:"Y","ᴢ":"Z",á:"a",ă:"a",ắ:"a",ặ:"a",ằ:"a",ẳ:"a",ẵ:"a",ǎ:"a",â:"a",ấ:"a",ậ:"a",ầ:"a",ẩ:"a",ẫ:"a",ä:"a",ǟ:"a",ȧ:"a",ǡ:"a",ạ:"a",ȁ:"a",à:"a",ả:"a",ȃ:"a",ā:"a",ą:"a","ᶏ":"a",ẚ:"a",å:"a",ǻ:"a",ḁ:"a","ⱥ":"a",ã:"a","ꜳ":"aa",æ:"ae",ǽ:"ae",ǣ:"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay",ḃ:"b",ḅ:"b",ɓ:"b",ḇ:"b","ᵬ":"b","ᶀ":"b",ƀ:"b",ƃ:"b",ɵ:"o",ć:"c",č:"c",ç:"c",ḉ:"c",ĉ:"c",ɕ:"c",ċ:"c",ƈ:"c","ȼ":"c",ď:"d",ḑ:"d",ḓ:"d","ȡ":"d",ḋ:"d",ḍ:"d",ɗ:"d","ᶑ":"d",ḏ:"d","ᵭ":"d","ᶁ":"d",đ:"d",ɖ:"d",ƌ:"d",ı:"i","ȷ":"j",ɟ:"j",ʄ:"j",dz:"dz",dž:"dz",é:"e",ĕ:"e",ě:"e",ȩ:"e",ḝ:"e",ê:"e",ế:"e",ệ:"e",ề:"e",ể:"e",ễ:"e",ḙ:"e",ë:"e",ė:"e",ẹ:"e",ȅ:"e",è:"e",ẻ:"e",ȇ:"e",ē:"e",ḗ:"e",ḕ:"e","ⱸ":"e",ę:"e","ᶒ":"e","ɇ":"e",ẽ:"e",ḛ:"e","ꝫ":"et",ḟ:"f",ƒ:"f","ᵮ":"f","ᶂ":"f",ǵ:"g",ğ:"g",ǧ:"g",ģ:"g",ĝ:"g",ġ:"g",ɠ:"g",ḡ:"g","ᶃ":"g",ǥ:"g",ḫ:"h",ȟ:"h",ḩ:"h",ĥ:"h","ⱨ":"h",ḧ:"h",ḣ:"h",ḥ:"h",ɦ:"h",ẖ:"h",ħ:"h",ƕ:"hv",í:"i",ĭ:"i",ǐ:"i",î:"i",ï:"i",ḯ:"i",ị:"i",ȉ:"i",ì:"i",ỉ:"i",ȋ:"i",ī:"i",į:"i","ᶖ":"i",ɨ:"i",ĩ:"i",ḭ:"i","ꝺ":"d","ꝼ":"f","ᵹ":"g","ꞃ":"r","ꞅ":"s","ꞇ":"t","ꝭ":"is",ǰ:"j",ĵ:"j",ʝ:"j","ɉ":"j",ḱ:"k",ǩ:"k",ķ:"k","ⱪ":"k","ꝃ":"k",ḳ:"k",ƙ:"k",ḵ:"k","ᶄ":"k","ꝁ":"k","ꝅ":"k",ĺ:"l",ƚ:"l",ɬ:"l",ľ:"l",ļ:"l",ḽ:"l","ȴ":"l",ḷ:"l",ḹ:"l","ⱡ":"l","ꝉ":"l",ḻ:"l",ŀ:"l",ɫ:"l","ᶅ":"l",ɭ:"l",ł:"l",lj:"lj",ſ:"s","ẜ":"s",ẛ:"s","ẝ":"s",ḿ:"m",ṁ:"m",ṃ:"m",ɱ:"m","ᵯ":"m","ᶆ":"m",ń:"n",ň:"n",ņ:"n",ṋ:"n","ȵ":"n",ṅ:"n",ṇ:"n",ǹ:"n",ɲ:"n",ṉ:"n",ƞ:"n","ᵰ":"n","ᶇ":"n",ɳ:"n",ñ:"n",nj:"nj",ó:"o",ŏ:"o",ǒ:"o",ô:"o",ố:"o",ộ:"o",ồ:"o",ổ:"o",ỗ:"o",ö:"o",ȫ:"o",ȯ:"o",ȱ:"o",ọ:"o",ő:"o",ȍ:"o",ò:"o",ỏ:"o",ơ:"o",ớ:"o",ợ:"o",ờ:"o",ở:"o",ỡ:"o",ȏ:"o","ꝋ":"o","ꝍ":"o","ⱺ":"o",ō:"o",ṓ:"o",ṑ:"o",ǫ:"o",ǭ:"o",ø:"o",ǿ:"o",õ:"o",ṍ:"o",ṏ:"o",ȭ:"o",ƣ:"oi","ꝏ":"oo",ɛ:"e","ᶓ":"e",ɔ:"o","ᶗ":"o",ȣ:"ou",ṕ:"p",ṗ:"p","ꝓ":"p",ƥ:"p","ᵱ":"p","ᶈ":"p","ꝕ":"p","ᵽ":"p","ꝑ":"p","ꝙ":"q",ʠ:"q","ɋ":"q","ꝗ":"q",ŕ:"r",ř:"r",ŗ:"r",ṙ:"r",ṛ:"r",ṝ:"r",ȑ:"r",ɾ:"r","ᵳ":"r",ȓ:"r",ṟ:"r",ɼ:"r","ᵲ":"r","ᶉ":"r","ɍ":"r",ɽ:"r","ↄ":"c","ꜿ":"c",ɘ:"e",ɿ:"r",ś:"s",ṥ:"s",š:"s",ṧ:"s",ş:"s",ŝ:"s",ș:"s",ṡ:"s",ṣ:"s",ṩ:"s",ʂ:"s","ᵴ":"s","ᶊ":"s","ȿ":"s",ɡ:"g",ß:"ss","ᴑ":"o","ᴓ":"o","ᴝ":"u",ť:"t",ţ:"t",ṱ:"t",ț:"t","ȶ":"t",ẗ:"t","ⱦ":"t",ṫ:"t",ṭ:"t",ƭ:"t",ṯ:"t","ᵵ":"t",ƫ:"t",ʈ:"t",ŧ:"t","ᵺ":"th",ɐ:"a","ᴂ":"ae",ǝ:"e","ᵷ":"g",ɥ:"h","ʮ":"h","ʯ":"h","ᴉ":"i",ʞ:"k","ꞁ":"l",ɯ:"m",ɰ:"m","ᴔ":"oe",ɹ:"r",ɻ:"r",ɺ:"r","ⱹ":"r",ʇ:"t",ʌ:"v",ʍ:"w",ʎ:"y","ꜩ":"tz",ú:"u",ŭ:"u",ǔ:"u",û:"u",ṷ:"u",ü:"u",ǘ:"u",ǚ:"u",ǜ:"u",ǖ:"u",ṳ:"u",ụ:"u",ű:"u",ȕ:"u",ù:"u",ủ:"u",ư:"u",ứ:"u",ự:"u",ừ:"u",ử:"u",ữ:"u",ȗ:"u",ū:"u",ṻ:"u",ų:"u","ᶙ":"u",ů:"u",ũ:"u",ṹ:"u",ṵ:"u","ᵫ":"ue","ꝸ":"um","ⱴ":"v","ꝟ":"v",ṿ:"v",ʋ:"v","ᶌ":"v","ⱱ":"v",ṽ:"v","ꝡ":"vy",ẃ:"w",ŵ:"w",ẅ:"w",ẇ:"w",ẉ:"w",ẁ:"w","ⱳ":"w",ẘ:"w",ẍ:"x",ẋ:"x","ᶍ":"x",ý:"y",ŷ:"y",ÿ:"y",ẏ:"y",ỵ:"y",ỳ:"y",ƴ:"y",ỷ:"y","ỿ":"y",ȳ:"y",ẙ:"y","ɏ":"y",ỹ:"y",ź:"z",ž:"z",ẑ:"z",ʑ:"z","ⱬ":"z",ż:"z",ẓ:"z",ȥ:"z",ẕ:"z","ᵶ":"z","ᶎ":"z",ʐ:"z",ƶ:"z","ɀ":"z",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ij:"ij",œ:"oe",st:"st","ₐ":"a","ₑ":"e","ᵢ":"i","ⱼ":"j","ₒ":"o","ᵣ":"r","ᵤ":"u","ᵥ":"v","ₓ":"x",Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"},Tr=/[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<]+/g,Rr=/^\s+|\s$/g,Br={й:"q",ц:"w",у:"e",к:"r",е:"t",н:"y",г:"u",ш:"i",щ:"o",з:"p",х:"[",ъ:"]",ф:"a",ы:"s",в:"d",а:"f",п:"g",р:"h",о:"j",л:"k",д:"l",ж:";",э:"'",я:"z",ч:"x",с:"c",м:"v",и:"b",т:"n",ь:"m",б:",",ю:".",".":"/"};function xr(o){return o.replace(Tr,"").replace(Rr,"")}function Lr(o){return o.toLowerCase().replace(/[\wа-я]/g,e=>Br[e]??e)}function Or(o){return o.replace(/[^A-Za-z0-9]/g,e=>Ur[e]??e)}function Vr(o,e=!0){return Yn(o,{clearBadChars:!0,latinize:e,ignoreCase:!0})}function Yn(o="",e={}){const t=e.includeTag&&o.charAt(0)==="%",a=o;return e.clearBadChars&&(o=xr(o)),e.latinize&&(o=Or(o)),e.ignoreCase&&(o=o.toLowerCase()),t&&(o="%"+o),e.latinize&&(o+=""+Lr(a)),o}function Nr(o){return o.reduce((e,t)=>(e.push(...t),e),[])}class Ea{constructor(e={}){this.options=e,this.fullTexts=new Map,e.minChars??(e.minChars=0)}indexObject(e,t){if(t.trim()&&(t=this.processSearchText(t)),!t)return this.fullTexts.delete(e),!1;this.fullTexts.set(e,t)}indexObjectArray(e,t){return this.indexObject(e,t.join(" "))}_search(e,t=e.split(" ").filter(s=>s.trim()),a=this.options.minChars){const s=[],n=this.fullTexts,i=t.length;return n.forEach((r,p)=>{let d=!0,f=0;for(let c=0;c<i;++c){const l=t[c],m=r.indexOf(l),u=c===i-1;if(m===-1||this.options.fullWords&&!u&&r[m+l.length]!==" "||m!==0&&r[m-1]!==" "){d=!1;break}f+=l.length}if(d){f+=i-1;const c=r.length;(a<=f||c<=f)&&s.push({fullText:r,fullTextLength:c,what:p,foundChars:f})}}),s}search(e,t){e=this.processSearchText(e);const s=e.split("").map(r=>this._search(r,void 0,t)),n=Nr(s);return n.sort((r,p)=>{const d=r.fullTextLength-r.foundChars,f=p.fullTextLength-p.foundChars;return d-f||r.fullTextLength-p.fullTextLength}),new Set(n.map(r=>r.what))}processSearchText(e){return this.options?Yn(e,this.options):e}}function qr(o,e){const t=o.length;if(t!==e.length){const s=t-e.length;return s<0?-1:s>0?1:0}const a=15;for(let s=0;s<t;s+=a){const n=+o.slice(s,s+a),i=+e.slice(s,s+a),r=n-i;if(r)return r}return 0}function jr(o,e){if(o.toExponential){const t=o-e;return t<0?-1:t>0?1:0}return qr(o,e)}var Le=(o=>(o[o.None=0]="None",o[o.Top=1]="Top",o[o.Bottom=2]="Bottom",o[o.Both=3]="Both",o))(Le||{});class ea{constructor(){this.sliceConstructor=ea.getSliceConstructor(this),this.compareValue??(this.compareValue=jr);const e=this.constructSlice();this.slices=[e]}static getSliceConstructor(e){return class extends Array{constructor(){super(...arguments),this.end=0}isEnd(a){if((this.end&a)===a)return!0;let s=!1;if(a===1){const n=e.last;s=n.end&a?this.includes(n[n.length-1]):!1}else if(a===2){const n=e.first;s=n.end&a?this.includes(n[0]):!1}else if(a===3)return this.isEnd(1)&&this.isEnd(2);return s&&this.setEnd(a),s}getEnds(){return{top:this.isEnd(1),bottom:this.isEnd(2),both:this.isEnd(3)}}setEnd(a){this.end|=a}unsetEnd(a){this.end&=~a}splice(a,s,...n){const i=super.splice(a,s,...n);if(!this.length){const r=e.slices,p=r.indexOf(this);p!==-1&&(r.length===1?this.unsetEnd(3):r.splice(p,1))}return i}}}constructSlice(...e){const t=new this.sliceConstructor(e.length);for(let a=0,s=e.length;a<s;++a)t[a]=e[a];return t}insertSlice(e,t=!0){if(!e.length)return;const a=this.slices[0];if(!a.length)return a.push(...e),a;const s=e[e.length-1],n=e[0];let i,r=-1,p=-1,d=0;for(;d<this.slices.length&&(i=this.slices[d],r=i.indexOf(s),p=i.indexOf(n),!(p!==-1&&r!==-1));++d)if(p!==-1||r!==-1)break;if(!(p!==-1&&r!==-1))if(p!==-1){const f=e.slice(i.length-p);i.push(...f)}else if(r!==-1){const f=e.slice(0,e.length-r-1);i.unshift(...f)}else{let f=0;for(const c=this.slices.length;f<c;++f){const l=this.slices[f];if(this.compareValue(e[0],l[0])===1)break}this.slices.splice(f,0,this.constructSlice(...e)),d=f}if(t)return this.flatten(d)}flatten(e){if(this.slices.length>=2)for(let t=0,a=this.slices.length;t<a-1;++t){const s=this.slices[t],n=this.slices[t+1];s.indexOf(n[0])!==-1&&(s.setEnd(n.end),this.slices.splice(t+1,1),t<e&&--e,--a,--t,this.insertSlice(n,!1))}return this.slices[e]}get first(){return this.slices[0]}get last(){return this.slices[this.slices.length-1]}get slice(){return this.first}get length(){return this.slice.length}findSlice(e){for(let t=0,a=this.slices.length;t<a;++t){const s=this.slices[t],n=s.indexOf(e);if(n!==-1)return{slice:s,index:n}}}findOffsetInSlice(e,t){for(let a=0;a<t.length;++a)if(this.compareValue(e,t[a])>=0)return{slice:t,offset:e===t[a]?a+1:a}}findSliceOffset(e){let t;for(let a=0;a<this.slices.length;++a){t=this.slices[a];const s=this.findOffsetInSlice(e,t);if(s)return{...s,sliceIndex:a}}if(t?.isEnd(1))return{slice:t,offset:t.length,sliceIndex:this.slices.length-1}}sliceMe(e,t,a){let s=this.slice,n=0,i=0;if(e){const u=this.findSliceOffset(e);if(!u)return;s=u.slice,n=i=u.offset}else if(!s.isEnd(2))return;const r=Math.max(i+t,0),p=i+t+a,d=s.slice(r,p),f=t<0?a+t:a,c=Math.abs(t),l=s.length-i>=f||(s.isEnd(1)?(d.setEnd(1),!0):!1),m=i-c>=0||(s.isEnd(2)?(d.setEnd(2),!0):!1);return{slice:d,offsetIdOffset:n,fulfilled:0|(l&&m?3:(l?1:0)|(m?2:0))}}unshift(...e){let t=this.first;t.length?t.isEnd(2)||(t=this.constructSlice(),t.setEnd(2),this.slices.unshift(t)):t.setEnd(2),t.unshift(...e)}push(...e){let t=this.last;t.length?t.isEnd(1)||(t=this.constructSlice(),t.setEnd(1),this.slices.push(t)):t.setEnd(1),t.push(...e)}delete(e){const t=this.findSlice(e);return t?(t.slice.splice(t.index,1),!0):!1}deleteSlice(e){Oe(this.slices,e)}toJSON(){const t={slices:this.slices.map(a=>({values:a.slice(),isEnd:a.getEnds()}))};return JSON.stringify(t)}static fromJSON(e){const t=JSON.parse(e),a=new ea;return t.slices.forEach(s=>{const n=a.insertSlice(s.values)||a.first;s.isEnd.top&&n.setEnd(1),s.isEnd.bottom&&n.setEnd(2)}),a}}Ue&&(Ue.SlicedArray=ea);function Et(o,e){for(let t=o.length,a=t-1;a>=0;--a)e(o[a],a,o)}function Bt(o,e,t,a,s){if(!t)t=r=>r;else if(typeof t!="function"){const r=t;t=p=>p[r]}s||(s=(r,p)=>r-p);const n=t(e);if(a??(a=o.indexOf(e)),a!==-1){const r=o[a-1],p=o[a+1];if((!r||s(t(r),n)>=0)&&(!p||s(t(p),n)<=0))return a;o.splice(a,1)}const i=o.length;if(!i||s(n,t(o[i-1]))<=0)return o.push(e)-1;if(s(n,t(o[0]))>=0)return o.unshift(e),0;for(let r=0;r<i;r++)if(s(n,t(o[r]))>0)return o.splice(r,0,e),r;return console.error("wtf",o,e),o.indexOf(e)}function Wt(o,e){if(!o)return e;for(var t in o)e.hasOwnProperty(t)||delete o[t];for(var t in e)o[t]=e[t];return o}function Gr(o,e){if(o!==void 0)return o=+o.toFixed(0),o<ka?o:o%ka}function ae(o){return Gr(o)}function Ma(o=0){return`index_${o}`}function et(o){return typeof o=="object"&&o!==null}function Es(o,e=Ma(o.folder_id)){return o?.[e]}function He(o){if(o!==void 0&&(o.isPeerId&&o.isPeerId()))return o;if(et(o)){const a=o.user_id;if(a!==void 0)return a.toPeerId(!1);const s=o.channel_id||o.chat_id;return s!==void 0?s.toPeerId(!0):lt}else if(!o)return lt;const e=o.charAt(0)==="u",t=o.substr(1).split("_");return e?t[0].toPeerId():(t[0]||"").toPeerId(!0)}function Hr(o){const e=[o.fromId,o.viaBotId,o.fwdFromId],t=o.media;if(t){const p=[t.user_id,...t.winners||[]];e.push(...p.filter(Boolean).map(l=>l.toPeerId()));const d=[...t.channels||[],t.channel_id];e.push(...d.filter(Boolean).map(l=>l.toPeerId(!0)));const f=[...t.results?.recent_voters||[],t.peer],c=t?.webpage;if(c){const l=c.attributes?.find(m=>m._==="webPageAttributeStory");f.push(l?.peer)}e.push(...f.filter(Boolean).map(l=>He(l)))}const a=o.reactions?.recent_reactions;a?.length&&e.push(...a.map(p=>He(p.peer_id)));const s=o.action;if(s){const p=[...s.users||[],s.user_id,s.inviter_id];e.push(...p.filter(Boolean).map(c=>c.toPeerId()));const d=[s.channel_id,s.chat_id];e.push(...d.filter(Boolean).map(c=>c.toPeerId(!0)));const f=[s.boost_peer,...s.peers||[],s.from_id,s.to_id];e.push(...f.filter(Boolean).map(c=>He(c)))}const n=o.replies?.recent_repliers;n?.length&&e.push(...n.map(p=>He(p)));const i=o.saved_peer_id;i&&e.push(He(i));const r=o.fwd_from;return r&&e.push(...[r.from_id,r.saved_from_id,r.saved_from_peer].filter(Boolean).map(p=>He(p))),new Set(e.filter(Boolean))}function Zt(o,e){const t={writable:!0,configurable:!0},a={};e.forEach(s=>{o.hasOwnProperty(s)||(a[s]=t)}),Object.defineProperties(o,a)}function pn(o,e,t){return o[e]=t}function Je(o){return o?._==="forumTopic"}function Ye(o){return o?._==="savedDialog"}function yt(o){return o?._==="dialog"}function At(o){let e;return yt(o)?e=o.peerId:Je(o)?e=o.id:Ye(o)&&(e=o.savedPeerId),e}function Wr(o){if(!yt(o))return At(o)}var Us=(o=>(o[o.Folder=0]="Folder",o[o.Forum=1]="Forum",o[o.Saved=2]="Saved",o))(Us||{});const Ft=void 0;class zr extends ce{constructor(){super(...arguments),this.log=We("DIALOGS"),this.clear=(e=!1)=>{if(e){this.allDialogsLoaded={},this.pinnedOrders={};for(const t of je)this.pinnedOrders[t]=[]}else{this.storage.clear(),this.allDialogsLoaded={},this.saveAllDialogsLoaded(),this.pinnedOrders=Object.assign({},this.pinnedOrders);for(const t of je)this.resetPinnedOrder(t);this.savePinnedOrders()}this.forumTopics=new Map,this.savedDialogsPromises=new Map,this.folders={},this.dialogsOffsetDate={},this.dialogsNum=0,this.dialogsIndex=this.createSearchIndex(),this.cachedResults={query:"",count:0,dialogs:[],folderId:0},this.savedDialogs={}},this.onUpdateFolderPeers=e=>{e.folder_peers.forEach(a=>{const{folder_id:s,peer:n}=a,i=this.appPeersManager.getPeerId(n),r=this.dropDialog(i)[0];r&&(r.pFlags?.pinned&&this.handleDialogUnpinning(r,s),r.folder_id=s,this.generateIndexForDialog(r),this.pushDialog({dialog:r})),this.appMessagesManager.scheduleHandleNewDialogs(i,r)})},this.onUpdateDialogPinned=e=>{const t=this.appPeersManager.getPeerId(e.peer.peer);let a,s;e._==="updateDialogPinned"?(s=e.folder_id??ct,a=this.getDialogOnly(t)):(s=this.appPeersManager.peerId,a=this.getAnyDialog(this.appPeersManager.peerId,t)),this.handleDialogTogglePinned(a,e.pFlags.pinned,s)},this.onUpdateChannelPinnedTopic=e=>{const t=e.channel_id,a=t.toPeerId(!0),s=this.appMessagesIdsManager.generateMessageId(e.topic_id,t),n=this.getForumTopic(a,s);n&&this.handleDialogTogglePinned(n,e.pFlags.pinned,this.getFilterIdForForum(n))},this.onUpdatePinnedDialogs=e=>{const t=e._==="updatePinnedSavedDialogs";let a;if(t?a=this.appPeersManager.peerId:a=e.folder_id??ct,e.order)this.handleDialogsPinned(a,e.order.map(s=>this.appPeersManager.getPeerId(s.peer)));else{let s;t?s=this.apiManager.invokeApi("messages.getPinnedSavedDialogs"):s=this.apiManager.invokeApi("messages.getPinnedDialogs",{folder_id:a}),s.then(n=>{this.applyDialogs(n),this.handleDialogsPinned(a,n.dialogs.map(i=>i.peerId))})}},this.onUpdateChannelPinnedTopics=async e=>{const t=e.channel_id,a=t.toPeerId(!0);if(!this.forumTopics.get(a))return;const n=a;if(e.order){const i=e.order.map(r=>this.appMessagesIdsManager.generateMessageId(r,t));this.handleDialogsPinned(n,i)}else{const i=await this.apiManager.getLimit("topicPin",!0),r=this.apiManager.invokeApi("channels.getForumTopics",{channel:this.appChatsManager.getChannelInput(t),limit:i,offset_date:0,offset_id:0,offset_topic:0}),f=(await this.processTopics(a,r)).topics.filter(c=>c.pFlags.pinned);this.handleDialogsPinned(n,f.map(c=>c.id))}},this.onUpdateChannelViewForumAsMessages=e=>{const t=e.channel_id.toPeerId(!0),a=this.getDialogOnly(t);a&&(e.enabled?a.pFlags.view_forum_as_messages=!0:delete a.pFlags.view_forum_as_messages,this.setDialogToState(a))}}after(){this.clear(!0);const e=t=>{const a=this.getCachedDialogs(!1);for(let s=0;s<a.length;++s)this.processDialogForFilter(a[s],t)};return this.rootScope.addEventListener("filter_order",()=>{const t=this.getCachedDialogs(!1);for(const a in this.folders)this.isVirtualFilter(+a)||delete this.folders[a];for(let a=0;a<t.length;++a){const s=t[a];this.processDialogForFilters(s)}}),this.rootScope.addEventListener("filter_update",e),this.rootScope.addEventListener("filter_new",e),this.rootScope.addEventListener("filter_delete",t=>{const a=this.getCachedDialogs(!1),s=this.getDialogIndexKeyByFilterId(t.id);for(let n=0;n<a.length;++n){const i=a[n];delete i[s]}delete this.folders[t.id]}),this.rootScope.addEventListener("dialog_notify_settings",t=>{this.processChangedUnreadOrUnmuted(t.peerId)}),this.rootScope.addEventListener("chat_update",t=>{const a=t.toPeerId(!0),s=this.getDialogOnly(a);s&&!this.canSaveDialog(a,s)&&this.dropDialogOnDeletion(a)}),this.rootScope.addEventListener("chat_toggle_forum",({chatId:t,enabled:a})=>{const s=t.toPeerId(!0);a||this.flushForumTopicsCache(s),this.processChangedUnreadOrUnmuted(s)}),this.rootScope.addEventListener("user_auth",()=>{this.rootScope.addEventListener("premium_toggle",()=>{[ct,Dt].forEach(t=>{this.apiUpdatesManager.processLocalUpdate({_:"updatePinnedDialogs",folder_id:t})})})}),this.apiUpdatesManager.addMultipleEventsListeners({updateFolderPeers:this.onUpdateFolderPeers,updateDialogPinned:this.onUpdateDialogPinned,updateSavedDialogPinned:this.onUpdateDialogPinned,updateChannelPinnedTopic:this.onUpdateChannelPinnedTopic,updatePinnedDialogs:this.onUpdatePinnedDialogs,updatePinnedSavedDialogs:this.onUpdatePinnedDialogs,updateChannelPinnedTopics:this.onUpdateChannelPinnedTopics,updateChannelViewForumAsMessages:this.onUpdateChannelViewForumAsMessages}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("dialogs")]).then(([t,{results:a,storage:s}])=>{this.storage=s,this.dialogs=this.storage.getCache();for(const n of je){const i=t.pinnedOrders[n];if(!i)continue;const r=this.getPinnedOrders(n);r.splice(0,r.length,...i)}a.length&&Gt.freezeSaving(this.setDialogsFromState.bind(this,a),["chats","dialogs","messages","users"]),this.allDialogsLoaded=t.allDialogsLoaded||{},a.length&&this.appDraftsManager.addMissedDialogs()})}indexMyDialog(){const e=this.appUsersManager.getSelf().id.toPeerId(!1);if(this.getDialogOnly(e)){const a=this.appPeersManager.getPeerSearchText(e);this.dialogsIndex.indexObject(e,a)}}setDialogsFromState(e){for(let t=0,a=e.length;t<a;++t){const s=e[t];if(!s)continue;s.top_message=ae(s.top_message),s.topMessage&&this.appMessagesManager.saveMessages([s.topMessage]);for(let i=0;i<=21;++i){const r=`index_${i}`;delete s[r]}this.saveDialog({dialog:s,ignoreOffsetDate:!0}),this.appMessagesManager.getMessageByPeer(s.peerId,s.top_message)||this.appMessagesManager.reloadConversation(s.peerId)}}isDialogsLoaded(e){return!!this.allDialogsLoaded[e]}setDialogsLoaded(e,t){const a=this.isVirtualFilter(e);e===Ft&&t?(this.allDialogsLoaded[ct]=t,this.allDialogsLoaded[Dt]=t):(a&&Zt(this.allDialogsLoaded,[e]),this.allDialogsLoaded[e]=t),!a&&(Array.from(je).every(s=>this.allDialogsLoaded[s])&&(this.allDialogsLoaded[Ft]=!0),this.saveAllDialogsLoaded())}saveAllDialogsLoaded(){this.appStateManager.pushToState("allDialogsLoaded",this.allDialogsLoaded)}createSearchIndex(){return new Ea({clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0})}handleDialogUnpinning(e,t){delete e.pFlags.pinned,Oe(this.getPinnedOrders(t),At(e)),this.savePinnedOrders()}savePinnedOrders(){this.appStateManager.pushToState("pinnedOrders",this.pinnedOrders)}resetPinnedOrder(e){this.getPinnedOrders(e).length=0}getPinnedOrders(e){let t=this.pinnedOrders[e];return!t&&this.isVirtualFilter(e)&&(Zt(this.pinnedOrders,[e]),t=this.pinnedOrders[e]=[]),t}isDialogPinned(e,t){const a=this.filtersStorage.getFilter(t);let s;return a?s=a.pinnedPeerIds.indexOf(e)!==-1:s=!!this.getDialogOnly(e).pFlags.pinned,s}getOffsetDate(e){const t=this.dialogsOffsetDate[e]||0;return e===Ft&&!t?Math.min(...Array.from(je).sort((a,s)=>a-s)):t}generateFolder(e){const t={dialogs:[],id:e,count:null,unreadMessagesCount:0,unreadPeerIds:new Set,unreadUnmutedPeerIds:new Set};return Zt(t,["dispatchUnreadTimeout"]),t}getFolder(e){var t;return(t=this.folders)[e]??(t[e]=this.generateFolder(e))}isVirtualFilter(e){return this.getFilterType(e)!==0}getFilterType(e){return e&&e<0?1:e===this.appPeersManager.peerId?2:0}isFilterIdForForum(e){return e&&e<0}getFilterIdForForum(e){return e.peerId}getFolderDialogs(e,t=!0){if(e===Ft)return this.getCachedDialogs(t);const a=this.getFolder(e),s=this.getFilterType(e);return s===1?t?a.dialogs.filter(n=>!n.pFlags.hidden):a.dialogs:s===2?a.dialogs:t?a.dialogs.filter(n=>n.migratedTo===void 0):a.dialogs}getNextDialog(e,t,a){const s=this.getFolderDialogs(a,!0);let n;if(!e)t&&(n=s[0]);else{const i=s.findIndex(r=>r.peerId===e);if(i!==-1){const r=t?i+1:i-1;n=s[r]}}return n}getDialogIndexKeyByFilterId(e){if(this.isVirtualFilter(e))return Ma();if(je.has(e))return Ma(e);const t=this.filtersStorage.getFilter(e);return Ma(t.localId)}isDialogUnmuted(e){return!this.appNotificationsManager.isPeerLocalMuted({peerId:e.peerId,respectType:!0,threadId:Je(e)?e.id:void 0})}getFolderUnreadCount(e){const t=this.getFolder(e);return{unreadUnmutedCount:t.unreadUnmutedPeerIds.size,unreadCount:t.unreadPeerIds.size}}getCachedDialogs(e){const t=Array.from(je).map(a=>this.getFolderDialogs(a,e));return[].concat(...t)}setDialogIndexInFilter(e,t,a){let s;const n=this.isVirtualFilter(this.getDialogFilterId(e)),i=n||je.has(a.id);if(this.filtersStorage.testDialogForFilter(e,a)){const r=n?this.getPinnedOrdersByDialog(e):a.pinnedPeerIds,p=At(e),d=r.indexOf(p);d!==-1?s=this.generateDialogIndex(this.generateDialogPinnedDateByIndex(r.length-1-d),!0):e.pFlags?.pinned||i?s=this.generateIndexForDialog(e,!0,void 0,!i):s=Es(e)??this.generateIndexForDialog(e,!0)}return pn(e,t,s)}getDialog(e,t,a,s=!0){const n=[];a&&(t=e),t===void 0?n.push(...Array.from(je).map(r=>this.getFolder(r).dialogs)):n.push(this.getFolderDialogs(t,!1));let i;a?this.isFilterIdForForum(t)?i=r=>r.id===a:i=r=>r.savedPeerId===a:i=r=>r.peerId===e;for(const r of n){let p=0,d=0;for(let f=r.length;p<f;++p){const c=r[p];if(i(c))return[c,p-d];s&&(c.pFlags.hidden||c.migratedTo!==void 0)&&++d}}return[]}getDialogOnly(e){return this.dialogs[e]}getAnyDialog(e,t){return t?e.isUser()?this.savedDialogs[t]:this.getForumTopic(e,t):this.dialogs[e]}getDialogIndex(e,t,a){const s=et(e)?e:this.getAnyDialog(e,a);return Es(s,t)}generateDialogIndex(e,t){return e??(e=Ie(!0)+this.timeManager.getServerTimeOffset()),e*65536+(t?0:++this.dialogsNum&65535)}getDialogFilterId(e){let t;return Je(e)?t=this.getFilterIdForForum(e):Ye(e)?t=e.peerId:t=e.folder_id,t}getPinnedOrdersByDialog(e){return this.getPinnedOrders(this.getDialogFilterId(e))}processDialogForFilters(e,t){if(!yt(e)){this.processDialogForFilter(e,void 0,t);return}const a=this.filtersStorage.getFilters();for(const s in a){const n=a[s];this.processDialogForFilter(e,n,t)}}processDialogForFilter(e,t,a){const s=t?.id??this.getDialogFilterId(e),n=this.getDialogIndexKeyByFilterId(s),i=this.getFolder(s),r=i.dialogs,d={dialog:u=>u.peerId===e.peerId,forumTopic:u=>u.id===e.id,savedDialog:u=>u.savedPeerId===e.savedPeerId}[e._],f=r.findIndex(d),c=r[f],l=this.getDialogIndex(c,n);a&&!this.isVirtualFilter(s)&&s>Dt&&(a=void 0);const m=a?void 0:this.setDialogIndexInFilter(e,n,t);return l===m?!1:(!!l!=!!m&&this.prepareFolderUnreadCountModifyingByDialog(s,e,!!m),f!==-1&&(r.splice(f,1),i.count!==null&&--i.count),m&&(Bt(r,e,u=>this.getDialogIndex(u,n),-1),f===-1&&i.count!==null&&++i.count),!0)}prepareDialogUnreadCountModifying(e,t){if(Ye(e))return()=>{};const a=Je(e),s=[],n=a?this.getFilterIdForForum(e):e.folder_id;if(s.push(this.prepareFolderUnreadCountModifyingByDialog(n,e,t)),!a){const i=this.filtersStorage.getFilters();for(const r in i){const p=i[r];this.filtersStorage.testDialogForFilter(e,p)&&s.push(this.prepareFolderUnreadCountModifyingByDialog(p.id,e,t))}}return()=>!t&&s.forEach(i=>i())}prepareFolderUnreadCountModifyingByDialog(e,t,a){if(Ye(t))return a!==void 0?void 0:()=>{};const s=this.appMessagesManager.getDialogUnreadCount(t),n=this.isDialogUnmuted(t);if(a!==void 0){const i=a?s:-s;this.modifyFolderUnreadCount(e,i,a&&!!s,a&&!!s&&n,t);return}return()=>{const i=this.appMessagesManager.getDialogUnreadCount(t),r=this.isDialogUnmuted(t),p=i-s;this.modifyFolderUnreadCount(e,p,!!i,i&&r,t)}}modifyFolderUnreadCount(e,t,a,s,n){const{peerId:i}=n,r=this.appPeersManager.isForum(i),p=Je(n);if(r&&!p&&!n.pFlags.view_forum_as_messages){const c=this.getForumUnreadCount(i);if(c instanceof Promise){c.then(({count:l,hasUnmuted:m})=>{n=this.getDialogOnly(i);const u=this.getFolder(e);!n||!this.appPeersManager.isForum(i)||!u||!u.dialogs.some(M=>M.peerId===i)||this.modifyFolderUnreadCount(e,0,!1,!1,n)});return}else t=0,a=c.count>0,s=c.hasUnmuted}const d=this.getFolder(e);t&&(d.unreadMessagesCount=Math.max(0,d.unreadMessagesCount+t));const f=At(n);a?d.unreadPeerIds.add(f):d.unreadPeerIds.delete(f),s?d.unreadUnmutedPeerIds.add(f):d.unreadUnmutedPeerIds.delete(f),d.dispatchUnreadTimeout??(d.dispatchUnreadTimeout=we.setTimeout(()=>{d.dispatchUnreadTimeout=void 0;const c={...d};delete c.dialogs,this.rootScope.dispatchEvent("folder_unread",c),p&&this.processChangedUnreadOrUnmuted(i)},0))}processChangedUnreadOrUnmuted(e){const t=this.getDialogOnly(e);t&&(this.processDialogForFilters(t),this.prepareDialogUnreadCountModifying(t)(),this.rootScope.dispatchEvent("dialog_unread",{peerId:e,dialog:t}))}generateIndexForDialog(e,t,a,s){if(!t)return;const n=Je(e),i=yt(e);let r=0,p;if(n&&e.pFlags.hidden&&nr)r=this.generateDialogPinnedDateByIndex(4095),p=!0;else if(e.pFlags.pinned&&!s)r=this.generateDialogPinnedDate(e),p=!0;else{const{peerId:c}=e;if(a||(a=this.appMessagesManager.getMessageByPeer(c,e.top_message)),r=a?.date||r,i){const l=this.appPeersManager.isChannel(c)&&c.toChatId();if(l){const m=this.appChatsManager.getChat(l);(!r||m.date&&m.date>r)&&(r=m.date)}}(n||i)&&e.draft?._==="draftMessage"&&e.draft.date>r&&(r=e.draft.date)}r||(r=Ie(!0));const d=this.generateDialogIndex(r,p);if(t)return d;const f=Ma(e.folder_id);pn(e,f,d)}generateDialogPinnedDateByIndex(e){return 2147418112+(e&65535)}generateDialogPinnedDate(e){const t=this.getPinnedOrdersByDialog(e),a=At(e);let s=t.indexOf(a);return s===-1&&(t.unshift(a),s=0,yt(e)&&this.savePinnedOrders()),this.generateDialogPinnedDateByIndex(t.length-1-s)}getDialogMessageForState(e){const{peerId:t}=e,a=Ye(e)?e.savedPeerId:void 0,s=this.appMessagesManager.getHistoryStorage(t,a),n=this.appMessagesManager.getHistoryMessagesStorage(t),i=s.history.slice;let r;for(let p=0,d=i.length;p<d;++p){const f=i[p],c=this.appMessagesManager.getMessageFromStorage(n,f);if(c&&!c.pFlags.is_outgoing){r=c;break}}return r}setDialogToState(e){if(!yt(e))return;const{peerId:t,pts:a}=e,s=this.getDialogMessageForState(e);if(s){const n=Hr(s);this.peersStorage.requestPeersForKey(n,`topMessage_${t}`)}if(e.topMessage=s,t.isAnyChat()&&a){const n=this.apiUpdatesManager.getChannelState(t.toChatId(),a).pts;e.pts=n}this.storage.set({[t]:e}),this.peersStorage.requestPeer(t,"dialog")}pushDialog({dialog:e,offsetDate:t,ignoreOffsetDate:a,saveGlobalOffset:s}){const n=yt(e),{peerId:i}=e,r=At(e);if(n?this.dialogs[r]=e:Je(e)?this.getForumTopicsCache(i).topics.set(r,e):Ye(e)&&(this.savedDialogs[r]=e),t??(t=this.getDialogOffsetDate(e)),this.processDialogForFilters(e),t&&!e.pFlags.pinned){if(n&&s){const f=this.dialogsOffsetDate[Ft];(!f||t<f)&&this.setDialogOffsetDate(Ft,t)}const p=this.getDialogFilterId(e),d=this.dialogsOffsetDate[p];if(!d||t<d){if(!a&&!this.isDialogsLoaded(p)){this.dropDialog(i,Wr(e),!0);return}this.setDialogOffsetDate(p,t)}}this.setDialogToState(e)}dropDialogFromFolders(e,t,a){const s=this.getDialog(e,void 0,t,!1),[n,i]=s;if(n){const r=this.getDialogFilterId(n),p=Oe(this.getPinnedOrders(r),At(n))!==void 0;this.processDialogForFilters(n,!0),a||(Je(n)?this.getForumTopicsCache(e).index.indexObject(t,""):Ye(n)||this.dialogsIndex.indexObject(e,"")),p&&this.savePinnedOrders()}return s}dropDialog(e,t,a){const s=this.getAnyDialog(e,t),n=this.dropDialogFromFolders(e,t,a);return s&&(a||(Je(s)?this.getForumTopicsCache(e).topics.delete(t):Ye(s)?delete this.savedDialogs[t]:delete this.dialogs[e]),this.clearDialogFromState(s,a)),n}clearDialogFromState(e,t){if(!yt(e))return;const{peerId:a}=e;this.peersStorage.requestPeersForKey([],`topMessage_${a}`),this.peersStorage.releasePeer(a,"dialog"),this.storage.delete(a,t)}dropDialogWithEvent(e,t){const a=this.dropDialog(e,t);return a.length&&this.rootScope.dispatchEvent("dialog_drop",a[0]),a}dropDialogOnDeletion(e,t){if(this.dropDialogWithEvent(e,t),this.appPeersManager.isBroadcast(e)){const a=this.appMessagesManager.getHistoryStorage(e),s=a?.channelJoinedMid;s&&(a.channelJoinedMid=void 0,this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteChannelMessages",channel_id:e.toChatId(),messages:[s],pts:void 0,pts_count:void 0}))}this.rootScope.dispatchEvent("peer_deleted",e)}applyDialogs(e,t){const a=e._==="messages.forumTopics",s=e._==="messages.savedDialogs",n=!a&&!s,i=a?e.topics:e.dialogs;a?this.processTopics(t,e):n&&Et(e.dialogs,(d,f,c)=>{d._==="dialogFolder"&&c.splice(f,1)}),this.appMessagesManager.saveApiResult(e);const r=new Map,p=d=>{let f=r.get(d);return f||r.set(d,f={}),f};i.forEach(d=>{const f=this.getDialogPeerId(d);let c=d.top_message;const{pendingTopMsgs:l}=this.appMessagesManager;let m,u;n?m=f:a?(u=this.appMessagesIdsManager.generateMessageId(d.id,this.getDialogPeerId(d).toChatId()),m=`${f}_${u}`):(u=He(d.peer),m=`${f}_${u}`);const M=l[m];if(M){const C=this.appMessagesManager.getMessageByPeer(f,M),I=this.appMessagesManager.getMessageByPeer(f,c);(!c||C&&(!I||C?.date>I?.date))&&(d.top_message=c=M,this.appMessagesManager.getHistoryStorage(f,u).maxId=M)}if(c||d.draft?._==="draftMessage"){if(this.saveDialog({dialog:d})){const C=p(f);a?(C.topics??(C.topics=new Map)).set(d.id,d):s?(C.saved??(C.saved=new Map)).set(d.savedPeerId,d):C.dialog=d}}else this.dropDialogWithEvent(f,u);const A=this.appMessagesManager.getUpdateAfterReloadKey(f,u),w=this.appMessagesManager.newUpdatesAfterReloadToHandle[A];if(w!==void 0){const C=[...w];for(const I of C)w.delete(I),this.apiUpdatesManager.saveUpdate(I);w.size||delete this.appMessagesManager.newUpdatesAfterReloadToHandle[A]}}),r.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",r)}getDialogOffsetDate(e){return this.getDialogMessageForState(e)?.date||0}setDialogOffsetDate(e,t){return this.log("setting offset date",e,t),this.dialogsOffsetDate[e]=t}canSaveDialog(e,t){if(e.isAnyChat()){const a=this.appChatsManager.getChat(e.toChatId());if(a._==="channelForbidden"||a.pFlags.left)return!1}else if(this.appUsersManager.isDeleted(e.toUserId())&&!ae(t.top_message))return!1;return!0}getDialogPeerId(e){const{peerId:t}=e;return t||(Ye(e)?this.appPeersManager.peerId:this.appPeersManager.getPeerId(e.peer))}saveDialog({dialog:e,folderId:t,ignoreOffsetDate:a,saveGlobalOffset:s}){const n=Je(e),i=Ye(e),r=yt(e),p=this.getDialogPeerId(e),d=this.appPeersManager.isChannel(p)?p.toChatId():void 0,f=i?He(e.peer):void 0,c=n?e.id=this.appMessagesIdsManager.generateMessageId(e.id,d):i?f:void 0;if(r&&(t??(t=e.folder_id??ct)),!p)return this.log.error("saveConversation no peerId???",e,t),!1;if(r&&e._!=="dialog"&&this.log.error("saveConversation not regular dialog",e,Object.assign({},e)),r&&!d&&p.isAnyChat()){const w=this.appChatsManager.getChat(p.toChatId());if(w&&w.migrated_to&&w.pFlags.deactivated){const C=this.appPeersManager.getPeerId(w.migrated_to);this.appMessagesManager.migratedFromTo[p]=C,this.appMessagesManager.migratedToFrom[C]=p,e.migratedTo=C}}if(r&&!this.canSaveDialog(p,e))return!1;if(n)this.getForumTopicsCache(p).index.indexObject(c,e.title);else if(r&&!e.migratedTo){const w=this.appPeersManager.getPeerSearchText(p);this.dialogsIndex.indexObject(p,w)}const l=this.getAnyDialog(p,c);let m,u;if(e.top_message,m=this.appMessagesIdsManager.generateMessageId(e.top_message,d),(l?.top_message&&this.appMessagesManager.getMessageByPeer(p,l.top_message))?.pFlags?.is_outgoing&&l.top_message>=m&&(m=l.top_message),u=this.appMessagesManager.getMessageByPeer(p,m),e.top_message=m,i||(e.read_inbox_max_id=this.appMessagesIdsManager.generateMessageId(l&&!e.read_inbox_max_id?l.read_inbox_max_id:e.read_inbox_max_id,d),e.read_outbox_max_id=this.appMessagesIdsManager.generateMessageId(l&&!e.read_outbox_max_id?l.read_outbox_max_id:e.read_outbox_max_id,d)),r&&e.folder_id===void 0&&e._==="dialog"&&(e.folder_id=l?l.folder_id:t),i?e.savedPeerId=f:e.draft=this.appDraftsManager.saveDraft({peerId:p,threadId:c,draft:e.draft}),e.peerId=p,!i&&u&&u.pFlags.is_outgoing){const w=u.pFlags.out,C=e[w?"read_outbox_max_id":"read_inbox_max_id"];m>C?(u.pFlags.unread=!0,!e.unread_count&&!w&&++e.unread_count):delete u.pFlags.unread}const M=this.appMessagesManager.getHistoryStorage(p,c),A=M.history.slice;if(m&&(!A.length||!A.isEnd(Le.Bottom)?(M.history.unshift(m),M.count||(M.count=M.history.length),this.appMessagesManager.mergeReplyKeyboard(M,u)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:p}),M.originalInsertSlice&&this.appMessagesManager.insertChannelJoinedService(p,M,M.history.slice)):r&&!l&&this.appMessagesManager.insertChannelJoinedService(p,M)),r&&e.top_message<M.history.first[0]&&(m=e.top_message=M.history.first[0],e.topMessage=this.appMessagesManager.getMessageByPeer(p,e.top_message)),M.maxId=m,i||(M.readMaxId=e.read_inbox_max_id,M.readOutboxMaxId=e.read_outbox_max_id,this.appNotificationsManager.savePeerSettings({peerId:p,threadId:n?e.id:void 0,settings:e.notify_settings})),r&&d&&e.pts&&this.apiUpdatesManager.addChannelState(d,e.pts),this.generateIndexForDialog(e),l){const w=this.dialogsStorage.prepareDialogUnreadCountModifying(l);Wt(l,e),w()}return this.pushDialog({dialog:e,ignoreOffsetDate:a,saveGlobalOffset:s}),n&&this.processTopicUpdate(e,l),!0}processTopicUpdate(e,t){if(!t)return;const{peerId:a,id:s}=e,n=e.icon_emoji_id!==t.icon_emoji_id,i=e.title!==t.title,r=n||i;n&&this.rootScope.dispatchEvent("avatar_update",{peerId:a,threadId:s}),r&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:a,threadId:s})}getDialogs(e){const{query:t="",offsetIndex:a,limit:s=20,filterId:n=ct,filterType:i=this.getFilterType(n),skipMigrated:r=i===1,forceLocal:p,recursion:d}=e,f=this.isFilterIdForForum(n),c=this.isVirtualFilter(n);if(!c&&!je.has(n)){const F=[],L=this.appUsersManager.fillContacts();L.cached||F.push(L.promise);const z=this.filtersStorage.reloadMissingPeerIds(n);if(z&&F.push(z),F.length)return Promise.all(F).then(()=>this.getDialogs(e))}const l=(!je.has(n)||this.getOffsetDate(n))&&!c?Ft:n;let m=this.getFolderDialogs(n,r);const u=this.getDialogIndexKeyByFilterId(n),M=i!==2,A=i===1;if(t&&M){if(!s||this.cachedResults.query!==t||this.cachedResults.folderId!==n||d){this.cachedResults.query=t,this.cachedResults.folderId=n;const L=(f?this.getForumTopicsCache(n).index:this.dialogsIndex).search(t),z=[];if(f)for(const j of L){const Z=this.getForumTopic(n,j);Z&&z.push(Z)}else for(const j of L){const Z=this.dialogs[j];Z&&Z.folder_id===n&&z.push(Z)}z.sort((j,Z)=>this.getDialogIndex(Z,u)-this.getDialogIndex(j,u)),this.cachedResults.dialogs=z,this.cachedResults.count=z.length}m=this.cachedResults.dialogs}else this.cachedResults.query="";let w=0;if(a>0)for(let F=m.length;w<F&&!(a>this.getDialogIndex(m[w],u));++w);const C=this.isDialogsLoaded(l),I=m.length>=w+s;if(!A&&t||C||I||p){const F=m.slice(w,w+s);return{dialogs:F,count:C?m.length:this.getFolder(n).count,isTopEnd:m.length&&(F[0]&&F[0]===m[0]||this.getDialogIndex(m[0],u)<a),isEnd:((A?!1:t)||C)&&w+s>=m.length}}return this.appMessagesManager.getTopMessages({limit:s,folderId:l,query:t,offsetTopicId:f&&t?m[m.length-1]?.id:void 0}).then(F=>{if(t)return this.getDialogs({...e,forceLocal:!0,recursion:!0});const L=this.getFolder(n);if(L.count=F.count,r&&(m=this.getFolderDialogs(n,r)),w=0,a>0)for(let j=m.length;w<j&&!(a>this.getDialogIndex(m[w],u));++w);const z=m.slice(w,w+s);return{dialogs:z,count:F.count??m.length,isTopEnd:m.length&&(z[0]&&z[0]===m[0]||this.getDialogIndex(m[0],u)<a),isEnd:F.isEnd&&m[m.length-1]===z[z.length-1]}})}async markFolderAsRead(e){const a=[...this.getFolder(e).unreadPeerIds];for(const s of a)await this.appMessagesManager.markDialogUnread(s,!0)}flushForumTopicsCache(e){const t=this.forumTopics.get(e);if(!t)return;const a=this.folders[e];a&&(a.dispatchUnreadTimeout&&clearTimeout(a.dispatchUnreadTimeout),delete this.allDialogsLoaded[e],delete this.pinnedOrders[e],delete this.dialogsOffsetDate[e],delete this.folders[e]),t.topics.clear()}getForumTopicsCache(e){let t=this.forumTopics.get(e);return t||(t={topics:new Map,deletedTopics:new Set,getTopicPromises:new Map,index:this.createSearchIndex()},this.forumTopics.set(e,t)),t}getForumTopicById(e,t){if(!this.appPeersManager.isForum(e))return Promise.reject(Ee("CHANNEL_FORUM_MISSING"));const a=this.getForumTopicsCache(e);let s;if(t){if(s=a.getTopicPromises.get(t),s)return s;if(a.deletedTopics.has(t))return Promise.resolve(void 0);a.getTopicPromises.set(t,s=Pe())}return a.getTopicsPromise??(a.getTopicsPromise=rt(0).then(()=>{const n={},i=[];for(const[p,d]of a.getTopicPromises)n[p]=d,i.push(ae(p));a.getTopicPromises.clear();const r=()=>{for(const p in n)n[p].resolve(void 0),a.deletedTopics.add(+p)};if(this.getForumTopicsCache(e)!==a){r();return}return this.apiManager.invokeApi("channels.getForumTopicsByID",{channel:this.appChatsManager.getChannelInput(e.toChatId()),topics:i}).then(p=>{if(this.getForumTopicsCache(e)===a)return this.applyDialogs(p,e),p.topics.forEach(d=>{Je(d)&&(n[d.id].resolve(d),delete n[d.id])}),p},()=>{}).then(()=>{r(),a.getTopicsPromise=void 0,a.getTopicPromises.size&&this.getForumTopicById(e)})})),s||a.getTopicsPromise}getForumTopic(e,t){return this.forumTopics.get(e)?.topics?.get(t)}getForumTopicOrReload(e,t){const a=this.getForumTopic(e,t);return a||(this.getForumTopicsCache(e)?.deletedTopics?.has(t)?void 0:this.getForumTopicById(e,t))}processTopics(e,t){return Ce(t,a=>{"pts"in a&&this.apiUpdatesManager.addChannelState(e.toChatId(),a.pts);const s=this.appPeersManager.getOutputPeer(e);return a.topics=a.topics.map(n=>{if(Je(n))return n.peer=s,n.id=this.appMessagesIdsManager.generateMessageId(n.id,s.channel_id),n}).filter(Boolean),a})}processTopicsPromise(e,t){return t.then(a=>(this.processTopics(e,a),a))}getForumUnreadCount(e,t){if(!this.appPeersManager.isForum(e))return;if(t){const n=this.getDialogOnly(e);if(n&&n.pFlags.view_forum_as_messages)return}const a=this.getFolder(e),s=a.dialogs.length>=20||this.isDialogsLoaded(e)?a.dialogs.slice(0,20):Ce(this.getDialogs({filterId:e,limit:20}),n=>n.dialogs);return Ce(s,n=>({count:n.reduce((i,r)=>i+ +!!r.unread_count,0),hasUnmuted:n.some(i=>i.unread_count&&this.isDialogUnmuted(i))}))}canManageTopic(e){if(e.pFlags.my)return!0;const t=e.peerId.toChatId();return this.appChatsManager.getChat(t).admin_rights?this.appChatsManager.hasRights(e.peerId.toChatId(),"manage_topics"):!1}getSavedDialogById(e){let t=this.savedDialogsPromises.get(e);if(t)return t;const a=this.appPeersManager.peerId;t=this.apiManager.invokeApi("messages.getSavedHistory",{peer:this.appPeersManager.getInputPeerById(e),add_offset:0,hash:0,limit:1,max_id:0,min_id:0,offset_date:0,offset_id:0}).then(s=>{this.savedDialogsPromises.get(e)===t&&this.savedDialogsPromises.delete(e),this.appMessagesManager.saveApiResult(s);const i=s.messages[0];if(!i){this.log("reloaded saved dialog is empty",e),this.dropDialogOnDeletion(a,e);return}const r=this.getPinnedOrders(a),p={_:"savedDialog",peer:this.appPeersManager.getOutputPeer(e),pFlags:{pinned:r.includes(e)||void 0},top_message:i.id||0};return this.log("saving reloaded saved dialog",e),this.applyDialogs({_:"messages.savedDialogs",dialogs:[p]}),p.peerId?p:void 0})}handleDialogTogglePinned(e,t,a){e&&(t?e.pFlags.pinned=!0:this.handleDialogUnpinning(e,a),this.generateIndexForDialog(e)),this.appMessagesManager.scheduleHandleNewDialogs(e.peerId,e)}handleDialogsPinned(e,t){const a=this.isFilterIdForForum(e),s=e===this.appPeersManager.peerId,n=a||s;this.resetPinnedOrder(e),this.getPinnedOrders(e).push(...t),this.savePinnedOrders(),t.reverse();const i={};t.forEach(p=>{i[p]=!0;const d=n?e:p,f=n?p:void 0,c=this.getAnyDialog(d,f);this.appMessagesManager.scheduleHandleNewDialogs(d,c),c&&(c.pFlags.pinned=!0,this.generateIndexForDialog(c))});const r=this.getFolderDialogs(e,!1);for(const p of r){if(!p.pFlags.pinned)break;i[At(p)]||(delete p.pFlags.pinned,this.generateIndexForDialog(p),this.appMessagesManager.scheduleHandleNewDialogs(p.peerId,p))}}}function it(o){if(o===null||typeof o!="object")return o;if(o instanceof Date)return new Date(o.getTime());if(Array.isArray(o))return o.map(s=>it(s));if(ArrayBuffer.isView(o))return o.slice();const e=new o.constructor;for(var t in o)o.hasOwnProperty(t)&&(e[t]=it(o[t]));return e}function wt(o,e){const t=o.findIndex(e);return t!==-1?o.splice(t,1)[0]:void 0}const Kr=[["pinned_peers","pinnedPeerIds"],["exclude_peers","excludePeerIds"],["include_peers","includePeerIds"]],Jr=je.size,Qr={_:"dialogFilter",pFlags:{},id:0,title:"",exclude_peers:[],include_peers:[],pinned_peers:[],excludePeerIds:[],includePeerIds:[],pinnedPeerIds:[]};class Yr extends ce{constructor(){super(...arguments),this.clear=e=>{if(!e)this.reloadedPeerIds.clear(),this.clearFilters();else{this.filters={},this.filtersArr=[],this.reloadedPeerIds=new Set,this.localFilters={};for(const t of je)this.localFilters[t]=this.generateLocalFilter(t)}this.localId=ms},this.onUpdateDialogFilter=e=>{e.filter?this.saveDialogFilter(e.filter):this.filters[e.id]&&(this.rootScope.dispatchEvent("filter_delete",this.filters[e.id]),delete this.filters[e.id],wt(this.filtersArr,t=>t.id===e.id)),this.pushToState()},this.onUpdateDialogFilters=e=>{const t=it(this.filters);this.getDialogFilters(!0).then(a=>{for(const s in t){const n=+s;a.find(i=>i.id===n)||this.onUpdateDialogFilter({_:"updateDialogFilter",id:n})}this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:a.map(s=>s.id)})})},this.onUpdateDialogFilterOrder=e=>{const t=e.order.slice();t.includes(Dt)||t.splice(t[0]===ct?1:0,0,Dt),this.localId=ms,t.forEach(a=>{const s=this.filters[a];delete s.localId,this.setLocalId(s)}),this.rootScope.dispatchEvent("filter_order",t),this.pushToState()}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateDialogFilter:this.onUpdateDialogFilter,updateDialogFilters:this.onUpdateDialogFilters,updateDialogFilterOrder:this.onUpdateDialogFilterOrder}),this.rootScope.addEventListener("premium_toggle",()=>{this.onUpdateDialogFilters({_:"updateDialogFilters"})}),this.appStateManager.getState().then(e=>{this.prependFilters(e.filtersArr).map(a=>{this.saveDialogFilter(a,!1,!0)})})}prependFilters(e){e=e.slice();const t=this.localFilters[ct],a=this.localFilters[Dt],s=e.findIndex(n=>n._==="dialogFilterDefault"||n.id===ct);return s!==-1?e[s]=t:e.unshift(t),wt(e,n=>n.id===Dt),e.splice(e[0]===t?1:0,0,a),this.localId=ms,e.forEach(n=>{delete n.localId}),e}generateLocalFilter(e){const t={...it(Qr),id:e};return e===ct?t.pFlags.exclude_archived=!0:e===Dt&&(t.pFlags.exclude_unarchived=!0),je.has(e)&&(t.pinnedPeerIds=this.dialogsStorage.getPinnedOrders(e)),t}pushToState(){this.appStateManager.pushToState("filtersArr",this.filtersArr)}testDialogForFilter(e,t){if(!t||!yt(e))return!0;const{peerId:a}=e;if(je.has(t.id))return e.folder_id===t.id&&this.dialogsStorage.canSaveDialog(a,e);if(!this.appMessagesManager.getDialogOnly(a)||t.excludePeerIds?.includes(a))return!1;if(t.includePeerIds?.includes(a))return!0;const s=t.pFlags;if(!s)return!0;if(s.exclude_archived&&e.folder_id===Dt||s.exclude_read&&!this.appMessagesManager.isDialogUnread(e)||s.exclude_muted&&this.appNotificationsManager.isPeerLocalMuted({peerId:a})&&!(e.unread_mentions_count&&e.unread_count))return!1;if(this.appPeersManager.isAnyChat(a)){if(s.broadcasts&&this.appPeersManager.isBroadcast(a)||s.groups&&this.appPeersManager.isAnyGroup(a))return!0}else{const n=a.toUserId();if(this.appUsersManager.isBot(n))return!!s.bots;if(s.non_contacts&&!this.appUsersManager.isContact(n)||s.contacts&&this.appUsersManager.isContact(n))return!0}return!1}testDialogForFilterId(e,t){return this.testDialogForFilter(e,this.filters[t])}getFilter(e){return this.filters[e]}getFilters(){return this.filters}clearFilters(){const e=this.getFilters();for(const t in e)je.has(+t)||this.onUpdateDialogFilter({_:"updateDialogFilter",id:+t})}async toggleDialogPin(e,t){const a=this.filters[t],s=a.pinnedPeerIds.indexOf(e),n=s!==-1;if(n&&(a.pinned_peers.splice(s,1),a.pinnedPeerIds.splice(s,1)),!n){if(a.pinned_peers.length>=await this.apiManager.getLimit("folderPin"))return Promise.reject(Ee("PINNED_DIALOGS_TOO_MUCH"));a.pinned_peers.unshift(this.appPeersManager.getInputPeerById(e)),a.pinnedPeerIds.unshift(e)}return this.updateDialogFilter(a)}createDialogFilter(e,t){const a=Math.max(1,...Object.keys(this.filters).map(s=>+s));return e=it(e),e.id=a+1,this.updateDialogFilter(e,void 0,t)}updateDialogFilter(e,t=!1,a=!1){return this.apiManager.invokeApi("messages.updateDialogFilter",{id:e.id,filter:t?void 0:this.getOutputDialogFilter(e)}).then(()=>{if(this.onUpdateDialogFilter({_:"updateDialogFilter",id:e.id,filter:t?void 0:e}),a){const n=Object.values(this.filters).sort((i,r)=>i.localId-r.localId).map(i=>i.id);Oe(n,e.id),Oe(n,Dt),n.splice(n[0]===ct?1:0,0,e.id),this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:n})}return e})}updateDialogFiltersOrder(e){return this.apiManager.invokeApi("messages.updateDialogFiltersOrder",{order:e}).then(()=>{this.onUpdateDialogFilterOrder({_:"updateDialogFilterOrder",order:e})})}getOutputDialogFilter(e){const t=it(e);return this.filterIncludedPinnedPeers(e),t}filterIncludedPinnedPeers(e){Et(e.includePeerIds,(t,a)=>{e.pinnedPeerIds.includes(t)&&(e.include_peers.splice(a,1),e.includePeerIds.splice(a,1))})}reloadMissingPeerIds(e,t="pinned_peers"){const s=this.getFilter(e)?.[t];if(!s?.length)return;const n=s.filter(p=>{const d=this.appPeersManager.getPeerId(p),f=this.reloadedPeerIds.has(d),c=this.appMessagesManager.getDialogOnly(d);return!f&&!c});if(!n.length)return;const i=n.map(p=>{const d=this.appPeersManager.getPeerId(p);return this.appMessagesManager.reloadConversation(p).then(c=>(this.reloadedPeerIds.add(d),c?void 0:d))});return Promise.all(i).then(p=>{p=p.filter(Boolean),p.length})}async getDialogFilters(e=!1){const t=Object.keys(this.filters);if(t.length>Jr&&!e)return t.map(n=>this.filters[n]).sort((n,i)=>n.localId-i.localId);const a=await this.apiManager.invokeApiSingle("messages.getDialogFilters");return this.prependFilters(a.filters).map(n=>this.saveDialogFilter(n,e)).filter(Boolean)}getSuggestedDialogsFilters(){return this.apiManager.invokeApi("messages.getSuggestedDialogFilters")}saveDialogFilter(e,t=!0,a){e._==="dialogFilterDefault"&&(e=this.localFilters[ct]),je.has(e.id)||(Kr.forEach(([n,i])=>{const r=e[n];r&&(e[i]=r.map(p=>this.appPeersManager.getPeerId(p)))}),this.filterIncludedPinnedPeers(e),e.include_peers=e.pinned_peers.concat(e.include_peers),e.includePeerIds=e.pinnedPeerIds.concat(e.includePeerIds));const s=this.filters[e.id];return s?e=Object.assign(s,e):this.filters[e.id]=e,this.setLocalId(e),a||(t?this.rootScope.dispatchEvent("filter_update",e):s||this.rootScope.dispatchEvent("filter_new",e)),e}setLocalId(e){e.localId!==void 0?e.localId>=this.localId&&(this.localId=e.localId+1):(e.localId=this.localId++,wt(this.filtersArr,t=>t.id===e.id),this.filtersArr.push(e),this.pushToState())}async isFilterIdAvailable(e){if(je.has(e))return!0;const t=await this.apiManager.getLimit("folders");return this.filtersArr.filter(s=>!je.has(s.id)).slice(0,t).some(s=>s.id===e)}getChatlistInput(e){return{_:"inputChatlistDialogFilter",filter_id:e}}exportChatlistInvite(e){return this.apiManager.invokeApiSingleProcess({method:"chatlists.exportChatlistInvite",params:{chatlist:this.getChatlistInput(e.id),title:e.title,peers:e.include_peers},processResult:t=>(this.saveDialogFilter(t.filter),t)})}deleteExportedInvite(e,t){return this.apiManager.invokeApiSingleProcess({method:"chatlists.deleteExportedInvite",params:{chatlist:this.getChatlistInput(e),slug:t}})}editExportedInvite(e,t,a,s){return this.apiManager.invokeApi("chatlists.editExportedInvite",{chatlist:this.getChatlistInput(e),slug:t,title:s,peers:a.map(n=>this.appPeersManager.getInputPeerById(n))})}getExportedInvites(e){return this.getFilter(e)?._==="dialogFilter"?Promise.reject(Ee("FILTER_NOT_SUPPORTED")):this.apiManager.invokeApiSingleProcess({method:"chatlists.getExportedInvites",params:{chatlist:this.getChatlistInput(e)},processResult:a=>(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),a.invites)})}checkChatlistInvite(e){return this.apiManager.invokeApiSingleProcess({method:"chatlists.checkChatlistInvite",params:{slug:e},processResult:t=>(this.appUsersManager.saveApiUsers(t.users),this.appChatsManager.saveApiChats(t.chats),t)})}joinChatlistInvite(e,t){return this.apiManager.invokeApiSingleProcess({method:"chatlists.joinChatlistInvite",params:{slug:e,peers:t.map(a=>this.appPeersManager.getInputPeerById(a))},processResult:a=>{this.apiUpdatesManager.processUpdateMessage(a);const n=a.updates.find(i=>i._==="updateDialogFilter").id;return this.rootScope.dispatchEvent("filter_joined",this.getFilter(n)),n}})}getChatlistUpdates(e){if(this.getFilter(e)?._!=="dialogFilterChatlist")return Promise.reject(Ee("FILTER_NOT_SUPPORTED"));const a=Date.now();return this.apiManager.invokeApiSingleProcess({method:"chatlists.getChatlistUpdates",params:{chatlist:this.getChatlistInput(e)},processResult:s=>{this.appUsersManager.saveApiUsers(s.users),this.appChatsManager.saveApiChats(s.chats);const n=this.getFilter(e);return n?._==="dialogFilterChatlist"&&(n.updatedTime=a,this.pushToState()),s}})}joinChatlistUpdates(e,t){return this.apiManager.invokeApiSingleProcess({method:"chatlists.joinChatlistUpdates",params:{chatlist:this.getChatlistInput(e),peers:t.map(a=>this.appPeersManager.getInputPeerById(a))},processResult:a=>{this.apiUpdatesManager.processUpdateMessage(a)}})}hideChatlistUpdates(e){return this.apiManager.invokeApiSingle("chatlists.hideChatlistUpdates",{chatlist:this.getChatlistInput(e)})}getLeaveChatlistSuggestions(e){return this.apiManager.invokeApiSingle("chatlists.getLeaveChatlistSuggestions",{chatlist:this.getChatlistInput(e)})}leaveChatlist(e,t){return this.apiManager.invokeApiSingleProcess({method:"chatlists.leaveChatlist",params:{chatlist:this.getChatlistInput(e),peers:t.map(a=>this.appPeersManager.getInputPeerById(a))},processResult:a=>{this.apiUpdatesManager.processUpdateMessage(a)}})}}function Ua(o){return[...new Set(o)]}const $r="((?:👨🏻❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👨🏼❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👨🏽❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👨🏾❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👨🏿❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏻❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏻❤️?💋👩\uD83C[\uDFFB-\uDFFF]|👩🏼❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏼❤️?💋👩\uD83C[\uDFFB-\uDFFF]|👩🏽❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏽❤️?💋👩\uD83C[\uDFFB-\uDFFF]|👩🏾❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏾❤️?💋👩\uD83C[\uDFFB-\uDFFF]|👩🏿❤️?💋👨\uD83C[\uDFFB-\uDFFF]|👩🏿❤️?💋👩\uD83C[\uDFFB-\uDFFF]|🧑🏻❤️?💋🧑\uD83C[\uDFFC-\uDFFF]|🧑🏼❤️?💋🧑\uD83C[\uDFFB\uDFFD-\uDFFF]|🧑🏽❤️?💋🧑\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|🧑🏾❤️?💋🧑\uD83C[\uDFFB-\uDFFD\uDFFF]|🧑🏿❤️?💋🧑\uD83C[\uDFFB-\uDFFE]|👨🏻❤️?👨\uD83C[\uDFFB-\uDFFF]|👨🏻🤝👨\uD83C[\uDFFC-\uDFFF]|👨🏼❤️?👨\uD83C[\uDFFB-\uDFFF]|👨🏼🤝👨\uD83C[\uDFFB\uDFFD-\uDFFF]|👨🏽❤️?👨\uD83C[\uDFFB-\uDFFF]|👨🏽🤝👨\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|👨🏾❤️?👨\uD83C[\uDFFB-\uDFFF]|👨🏾🤝👨\uD83C[\uDFFB-\uDFFD\uDFFF]|👨🏿❤️?👨\uD83C[\uDFFB-\uDFFF]|👨🏿🤝👨\uD83C[\uDFFB-\uDFFE]|👩🏻❤️?👨\uD83C[\uDFFB-\uDFFF]|👩🏻❤️?👩\uD83C[\uDFFB-\uDFFF]|👩🏻🤝👨\uD83C[\uDFFC-\uDFFF]|👩🏻🤝👩\uD83C[\uDFFC-\uDFFF]|👩🏼❤️?👨\uD83C[\uDFFB-\uDFFF]|👩🏼❤️?👩\uD83C[\uDFFB-\uDFFF]|👩🏼🤝👨\uD83C[\uDFFB\uDFFD-\uDFFF]|👩🏼🤝👩\uD83C[\uDFFB\uDFFD-\uDFFF]|👩🏽❤️?👨\uD83C[\uDFFB-\uDFFF]|👩🏽❤️?👩\uD83C[\uDFFB-\uDFFF]|👩🏽🤝👨\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|👩🏽🤝👩\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|👩🏾❤️?👨\uD83C[\uDFFB-\uDFFF]|👩🏾❤️?👩\uD83C[\uDFFB-\uDFFF]|👩🏾🤝👨\uD83C[\uDFFB-\uDFFD\uDFFF]|👩🏾🤝👩\uD83C[\uDFFB-\uDFFD\uDFFF]|👩🏿❤️?👨\uD83C[\uDFFB-\uDFFF]|👩🏿❤️?👩\uD83C[\uDFFB-\uDFFF]|👩🏿🤝👨\uD83C[\uDFFB-\uDFFE]|👩🏿🤝👩\uD83C[\uDFFB-\uDFFE]|🧑🏻❤️?🧑\uD83C[\uDFFC-\uDFFF]|🧑🏻🤝🧑\uD83C[\uDFFB-\uDFFF]|🧑🏼❤️?🧑\uD83C[\uDFFB\uDFFD-\uDFFF]|🧑🏼🤝🧑\uD83C[\uDFFB-\uDFFF]|🧑🏽❤️?🧑\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|🧑🏽🤝🧑\uD83C[\uDFFB-\uDFFF]|🧑🏾❤️?🧑\uD83C[\uDFFB-\uDFFD\uDFFF]|🧑🏾🤝🧑\uD83C[\uDFFB-\uDFFF]|🧑🏿❤️?🧑\uD83C[\uDFFB-\uDFFE]|🧑🏿🤝🧑\uD83C[\uDFFB-\uDFFF]|👨❤️?💋👨|👩❤️?💋\uD83D[\uDC68\uDC69]|🫱🏻🫲\uD83C[\uDFFC-\uDFFF]|🫱🏼🫲\uD83C[\uDFFB\uDFFD-\uDFFF]|🫱🏽🫲\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|🫱🏾🫲\uD83C[\uDFFB-\uDFFD\uDFFF]|🫱🏿🫲\uD83C[\uDFFB-\uDFFE]|👨❤️?👨|👩❤️?\uD83D[\uDC68\uDC69]|🧑🤝🧑|👫\uD83C[\uDFFB-\uDFFF]|👬\uD83C[\uDFFB-\uDFFF]|👭\uD83C[\uDFFB-\uDFFF]|💏\uD83C[\uDFFB-\uDFFF]|💑\uD83C[\uDFFB-\uDFFF]|🤝\uD83C[\uDFFB-\uDFFF]|\uD83D[\uDC6B-\uDC6D\uDC8F\uDC91]|🤝)|(?:\uD83D[\uDC68\uDC69]|🧑)(?:\uD83C[\uDFFB-\uDFFF])?(?:⚕️?|⚖️?|✈️?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C[\uDFCB\uDFCC]|\uD83D[\uDD74\uDD75]|⛹)(?:(?:\uD83C[\uDFFB-\uDFFF]|️?)[♀♂]️?)|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?[♀♂]️?|(?:👨👨👦👦|👨👨👧\uD83D[\uDC66\uDC67]|👨👩👦👦|👨👩👧\uD83D[\uDC66\uDC67]|👩👩👦👦|👩👩👧\uD83D[\uDC66\uDC67]|👨👦👦|👨👧\uD83D[\uDC66\uDC67]|👨👨\uD83D[\uDC66\uDC67]|👨👩\uD83D[\uDC66\uDC67]|👩👦👦|👩👧\uD83D[\uDC66\uDC67]|👩👩\uD83D[\uDC66\uDC67]|🏳️?⚧️?|🏳️?🌈|😶🌫️?|❤️?🔥|❤️?🩹|🏴☠️?|🐕🦺|🐻❄️?|👁🗨|👨\uD83D[\uDC66\uDC67]|👩\uD83D[\uDC66\uDC67]|👯♀️?|👯♂️?|😮💨|😵💫|🤼♀️?|🤼♂️?|🧞♀️?|🧞♂️?|🧟♀️?|🧟♂️?|🐈⬛)|[#*0-9]️??⃣|(?:[©®™♟]️?)|(?:\uD83C[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE1A\uDE2F\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF3\uDFF5\uDFF7]|\uD83D[\uDC3F\uDC41\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]|[‼⁉ℹ↔-↙↩↪⌚⌛⌨⏏⏭-⏯⏱⏲⏸-⏺Ⓜ▪▫▶◀◻-◾☀-☄☎☑☔☕☘☠☢☣☦☪☮☯☸-☺♀♂♈-♓♠♣♥♦♨♻♿⚒-⚗⚙⚛⚜⚠⚡⚧⚪⚫⚰⚱⚽⚾⛄⛅⛈⛏⛑⛓⛔⛩⛪⛰-⛵⛸⛺⛽✂✈✉✏✒✔✖✝✡✳✴❄❇❗❣❤➡⤴⤵⬅-⬇⬛⬜⭐⭕〰〽㊗㊙])(?:️?|(?!︎))|(?:(?:\uD83C[\uDFCB\uDFCC]|\uD83D[\uDD74\uDD75\uDD90]|[☝⛷⛹✌✍])(?:️?|(?!︎))|(?:\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD7A\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD\uDEC3-\uDEC5\uDEF0-\uDEF6]|[✊✋]))(?:\uD83C[\uDFFB-\uDFFF])?|(?:🏴|🏴|🏴|🇦\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|🇧\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|🇨\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|🇩\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|🇪\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|🇫\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|🇬\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|🇭\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|🇮\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|🇯\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|🇰\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|🇱\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|🇲\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|🇳\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|🇴🇲|🇵\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|🇶🇦|🇷\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|🇸\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|🇹\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|🇺\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|🇻\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|🇼\uD83C[\uDDEB\uDDF8]|🇽🇰|🇾\uD83C[\uDDEA\uDDF9]|🇿\uD83C[\uDDE6\uDDF2\uDDFC]|\uD83C[\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC6F\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3C\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDDE-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|[⏩-⏬⏰⏳♾⛎✅✨❌❎❓-❕➕-➗➰➿])|️)",Ia="a-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff\\u0100-\\u024f\\u0253\\u0254\\u0256\\u0257\\u0259\\u025b\\u0263\\u0268\\u026f\\u0272\\u0289\\u028b\\u02bb\\u0300-\\u036f\\u1e00-\\u1eff\\u0400-\\u04ff\\u0500-\\u0527\\u2de0-\\u2dff\\ua640-\\ua69f\\u0591-\\u05bf\\u05c1-\\u05c2\\u05c4-\\u05c5\\u05c7\\u05d0-\\u05ea\\u05f0-\\u05f4\\ufb1d-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufb4f\\u0610-\\u061a\\u0620-\\u065f\\u066e-\\u06d3\\u06d5-\\u06dc\\u06de-\\u06e8\\u06ea-\\u06ef\\u06fa-\\u06fc\\u06ff\\u0750-\\u077f\\u08a0\\u08a2-\\u08ac\\u08e4-\\u08fe\\ufb50-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\u200c\\u0e01-\\u0e3a\\u0e40-\\u0e4e\\u1100-\\u11ff\\u3130-\\u3185\\uA960-\\uA97F\\uAC00-\\uD7AF\\uD7B0-\\uD7FF\\u3003\\u3005\\u303b\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uff9f\\uffa1-\\uffdc",Zr="0-9_"+Ia,dn="·",ja="["+Ia+"0-9]",Xr="((?:https?|ftp)://|mailto:)?",$n=Xr+"(?:"+ja+"{1,64}(?::"+ja+"{0,64})?@)?(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}|"+ja+"["+Ia+dn+"0-9-]{0,64}(?:\\."+ja+"["+Ia+dn+"0-9-]{0,64}){0,10}(?:\\.(xn--[0-9a-z]{2,16}|["+Ia+`]{2,24})))(?::\\d{2,5})?(?:/(?:\\S{0,255}[^\\s.;,(\\[\\]{}<>"'])?)?`,Zn="[a-zA-Z\\d_]{5,32}",eo="(?:\\s|^)((?:(\\d{1,2}):(?:[0-5]?[0-9])|(?:\\d{1,2}|\\d{3,})):(?:[0-5][0-9]))(?:\\s|$)",to="\\/([a-zA-Z\\d_]{1,32})(?:@("+Zn+"))?(\\b|$)",fn=new RegExp("(^| )(@)("+Zn+")|("+$n+")|(\\n)|("+$r+")|(^|[\\s\\(\\]])(#["+Zr+"]{2,64})|(^|\\s)"+to+"|"+eo,"i"),ao=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,so=/(^|\s|\n)(````?)([\s\S]+?)(````?)([\s\n\.,:?!;]|$)|(^|\s|\x01)(`|~~|\*\*|__|_-_|\|\|)([^\n]+?)\7([\x01\s\.,:?!;]|$)|@(\d+)\s*\((.+?)\)|(\[(.+?)\]\((.+?)\))/m,Za={"`":"messageEntityCode","``":"messageEntityPre","**":"messageEntityBold",__:"messageEntityItalic","~~":"messageEntityStrike","_-_":"messageEntityUnderline","||":"messageEntitySpoiler"};new Set(Object.values(Za));const Xa=new Set(["messageEntityEmoji","messageEntityLinebreak","messageEntityCaret"]),no=new Set(Xa);for(const o in Za)Xa.add(Za[o]);const io=/^\+\d+$/,ro=new Set(["messageEntityLinebreak","messageEntityCaret","messageEntityHighlight","messageEntityBotCommand","messageEntityTimestamp"]),oo=new Set(["messageEntityBold","messageEntityItalic","messageEntityCode","messageEntityPre","messageEntityUnderline","messageEntityStrike","messageEntityBlockquote","messageEntitySpoiler"]);function po(o){for(let e=0;e<o.length;++e){const t=o[e];let a=-1;do if(a=o.findIndex((s,n)=>oo.has(s._)&&n!==e&&s._===t._&&s.offset-t.length===t.offset),a!==-1){const s=o[a];t.length+=s.length,o.splice(a,1)}while(a!==-1)}}const fo=new Set(["messageEntityPre","messageEntityCode"]);function Xn(o,e){let t=-1,a=-1;return o.find(s=>{const{offset:n,length:i}=s;return fo.has(s._)&&(t=n,a=t+i),t!==-1&&e.offset>=t&&e.offset<a&&!no.has(e._)?!0:e._===s._||!Xa.has(e._)&&!Xa.has(s._)?e.offset>=n&&e.length+e.offset<=i+n:!1})}function co(o){o.sort((e,t)=>e.offset-t.offset||t.length-e.length)}function ei(o,e){o=o.slice();const t=e.filter(a=>!Xn(o,a));o.push(...t),co(o);for(let a=0;a<o.length;++a){let s=o[a];if(s._==="messageEntityEmoji"){const n=o[a+1];n&&n.offset<s.offset+s.length&&(s=o[a]={...s},s.length=n.offset-s.offset)}}return o}function oa(o,e=[],t){const a=[];let s=!1;const n=c=>Xn(e,c)?s=!1:(a.push(c),s=!0),i=[];let r=0,p;for(;p=o.match(so);){const c=r+p.index,l=p.index+p[0].length,m=p.index>0&&o.slice(0,p.index);m&&i.push(m);const u=p[3]||p[8]||p[11]||p[13];let M;if(s=!1,u.match(/^`*$/))i.push(p[0]);else if(p[3]){let w=p[3].match(/(.*?)\n/);w?.[1]||(w=void 0);let C=w?p[3].slice(w[1].length):p[3];const I=C[0]===`
|
||
`?1:0,F=C[C.length-1]===`
|
||
`?-1:void 0;if(C=C.slice(I,F),M={_:"messageEntityPre",language:w?.[1]||"",offset:c+p[1].length,length:C.length},n(M)){F&&(r-=1),w&&(r-=w[0].length);let L="";if(p[1])L=p[1];else{const z=i[i.length-1];z&&!/\s/.test(z[z.length-1])&&(L=`
|
||
`)}i.push(L,C,p[5]),r-=p[2].length+p[4].length}}else if(p[7]){const w=p[6]==="";M={_:Za[p[7]],offset:c+(w?0:p[6].length),length:u.length},n(M)&&(w?i.push(u):i.push(p[6]+u+p[9]),r-=p[7].length*2+(w?2:0))}else p[11]?(M={_:"messageEntityMentionName",user_id:p[10].toUserId(),offset:c,length:u.length},n(M)&&(i.push(u),r-=p[0].length-u.length)):p[12]&&(M={_:"messageEntityTextUrl",url:p[14],offset:c,length:u.length},n(M)&&(i.push(u),r-=p[12].length-u.length));s||i.push(p[0]),o=o.substr(p.index+p[0].length),r+=p.index+p[0].length;const A=r-l;A&&e.forEach(w=>{w.offset>=c&&(w.offset+=A)})}o&&i.push(o);let d=i.join("");d.replace(/\s+/g,"").length||(d=o,a.splice(0,a.length)),e=ei(e,a),po(e);let f=d.length;{d=d.replace(/^\s*/,"");let c=f-d.length;c&&e.forEach(l=>{l.offset=Math.max(0,l.offset-c)}),d=d.replace(/\s*$/,""),c=f-d.length,f=d.length,c&&e.forEach(l=>{l.offset+l.length>f&&(l.length=f-l.offset)})}return[d,e]}function ti(o,e){e.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(a=>{const s=Object.getOwnPropertyDescriptor(t.prototype,a)||Object.create(null);a!=="constructor"&&Object.defineProperty(o.prototype,a,s)})})}const us=6;class ai{constructor(){this.updatesState={pendingPtsUpdates:[],pendingSeqUpdates:{},syncPending:null,syncLoading:null},this.channelStates={},this.attached=!1,this.log=We("UPDATES",ke.Error|ke.Warn|ke.Log),this.debug=qe,this.subscriptions={},this.processUpdateMessage=(e,t={})=>{const a=this.log.bindPrefix("processUpdateMessage"),s={date:e.date,seq:e.seq,seqStart:e.seq_start,ignoreSyncLoading:t.ignoreSyncLoading,local:t.local};switch(a.debug("processUpdateMessage",e,t),e._){case"updatesTooLong":case"new_session_created":this.forceGetDifference();break;case"updateShort":this.processUpdate(e.update,s);break;case"updateShortMessage":case"updateShortChatMessage":{a.debug("updateShortMessage | updateShortChatMessage",{...e});const n=e.pFlags.out,i=e.from_id||(n?this.appPeersManager.peerId:e.user_id),r=e.chat_id?e.chat_id.toPeerId(!0):e.user_id.toPeerId(!1)||this.appPeersManager.peerId;this.processUpdate({_:"updateNewMessage",message:{_:"message",pFlags:e.pFlags,id:e.id,from_id:this.appPeersManager.getOutputPeer(i.toPeerId()),peer_id:this.appPeersManager.getOutputPeer(r),date:e.date,message:e.message,fwd_from:e.fwd_from,reply_to:e.reply_to,entities:e.entities,ttl_period:e.ttl_period},pts:e.pts,pts_count:e.pts_count},s);break}case"updatesCombined":case"updates":this.appUsersManager.saveApiUsers(e.users,t.override),this.appChatsManager.saveApiChats(e.chats,t.override),e.updates.forEach(n=>{this.processUpdate(n,s)});break;default:a.warn("unknown update message",e)}},this._constructor(!1)}setProxy(){const e=this;this.updatesState=new Proxy(this.updatesState,{set:function(t,a,s){return t[a]=s,e.saveUpdatesState(),!0}})}saveUpdatesState(){const e=this.updatesState;this.appStateManager.pushToState("updates",{seq:e.seq,pts:e.pts,date:e.date})}popPendingSeqUpdate(){const e=this.updatesState,t=e.seq+1,a=e.pendingSeqUpdates[t];if(!a)return!1;const s=a.updates;for(let n=0,i=s.length;n<i;++n)this.saveUpdate(s[n]);return e.seq=a.seq,a.date&&e.date<a.date&&(e.date=a.date),delete e.pendingSeqUpdates[t],!this.popPendingSeqUpdate()&&e.syncPending?.seqAwaiting&&e.seq>=e.syncPending.seqAwaiting&&(e.syncPending.ptsAwaiting?delete e.syncPending.seqAwaiting:this.clearStatePendingSync(e)),!0}popPendingPtsUpdate(e){const t=e?this.getChannelState(e):this.updatesState;if(!t.pendingPtsUpdates.length)return!1;t.pendingPtsUpdates.sort((i,r)=>i.pts-r.pts);let a=t.pts,s=0,n=0;for(let i=0,r=t.pendingPtsUpdates.length;i<r;++i){const p=t.pendingPtsUpdates[i];a+=p.pts_count,a>=p.pts&&(s=p.pts,n=i)}if(!s)return!1;this.log.debug("pop pending pts updates",s,t.pendingPtsUpdates.slice(0,n+1)),t.pts=s;for(let i=0;i<=n;++i){const r=t.pendingPtsUpdates[i];this.saveUpdate(r)}return t.pendingPtsUpdates.splice(0,n+1),!t.pendingPtsUpdates.length&&t.syncPending&&(t.syncPending.seqAwaiting?delete t.syncPending.ptsAwaiting:this.clearStatePendingSync(t)),!0}forceGetDifference(){this.updatesState.syncLoading||this.getDifference()}processLocalUpdate(e){this.processUpdateMessage({_:"updateShort",update:e},{local:!0,ignoreSyncLoading:!0})}getDifference(e=!1){const t=this.log.bindPrefix("getDifference");t("get",e);const a=this.updatesState,s=a.syncLoading;s||(a.pendingSeqUpdates={},a.pendingPtsUpdates=[]),this.clearStatePendingSync(a);const n=this.apiManager.invokeApi("updates.getDifference",{pts:a.pts,pts_total_limit:e?1200:void 0,date:a.date,qts:-1},{timeout:2147483647}).then(i=>{if(t("result",i),i._==="updates.differenceEmpty"){t("apply empty diff",i.seq),a.date=i.date,a.seq=i.seq;return}if(e&&this.rootScope.dispatchEvent("state_synchronizing"),i._!=="updates.differenceTooLong"){this.appUsersManager.saveApiUsers(i.users),this.appChatsManager.saveApiChats(i.chats),t("applying",i.other_updates.length,"other updates"),i.other_updates.forEach(p=>{switch(p._){case"updateChannelTooLong":case"updateNewChannelMessage":case"updateEditChannelMessage":this.processUpdate(p);return}this.saveUpdate(p)}),t("applying",i.new_messages.length,"new messages"),i.new_messages.forEach(p=>{this.saveUpdate({_:"updateNewMessage",message:p,pts:a.pts,pts_count:0})});const r=i._==="updates.difference"?i.state:i.intermediate_state;a.seq=r.seq,a.pts=r.pts,a.date=r.date}else a.pts=i.pts,a.date=Ie(!0)+this.timeManager.getServerTimeOffset(),delete a.seq,this.channelStates={},t.warn("result type",i._),this.onDifferenceTooLong();if(t("apply diff",a.seq,a.pts),i._==="updates.differenceSlice")return this.getDifference();t("finish")});return s||this.setDifferencePromise(a,n),n}clearStatePendingSync(e){e.syncPending&&(clearTimeout(e.syncPending.timeout),e.syncPending=null)}getChannelDifference(e){const t=this.getChannelState(e),a=t.syncLoading;a||(t.pendingPtsUpdates=[]);const s=this.log.bindPrefix("getChannelDifference-"+e);this.clearStatePendingSync(t),s("get",t.pts);const n=this.apiManager.invokeApi("updates.getChannelDifference",{channel:this.appChatsManager.getChannelInput(e),filter:{_:"channelMessagesFilterEmpty"},pts:t.pts,limit:1e3},{timeout:2147483647}).then(i=>{if(s("diff result",i),t.pts="pts"in i?i.pts:void 0,t.lastDifferenceTime=Date.now(),i._==="updates.channelDifferenceEmpty"){s("apply channel empty diff",i);return}if(i._==="updates.channelDifferenceTooLong"){s("channel diff too long",i),delete this.channelStates[e],this.saveUpdate({_:"updateChannelReload",channel_id:e});return}if(this.appUsersManager.saveApiUsers(i.users),this.appChatsManager.saveApiChats(i.chats),s("applying",i.other_updates.length,"channel other updates"),i.other_updates.forEach(r=>{this.saveUpdate(r)}),s("applying",i.new_messages.length,"channel new messages"),i.new_messages.forEach(r=>{this.saveUpdate({_:"updateNewChannelMessage",message:r,pts:t.pts,pts_count:0})}),s("apply channel diff",t.pts),i._==="updates.channelDifference"&&!i.pFlags.final)return this.getChannelDifference(e);s("finished channel get diff")});return a||this.setDifferencePromise(t,n,e),n}onDifferenceTooLong(){for(const e in this){const t=this[e];t instanceof ce&&t.clear?.()}this.rootScope.dispatchEvent("state_cleared")}setDifferencePromise(e,t,a){e.syncLoading=t,!a&&this.rootScope.dispatchEvent("state_synchronizing"),t.then(()=>{e.syncLoading=null,!a&&this.rootScope.dispatchEvent("state_synchronized")},()=>{e.syncLoading=null})}addChannelState(e,t){var a;if(!t)throw new Error("Add channel state without pts "+e);return(a=this.channelStates)[e]??(a[e]={pts:t,pendingPtsUpdates:[],syncPending:null,syncLoading:null})}getChannelState(e,t){return this.channelStates[e]===void 0&&this.addChannelState(e,t),this.channelStates[e]}processUpdate(e,t={}){var f;let a;switch(e._){case"updateNewChannelMessage":case"updateEditChannelMessage":a=this.appPeersManager.getPeerId(e.message.peer_id).toChatId();break;case"updateChannelTooLong":if(a=e.channel_id,!(a in this.channelStates))return!1;break;default:"channel_id"in e&&"pts"in e&&(a=e.channel_id);break}const{pts:s,pts_count:n}=e,i=a?this.getChannelState(a,s):this.updatesState,r=this.log.bindPrefix(`processUpdate${a?`-${a}`:""}`);if(r("process",i.pts,e),i.syncLoading&&!t.ignoreSyncLoading)return r("ignoring update, sync loading"),!1;if(i.syncLoading&&r("ignoring syncLoading"),e._==="updateChannelTooLong")return(!i.lastPtsUpdateTime||i.lastPtsUpdateTime<Date.now()-us)&&(r.warn("channel too long, get diff"),this.getChannelDifference(a)),!1;if(e._==="updateNewMessage"||e._==="updateEditMessage"||e._==="updateNewChannelMessage"||e._==="updateEditChannelMessage"){const c=e.message,l=this.appPeersManager.getPeerId(c.peer_id),m=c.fwd_from||{};let u;if(c.from_id&&!this.appUsersManager.hasUser(this.appPeersManager.getPeerId(c.from_id),c.pFlags.post)&&(u="author")||m.from_id&&!this.appUsersManager.hasUser(this.appPeersManager.getPeerId(m.from_id),!!m.from_id.channel_id)&&(u="fwdAuthor")||m.from_id?.channel_id&&!this.appChatsManager.hasChat(m.from_id.channel_id,!0)&&(u="fwdChannel")||l.isUser()&&!this.appUsersManager.hasUser(l)&&(u="toPeer User")||l.isAnyChat()&&!this.appChatsManager.hasChat(l.toChatId())&&(u="toPeer Chat"))return r.warn("not enough data for message update",l,u,c),a&&this.appChatsManager.hasChat(a)?this.getChannelDifference(a):this.forceGetDifference(),!1}else if(a&&!this.appChatsManager.hasChat(a))return r("skipping update, missing channel"),!1;let p,d;if(s){if(i.pts+(n||0)<s)return r.warn("pts hole",i,e,a&&this.appChatsManager.getChat(a)),i.pendingPtsUpdates.push(e),!i.syncPending&&!i.syncLoading&&(i.syncPending={timeout:we.setTimeout(()=>{i.syncPending=null,!i.syncLoading&&(a?this.getChannelDifference(a):this.getDifference())},us)}),i.syncPending&&(i.syncPending.ptsAwaiting=!0),!1;if(s>i.pts)i.pts=s,p=!0,i.lastPtsUpdateTime=Date.now();else if(n)return r.warn("duplicate update"),!1;a&&t.date&&this.updatesState.date<t.date&&(this.updatesState.date=t.date)}else if(!a&&t.seq>0){const c=t.seq,l=t.seqStart||c;if(l!==i.seq+1&&l>i.seq)return r.warn("seq hole",i,i.syncPending?.seqAwaiting),(f=i.pendingSeqUpdates)[l]??(f[l]={seq:c,date:t.date,updates:[]}),i.pendingSeqUpdates[l].updates.push(e),i.syncPending||(i.syncPending={timeout:we.setTimeout(()=>{i.syncPending=null,!i.syncLoading&&this.getDifference()},us)}),(!i.syncPending.seqAwaiting||i.syncPending.seqAwaiting<l)&&(i.syncPending.seqAwaiting=l),!1;i.seq!==c&&(i.seq=c,t.date&&i.date<t.date&&(i.date=t.date),d=!0)}this.saveUpdate(e),p?this.popPendingPtsUpdate(a):d&&this.popPendingSeqUpdate()}saveUpdate(e){this.log.debug("update",e),this.dispatchEvent(e._,e)}subscribeToChannelUpdates(e){var s;const t=(s=this.subscriptions)[e]??(s[e]={count:0});++t.count;const a=()=>{const n=this.getChannelState(e);!n.syncLoading&&(!n.lastDifferenceTime||Date.now()-n.lastDifferenceTime>2500)&&this.getChannelDifference(e)};t.interval??(t.interval=we.setInterval(a,3e3)),a()}unsubscribeFromChannelUpdates(e,t){const a=this.subscriptions[e];!a?.interval||--a.count&&!t||(clearInterval(a.interval),a.interval=void 0,delete this.subscriptions[e])}attach(e){this.attached||(this.log("attach"),this.attached=!0,this.appStateManager.getState().then(({updates:t})=>{const a=this.appStateManager.newVersion;!t||!t.pts||!t.date?(this.log("will get new state"),this.updatesState.syncLoading=new Promise(s=>{this.apiManager.invokeApi("updates.getState",{},{noErrorBox:!0}).then(n=>{this.updatesState.seq=n.seq,this.updatesState.pts=n.pts,this.updatesState.date=n.date,this.saveUpdatesState(),this.updatesState.syncLoading=null,s()})})):(Object.assign(this.updatesState,t),this.log("will get difference",Object.assign({},t)),this.getDifference(!0)),this.apiManager.setUpdatesProcessor(this.processUpdateMessage),this.setProxy(),a&&this.updatesState.syncLoading.then(async()=>{const s={en:"was updated to version",ru:"обновлён до версии"},n=r=>fetch(`changelogs/${r}_${a.split(" ")[0]}.md`).then(p=>p.status===200&&p.ok&&p.text()||Promise.reject()).then(p=>{const d=s[r]||s.en;p=`**Telegram Web${Ve.suffix} ${d} ${a}**
|
||
|
||
`+p;const[c,l]=oa(p,[]),m={_:"updateServiceNotification",entities:l,message:c,type:"local",pFlags:{},inbox_date:Ie(!0),media:void 0};this.processLocalUpdate(m)}),i=Ua([e,"en"]);for(const r of i)try{await n(r);break}catch{}})}))}}ti(ai,[ua,ce]);class lo extends ce{constructor(){super(...arguments),this.savedAvatarURLs={}}after(){this.rootScope.addEventListener("avatar_update",({peerId:e,threadId:t})=>{t||this.removeFromAvatarsCache(e)})}isAvatarCached(e,t){const a=this.savedAvatarURLs[e];return t===void 0?!!a:!!(a&&a[t]&&!(a[t]instanceof Promise))}removeFromAvatarsCache(e){this.savedAvatarURLs[e]&&(delete this.savedAvatarURLs[e],Be.getInstance().invokeVoid("mirror",{name:"avatars",key:""+e}))}loadAvatar(e,t,a){var p;const s=(p=this.savedAvatarURLs)[e]??(p[e]={});if(s[a])return s[a];const n={_:"inputPeerPhotoFileLocation",pFlags:{},peer:this.appPeersManager.getInputPeerById(e),photo_id:t.photo_id},i={dcId:t.dc_id,location:n};a==="photo_big"&&(n.pFlags.big=!0,i.limitPart=512*1024);const r=this.apiFileManager.download(i);return s[a]=r.then(d=>{const f=s[a]=URL.createObjectURL(d);return Be.getInstance().invokeVoid("mirror",{name:"avatars",key:$a(e,a),value:f}),f})}}const go={8:new Uint8Array(1),16:new Uint16Array(1),32:new Uint32Array(1)};function ha(o){const e=go[o];return crypto.getRandomValues(e),e[0]}function qt(){return""+ha(32)+ha(32)%16777215}class mo extends ce{after(){this.calls=new Map,Rt().IS_CALL_SUPPORTED&&this.apiUpdatesManager.addMultipleEventsListeners({updatePhoneCall:e=>{this.saveCall(e.phone_call)},updatePhoneCallSignalingData:e=>{this.rootScope.dispatchEvent("call_signaling",{callId:e.phone_call_id,data:e.data})}})}computeKey(e,t,a){return this.cryptoWorker.invokeCrypto("compute-dh-key",e,t,a)}saveCall(e){const t=e._==="phoneCallDiscarded",a=this.calls.get(e.id);return a?(Wt(a,e),t&&this.calls.delete(e.id),e=a):t||this.calls.set(e.id,e),this.rootScope.dispatchEvent("call_update",e),e}getCall(e){return this.calls.get(e)}getCallInput(e){const t=this.getCall(e);return{_:"inputPhoneCall",id:t.id,access_hash:t.access_hash}}savePhonePhoneCall(e){return this.appUsersManager.saveApiUsers(e.users),this.saveCall(e.phone_call)}generateDh(){return this.apiManager.invokeApi("messages.getDhConfig",{version:0,random_length:256}).then(e=>this.cryptoWorker.invokeCrypto("generate-dh",e))}async requestCall(e,t,a,s){const n=await this.apiManager.invokeApi("phone.requestCall",{user_id:this.appUsersManager.getUserInput(e),protocol:t,video:s,random_id:ha(32),g_a_hash:a});return this.savePhonePhoneCall(n)}async discardCall(e,t,a,s){if(!this.getCall(e))return;const n=await this.apiManager.invokeApi("phone.discardCall",{video:s,peer:this.getCallInput(e),duration:t,reason:{_:a},connection_id:"0"});this.apiUpdatesManager.processUpdateMessage(n)}}function ho(o,e,t,a){if(!o||o.pFlags.deactivated&&e!=="view_messages")return!1;const s=t===void 0;if(o.pFlags.creator&&s)return!0;if(o._==="chatForbidden"||o._==="channelForbidden"||o.pFlags.left&&!o.pFlags.megagroup||!t&&(t=o.admin_rights||o.banned_rights||o.default_banned_rights,!t))return!1;let n={};t&&(n=t.pFlags);const i=t._==="chatAdminRights";switch(e){case"embed_links":case"send_games":case"send_gifs":case"send_inline":case"send_media":case"send_messages":case"send_polls":case"send_stickers":case"send_photos":case"send_videos":case"send_roundvideos":case"send_audios":case"send_voices":case"send_docs":case"send_plain":{if(!i&&n[e]||o._==="channel"&&!o.pFlags.megagroup&&!n.post_messages)return!1;break}case"delete_messages":case"manage_call":return!!n[e];case"pin_messages":return i?!!(n[e]||!o.pFlags.megagroup&&n.post_messages):!n[e];case"invite_links":return o._==="chat"?!1:i&&!!n.invite_users;case"change_type":case"delete_chat":return!1;case"change_info":case"invite_users":return i||o.pFlags.broadcast?!!n[e]:!n[e];case"delete_stories":case"edit_stories":case"post_stories":case"add_admins":case"anonymous":case"post_messages":case"edit_messages":return i&&!!n[e];case"ban_users":case"change_permissions":return i&&!!n.ban_users;case"view_participants":return!!(o._==="chat"||!o.pFlags.broadcast||o.pFlags.creator||o.admin_rights);case"create_giveaway":return i&&!!n.post_messages;case"manage_topics":return i?!!n[e]:!n[e]}return!0}function It(o){return typeof o!="object"?o:o.peer?He(o.peer):o.user_id.toPeerId()}function zt(o){if(!o)return[];const e=o.usernames;return e?e.filter(t=>t.pFlags.active).map(t=>t.username):o.username?[o.username]:[]}class uo extends ce{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.chats={};else for(const t in this.chats)if(t&&!this.peersStorage.isPeerNeeded(t.toPeerId(!0))){const a=this.chats[t];this.appUsersManager.modifyUsernamesCache(a,!1),this.storage.delete(t),delete this.chats[t]}this.recommendations={}},this.onChatUpdated=(e,t,a)=>{this.apiUpdatesManager.processUpdateMessage(t),(a||t?.updates?.length)&&this.isChannel(e)&&this.rootScope.dispatchEvent("invalidate_participants",e)},this.onChatUpdatedForce=(e,t)=>this.onChatUpdated(e,t,!0),this.onUpdateChannelParticipant=e=>{this.appProfileManager.invalidateChannelParticipants(e.channel_id),this.rootScope.dispatchEvent("chat_participant",e)},this.onUpdateChatDefaultBannedRights=e=>{const t=this.appPeersManager.getPeerId(e.peer).toChatId(),a=this.chats[t];a&&(a.default_banned_rights=e.default_banned_rights,this.rootScope.dispatchEvent("chat_update",t))}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateChannelParticipant:this.onUpdateChannelParticipant,updateChatDefaultBannedRights:this.onUpdateChatDefaultBannedRights}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("chats")]).then(([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiChats(t),this.peersStorage.addEventListener("peerNeeded",s=>{s.isUser()||this.storage.getFromCache(s.toChatId())||this.storage.set({[s.toChatId()]:this.getChat(s.toChatId())})}),this.peersStorage.addEventListener("peerUnneeded",s=>{s.isUser()||!this.storage.getFromCache(s.toChatId())||this.storage.delete(s.toChatId())}),this.rootScope.addEventListener("premium_toggle",()=>{this.recommendations={}})})}saveApiChats(e,t){!e||e.saved||(e.saved=!0,e.forEach(a=>this.saveApiChat(a,t)))}saveApiChat(e,t){if(!e||e._==="chatEmpty")return;const a=this.chats[e.id];if(e.pFlags??(e.pFlags={}),e.pFlags.min&&a!==void 0)return;e._==="channel"&&e.participants_count===void 0&&a!==void 0&&a.participants_count&&(e.participants_count=a.participants_count),e.photo?._==="chatPhotoEmpty"&&delete e.photo;const s=this.appUsersManager.setUsernameToCache(e,a);e.emoji_status?._==="emojiStatusEmpty"&&delete e.emoji_status;const n=e.id.toPeerId(!0);if(a===void 0)this.chats[e.id]=e,this.mirrorChat(e);else{const i=a.photo?.photo_id,r=e.photo?.photo_id,p=a.pFlags.forum!==e.pFlags.forum,d=i!==r||p,f=a.emoji_status?.document_id!==e.emoji_status?.document_id,c=a.title!==e.title||s,l=f||a.pFlags.verified!==e.pFlags.verified||a.pFlags.scam!==e.pFlags.scam||a.pFlags.fake!==e.pFlags.fake,m=a.pFlags.left!==e.pFlags.left,u=this.appStoriesManager.saveApiPeerStories(e,a);Wt(a,e),this.mirrorChat(a),this.rootScope.dispatchEvent("chat_update",e.id),u?.(),m&&this.rootScope.dispatchEvent("chat_participation",{chatId:e.id,left:!!e.pFlags.left}),d&&this.rootScope.dispatchEvent("avatar_update",{peerId:n}),(c||l)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:n}),p&&this.rootScope.dispatchEvent("chat_toggle_forum",{chatId:e.id,enabled:!!e.pFlags.forum})}this.peersStorage.isPeerNeeded(n)&&this.storage.set({[e.id]:e})}mirrorChat(e){Be.getInstance().invokeVoid("mirror",{name:"peers",key:""+e.id.toPeerId(!0),value:e})}getChat(e){return this.chats[e]}getChats(){return this.chats}hasRights(e,t,a,s){return ho(this.getChat(e),t,a)}editChatDefaultBannedRights(e,t){const a=this.getChat(e);return a.default_banned_rights&&a.default_banned_rights.until_date===t.until_date&&St(a.default_banned_rights.pFlags,t.pFlags)?Promise.resolve():this.apiManager.invokeApi("messages.editChatDefaultBannedRights",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),banned_rights:t}).then(this.onChatUpdated.bind(this,e))}isChannel(e){const t=this.chats[e];return!!(t&&(t._==="channel"||t._==="channelForbidden"))}isMegagroup(e){return!!this.chats[e]?.pFlags?.megagroup}isForum(e){return!!this.chats[e]?.pFlags?.forum}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isInChat(e){let t=!0;const a=this.getChat(e);return(!a||a._==="channelForbidden"||a._==="chatForbidden"||a._==="chatEmpty"||a.pFlags.left||a.pFlags.deactivated)&&(t=!1),t}isPublic(e){const t=this.getChat(e);return!!zt(t)[0]}getChannelInput(e){const t=this.getChat(e);return!t||!t.access_hash?{_:"inputChannelEmpty"}:{_:"inputChannel",channel_id:e,access_hash:t.access_hash||"0"}}getInputPeer(e){return this.isChannel(e)?this.getChannelInputPeer(e):this.getChatInputPeer(e)}getChatInputPeer(e){return{_:"inputPeerChat",chat_id:e}}getChannelInputPeer(e){return{_:"inputPeerChannel",channel_id:e,access_hash:this.getChat(e).access_hash||0}}hasChat(e,t){const a=this.chats[e];return et(a)&&(t||!a.pFlags.min)}getChatString(e){const t=this.getChat(e);return this.isChannel(e)?(this.isMegagroup(e)?"s":"c")+e+"_"+t.access_hash:"g"+e}getChatSearchText(e){const t=this.chats[e];return t?[t.title,...zt(t)].filter(Boolean).join(" "):""}createChannel(e){return this.apiManager.invokeApi("channels.createChannel",e).then(t=>(this.apiUpdatesManager.processUpdateMessage(t),t.chats[0].id))}inviteToChannel(e,t){const a=this.getChannelInput(e),s=t.map(n=>this.appUsersManager.getUserInput(n));return this.apiManager.invokeApi("channels.inviteToChannel",{channel:a,users:s}).then(n=>{const i=Ie(!0);return t.map(p=>this.generateUpdateChannelParticipant({chatId:e,newParticipant:{_:"channelParticipant",date:i,user_id:p}})).forEach(p=>{this.apiUpdatesManager.processLocalUpdate(p)}),this.onChatUpdatedForce(e,n.updates),n.missing_invitees})}createChat(e,t){return this.apiManager.invokeApi("messages.createChat",{users:t.map(a=>this.appUsersManager.getUserInput(a)),title:e}).then(a=>(this.apiUpdatesManager.processUpdateMessage(a.updates),a.updates.chats[0].id))}leaveChannel(e){return this.apiManager.invokeApi("channels.leaveChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}joinChannel(e){return this.apiManager.invokeApi("channels.joinChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}addToChat(e,t){return this.isChannel(e)?this.inviteToChannel(e,[t]):this.addChatUser(e,t)}addChatUser(e,t,a=100){return this.apiManager.invokeApi("messages.addChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t),fwd_limit:a}).then(s=>(this.onChatUpdated(e,s.updates),s.missing_invitees))}deleteChatUser(e,t){return this.apiManager.invokeApi("messages.deleteChatUser",{chat_id:e,user_id:this.appUsersManager.getUserInput(t)}).then(this.onChatUpdated.bind(this,e))}leaveChat(e){return this.deleteChatUser(e,this.appUsersManager.getSelf().id)}leave(e){return this.isChannel(e)?this.leaveChannel(e):this.leaveChat(e)}delete(e){return this.isChannel(e)?this.deleteChannel(e):this.deleteChat(e)}deleteChannel(e){return this.apiManager.invokeApi("channels.deleteChannel",{channel:this.getChannelInput(e)}).then(this.onChatUpdated.bind(this,e))}deleteChat(e){return this.apiManager.invokeApi("messages.deleteChat",{chat_id:e})}migrateChat(e){const t=this.getChat(e);return t._==="channel"?Promise.resolve(t.id):this.apiManager.invokeApi("messages.migrateChat",{chat_id:e}).then(a=>(this.onChatUpdated(e,a),a.updates.find(n=>n._==="updateChannel").channel_id))}updateUsername(e,t,a){const s=this.apiManager.invokeApi("channels.updateUsername",{channel:this.getChannelInput(e),username:t});return this.refreshChatAfterRequest(e,s,a)}editAdmin(e,t,a,s=""){const n=this.isChannel(e),r=It(t).toUserId();return this.migrateChat(e).then(p=>this.apiManager.invokeApi("channels.editAdmin",{channel:this.getChannelInput(p),user_id:this.appUsersManager.getUserInput(r),admin_rights:a,rank:s}).then(d=>{const f=Ie(!0),c=this.generateUpdateChannelParticipant({chatId:p,newParticipant:Object.keys(a.pFlags).length?{_:"channelParticipantAdmin",date:f,admin_rights:a,promoted_by:this.appUsersManager.getSelf().id,user_id:r,rank:s,pFlags:{}}:{_:"channelParticipant",date:f,user_id:r},prevParticipant:t,wasChannel:n});this.apiUpdatesManager.processLocalUpdate(c),this.onChatUpdatedForce(p,d)}))}editPhoto(e,t){const a={_:"inputChatUploadedPhoto",file:t};let s;return this.isChannel(e)?s=this.apiManager.invokeApi("channels.editPhoto",{channel:this.getChannelInput(e),photo:a}):s=this.apiManager.invokeApi("messages.editChatPhoto",{chat_id:e,photo:a}),s.then(this.onChatUpdated.bind(this,e))}editTitle(e,t){let a;return this.isChannel(e)?a=this.apiManager.invokeApi("channels.editTitle",{channel:this.getChannelInput(e),title:t}):a=this.apiManager.invokeApi("messages.editChatTitle",{chat_id:e,title:t}),a.then(this.onChatUpdated.bind(this,e))}editAbout(e,t){const a=e.toPeerId(!0);return this.apiManager.invokeApi("messages.editChatAbout",{peer:this.appPeersManager.getInputPeerById(a),about:t}).then(s=>(s&&this.rootScope.dispatchEvent("peer_bio_edit",a),s))}generateUpdateChannelParticipant({chatId:e,prevParticipant:t,newParticipant:a,wasChannel:s}){const n=Ie(!0),i=It(t||a);return{_:"updateChannelParticipant",channel_id:e,date:n,actor_id:void 0,qts:void 0,user_id:i,prev_participant:s?t:void 0,new_participant:a,pFlags:{}}}async editBanned(e,t,a){const s=It(t),n=this.isChannel(e);return n||(e=await this.migrateChat(e)),this.apiManager.invokeApi("channels.editBanned",{channel:this.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(s),banned_rights:a}).then(i=>{const r=Ie(!0),p=this.generateUpdateChannelParticipant({chatId:e,wasChannel:n,prevParticipant:t,newParticipant:Object.keys(a.pFlags).length?{_:"channelParticipantBanned",date:r,banned_rights:a,kicked_by:this.appUsersManager.getSelf().id,peer:this.appPeersManager.getOutputPeer(s),pFlags:a.pFlags.view_messages?{left:!0}:{}}:void 0});this.apiUpdatesManager.processLocalUpdate(p),this.onChatUpdated(e,i)})}clearChannelParticipantBannedRights(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{}})}kickFromChannel(e,t){return this.editBanned(e,t,{_:"chatBannedRights",until_date:0,pFlags:{view_messages:!0}})}kickFromChat(e,t){return this.isChannel(e)?this.kickFromChannel(e,t):this.deleteChatUser(e,et(t)?It(t):t.toUserId())}resolveChannel(e){return this.apiManager.invokeApiSingle("channels.getChannels",{id:[{_:"inputChannel",channel_id:e,access_hash:"0"}]}).then(t=>{this.saveApiChats(t.chats)})}setChatAvailableReactions(e,t){return this.appProfileManager.modifyCachedFullChat(e,a=>{a.available_reactions=t}),this.apiManager.invokeApi("messages.setChatAvailableReactions",{peer:this.getInputPeer(e),available_reactions:t}).then(this.onChatUpdated.bind(this,e))}getSendAs(e){const t=n=>(this.appUsersManager.saveApiUsers(n.users),this.saveApiChats(n.chats),n.peers),a=this.getChannelInputPeer(e),s=this.apiManager.invokeApiCacheable("channels.getSendAs",{peer:a},{cacheSeconds:60,syncIfHasResult:!0});return Ce(s,t)}checkUsername(e,t){return this.apiManager.invokeApi("channels.checkUsername",{channel:this.getChannelInput(e),username:t})}getSponsoredMessage(e){return this.apiManager.invokeApiCacheable("channels.getSponsoredMessages",{channel:this.getChannelInput(e)},{cacheSeconds:300}).then(a=>{if(a._!=="messages.sponsoredMessages")return a;this.appPeersManager.saveApiPeers(a);const s=a.messages.shift();return a.messages.push(s),a.messages.forEach(n=>{n.photo&&(n.photo=this.appPhotosManager.savePhoto(n.photo))}),a})}viewSponsoredMessage(e,t){return this.apiManager.invokeApiSingle("channels.viewSponsoredMessage",{channel:this.getChannelInput(e),random_id:t})}clickSponsoredMessage(e,t){return this.apiManager.invokeApiSingle("channels.clickSponsoredMessage",{channel:this.getChannelInput(e),random_id:t})}deactivateAllUsernames(e,t){const a=this.apiManager.invokeApi("channels.deactivateAllUsernames",{channel:this.getChannelInput(e)});return this.refreshChatAfterRequest(e,a,t)}makeChannelPrivate(e){const t=[this.updateUsername(e,"",!0),this.deactivateAllUsernames(e,!0)],a=Promise.all(t).then(()=>!0);return this.refreshChatAfterRequest(e,a)}refreshChatAfterRequest(e,t,a){return a?t:t.then(s=>this.getChannels([e]).then(()=>s))}getChannels(e){return this.apiManager.invokeApi("channels.getChannels",{id:e.map(t=>this.getChannelInput(t))}).then(t=>{this.saveApiChats(t.chats)})}toggleSomething(e,t,a,s){return this.migrateChat(e).then(n=>this.apiManager.invokeApi(`channels.${t}`,{channel:this.getChannelInput(n),enabled:a}).then((s?this.onChatUpdatedForce:this.onChatUpdated).bind(this,n)))}toggleParticipantsHidden(e,t){return this.toggleSomething(e,"toggleParticipantsHidden",t,!0)}togglePreHistoryHidden(e,t){return this.toggleSomething(e,"togglePreHistoryHidden",t)}toggleSignatures(e,t){return this.toggleSomething(e,"toggleSignatures",t)}toggleNoForwards(e,t){return this.apiManager.invokeApi("messages.toggleNoForwards",{peer:this.getInputPeer(e),enabled:t}).then(this.onChatUpdated.bind(this,e))}toggleJoinToSend(e,t){return this.toggleSomething(e,"toggleJoinToSend",t)}toggleJoinRequest(e,t){return this.toggleSomething(e,"toggleJoinRequest",t)}toggleForum(e,t){return this.toggleSomething(e,"toggleForum",t)}toggleAntiSpam(e,t){return this.toggleSomething(e,"toggleAntiSpam",t)}toggleViewForumAsMessages(e,t){return this.apiUpdatesManager.processLocalUpdate({_:"updateChannelViewForumAsMessages",channel_id:e,enabled:t}),this.toggleSomething(e,"toggleViewForumAsMessages",t)}editForumTopic(e){const{chatId:t,topicId:a,title:s,iconEmojiId:n,closed:i,hidden:r}=e;return this.apiManager.invokeApi("channels.editForumTopic",{channel:this.getChannelInput(t),topic_id:ae(a),title:s,icon_emoji_id:n,closed:i,hidden:r}).then(this.onChatUpdated.bind(this,t))}async createForumTopic(e){const{chatId:t,title:a,iconColor:s,iconEmojiId:n}=e,i=await this.appProfileManager.getChannelFull(t),r=i.default_send_as&&this.appPeersManager.getInputPeerById(this.appPeersManager.getPeerId(i.default_send_as));return this.apiManager.invokeApi("channels.createForumTopic",{channel:this.getChannelInput(t),title:a,icon_color:s,icon_emoji_id:n,random_id:qt(),send_as:r}).then(p=>{this.onChatUpdated(t,p);const d=p.updates.find(f=>f._==="updateNewChannelMessage");return this.appMessagesIdsManager.generateMessageId(d.message.id,t)})}updatePinnedForumTopic(e,t,a){return this.apiManager.invokeApi("channels.updatePinnedForumTopic",{channel:this.getChannelInput(e),topic_id:ae(t),pinned:a}).then(this.onChatUpdated.bind(this,e))}getGroupsForDiscussion(){return this.apiManager.invokeApi("channels.getGroupsForDiscussion").then(e=>(this.saveApiChats(e.chats),e.chats))}async setDiscussionGroup(e,t){return this.getChat(t)&&!this.isChannel(t)&&(t=await this.migrateChat(t)),t&&(await this.appProfileManager.getChannelFull(t)).pFlags.hidden_prehistory&&await this.togglePreHistoryHidden(t,!1),this.apiManager.invokeApi("channels.setDiscussionGroup",{broadcast:this.getChannelInput(e),group:this.getChannelInput(t)}).then(()=>{const a=this.appProfileManager.getCachedFullChat(e),s=t||a.linked_chat_id,n=this.appProfileManager.getCachedFullChat(s);a&&(a.linked_chat_id=t),n&&(n.linked_chat_id=e),a&&this.rootScope.dispatchEvent("chat_full_update",e),n&&this.rootScope.dispatchEvent("chat_full_update",s)})}async toggleSlowMode(e,t){return e=await this.migrateChat(e),this.apiManager.invokeApi("channels.toggleSlowMode",{channel:this.getChannelInput(e),seconds:t}).then(this.onChatUpdated.bind(this,e))}hideChatJoinRequest(e,t,a){return this.apiManager.invokeApi("messages.hideChatJoinRequest",{peer:this.appChatsManager.getInputPeer(e),user_id:this.appUsersManager.getUserInput(t),approved:a}).then(s=>this.onChatUpdated(e,s,!0))}getChannelRecommendations(e){const t=this.recommendations[e];if(t)return t;const a=this.recommendations[e]=this.apiManager.invokeApiSingleProcess({method:"channels.getChannelRecommendations",params:{channel:this.getChannelInput(e)},processResult:s=>(this.saveApiChats(s.chats),this.recommendations[e]===a&&(this.recommendations[e]=s),s)});return a}reportSponsoredMessage(e,t,a){return this.apiManager.invokeApi("channels.reportSponsoredMessage",{channel:this.getChannelInput(e),random_id:t,option:a})}}function si(o){return o.charAt(0).toUpperCase()+o.slice(1)}const yo=new Set(["javascript:"]);function ni(o){if(!o)return null;try{const e=new URL(o).protocol;return yo.has(e)?null:e}catch{return null}}function zs(o,e){ni(o)||(o="https://"+o);const t={url:o};let a,s,n;if(a=o.match(/^(?:https?:\/\/)?(?:(.+?)\.)?(?:(?:web|k|z|a)\.)?t(?:elegram)?\.me(?:\/(.+))?/)){const i=new URL(o);let r=a[1];r&&ir.has(a[1])&&(r=void 0),r&&(i.pathname=r+(i.pathname==="/"?"":i.pathname));const p=i.pathname.slice(1),d=p.split("/");if(d[0]&&d[0][0]==="$"&&d[0].length>1)n="invoice";else if(/^\+/.test(p)&&!io.test(p))n="joinchat";else if(d[0])switch(d[0]){case"m":case"addlist":case"joinchat":case"addstickers":case"addemoji":case"voicechat":case"invoice":case"boost":case"giftcode":if(d.length!==1&&!r){n=d[0];break}default:if(d.length<=2||d[1]?.match(/^\d+(?:\?(?:comment|thread)=\d+)?$/)||d[1]==="s"){n="im";break}break}}else o.match(/^(?:https?:\/\/)?telesco\.pe\/([^/?]+)\/(\d+)/)?n="im":(s=o.match(/tg:(?:\/\/)?(.+?)(?:\?|$)/))&&(n="tg_"+s[1]);return window[n]||(n=void 0),t.onclick=n,t}Ue&&(Ue.wrapUrl=zs);function _o(o){o.setAttribute("dir","auto")}function Po(o){return o.target="_blank",o.rel="noopener noreferrer",o}const Mo=(o,e)=>o===e,cn={equals:Mo};let vo=pi;const Ta=1,es=2;var za=null;let ys=null,So=null,Xe=null,ot=null,ta=null,ps=0;function bo(o,e){e=e?Object.assign({},cn,e):cn;const t={value:o,observers:null,observerSlots:null,comparator:e.equals||void 0},a=s=>(typeof s=="function"&&(s=s(t.value)),ii(t,s));return[Io.bind(t),a]}function Co(o){if(Xe===null)return o();const e=Xe;Xe=null;try{return o()}finally{Xe=e}}function Io(){if(this.sources&&this.state)if(this.state===Ta)ri(this);else{const o=ot;ot=null,ds(()=>ts(this)),ot=o}if(Xe){const o=this.observers?this.observers.length:0;Xe.sources?(Xe.sources.push(this),Xe.sourceSlots.push(o)):(Xe.sources=[this],Xe.sourceSlots=[o]),this.observers?(this.observers.push(Xe),this.observerSlots.push(Xe.sources.length-1)):(this.observers=[Xe],this.observerSlots=[Xe.sources.length-1])}return this.value}function ii(o,e,t){let a=o.value;return(!o.comparator||!o.comparator(a,e))&&(o.value=e,o.observers&&o.observers.length&&ds(()=>{for(let s=0;s<o.observers.length;s+=1){const n=o.observers[s],i=ys&&ys.running;i&&ys.disposed.has(n),(i?!n.tState:!n.state)&&(n.pure?ot.push(n):ta.push(n),n.observers&&di(n)),i||(n.state=Ta)}if(ot.length>1e6)throw ot=[],new Error})),e}function ri(o){if(!o.fn)return;Ks(o);const e=ps;Do(o,o.value,e)}function Do(o,e,t){let a;const s=za,n=Xe;Xe=za=o;try{a=o.fn(e)}catch(i){return o.pure&&(o.state=Ta,o.owned&&o.owned.forEach(Ks),o.owned=null),o.updatedAt=t+1,fi(i)}finally{Xe=n,za=s}(!o.updatedAt||o.updatedAt<=t)&&(o.updatedAt!=null&&"observers"in o?ii(o,a):o.value=a,o.updatedAt=t)}function oi(o){if(o.state===0)return;if(o.state===es)return ts(o);if(o.suspense&&Co(o.suspense.inFallback))return o.suspense.effects.push(o);const e=[o];for(;(o=o.owner)&&(!o.updatedAt||o.updatedAt<ps);)o.state&&e.push(o);for(let t=e.length-1;t>=0;t--)if(o=e[t],o.state===Ta)ri(o);else if(o.state===es){const a=ot;ot=null,ds(()=>ts(o,e[0])),ot=a}}function ds(o,e){if(ot)return o();let t=!1;ot=[],ta?t=!0:ta=[],ps++;try{const a=o();return wo(t),a}catch(a){t||(ta=null),ot=null,fi(a)}}function wo(o){if(ot&&(pi(ot),ot=null),o)return;const e=ta;ta=null,e.length&&ds(()=>vo(e))}function pi(o){for(let e=0;e<o.length;e++)oi(o[e])}function ts(o,e){o.state=0;for(let t=0;t<o.sources.length;t+=1){const a=o.sources[t];if(a.sources){const s=a.state;s===Ta?a!==e&&(!a.updatedAt||a.updatedAt<ps)&&oi(a):s===es&&ts(a,e)}}}function di(o){for(let e=0;e<o.observers.length;e+=1){const t=o.observers[e];t.state||(t.state=es,t.pure?ot.push(t):ta.push(t),t.observers&&di(t))}}function Ks(o){let e;if(o.sources)for(;o.sources.length;){const t=o.sources.pop(),a=o.sourceSlots.pop(),s=t.observers;if(s&&s.length){const n=s.pop(),i=t.observerSlots.pop();a<s.length&&(n.sourceSlots[i]=a,s[a]=n,t.observerSlots[a]=i)}}if(o.owned){for(e=o.owned.length-1;e>=0;e--)Ks(o.owned[e]);o.owned=null}if(o.cleanups){for(e=o.cleanups.length-1;e>=0;e--)o.cleanups[e]();o.cleanups=null}o.state=0}function ko(o){return o instanceof Error?o:new Error(typeof o=="string"?o:"Unknown error",{cause:o})}function fi(o,e=za){const t=ko(o);{console.error("solid error",t);return}}var aa;(o=>{o.strings=new Map,o.countriesList=[];let e,t;o.requestedServerLanguage=!1,o.isRTL=!1,[o.langCodeNormalized,o.setLangCodeNormalized]=bo();function a(O){o.isRTL=O}o.setRTL=a;function s(O){o.lastRequestedLangCode=O,o.lastRequestedNormalizedLangCode=O.split("-")[0],(0,o.setLangCodeNormalized)(o.lastRequestedNormalizedLangCode.split("-")[0])}function n(){return t||(t=Promise.all([Ht.get("langPack"),o.polyfillPromise]).then(([O])=>O?(o.lastRequestedLangCode||s(O.lang_code),u(O),O):p()).finally(()=>{t=void 0}))}o.getCacheLangPack=n;function i(){if(o.timeFormat==="h12")try{const O=L({hour:"numeric",minute:"numeric",hour12:!0}),B=new Date;B.setHours(0);const y=O.format(B);o.amPmCache.am=y.split(/\s/)[1],B.setHours(12);const P=O.format(B);o.amPmCache.pm=P.split(/\s/)[1]}catch(O){console.error("cannot get am/pm",O),o.amPmCache={am:"AM",pm:"PM"}}}function r(O,B=!!o.timeFormat&&o.timeFormat!==O){o.timeFormat=O,i(),B&&(F.clear(),Array.from(document.querySelectorAll(".i18n")).forEach(P=>{const S=o.weakMap.get(P);S instanceof z&&S.update()}))}o.setTimeFormat=r;function p(){const O=Ve.langPackCode;return s(O),Promise.all([import("./lang-nn4KIa5Q.js"),import("./langSign-CN-ja8rh.js"),import("./countries-CzeCvYH8.js")]).then(([B,y,P])=>{const S=[];c(B.default,S),c(y.default,S);const v={_:"langPackDifference",from_version:0,lang_code:O,strings:S,version:0,local:!0,countries:P.default};return m(v)})}o.loadLocalLangPack=p;function d(O,B){B=!0,o.requestedServerLanguage=!0;const y=Vt.managers;return Promise.all([y.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:O,lang_pack:B?"web":Ve.langPack}),!B&&y.apiManager.invokeApiCacheable("langpack.getLangPack",{lang_code:O,lang_pack:"android"}),import("./lang-nn4KIa5Q.js"),import("./langSign-CN-ja8rh.js"),y.apiManager.invokeApiCacheable("help.getCountriesList",{lang_code:O,hash:0}),o.polyfillPromise])}o.loadLangPack=d;function f(O,B){return Vt.managers.apiManager.invokeApi("langpack.getStrings",{lang_pack:Ve.langPack,lang_code:O,keys:B})}o.getStrings=f;function c(O,B=[]){for(const y in O){const P=O[y];typeof P=="string"?B.push({_:"langPackString",key:y,value:P}):B.push({_:"langPackStringPluralized",key:y,...P})}return B}o.formatLocalStrings=c;function l(O,B){return s(O),d(O,B).then(([y,P,S,v,Q,T])=>{let R=[];return[S,v].forEach(ee=>{c(ee.default,R)}),R=R.concat(...[y.strings,P.strings].filter(Boolean)),y.strings=R,y.countries=Q,m(y)})}o.getLangPack=l;function m(O){return O.appVersion=Ve.langPackVersion,Ht.set({langPack:O}).then(()=>(u(O),O))}o.saveLangPack=m,o.polyfillPromise=function(){return typeof Intl<"u"&&typeof Intl.PluralRules<"u"?Promise.resolve():import("./pluralPolyfill-B0qpVVRH.js").then(B=>{window.Intl=Object.assign(typeof Intl<"u"?Intl:{},B.default)})}();function u(O){const B=o.lastRequestedLangCode;if(O.lang_code!==B)return;try{e=new Intl.PluralRules(o.lastRequestedNormalizedLangCode)}catch(P){console.error("pluralRules error",P),e=new Intl.PluralRules(o.lastRequestedNormalizedLangCode.split("-",1)[0])}try{e=new Intl.PluralRules(O.lang_code)}catch(P){console.error("pluralRules error",P),e=new Intl.PluralRules(O.lang_code.split("-",1)[0])}o.strings.clear();for(const P of O.strings)o.strings.set(P.key,P);O.countries&&(o.countriesList.length=0,o.countriesList.push(...O.countries.countries),O.countries.countries.forEach(P=>{if(P.name){const S=P.default_name;o.strings.set(S,{_:"langPackString",key:S,value:P.name})}})),o.lastAppliedLangCode!==B&&(o.lastAppliedLangCode&&Vt.myId&&(Vt.managers.appReactionsManager.resetAvailableReactions(),Vt.managers.appUsersManager.indexMyself(),Vt.managers.dialogsStorage.indexMyDialog()),o.lastAppliedLangCode=B,F.clear(),i(),Vt.dispatchEvent("language_change",B)),Array.from(document.querySelectorAll(".i18n")).forEach(P=>{const S=o.weakMap.get(P);S&&S.update()})}o.applyLangPack=u;function M(O,B,y,P){const S=B[P===void 0?y.i++:P];Array.isArray(S)?O.push(...S):O.push(S)}function A(O,B,y){if(!y){y={i:0};const Q=O.match(/(%|un)\d+/g);Q?.length&&(y.i=Math.max(...Q.map(T=>+T.replace(/\D/g,""))))}const P=[],S=/(\*\*|__)(.+?)\1|(\n)|(\[.+?\]\(.*?\))|un\d|%\d\$.|%\S/g;let v=0;return O.replace(S,(Q,T,R,ee,le,ze,Ne)=>{if(ze>v&&P.push(Ne.slice(v,ze)),T){let Fe;switch(T){case"**":{Fe=document.createElement("b");break}case"__":{Fe=document.createElement("i");break}}Fe.append(...A(R,B,y)),P.push(Fe)}else if(ee)P.push(document.createElement("br"));else if(le){const Fe=le.lastIndexOf("]"),mt=le.slice(1,Fe),Qe=le.slice(Fe+2,le.length-1);let xe;if(Qe&&ni(Qe)){xe=document.createElement("a");const _t=zs(Qe);xe.href=_t.url,_t.onclick&&xe.setAttribute("onclick",_t.onclick+"(this)"),Po(xe)}else xe=B[y.i++],xe instanceof DocumentFragment&&(xe=xe.firstChild),typeof xe!="string"&&(xe.textContent="");const bt=A(mt,B,y);typeof xe=="string"?P.push(...bt):(xe.append(...bt),P.push(xe))}else if(B){const Fe=Q.replace(/\D/g,"");M(P,B,y,!Fe||Number.isNaN(+Fe)?void 0:Math.min(B.length-1,+Fe-1))}return v=ze+Q.length,""}),v!==O.length&&P.push(O.slice(v)),P}o.superFormatter=A;function w(O,B=!1,y){const P=o.strings.get(O);let S;if(P)if(P._==="langPackStringPluralized"&&y?.length){let Q=y[0];typeof Q=="string"&&(Q=+Q.replace(/\D/g,""));const T=e.select(Q);S=P[T+"_value"]||P.other_value}else P._==="langPackString"?S=P.value:S=O;else S=O;const v=A(S,y);return B?v.map(Q=>Q instanceof Node?Q.textContent:Q).join(""):v}o.format=w,o.weakMap=new WeakMap;class C{constructor(B){this.element=B?.element||document.createElement("span"),this.element.classList.add("i18n"),this.property=B?.property,o.weakMap.set(this.element,this)}}class I extends C{constructor(B={}){super({...B,property:B.property??"innerHTML"}),B?.key&&this.update(B)}update(B){if(Fs(this,B),this.property==="innerHTML")this.element.replaceChildren(...w(this.key,!1,this.args)),this.args?.length&&this.element.normalize();else{const y=this.element[this.property],P=w(this.key,!0,this.args);y===void 0?this.element.dataset[this.property]=P:this.element[this.property]=P}}compareAndUpdate(B){if(!(this.key===B.key&&St(this.args,B.args)))return this.update(B)}}o.IntlElement=I;const F=new Map;function L(O={}){const B=JSON.stringify(O);let y=F.get(B);return y||(y=new Intl.DateTimeFormat(o.lastRequestedNormalizedLangCode+"-u-hc-"+o.timeFormat,O),F.set(B,y)),y}o.getDateTimeFormat=L,o.amPmCache={am:"AM",pm:"PM"};class z extends C{constructor(B){super({...B,property:B.property??"textContent"}),_o(this.element),B?.date&&this.update(B)}update(B){Fs(this,B);let y;if(this.options.hour&&this.options.minute&&Object.keys(this.options).length===2){const P=this.date.getHours();y=("0"+(o.timeFormat==="h12"?P%12||12:P)).slice(-2)+":"+("0"+this.date.getMinutes()).slice(-2),o.timeFormat==="h12"&&(y+=" "+(P<12?o.amPmCache.am:o.amPmCache.pm))}else{const P=L(this.options);y=si(P.format(this.date))}this.element[this.property]=y}}o.IntlDateElement=z;function j(O,B){return new I({key:O,args:B}).element}o.i18n=j;function Z(O){return new I(O).element}o.i18n_=Z;function X(O,B,y,P){return new I({element:O,key:B,args:y,property:P}).element}o._i18n=X})(aa||(aa={}));var va=aa;aa.i18n;aa.i18n_;aa._i18n;Ue&&(Ue.I18n=aa);const Js=["January","February","March","April","May","June","July","August","September","October","November","December"],Ao=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Qs=Js.slice(),Fo=Ao.slice(),Ts=86400,ln=o=>{const e=new Date(Date.UTC(o.getFullYear(),o.getMonth(),o.getDate())),t=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-t);const a=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-a.getTime())/Ts+1)/7)};function Eo(o){const e=new Date,t=e.getTime()/1e3|0,a=o.getTime()/1e3|0,s={};return t-a<Ts&&e.getDate()===o.getDate()?s.hour=s.minute="2-digit":e.getFullYear()!==o.getFullYear()?(s.year=s.day="numeric",s.month="2-digit"):t-a<Ts*7&&ln(e)===ln(o)?s.weekday="short":(s.month="short",s.day="numeric"),new va.IntlDateElement({date:o,options:s}).element}Ue&&(Ue.formatDateAccordingToTodayNew=Eo);const Uo=(o,e={})=>{const t=e.monthAsNumber?".":" ",a=("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+(e.noSeconds?"":":"+("0"+o.getSeconds()).slice(-2)),s=o.getFullYear();return(e.leadingZero?("0"+o.getDate()).slice(-2):o.getDate())+t+(e.monthAsNumber?("0"+(o.getMonth()+1)).slice(-2):Js[o.getMonth()])+t+(""+s).slice(e.shortYear?2:0)+(e.noTime?"":", "+a)},Ut=2013,To=new RegExp("20[0-9]{1,2}"),Ys="\\p{L}",Ro=new RegExp(`(${Ys}{3,})`,"iu"),Bo=new RegExp(`(${Ys}{3,}) ([0-9]{0,4})`,"iu"),xo=new RegExp(`([0-9]{0,4}) (${Ys}{2,})`,"iu"),Lo=new RegExp("^([0-9]{1,4})(\\.| |/|\\-)([0-9]{1,4})$","i"),Oo=new RegExp("^([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,2})(\\.| |/|\\-)([0-9]{1,4})$","i"),Vo=[31,29,31,30,31,30,31,31,30,31,30,31];function No(o,e){const t=o.trim().toLowerCase();if(t.length<3)return;if(["today",va.format("Peer.Status.Today",!0)].some(n=>n.indexOf(t)===0)){const n=new Date,i=n.getFullYear(),r=n.getMonth(),p=n.getDate();n.setFullYear(i,r,p),n.setHours(0,0,0);const d=n.getTime();n.setFullYear(i,r,p+1),n.setHours(0,0,0);const f=n.getTime()-1;e.push({title:va.format("Date.Today",!0),minDate:d,maxDate:f});return}if(["yesterday",va.format("Peer.Status.Yesterday",!0)].some(n=>n.indexOf(t)===0)){const n=new Date,i=n.getFullYear(),r=n.getMonth(),p=n.getDate();n.setFullYear(i,r,p),n.setHours(0,0,0);const d=n.getTime()-864e5;n.setFullYear(i,r,p+1),n.setHours(0,0,0);const f=n.getTime()-86400001;e.push({title:si(va.format("Yesterday",!0)),minDate:d,maxDate:f});return}const a=Ho(t);if(a>=0){const n=new Date,i=n.getTime(),r=n.getDay(),p=a-r;n.setDate(n.getDate()+p),n.getTime()>i&&n.setTime(n.getTime()-6048e5);const d=n.getFullYear(),f=n.getMonth(),c=n.getDate();n.setFullYear(d,f,c),n.setHours(0,0,0);const l=n.getTime();n.setFullYear(d,f,c+1),n.setHours(0,0,0);const m=n.getTime()-1;e.push({title:li(l),minDate:l,maxDate:m});return}let s;if((s=Lo.exec(t))!==null){const n=s[1],i=s[3],r=parseInt(n),p=parseInt(i);if(r>0&&r<=31){if(p>=Ut&&r<=12){const d=p,f=r-1;_a(e,f,d);return}else if(p<=12){const d=r-1,f=p-1;_s(e,d,f)}}else if(r>=Ut&&p<=12){const d=r,f=p-1;_a(e,f,d)}return}if((s=Oo.exec(t))!==null){const n=s[1],i=s[3],r=s[5];if(!s[2]===s[4])return;const p=parseInt(n),d=parseInt(i)-1;let f=parseInt(r);f>=10&&f<=99&&(f+=2e3);const c=new Date().getFullYear();if(gi(p-1,d)&&f>=Ut&&f<=c){const l=new Date;l.setFullYear(f,d,p),l.setHours(0,0,0);const m=l.getTime();l.setFullYear(f,d,p+1),l.setHours(0,0,0);const u=l.getTime()-1;e.push({title:ci(m),minDate:m,maxDate:u});return}return}if((s=Bo.exec(t))!==null){const n=s[1],i=s[2],r=Ps(n);if(r>=0){const p=+i||new Date().getUTCFullYear();if(p>0&&p<=31){const d=p-1;_s(e,d,r);return}else if(p>=Ut){_a(e,r,p);return}}}if((s=xo.exec(t))!==null){const n=s[1],i=s[2],r=Ps(i);if(r>=0){const p=+n;if(p>0&&p<=31){const d=p-1;_s(e,d,r);return}else p>=Ut&&_a(e,r,p)}}if((s=Ro.exec(t))!==null){const n=s[1],i=Ps(n);if(i>=0){const r=new Date().getFullYear();for(let p=r;p>=Ut;--p)_a(e,i,p)}}if((s=To.exec(t))!==null){let n=+s[0];const i=new Date().getFullYear();if(n<Ut){n=Ut;for(let r=i;r>=n;r--){const p=new Date;p.setFullYear(r,0,1),p.setHours(0,0,0);const d=p.getTime();p.setFullYear(r+1,0,1),p.setHours(0,0,0);const f=p.getTime()-1;e.push({title:""+r,minDate:d,maxDate:f})}}else if(n<=i){const r=new Date;r.setFullYear(n,0,1),r.setHours(0,0,0);const p=r.getTime();r.setFullYear(n+1,0,1),r.setHours(0,0,0);const d=r.getTime()-1;e.push({title:""+n,minDate:p,maxDate:d})}return}}function _a(o,e,t){const a=new Date().getFullYear(),s=Date.now();if(t>=Ut&&t<=a){const n=new Date;n.setFullYear(t,e,1),n.setHours(0,0,0);const i=n.getTime();if(i>s)return;n.setMonth(n.getMonth()+1);const r=n.getTime()-1;o.push({title:qo(i),minDate:i,maxDate:r})}}function _s(o,e,t){if(gi(e,t)){const a=new Date().getFullYear(),s=Date.now();for(let n=a;n>=Ut;n--){if(t===1&&e===28&&!Go(n))continue;const i=new Date;i.setFullYear(n,t,e+1),i.setHours(0,0,0);const r=i.getTime();if(r>s)continue;i.setFullYear(n,t,e+2),i.setHours(0,0,0);const p=i.getTime()-1;n===a?o.push({title:jo(r),minDate:r,maxDate:p}):o.push({title:ci(r),minDate:r,maxDate:p})}}}function qo(o){const e=new Date(o);return Qs[e.getMonth()]+" "+e.getFullYear()}function jo(o){const e=new Date(o);return Qs[e.getMonth()]+" "+e.getDate()}function ci(o){const e=new Date(o);return("0"+e.getDate()).slice(-2)+"."+("0"+(e.getMonth()+1)).slice(-2)+"."+e.getFullYear()}function li(o){const e=new Date(o);return Fo[e.getDay()]}function gi(o,e){return e>=0&&e<12&&o>=0&&o<Vo[e]}function Go(o){return o%4===0&&o%100!==0||o%400===0}function Ps(o){o=o.toLowerCase();for(let e=0;e<12;e++)if([Js[e],Qs[e]].some(t=>t.toLowerCase().indexOf(o)===0))return e;return-1}function Ho(o){const e=new Date;if(o.length<=3)return-1;for(let t=0;t<7;t++)if(e.setDate(e.getDate()+1),li(e.getTime()).toLowerCase().indexOf(o)===0)return e.getDay();return-1}Ue.fillTipDates=No;function mi(o,e,t){"byteLength"in t[o]&&(t[o]=[...t[o]]),e&&e[o]!==t[o]&&(e[o].length=t[o].length,t[o].forEach((a,s)=>{e[o][s]=a}),t[o]=e[o])}function Wo(o){const e="⠁⠂⠄⠈⠐⠠⡀⢀⠃⠅⠆⠉⠊⠌⠑⠒⠔⠘⠡⠢⠤⠨⠰⡁⡂⡄⡈⡐⡠⢁⢂⢄⢈⢐⢠⣀⠇⠋⠍⠎⠓⠕⠖⠙⠚⠜⠣⠥⠦⠩⠪⠬⠱⠲⠴⠸⡃⡅⡆⡉⡊⡌⡑⡒⡔⡘⡡⡢⡤⡨⡰⢃⢅⢆⢉⢊⢌⢑⢒⢔⢘⢡⢢⢤⢨⢰⣁⣂⣄⣈⣐⣠⠏⠗⠛⠝⠞⠧⠫⠭⠮⠳⠵⠶⠹⠺⠼⡇⡋⡍⡎⡓⡕⡖⡙⡚⡜⡣⡥⡦⡩⡪⡬⡱⡲⡴⡸⢇⢋⢍⢎⢓⢕⢖⢙⢚⢜⢣⢥⢦⢩⢪⢬⢱⢲⢴⢸⣃⣅⣆⣉⣊⣌⣑⣒⣔⣘⣡⣢⣤⣨⣰⠟⠯⠷⠻⠽⠾⡏⡗⡛⡝⡞⡧⡫⡭⡮⡳⡵⡶⡹⡺⡼⢏⢗⢛⢝⢞⢧⢫⢭⢮⢳⢵⢶⢹⢺⢼⣇⣋⣍⣎⣓⣕⣖⣙⣚⣜⣣⣥⣦⣩⣪⣬⣱⣲⣴⣸⠿⡟⡯⡷⡻⡽⡾⢟⢯⢷⢻⢽⢾⣏⣗⣛⣝⣞⣧⣫⣭⣮⣳⣵⣶⣹⣺⣼⡿⢿⣟⣯⣷⣻⣽⣾⣿",t=e.length,a=[];for(let s=0;s<o.length;++s){const n=o.charCodeAt(s);a.push(e[n%t])}return a.join("")}function zo(o,e){const t=o.slice(0,e.offset),a=o.slice(e.offset,e.offset+e.length),s=Wo(a),n=o.slice(e.offset+e.length);return o=t+s+n,{text:o,entityText:s}}function Ko(o,e=[]){return e.forEach(t=>{t._==="messageEntitySpoiler"&&(o=zo(o,t).text)}),o}function hi(o,e){return{_:"inputDocumentFileLocation",id:o.id,access_hash:o.access_hash,file_reference:o.file_reference,thumb_size:e}}const Qt="_";function ui(o,e){const t="",a=t[t.length-1]||"";let s;switch(o._){case"inputPhotoFileLocation":{s=["photo",t[0],o.id,o.thumb_size].filter(Boolean).join(Qt);break}case"inputDocumentFileLocation":{s=["document",t[0],o.id,o.thumb_size].filter(Boolean).join(Qt);break}case"inputPeerPhotoFileLocation":s=["peerPhoto",o.photo_id,o.pFlags.big?"big":"small"].join(Qt);break;case"inputStickerSetThumb":{s=["stickerSetThumb",o.stickerset.id||o.stickerset.short_name||o.stickerset.emoticon||o.stickerset._,o.thumb_version].join(Qt);break}case"inputFileLocation":{s=[o.volume_id,o.local_id].join(Qt);break}case"inputWebFileLocation":{s=["webFile",o.url].join(Qt);break}case"inputWebFileGeoPointLocation":{const n=o.geo_point;s=["geoPoint",n.lat,n.long,o.w,o.h,o.zoom,o.scale].join(Qt);break}default:{console.error("Unrecognized location:",o),s="";break}}return s+(e?.downloadId?"_download":"")+(a&&"."+a)}function Jo(o,e){const t=encodeURIComponent(JSON.stringify(e));return o+"/"+t}function yi(o,e,t,a){const s=hi(o,e?.type);let n;return e?._==="photoSize"?n=o.sticker?"image/webp":o.mime_type.startsWith("image/")?o.mime_type:"image/jpeg":n=o.mime_type||"application/octet-stream",{dcId:o.dc_id,location:s,size:e?e.size:o.size,mimeType:n,fileName:o.file_name,queueId:t,onlyCache:a}}function Qo(o,e=!1,t){let a;return e?a="download":o.supportsStreaming?a="stream":a="document",Jo(a,yi(o,t))}const st={pdf:"application/pdf",tgv:"application/x-tgwallpattern",tgs:"application/x-tgsticker",json:"application/json",wav:"audio/wav",mp3:"audio/mpeg",ogg:"audio/ogg",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm",mov:"video/quicktime",svg:"image/svg+xml",avif:"image/avif",jxl:"image/jxl",bmp:"image/bmp"},_i={};for(const o in st)_i[st[o]]=o;function sa(o){const e=o.length,t=new Uint8Array(Math.ceil(e/2));let a=0;e%2&&(t[a++]=parseInt(o.charAt(0),16));for(let s=a;s<e;s+=2)t[a++]=parseInt(o.substr(s,2),16);return t}function Ze(o,e){const t=o.length;if(t!==e.length)return!1;for(let a=0;a<t;++a)if(o[a]!==e[a])return!1;return!0}function as(o,e){let t=0,a=0;for(let s=0;s<4;s++){const n=o[e+s];if(t=(t<<7)+(n&127),a++,!(n&128))break}return[a,t]}function Yo(o){if(o[0]!==5)throw new Error("Invalid DecoderSpecificInfo tag");const[e,t]=as(o,1),a=1+e;return o.subarray(a,a+t)}function $o(o){if(o[0]!==4)throw new Error("Invalid DecoderConfigDescriptor tag");const[e,t]=as(o,1);let a=1+e;return a+=13,Yo(o.subarray(a))}function Zo(o){if(o[0]!==3)throw new Error("Invalid ES_Descriptor tag");const e=new DataView(o.buffer,o.byteOffset,o.byteLength),[t,a]=as(o,1);let s=1+t;s+=2;const n=e.getUint8(s);s+=1;const i=n&128,r=n&64;if(i&&(s+=2),r){const d=as(o,s);s+=1+d[0]+d[1]}return{decoderConfigDescriptor:$o(o.subarray(s))}}const Xo=[19,136],Ms=sa("0327000100041940150000000001f4000000bb750507138856e5a5"),ep=new TextEncoder().encode("esds"),tp=new TextEncoder().encode("mp4a");function gn(o,e,t=o.length){for(let a=t-e.length;a>=0;a--){let s=!0;for(let n=0;n<e.length;n++)if(o[a+n]!==e[n]){s=!1;break}if(s)return a}return-1}function ap(o){const e=new DataView(o.buffer,o.byteOffset,o.byteLength);let t=o.length,a=null;for(;;){const i=gn(o,ep,t);if(i===-1)break;t=i;const r=e.getUint32(i-4);if(r<0||i+r>o.length)continue;const p=gn(o,tp,i);p===-1||i-p>100||(a={offset:i+8,size:r-12})}if(!a)throw new Error("No ESDS found");const s=o.subarray(a.offset,a.offset+a.size),n=Zo(s);if(!n)throw new Error("Invalid ESDS");if(!Ze(n.decoderConfigDescriptor,Xo))throw new Error("Not a broken DSCI");if(a.size<Ms.length)throw new Error(`ESDS Size not enough (expected at least ${Ms.length}, got ${a.size})`);o.set(Ms,a.offset)}function sp(o){try{return ap(o),!0}catch{return!1}}let np=0;class ip extends ce{constructor(){super(...arguments),this.onServiceWorkerFail=()=>{for(const e in this.docs){const t=this.docs[e];t.supportsStreaming&&(delete t.supportsStreaming,this.thumbsStorage.deleteCacheContext(t))}}}after(){this.docs={},this.uploadingWallPapers={},this.fixingChromiumMp4={},this.requestingDocParts={},Be.getInstance().addEventListener("serviceWorkerOnline",e=>{e||this.onServiceWorkerFail()})}saveDoc(e,t){if(!e||e._==="documentEmpty")return;const a=this.docs[e.id];e.file_reference&&(mi("file_reference",a,e),this.referenceDatabase.saveContext(e.file_reference,t)),a||(this.docs[e.id]=e);for(let s=0,n=e.attributes.length;s<n;++s){const i=e.attributes[s];switch(i._){case"documentAttributeFilename":{e.file_name=Ko(i.file_name);break}case"documentAttributeAudio":{if(e.type==="round")break;e.duration=i.duration,e.type=i.pFlags.voice&&e.mime_type===st.ogg?"voice":"audio";break}case"documentAttributeVideo":{e.duration=i.duration,e.w=i.w,e.h=i.h,i.pFlags.round_message?e.type="round":e.type="video";break}case"documentAttributeCustomEmoji":case"documentAttributeSticker":{i.alt!==void 0&&(e.stickerEmojiRaw=i.alt),i.stickerset&&(i.stickerset._==="inputStickerSetEmpty"?delete i.stickerset:i.stickerset._==="inputStickerSetID"&&(e.stickerSetInput=i.stickerset)),e.mime_type===st.webp&&(e.thumbs||Rt().IS_WEBP_SUPPORTED)?(e.type="sticker",e.sticker=1):e.mime_type===st.webm&&(e.type="sticker",e.sticker=3,e.animated=!0);break}case"documentAttributeImageSize":{e.type="photo",e.w=i.w,e.h=i.h;break}case"documentAttributeAnimated":{(e.mime_type===st.gif||e.mime_type===st.mp4)&&(e.type="gif"),e.animated=!0;break}}}if(e.mime_type)e.mime_type===st.pdf?e.type="pdf":e.mime_type===st.gif?e.type="gif":e.mime_type===st.tgs&&e.file_name==="AnimatedSticker.tgs"&&(e.type="sticker",e.animated=!0,e.sticker=2);else{const s=(e.file_name||"").split(".").pop(),n=s&&st[s.toLowerCase()];if(n)e.mime_type=n;else switch(e.type){case"gif":case"video":case"round":e.mime_type=st.mp4;break;case"sticker":e.mime_type=st.webp;break;case"audio":e.mime_type=st.mp3;break;case"voice":e.mime_type=st.ogg;break;default:e.mime_type="application/octet-stream";break}}if(e.type==="voice"||e.type==="round"){const s=e.attributes.find(r=>r._==="documentAttributeFilename"),n=s&&s.file_name.split(".").pop(),i=Uo(new Date(e.date*1e3),{monthAsNumber:!0,leadingZero:!0}).replace(/[:\.]/g,"-").replace(", ","_");e.file_name=`${e.type}_${i}${n?"."+n:""}`}return xt.isServiceWorkerOnline&&(e.type==="gif"&&e.size>8e6||e.type==="audio"||e.type==="video")?(e.supportsStreaming=!0,this.thumbsStorage.getCacheContext(e).url||this.thumbsStorage.setCacheContextURL(e,void 0,Qo(e),0)):e.supportsStreaming=!1,e.file_name||(e.file_name=""),a?Object.assign(a,e):e}getDoc(e){return et(e)?e:this.docs[e]}downloadDoc(e,t,a){return this.apiFileManager.downloadMedia({media:e,queueId:t,onlyCache:a})}saveWebPConvertedStrippedThumb(e,t){const a=this.getDoc(e);if(!a)return;const s=a.thumbs&&a.thumbs.find(n=>n._==="photoStrippedSize");s&&(a.pFlags.stickerThumbConverted=!0,s.bytes=t)}prepareWallPaperUpload(e){const t="wallpaper-upload-"+ ++np,a={_:"photoSize",h:0,w:0,location:{},size:e.size,type:ba};let s={_:"document",access_hash:"",attributes:[],dc_id:0,file_reference:[],id:t,mime_type:e.type,size:e.size,date:Ie(!0),pFlags:{},thumbs:[a],file_name:e.name};s=this.saveDoc(s);const n=this.thumbsStorage.setCacheContextURL(s,void 0,URL.createObjectURL(e),e.size),i={_:"wallPaper",access_hash:"",document:s,id:t,slug:t,pFlags:{}};return this.uploadingWallPapers[t]={cacheContext:n,file:e},i}uploadWallPaper(e){const{cacheContext:t,file:a}=this.uploadingWallPapers[e];return delete this.uploadingWallPapers[e],this.apiFileManager.upload({file:a,fileName:a.name}).then(n=>this.apiManager.invokeApi("account.uploadWallPaper",{file:n,mime_type:a.type,settings:{_:"wallPaperSettings",pFlags:{}}}).then(i=>(i.document=this.saveDoc(i.document),this.thumbsStorage.setCacheContextURL(i.document,void 0,t.url,t.downloaded),i)))}requestDocPart(e,t,a,s){var c;const n=this.getDoc(e);if(!n)return Promise.reject(Ee("NO_DOC"));const i=(c=this.requestingDocParts)[e]??(c[e]=new Set),r=()=>{i.delete(d)&&!i.size&&this.requestingDocParts[e]===i&&delete this.requestingDocParts[e]};let p=!1;const d=()=>{p=!0,r()};i.add(d);const f=this.apiFileManager.requestFilePart({dcId:t,location:hi(n),offset:a,limit:s,checkCancel:()=>{if(p)throw Ee("DOWNLOAD_CANCELED")}});return f.finally(r),f}cancelDocPartsRequests(e){const t=this.requestingDocParts[e];if(t)for(const a of t)a()}fixChromiumMp4(e){var t;return(t=this.fixingChromiumMp4)[e]??(t[e]=fetch(e).then(a=>a.arrayBuffer()).then(a=>{const s=new Uint8Array(a);return sp(s),this.fixingChromiumMp4[e]=URL.createObjectURL(new Blob([s]))}))}}function rp(o,e){return St(o,e)}function op(o,e){return St(o,e,["date","reply_to"])&&rp(o?.reply_to,e?.reply_to)}class pp extends ce{constructor(){super(...arguments),this.clear=e=>{e||(this.getAllDraftPromise=void 0),this.drafts={}}}after(){this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateDraftMessage:e=>{const t=this.appPeersManager.getPeerId(e.peer);this.saveDraft({peerId:t,threadId:e.threadId,draft:e.draft,notify:!0,force:!0})}}),Ht.get("drafts").then(e=>{this.drafts=e||{}})}getKey(e,t){return""+e+(t?"_"+t:"")}getDraft(e,t){return this.drafts[this.getKey(e,t)]}addMissedDialogs(){return this.getAllDrafts().then(()=>{for(const e in this.drafts){if(e.indexOf("_")!==-1)continue;const t=e.toPeerId();this.appMessagesManager.getDialogOnly(t)||this.appMessagesManager.reloadConversation(t)}})}getAllDrafts(){return this.getAllDraftPromise??(this.getAllDraftPromise=this.apiManager.invokeApi("messages.getAllDrafts").then(e=>(this.apiUpdatesManager.updatesState.syncLoading||Promise.resolve()).then(()=>{this.apiUpdatesManager.processUpdateMessage(e)})))}saveDraft({peerId:e,threadId:t,draft:a,notify:s,force:n}){const i=this.processApiDraft(a,e),r=this.getKey(e,t);return i?this.drafts[r]=i:delete this.drafts[r],Ht.set({drafts:this.drafts}),s&&this.rootScope.dispatchEvent("draft_updated",{peerId:e,threadId:t,draft:i,force:n}),i}isEmptyDraft(e){return e?._!=="draftMessage"?!0:e.reply_to!==void 0&&e.reply_to.reply_to_msg_id>0?!1:!e.message.length}processApiDraft(e,t){if(e?._!=="draftMessage")return;const a=e.reply_to;if(a?.reply_to_msg_id){const s=this.appPeersManager.isChannel(t)?t.toChatId():void 0;a.reply_to_msg_id=this.appMessagesIdsManager.generateMessageId(a.reply_to_msg_id,s),a.top_msg_id&&(a.top_msg_id=this.appMessagesIdsManager.generateMessageId(a.top_msg_id,s)),a.reply_to_peer_id&&(a.reply_to_peer_id=this.appPeersManager.getPeerId(a.reply_to_peer_id))}return e}syncDraft(e,t,a,s=!0,n=!1){const i=this.getDraft(e,t);if(op(i,a))return!0;const r={peer:this.appPeersManager.getInputPeerById(e),message:""};let p;if(this.isEmptyDraft(a))p={_:"draftMessageEmpty"};else{const f=a.message,c=a.entities,l=a.reply_to;l&&(r.reply_to={_:"inputReplyToMessage",reply_to_msg_id:ae(l.reply_to_msg_id)},l.reply_to_peer_id&&!et(l.reply_to_peer_id)&&(r.reply_to.reply_to_peer_id=this.appPeersManager.getInputPeerById(l.reply_to_peer_id))),c?.length&&(r.entities=this.appMessagesManager.getInputEntities(c)),a.pFlags.no_webpage&&(r.no_webpage=a.pFlags.no_webpage),a.pFlags.invert_media&&(r.invert_media=a.pFlags.invert_media),a.media&&(r.media=a.media),r.message=f}if(t){const f=r.reply_to??(r.reply_to={_:"inputReplyToMessage"});f.reply_to_msg_id?f.top_msg_id=ae(t):f.reply_to_msg_id=ae(t)}const d=p||a;if(d.date=Ie(!0)+this.timeManager.getServerTimeOffset(),this.saveDraft({peerId:e,threadId:t,draft:d,notify:!0,force:n}),s){const f=this.apiManager.invokeApi("messages.saveDraft",r),c=this.dialogsStorage.getDialogOnly(e);return!c||!ae(c.top_message)?f.then(()=>this.appMessagesManager.reloadConversation(e)):f}return!0}clearAllDrafts(){return this.apiManager.invokeApi("messages.clearAllDrafts").then(e=>{if(e)for(const t in this.drafts){const[a,s]=t.split("_");this.rootScope.dispatchEvent("draft_updated",{peerId:a.toPeerId(),threadId:s?+s:void 0,draft:void 0})}})}clearDraft(e,t){const a={_:"draftMessageEmpty"};t?this.syncDraft(e,t,a,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:a,notify:!0,force:!0})}setDraft(e,t,a,s){const n={_:"draftMessage",date:Ie(!0),message:a,pFlags:{},entities:s};t?this.syncDraft(e,t,n,!1,!0):this.saveDraft({peerId:e,threadId:t,draft:n,notify:!0,force:!0})}}function Pi(o,e,t,a,s,n){for(const i in o)typeof e[i]!=typeof o[i]?e[i]=it(o[i]):et(o[i])&&Pi(o[i],e[i])}function Xt(o,e){return o=o.replace(/[\u2640\u2642\u2764](?!\ufe0f)/g,(t,a,s)=>{if(e){const n=t.length;a+=n,e.forEach(i=>{const r=i.offset+i.length;r===a?i.length+=n:r>a&&(i.offset+=n)})}return t+"️"}),o}const dp={keywords:{},version:0,langCode:Ve.langPackCode},vs=32,wa=class wa extends ce{constructor(){super(...arguments),this.keywordLangPacks={},this.indexedLangPacks={},this.getKeywordsPromises={},this.recent={},this.getRecentEmojisPromises={},this.getCustomEmojiDocumentPromises=new Map,this.emojiGroups={}}getEmojiKeywords(e=Ve.langPackCode){const t=this.getKeywordsPromises[e];if(t)return t;const a="emojiKeywords_"+e;return this.getKeywordsPromises[e]=Ht.get(a).then(s=>(et(s)||(s={}),Pi(dp,s),s.langCode=e,this.keywordLangPacks[e]=s,this.apiManager.invokeApi("messages.getEmojiKeywordsDifference",{lang_code:s.langCode,from_version:s.version}).then(n=>{s.version=n.version;const i=s.keywords,r=n.keywords;for(let p=0,d=r.length;p<d;++p){const{keyword:f,emoticons:c}=r[p];i[f]=c}return Ht.set({[a]:s}),s},()=>s)))}getBothEmojiKeywords(){const e=[this.getEmojiKeywords()];return this.networkerFactory.language!==Ve.langPackCode&&e.push(this.getEmojiKeywords(this.networkerFactory.language)),this.recent.native||e.push(this.getRecentEmojis("native")),this.rootScope.premium&&e.push(this.appStickersManager.preloadEmojiSets()),Promise.all(e)}indexEmojis(){this.index||(this.index=new Ea({minChars:2,fullWords:!0}));for(const e in this.keywordLangPacks){if(this.indexedLangPacks[e])continue;const a=this.keywordLangPacks[e].keywords;for(const s in a){const n=a[s];this.index.indexObject(n,s)}this.indexedLangPacks[e]=!0}}searchEmojis({q:e,limit:t=40,minChars:a=2,addCustom:s}){this.indexEmojis(),e=e.toLowerCase().replace(/_/g," ");let n;if(e.trim()){const p=this.index.search(e,a);n=Array.from(p).reduce((d,f)=>(d.push(...f),d),[]),n.length=Math.min(40,n.length)}else n=this.recent.native.concat(wa.POPULAR_EMOJI).slice(0,vs),n=Ua(n);const i=[],r=s&&this.appStickersManager.getEmojisSearchIndex();return n.forEach(p=>{if(r){const d=r.search(p,a),f=Array.from(d).map(c=>({docId:c,emoji:p}));i.push(...f)}i.push({emoji:p})}),i.length=Math.min(t,i.length),i}async prepareAndSearchEmojis(e){return await Promise.all([this.getBothEmojiKeywords(),this.appStickersManager.preloadEmojiSets()]),this.searchEmojis(e)}getRecentEmojis(e){const t=this.getRecentEmojisPromises;return t[e]??(t[e]=this.appStateManager.getState().then(a=>{let s=[];if(e==="native"){const{recentEmoji:n}=a;s=Array.isArray(n)&&n.length?n:wa.POPULAR_EMOJI}else{const{recentCustomEmoji:n}=a;s=Array.isArray(n)&&n.length?n:[]}return this.recent[e]=s}))}modifyRecentEmoji(e,t){const a=e.docId?"custom":"native";e.emoji=Xt(e.emoji),this.getRecentEmojis(a).then(s=>{const n=e.docId||e.emoji;Oe(s,n),t&&s.unshift(n),s.splice(vs,s.length-vs),this.appStateManager.pushToState(a==="custom"?"recentCustomEmoji":"recentEmoji",s),this.rootScope.dispatchEvent("emoji_recent",{emoji:e,deleted:!t})})}pushRecentEmoji(e){return this.modifyRecentEmoji(e,!0)}deleteRecentEmoji(e){return this.modifyRecentEmoji(e,!1)}getCustomEmojiDocuments(e){return e.length?this.apiManager.invokeApi("messages.getCustomEmojiDocuments",{document_id:e}).then(t=>t.map(a=>this.appDocsManager.saveDoc(a,{type:"customEmoji",docId:a.id})),()=>new Array(e.length).fill(void 0)):Promise.resolve([])}getCachedCustomEmojiDocuments(e){return e.map(t=>this.appDocsManager.getDoc(t))}setDebouncedGetCustomEmojiDocuments(){this.getCustomEmojiDocumentsPromise||!this.getCustomEmojiDocumentPromises.size||(this.getCustomEmojiDocumentsPromise=rt(0).then(()=>{const e=[...this.getCustomEmojiDocumentPromises.keys()],t=[];do{const a=e.splice(0,100),s=this.getCustomEmojiDocuments(a).then(n=>{n.forEach((i,r)=>{const p=a[r],d=this.getCustomEmojiDocumentPromises.get(p);this.getCustomEmojiDocumentPromises.delete(p),d.resolve(i)})});t.push(s)}while(e.length);return Promise.all(t)}).finally(()=>{this.getCustomEmojiDocumentsPromise=void 0,this.setDebouncedGetCustomEmojiDocuments()}))}getCustomEmojiDocument(e){let t=this.getCustomEmojiDocumentPromises.get(e);if(t)return t;const a=this.appDocsManager.getDoc(e);return a||(t=Pe(),this.getCustomEmojiDocumentPromises.set(e,t),this.setDebouncedGetCustomEmojiDocuments(),t)}getCustomEmojis(){return this.appStickersManager.getEmojiStickers()}getEmojiGroups(e){var a;const t=s=>{s.some(n=>n._==="emojiGroupPremium")||s.push({_:"emojiGroupPremium",title:"Premium",icon_emoji_id:"5269590556232664327"})};return(a=this.emojiGroups)[e]??(a[e]=this.apiManager.invokeApiSingleProcess({method:e==="esg"||e==="stickers"?"messages.getEmojiGroups":e==="status"?"messages.getEmojiStatusGroups":"messages.getEmojiProfilePhotoGroups",params:{hash:0},processResult:async s=>{(e==="esg"||e==="stickers")&&t(s.groups);const n=await Promise.all(s.groups.map(i=>this.getCustomEmojiDocument(i.icon_emoji_id)));return this.emojiGroups[e]=s.groups.map((i,r)=>({group:i,document:n[r]}))}}))}searchCustomEmoji(e){return this.apiManager.invokeApiCacheable("messages.searchCustomEmoji",{hash:0,emoticon:e},{cacheSeconds:3600,syncIfHasResult:!0})}};wa.POPULAR_EMOJI=["😂","😘","❤️","😍","😊","😁","👍","☺️","😔","😄","😭","💋","😒","😳","😜","🙈","😉","😃","😢","😝","😱","😡","😏","😞","😅","😚","🙊","😌","😀","😋","😆","👌","😐","😕"];let Rs=wa;const mn=100;class fp extends ce{after(){this.log=We("GROUP-CALLS"),this.groupCalls=new Map,this.participants=new Map,this.nextOffsets=new Map,this.cachedStreamChannels=new Map,this.apiUpdatesManager.addMultipleEventsListeners({updateGroupCall:e=>{this.saveGroupCall(e.call,e.chat_id)},updateGroupCallParticipants:e=>{this.saveGroupCall(e.call);const t=e.call.id;this.saveApiParticipants(t,e.participants)}}),this.rootScope.addEventListener("group_call_update",e=>{e._==="groupCallDiscarded"&&this.participants.delete(e.id)})}getCachedParticipants(e){let t=this.participants.get(e);return t||this.participants.set(e,t=new Map),t}prepareToSavingNextOffset(e){const t=this.nextOffsets,a=n=>{t.get(e)===s&&t.set(e,n)},s=t.get(e);return{nextOffset:s,setNextOffset:a}}saveApiParticipant(e,t,a){const s=this.getCachedParticipants(e),n=He(t.peer),i=s.get(n),r=t.pFlags.left;if(!i&&r)return;!t.pFlags.muted&&!t.pFlags.can_self_unmute&&(t.pFlags.can_self_unmute=!0),i?(Wt(i,t),t=i):s.set(n,t);const p=this.getGroupCall(e);if(p?._==="groupCall"){let d=!1;r?(--p.participants_count,d=!0):t.pFlags.just_joined&&!i&&!t.pFlags.self&&(++p.participants_count,d=!0),d&&this.rootScope.dispatchEvent("group_call_update",p)}r&&s.delete(n),this.rootScope.dispatchEvent("group_call_participant",{groupCallId:e,participant:t})}saveApiParticipants(e,t,a){t.saved||(t.saved=!0,t.forEach(s=>this.saveApiParticipant(e,s,a)))}async editParticipant(e,t,a){this.saveApiParticipant(e,t);const s=t.pFlags.self?lt:He(t.peer),n=await this.apiManager.invokeApiSingle("phone.editGroupCallParticipant",{call:this.getGroupCallInput(e),participant:s===lt?this.appPeersManager.getInputPeerSelf():this.appPeersManager.getInputPeerById(s),muted:a.muted,volume:a.volume,raise_hand:a.raiseHand,video_paused:a.videoPaused,video_stopped:a.videoStopped,presentation_paused:a.presentationPaused});this.apiUpdatesManager.processUpdateMessage(n)}getGroupCall(e){return this.groupCalls.get(e)}async getGroupCallFull(e,t){const a=this.getGroupCall(e);if(a&&a._!=="inputGroupCall"&&!t)return a;const s=this.getCachedParticipants(e).size?0:mn;return this.apiManager.invokeApiSingleProcess({method:"phone.getGroupCall",params:{call:this.getGroupCallInput(e),limit:s},processResult:n=>{this.appUsersManager.saveApiUsers(n.users),this.appChatsManager.saveApiChats(n.chats),this.saveApiParticipants(e,n.participants,!0);const i=this.saveGroupCall(n.call);return s&&this.nextOffsets.get(e)===void 0&&this.nextOffsets.set(e,n.participants_next_offset),i}})}saveGroupCall(e,t){const a=this.groupCalls.get(e.id),s=e._!=="inputGroupCall"&&(!a||a._!=="groupCallDiscarded");return a?(s&&Wt(a,e),e=a):this.groupCalls.set(e.id,e),s&&this.rootScope.dispatchEvent("group_call_update",e),e}async createGroupCall(e,t,a,s=!1){const n=await this.apiManager.invokeApi("phone.createGroupCall",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0)),random_id:ha(32),schedule_date:t,title:a,rtmp_stream:s});return this.apiUpdatesManager.processUpdateMessage(n),n.updates.find(r=>r._==="updateGroupCall").call}getGroupCallInput(e){const t=this.getGroupCall(e);if(!t)throw new Error(`Group call ${e} not found`);return{_:"inputGroupCall",id:t.id,access_hash:t.access_hash}}async getGroupCallParticipants(e){const{nextOffset:t,setNextOffset:a}=this.prepareToSavingNextOffset(e);return t!==""&&await this.apiManager.invokeApiSingleProcess({method:"phone.getGroupParticipants",params:{call:this.getGroupCallInput(e),ids:[],sources:[],offset:t||"",limit:mn},processResult:s=>{const n=s.count===s.participants.length?"":s.next_offset;this.appChatsManager.saveApiChats(s.chats),this.appUsersManager.saveApiUsers(s.users),this.saveApiParticipants(e,s.participants),a(n)}}),{participants:this.getCachedParticipants(e),isEnd:this.nextOffsets.get(e)===""}}hangUp(e,t){const a=this.getGroupCallInput(e);let s;return typeof t=="boolean"&&t?s=this.apiManager.invokeApi("phone.discardGroupCall",{call:a}):typeof t=="number"?s=this.apiManager.invokeApi("phone.leaveGroupCall",{call:a,source:t}):s=this.apiManager.invokeApi("phone.joinGroupCall",{call:a,join_as:this.appPeersManager.getInputPeerSelf(),muted:!0,video_stopped:!0,params:{_:"dataJSON",data:""}}),s.then(n=>{this.apiUpdatesManager.processUpdateMessage(n)})}async joinGroupCall(e,t,a){const s=this.getGroupCallInput(e);let n;if(a.type==="main"){const p={call:s,join_as:this.appPeersManager.getInputPeerSelf(),params:t,muted:a.isMuted,video_stopped:!a.joinVideo};n=this.apiManager.invokeApi("phone.joinGroupCall",p),this.log(`[api] joinGroupCall id=${e}`,p)}else{const p={call:s,params:t};n=this.apiManager.invokeApi("phone.joinGroupCallPresentation",p),this.log(`[api] joinGroupCallPresentation id=${e}`,p)}const i=await n;return this.apiUpdatesManager.processUpdateMessage(i),i.updates.find(p=>p._==="updateGroupCallConnection")}leaveGroupCallPresentation(e){return this.apiManager.invokeApi("phone.leaveGroupCallPresentation",{call:this.getGroupCallInput(e)}).then(t=>{this.apiUpdatesManager.processUpdateMessage(t)})}async _fetchRtmpState(e,t=0,a){const s=await this.getGroupCallFull(e.id);if(s._==="groupCallDiscarded")throw new Error("Group call discarded");a??(a=s.stream_dc_id||await this.apiManager.getBaseDcId());try{return{channels:(await this.apiManager.invokeApi("phone.getGroupCallStreamChannels",{call:e},{dcId:a})).channels,dcId:a,time:Date.now()}}catch(n){if(n.code===400&&n.type.indexOf("CALL_MIGRATE")===0){const i=+n.type.match(/^(CALL_MIGRATE_)(\d+)/)[2];return this._fetchRtmpState(e,t,i)}if(n.type==="GROUPCALL_INVALID"&&t<3)return this._fetchRtmpState(e,t+1);throw n}}fetchRtmpState(e,t){const a=this.cachedStreamChannels.get(e.id);if(a&&!t)return a;const s=this._fetchRtmpState(e);return s.finally(()=>{setTimeout(()=>{this.cachedStreamChannels.get(e.id)===s&&this.cachedStreamChannels.delete(e.id)},1e3)}),this.cachedStreamChannels.set(e.id,s),s}fetchRtmpPart(e,t){return this.apiFileManager.requestFilePart({dcId:t,location:e,offset:0,limit:512*1024,priority:32,floodMaxTimeout:0})}fetchRtmpUrl(e,t=!1){return this.apiManager.invokeApi("phone.getGroupCallStreamRtmpUrl",{peer:this.appPeersManager.getInputPeerById(e),revoke:t})}async startRecording(e,t){const a=await this.apiManager.invokeApi("phone.toggleGroupCallRecord",{start:!0,call:e,video:t.recordVideo,video_portrait:t.videoHorizontal,title:t.name||void 0});this.apiUpdatesManager.processUpdateMessage(a)}async stopRecording(e){const t=await this.apiManager.invokeApi("phone.toggleGroupCallRecord",{start:!1,call:e});this.apiUpdatesManager.processUpdateMessage(t)}}function Mi(o){return{_:"inputPhoto",id:o.id,access_hash:o.access_hash,file_reference:o.file_reference}}function vi(o){return{_:"inputMediaPhoto",id:Mi(o),ttl_seconds:0,pFlags:{}}}function cp(o,e){return o+"_"+e}function Si(o){return{_:"inputMediaDocument",id:{_:"inputDocument",id:o.id,access_hash:o.access_hash,file_reference:o.file_reference},ttl_seconds:0,pFlags:{}}}class lp extends ce{constructor(){super(...arguments),this.inlineResults={},this.setHash={}}getGeoInput(e){return e._==="geoPoint"?{_:"inputGeoPoint",lat:e.lat,long:e.long,accuracy_radius:e.accuracy_radius}:{_:"inputGeoPointEmpty"}}getInlineResults(e,t,a="",s="",n){return this.apiManager.invokeApi("messages.getInlineBotResults",{bot:this.appUsersManager.getUserInput(t),peer:this.appPeersManager.getInputPeerById(e),query:a,geo_point:n?this.getGeoInput(n):void 0,offset:s},{stopTime:-1,noErrorBox:!0}).then(i=>{const r=i.query_id;return i.results.forEach(p=>{p._==="botInlineMediaResult"?(p.document=this.appDocsManager.saveDoc(p.document),p.photo=this.appPhotosManager.savePhoto(p.photo)):(p.content=this.appWebDocsManager.saveWebDocument(p.content),p.thumb=this.appWebDocsManager.saveWebDocument(p.thumb)),this.inlineResults[cp(r,p.id)]=p}),i})}pushPopularBot(e){this.appUsersManager.getTopPeers("bots_inline").then(t=>{const a=e.toPeerId(),s=t.findIndex(i=>i.id===a);let n;s!==-1?n=t[s]:n={id:a,rating:0},++n.rating,Bt(t,n,"rating"),this.appStateManager.setKeyValueToStorage("topPeersCache")})}switchToPM(e,t,a){return this.setHash[t]={peerId:e,time:Date.now()},this.appMessagesManager.startBot(t,void 0,a)}async checkSwitchReturn(e){const t=this.appUsersManager.getUser(e);if(!t||!t.pFlags.bot||!t.bot_inline_placeholder)return;const a=this.setHash[e];if(a&&(delete this.setHash[e],Date.now()-a.time<36e5))return a.peerId}switchInlineQuery(e,t,a,s){const n="@"+this.appPeersManager.getPeerUsername(a.toPeerId())+" "+s;this.appDraftsManager.setDraft(e,t,n)}callbackButtonClick(e,t,a){return this.apiManager.invokeApi("messages.getBotCallbackAnswer",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t),data:a.data},{stopTime:-1,noErrorBox:!0})}sendInlineResult(e,t,a,s={}){const n=this.inlineResults[a];if(!n)return;this.pushPopularBot(t);const i=a.split("_"),r=i.shift(),p=i.join("_");if(s.viaBotId=t,s.queryId=r,s.resultId=p,n.send_message.reply_markup&&(s.replyMarkup=n.send_message.reply_markup),n.send_message._==="botInlineMessageText")this.appMessagesManager.sendText({...s,peerId:e,text:n.send_message.message,entities:n.send_message.entities});else{let d,f;const c=n.send_message;switch(c._){case"botInlineMessageMediaAuto":{if(c.message,n._==="botInlineMediaResult"){const{document:l,photo:m}=n;l?d=Si(l):d=vi(m)}else{const l=n.content||n.thumb;l&&(n.type==="photo"?d={_:"inputMediaPhotoExternal",pFlags:{},url:l.url}:d={_:"inputMediaDocumentExternal",pFlags:{},url:l.url},s.webDocument=l)}break}case"botInlineMessageMediaGeo":{d={_:"inputMediaGeoPoint",geo_point:this.getGeoInput(c.geo)},s.geoPoint=c.geo;break}case"botInlineMessageMediaVenue":{d={_:"inputMediaVenue",geo_point:this.getGeoInput(c.geo),title:c.title,address:c.address,provider:c.provider,venue_id:c.venue_id,venue_type:c.venue_type},s.geoPoint=c.geo;break}case"botInlineMessageMediaContact":{d={_:"inputMediaContact",phone_number:c.phone_number,first_name:c.first_name,last_name:c.last_name,vcard:c.vcard};break}case"botInlineMessageMediaInvoice":{f={_:"messageMediaInvoice",title:c.title,description:c.description,photo:c.photo,currency:c.currency,total_amount:c.total_amount,pFlags:{shipping_address_requested:c.pFlags.shipping_address_requested,test:c.pFlags.test},start_param:void 0};break}}!d&&f&&(d={_:"messageMediaPending",messageMedia:f}),this.appMessagesManager.sendOther({...s,peerId:e,inputMedia:d})}}}function ia(o){return typeof o=="number"&&o<ka}class gp{generateTempMessageId(e,t){return+(this.generateMessageId(e,t)+1e-4).toFixed(4)}generateMessageId(e,t){return!t||!Number.isInteger(e)||e<=0?e:(e=ae(e),ka+e)}incrementMessageId(e,t){return this.generateMessageId(ae(e)+t,ia(e)?1:0)}getMessageIdInfo(e,t){const a=ae(e);return{messageId:a,channelId:e===a?void 0:t}}splitMessageIdsByChannels(e,t){const a=[];let s;for(let n=0,i=e.length;n<i;++n){const r=e[n],{messageId:p,channelId:d}=this.getMessageIdInfo(r,t);(!s||s[0]!==d)&&(s=[d,{mids:[],messageIds:[]}],a.push(s)),s[1].mids.push(r),s[1].messageIds.push(p)}return a}}const mp=8,hp=new Set(["NO_ENTRY_FOUND","STORAGE_OFFLINE","MIDDLEWARE","NO_AUTO_DOWNLOAD"]);class up{constructor(e=mp){this.parallelLimit=e,this.queueId=0,this.queue=[],this.inProcess=new Set,this.lockPromise=null,this.unlockResolve=null,this.log=We("LL",ke.Error),this.processQueue=ca(()=>this._processQueue(),8,!1)}clear(){this.inProcess.clear(),this.queue.length=0}lock(){this.lockPromise||(this.lockPromise=new Promise((e,t)=>{this.unlockResolve=e}))}unlock(){this.unlockResolve&&(this.unlockResolve(),this.unlockResolve=this.lockPromise=null,this.processQueue())}async processItem(e){if(!this.lockPromise){this.inProcess.add(e);try{await this.loadItem(e)}catch(t){hp.has(t?.type)||this.log.error("loadMediaQueue error:",t)}this.inProcess.delete(e),this.processQueue()}}loadItem(e){return e.load()}getItem(){return this.queue.shift()}addElement(e,t){this.queue[e](t),this.processQueue()}_processQueue(e){if(!(!this.queue.length||this.lockPromise||this.parallelLimit>0&&this.inProcess.size>=this.parallelLimit))do{if(e?Oe(this.queue,e):e=this.getItem(),e)this.processItem(e);else break;e=null}while(this.inProcess.size<this.parallelLimit&&this.queue.length)}push(e){this.addElement("push",e)}unshift(e){this.addElement("unshift",e)}}const hn=()=>({cleaned:!1,inner:[],onCleanCallbacks:[]}),yp=Ee("MIDDLEWARE");class _p{constructor(){this.details=hn(),this.onDestroyCallbacks=[],this.onDestroy=e=>{if(this.destroyed)return e();this.onDestroyCallbacks.push(e)}}clean(){const e=this.details;e.cleaned=!0,e.inner.splice(0,e.inner.length).forEach(t=>t.destroy()),e.onCleanCallbacks.splice(0,e.onCleanCallbacks.length).forEach(t=>t()),e.middleware=void 0,this.details=hn()}destroy(){this.destroyed=!0,this.clean(),this.onDestroyCallbacks.splice(0,this.onDestroyCallbacks.length).forEach(e=>e()),this.parent&&(Oe(this.parent.details.inner,this),this.parent=void 0)}createMiddlewareForDetails(e,t){const a=()=>!e.cleaned&&(!t||t());return a.create=()=>{if(!a())throw yp;const s=bi();return s.parent=this,e.inner.push(s),s},a.onClean=s=>{if(!a())return s();e.onCleanCallbacks.push(s)},a.onDestroy=this.onDestroy,a}get(e){const t=this.details;return t.cleaned?this.createMiddlewareForDetails(t):e?this.createMiddlewareForDetails(t,e):t.middleware??(t.middleware=this.createMiddlewareForDetails(t))}}function bi(){return new _p}function un(o,e="asc"){if(!o)return[];const t=o instanceof Map?[...o.keys()]:Object.keys(o).map(a=>+a);return e==="asc"?t.sort((a,s)=>a-s):t.sort((a,s)=>s-a)}function Ci(o,e){if(o.length<e)return[o];let t=0,a=0,s=0;const n=" ",i=[],r=d=>{let f=o.slice(a,d);const c=s++;if(f.length>e){const l=f.slice(e);Ci(l,e).forEach(u=>{i[s++]=u}),f=f.slice(0,e)}a=d,t=0,i[c]=(i[c]||"")+f};let p=0;do{let d=o.indexOf(n,p);if(d===-1){p!==o.length-1&&r();break}d+=n.length;const f=d-p;t+f>e&&r(t),p=d,t+=f}while(!0);return i}function Pp(o,e,t=!0,a=!0){let s,n,i,r,p=!1;const d=c=>{const l=i,m=r;try{const u=o.apply(null,c);l(u)}catch(u){console.error("debounce error",u),m(u)}},f=(...c)=>{n||(n=new Promise((m,u)=>(i=m,r=u))),s?(clearTimeout(s),p=!0,r(),n=new Promise((m,u)=>(i=m,r=u))):t&&(d(c),p=!1);const l=we.setTimeout(()=>{a&&(!t||p)&&d(c),s===l&&(s=n=i=r=void 0,p=!1)},e);return s=l,n.catch(Ge),n};return f.clearTimeout=()=>{s&&(we.clearTimeout(s),r(),s=n=i=r=void 0,p=!1)},f.isDebounced=()=>!!s,f}function Mp(o){return o?o.match($n):null}function Ka(o){return{_:"reactionEmoji",emoticon:o.reaction}}function ut(o,e){return typeof o!=typeof e?!1:([o,e]=[o,e].map(t=>t._==="availableReaction"?Ka(t):t),St(o,e))}function yn({inputFilter:o,messages:e,limit:t,savedReaction:a}){if(o==="inputMessagesFilterEmpty"&&!a)return e.slice(0,t);const s=[];if(!e.length)return s;let n=!0;const i={},r=[],p=[];switch(o){case"inputMessagesFilterPhotos":i.messageMediaPhoto=!0;break;case"inputMessagesFilterPhotoVideo":i.messageMediaPhoto=!0,i.messageMediaDocument=!0,r.push("video");break;case"inputMessagesFilterVideo":i.messageMediaDocument=!0,r.push("video");break;case"inputMessagesFilterDocument":i.messageMediaDocument=!0,r.push(void 0,"photo","pdf");break;case"inputMessagesFilterVoice":i.messageMediaDocument=!0,r.push("voice");break;case"inputMessagesFilterRoundVoice":i.messageMediaDocument=!0,r.push("round","voice");break;case"inputMessagesFilterRoundVideo":i.messageMediaDocument=!0,r.push("round");break;case"inputMessagesFilterMusic":i.messageMediaDocument=!0,r.push("audio");break;case"inputMessagesFilterUrl":i.url=!0;break;case"inputMessagesFilterChatPhotos":i.avatar=!0;break;case"inputMessagesFilterPinned":p.push("pinned");break;default:n=!1;break}if(!n&&!a?.length)return s;for(let d=0,f=e.length;d<f;++d){const c=e[d];if(!c)continue;let l=!n;if(p?.some(m=>c.pFlags[m]))l=!0;else if(c._==="message"){if(c.media&&i[c.media._]){const m=c.media.document;if(m&&r.length&&!r.includes(m.type))continue;l=!0}else if(i.url&&c.message){const m=["messageEntityTextUrl","messageEntityUrl"];(c.totalEntities.find(u=>m.includes(u._))||Mp(c.message))&&(l=!0)}if(l&&a){const m=c.reactions?.results;l=m?a.every(u=>m.some(M=>ut(M.reaction,u))):!1}}else i.avatar&&c.action&&["messageActionChannelEditPhoto","messageActionChatEditPhoto","messageActionChannelEditVideo","messageActionChatEditVideo"].includes(c.action._)&&(l=!0);if(l&&s.push(c)>=t)break}return s}let _n=0;function Ii(o){let e;const t=o?.type;if(t){const a=`${ks}_${_n++}.${t.split("/")[1]}`;["image/jpeg","image/png","image/bmp"].indexOf(t)>=0?e="photo"+a:t.indexOf("audio/")===0||["video/ogg"].indexOf(t)>=0?e="audio"+a:t.indexOf("video/")===0?e="video"+a:e="document"+a}else e=`upload-${ks}_${_n++}`;return e}class vp{constructor(){this.tabs=new Map}start(){Be.getInstance().addEventListener("tabState",(t,a)=>{const s=this.tabs.get(a);s.state=t})}getTabs(){return[...this.tabs.values()].filter(e=>!!e.state)}addTab(e){const t={source:e,state:void 0};this.tabs.set(e,t)}deleteTab(e){this.tabs.delete(e)}}const Aa=new vp;Ue&&(Ue.appTabsManager=Aa);function Sp(o){let e=0,t;for(const a of o)if(a.message){if(++e>1)break;t=a}return e>1&&(t=void 0),t}function Di(o){return o.video_thumbs?.[0]}function ss(o){return{_:"inputDocument",id:o.id,access_hash:o.access_hash,file_reference:o.file_reference}}function Pn(o,e,t){t?o[e]=!0:delete o[e]}function Pa(o,e){let t;const a=o.reply_to,s=o.saved_peer_id&&He(o.saved_peer_id);return s?t=s:a?._==="messageReplyHeader"&&(!e||a.pFlags.forum_topic)?t=a.reply_to_top_id||a.reply_to_msg_id:e&&(o._==="messageService"&&o.action?._==="messageActionTopicCreate"?t=o.mid:t=Wn),t}const bp=["abogado","ac","academy","accountants","active","actor","ad","adult","ae","aero","af","ag","agency","ai","airforce","al","allfinanz","alsace","am","amsterdam","an","android","ao","apartments","aq","aquarelle","ar","archi","army","arpa","as","asia","associates","at","attorney","au","auction","audio","autos","aw","ax","axa","az","ba","band","bank","bar","barclaycard","barclays","bargains","bayern","bb","bd","be","beer","berlin","best","bf","bg","bh","bi","bid","bike","bingo","bio","biz","bj","black","blackfriday","bloomberg","blue","bm","bmw","bn","bnpparibas","bo","boo","boutique","br","brussels","bs","bt","budapest","build","builders","business","buzz","bv","bw","by","bz","bzh","ca","cab","cal","camera","camp","cancerresearch","canon","capetown","capital","caravan","cards","care","career","careers","cartier","casa","cash","cat","catering","cc","cd","center","ceo","cern","cf","cg","ch","channel","chat","cheap","christmas","chrome","church","ci","citic","city","ck","cl","claims","cleaning","click","clinic","clothing","club","cm","cn","co","coach","codes","coffee","college","cologne","com","community","company","computer","condos","construction","consulting","contractors","cooking","cool","coop","country","cr","credit","creditcard","cricket","crs","cruises","cu","cuisinella","cv","cw","cx","cy","cymru","cz","dabur","dad","dance","dating","day","dclk","de","deals","degree","delivery","democrat","dental","dentist","desi","design","dev","diamonds","diet","digital","direct","directory","discount","dj","dk","dm","dnp","do","docs","domains","doosan","durban","dvag","dz","eat","ec","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","equipment","er","es","esq","estate","et","eu","eurovision","eus","events","everbank","exchange","expert","exposed","fail","farm","fashion","feedback","fi","finance","financial","firmdale","fish","fishing","fit","fitness","fj","fk","flights","florist","flowers","flsmidth","fly","fm","fo","foo","forsale","foundation","fr","frl","frogans","fund","furniture","futbol","ga","gal","gallery","garden","gb","gbiz","gd","ge","gent","gf","gg","ggee","gh","gi","gift","gifts","gives","gl","glass","gle","global","globo","gm","gmail","gmo","gmx","gn","goog","google","gop","gov","gp","gq","gr","graphics","gratis","green","gripe","gs","gt","gu","guide","guitars","guru","gw","gy","hamburg","hangout","haus","healthcare","help","here","hermes","hiphop","hiv","hk","hm","hn","holdings","holiday","homes","horse","host","hosting","house","how","hr","ht","hu","ibm","id","ie","ifm","il","im","immo","immobilien","in","industries","info","ing","ink","institute","insure","int","international","investments","io","iq","ir","irish","is","it","iwc","jcb","je","jetzt","jm","jo","jobs","joburg","jp","juegos","kaufen","kddi","ke","kg","kh","ki","kim","kitchen","kiwi","km","kn","koeln","kp","kr","krd","kred","kw","ky","kyoto","kz","la","lacaixa","land","lat","latrobe","lawyer","lb","lc","lds","lease","legal","lgbt","li","lidl","life","lighting","limited","limo","link","lk","loans","london","lotte","lotto","lr","ls","lt","ltda","lu","luxe","luxury","lv","ly","ma","madrid","maison","management","mango","market","marketing","marriott","mc","md","me","media","meet","melbourne","meme","memorial","menu","mg","mh","miami","mil","mini","mk","ml","mm","mn","mo","mobi","moda","moe","monash","money","mormon","mortgage","moscow","motorcycles","mov","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","nagoya","name","navy","nc","ne","net","network","neustar","new","nexus","nf","ng","ngo","nhk","ni","nico","ninja","nl","no","np","nr","nra","nrw","ntt","nu","nyc","nz","okinawa","om","one","ong","onl","ooo","org","organic","osaka","otsuka","ovh","pa","paris","partners","parts","party","pe","pf","pg","ph","pharmacy","photo","photography","photos","physio","pics","pictures","pink","pizza","pk","pl","place","plumbing","pm","pn","pohl","poker","porn","post","pr","praxi","press","pro","prod","productions","prof","properties","property","ps","pt","pub","pw","py","qa","qpon","quebec","re","realtor","recipes","red","rehab","reise","reisen","reit","ren","rentals","repair","report","republican","rest","restaurant","reviews","rich","rio","rip","ro","rocks","rodeo","rs","rsvp","ru","ruhr","rw","ryukyu","sa","saarland","sale","samsung","sarl","saxo","sb","sc","sca","scb","schmidt","schule","schwarz","science","scot","sd","se","services","sew","sexy","sg","sh","shiksha","shoes","shriram","si","singles","sj","sk","sky","sl","sm","sn","so","social","software","sohu","solar","solutions","soy","space","spiegel","sr","st","style","su","supplies","supply","support","surf","surgery","suzuki","sv","sx","sy","sydney","systems","sz","taipei","tatar","tattoo","tax","tc","td","technology","tel","temasek","tennis","tf","tg","th","tienda","tips","tires","tirol","tj","tk","tl","tm","tn","to","today","tokyo","tools","top","toshiba","town","toys","tp","tr","trade","training","travel","trust","tt","tui","tv","tw","tz","ua","ug","uk","university","uno","uol","us","uy","uz","va","vacations","vc","ve","vegas","ventures","versicherung","vet","vg","vi","viajes","video","villas","vision","vlaanderen","vn","vodka","vote","voting","voto","voyage","vu","wales","wang","watch","webcam","website","wed","wedding","wf","whoswho","wien","wiki","williamhill","wme","work","works","world","ws","wtc","wtf","佛山","集团","在线","한국","ভারত","八卦","موقع","公益","公司","移动","我爱你","москва","қаз","онлайн","сайт","срб","淡马锡","орг","삼성","சிங்கப்பூர்","商标","商店","商城","дети","мкд","中文网","中信","中国","中國","谷歌","భారత్","ලංකා","ભારત","भारत","网店","संगठन","网络","укр","香港","台湾","台灣","手机","мон","الجزائر","عمان","ایران","امارات","بازار","الاردن","بھارت","المغرب","السعودية","مليسيا","شبكة","გე","机构","组织机构","ไทย","سورية","рус","рф","تونس","みんな","グーグル","世界","ਭਾਰਤ","网址","游戏","vermögensberater","vermögensberatung","企业","مصر","قطر","广东","இலங்கை","இந்தியா","新加坡","فلسطين","政务","xxx","xyz","yachts","yandex","ye","yoga","yokohama","youtube","yt","za","zip","zm","zone","zuerich","zw"];function Cp(o){for(var e=o.length,t=o.split("(").length-1,a=o.split(")").length-1;a>t&&o.charAt(e-1)===")";)o=o.substr(0,e-1),a--,e--;return t>a&&(o=o.replace(/\)+$/,"")),o}const Bs={14:{"1f6dd":4867,"1f6de":4916,"1f6df":4923,"1f7f0":62832,"1f979":183,"1f9cc":1557,"1fa7b":61332,"1fa7c":61330,"1faa9":51093,"1faaa":61364,"1faab":61189,"1faac":51085,"1fab7":2651,"1fab8":2631,"1fab9":2672,"1faba":2673,"1fac3":1520,"1fac4":1521,"1fac5":1505,"1fad7":3793,"1fad8":3707,"1fad9":3804,"1fae0":111,"1fae1":136,"1fae2":132,"1fae3":133,"1fae4":174,"1fae5":142,"1fae6":1385,"1fae7":61353,"1faf0":1341,"1faf1":1332,"1faf2":1333,"1faf3":1334,"1faf4":1335,"1faf5":1351,"1faf6":1360,"1faf1-1f3fb-200d-1faf2-1f3fc":0,"1faf1-1f3fb-200d-1faf2-1f3fd":0,"1faf1-1f3fb-200d-1faf2-1f3fe":0,"1faf1-1f3fb-200d-1faf2-1f3ff":0,"1faf1-1f3fc-200d-1faf2-1f3fb":0,"1faf1-1f3fc-200d-1faf2-1f3fd":0,"1faf1-1f3fc-200d-1faf2-1f3fe":0,"1faf1-1f3fc-200d-1faf2-1f3ff":0,"1faf1-1f3fd-200d-1faf2-1f3fb":0,"1faf1-1f3fd-200d-1faf2-1f3fc":0,"1faf1-1f3fd-200d-1faf2-1f3fe":0,"1faf1-1f3fd-200d-1faf2-1f3ff":0,"1faf1-1f3fe-200d-1faf2-1f3fb":0,"1faf1-1f3fe-200d-1faf2-1f3fc":0,"1faf1-1f3fe-200d-1faf2-1f3fd":0,"1faf1-1f3fe-200d-1faf2-1f3ff":0,"1faf1-1f3ff-200d-1faf2-1f3fb":0,"1faf1-1f3ff-200d-1faf2-1f3fc":0,"1faf1-1f3ff-200d-1faf2-1f3fd":0,"1faf1-1f3ff-200d-1faf2-1f3fe":0,"1fac3-1f3fb":0,"1fac3-1f3fc":0,"1fac3-1f3fd":0,"1fac3-1f3fe":0,"1fac3-1f3ff":0,"1fac4-1f3fb":0,"1fac4-1f3fc":0,"1fac4-1f3fd":0,"1fac4-1f3fe":0,"1fac4-1f3ff":0,"1fac5-1f3fb":0,"1fac5-1f3fc":0,"1fac5-1f3fd":0,"1fac5-1f3fe":0,"1fac5-1f3ff":0,"1faf0-1f3fb":0,"1faf0-1f3fc":0,"1faf0-1f3fd":0,"1faf0-1f3fe":0,"1faf0-1f3ff":0,"1faf1-1f3fb":0,"1faf1-1f3fc":0,"1faf1-1f3fd":0,"1faf1-1f3fe":0,"1faf1-1f3ff":0,"1faf2-1f3fb":0,"1faf2-1f3fc":0,"1faf2-1f3fd":0,"1faf2-1f3fe":0,"1faf2-1f3ff":0,"1faf3-1f3fb":0,"1faf3-1f3fc":0,"1faf3-1f3fd":0,"1faf3-1f3fe":0,"1faf3-1f3ff":0,"1faf4-1f3fb":0,"1faf4-1f3fc":0,"1faf4-1f3fd":0,"1faf4-1f3fe":0,"1faf4-1f3ff":0,"1faf5-1f3fb":0,"1faf5-1f3fc":0,"1faf5-1f3fd":0,"1faf5-1f3fe":0,"1faf5-1f3ff":0,"1faf6-1f3fb":0,"1faf6-1f3fc":0,"1faf6-1f3fd":0,"1faf6-1f3fe":0,"1faf6-1f3ff":0},"":{2049:62835,2122:62863,2139:62888,2194:62764,2195:62763,2196:62762,2197:62756,2198:62758,2199:62760,2328:61194,2600:4990,2601:4998,2602:41013,2603:41018,2604:41020,2611:62851,2614:41014,2615:3781,2618:2667,2620:1106,2622:62753,2623:62754,2626:62783,2638:62780,2639:177,2648:62788,2649:62789,2650:62796,2651:62797,2652:62798,2653:62799,2660:51095,2663:51098,2665:51096,2666:51097,2668:4865,2692:61297,2693:4922,2694:61300,2696:61311,2697:61319,2699:61309,2702:61284,2705:62850,2708:4931,2709:61245,2712:61259,2714:62852,2716:62828,2721:62779,2728:51029,2733:62858,2734:62859,2744:41017,2747:62860,2753:62836,2754:62837,2755:62838,2757:62839,2763:1137,2764:1141,2795:62829,2796:62830,2797:62831,2934:62767,2935:62768,3030:62840,3297:62912,3299:62913,"0023-20e3":62864,"002a-20e3":62865,"0030-20e3":62866,"0031-20e3":62867,"0032-20e3":62868,"0033-20e3":62869,"0034-20e3":62870,"0035-20e3":62871,"0036-20e3":62872,"0037-20e3":62873,"0038-20e3":62874,"0039-20e3":62875,"00a9":62861,"00ae":62862,"1f004":51101,"1f0cf":51100,"1f170":62882,"1f171":62884,"1f17e":62893,"1f17f":62895,"1f18e":62883,"1f191":62885,"1f192":62886,"1f193":62887,"1f194":62889,"1f195":62891,"1f196":62892,"1f197":62894,"1f198":62896,"1f199":62897,"1f19a":62898,"1f1e6-1f1e8":71594,"1f1e6-1f1e9":71595,"1f1e6-1f1ea":71596,"1f1e6-1f1eb":71597,"1f1e6-1f1ec":71598,"1f1e6-1f1ee":71599,"1f1e6-1f1f1":71600,"1f1e6-1f1f2":71601,"1f1e6-1f1f4":71602,"1f1e6-1f1f6":71603,"1f1e6-1f1f7":71604,"1f1e6-1f1f8":71605,"1f1e6-1f1f9":71606,"1f1e6-1f1fa":71607,"1f1e6-1f1fc":71608,"1f1e6-1f1fd":71609,"1f1e6-1f1ff":71610,"1f1e7-1f1e6":71611,"1f1e7-1f1e7":71612,"1f1e7-1f1e9":71613,"1f1e7-1f1ea":71614,"1f1e7-1f1eb":71615,"1f1e7-1f1ec":71616,"1f1e7-1f1ed":71617,"1f1e7-1f1ee":71618,"1f1e7-1f1ef":71619,"1f1e7-1f1f1":71620,"1f1e7-1f1f2":71621,"1f1e7-1f1f3":71622,"1f1e7-1f1f4":71623,"1f1e7-1f1f6":71624,"1f1e7-1f1f7":71625,"1f1e7-1f1f8":71626,"1f1e7-1f1f9":71627,"1f1e7-1f1fb":71628,"1f1e7-1f1fc":71629,"1f1e7-1f1fe":71630,"1f1e7-1f1ff":71631,"1f1e8-1f1e6":71632,"1f1e8-1f1e8":71633,"1f1e8-1f1e9":71634,"1f1e8-1f1eb":71635,"1f1e8-1f1ec":71636,"1f1e8-1f1ed":71637,"1f1e8-1f1ee":71638,"1f1e8-1f1f0":71639,"1f1e8-1f1f1":71640,"1f1e8-1f1f2":71641,"1f1e8-1f1f3":71642,"1f1e8-1f1f4":71643,"1f1e8-1f1f5":71644,"1f1e8-1f1f7":71645,"1f1e8-1f1fa":71646,"1f1e8-1f1fb":71647,"1f1e8-1f1fc":71648,"1f1e8-1f1fd":71649,"1f1e8-1f1fe":71650,"1f1e8-1f1ff":71651,"1f1e9-1f1ea":71652,"1f1e9-1f1ec":71653,"1f1e9-1f1ef":71654,"1f1e9-1f1f0":71655,"1f1e9-1f1f2":71656,"1f1e9-1f1f4":71657,"1f1e9-1f1ff":71658,"1f1ea-1f1e6":71659,"1f1ea-1f1e8":71660,"1f1ea-1f1ea":71661,"1f1ea-1f1ec":71662,"1f1ea-1f1ed":71663,"1f1ea-1f1f7":71664,"1f1ea-1f1f8":71665,"1f1ea-1f1f9":71666,"1f1ea-1f1fa":71667,"1f1eb-1f1ee":71668,"1f1eb-1f1ef":71669,"1f1eb-1f1f0":71670,"1f1eb-1f1f2":71671,"1f1eb-1f1f4":71672,"1f1eb-1f1f7":71673,"1f1ec-1f1e6":71674,"1f1ec-1f1e7":71675,"1f1ec-1f1e9":71676,"1f1ec-1f1ea":71677,"1f1ec-1f1eb":71678,"1f1ec-1f1ec":71679,"1f1ec-1f1ed":71680,"1f1ec-1f1ee":71681,"1f1ec-1f1f1":71682,"1f1ec-1f1f2":71683,"1f1ec-1f1f3":71684,"1f1ec-1f1f5":71685,"1f1ec-1f1f6":71686,"1f1ec-1f1f7":71687,"1f1ec-1f1f8":71688,"1f1ec-1f1f9":71689,"1f1ec-1f1fa":71690,"1f1ec-1f1fc":71691,"1f1ec-1f1fe":71692,"1f1ed-1f1f0":71693,"1f1ed-1f1f2":71694,"1f1ed-1f1f3":71695,"1f1ed-1f1f7":71696,"1f1ed-1f1f9":71697,"1f1ed-1f1fa":71698,"1f1ee-1f1e8":71699,"1f1ee-1f1e9":71700,"1f1ee-1f1ea":71701,"1f1ee-1f1f1":71702,"1f1ee-1f1f2":71703,"1f1ee-1f1f3":71704,"1f1ee-1f1f4":71705,"1f1ee-1f1f6":71706,"1f1ee-1f1f7":71707,"1f1ee-1f1f8":71708,"1f1ee-1f1f9":71709,"1f1ef-1f1ea":71710,"1f1ef-1f1f2":71711,"1f1ef-1f1f4":71712,"1f1ef-1f1f5":71713,"1f1f0-1f1ea":71714,"1f1f0-1f1ec":71715,"1f1f0-1f1ed":71716,"1f1f0-1f1ee":71717,"1f1f0-1f1f2":71718,"1f1f0-1f1f3":71719,"1f1f0-1f1f5":71720,"1f1f0-1f1f7":71721,"1f1f0-1f1fc":71722,"1f1f0-1f1fe":71723,"1f1f0-1f1ff":71724,"1f1f1-1f1e6":71725,"1f1f1-1f1e7":71726,"1f1f1-1f1e8":71727,"1f1f1-1f1ee":71728,"1f1f1-1f1f0":71729,"1f1f1-1f1f7":71730,"1f1f1-1f1f8":71731,"1f1f1-1f1f9":71732,"1f1f1-1f1fa":71733,"1f1f1-1f1fb":71734,"1f1f1-1f1fe":71735,"1f1f2-1f1e6":71736,"1f1f2-1f1e8":71737,"1f1f2-1f1e9":71738,"1f1f2-1f1ea":71739,"1f1f2-1f1eb":71740,"1f1f2-1f1ec":71741,"1f1f2-1f1ed":71742,"1f1f2-1f1f0":71743,"1f1f2-1f1f1":71744,"1f1f2-1f1f2":71745,"1f1f2-1f1f3":71746,"1f1f2-1f1f4":71747,"1f1f2-1f1f5":71748,"1f1f2-1f1f6":71749,"1f1f2-1f1f7":71750,"1f1f2-1f1f8":71751,"1f1f2-1f1f9":71752,"1f1f2-1f1fa":71753,"1f1f2-1f1fb":71754,"1f1f2-1f1fc":71755,"1f1f2-1f1fd":71756,"1f1f2-1f1fe":71757,"1f1f2-1f1ff":71758,"1f1f3-1f1e6":71759,"1f1f3-1f1e8":71760,"1f1f3-1f1ea":71761,"1f1f3-1f1eb":71762,"1f1f3-1f1ec":71763,"1f1f3-1f1ee":71764,"1f1f3-1f1f1":71765,"1f1f3-1f1f4":71766,"1f1f3-1f1f5":71767,"1f1f3-1f1f7":71768,"1f1f3-1f1fa":71769,"1f1f3-1f1ff":71770,"1f1f4-1f1f2":71771,"1f1f5-1f1e6":71772,"1f1f5-1f1ea":71773,"1f1f5-1f1eb":71774,"1f1f5-1f1ec":71775,"1f1f5-1f1ed":71776,"1f1f5-1f1f0":71777,"1f1f5-1f1f1":71778,"1f1f5-1f1f2":71779,"1f1f5-1f1f3":71780,"1f1f5-1f1f7":71781,"1f1f5-1f1f8":71782,"1f1f5-1f1f9":71783,"1f1f5-1f1fc":71784,"1f1f5-1f1fe":71785,"1f1f6-1f1e6":71786,"1f1f7-1f1ea":71787,"1f1f7-1f1f4":71788,"1f1f7-1f1f8":71789,"1f1f7-1f1fa":71790,"1f1f7-1f1fc":71791,"1f1f8-1f1e6":71792,"1f1f8-1f1e7":71793,"1f1f8-1f1e8":71794,"1f1f8-1f1e9":71795,"1f1f8-1f1ea":71796,"1f1f8-1f1ec":71797,"1f1f8-1f1ed":71798,"1f1f8-1f1ee":71799,"1f1f8-1f1ef":71800,"1f1f8-1f1f0":71801,"1f1f8-1f1f1":71802,"1f1f8-1f1f2":71803,"1f1f8-1f1f3":71804,"1f1f8-1f1f4":71805,"1f1f8-1f1f7":71806,"1f1f8-1f1f8":71807,"1f1f8-1f1f9":71808,"1f1f8-1f1fb":71809,"1f1f8-1f1fd":71810,"1f1f8-1f1fe":71811,"1f1f8-1f1ff":71812,"1f1f9-1f1e6":71813,"1f1f9-1f1e8":71814,"1f1f9-1f1e9":71815,"1f1f9-1f1eb":71816,"1f1f9-1f1ec":71817,"1f1f9-1f1ed":71818,"1f1f9-1f1ef":71819,"1f1f9-1f1f0":71820,"1f1f9-1f1f1":71821,"1f1f9-1f1f2":71822,"1f1f9-1f1f3":71823,"1f1f9-1f1f4":71824,"1f1f9-1f1f7":71825,"1f1f9-1f1f9":71826,"1f1f9-1f1fb":71827,"1f1f9-1f1fc":71828,"1f1f9-1f1ff":71829,"1f1fa-1f1e6":71830,"1f1fa-1f1ec":71831,"1f1fa-1f1f2":71832,"1f1fa-1f1f3":71833,"1f1fa-1f1f8":71834,"1f1fa-1f1fe":71835,"1f1fa-1f1ff":71836,"1f1fb-1f1e6":71837,"1f1fb-1f1e8":71838,"1f1fb-1f1ea":71839,"1f1fb-1f1ec":71840,"1f1fb-1f1ee":71841,"1f1fb-1f1f3":71842,"1f1fb-1f1fa":71843,"1f1fc-1f1eb":71844,"1f1fc-1f1f8":71845,"1f1fd-1f1f0":71846,"1f1fe-1f1ea":71847,"1f1fe-1f1f9":71848,"1f1ff-1f1e6":71849,"1f1ff-1f1f2":71850,"1f1ff-1f1fc":71851,"1f201":62899,"1f202":62900,"1f21a":62906,"1f22f":62903,"1f232":62907,"1f233":62911,"1f234":62910,"1f235":62915,"1f236":62902,"1f237":62901,"1f238":62909,"1f239":62905,"1f23a":62914,"1f250":62904,"1f251":62908,"1f300":41010,"1f301":4857,"1f302":41012,"1f303":4858,"1f304":4860,"1f305":4861,"1f306":4862,"1f307":4863,"1f308":41011,"1f309":4864,"1f30a":41023,"1f30b":4815,"1f30c":4997,"1f30d":4806,"1f30e":4807,"1f30f":4808,"1f310":4809,"1f311":4977,"1f312":4978,"1f313":4979,"1f314":4980,"1f315":4981,"1f316":4982,"1f317":4983,"1f318":4984,"1f319":4985,"1f31a":4986,"1f31b":4987,"1f31c":4988,"1f31d":4991,"1f31e":4992,"1f31f":4995,"1f320":4996,"1f321":4989,"1f324":41001,"1f325":41002,"1f326":41003,"1f327":41004,"1f328":41005,"1f329":41006,"1f32a":41007,"1f32b":41008,"1f32c":41009,"1f32d":3725,"1f32e":3727,"1f32f":3728,"1f330":3708,"1f331":2659,"1f332":2661,"1f333":2662,"1f334":2663,"1f335":2664,"1f336":3698,"1f337":2658,"1f338":2649,"1f339":2653,"1f33a":2655,"1f33b":2656,"1f33c":2657,"1f33d":3697,"1f33e":2665,"1f33f":2666,"1f340":2668,"1f341":2669,"1f342":2670,"1f343":2671,"1f344":3705,"1f345":3690,"1f346":3694,"1f347":3674,"1f348":3675,"1f349":3676,"1f34a":3677,"1f34b":3678,"1f34c":3679,"1f34d":3680,"1f34e":3682,"1f34f":3683,"1f350":3684,"1f351":3685,"1f352":3686,"1f353":3687,"1f354":3722,"1f355":3724,"1f356":3718,"1f357":3719,"1f358":3744,"1f359":3745,"1f35a":3746,"1f35b":3747,"1f35c":3748,"1f35d":3749,"1f35e":3709,"1f35f":3723,"1f360":3750,"1f361":3756,"1f362":3751,"1f363":3752,"1f364":3753,"1f365":3754,"1f366":3765,"1f367":3766,"1f368":3767,"1f369":3768,"1f36a":3769,"1f36b":3774,"1f36c":3775,"1f36d":3776,"1f36e":3777,"1f36f":3778,"1f370":3771,"1f371":3743,"1f372":3735,"1f373":3733,"1f374":3801,"1f375":3783,"1f376":3784,"1f377":3786,"1f378":3787,"1f379":3788,"1f37a":3789,"1f37b":3790,"1f37c":3779,"1f37d":3800,"1f37e":3785,"1f37f":3739,"1f380":51040,"1f381":51041,"1f382":3770,"1f383":51024,"1f384":51025,"1f385":1527,"1f386":51026,"1f387":51027,"1f388":51030,"1f389":51031,"1f38a":51032,"1f38b":51033,"1f38c":71588,"1f38d":51034,"1f38e":51035,"1f38f":51036,"1f390":51037,"1f391":51038,"1f392":61134,"1f393":61147,"1f396":51045,"1f397":51042,"1f399":61167,"1f39a":61168,"1f39b":61169,"1f39e":61203,"1f39f":51043,"1f3a0":4866,"1f3a1":4868,"1f3a2":4869,"1f3a3":51072,"1f3a4":61170,"1f3a5":61202,"1f3a6":62819,"1f3a7":61171,"1f3a8":51105,"1f3a9":61146,"1f3aa":4871,"1f3ab":51044,"1f3ac":61205,"1f3ad":51103,"1f3ae":51086,"1f3af":51078,"1f3b0":51088,"1f3b1":51081,"1f3b2":51089,"1f3b3":51060,"1f3b4":51102,"1f3b5":61165,"1f3b6":61166,"1f3b7":61173,"1f3b8":61175,"1f3b9":61176,"1f3ba":61177,"1f3bb":61178,"1f3bc":61164,"1f3bd":51074,"1f3be":51058,"1f3bf":51075,"1f3c0":51054,"1f3c1":71586,"1f3c2":1600,"1f3c3-200d-2640":1584,"1f3c3-200d-2642":1583,"1f3c3":1582,"1f3c4-200d-2640":1606,"1f3c4-200d-2642":1605,"1f3c4":1604,"1f3c5":51047,"1f3c6":51046,"1f3c7":1598,"1f3c8":51056,"1f3c9":51057,"1f3ca-200d-2640":1612,"1f3ca-200d-2642":1611,"1f3ca":1610,"1f3cb-200d-2640":1618,"1f3cb-200d-2642":1617,"1f3cb":1616,"1f3cc-200d-2640":1603,"1f3cc-200d-2642":1602,"1f3cc":1601,"1f3cd":4902,"1f3ce":4901,"1f3cf":51061,"1f3d0":51055,"1f3d1":51062,"1f3d2":51063,"1f3d3":51065,"1f3d4":4813,"1f3d5":4817,"1f3d6":4818,"1f3d7":4824,"1f3d8":4829,"1f3d9":4859,"1f3da":4830,"1f3db":4823,"1f3dc":4819,"1f3dd":4820,"1f3de":4821,"1f3df":4822,"1f3e0":4831,"1f3e1":4832,"1f3e2":4833,"1f3e3":4834,"1f3e4":4835,"1f3e5":4836,"1f3e6":4837,"1f3e7":62729,"1f3e8":4838,"1f3e9":4839,"1f3ea":4840,"1f3eb":4841,"1f3ec":4842,"1f3ed":4843,"1f3ee":61216,"1f3ef":4844,"1f3f0":4845,"1f3f3-200d-1f308":71591,"1f3f3-200d-26a7":71592,"1f3f3":71590,"1f3f4-200d-2620":71593,"1f3f4-e0067-e0062-e0065-e006e-e0067-e007f":71852,"1f3f4-e0067-e0062-e0073-e0063-e0074-e007f":71853,"1f3f4-e0067-e0062-e0077-e006c-e0073-e007f":71854,"1f3f4":71589,"1f3f5":2652,"1f3f7":61234,"1f3f8":51066,"1f3f9":61303,"1f3fa":3805,"1f3fb":9525,"1f3fc":9526,"1f3fd":9527,"1f3fe":9528,"1f3ff":9529,"1f400":2576,"1f401":2575,"1f402":2556,"1f403":2557,"1f404":2558,"1f405":2547,"1f406":2548,"1f407":2579,"1f408-200d-2b1b":2544,"1f408":2543,"1f409":2618,"1f40a":2613,"1f40b":2622,"1f40c":2632,"1f40d":2616,"1f40e":2550,"1f40f":2563,"1f410":2565,"1f411":2564,"1f412":2531,"1f413":2596,"1f414":2595,"1f415-200d-1f9ba":2537,"1f415":2535,"1f416":2560,"1f417":2561,"1f418":2570,"1f419":2629,"1f41a":2630,"1f41b":2634,"1f41c":2635,"1f41d":2636,"1f41e":2638,"1f41f":2625,"1f420":2626,"1f421":2627,"1f422":2614,"1f423":2597,"1f424":2598,"1f425":2599,"1f426":2600,"1f427":2601,"1f428":2586,"1f429":2538,"1f42a":2566,"1f42b":2567,"1f42c":2623,"1f42d":2574,"1f42e":2555,"1f42f":2546,"1f430":2578,"1f431":2542,"1f432":2617,"1f433":2621,"1f434":2549,"1f435":2530,"1f436":2534,"1f437":2559,"1f438":2612,"1f439":2577,"1f43a":2539,"1f43b-200d-2744":2585,"1f43b":2584,"1f43c":2587,"1f43d":2562,"1f43e":2593,"1f43f":2580,"1f440":1381,"1f441-200d-1f5e8":1159,"1f441":1382,"1f442":1373,"1f443":1375,"1f444":1384,"1f445":1383,"1f446":1347,"1f447":1349,"1f448":1345,"1f449":1346,"1f44a":1355,"1f44b":1327,"1f44c":1336,"1f44d":1352,"1f44e":1353,"1f44f":1358,"1f450":1361,"1f451":61144,"1f452":61145,"1f453":61110,"1f454":61115,"1f455":61116,"1f456":61117,"1f457":61122,"1f458":61123,"1f459":61128,"1f45a":61129,"1f45b":61130,"1f45c":61131,"1f45d":61132,"1f45e":61136,"1f45f":61137,"1f460":61140,"1f461":61141,"1f462":61143,"1f463":1687,"1f464":1684,"1f465":1685,"1f466":1388,"1f467":1389,"1f468-200d-1f33e":1457,"1f468-200d-1f373":1460,"1f468-200d-1f37c":1524,"1f468-200d-1f393":1448,"1f468-200d-1f3a4":1478,"1f468-200d-1f3a8":1481,"1f468-200d-1f3eb":1451,"1f468-200d-1f3ed":1466,"1f468-200d-1f466-200d-1f466":1674,"1f468-200d-1f466":1673,"1f468-200d-1f467-200d-1f466":1676,"1f468-200d-1f467-200d-1f467":1677,"1f468-200d-1f467":1675,"1f468-200d-1f468-200d-1f466":1663,"1f468-200d-1f468-200d-1f466-200d-1f466":1666,"1f468-200d-1f468-200d-1f467":1664,"1f468-200d-1f468-200d-1f467-200d-1f466":1665,"1f468-200d-1f468-200d-1f467-200d-1f467":1667,"1f468-200d-1f469-200d-1f466":1658,"1f468-200d-1f469-200d-1f466-200d-1f466":1661,"1f468-200d-1f469-200d-1f467":1659,"1f468-200d-1f469-200d-1f467-200d-1f466":1660,"1f468-200d-1f469-200d-1f467-200d-1f467":1662,"1f468-200d-1f4bb":1475,"1f468-200d-1f4bc":1469,"1f468-200d-1f527":1463,"1f468-200d-1f52c":1472,"1f468-200d-1f680":1487,"1f468-200d-1f692":1490,"1f468-200d-1f9af":1574,"1f468-200d-1f9b0":1396,"1f468-200d-1f9b1":1397,"1f468-200d-1f9b2":1399,"1f468-200d-1f9b3":1398,"1f468-200d-1f9bc":1577,"1f468-200d-1f9bd":1580,"1f468-200d-2695":1445,"1f468-200d-2696":1454,"1f468-200d-2708":1484,"1f468-200d-2764-200d-1f468":1655,"1f468-200d-2764-200d-1f48b-200d-1f468":1651,"1f468":1392,"1f469-200d-1f33e":1458,"1f469-200d-1f373":1461,"1f469-200d-1f37c":1523,"1f469-200d-1f393":1449,"1f469-200d-1f3a4":1479,"1f469-200d-1f3a8":1482,"1f469-200d-1f3eb":1452,"1f469-200d-1f3ed":1467,"1f469-200d-1f466-200d-1f466":1679,"1f469-200d-1f466":1678,"1f469-200d-1f467-200d-1f466":1681,"1f469-200d-1f467-200d-1f467":1682,"1f469-200d-1f467":1680,"1f469-200d-1f469-200d-1f466":1668,"1f469-200d-1f469-200d-1f466-200d-1f466":1671,"1f469-200d-1f469-200d-1f467":1669,"1f469-200d-1f469-200d-1f467-200d-1f466":1670,"1f469-200d-1f469-200d-1f467-200d-1f467":1672,"1f469-200d-1f4bb":1476,"1f469-200d-1f4bc":1470,"1f469-200d-1f527":1464,"1f469-200d-1f52c":1473,"1f469-200d-1f680":1488,"1f469-200d-1f692":1491,"1f469-200d-1f9af":1575,"1f469-200d-1f9b0":1401,"1f469-200d-1f9b1":1403,"1f469-200d-1f9b2":1407,"1f469-200d-1f9b3":1405,"1f469-200d-1f9bc":1578,"1f469-200d-1f9bd":1581,"1f469-200d-2695":1446,"1f469-200d-2696":1455,"1f469-200d-2708":1485,"1f469-200d-2764-200d-1f468":1654,"1f469-200d-2764-200d-1f469":1656,"1f469-200d-2764-200d-1f48b-200d-1f468":1650,"1f469-200d-2764-200d-1f48b-200d-1f469":1652,"1f469":1400,"1f46a":1657,"1f46b":1647,"1f46c":1648,"1f46d":1646,"1f46e-200d-2640":1494,"1f46e-200d-2642":1493,"1f46e":1492,"1f46f-200d-2640":1590,"1f46f-200d-2642":1589,"1f46f":1588,"1f470-200d-2640":1518,"1f470-200d-2642":1517,"1f470":1516,"1f471-200d-2640":1409,"1f471-200d-2642":1410,"1f471":1391,"1f472":1511,"1f473-200d-2640":1510,"1f473-200d-2642":1509,"1f473":1508,"1f474":1412,"1f475":1413,"1f476":1386,"1f477-200d-2640":1504,"1f477-200d-2642":1503,"1f477":1502,"1f478":1507,"1f479":1109,"1f47a":1110,"1f47b":1111,"1f47c":1526,"1f47d":1112,"1f47e":1113,"1f47f":1104,"1f480":1105,"1f481-200d-2640":1428,"1f481-200d-2642":1427,"1f481":1426,"1f482-200d-2640":1500,"1f482-200d-2642":1499,"1f482":1498,"1f483":1585,"1f484":61152,"1f485":1366,"1f486-200d-2640":1560,"1f486-200d-2642":1559,"1f486":1558,"1f487-200d-2640":1563,"1f487-200d-2642":1562,"1f487":1561,"1f488":4870,"1f489":61326,"1f48a":61328,"1f48b":1127,"1f48c":1128,"1f48d":61153,"1f48e":61154,"1f48f":1649,"1f490":2648,"1f491":1653,"1f492":4846,"1f493":1133,"1f494":1138,"1f495":1135,"1f496":1131,"1f497":1132,"1f498":1129,"1f499":1145,"1f49a":1144,"1f49b":1143,"1f49c":1146,"1f49d":1130,"1f49e":1134,"1f49f":1136,"1f4a0":62946,"1f4a1":61214,"1f4a2":1151,"1f4a3":1157,"1f4a4":1163,"1f4a5":1152,"1f4a6":1154,"1f4a7":41022,"1f4a8":1155,"1f4a9":1107,"1f4aa":1368,"1f4ab":1153,"1f4ac":1158,"1f4ad":1162,"1f4ae":2650,"1f4af":1150,"1f4b0":61235,"1f4b1":62841,"1f4b2":62842,"1f4b3":61242,"1f4b4":61237,"1f4b5":61238,"1f4b6":61239,"1f4b7":61240,"1f4b8":61241,"1f4b9":61244,"1f4ba":4936,"1f4bb":61191,"1f4bc":61265,"1f4bd":61197,"1f4be":61198,"1f4bf":61199,"1f4c0":61200,"1f4c1":61266,"1f4c2":61267,"1f4c3":61227,"1f4c4":61229,"1f4c5":61269,"1f4c6":61270,"1f4c7":61273,"1f4c8":61274,"1f4c9":61275,"1f4ca":61276,"1f4cb":61277,"1f4cc":61278,"1f4cd":61279,"1f4ce":61280,"1f4cf":61282,"1f4d0":61283,"1f4d1":61232,"1f4d2":61226,"1f4d3":61225,"1f4d4":61218,"1f4d5":61219,"1f4d6":61220,"1f4d7":61221,"1f4d8":61222,"1f4d9":61223,"1f4da":61224,"1f4db":62847,"1f4dc":61228,"1f4dd":61264,"1f4de":61185,"1f4df":61186,"1f4e0":61187,"1f4e1":61325,"1f4e2":61159,"1f4e3":61160,"1f4e4":61249,"1f4e5":61250,"1f4e6":61251,"1f4e7":61246,"1f4e8":61247,"1f4e9":61248,"1f4ea":61253,"1f4eb":61252,"1f4ec":61254,"1f4ed":61255,"1f4ee":61256,"1f4ef":61161,"1f4f0":61230,"1f4f1":61182,"1f4f2":61183,"1f4f3":62823,"1f4f4":62824,"1f4f5":62751,"1f4f6":62822,"1f4f7":61207,"1f4f8":61208,"1f4f9":61209,"1f4fa":61206,"1f4fb":61172,"1f4fc":61210,"1f4fd":61204,"1f4ff":61151,"1f500":62801,"1f501":62802,"1f502":62803,"1f503":62769,"1f504":62770,"1f505":62820,"1f506":62821,"1f507":61155,"1f508":61156,"1f509":61157,"1f50a":61158,"1f50b":61188,"1f50c":61190,"1f50d":61211,"1f50e":61212,"1f50f":61290,"1f510":61291,"1f511":61292,"1f512":61288,"1f513":61289,"1f514":61162,"1f515":61163,"1f516":61233,"1f517":61313,"1f518":62947,"1f519":62771,"1f51a":62772,"1f51b":62773,"1f51c":62774,"1f51d":62775,"1f51e":62752,"1f51f":62876,"1f520":62877,"1f521":62878,"1f522":62879,"1f523":62880,"1f524":62881,"1f525":41021,"1f526":61215,"1f527":61306,"1f528":61294,"1f529":61308,"1f52a":3803,"1f52b":61301,"1f52c":61323,"1f52d":61324,"1f52e":51082,"1f52f":62787,"1f530":62848,"1f531":62846,"1f532":62949,"1f533":62948,"1f534":62916,"1f535":62920,"1f536":62940,"1f537":62941,"1f538":62942,"1f539":62943,"1f53a":62944,"1f53b":62945,"1f53c":62811,"1f53d":62813,"1f549":62778,"1f54a":2602,"1f54b":4854,"1f54c":4850,"1f54d":4852,"1f54e":62786,"1f550":4955,"1f551":4957,"1f552":4959,"1f553":4961,"1f554":4963,"1f555":4965,"1f556":4967,"1f557":4969,"1f558":4971,"1f559":4973,"1f55a":4975,"1f55b":4953,"1f55c":4956,"1f55d":4958,"1f55e":4960,"1f55f":4962,"1f560":4964,"1f561":4966,"1f562":4968,"1f563":4970,"1f564":4972,"1f565":4974,"1f566":4976,"1f567":4954,"1f56f":61213,"1f570":4952,"1f573":1156,"1f574":1587,"1f575-200d-2640":1497,"1f575-200d-2642":1496,"1f575":1495,"1f576":61111,"1f577":2641,"1f578":2642,"1f579":51087,"1f57a":1586,"1f587":61281,"1f58a":61261,"1f58b":61260,"1f58c":61262,"1f58d":61263,"1f590":1329,"1f595":1348,"1f596":1331,"1f5a4":1148,"1f5a5":61192,"1f5a8":61193,"1f5b1":61195,"1f5b2":61196,"1f5bc":51104,"1f5c2":61268,"1f5c3":61285,"1f5c4":61286,"1f5d1":61287,"1f5d2":61271,"1f5d3":61272,"1f5dc":61310,"1f5dd":61293,"1f5de":61231,"1f5e1":61299,"1f5e3":1683,"1f5e8":1160,"1f5ef":1161,"1f5f3":61257,"1f5fa":4810,"1f5fb":4816,"1f5fc":4847,"1f5fd":4848,"1f5fe":4811,"1f5ff":61362,"1f600":11,"1f601":14,"1f602":18,"1f603":12,"1f604":13,"1f605":16,"1f606":15,"1f607":114,"1f608":1103,"1f609":112,"1f60a":113,"1f60b":124,"1f60c":150,"1f60d":116,"1f60e":170,"1f60f":144,"1f610":139,"1f611":140,"1f612":145,"1f613":195,"1f614":151,"1f615":173,"1f616":192,"1f617":119,"1f618":118,"1f619":122,"1f61a":121,"1f61b":125,"1f61c":126,"1f61d":128,"1f61e":194,"1f61f":175,"1f620":1101,"1f621":1100,"1f622":189,"1f623":193,"1f624":199,"1f625":188,"1f626":184,"1f627":185,"1f628":186,"1f629":196,"1f62a":152,"1f62b":197,"1f62c":147,"1f62d":190,"1f62e-200d-1f4a8":148,"1f62e":178,"1f62f":179,"1f630":187,"1f631":191,"1f632":180,"1f633":181,"1f634":154,"1f635-200d-1f4ab":165,"1f635":164,"1f636-200d-1f32b":143,"1f636":141,"1f637":155,"1f638":1116,"1f639":1117,"1f63a":1115,"1f63b":1118,"1f63c":1119,"1f63d":1120,"1f63e":1123,"1f63f":1122,"1f640":1121,"1f641":176,"1f642":19,"1f643":110,"1f644":146,"1f645-200d-2640":1422,"1f645-200d-2642":1421,"1f645":1420,"1f646-200d-2640":1425,"1f646-200d-2642":1424,"1f646":1423,"1f647-200d-2640":1437,"1f647-200d-2642":1436,"1f647":1435,"1f648":1124,"1f649":1125,"1f64a":1126,"1f64b-200d-2640":1431,"1f64b-200d-2642":1430,"1f64b":1429,"1f64c":1359,"1f64d-200d-2640":1416,"1f64d-200d-2642":1415,"1f64d":1414,"1f64e-200d-2640":1419,"1f64e-200d-2642":1418,"1f64e":1417,"1f64f":1364,"1f680":4942,"1f681":4937,"1f682":4872,"1f683":4873,"1f684":4874,"1f685":4875,"1f686":4876,"1f687":4877,"1f688":4878,"1f689":4879,"1f68a":4880,"1f68b":4883,"1f68c":4884,"1f68d":4885,"1f68e":4886,"1f68f":4911,"1f690":4887,"1f691":4888,"1f692":4889,"1f693":4890,"1f694":4891,"1f695":4892,"1f696":4893,"1f697":4894,"1f698":4895,"1f699":4896,"1f69a":4898,"1f69b":4899,"1f69c":4900,"1f69d":4881,"1f69e":4882,"1f69f":4938,"1f6a0":4939,"1f6a1":4940,"1f6a2":4930,"1f6a3-200d-2640":1609,"1f6a3-200d-2642":1608,"1f6a3":1607,"1f6a4":4926,"1f6a5":4918,"1f6a6":4919,"1f6a7":4921,"1f6a8":4917,"1f6a9":71587,"1f6aa":61333,"1f6ab":62745,"1f6ac":61358,"1f6ad":62747,"1f6ae":62730,"1f6af":62748,"1f6b0":62731,"1f6b1":62749,"1f6b2":4907,"1f6b3":62746,"1f6b4-200d-2640":1621,"1f6b4-200d-2642":1620,"1f6b4":1619,"1f6b5-200d-2640":1624,"1f6b5-200d-2642":1623,"1f6b5":1622,"1f6b6-200d-2640":1566,"1f6b6-200d-2642":1565,"1f6b6":1564,"1f6b7":62750,"1f6b8":62743,"1f6b9":62733,"1f6ba":62734,"1f6bb":62735,"1f6bc":62736,"1f6bd":61340,"1f6be":62737,"1f6bf":61342,"1f6c0":1643,"1f6c1":61343,"1f6c2":62738,"1f6c3":62739,"1f6c4":62740,"1f6c5":62741,"1f6cb":61338,"1f6cc":1644,"1f6cd":61133,"1f6ce":4944,"1f6cf":61337,"1f6d0":62776,"1f6d1":4920,"1f6d2":61357,"1f6d5":4851,"1f6d6":4828,"1f6d7":61334,"1f6e0":61298,"1f6e1":61304,"1f6e2":4914,"1f6e3":4912,"1f6e4":4913,"1f6e5":4929,"1f6e9":4932,"1f6eb":4933,"1f6ec":4934,"1f6f0":4941,"1f6f3":4927,"1f6f4":4908,"1f6f5":4903,"1f6f6":4925,"1f6f7":51076,"1f6f8":4943,"1f6f9":4909,"1f6fa":4906,"1f6fb":4897,"1f6fc":4910,"1f7e0":62917,"1f7e1":62918,"1f7e2":62919,"1f7e3":62921,"1f7e4":62922,"1f7e5":62925,"1f7e6":62929,"1f7e7":62926,"1f7e8":62927,"1f7e9":62928,"1f7ea":62930,"1f7eb":62931,"1f90c":1337,"1f90d":1149,"1f90e":1147,"1f90f":1338,"1f910":137,"1f911":129,"1f912":156,"1f913":171,"1f914":135,"1f915":157,"1f916":1114,"1f917":130,"1f918":1343,"1f919":1344,"1f91a":1328,"1f91b":1356,"1f91c":1357,"1f91d":1363,"1f91e":1340,"1f91f":1342,"1f920":167,"1f921":1108,"1f922":158,"1f923":17,"1f924":153,"1f925":149,"1f926-200d-2640":1440,"1f926-200d-2642":1439,"1f926":1438,"1f927":160,"1f928":138,"1f929":117,"1f92a":127,"1f92b":134,"1f92c":1102,"1f92d":131,"1f92e":159,"1f92f":166,"1f930":1519,"1f931":1522,"1f932":1362,"1f933":1367,"1f934":1506,"1f935-200d-2640":1515,"1f935-200d-2642":1514,"1f935":1513,"1f936":1528,"1f937-200d-2640":1443,"1f937-200d-2642":1442,"1f937":1441,"1f938-200d-2640":1627,"1f938-200d-2642":1626,"1f938":1625,"1f939-200d-2640":1639,"1f939-200d-2642":1638,"1f939":1637,"1f93a":1597,"1f93c-200d-2640":1630,"1f93c-200d-2642":1629,"1f93c":1628,"1f93d-200d-2640":1633,"1f93d-200d-2642":1632,"1f93d":1631,"1f93e-200d-2640":1636,"1f93e-200d-2642":1635,"1f93e":1634,"1f93f":51073,"1f940":2654,"1f941":61180,"1f942":3791,"1f943":3792,"1f944":3802,"1f945":51069,"1f947":51048,"1f948":51049,"1f949":51050,"1f94a":51067,"1f94b":51068,"1f94c":51077,"1f94d":51064,"1f94e":51053,"1f94f":51059,"1f950":3710,"1f951":3693,"1f952":3700,"1f953":3721,"1f954":3695,"1f955":3696,"1f956":3711,"1f957":3738,"1f958":3734,"1f959":3730,"1f95a":3732,"1f95b":3780,"1f95c":3706,"1f95d":3689,"1f95e":3715,"1f95f":3757,"1f960":3758,"1f961":3759,"1f962":3799,"1f963":3737,"1f964":3794,"1f965":3692,"1f966":3702,"1f967":3773,"1f968":3713,"1f969":3720,"1f96a":3726,"1f96b":3742,"1f96c":3701,"1f96d":3681,"1f96e":3755,"1f96f":3714,"1f970":115,"1f971":198,"1f972":123,"1f973":168,"1f974":163,"1f975":161,"1f976":162,"1f977":1501,"1f978":169,"1f97a":182,"1f97b":61124,"1f97c":61113,"1f97d":61112,"1f97e":61138,"1f97f":61139,"1f980":3760,"1f981":2545,"1f982":2643,"1f983":2594,"1f984":2551,"1f985":2603,"1f986":2604,"1f987":2583,"1f988":2628,"1f989":2606,"1f98a":2540,"1f98b":2633,"1f98c":2553,"1f98d":2532,"1f98e":2615,"1f98f":2572,"1f990":3762,"1f991":3763,"1f992":2569,"1f993":2552,"1f994":2582,"1f995":2619,"1f996":2620,"1f997":2639,"1f998":2591,"1f999":2568,"1f99a":2610,"1f99b":2573,"1f99c":2611,"1f99d":2541,"1f99e":3761,"1f99f":2644,"1f9a0":2647,"1f9a1":2592,"1f9a2":2605,"1f9a3":2571,"1f9a4":2607,"1f9a5":2588,"1f9a6":2589,"1f9a7":2533,"1f9a8":2590,"1f9a9":2609,"1f9aa":3764,"1f9ab":2581,"1f9ac":2554,"1f9ad":2624,"1f9ae":2536,"1f9af":61312,"1f9b4":1380,"1f9b5":1371,"1f9b6":1372,"1f9b7":1379,"1f9b8-200d-2640":1532,"1f9b8-200d-2642":1531,"1f9b8":1530,"1f9b9-200d-2640":1535,"1f9b9-200d-2642":1534,"1f9b9":1533,"1f9ba":61114,"1f9bb":1374,"1f9bc":4905,"1f9bd":4904,"1f9be":1369,"1f9bf":1370,"1f9c0":3717,"1f9c1":3772,"1f9c2":3741,"1f9c3":3796,"1f9c4":3703,"1f9c5":3704,"1f9c6":3731,"1f9c7":3716,"1f9c8":3740,"1f9c9":3797,"1f9ca":3798,"1f9cb":3795,"1f9cd-200d-2640":1569,"1f9cd-200d-2642":1568,"1f9cd":1567,"1f9ce-200d-2640":1572,"1f9ce-200d-2642":1571,"1f9ce":1570,"1f9cf-200d-2640":1434,"1f9cf-200d-2642":1433,"1f9cf":1432,"1f9d0":172,"1f9d1-200d-1f33e":1456,"1f9d1-200d-1f373":1459,"1f9d1-200d-1f37c":1525,"1f9d1-200d-1f384":1529,"1f9d1-200d-1f393":1447,"1f9d1-200d-1f3a4":1477,"1f9d1-200d-1f3a8":1480,"1f9d1-200d-1f3eb":1450,"1f9d1-200d-1f3ed":1465,"1f9d1-200d-1f4bb":1474,"1f9d1-200d-1f4bc":1468,"1f9d1-200d-1f527":1462,"1f9d1-200d-1f52c":1471,"1f9d1-200d-1f680":1486,"1f9d1-200d-1f692":1489,"1f9d1-200d-1f91d-200d-1f9d1":1645,"1f9d1-200d-1f9af":1573,"1f9d1-200d-1f9b0":1402,"1f9d1-200d-1f9b1":1404,"1f9d1-200d-1f9b2":1408,"1f9d1-200d-1f9b3":1406,"1f9d1-200d-1f9bc":1576,"1f9d1-200d-1f9bd":1579,"1f9d1-200d-2695":1444,"1f9d1-200d-2696":1453,"1f9d1-200d-2708":1483,"1f9d1":1390,"1f9d2":1387,"1f9d3":1411,"1f9d4-200d-2640":1395,"1f9d4-200d-2642":1394,"1f9d4":1393,"1f9d5":1512,"1f9d6-200d-2640":1593,"1f9d6-200d-2642":1592,"1f9d6":1591,"1f9d7-200d-2640":1596,"1f9d7-200d-2642":1595,"1f9d7":1594,"1f9d8-200d-2640":1642,"1f9d8-200d-2642":1641,"1f9d8":1640,"1f9d9-200d-2640":1538,"1f9d9-200d-2642":1537,"1f9d9":1536,"1f9da-200d-2640":1541,"1f9da-200d-2642":1540,"1f9da":1539,"1f9db-200d-2640":1544,"1f9db-200d-2642":1543,"1f9db":1542,"1f9dc-200d-2640":1547,"1f9dc-200d-2642":1546,"1f9dc":1545,"1f9dd-200d-2640":1550,"1f9dd-200d-2642":1549,"1f9dd":1548,"1f9de-200d-2640":1553,"1f9de-200d-2642":1552,"1f9de":1551,"1f9df-200d-2640":1556,"1f9df-200d-2642":1555,"1f9df":1554,"1f9e0":1376,"1f9e1":1142,"1f9e2":61148,"1f9e3":61118,"1f9e4":61119,"1f9e5":61120,"1f9e6":61121,"1f9e7":51039,"1f9e8":51028,"1f9e9":51090,"1f9ea":61320,"1f9eb":61321,"1f9ec":61322,"1f9ed":4812,"1f9ee":61201,"1f9ef":61356,"1f9f0":61316,"1f9f1":4825,"1f9f2":61317,"1f9f3":4945,"1f9f4":61346,"1f9f5":51106,"1f9f6":51108,"1f9f7":61347,"1f9f8":51091,"1f9f9":61348,"1f9fa":61349,"1f9fb":61350,"1f9fc":61352,"1f9fd":61355,"1f9fe":61243,"1f9ff":51084,"1fa70":61142,"1fa71":61125,"1fa72":61126,"1fa73":61127,"1fa74":61135,"1fa78":61327,"1fa79":61329,"1fa7a":61331,"1fa80":51079,"1fa81":51080,"1fa82":4935,"1fa83":61302,"1fa84":51083,"1fa85":51092,"1fa86":51094,"1fa90":4993,"1fa91":61339,"1fa92":61345,"1fa93":61295,"1fa94":61217,"1fa95":61179,"1fa96":61149,"1fa97":61174,"1fa98":61181,"1fa99":61236,"1fa9a":61305,"1fa9b":61307,"1fa9c":61318,"1fa9d":61315,"1fa9e":61335,"1fa9f":61336,"1faa0":61341,"1faa1":51107,"1faa2":51109,"1faa3":61351,"1faa4":61344,"1faa5":61354,"1faa6":61360,"1faa7":61363,"1faa8":4826,"1fab0":2645,"1fab1":2646,"1fab2":2637,"1fab3":2640,"1fab4":2660,"1fab5":4827,"1fab6":2608,"1fac0":1377,"1fac1":1378,"1fac2":1686,"1fad0":3688,"1fad1":3699,"1fad2":3691,"1fad3":3712,"1fad4":3729,"1fad5":3736,"1fad6":3782,"203c":62834,"21a9":62765,"21aa":62766,"231a":4948,"231b":4946,"23cf":62818,"23e9":62805,"23ea":62809,"23eb":62812,"23ec":62814,"23ed":62806,"23ee":62810,"23ef":62807,"23f0":4949,"23f1":4950,"23f2":4951,"23f3":4947,"23f8":62815,"23f9":62816,"23fa":62817,"24c2":62890,"25aa":62938,"25ab":62939,"25b6":62804,"25c0":62808,"25fb":62935,"25fc":62934,"25fd":62937,"25fe":62936,"260e":61184,"261d":1350,"262a":62784,"262e":62785,"262f":62781,"263a":120,"264a":62790,"264b":62791,"264c":62792,"264d":62793,"264e":62794,"264f":62795,"265f":51099,"267b":62844,"267e":62833,"267f":62732,"269b":62777,"269c":62845,"26a0":62742,"26a1":41016,"26a7":62827,"26aa":62924,"26ab":62923,"26b0":61359,"26b1":61361,"26bd":51051,"26be":51052,"26c4":41019,"26c5":4999,"26c8":41e3,"26ce":62800,"26cf":61296,"26d1":61150,"26d3":61314,"26d4":62744,"26e9":4853,"26ea":4849,"26f0":4814,"26f1":41015,"26f2":4855,"26f3":51070,"26f4":4928,"26f5":4924,"26f7":1599,"26f8":51071,"26f9-200d-2640":1615,"26f9-200d-2642":1614,"26f9":1613,"26fa":4856,"26fd":4915,"270a":1354,"270b":1330,"270c":1339,"270d":1365,"270f":61258,"271d":62782,"274c":62853,"274e":62854,"2764-200d-1f525":1139,"2764-200d-1fa79":1140,"27a1":62757,"27b0":62855,"27bf":62856,"2b05":62761,"2b06":62755,"2b07":62759,"2b1b":62932,"2b1c":62933,"2b50":4994,"2b55":62849,"303d":62857,"1f385-1f3fb":0,"1f385-1f3fc":0,"1f385-1f3fd":0,"1f385-1f3fe":0,"1f385-1f3ff":0,"1f3c2-1f3fb":0,"1f3c2-1f3fc":0,"1f3c2-1f3fd":0,"1f3c2-1f3fe":0,"1f3c2-1f3ff":0,"1f3c3-1f3fb-200d-2640":0,"1f3c3-1f3fc-200d-2640":0,"1f3c3-1f3fd-200d-2640":0,"1f3c3-1f3fe-200d-2640":0,"1f3c3-1f3ff-200d-2640":0,"1f3c3-1f3fb-200d-2642":0,"1f3c3-1f3fc-200d-2642":0,"1f3c3-1f3fd-200d-2642":0,"1f3c3-1f3fe-200d-2642":0,"1f3c3-1f3ff-200d-2642":0,"1f3c3-1f3fb":0,"1f3c3-1f3fc":0,"1f3c3-1f3fd":0,"1f3c3-1f3fe":0,"1f3c3-1f3ff":0,"1f3c4-1f3fb-200d-2640":0,"1f3c4-1f3fc-200d-2640":0,"1f3c4-1f3fd-200d-2640":0,"1f3c4-1f3fe-200d-2640":0,"1f3c4-1f3ff-200d-2640":0,"1f3c4-1f3fb-200d-2642":0,"1f3c4-1f3fc-200d-2642":0,"1f3c4-1f3fd-200d-2642":0,"1f3c4-1f3fe-200d-2642":0,"1f3c4-1f3ff-200d-2642":0,"1f3c4-1f3fb":0,"1f3c4-1f3fc":0,"1f3c4-1f3fd":0,"1f3c4-1f3fe":0,"1f3c4-1f3ff":0,"1f3c7-1f3fb":0,"1f3c7-1f3fc":0,"1f3c7-1f3fd":0,"1f3c7-1f3fe":0,"1f3c7-1f3ff":0,"1f3ca-1f3fb-200d-2640":0,"1f3ca-1f3fc-200d-2640":0,"1f3ca-1f3fd-200d-2640":0,"1f3ca-1f3fe-200d-2640":0,"1f3ca-1f3ff-200d-2640":0,"1f3ca-1f3fb-200d-2642":0,"1f3ca-1f3fc-200d-2642":0,"1f3ca-1f3fd-200d-2642":0,"1f3ca-1f3fe-200d-2642":0,"1f3ca-1f3ff-200d-2642":0,"1f3ca-1f3fb":0,"1f3ca-1f3fc":0,"1f3ca-1f3fd":0,"1f3ca-1f3fe":0,"1f3ca-1f3ff":0,"1f3cb-1f3fb-200d-2640":0,"1f3cb-1f3fc-200d-2640":0,"1f3cb-1f3fd-200d-2640":0,"1f3cb-1f3fe-200d-2640":0,"1f3cb-1f3ff-200d-2640":0,"1f3cb-1f3fb-200d-2642":0,"1f3cb-1f3fc-200d-2642":0,"1f3cb-1f3fd-200d-2642":0,"1f3cb-1f3fe-200d-2642":0,"1f3cb-1f3ff-200d-2642":0,"1f3cb-1f3fb":0,"1f3cb-1f3fc":0,"1f3cb-1f3fd":0,"1f3cb-1f3fe":0,"1f3cb-1f3ff":0,"1f3cc-1f3fb-200d-2640":0,"1f3cc-1f3fc-200d-2640":0,"1f3cc-1f3fd-200d-2640":0,"1f3cc-1f3fe-200d-2640":0,"1f3cc-1f3ff-200d-2640":0,"1f3cc-1f3fb-200d-2642":0,"1f3cc-1f3fc-200d-2642":0,"1f3cc-1f3fd-200d-2642":0,"1f3cc-1f3fe-200d-2642":0,"1f3cc-1f3ff-200d-2642":0,"1f3cc-1f3fb":0,"1f3cc-1f3fc":0,"1f3cc-1f3fd":0,"1f3cc-1f3fe":0,"1f3cc-1f3ff":0,"1f442-1f3fb":0,"1f442-1f3fc":0,"1f442-1f3fd":0,"1f442-1f3fe":0,"1f442-1f3ff":0,"1f443-1f3fb":0,"1f443-1f3fc":0,"1f443-1f3fd":0,"1f443-1f3fe":0,"1f443-1f3ff":0,"1f446-1f3fb":0,"1f446-1f3fc":0,"1f446-1f3fd":0,"1f446-1f3fe":0,"1f446-1f3ff":0,"1f447-1f3fb":0,"1f447-1f3fc":0,"1f447-1f3fd":0,"1f447-1f3fe":0,"1f447-1f3ff":0,"1f448-1f3fb":0,"1f448-1f3fc":0,"1f448-1f3fd":0,"1f448-1f3fe":0,"1f448-1f3ff":0,"1f449-1f3fb":0,"1f449-1f3fc":0,"1f449-1f3fd":0,"1f449-1f3fe":0,"1f449-1f3ff":0,"1f44a-1f3fb":0,"1f44a-1f3fc":0,"1f44a-1f3fd":0,"1f44a-1f3fe":0,"1f44a-1f3ff":0,"1f44b-1f3fb":0,"1f44b-1f3fc":0,"1f44b-1f3fd":0,"1f44b-1f3fe":0,"1f44b-1f3ff":0,"1f44c-1f3fb":0,"1f44c-1f3fc":0,"1f44c-1f3fd":0,"1f44c-1f3fe":0,"1f44c-1f3ff":0,"1f44d-1f3fb":0,"1f44d-1f3fc":0,"1f44d-1f3fd":0,"1f44d-1f3fe":0,"1f44d-1f3ff":0,"1f44e-1f3fb":0,"1f44e-1f3fc":0,"1f44e-1f3fd":0,"1f44e-1f3fe":0,"1f44e-1f3ff":0,"1f44f-1f3fb":0,"1f44f-1f3fc":0,"1f44f-1f3fd":0,"1f44f-1f3fe":0,"1f44f-1f3ff":0,"1f450-1f3fb":0,"1f450-1f3fc":0,"1f450-1f3fd":0,"1f450-1f3fe":0,"1f450-1f3ff":0,"1f466-1f3fb":0,"1f466-1f3fc":0,"1f466-1f3fd":0,"1f466-1f3fe":0,"1f466-1f3ff":0,"1f467-1f3fb":0,"1f467-1f3fc":0,"1f467-1f3fd":0,"1f467-1f3fe":0,"1f467-1f3ff":0,"1f468-1f3fb-200d-1f33e":0,"1f468-1f3fc-200d-1f33e":0,"1f468-1f3fd-200d-1f33e":0,"1f468-1f3fe-200d-1f33e":0,"1f468-1f3ff-200d-1f33e":0,"1f468-1f3fb-200d-1f373":0,"1f468-1f3fc-200d-1f373":0,"1f468-1f3fd-200d-1f373":0,"1f468-1f3fe-200d-1f373":0,"1f468-1f3ff-200d-1f373":0,"1f468-1f3fb-200d-1f37c":0,"1f468-1f3fc-200d-1f37c":0,"1f468-1f3fd-200d-1f37c":0,"1f468-1f3fe-200d-1f37c":0,"1f468-1f3ff-200d-1f37c":0,"1f468-1f3fb-200d-1f393":0,"1f468-1f3fc-200d-1f393":0,"1f468-1f3fd-200d-1f393":0,"1f468-1f3fe-200d-1f393":0,"1f468-1f3ff-200d-1f393":0,"1f468-1f3fb-200d-1f3a4":0,"1f468-1f3fc-200d-1f3a4":0,"1f468-1f3fd-200d-1f3a4":0,"1f468-1f3fe-200d-1f3a4":0,"1f468-1f3ff-200d-1f3a4":0,"1f468-1f3fb-200d-1f3a8":0,"1f468-1f3fc-200d-1f3a8":0,"1f468-1f3fd-200d-1f3a8":0,"1f468-1f3fe-200d-1f3a8":0,"1f468-1f3ff-200d-1f3a8":0,"1f468-1f3fb-200d-1f3eb":0,"1f468-1f3fc-200d-1f3eb":0,"1f468-1f3fd-200d-1f3eb":0,"1f468-1f3fe-200d-1f3eb":0,"1f468-1f3ff-200d-1f3eb":0,"1f468-1f3fb-200d-1f3ed":0,"1f468-1f3fc-200d-1f3ed":0,"1f468-1f3fd-200d-1f3ed":0,"1f468-1f3fe-200d-1f3ed":0,"1f468-1f3ff-200d-1f3ed":0,"1f468-1f3fb-200d-1f4bb":0,"1f468-1f3fc-200d-1f4bb":0,"1f468-1f3fd-200d-1f4bb":0,"1f468-1f3fe-200d-1f4bb":0,"1f468-1f3ff-200d-1f4bb":0,"1f468-1f3fb-200d-1f4bc":0,"1f468-1f3fc-200d-1f4bc":0,"1f468-1f3fd-200d-1f4bc":0,"1f468-1f3fe-200d-1f4bc":0,"1f468-1f3ff-200d-1f4bc":0,"1f468-1f3fb-200d-1f527":0,"1f468-1f3fc-200d-1f527":0,"1f468-1f3fd-200d-1f527":0,"1f468-1f3fe-200d-1f527":0,"1f468-1f3ff-200d-1f527":0,"1f468-1f3fb-200d-1f52c":0,"1f468-1f3fc-200d-1f52c":0,"1f468-1f3fd-200d-1f52c":0,"1f468-1f3fe-200d-1f52c":0,"1f468-1f3ff-200d-1f52c":0,"1f468-1f3fb-200d-1f680":0,"1f468-1f3fc-200d-1f680":0,"1f468-1f3fd-200d-1f680":0,"1f468-1f3fe-200d-1f680":0,"1f468-1f3ff-200d-1f680":0,"1f468-1f3fb-200d-1f692":0,"1f468-1f3fc-200d-1f692":0,"1f468-1f3fd-200d-1f692":0,"1f468-1f3fe-200d-1f692":0,"1f468-1f3ff-200d-1f692":0,"1f468-1f3fb-200d-1f9af":0,"1f468-1f3fc-200d-1f9af":0,"1f468-1f3fd-200d-1f9af":0,"1f468-1f3fe-200d-1f9af":0,"1f468-1f3ff-200d-1f9af":0,"1f468-1f3fb-200d-1f9b0":0,"1f468-1f3fc-200d-1f9b0":0,"1f468-1f3fd-200d-1f9b0":0,"1f468-1f3fe-200d-1f9b0":0,"1f468-1f3ff-200d-1f9b0":0,"1f468-1f3fb-200d-1f9b1":0,"1f468-1f3fc-200d-1f9b1":0,"1f468-1f3fd-200d-1f9b1":0,"1f468-1f3fe-200d-1f9b1":0,"1f468-1f3ff-200d-1f9b1":0,"1f468-1f3fb-200d-1f9b2":0,"1f468-1f3fc-200d-1f9b2":0,"1f468-1f3fd-200d-1f9b2":0,"1f468-1f3fe-200d-1f9b2":0,"1f468-1f3ff-200d-1f9b2":0,"1f468-1f3fb-200d-1f9b3":0,"1f468-1f3fc-200d-1f9b3":0,"1f468-1f3fd-200d-1f9b3":0,"1f468-1f3fe-200d-1f9b3":0,"1f468-1f3ff-200d-1f9b3":0,"1f468-1f3fb-200d-1f9bc":0,"1f468-1f3fc-200d-1f9bc":0,"1f468-1f3fd-200d-1f9bc":0,"1f468-1f3fe-200d-1f9bc":0,"1f468-1f3ff-200d-1f9bc":0,"1f468-1f3fb-200d-1f9bd":0,"1f468-1f3fc-200d-1f9bd":0,"1f468-1f3fd-200d-1f9bd":0,"1f468-1f3fe-200d-1f9bd":0,"1f468-1f3ff-200d-1f9bd":0,"1f468-1f3fb-200d-2695":0,"1f468-1f3fc-200d-2695":0,"1f468-1f3fd-200d-2695":0,"1f468-1f3fe-200d-2695":0,"1f468-1f3ff-200d-2695":0,"1f468-1f3fb-200d-2696":0,"1f468-1f3fc-200d-2696":0,"1f468-1f3fd-200d-2696":0,"1f468-1f3fe-200d-2696":0,"1f468-1f3ff-200d-2696":0,"1f468-1f3fb-200d-2708":0,"1f468-1f3fc-200d-2708":0,"1f468-1f3fd-200d-2708":0,"1f468-1f3fe-200d-2708":0,"1f468-1f3ff-200d-2708":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f468-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f468-1f3fb":0,"1f468-1f3fc":0,"1f468-1f3fd":0,"1f468-1f3fe":0,"1f468-1f3ff":0,"1f469-1f3fb-200d-1f33e":0,"1f469-1f3fc-200d-1f33e":0,"1f469-1f3fd-200d-1f33e":0,"1f469-1f3fe-200d-1f33e":0,"1f469-1f3ff-200d-1f33e":0,"1f469-1f3fb-200d-1f373":0,"1f469-1f3fc-200d-1f373":0,"1f469-1f3fd-200d-1f373":0,"1f469-1f3fe-200d-1f373":0,"1f469-1f3ff-200d-1f373":0,"1f469-1f3fb-200d-1f37c":0,"1f469-1f3fc-200d-1f37c":0,"1f469-1f3fd-200d-1f37c":0,"1f469-1f3fe-200d-1f37c":0,"1f469-1f3ff-200d-1f37c":0,"1f469-1f3fb-200d-1f393":0,"1f469-1f3fc-200d-1f393":0,"1f469-1f3fd-200d-1f393":0,"1f469-1f3fe-200d-1f393":0,"1f469-1f3ff-200d-1f393":0,"1f469-1f3fb-200d-1f3a4":0,"1f469-1f3fc-200d-1f3a4":0,"1f469-1f3fd-200d-1f3a4":0,"1f469-1f3fe-200d-1f3a4":0,"1f469-1f3ff-200d-1f3a4":0,"1f469-1f3fb-200d-1f3a8":0,"1f469-1f3fc-200d-1f3a8":0,"1f469-1f3fd-200d-1f3a8":0,"1f469-1f3fe-200d-1f3a8":0,"1f469-1f3ff-200d-1f3a8":0,"1f469-1f3fb-200d-1f3eb":0,"1f469-1f3fc-200d-1f3eb":0,"1f469-1f3fd-200d-1f3eb":0,"1f469-1f3fe-200d-1f3eb":0,"1f469-1f3ff-200d-1f3eb":0,"1f469-1f3fb-200d-1f3ed":0,"1f469-1f3fc-200d-1f3ed":0,"1f469-1f3fd-200d-1f3ed":0,"1f469-1f3fe-200d-1f3ed":0,"1f469-1f3ff-200d-1f3ed":0,"1f469-1f3fb-200d-1f4bb":0,"1f469-1f3fc-200d-1f4bb":0,"1f469-1f3fd-200d-1f4bb":0,"1f469-1f3fe-200d-1f4bb":0,"1f469-1f3ff-200d-1f4bb":0,"1f469-1f3fb-200d-1f4bc":0,"1f469-1f3fc-200d-1f4bc":0,"1f469-1f3fd-200d-1f4bc":0,"1f469-1f3fe-200d-1f4bc":0,"1f469-1f3ff-200d-1f4bc":0,"1f469-1f3fb-200d-1f527":0,"1f469-1f3fc-200d-1f527":0,"1f469-1f3fd-200d-1f527":0,"1f469-1f3fe-200d-1f527":0,"1f469-1f3ff-200d-1f527":0,"1f469-1f3fb-200d-1f52c":0,"1f469-1f3fc-200d-1f52c":0,"1f469-1f3fd-200d-1f52c":0,"1f469-1f3fe-200d-1f52c":0,"1f469-1f3ff-200d-1f52c":0,"1f469-1f3fb-200d-1f680":0,"1f469-1f3fc-200d-1f680":0,"1f469-1f3fd-200d-1f680":0,"1f469-1f3fe-200d-1f680":0,"1f469-1f3ff-200d-1f680":0,"1f469-1f3fb-200d-1f692":0,"1f469-1f3fc-200d-1f692":0,"1f469-1f3fd-200d-1f692":0,"1f469-1f3fe-200d-1f692":0,"1f469-1f3ff-200d-1f692":0,"1f469-1f3fb-200d-1f9af":0,"1f469-1f3fc-200d-1f9af":0,"1f469-1f3fd-200d-1f9af":0,"1f469-1f3fe-200d-1f9af":0,"1f469-1f3ff-200d-1f9af":0,"1f469-1f3fb-200d-1f9b0":0,"1f469-1f3fc-200d-1f9b0":0,"1f469-1f3fd-200d-1f9b0":0,"1f469-1f3fe-200d-1f9b0":0,"1f469-1f3ff-200d-1f9b0":0,"1f469-1f3fb-200d-1f9b1":0,"1f469-1f3fc-200d-1f9b1":0,"1f469-1f3fd-200d-1f9b1":0,"1f469-1f3fe-200d-1f9b1":0,"1f469-1f3ff-200d-1f9b1":0,"1f469-1f3fb-200d-1f9b2":0,"1f469-1f3fc-200d-1f9b2":0,"1f469-1f3fd-200d-1f9b2":0,"1f469-1f3fe-200d-1f9b2":0,"1f469-1f3ff-200d-1f9b2":0,"1f469-1f3fb-200d-1f9b3":0,"1f469-1f3fc-200d-1f9b3":0,"1f469-1f3fd-200d-1f9b3":0,"1f469-1f3fe-200d-1f9b3":0,"1f469-1f3ff-200d-1f9b3":0,"1f469-1f3fb-200d-1f9bc":0,"1f469-1f3fc-200d-1f9bc":0,"1f469-1f3fd-200d-1f9bc":0,"1f469-1f3fe-200d-1f9bc":0,"1f469-1f3ff-200d-1f9bc":0,"1f469-1f3fb-200d-1f9bd":0,"1f469-1f3fc-200d-1f9bd":0,"1f469-1f3fd-200d-1f9bd":0,"1f469-1f3fe-200d-1f9bd":0,"1f469-1f3ff-200d-1f9bd":0,"1f469-1f3fb-200d-2695":0,"1f469-1f3fc-200d-2695":0,"1f469-1f3fd-200d-2695":0,"1f469-1f3fe-200d-2695":0,"1f469-1f3ff-200d-2695":0,"1f469-1f3fb-200d-2696":0,"1f469-1f3fc-200d-2696":0,"1f469-1f3fd-200d-2696":0,"1f469-1f3fe-200d-2696":0,"1f469-1f3ff-200d-2696":0,"1f469-1f3fb-200d-2708":0,"1f469-1f3fc-200d-2708":0,"1f469-1f3fd-200d-2708":0,"1f469-1f3fe-200d-2708":0,"1f469-1f3ff-200d-2708":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f469-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f468-1f3ff":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3fe-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3fe":0,"1f469-1f3ff-200d-2764-200d-1f48b-200d-1f469-1f3ff":0,"1f469-1f3fb":0,"1f469-1f3fc":0,"1f469-1f3fd":0,"1f469-1f3fe":0,"1f469-1f3ff":0,"1f46b-1f3fb":0,"1f46b-1f3fc":0,"1f46b-1f3fd":0,"1f46b-1f3fe":0,"1f46b-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46c-1f3fb":0,"1f46c-1f3fc":0,"1f46c-1f3fd":0,"1f46c-1f3fe":0,"1f46c-1f3ff":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fb-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fc-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3fe":0,"1f468-1f3fd-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3fe-200d-1f91d-200d-1f468-1f3ff":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fb":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fc":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fd":0,"1f468-1f3ff-200d-1f91d-200d-1f468-1f3fe":0,"1f46d-1f3fb":0,"1f46d-1f3fc":0,"1f46d-1f3fd":0,"1f46d-1f3fe":0,"1f46d-1f3ff":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fb-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fc-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3fe":0,"1f469-1f3fd-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3fe-200d-1f91d-200d-1f469-1f3ff":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fb":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fc":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fd":0,"1f469-1f3ff-200d-1f91d-200d-1f469-1f3fe":0,"1f46e-1f3fb-200d-2640":0,"1f46e-1f3fc-200d-2640":0,"1f46e-1f3fd-200d-2640":0,"1f46e-1f3fe-200d-2640":0,"1f46e-1f3ff-200d-2640":0,"1f46e-1f3fb-200d-2642":0,"1f46e-1f3fc-200d-2642":0,"1f46e-1f3fd-200d-2642":0,"1f46e-1f3fe-200d-2642":0,"1f46e-1f3ff-200d-2642":0,"1f46e-1f3fb":0,"1f46e-1f3fc":0,"1f46e-1f3fd":0,"1f46e-1f3fe":0,"1f46e-1f3ff":0,"1f470-1f3fb-200d-2640":0,"1f470-1f3fc-200d-2640":0,"1f470-1f3fd-200d-2640":0,"1f470-1f3fe-200d-2640":0,"1f470-1f3ff-200d-2640":0,"1f470-1f3fb-200d-2642":0,"1f470-1f3fc-200d-2642":0,"1f470-1f3fd-200d-2642":0,"1f470-1f3fe-200d-2642":0,"1f470-1f3ff-200d-2642":0,"1f470-1f3fb":0,"1f470-1f3fc":0,"1f470-1f3fd":0,"1f470-1f3fe":0,"1f470-1f3ff":0,"1f471-1f3fb-200d-2640":0,"1f471-1f3fc-200d-2640":0,"1f471-1f3fd-200d-2640":0,"1f471-1f3fe-200d-2640":0,"1f471-1f3ff-200d-2640":0,"1f471-1f3fb-200d-2642":0,"1f471-1f3fc-200d-2642":0,"1f471-1f3fd-200d-2642":0,"1f471-1f3fe-200d-2642":0,"1f471-1f3ff-200d-2642":0,"1f471-1f3fb":0,"1f471-1f3fc":0,"1f471-1f3fd":0,"1f471-1f3fe":0,"1f471-1f3ff":0,"1f472-1f3fb":0,"1f472-1f3fc":0,"1f472-1f3fd":0,"1f472-1f3fe":0,"1f472-1f3ff":0,"1f473-1f3fb-200d-2640":0,"1f473-1f3fc-200d-2640":0,"1f473-1f3fd-200d-2640":0,"1f473-1f3fe-200d-2640":0,"1f473-1f3ff-200d-2640":0,"1f473-1f3fb-200d-2642":0,"1f473-1f3fc-200d-2642":0,"1f473-1f3fd-200d-2642":0,"1f473-1f3fe-200d-2642":0,"1f473-1f3ff-200d-2642":0,"1f473-1f3fb":0,"1f473-1f3fc":0,"1f473-1f3fd":0,"1f473-1f3fe":0,"1f473-1f3ff":0,"1f474-1f3fb":0,"1f474-1f3fc":0,"1f474-1f3fd":0,"1f474-1f3fe":0,"1f474-1f3ff":0,"1f475-1f3fb":0,"1f475-1f3fc":0,"1f475-1f3fd":0,"1f475-1f3fe":0,"1f475-1f3ff":0,"1f476-1f3fb":0,"1f476-1f3fc":0,"1f476-1f3fd":0,"1f476-1f3fe":0,"1f476-1f3ff":0,"1f477-1f3fb-200d-2640":0,"1f477-1f3fc-200d-2640":0,"1f477-1f3fd-200d-2640":0,"1f477-1f3fe-200d-2640":0,"1f477-1f3ff-200d-2640":0,"1f477-1f3fb-200d-2642":0,"1f477-1f3fc-200d-2642":0,"1f477-1f3fd-200d-2642":0,"1f477-1f3fe-200d-2642":0,"1f477-1f3ff-200d-2642":0,"1f477-1f3fb":0,"1f477-1f3fc":0,"1f477-1f3fd":0,"1f477-1f3fe":0,"1f477-1f3ff":0,"1f478-1f3fb":0,"1f478-1f3fc":0,"1f478-1f3fd":0,"1f478-1f3fe":0,"1f478-1f3ff":0,"1f47c-1f3fb":0,"1f47c-1f3fc":0,"1f47c-1f3fd":0,"1f47c-1f3fe":0,"1f47c-1f3ff":0,"1f481-1f3fb-200d-2640":0,"1f481-1f3fc-200d-2640":0,"1f481-1f3fd-200d-2640":0,"1f481-1f3fe-200d-2640":0,"1f481-1f3ff-200d-2640":0,"1f481-1f3fb-200d-2642":0,"1f481-1f3fc-200d-2642":0,"1f481-1f3fd-200d-2642":0,"1f481-1f3fe-200d-2642":0,"1f481-1f3ff-200d-2642":0,"1f481-1f3fb":0,"1f481-1f3fc":0,"1f481-1f3fd":0,"1f481-1f3fe":0,"1f481-1f3ff":0,"1f482-1f3fb-200d-2640":0,"1f482-1f3fc-200d-2640":0,"1f482-1f3fd-200d-2640":0,"1f482-1f3fe-200d-2640":0,"1f482-1f3ff-200d-2640":0,"1f482-1f3fb-200d-2642":0,"1f482-1f3fc-200d-2642":0,"1f482-1f3fd-200d-2642":0,"1f482-1f3fe-200d-2642":0,"1f482-1f3ff-200d-2642":0,"1f482-1f3fb":0,"1f482-1f3fc":0,"1f482-1f3fd":0,"1f482-1f3fe":0,"1f482-1f3ff":0,"1f483-1f3fb":0,"1f483-1f3fc":0,"1f483-1f3fd":0,"1f483-1f3fe":0,"1f483-1f3ff":0,"1f485-1f3fb":0,"1f485-1f3fc":0,"1f485-1f3fd":0,"1f485-1f3fe":0,"1f485-1f3ff":0,"1f486-1f3fb-200d-2640":0,"1f486-1f3fc-200d-2640":0,"1f486-1f3fd-200d-2640":0,"1f486-1f3fe-200d-2640":0,"1f486-1f3ff-200d-2640":0,"1f486-1f3fb-200d-2642":0,"1f486-1f3fc-200d-2642":0,"1f486-1f3fd-200d-2642":0,"1f486-1f3fe-200d-2642":0,"1f486-1f3ff-200d-2642":0,"1f486-1f3fb":0,"1f486-1f3fc":0,"1f486-1f3fd":0,"1f486-1f3fe":0,"1f486-1f3ff":0,"1f487-1f3fb-200d-2640":0,"1f487-1f3fc-200d-2640":0,"1f487-1f3fd-200d-2640":0,"1f487-1f3fe-200d-2640":0,"1f487-1f3ff-200d-2640":0,"1f487-1f3fb-200d-2642":0,"1f487-1f3fc-200d-2642":0,"1f487-1f3fd-200d-2642":0,"1f487-1f3fe-200d-2642":0,"1f487-1f3ff-200d-2642":0,"1f487-1f3fb":0,"1f487-1f3fc":0,"1f487-1f3fd":0,"1f487-1f3fe":0,"1f487-1f3ff":0,"1f48f-1f3fb":0,"1f48f-1f3fc":0,"1f48f-1f3fd":0,"1f48f-1f3fe":0,"1f48f-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f48b-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f48b-200d-1f9d1-1f3fe":0,"1f491-1f3fb":0,"1f491-1f3fc":0,"1f491-1f3fd":0,"1f491-1f3fe":0,"1f491-1f3ff":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-2764-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-2764-200d-1f9d1-1f3fe":0,"1f4aa-1f3fb":0,"1f4aa-1f3fc":0,"1f4aa-1f3fd":0,"1f4aa-1f3fe":0,"1f4aa-1f3ff":0,"1f574-1f3fb":0,"1f574-1f3fc":0,"1f574-1f3fd":0,"1f574-1f3fe":0,"1f574-1f3ff":0,"1f575-1f3fb-200d-2640":0,"1f575-1f3fc-200d-2640":0,"1f575-1f3fd-200d-2640":0,"1f575-1f3fe-200d-2640":0,"1f575-1f3ff-200d-2640":0,"1f575-1f3fb-200d-2642":0,"1f575-1f3fc-200d-2642":0,"1f575-1f3fd-200d-2642":0,"1f575-1f3fe-200d-2642":0,"1f575-1f3ff-200d-2642":0,"1f575-1f3fb":0,"1f575-1f3fc":0,"1f575-1f3fd":0,"1f575-1f3fe":0,"1f575-1f3ff":0,"1f57a-1f3fb":0,"1f57a-1f3fc":0,"1f57a-1f3fd":0,"1f57a-1f3fe":0,"1f57a-1f3ff":0,"1f590-1f3fb":0,"1f590-1f3fc":0,"1f590-1f3fd":0,"1f590-1f3fe":0,"1f590-1f3ff":0,"1f595-1f3fb":0,"1f595-1f3fc":0,"1f595-1f3fd":0,"1f595-1f3fe":0,"1f595-1f3ff":0,"1f596-1f3fb":0,"1f596-1f3fc":0,"1f596-1f3fd":0,"1f596-1f3fe":0,"1f596-1f3ff":0,"1f645-1f3fb-200d-2640":0,"1f645-1f3fc-200d-2640":0,"1f645-1f3fd-200d-2640":0,"1f645-1f3fe-200d-2640":0,"1f645-1f3ff-200d-2640":0,"1f645-1f3fb-200d-2642":0,"1f645-1f3fc-200d-2642":0,"1f645-1f3fd-200d-2642":0,"1f645-1f3fe-200d-2642":0,"1f645-1f3ff-200d-2642":0,"1f645-1f3fb":0,"1f645-1f3fc":0,"1f645-1f3fd":0,"1f645-1f3fe":0,"1f645-1f3ff":0,"1f646-1f3fb-200d-2640":0,"1f646-1f3fc-200d-2640":0,"1f646-1f3fd-200d-2640":0,"1f646-1f3fe-200d-2640":0,"1f646-1f3ff-200d-2640":0,"1f646-1f3fb-200d-2642":0,"1f646-1f3fc-200d-2642":0,"1f646-1f3fd-200d-2642":0,"1f646-1f3fe-200d-2642":0,"1f646-1f3ff-200d-2642":0,"1f646-1f3fb":0,"1f646-1f3fc":0,"1f646-1f3fd":0,"1f646-1f3fe":0,"1f646-1f3ff":0,"1f647-1f3fb-200d-2640":0,"1f647-1f3fc-200d-2640":0,"1f647-1f3fd-200d-2640":0,"1f647-1f3fe-200d-2640":0,"1f647-1f3ff-200d-2640":0,"1f647-1f3fb-200d-2642":0,"1f647-1f3fc-200d-2642":0,"1f647-1f3fd-200d-2642":0,"1f647-1f3fe-200d-2642":0,"1f647-1f3ff-200d-2642":0,"1f647-1f3fb":0,"1f647-1f3fc":0,"1f647-1f3fd":0,"1f647-1f3fe":0,"1f647-1f3ff":0,"1f64b-1f3fb-200d-2640":0,"1f64b-1f3fc-200d-2640":0,"1f64b-1f3fd-200d-2640":0,"1f64b-1f3fe-200d-2640":0,"1f64b-1f3ff-200d-2640":0,"1f64b-1f3fb-200d-2642":0,"1f64b-1f3fc-200d-2642":0,"1f64b-1f3fd-200d-2642":0,"1f64b-1f3fe-200d-2642":0,"1f64b-1f3ff-200d-2642":0,"1f64b-1f3fb":0,"1f64b-1f3fc":0,"1f64b-1f3fd":0,"1f64b-1f3fe":0,"1f64b-1f3ff":0,"1f64c-1f3fb":0,"1f64c-1f3fc":0,"1f64c-1f3fd":0,"1f64c-1f3fe":0,"1f64c-1f3ff":0,"1f64d-1f3fb-200d-2640":0,"1f64d-1f3fc-200d-2640":0,"1f64d-1f3fd-200d-2640":0,"1f64d-1f3fe-200d-2640":0,"1f64d-1f3ff-200d-2640":0,"1f64d-1f3fb-200d-2642":0,"1f64d-1f3fc-200d-2642":0,"1f64d-1f3fd-200d-2642":0,"1f64d-1f3fe-200d-2642":0,"1f64d-1f3ff-200d-2642":0,"1f64d-1f3fb":0,"1f64d-1f3fc":0,"1f64d-1f3fd":0,"1f64d-1f3fe":0,"1f64d-1f3ff":0,"1f64e-1f3fb-200d-2640":0,"1f64e-1f3fc-200d-2640":0,"1f64e-1f3fd-200d-2640":0,"1f64e-1f3fe-200d-2640":0,"1f64e-1f3ff-200d-2640":0,"1f64e-1f3fb-200d-2642":0,"1f64e-1f3fc-200d-2642":0,"1f64e-1f3fd-200d-2642":0,"1f64e-1f3fe-200d-2642":0,"1f64e-1f3ff-200d-2642":0,"1f64e-1f3fb":0,"1f64e-1f3fc":0,"1f64e-1f3fd":0,"1f64e-1f3fe":0,"1f64e-1f3ff":0,"1f64f-1f3fb":0,"1f64f-1f3fc":0,"1f64f-1f3fd":0,"1f64f-1f3fe":0,"1f64f-1f3ff":0,"1f6a3-1f3fb-200d-2640":0,"1f6a3-1f3fc-200d-2640":0,"1f6a3-1f3fd-200d-2640":0,"1f6a3-1f3fe-200d-2640":0,"1f6a3-1f3ff-200d-2640":0,"1f6a3-1f3fb-200d-2642":0,"1f6a3-1f3fc-200d-2642":0,"1f6a3-1f3fd-200d-2642":0,"1f6a3-1f3fe-200d-2642":0,"1f6a3-1f3ff-200d-2642":0,"1f6a3-1f3fb":0,"1f6a3-1f3fc":0,"1f6a3-1f3fd":0,"1f6a3-1f3fe":0,"1f6a3-1f3ff":0,"1f6b4-1f3fb-200d-2640":0,"1f6b4-1f3fc-200d-2640":0,"1f6b4-1f3fd-200d-2640":0,"1f6b4-1f3fe-200d-2640":0,"1f6b4-1f3ff-200d-2640":0,"1f6b4-1f3fb-200d-2642":0,"1f6b4-1f3fc-200d-2642":0,"1f6b4-1f3fd-200d-2642":0,"1f6b4-1f3fe-200d-2642":0,"1f6b4-1f3ff-200d-2642":0,"1f6b4-1f3fb":0,"1f6b4-1f3fc":0,"1f6b4-1f3fd":0,"1f6b4-1f3fe":0,"1f6b4-1f3ff":0,"1f6b5-1f3fb-200d-2640":0,"1f6b5-1f3fc-200d-2640":0,"1f6b5-1f3fd-200d-2640":0,"1f6b5-1f3fe-200d-2640":0,"1f6b5-1f3ff-200d-2640":0,"1f6b5-1f3fb-200d-2642":0,"1f6b5-1f3fc-200d-2642":0,"1f6b5-1f3fd-200d-2642":0,"1f6b5-1f3fe-200d-2642":0,"1f6b5-1f3ff-200d-2642":0,"1f6b5-1f3fb":0,"1f6b5-1f3fc":0,"1f6b5-1f3fd":0,"1f6b5-1f3fe":0,"1f6b5-1f3ff":0,"1f6b6-1f3fb-200d-2640":0,"1f6b6-1f3fc-200d-2640":0,"1f6b6-1f3fd-200d-2640":0,"1f6b6-1f3fe-200d-2640":0,"1f6b6-1f3ff-200d-2640":0,"1f6b6-1f3fb-200d-2642":0,"1f6b6-1f3fc-200d-2642":0,"1f6b6-1f3fd-200d-2642":0,"1f6b6-1f3fe-200d-2642":0,"1f6b6-1f3ff-200d-2642":0,"1f6b6-1f3fb":0,"1f6b6-1f3fc":0,"1f6b6-1f3fd":0,"1f6b6-1f3fe":0,"1f6b6-1f3ff":0,"1f6c0-1f3fb":0,"1f6c0-1f3fc":0,"1f6c0-1f3fd":0,"1f6c0-1f3fe":0,"1f6c0-1f3ff":0,"1f6cc-1f3fb":0,"1f6cc-1f3fc":0,"1f6cc-1f3fd":0,"1f6cc-1f3fe":0,"1f6cc-1f3ff":0,"1f90c-1f3fb":0,"1f90c-1f3fc":0,"1f90c-1f3fd":0,"1f90c-1f3fe":0,"1f90c-1f3ff":0,"1f90f-1f3fb":0,"1f90f-1f3fc":0,"1f90f-1f3fd":0,"1f90f-1f3fe":0,"1f90f-1f3ff":0,"1f918-1f3fb":0,"1f918-1f3fc":0,"1f918-1f3fd":0,"1f918-1f3fe":0,"1f918-1f3ff":0,"1f919-1f3fb":0,"1f919-1f3fc":0,"1f919-1f3fd":0,"1f919-1f3fe":0,"1f919-1f3ff":0,"1f91a-1f3fb":0,"1f91a-1f3fc":0,"1f91a-1f3fd":0,"1f91a-1f3fe":0,"1f91a-1f3ff":0,"1f91b-1f3fb":0,"1f91b-1f3fc":0,"1f91b-1f3fd":0,"1f91b-1f3fe":0,"1f91b-1f3ff":0,"1f91c-1f3fb":0,"1f91c-1f3fc":0,"1f91c-1f3fd":0,"1f91c-1f3fe":0,"1f91c-1f3ff":0,"1f91d-1f3fb":0,"1f91d-1f3fc":0,"1f91d-1f3fd":0,"1f91d-1f3fe":0,"1f91d-1f3ff":0,"1f91e-1f3fb":0,"1f91e-1f3fc":0,"1f91e-1f3fd":0,"1f91e-1f3fe":0,"1f91e-1f3ff":0,"1f91f-1f3fb":0,"1f91f-1f3fc":0,"1f91f-1f3fd":0,"1f91f-1f3fe":0,"1f91f-1f3ff":0,"1f926-1f3fb-200d-2640":0,"1f926-1f3fc-200d-2640":0,"1f926-1f3fd-200d-2640":0,"1f926-1f3fe-200d-2640":0,"1f926-1f3ff-200d-2640":0,"1f926-1f3fb-200d-2642":0,"1f926-1f3fc-200d-2642":0,"1f926-1f3fd-200d-2642":0,"1f926-1f3fe-200d-2642":0,"1f926-1f3ff-200d-2642":0,"1f926-1f3fb":0,"1f926-1f3fc":0,"1f926-1f3fd":0,"1f926-1f3fe":0,"1f926-1f3ff":0,"1f930-1f3fb":0,"1f930-1f3fc":0,"1f930-1f3fd":0,"1f930-1f3fe":0,"1f930-1f3ff":0,"1f931-1f3fb":0,"1f931-1f3fc":0,"1f931-1f3fd":0,"1f931-1f3fe":0,"1f931-1f3ff":0,"1f932-1f3fb":0,"1f932-1f3fc":0,"1f932-1f3fd":0,"1f932-1f3fe":0,"1f932-1f3ff":0,"1f933-1f3fb":0,"1f933-1f3fc":0,"1f933-1f3fd":0,"1f933-1f3fe":0,"1f933-1f3ff":0,"1f934-1f3fb":0,"1f934-1f3fc":0,"1f934-1f3fd":0,"1f934-1f3fe":0,"1f934-1f3ff":0,"1f935-1f3fb-200d-2640":0,"1f935-1f3fc-200d-2640":0,"1f935-1f3fd-200d-2640":0,"1f935-1f3fe-200d-2640":0,"1f935-1f3ff-200d-2640":0,"1f935-1f3fb-200d-2642":0,"1f935-1f3fc-200d-2642":0,"1f935-1f3fd-200d-2642":0,"1f935-1f3fe-200d-2642":0,"1f935-1f3ff-200d-2642":0,"1f935-1f3fb":0,"1f935-1f3fc":0,"1f935-1f3fd":0,"1f935-1f3fe":0,"1f935-1f3ff":0,"1f936-1f3fb":0,"1f936-1f3fc":0,"1f936-1f3fd":0,"1f936-1f3fe":0,"1f936-1f3ff":0,"1f937-1f3fb-200d-2640":0,"1f937-1f3fc-200d-2640":0,"1f937-1f3fd-200d-2640":0,"1f937-1f3fe-200d-2640":0,"1f937-1f3ff-200d-2640":0,"1f937-1f3fb-200d-2642":0,"1f937-1f3fc-200d-2642":0,"1f937-1f3fd-200d-2642":0,"1f937-1f3fe-200d-2642":0,"1f937-1f3ff-200d-2642":0,"1f937-1f3fb":0,"1f937-1f3fc":0,"1f937-1f3fd":0,"1f937-1f3fe":0,"1f937-1f3ff":0,"1f938-1f3fb-200d-2640":0,"1f938-1f3fc-200d-2640":0,"1f938-1f3fd-200d-2640":0,"1f938-1f3fe-200d-2640":0,"1f938-1f3ff-200d-2640":0,"1f938-1f3fb-200d-2642":0,"1f938-1f3fc-200d-2642":0,"1f938-1f3fd-200d-2642":0,"1f938-1f3fe-200d-2642":0,"1f938-1f3ff-200d-2642":0,"1f938-1f3fb":0,"1f938-1f3fc":0,"1f938-1f3fd":0,"1f938-1f3fe":0,"1f938-1f3ff":0,"1f939-1f3fb-200d-2640":0,"1f939-1f3fc-200d-2640":0,"1f939-1f3fd-200d-2640":0,"1f939-1f3fe-200d-2640":0,"1f939-1f3ff-200d-2640":0,"1f939-1f3fb-200d-2642":0,"1f939-1f3fc-200d-2642":0,"1f939-1f3fd-200d-2642":0,"1f939-1f3fe-200d-2642":0,"1f939-1f3ff-200d-2642":0,"1f939-1f3fb":0,"1f939-1f3fc":0,"1f939-1f3fd":0,"1f939-1f3fe":0,"1f939-1f3ff":0,"1f93d-1f3fb-200d-2640":0,"1f93d-1f3fc-200d-2640":0,"1f93d-1f3fd-200d-2640":0,"1f93d-1f3fe-200d-2640":0,"1f93d-1f3ff-200d-2640":0,"1f93d-1f3fb-200d-2642":0,"1f93d-1f3fc-200d-2642":0,"1f93d-1f3fd-200d-2642":0,"1f93d-1f3fe-200d-2642":0,"1f93d-1f3ff-200d-2642":0,"1f93d-1f3fb":0,"1f93d-1f3fc":0,"1f93d-1f3fd":0,"1f93d-1f3fe":0,"1f93d-1f3ff":0,"1f93e-1f3fb-200d-2640":0,"1f93e-1f3fc-200d-2640":0,"1f93e-1f3fd-200d-2640":0,"1f93e-1f3fe-200d-2640":0,"1f93e-1f3ff-200d-2640":0,"1f93e-1f3fb-200d-2642":0,"1f93e-1f3fc-200d-2642":0,"1f93e-1f3fd-200d-2642":0,"1f93e-1f3fe-200d-2642":0,"1f93e-1f3ff-200d-2642":0,"1f93e-1f3fb":0,"1f93e-1f3fc":0,"1f93e-1f3fd":0,"1f93e-1f3fe":0,"1f93e-1f3ff":0,"1f977-1f3fb":0,"1f977-1f3fc":0,"1f977-1f3fd":0,"1f977-1f3fe":0,"1f977-1f3ff":0,"1f9b5-1f3fb":0,"1f9b5-1f3fc":0,"1f9b5-1f3fd":0,"1f9b5-1f3fe":0,"1f9b5-1f3ff":0,"1f9b6-1f3fb":0,"1f9b6-1f3fc":0,"1f9b6-1f3fd":0,"1f9b6-1f3fe":0,"1f9b6-1f3ff":0,"1f9b8-1f3fb-200d-2640":0,"1f9b8-1f3fc-200d-2640":0,"1f9b8-1f3fd-200d-2640":0,"1f9b8-1f3fe-200d-2640":0,"1f9b8-1f3ff-200d-2640":0,"1f9b8-1f3fb-200d-2642":0,"1f9b8-1f3fc-200d-2642":0,"1f9b8-1f3fd-200d-2642":0,"1f9b8-1f3fe-200d-2642":0,"1f9b8-1f3ff-200d-2642":0,"1f9b8-1f3fb":0,"1f9b8-1f3fc":0,"1f9b8-1f3fd":0,"1f9b8-1f3fe":0,"1f9b8-1f3ff":0,"1f9b9-1f3fb-200d-2640":0,"1f9b9-1f3fc-200d-2640":0,"1f9b9-1f3fd-200d-2640":0,"1f9b9-1f3fe-200d-2640":0,"1f9b9-1f3ff-200d-2640":0,"1f9b9-1f3fb-200d-2642":0,"1f9b9-1f3fc-200d-2642":0,"1f9b9-1f3fd-200d-2642":0,"1f9b9-1f3fe-200d-2642":0,"1f9b9-1f3ff-200d-2642":0,"1f9b9-1f3fb":0,"1f9b9-1f3fc":0,"1f9b9-1f3fd":0,"1f9b9-1f3fe":0,"1f9b9-1f3ff":0,"1f9bb-1f3fb":0,"1f9bb-1f3fc":0,"1f9bb-1f3fd":0,"1f9bb-1f3fe":0,"1f9bb-1f3ff":0,"1f9cd-1f3fb-200d-2640":0,"1f9cd-1f3fc-200d-2640":0,"1f9cd-1f3fd-200d-2640":0,"1f9cd-1f3fe-200d-2640":0,"1f9cd-1f3ff-200d-2640":0,"1f9cd-1f3fb-200d-2642":0,"1f9cd-1f3fc-200d-2642":0,"1f9cd-1f3fd-200d-2642":0,"1f9cd-1f3fe-200d-2642":0,"1f9cd-1f3ff-200d-2642":0,"1f9cd-1f3fb":0,"1f9cd-1f3fc":0,"1f9cd-1f3fd":0,"1f9cd-1f3fe":0,"1f9cd-1f3ff":0,"1f9ce-1f3fb-200d-2640":0,"1f9ce-1f3fc-200d-2640":0,"1f9ce-1f3fd-200d-2640":0,"1f9ce-1f3fe-200d-2640":0,"1f9ce-1f3ff-200d-2640":0,"1f9ce-1f3fb-200d-2642":0,"1f9ce-1f3fc-200d-2642":0,"1f9ce-1f3fd-200d-2642":0,"1f9ce-1f3fe-200d-2642":0,"1f9ce-1f3ff-200d-2642":0,"1f9ce-1f3fb":0,"1f9ce-1f3fc":0,"1f9ce-1f3fd":0,"1f9ce-1f3fe":0,"1f9ce-1f3ff":0,"1f9cf-1f3fb-200d-2640":0,"1f9cf-1f3fc-200d-2640":0,"1f9cf-1f3fd-200d-2640":0,"1f9cf-1f3fe-200d-2640":0,"1f9cf-1f3ff-200d-2640":0,"1f9cf-1f3fb-200d-2642":0,"1f9cf-1f3fc-200d-2642":0,"1f9cf-1f3fd-200d-2642":0,"1f9cf-1f3fe-200d-2642":0,"1f9cf-1f3ff-200d-2642":0,"1f9cf-1f3fb":0,"1f9cf-1f3fc":0,"1f9cf-1f3fd":0,"1f9cf-1f3fe":0,"1f9cf-1f3ff":0,"1f9d1-1f3fb-200d-1f33e":0,"1f9d1-1f3fc-200d-1f33e":0,"1f9d1-1f3fd-200d-1f33e":0,"1f9d1-1f3fe-200d-1f33e":0,"1f9d1-1f3ff-200d-1f33e":0,"1f9d1-1f3fb-200d-1f373":0,"1f9d1-1f3fc-200d-1f373":0,"1f9d1-1f3fd-200d-1f373":0,"1f9d1-1f3fe-200d-1f373":0,"1f9d1-1f3ff-200d-1f373":0,"1f9d1-1f3fb-200d-1f37c":0,"1f9d1-1f3fc-200d-1f37c":0,"1f9d1-1f3fd-200d-1f37c":0,"1f9d1-1f3fe-200d-1f37c":0,"1f9d1-1f3ff-200d-1f37c":0,"1f9d1-1f3fb-200d-1f384":0,"1f9d1-1f3fc-200d-1f384":0,"1f9d1-1f3fd-200d-1f384":0,"1f9d1-1f3fe-200d-1f384":0,"1f9d1-1f3ff-200d-1f384":0,"1f9d1-1f3fb-200d-1f393":0,"1f9d1-1f3fc-200d-1f393":0,"1f9d1-1f3fd-200d-1f393":0,"1f9d1-1f3fe-200d-1f393":0,"1f9d1-1f3ff-200d-1f393":0,"1f9d1-1f3fb-200d-1f3a4":0,"1f9d1-1f3fc-200d-1f3a4":0,"1f9d1-1f3fd-200d-1f3a4":0,"1f9d1-1f3fe-200d-1f3a4":0,"1f9d1-1f3ff-200d-1f3a4":0,"1f9d1-1f3fb-200d-1f3a8":0,"1f9d1-1f3fc-200d-1f3a8":0,"1f9d1-1f3fd-200d-1f3a8":0,"1f9d1-1f3fe-200d-1f3a8":0,"1f9d1-1f3ff-200d-1f3a8":0,"1f9d1-1f3fb-200d-1f3eb":0,"1f9d1-1f3fc-200d-1f3eb":0,"1f9d1-1f3fd-200d-1f3eb":0,"1f9d1-1f3fe-200d-1f3eb":0,"1f9d1-1f3ff-200d-1f3eb":0,"1f9d1-1f3fb-200d-1f3ed":0,"1f9d1-1f3fc-200d-1f3ed":0,"1f9d1-1f3fd-200d-1f3ed":0,"1f9d1-1f3fe-200d-1f3ed":0,"1f9d1-1f3ff-200d-1f3ed":0,"1f9d1-1f3fb-200d-1f4bb":0,"1f9d1-1f3fc-200d-1f4bb":0,"1f9d1-1f3fd-200d-1f4bb":0,"1f9d1-1f3fe-200d-1f4bb":0,"1f9d1-1f3ff-200d-1f4bb":0,"1f9d1-1f3fb-200d-1f4bc":0,"1f9d1-1f3fc-200d-1f4bc":0,"1f9d1-1f3fd-200d-1f4bc":0,"1f9d1-1f3fe-200d-1f4bc":0,"1f9d1-1f3ff-200d-1f4bc":0,"1f9d1-1f3fb-200d-1f527":0,"1f9d1-1f3fc-200d-1f527":0,"1f9d1-1f3fd-200d-1f527":0,"1f9d1-1f3fe-200d-1f527":0,"1f9d1-1f3ff-200d-1f527":0,"1f9d1-1f3fb-200d-1f52c":0,"1f9d1-1f3fc-200d-1f52c":0,"1f9d1-1f3fd-200d-1f52c":0,"1f9d1-1f3fe-200d-1f52c":0,"1f9d1-1f3ff-200d-1f52c":0,"1f9d1-1f3fb-200d-1f680":0,"1f9d1-1f3fc-200d-1f680":0,"1f9d1-1f3fd-200d-1f680":0,"1f9d1-1f3fe-200d-1f680":0,"1f9d1-1f3ff-200d-1f680":0,"1f9d1-1f3fb-200d-1f692":0,"1f9d1-1f3fc-200d-1f692":0,"1f9d1-1f3fd-200d-1f692":0,"1f9d1-1f3fe-200d-1f692":0,"1f9d1-1f3ff-200d-1f692":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fb-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fc-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fd-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3fe-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fb":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fc":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fd":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3fe":0,"1f9d1-1f3ff-200d-1f91d-200d-1f9d1-1f3ff":0,"1f9d1-1f3fb-200d-1f9af":0,"1f9d1-1f3fc-200d-1f9af":0,"1f9d1-1f3fd-200d-1f9af":0,"1f9d1-1f3fe-200d-1f9af":0,"1f9d1-1f3ff-200d-1f9af":0,"1f9d1-1f3fb-200d-1f9b0":0,"1f9d1-1f3fc-200d-1f9b0":0,"1f9d1-1f3fd-200d-1f9b0":0,"1f9d1-1f3fe-200d-1f9b0":0,"1f9d1-1f3ff-200d-1f9b0":0,"1f9d1-1f3fb-200d-1f9b1":0,"1f9d1-1f3fc-200d-1f9b1":0,"1f9d1-1f3fd-200d-1f9b1":0,"1f9d1-1f3fe-200d-1f9b1":0,"1f9d1-1f3ff-200d-1f9b1":0,"1f9d1-1f3fb-200d-1f9b2":0,"1f9d1-1f3fc-200d-1f9b2":0,"1f9d1-1f3fd-200d-1f9b2":0,"1f9d1-1f3fe-200d-1f9b2":0,"1f9d1-1f3ff-200d-1f9b2":0,"1f9d1-1f3fb-200d-1f9b3":0,"1f9d1-1f3fc-200d-1f9b3":0,"1f9d1-1f3fd-200d-1f9b3":0,"1f9d1-1f3fe-200d-1f9b3":0,"1f9d1-1f3ff-200d-1f9b3":0,"1f9d1-1f3fb-200d-1f9bc":0,"1f9d1-1f3fc-200d-1f9bc":0,"1f9d1-1f3fd-200d-1f9bc":0,"1f9d1-1f3fe-200d-1f9bc":0,"1f9d1-1f3ff-200d-1f9bc":0,"1f9d1-1f3fb-200d-1f9bd":0,"1f9d1-1f3fc-200d-1f9bd":0,"1f9d1-1f3fd-200d-1f9bd":0,"1f9d1-1f3fe-200d-1f9bd":0,"1f9d1-1f3ff-200d-1f9bd":0,"1f9d1-1f3fb-200d-2695":0,"1f9d1-1f3fc-200d-2695":0,"1f9d1-1f3fd-200d-2695":0,"1f9d1-1f3fe-200d-2695":0,"1f9d1-1f3ff-200d-2695":0,"1f9d1-1f3fb-200d-2696":0,"1f9d1-1f3fc-200d-2696":0,"1f9d1-1f3fd-200d-2696":0,"1f9d1-1f3fe-200d-2696":0,"1f9d1-1f3ff-200d-2696":0,"1f9d1-1f3fb-200d-2708":0,"1f9d1-1f3fc-200d-2708":0,"1f9d1-1f3fd-200d-2708":0,"1f9d1-1f3fe-200d-2708":0,"1f9d1-1f3ff-200d-2708":0,"1f9d1-1f3fb":0,"1f9d1-1f3fc":0,"1f9d1-1f3fd":0,"1f9d1-1f3fe":0,"1f9d1-1f3ff":0,"1f9d2-1f3fb":0,"1f9d2-1f3fc":0,"1f9d2-1f3fd":0,"1f9d2-1f3fe":0,"1f9d2-1f3ff":0,"1f9d3-1f3fb":0,"1f9d3-1f3fc":0,"1f9d3-1f3fd":0,"1f9d3-1f3fe":0,"1f9d3-1f3ff":0,"1f9d4-1f3fb-200d-2640":0,"1f9d4-1f3fc-200d-2640":0,"1f9d4-1f3fd-200d-2640":0,"1f9d4-1f3fe-200d-2640":0,"1f9d4-1f3ff-200d-2640":0,"1f9d4-1f3fb-200d-2642":0,"1f9d4-1f3fc-200d-2642":0,"1f9d4-1f3fd-200d-2642":0,"1f9d4-1f3fe-200d-2642":0,"1f9d4-1f3ff-200d-2642":0,"1f9d4-1f3fb":0,"1f9d4-1f3fc":0,"1f9d4-1f3fd":0,"1f9d4-1f3fe":0,"1f9d4-1f3ff":0,"1f9d5-1f3fb":0,"1f9d5-1f3fc":0,"1f9d5-1f3fd":0,"1f9d5-1f3fe":0,"1f9d5-1f3ff":0,"1f9d6-1f3fb-200d-2640":0,"1f9d6-1f3fc-200d-2640":0,"1f9d6-1f3fd-200d-2640":0,"1f9d6-1f3fe-200d-2640":0,"1f9d6-1f3ff-200d-2640":0,"1f9d6-1f3fb-200d-2642":0,"1f9d6-1f3fc-200d-2642":0,"1f9d6-1f3fd-200d-2642":0,"1f9d6-1f3fe-200d-2642":0,"1f9d6-1f3ff-200d-2642":0,"1f9d6-1f3fb":0,"1f9d6-1f3fc":0,"1f9d6-1f3fd":0,"1f9d6-1f3fe":0,"1f9d6-1f3ff":0,"1f9d7-1f3fb-200d-2640":0,"1f9d7-1f3fc-200d-2640":0,"1f9d7-1f3fd-200d-2640":0,"1f9d7-1f3fe-200d-2640":0,"1f9d7-1f3ff-200d-2640":0,"1f9d7-1f3fb-200d-2642":0,"1f9d7-1f3fc-200d-2642":0,"1f9d7-1f3fd-200d-2642":0,"1f9d7-1f3fe-200d-2642":0,"1f9d7-1f3ff-200d-2642":0,"1f9d7-1f3fb":0,"1f9d7-1f3fc":0,"1f9d7-1f3fd":0,"1f9d7-1f3fe":0,"1f9d7-1f3ff":0,"1f9d8-1f3fb-200d-2640":0,"1f9d8-1f3fc-200d-2640":0,"1f9d8-1f3fd-200d-2640":0,"1f9d8-1f3fe-200d-2640":0,"1f9d8-1f3ff-200d-2640":0,"1f9d8-1f3fb-200d-2642":0,"1f9d8-1f3fc-200d-2642":0,"1f9d8-1f3fd-200d-2642":0,"1f9d8-1f3fe-200d-2642":0,"1f9d8-1f3ff-200d-2642":0,"1f9d8-1f3fb":0,"1f9d8-1f3fc":0,"1f9d8-1f3fd":0,"1f9d8-1f3fe":0,"1f9d8-1f3ff":0,"1f9d9-1f3fb-200d-2640":0,"1f9d9-1f3fc-200d-2640":0,"1f9d9-1f3fd-200d-2640":0,"1f9d9-1f3fe-200d-2640":0,"1f9d9-1f3ff-200d-2640":0,"1f9d9-1f3fb-200d-2642":0,"1f9d9-1f3fc-200d-2642":0,"1f9d9-1f3fd-200d-2642":0,"1f9d9-1f3fe-200d-2642":0,"1f9d9-1f3ff-200d-2642":0,"1f9d9-1f3fb":0,"1f9d9-1f3fc":0,"1f9d9-1f3fd":0,"1f9d9-1f3fe":0,"1f9d9-1f3ff":0,"1f9da-1f3fb-200d-2640":0,"1f9da-1f3fc-200d-2640":0,"1f9da-1f3fd-200d-2640":0,"1f9da-1f3fe-200d-2640":0,"1f9da-1f3ff-200d-2640":0,"1f9da-1f3fb-200d-2642":0,"1f9da-1f3fc-200d-2642":0,"1f9da-1f3fd-200d-2642":0,"1f9da-1f3fe-200d-2642":0,"1f9da-1f3ff-200d-2642":0,"1f9da-1f3fb":0,"1f9da-1f3fc":0,"1f9da-1f3fd":0,"1f9da-1f3fe":0,"1f9da-1f3ff":0,"1f9db-1f3fb-200d-2640":0,"1f9db-1f3fc-200d-2640":0,"1f9db-1f3fd-200d-2640":0,"1f9db-1f3fe-200d-2640":0,"1f9db-1f3ff-200d-2640":0,"1f9db-1f3fb-200d-2642":0,"1f9db-1f3fc-200d-2642":0,"1f9db-1f3fd-200d-2642":0,"1f9db-1f3fe-200d-2642":0,"1f9db-1f3ff-200d-2642":0,"1f9db-1f3fb":0,"1f9db-1f3fc":0,"1f9db-1f3fd":0,"1f9db-1f3fe":0,"1f9db-1f3ff":0,"1f9dc-1f3fb-200d-2640":0,"1f9dc-1f3fc-200d-2640":0,"1f9dc-1f3fd-200d-2640":0,"1f9dc-1f3fe-200d-2640":0,"1f9dc-1f3ff-200d-2640":0,"1f9dc-1f3fb-200d-2642":0,"1f9dc-1f3fc-200d-2642":0,"1f9dc-1f3fd-200d-2642":0,"1f9dc-1f3fe-200d-2642":0,"1f9dc-1f3ff-200d-2642":0,"1f9dc-1f3fb":0,"1f9dc-1f3fc":0,"1f9dc-1f3fd":0,"1f9dc-1f3fe":0,"1f9dc-1f3ff":0,"1f9dd-1f3fb-200d-2640":0,"1f9dd-1f3fc-200d-2640":0,"1f9dd-1f3fd-200d-2640":0,"1f9dd-1f3fe-200d-2640":0,"1f9dd-1f3ff-200d-2640":0,"1f9dd-1f3fb-200d-2642":0,"1f9dd-1f3fc-200d-2642":0,"1f9dd-1f3fd-200d-2642":0,"1f9dd-1f3fe-200d-2642":0,"1f9dd-1f3ff-200d-2642":0,"1f9dd-1f3fb":0,"1f9dd-1f3fc":0,"1f9dd-1f3fd":0,"1f9dd-1f3fe":0,"1f9dd-1f3ff":0,"261d-1f3fb":0,"261d-1f3fc":0,"261d-1f3fd":0,"261d-1f3fe":0,"261d-1f3ff":0,"26f9-1f3fb-200d-2640":0,"26f9-1f3fc-200d-2640":0,"26f9-1f3fd-200d-2640":0,"26f9-1f3fe-200d-2640":0,"26f9-1f3ff-200d-2640":0,"26f9-1f3fb-200d-2642":0,"26f9-1f3fc-200d-2642":0,"26f9-1f3fd-200d-2642":0,"26f9-1f3fe-200d-2642":0,"26f9-1f3ff-200d-2642":0,"26f9-1f3fb":0,"26f9-1f3fc":0,"26f9-1f3fd":0,"26f9-1f3fe":0,"26f9-1f3ff":0,"270a-1f3fb":0,"270a-1f3fc":0,"270a-1f3fd":0,"270a-1f3fe":0,"270a-1f3ff":0,"270b-1f3fb":0,"270b-1f3fc":0,"270b-1f3fd":0,"270b-1f3fe":0,"270b-1f3ff":0,"270c-1f3fb":0,"270c-1f3fc":0,"270c-1f3fd":0,"270c-1f3fe":0,"270c-1f3ff":0,"270d-1f3fb":0,"270d-1f3fc":0,"270d-1f3fd":0,"270d-1f3fe":0,"270d-1f3ff":0}},wi=Bs[""];for(const o in Bs)o&&Object.assign(wi,Bs[o]);function Ip(o){return Ap(kp(o)).join("-")}const Dp=/\uFE0F/g,wp="",kp=o=>o.indexOf(wp)<0?o.replace(Dp,""):o;function Ap(o){const e=[];let t=0,a=0,s=0;for(;s<o.length;)t=o.charCodeAt(s++),a?(e.push((65536+(a-55296<<10)+(t-56320)).toString(16)),a=0):t>55296&&t<=56319?a=t:e.push(t.toString(16));return e.length&&e[0].length===2&&(e[0]="00"+e[0]),e}function Fp(o){const e=Ip(o).replace(/-?fe0f/g,"");if(wi.hasOwnProperty(e))return e}function $s(o){let e,t=o;const a=[];let s,n=0;for(fn.lastIndex=0;e=t.match(fn);){if(s=n+e.index,e[3])a.push({_:"messageEntityMention",offset:s+e[1].length,length:e[2].length+e[3].length});else if(e[4])if(ao.test(e[4]))a.push({_:"messageEntityEmail",offset:s,length:e[4].length});else{let i,r=e[5];const p=e[6];if(p){if(!r&&(p.substr(0,4)==="xn--"||bp.indexOf(p.toLowerCase())!==-1)&&(r="http://"),r){const d=Cp(e[4]);d.length!==e[4].length&&(e[4]=d),i=(e[5]?"":r)+e[4]}}else i=(e[5]?"":"http://")+e[4];i&&a.push({_:"messageEntityUrl",offset:s,length:e[4].length})}else if(e[7])a.push({_:"messageEntityLinebreak",offset:s,length:1});else if(e[8]){const i=Fp(e[8]);i&&a.push({_:"messageEntityEmoji",offset:s,length:e[8].length,unicode:i})}else if(e[11])a.push({_:"messageEntityHashtag",offset:s+(e[10]?e[10].length:0),length:e[11].length});else if(e[13])a.push({_:"messageEntityBotCommand",offset:s+(e[11]?e[11].length:0)+(e[12]?e[12].length:0),length:1+e[13].length+(e[14]?1+e[14].length:0),unsafe:!0});else if(e[16]){const i=e[16],r=i.split(":"),p=r.length,d=p===3?+r[0]:0,f=+r[p===3?1:0],c=+r[p-1];a.push({_:"messageEntityTimestamp",offset:s+(/\D/.test(e[0][0])?1:0),length:i.length,raw:i,time:d*3600+f*60+c})}t=t.substr(e.index+e[0].length),n+=e.index+e[0].length}return a}function Mn(o,e=[]){o=Xt(o,e);const t=$s(o),a=ei(e,t);return{message:o,entities:e,myEntities:t,totalEntities:a}}function vn(o){if(o.inputFilter||o.savedReaction||o.query||o.isPublicHashtag)return o.isCacheableSearch?"cached":o.query||!o.peerId||o.fromPeerId?"uncached":"cached"}function Sn(o){const{type:e,peerId:t,threadId:a}=o,s=ki(o);return[e,t,s,a].filter(Boolean).join("_")}function ki({inputFilter:o,savedReaction:e,query:t,hashtagType:a}){let s;return e&&(s=`tag-${e.map(r=>r.document_id||r.emoticon).join(",")}`,o??(o={_:"inputMessagesFilterEmpty"})),[o?._,a!=="this"&&a,t,s].filter(Boolean).join("_")}function Ep(o){return o&&(o.saved_from_name||o.from_name)}function Ss(o){return o[0]}function Up(o){const t=o?.reactions?.recent_reactions;if(!t)return;const a=t.filter(s=>s.pFlags.unread);if(a.length)return a}function Ga(o){if(!o)return!1;const e=o.media?.document;return!!(o.pFlags.media_unread&&o.pFlags.mentioned&&(!e||!["voice","round"].includes(e.type)))}function Tp(o){return!(o?._!=="message"||o.media?.document?.sticker)}const Ha=lt,Rp=o=>{o()};class Bp extends ce{constructor(){super(...arguments),this.pendingByRandomId={},this.pendingByMessageId={},this.pendingAfterMsgs={},this.pendingTopMsgs={},this.tempFinalizeCallbacks={},this.sendSmthLazyLoadQueue=new up(10),this.needSingleMessages=new Map,this.extendedMedia=new Map,this.maxSeenId=0,this.migratedFromTo={},this.migratedToFrom={},this.newDialogsToHandle=new Map,this.newUpdatesAfterReloadToHandle={},this.notificationsToHandle={},this.reloadConversationsPeers=new Map,this.log=We("MESSAGES",ke.Error|ke.Debug|ke.Log|ke.Warn),this.groupedTempId=0,this.mediaTempId=0,this.mediaTempMap={},this.typings={},this.unreadMentions={},this.goToNextMentionPromises={},this.batchUpdates={},this.tempMids={},this.historyMaxIdSubscribed=new Map,this.clear=e=>{this.middleware?this.middleware.clean():(this.middleware=bi(),this.uploadFilePromises={}),this.messagesStorageByPeerId={},this.groupedMessagesStorage={},this.scheduledMessagesStorage={},this.historiesStorage={},this.threadsStorage={},this.searchesStorage={},this.pinnedMessages={},this.threadsServiceMessagesIdsStorage={},this.threadsToReplies={},this.references={},this.dialogsStorage&&this.dialogsStorage.clear(e),this.filtersStorage&&this.filtersStorage.clear(e)},this.handleNewDialogs=()=>{let e=0;const t=new Map,a=s=>{const{peerId:n}=s;this.dialogsStorage.pushDialog({dialog:s}),this.appPeersManager.isChannel(n)||(e=Math.max(e,s.top_message||0));let i=t.get(n);i||t.set(n,i={}),Je(s)?(i.topics??(i.topics=new Map)).set(s.id,s):Ye(s)?(i.saved??(i.saved=new Map)).set(s.savedPeerId,s):i.dialog=s};for(const[s,n]of this.newDialogsToHandle){const i="dialog"in n,{dialog:r,topics:p,saved:d}=n;i&&(r?this.dialogsStorage.getDialogOnly(s)&&a(r):this.reloadConversation(s.toPeerId())),p?.forEach((f,c)=>{f?this.dialogsStorage.getForumTopic(s,c)&&a(f):this.dialogsStorage.getForumTopicById(s,c)}),d?.forEach((f,c)=>{f?this.dialogsStorage.getAnyDialog(s,c)&&a(f):this.dialogsStorage.getSavedDialogById(c)})}e!==0&&this.incrementMaxSeenId(e),this.rootScope.dispatchEvent("dialogs_multiupdate",t),this.newDialogsToHandle.clear()},this.handleNotifications=()=>{we.clearTimeout(this.notificationsHandlePromise),this.notificationsHandlePromise=void 0;for(const e in this.notificationsToHandle){const[t,a]=e.split("_"),s=this.notificationsToHandle[e];this.getNotifyPeerSettings(t.toPeerId(),a?+a:void 0).then(({muted:n,peerTypeNotifySettings:i})=>{const r=s.topMessage;n&&!r.pFlags.mentioned||!r.pFlags.unread||r.pFlags.unread&&this.notifyAboutMessage(r,{fwdCount:s.fwdCount,peerTypeNotifySettings:i})})}this.notificationsToHandle={}},this.onUpdateMessageId=e=>{const t=e.random_id,a=this.pendingByRandomId[t];if(!a)return;const{peerId:s}=a,n=this.appPeersManager.isChannel(s)?s.toChatId():void 0,i=this.appMessagesIdsManager.generateMessageId(e.id,n);this.pendingByMessageId[i]=t},this.onUpdateNewMessage=e=>{var w;const t=e.message,a=this.getMessagePeer(t),s=this.getHistoryMessagesStorage(a),n=e._==="updateNewDiscussionMessage";this.saveMessages([t],{storage:this.createMessageStorage(a,"history")});const i=this.appPeersManager.isForum(a),r=this.getThreadKey(t),p=r?+r.split("_")[1]:void 0,d=this.dialogsStorage.getAnyDialog(a,n?p:void 0);if((!d||this.reloadConversationsPeers.has(a))&&!n){let C=!0;if(a.isAnyChat()&&(C=this.appChatsManager.isInChat(a.toChatId())),C){this.handleNewUpdateAfterReload(a,e);return}}if(p&&!n){const C=this.threadsStorage[a]?.[p],I={_:"updateNewDiscussionMessage",message:t};this.appChatsManager.isForum(a.toChatId())&&!this.dialogsStorage.getForumTopic(a,p)?this.handleNewUpdateAfterReload(a,I,p):a===this.appPeersManager.peerId&&!this.dialogsStorage.getAnyDialog(a,p)?this.handleNewUpdateAfterReload(a,I,p):C&&this.onUpdateNewMessage(I)}if(t._==="messageService"){const{action:C}=t;if(C._==="messageActionPaymentSent"&&t.reply_to){const I=t.reply_to;this.rootScope.dispatchEvent("payment_sent",{peerId:I.reply_to_peer_id?this.appPeersManager.getPeerId(I.reply_to_peer_id):t.peerId,mid:t.reply_to_mid,receiptMessage:t})}if(C._==="messageActionTopicEdit"&&!n){const I=this.dialogsStorage.getForumTopic(a,p);if(!I)this.dialogsStorage.getForumTopicById(a,p);else{const F=it(I);C.title!==void 0&&(I.title=C.title),C.closed!==void 0&&Pn(I.pFlags,"closed",C.closed),C.hidden!==void 0&&Pn(I.pFlags,"hidden",C.hidden),C.icon_emoji_id!==void 0&&(I.icon_emoji_id=C.icon_emoji_id),this.scheduleHandleNewDialogs(a,I),this.dialogsStorage.processTopicUpdate(I,F)}}}this.saveMessages([t],{storage:s}),this.checkPendingMessage(t);const f=this.getHistoryStorage(a,n?p:void 0);n||this.updateMessageRepliesIfNeeded(t,!0);const c=e.ignoreExisting,l=!!f.history.findSlice(t.mid);if(this.updateMessageContextForInserting(t),l){if(!c)return!1}else{const C=f.history.first;if(C.isEnd(Le.Bottom)){let I=0;for(const F=C.length;I<F&&!(t.mid>C[I]);++I);C.splice(I,0,t.mid)}else f.history.unshift(t.mid);f.count!==null&&++f.count}(!f.maxId||t.mid>f.maxId)&&(f.maxId=t.mid),this.mergeReplyKeyboard(f,t)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:a});const m=t.fromId;if(m.isUser()&&!t.pFlags.out&&t.from_id){t.pFlags.offline||this.appUsersManager.forceUserOnline(m,t.date);const C={_:"sendMessageCancelAction"};let I;a.isUser()?I={_:"updateUserTyping",action:C,user_id:m}:this.appPeersManager.isChannel(a)?I={_:"updateChannelUserTyping",action:C,channel_id:a.toChatId(),from_id:this.appPeersManager.getOutputPeer(m),top_msg_id:p?ae(p):void 0}:I={_:"updateChatUserTyping",action:C,chat_id:a.toChatId(),from_id:this.appPeersManager.getOutputPeer(m)},this.apiUpdatesManager.processLocalUpdate(I)}n||this.updateSlowModeOnNewMessage(t),n||this.handleNewMessage(t);const u=Je(d),M=Ye(d);if(n&&!u&&!M||!d)return;const A=!t.pFlags.out&&t.pFlags.unread;{if(A&&t.mid>d.top_message&&!M){const C=this.dialogsStorage.prepareDialogUnreadCountModifying(d);++d.unread_count,Ga(t)&&(++d.unread_mentions_count,this.modifyCachedMentions({peerId:a,mid:t.mid,add:!0,threadId:u?p:void 0})),C()}t.mid>=d.top_message&&this.setDialogTopMessage(t,d)}if((!n&&!i||u)&&A){const C=r||a,I=(w=this.notificationsToHandle)[C]??(w[C]={fwdCount:0,fromId:lt});I.fromId!==m&&(I.fromId=m,I.fwdCount=0),t.fwd_from&&++I.fwdCount,I.topMessage=t,this.notificationsHandlePromise??(this.notificationsHandlePromise=we.setTimeout(this.handleNotifications,0))}},this.onUpdateMessageReactions=e=>{const{peer:t,msg_id:a,top_msg_id:s,reactions:n}=e,i=t.channel_id,r=this.appMessagesIdsManager.generateMessageId(a,i),p=this.appMessagesIdsManager.generateMessageId(s,i),d=this.appPeersManager.getPeerId(t),f=this.getMessageByPeer(d,r);if(f?._!=="message"){this.fixDialogUnreadMentionsIfNoMessage({peerId:d,threadId:p,force:!0});return}const c=C=>{this.modifyCachedMentionsAndSave({peerId:d,mid:f.mid,threadId:p,addReaction:C})},l=n?.recent_reactions,u=f.reactions?.recent_reactions,M=l?.some(C=>C.pFlags.unread),A=!!u?.some(C=>C.pFlags.unread);if(l?.length&&f.pFlags.out){const C=l[l.length-1];this.appPeersManager.getPeerId(C.peer_id)!==this.appPeersManager.peerId&&(!u||u.length<=l.length)&&(!u||!St(C,u[u.length-1]))&&M!==A&&this.getNotifyPeerSettings(d).then(({muted:I,peerTypeNotifySettings:F})=>{F.show_previews&&this.notifyAboutMessage(f,{peerReaction:C,peerTypeNotifySettings:F})})}f.pFlags.out&&M!==A&&c(M);const w=f.peerId+"_"+f.mid;this.pushBatchUpdate("messages_reactions",this.batchUpdateReactions,w,()=>it(f.reactions)),this.modifyMessage(f,C=>{C.reactions=n},void 0,e.local)},this.onUpdateDialogUnreadMark=e=>{const t=this.appPeersManager.getPeerId(e.peer.peer),a=this.getDialogOnly(t);if(!a)this.scheduleHandleNewDialogs(t);else{const s=this.dialogsStorage.prepareDialogUnreadCountModifying(a);e.pFlags.unread?a.pFlags.unread_mark=!0:delete a.pFlags.unread_mark,s(),this.dialogsStorage.setDialogToState(a),this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[t,{dialog:a}]]))}},this.onUpdateEditMessage=e=>{var M,A;const t=e.message,a=this.getMessagePeer(t),s=this.appPeersManager.isChannel(a)?a.toChatId():void 0,n=this.appMessagesIdsManager.generateMessageId(t.id,s),i=this.getHistoryMessagesStorage(a);if(!i.has(n)){this.fixDialogUnreadMentionsIfNoMessage({peerId:a,threadId:Pa(t,this.appPeersManager.isForum(a)),force:!0});return}const r=this.getMessageFromStorage(i,n),p=this.modifyMessage(r,()=>(this.saveMessages([t],{storage:i}),this.getMessageFromStorage(i,n)),!1,!0);this.handleEditedMessage(r,p,i);const d=this.getDialogOnly(a),f=d?.top_message===n;if(t.clear_history){f&&this.rootScope.dispatchEvent("dialog_flush",{peerId:a,dialog:d});return}let c=!0;if(r?._==="message"&&!St(r.reactions,p.reactions)){const w=p.reactions;p.reactions=r.reactions,this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:this.appPeersManager.getOutputPeer(a),msg_id:t.id,reactions:w}),c=!1}c&&this.rootScope.dispatchEvent("message_edit",{storageKey:i.key,peerId:a,mid:n,message:t}),f&&this.dialogsStorage.setDialogToState(d);const l=new Map,m=()=>{let w=l.get(a);return w||l.set(a,w={}),w};(f||t.grouped_id)&&d&&(m().dialog=d);const u=this.getThreadKey(t);if(u){const w=+u.split("_")[1],C=this.dialogsStorage.getAnyDialog(a,w);C&&((M=m())[A=Ye(C)?"saved":"topics"]??(M[A]=new Map)).set(w,C)}l.size&&this.rootScope.dispatchEvent("dialogs_multiupdate",l)},this.onUpdateReadHistory=e=>{const t=e.channel_id,a=this.appMessagesIdsManager.generateMessageId(e.max_id||e.read_max_id,t),s=this.appMessagesIdsManager.generateMessageId(e.top_msg_id,t),n=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),i=e._==="updateReadHistoryOutbox"||e._==="updateReadChannelOutbox"||e._==="updateReadChannelDiscussionOutbox"?!0:void 0,r=t?this.appChatsManager.isForum(t):!1,p=this.getHistoryMessagesStorage(n),d=un(p,"desc"),f=s&&r?this.dialogsStorage.getForumTopic(n,s):this.getDialogOnly(n),c=e.still_unread_count;let l=0,m=0,u=!1;const M=this.getHistoryStorage(n,s);if(n.isUser()&&i&&this.appUsersManager.forceUserOnline(n.toUserId()),s){const C=this.threadsToReplies[n+"_"+s];if(C){const[I,F]=C.split("_");this.updateMessage(I.toPeerId(),+F,"replies_updated")}}const A=f&&this.dialogsStorage.prepareDialogUnreadCountModifying(f),w=this.getReadMaxIdIfUnread(n,s);for(let C=0,I=d.length;C<I;C++){const F=d[C];if(F>a)continue;const L=p.get(F);if(L.pFlags.out!==i)continue;const z=Pa(L,r);if(s&&z!==s)continue;if(!(L.pFlags.unread||w&&w<F))break;this.modifyMessage(L,Z=>{delete Z.pFlags.unread},p,!0),u||(u=!0),!L.pFlags.out&&f&&(c===void 0&&(l=--f.unread_count),Ga(L)&&(m=--f.unread_mentions_count,this.modifyCachedMentions({peerId:n,mid:L.mid,add:!1}))),this.rootScope.dispatchEvent("notification_cancel","msg"+F)}if(i?M.readOutboxMaxId=a:M.readMaxId=a,f){if(i?f.read_outbox_max_id=a:f.read_inbox_max_id=a,!i){let C;c!==void 0?C=c:l<0||a>=f.top_message||!w?C=0:l&&f.top_message>a&&(C=l),C!==void 0&&(f.unread_count=C),(m<0||!f.unread_count)&&(f.unread_mentions_count=0)}A?.(),this.dialogsStorage.processDialogForFilters(f),this.rootScope.dispatchEvent("dialog_unread",{peerId:n,dialog:f}),this.dialogsStorage.setDialogToState(f),!u&&c===void 0&&!i&&f.unread_count&&(Je(f)?this.dialogsStorage.getForumTopicById(n,s):this.reloadConversation(n))}if(u&&this.rootScope.dispatchEvent("messages_read"),!s&&t){const C=n+"_";for(const I in this.threadsToReplies)if(I.indexOf(C)===0){const[F,L]=this.threadsToReplies[I].split("_");this.rootScope.dispatchEvent("replies_updated",this.getMessageByPeer(F.toPeerId(),+L))}}},this.onUpdateReadMessagesContents=e=>{const t=e.channel_id,a=e.top_msg_id,s=a?this.appMessagesIdsManager.generateMessageId(a,t):void 0,n=e.messages.map(r=>this.appMessagesIdsManager.generateMessageId(r,t)),i=t?t.toPeerId(!0):this.findPeerIdByMids(n);for(let r=0,p=n.length;r<p;++r){const d=n[r],f=this.getMessageByPeer(i,d);if(f){if(f.pFlags.media_unread&&(this.modifyMessage(f,c=>{delete c.pFlags.media_unread}),!f.pFlags.out&&Ga(f)&&this.modifyCachedMentionsAndSave({peerId:i,mid:d,addMention:!1})),Up(f)){const c=it(f.reactions);c.recent_reactions.forEach(l=>{delete l.pFlags.unread}),this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:this.appPeersManager.getOutputPeer(i),msg_id:f.id,reactions:c})}}else this.fixDialogUnreadMentionsIfNoMessage({peerId:i,threadId:s}),this.fixDialogUnreadMentionsIfNoMessage({peerId:i,threadId:s,isReaction:!0})}this.rootScope.dispatchEvent("messages_media_read",{peerId:i,mids:n})},this.onUpdateChannelAvailableMessages=e=>{const t=e.channel_id,a=t.toPeerId(!0),s=this.getHistoryStorage(a).history.slice,n=this.appMessagesIdsManager.generateMessageId(e.available_min_id,t),i=s.filter(r=>r<=n);e.messages=i,this.onUpdateDeleteMessages(e)},this.onUpdateDeleteMessages=e=>{const t=e.channel_id,a=e.messages.map(l=>this.appMessagesIdsManager.generateMessageId(l,t)),s=t?t.toPeerId(!0):this.findPeerIdByMids(a);if(!s)return;this.apiManager.clearCache("messages.getSearchCounters",l=>this.appPeersManager.getPeerId(l.peer)===s);const n=new Set,i=new Map;for(const l of a){const m=this.getMessageByPeer(s,l),u=this.getThreadKey(m);if(!u)continue;const M=+u.split("_")[1];if(this.threadsStorage[s]?.[M]){n.add(u);const A=this.dialogsStorage.getAnyDialog(s,M);A&&i.set(M,A)}}const r=this.handleDeletedMessages(s,this.getHistoryMessagesStorage(s),a),p=Array.from(n).map(l=>{const[m,u]=l.split("_");return this.getHistoryStorage(m.toPeerId(),+u)});[this.getHistoryStorage(s),...p].forEach(l=>{for(const m of r.msgs)l.history.delete(m);r.count&&l.count&&(l.count=Math.max(0,l.count-r.count))}),this.rootScope.dispatchEvent("history_delete",{peerId:s,msgs:r.msgs});const f=[...i.values()],c=this.getDialogOnly(s);c&&f.unshift(c),f.forEach(l=>{const m=Je(l),u=Ye(l),M=yt(l),A=!!(r.unreadMentions||r.unread||r.unreadReactions),w=A&&this.dialogsStorage.prepareDialogUnreadCountModifying(l);if(!u&&r.unread&&(l.unread_count=Math.max(0,l.unread_count-r.unread)),!u&&r.unreadMentions&&(l.unread_mentions_count=l.unread_count?Math.max(0,l.unread_mentions_count-r.unreadMentions):0),!u&&r.unreadReactions&&(l.unread_reactions_count=Math.max(0,l.unread_reactions_count-r.unreadReactions)),A&&(w(),u||this.rootScope.dispatchEvent("dialog_unread",{peerId:s,dialog:l})),r.msgs.has(l.top_message)){const I=this.getHistoryStorage(l.peerId,M?void 0:At(l)).history.first;if(I.isEnd(Le.Bottom)&&I.length){const F=I[0],L=this.getMessageByPeer(s,F);this.setDialogTopMessage(L,l)}else m?this.dialogsStorage.getForumTopicById(s,l.id):u?this.dialogsStorage.getSavedDialogById(l.savedPeerId):this.reloadConversation(s)}this.dialogsStorage.setDialogToState(l)})},this.onUpdateChannel=e=>{const t=e.channel_id,a=t.toPeerId(!0),s=this.appChatsManager.getChat(t),n=this.appChatsManager.isInChat(t),i=!!zt(s)[0]||!s.pFlags.left,r=this.historiesStorage[a]!==void 0;i!==r&&(delete this.historiesStorage[a],this.rootScope.dispatchEvent("history_forbidden",a)),!!this.getDialogOnly(a)!==n&&(n?this.reloadConversation(a):this.dialogsStorage.dropDialogOnDeletion(a)),this.rootScope.dispatchEvent("channel_update",t)},this.onUpdateChannelReload=e=>{const t=e.channel_id.toPeerId(!0);this.flushStoragesByPeerId(t),Promise.all([this.reloadConversation(t)]).then(()=>{this.rootScope.dispatchEvent("history_reload",t)})},this.onUpdateChannelMessageViews=e=>{const t=e.views,a=e.channel_id.toPeerId(!0),s=this.appMessagesIdsManager.generateMessageId(e.id,e.channel_id),n=this.getMessageByPeer(a,s);n?.views!==void 0&&n.views<t&&(this.modifyMessage(n,i=>{i.views=t}),this.pushBatchUpdate("messages_views",this.batchUpdateViews,n.peerId+"_"+n.mid))},this.onUpdateServiceNotification=e=>{if(e.pFlags?.popup){this.rootScope.dispatchEvent("service_notification",e);return}const t=As,a=t,s=this.generateTempMessageId(a),n={_:"message",id:s,from_id:this.appPeersManager.getOutputPeer(t),peer_id:this.appPeersManager.getOutputPeer(a),pFlags:{unread:!0},date:(e.inbox_date||Ie(!0))+this.timeManager.getServerTimeOffset(),message:e.message,media:e.media,entities:e.entities};this.appUsersManager.hasUser(t)||this.appUsersManager.saveApiUsers([{_:"user",id:t,pFlags:{verified:!0},access_hash:"0",first_name:"Telegram",phone:"42777"}]),this.saveMessages([n],{isOutgoing:!0}),e.inbox_date&&(this.pendingTopMsgs[a]=s,this.onUpdateNewMessage({_:"updateNewMessage",message:n,pts:void 0,pts_count:void 0}))},this.onUpdatePinnedMessages=e=>{const t=e._==="updatePinnedChannelMessages"?e.channel_id:void 0,a=t?t.toPeerId(!0):this.appPeersManager.getPeerId(e.peer),s=e.messages.map(d=>this.appMessagesIdsManager.generateMessageId(d,t)),n=e.pFlags?.pinned,i=this.getHistoryMessagesStorage(a),r=s.filter(d=>!i.has(d)),p=r.length&&Promise.all(r.map(d=>this.reloadMessages(a,d))).catch(Ge);Ce(p,()=>{let d;n?d=f=>{f.pFlags.pinned=!0}:d=f=>{delete f.pFlags.pinned};for(const f of s){const c=i.get(f);this.modifyMessage(c,l=>{d(l)},i)}delete this.pinnedMessages[this.getPinnedMessagesKey(a)],this.appStateManager.getState().then(f=>{delete f.hiddenPinnedMessages[a],this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:a,mids:s,pinned:n})})})},this.onUpdateNotifySettings=e=>{const{peer:t,notify_settings:a}=e,s=t._==="notifyForumTopic";if(!(t._==="notifyPeer"||s))return;const i=this.appPeersManager.getPeerId(t.peer),r=this.dialogsStorage.getAnyDialog(i,s?this.appMessagesIdsManager.generateMessageId(t.top_msg_id,t.peer.channel_id):void 0);r&&(r.notify_settings=a,this.rootScope.dispatchEvent("dialog_notify_settings",r),this.dialogsStorage.setDialogToState(r))},this.onUpdateNewScheduledMessage=e=>{const t=e.message,a=this.getMessagePeer(t),s=this.scheduledMessagesStorage[a];if(!s)return;const n=this.appPeersManager.isChannel(a)?a.toChatId():void 0,i=this.appMessagesIdsManager.generateMessageId(t.id,n),r=this.getMessageFromStorage(s,i);this.saveMessages([t],{storage:s,isScheduled:!0});const p=this.getMessageFromStorage(s,i);r?(this.handleEditedMessage(r,p,s),this.rootScope.dispatchEvent("message_edit",{storageKey:s.key,peerId:a,mid:t.mid,message:t})):this.checkPendingMessage(t)||this.rootScope.dispatchEvent("scheduled_new",t)},this.onUpdateDeleteScheduledMessages=e=>{const t=e.peer.channel_id,a=this.appPeersManager.getPeerId(e.peer),s=this.scheduledMessagesStorage[a];if(s){const n=e.messages.map(i=>this.appMessagesIdsManager.generateMessageId(i,t));this.handleDeletedMessages(a,s,n),this.rootScope.dispatchEvent("scheduled_delete",{peerId:a,mids:n})}},this.onUpdateMessageExtendedMedia=e=>{const t=e.peer.channel_id,a=this.appPeersManager.getPeerId(e.peer),s=this.appMessagesIdsManager.generateMessageId(e.msg_id,t),n=this.getHistoryMessagesStorage(a);if(!n.has(s))return;const i=this.getMessageFromStorage(n,s),r=i.media,p=r.extended_media,d=Array.isArray(p);(d?p:[p]).some(c=>c?._==="messageExtendedMedia")||(r.extended_media=d?e.extended_media:e.extended_media[0],this.onUpdateEditMessage({_:"updateEditMessage",message:i,pts:0,pts_count:0}))},this.onUpdateTranscribedAudio=e=>{const t=e.peer.channel_id,a=this.appPeersManager.getPeerId(e.peer),s=e.text,n=this.appMessagesIdsManager.generateMessageId(e.msg_id,t);this.rootScope.dispatchEvent("message_transcribed",{peerId:a,mid:n,text:s,pending:e.pFlags.pending})},this.batchUpdateViews=e=>{const t=[],a=this.getMessagesFromMap(e);for(const[s]of a)t.push({peerId:s.peerId,mid:s.mid,views:s.views});return t},this.batchUpdateReactions=e=>{const t=[],a=this.getMessagesFromMap(e);for(const[s,n]of a){const i=s.reactions?.results??[],r=n?.results??[],p=i.filter(f=>{const c=r.find(l=>ut(l.reaction,f.reaction));return s.pFlags.out&&(!c||f.count>c.count)||f.chosen_order!==void 0&&(!c||c.chosen_order===void 0)}),d=r.filter(f=>!i.some(c=>ut(c.reaction,f.reaction)));t.push({message:s,changedResults:p,removedResults:d})}return t},this.processFactCheckBatch=async e=>{for(const[t,a]of e){const s=[...a.keys()].slice(0,100);try{(await this.apiManager.invokeApi("messages.getFactCheck",{peer:this.appPeersManager.getInputPeerById(t),msg_id:s.map(i=>ae(i))})).forEach((i,r)=>{const p=s[r],d=this.getMessageByPeer(t,p);d&&this.modifyMessage(d,c=>{c.factcheck=i}),a.get(p).resolve(i),a.delete(p)})}catch(n){s.forEach(i=>{a.get(i).reject(n),a.delete(i)})}a.size||e.delete(t)}}}after(){return this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateMessageID:this.onUpdateMessageId,updateNewDiscussionMessage:this.onUpdateNewMessage,updateNewMessage:this.onUpdateNewMessage,updateNewChannelMessage:this.onUpdateNewMessage,updateDialogUnreadMark:this.onUpdateDialogUnreadMark,updateEditMessage:this.onUpdateEditMessage,updateEditChannelMessage:this.onUpdateEditMessage,updateMessageReactions:this.onUpdateMessageReactions,updateReadChannelDiscussionInbox:this.onUpdateReadHistory,updateReadChannelDiscussionOutbox:this.onUpdateReadHistory,updateReadHistoryInbox:this.onUpdateReadHistory,updateReadHistoryOutbox:this.onUpdateReadHistory,updateReadChannelInbox:this.onUpdateReadHistory,updateReadChannelOutbox:this.onUpdateReadHistory,updateChannelReadMessagesContents:this.onUpdateReadMessagesContents,updateReadMessagesContents:this.onUpdateReadMessagesContents,updateChannelAvailableMessages:this.onUpdateChannelAvailableMessages,updateDeleteMessages:this.onUpdateDeleteMessages,updateDeleteChannelMessages:this.onUpdateDeleteMessages,updateChannel:this.onUpdateChannel,updateChannelReload:this.onUpdateChannelReload,updateChannelMessageViews:this.onUpdateChannelMessageViews,updateServiceNotification:this.onUpdateServiceNotification,updatePinnedMessages:this.onUpdatePinnedMessages,updatePinnedChannelMessages:this.onUpdatePinnedMessages,updateNotifySettings:this.onUpdateNotifySettings,updateNewScheduledMessage:this.onUpdateNewScheduledMessage,updateDeleteScheduledMessages:this.onUpdateDeleteScheduledMessages,updateMessageExtendedMedia:this.onUpdateMessageExtendedMedia,updateTranscribedAudio:this.onUpdateTranscribedAudio}),this.rootScope.addEventListener("notify_peer_type_settings",({key:e,settings:t})=>{const a=this.dialogsStorage.getFolderDialogs(0).concat(this.dialogsStorage.getFolderDialogs(1));let s;e==="notifyUsers"?s=n=>n.peerId.isUser():e==="notifyBroadcasts"?s=n=>this.appPeersManager.isBroadcast(n.peerId):s=n=>this.appPeersManager.isAnyGroup(n.peerId),a.filter(s).forEach(n=>{this.rootScope.dispatchEvent("dialog_notify_settings",n)})}),this.rootScope.addEventListener("webpage_updated",({id:e,msgs:t})=>{t.forEach(({peerId:a,mid:s,isScheduled:n})=>{const i=n?this.getScheduledMessagesStorage(a):this.getHistoryMessagesStorage(a),r=this.getMessageFromStorage(i,s);r&&(this.modifyMessage(r,p=>{p.media={_:"messageMediaWebPage",pFlags:{},...p.media||{},webpage:this.appWebPagesManager.getCachedWebPage(e)}},i),this.rootScope.dispatchEvent("message_edit",{storageKey:i.key,peerId:a,mid:s,message:r}))})}),this.rootScope.addEventListener("draft_updated",({peerId:e,threadId:t,draft:a})=>{const s=this.dialogsStorage.getAnyDialog(e,t);if(s){s.draft=a;let n=!1;!a&&!ae(s.top_message)?(this.dialogsStorage.dropDialog(e),n=!0):(this.dialogsStorage.generateIndexForDialog(s),this.dialogsStorage.pushDialog({dialog:s})),this.rootScope.dispatchEvent("dialog_draft",{peerId:e,dialog:s,drop:n,draft:a})}else if(t){const n=this.appChatsManager.getChat(e.toChatId());n?n.pFlags.forum&&this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}else this.reloadConversation(e)}),this.rootScope.addEventListener("poll_update",({poll:e})=>{const t=this.appPollsManager.pollToMessages[e.id];if(t)for(const a of t){const[s,n]=a.split("_"),i=this.getMessageByPeer(s.toPeerId(),+n);i&&(this.onMessageModification(i),this.setDialogToStateIfMessageIsTop(i))}}),this.rootScope.addEventListener("chat_toggle_forum",({chatId:e,enabled:t})=>{const a=e.toPeerId(!0);if(!t){delete this.threadsStorage[a];for(const s in this.pinnedMessages)+s===a&&s.startsWith(a+"_")&&delete this.pinnedMessages[s]}}),this.batchUpdatesDebounced=Pp(()=>{for(const e in this.batchUpdates){const t=this.batchUpdates[e];delete this.batchUpdates[e];const a=t.callback(t.batch);a&&(!(a instanceof Array)||a.length)&&rootScope.dispatchEvent(e,a)}},33,!1,!0),this.factCheckBatcher=new xp({processBatch:this.processFactCheckBatch}),this.appStateManager.getState().then(e=>{e.maxSeenMsgId&&(this.maxSeenId=e.maxSeenMsgId)})}getInputEntities(e){const t=it(e);return Et(t,(a,s,n)=>{ro.has(a._)?n.splice(s,1):a._==="messageEntityMentionName"&&(a._="inputMessageEntityMentionName",a.user_id=this.appUsersManager.getUserInput(a.user_id))}),t}invokeAfterMessageIsSent(e,t,a){var i;const s=(i=this.tempFinalizeCallbacks)[e]??(i[e]={}),n=s[t]??(s[t]={deferred:Pe()});return n.callback=a,n.deferred}editMessage(e,t,a={}){const{mid:s,peerId:n}=e;if(e.pFlags.is_outgoing)return this.invokeAfterMessageIsSent(s,"edit",f=>this.editMessage(f,t,a));let i=a.entities||[];t&&([t,i]=oa(t,i));let r=this.getInputEntities(i);r.length||(r=void 0);const p=this.getInputMediaWebPage(a),d=a.scheduleDate||(e.pFlags.is_scheduled?e.date:void 0);return this.apiManager.invokeApi("messages.editMessage",{peer:this.appPeersManager.getInputPeerById(n),id:e.id,message:t,media:a.newMedia,entities:r,no_webpage:a.noWebPage,schedule_date:d,invert_media:a.invertMedia,...p?{media:p}:{}}).then(f=>{this.apiUpdatesManager.processUpdateMessage(f)},f=>{if(this.log.error("editMessage error:",f),f?.type==="MESSAGE_NOT_MODIFIED"){f.handled=!0;return}throw f?.type==="MESSAGE_EMPTY"&&(f.handled=!0),f})}async transcribeAudio(e){const{id:t,peerId:a}=e,s=n=>{this.apiUpdatesManager.processLocalUpdate({_:"updateTranscribedAudio",msg_id:e.id,peer:this.appPeersManager.getOutputPeer(a),pFlags:n.pFlags,text:n.text,transcription_id:n.transcription_id})};return this.apiManager.invokeApiSingleProcess({method:"messages.transcribeAudio",params:{peer:this.appPeersManager.getInputPeerById(a),msg_id:t},processResult:n=>(s(n),n),processError:n=>{throw(n.type==="TRANSCRIPTION_FAILED"||n.type==="MSG_VOICE_MISSING")&&s({_:"messages.transcribedAudio",transcription_id:0,text:"",pFlags:{}}),n}})}async sendText(e){let{peerId:t,text:a}=e;if(!a.trim())return;e.entities??(e.entities=[]),e.webPageOptions??(e.webPageOptions={}),this.checkSendOptions(e);const n=(await this.apiManager.getConfig()).message_length_max,i=Ci(a,n);a=i[0],i.length>1&&e.webPage?._==="webPage"&&!a.includes(e.webPage.url)&&delete e.webPage,t=this.appPeersManager.getPeerMigratedTo(t)||t;let r=e.entities;e.viaBotId||([a,r]=oa(a,r));let p=this.getInputEntities(r);p.length||(p=void 0);const d=this.generateOutgoingMessage(t,e);d.entities=r,d.message=a;const f=this.appPeersManager.isChannel(t),c=this.generateOutgoingWebPage(d,e),l=u=>{this.onMessagesSendError([d],u),this.rootScope.dispatchEvent("messages_pending")};d.send=()=>{l();const u={};this.pendingAfterMsgs[t]&&(u.afterMessageId=this.pendingAfterMsgs[t].messageId);const M=e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,A=this.appPeersManager.getInputPeerById(t),w=e.replyTo;let C;if(e.viaBotId)C=this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:A,random_id:d.random_id,reply_to:w,query_id:e.queryId,id:e.resultId,clear_draft:e.clearDraft,send_as:M},u);else{const F={...{peer:A,message:a,random_id:d.random_id,reply_to:w,entities:p,clear_draft:e.clearDraft,schedule_date:e.scheduleDate||void 0,silent:e.silent,send_as:M,update_stickersets_order:e.updateStickersetOrder,invert_media:e.invertMedia,effect:e.effect},...c};C=this.apiManager.invokeApiAfter(e.webPage?"messages.sendMedia":"messages.sendMessage",F,u)}return this.pendingAfterMsgs[t]=u,C.then(I=>{if(I._==="updateShortSentMessage"){const F=d.promise;delete d.promise;const L=it(d);Zt(d,["promise"]),d.promise=F,L.date=I.date,L.id=I.id,L.media=I.media,L.entities=I.entities,L.ttl_period=I.ttl_period,this.wrapMessageEntities(L),I.pFlags.out&&(L.pFlags.out=!0);const{pts:z,pts_count:j}=I;this.apiUpdatesManager.processLocalUpdate({_:"updateMessageID",random_id:d.random_id,id:L.id}),this.apiUpdatesManager.processLocalUpdate({_:e.scheduleDate?"updateNewScheduledMessage":f?"updateNewChannelMessage":"updateNewMessage",message:L,pts:z,pts_count:j}),I=void 0}else I.updates&&I.updates.forEach(F=>{F._==="updateDraftMessage"&&(F.local=!0)});I&&this.apiUpdatesManager.processUpdateMessage(I),d.promise.resolve()},I=>{throw l(I),d.promise.reject(I),I}).finally(()=>{this.pendingAfterMsgs[t]===u&&delete this.pendingAfterMsgs[t]})},this.beforeMessageSending(d,{isScheduled:!!e.scheduleDate||void 0,threadId:e.threadId,clearDraft:e.clearDraft,sequential:!0});const m=[d.promise];for(let u=1;u<i.length;++u)m.push(this.sendText({...e,peerId:t,text:i[u]}));return Promise.all(m).then(Ge)}sendFile(e){const t=e.file;let{peerId:a}=e;a=this.appPeersManager.getPeerMigratedTo(a)||a,this.checkSendOptions(e);const s=!!e.groupedMessage,n=e.groupedMessage||this.generateOutgoingMessage(a,e);let i,r;const p=t.mime_type||t.type,d=t instanceof File?t.name:"",f=!(t instanceof File)&&!(t instanceof Blob);let c=e.caption||"";this.log("sendFile",t,p);let l=e.entities||[];c&&([c,l]=oa(c,l));const m=[],u=Rt().IMAGE_MIME_TYPES_SUPPORTED.has(p),M=e.strippedBytes&&{_:"photoStrippedSize",bytes:e.strippedBytes,type:"i"},A=e.useTempMediaId?this.mediaTempId++:n.id;let w,C,I;if(f)i="document",r="";else if(p.indexOf("audio/")===0||["video/ogg"].indexOf(p)>=0){i="audio",r="audio."+(p.split("/")[1]==="ogg"?"ogg":"mp3"),I="sendMessageUploadAudioAction",e.isVoiceMessage&&(i="voice",n&&(n.pFlags.media_unread=!0));const P={_:"documentAttributeAudio",pFlags:{voice:e.isVoiceMessage||void 0},waveform:e.waveform,duration:e.duration||void 0};m.push(P)}else if(!e.isMedia)i="document",r="document."+p.split("/")[1],I="sendMessageUploadDocumentAction";else if(u){i="photo",r="photo."+p.split("/")[1],I="sendMessageUploadPhotoAction";const P={_:"photoSize",w:e.width,h:e.height,type:ba,location:null,size:t.size};w={_:"photo",id:A,sizes:[P],w:e.width,h:e.height},M&&w.sizes.unshift(M),this.thumbsStorage.setCacheContextURL(w,P.type,e.objectURL||"",t.size),w=this.appPhotosManager.savePhoto(w)}else if(Rt().VIDEO_MIME_TYPES_SUPPORTED.has(p)){i="video",r="video.mp4",I="sendMessageUploadVideoAction";const P={_:"documentAttributeVideo",pFlags:{round_message:e.isRoundMessage||void 0,supports_streaming:!0},duration:e.duration,w:e.width,h:e.height};m.push(P),e.noSound&&t.size>10*1024&&t.size<10*1024*1024&&m.push({_:"documentAttributeAnimated"})}else i="document",r="document."+p.split("/")[1],I="sendMessageUploadDocumentAction";if(m.push({_:"documentAttributeFilename",file_name:d||r}),["document","video","audio","voice"].includes(i)&&!f){const P=[];C={_:"document",id:A,duration:e.duration,attributes:m,w:e.width,h:e.height,thumbs:P,mime_type:p,size:t.size},e.objectURL&&this.thumbsStorage.setCacheContextURL(C,void 0,e.objectURL,t.size);let S;u?(m.push({_:"documentAttributeImageSize",w:e.width,h:e.height}),S={_:"photoSize",w:e.width,h:e.height,type:ba,size:t.size}):i==="video"&&e.thumb&&(S={_:"photoSize",w:e.thumb.size.width,h:e.thumb.size.height,type:"local-thumb",size:e.thumb.blob.size},this.thumbsStorage.setCacheContextURL(C,S.type,e.thumb.url,S.size)),S&&P.push(S),M&&P.unshift(M),C=this.appDocsManager.saveDoc(C)}this.log("sendFile",i,r,t.type,e);const F=Pe(),L=f?void 0:{_:w?"messageMediaPhoto":"messageMediaDocument",pFlags:{},photo:w,document:C};L&&(Zt(L,["promise"]),L.promise=F,e.spoiler&&(L.pFlags.spoiler=!0));let z=this.getInputEntities(l);z.length||(z=void 0);const j=f?void 0:Ii(t);j&&(this.uploadFilePromises[j]=F),s||(e.invertMedia&&(n.pFlags.invert_media=!0),n.entities=l,n.message=c,n.media=f?{_:"messageMediaDocument",pFlags:{},document:t}:L,n.uploadingFileName=[j],e.stars&&(n.media=this.generateOutgoingPaidMedia([n],e.stars)));const Z=P=>{this.onMessagesSendError([n],P),this.rootScope.dispatchEvent("messages_pending")};let X=!1,O=null;const B=()=>{if(f){const P={_:"inputMediaDocument",id:ss(t),pFlags:{}};F.resolve(P)}else if(t instanceof File||t instanceof Blob){const P=()=>{(!X||n?.error)&&(X=!1,O=this.apiFileManager.upload({file:t,fileName:j}),O.catch(v=>{X||(this.log("cancelling upload",L),n&&this.cancelPendingMessage(n.random_id),this.setTyping(a,{_:"sendMessageCancelAction"},void 0,e.threadId),F.reject(v))}),O.addNotifyListener(v=>{const Q=Math.max(1,Math.floor(100*v.done/v.total));I&&this.setTyping(a,{_:I,progress:Q|0},void 0,e.threadId),F.notifyAll(v)}),F.notifyAll({done:0,total:t.size}));let S;return i==="video"&&e.objectURL&&e.thumb?.blob&&(S=this.apiFileManager.upload({file:e.thumb.blob})),O&&O.then(async v=>{v.name=r,X=!0;let Q;switch(i){case"photo":Q={_:"inputMediaUploadedPhoto",file:v,pFlags:{spoiler:e.spoiler||void 0}};break;default:Q={_:"inputMediaUploadedDocument",file:v,mime_type:p,pFlags:{force_file:I==="sendMessageUploadDocumentAction"||void 0,spoiler:e.spoiler||void 0},attributes:m}}if(e.stars&&!e.isGroupedItem&&(Q={_:"inputMediaPaidMedia",extended_media:[Q],stars_amount:""+e.stars}),S)try{const T=await S;Q.thumb=T}catch(T){this.log.error("sendFile thumb upload error:",T)}F.resolve(Q)},v=>{Z(v)}),F};e.isGroupedItem?P():this.sendSmthLazyLoadQueue.push({load:P})}return F};if(!s&&(n.send=B),!s&&this.beforeMessageSending(n,{isGroupedItem:e.isGroupedItem,isScheduled:!!e.scheduleDate||void 0,threadId:e.threadId,clearDraft:e.clearDraft,processAfter:e.processAfter}),!e.isGroupedItem){F.then(S=>(this.setTyping(a,{_:"sendMessageCancelAction"},void 0,e.threadId),this.apiManager.invokeApi("messages.sendMedia",{background:e.background,peer:this.appPeersManager.getInputPeerById(a),media:S,message:c,random_id:n.random_id,reply_to:e.replyTo,schedule_date:e.scheduleDate,silent:e.silent,entities:z,clear_draft:e.clearDraft,send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,update_stickersets_order:e.updateStickersetOrder,invert_media:e.invertMedia,effect:e.effect}).then(v=>{this.apiUpdatesManager.processUpdateMessage(v)},v=>{if(i==="photo"&&v.code===400&&(v.type==="PHOTO_INVALID_DIMENSIONS"||v.type==="PHOTO_SAVE_FILE_INVALID")){v.handled=!0,i="document",n.send();return}throw Z(v),v})));const P=n.promise;F.then(()=>P.resolve(),S=>P.reject(S))}const y={message:n,media:L,send:B,uploadingFileName:j};return Zt(y,["promise","send"]),y.promise=F,y}async sendGrouped(e){if(this.checkSendOptions(e),e.sendFileDetails.length===1)return this.sendFile({...e,...e.sendFileDetails[0]});let{peerId:t}=e;t=this.appPeersManager.getPeerMigratedTo(t)||t;let a=e.caption||"",s=e.entities||[];a&&([a,s]=oa(a,s));let n=this.getInputEntities(s);n.length||(n=void 0);const i=this.log.bindPrefix("sendGrouped");i(e);const r=e.stars?void 0:""+ ++this.groupedTempId,p=[],d=C=>{p.push(C)};let f;const c=!!e.stars,l=this.mediaTempId,m=e.sendFileDetails.map((C,I)=>{const F={peerId:t,isGroupedItem:!0,isMedia:e.isMedia,scheduleDate:e.scheduleDate,silent:e.silent,replyToMsgId:e.replyToMsgId,replyToStoryId:e.replyToStoryId,replyToQuote:e.replyToQuote,threadId:e.threadId,sendAsPeerId:e.sendAsPeerId,useTempMediaId:c,groupedMessage:c&&f,groupId:r,processAfter:d,...C};I===0&&(F.caption=a,F.entities=s,F.effect=e.effect);const L=this.sendFile(F);return I===0&&(f=L.message),L});if(e.stars){const C=m[0].message;C.media=this.generateOutgoingPaidMedia(m,e.stars),this.mediaTempMap[C.id]=l,C.uploadingFileName=m.map(({uploadingFileName:I})=>I)}e.clearDraft&&p.push(()=>{this.appDraftsManager.clearDraft(t,e.threadId)}),p.forEach(C=>{C()});const u=(C,I)=>{C.error!==I&&(this.onMessagesSendError([C],I),this.rootScope.dispatchEvent("messages_pending"))},M=this.appPeersManager.getInputPeerById(t),A=C=>{this.setTyping(t,{_:"sendMessageCancelAction"},void 0,e.threadId);const I=Pe();return this.sendSmthLazyLoadQueue.push({load:()=>this.apiManager.invokeApi(e.stars?"messages.sendMedia":"messages.sendMultiMedia",{peer:M,reply_to:e.replyTo,schedule_date:e.scheduleDate,silent:e.silent,clear_draft:e.clearDraft,send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,update_stickersets_order:e.updateStickersetOrder,invert_media:e.invertMedia,effect:e.effect,...e.stars?{media:C[0].media,message:C[0].message,entities:C[0].entities,random_id:C[0].random_id}:{multi_media:C}}).then(F=>{this.apiUpdatesManager.processUpdateMessage(F),I.resolve()},F=>{m.forEach(({message:L})=>u(L,F)),I.reject(F)})}),I},w=m.map(async({message:C,send:I})=>{let F;try{F=await I()}catch(X){const O=X.type==="UPLOAD_CANCELED";if(O&&!c)return;throw O||i.error("upload item error:",X,C),u(C,X),X}let L;try{L=await this.apiManager.invokeApi("messages.uploadMedia",{peer:M,media:F})}catch(X){throw i.error("uploadMedia error:",X,C),u(C,X),X}const z=F;if(L._==="messageMediaPhoto"){const X=this.appPhotosManager.savePhoto(L.photo);F=vi(X)}else if(L._==="messageMediaDocument"){const X=this.appDocsManager.saveDoc(L.document);F=Si(X)}["pFlags","ttl_seconds"].forEach(X=>{F[X]=z[X]??F[X]});const Z={_:"inputSingleMedia",media:F,random_id:C?.random_id,message:a,entities:n};return a&&(a="",n=void 0),Z});return Promise.all(w).then(C=>{if(C=C.filter(Boolean),e.stars){const I=C.splice(1,1/0);C[0].media={_:"inputMediaPaidMedia",extended_media:[C[0].media,...I.map(({media:F})=>F)],stars_amount:""+e.stars}}return A(C)})}sendContact(e,t){return this.sendOther({peerId:e,inputMedia:this.appUsersManager.getContactMediaInput(t)})}sendOther(e){let{peerId:t,inputMedia:a}=e;t=this.appPeersManager.getPeerMigratedTo(t)||t;const s=a?._==="inputMediaDocumentExternal";this.checkSendOptions(e);const n=this.generateOutgoingMessage(t,e);let i;switch(a._){case"inputMediaPoll":{const d=qt();a.poll.id=d,this.appPollsManager.savePoll(a.poll,{_:"pollResults",total_voters:0,pFlags:{},recent_voters:[]});const{poll:f,results:c}=this.appPollsManager.getPoll(d);i={_:"messageMediaPoll",poll:f,results:c};break}case"inputMediaPhoto":{i={_:"messageMediaPhoto",photo:this.appPhotosManager.getPhoto(a.id.id),pFlags:{}};break}case"inputMediaDocument":{i={_:"messageMediaDocument",document:this.appDocsManager.getDoc(a.id.id),pFlags:{}};break}case"inputMediaContact":{i={_:"messageMediaContact",phone_number:a.phone_number,first_name:a.first_name,last_name:a.last_name,user_id:a.user_id??"0",vcard:a.vcard};break}case"inputMediaGeoPoint":{i={_:"messageMediaGeo",geo:e.geoPoint};break}case"inputMediaVenue":{i={_:"messageMediaVenue",geo:e.geoPoint,title:a.title,address:a.address,provider:a.provider,venue_id:a.venue_id,venue_type:a.venue_type};break}case"inputMediaPhotoExternal":{if(s)break;i={_:"messageMediaPhotoExternal",photo:e.webDocument};break}case"inputMediaDocumentExternal":{if(s)break;i={_:"messageMediaDocumentExternal",document:e.webDocument};break}case"inputMediaStory":{i={_:"messageMediaStory",id:a.id,pFlags:{},peer:this.appPeersManager.getOutputPeer(this.appPeersManager.getPeerId(a.peer))};break}case"messageMediaPending":{i=a.messageMedia;break}}n.media=i;const r=d=>{this.onMessagesSendError([n],d),this.rootScope.dispatchEvent("messages_pending")};n.send=()=>{const d={};this.pendingAfterMsgs[t]&&(d.afterMessageId=this.pendingAfterMsgs[t].messageId);const f=e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0;let c;return e.viaBotId?c=this.apiManager.invokeApiAfter("messages.sendInlineBotResult",{peer:this.appPeersManager.getInputPeerById(t),random_id:n.random_id,reply_to:e.replyTo,query_id:e.queryId,id:e.resultId,clear_draft:e.clearDraft,schedule_date:e.scheduleDate,silent:e.silent,send_as:f},d):c=this.apiManager.invokeApiAfter("messages.sendMedia",{peer:this.appPeersManager.getInputPeerById(t),media:a,random_id:n.random_id,reply_to:e.replyTo,message:"",clear_draft:e.clearDraft,schedule_date:e.scheduleDate,silent:e.silent,send_as:f,update_stickersets_order:e.updateStickersetOrder},d),this.pendingAfterMsgs[t]=d,c.then(l=>{l.updates&&l.updates.forEach(m=>{m._==="updateDraftMessage"&&(m.local=!0)}),this.apiUpdatesManager.processUpdateMessage(l),p.resolve()},l=>{throw r(l),p.reject(l),l}).finally(()=>{this.pendingAfterMsgs[t]===d&&delete this.pendingAfterMsgs[t]})},this.beforeMessageSending(n,{isScheduled:!!e.scheduleDate||void 0,threadId:e.threadId,clearDraft:e.clearDraft,sequential:!0,noOutgoingMessage:s});const p=n.promise;return p}getInputReplyTo(e){if(e.replyToStoryId)return{_:"inputReplyToStory",story_id:e.replyToStoryId,peer:this.appPeersManager.getInputPeerById(e.peerId)};if(e.replyToMsgId)return{_:"inputReplyToMessage",reply_to_msg_id:ae(e.replyToMsgId),reply_to_peer_id:e.replyToPeerId&&this.appPeersManager.getInputPeerById(e.replyToPeerId),top_msg_id:e.threadId?ae(e.threadId):void 0,...e.replyToQuote&&{quote_text:e.replyToQuote.text,quote_entities:e.replyToQuote.entities,quote_offset:e.replyToQuote.offset}}}checkSendOptions(e){e.threadId&&!e.replyToMsgId&&(e.replyToMsgId=e.threadId),e.replyTo??(e.replyTo=this.getInputReplyTo(e))}beforeMessageSending(e,t={}){const a=e.id,s=this.getMessagePeer(e),n=t.isScheduled?this.getScheduledMessagesStorage(s):this.getHistoryMessagesStorage(s);e.storageKey=n.key;const i=[];if(t.isScheduled&&!t.noOutgoingMessage)this.saveMessages([e],{storage:n,isScheduled:!0,isOutgoing:!0}),i.push(()=>{this.rootScope.dispatchEvent("scheduled_new",e)});else if(!t.noOutgoingMessage){const p=[this.getHistoryStorage(s),t.threadId?this.getHistoryStorage(s,t.threadId):void 0].filter(Boolean);for(const d of p)d.history.unshift(a);if(this.saveMessages([e],{storage:n,isOutgoing:!0}),this.setDialogTopMessage(e),this.updateMessageContextForInserting(e),t.threadId){const d=this.dialogsStorage.getAnyDialog(s,t.threadId);d&&this.setDialogTopMessage(e,d)}i.push(()=>{this.rootScope.dispatchEvent("history_append",{storageKey:n.key,message:e})})}let r;if(t.noOutgoingMessage||(r=this.pendingByRandomId[e.random_id]={peerId:s,tempId:a,threadId:t.threadId,storage:n,sequential:t.sequential},t.isScheduled||(this.pendingTopMsgs[s]=a,t.threadId&&(this.pendingTopMsgs[`${s}_${t.threadId}`]=a))),e.reactions){const p=e.reactions.results[0].reaction;this.invokeAfterMessageIsSent(a,"reactions",d=>this.appReactionsManager.sendReaction({message:d,reaction:p}))}return!t.isGroupedItem&&e.send&&i.push(()=>{t.clearDraft&&this.appDraftsManager.clearDraft(s,t.threadId),e.send()}),i.length&&(t.processAfter||Rp)(()=>{for(const p of i)p()}),r}generateStandaloneOutgoingMessage(e){const t=this.generateOutgoingMessage(e,{});return this.saveMessage(t,{storage:new Map}),t}generateOutgoingMessage(e,t){let a;const s=this.appPeersManager.isBroadcast(e);if(s&&this.appPeersManager.getPeer(e).pFlags.signatures){const p=this.appUsersManager.getSelf();a=p.first_name+(p.last_name?" "+p.last_name:"")}let n;t.threadId&&!this.appPeersManager.isForum(e)&&(n=this.getHistoryStorage(e,t.threadId).history.first[0]);const i={_:"message",id:this.generateTempMessageId(e,n),from_id:t.sendAsPeerId?this.appPeersManager.getOutputPeer(t.sendAsPeerId):this.generateFromId(e),peer_id:this.appPeersManager.getOutputPeer(e),post_author:a,pFlags:this.generateFlags(e),date:t.scheduleDate||Ie(!0)+this.timeManager.getServerTimeOffset(),message:"",grouped_id:t.groupId,random_id:qt(),reply_to:this.generateReplyHeader(e,t.replyTo),via_bot_id:t.viaBotId,reply_markup:t.replyMarkup,replies:this.generateReplies(e,t.replyTo),views:s&&1,pending:!0,effect:t.effect};return Zt(i,["send","promise"]),t.groupId===void 0&&(i.promise=Pe()),t.savedReaction&&(i.reactions={_:"messageReactions",pFlags:{reactions_as_tags:!0},results:t.savedReaction.map(r=>({_:"reactionCount",count:1,reaction:r,chosen_order:0}))}),i}generateReplyHeader(e,t){if(!t)return;if(t._==="inputReplyToStory")return{_:"messageReplyStoryHeader",story_id:t.story_id,peer:this.appPeersManager.getOutputPeer(this.appPeersManager.getPeerId(t.peer))};const a=e,s=this.appPeersManager.getPeerId(t.reply_to_peer_id);s&&(e=s);const n=this.appPeersManager.isChannel(e)?e.toChatId():void 0,i=this.appPeersManager.isForum(e),r=this.appMessagesIdsManager.generateMessageId(t.reply_to_msg_id,n);let p=t.top_msg_id?this.appMessagesIdsManager.generateMessageId(t.top_msg_id,n):void 0;const d=this.getMessageByPeer(e,r);i&&!p&&d&&(p=Pa(d,!0));const f={_:"messageReplyHeader",pFlags:{},reply_to_msg_id:r||p};return p&&i&&Wn!==p&&(f.pFlags.forum_topic=!0),p&&f.reply_to_msg_id!==p&&(f.reply_to_top_id=p),t.quote_text&&(f.quote_text=t.quote_text,f.quote_entities=t.quote_entities,f.quote_offset=t.quote_offset,f.pFlags.quote=!0),s&&(s.isUser()||!this.appPeersManager.isPeerPublic(s)?(delete f.reply_to_msg_id,f.quote_text??(f.quote_text=d.message)):f.reply_to_peer_id=this.appPeersManager.getOutputPeer(s)),f.reply_media=d?.media,d&&a!==d.peerId&&(f.reply_from=this.generateForwardHeader(e,d,!0)),f}generateReplies(e,t){let a;if(this.appPeersManager.isBroadcast(e)){const s=this.appProfileManager.getCachedFullChat(e.toChatId());s?.linked_chat_id&&(a={_:"messageReplies",pFlags:{comments:!0},channel_id:s.linked_chat_id,replies:0,replies_pts:0})}else this.appPeersManager.isMegagroup(e)&&!t&&(a={_:"messageReplies",pFlags:{},replies:0,replies_pts:0});return a}generateFromId(e){if(!(this.appPeersManager.isAnyChat(e)&&(this.appPeersManager.isBroadcast(e)||this.isAnonymousSending(e))))return this.appPeersManager.getOutputPeer(this.appUsersManager.getSelf().id.toPeerId())}generateFlags(e){const t={},a=this.appUsersManager.getSelf().id;return e!==a&&(t.out=!0,!this.appPeersManager.isChannel(e)&&!this.appUsersManager.isBot(e)&&(t.unread=!0)),this.appPeersManager.isBroadcast(e)&&(t.post=!0),t}generateForwardHeader(e,t,a){if(!t)return;const s=this.appPeersManager.peerId,n=t.fromId,i=t.peerId,r=t.fwd_from;if(n===s&&i===s&&!r&&!a)return;const p={_:"messageFwdHeader",date:t.date,pFlags:{}};let d;return n.isUser()&&(d=this.appProfileManager.getCachedFullUser(n.toUserId())?.private_forward_name),r?["from_id","from_name","channel_post","post_author"].forEach(c=>{p[c]=r[c]}):(p.post_author=t.post_author,d||(p.from_id=this.appPeersManager.getOutputPeer(n)),this.appPeersManager.isBroadcast(i)&&(p.channel_post=t.id)),p.from_name||(p.from_name=d),e===s&&!a&&(d?p.from_name&&(p.saved_from_name=d):(p.saved_from_msg_id=t.id,p.saved_from_peer=this.appPeersManager.getOutputPeer(i),r&&(p.saved_from_id=this.appPeersManager.getOutputPeer(n))),t.pFlags.out&&!this.appPeersManager.isBroadcast(i)&&(p.pFlags.saved_out=!0),r&&(p.saved_date=t.date)),p}getInputMediaWebPage(e){if(e.webPage)return{_:"inputMediaWebPage",url:e.webPage.url,pFlags:{force_large_media:e.webPageOptions.largeMedia||void 0,force_small_media:e.webPageOptions.smallMedia||void 0,optional:e.webPageOptions.optional||void 0}}}generateOutgoingWebPage(e,t){return e._!=="message"?{}:t.webPage?(e.media={_:"messageMediaWebPage",pFlags:{force_large_media:t.webPageOptions.largeMedia||void 0,force_small_media:t.webPageOptions.smallMedia||void 0},webpage:t.webPage},t.invertMedia&&(e.pFlags.invert_media=!0),{media:this.getInputMediaWebPage(t)}):{no_webpage:t.noWebPage}}generateFakeAvatarMessage(e,t){const a=Number.MAX_SAFE_INTEGER,s={_:"messageService",pFlags:{},action:{_:"messageActionChannelEditPhoto",photo:t},id:a,peer_id:this.appPeersManager.getOutputPeer(e),mid:a,peerId:e,date:t.date,fromId:e};return this.getHistoryMessagesStorage(e).set(a,s),s}generateOutgoingPaidMedia(e,t){return{_:"messageMediaPaidMedia",extended_media:e.map(({media:a})=>({_:"messageExtendedMedia",media:a})),stars_amount:""+t}}getUploadPromise(e){return this.uploadFilePromises[e]}isAnonymousSending(e){return e.isAnyChat()?this.appPeersManager.getPeer(e).admin_rights?.pFlags?.anonymous:!1}setDialogTopMessage(e,t=this.getDialogOnly(e.peerId)){if(!t)return;t.top_message=e.mid;const a=this.getHistoryStorage(e.peerId,yt(t)?void 0:At(t));a.maxId=e.mid,this.dialogsStorage.generateIndexForDialog(t,!1,e),this.scheduleHandleNewDialogs(e.peerId,t)}cancelPendingMessage(e){const t=this.pendingByRandomId[e];if(t){const{peerId:a,tempId:s,storage:n}=t,i=this.getHistoryStorage(a);return this.appPeersManager.isChannel(a)?this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteChannelMessages",channel_id:a.toChatId(),messages:[s],pts:void 0,pts_count:void 0}):this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:[s],pts:void 0,pts_count:void 0}),i.history.delete(s),delete this.pendingByRandomId[e],this.deleteMessageFromStorage(n,s),!0}return!1}async fillConversations(e=Ft){const t=this.middleware.get();for(;!this.dialogsStorage.isDialogsLoaded(e);){const a=await this.getTopMessages({limit:100,folderId:e});if(!t()||!a||a.isEnd)break}}getReadMaxIdIfUnread(e,t){const a=this.getHistoryStorage(e,t);if(t&&!this.appChatsManager.isForum(e.toChatId())){const s=this.getHistoryStorage(e),n=Math.max(s.readMaxId??0,a.readMaxId);return!this.getMessageByPeer(e,a.maxId)?.pFlags?.out&&n<a.maxId?n:0}else{const s=this.getMessageByPeer(e,a.maxId),n=a.readMaxId;return!s?.pFlags?.out&&n<a.maxId&&ae(n)?n:0}}getTopMessages({limit:e,folderId:t,query:a,offsetTopicId:s,filterType:n=this.dialogsStorage.getFilterType(t)}){const i=this.log.bindPrefix("getTopMessages"),r=0;let p,d=0;a||(a=void 0);let f=this.dialogsStorage.getOffsetDate(t);f&&(d=f*65536,f+=this.timeManager.getServerTimeOffset());const c=100,l=this.middleware.get(),m=!!a,u=this.dialogsStorage.isVirtualFilter(t)?t:void 0,M=F=>{if(!l()||F._==="messages.dialogsNotModified"||F._==="messages.savedDialogsNotModified")return null;i("result",F),!u&&!r&&!f&&!p&&t!==Ft&&(i("resetting pinned order",t),this.dialogsStorage.resetPinnedOrder(t)),!u&&!f&&(i("adding missed dialogs"),this.appDraftsManager.addMissedDialogs()),this.saveApiResult(F);let L=!!f,z=!1;const j=new Map,Z=t===Ft?ct:t,X=!!u&&!m||t===Ft,O=F.dialogs||F.topics;if(i("saving",{setFolderId:Z,saveGlobalOffset:X,noIdsDialogs:j,isSearch:m}),Et(O,(T,R,ee)=>{if(!T){ee.splice(R,1);return}if(u||(T.folder_id??(T.folder_id=Z)),this.dialogsStorage.saveDialog({dialog:T,ignoreOffsetDate:!m,saveGlobalOffset:X}),T.peerId===void 0){ee.splice(R,1);return}if(!L&&!this.appPeersManager.isChannel(T.peerId||this.dialogsStorage.getDialogPeerId(T))&&(this.incrementMaxSeenId(T.top_message),L=!0),d&&Es(T)>d&&(this.scheduleHandleNewDialogs(T.peerId,T),z=!0),!u&&!Ye(T)&&!ae(T.read_inbox_max_id)&&!ae(T.read_outbox_max_id)&&!T.unread_count&&ae(T.top_message))j.set(T.peerId,{dialog:T}),this.log.error("noIdsDialogs",T,I);else if(T.top_message){const le=this.getMessageByPeer(T.peerId,T.top_message);le&&(this.setMessageUnreadByDialog(le,T),this.dialogsStorage.setDialogToState(T))}}),j.size){const T=[...j.keys()],R=T.map(ee=>this.reloadConversation(ee));Promise.all(R).then(()=>{this.rootScope.dispatchEvent("dialogs_multiupdate",j);for(let ee=0;ee<T.length;++ee){const le=T[ee];this.rootScope.dispatchEvent("dialog_unread",{peerId:le,dialog:this.getDialogOnly(le)})}})}const B=F.count,y=this.dialogsStorage.getFolderDialogs(t,!1);let P=0;if(!m)for(let T=0,R=y.length;T<R;++T){const ee=y[T];ae(ee.top_message)||ee.draft?++P:this.log.error("something strange with dialog",ee)}let S;m?S=!B||O.length===B:S=!B||P>=B||!O.length,S&&!m&&this.dialogsStorage.setDialogsLoaded(t,!0),z?this.scheduleHandleNewDialogs():this.rootScope.dispatchEvent("dialogs_multiupdate",new Map),i("end",{isEnd:S,hasPrepend:z,offsetDate:this.dialogsStorage.getOffsetDate(t)});const v=O,Q=e===c?v:v.slice(0,e);return{isEnd:S&&Q[Q.length-1]===v[v.length-1],count:B??O.length,dialogs:Q}},A={noErrorBox:!0};let w,C,I;return n===Us.Forum?w=this.apiManager.invokeApiSingleProcess({method:C="channels.getForumTopics",params:I={channel:this.appChatsManager.getChannelInput(u.toChatId()),limit:c,offset_date:s?void 0:f,offset_id:r,offset_topic:s,q:a},options:A,processResult:F=>(F=this.dialogsStorage.processTopics(u,F),M(F))}):n===Us.Saved?w=this.apiManager.invokeApiSingleProcess({method:C="messages.getSavedDialogs",params:I={offset_date:f,offset_id:r,offset_peer:this.appPeersManager.getInputPeerById(p),limit:c,hash:"0"},options:A,processResult:M}):w=this.apiManager.invokeApiSingleProcess({method:C="messages.getDialogs",params:I={folder_id:t,offset_date:f,offset_id:r,offset_peer:this.appPeersManager.getInputPeerById(p),limit:c,hash:"0"},options:A,processResult:M}),i("invoke",C,I),w}async forwardMessagesInner(e){let{peerId:t,fromPeerId:a,mids:s}=e;t=this.appPeersManager.getPeerMigratedTo(t)||t,s=s.slice().sort((m,u)=>m-u);for(let m=0,u=s.length;m<u;++m){const M=s[m],A=this.getMessageByPeer(a,M);A.pFlags.is_outgoing&&(this.sendText({peerId:t,threadId:e.threadId,sendAsPeerId:e.sendAsPeerId,text:A.message,entities:A.entities,scheduleDate:e.scheduleDate,silent:e.silent}),s.splice(m--,1),--u)}if(!s.length)return Promise.resolve();const n=await this.apiManager.getConfig(),i=s.splice(n.forwarded_count_max,s.length-n.forwarded_count_max);e.dropCaptions&&(e.dropAuthor=!0);const r={},p=[],d=s.map(m=>{var L;const u=this.getMessageByPeer(a,m),M=this.generateOutgoingMessage(t,e);p.push(M.id);const A=["entities","media"],w=["invert_media"];e.dropAuthor||(M.fwd_from=this.generateForwardHeader(t,u),A.push("views","forwards"),M.fwd_from?.from_name&&t===this.appPeersManager.peerId&&delete M.from_id),(!e.dropCaptions||!u.media)&&A.push("message");const C=u.reply_to?.reply_to_msg_id,I=s.indexOf(C);if(C&&I!==-1){const z=p[I];M.reply_to={_:"messageReplyHeader",reply_to_msg_id:z,pFlags:{}}}A.forEach(z=>{M[z]=it(u[z])}),w.forEach(z=>{M.pFlags[z]=u.pFlags[z]});const F=M.media?.document;return F&&(["round","voice"].includes(F.type)&&(M.pFlags.media_unread=!0),F.sticker&&!this.rootScope.premium&&Di(F)&&(M.media.pFlags.nopremium=!0)),u.grouped_id&&(r[L=u.grouped_id]??(r[L]={tempId:""+ ++this.groupedTempId,messages:[]})).messages.push(M),t===this.appPeersManager.peerId&&(M.saved_peer_id=this.appPeersManager.getOutputPeer(a)),M});for(const m in r){const u=r[m];if(u.messages.length>1){u.messages.forEach(w=>{w.grouped_id=u.tempId});const M=Ss(this.getMessagesByGroupedId(m)),A=Ss(u.messages);M.factcheck&&(A.factcheck=M.factcheck)}}d.forEach(m=>{this.beforeMessageSending(m,{isScheduled:!!e.scheduleDate||void 0,sequential:!0,threadId:m.peerId===this.appPeersManager.peerId?a:void 0})});const f={};this.pendingAfterMsgs[t]&&(f.afterMessageId=this.pendingAfterMsgs[t].messageId);const c=this.apiManager.invokeApiAfter("messages.forwardMessages",{from_peer:this.appPeersManager.getInputPeerById(a),id:s.map(m=>ae(m)),random_id:d.map(m=>m.random_id),to_peer:this.appPeersManager.getInputPeerById(t),with_my_score:e.withMyScore,silent:e.silent,schedule_date:e.scheduleDate,drop_author:e.dropAuthor,drop_media_captions:e.dropCaptions,send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0,top_msg_id:e.threadId?this.appMessagesIdsManager.generateMessageId(e.threadId):void 0},f).then(m=>{this.log("forwardMessages updates:",m),this.apiUpdatesManager.processUpdateMessage(m)},m=>{throw this.onMessagesSendError(d,m),m}).finally(()=>{this.pendingAfterMsgs[t]===f&&delete this.pendingAfterMsgs[t]});this.pendingAfterMsgs[t]=f;const l=[c];return i.length&&l.push(this.forwardMessages({...e,peerId:t,fromPeerId:a,mids:i})),Promise.all(l).then(Ge)}forwardMessages(e){this.checkSendOptions(e);const{peerId:t,fromPeerId:a,mids:s}=e,n=this.appPeersManager.isChannel(a)?a.toChatId():void 0,r=this.appMessagesIdsManager.splitMessageIdsByChannels(s,n).map(([p,{mids:d}])=>this.forwardMessagesInner({...e,peerId:t,fromPeerId:p?n.toPeerId(!0):this.getMessageByPeer(a,d[0]).peerId,mids:d}));return Promise.all(r).then(Ge)}generateEmptyMessage(e){}onMessagesSendError(e,t){e.forEach(a=>{if(a.error===t)return;const{uploadingFileName:s}=a;if(s?.length>1&&s.forEach(n=>{this.apiFileManager.cancelDownload(n)}),this.modifyMessage(a,n=>{t?n.error=t:delete n.error},void 0,!0),t){this.rootScope.dispatchEvent("message_error",{storageKey:a.storageKey,peerId:a.peerId,tempId:a.mid,error:t});const n=this.getDialogOnly(a.peerId);n&&this.rootScope.dispatchEvent("dialog_unread",{peerId:a.peerId,dialog:n})}})}onMessageModification(e,t){this.setMessageToStorage(t??this.getHistoryMessagesStorage(e.peerId),e)}updateMessageContextForDeletion(e,t,a){const s=this.getReferenceContextByMessage(e,!0);if(!s)return;let n=!1;const{searchStorages:i}=s;i?.forEach(r=>{!t&&r.filterMessage(e)||(n=!0,r.history.delete(e.mid),r.count&&(r.count=Math.max(0,r.count-1)),i.delete(r),this.historyMaxIdSubscribed.has(r.key)&&!a&&this.rootScope.dispatchEvent("history_delete_key",{historyKey:r.key,mid:e.mid}))}),n&&(i&&!i.size&&delete s.searchStorages,Object.keys(s).length||delete this.references[e.peerId+"_"+e.mid])}updateMessageContextForInserting(e){const t=Pa(e),a=this.searchesStorage[e.peerId];if(!a)return;const n=this.getReferenceContextByMessage(e,!0)?.searchStorages;Ua([a[void 0],a[t]].filter(Boolean)).forEach(r=>{for(const p in r){const d=r[p];if(n?.has(d)||!d.filterMessage(e))continue;const{first:f,last:c}=d.history,{mid:l}=e;let m=!0;if(f.isEnd(Le.Bottom)&&f[0]<l)d.history.unshift(l);else if(c.isEnd(Le.Top)&&c[c.length-1]>l)d.history.push(l);else{const u=d.history.findSliceOffset(l),M=u?.slice||[],A=M.findIndex(I=>l>I),w=M[A],C=M[A-1];w&&C?M.splice(A,0,l):(m=!1,this.log.error("cannot insert message for search filter",e,u,d))}m&&(d.onMidInsertion(l),++d.count),this.log("inserting message for search filter",e.mid,p)}})}updateMessageContext(e){this.updateMessageContextForDeletion(e),this.updateMessageContextForInserting(e)}modifyMessage(e,t,a,s){return e=t(e)||e,a!==!1&&this.onMessageModification(e,a),s||this.setDialogToStateIfMessageIsTop(e),this.updateMessageContext(e),e}mirrorAllMessages(e){const t={};[this.messagesStorageByPeerId,this.scheduledMessagesStorage].forEach(a=>{for(const s in a){const n=a[s];t[n.key]=Object.fromEntries(n.entries())}}),Be.getInstance().invokeVoid("mirror",{name:"messages",value:t},e)}getMessagesStorageByKey(e){const t=e.split("_"),a=+t[0];return t[1]==="scheduled"?this.getScheduledMessagesStorage(a):this.getHistoryMessagesStorage(a)}getMessageFromStorage(e,t){return e=this.getMessagesStorage(e),e?.type==="history"&&ia(t)&&(e=this.getGlobalHistoryMessagesStorage()),e?.get(t)}setMessageToStorage(e,t){e=this.getMessagesStorage(e);const{mid:a}=t;if(e?.type==="history"&&ia(a)&&e.peerId!==Ha){const s=this.getGlobalHistoryMessagesStorage();this.setMessageToStorage(s,t)}return e.type!=="grouped"&&Be.getInstance().invokeVoid("mirror",{name:"messages",key:$a(e.key,a),value:t}),e?.set(a,t)}deleteMessageFromStorage(e,t){if(e?.type==="history"&&ia(t)&&e.peerId!==Ha){const a=this.getGlobalHistoryMessagesStorage();this.deleteMessageFromStorage(a,t)}return e.type!=="grouped"&&Be.getInstance().invokeVoid("mirror",{name:"messages",key:$a(e.key,t)}),e?.delete(t)}createMessageStorage(e,t){const a=new Map;return a.peerId=e,a.type=t,a.key=`${e}_${t}`,a}getHistoryMessagesStorage(e){var t;return(t=this.messagesStorageByPeerId)[e]??(t[e]=this.createMessageStorage(e,"history"))}getGlobalHistoryMessagesStorage(){return this.getHistoryMessagesStorage(Ha)}getMessagesStorage(e){return typeof e=="object"?e:this.getMessagesStorageByKey(e)}getMessageById(e){return ia(e)?this.getMessageFromStorage(this.getGlobalHistoryMessagesStorage(),e):this.generateEmptyMessage(e)}getMessageByPeer(e,t){return e?this.getMessageFromStorage(this.getHistoryMessagesStorage(e),t):this.getMessageById(t)}getMessagePeer(e){return e?.peer_id&&this.appPeersManager.getPeerId(e.peer_id)||lt}getDialogOnly(e){return this.dialogsStorage.getDialogOnly(e)}cantForwardDeleteMids(e,t){const a=this.getMessagesStorage(e);let s=!t.length,n=!t.length;for(const i of t){const r=this.getMessageFromStorage(a,i);if(s||(s=!this.canForward(r)),n||(n=!this.canDeleteMessage(r)),s&&n)break}return{cantForward:s,cantDelete:n}}reloadConversationOrTopic(e,t){t?this.dialogsStorage.getForumTopicById(e,t):this.reloadConversation(e)}reloadConversation(e,t){const a=this.log.bindPrefix("reloadConversation");let s;if(e!==void 0){const n=this.appPeersManager.getPeerId(e);let i=this.reloadConversationsPeers.get(n);if(i&&(t||!i.sentRequest)&&(s=i.promise),a.warn({peerId:n,throttled:!!s,sentRequest:i?.sentRequest}),s)return s;s=Pe(),this.reloadConversationsPeers.set(n,i={inputDialogPeer:this.appPeersManager.getInputDialogPeerById(e),promise:s})}return this.reloadConversationsPromise?s||this.reloadConversationsPromise:(a("creating throttled promise"),this.reloadConversationsPromise=rt(0).then(()=>{const n=new Map(this.reloadConversationsPeers),i=[...n.values()].map(d=>(d.sentRequest=!0,d.inputDialogPeer)),r=()=>{a("fullfilling left",n);for(const[d,f]of n)this.reloadConversationsPeers.get(d)===f&&this.reloadConversationsPeers.delete(d),f.promise.resolve(void 0)};return(async()=>{for(;;){const d=await this.apiManager.invokeApi("messages.getPeerDialogs",{peers:i},{floodMaxTimeout:1/0}),f=this.apiUpdatesManager.updatesState,{state:c}=d;if(f.pts&&f.pts!==c.pts){this.log.warn("current pts is different, will try again",f.pts,c.pts),await rt(500);continue}return d}})().then(d=>{a("result",d);for(const[f,c]of n)this.reloadConversationsPeers.get(f)===c&&this.reloadConversationsPeers.delete(f);this.dialogsStorage.applyDialogs(d),d.dialogs.forEach(f=>{const c=f.peerId;if(!c)return;n.get(c).promise.resolve(f),n.delete(c)})},d=>{a.error(d)}).then(()=>{r(),this.reloadConversationsPromise=null,this.reloadConversationsPeers.size&&this.reloadConversation()})}),s||this.reloadConversationsPromise)}doFlushHistory(e,t,a,s,n){const i=this.appPeersManager.isSavedDialog(e,s);let r;const p=d=>{if(this.apiUpdatesManager.processLocalUpdate({_:"updatePts",pts:d.pts,pts_count:d.pts_count}),!d.offset){let f;if(n?f=c=>c.fromId===n:i&&(f=c=>{const l=c.saved_peer_id;return l?this.appPeersManager.getPeerId(l)===s:c.fromId===this.appPeersManager.peerId}),f){const c=this.getHistoryMessagesStorage(e),l=[];for(const[m,u]of c)f(u)&&l.push(m);this.apiUpdatesManager.processLocalUpdate(e.isUser()?{_:"updateDeleteMessages",messages:l,pts:void 0,pts_count:void 0}:{_:"updateDeleteChannelMessages",channel_id:e.toChatId(),messages:l,pts:void 0,pts_count:void 0})}return!0}return this.doFlushHistory(e,t,a,s)};return n?r=this.apiManager.invokeApiSingleProcess({method:"channels.deleteParticipantHistory",params:{channel:this.appChatsManager.getChannelInput(e.toChatId()),participant:this.appPeersManager.getInputPeerById(n)},processResult:p}):s?i?r=this.apiManager.invokeApiSingleProcess({method:"messages.deleteSavedHistory",params:{peer:this.appPeersManager.getInputPeerById(s),max_id:0},processResult:p}):r=this.apiManager.invokeApiSingleProcess({method:"channels.deleteTopicHistory",params:{channel:this.appChatsManager.getChannelInput(e.toChatId()),top_msg_id:ae(s)},processResult:p}):r=this.apiManager.invokeApiSingleProcess({method:"messages.deleteHistory",params:{just_clear:t,revoke:a,peer:this.appPeersManager.getInputPeerById(e),max_id:0},processResult:p}),r}async flushHistory(e,t,a,s){if(this.appPeersManager.isChannel(e)&&!s){const i=await this.getHistory({peerId:e,offsetId:0,limit:1}),r=e.toChatId(),p=i.history[0]||0;return this.apiManager.invokeApiSingle("channels.deleteHistory",{channel:this.appChatsManager.getChannelInput(r),max_id:ae(p)}).then(d=>(d&&this.apiUpdatesManager.processLocalUpdate({_:"updateChannelAvailableMessages",channel_id:r,available_min_id:p}),d))}return this.doFlushHistory(e,t,a,s).then(()=>{if(s||this.flushStoragesByPeerId(e),t)this.rootScope.dispatchEvent("dialog_flush",{peerId:e,dialog:this.getDialogOnly(e)});else{const n=this.getTypingKey(e,s);if(delete this.notificationsToHandle[n],delete this.typings[n],!s){const i=this.reloadConversationsPeers.get(e);i&&(this.reloadConversationsPeers.delete(e),i.promise.resolve(void 0))}this.dialogsStorage.dropDialogOnDeletion(e,s)}})}flushStoragesByPeerId(e){[this.historiesStorage,this.threadsStorage,this.searchesStorage,this.pendingAfterMsgs,this.pendingTopMsgs].forEach(a=>{delete a[e]});for(const a in this.pinnedMessages)(+a===e||a.startsWith(e+"_"))&&delete this.pinnedMessages[a];const t=this.needSingleMessages.get(e);if(t){for(const[a,s]of t)s.resolve(this.generateEmptyMessage(a));t.clear()}[this.messagesStorageByPeerId,this.scheduledMessagesStorage].forEach(a=>{const s=a[e];if(s){if(s.type==="history"&&(s.forEach((n,i)=>{delete this.references[e+"_"+i]}),!this.appPeersManager.isChannel(e))){const n=this.getGlobalHistoryMessagesStorage();s.forEach((i,r)=>{this.deleteMessageFromStorage(n,r)})}s.clear(),delete a[e]}}),this.dialogsStorage.flushForumTopicsCache(e)}hidePinnedMessages(e){return Promise.all([this.appStateManager.getState(),this.getPinnedMessage(e)]).then(([t,a])=>{t.hiddenPinnedMessages[e]=a.maxId,this.rootScope.dispatchEvent("peer_pinned_hidden",{peerId:e,maxId:a.maxId})})}getPinnedMessagesKey(e,t){return e+(t?"_"+t:"")}getPinnedMessage(e,t){var s,n;const a=(s=this.pinnedMessages)[n=this.getPinnedMessagesKey(e,t)]??(s[n]={});return a.promise?a.promise:a.maxId?Promise.resolve(a):a.promise=Promise.resolve(this.getHistory({peerId:e,inputFilter:{_:"inputMessagesFilterPinned"},offsetId:0,limit:1,threadId:t})).then(i=>(a.count=i.count,a.maxId=i.history[0],a)).finally(()=>{delete a.promise})}getPinnedMessagesCount(e,t){return this.pinnedMessages[this.getPinnedMessagesKey(e,t)]?.count}getPinnedMessagesMaxId(e,t){return this.pinnedMessages[this.getPinnedMessagesKey(e,t)]?.maxId}updatePinnedMessage(e,t,a,s,n){return this.apiManager.invokeApi("messages.updatePinnedMessage",{peer:this.appPeersManager.getInputPeerById(e),unpin:a,silent:s,pm_oneside:n,id:ae(t)}).then(i=>{this.apiUpdatesManager.processUpdateMessage(i)})}unpinAllMessages(e){return this.apiManager.invokeApiSingle("messages.unpinAllMessages",{peer:this.appPeersManager.getInputPeerById(e)}).then(t=>(this.apiUpdatesManager.processLocalUpdate({_:"updatePts",pts:t.pts,pts_count:t.pts_count}),t.offset?this.unpinAllMessages(e):(this.getHistoryMessagesStorage(e).forEach(s=>{s.pFlags.pinned&&delete s.pFlags.pinned}),this.rootScope.dispatchEvent("peer_pinned_messages",{peerId:e,unpinAll:!0}),delete this.pinnedMessages[this.getPinnedMessagesKey(e)],!0)))}getGroupedText(e){const t=this.groupedMessagesStorage[e];return Sp(Array.from(t.values()))}getGroupsFirstMessage(e){if(!e?.grouped_id)return e;const t=this.groupedMessagesStorage[e.grouped_id];let a=Number.MAX_SAFE_INTEGER;for(const[s,n]of t)n.mid<a&&(a=n.mid);return this.getMessageFromStorage(t,a)}getMidsByGroupedId(e,t="asc"){return un(this.groupedMessagesStorage[e],t)}getMessagesByGroupedId(e){const t=this.getMidsByGroupedId(e,"asc"),a=this.groupedMessagesStorage[e];return t.map(s=>this.getMessageFromStorage(a,s))}getMidsByMessage(e){return e?e.grouped_id?this.getMidsByGroupedId(e.grouped_id):[e.mid]:[]}filterMessages(e,t){const a=[];if(e.grouped_id){const s=this.groupedMessagesStorage[e.grouped_id];for(const[n,i]of s)t(i)&&a.push(i)}else t(e)&&a.push(e);return a}generateTempMessageId(e,t,a){if(!t){const r=this.getDialogOnly(e),p=this.historiesStorage[e];t=(r?.top_message??p?.maxId)||0}const s=this.tempMids[e];s&&s>t&&!a&&(t=s);const n=this.appPeersManager.isChannel(e)?e.toChatId():void 0,i=this.appMessagesIdsManager.generateTempMessageId(t,n);return(!s||i>s)&&(this.tempMids[e]=i),i}setMessageUnreadByDialog(e,t=this.getDialogOnly(e.peerId)){Ye(t)||t&&e.mid&&e.mid>t[e.pFlags.out?"read_outbox_max_id":"read_inbox_max_id"]&&(e.pFlags.unread=!0)}saveMessage(e,t={}){var w,C;if(!e||e._==="messageEmpty")return;e.pFlags??(e.pFlags={});const a=!!e.peerId,s=this.getMessagePeer(e),n=t.storage||this.getHistoryMessagesStorage(s),i=e.peer_id._==="peerChannel",r=i&&this.appChatsManager.isBroadcast(s.toChatId()),p=e._==="message",d=i?s.toChatId():void 0;t.isOutgoing&&(e.pFlags.is_outgoing=!0);const f=this.appMessagesIdsManager.generateMessageId(e.id,d);if(e.mid=f,p){if(t.isScheduled&&(e.pFlags.is_scheduled=!0),e.grouped_id){const I=(w=this.groupedMessagesStorage)[C=e.grouped_id]??(w[C]=this.createMessageStorage(s,"grouped"));this.setMessageToStorage(I,e)}e.via_bot_id&&(e.viaBotId=e.via_bot_id)}const c={type:"message",peerId:s,messageId:f},l=e.reply_to;if(l&&l._==="messageReplyHeader"){const I=l.reply_to_peer_id?.channel_id||d;l.reply_to_msg_id&&(l.reply_to_msg_id=e.reply_to_mid=this.appMessagesIdsManager.generateMessageId(l.reply_to_msg_id,I)),l.reply_to_top_id&&(l.reply_to_top_id=this.appMessagesIdsManager.generateMessageId(l.reply_to_top_id,I)),this.saveMessageMedia(l,c,t.isScheduled)}const m=p&&e.replies;m&&(m.max_id&&(m.max_id=this.appMessagesIdsManager.generateMessageId(m.max_id,m.channel_id)),m.read_max_id&&(m.read_max_id=this.appMessagesIdsManager.generateMessageId(m.read_max_id,m.channel_id))),a||(e.date-=this.timeManager.getServerTimeOffset());const u=this.appPeersManager.peerId,M=p&&e.fwd_from;if(e.peerId=s,s===u){if(p&&!e.saved_peer_id){let F;M?M.saved_from_peer?e.saved_peer_id=M.saved_from_peer:M.from_id?F=u:M.from_name?F=ar:F=u:F=u,e.saved_peer_id||(e.saved_peer_id=this.appPeersManager.getOutputPeer(F))}const I=M?.saved_from_id||M?.from_id;e.fromId=M?I&&!Ep(M)?this.appPeersManager.getPeerId(I):lt:u}else e.fromId=e.pFlags.post||!e.from_id?s:this.appPeersManager.getPeerId(e.from_id);if(this.setMessageUnreadByDialog(e),M){M.saved_from_msg_id&&(M.saved_from_msg_id=this.appMessagesIdsManager.generateMessageId(M.saved_from_msg_id,M.saved_from_peer.channel_id)),M.channel_post&&(M.channel_post=this.appMessagesIdsManager.generateMessageId(M.channel_post,M.from_id.channel_id));const I=M.saved_from_peer||M.from_id,F=M.saved_from_msg_id||M.channel_post;if(I&&F){const L=this.appPeersManager.getPeerId(I),z=this.appMessagesIdsManager.generateMessageId(F,I.channel_id);e.savedFrom=L+"_"+z}e.fwdFromId=this.appPeersManager.getPeerId(M.from_id),a||(M.date-=this.timeManager.getServerTimeOffset())}const A=this.saveMessageMedia(e,c,t.isScheduled);if(p&&A&&(e.media={_:"messageMediaUnsupported"},e.message="",delete e.entities,delete e.totalEntities),!p&&e.action){const I=e.action,F=e.fromId===this.appUsersManager.getSelf().id?"You":"";let L,z;switch(I.photo&&(I.photo=this.appPhotosManager.savePhoto(I.photo,c)),I.document&&(I.document=this.appDocsManager.saveDoc(I.photo,c)),I._){case"messageActionChatEditPhoto":I.photo?.video_sizes?I._=r?"messageActionChannelEditVideo":"messageActionChatEditVideo":r&&(I._="messageActionChannelEditPhoto");break;case"messageActionGroupCall":{this.appGroupCallsManager.saveGroupCall(I.call);let j;I.duration===void 0?j="started":j="ended",r||(j+="_by"+F),I.type=j;break}case"messageActionChatEditTitle":r&&(I._="messageActionChannelEditTitle");break;case"messageActionChatDeletePhoto":r&&(I._="messageActionChannelDeletePhoto");break;case"messageActionChatAddUser":I.users.length===1?(I.user_id=I.users[0],e.fromId===I.user_id&&(i?I._="messageActionChatJoined"+F:I._="messageActionChatReturn"+F)):I.users.length>1&&(I._="messageActionChatAddUsers");break;case"messageActionChatDeleteUser":e.fromId===I.user_id&&(I._="messageActionChatLeave"+F);break;case"messageActionChannelMigrateFrom":L=I.chat_id.toPeerId(!0),z=s;break;case"messageActionChatMigrateTo":L=s,z=I.channel_id.toPeerId(!0);break;case"messageActionHistoryClear":e.clear_history=!0,delete e.pFlags.out,delete e.pFlags.unread;break;case"messageActionPhoneCall":I.type=(I.pFlags.video?"video_":"")+(I.duration!==void 0?e.pFlags.out?"out_":"in_":"")+(I.duration!==void 0?"ok":I.reason._==="phoneCallDiscardReasonMissed"?"missed":"cancelled");break}L&&z&&!this.getMigration(L)&&this.migrateChecks(L,z)}return p&&e.message.length&&!e.totalEntities&&this.wrapMessageEntities(e),this.setMessageToStorage(n,e),e}saveMessages(e,t={}){return!e||e.saved||(e.saved=!0,e.forEach((a,s,n)=>{n[s]=this.saveMessage(a,t)})),e}saveMessageMedia(e,t,a){const s="media"in e?"media":"reply_media",n=e[s];if(!n)return;let i=!1;switch(n._){case"messageMediaEmpty":{delete e[s];break}case"messageMediaPhoto":{n.ttl_seconds?i=!0:n.photo=this.appPhotosManager.savePhoto(n.photo,t),n.photo||delete e[s];break}case"messageMediaPoll":{const r=this.appPollsManager.savePoll(n.poll,n.results,e.peerId&&e);n.poll=r.poll,n.results=r.results;break}case"messageMediaDocument":{if(n.ttl_seconds)i=!0;else{const r=n.document;n.document=this.appDocsManager.saveDoc(r,t),n.alt_document&&(n.alt_document=this.appDocsManager.saveDoc(n.alt_document,t)),!n.document&&r._!=="documentEmpty"&&(i=!0)}break}case"messageMediaWebPage":{const r=e.peerId?this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,a):void 0;n.webpage=this.appWebPagesManager.saveWebPage(n.webpage,r,t),n.webpage||delete e[s];break}case"messageMediaInvoice":{n.photo=this.appWebDocsManager.saveWebDocument(n.photo);const r=n.extended_media;if(r?._==="messageExtendedMedia"){const p=r.media;p.photo=this.appPhotosManager.savePhoto(p.photo,t),p.document=this.appDocsManager.saveDoc(p.document,t)}break}case"messageMediaStory":{const r=this.appStoriesManager.getPeerStoriesCache(this.appPeersManager.getPeerId(n.peer));n.story=this.appStoriesManager.saveStoryItems([n.story],r)[0];break}case"messageMediaGiveawayResults":{n.launch_msg_id=this.appMessagesIdsManager.generateMessageId(n.launch_msg_id,n.channel_id);break}case"messageMediaPaidMedia":{n.extended_media.forEach(r=>{r._==="messageExtendedMedia"&&this.saveMessageMedia(r,t,a)});break}case"messageMediaUnsupported":{i=!0;break}}return i}saveApiResult(e){this.appPeersManager.saveApiPeers(e),this.saveMessages(e.messages)}async getFirstMessageToEdit(e,t){const s=this.getHistoryStorage(e,t).history.slice;if(s.isEnd(Le.Bottom)&&s.length){let n;const i=this.appPeersManager.peerId;for(const r of s){const p=this.getMessageByPeer(e,r);if((i===e?p.fromId===i:p.pFlags.out)&&await this.canEditMessage(p,"text")){n=p;break}}return n}}wrapMessageEntities(e){if("message"in e){const{message:t,totalEntities:a}=Mn(e.message,e.entities);e.message=t,e.totalEntities=a}else{const{message:t,totalEntities:a}=Mn(e.text,e.entities);e.text=t,e.entities=a}}reportMessages(e,t,a,s){return this.apiManager.invokeApiSingle("messages.report",{peer:this.appPeersManager.getInputPeerById(e),id:t.map(n=>ae(n)),reason:{_:a},message:s})}async unblockBot(e){await this.appProfileManager.isUserBlocked(e)&&await this.appUsersManager.toggleBlock(e.toPeerId(!1),!1)}async startBot(e,t,a){const s=t?t.toPeerId(!0):e.toPeerId();if(t||await this.unblockBot(e),a){const i=qt();return this.apiManager.invokeApi("messages.startBot",{bot:this.appUsersManager.getUserInput(e),peer:this.appPeersManager.getInputPeerById(s),random_id:i,start_param:a}).then(r=>{this.apiUpdatesManager.processUpdateMessage(r)})}const n="/start";if(t){let i;return this.appChatsManager.isChannel(t)?i=this.appChatsManager.inviteToChannel(t,[e]):i=this.appChatsManager.addChatUser(t,e,0),i.catch(r=>{if(r?.type=="USER_ALREADY_PARTICIPANT"){r.handled=!0;return}throw r}).then(()=>this.sendText({peerId:s,text:n+"@"+this.appPeersManager.getPeerUsername(e.toPeerId())}))}return this.sendText({peerId:s,text:n})}editPeerFolders(e,t){this.apiManager.invokeApi("folders.editPeerFolders",{folder_peers:e.map(a=>({_:"inputFolderPeer",peer:this.appPeersManager.getInputPeerById(a),folder_id:t}))}).then(a=>{const s=e[0];e.length===1&&t===ct&&this.appProfileManager.refreshPeerSettingsIfNeeded(s),this.apiUpdatesManager.processUpdateMessage(a)})}getFilter(e){return this.filtersStorage.getFilter(e)}async toggleDialogPin(e){let{peerId:t,topicOrSavedId:a,filterId:s}=e;if(s!==void 0&&!je.has(s))return this.filtersStorage.toggleDialogPin(t,s);const n=this.dialogsStorage.getAnyDialog(t,a);if(!n)throw void 0;const i=Ye(n),r=Je(n),p=yt(n);s??(s=this.dialogsStorage.getDialogFilterId(n));const d=n.pFlags?.pinned?void 0:!0;if(d){let c;i?c="savedPin":r?c="topicPin":c=s===Dt?"folderPin":"pin";const l=await this.apiManager.getLimit(c);if(this.dialogsStorage.getPinnedOrders(s).length>=l)throw Ee(p?"PINNED_DIALOGS_TOO_MUCH":"PINNED_TOO_MUCH")}if(r)return this.appChatsManager.updatePinnedForumTopic(t.toChatId(),a,d);let f;return i?f=this.apiManager.invokeApi("messages.toggleSavedDialogPin",{peer:this.appPeersManager.getInputDialogPeerById(a),pinned:d}):f=this.apiManager.invokeApi("messages.toggleDialogPin",{peer:this.appPeersManager.getInputDialogPeerById(t),pinned:d}),f.then(()=>{const c=d?{pinned:d}:{},l=this.appPeersManager.getDialogPeer(i?a:t);this.apiUpdatesManager.saveUpdate(i?{_:"updateSavedDialogPinned",peer:l,pFlags:c}:{_:"updateDialogPinned",peer:l,folder_id:s,pFlags:c})})}async markDialogUnread(e,t){const a=this.getDialogOnly(e);if(!a)return Promise.reject();if(this.appPeersManager.isForum(e)&&!a.pFlags.view_forum_as_messages&&(t||await this.dialogsStorage.getForumUnreadCount(e))){const n=this.dialogsStorage.getFolder(e);for(const i of n.unreadPeerIds){const r=this.dialogsStorage.getForumTopic(e,i);this.readHistory(e,r.top_message,i,!0)}return}const s=t||a.pFlags?.unread_mark?void 0:!0;if(!s&&a.unread_count){const n=this.readHistory(e,a.top_message,void 0,!0);if(!a.pFlags.unread_mark)return n}return this.apiManager.invokeApi("messages.markDialogUnread",{peer:this.appPeersManager.getInputDialogPeerById(e),unread:s}).then(()=>{const n=s?{unread:s}:{};this.onUpdateDialogUnreadMark({_:"updateDialogUnreadMark",peer:this.appPeersManager.getDialogPeer(e),pFlags:n})})}migrateChecks(e,t){if(!this.getMigration(e)&&this.appChatsManager.hasChat(t.toChatId())){const a=this.appChatsManager.getChat(e.toChatId());a?.migrated_to&&a.migrated_to.channel_id===t.toChatId()&&(this.migratedFromTo[e]=t,this.migratedToFrom[t]=e,this.rootScope.dispatchEvent("dialog_migrate",{migrateFrom:e,migrateTo:t}),this.dialogsStorage.dropDialogWithEvent(e))}}canMessageBeEdited(e,t){if(e?.pFlags?.is_outgoing)return!1;const a=["messageMediaPhoto","messageMediaDocument","messageMediaWebPage"];return t==="poll"&&a.push("messageMediaPoll"),!(!e||e._!=="message"||e.fwd_from||e.via_bot_id||e.media&&a.indexOf(e.media._)===-1||e.fromId&&this.appUsersManager.isBot(e.fromId)||e.media?._==="messageMediaDocument"&&(e.media.document.sticker||e.media.document.type==="round"))}async canEditMessage(e,t="text"){if(!e||!this.canMessageBeEdited(e,t))return!1;if(this.getMessagePeer(e)===this.appUsersManager.getSelf().id)return!0;const{peerId:a}=e;return!(!(this.appPeersManager.isBroadcast(a)?this.appChatsManager.hasRights(a.toChatId(),"edit_messages"):(a.isAnyChat()&&t==="text"?!this.getMigration(e.peerId)?.next&&(this.appChatsManager.hasRights(a.toChatId(),"send_plain")||this.appChatsManager.hasRights(a.toChatId(),"send_media")):!0)&&e.pFlags.out)||e.peer_id._!=="peerChannel"&&e.date<Ie(!0)-(await this.apiManager.getConfig()).edit_time_limit&&e.media?._!=="messageMediaPoll")}canDeleteMessage(e){return e&&(e.peerId.isUser()||e.pFlags.out||this.appChatsManager.getChat(e.peerId.toChatId())._==="chat"||this.appChatsManager.hasRights(e.peerId.toChatId(),"delete_messages"))&&(!e.pFlags.is_outgoing||!!e.error)}getReplyKeyboard(e){return this.getHistoryStorage(e).replyMarkup}mergeReplyKeyboard(e,t){if(!t)return!1;const a=t.reply_markup;if(!a&&!t.pFlags?.out&&!t.action||a?._==="replyInlineMarkup")return!1;const s=e.replyMarkup;if(a)return s&&s.mid>=t.mid||a.pFlags.selective?!1:(e.maxOutId&&t.mid<e.maxOutId&&a.pFlags.single_use&&(a.pFlags.hidden=!0),a.mid=t.mid,a._!=="replyKeyboardHide"&&(a.fromId=this.appPeersManager.getPeerId(t.from_id||t.peer_id)),e.replyMarkup=a,!0);if(t.pFlags.out)if(s){if(s.pFlags.single_use&&!s.pFlags.hidden&&(t.mid>s.mid||t.pFlags.is_outgoing)&&t.message)return s.pFlags.hidden=!0,!0}else(!e.maxOutId||t.mid>e.maxOutId)&&(e.maxOutId=t.mid);return t.action?._==="messageActionChatDeleteUser"&&(s?t.action.user_id===s.fromId:this.appUsersManager.isBot(t.action.user_id))?(e.replyMarkup={_:"replyKeyboardHide",mid:t.mid,pFlags:{}},!0):!1}getReferenceContext(e,t,a){const s=e+"_"+t;let n=this.references[s];return!n&&!a&&(n=this.references[s]={}),n}getReferenceContextByMessage(e,t){return this.getReferenceContext(e.peerId,e.mid,t)}getSearchStorage(e){var i,r,p,d,f,c;const t={...e,type:"search"};if(vn(e)==="uncached")return this.createHistoryStorage(t);const a=ki(t),s=Sn(t);let n;if(e.isCacheableSearch?n=(i=this.searchesStorage)[s]??(i[s]=this.createHistoryStorage(t)):n=(c=(d=(r=this.searchesStorage)[p=e.peerId]??(r[p]={}))[f=e.threadId]??(d[f]={}))[a]??(c[a]=this.createHistoryStorage(t)),e.isCacheableSearch){if(!n.searchHistory){const l=n.searchHistory=new ea;l.insertSlice=m=>(l.first.push(...m),l.first),l.findOffsetInSlice=(m,u)=>{const M=u.indexOf(m);if(M!==-1)return{slice:u,offset:M+1}}}}else n.originalInsertSlice||(n.originalInsertSlice=n.history.insertSlice.bind(n.history),n.history.insertSlice=(...l)=>{const m=n.originalInsertSlice(...l);return m&&l[0].forEach(u=>{n.onMidInsertion(u)}),m},n.filterMessages=l=>yn({inputFilter:e.inputFilter._,limit:l.length,messages:l,savedReaction:e.savedReaction}),n.filterMessage=l=>!!n.filterMessages([l]).length,n.onMidInsertion=l=>{const m=this.getReferenceContext(e.peerId,l);(m.searchStorages??(m.searchStorages=new Set)).add(n)});return n}getSearchCounters(e,t,a=!0,s){if(e=this.appPeersManager.getPeerMigratedTo(e)||e,this.appPeersManager.isPeerRestricted(e))return Promise.resolve(t.map(f=>({_:"messages.searchCounter",pFlags:{},filter:f,count:0})));const n=this.getHistoryType(e,s),i=this.getMigration(e),r="messages.getSearchCounters",p=(a?this.apiManager.invokeApiCacheable:this.apiManager.invokeApi).bind(this.apiManager),d=p(r,{peer:this.appPeersManager.getInputPeerById(e),filters:t,top_msg_id:s&&n!==3?ae(s):void 0,saved_peer_id:n===3?this.appPeersManager.getInputPeerById(s):void 0},{cacheSeconds:6e4});if(i){const f=p(r,{peer:this.appPeersManager.getInputPeerById(i.prev),filters:t});return Promise.all([d,f]).then(([c,l])=>c.map((u,M)=>({...u,count:u.count+l[M].count})))}return d}filterMessagesByInputFilterFromStorage(e,t,a,s){const n=this.getMessagesStorage(a);return yn({inputFilter:e,messages:t.map(i=>n.get(i)),limit:s})}subscribeRepliesThread(e,t){const a=e+"_"+t;for(const s in this.threadsToReplies)if(this.threadsToReplies[s]===a)return;this.getDiscussionMessage(e,t)}generateThreadServiceStartMessage(e){const{peerId:t,mid:a}=e,s=t+"_"+a,n=this.threadsServiceMessagesIdsStorage[s];if(n)return n;const i=Math.max(...this.getMidsByMessage(e)),r={_:"messageService",pFlags:{is_single:!0},id:this.generateTempMessageId(t,i,!0),date:e.date,from_id:{_:"peerUser",user_id:lt},peer_id:e.peer_id,action:{_:"messageActionDiscussionStarted"},reply_to:this.generateReplyHeader(t,this.getInputReplyTo({replyToMsgId:a,threadId:a}))};return this.saveMessages([r],{isOutgoing:!0}),this.threadsServiceMessagesIdsStorage[s]=r.mid}getThreadServiceMessageId(e,t){return this.threadsServiceMessagesIdsStorage[e+"_"+t]}getDiscussionMessage(e,t){return this.apiManager.invokeApiSingle("messages.getDiscussionMessage",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}).then(a=>{this.saveApiResult(a);const s=this.getMessageWithReplies(a.messages[0]),n=s.peerId+"_"+s.mid,i=s.peerId.toChatId();this.log("got discussion message",e,t,a,s.peerId,s.mid);const r=this.getHistoryStorage(s.peerId,s.mid),p=a.max_id=this.appMessagesIdsManager.generateMessageId(a.max_id,i)||0;a.read_inbox_max_id=r.readMaxId=this.appMessagesIdsManager.generateMessageId(a.read_inbox_max_id??s.mid,i),a.read_outbox_max_id=r.readOutboxMaxId=this.appMessagesIdsManager.generateMessageId(a.read_outbox_max_id,i)||0;const d=r.history.first;return r.maxId&&r.maxId<p&&d.isEnd(Le.Bottom)&&d.unsetEnd(Le.Bottom),r.maxId=p,this.threadsToReplies[n]=e+"_"+t,s})}handleNewMessage(e){this.rootScope.dispatchEvent("history_multiappend",e)}scheduleHandleNewDialogs(e,t){if(e!==void 0){let a=this.newDialogsToHandle.get(e);a||this.newDialogsToHandle.set(e,a={});const s=typeof t=="object";if(!t||s&&yt(t))a.dialog=t;else{const n=s?At(t):t,i=this.getHistoryType(e,n)===3?a.saved??(a.saved=new Map):a.topics??(a.topics=new Map);s?i.set(n,t):i.set(n,void 0)}}return this.newDialogsHandlePromise??(this.newDialogsHandlePromise=rt(0).then(()=>{this.newDialogsHandlePromise=void 0,this.handleNewDialogs()}))}async deleteMessagesInner(e,t,a,s){let n;if(e&&!s){const f=this.appChatsManager.getChat(e);if(!f.pFlags.creator&&!f.admin_rights?.pFlags?.delete_messages&&(t=t.filter(c=>!!this.getMessageByPeer(e.toPeerId(!0),c).pFlags.out),!t.length))return}const i=await this.apiManager.getConfig(),r=t.splice(i.forwarded_count_max,t.length-i.forwarded_count_max),p=t.map(f=>{const c=ae(f);return this.appMessagesIdsManager.generateMessageId(c,e)===f&&c}).filter(Boolean);e?n=this.apiManager.invokeApi("channels.deleteMessages",{channel:this.appChatsManager.getChannelInput(e),id:p}).then(f=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteChannelMessages",channel_id:e,messages:t,pts:f.pts,pts_count:f.pts_count})}):n=this.apiManager.invokeApi("messages.deleteMessages",{revoke:a,id:p}).then(f=>{this.apiUpdatesManager.processLocalUpdate({_:"updateDeleteMessages",messages:t,pts:f.pts,pts_count:f.pts_count})});const d=[n];return r.length&&d.push(this.deleteMessagesInner(e,r,a,!0)),Promise.all(d).then(Ge)}deleteMessages(e,t,a){const s=this.appPeersManager.isChannel(e)?e.toChatId():void 0,i=this.appMessagesIdsManager.splitMessageIdsByChannels(t,s).map(([r,{mids:p}])=>this.deleteMessagesInner(r,p,a));return Promise.all(i).then(Ge)}readHistory(e,t=0,a,s=!1){if(this.log("readHistory:",e,t,a),!this.getReadMaxIdIfUnread(e,a)){if(a&&!s){const p=this.dialogsStorage.getForumTopic(e,a);p&&!ae(p.read_inbox_max_id)&&(s=!0)}if(!s){const p=this.appChatsManager.isForum(e.toChatId())&&a?this.dialogsStorage.getForumTopic(e,a):this.getDialogOnly(e);p&&this.isDialogUnread(p)&&(s=!0)}if(!s)return this.log("readHistory: isn't unread"),Promise.resolve()}const i=this.getHistoryStorage(e,a);if(i.triedToReadMaxId>=t)return Promise.resolve();let r;return a?(i.readPromise||(r=this.apiManager.invokeApi("messages.readDiscussion",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(a),read_max_id:ae(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelDiscussionInbox",channel_id:e.toChatId(),top_msg_id:a,read_max_id:t})):this.appPeersManager.isChannel(e)?(i.readPromise||(r=this.apiManager.invokeApi("channels.readHistory",{channel:this.appChatsManager.getChannelInput(e.toChatId()),max_id:ae(t)})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadChannelInbox",max_id:t,channel_id:e.toChatId(),still_unread_count:void 0,pts:void 0})):(i.readPromise||(r=this.apiManager.invokeApi("messages.readHistory",{peer:this.appPeersManager.getInputPeerById(e),max_id:ae(t)}).then(p=>{this.apiUpdatesManager.processLocalUpdate({_:"updatePts",pts:p.pts,pts_count:p.pts_count})})),this.apiUpdatesManager.processLocalUpdate({_:"updateReadHistoryInbox",max_id:t,peer:this.appPeersManager.getOutputPeer(e),still_unread_count:void 0,pts:void 0,pts_count:void 0})),this.rootScope.dispatchEvent("notification_reset",this.appPeersManager.getPeerString(e)),i.readPromise?i.readPromise:(i.triedToReadMaxId=t,r.finally(()=>{delete i.readPromise;const{readMaxId:p}=i;this.log("readHistory: promise finally",t,p),p>t&&this.readHistory(e,p,a,!0)}),i.readPromise=r)}readAllHistory(e,t,a=!1){const s=this.getHistoryStorage(e,t);s.maxId&&this.readHistory(e,s.maxId,t,a)}getUnreadMentionsKey({peerId:e,threadId:t,isReaction:a}){return e+(t?`_${t}`:"")+(a?"_reaction":"")}getDialogUnreadMentions(e,t){return e&&(t?e.unread_reactions_count:e.unread_mentions_count)}fixDialogUnreadMentionsIfNoMessage({peerId:e,threadId:t,isReaction:a,force:s}){const n=this.dialogsStorage.getAnyDialog(e,t);(s||this.getDialogUnreadMentions(n,a))&&this.reloadConversationOrTopic(e)}modifyCachedMentions(e){const{mid:t,add:a}=e,s=this.unreadMentions[this.getUnreadMentionsKey(e)];s&&(a?s.first.isEnd(Le.Top)&&s.insertSlice([t]):t?s.delete(t):(s.slices.splice(1,1/0),s.first.length=0,s.first.setEnd(Le.Both)))}modifyCachedMentionsAndSave(e){const t=this.dialogsStorage.getAnyDialog(e.peerId,e.threadId);if(!t)return;const a=this.dialogsStorage.prepareDialogUnreadCountModifying(t);[[e.addMention,"unread_mentions_count"],[e.addReaction,"unread_reactions_count"]].forEach(([n,i])=>{n!==void 0&&(n?t[i]+=+n:t[i]=Math.max(0,t[i]-Math.max(1,+n)),this.modifyCachedMentions({...e,threadId:Je(t)?e.threadId:void 0,isReaction:i==="unread_reactions_count",add:!!n}))}),a(),this.rootScope.dispatchEvent("dialog_unread",{peerId:e.peerId,dialog:t}),this.dialogsStorage.setDialogToState(t)}fixUnreadMentionsCountIfNeeded({peerId:e,threadId:t,slicedArray:a,isReaction:s}){const n=this.dialogsStorage.getAnyDialog(e,t);!a.length&&this.getDialogUnreadMentions(n,s)&&this.reloadConversationOrTopic(e)}goToNextMention(e){var p;const t=this.getUnreadMentionsKey(e),a=this.goToNextMentionPromises[t];if(a)return a;const s=(p=this.unreadMentions)[t]??(p[t]=new ea),n=s.length,i=s.first.isEnd(Le.Top);if(!n&&i)return this.fixUnreadMentionsCountIfNeeded({...e,slicedArray:s}),Promise.resolve();let r=Promise.resolve();return!i&&n<25&&(r=this.loadNextMentions(e)),this.goToNextMentionPromises[t]=r.then(()=>{const d=s.last,f=d&&d[d.length-1];if(f)return s.delete(f),f;this.fixUnreadMentionsCountIfNeeded({...e,slicedArray:s})}).finally(()=>{delete this.goToNextMentionPromises[t]})}loadNextMentions(e){const{peerId:t}=e,a=this.unreadMentions[this.getUnreadMentionsKey(e)],s=a.first[0]||1,n=50,i=-n,r=n;return this.getUnreadMentions({...e,offsetId:s,addOffset:i,limit:r}).then(p=>{this.mergeHistoryResult({slicedArray:a,historyResult:p,offsetId:s===1?0:s,limit:r,addOffset:i,peerId:t})})}getUnreadMentions({peerId:e,offsetId:t,addOffset:a,limit:s,maxId:n=0,minId:i=0,threadId:r,isReaction:p}){return this.apiManager.invokeApiSingleProcess({method:p?"messages.getUnreadReactions":"messages.getUnreadMentions",params:{peer:this.appPeersManager.getInputPeerById(e),offset_id:ae(t),add_offset:a,limit:s,max_id:ae(n),min_id:ae(i),top_msg_id:r?ae(r):void 0},processResult:d=>(this.saveApiResult(d),d)})}readMessages(e,t){if(!t.length)return Promise.resolve();t=t.map(n=>ae(n));let a,s;if(e.isAnyChat()&&this.appPeersManager.isChannel(e)){const n=e.toChatId();s={_:"updateChannelReadMessagesContents",channel_id:n,messages:t},a=this.apiManager.invokeApi("channels.readMessageContents",{channel:this.appChatsManager.getChannelInput(n),id:t})}else s={_:"updateReadMessagesContents",messages:t,pts:void 0,pts_count:void 0},a=this.apiManager.invokeApi("messages.readMessageContents",{id:t}).then(n=>{s.pts=n.pts,s.pts_count=n.pts_count,this.apiUpdatesManager.processLocalUpdate(s)});return this.apiUpdatesManager.processLocalUpdate(s),a}async readMentions(e,t,a){return this.apiManager.invokeApi(a?"messages.readReactions":"messages.readMentions",{peer:this.appPeersManager.getInputPeerById(e),top_msg_id:t?ae(t):void 0}).then(s=>{if(this.apiUpdatesManager.processLocalUpdate({_:"updatePts",pts:s.pts,pts_count:s.pts_count}),!s.offset){const n=this.dialogsStorage.getAnyDialog(e,t);return this.modifyCachedMentionsAndSave({peerId:e,threadId:t,mid:void 0,...a?{addReaction:-n.unread_reactions_count}:{addMention:-n.unread_mentions_count}}),!0}return this.readMentions(e,t,a)})}toggleHistoryKeySubscription(e,t){if(!e)return;const a=this.historyMaxIdSubscribed.get(e)||0;t?this.historyMaxIdSubscribed.set(e,a+1):(a&&(a===1&&this.historyMaxIdSubscribed.delete(e),this.historyMaxIdSubscribed.set(e,a-1)),this.historyMaxIdSubscribed.get(e)||delete this.searchesStorage[e])}getDetailsForChannelJoinedService(e,t,a){if(e.isUser()||t.channelJoinedMid)return;const s=e.toChatId(),n=this.appChatsManager.getChat(s),i=n?.date;if(!i||!this.appChatsManager.isInChat(s)||!n.pFlags.broadcast)return;const r=a?[a]:t.history.slices;for(const p of r){let d,f;for(const m of p){const u=this.getMessageByPeer(e,m);if(!u){this.log.error("no message from historyStorage?",e,t,p,m);debugger;continue}if(u.date>=i)d=u;else{f=u;break}}const c=d||p.isEnd(Le.Bottom),l=f||p.isEnd(Le.Top);if(c&&l)return{date:i,slice:p,newerMessage:d,olderMessage:f}}}insertChannelJoinedService(e,t,a){const s=this.getDetailsForChannelJoinedService(e,t,a);if(!s)return!1;const{date:n,slice:i,newerMessage:r,olderMessage:p}=s,d=this.generateTempMessageId(e,p?.mid||r.mid-1);this.log("will insert channel joined",e,d,r?.mid,p?.mid,i);const f={_:"messageService",pFlags:{is_single:!0,out:!0},id:d,date:n,from_id:{_:"peerUser",user_id:lt},peer_id:this.appPeersManager.getOutputPeer(e),action:{_:"messageActionChannelJoined"}};this.saveMessages([f],{isOutgoing:!0}),Bt(i,d),t.maxId=Math.max(t.maxId,f.mid),t.channelJoinedMid=f.mid,t.originalInsertSlice&&(t.history.insertSlice=t.originalInsertSlice,delete t.originalInsertSlice);const c=this.getDialogOnly(e);return c&&c.top_message<f.mid&&this.setDialogTopMessage(f,c),this.handleNewMessage(f),!0}processNewHistoryStorage(e,t){return this.appPeersManager.isBroadcast(e)&&!t.originalInsertSlice&&(t.originalInsertSlice=t.history.insertSlice.bind(t.history),t.history.insertSlice=(...a)=>{const s=t.originalInsertSlice(...a);return s&&this.insertChannelJoinedService(e,t,s),s}),t}createHistoryStorage(e){const t=this;return{history:new ea,type:e.type,key:Sn(e),_maxId:void 0,_count:null,get count(){return this._count},set count(a){this._count=a,t.historyMaxIdSubscribed.has(this.key)&&t.rootScope.dispatchEvent("history_count",{historyKey:this.key,count:a})},get maxId(){const a=this._maxId;if(a)return a;const s=this.history.first;if(s.isEnd(Le.Bottom))return s[0]},set maxId(a){this._maxId=a}}}getHistoryStorage(e,t){var a,s,n;return t?(s=(a=this.threadsStorage)[e]??(a[e]={}))[t]??(s[t]=this.createHistoryStorage({type:"replies",peerId:e,threadId:t})):(n=this.historiesStorage)[e]??(n[e]=this.processNewHistoryStorage(e,this.createHistoryStorage({type:"history",peerId:e})))}getHistoryStorageTransferable(e){this.processRequestHistoryOptions(e);const t=e.historyStorage,{count:a,history:s,searchHistory:n,maxId:i,readMaxId:r,readOutboxMaxId:p,maxOutId:d,replyMarkup:f}=t;return{count:a,history:void 0,historySerialized:s.toJSON(),searchHistory:void 0,searchHistorySerialized:n?.toJSON(),maxId:i,readMaxId:r,readOutboxMaxId:p,maxOutId:d,replyMarkup:f}}getNotifyPeerSettings(e,t){const a=this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:t});return Promise.all([this.appNotificationsManager.getNotifyPeerTypeSettings(),this.appNotificationsManager.getNotifySettings(a)]).then(([s,n])=>({muted:this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!0,threadId:t}),peerTypeNotifySettings:n}))}getUpdateAfterReloadKey(e,t){return e+(t?"_"+t:"")}handleNewUpdateAfterReload(e,t,a){var n,i;const s=(n=this.newUpdatesAfterReloadToHandle)[i=this.getUpdateAfterReloadKey(e,a)]??(n[i]=new Set);if(s.has(t)){this.log.error("here we go again",e);return}t.ignoreExisting=!0,s.add(t),this.scheduleHandleNewDialogs(e,a)}updateSlowModeOnNewMessage(e){const{peerId:t}=e;if(e.pFlags.out&&!t.isUser()){const a=t.toChatId();this.appProfileManager.modifyCachedFullChat(a,s=>{const n=this.appChatsManager.getChat(a);if(!(s.slowmode_seconds&&!n.admin_rights))return!1;s.slowmode_next_send_date=e.date+s.slowmode_seconds})}}hasOutgoingMessage(e){for(const t in this.pendingByRandomId)if(this.pendingByRandomId[t].peerId===e)return!0;return!1}setDialogToStateIfMessageIsTop(e){this.isMessageIsTopMessage(e)&&this.dialogsStorage.setDialogToState(this.getDialogOnly(e.peerId))}isMessageIsTopMessage(e){const t=this.getDialogOnly(e.peerId);return t&&t.top_message===e.mid}updateMessageRepliesIfNeeded(e,t){try{const a=this.getThreadKey(e);if(a){const s=this.threadsToReplies[a];if(s){const[n,i]=s.split("_");this.updateMessage(n.toPeerId(),+i,"replies_updated")}else if(e.reply_to){const n=+a.split("_").pop(),i=this.getMessageByPeer(e.peerId,n);i?.replies&&this.modifyMessage(i,p=>{const d=p.replies;d.replies=Math.max(0,d.replies+(t?1:-1)),this.rootScope.dispatchEvent("replies_short_update",p)})}}}catch(a){this.log.error("incrementMessageReplies err",a,e)}}getThreadKey(e){let t="";const a=e?.peerId;if(!a)return t;if(a.isAnyChat()||e.saved_peer_id){const s=Pa(e,this.appChatsManager.isForum(a.toChatId()));s&&(t=a+"_"+s)}return t}updateMessage(e,t,a){return this.reloadMessages(e,t,!0).then(()=>{const n=this.getMessageByPeer(e,t);if(n)return a&&this.rootScope.dispatchEvent(a,n),n})}checkPendingMessage(e){const t=this.pendingByMessageId[e.mid];let a;if(t){const s=this.pendingByRandomId[t];(a=this.finalizePendingMessage(t,e))&&this.rootScope.dispatchEvent("history_update",{storageKey:s.storage.key,message:e,sequential:s.sequential}),delete this.pendingByMessageId[e.mid]}return a}mutePeer(e){if(!(e=this.appNotificationsManager.validatePeerSettings(e)))return;const{peerId:t,muteUntil:a,threadId:s}=e,n={_:"inputPeerNotifySettings"};n.mute_until=a;const i=this.appPeersManager.getInputPeerById(t);return this.appNotificationsManager.updateNotifySettings(s?{_:"inputNotifyForumTopic",peer:i,top_msg_id:ae(s)}:{_:"inputNotifyPeer",peer:i},n)}togglePeerMute({peerId:e,mute:t,threadId:a}){return t===void 0&&(t=!this.appNotificationsManager.isPeerLocalMuted({peerId:e,respectType:!1,threadId:a})),this.mutePeer({peerId:e,muteUntil:t?Hn:0,threadId:a})}findPeerIdByMids(e){for(let t=e.length,a=t-1;a>=0;--a){const s=e[a],n=this.getMessageById(s);if(n)return n.peerId}}canSendToPeer(e,t,a="send_messages"){if(this.appPeersManager.isPeerRestricted(e))return!1;if(e.isAnyChat()){const s=e.toChatId();if(t){const n=this.dialogsStorage.getForumTopic(e,t);if(n?.pFlags?.closed&&!this.dialogsStorage.canManageTopic(n))return!1}return this.appChatsManager.hasRights(s,a,void 0,!!t)}else return this.appUsersManager.canSendToUser(e)}finalizePendingMessage(e,t){const a=this.pendingByRandomId[e];if(!a)return;const{peerId:s,tempId:n,threadId:i,storage:r}=a;[this.getHistoryStorage(s),i?this.getHistoryStorage(s,i):void 0].filter(Boolean).forEach(d=>{d.history.delete(n)});const p=this.getMessageFromStorage(r,n);return p&&(this.updateMessageContextForDeletion(p,!0,t.mid),delete t.pFlags.is_outgoing,delete t.pending,delete t.error,delete t.random_id,delete t.send),this.rootScope.dispatchEvent("messages_pending"),delete this.pendingByRandomId[e],this.finalizePendingMessageCallbacks(r,n,t),p}finalizePendingMessageCallbacks(e,t,a){const s=this.tempFinalizeCallbacks[t];if(s!==void 0){for(const i in s){const{deferred:r,callback:p}=s[i];p(a).then(r.resolve.bind(r),r.reject.bind(r))}delete this.tempFinalizeCallbacks[t]}if(a.media){const{photo:i,document:r}=a.media,p=a.media.extended_media,d=(c,l)=>{const m=this.appPhotosManager.getPhoto(l);if(!m)return;const u=c.sizes[c.sizes.length-1],M=this.thumbsStorage.getCacheContext(m,ba);this.thumbsStorage.setCacheContextURL(c,u.type,M.url,M.downloaded)},f=(c,l)=>{const m=this.appDocsManager.getDoc(l);if(!m)return;const u=this.thumbsStorage.getCacheContext(m);m.type&&m.type!=="sticker"&&m.mime_type!=="image/gif"&&u.url&&this.thumbsStorage.setCacheContextURL(c,void 0,u.url,u.downloaded)};if(i)d(i,""+t);else if(r)f(r,""+t);else if(a.media.poll)delete this.appPollsManager.polls[t],delete this.appPollsManager.results[t];else if(p){const c=this.mediaTempMap[t];p.forEach((l,m)=>{const{photo:u}=l.media,{document:M}=l.media,A=""+(c+m);u?d(u,A):M&&f(M,A)})}}const n=this.getMessageFromStorage(e,t);this.deleteMessageFromStorage(e,t),!n.reply_markup&&a.reply_markup&&setTimeout(()=>{this.getMessageFromStorage(e,a.mid)&&this.rootScope.dispatchEvent("message_edit",{storageKey:e.key,peerId:a.peerId,mid:a.mid,message:a})},0),this.handleReleasingMessage(n,e),this.onMessageModification(a,e),this.rootScope.dispatchEvent("message_sent",{storageKey:e.key,tempId:t,tempMessage:n,mid:a.mid,message:a})}incrementMaxSeenId(e){if(!e||!(!this.maxSeenId||e>this.maxSeenId))return!1;this.maxSeenId=e,this.appStateManager.pushToState("maxSeenMsgId",e),this.apiManager.invokeApi("messages.receivedMessages",{max_id:ae(e)})}async getMessageReactionsListAndReadParticipants(e,t,a,s,n,i){const r={reactions:[],count:0,next_offset:void 0},p=await this.canViewMessageReadParticipants(e);return t??(t=p?100:50),Promise.all([p&&!a&&!n?this.getMessageReadParticipants(e.peerId,e.mid).catch(()=>[]):[],e.reactions?.recent_reactions?.length&&!i?this.appReactionsManager.getMessageReactionsList(e.peerId,e.mid,t,a,s).catch(d=>r):r]).then(([d,f])=>{const c=d.slice();Et(c,({user_id:m},u,M)=>{f.reactions.some(A=>this.appPeersManager.getPeerId(A.peer_id)===m.toPeerId())&&M.splice(u,1)});let l=f.reactions.map(m=>({peerId:this.appPeersManager.getPeerId(m.peer_id),reaction:m.reaction,date:m.date}));return l=l.concat(c.map(({user_id:m,date:u})=>({date:u,peerId:m.toPeerId()}))),{reactions:f.reactions,reactionsCount:f.count,readParticipantDates:d,combined:l,nextOffset:f.next_offset}})}getMessageReadParticipants(e,t){return this.apiManager.invokeApiSingle("messages.getMessageReadParticipants",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}).then(a=>(a.forEach(s=>s.user_id=s.user_id.toUserId()),a))}getOutboxReadDate(e,t){return this.apiManager.invokeApiSingle("messages.getOutboxReadDate",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)})}async canViewMessageReadParticipants(e){if(e?._!=="message"||e.pFlags.is_outgoing||!e.pFlags.out||e.pFlags.unread||e.peerId===this.appPeersManager.peerId||this.appPeersManager.isBroadcast(e.peerId))return!1;const t=await this.apiManager.getAppConfig(),a=Ie(!0)-e.date;if(e.peerId.isUser()){const n=await this.appProfileManager.getProfile(e.peerId.toUserId());return a<t.pm_read_date_expire_period&&!n.pFlags.read_dates_private}return this.appChatsManager.getChat(e.peerId.toChatId()).participants_count<=t.chat_read_mark_size_threshold&&a<t.chat_read_mark_expire_period}incrementMessageViews(e,t){if(t.length)return this.apiManager.invokeApiSingle("messages.getMessagesViews",{peer:this.appPeersManager.getInputPeerById(e),id:t.map(a=>ae(a)),increment:!0}).then(a=>{this.appPeersManager.saveApiPeers(a);for(let s=0,n=t.length;s<n;++s)this.apiUpdatesManager.processLocalUpdate({_:"updateChannelMessageViews",channel_id:e.toChatId(),id:t[s],views:a.views[s].views})})}notifyAboutMessage(e,t={}){const a=this.getMessagePeer(e);if(this.appPeersManager.isPeerRestricted(a))return;const s=Aa.getTabs();let n=s.find(r=>{const{chatPeerIds:p}=r.state;return p[p.length-1]===a});!n&&s.length&&(s.sort((r,p)=>r.state.idleStartTime-p.state.idleStartTime),n=s[0].state.idleStartTime?s[s.length-1]:s[0]),Be.getInstance().invokeVoid("notificationBuild",{message:e,...t},n?.source)}getScheduledMessagesStorage(e){var t;return(t=this.scheduledMessagesStorage)[e]??(t[e]=this.createMessageStorage(e,"scheduled"))}getScheduledMessageByPeer(e,t){return this.getMessageFromStorage(this.getScheduledMessagesStorage(e),t)}getScheduledMessages(e){if(!this.canSendToPeer(e))return;const t=this.getScheduledMessagesStorage(e);return t.size?[...t.keys()]:this.apiManager.invokeApiSingle("messages.getScheduledHistory",{peer:this.appPeersManager.getInputPeerById(e),hash:""}).then(a=>{if(a._!=="messages.messagesNotModified"){this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats);const s=this.getScheduledMessagesStorage(e);return this.saveMessages(a.messages,{storage:s,isScheduled:!0}),[...s.keys()]}return[]})}sendScheduledMessages(e,t){return this.apiManager.invokeApi("messages.sendScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map(a=>ae(a))}).then(a=>{this.apiUpdatesManager.processUpdateMessage(a)})}deleteScheduledMessages(e,t){return this.apiManager.invokeApi("messages.deleteScheduledMessages",{peer:this.appPeersManager.getInputPeerById(e),id:t.map(a=>ae(a))}).then(a=>{this.apiUpdatesManager.processUpdateMessage(a)})}getMessageWithReplies(e){return Ss(this.filterMessages(e,t=>!!t.replies))}getMessageWithCommentReplies(e){if(e.peerId!==Gn){e=this.getMessageWithReplies(e);const t=e?.replies;if(!(t&&t.pFlags.comments&&t.channel_id.toChatId()!==tr))return}return e}isFetchIntervalNeeded(e){return e.isAnyChat()&&(!this.appChatsManager.isInChat(e.toChatId())||this.appChatsManager.isForum(e.toChatId()))}getMigration(e){const t=this.migratedFromTo[e],a=this.migratedToFrom[e];return t||a?{next:t,prev:a}:void 0}getHistoryType(e,t){return t?e.isUser()?3:this.appPeersManager.isForum(e)?2:1:0}processRequestHistoryOptions(e){return e.offsetId??(e.offsetId=0),e.historyType??(e.historyType=this.getHistoryType(e.peerId,e.threadId)),e.searchType??(e.searchType=vn(e)),e.savedReaction&&(e.savedReaction=e.savedReaction.filter(Boolean),e.savedReaction.length?e.inputFilter??(e.inputFilter={_:"inputMessagesFilterEmpty"}):delete e.savedReaction),e.addOffset===void 0&&(e.addOffset=0,e.backLimit&&(e.addOffset=-e.backLimit,e.limit+=e.backLimit)),e.historyStorage??(e.historyStorage=e.searchType?this.getSearchStorage(e):this.getHistoryStorage(e.peerId,e.threadId)),e}getHistory(e){this.processRequestHistoryOptions(e);const{historyStorage:t,limit:a,addOffset:s,offsetId:n,offsetPeerId:i,needRealOffsetIdOffset:r}=e;if(this.appPeersManager.isPeerRestricted(e.peerId)){const f=t.history.first;f.setEnd(Le.Both);const c=f.slice(0,0);return c.setEnd(Le.Both),{count:0,history:Array.from(c),isEnd:c.getEnds(),offsetIdOffset:0}}const p=()=>{let f;return t.searchHistory?f=t.searchHistory.sliceMe(n?`${i}_${n}`:void 0,s,a):f=t.history.sliceMe(n,s,a),f},d=p();return d&&(d.slice.length===a||(d.fulfilled&Le.Both)===Le.Both)&&(!r||d.slice.isEnd(Le.Bottom))?{count:t.count,history:Array.from(d.slice),isEnd:d.slice.getEnds(),offsetIdOffset:d.offsetIdOffset,messages:e.isCacheableSearch?d.slice.map(f=>this.getMessageByPeer(+f.split("_")[0],+f.split("_")[1])):void 0}:this.fillHistoryStorage(e).then(f=>{if(e.searchType==="uncached"){const M=f.messages.map(A=>A.mid);return{count:f.count??t.count,history:M,isEnd:t.history.slice.getEnds(),offsetIdOffset:f?.offset_id_offset||0,nextRate:f?.next_rate,messages:f.messages}}const c=p(),l=c?.slice||t.history.constructSlice(),m=l.getEnds();let u;return r?u=f.offset_id_offset||0:u=c?.offsetIdOffset||t.count,{count:t.count,history:Array.from(l),isEnd:m,offsetIdOffset:u,messages:e.isCacheableSearch?l.map(M=>this.getMessageByPeer(M.split("_")[0].toPeerId(),+M.split("_")[1])):void 0}})}isHistoryResultEnd({historyResult:e,limit:t,addOffset:a,offsetId:s,offsetPeerId:n,inputFilter:i,peerId:r}){const{offset_id_offset:p,messages:d}=e,f=d.map(({mid:L})=>L),c=e.count||d.length,l=a<0?t+a:t,m=Math.abs(a);!r&&i&&(s=0);let u=p,M=!1,A=!s,w=d.length,C=0,I=!1;const F=s&&ae(s);if(F){let L=0;for(const z=f.length;L<z&&!(s>f[L]);++L);I=f.includes(s),w=d.length-L,C=L}return u!==void 0?(M=u>=c-l||c<l,A=!u||a<0&&u+a<=0):F?(l&&(M=w<l),m&&(A=C<m),(M||A)&&(u=M?c-w:C-+I)):d.length>=c&&(M=!0,A=!0),u??(u=0),{count:c,offsetIdOffset:u,isTopEnd:M,isBottomEnd:A,mids:f,topWasMeantToLoad:l,bottomWasMeantToLoad:m,topLoaded:w,bottomLoaded:C}}mergeHistoryResult(e){const{slicedArray:t,historyResult:a,offsetId:s,addOffset:n,peerId:i,historyStorage:r}=e,p=r?.searchHistory,{messages:d}=a,f=this.isHistoryResultEnd(e),{count:c,offsetIdOffset:l,mids:m}=f,u=this.getMigration(i);if(u&&r&&r.type!=="replies"&&(u.prev?f.isTopEnd=!1:u.next&&f.isBottomEnd&&(m.unshift(this.appMessagesIdsManager.generateMessageId(1,u.next.toChatId())),f.isBottomEnd=!1)),s&&ae(s)&&!m.includes(s)&&l<c&&(n||0)>=0&&!p){let A=0;for(const w=m.length;A<w&&!(s>m[A]);++A);m.splice(A,0,s)}let M;if(p){let A=d.map(w=>`${w.peerId}_${w.mid}`);A=A.filter(w=>!p.first.includes(w)),M=p.insertSlice(A)}else M=t.insertSlice(m)||t.slice;return f.isTopEnd&&M.setEnd(Le.Top),f.isBottomEnd&&M.setEnd(Le.Bottom),{slice:M,mids:m,messages:d,...f}}async fillHistoryStorage(e){const{offsetId:t,historyStorage:a,inputFilter:s,recursion:n}=e;e.recursion=!0;let{peerId:i}=e;const r=a.maxId,p=this.middleware.get();let d=this.getMigration(i),f=i;t&&d?.prev&&ae(t)===t&&(f=d.prev),i=e.peerId=this.appPeersManager.getPeerMigratedTo(i)||i;const c=f!==i,l=e.searchType==="cached"&&e.isCacheableSearch;if(l&&a.nextRate){const O=a.searchHistory.last,[B,y]=O[O.length-1].split("_"),P=this.getMessageByPeer(B.toPeerId(),+y);e.offsetId=P.mid,e.offsetPeerId=B.toPeerId(),e.nextRate=a.nextRate}const m=await this.requestHistory({...e,peerId:f});if(!p())return;l&&(a.nextRate=m.next_rate);const u=this.mergeHistoryResult({...e,slicedArray:a.history,historyResult:m,peerId:f}),{count:M,isBottomEnd:A,isTopEnd:w,slice:C,messages:I,topWasMeantToLoad:F,bottomWasMeantToLoad:L,topLoaded:z,bottomLoaded:j}=u;if(c||(a.count=M),!s)for(let O=0,B=I.length;O<B;++O){const y=I[O];this.mergeReplyKeyboard(a,y)&&this.rootScope.dispatchEvent("history_reply_markup",{peerId:i})}if(!s&&A){const O=C[0];if(a.maxId===r){const B=a.history.first;B!==C&&a.history.deleteSlice(B),a.maxId!==O&&(a.maxId=C[0],this.reloadConversation(i))}}const Z=I[0],X=I[I.length-1];if(!(!s&&!A&&Z?.grouped_id&&(await this.getHistory({...e,offsetId:Z.mid,limit:20,addOffset:-10}),!p()))&&!(!s&&!w&&X?.grouped_id&&X.grouped_id!==Z?.grouped_id&&(await this.getHistory({...e,offsetId:X.mid,limit:20,addOffset:-10}),!p()))){if(e.threadId){if(w&&e.historyType===1){const O=a.history.last,B=this.getMessageByPeer(i,e.threadId),y=this.getMessageWithReplies(B),P=this.generateThreadServiceStartMessage(y),S=this.getMidsByMessage(y),v=[P,...S.sort((T,R)=>R-T)];Et(v,(T,R,ee)=>{O.includes(T)&&ee.splice(R,1)});const Q=O.length;O.isEnd(Le.Top)&&Q&&v.unshift(O[Q-1]),a.history.insertSlice(v),this.log("inserted thread service start message",i,e.threadId,P)}return m}if(d??(d=this.getMigration(i)),d?.prev&&F!==z&&!w){const O=F-z,B=await this.fillHistoryStorage({...e,peerId:d.prev,offsetId:0,limit:O,addOffset:0});m.messages.push(...B.messages);const y=B.count??B.messages.length;m.count=(m.count||0)+y}else if((d?.next||c)&&L!==j&&!A){const O=L-j,B=await this.fillHistoryStorage({...e,offsetId:this.appMessagesIdsManager.generateMessageId(1,i.toChatId()),limit:O,addOffset:-O});m.messages.unshift(...B.messages);const y=B.count??B.messages.length;m.count=(m.count||0)+y;const P=m.offset_id_offset||0;m.offset_id_offset=P+y}else if(d&&s&&!n){const O=await this.requestHistory({...e,peerId:c?i:d.prev,offsetId:0,limit:1}),B=O.count??O.messages.length;m.count=(m.count||0)+B;const y=m.offset_id_offset||0;m.offset_id_offset=y+B}if(p()){if(s&&e.savedReaction){const O=m.messages.filter(B=>B.grouped_id);if(await Promise.all(O.map(B=>this.getHistory({peerId:B.peerId,offsetId:B.mid,limit:20,addOffset:-10}))),!p())return}return m}}}requestHistory({peerId:e,offsetId:t=0,limit:a=50,addOffset:s=0,offsetDate:n=0,threadId:i=0,offsetPeerId:r,nextRate:p,folderId:d,query:f,inputFilter:c,minDate:l,maxDate:m,historyType:u=this.getHistoryType(e,i),fromPeerId:M,savedReaction:A,isPublicHashtag:w}){const C=t&&this.getMessageByPeer(r||e,t);r??(r=C?.peerId),t=ae(t)||0,i=u===3?i:ae(i)||0,l=l?l/1e3|0:0,m=m?m/1e3|0:0;let I,F;const L={peer:this.appPeersManager.getInputPeerById(e),offset_id:t,offset_date:n,add_offset:s,limit:a,max_id:0,min_id:0,hash:0};if(A&&(c??(c={_:"inputMessagesFilterEmpty"})),w){const j={...L,hashtag:f.slice(1),offset_rate:p,offset_peer:this.appPeersManager.getInputPeerById(r)};F="channels.searchPosts",I=j}else if(c&&e&&!p&&d===void 0){const j={...L,q:f||"",filter:c,min_date:l,max_date:m,top_msg_id:u===3?void 0:i,saved_peer_id:u===3?this.appPeersManager.getInputPeerById(i):void 0,from_id:M?this.appPeersManager.getInputPeerById(M):void 0,saved_reaction:A};F="messages.search",I=j}else if(c){const j={...L,q:f||"",filter:c,min_date:l,max_date:m,offset_rate:p,offset_peer:this.appPeersManager.getInputPeerById(r),folder_id:d};F="messages.searchGlobal",I=j}else if(u===1||u===2){const j={...L,msg_id:i};F="messages.getReplies",I=j}else if(u===3){const j={...L,peer:this.appPeersManager.getInputPeerById(i)};F="messages.getSavedHistory",I=j}else{const j={...L};F="messages.getHistory",I=j}return this.apiManager.invokeApiSingle(F,I,{noErrorBox:!0}).then(j=>{qe&&this.log("requestHistory result:",e,j,t,a,s);const{messages:Z}=j;this.saveApiResult(j),"pts"in j&&this.apiUpdatesManager.addChannelState(e.toChatId(),j.pts);let X=Z.length;return j.count,X&&!Z[X-1]&&(Z.splice(X-1,1),X--),j},j=>{switch(j.type){case"CHANNEL_PRIVATE":let Z=this.appChatsManager.getChat(e.toChatId());Z._==="channel"&&(Z={_:"channelForbidden",id:Z.id,access_hash:Z.access_hash,title:Z.title,pFlags:Z.pFlags}),this.appChatsManager.saveApiChats([Z]),this.apiUpdatesManager.processLocalUpdate({_:"updateChannel",channel_id:Z.id});break}throw j})}fetchSingleMessages(){return this.fetchSingleMessagesPromise??(this.fetchSingleMessagesPromise=rt(0).then(()=>{const e=[];for(const[t,a]of this.needSingleMessages){const s=[...a.keys()],n=s.map(d=>({_:"inputMessageID",id:ae(d)}));let i;const r=this.appPeersManager.isChannel(t)?t.toChatId():void 0;r?i=this.apiManager.invokeApiSingle("channels.getMessages",{channel:this.appChatsManager.getChannelInput(r),id:n}):i=this.apiManager.invokeApiSingle("messages.getMessages",{id:n});const p=i.then(d=>{this.saveApiResult(d);const{messages:f}=d;for(let c=0;c<f.length;++c){const l=f[c];if(!l)continue;const m=this.appMessagesIdsManager.generateMessageId(l.id,r);a.get(m).resolve(l),a.delete(m)}if(a.size)for(const[c,l]of a)l.resolve(this.generateEmptyMessage(c))}).finally(()=>{this.rootScope.dispatchEvent("messages_downloaded",{peerId:t,mids:s})});e.push(p)}return this.needSingleMessages.clear(),Promise.all(e).then(Ge,Ge).then(()=>{this.fetchSingleMessagesPromise=void 0,this.needSingleMessages.size&&this.fetchSingleMessages()})}))}reloadMessages(e,t,a){if(Array.isArray(t))return Promise.all(t.map(n=>this.reloadMessages(e,n,a)));e.isAnyChat()&&ia(t)&&(e=Ha);const s=this.getMessageByPeer(e,t);if(s&&!a)return this.rootScope.dispatchEvent("messages_downloaded",{peerId:e,mids:[t]}),Promise.resolve(s);{let n=this.needSingleMessages.get(e);n||this.needSingleMessages.set(e,n=new Map);let i=n.get(t);return i||(i=Pe(),n.set(t,i),this.fetchSingleMessages(),i)}}getExtendedMedia(e,t){let a=this.extendedMedia.get(e);a||this.extendedMedia.set(e,a=new Map);const s=Pe(),n=[],i=t.map(r=>{let p=a.get(r);return p||(a.set(r,p=s),n.push(r),p.then(()=>{a.delete(r),!a.size&&this.extendedMedia.get(e)===a&&this.extendedMedia.delete(e)})),p});return n.length?this.apiManager.invokeApi("messages.getExtendedMedia",{peer:this.appPeersManager.getInputPeerById(e),id:n.map(r=>ae(r))}).then(r=>{this.apiUpdatesManager.processUpdateMessage(r),s.resolve()}):s.resolve(),Promise.all(i)}clearMessageReplyTo(e){e=this.getMessageByPeer(e.peerId,e.mid),this.modifyMessage(e,t=>{delete t.reply_to_mid,delete t.reply_to},this.getHistoryMessagesStorage(e.peerId),!0)}fetchMessageReplyTo(e){if(!e.reply_to)return Promise.resolve(this.generateEmptyMessage(0));const t=e.reply_to;if(t._==="messageReplyStoryHeader"){const s=this.appStoriesManager.getStoryById(this.appPeersManager.getPeerId(t.peer),t.story_id);return Ce(s,n=>n)}const a=t.reply_to_peer_id?this.appPeersManager.getPeerId(t.reply_to_peer_id):e.peerId;return this.reloadMessages(a,e.reply_to_mid).then(s=>{if(s||this.clearMessageReplyTo(e),e._==="messageService"){const n=e.peerId;this.rootScope.dispatchEvent("message_edit",{storageKey:`${n}_history`,peerId:n,mid:e.mid,message:e}),this.isMessageIsTopMessage(e)&&this.rootScope.dispatchEvent("dialogs_multiupdate",new Map([[n,{dialog:this.getDialogOnly(n)}]]))}return s})}getTypingKey(e,t){return t?`${e}_${t}`:e}setTyping(e,t,a,s){s&&!this.appPeersManager.isForum(e)&&(s=void 0);const n=this.getTypingKey(e,s);let i=this.typings[n];return!e||!this.canSendToPeer(e)||e===this.appPeersManager.peerId||!a&&i?.action?._===t._?Promise.resolve(!1):(i?.timeout&&clearTimeout(i.timeout),i=this.typings[n]={action:t},this.apiManager.invokeApi("messages.setTyping",{peer:this.appPeersManager.getInputPeerById(e),action:t,top_msg_id:s?ae(s):void 0}).finally(()=>{i===this.typings[n]&&(i.timeout=we.setTimeout(()=>{delete this.typings[n]},6e3))}))}handleReleasingMessage(e,t){const a=e.media;if(a){const s=a.webpage||a,n=s.photo||s.document;if(n?.file_reference&&this.referenceDatabase.deleteContext(n.file_reference,{type:"message",peerId:e.peerId,messageId:e.mid}),"webpage"in a&&a.webpage){const i=this.getScheduledMessagesStorage(e.peerId)===t,r=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,i);this.appWebPagesManager.deleteWebPageFromPending(a.webpage,r)}a.poll&&this.appPollsManager.updatePollToMessage(e,!1)}}handleDeletedMessages(e,t,a){const s={count:0,unread:0,unreadMentions:0,unreadReactions:0,msgs:new Set},n=t.type==="history";for(const i of a){const r=this.getMessageFromStorage(t,i);if(!r){this.fixDialogUnreadMentionsIfNoMessage({peerId:e}),this.fixDialogUnreadMentionsIfNoMessage({peerId:e,isReaction:!0});continue}this.handleReleasingMessage(r,t),this.updateMessageRepliesIfNeeded(r,!1),!r.pFlags.out&&!r.pFlags.is_outgoing&&r.pFlags.unread&&(++s.unread,this.rootScope.dispatchEvent("notification_cancel","msg"+i),Ga(r)&&(++s.unreadMentions,this.modifyCachedMentions({peerId:e,mid:i,add:!1}))),++s.count,s.msgs.add(i);const p=r.grouped_id;if(p){const d=this.groupedMessagesStorage[p];d&&(this.deleteMessageFromStorage(d,i),s.grouped||(s.grouped={}),(s.grouped[p]||(s.grouped[p]=new Set)).add(i),d.size||(delete s.grouped,delete this.groupedMessagesStorage[p]))}if(n){this.updateMessageContextForDeletion(r,!0);const d=r.reactions;d&&d.pFlags.reactions_as_tags&&this.appReactionsManager.processMessageReactionsChanges({message:r,changedResults:[],removedResults:d.results});const f=d?.recent_reactions;r.pFlags.out&&f?.some(c=>c.pFlags.unread)&&(++s.unreadReactions,this.modifyCachedMentions({peerId:e,mid:i,add:!1,isReaction:!0})),this.appTranslationsManager.resetMessageTranslations(r.peerId,r.mid)}this.deleteMessageFromStorage(t,i)}if(s.grouped)for(const i in s.grouped)this.dispatchGroupedEdit(i,t,[...s.grouped[i]]);return s}handleEditedMessage(e,t,a){if(e._==="message"){if(e.media?.webpage){const i=this.appWebPagesManager.getMessageKeyForPendingWebPage(e.peerId,e.mid,!!e.pFlags.is_scheduled);this.appWebPagesManager.deleteWebPageFromPending(e.media.webpage,i)}const s=e.grouped_id;s&&this.dispatchGroupedEdit(s,a,[]),this.appTranslationsManager.hasTriedToTranslateMessage(e.peerId,e.mid)&&(e.message!==t.message||!St(e.entities,t.entities))&&this.appTranslationsManager.resetMessageTranslations(e.peerId,e.mid)}}dispatchGroupedEdit(e,t,a){const n=this.getMidsByGroupedId(e).map(i=>this.getMessageFromStorage(t,i));this.rootScope.dispatchEvent("grouped_edit",{peerId:n[0].peerId,groupedId:e,deletedMids:a||[],messages:n})}getDialogUnreadCount(e){let t=e.unread_count;if(!Je(e)&&this.appPeersManager.isForum(e.peerId)&&!e.pFlags.view_forum_as_messages){const a=this.dialogsStorage.getForumUnreadCount(e.peerId);a instanceof Promise?t=0:t=a.count}return t||+!!e.pFlags?.unread_mark}isDialogUnread(e){return!Ye(e)&&!!this.getDialogUnreadCount(e)}canForward(e){return e?._==="message"&&!e.pFlags.noforwards&&!this.appPeersManager.noForwards(e.peerId)}pushBatchUpdate(e,t,a,s){let n=this.batchUpdates[e];n||(n=this.batchUpdates[e]={callback:t,batch:new Map}),n.batch.has(a)||(n.batch.set(a,s?s():void 0),this.batchUpdatesDebounced())}getMessagesFromMap(e){const t=new Map;for(const[a,s]of e){const[n,i]=a.split("_"),r=this.getMessageByPeer(n.toPeerId(),+i);r&&t.set(r,s)}return t}saveDefaultSendAs(e,t){return this.appProfileManager.modifyCachedFullChat(e.toChatId(),a=>{a.default_send_as=this.appPeersManager.getOutputPeer(t)}),this.apiManager.invokeApi("messages.saveDefaultSendAs",{peer:this.appPeersManager.getInputPeerById(e),send_as:this.appPeersManager.getInputPeerById(t)})}sendBotRequestedPeer(e,t,a,s){return this.apiManager.invokeApi("messages.sendBotRequestedPeer",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t),button_id:a,requested_peers:s.map(n=>this.appPeersManager.getInputPeerById(n))}).then(n=>{this.apiUpdatesManager.processUpdateMessage(n)})}reportSpam(e){return this.apiManager.invokeApi("messages.reportSpam",{peer:this.appPeersManager.getInputPeerById(e)})}canUpdateFactCheck(e,t){if(!this.appPeersManager.isBroadcast(e))return!1;const a=this.getMessageByPeer(e,t);return Tp(a)?Ce(this.apiManager.getAppConfig(),s=>!!s.can_edit_factcheck):!1}updateFactCheck(e,t,a){let s;return a?s=this.apiManager.invokeApi("messages.editFactCheck",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t),text:a}):s=this.apiManager.invokeApi("messages.deleteFactCheck",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}),s.then(n=>{this.apiUpdatesManager.processUpdateMessage(n)})}getFactCheck(e,t){const a=this.getMessageByPeer(e,t);return a&&a.factcheck&&!a.factcheck.pFlags.need_check?a.factcheck:this.factCheckBatcher.addToBatch(e,t)}}class xp{constructor(e){this.batchMap=new Map,this.delay=e.delay??0,this._processBatch=e.processBatch}async processBatch(){await this._processBatch(this.batchMap),this.timeoutId=void 0,this.batchMap.size&&this.scheduleBatch()}scheduleBatch(){this.timeoutId||(this.timeoutId=we.setTimeout(()=>{this.processBatch()},this.delay))}addToBatch(e,t){this.batchMap.has(e)||this.batchMap.set(e,new Map);const a=this.batchMap.get(e),s=a.get(t);if(s)return s;{const n=Pe();return a.set(t,n),this.scheduleBatch(),n}}}function la(o){const e=o.replace("input","");return e[0].toLowerCase()+e.slice(1)}class Lp extends ce{constructor(){super(...arguments),this.peerSettings={notifyPeer:{},notifyUsers:null,notifyChats:null,notifyBroadcasts:null,notifyForumTopic:{}},this.checkMuteUntil=()=>{this.checkMuteUntilTimeout!==void 0&&(clearTimeout(this.checkMuteUntilTimeout),this.checkMuteUntilTimeout=void 0);const e=Ie(!0);let t=Hn;const a=n=>{if(n instanceof Promise)return!1;const i=n.mute_until;return i?i<=e?(n.mute_until=0,!0):(i<t&&(t=i),!1):!1};["notifyPeer","notifyForumTopic"].forEach(n=>{for(const i in this.peerSettings[n]){const r=this.peerSettings[n][i];if(a(r)){const[p,d]=i.split("_"),f=this.appPeersManager.getOutputPeer(p.toPeerId());this.apiUpdatesManager.saveUpdate({_:"updateNotifySettings",peer:d?{_:"notifyForumTopic",peer:f,top_msg_id:+d}:{_:"notifyPeer",peer:f},notify_settings:r})}}});const s=Math.min(18e5,(t-e)*1e3);this.checkMuteUntilTimeout=we.setTimeout(this.checkMuteUntil,s)},this.onUpdateNotifySettings=e=>{const{peer:t}=e,a=t._==="notifyForumTopic",s=t._==="notifyPeer"||a,n=s&&this.appPeersManager.getPeerId(t.peer),i=s?void 0:t._,r=a?this.appMessagesIdsManager.generateMessageId(t.top_msg_id,t.peer.channel_id):void 0;this.savePeerSettings({key:i,peerId:n,threadId:r,settings:e.notify_settings}),this.rootScope.dispatchEvent("notify_settings",e)}}after(){return this.checkMuteUntilThrottled=ca(this.checkMuteUntil,1e3,!1),this.apiUpdatesManager.addMultipleEventsListeners({updateNotifySettings:this.onUpdateNotifySettings}),this.appStateManager.getState().then(e=>{if(e.notifySettings)for(const t in e.notifySettings)this.savePeerSettings({key:t,settings:e.notifySettings[t]})})}getNotifySettings(e){let t=la(e._),a=this.peerSettings[t],s;return e._==="inputNotifyPeer"&&(s=t=this.appPeersManager.getPeerId(e.peer),a=a[t]),a||((a||this.peerSettings)[t]=this.apiManager.invokeApi("account.getNotifySettings",{peer:e}).then(n=>(this.savePeerSettings({key:t,peerId:s,settings:n}),n)))}getNotifyPeerTypeSettings(){if(this.getNotifyPeerTypePromise)return this.getNotifyPeerTypePromise;const e=["inputNotifyBroadcasts","inputNotifyUsers","inputNotifyChats"].map(t=>this.getNotifySettings({_:t}));return this.getNotifyPeerTypePromise=Promise.all(e)}generateLocalNotifySettingsUpdate(e,t){this.apiUpdatesManager.processLocalUpdate({_:"updateNotifySettings",peer:{...e,_:la(e._)},notify_settings:{...t,_:"peerNotifySettings"}})}updateNotifySettings(e,t){return this.apiManager.invokeApi("account.updateNotifySettings",{peer:e,settings:t}).then(()=>{this.generateLocalNotifySettingsUpdate(e,t)})}getContactSignUpNotification(){return this.notifyContactsSignUp?this.notifyContactsSignUp:this.notifyContactsSignUp=this.apiManager.invokeApi("account.getContactSignUpNotification")}setContactSignUpNotification(e){this.apiManager.invokeApi("account.setContactSignUpNotification",{silent:e}).then(t=>{this.notifyContactsSignUp=Promise.resolve(!e)})}getPeerKey(e,t){return e+(t?"_"+t:"")}savePeerSettings({key:e,peerId:t,threadId:a,settings:s}){let n;t&&(e=this.getPeerKey(t,a),n=this.peerSettings[a?"notifyForumTopic":"notifyPeer"]),(n||this.peerSettings)[e]=s,t?this.checkMuteUntilThrottled():(this.rootScope.dispatchEvent("notify_peer_type_settings",{key:e,settings:s}),this.appStateManager.getState().then(i=>{const r=i.notifySettings;r[e]=s,this.appStateManager.pushToState("notifySettings",r)}))}isMuted(e){return e._==="peerNotifySettings"&&(e.silent||e.mute_until!==void 0&&e.mute_until*1e3>Ie())}getPeerMuted(e){const t=this.getNotifySettings({_:"inputNotifyPeer",peer:this.appPeersManager.getInputPeerById(e)});return(t instanceof Promise?t:Promise.resolve(t)).then(a=>this.isMuted(a))}getPeerLocalSettings({peerId:e,respectType:t=!0,threadId:a}){const s={_:"peerNotifySettings"},n=this.getPeerKey(e,a),i=this.peerSettings[a?"notifyForumTopic":"notifyPeer"][n];if(i&&!(i instanceof Promise)&&Object.assign(s,i),t){const r=this.appPeersManager.getInputNotifyPeerById({peerId:e,ignorePeerId:!0,threadId:a}),p=la(r._),d=this.peerSettings[p];if(d&&!(d instanceof Promise))for(const f in d)s[f]===void 0&&(s[f]=d[f])}return s}validatePeerSettings(e){if(e.peerId!==this.appPeersManager.peerId)return e.threadId&&!this.appPeersManager.isForum(e.peerId)&&(e.threadId=void 0),e}isPeerLocalMuted(e){if(!(e=this.validatePeerSettings(e)))return!1;if(e.threadId){const s=this.getPeerLocalSettings({...e,respectType:!1});return s.silent!==void 0||s.mute_until!==void 0?this.isMuted(s):this.isPeerLocalMuted({...e,threadId:void 0})}const t=this.getPeerLocalSettings(e);return this.isMuted(t)}isPeerStoriesMuted(e){return!!this.getPeerLocalSettings({peerId:e})?.stories_muted}toggleStoriesMute(e,t,a){const s=this.getPeerLocalSettings({peerId:e}),n={_:"inputNotifyPeer",peer:this.appPeersManager.getInputPeerById(e)},i={...s,_:"inputPeerNotifySettings"};t?i.stories_muted=!0:delete i.stories_muted,a?this.generateLocalNotifySettingsUpdate(n,i):this.updateNotifySettings(n,i)}}const Op=new Set(["all","web","webk"]),xs=new Set;function Ai(o){return o.find(e=>Op.has(e.platform)&&!xs.has(e.reason))}function Vp(o){return!!Ai(o)}function Np(o){xs.clear(),o.forEach(e=>{xs.add(e)})}function Fi(o){const e=o?.restriction_reason;return!!(e&&o.pFlags.restricted&&Vp(e))}function qp(o){if(!(!o||Fi(o)))return o?.photo}class jp extends ce{get peerId(){return this.appUsersManager.userId.toPeerId()}saveApiPeers(e){this.appChatsManager.saveApiChats(e.chats),this.appUsersManager.saveApiUsers(e.users)}canPinMessage(e){return e.isUser()||this.appChatsManager.hasRights(e.toChatId(),"pin_messages")}getPeerPhoto(e){const t=this.getPeer(e);return qp(t)}getPeerMigratedTo(e){if(e.isUser())return;const t=this.appChatsManager.getChat(e.toChatId()),a=t?.migrated_to;if(a&&t.pFlags.deactivated)return He(a)}getOutputPeer(e){if(e.isUser())return{_:"peerUser",user_id:e.toUserId()};const t=e.toChatId();return this.appChatsManager.isChannel(t)?{_:"peerChannel",channel_id:t}:{_:"peerChat",chat_id:t}}getPeerString(e){return e.isUser()?this.appUsersManager.getUserString(e.toUserId()):this.appChatsManager.getChatString(e.toChatId())}getPeerUsername(e){return this.getPeerActiveUsernames(e)[0]||""}getPeerActiveUsernames(e){const t=this.getPeer(e);return zt(t)}getPeer(e){return e.isUser()?this.appUsersManager.getUser(e.toUserId()):this.appChatsManager.getChat(e.toChatId())}getPeerId(e){return He(e)||et(e)&&e._==="inputPeerSelf"&&this.peerId||lt}getDialogPeer(e){return{_:"dialogPeer",peer:this.getOutputPeer(e)}}isChannel(e){return!e.isUser()&&this.appChatsManager.isChannel(e.toChatId())}isMegagroup(e){return!e.isUser()&&this.appChatsManager.isMegagroup(e.toChatId())}isForum(e){return!e.isUser()&&this.appChatsManager.isForum(e.toChatId())}isAnyGroup(e){return!e.isUser()&&!this.appChatsManager.isBroadcast(e.toChatId())}isBroadcast(e){return this.isChannel(e)&&!this.isMegagroup(e)}isBot(e){return e.isUser()&&this.appUsersManager.isBot(e.toUserId())}isContact(e){return e.isUser()&&this.appUsersManager.isContact(e.toUserId())}isUser(e){return Ln(e)}isRegularUser(e){return this.isUser(e)&&this.appUsersManager.isRegularUser(e)}isAnyChat(e){return xn(e)}isPeerRestricted(e){return Fi(this.getPeer(e))}isPeerPublic(e){return!!zt(this.getPeer(e))[0]}isSavedDialog(e,t){return!!(e===this.peerId&&t)}getRestrictionReasonText(e){const t=this.getPeer(e),a=t.restriction_reason?Ai(t.restriction_reason):void 0;return a?a.text:e.isUser()?"This user is restricted":"This chat is restricted"}getInputNotifyPeerById({peerId:e,ignorePeerId:t,threadId:a}){return t?e.isUser()?{_:"inputNotifyUsers"}:this.isBroadcast(e)?{_:"inputNotifyBroadcasts"}:{_:"inputNotifyChats"}:a?{_:"inputNotifyForumTopic",peer:this.getInputPeerById(e),top_msg_id:ae(a)}:{_:"inputNotifyPeer",peer:this.getInputPeerById(e)}}getInputPeerById(e){if(!e)return{_:"inputPeerEmpty"};if(!e.isUser()){const a=e.toChatId();return this.appChatsManager.getInputPeer(a)}const t=e.toUserId();return this.appUsersManager.getUserInputPeer(t)}getInputPeerSelf(){return{_:"inputPeerSelf"}}getInputDialogPeerById(e){return{_:"inputDialogPeer",peer:et(e)?e:this.getInputPeerById(e)}}getPeerSearchText(e){let t;return this.isUser(e)?t="%pu "+this.appUsersManager.getUserSearchText(e.toUserId()):t="%pg "+this.appChatsManager.getChatSearchText(e.toChatId()),t}getDialogType(e,t){return this.peerId===e&&t?"savedDialog":this.isMegagroup(e)?"megagroup":this.isChannel(e)?"channel":this.isUser(e)?e===this.peerId?"saved":"chat":"group"}getDeleteButtonText(e){switch(this.getDialogType(e)){case"channel":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"ChannelDelete":"ChatList.Context.LeaveChannel";case"megagroup":case"group":return this.appChatsManager.hasRights(e.toChatId(),"delete_chat")?"DeleteMega":"ChatList.Context.LeaveGroup";default:return"ChatList.Context.DeleteChat"}}noForwards(e){return e.isUser()?!1:!!this.appChatsManager.getChat(e.toChatId()).pFlags?.noforwards}mirrorAllPeers(e){const t={...this.appUsersManager.getUsers()},a=this.appChatsManager.getChats();for(const s in a)t[s.toPeerId(!0)]=a[s];Be.getInstance().invokeVoid("mirror",{name:"peers",value:t},e)}}class Gp extends ce{constructor(){super(...arguments),this.photos={}}savePhoto(e,t){if(!e||e._==="photoEmpty")return;const a=this.photos[e.id];if(e.file_reference&&(mi("file_reference",a,e),this.referenceDatabase.saveContext(e.file_reference,t)),e.sizes?.length){e.sizes.sort((n,i)=>(n.size||(n.sizes?1/0:0))-(i.size||(i.sizes?1/0:0)));const s=e.sizes[e.sizes.length-1];s._==="photoSizeProgressive"&&(s.size=s.sizes[s.sizes.length-1])}return a?Object.assign(a,e):this.photos[e.id]=e}getUserPhotos(e,t="0",a=20){const s=this.appUsersManager.getUserInput(e);return this.apiManager.invokeApiCacheable("photos.getUserPhotos",{user_id:s,offset:0,limit:a,max_id:t},{cacheSeconds:60}).then(n=>{this.appUsersManager.saveApiUsers(n.users);const i=n.photos.map((r,p)=>(n.photos[p]=this.savePhoto(r,{type:"profilePhoto",peerId:e.toPeerId()}),r.id));if(t!=="0"&&t){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}return{count:n.count||i.length,photos:i}})}getPhoto(e){return et(e)?e:this.photos[e]}}class Hp extends ce{constructor(){super(...arguments),this.polls={},this.results={},this.pollToMessages={},this.log=We("POLLS",ke.Error)}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateMessagePoll:e=>{this.log("updateMessagePoll:",e);let t=e.poll||this.polls[e.poll_id];if(!t)return;let a=e.results;const s=this.savePoll(t,a);t=s.poll,a=s.results,this.rootScope.dispatchEvent("poll_update",{poll:t,results:a})}})}savePoll(e,t,a){a&&this.updatePollToMessage(a,!0);const s=e.id;return this.polls[s]?(e=Object.assign(this.polls[s],e),t=this.saveResults(e,t)):(this.polls[s]=e,e.chosenIndexes=[],t=this.saveResults(e,t)),{poll:e,results:t}}saveResults(e,t){return this.results[e.id]?t=Object.assign(this.results[e.id],t):this.results[e.id]=t,t.pFlags.min||(e.chosenIndexes.length=0,t?.results?.length&&t.results.forEach((a,s)=>{a.pFlags?.chosen&&e.chosenIndexes.push(s)})),t}getPoll(e){return{poll:this.polls[e],results:this.results[e]}}getInputMediaPoll(e,t,a,s){return a?[a,s]=oa(a,s):a=void 0,{_:"inputMediaPoll",poll:e,correct_answers:t,solution:a,solution_entities:a?s:void 0}}updatePollToMessage(e,t){const{id:a}=e.media.poll;let s=this.pollToMessages[a];if(!t&&!s)return;s||(s=this.pollToMessages[a]=new Set);const n=e.peerId+"_"+e.mid;t?s.add(n):s.delete(n),!t&&!s.size&&(delete this.polls[a],delete this.results[a],delete this.pollToMessages[a])}sendVote(e,t){const a=e.media.poll,s=t.map(p=>a.answers[p].option),n=e.mid,i=e.peerId,r=this.appPeersManager.getInputPeerById(i);return e.pFlags.is_outgoing?this.appMessagesManager.invokeAfterMessageIsSent(n,"sendVote",p=>(this.log("invoke sendVote callback"),this.sendVote(p,t))):this.apiManager.invokeApi("messages.sendVote",{peer:r,msg_id:ae(e.mid),options:s}).then(p=>{this.log("sendVote updates:",p),this.apiUpdatesManager.processUpdateMessage(p)})}getResults(e){const t=this.appPeersManager.getInputPeerById(e.peerId);return this.apiManager.invokeApi("messages.getPollResults",{peer:t,msg_id:ae(e.mid)}).then(a=>{this.apiUpdatesManager.processUpdateMessage(a),this.log("getResults updates:",a)})}getVotes(e,t,a,s=20){return this.apiManager.invokeApi("messages.getPollVotes",{peer:this.appPeersManager.getInputPeerById(e.peerId),id:ae(e.mid),option:t,offset:a,limit:s}).then(n=>(this.log("getPollVotes messages:",n),this.appUsersManager.saveApiUsers(n.users),this.appChatsManager.saveApiChats(n.chats),n))}stopPoll(e){const t=e.media.poll;if(t.pFlags.closed)return Promise.resolve();const a=it(t);return a.pFlags.closed=!0,this.appMessagesManager.editMessage(e,void 0,{newMedia:this.getInputMediaPoll(a)}).then(()=>{},s=>{this.log.error("stopPoll error:",s)})}}class Wp extends ce{constructor(){super(...arguments),this.privacy={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updatePrivacy:e=>{const t=e.key._;this.privacy[t]=e.rules,this.rootScope.dispatchEvent("privacy_update",e)}})}setPrivacy(e,t){return this.apiManager.invokeApi("account.setPrivacy",{key:{_:e},rules:t}).then(a=>(this.appUsersManager.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats),this.apiUpdatesManager.processLocalUpdate({_:"updatePrivacy",key:{_:la(e)},rules:t.map(s=>{const n={};return Object.assign(n,s),n._=la(n._),n})}),a.rules))}getPrivacy(e){const t=la(e),a=this.privacy[t];return a?Promise.resolve(a):this.privacy[t]=this.apiManager.invokeApi("account.getPrivacy",{key:{_:e}}).then(s=>(this.appUsersManager.saveApiUsers(s.users),this.appChatsManager.saveApiChats(s.chats),this.privacy[t]=s.rules))}getGlobalPrivacySettings(){return this.apiManager.invokeApi("account.getGlobalPrivacySettings")}setGlobalPrivacySettings(e){return this.apiManager.invokeApi("account.setGlobalPrivacySettings",{settings:e})}}function zp(o){return o.participants_count||o.participants?.participants?.length||1}function Sa(o,e){return o.some(t=>t instanceof Promise)?Promise.all(o).then(e):e(o)}const bs=3*6e4,bn={filter:{_:"channelParticipantsRecent"},limit:200,offset:0};class Kp extends ce{constructor(){super(...arguments),this.usersFull={},this.chatsFull={},this.fullExpiration={},this.onUpdateChatParticipants=e=>{const t=e.participants;if(t._!=="chatParticipants")return;const a=t.chat_id,s=this.chatsFull[a];s!==void 0&&(s.participants=t,this.rootScope.dispatchEvent("chat_full_update",a))},this.onUpdateChatParticipantAdd=e=>{const t=this.chatsFull[e.chat_id];if(t===void 0)return;const a=t.participants,s=a.participants||[];for(let n=0,i=s.length;n<i;n++)if(s[n].user_id===e.user_id)return;s.push({_:"chatParticipant",user_id:e.user_id,inviter_id:e.inviter_id,date:Ie(!0)}),a.version=e.version,this.rootScope.dispatchEvent("chat_full_update",e.chat_id)},this.onUpdateChatParticipantDelete=e=>{const t=this.chatsFull[e.chat_id];if(t===void 0)return;const a=t.participants,s=a.participants||[];for(let n=0,i=s.length;n<i;n++)if(s[n].user_id===e.user_id){s.splice(n,1),a.version=e.version,this.rootScope.dispatchEvent("chat_full_update",e.chat_id);return}},this.onUpdateUserTyping=e=>{var l;const t=e.user_id?e.user_id.toPeerId():this.appPeersManager.getPeerId(e.from_id);if(this.appPeersManager.peerId===t||e.action._==="speakingInGroupCallAction")return;const a=e.top_msg_id,s=a?this.appMessagesIdsManager.generateMessageId(a,e.channel_id):void 0,n=this.appPeersManager.getPeerId(e),i=this.getTypingsKey(n,s),r=(l=this.typingsInPeer)[i]??(l[i]=[]),p=e.action;let d=r.find(m=>m.userId===t);p.msg_id&&(p.msg_id=this.appMessagesIdsManager.generateMessageId(p.msg_id,e.channel_id));const f=()=>{delete d.timeout;const m=r.indexOf(d);m!==-1&&r.splice(m,1),this.rootScope.dispatchEvent("peer_typings",{peerId:n,threadId:s,typings:r}),r.length||delete this.typingsInPeer[i]};if(d?.timeout!==void 0&&clearTimeout(d.timeout),p._==="sendMessageCancelAction"){if(!d)return;f();return}d||(d={userId:t},r.push(d)),d.action=p;const c=this.appUsersManager.hasUser(t);c?this.appUsersManager.forceUserOnline(t):e._==="updateChatUserTyping"&&e.chat_id&&this.appChatsManager.hasChat(e.chat_id)&&!this.appChatsManager.isChannel(e.chat_id)&&Promise.resolve(this.getChatFull(e.chat_id)).then(()=>{d.timeout!==void 0&&this.appUsersManager.hasUser(t)&&this.rootScope.dispatchEvent("peer_typings",{peerId:n,threadId:s,typings:r})}),d.timeout=we.setTimeout(f,6e3),c&&this.rootScope.dispatchEvent("peer_typings",{peerId:n,threadId:s,typings:r})},this.onUpdatePeerBlocked=e=>{const t=this.appPeersManager.getPeerId(e.peer_id);if(this.appPeersManager.isUser(t)){const a=t.toUserId(),s=this.usersFull[a];s&&(e.pFlags.blocked?s.pFlags.blocked=!0:delete s.pFlags.blocked,e.pFlags.blocked_my_stories_from?s.pFlags.blocked_my_stories_from=!0:delete s.pFlags.blocked_my_stories_from),this.rootScope.dispatchEvent("user_full_update",a)}this.rootScope.dispatchEvent("peer_block",{peerId:t,blocked:e.pFlags.blocked,blockedMyStoriesFrom:e.pFlags.blocked_my_stories_from})},this.onUpdatePeerSettings=e=>{const t=this.appPeersManager.getPeerId(e.peer);this.rootScope.dispatchEvent("peer_settings",{peerId:t,settings:e.settings})}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateChatParticipants:this.onUpdateChatParticipants,updateChatParticipantAdd:this.onUpdateChatParticipantAdd,updateChatParticipantDelete:this.onUpdateChatParticipantDelete,updateUserTyping:this.onUpdateUserTyping,updateChatUserTyping:this.onUpdateUserTyping,updateChannelUserTyping:this.onUpdateUserTyping,updatePeerBlocked:this.onUpdatePeerBlocked,updatePeerSettings:this.onUpdatePeerSettings}),this.rootScope.addEventListener("chat_update",e=>{const t=this.chatsFull[e],a=this.appChatsManager.getChat(e);if(!t||!a)return;let s=!1;!!t.call!=!!a.pFlags?.call_active&&(s=!0);const{photo:n}=a;if(n){const i=n._!=="chatPhotoEmpty",r=!!(t.chat_photo&&t.chat_photo._!=="photoEmpty");(i!==r||i&&n.photo_id!==t.chat_photo?.id)&&(s=!0)}s&&this.refreshFullPeer(e.toPeerId(!0))}),this.rootScope.addEventListener("channel_update",e=>{this.refreshFullPeer(e.toPeerId(!0))}),this.rootScope.addEventListener("chat_full_update",e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!0))}),this.rootScope.addEventListener("user_full_update",e=>{this.rootScope.dispatchEvent("peer_full_update",e.toPeerId(!1))}),this.rootScope.addEventListener("invalidate_participants",e=>{this.invalidateChannelParticipants(e)}),this.rootScope.addEventListener("peer_bio_edit",e=>{this.rootScope.dispatchEvent("user_full_update",e.toUserId())}),this.typingsInPeer={},this.peerSettings={}}getProfile(e,t){return this.usersFull[e]&&!t&&Date.now()<this.fullExpiration[e.toPeerId()]?this.usersFull[e]:this.apiManager.invokeApiSingleProcess({method:"users.getFullUser",params:{id:this.appUsersManager.getUserInput(e)},processResult:a=>{this.appChatsManager.saveApiChats(a.chats,!0),this.appUsersManager.saveApiUsers(a.users);const s=a.full_user,n=e.toPeerId(!1);s.profile_photo&&(s.profile_photo=this.appPhotosManager.savePhoto(s.profile_photo,{type:"profilePhoto",peerId:n})),s.wallpaper=this.appThemesManager.saveWallPaper(s.wallpaper);const i=s.bot_info;if(i){const r={type:"userFull",userId:e};i.description_document=this.appDocsManager.saveDoc(i.description_document,r),i.description_photo=this.appPhotosManager.savePhoto(i.description_photo,r)}return s.business_intro=this.appBusinessManager.saveBusinessIntro(e,s.business_intro),s.personal_channel_message&&(s.personal_channel_message=this.appMessagesIdsManager.generateMessageId(s.personal_channel_message,s.personal_channel_id)),this.appNotificationsManager.savePeerSettings({peerId:n,settings:s.notify_settings}),this.usersFull[e]=s,this.fullExpiration[n]=Date.now()+bs,this.rootScope.dispatchEvent("user_full_update",e),s}})}getProfileByPeerId(e,t){return this.appPeersManager.isAnyChat(e)?this.getChatFull(e.toChatId(),t):this.getProfile(e.toUserId(),t)}getCachedFullChat(e){return this.chatsFull[e]}getCachedFullUser(e){return this.usersFull[e]}getCachedProfileByPeerId(e){return e.isUser()?this.getCachedFullUser(e.toUserId()):this.getCachedFullChat(e.toChatId())}modifyCachedFullChat(e,t){this.modifyCachedFullPeer(e.toPeerId(!0),t)}modifyCachedFullUser(e,t){this.modifyCachedFullPeer(e.toPeerId(!0),t)}modifyCachedFullPeer(e,t){const a=this.getCachedProfileByPeerId(e);if(a){if(t(a)===!1)return;e.isUser()?this.rootScope.dispatchEvent("user_full_update",e.toUserId()):this.rootScope.dispatchEvent("chat_full_update",e.toChatId())}}isUserBlocked(e){return Ce(this.getProfile(e),t=>!!t.pFlags.blocked)}isCachedUserBlocked(e){const t=this.isUserBlocked(e);return t instanceof Promise?void 0:t}async getFullPhoto(e){const t=await this.getProfileByPeerId(e);switch(t._){case"userFull":return t.profile_photo;case"channelFull":case"chatFull":return t.chat_photo}}getChatFull(e,t){if(this.appChatsManager.isChannel(e))return this.getChannelFull(e,t);const a=e.toPeerId(!0),s=this.chatsFull[e];if(s&&!t&&Date.now()<this.fullExpiration[a]){const n=this.appChatsManager.getChat(e);if(n.pFlags.left||n.pFlags.deactivated||n.version===s.participants.version)return s}return this.apiManager.invokeApiSingleProcess({method:"messages.getFullChat",params:{chat_id:e},processResult:n=>{this.appChatsManager.saveApiChats(n.chats,!0),this.appUsersManager.saveApiUsers(n.users);const i=n.full_chat;return i&&i.chat_photo&&i.chat_photo.id&&(i.chat_photo=this.appPhotosManager.savePhoto(i.chat_photo,{type:"profilePhoto",peerId:a})),i.call&&this.appGroupCallsManager.saveGroupCall(i.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:i.notify_settings}),this.chatsFull[e]=i,this.fullExpiration[a]=Date.now()+bs,this.rootScope.dispatchEvent("chat_full_update",e),i}})}async getChatInviteLink(e,t){const a=await this.getChatFull(e);return!t&&a.exported_invite&&a.exported_invite._=="chatInviteExported"?a.exported_invite.link:this.apiManager.invokeApi("messages.exportChatInvite",{peer:this.appPeersManager.getInputPeerById(e.toPeerId(!0))}).then(s=>(this.chatsFull[e]!==void 0&&(this.chatsFull[e].exported_invite=s),s.link))}filterParticipantsByQuery(e,t){const a=this.appUsersManager.createSearchIndex();e.forEach(i=>{const r=It(i);a.indexObject(r,this.appPeersManager.getPeerSearchText(r))});const s=a.search(t);return e.filter(i=>{const r=It(i);return s.has(r)})}getParticipants(e){e={...bn,...e};const{id:t,filter:a}=e;return this.appChatsManager.isChannel(t)?this.getChannelParticipants(e):Ce(this.getChatFull(t),s=>{const n=s.participants;if(n._!=="chatParticipants")throw Ee("CHAT_PRIVATE");return a._==="channelParticipantsSearch"&&a.q.trim()?{...n,participants:this.filterParticipantsByQuery(n.participants,a.q)}:n})}getParticipant(e,t){return this.appChatsManager.isChannel(e)?this.getChannelParticipant(e,t):Promise.resolve(this.getParticipants({id:e})).then(a=>{const s=a.participants.find(n=>{if(It(n)===t)return n});if(!s)throw Ee("USER_NOT_PARTICIPANT");return s})}getChannelParticipants(e){e={...bn,...e};const{id:t,filter:a,offset:s,limit:n}=e;if(!this.appChatsManager.hasRights(t,"view_participants"))throw Ee("CHAT_ADMIN_REQUIRED");const i=new Set(["channelParticipantsAdmins"]),r=this.apiManager.invokeApiCacheable("channels.getParticipants",{channel:this.appChatsManager.getChannelInput(t),filter:a,offset:s,limit:n,hash:"0"},{cacheSeconds:60,syncIfHasResult:!0});let p;if(e.forMessagesSearch)try{p=this.appChatsManager.getSendAs(t),p instanceof Promise&&(p=p.catch(()=>{}))}catch{}return Sa([r,p],([d,f])=>{this.appPeersManager.saveApiPeers(d);const c=a.q;if(f){const l=f.map(I=>({_:"channelParticipant",date:0,user_id:0,peer:I.peer})),m=t.toPeerId(!0),u={_:"channelParticipant",date:0,user_id:0,peer:this.appPeersManager.getOutputPeer(m)},M=this.appPeersManager.peerId,A={_:"channelParticipant",date:0,user_id:M.toUserId()};l.unshift(u,A);const w=d.participants.slice(),C=this.filterParticipantsByQuery(l,c);(C.includes(u)||!c?.trim())&&!w.some(I=>It(I)===m)&&(Oe(C,u),w.unshift(u));for(const I of C){const F=It(I);if(!w.some(L=>It(L)===F)||!w.some(L=>It(L)===M)){w.unshift(A);break}}return{...d,participants:w}}return i.has(a._)&&c?.trim()?{...d,participants:this.filterParticipantsByQuery(d.participants,c)}:d})}getChannelParticipant(e,t){return this.apiManager.invokeApiSingle("channels.getParticipant",{channel:this.appChatsManager.getChannelInput(e),participant:this.appPeersManager.getInputPeerById(t)}).then(a=>(this.appUsersManager.saveApiUsers(a.users),a.participant))}getChannelFull(e,t){const a=e.toPeerId(!0);return this.chatsFull[e]!==void 0&&!t&&Date.now()<this.fullExpiration[a]?this.chatsFull[e]:this.apiManager.invokeApiSingleProcess({method:"channels.getFullChannel",params:{channel:this.appChatsManager.getChannelInput(e)},processResult:s=>{this.appChatsManager.saveApiChats(s.chats,!0),this.appUsersManager.saveApiUsers(s.users);const n=s.full_chat;return n&&n.chat_photo.id&&(n.chat_photo=this.appPhotosManager.savePhoto(n.chat_photo,{type:"profilePhoto",peerId:a})),n.wallpaper=this.appThemesManager.saveWallPaper(n.wallpaper),n.call&&this.appGroupCallsManager.saveGroupCall(n.call,e),this.appNotificationsManager.savePeerSettings({peerId:a,settings:n.notify_settings}),this.chatsFull[e]=n,this.fullExpiration[a]=Date.now()+bs,this.rootScope.dispatchEvent("chat_full_update",e),n},processError:s=>{switch(s.type){case"CHANNEL_PRIVATE":const n=this.appChatsManager.getChat(e);n._!=="channelForbidden"&&this.appChatsManager.saveApiChats([{_:"channelForbidden",id:e,access_hash:n.access_hash,title:n.title,pFlags:n.pFlags}]),this.apiUpdatesManager.processLocalUpdate({_:"updateChannel",channel_id:e});break}throw s}})}getMentions(e,t,a,s){const n=r=>{if(t.charAt(0)==="@"&&(t=t.slice(1)),!!!t.trim())return r.map(m=>m.id);const f=new Ea({ignoreCase:!0}),c=new Map;r.forEach(m=>{f.indexObject(m.id,this.appUsersManager.getUserSearchText(m.id)),c.set(m.id,m.rating)});const l=Array.from(f.search(t));return l.sort((m,u)=>c.get(u)-c.get(m)),l};let i;return this.appChatsManager.isChannel(e)?i=Promise.resolve(this.getChannelParticipants({id:e,filter:{_:"channelParticipantsMentions",q:t,top_msg_id:ae(a)},limit:50,offset:0})).then(r=>r.participants.map(p=>It(p))):e&&(i=Promise.resolve(this.getChatFull(e)).then(r=>r.participants.participants.map(p=>p.user_id.toPeerId()))),Promise.all([s?[]:this.appUsersManager.getTopPeers("bots_inline").catch(()=>[]),i,s&&this.appUsersManager.getContactsPeerIds(t,!1,"rating",30)]).then(([r,p,d])=>{d&&(d=d.filter(l=>{const m=this.appPeersManager.getPeer(l);return!!zt(m)[0]}));const f=l=>l?l.map(m=>({id:m,rating:0})):[],c=r.concat(f(p),f(d));return n(c)})}invalidateChannelParticipants(e){this.apiManager.clearCache("channels.getParticipants",t=>t.channel.channel_id===e),this.getCachedFullChat(e)&&this.refreshFullPeer(e.toPeerId(!0))}refreshFullPeer(e){if(e.isUser()){const t=e.toUserId();delete this.usersFull[t],this.rootScope.dispatchEvent("user_full_update",t)}else{const t=e.toChatId();delete this.chatsFull[t],this.rootScope.dispatchEvent("chat_full_update",t)}}refreshFullPeerIfNeeded(e){(e.isUser()?this.usersFull[e.toUserId()]:this.chatsFull[e.toChatId()])&&this.refreshFullPeer(e)}updateProfile(e,t,a){return this.apiManager.invokeApi("account.updateProfile",{first_name:e,last_name:t,about:a}).then(s=>{if(this.appUsersManager.saveApiUser(s),a!==void 0){const n=s.id.toPeerId(),i=this.usersFull[s.id];i&&(i.about=a),this.rootScope.dispatchEvent("peer_bio_edit",n)}return this.getProfile(s.id,!0)})}setBotInfo(e,t,a){return this.apiManager.invokeApi("bots.setBotInfo",{lang_code:"",bot:this.appUsersManager.getUserInput(e),name:t,about:a}).then(()=>{const s=this.appUsersManager.getUser(e);t!==void 0&&this.appUsersManager.saveApiUser({...s,first_name:t});const n=this.getCachedFullUser(e);return a!==void 0&&(n&&(n.about=a),this.rootScope.dispatchEvent("peer_bio_edit",e.toPeerId())),this.getProfile(e,!0)})}getBotInfo(e){return this.apiManager.invokeApiSingle("bots.getBotInfo",{bot:this.appUsersManager.getUserInput(e),lang_code:""})}uploadProfilePhoto(e,t){return this.apiManager.invokeApi("photos.uploadProfilePhoto",{file:e,bot:t?this.appUsersManager.getUserInput(t):void 0}).then(a=>{const s=a.photo;if(!a.users.length){const r=s.sizes.find(p=>p._==="photoStrippedSize");a.users.push({...t?this.appUsersManager.getUser(t):this.appUsersManager.getSelf(),photo:{_:"userProfilePhoto",dc_id:s.dc_id,photo_id:s.id,stripped_thumb:r?.bytes,pFlags:{}}})}this.appUsersManager.saveApiUsers(a.users);const n=t?t.toPeerId():this.appPeersManager.peerId;this.appPhotosManager.savePhoto(a.photo,{type:"profilePhoto",peerId:n});const i=n.toUserId();this.apiUpdatesManager.processLocalUpdate({_:"updateUser",user_id:i})})}deletePhotos(e){return this.apiManager.invokeApiSingle("photos.deletePhotos",{id:e.map(t=>{const a=this.appPhotosManager.getPhoto(t);return Mi(a)})}).then(t=>{})}verifyParticipantForOnlineCount(e){const t=this.appUsersManager.getUser(e.user_id);return!!(t&&t.status&&t.status._==="userStatusOnline")}reduceParticipantsForOnlineCount(e){return e.reduce((t,a)=>t+ +this.verifyParticipantForOnlineCount(a),0)}getOnlines(e){return this.appChatsManager.isBroadcast(e)?1:Ce(this.getChatFull(e),a=>{if(zp(a)<2)return 1;if(this.appChatsManager.isMegagroup(e)){if(a.participants_count<=100){const i=this.getChannelParticipants({id:e,filter:{_:"channelParticipantsRecent"},limit:100});return Ce(i,r=>this.reduceParticipantsForOnlineCount(r.participants))}const n=this.apiManager.invokeApiCacheable("messages.getOnlines",{peer:this.appChatsManager.getChannelInputPeer(e)},{cacheSeconds:60,syncIfHasResult:!0});return Ce(n,i=>i.onlines??1)}const s=a.participants;return s?.participants?this.reduceParticipantsForOnlineCount(s.participants):1})}getTypingsKey(e,t){return e+(t?`_${t}`:"")}getPeerTypings(e,t){return this.typingsInPeer[this.getTypingsKey(e,t)]}canGiftPremium(e){return this.appUsersManager.getUser(e)?.pFlags?.premium?!1:Ce(this.getProfile(e),a=>{const s=this.appUsersManager.getUser(e);return!!a.premium_gifts&&!s?.pFlags?.premium})}canViewStatistics(e){if(e.isUser())return!1;const t=e.toChatId(),a=this.getCachedFullChat(t);return a?!!(a.stats_dc&&a.pFlags.can_view_stats):!1}refreshPeerSettingsIfNeeded(e){this.peerSettings[e]&&(delete this.peerSettings[e],Ce(this.getPeerSettings(e),t=>{this.apiUpdatesManager.processLocalUpdate({_:"updatePeerSettings",peer:this.appPeersManager.getOutputPeer(e),settings:t})}))}getPeerSettings(e){return this.peerSettings[e]?this.peerSettings[e]:this.apiManager.invokeApiSingleProcess({method:"messages.getPeerSettings",params:{peer:this.appPeersManager.getInputPeerById(e)},processResult:t=>(this.appChatsManager.saveApiChats(t.chats,!0),this.appUsersManager.saveApiUsers(t.users),this.peerSettings[e]=t.settings)})}hidePeerSettingsBar(e){return this.apiManager.invokeApiSingleProcess({method:"messages.hidePeerSettingsBar",params:{peer:this.appPeersManager.getInputPeerById(e)},processResult:()=>{this.refreshPeerSettingsIfNeeded(e)}})}}var Ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ui(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function Jp(o){if(o.__esModule)return o;var e=o.default;if(typeof e=="function"){var t=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(o).forEach(function(a){var s=Object.getOwnPropertyDescriptor(o,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:function(){return o[a]}})}),t}var Ti={exports:{}},Qp={},Yp=Object.freeze({__proto__:null,default:Qp}),Cn=Jp(Yp);/**
|
||
* [js-md5]{@link https://github.com/emn178/js-md5}
|
||
*
|
||
* @namespace md5
|
||
* @version 0.8.3
|
||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||
* @copyright Chen, Yi-Cyuan 2014-2023
|
||
* @license MIT
|
||
*/(function(o){(function(){var e="input is invalid type",t="finalize already called",a=typeof window=="object",s=a?window:{};s.JS_MD5_NO_WINDOW&&(a=!1);var n=!a&&typeof self=="object",i=!s.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;i?s=Ei:n&&(s=self);var r=!s.JS_MD5_NO_COMMON_JS&&!0&&o.exports,p=!s.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),f=[128,32768,8388608,-2147483648],c=[0,8,16,24],l=["hex","array","digest","buffer","arrayBuffer","base64"],m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),u=[],M;if(p){var A=new ArrayBuffer(68);M=new Uint8Array(A),u=new Uint32Array(A)}var w=Array.isArray;(s.JS_MD5_NO_NODE_JS||!w)&&(w=function(y){return Object.prototype.toString.call(y)==="[object Array]"});var C=ArrayBuffer.isView;p&&(s.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!C)&&(C=function(y){return typeof y=="object"&&y.buffer&&y.buffer.constructor===ArrayBuffer});var I=function(y){var P=typeof y;if(P==="string")return[y,!0];if(P!=="object"||y===null)throw new Error(e);if(p&&y.constructor===ArrayBuffer)return[new Uint8Array(y),!1];if(!w(y)&&!C(y))throw new Error(e);return[y,!1]},F=function(y){return function(P){return new X(!0).update(P)[y]()}},L=function(){var y=F("hex");i&&(y=z(y)),y.create=function(){return new X},y.update=function(v){return y.create().update(v)};for(var P=0;P<l.length;++P){var S=l[P];y[S]=F(S)}return y},z=function(y){var P=Cn,S=Cn.Buffer,v;S.from&&!s.JS_MD5_NO_BUFFER_FROM?v=S.from:v=function(T){return new S(T)};var Q=function(T){if(typeof T=="string")return P.createHash("md5").update(T,"utf8").digest("hex");if(T==null)throw new Error(e);return T.constructor===ArrayBuffer&&(T=new Uint8Array(T)),w(T)||C(T)||T.constructor===S?P.createHash("md5").update(v(T)).digest("hex"):y(T)};return Q},j=function(y){return function(P,S){return new O(P,!0).update(S)[y]()}},Z=function(){var y=j("hex");y.create=function(v){return new O(v)},y.update=function(v,Q){return y.create(v).update(Q)};for(var P=0;P<l.length;++P){var S=l[P];y[S]=j(S)}return y};function X(y){if(y)u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u,this.buffer8=M;else if(p){var P=new ArrayBuffer(68);this.buffer8=new Uint8Array(P),this.blocks=new Uint32Array(P)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}X.prototype.update=function(y){if(this.finalized)throw new Error(t);var P=I(y);y=P[0];for(var S=P[1],v,Q=0,T,R=y.length,ee=this.blocks,le=this.buffer8;Q<R;){if(this.hashed&&(this.hashed=!1,ee[0]=ee[16],ee[16]=ee[1]=ee[2]=ee[3]=ee[4]=ee[5]=ee[6]=ee[7]=ee[8]=ee[9]=ee[10]=ee[11]=ee[12]=ee[13]=ee[14]=ee[15]=0),S)if(p)for(T=this.start;Q<R&&T<64;++Q)v=y.charCodeAt(Q),v<128?le[T++]=v:v<2048?(le[T++]=192|v>>>6,le[T++]=128|v&63):v<55296||v>=57344?(le[T++]=224|v>>>12,le[T++]=128|v>>>6&63,le[T++]=128|v&63):(v=65536+((v&1023)<<10|y.charCodeAt(++Q)&1023),le[T++]=240|v>>>18,le[T++]=128|v>>>12&63,le[T++]=128|v>>>6&63,le[T++]=128|v&63);else for(T=this.start;Q<R&&T<64;++Q)v=y.charCodeAt(Q),v<128?ee[T>>>2]|=v<<c[T++&3]:v<2048?(ee[T>>>2]|=(192|v>>>6)<<c[T++&3],ee[T>>>2]|=(128|v&63)<<c[T++&3]):v<55296||v>=57344?(ee[T>>>2]|=(224|v>>>12)<<c[T++&3],ee[T>>>2]|=(128|v>>>6&63)<<c[T++&3],ee[T>>>2]|=(128|v&63)<<c[T++&3]):(v=65536+((v&1023)<<10|y.charCodeAt(++Q)&1023),ee[T>>>2]|=(240|v>>>18)<<c[T++&3],ee[T>>>2]|=(128|v>>>12&63)<<c[T++&3],ee[T>>>2]|=(128|v>>>6&63)<<c[T++&3],ee[T>>>2]|=(128|v&63)<<c[T++&3]);else if(p)for(T=this.start;Q<R&&T<64;++Q)le[T++]=y[Q];else for(T=this.start;Q<R&&T<64;++Q)ee[T>>>2]|=y[Q]<<c[T++&3];this.lastByteIndex=T,this.bytes+=T-this.start,T>=64?(this.start=T-64,this.hash(),this.hashed=!0):this.start=T}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},X.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var y=this.blocks,P=this.lastByteIndex;y[P>>>2]|=f[P&3],P>=56&&(this.hashed||this.hash(),y[0]=y[16],y[16]=y[1]=y[2]=y[3]=y[4]=y[5]=y[6]=y[7]=y[8]=y[9]=y[10]=y[11]=y[12]=y[13]=y[14]=y[15]=0),y[14]=this.bytes<<3,y[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},X.prototype.hash=function(){var y,P,S,v,Q,T,R=this.blocks;this.first?(y=R[0]-680876937,y=(y<<7|y>>>25)-271733879<<0,v=(-1732584194^y&2004318071)+R[1]-117830708,v=(v<<12|v>>>20)+y<<0,S=(-271733879^v&(y^-271733879))+R[2]-1126478375,S=(S<<17|S>>>15)+v<<0,P=(y^S&(v^y))+R[3]-1316259209,P=(P<<22|P>>>10)+S<<0):(y=this.h0,P=this.h1,S=this.h2,v=this.h3,y+=(v^P&(S^v))+R[0]-680876936,y=(y<<7|y>>>25)+P<<0,v+=(S^y&(P^S))+R[1]-389564586,v=(v<<12|v>>>20)+y<<0,S+=(P^v&(y^P))+R[2]+606105819,S=(S<<17|S>>>15)+v<<0,P+=(y^S&(v^y))+R[3]-1044525330,P=(P<<22|P>>>10)+S<<0),y+=(v^P&(S^v))+R[4]-176418897,y=(y<<7|y>>>25)+P<<0,v+=(S^y&(P^S))+R[5]+1200080426,v=(v<<12|v>>>20)+y<<0,S+=(P^v&(y^P))+R[6]-1473231341,S=(S<<17|S>>>15)+v<<0,P+=(y^S&(v^y))+R[7]-45705983,P=(P<<22|P>>>10)+S<<0,y+=(v^P&(S^v))+R[8]+1770035416,y=(y<<7|y>>>25)+P<<0,v+=(S^y&(P^S))+R[9]-1958414417,v=(v<<12|v>>>20)+y<<0,S+=(P^v&(y^P))+R[10]-42063,S=(S<<17|S>>>15)+v<<0,P+=(y^S&(v^y))+R[11]-1990404162,P=(P<<22|P>>>10)+S<<0,y+=(v^P&(S^v))+R[12]+1804603682,y=(y<<7|y>>>25)+P<<0,v+=(S^y&(P^S))+R[13]-40341101,v=(v<<12|v>>>20)+y<<0,S+=(P^v&(y^P))+R[14]-1502002290,S=(S<<17|S>>>15)+v<<0,P+=(y^S&(v^y))+R[15]+1236535329,P=(P<<22|P>>>10)+S<<0,y+=(S^v&(P^S))+R[1]-165796510,y=(y<<5|y>>>27)+P<<0,v+=(P^S&(y^P))+R[6]-1069501632,v=(v<<9|v>>>23)+y<<0,S+=(y^P&(v^y))+R[11]+643717713,S=(S<<14|S>>>18)+v<<0,P+=(v^y&(S^v))+R[0]-373897302,P=(P<<20|P>>>12)+S<<0,y+=(S^v&(P^S))+R[5]-701558691,y=(y<<5|y>>>27)+P<<0,v+=(P^S&(y^P))+R[10]+38016083,v=(v<<9|v>>>23)+y<<0,S+=(y^P&(v^y))+R[15]-660478335,S=(S<<14|S>>>18)+v<<0,P+=(v^y&(S^v))+R[4]-405537848,P=(P<<20|P>>>12)+S<<0,y+=(S^v&(P^S))+R[9]+568446438,y=(y<<5|y>>>27)+P<<0,v+=(P^S&(y^P))+R[14]-1019803690,v=(v<<9|v>>>23)+y<<0,S+=(y^P&(v^y))+R[3]-187363961,S=(S<<14|S>>>18)+v<<0,P+=(v^y&(S^v))+R[8]+1163531501,P=(P<<20|P>>>12)+S<<0,y+=(S^v&(P^S))+R[13]-1444681467,y=(y<<5|y>>>27)+P<<0,v+=(P^S&(y^P))+R[2]-51403784,v=(v<<9|v>>>23)+y<<0,S+=(y^P&(v^y))+R[7]+1735328473,S=(S<<14|S>>>18)+v<<0,P+=(v^y&(S^v))+R[12]-1926607734,P=(P<<20|P>>>12)+S<<0,Q=P^S,y+=(Q^v)+R[5]-378558,y=(y<<4|y>>>28)+P<<0,v+=(Q^y)+R[8]-2022574463,v=(v<<11|v>>>21)+y<<0,T=v^y,S+=(T^P)+R[11]+1839030562,S=(S<<16|S>>>16)+v<<0,P+=(T^S)+R[14]-35309556,P=(P<<23|P>>>9)+S<<0,Q=P^S,y+=(Q^v)+R[1]-1530992060,y=(y<<4|y>>>28)+P<<0,v+=(Q^y)+R[4]+1272893353,v=(v<<11|v>>>21)+y<<0,T=v^y,S+=(T^P)+R[7]-155497632,S=(S<<16|S>>>16)+v<<0,P+=(T^S)+R[10]-1094730640,P=(P<<23|P>>>9)+S<<0,Q=P^S,y+=(Q^v)+R[13]+681279174,y=(y<<4|y>>>28)+P<<0,v+=(Q^y)+R[0]-358537222,v=(v<<11|v>>>21)+y<<0,T=v^y,S+=(T^P)+R[3]-722521979,S=(S<<16|S>>>16)+v<<0,P+=(T^S)+R[6]+76029189,P=(P<<23|P>>>9)+S<<0,Q=P^S,y+=(Q^v)+R[9]-640364487,y=(y<<4|y>>>28)+P<<0,v+=(Q^y)+R[12]-421815835,v=(v<<11|v>>>21)+y<<0,T=v^y,S+=(T^P)+R[15]+530742520,S=(S<<16|S>>>16)+v<<0,P+=(T^S)+R[2]-995338651,P=(P<<23|P>>>9)+S<<0,y+=(S^(P|~v))+R[0]-198630844,y=(y<<6|y>>>26)+P<<0,v+=(P^(y|~S))+R[7]+1126891415,v=(v<<10|v>>>22)+y<<0,S+=(y^(v|~P))+R[14]-1416354905,S=(S<<15|S>>>17)+v<<0,P+=(v^(S|~y))+R[5]-57434055,P=(P<<21|P>>>11)+S<<0,y+=(S^(P|~v))+R[12]+1700485571,y=(y<<6|y>>>26)+P<<0,v+=(P^(y|~S))+R[3]-1894986606,v=(v<<10|v>>>22)+y<<0,S+=(y^(v|~P))+R[10]-1051523,S=(S<<15|S>>>17)+v<<0,P+=(v^(S|~y))+R[1]-2054922799,P=(P<<21|P>>>11)+S<<0,y+=(S^(P|~v))+R[8]+1873313359,y=(y<<6|y>>>26)+P<<0,v+=(P^(y|~S))+R[15]-30611744,v=(v<<10|v>>>22)+y<<0,S+=(y^(v|~P))+R[6]-1560198380,S=(S<<15|S>>>17)+v<<0,P+=(v^(S|~y))+R[13]+1309151649,P=(P<<21|P>>>11)+S<<0,y+=(S^(P|~v))+R[4]-145523070,y=(y<<6|y>>>26)+P<<0,v+=(P^(y|~S))+R[11]-1120210379,v=(v<<10|v>>>22)+y<<0,S+=(y^(v|~P))+R[2]+718787259,S=(S<<15|S>>>17)+v<<0,P+=(v^(S|~y))+R[9]-343485551,P=(P<<21|P>>>11)+S<<0,this.first?(this.h0=y+1732584193<<0,this.h1=P-271733879<<0,this.h2=S-1732584194<<0,this.h3=v+271733878<<0,this.first=!1):(this.h0=this.h0+y<<0,this.h1=this.h1+P<<0,this.h2=this.h2+S<<0,this.h3=this.h3+v<<0)},X.prototype.hex=function(){this.finalize();var y=this.h0,P=this.h1,S=this.h2,v=this.h3;return d[y>>>4&15]+d[y&15]+d[y>>>12&15]+d[y>>>8&15]+d[y>>>20&15]+d[y>>>16&15]+d[y>>>28&15]+d[y>>>24&15]+d[P>>>4&15]+d[P&15]+d[P>>>12&15]+d[P>>>8&15]+d[P>>>20&15]+d[P>>>16&15]+d[P>>>28&15]+d[P>>>24&15]+d[S>>>4&15]+d[S&15]+d[S>>>12&15]+d[S>>>8&15]+d[S>>>20&15]+d[S>>>16&15]+d[S>>>28&15]+d[S>>>24&15]+d[v>>>4&15]+d[v&15]+d[v>>>12&15]+d[v>>>8&15]+d[v>>>20&15]+d[v>>>16&15]+d[v>>>28&15]+d[v>>>24&15]},X.prototype.toString=X.prototype.hex,X.prototype.digest=function(){this.finalize();var y=this.h0,P=this.h1,S=this.h2,v=this.h3;return[y&255,y>>>8&255,y>>>16&255,y>>>24&255,P&255,P>>>8&255,P>>>16&255,P>>>24&255,S&255,S>>>8&255,S>>>16&255,S>>>24&255,v&255,v>>>8&255,v>>>16&255,v>>>24&255]},X.prototype.array=X.prototype.digest,X.prototype.arrayBuffer=function(){this.finalize();var y=new ArrayBuffer(16),P=new Uint32Array(y);return P[0]=this.h0,P[1]=this.h1,P[2]=this.h2,P[3]=this.h3,y},X.prototype.buffer=X.prototype.arrayBuffer,X.prototype.base64=function(){for(var y,P,S,v="",Q=this.array(),T=0;T<15;)y=Q[T++],P=Q[T++],S=Q[T++],v+=m[y>>>2]+m[(y<<4|P>>>4)&63]+m[(P<<2|S>>>6)&63]+m[S&63];return y=Q[T],v+=m[y>>>2]+m[y<<4&63]+"==",v};function O(y,P){var S,v=I(y);if(y=v[0],v[1]){var Q=[],T=y.length,R=0,ee;for(S=0;S<T;++S)ee=y.charCodeAt(S),ee<128?Q[R++]=ee:ee<2048?(Q[R++]=192|ee>>>6,Q[R++]=128|ee&63):ee<55296||ee>=57344?(Q[R++]=224|ee>>>12,Q[R++]=128|ee>>>6&63,Q[R++]=128|ee&63):(ee=65536+((ee&1023)<<10|y.charCodeAt(++S)&1023),Q[R++]=240|ee>>>18,Q[R++]=128|ee>>>12&63,Q[R++]=128|ee>>>6&63,Q[R++]=128|ee&63);y=Q}y.length>64&&(y=new X(!0).update(y).array());var le=[],ze=[];for(S=0;S<64;++S){var Ne=y[S]||0;le[S]=92^Ne,ze[S]=54^Ne}X.call(this,P),this.update(ze),this.oKeyPad=le,this.inner=!0,this.sharedMemory=P}O.prototype=new X,O.prototype.finalize=function(){if(X.prototype.finalize.call(this),this.inner){this.inner=!1;var y=this.array();X.call(this,this.sharedMemory),this.update(this.oKeyPad),this.update(y),X.prototype.finalize.call(this)}};var B=L();B.md5=B,B.md5.hmac=Z(),r?o.exports=B:s.md5=B})()})(Ti);var $p=Ti.exports,Ri={exports:{}};(function(o){var e=function(t){var a=1e7,s=7,n=9007199254740992,i=u(n),r="0123456789abcdefghijklmnopqrstuvwxyz",p=typeof BigInt=="function";function d(h,_,D,k){return typeof h>"u"?d[0]:typeof _<"u"?+_==10&&!D?re(h):fs(h,_,D,k):re(h)}function f(h,_){this.value=h,this.sign=_,this.isSmall=!1}f.prototype=Object.create(d.prototype);function c(h){this.value=h,this.sign=h<0,this.isSmall=!0}c.prototype=Object.create(d.prototype);function l(h){this.value=h}l.prototype=Object.create(d.prototype);function m(h){return-n<h&&h<n}function u(h){return h<1e7?[h]:h<1e14?[h%1e7,Math.floor(h/1e7)]:[h%1e7,Math.floor(h/1e7)%1e7,Math.floor(h/1e14)]}function M(h){A(h);var _=h.length;if(_<4&&le(h,i)<0)switch(_){case 0:return 0;case 1:return h[0];case 2:return h[0]+h[1]*a;default:return h[0]+(h[1]+h[2]*a)*a}return h}function A(h){for(var _=h.length;h[--_]===0;);h.length=_+1}function w(h){for(var _=new Array(h),D=-1;++D<h;)_[D]=0;return _}function C(h){return h>0?Math.floor(h):Math.ceil(h)}function I(h,_){var D=h.length,k=_.length,x=new Array(D),U=0,G=a,H,J;for(J=0;J<k;J++)H=h[J]+_[J]+U,U=H>=G?1:0,x[J]=H-U*G;for(;J<D;)H=h[J]+U,U=H===G?1:0,x[J++]=H-U*G;return U>0&&x.push(U),x}function F(h,_){return h.length>=_.length?I(h,_):I(_,h)}function L(h,_){var D=h.length,k=new Array(D),x=a,U,G;for(G=0;G<D;G++)U=h[G]-x+_,_=Math.floor(U/x),k[G]=U-_*x,_+=1;for(;_>0;)k[G++]=_%x,_=Math.floor(_/x);return k}f.prototype.add=function(h){var _=re(h);if(this.sign!==_.sign)return this.subtract(_.negate());var D=this.value,k=_.value;return _.isSmall?new f(L(D,Math.abs(k)),this.sign):new f(F(D,k),this.sign)},f.prototype.plus=f.prototype.add,c.prototype.add=function(h){var _=re(h),D=this.value;if(D<0!==_.sign)return this.subtract(_.negate());var k=_.value;if(_.isSmall){if(m(D+k))return new c(D+k);k=u(Math.abs(k))}return new f(L(k,Math.abs(D)),D<0)},c.prototype.plus=c.prototype.add,l.prototype.add=function(h){return new l(this.value+re(h).value)},l.prototype.plus=l.prototype.add;function z(h,_){var D=h.length,k=_.length,x=new Array(D),U=0,G=a,H,J;for(H=0;H<k;H++)J=h[H]-U-_[H],J<0?(J+=G,U=1):U=0,x[H]=J;for(H=k;H<D;H++){if(J=h[H]-U,J<0)J+=G;else{x[H++]=J;break}x[H]=J}for(;H<D;H++)x[H]=h[H];return A(x),x}function j(h,_,D){var k;return le(h,_)>=0?k=z(h,_):(k=z(_,h),D=!D),k=M(k),typeof k=="number"?(D&&(k=-k),new c(k)):new f(k,D)}function Z(h,_,D){var k=h.length,x=new Array(k),U=-_,G=a,H,J;for(H=0;H<k;H++)J=h[H]+U,U=Math.floor(J/G),J%=G,x[H]=J<0?J+G:J;return x=M(x),typeof x=="number"?(D&&(x=-x),new c(x)):new f(x,D)}f.prototype.subtract=function(h){var _=re(h);if(this.sign!==_.sign)return this.add(_.negate());var D=this.value,k=_.value;return _.isSmall?Z(D,Math.abs(k),this.sign):j(D,k,this.sign)},f.prototype.minus=f.prototype.subtract,c.prototype.subtract=function(h){var _=re(h),D=this.value;if(D<0!==_.sign)return this.add(_.negate());var k=_.value;return _.isSmall?new c(D-k):Z(k,Math.abs(D),D>=0)},c.prototype.minus=c.prototype.subtract,l.prototype.subtract=function(h){return new l(this.value-re(h).value)},l.prototype.minus=l.prototype.subtract,f.prototype.negate=function(){return new f(this.value,!this.sign)},c.prototype.negate=function(){var h=this.sign,_=new c(-this.value);return _.sign=!h,_},l.prototype.negate=function(){return new l(-this.value)},f.prototype.abs=function(){return new f(this.value,!1)},c.prototype.abs=function(){return new c(Math.abs(this.value))},l.prototype.abs=function(){return new l(this.value>=0?this.value:-this.value)};function X(h,_){var D=h.length,k=_.length,x=D+k,U=w(x),G=a,H,J,oe,he,fe;for(oe=0;oe<D;++oe){he=h[oe];for(var Me=0;Me<k;++Me)fe=_[Me],H=he*fe+U[oe+Me],J=Math.floor(H/G),U[oe+Me]=H-J*G,U[oe+Me+1]+=J}return A(U),U}function O(h,_){var D=h.length,k=new Array(D),x=a,U=0,G,H;for(H=0;H<D;H++)G=h[H]*_+U,U=Math.floor(G/x),k[H]=G-U*x;for(;U>0;)k[H++]=U%x,U=Math.floor(U/x);return k}function B(h,_){for(var D=[];_-- >0;)D.push(0);return D.concat(h)}function y(h,_){var D=Math.max(h.length,_.length);if(D<=30)return X(h,_);D=Math.ceil(D/2);var k=h.slice(D),x=h.slice(0,D),U=_.slice(D),G=_.slice(0,D),H=y(x,G),J=y(k,U),oe=y(F(x,k),F(G,U)),he=F(F(H,B(z(z(oe,H),J),D)),B(J,2*D));return A(he),he}function P(h,_){return-.012*h-.012*_+15e-6*h*_>0}f.prototype.multiply=function(h){var _=re(h),D=this.value,k=_.value,x=this.sign!==_.sign,U;if(_.isSmall){if(k===0)return d[0];if(k===1)return this;if(k===-1)return this.negate();if(U=Math.abs(k),U<a)return new f(O(D,U),x);k=u(U)}return P(D.length,k.length)?new f(y(D,k),x):new f(X(D,k),x)},f.prototype.times=f.prototype.multiply;function S(h,_,D){return h<a?new f(O(_,h),D):new f(X(_,u(h)),D)}c.prototype._multiplyBySmall=function(h){return m(h.value*this.value)?new c(h.value*this.value):S(Math.abs(h.value),u(Math.abs(this.value)),this.sign!==h.sign)},f.prototype._multiplyBySmall=function(h){return h.value===0?d[0]:h.value===1?this:h.value===-1?this.negate():S(Math.abs(h.value),this.value,this.sign!==h.sign)},c.prototype.multiply=function(h){return re(h)._multiplyBySmall(this)},c.prototype.times=c.prototype.multiply,l.prototype.multiply=function(h){return new l(this.value*re(h).value)},l.prototype.times=l.prototype.multiply;function v(h){var _=h.length,D=w(_+_),k=a,x,U,G,H,J;for(G=0;G<_;G++){H=h[G],U=0-H*H;for(var oe=G;oe<_;oe++)J=h[oe],x=2*(H*J)+D[G+oe]+U,U=Math.floor(x/k),D[G+oe]=x-U*k;D[G+_]=U}return A(D),D}f.prototype.square=function(){return new f(v(this.value),!1)},c.prototype.square=function(){var h=this.value*this.value;return m(h)?new c(h):new f(v(u(Math.abs(this.value))),!1)},l.prototype.square=function(h){return new l(this.value*this.value)};function Q(h,_){var D=h.length,k=_.length,x=a,U=w(_.length),G=_[k-1],H=Math.ceil(x/(2*G)),J=O(h,H),oe=O(_,H),he,fe,Me,pt,b,E,g;for(J.length<=D&&J.push(0),oe.push(0),G=oe[k-1],fe=D-k;fe>=0;fe--){for(he=x-1,J[fe+k]!==G&&(he=Math.floor((J[fe+k]*x+J[fe+k-1])/G)),Me=0,pt=0,E=oe.length,b=0;b<E;b++)Me+=he*oe[b],g=Math.floor(Me/x),pt+=J[fe+b]-(Me-g*x),Me=g,pt<0?(J[fe+b]=pt+x,pt=-1):(J[fe+b]=pt,pt=0);for(;pt!==0;){for(he-=1,Me=0,b=0;b<E;b++)Me+=J[fe+b]-x+oe[b],Me<0?(J[fe+b]=Me+x,Me=0):(J[fe+b]=Me,Me=1);pt+=Me}U[fe]=he}return J=R(J,H)[0],[M(U),M(J)]}function T(h,_){for(var D=h.length,k=_.length,x=[],U=[],G=a,H,J,oe,he,fe;D;){if(U.unshift(h[--D]),A(U),le(U,_)<0){x.push(0);continue}J=U.length,oe=U[J-1]*G+U[J-2],he=_[k-1]*G+_[k-2],J>k&&(oe=(oe+1)*G),H=Math.ceil(oe/he);do{if(fe=O(_,H),le(fe,U)<=0)break;H--}while(H);x.push(H),U=z(U,fe)}return x.reverse(),[M(x),M(U)]}function R(h,_){var D=h.length,k=w(D),x=a,U,G,H,J;for(H=0,U=D-1;U>=0;--U)J=H*x+h[U],G=C(J/_),H=J-G*_,k[U]=G|0;return[k,H|0]}function ee(h,_){var D,k=re(_);if(p)return[new l(h.value/k.value),new l(h.value%k.value)];var x=h.value,U=k.value,G;if(U===0)throw new Error("Cannot divide by zero");if(h.isSmall)return k.isSmall?[new c(C(x/U)),new c(x%U)]:[d[0],h];if(k.isSmall){if(U===1)return[h,d[0]];if(U==-1)return[h.negate(),d[0]];var H=Math.abs(U);if(H<a){D=R(x,H),G=M(D[0]);var J=D[1];return h.sign&&(J=-J),typeof G=="number"?(h.sign!==k.sign&&(G=-G),[new c(G),new c(J)]):[new f(G,h.sign!==k.sign),new c(J)]}U=u(H)}var oe=le(x,U);if(oe===-1)return[d[0],h];if(oe===0)return[d[h.sign===k.sign?1:-1],d[0]];x.length+U.length<=200?D=Q(x,U):D=T(x,U),G=D[0];var he=h.sign!==k.sign,fe=D[1],Me=h.sign;return typeof G=="number"?(he&&(G=-G),G=new c(G)):G=new f(G,he),typeof fe=="number"?(Me&&(fe=-fe),fe=new c(fe)):fe=new f(fe,Me),[G,fe]}f.prototype.divmod=function(h){var _=ee(this,h);return{quotient:_[0],remainder:_[1]}},l.prototype.divmod=c.prototype.divmod=f.prototype.divmod,f.prototype.divide=function(h){return ee(this,h)[0]},l.prototype.over=l.prototype.divide=function(h){return new l(this.value/re(h).value)},c.prototype.over=c.prototype.divide=f.prototype.over=f.prototype.divide,f.prototype.mod=function(h){return ee(this,h)[1]},l.prototype.mod=l.prototype.remainder=function(h){return new l(this.value%re(h).value)},c.prototype.remainder=c.prototype.mod=f.prototype.remainder=f.prototype.mod,f.prototype.pow=function(h){var _=re(h),D=this.value,k=_.value,x,U,G;if(k===0)return d[1];if(D===0)return d[0];if(D===1)return d[1];if(D===-1)return _.isEven()?d[1]:d[-1];if(_.sign)return d[0];if(!_.isSmall)throw new Error("The exponent "+_.toString()+" is too large.");if(this.isSmall&&m(x=Math.pow(D,k)))return new c(C(x));for(U=this,G=d[1];k&!0&&(G=G.times(U),--k),k!==0;)k/=2,U=U.square();return G},c.prototype.pow=f.prototype.pow,l.prototype.pow=function(h){var _=re(h),D=this.value,k=_.value,x=BigInt(0),U=BigInt(1),G=BigInt(2);if(k===x)return d[1];if(D===x)return d[0];if(D===U)return d[1];if(D===BigInt(-1))return _.isEven()?d[1]:d[-1];if(_.isNegative())return new l(x);for(var H=this,J=d[1];(k&U)===U&&(J=J.times(H),--k),k!==x;)k/=G,H=H.square();return J},f.prototype.modPow=function(h,_){if(h=re(h),_=re(_),_.isZero())throw new Error("Cannot take modPow with modulus 0");var D=d[1],k=this.mod(_);for(h.isNegative()&&(h=h.multiply(d[-1]),k=k.modInv(_));h.isPositive();){if(k.isZero())return d[0];h.isOdd()&&(D=D.multiply(k).mod(_)),h=h.divide(2),k=k.square().mod(_)}return D},l.prototype.modPow=c.prototype.modPow=f.prototype.modPow;function le(h,_){if(h.length!==_.length)return h.length>_.length?1:-1;for(var D=h.length-1;D>=0;D--)if(h[D]!==_[D])return h[D]>_[D]?1:-1;return 0}f.prototype.compareAbs=function(h){var _=re(h),D=this.value,k=_.value;return _.isSmall?1:le(D,k)},c.prototype.compareAbs=function(h){var _=re(h),D=Math.abs(this.value),k=_.value;return _.isSmall?(k=Math.abs(k),D===k?0:D>k?1:-1):-1},l.prototype.compareAbs=function(h){var _=this.value,D=re(h).value;return _=_>=0?_:-_,D=D>=0?D:-D,_===D?0:_>D?1:-1},f.prototype.compare=function(h){if(h===1/0)return-1;if(h===-1/0)return 1;var _=re(h),D=this.value,k=_.value;return this.sign!==_.sign?_.sign?1:-1:_.isSmall?this.sign?-1:1:le(D,k)*(this.sign?-1:1)},f.prototype.compareTo=f.prototype.compare,c.prototype.compare=function(h){if(h===1/0)return-1;if(h===-1/0)return 1;var _=re(h),D=this.value,k=_.value;return _.isSmall?D==k?0:D>k?1:-1:D<0!==_.sign?D<0?-1:1:D<0?1:-1},c.prototype.compareTo=c.prototype.compare,l.prototype.compare=function(h){if(h===1/0)return-1;if(h===-1/0)return 1;var _=this.value,D=re(h).value;return _===D?0:_>D?1:-1},l.prototype.compareTo=l.prototype.compare,f.prototype.equals=function(h){return this.compare(h)===0},l.prototype.eq=l.prototype.equals=c.prototype.eq=c.prototype.equals=f.prototype.eq=f.prototype.equals,f.prototype.notEquals=function(h){return this.compare(h)!==0},l.prototype.neq=l.prototype.notEquals=c.prototype.neq=c.prototype.notEquals=f.prototype.neq=f.prototype.notEquals,f.prototype.greater=function(h){return this.compare(h)>0},l.prototype.gt=l.prototype.greater=c.prototype.gt=c.prototype.greater=f.prototype.gt=f.prototype.greater,f.prototype.lesser=function(h){return this.compare(h)<0},l.prototype.lt=l.prototype.lesser=c.prototype.lt=c.prototype.lesser=f.prototype.lt=f.prototype.lesser,f.prototype.greaterOrEquals=function(h){return this.compare(h)>=0},l.prototype.geq=l.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals=f.prototype.geq=f.prototype.greaterOrEquals,f.prototype.lesserOrEquals=function(h){return this.compare(h)<=0},l.prototype.leq=l.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals=f.prototype.leq=f.prototype.lesserOrEquals,f.prototype.isEven=function(){return(this.value[0]&1)===0},c.prototype.isEven=function(){return(this.value&1)===0},l.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},f.prototype.isOdd=function(){return(this.value[0]&1)===1},c.prototype.isOdd=function(){return(this.value&1)===1},l.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},f.prototype.isPositive=function(){return!this.sign},c.prototype.isPositive=function(){return this.value>0},l.prototype.isPositive=c.prototype.isPositive,f.prototype.isNegative=function(){return this.sign},c.prototype.isNegative=function(){return this.value<0},l.prototype.isNegative=c.prototype.isNegative,f.prototype.isUnit=function(){return!1},c.prototype.isUnit=function(){return Math.abs(this.value)===1},l.prototype.isUnit=function(){return this.abs().value===BigInt(1)},f.prototype.isZero=function(){return!1},c.prototype.isZero=function(){return this.value===0},l.prototype.isZero=function(){return this.value===BigInt(0)},f.prototype.isDivisibleBy=function(h){var _=re(h);return _.isZero()?!1:_.isUnit()?!0:_.compareAbs(2)===0?this.isEven():this.mod(_).isZero()},l.prototype.isDivisibleBy=c.prototype.isDivisibleBy=f.prototype.isDivisibleBy;function ze(h){var _=h.abs();if(_.isUnit())return!1;if(_.equals(2)||_.equals(3)||_.equals(5))return!0;if(_.isEven()||_.isDivisibleBy(3)||_.isDivisibleBy(5))return!1;if(_.lesser(49))return!0}function Ne(h,_){for(var D=h.prev(),k=D,x=0,U,G,H;k.isEven();)k=k.divide(2),x++;e:for(G=0;G<_.length;G++)if(!h.lesser(_[G])&&(H=e(_[G]).modPow(k,h),!(H.isUnit()||H.equals(D)))){for(U=x-1;U!=0;U--){if(H=H.square().mod(h),H.isUnit())return!1;if(H.equals(D))continue e}return!1}return!0}f.prototype.isPrime=function(h){var _=ze(this);if(_!==t)return _;var D=this.abs(),k=D.bitLength();if(k<=64)return Ne(D,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var x=Math.log(2)*k.toJSNumber(),U=Math.ceil(h===!0?2*Math.pow(x,2):x),G=[],H=0;H<U;H++)G.push(e(H+2));return Ne(D,G)},l.prototype.isPrime=c.prototype.isPrime=f.prototype.isPrime,f.prototype.isProbablePrime=function(h,_){var D=ze(this);if(D!==t)return D;for(var k=this.abs(),x=h===t?5:h,U=[],G=0;G<x;G++)U.push(e.randBetween(2,k.minus(2),_));return Ne(k,U)},l.prototype.isProbablePrime=c.prototype.isProbablePrime=f.prototype.isProbablePrime,f.prototype.modInv=function(h){for(var _=e.zero,D=e.one,k=re(h),x=this.abs(),U,G,H;!x.isZero();)U=k.divide(x),G=_,H=k,_=D,k=x,D=G.subtract(U.multiply(D)),x=H.subtract(U.multiply(x));if(!k.isUnit())throw new Error(this.toString()+" and "+h.toString()+" are not co-prime");return _.compare(0)===-1&&(_=_.add(h)),this.isNegative()?_.negate():_},l.prototype.modInv=c.prototype.modInv=f.prototype.modInv,f.prototype.next=function(){var h=this.value;return this.sign?Z(h,1,this.sign):new f(L(h,1),this.sign)},c.prototype.next=function(){var h=this.value;return h+1<n?new c(h+1):new f(i,!1)},l.prototype.next=function(){return new l(this.value+BigInt(1))},f.prototype.prev=function(){var h=this.value;return this.sign?new f(L(h,1),!0):Z(h,1,this.sign)},c.prototype.prev=function(){var h=this.value;return h-1>-n?new c(h-1):new f(i,!0)},l.prototype.prev=function(){return new l(this.value-BigInt(1))};for(var Fe=[1];2*Fe[Fe.length-1]<=a;)Fe.push(2*Fe[Fe.length-1]);var mt=Fe.length,Qe=Fe[mt-1];function xe(h){return Math.abs(h)<=a}f.prototype.shiftLeft=function(h){var _=re(h).toJSNumber();if(!xe(_))throw new Error(String(_)+" is too large for shifting.");if(_<0)return this.shiftRight(-_);var D=this;if(D.isZero())return D;for(;_>=mt;)D=D.multiply(Qe),_-=mt-1;return D.multiply(Fe[_])},l.prototype.shiftLeft=c.prototype.shiftLeft=f.prototype.shiftLeft,f.prototype.shiftRight=function(h){var _,D=re(h).toJSNumber();if(!xe(D))throw new Error(String(D)+" is too large for shifting.");if(D<0)return this.shiftLeft(-D);for(var k=this;D>=mt;){if(k.isZero()||k.isNegative()&&k.isUnit())return k;_=ee(k,Qe),k=_[1].isNegative()?_[0].prev():_[0],D-=mt-1}return _=ee(k,Fe[D]),_[1].isNegative()?_[0].prev():_[0]},l.prototype.shiftRight=c.prototype.shiftRight=f.prototype.shiftRight;function bt(h,_,D){_=re(_);for(var k=h.isNegative(),x=_.isNegative(),U=k?h.not():h,G=x?_.not():_,H=0,J=0,oe=null,he=null,fe=[];!U.isZero()||!G.isZero();)oe=ee(U,Qe),H=oe[1].toJSNumber(),k&&(H=Qe-1-H),he=ee(G,Qe),J=he[1].toJSNumber(),x&&(J=Qe-1-J),U=oe[0],G=he[0],fe.push(D(H,J));for(var Me=D(k?1:0,x?1:0)!==0?e(-1):e(0),pt=fe.length-1;pt>=0;pt-=1)Me=Me.multiply(Qe).add(e(fe[pt]));return Me}f.prototype.not=function(){return this.negate().prev()},l.prototype.not=c.prototype.not=f.prototype.not,f.prototype.and=function(h){return bt(this,h,function(_,D){return _&D})},l.prototype.and=c.prototype.and=f.prototype.and,f.prototype.or=function(h){return bt(this,h,function(_,D){return _|D})},l.prototype.or=c.prototype.or=f.prototype.or,f.prototype.xor=function(h){return bt(this,h,function(_,D){return _^D})},l.prototype.xor=c.prototype.xor=f.prototype.xor;var _t=1<<30,Kt=(a&-a)*(a&-a)|_t;function Ct(h){var _=h.value,D=typeof _=="number"?_|_t:typeof _=="bigint"?_|BigInt(_t):_[0]+_[1]*a|Kt;return D&-D}function Ke(h,_){if(_.compareTo(h)<=0){var D=Ke(h,_.square(_)),k=D.p,x=D.e,U=k.multiply(_);return U.compareTo(h)<=0?{p:U,e:x*2+1}:{p:k,e:x*2}}return{p:e(1),e:0}}f.prototype.bitLength=function(){var h=this;return h.compareTo(e(0))<0&&(h=h.negate().subtract(e(1))),h.compareTo(e(0))===0?e(0):e(Ke(h,e(2)).e).add(e(1))},l.prototype.bitLength=c.prototype.bitLength=f.prototype.bitLength;function ht(h,_){return h=re(h),_=re(_),h.greater(_)?h:_}function Pt(h,_){return h=re(h),_=re(_),h.lesser(_)?h:_}function kt(h,_){if(h=re(h).abs(),_=re(_).abs(),h.equals(_))return h;if(h.isZero())return _;if(_.isZero())return h;for(var D=d[1],k,x;h.isEven()&&_.isEven();)k=Pt(Ct(h),Ct(_)),h=h.divide(k),_=_.divide(k),D=D.multiply(k);for(;h.isEven();)h=h.divide(Ct(h));do{for(;_.isEven();)_=_.divide(Ct(_));h.greater(_)&&(x=_,_=h,h=x),_=_.subtract(h)}while(!_.isZero());return D.isUnit()?h:h.multiply(D)}function na(h,_){return h=re(h).abs(),_=re(_).abs(),h.divide(kt(h,_)).multiply(_)}function Jt(h,_,D){h=re(h),_=re(_);var k=D||Math.random,x=Pt(h,_),U=ht(h,_),G=U.subtract(x).add(1);if(G.isSmall)return x.add(Math.floor(k()*G));for(var H=Lt(G,a).value,J=[],oe=!0,he=0;he<H.length;he++){var fe=oe?H[he]+(he+1<H.length?H[he+1]/a:0):a,Me=C(k()*fe);J.push(Me),Me<H[he]&&(oe=!1)}return x.add(d.fromArray(J,a,!1))}var fs=function(h,_,D,k){D=D||r,h=String(h),k||(h=h.toLowerCase(),D=D.toLowerCase());var x=h.length,U,G=Math.abs(_),H={};for(U=0;U<D.length;U++)H[D[U]]=U;for(U=0;U<x;U++){var J=h[U];if(J!=="-"&&J in H&&H[J]>=G){if(J==="1"&&G===1)continue;throw new Error(J+" is not a valid digit in base "+_+".")}}_=re(_);var oe=[],he=h[0]==="-";for(U=he?1:0;U<h.length;U++){var J=h[U];if(J in H)oe.push(re(H[J]));else if(J==="<"){var fe=U;do U++;while(h[U]!==">"&&U<h.length);oe.push(re(h.slice(fe+1,U)))}else throw new Error(J+" is not a valid character")}return Ra(oe,_,he)};function Ra(h,_,D){var k=d[0],x=d[1],U;for(U=h.length-1;U>=0;U--)k=k.add(h[U].times(x)),x=x.times(_);return D?k.negate():k}function cs(h,_){return _=_||r,h<_.length?_[h]:"<"+h+">"}function Lt(h,_){if(_=e(_),_.isZero()){if(h.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(_.equals(-1)){if(h.isZero())return{value:[0],isNegative:!1};if(h.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-h.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var D=Array.apply(null,Array(h.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return D.unshift([1]),{value:[].concat.apply([],D),isNegative:!1}}var k=!1;if(h.isNegative()&&_.isPositive()&&(k=!0,h=h.abs()),_.isUnit())return h.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(h.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:k};for(var x=[],U=h,G;U.isNegative()||U.compareAbs(_)>=0;){G=U.divmod(_),U=G.quotient;var H=G.remainder;H.isNegative()&&(H=_.minus(H).abs(),U=U.next()),x.push(H.toJSNumber())}return x.push(U.toJSNumber()),{value:x.reverse(),isNegative:k}}function Ba(h,_,D){var k=Lt(h,_);return(k.isNegative?"-":"")+k.value.map(function(x){return cs(x,D)}).join("")}f.prototype.toArray=function(h){return Lt(this,h)},c.prototype.toArray=function(h){return Lt(this,h)},l.prototype.toArray=function(h){return Lt(this,h)},f.prototype.toString=function(h,_){if(h===t&&(h=10),h!==10||_)return Ba(this,h,_);for(var D=this.value,k=D.length,x=String(D[--k]),U="0000000",G;--k>=0;)G=String(D[k]),x+=U.slice(G.length)+G;var H=this.sign?"-":"";return H+x},c.prototype.toString=function(h,_){return h===t&&(h=10),h!=10||_?Ba(this,h,_):String(this.value)},l.prototype.toString=c.prototype.toString,l.prototype.toJSON=f.prototype.toJSON=c.prototype.toJSON=function(){return this.toString()},f.prototype.valueOf=function(){return parseInt(this.toString(),10)},f.prototype.toJSNumber=f.prototype.valueOf,c.prototype.valueOf=function(){return this.value},c.prototype.toJSNumber=c.prototype.valueOf,l.prototype.valueOf=l.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function xa(h){if(m(+h)){var _=+h;if(_===C(_))return p?new l(BigInt(_)):new c(_);throw new Error("Invalid integer: "+h)}var D=h[0]==="-";D&&(h=h.slice(1));var k=h.split(/e/i);if(k.length>2)throw new Error("Invalid integer: "+k.join("e"));if(k.length===2){var x=k[1];if(x[0]==="+"&&(x=x.slice(1)),x=+x,x!==C(x)||!m(x))throw new Error("Invalid integer: "+x+" is not a valid exponent.");var U=k[0],G=U.indexOf(".");if(G>=0&&(x-=U.length-G-1,U=U.slice(0,G)+U.slice(G+1)),x<0)throw new Error("Cannot include negative exponent part for integers");U+=new Array(x+1).join("0"),h=U}var H=/^([0-9][0-9]*)$/.test(h);if(!H)throw new Error("Invalid integer: "+h);if(p)return new l(BigInt(D?"-"+h:h));for(var J=[],oe=h.length,he=s,fe=oe-he;oe>0;)J.push(+h.slice(fe,oe)),fe-=he,fe<0&&(fe=0),oe-=he;return A(J),new f(J,D)}function La(h){if(p)return new l(BigInt(h));if(m(h)){if(h!==C(h))throw new Error(h+" is not an integer.");return new c(h)}return xa(h.toString())}function re(h){return typeof h=="number"?La(h):typeof h=="string"?xa(h):typeof h=="bigint"?new l(h):h}for(var Ot=0;Ot<1e3;Ot++)d[Ot]=re(Ot),Ot>0&&(d[-Ot]=re(-Ot));return d.one=d[1],d.zero=d[0],d.minusOne=d[-1],d.max=ht,d.min=Pt,d.gcd=kt,d.lcm=na,d.isInstance=function(h){return h instanceof f||h instanceof c||h instanceof l},d.randBetween=Jt,d.fromArray=function(h,_,D){return Ra(h.map(re),re(_||10),D)},d}();o.hasOwnProperty("exports")&&(o.exports=e)})(Ri);var Zp=Ri.exports,$e=Ui(Zp);const Xp=$e(Number.MAX_SAFE_INTEGER),Zs=$e($e[2]).pow(64),ed=Zs.divide($e[2]);function Ls(o,e=256){return $e.fromArray(o instanceof Uint8Array?[...o]:o,e)}function td(o){return new Uint8Array(o.toArray(256).value)}function ad(o){return o.greater(ed)?o.minus(Zs):o}function sd(o){return o.isNegative()?Zs.add(o):o}const nd=["static_icon","appear_animation","select_animation","activate_animation","effect_animation","around_animation","center_icon"],id={type:"reactions"},rd=10*6e4;class od extends ce{constructor(){super(...arguments),this.clear=(e=!1)=>{e&&(this.sendReactionPromises=new Map,this.lastSendingTimes=new Map,this.reactions={}),this.savedReactionsTags=new Map}}after(){this.clear(!0),this.rootScope.addEventListener("user_auth",()=>{setTimeout(()=>{Promise.resolve(this.getAvailableReactions()).then(async e=>{const t=["around_animation","static_icon","appear_animation","center_icon"];for(let a=0,s=Math.min(7,e.length);a<s;++a){const n=e[a],i=t.map(r=>n[r]&&this.apiFileManager.downloadMedia({media:n[r]}));await Promise.all(i),await rt(1e3)}}),this.getTopReactions()},7500),this.getSavedReactionTags()}),this.apiUpdatesManager.addMultipleEventsListeners({updateSavedReactionTags:({tags:e,savedPeerId:t})=>{if(!e){this.savedReactionsTags.get(t)&&Promise.resolve(this.getSavedReactionTags(t,!0)).then(a=>{this.apiUpdatesManager.processLocalUpdate({_:"updateSavedReactionTags",tags:a,savedPeerId:t})});return}this.setSavedReactionTags(t,e)}}),this.rootScope.addEventListener("messages_reactions",e=>{for(const t of e)this.processMessageReactionsChanges(t)}),setInterval(()=>{this.savedReactionsTags.size&&(this.savedReactionsTags.clear(),this.rootScope.dispatchEvent("saved_tags_clear"))},rd)}resetAvailableReactions(){this.availableReactions=void 0,this.getAvailableReactions()}getAvailableReactions(){return this.availableReactions?this.availableReactions:this.apiManager.invokeApiSingleProcess({method:"messages.getAvailableReactions",processResult:e=>{const t=this.availableReactions=e.reactions;for(const a of t)for(const s of nd)a[s]&&(a[s]=this.appDocsManager.saveDoc(a[s],id));return Be.getInstance().invokeVoid("mirror",{name:"availableReactions",value:t}),t},params:{hash:0}})}getActiveAvailableReactions(){return Ce(this.getAvailableReactions(),e=>e.filter(t=>!t.pFlags.inactive))}getAvailableReactionsForPeer(e,t){const a=this.getActiveAvailableReactions(),s=this.getTopReactions(),n=this.getQuickReaction();if(e.isUser())return Sa([s,n],([r,p])=>{const d={type:"chatReactionsAll",reactions:r};return t&&this.unshiftQuickReactionInner(d,p),d});const i=this.appProfileManager.getChatFull(e.toChatId());return Sa([a,i,n,s],([r,p,d,f])=>{let c=p.available_reactions??{_:"chatReactionsNone"};c._==="chatReactionsAll"&&!c.pFlags.allow_custom&&(c={_:"chatReactionsSome",reactions:r.map(Ka)});let l=[];if(c._==="chatReactionsAll")l=f;else if(c._==="chatReactionsSome"){const u=c.reactions.map(A=>r.find(w=>w.reaction===A.emoticon)||A).filter(Boolean),M=new Map(r.map((A,w)=>[A.reaction,w]));u.sort((A,w)=>(M.get(A.reaction)||0)-(M.get(w.reaction)||0)),l=u.map(A=>A._==="availableReaction"?Ka(A):A)}const m={type:c._,reactions:l};return c._==="chatReactionsAll"&&t&&this.unshiftQuickReactionInner(m,d),m})}getReactions(e){if(this.reactions[e])return this.reactions[e];let t;return e==="recent"?t="messages.getRecentReactions":e==="top"?t="messages.getTopReactions":t="messages.getDefaultTagReactions",this.apiManager.invokeApiHashable({method:t,params:{limit:75},processResult:a=>this.reactions[e]=a.reactions})}getTopReactions(){return this.getReactions("top")}getRecentReactions(){return this.getReactions("recent")}getTagReactions(e){return Sa([this.getReactions("tags"),this.getSavedReactionTags(e)],([t,a])=>(t=t.slice(),Et(a,s=>{const n=wt(t,i=>ut(i,s.reaction));n&&t.unshift(n)}),t))}unshiftQuickReactionInner(e,t){return t._==="availableReaction"&&(t=Ka(t)),e.reactions=e.reactions.slice(),wt(e.reactions,a=>ut(a,t)),e.reactions.unshift(t),e}getAvailableReactionsByMessage(e,t){let a;if(e?a=e.fwd_from?.channel_post&&this.appPeersManager.isMegagroup(e.peerId)&&e.fromId===e.fwdFromId&&e.fromId||e.peerId:a=lt,a===this.appPeersManager.peerId){const{reactions:s}=e;if(!s||s.pFlags.reactions_as_tags)return Ce(this.getTagReactions(),n=>({type:"chatReactionsAll",reactions:n}))}return this.getAvailableReactionsForPeer(a,t)}getQuickReaction(){return Sa([this.apiManager.getConfig(),this.getAvailableReactions()],([e,t])=>{const a=e.reactions_default;return a?._==="reactionEmoji"?t.find(s=>s.reaction===a.emoticon):a})}getReactionCached(e){return this.availableReactions.find(t=>t.reaction===e)}getReaction(e){return Ce(this.getAvailableReactions(),()=>this.getReactionCached(e))}getMessagesReactions(e,t){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessagesReactions",params:{id:t.map(a=>ae(a)),peer:this.appPeersManager.getInputPeerById(e)},processResult:a=>{this.apiUpdatesManager.processUpdateMessage(a)}})}getMessageReactionsList(e,t,a,s,n){return this.apiManager.invokeApiSingleProcess({method:"messages.getMessageReactionsList",params:{peer:this.appPeersManager.getInputPeerById(e),id:ae(t),limit:a,reaction:s,offset:n},processResult:i=>(this.appUsersManager.saveApiUsers(i.users),i)})}setDefaultReaction(e){return this.apiManager.invokeApi("messages.setDefaultReaction",{reaction:e}).then(async t=>{if(t){const a=await this.apiManager.getConfig();a&&(a.reactions_default=e),this.rootScope.dispatchEvent("quick_reaction",e)}return t})}async sendReaction({message:e,reaction:t,onlyLocal:a,sendAsPeerId:s}){e=this.appMessagesManager.getMessageByPeer(e.peerId,e.mid),t._==="availableReaction"&&(t={_:"reactionEmoji",emoticon:t.reaction});const n=await this.apiManager.getLimit("reactions"),i=e.peerId+"_"+e.mid;if(this.lastSendingTimes.get(i))return;this.lastSendingTimes.set(i,Date.now()),setTimeout(()=>{this.lastSendingTimes.delete(i)},333);const{peerId:p,mid:d}=e;let f;s?f=this.appPeersManager.getOutputPeer(s):f=this.appMessagesManager.generateFromId(p)??this.appPeersManager.getOutputPeer(p);const c=this.appPeersManager.getPeerId(f),l=j=>{--j.count,delete j.chosen_order,ut(t,j.reaction)&&(t=void 0),j.count||Oe(u.results,j),u.recent_reactions&&wt(u.recent_reactions,Z=>ut(Z.reaction,j.reaction)&&this.appPeersManager.getPeerId(Z.peer_id)===c),u.results.length||(u=void 0)},m=e.reactions?.pFlags?.can_see_list||!this.appPeersManager.isBroadcast(e.peerId)||e.peerId.isUser();e.reactions||(e.reactions={_:"messageReactions",results:[],recent_reactions:m?[]:void 0,pFlags:{can_see_list:m||void 0}});let u=a?e.reactions:it(e.reactions);const M=u.results.filter(j=>j.chosen_order!==void 0);M.sort((j,Z)=>Z.chosen_order-j.chosen_order);const A=[],w=M.findIndex(j=>ut(j.reaction,t));w!==-1&&A.push(...M.splice(w,1)),A.push(...M.splice(n-+(w===-1))),A.forEach(j=>{M.forEach(Z=>{Z.chosen_order>j.chosen_order&&--Z.chosen_order}),l(j)});const C=M.length;if(M.forEach((j,Z)=>{j.chosen_order=C-1-Z}),t){u||(u={_:"messageReactions",results:[],pFlags:{}},m&&(u.pFlags.can_see_list=!0)),!u.results.length&&p===this.appPeersManager.peerId&&(u.pFlags.reactions_as_tags=!0);let j=u.results.findIndex(X=>ut(X.reaction,t)),Z=j!==-1&&u.results[j];if(Z||(Z={_:"reactionCount",count:0,reaction:t},j=u.results.push(Z)-1),++Z.count,Z.chosen_order=M.length?M[0].chosen_order+1:0,M.unshift(Z),!u.recent_reactions&&m&&(u.recent_reactions=[]),u.recent_reactions){const X={_:"messagePeerReaction",reaction:t,peer_id:f,pFlags:{},date:Ie(!0)};this.appPeersManager.isMegagroup(p),u.recent_reactions.unshift(X),u.recent_reactions=u.recent_reactions.slice(0,3)}}const I=this.availableReactions;if(u&&I?.length){const j=new Map;I.forEach((Z,X)=>{j.set(Z.reaction,X)}),u.results.sort((Z,X)=>{const O=Z.reaction.document_id||Z.reaction.emoticon,B=X.reaction.document_id||X.reaction.emoticon;return X.count-Z.count||(j.get(O)??0)-(j.get(B)??0)})}if(a)return e.reactions=u,this.rootScope.dispatchEvent("messages_reactions",[{message:e,changedResults:[],removedResults:[]}]),Promise.resolve();this.apiUpdatesManager.processLocalUpdate({_:"updateMessageReactions",peer:e.peer_id,msg_id:e.id,reactions:u,local:!0});const F=[p,d].join("-"),L=ae(d),z=this.apiManager.invokeApi("messages.sendReaction",{peer:this.appPeersManager.getInputPeerById(p),msg_id:L,reaction:M.map(j=>j.reaction).reverse()}).then(j=>{const Z=j.updates.findIndex(X=>X._==="updateEditMessage"||X._==="updateEditChannelMessage");if(Z!==-1){const X=j.updates[Z];j.updates[Z]={_:"updateMessageReactions",msg_id:L,peer:this.appPeersManager.getOutputPeer(p),reactions:X.message.reactions,pts:X.pts,pts_count:X.pts_count}}this.apiUpdatesManager.processUpdateMessage(j)}).catch(j=>{j.type==="REACTION_INVALID"&&this.sendReactionPromises.get(F)===z&&this.sendReaction({message:e,reaction:M[0]?.reaction,onlyLocal:!0,sendAsPeerId:s})}).finally(()=>{this.sendReactionPromises.get(F)===z&&this.sendReactionPromises.delete(F)});return this.sendReactionPromises.set(F,z),z}getRandomGenericAnimation(){return Ce(this.appStickersManager.getLocalStickerSet("inputStickerSetEmojiGenericAnimations"),e=>{const t=e.documents.length;return t?e.documents[Math.floor(Math.random()*t)]:void 0})}setSavedReactionTags(e,t){this.savedReactionsTags.set(e,t),this.rootScope.dispatchEvent("saved_tags",{savedPeerId:e,tags:t})}getSavedReactionTags(e,t){const{savedReactionsTags:a}=this,s=a.get(e);if(s&&!t)return s;const n=this.apiManager.invokeApi("messages.getSavedReactionTags",{peer:e?this.appPeersManager.getInputPeerById(e):void 0,hash:0}).then(i=>{const r=i.tags||[];return a.get(e)===n&&this.setSavedReactionTags(e,r),this.getSavedReactionTags(e)});return a.set(e,n),n}async updateSavedReactionTag(e,t){await this.apiManager.invokeApi("messages.updateSavedReactionTag",{reaction:e,title:t});const a=await this.getSavedReactionTags(),s=a.find(n=>ut(n.reaction,e));t?s.title=t:delete s.title,this.apiUpdatesManager.processLocalUpdate({_:"updateSavedReactionTags",tags:a})}getAvailableEffects(e){return this.availableEffects&&e&&(this.availableEffects=void 0),this.availableEffects??(this.availableEffects=this.apiManager.invokeApiSingleProcess({method:"messages.getAvailableEffects",processResult:t=>(t.documents.forEach((a,s,n)=>{n[s]=this.appDocsManager.saveDoc(a)}),t.effects.forEach(a=>{a.emoticon=Xt(a.emoticon)}),this.availableEffects=t.effects)}))}getAvailableEffect(e){return Ce(this.getAvailableEffects(),t=>t.find(a=>a.id===e))}async searchAvailableEffects({q:e,emoticon:t}){const[a,s]=await Promise.all([e?.trim()?(await this.appEmojiManager.prepareAndSearchEmojis({q:e,limit:1/0})).map(i=>i.emoji):t,this.getAvailableEffects()]),n=new Set(a);return s.filter(i=>n.has(i.emoticon))}processMessageReactionsChanges({message:e,changedResults:t,removedResults:a,savedPeerId:s}){if(e.peerId!==this.appPeersManager.peerId)return;const{reactions:n}=e;if(n&&!n.pFlags.reactions_as_tags)return;s===void 0&&this.processMessageReactionsChanges({message:e,changedResults:t,removedResults:a,savedPeerId:this.appPeersManager.getPeerId(e.saved_peer_id)});const i=this.savedReactionsTags.get(s);if(!i)return;if(i instanceof Promise){this.apiUpdatesManager.processLocalUpdate({_:"updateSavedReactionTags",savedPeerId:s});return}const r=d=>{const f=d.reaction.document_id;return f?$e(""+f,10):Ls(sa($p.md5(d.reaction.emoticon).slice(0,16)))},p=d=>{Bt(i,d,c=>c,void 0,(c,l)=>{const m=c.count-l.count;if(m)return m;const u=r(c),M=r(l);return u.compare(M)})};for(const d of a){const f=i.findIndex(l=>ut(l.reaction,d.reaction)),c=i[f];c&&(--c.count?p(c):i.splice(f,1))}for(const d of t){let f=i.find(c=>ut(c.reaction,d.reaction));f||(f={_:"savedReactionTag",count:0,reaction:d.reaction}),++f.count,p(f)}this.apiUpdatesManager.processLocalUpdate({_:"updateSavedReactionTags",tags:i,savedPeerId:s})}}function pd(o,e){return o.replace(/-/g,"+").replace(/_/g,"/")}function Xs(o){return Array.isArray(o)?o:[o]}const dd=36e5,Yt={EMOJI:"inputStickerSetAnimatedEmoji",EMOJI_ANIMATIONS:"inputStickerSetAnimatedEmojiAnimations",PREMIUM_GIFTS:"inputStickerSetPremiumGifts",GENERIC_ANIMATIONS:"inputStickerSetEmojiGenericAnimations",DEFAULT_STATUSES:"inputStickerSetEmojiDefaultStatuses",DEFAULT_TOPIC_ICONS:"inputStickerSetEmojiDefaultTopicIcons"},In=new Set(Object.values(Yt));class fd extends ce{constructor(){super(...arguments),this.storage=new Gt(Hs,"stickerSets"),this.clear=e=>{this.getStickerSetPromises={},this.getStickersByEmoticonsPromises={},this.sounds={},this.names={},this.indexes={}},this.processAllStickersResult=e=>e,this.onPreloadStickerSetsResult=e=>{const t=e.sets;return Promise.all(t.map(a=>this.getStickerSet(a,{useCache:!0})))}}after(){this.clear(!0),this.rootScope.addEventListener("user_auth",()=>{setTimeout(()=>{this.getAnimatedEmojiStickerSet(),Promise.resolve(this.getLocalStickerSet(Yt.GENERIC_ANIMATIONS)).then(async e=>{for(const t of e.documents)await this.apiFileManager.downloadMedia({media:t})})},1e3),this.getGreetingStickersPromise||(this.getGreetingStickersTimeout??(this.getGreetingStickersTimeout=we.setTimeout(()=>{this.getGreetingStickersTimeout=void 0,this.getGreetingSticker(!0)},5e3))),this.rootScope.addEventListener("app_config",()=>this.onStickersUpdated("faved",!0))}),this.apiUpdatesManager.addMultipleEventsListeners({updateNewStickerSet:e=>{const t=e.stickerset;this.saveStickerSet(t,t.set.id),this.rootScope.dispatchEvent("stickers_installed",t.set)},updateRecentStickers:()=>this.onStickersUpdated("recent",!0),updateFavedStickers:()=>this.onStickersUpdated("faved",!0),updateMoveStickerSetToTop:e=>{this.rootScope.dispatchEvent("stickers_top",e.stickerset)},updateStickerSetsOrder:e=>{this.rootScope.dispatchEvent("stickers_order",{type:e.pFlags.emojis?"emojis":e.pFlags.masks?"masks":"stickers",order:e.order})}})}async onStickersUpdated(e,t){const a=await(e==="faved"?this.getFavedStickersStickers(t):this.getRecentStickersStickers(t));this.rootScope.dispatchEvent("stickers_updated",{type:e,stickers:a})}getGreetingSticker(e=!1){return this.getGreetingStickersTimeout&&(clearTimeout(this.getGreetingStickersTimeout),this.getGreetingStickersTimeout=void 0),this.getGreetingStickersPromise||(this.getGreetingStickersPromise=this.getStickersByEmoticon({emoticon:"👋⭐️",includeServerStickers:!0}).then(t=>{if(!t.length)throw"NO_STICKERS";this.greetingStickers=t.slice(),this.greetingStickers.sort((a,s)=>Math.random()-Math.random())})),this.getGreetingStickersPromise.then(()=>{let t;return e||(t=this.greetingStickers.shift(),this.greetingStickers.push(t)),this.apiFileManager.downloadMedia({media:this.greetingStickers[0]}),t})}saveStickers(e){!e||e.saved||(e.saved=!0,Et(e,(t,a)=>{t=this.appDocsManager.saveDoc(t),t?e[a]=t:e.splice(a,1)}))}canUseStickerSetCache(e,t){return e&&e.documents?.length&&(Date.now()-e.refreshTime<dd||t)}getStickerSet(e,t={}){let{id:a}=e;if(e.access_hash||(e=this.names[a]||e,a=e.id),this.getStickerSetPromises[a])return this.getStickerSetPromises[a];if(!t.overwrite){const n=this.storage.getFromCache(a);if(this.canUseStickerSetCache(n,t.useCache))return n}const s=this.getStickerSetPromises[a]=new Promise(async n=>{if(!t.overwrite){const i=await this.storage.get(a);if(this.canUseStickerSetCache(i,t.useCache)){delete i.documents.saved,this.saveStickerSetLocal(i),n(i),this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a];return}}try{const i=await this.apiManager.invokeApi("messages.getStickerSet",{stickerset:this.getStickerSetInput(e),hash:0}),r=t.saveById?a:i.set.id;this.saveStickerSet(i,r),n(i)}catch{n(null)}this.getStickerSetPromises[a]===s&&delete this.getStickerSetPromises[a]});return s}getLocalStickerSet(e){return this.getStickerSet({id:e},{saveById:!0})}getAnimatedEmojiStickerSet(){return Promise.all([this.getLocalStickerSet(Yt.EMOJI),this.getLocalStickerSet(Yt.EMOJI_ANIMATIONS),this.getAnimatedEmojiSounds(),this.getLocalStickerSet(Yt.GENERIC_ANIMATIONS)]).then(([e,t])=>({emoji:e,animations:t}))}getAnimatedEmojiSounds(e){if(this.getAnimatedEmojiSoundsPromise&&!e)return this.getAnimatedEmojiSoundsPromise;const t=this.getAnimatedEmojiSoundsPromise=Promise.all([this.apiManager.getAppConfig(e),this.apiManager.getConfig()]).then(([a,s])=>{if(this.getAnimatedEmojiSoundsPromise===t)for(const n in a.emojies_sounds){const i=a.emojies_sounds[n],r=atob(pd(i.file_reference_base64)),p=new Uint8Array(r.length);for(let f=0,c=p.length;f<c;++f)p[f]=r[f].charCodeAt(0);const d=this.appDocsManager.saveDoc({_:"document",pFlags:{},id:i.id,access_hash:i.access_hash,attributes:[{_:"documentAttributeAudio",duration:1,pFlags:{voice:!0}}],date:0,dc_id:s.this_dc,file_reference:p,mime_type:"audio/ogg"},{type:"emojiesSounds"});this.sounds[n]=d}});return t}async getRecentStickers(e){return await this.apiManager.invokeApiHashable({method:"messages.getRecentStickers",processResult:a=>(this.recentStickers=a.stickers,this.saveStickers(a.stickers),a),overwrite:e})}getRecentStickersStickers(e){if(e)this.recentStickers=void 0;else if(this.recentStickers)return this.recentStickers;return this.getRecentStickers(e).then(()=>this.recentStickers)}async saveRecentSticker(e,t,a){await this.getRecentStickersStickers();const s=this.appDocsManager.getDoc(e);if(wt(this.recentStickers,n=>n.id===e),!t){this.recentStickers.unshift(s);const n=Xt(s.stickerEmojiRaw);for(const i in this.getStickersByEmoticonsPromises)this.getStickersByEmoticonsPromises[i].then(p=>{const d=wt(p,f=>f.id===s.id);d?p.unshift(d):i.includes(n)&&p.unshift(s)})}return this.rootScope.dispatchEvent("sticker_updated",{type:"recent",faved:!t,document:s}),t&&this.onStickersUpdated("recent",!1),this.apiManager.invokeApi("messages.saveRecentSticker",{id:ss(s),unsave:t,attached:a})}cleanEmoji(e){return e.replace(/\ufe0f/g,"").replace(/🏻|🏼|🏽|🏾|🏿/g,"")}getAnimatedEmojiSticker(e,t){const a=t?Yt.EMOJI_ANIMATIONS:Yt.EMOJI,s=this.storage.getFromCache(a);if(!s?.documents)return;t&&["🧡","💛","💚","💙","💜","🖤","🤍","🤎"].includes(e)&&(e="❤️"),e=this.cleanEmoji(e);const n=s.packs.find(i=>i.emoticon===e);return n?this.appDocsManager.getDoc(n.documents[0]):void 0}getAnimatedEmojiSoundDocument(e){return this.sounds[this.cleanEmoji(e)]}preloadAnimatedEmojiSticker(e){const t=this.getAnimatedEmojiStickerSet().then(()=>this.getAnimatedEmojiSticker(e));return Promise.all([t,this.preloadAnimatedEmojiStickerAnimation(e)]).then(([a,s])=>({doc:a,animation:s?.doc,sound:s?.sound}))}preloadAnimatedEmojiStickerAnimation(e){return this.getAnimatedEmojiStickerSet().then(()=>this.getAnimatedEmojiSticker(e,!0)).then(t=>{if(!t)return;const a=this.getAnimatedEmojiSoundDocument(e);return Promise.all([this.preloadSticker(t.id),a?this.preloadSticker(a.id):void 0]).then(()=>({doc:t,sound:a}))})}preloadSticker(e,t){const a=this.appDocsManager.getDoc(e);return this.apiFileManager.downloadMedia({media:a,thumb:t?a.video_thumbs?.[0]:void 0})}getEmojisSearchIndex(){return this.indexes.emojis}indexStickerSet(e){var i,r;const t=e.set.pFlags.emojis,a=(i=this.indexes)[r=t?"emojis":"stickers"]??(i[r]=new Ea({minChars:2,fullWords:!0})),s=new Map;e.keywords.forEach(p=>{s.set(p.document_id,p.keyword.slice())}),e.packs.forEach(p=>{const d=Xt(p.emoticon);p.documents.forEach(f=>{let c=s.get(f);c||s.set(f,c=[]),c.push(d)})});const n=!e.set.installed_date;s.forEach((p,d)=>{a.indexObjectArray(d,n?[]:p)})}saveStickerSetLocal(e){e.set.short_name&&(this.names[e.set.short_name]=this.getStickerSetInput(e.set)),this.saveStickers(e.documents),this.indexStickerSet(e)}saveStickerSet(e,t){const a={_:"messages.stickerSet",set:e.set,packs:e.packs,documents:e.documents,keywords:e.keywords};let s=this.storage.getFromCache(t);s?Object.assign(s,a):s=this.storage.setToCache(t,a),this.saveStickerSetLocal(a);const n=s.set.installed_date||In.has(t);s.refreshTime=Date.now(),this.storage.set({[t]:s},!n)}getStickerSetThumbDownloadOptions(e){const t=e.thumbs.find(r=>r._==="photoSize"),a=e.thumb_dc_id,s=t.type==="a",n=t.type==="v",i={_:"inputStickerSetThumb",stickerset:this.getStickerSetInput(e),thumb_version:e.thumb_version};return{dcId:a,location:i,size:t.size,mimeType:s?"application/x-tgsticker":n&&Rt().IS_WEBM_SUPPORTED?"video/webm":"image/webp"}}getStickerSetInput(e){return In.has(e.id)?{_:e.id}:e.access_hash?{_:"inputStickerSetID",id:e.id,access_hash:e.access_hash}:{_:"inputStickerSetShortName",short_name:""+e.id}}async getFeaturedStickers(){return(await this.apiManager.invokeApiHashable({method:"messages.getFeaturedStickers",processResult:t=>(t.sets.forEach(a=>{this.saveStickerSet({documents:[],packs:[],keywords:[],...a},a.set.id)}),t)})).sets}getPromoPremiumStickers(){return this.getStickersByEmoticon({emoticon:"⭐️⭐️",includeServerStickers:!0})}getPremiumStickers(){return this.getStickersByEmoticon({emoticon:"📂⭐️",includeServerStickers:!0})}getFavedStickers(e){return this.apiManager.invokeApiHashable({method:"messages.getFavedStickers",processResult:t=>(this.saveStickers(t.stickers),this.favedStickers=t.stickers,t),overwrite:e})}getFavedStickersStickers(e){if(e)this.favedStickers=void 0;else if(this.favedStickers)return this.favedStickers;return this.getFavedStickers(e).then(()=>this.favedStickers)}getFavedStickersLimit(){return this.apiManager.getLimit("favedStickers")}async faveSticker(e,t){this.favedStickers||await this.getFavedStickersStickers();const a=await this.getFavedStickersLimit(),s=this.appDocsManager.getDoc(e);return wt(this.favedStickers,n=>n.id===s.id),t||(this.favedStickers.unshift(s),this.favedStickers.splice(a,this.favedStickers.length-a)),this.rootScope.dispatchEvent("sticker_updated",{type:"faved",faved:!t,document:s}),this.apiManager.invokeApi("messages.faveSticker",{id:ss(s),unfave:t}).then(()=>{t&&this.onStickersUpdated("faved",!0)})}async toggleStickerSet(e){const t=this.storage.getFromCache(e.id);if(e=t.set,e.installed_date){if(await this.apiManager.invokeApi("messages.uninstallStickerSet",{stickerset:this.getStickerSetInput(e)}))return delete e.installed_date,this.saveStickerSetLocal(t),this.rootScope.dispatchEvent("stickers_deleted",e),this.storage.delete(e.id,!0),!0}else if(await this.apiManager.invokeApi("messages.installStickerSet",{stickerset:this.getStickerSetInput(e),archived:!1}))return e.installed_date=Ie(!0),this.saveStickerSetLocal(t),this.rootScope.dispatchEvent("stickers_installed",e),!0;return!1}toggleStickerSets(e){return Promise.all(e.map(t=>this.toggleStickerSet(t)))}async searchStickerSets(e,t=!0){const a=t?1:0,s=await this.apiManager.invokeApiHashable({method:"messages.searchStickerSets",params:{flags:a,exclude_featured:t||void 0,q:e},processResult:r=>(r.sets.forEach(p=>{this.saveStickerSet({set:p.set,documents:[],keywords:[],packs:[],...p},p.set.id)}),r)}),n=[],i=this.storage.getCache();for(const r in i){const{set:p}=i[r];p.title.toLowerCase().includes(e.toLowerCase())&&!s.sets.find(d=>d.set.id===p.id)&&n.push({_:"stickerSetCovered",set:p,cover:null})}return s.sets.concat(n)}getAllStickers(){return this.apiManager.invokeApiHashable({method:"messages.getAllStickers",processResult:this.processAllStickersResult})}getEmojiStickers(){return this.apiManager.invokeApiHashable({method:"messages.getEmojiStickers",processResult:this.processAllStickersResult})}preloadStickerSets(){return this.getAllStickers().then(this.onPreloadStickerSetsResult)}preloadEmojiSets(){return this.getEmojiStickers().then(this.onPreloadStickerSetsResult)}getStickersByEmoticon({emoticon:e,includeOurStickers:t,includeServerStickers:a,excludePremiumEffectStickers:s}){const n=Xs(e).map(r=>Xt(r));e=n.join("");const i=e+(t?"1":"0")+(a?"1":"0");return this.getStickersByEmoticonsPromises[i]?this.getStickersByEmoticonsPromises[i]:this.getStickersByEmoticonsPromises[i]=Promise.all([a?this.apiManager.invokeApiHashable({method:"messages.getStickers",params:{emoticon:e},processResult:r=>r}):void 0,t?this.preloadStickerSets():[],t?this.getRecentStickers():void 0]).then(([r,p,d])=>{const f=r?r.stickers.map(M=>this.appDocsManager.saveDoc(M)):[],c=[],l=[],m=M=>{for(const A of n)for(const w of M)if(Xt(w.emoticon).includes(A))for(const I of w.documents){const F=this.appDocsManager.getDoc(I);(F.animated?c:l).push(F)}};if(d){m(d.packs);const M=d.stickers;[c,l].forEach(A=>{A.sort((w,C)=>M.indexOf(w)-M.indexOf(C))})}for(const M of p)m(M.packs);const u=[...new Set(c.concat(l,f))];return Et(u,(M,A,w)=>{(M.sticker===3&&!Rt().IS_WEBM_SUPPORTED||s&&!this.rootScope.premium&&Di(M))&&w.splice(A,1)}),u})}async splitSearchQuery(e){if(e=e.trim(),!e)return[];let s=$s(e).filter(n=>n._==="messageEntityEmoji"||n._==="messageEntityCustomEmoji").map(n=>e.slice(n.offset,n.offset+n.length));return s.length||(s=(await this.appEmojiManager.prepareAndSearchEmojis({q:e,limit:200,minChars:1})).map(({emoji:n})=>n)),s}async searchStickers(e){return this.getStickersByEmoticon({emoticon:await this.splitSearchQuery(e),includeOurStickers:!0})}clearRecentStickers(){return this.recentStickers&&(this.recentStickers.length=0,this.onStickersUpdated("recent",!1)),this.apiManager.invokeApi("messages.clearRecentStickers")}reorderStickerSets(e,t,a){return this.apiManager.invokeApi("messages.reorderStickerSets",{emojis:t,masks:a,order:e}).then(()=>{this.apiUpdatesManager.processLocalUpdate({_:"updateStickerSetsOrder",order:e,pFlags:{emojis:t||void 0,masks:a||void 0}})})}}function cd(o){return o&&o.toLowerCase()||""}function ld(o){return!!(o&&!o.pFlags.deleted&&o.id.toPeerId()!==Gn)}const gd={clearBadChars:!0,ignoreCase:!0,latinize:!0,includeTag:!0};class md extends ce{constructor(){super(...arguments),this.clear=(e=!1)=>{if(e)this.users={},this.usernames={},this.isPremiumRequiredToContactUserIds=new Map,this.isPremiumRequiredToContactUserIdsProcessing=!1;else for(const t in this.users){if(!t)continue;const a=t.toPeerId();if(!this.peersStorage.isPeerNeeded(a)){const s=this.users[t];this.modifyUsernamesCache(s,!1),this.storage.delete(t),delete this.users[t]}}this.getTopPeersPromises={},this.contactsIndex=this.createSearchIndex(),this.contactsFillPromise=void 0,this.contactsList=new Set,this.updatedContactsList=!1},this.updateUsersStatuses=()=>{const e=Ie(!0);for(const t in this.users){const a=this.users[t];this.updateUserStatus(a,e)}}}after(){return this.clear(!0),setInterval(this.updateUsersStatuses,6e4),this.rootScope.addEventListener("state_synchronized",this.updateUsersStatuses),this.apiUpdatesManager.addMultipleEventsListeners({updateUserStatus:e=>{const t=e.user_id,a=this.users[t];a&&(a.status=e.status,this.saveUserStatus(a.status),this.rootScope.dispatchEvent("user_update",t),this.setUserToStateIfNeeded(a))},updateUserName:e=>{const t=e.user_id,a=this.users[t];a&&(this.forceUserOnline(t),this.saveApiUser({...a,first_name:e.first_name,last_name:e.last_name,username:void 0,usernames:e.usernames},!0))},updateUserEmojiStatus:e=>{const t=e.user_id,a=this.users[t];a&&(this.forceUserOnline(t),this.saveApiUser({...a,emoji_status:e.emoji_status},!0))},updateRecentEmojiStatuses:()=>{this.recentEmojiStatuses=void 0,this.getRecentEmojiStatuses()}}),Promise.all([this.appStateManager.getState(),this.appStoragesManager.loadStorage("users")]).then(([e,{results:t,storage:a}])=>{this.storage=a,this.saveApiUsers(t);for(let n=0,i=t.length;n<i;++n){const r=t[n];r&&e.contactsListCachedTime&&(r.pFlags.contact||r.pFlags.mutual_contact)&&(this.pushContact(r.id),this.contactsFillPromise||(this.contactsFillPromise=Pe(),this.contactsFillPromise.resolve(this.contactsList)))}const s=e.recentSearch||[];for(let n=0,i=s.length;n<i;++n)this.peersStorage.requestPeer(s[n],"recentSearch");this.peersStorage.addEventListener("peerNeeded",n=>{if(!this.appPeersManager.isUser(n))return;const i=n.toUserId();this.storage.getFromCache(i)||this.storage.set({[i]:this.getUser(i)})}),this.peersStorage.addEventListener("peerUnneeded",n=>{if(!this.appPeersManager.isUser(n))return;const i=n.toUserId();this.storage.getFromCache(i)&&this.storage.delete(i)})})}indexMyself(){const e=this.getSelf().id;this.contactsIndex.indexObject(e,this.getUserSearchText(e))}get userId(){return this.rootScope.myId.toUserId()}onContactsModified(e){e&&this.appStateManager.pushToState("contactsListCachedTime",Ie(!0))}pushRecentSearch(e){return this.appStateManager.getState().then(t=>{const a=t.recentSearch||[];if(a[0]!==e){Oe(a,e),a.unshift(e),a.length>20&&(a.length=20),this.appStateManager.pushToState("recentSearch",a);for(const s of a)this.peersStorage.requestPeer(s,"recentSearch")}})}clearRecentSearch(){return this.appStateManager.getState().then(e=>{const t=e.recentSearch||[];for(const a of t)this.peersStorage.releasePeer(a,"recentSearch");t.length=0,this.appStateManager.pushToState("recentSearch",t)})}fillContacts(){if(this.contactsFillPromise&&this.updatedContactsList)return{cached:this.contactsFillPromise.isFulfilled,promise:this.contactsFillPromise};this.updatedContactsList=!0;const e=Pe();return this.apiManager.invokeApi("contacts.getContacts").then(t=>{t._==="contacts.contacts"&&(this.contactsList.clear(),this.saveApiUsers(t.users),t.contacts.forEach(a=>{this.pushContact(a.user_id)}),this.onContactsModified(!0),this.contactsFillPromise=e),e.resolve(this.contactsList)},()=>{this.updatedContactsList=!1}),{cached:this.contactsFillPromise?.isFulfilled,promise:this.contactsFillPromise||(this.contactsFillPromise=e)}}resolveUsername(e){e[0]==="@"&&(e=e.slice(1)),e=e.toLowerCase();const t=this.usernames[e];return t?this.appPeersManager.getPeer(t):this.apiManager.invokeApiSingleProcess({method:"contacts.resolveUsername",params:{username:e},processResult:a=>this.processResolvedPeer(a)})}resolveUserByUsername(e){return Ce(this.resolveUsername(e),t=>t?._==="user"?t:void 0)}processResolvedPeer(e){return this.saveApiUsers(e.users),this.appChatsManager.saveApiChats(e.chats),this.appPeersManager.getPeer(He(e.peer))}resolvePhone(e){return this.apiManager.invokeApi("contacts.resolvePhone",{phone:e}).then(t=>this.processResolvedPeer(t))}pushContact(e){this.contactsList.add(e),this.contactsIndex.indexObject(e,this.getUserSearchText(e)),this.peersStorage.requestPeer(e.toPeerId(),"contact")}popContact(e){this.contactsList.delete(e),this.contactsIndex.indexObject(e,""),this.peersStorage.releasePeer(e.toPeerId(),"contact")}getUserSearchText(e){const t=this.users[e];return t?[t.first_name,t.last_name,t.phone,...zt(t),t.pFlags.self?"Saved Messages":""].filter(Boolean).join(" "):""}getContacts(e,t=!1,a="name"){const s=this.fillContacts().promise;return Promise.all([s,a==="rating"&&this.getTopPeers("correspondents")]).then(([n,i])=>{let r=[...n];if(e){const d=this.contactsIndex.search(e);r=[...r].filter(c=>d.has(c))}if(a==="name")r.sort((d,f)=>{const c=(this.users[d]||{}).sortName||"",l=(this.users[f]||{}).sortName||"";return c.localeCompare(l)});else if(a==="online")r.sort((d,f)=>{const c=this.getUserStatusForSort(this.getUser(d).status);return this.getUserStatusForSort(this.getUser(f).status)-c});else if(a==="rating")if(!e.trim().replace(/@/g,""))r=i.map(d=>d.id.toUserId());else{const d=new Map(i.map(f=>[f.id.toUserId(),f.rating]));r.sort((f,c)=>{const l=d.get(f)||0;return(d.get(c)||0)-l})}const p=this.userId;return Oe(r,p),t&&this.testSelfSearch(e)&&r.unshift(p),r})}getContactsPeerIds(e,t,a,s){return this.getContacts(e,t,a).then(n=>{const i=n.map(r=>r.toPeerId(!1));return s?i.slice(0,s):i})}toggleBlock(e,t,a){return this.apiManager.invokeApiSingle(t?"contacts.block":"contacts.unblock",{id:this.appPeersManager.getInputPeerById(e),my_stories_from:a===void 0?void 0:!0}).then(()=>{this.apiUpdatesManager.processLocalUpdate({_:"updatePeerBlocked",peer_id:this.appPeersManager.getOutputPeer(e),pFlags:{blocked:t||void 0,blocked_my_stories_from:a||void 0}}),this.appProfileManager.refreshPeerSettingsIfNeeded(e)})}testSelfSearch(e){const t=this.getSelf(),a=this.createSearchIndex();return a.indexObject(t.id,this.getUserSearchText(t.id)),a.search(e).has(t.id)}createSearchIndex(){return new Ea(gd)}saveApiUsers(e,t){!e||e.saved||(e.saved=!0,e.forEach(a=>this.saveApiUser(a,t)))}modifyUsernamesCache(e,t){const a=zt(e);if(!a.length)return;const s=a.map(n=>cd(n));t?s.forEach(n=>{this.usernames[n]=e.id.toPeerId(e._!=="user")}):s.forEach(n=>{delete this.usernames[n]})}setUsernameToCache(e,t){return!t||t.username!==e.username||!St(t.usernames,e.usernames)?(this.modifyUsernamesCache(t,!1),this.modifyUsernamesCache(e,!0),!0):!1}saveUserStatus(e){if(!e)return;const t=e.saved;e.expires&&!t&&(e.expires-=this.timeManager.getServerTimeOffset()),e.was_online&&!t&&(e.was_online-=this.timeManager.getServerTimeOffset()),e.saved=!0}saveApiUser(e,t){if(!e||e._==="userEmpty")return;const a=e.id,s=this.users[a];if(e.pFlags??(e.pFlags={}),e.pFlags.min&&s!==void 0)return;const n=this.setUsernameToCache(e,s);if(!s||s.sortName===void 0||s.first_name!==e.first_name||s.last_name!==e.last_name){const r=e.first_name+(e.last_name?" "+e.last_name:"");e.sortName=e.pFlags.deleted?"":Vr(r,!1)}else e.sortName=s.sortName;this.saveUserStatus(e.status),e.photo?._==="userProfilePhotoEmpty"&&delete e.photo,e.emoji_status?._==="emojiStatusEmpty"&&delete e.emoji_status;const i=a.toPeerId(!1);if(s===void 0)this.users[a]=e,this.mirrorUser(e);else{const r=e.first_name!==s.first_name||e.last_name!==s.last_name||n,p=s.photo?.photo_id,d=e.photo?.photo_id,f=p!==d,c=s.emoji_status?.document_id!==e.emoji_status?.document_id,l=s.pFlags.premium!==e.pFlags.premium,m=l||c||s.pFlags.verified!==e.pFlags.verified||s.pFlags.scam!==e.pFlags.scam||s.pFlags.fake!==e.pFlags.fake,u=!!s.pFlags.contact,M=!!e.pFlags.contact,A=this.appStoriesManager.saveApiPeerStories(e,s);Wt(s,e),this.mirrorUser(s),this.rootScope.dispatchEvent("user_update",a),u!==M&&this.onContactUpdated(a,M,u),A?.(),f&&this.rootScope.dispatchEvent("avatar_update",{peerId:i}),(r||m)&&this.rootScope.dispatchEvent("peer_title_edit",{peerId:i}),l&&this.rootScope.dispatchEvent("peer_bio_edit",i),c&&e.pFlags.self&&this.rootScope.dispatchEvent("emoji_status_change")}this.checkPremium(e,s),this.setUserToStateIfNeeded(e)}mirrorUser(e){Be.getInstance().invokeVoid("mirror",{name:"peers",key:""+e.id,value:e})}checkPremium(e,t){if(e.pFlags.self){const a=!!e.pFlags.premium;this.rootScope.premium!==a&&this.rootScope.dispatchEvent("premium_toggle_private",{isNew:!t,isPremium:a})}}setUserToStateIfNeeded(e){this.peersStorage.isPeerNeeded(e.id.toPeerId())&&this.storage.set({[e.id]:e})}isUserOnlineVisible(e){return this.getUserStatusForSort(e)>3}getUserStatusForSort(e){if(typeof e!="object"&&(e=this.getUser(e)?.status),e){const t=e._==="userStatusOnline"?e.expires:e._==="userStatusOffline"?e.was_online:0;if(t)return t;switch(e._){case"userStatusRecently":return 3;case"userStatusLastWeek":return 2;case"userStatusLastMonth":return 1}}return 0}getUser(e){return et(e)?e:this.users[e]}getUsers(){return this.users}getUserStatus(e){return this.isRegularUser(e)&&!this.users[e].pFlags.self&&this.users[e].status}getApiUsers(e){return this.apiManager.invokeApi("users.getUsers",{id:e.map(t=>this.getUserInput(t))}).then(t=>(this.saveApiUsers(t),t))}async getUserPhone(e){const t=this.getUser(e);if(!t?.phone)return;const a=await this.apiManager.getAppConfig();return{phone:t.phone,isAnonymous:a.fragment_prefixes.some(s=>t.phone.startsWith(s))}}getSelf(){return this.getUser(this.userId)}isBot(e){return this.users[e]&&!!this.users[e].pFlags.bot}isAttachMenuBot(e){return this.isBot(e)&&!!this.users[e].pFlags.bot_attach_menu}isContact(e){return this.contactsList.has(e)||!!(this.users[e]&&this.users[e].pFlags.contact)}isRegularUser(e){const t=this.users[e];return t&&!this.isBot(e)&&!t.pFlags.deleted&&!t.pFlags.support}isNonContactUser(e){return this.isRegularUser(e)&&!this.isContact(e)&&e!==this.userId}isPremium(e){return!!this.users[e]?.pFlags?.premium}isDeleted(e){return!!this.users[e]?.pFlags?.deleted}hasUser(e,t){const a=this.users[e];return et(a)&&(t||!a.pFlags.min)}canEdit(e){return this.userId===e||this.isContact(e)||!!this.users[e]?.pFlags?.bot_can_edit}getUserString(e){const t=this.getUser(e);return"u"+e+(t.access_hash?"_"+t.access_hash:"")}getUserId(e){const t=He(e);return t?t.toUserId():et(e)&&e._==="inputUserSelf"&&this.getSelf().id||lt}getUserInput(e){const t=this.getUser(e);return!e||t.pFlags&&t.pFlags.self?{_:"inputUserSelf"}:{_:"inputUser",user_id:e,access_hash:t.access_hash}}getUserInputPeer(e){const t=this.getUser(e);return{_:"inputPeerUser",user_id:e,access_hash:t.access_hash}}getContactMediaInput(e){const t=this.getUser(e);return{_:"inputMediaContact",first_name:t.first_name,last_name:t.last_name,phone_number:t.phone,vcard:"",user_id:e}}updateUserStatus(e,t=Ie(!0)){e.status&&e.status._==="userStatusOnline"&&e.status.expires<t&&(e.status={_:"userStatusOffline",was_online:e.status.expires},this.rootScope.dispatchEvent("user_update",e.id),this.setUserToStateIfNeeded(e))}forceUserOnline(e,t){if(this.isBot(e))return;const a=Ie(!0),s=60;if(t){if(a-t>=s)return}else if(this.apiUpdatesManager.updatesState.syncLoading)return;const n=this.getUser(e);n?.status&&n.status._!=="userStatusOnline"&&n.status._!=="userStatusEmpty"&&!n.pFlags.support&&!n.pFlags.deleted&&(n.status={_:"userStatusOnline",expires:a+s},this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(n))}importContact(e,t,a){return this.importContacts([{first_name:e,last_name:t,phones:[a]}]).then(s=>{if(!s.length){const n=new Error;throw n.type="NO_USER",n}return s[0]})}importContacts(e){const t=[];for(let a=0;a<e.length;++a)for(let s=0;s<e[a].phones.length;++s)t.push({_:"inputPhoneContact",client_id:(a<<16|s).toString(10),phone:e[a].phones[s],first_name:e[a].first_name,last_name:e[a].last_name});return this.apiManager.invokeApi("contacts.importContacts",{contacts:t}).then(a=>(this.saveApiUsers(a.users),a.imported.map(n=>(this.onContactUpdated(n.user_id,!0),n.user_id))))}getTopPeers(e){return this.getTopPeersPromises[e]?this.getTopPeersPromises[e]:this.getTopPeersPromises[e]=this.appStateManager.getState().then(t=>{const a=t.topPeersCache[e];return a&&a.cachedTime+864e5>Date.now()&&a.peers?a.peers:this.apiManager.invokeApi("contacts.getTopPeers",{[e]:!0,offset:0,limit:30,hash:"0"}).then(s=>{let n=[];return s._==="contacts.topPeers"&&(this.saveApiUsers(s.users),this.appChatsManager.saveApiChats(s.chats),s.categories.length&&(n=s.categories[0].peers.map(i=>{const r=He(i.peer);return this.peersStorage.requestPeer(r,"topPeer"),{id:r,rating:i.rating}}))),t.topPeersCache[e]={peers:n,cachedTime:Date.now()},this.appStateManager.pushToState("topPeersCache",t.topPeersCache),n})})}getBlocked(e=0,t=0){return this.apiManager.invokeApiSingle("contacts.getBlocked",{offset:e,limit:t}).then(a=>{this.saveApiUsers(a.users),this.appChatsManager.saveApiChats(a.chats);const s=a._==="contacts.blocked"?a.users.length+a.chats.length:a.count,n=a.users.map(i=>i.id.toPeerId()).concat(a.chats.map(i=>i.id.toPeerId(!0)));return{count:s,peerIds:n}})}getLocated(e,t,a,s=!1,n=0){const i={_:"inputGeoPoint",lat:e,long:t,accuracy_radius:a};return this.apiManager.invokeApi("contacts.getLocated",{geo_point:i,background:s}).then(r=>(this.apiUpdatesManager.processUpdateMessage(r),r))}searchContacts(e,t=20){const a=$s(e);if(a.length&&a[0].length===e.trim().length&&a[0]._==="messageEntityUrl")try{const n=new URL(zs(e).url).pathname.slice(1);n&&(e=n)}catch{}return this.apiManager.invokeApiCacheable("contacts.search",{q:e,limit:t},{cacheSeconds:60}).then(s=>(this.saveApiUsers(s.users),this.appChatsManager.saveApiChats(s.chats),{my_results:Ua(s.my_results.map(i=>He(i))),results:s.results.map(i=>He(i))}))}onContactUpdated(e,t,a=this.isContact(e)){t!==a&&(t?this.pushContact(e):this.popContact(e),this.onContactsModified(),this.rootScope.dispatchEvent("contacts_update",e))}updateUsername(e){return this.apiManager.invokeApi("account.updateUsername",{username:e}).then(t=>{this.saveApiUser(t)})}setUserStatus(e,t){if(this.isBot(e))return;const a=this.users[e];if(a){const s=t?{_:"userStatusOffline",was_online:Ie(!0)}:{_:"userStatusOnline",expires:Ie(!0)+50};a.status=s,this.rootScope.dispatchEvent("user_update",e),this.setUserToStateIfNeeded(a)}}updateMyOnlineStatus(e){return this.setUserStatus(this.getSelf().id,e),this.apiManager.invokeApiSingle("account.updateStatus",{offline:e})}addContact(e,t,a,s,n){return this.apiManager.invokeApi("contacts.addContact",{id:this.getUserInput(e),first_name:t,last_name:a,phone:s,add_phone_privacy_exception:n}).then(i=>{this.apiUpdatesManager.processUpdateMessage(i,{override:!0}),this.appProfileManager.refreshPeerSettingsIfNeeded(e.toPeerId(!1)),this.onContactUpdated(e,!0)})}deleteContacts(e){return this.apiManager.invokeApi("contacts.deleteContacts",{id:e.map(t=>this.getUserInput(t))}).then(t=>{this.apiUpdatesManager.processUpdateMessage(t,{override:!0}),e.forEach(a=>{this.onContactUpdated(a,!1)})})}checkUsername(e){return this.apiManager.invokeApi("account.checkUsername",{username:e})}canSendToUser(e){return ld(this.getUser(e))}getCommonChats(e,t=100,a){return this.apiManager.invokeApiSingleProcess({method:"messages.getCommonChats",params:{user_id:this.getUserInput(e),limit:t,max_id:a??0},processResult:s=>(this.appChatsManager.saveApiChats(s.chats),s)})}updateEmojiStatus(e){return this.apiManager.invokeApi("account.updateEmojiStatus",{emoji_status:e}).then(()=>{this.apiUpdatesManager.processLocalUpdate({_:"updateUserEmojiStatus",user_id:this.getSelf().id,emoji_status:e})})}getDefaultEmojiStatuses(){return this.defaultEmojiStatuses??(this.defaultEmojiStatuses=this.apiManager.invokeApiSingleProcess({method:"account.getDefaultEmojiStatuses",processResult:e=>this.defaultEmojiStatuses=e}))}getRecentEmojiStatuses(){return this.recentEmojiStatuses??(this.recentEmojiStatuses=this.apiManager.invokeApiSingleProcess({method:"account.getRecentEmojiStatuses",processResult:e=>this.recentEmojiStatuses=e}))}isPremiumRequiredToContact(e,t){const a=this.getUser(e);if(!a||this.rootScope.premium||!a.pFlags.contact_require_premium)return!1;if(this.appProfileManager.getCachedFullUser(e)?.pFlags?.contact_require_premium)return!0;if(this.appMessagesManager.getHistoryStorage(e.toPeerId(!1)).count)return!1;if(t)return;let i=this.isPremiumRequiredToContactUserIds.get(e);return i||this.isPremiumRequiredToContactUserIds.set(e,i=Pe()),this.getIsPremiumRequiredToContact(),i}getIsPremiumRequiredToContact(){this.isPremiumRequiredToContactUserIdsProcessing||(this.isPremiumRequiredToContactUserIdsProcessing=!0,rt(0).then(()=>{const e=[...this.isPremiumRequiredToContactUserIds.keys()];this.apiManager.invokeApi("users.getIsPremiumRequiredToContact",{id:e.map(t=>this.getUserInput(t))}).then(t=>{t.forEach((a,s)=>{const n=e[s];this.isPremiumRequiredToContactUserIds.get(n).resolve(a),this.isPremiumRequiredToContactUserIds.delete(n)})}).finally(()=>{this.isPremiumRequiredToContactUserIdsProcessing=!1,this.isPremiumRequiredToContactUserIds.size&&this.getIsPremiumRequiredToContact()})}))}}const hd=new Set(["photo","video","gif","document"]);class ud extends ce{constructor(){super(...arguments),this.webpages={},this.pendingWebPages={}}after(){this.apiUpdatesManager.addMultipleEventsListeners({updateWebPage:e=>{this.saveWebPage(e.webpage)},updateChannelWebPage:e=>{this.saveWebPage(e.webpage)}})}saveWebPage(e,t,a){if(e._==="webPageNotModified"||e._==="webPageEmpty")return;const{id:s}=e;a??(a={type:"webPage",url:e.url});const n=this.webpages[s],i=n&&n._===e._&&n.hash!==e.hash;let r=!1;if(e._==="webPage"){e.photo?._==="photo"?e.photo=this.appPhotosManager.savePhoto(e.photo,a):delete e.photo,e.document?._==="document"?e.document=this.appDocsManager.saveDoc(e.document,a):(e.type==="document"&&delete e.type,delete e.document),n?._===e._&&(r=n.photo?.id!==e.photo?.id||n.document?.id!==e.document?.id);const d=e.site_name,f=e.title||e.author||"";d&&f===d&&delete e.site_name;for(const c of e.attributes||[])switch(c._){case"webPageAttributeStory":{const l=this.appStoriesManager.getPeerStoriesCache(this.appPeersManager.getPeerId(c.peer));c.story=this.appStoriesManager.saveStoryItem(c.story,l);break}}!hd.has(e.type)&&!e.description&&e.photo&&(e.type="photo")}let p=this.pendingWebPages[s];if(t&&(p||(p=this.pendingWebPages[s]=new Set),p.add(t)),n===void 0?this.webpages[s]=e:Wt(n,e),(!t&&i||r)&&p!==void 0){const d=[];p.forEach(f=>{const[c,l,m]=f.split("_");d.push({peerId:c.toPeerId(),mid:+l,isScheduled:!!m})}),this.rootScope.dispatchEvent("webpage_updated",{id:s,msgs:d})}return e}getMessageKeyForPendingWebPage(e,t,a){return e+"_"+t+(a?"_s":"")}deleteWebPageFromPending(e,t){const a=e.id;if(!a)return;const s=this.pendingWebPages[a];s&&s.has(t)&&(s.delete(t),s.size||delete this.pendingWebPages[a])}getCachedWebPage(e){return this.webpages[e]}getWebPage(e){return this.apiManager.invokeApiHashable({method:"messages.getWebPage",processResult:t=>(this.appPeersManager.saveApiPeers(t),this.saveWebPage(t.webpage)),params:{url:e}})}}function yd(o){return["image/jpeg","image/png","image/gif","image/svg+xml","image/webp","image/bmp","image/avif","image/jxl","video/mp4","video/webm","video/quicktime","audio/ogg","audio/mpeg","audio/mp4","audio/wav","application/json","application/pdf"].indexOf(o)===-1?"application/octet-stream":o}function Bi(o,e=""){o=Xs(o);const t=yd(e);return new Blob(o,{type:t})}class _d{constructor(e,t,a){this.mimeType=e,this.size=t,this.saveFileCallback=a,this.bytes=new Uint8Array(t)}async write(e,t){const a=t+e.byteLength;if(a>this.bytes.byteLength){const s=new Uint8Array(a);s.set(this.bytes,0),this.bytes=s}this.bytes.set(e,t)}truncate(){this.bytes=new Uint8Array}trim(e){this.bytes=this.bytes.slice(0,e)}finalize(e=!0){const t=Bi(this.bytes,this.mimeType);return e&&this.saveFileCallback&&this.saveFileCallback(t),t}getParts(){return this.bytes}replaceParts(e){this.bytes=e}}const fa=class fa{constructor(e){this.dbName=e,this.useStorage=!0,Ae.test&&(this.dbName+="_test"),fa.STORAGES.length&&(this.useStorage=fa.STORAGES[0].useStorage),this.openDatabase(),fa.STORAGES.push(this)}openDatabase(){return this.openDbPromise??(this.openDbPromise=caches.open(this.dbName))}delete(e){return this.timeoutOperation(t=>t.delete("/"+e))}deleteAll(){return caches.delete(this.dbName)}get(e){return this.timeoutOperation(t=>t.match("/"+e))}save(e,t){return this.timeoutOperation(a=>a.put("/"+e,t))}getFile(e,t="blob"){return this.get(e).then(a=>{if(!a)throw Ee("NO_ENTRY_FOUND");return a[t]()})}saveFile(e,t){t instanceof Blob||(t=Bi(t));const a=new Response(t,{headers:{"Content-Length":""+t.size}});return this.save(e,a).then(()=>t)}timeoutOperation(e){return this.useStorage?new Promise(async(t,a)=>{let s=!1;const n=setTimeout(()=>{a(),s=!0},15e3);try{const i=await this.openDatabase();if(!i)throw this.useStorage=!1,this.openDbPromise=void 0,"no cache?";const r=await e(i);if(s)return;t(r)}catch(i){a(i)}clearTimeout(n)}):Promise.reject(Ee("STORAGE_OFFLINE"))}prepareWriting(e,t,a){return{deferred:Pe(),getWriter:()=>new _d(a,t,n=>this.saveFile(e,n).catch(()=>n))}}static toggleStorage(e,t){return Promise.all(this.STORAGES.map(a=>{if(a.useStorage=e,!!t&&!e)return a.deleteAll()}))}};fa.STORAGES=[];let ns=fa;function Pd(o,e){return new Promise(t=>{const a=new FileReader;a.addEventListener("loadend",s=>{t(s.target.result)}),a[e](o)})}function xi(o){return Pd(o,"readAsArrayBuffer")}function Md(o){const e=o.indexOf("<svg");e!==0&&(o=o.slice(e));const[t,a,s,n]=o.match(/viewBox="(.+?)"/)[1].split(" ");return o=o.replace(/>/,` width="${s}" height="${n}">`).replace(/[^\x00-\x7F]/g,""),o}function vd(o,e,t,a){const s=o._==="document";if(!e||e._==="photoSizeEmpty")throw new Error("photoSizeEmpty!");const n=!!((e._==="photoSize"||e._==="photoSizeProgressive")&&o.access_hash&&o.file_reference),i={_:s?"inputDocumentFileLocation":"inputPhotoFileLocation",id:o.id,access_hash:o.access_hash,file_reference:o.file_reference,thumb_size:e.type};return{dcId:o.dc_id,location:i,size:n?e.size:void 0,mimeType:"image/jpeg",queueId:t,onlyCache:a}}function Li(o){return{dcId:0,location:o,size:0,mimeType:"image/jpeg"}}function Sd(o){const e=Li({_:"inputWebFileLocation",access_hash:o.access_hash,url:o.url});return e.size=o.size,e.mimeType=o.mime_type,e}function bd(o){return!!(o&&(o._==="webDocument"||o._==="webDocumentNoProxy"))}function en(o){return o?._.includes("inputWebFile")}function Os(o){return ui(o.location,o)}function Cd(o){const{media:e,thumb:t,queueId:a,onlyCache:s}=o;let n;return e._==="document"?n=yi(e,t,a,s):e._==="photo"?n=vd(e,t,a,s):bd(e)?n=Sd(e):en(e)&&(n=Li(e)),n.downloadId=o.downloadId,{fileName:Os(n),downloadOptions:n}}function Id(o){return xi(o).then(e=>new Uint8Array(e))}function Dd(o){return encodeURIComponent(o).replace(/['()]/g,escape).replace(/\*/g,"%2A")}class wd{constructor(e,t){this.serviceMessagePort=e,this.downloadId=t,this.serviceMessagePort=xt.getServiceMessagePort()}async write(e,t){return this.serviceMessagePort.invoke("downloadChunk",{id:this.downloadId,chunk:e})}finalize(e){return this.serviceMessagePort.invoke("downloadFinalize",this.downloadId).then(()=>{})}}class kd{getFile(e){return Promise.reject(Ee("NO_ENTRY_FOUND"))}prepareWriting({fileName:e,downloadId:t,size:a}){const s={"Content-Disposition":"attachment; filename*=UTF-8''"+Dd(e),...a?{"Content-Length":a}:{}},n=xt.getServiceMessagePort(),i=n.invoke("download",{headers:s,id:t}),r=Pe();return r.cancel=()=>{r.reject(Ee("DOWNLOAD_CANCELED"))},r.catch(()=>{xt.getServiceMessagePort().invoke("downloadCancel",t)}),i.then(r.resolve.bind(r),r.reject.bind(r)),{deferred:r,getWriter:()=>new wd(n,t)}}}function Ad(o,e,t){return Math.min(t,Math.max(e,o))}const Fd=1*1024*1024,Ed=512*1024,is=64*1024,Ud=512*1024,Td=9*512*1024/is,Rd=56*512*1024/is,Bd=new Set(["DOWNLOAD_CANCELED","UPLOAD_CANCELED","UNKNOWN","NO_NEW_CONTEXT"]);class xd extends ce{constructor(){super(...arguments),this.cacheStorage=new ns("cachedFiles"),this.downloadStorage=new kd,this.downloadPromises={},this.uploadPromises={},this.downloadPulls={},this.downloadActives={},this.refreshReferencePromises={},this.log=We("AFM",ke.Error|ke.Log),this.tempId=0,this.queueId=0,this.debug=Ae.debug,this.maxUploadParts=4e3,this.maxDownloadParts=8e3,this.uncompressTGS=(e,t)=>this.cryptoWorker.invokeCrypto("gzipUncompress",e.slice().buffer,!1),this.uncompressTGV=(e,t)=>{const a=e.slice().buffer;return Rt().IS_FIREFOX?this.cryptoWorker.invokeCrypto("gzipUncompress",a,!0).then(s=>Md(s)).then(s=>new TextEncoder().encode(s)):this.cryptoWorker.invokeCrypto("gzipUncompress",a,!1)},this.convertWebp=(e,t)=>Be.getInstance().invoke("convertWebp",{fileName:t,bytes:e}),this.convertOpus=(e,t)=>Be.getInstance().invoke("convertOpus",{fileName:t,bytes:e})}after(){setInterval(()=>{for(const e in this.refreshReferencePromises){const{deferred:t}=this.refreshReferencePromises[e];(t.isFulfilled||t.isRejected)&&delete this.refreshReferencePromises[e]}},18e5),this.rootScope.addEventListener("config",e=>{this.webFileDcId=e.webfile_dc_id}),this.rootScope.addEventListener("app_config",e=>{this.maxUploadParts=this.rootScope.premium?e.upload_max_fileparts_premium:e.upload_max_fileparts_default,this.maxDownloadParts=e.upload_max_fileparts_premium})}downloadRequest({dcId:e,id:t,cb:a,activeDelta:s,queueId:n=0,priority:i=0}){this.downloadPulls[e]===void 0&&(this.downloadPulls[e]=[],this.downloadActives[e]=0);const r=this.downloadPulls[e],p=new Promise((d,f)=>{Bt(r,{id:t,queueId:n,cb:a,deferred:{resolve:d,reject:f},activeDelta:s,priority:i},"priority",-1)});return this.downloadCheck(e),p}downloadCheck(e){const t=this.downloadPulls[e],a=this.rootScope.premium?Rd:Td;if(this.downloadActives[e]>=a||!t?.length)return!1;const s=t[0].priority?t.shift():wt(t,r=>r.queueId===0)||wt(t,r=>r.queueId===this.queueId)||t.shift(),n=s.activeDelta||1;this.downloadActives[e]+=n;const i=s.cb();i.then(()=>{this.downloadActives[e]-=n,this.downloadCheck(e)},r=>{(!r?.type||!Bd.has(r.type))&&this.log.error("downloadCheck error:",r),this.downloadActives[e]-=n,this.downloadCheck(e)}).finally(()=>{i.then(s.deferred.resolve,s.deferred.reject)})}setQueueId(e){this.queueId=e}getFileStorage(){return this.cacheStorage}cancelDownload(e){const t=[this.downloadPromises[e],this.uploadPromises[e]].filter(Boolean);let a=!1;for(let s=0,n=t.length;s<n;++s){const i=t[s];i&&!i.isRejected&&!i.isFulfilled&&(i.cancel(),a=!0)}return a}requestWebFilePart({dcId:e,location:t,offset:a,limit:s,id:n,queueId:i,checkCancel:r}){return this.downloadRequest({dcId:this.webFileDcId,id:n,cb:async()=>{if(r?.(),"url"in t){const p=t.url;if(this.isLocalWebFile(p))return fetch(p).then(d=>d.arrayBuffer()).then(d=>{const f=p.split(".").pop(),c=st[f]||"application/octet-stream";return{_:"upload.webFile",size:d.byteLength,mime_type:c,file_type:{_:"storage.fileUnknown"},mtime:0,bytes:new Uint8Array(d)}})}return this.apiManager.invokeApi("upload.getWebFile",{location:t,offset:a,limit:s},{dcId:this.webFileDcId,fileDownload:!0})},activeDelta:this.getDelta(s),queueId:i})}requestFilePart({dcId:e,location:t,offset:a,limit:s,id:n,queueId:i,checkCancel:r,floodMaxTimeout:p,priority:d}){return this.downloadRequest({dcId:e,id:n,cb:async()=>{r?.();const f=async()=>{r?.();const l=t.file_reference?.slice();return this.apiManager.invokeApi("upload.getFile",{location:t,offset:a,limit:s},{dcId:e,fileDownload:!0,floodMaxTimeout:p}).catch(u=>{if(r?.(),u.type==="FILE_REFERENCE_EXPIRED")return this.refreshReference(t,l).then(f);throw u})},c=t.file_reference;if(c&&!t.checkedReference){t.checkedReference=!0;const l=Te(c);if(this.refreshReferencePromises[l])return this.refreshReference(t,c).then(f)}return f()},activeDelta:this.getDelta(s),queueId:i,priority:d})}getDelta(e){return e/is}getLimitPart(e,t){if(!e)return Ud;let a=is;const s=t?this.maxUploadParts:this.maxDownloadParts,n=t?Ed:Fd;for(;e/a>s&&a<n;)a*=2;return a}refreshReference(e,t,a=Te(t)){let s=this.refreshReferencePromises[a];if(!s){const n=Pe();s=this.refreshReferencePromises[a]={deferred:n},this.referenceDatabase.refreshReference(t).then(i=>{a===Te(i)&&n.reject(Ee("REFERENCE_IS_NOT_REFRESHED")),n.resolve(i)},n.reject.bind(n))}return s.deferred.then(n=>{e.file_reference=n})}isDownloading(e){return!!this.downloadPromises[e]}getDownload(e){return this.downloadPromises[e]}getUpload(e){return this.uploadPromises[e]}getConvertMethod(e){let t;return e==="application/x-tgwallpattern"?(t=this.uncompressTGV,e="image/svg+xml"):e==="image/webp"&&!Rt().IS_WEBP_SUPPORTED?(t=this.convertWebp,e="image/png"):e==="application/x-tgsticker"?(t=this.uncompressTGS,e="application/json"):e==="audio/ogg"&&!Rt().IS_OPUS_SUPPORTED&&(t=this.convertOpus,e="audio/wav"),{mimeType:e,process:t}}isLocalWebFile(e){return e?.startsWith("assets/")}download(e){const t=this.log.bindPrefix("download"),a=e.size??0,{dcId:s,location:n}=e;let{downloadId:i}=e;i&&!xt.getServiceMessagePort()&&(t.error("fallback to blob",e),i=void 0);const r=e.mimeType,p=this.getConvertMethod(r),{process:d}=p;e.mimeType=p.mimeType||"image/jpeg";const f=Os(e),c=i?Os({...it(e),downloadId:void 0}):f,l=this.getFileStorage(),m=i?this.downloadStorage:void 0;let u=i?void 0:this.downloadPromises[f];if(t("start",f,e,a),u)return u;const M=(y,P)=>{if(!y?.error)for(const S of j)y&&y!==S||(S.error=P,S.deferred.reject(P))},A=en(n),w=A&&this.isLocalWebFile(n.url),C=this.tempId++,I=w?a:e.limitPart||this.getLimitPart(a,!1);let F=l.getFile.bind(l),L,z;const j=[],Z=a||I,X=()=>j.reduce((y,P)=>y+ +!!P.error,0),O=(y,P)=>{const{deferred:S}=y,v=M.bind(null,y);S.cancel=()=>S.reject(Ee("DOWNLOAD_CANCELED")),S.catch(Q=>{v(Q),y.writer?.truncate?.()}).finally(()=>{this.downloadPromises[P]===S&&delete this.downloadPromises[P],delete y.writer}),this.downloadPromises[P]=S,j.push(y)};if(l&&(!m||Z<=an)&&(L=l.prepareWriting(c,Z,e.mimeType),O(L,c)),m){let y=e.fileName;if(!y){y=c;const P=_i[e.mimeType];P&&(y+="."+P)}z=m.prepareWriting({fileName:y,downloadId:i,size:Z}),O(z,f),L&&z.deferred.catch(P=>L.deferred.reject(P))}u=z?.deferred??L.deferred,m&&d&&(F=m.getFile.bind(m)),F(c).then(async y=>{if(B(),z){const P=z.writer=z.getWriter();B();const S=await Id(y);B(),await P.write(S),B(),z.deferred.resolve(await P.finalize())}L&&L.deferred.resolve(y)}).catch(async y=>{if(e.onlyCache){M(null,y);return}j.forEach(Ne=>{Ne.writer=Ne.getWriter()});const P=1/0,S=(A?this.requestWebFilePart:this.requestFilePart).bind(this);A&&this.webFileDcId===void 0&&!w&&(await this.apiManager.getConfig(),B());const v={done:0,offset:0,total:a,fileName:f},Q=()=>{try{B(),v.done=R,this.rootScope.dispatchEvent("download_progress",v)}catch{}},T=ca(Q,50,!0);let R=0,ee=Promise.resolve(),le=0;const ze=async()=>{if(le&&le>a)return;const Ne=Pe(),Fe=ee,mt=le;ee=Ne,le+=I;try{B();const Qe=performance.now(),xe=await S({dcId:s,location:n,offset:mt,limit:I,id:C,queueId:e.queueId,checkCancel:B});B();const bt=performance.now()-Qe,_t=xe.bytes,Kt=_t.byteLength;t("requestPart result",f,xe);const Ct=mt+I>=a||!Kt;if(Kt){R+=Kt,Ct?Q():(ze(),T());const Ke=performance.now();await Fe,B();const ht=performance.now()-Ke,Pt=performance.now();await Promise.all(j.map(({writer:kt})=>kt?.write(_t,mt))),B(),i&&t("write time",performance.now()-Pt,"request time",bt,"queue time",ht)}if(Ct&&(!a||R<a)&&j.forEach(({writer:Ke})=>Ke?.trim?.(R)),Ct&&d){const Ke=j.filter(({writer:ht})=>ht?.getParts&&ht.replaceParts).map(async({writer:ht})=>{const Pt=ht.getParts(),kt=await d(Pt,c);ht.replaceParts(kt)});await Promise.all(Ke),B()}if(Ne.resolve(),Ct){const Ke=R<=an;j.forEach(ht=>{const{deferred:Pt,writer:kt}=ht;if(Pt.isFulfilled||Pt.isRejected||!kt)return;const na=kt.finalize(Ke);Pt.resolve(na)})}}catch(Qe){M(null,Qe),Ne.resolve()}};for(let Ne=0,Fe=Ad(a/I,1,P);Ne<Fe;++Ne)ze()}).catch(Ge);const B=()=>{if(X()===j.length)throw j[0].error};return u}downloadMedia(e){let{media:t,thumb:a}=e;const s=t._==="photo";if(s&&!a)return Promise.reject("preloadPhoto photoEmpty!");const n=t._==="document";n?t=this.appDocsManager.getDoc(t.id):s&&(t=this.appPhotosManager.getPhoto(t.id)),e.media=t||e.media;const{fileName:i,downloadOptions:r}=Cd(e);let p=this.getDownload(i);return p||(p=this.download(r),n&&!a&&(this.rootScope.dispatchEvent("document_downloading",t.id),p.then(()=>{this.rootScope.dispatchEvent("document_downloaded",t.id)}).catch(Ge))),p}downloadMediaURL(e){const{media:t,thumb:a}=e;let s=this.thumbsStorage.getCacheContext(t,a?.type);return(!a||s.downloaded>=("size"in a?a.size:0))&&s.url?Promise.resolve(s.url):this.downloadMedia(e).then(n=>{if(!s.downloaded||!s.url||s.downloaded<n.size){const i=URL.createObjectURL(n);s=this.thumbsStorage.setCacheContextURL(t,s.type,i,n.size)}return s.url})}downloadMediaVoid(e){return this.downloadMedia(e).then(Ge)}delete(e){return delete this.downloadPromises[e],this.getFileStorage().delete(e)}upload({file:e,fileName:t}){t||(t=Ii(e));const a=e.size,s=a>=10485760,n=this.getLimitPart(a,!0),i=this.getDelta(n),r=Math.ceil(a/n),p=qt(),d={_:s?"inputFileBig":"inputFile",id:p,parts:r,name:t,md5_checksum:""},f=Pe();if(r>this.maxUploadParts)return f.reject(Ee("FILE_TOO_BIG")),f;let c=!1,l=!1,m=z=>{z?.type!=="UPLOAD_CANCELED"&&this.log.error("up error",z),f.reject(z),c=!0,m=Ge};const u=s?"upload.saveBigFilePart":"upload.saveFilePart",M=this.tempId++,A=this;function*w(){let z=0,j=0;for(let Z=0;Z<a;Z+=n){const X=z++;yield A.downloadRequest({dcId:"upload",id:M,cb:async()=>{C();const O=e.slice(Z,Z+n),B=await xi(O);return C(),A.debug&&A.log("Upload file part, isBig:",s,X,B.byteLength,new Uint8Array(B).length,new Uint8Array(B).slice().length),A.apiManager.invokeApi(u,{file_id:p,file_part:X,file_total_parts:r,bytes:B},{fileUpload:!0}).then(()=>{if(c)return;++j;const y={done:j*n,offset:Z,total:a,fileName:t};f.notify(y),j>=r&&(f.resolve(d),l=!0)},m)},activeDelta:i}).catch(m)}}const C=()=>{if(c)throw Ee("UPLOAD_CANCELED")};f.cancel=()=>{!c&&!l&&(c=!0,m(Ee("UPLOAD_CANCELED")))},f.notify=z=>{this.rootScope.dispatchEvent("download_progress",z)},f.finally(()=>{this.uploadPromises[t]===f&&delete this.uploadPromises[t]}),this.uploadPromises[t]=f;const I=w(),F=()=>{if(c)return;const z=I.next();z.done||c||z.value.then(F)},L=1/0;for(let z=0,j=Math.min(L,r);z<j;++z)F();return f}}class Ld{constructor(){this.prefix="",this.cache={},this.useStorage=!0,Ae.test&&(this.prefix="t_")}get(e,t=!0){if(this.cache.hasOwnProperty(e)&&t)return this.cache[e];if(this.useStorage){let a;try{a=localStorage.getItem(this.prefix+e)}catch{throw this.useStorage=!1,Ee("STORAGE_OFFLINE")}if(a!==null)try{a=JSON.parse(a)}catch{}else a=void 0;return a}else throw Ee("STORAGE_OFFLINE")}set(e,t=!1){let a;for(const s in e)if(e.hasOwnProperty(s)){const n=e[s];if(this.cache[s]=n,!t)try{if(!this.useStorage)throw Ee("STORAGE_OFFLINE");const i=JSON.stringify(n);localStorage.setItem(this.prefix+s,i)}catch(i){this.useStorage=!1,a=i}}if(a)throw a}delete(e,t=!1){e=""+e,t||delete this.cache[e];try{localStorage.removeItem(this.prefix+e)}catch{}}clear(){const e=["dc","server_time_offset","xt_instance","user_auth","state_id","k_build"];for(let t=1;t<=5;++t)e.push(`dc${t}_server_salt`),e.push(`dc${t}_auth_key`),e.push(`dc${t}_hash`);for(const t of e)this.delete(t,!0)}toggleStorage(e,t){if(this.useStorage=e,!!t)if(!e)this.clear();else return this.set(this.cache)}}const rs=class rs{constructor(){rs.STORAGES.push(this),ga||(this.storage=new Ld)}async proxy(e,...t){return ga?Be.getInstance().invoke("localStorageProxy",{type:e,args:t}):(t=Array.prototype.slice.call(t),this.storage[e].apply(this.storage,t))}get(e,t){return this.proxy("get",e,t)}set(e,t){return this.proxy("set",e,t)}delete(e,t){return this.proxy("delete",e,t)}clear(){return this.proxy("clear")}toggleStorage(e,t){return this.proxy("toggleStorage",e,t)}};rs.STORAGES=[];let Vs=rs;const nt=new Vs;Ue.appStorage=nt;class Od extends ce{constructor(){super(),this.hashes={},this.apiPromisesSingleProcess={},this.apiPromisesSingle={},this.apiPromisesCacheable={},this.afterMessageIdTemp=0}after(){this.rootScope.addEventListener("managers_ready",async()=>{const t=await e;this.applyAppConfig(t,!1)},{once:!0});const e=this.appStateManager.getState().then(t=>t.appConfig);return e}setUser(e){return this.appUsersManager.saveApiUser(e),this.setUserAuth(e.id)}invokeApiAfter(e,t={},a={}){let s=a;return s.prepareTempMessageId=""+ ++this.afterMessageIdTemp,s={...a},a.messageId=s.prepareTempMessageId,this.invokeApi(e,t,s)}invokeApiHashable(e){e.params??(e.params={}),e.options??(e.options={});const{params:t,options:a,method:s,overwrite:n}=e,i=JSON.stringify(t);let r;return this.hashes[s]&&(r=this.hashes[s][i],r&&(n?(delete this.hashes[s][i],r=void 0):t.hash=r.hash)),this.invokeApiSingleProcess({method:s,processResult:p=>{if(p._.includes("NotModified"))return r.result;if(p.hash){const d=p.hash;this.hashes[s]||(this.hashes[s]={}),r=this.hashes[s][i]={hash:d,result:p}}if(e.processResult){const d=e.processResult(p);return r?r.result=d:d}return p},params:t,options:a})}invokeApiSingle(e,t={},a={}){const s=e+"-"+JSON.stringify(t),n=this.apiPromisesSingle;return n[s]?n[s]:n[s]=this.invokeApi(e,t,a).finally(()=>{delete n[s]})}invokeApiSingleProcess(e){e.params??(e.params={}),e.options??(e.options={});const{method:t,processResult:a,processError:s,params:n,options:i}=e,r=this.apiPromisesSingleProcess,p=i.cacheKey||JSON.stringify(n),d=r[t]??(r[t]=new Map),f=d.get(p);if(f)return f;const c=()=>{const M=d.get(p);return M===u?void 0:M},u=this.invokeApi(t,n,i).then(M=>c()||(a?a(M):M),M=>{const A=c();if(A)return A;if(!s)throw M;return s(M)}).finally(()=>{d.get(p)===u&&(d.delete(p),d.size||delete r[t])});return d.set(p,u),u}invokeApiCacheable(e,t={},a={}){var d;const s=(d=this.apiPromisesCacheable)[e]??(d[e]={}),n=JSON.stringify(t);let i=s[n];if(i&&(!a.override||!i.fulfilled)){if(a.syncIfHasResult){if(i.hasOwnProperty("result"))return i.result;if(i.hasOwnProperty("error"))throw i.error}return i.promise}a.override&&(i?.timeout&&(clearTimeout(i.timeout),delete i.timeout),delete a.override);let r;a.cacheSeconds&&(r=we.setTimeout(()=>{s[n]===i&&delete s[n]},a.cacheSeconds*1e3),delete a.cacheSeconds);const p=this.invokeApi(e,t,a);return p.then(f=>{i.result=f},f=>{i.error=f}),i=s[n]={timestamp:Date.now(),fulfilled:!1,timeout:r,promise:p,params:t},p}clearCache(e,t){const a=this.apiPromisesCacheable[e];if(a)for(const s in a){const n=a[s];try{t(n.params)&&(n.timeout&&clearTimeout(n.timeout),delete a[s])}catch{}}}getConfig(e){return this.config&&!e?this.config:this.invokeApiSingleProcess({method:"help.getConfig",params:{},processResult:t=>(this.config=t,this.rootScope.dispatchEvent("config",t),t),options:{overwrite:e}})}applyAppConfig(e,t){return this.appConfig=e,Np(e.ignore_restriction_reasons??[]),t&&(e.cachedTime=Date.now(),this.appStateManager.pushToState("appConfig",e)),this.rootScope.dispatchEvent("app_config",e),e}getAppConfig(e){return this.appConfig&&!e&&(this.requestedAppConfig||Date.now()-(this.appConfig.cachedTime||0)<864e5)?this.appConfig:this.invokeApiSingleProcess({method:"help.getAppConfig",params:{hash:this.appConfig?.hash||0},processResult:async t=>{this.requestedAppConfig=!0;const a=t.config||this.appConfig;return a.hash=t.hash||a.hash,this.applyAppConfig(a,!0)},options:{overwrite:e}})}getTimezonesList(){return this.invokeApiCacheable("help.getTimezonesList",{hash:0},{cacheSeconds:86400,syncIfHasResult:!0})}getLimit(e,t){return Ce(this.getAppConfig(),a=>{const s={pin:["dialogs_pinned_limit_default","dialogs_pinned_limit_premium"],folderPin:["dialogs_folder_pinned_limit_default","dialogs_folder_pinned_limit_premium"],folders:["dialog_filters_limit_default","dialog_filters_limit_premium"],favedStickers:["stickers_faved_limit_default","stickers_faved_limit_premium"],reactions:["reactions_user_max_default","reactions_user_max_premium"],bio:["about_length_limit_default","about_length_limit_premium"],topicPin:"topics_pinned_limit",caption:["caption_length_limit_default","caption_length_limit_premium"],chatlistInvites:["chatlist_invites_limit_default","chatlist_invites_limit_premium"],chatlistsJoined:["chatlists_joined_limit_default","chatlists_joined_limit_premium"],channels:["channels_limit_default","channels_limit_premium"],links:["channels_public_limit_default","channels_public_limit_premium"],gifs:["saved_gifs_limit_default","saved_gifs_limit_premium"],folderPeers:["dialog_filters_chats_limit_default","dialog_filters_chats_limit_premium"],uploadFileParts:["upload_max_fileparts_default","upload_max_fileparts_premium"],recommendedChannels:["recommended_channels_limit_default","recommended_channels_limit_premium"],savedPin:["saved_dialogs_pinned_limit_default","saved_dialogs_pinned_limit_premium"]};t??(t=this.rootScope.premium);const n=s[e],i=Array.isArray(n)?n[t?1:0]:n;return a[i]})}getPeerColors(){return this.apiManager.invokeApiCacheable("help.getPeerColors",{hash:0})}getPeerProfileColors(){return this.apiManager.invokeApiCacheable("help.getPeerProfileColors",{hash:0})}setThemeParams(e){this.themeParams=e}getThemeParams(){return this.themeParams}}function Oi(o,e){return Promise.all([Gt.toggleStorage(o,e),ns.toggleStorage(o,e),nt.toggleStorage(o,e)]).then(Ge,Ge)}const Vd=6,Nd=3;class qd extends Od{constructor(){super(),this.log=We("API"),this.cachedNetworkers={},this.cachedExportPromise={},this.gettingNetworkers={},this.baseDcId=0,this.afterMessageTempIds={},this.transportType=Ae.transport,Ae.multipleTransports&&ma.addEventListener("transport",t=>{this.changeTransportType(t)});const e=9970*1e3;setInterval(()=>{this.getConfig(!0)},e)}after(){const e=super.after();return this.apiUpdatesManager.addMultipleEventsListeners({updateConfig:()=>{this.getConfig(!0),this.getAppConfig(!0)}}),this.rootScope.addEventListener("user_auth",()=>{this.config&&this.apiUpdatesManager.processLocalUpdate({_:"updateConfig"})}),this.rootScope.addEventListener("premium_toggle",t=>{this.iterateNetworkers(({networker:a,connectionType:s,dcId:n,transportType:i})=>{if(s==="client"||i!=="websocket")return;const r=a.transport;if(!r){this.log.error("wow what, no transport?",a);return}if(r.connection){const p=Jn(n,s,t);r.changeUrl(p)}})}),e}getTransportType(e){let t;return t=this.transportType,t}iterateNetworkers(e){for(const t in this.cachedNetworkers){const a=this.cachedNetworkers[t];for(const s in a){const n=a[s];for(const i in n)n[i].forEach((p,d,f)=>{e({networker:p,dcId:+i,connectionType:s,transportType:t,index:d,array:f})})}}}chooseServer(e,t,a){return this.dcConfigurator.chooseServer(e,t,a,t==="client",this.rootScope.premium)}changeTransportType(e){const t=this.transportType;if(t===e)return;this.log("changing transport from",t,"to",e);const a=this.cachedNetworkers[t],s=this.cachedNetworkers[e];this.cachedNetworkers[e]=a,this.cachedNetworkers[t]=s,this.transportType=e;for(const n in this.gettingNetworkers){const i=this.gettingNetworkers[n];delete this.gettingNetworkers[n];const r=n.replace(t,e);this.gettingNetworkers[r]=i,this.log("changed networker getKey from",n,"to",r)}this.iterateNetworkers(n=>{const i=this.getTransportType(n.connectionType),r=this.chooseServer(n.dcId,n.connectionType,i);this.changeNetworkerTransport(n.networker,r)})}async getBaseDcId(){if(this.baseDcId)return this.baseDcId;const e=await nt.get("dc");return this.baseDcId||(e?this.baseDcId=e:this.setBaseDcId(Ve.baseDcId)),this.baseDcId}async setUserAuth(e){if((typeof e=="string"||typeof e=="number")&&(e={dcID:0,date:Ie(!0),id:e.toPeerId(!1)}),this.rootScope.dispatchEvent("user_auth",e),!e.dcID){const t=await this.getBaseDcId();e.dcID=t}nt.set({user_auth:e})}setBaseDcId(e){const t=this.baseDcId;t&&this.getNetworker(t).then(a=>{this.setOnDrainIfNeeded(a)}),this.baseDcId=e,nt.set({dc:this.baseDcId})}async logOut(){if(this.loggingOut)return;this.loggingOut=!0;const e=[],t="dc";for(let i=1;i<=5;i++)e.push(t+i+"_auth_key");const a=await Promise.all(e.map(i=>nt.get(i))),s=[];for(let i=0;i<a.length;i++)a[i]&&s.push(this.invokeApi("auth.logOut",{},{dcId:i+1,ignoreErrors:!0}));const n=async()=>{this.baseDcId=void 0,await Oi(!1,!0),Ya.closeDatabases(),this.rootScope.dispatchEvent("logging_out")};return setTimeout(n,1e3),Promise.all(s).catch(i=>{i.handled=!0}).finally(n)}generateNetworkerGetKey(e,t,a){return[e,t,a].join("-")}getNetworker(e,t={}){const a=t.fileDownload?"download":t.fileUpload?"upload":"client",s=this.getTransportType(a);this.cachedNetworkers[s]||(this.cachedNetworkers[s]={client:{},download:{},upload:{}});const n=this.cachedNetworkers[s][a];e in n||(n[e]=[]);const i=n[e],r=a==="client"||s==="https"?1:this.rootScope.premium?Vd:Nd;if(i.length>=r){let l=i[0];if(r>1){let m=1/0,u,M;for(let A=r-1;A>=0;--A){const w=i[A],{activeRequests:C,isOnline:I}=w;C<m&&I&&(m=m,u=w,M=A)}u?l=u:M=r-1,M&&i.unshift(l=i.splice(M,1)[0])}return Promise.resolve(l)}let p=this.generateNetworkerGetKey(e,s,a);if(this.gettingNetworkers[p])return this.gettingNetworkers[p];const d=`dc${e}_auth_key`,f=`dc${e}_server_salt`;let c=this.chooseServer(e,a,s);return this.gettingNetworkers[p]=Promise.all([d,f].map(l=>nt.get(l))).then(async([l,m])=>{let u,M;if(l?.length===512){m?.length!==16&&(m="AAAAAAAAAAAAAAAA");const w=sa(l),C=(await _e.invokeCrypto("sha1",w)).slice(-8),I=sa(m);u=this.networkerFactory.getNetworker(e,w,C,I,t)}else try{const w=await this.authorizer.auth(e);l=Te(w.authKey),m=Te(w.serverSalt),e===Ve.baseDcId&&nt.set({auth_key_fingerprint:l.slice(0,8)}),nt.set({[d]:l,[f]:m}),u=this.networkerFactory.getNetworker(e,w.authKey,w.authKeyId,w.serverSalt,t)}catch(w){M=w}const A=this.getTransportType(a);if(A!==s&&(p=this.generateNetworkerGetKey(e,A,a),c.destroy(),Ca.removeTransport(this.dcConfigurator.chosenServers,c),u&&(c=this.chooseServer(e,a,A)),this.log("transport has been changed during authorization from",s,"to",A)),delete this.gettingNetworkers[p],M)throw this.log("get networker error",M,M.stack),M;return this.changeNetworkerTransport(u,c),i.unshift(u),this.setOnDrainIfNeeded(u),u})}getNetworkerVoid(e){return this.getNetworker(e).then(Ge,Ge)}changeNetworkerTransport(e,t){const a=e.transport;a&&Ca.removeTransport(this.dcConfigurator.chosenServers,a),e.changeTransport(t)}onNetworkerDrain(e){this.log("networker drain",e.dcId),e.onDrain=void 0,this.changeNetworkerTransport(e),e.destroy(),this.networkerFactory.removeNetworker(e),Ca.removeTransport(this.cachedNetworkers,e)}setOnDrainIfNeeded(e){if(e.onDrain)return;(e.isFileNetworker?Promise.resolve(!0):this.getBaseDcId().then(a=>e.dcId!==a)).then(a=>{e.onDrain||a&&(e.onDrain=()=>this.onNetworkerDrain(e),e.setDrainTimeout())})}setUpdatesProcessor(e){this.updatesProcessor=e,this.networkerFactory.setUpdatesProcessor(e)}invokeApi(e,t={},a={}){const s=Pe();let{afterMessageId:n,prepareTempMessageId:i}=a;if(i&&s.then(()=>{delete this.afterMessageTempIds[i]}),Ue){const l=Date.now(),m=we.setInterval(()=>{(!d||!d.isStopped())&&this.log.error("Request is still processing:",e,t,a,"time:",(Date.now()-l)/1e3)},5e3);s.catch(Ge).finally(()=>{clearInterval(m)})}const r=async l=>{throw l?et(l)||(l={message:l}):l={type:"ERROR_EMPTY"},(l.code===401&&l.type==="SESSION_REVOKED"||l.code===406&&l.type==="AUTH_KEY_DUPLICATED")&&this.logOut(),a.ignoreErrors||(l.code===406&&(l.handled=!0),a.noErrorBox||(l.input=e,setTimeout(()=>{l.handled||(l.code===401&&this.logOut(),l.handled=!0)},100))),l};let p,d;const f=()=>{if(n){const m=this.afterMessageTempIds[n];m&&(a.afterMessageId=m.messageId)}const l=d.wrapApiCall(e,t,a);return i&&(this.afterMessageTempIds[i]={messageId:a.messageId,promise:s}),l.catch(m=>{if(m.type!=="FILE_REFERENCE_EXPIRED"&&this.log.error("Error",m.code,m.type,this.baseDcId,p,e,t),m.code===401&&this.baseDcId===p)throw m.type!=="SESSION_PASSWORD_NEEDED"&&(nt.delete("dc"),nt.delete("user_auth")),m;if(m.code===401&&this.baseDcId&&p!==this.baseDcId){if(this.cachedExportPromise[p]===void 0){const u=new Promise((M,A)=>{this.invokeApi("auth.exportAuthorization",{dc_id:p},{noErrorBox:!0}).then(w=>{this.invokeApi("auth.importAuthorization",{id:w.id,bytes:w.bytes},{dcId:p,noErrorBox:!0}).then(M,A)},A)});this.cachedExportPromise[p]=u}return this.cachedExportPromise[p].then(()=>f())}else if(m.code===303){const u=+m.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_|STATS_MIGRATE_)(\d+)/)[2];if(u!==p)return a.dcId?a.dcId=u:this.setBaseDcId(u),this.invokeApi(e,t,a)}else if(m.code===400&&m.type.indexOf("FILE_MIGRATE")===0){const u=+m.type.match(/^(FILE_MIGRATE_)(\d+)/)[2];if(u!==p)return a.dcId=u,this.invokeApi(e,t,a);throw m}else{if(m.code===400&&m.type==="CONNECTION_NOT_INITED")return this.networkerFactory.unsetConnectionInited(),f();if(!a.rawError&&m.code===420&&!m.type.includes("SLOWMODE_WAIT")){const u=m.type.match(/^FLOOD_WAIT_(\d+)/)||m.type.match(/_(\d+)_?/);let M;if(u&&(M=+u[1]),m.type.includes("FLOOD_PREMIUM_WAIT")&&Promise.all([this.getAppConfig(),this.appStateManager.getState()]).then(([A,w])=>{const C=Ie(!0);C-(w.shownUploadSpeedTimestamp||0)>=A.upload_premium_speedup_notify_period&&(this.appStateManager.pushToState("shownUploadSpeedTimestamp",C),this.rootScope.dispatchEvent("file_speed_limited",{increaseTimes:(a.fileUpload?A.upload_premium_speedup_upload:A.upload_premium_speedup_download)||10,isUpload:!!a.fileUpload}))}),M||(M=1),M>(a.floodMaxTimeout??60)&&!a.prepareTempMessageId)throw m;return rt(M*1e3).then(()=>f())}else if(!a.rawError&&["MSG_WAIT_FAILED","MSG_WAIT_TIMEOUT"].includes(m.type)){const u=this.afterMessageTempIds[n];return n=void 0,delete a.afterMessageId,u?u.promise.then(()=>f()):f()}else if(!a.rawError&&m.code===500){const u=Date.now();if(a.stopTime&&u>=a.stopTime)throw m;return a.waitTime=a.waitTime?Math.min(60,a.waitTime*1.5):1,rt(a.waitTime*1e3).then(()=>f())}else{if(m.type==="UNKNOWN"||m.type==="MTPROTO_CLUSTER_INVALID")return rt(1e3).then(()=>f());throw m}}})};let c;return(p=a.dcId||this.baseDcId)?c=this.getNetworker(p,a):c=this.getBaseDcId().then(l=>this.getNetworker(p=l,a)),c.then(l=>{d=l;const m=f();return d.attachPromise(s,a),m}).then(s.resolve.bind(s)).catch(r).catch(s.reject.bind(s)),s}}class Vi{constructor(){this.neededPeers=new Map,this.singlePeerMap=new Map,this._constructor(!1)}after(){this.rootScope.addEventListener("user_auth",()=>{this.requestPeer(this.appPeersManager.peerId,"self")})}requestPeer(e,t){let a=this.neededPeers.get(e);a&&a.has(t)||(a||(a=new Set,this.neededPeers.set(e,a)),a.add(t),this.dispatchEvent("peerNeeded",e))}releasePeer(e,t){const a=this.neededPeers.get(e);a&&(a.delete(t),a.size||(this.neededPeers.delete(e),this.dispatchEvent("peerUnneeded",e)))}requestPeersForKey(e,t){Array.isArray(e)&&(e=new Set(e));let a=this.singlePeerMap.get(t);if(a){for(const s of a)e.has(s)||(this.releasePeer(s,t),a.delete(s));if(!a.size&&!e.size){this.singlePeerMap.delete(t);return}}if(e.size){a||(a=new Set,this.singlePeerMap.set(t,a));for(const s of e)a.has(s)||(this.requestPeer(s,t),a.add(s))}}isPeerNeeded(e){return this.neededPeers.has(e)}}ti(Vi,[ua,ce]);function jd(o){return{downloaded:0,url:"",type:o}}function Dn(o,e){return o+(e!==void 0?"-"+e:"")}function Cs(o){return en(o)?ui(o):o._+(o.id??o.url)}const Is=ba;class Gd{constructor(){this.thumbsCache={},this.stickerCachedThumbs={}}getCacheContext(e,t=Is,a=Cs(e)){var n;const s=(n=this.thumbsCache)[a]??(n[a]={});return s[t]??(s[t]=jd(t))}mirrorCacheContext(e,t,a){Be.getInstance().invokeVoid("mirror",{name:"thumbs",key:$a(e,t),value:a})}mirrorStickerThumb(e,t){Be.getInstance().invokeVoid("mirror",{name:"stickerThumbs",key:e,value:t})}mirrorAll(e){const t=Be.getInstance();t.invokeVoid("mirror",{name:"thumbs",value:this.thumbsCache},e),t.invokeVoid("mirror",{name:"stickerThumbs",value:this.stickerCachedThumbs},e)}setCacheContextURL(e,t=Is,a,s=0,n=Cs(e)){const i=this.getCacheContext(e,t,n);return i.url=a,i.downloaded=s,this.mirrorCacheContext(n,t,i),i}deleteCacheContext(e,t=Is,a=Cs(e)){const s=this.thumbsCache[a];s&&(this.mirrorCacheContext(a,t),delete s[t])}getStickerCachedThumb(e,t){return this.stickerCachedThumbs[Dn(e,t)]}saveStickerPreview(e,t,a,s,n){const i=Dn(e,n),r=this.stickerCachedThumbs[i];if(r&&r.w>=a&&r.h>=s)return;const p=this.stickerCachedThumbs[i]={url:URL.createObjectURL(t),w:a,h:s};this.mirrorStickerThumb(i,p)}clearColoredStickerThumbs(){for(const e in this.stickerCachedThumbs){const[,t]=e.split("-");if(t&&isNaN(+t)){const a=this.stickerCachedThumbs[e];URL.revokeObjectURL(a.url),delete this.stickerCachedThumbs[e],this.mirrorStickerThumb(e)}}}}var gt={MTProto:{constructors:[{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:85337187,predicate:"resPQ",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"pq",type:"bytes"},{name:"server_public_key_fingerprints",type:"Vector<long>"}],type:"ResPQ"},{id:-1443537003,predicate:"p_q_inner_data_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"}],type:"P_Q_inner_data"},{id:1459478408,predicate:"p_q_inner_data_temp_dc",params:[{name:"pq",type:"bytes"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce",type:"int256"},{name:"dc",type:"int"},{name:"expires_in",type:"int"}],type:"P_Q_inner_data"},{id:-790100132,predicate:"server_DH_params_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_answer",type:"bytes"}],type:"Server_DH_Params"},{id:-1249309254,predicate:"server_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"g",type:"int"},{name:"dh_prime",type:"bytes"},{name:"g_a",type:"bytes"},{name:"server_time",type:"int"}],type:"Server_DH_inner_data"},{id:1715713620,predicate:"client_DH_inner_data",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"retry_id",type:"long"},{name:"g_b",type:"bytes"}],type:"Client_DH_Inner_Data"},{id:1003222836,predicate:"dh_gen_ok",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash1",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1188831161,predicate:"dh_gen_retry",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash2",type:"int128"}],type:"Set_client_DH_params_answer"},{id:-1499615742,predicate:"dh_gen_fail",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"new_nonce_hash3",type:"int128"}],type:"Set_client_DH_params_answer"},{id:1973679973,predicate:"bind_auth_key_inner",params:[{name:"nonce",type:"long"},{name:"temp_auth_key_id",type:"long"},{name:"perm_auth_key_id",type:"long"},{name:"temp_session_id",type:"long"},{name:"expires_at",type:"int"}],type:"BindAuthKeyInner"},{id:-212046591,predicate:"rpc_result",params:[{name:"req_msg_id",type:"long"},{name:"result",type:"Object"}],type:"RpcResult"},{id:558156313,predicate:"rpc_error",params:[{name:"error_code",type:"int"},{name:"error_message",type:"string"}],type:"RpcError"},{id:1579864942,predicate:"rpc_answer_unknown",params:[],type:"RpcDropAnswer"},{id:-847714938,predicate:"rpc_answer_dropped_running",params:[],type:"RpcDropAnswer"},{id:-1539647305,predicate:"rpc_answer_dropped",params:[{name:"msg_id",type:"long"},{name:"seq_no",type:"int"},{name:"bytes",type:"int"}],type:"RpcDropAnswer"},{id:155834844,predicate:"future_salt",params:[{name:"valid_since",type:"int"},{name:"valid_until",type:"int"},{name:"salt",type:"long"}],type:"FutureSalt"},{id:-1370486635,predicate:"future_salts",params:[{name:"req_msg_id",type:"long"},{name:"now",type:"int"},{name:"salts",type:"vector<future_salt>"}],type:"FutureSalts"},{id:880243653,predicate:"pong",params:[{name:"msg_id",type:"long"},{name:"ping_id",type:"long"}],type:"Pong"},{id:-501201412,predicate:"destroy_session_ok",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:1658015945,predicate:"destroy_session_none",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1631450872,predicate:"new_session_created",params:[{name:"first_msg_id",type:"long"},{name:"unique_id",type:"long"},{name:"server_salt",type:"long"}],type:"NewSession"},{id:1945237724,predicate:"msg_container",params:[{name:"messages",type:"vector<%Message>"}],type:"MessageContainer"},{id:1538843921,predicate:"message",params:[{name:"msg_id",type:"long"},{name:"seqno",type:"int"},{name:"bytes",type:"int"},{name:"body",type:"Object"}],type:"Message"},{id:-530561358,predicate:"msg_copy",params:[{name:"orig_message",type:"Message"}],type:"MessageCopy"},{id:812830625,predicate:"gzip_packed",params:[{name:"packed_data",type:"bytes"}],type:"Object"},{id:1658238041,predicate:"msgs_ack",params:[{name:"msg_ids",type:"Vector<long>"}],type:"MsgsAck"},{id:-1477445615,predicate:"bad_msg_notification",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"}],type:"BadMsgNotification"},{id:-307542917,predicate:"bad_server_salt",params:[{name:"bad_msg_id",type:"long"},{name:"bad_msg_seqno",type:"int"},{name:"error_code",type:"int"},{name:"new_server_salt",type:"long"}],type:"BadMsgNotification"},{id:2105940488,predicate:"msg_resend_req",params:[{name:"msg_ids",type:"Vector<long>"}],type:"MsgResendReq"},{id:-630588590,predicate:"msgs_state_req",params:[{name:"msg_ids",type:"Vector<long>"}],type:"MsgsStateReq"},{id:81704317,predicate:"msgs_state_info",params:[{name:"req_msg_id",type:"long"},{name:"info",type:"bytes"}],type:"MsgsStateInfo"},{id:-1933520591,predicate:"msgs_all_info",params:[{name:"msg_ids",type:"Vector<long>"},{name:"info",type:"bytes"}],type:"MsgsAllInfo"},{id:661470918,predicate:"msg_detailed_info",params:[{name:"msg_id",type:"long"},{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-2137147681,predicate:"msg_new_detailed_info",params:[{name:"answer_msg_id",type:"long"},{name:"bytes",type:"int"},{name:"status",type:"int"}],type:"MsgDetailedInfo"},{id:-161422892,predicate:"destroy_auth_key_ok",params:[],type:"DestroyAuthKeyRes"},{id:178201177,predicate:"destroy_auth_key_none",params:[],type:"DestroyAuthKeyRes"},{id:-368010477,predicate:"destroy_auth_key_fail",params:[],type:"DestroyAuthKeyRes"}],methods:[{id:-1099002127,method:"req_pq_multi",params:[{name:"nonce",type:"int128"}],type:"ResPQ"},{id:-686627650,method:"req_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"p",type:"bytes"},{name:"q",type:"bytes"},{name:"public_key_fingerprint",type:"long"},{name:"encrypted_data",type:"bytes"}],type:"Server_DH_Params"},{id:-184262881,method:"set_client_DH_params",params:[{name:"nonce",type:"int128"},{name:"server_nonce",type:"int128"},{name:"encrypted_data",type:"bytes"}],type:"Set_client_DH_params_answer"},{id:1491380032,method:"rpc_drop_answer",params:[{name:"req_msg_id",type:"long"}],type:"RpcDropAnswer"},{id:-1188971260,method:"get_future_salts",params:[{name:"num",type:"int"}],type:"FutureSalts"},{id:2059302892,method:"ping",params:[{name:"ping_id",type:"long"}],type:"Pong"},{id:-213746804,method:"ping_delay_disconnect",params:[{name:"ping_id",type:"long"},{name:"disconnect_delay",type:"int"}],type:"Pong"},{id:-414113498,method:"destroy_session",params:[{name:"session_id",type:"long"}],type:"DestroySessionRes"},{id:-1835453025,method:"http_wait",params:[{name:"max_delay",type:"int"},{name:"wait_after",type:"int"},{name:"max_wait",type:"int"}],type:"HttpWait"},{id:-784117408,method:"destroy_auth_key",params:[],type:"DestroyAuthKeyRes"}]},API:{constructors:[{id:-1132882121,predicate:"boolFalse",params:[],type:"Bool"},{id:-1720552011,predicate:"boolTrue",params:[],type:"Bool"},{id:1072550713,predicate:"true",params:[],type:"True"},{id:481674261,predicate:"vector",params:[],type:"Vector t"},{id:-994444869,predicate:"error",params:[{name:"code",type:"int"},{name:"text",type:"string"}],type:"Error"},{id:1450380236,predicate:"null",params:[],type:"Null"},{id:2134579434,predicate:"inputPeerEmpty",params:[],type:"InputPeer"},{id:2107670217,predicate:"inputPeerSelf",params:[],type:"InputPeer"},{id:900291769,predicate:"inputPeerChat",params:[{name:"chat_id",type:"long"}],type:"InputPeer"},{id:-1182234929,predicate:"inputUserEmpty",params:[],type:"InputUser"},{id:-138301121,predicate:"inputUserSelf",params:[],type:"InputUser"},{id:-208488460,predicate:"inputPhoneContact",params:[{name:"client_id",type:"long"},{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"InputContact"},{id:-181407105,predicate:"inputFile",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"},{name:"md5_checksum",type:"string"}],type:"InputFile"},{id:-1771768449,predicate:"inputMediaEmpty",params:[],type:"InputMedia"},{id:505969924,predicate:"inputMediaUploadedPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"file",type:"InputFile"},{name:"stickers",type:"flags.0?Vector<InputDocument>"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:-1279654347,predicate:"inputMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"id",type:"InputPhoto"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-104578748,predicate:"inputMediaGeoPoint",params:[{name:"geo_point",type:"InputGeoPoint"}],type:"InputMedia"},{id:-122978821,predicate:"inputMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"}],type:"InputMedia"},{id:480546647,predicate:"inputChatPhotoEmpty",params:[],type:"InputChatPhoto"},{id:-1110593856,predicate:"inputChatUploadedPhoto",params:[{name:"flags",type:"#"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.3?VideoSize"}],type:"InputChatPhoto"},{id:-1991004873,predicate:"inputChatPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputChatPhoto"},{id:-457104426,predicate:"inputGeoPointEmpty",params:[],type:"InputGeoPoint"},{id:1210199983,predicate:"inputGeoPoint",params:[{name:"flags",type:"#"},{name:"lat",type:"double"},{name:"long",type:"double"},{name:"accuracy_radius",type:"flags.0?int"}],type:"InputGeoPoint"},{id:483901197,predicate:"inputPhotoEmpty",params:[],type:"InputPhoto"},{id:1001634122,predicate:"inputPhoto",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputPhoto"},{id:-539317279,predicate:"inputFileLocation",params:[{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputFileLocation"},{id:1498486562,predicate:"peerUser",params:[{name:"user_id",type:"long"}],type:"Peer"},{id:918946202,predicate:"peerChat",params:[{name:"chat_id",type:"long"}],type:"Peer"},{id:-1432995067,predicate:"storage.fileUnknown",params:[],type:"storage.FileType"},{id:1086091090,predicate:"storage.filePartial",params:[],type:"storage.FileType"},{id:8322574,predicate:"storage.fileJpeg",params:[],type:"storage.FileType"},{id:-891180321,predicate:"storage.fileGif",params:[],type:"storage.FileType"},{id:172975040,predicate:"storage.filePng",params:[],type:"storage.FileType"},{id:-1373745011,predicate:"storage.filePdf",params:[],type:"storage.FileType"},{id:1384777335,predicate:"storage.fileMp3",params:[],type:"storage.FileType"},{id:1258941372,predicate:"storage.fileMov",params:[],type:"storage.FileType"},{id:-1278304028,predicate:"storage.fileMp4",params:[],type:"storage.FileType"},{id:276907596,predicate:"storage.fileWebp",params:[],type:"storage.FileType"},{id:-742634630,predicate:"userEmpty",params:[{name:"id",type:"long"}],type:"User"},{id:1326562017,predicate:"userProfilePhotoEmpty",params:[],type:"UserProfilePhoto"},{id:-2100168954,predicate:"userProfilePhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"personal",type:"flags.2?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"UserProfilePhoto"},{id:164646985,predicate:"userStatusEmpty",params:[],type:"UserStatus"},{id:-306628279,predicate:"userStatusOnline",params:[{name:"expires",type:"int"}],type:"UserStatus"},{id:9203775,predicate:"userStatusOffline",params:[{name:"was_online",type:"int"}],type:"UserStatus"},{id:693512293,predicate:"chatEmpty",params:[{name:"id",type:"long"}],type:"Chat"},{id:1103884886,predicate:"chat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"deactivated",type:"flags.5?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"noforwards",type:"flags.25?true"},{name:"id",type:"long"},{name:"title",type:"string"},{name:"photo",type:"ChatPhoto"},{name:"participants_count",type:"int"},{name:"date",type:"int"},{name:"version",type:"int"},{name:"migrated_to",type:"flags.6?InputChannel"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"}],type:"Chat"},{id:1704108455,predicate:"chatForbidden",params:[{name:"id",type:"long"},{name:"title",type:"string"}],type:"Chat"},{id:640893467,predicate:"chatFull",params:[{name:"flags",type:"#"},{name:"can_set_username",type:"flags.7?true"},{name:"has_scheduled",type:"flags.8?true"},{name:"translations_disabled",type:"flags.19?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants",type:"ChatParticipants"},{name:"chat_photo",type:"flags.2?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.13?ExportedChatInvite"},{name:"bot_info",type:"flags.3?Vector<BotInfo>"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"folder_id",type:"flags.11?int"},{name:"call",type:"flags.12?InputGroupCall"},{name:"ttl_period",type:"flags.14?int"},{name:"groupcall_default_join_as",type:"flags.15?Peer"},{name:"theme_emoticon",type:"flags.16?string"},{name:"requests_pending",type:"flags.17?int"},{name:"recent_requesters",type:"flags.17?Vector<long>"},{name:"available_reactions",type:"flags.18?ChatReactions"},{name:"reactions_limit",type:"flags.20?int"}],type:"ChatFull"},{id:-1070776313,predicate:"chatParticipant",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-2023500831,predicate:"chatParticipantsForbidden",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"self_participant",type:"flags.0?ChatParticipant"}],type:"ChatParticipants"},{id:1018991608,predicate:"chatParticipants",params:[{name:"chat_id",type:"long"},{name:"participants",type:"Vector<ChatParticipant>"},{name:"version",type:"int"}],type:"ChatParticipants"},{id:935395612,predicate:"chatPhotoEmpty",params:[],type:"ChatPhoto"},{id:476978193,predicate:"chatPhoto",params:[{name:"flags",type:"#"},{name:"has_video",type:"flags.0?true"},{name:"photo_id",type:"long"},{name:"stripped_thumb",type:"flags.1?bytes"},{name:"dc_id",type:"int"}],type:"ChatPhoto"},{id:-1868117372,predicate:"messageEmpty",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"peer_id",type:"flags.0?Peer"}],type:"Message"},{id:-1808510398,predicate:"message",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"from_scheduled",type:"flags.18?true"},{name:"legacy",type:"flags.19?true"},{name:"edit_hide",type:"flags.21?true"},{name:"pinned",type:"flags.24?true"},{name:"noforwards",type:"flags.26?true"},{name:"invert_media",type:"flags.27?true"},{name:"flags2",type:"#"},{name:"offline",type:"flags2.1?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"from_boosts_applied",type:"flags.29?int"},{name:"peer_id",type:"Peer"},{name:"saved_peer_id",type:"flags.28?Peer"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"via_business_bot_id",type:"flags2.0?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"message",type:"string"},{name:"media",type:"flags.9?MessageMedia"},{name:"reply_markup",type:"flags.6?ReplyMarkup"},{name:"entities",type:"flags.7?Vector<MessageEntity>"},{name:"views",type:"flags.10?int"},{name:"forwards",type:"flags.10?int"},{name:"replies",type:"flags.23?MessageReplies"},{name:"edit_date",type:"flags.15?int"},{name:"post_author",type:"flags.16?string"},{name:"grouped_id",type:"flags.17?long"},{name:"reactions",type:"flags.20?MessageReactions"},{name:"restriction_reason",type:"flags.22?Vector<RestrictionReason>"},{name:"ttl_period",type:"flags.25?int"},{name:"quick_reply_shortcut_id",type:"flags.30?int"},{name:"effect",type:"flags2.2?long"},{name:"factcheck",type:"flags2.3?FactCheck"}],type:"Message"},{id:721967202,predicate:"messageService",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"post",type:"flags.14?true"},{name:"legacy",type:"flags.19?true"},{name:"id",type:"int"},{name:"from_id",type:"flags.8?Peer"},{name:"peer_id",type:"Peer"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"date",type:"int"},{name:"action",type:"MessageAction"},{name:"ttl_period",type:"flags.25?int"}],type:"Message"},{id:1038967584,predicate:"messageMediaEmpty",params:[],type:"MessageMedia"},{id:1766936791,predicate:"messageMediaPhoto",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.3?true"},{name:"photo",type:"flags.0?Photo"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1457575028,predicate:"messageMediaGeo",params:[{name:"geo",type:"GeoPoint"}],type:"MessageMedia"},{id:1882335561,predicate:"messageMediaContact",params:[{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"user_id",type:"long"}],type:"MessageMedia"},{id:-1618676578,predicate:"messageMediaUnsupported",params:[],type:"MessageMedia"},{id:-1230047312,predicate:"messageActionEmpty",params:[],type:"MessageAction"},{id:-1119368275,predicate:"messageActionChatCreate",params:[{name:"title",type:"string"},{name:"users",type:"Vector<long>"}],type:"MessageAction"},{id:-1247687078,predicate:"messageActionChatEditTitle",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:2144015272,predicate:"messageActionChatEditPhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:-1780220945,predicate:"messageActionChatDeletePhoto",params:[],type:"MessageAction"},{id:365886720,predicate:"messageActionChatAddUser",params:[{name:"users",type:"Vector<long>"}],type:"MessageAction"},{id:-1539362612,predicate:"messageActionChatDeleteUser",params:[{name:"user_id",type:"long"}],type:"MessageAction"},{id:-712374074,predicate:"dialog",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"unread_mark",type:"flags.3?true"},{name:"view_forum_as_messages",type:"flags.6?true"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"pts",type:"flags.0?int"},{name:"draft",type:"flags.1?DraftMessage"},{name:"folder_id",type:"flags.4?int"},{name:"ttl_period",type:"flags.5?int"}],type:"Dialog"},{id:590459437,predicate:"photoEmpty",params:[{name:"id",type:"long"}],type:"Photo"},{id:-82216347,predicate:"photo",params:[{name:"flags",type:"#"},{name:"has_stickers",type:"flags.0?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"sizes",type:"Vector<PhotoSize>"},{name:"video_sizes",type:"flags.1?Vector<VideoSize>"},{name:"dc_id",type:"int"}],type:"Photo"},{id:236446268,predicate:"photoSizeEmpty",params:[{name:"type",type:"string"}],type:"PhotoSize"},{id:1976012384,predicate:"photoSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"}],type:"PhotoSize"},{id:35527382,predicate:"photoCachedSize",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:286776671,predicate:"geoPointEmpty",params:[],type:"GeoPoint"},{id:-1297942941,predicate:"geoPoint",params:[{name:"flags",type:"#"},{name:"long",type:"double"},{name:"lat",type:"double"},{name:"access_hash",type:"long"},{name:"accuracy_radius",type:"flags.0?int"}],type:"GeoPoint"},{id:1577067778,predicate:"auth.sentCode",params:[{name:"flags",type:"#"},{name:"type",type:"auth.SentCodeType"},{name:"phone_code_hash",type:"string"},{name:"next_type",type:"flags.1?auth.CodeType"},{name:"timeout",type:"flags.2?int"}],type:"auth.SentCode"},{id:782418132,predicate:"auth.authorization",params:[{name:"flags",type:"#"},{name:"setup_password_required",type:"flags.1?true"},{name:"otherwise_relogin_days",type:"flags.1?int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"future_auth_token",type:"flags.2?bytes"},{name:"user",type:"User"}],type:"auth.Authorization"},{id:-1271602504,predicate:"auth.exportedAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.ExportedAuthorization"},{id:-1195615476,predicate:"inputNotifyPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputNotifyPeer"},{id:423314455,predicate:"inputNotifyUsers",params:[],type:"InputNotifyPeer"},{id:1251338318,predicate:"inputNotifyChats",params:[],type:"InputNotifyPeer"},{id:-892638494,predicate:"inputPeerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"sound",type:"flags.3?NotificationSound"},{name:"stories_muted",type:"flags.6?Bool"},{name:"stories_hide_sender",type:"flags.7?Bool"},{name:"stories_sound",type:"flags.8?NotificationSound"}],type:"InputPeerNotifySettings"},{id:-1721619444,predicate:"peerNotifySettings",params:[{name:"flags",type:"#"},{name:"show_previews",type:"flags.0?Bool"},{name:"silent",type:"flags.1?Bool"},{name:"mute_until",type:"flags.2?int"},{name:"ios_sound",type:"flags.3?NotificationSound"},{name:"android_sound",type:"flags.4?NotificationSound"},{name:"other_sound",type:"flags.5?NotificationSound"},{name:"stories_muted",type:"flags.6?Bool"},{name:"stories_hide_sender",type:"flags.7?Bool"},{name:"stories_ios_sound",type:"flags.8?NotificationSound"},{name:"stories_android_sound",type:"flags.9?NotificationSound"},{name:"stories_other_sound",type:"flags.10?NotificationSound"}],type:"PeerNotifySettings"},{id:-1395233698,predicate:"peerSettings",params:[{name:"flags",type:"#"},{name:"report_spam",type:"flags.0?true"},{name:"add_contact",type:"flags.1?true"},{name:"block_contact",type:"flags.2?true"},{name:"share_contact",type:"flags.3?true"},{name:"need_contacts_exception",type:"flags.4?true"},{name:"report_geo",type:"flags.5?true"},{name:"autoarchived",type:"flags.7?true"},{name:"invite_members",type:"flags.8?true"},{name:"request_chat_broadcast",type:"flags.10?true"},{name:"business_bot_paused",type:"flags.11?true"},{name:"business_bot_can_reply",type:"flags.12?true"},{name:"geo_distance",type:"flags.6?int"},{name:"request_chat_title",type:"flags.9?string"},{name:"request_chat_date",type:"flags.9?int"},{name:"business_bot_id",type:"flags.13?long"},{name:"business_bot_manage_url",type:"flags.13?string"}],type:"PeerSettings"},{id:-1539849235,predicate:"wallPaper",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"pattern",type:"flags.3?true"},{name:"dark",type:"flags.4?true"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"document",type:"Document"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:1490799288,predicate:"inputReportReasonSpam",params:[],type:"ReportReason"},{id:505595789,predicate:"inputReportReasonViolence",params:[],type:"ReportReason"},{id:777640226,predicate:"inputReportReasonPornography",params:[],type:"ReportReason"},{id:-1376497949,predicate:"inputReportReasonChildAbuse",params:[],type:"ReportReason"},{id:-1041980751,predicate:"inputReportReasonOther",params:[],type:"ReportReason"},{id:-862357728,predicate:"userFull",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"phone_calls_available",type:"flags.4?true"},{name:"phone_calls_private",type:"flags.5?true"},{name:"can_pin_message",type:"flags.7?true"},{name:"has_scheduled",type:"flags.12?true"},{name:"video_calls_available",type:"flags.13?true"},{name:"voice_messages_forbidden",type:"flags.20?true"},{name:"translations_disabled",type:"flags.23?true"},{name:"stories_pinned_available",type:"flags.26?true"},{name:"blocked_my_stories_from",type:"flags.27?true"},{name:"wallpaper_overridden",type:"flags.28?true"},{name:"contact_require_premium",type:"flags.29?true"},{name:"read_dates_private",type:"flags.30?true"},{name:"flags2",type:"#"},{name:"sponsored_enabled",type:"flags2.7?true"},{name:"id",type:"long"},{name:"about",type:"flags.1?string"},{name:"settings",type:"PeerSettings"},{name:"personal_photo",type:"flags.21?Photo"},{name:"profile_photo",type:"flags.2?Photo"},{name:"fallback_photo",type:"flags.22?Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"bot_info",type:"flags.3?BotInfo"},{name:"pinned_msg_id",type:"flags.6?int"},{name:"common_chats_count",type:"int"},{name:"folder_id",type:"flags.11?int"},{name:"ttl_period",type:"flags.14?int"},{name:"theme_emoticon",type:"flags.15?string"},{name:"private_forward_name",type:"flags.16?string"},{name:"bot_group_admin_rights",type:"flags.17?ChatAdminRights"},{name:"bot_broadcast_admin_rights",type:"flags.18?ChatAdminRights"},{name:"premium_gifts",type:"flags.19?Vector<PremiumGiftOption>"},{name:"wallpaper",type:"flags.24?WallPaper"},{name:"stories",type:"flags.25?PeerStories"},{name:"business_work_hours",type:"flags2.0?BusinessWorkHours"},{name:"business_location",type:"flags2.1?BusinessLocation"},{name:"business_greeting_message",type:"flags2.2?BusinessGreetingMessage"},{name:"business_away_message",type:"flags2.3?BusinessAwayMessage"},{name:"business_intro",type:"flags2.4?BusinessIntro"},{name:"birthday",type:"flags2.5?Birthday"},{name:"personal_channel_id",type:"flags2.6?long"},{name:"personal_channel_message",type:"flags2.6?int"}],type:"UserFull"},{id:341499403,predicate:"contact",params:[{name:"user_id",type:"long"},{name:"mutual",type:"Bool"}],type:"Contact"},{id:-1052885936,predicate:"importedContact",params:[{name:"user_id",type:"long"},{name:"client_id",type:"long"}],type:"ImportedContact"},{id:383348795,predicate:"contactStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"ContactStatus"},{id:-1219778094,predicate:"contacts.contactsNotModified",params:[],type:"contacts.Contacts"},{id:-353862078,predicate:"contacts.contacts",params:[{name:"contacts",type:"Vector<Contact>"},{name:"saved_count",type:"int"},{name:"users",type:"Vector<User>"}],type:"contacts.Contacts"},{id:2010127419,predicate:"contacts.importedContacts",params:[{name:"imported",type:"Vector<ImportedContact>"},{name:"popular_invites",type:"Vector<PopularContact>"},{name:"retry_contacts",type:"Vector<long>"},{name:"users",type:"Vector<User>"}],type:"contacts.ImportedContacts"},{id:182326673,predicate:"contacts.blocked",params:[{name:"blocked",type:"Vector<PeerBlocked>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"contacts.Blocked"},{id:-513392236,predicate:"contacts.blockedSlice",params:[{name:"count",type:"int"},{name:"blocked",type:"Vector<PeerBlocked>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"contacts.Blocked"},{id:364538944,predicate:"messages.dialogs",params:[{name:"dialogs",type:"Vector<Dialog>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.Dialogs"},{id:1910543603,predicate:"messages.dialogsSlice",params:[{name:"count",type:"int"},{name:"dialogs",type:"Vector<Dialog>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.Dialogs"},{id:-1938715001,predicate:"messages.messages",params:[{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.Messages"},{id:978610270,predicate:"messages.messagesSlice",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"count",type:"int"},{name:"next_rate",type:"flags.0?int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.Messages"},{id:1694474197,predicate:"messages.chats",params:[{name:"chats",type:"Vector<Chat>"}],type:"messages.Chats"},{id:-438840932,predicate:"messages.chatFull",params:[{name:"full_chat",type:"ChatFull"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.ChatFull"},{id:-1269012015,predicate:"messages.affectedHistory",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"}],type:"messages.AffectedHistory"},{id:1474492012,predicate:"inputMessagesFilterEmpty",params:[],type:"MessagesFilter"},{id:-1777752804,predicate:"inputMessagesFilterPhotos",params:[],type:"MessagesFilter"},{id:-1614803355,predicate:"inputMessagesFilterVideo",params:[],type:"MessagesFilter"},{id:1458172132,predicate:"inputMessagesFilterPhotoVideo",params:[],type:"MessagesFilter"},{id:-1629621880,predicate:"inputMessagesFilterDocument",params:[],type:"MessagesFilter"},{id:2129714567,predicate:"inputMessagesFilterUrl",params:[],type:"MessagesFilter"},{id:-3644025,predicate:"inputMessagesFilterGif",params:[],type:"MessagesFilter"},{id:522914557,predicate:"updateNewMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1318109142,predicate:"updateMessageID",params:[{name:"id",type:"int"},{name:"random_id",type:"long"}],type:"Update"},{id:-1576161051,predicate:"updateDeleteMessages",params:[{name:"messages",type:"Vector<int>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1071741569,predicate:"updateUserTyping",params:[{name:"user_id",type:"long"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-2092401936,predicate:"updateChatUserTyping",params:[{name:"chat_id",type:"long"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:125178264,predicate:"updateChatParticipants",params:[{name:"participants",type:"ChatParticipants"}],type:"Update"},{id:-440534818,predicate:"updateUserStatus",params:[{name:"user_id",type:"long"},{name:"status",type:"UserStatus"}],type:"Update"},{id:-1484486364,predicate:"updateUserName",params:[{name:"user_id",type:"long"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"usernames",type:"Vector<Username>"}],type:"Update"},{id:-1991136273,predicate:"updateNewAuthorization",params:[{name:"flags",type:"#"},{name:"unconfirmed",type:"flags.0?true"},{name:"hash",type:"long"},{name:"date",type:"flags.0?int"},{name:"device",type:"flags.0?string"},{name:"location",type:"flags.0?string"}],type:"Update"},{id:-1519637954,predicate:"updates.state",params:[{name:"pts",type:"int"},{name:"qts",type:"int"},{name:"date",type:"int"},{name:"seq",type:"int"},{name:"unread_count",type:"int"}],type:"updates.State"},{id:1567990072,predicate:"updates.differenceEmpty",params:[{name:"date",type:"int"},{name:"seq",type:"int"}],type:"updates.Difference"},{id:16030880,predicate:"updates.difference",params:[{name:"new_messages",type:"Vector<Message>"},{name:"new_encrypted_messages",type:"Vector<EncryptedMessage>"},{name:"other_updates",type:"Vector<Update>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"state",type:"updates.State"}],type:"updates.Difference"},{id:-1459938943,predicate:"updates.differenceSlice",params:[{name:"new_messages",type:"Vector<Message>"},{name:"new_encrypted_messages",type:"Vector<EncryptedMessage>"},{name:"other_updates",type:"Vector<Update>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"intermediate_state",type:"updates.State"}],type:"updates.Difference"},{id:-484987010,predicate:"updatesTooLong",params:[],type:"Updates"},{id:826001400,predicate:"updateShortMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"user_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector<MessageEntity>"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:1299050149,predicate:"updateShortChatMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"mentioned",type:"flags.4?true"},{name:"media_unread",type:"flags.5?true"},{name:"silent",type:"flags.13?true"},{name:"id",type:"int"},{name:"from_id",type:"long"},{name:"chat_id",type:"long"},{name:"message",type:"string"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"fwd_from",type:"flags.2?MessageFwdHeader"},{name:"via_bot_id",type:"flags.11?long"},{name:"reply_to",type:"flags.3?MessageReplyHeader"},{name:"entities",type:"flags.7?Vector<MessageEntity>"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:2027216577,predicate:"updateShort",params:[{name:"update",type:"Update"},{name:"date",type:"int"}],type:"Updates"},{id:1918567619,predicate:"updatesCombined",params:[{name:"updates",type:"Vector<Update>"},{name:"users",type:"Vector<User>"},{name:"chats",type:"Vector<Chat>"},{name:"date",type:"int"},{name:"seq_start",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:1957577280,predicate:"updates",params:[{name:"updates",type:"Vector<Update>"},{name:"users",type:"Vector<User>"},{name:"chats",type:"Vector<Chat>"},{name:"date",type:"int"},{name:"seq",type:"int"}],type:"Updates"},{id:-1916114267,predicate:"photos.photos",params:[{name:"photos",type:"Vector<Photo>"},{name:"users",type:"Vector<User>"}],type:"photos.Photos"},{id:352657236,predicate:"photos.photosSlice",params:[{name:"count",type:"int"},{name:"photos",type:"Vector<Photo>"},{name:"users",type:"Vector<User>"}],type:"photos.Photos"},{id:539045032,predicate:"photos.photo",params:[{name:"photo",type:"Photo"},{name:"users",type:"Vector<User>"}],type:"photos.Photo"},{id:157948117,predicate:"upload.file",params:[{name:"type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.File"},{id:414687501,predicate:"dcOption",params:[{name:"flags",type:"#"},{name:"ipv6",type:"flags.0?true"},{name:"media_only",type:"flags.1?true"},{name:"tcpo_only",type:"flags.2?true"},{name:"cdn",type:"flags.3?true"},{name:"static",type:"flags.4?true"},{name:"this_port_only",type:"flags.5?true"},{name:"id",type:"int"},{name:"ip_address",type:"string"},{name:"port",type:"int"},{name:"secret",type:"flags.10?bytes"}],type:"DcOption"},{id:-870702050,predicate:"config",params:[{name:"flags",type:"#"},{name:"default_p2p_contacts",type:"flags.3?true"},{name:"preload_featured_stickers",type:"flags.4?true"},{name:"revoke_pm_inbox",type:"flags.6?true"},{name:"blocked_mode",type:"flags.8?true"},{name:"force_try_ipv6",type:"flags.14?true"},{name:"date",type:"int"},{name:"expires",type:"int"},{name:"test_mode",type:"Bool"},{name:"this_dc",type:"int"},{name:"dc_options",type:"Vector<DcOption>"},{name:"dc_txt_domain_name",type:"string"},{name:"chat_size_max",type:"int"},{name:"megagroup_size_max",type:"int"},{name:"forwarded_count_max",type:"int"},{name:"online_update_period_ms",type:"int"},{name:"offline_blur_timeout_ms",type:"int"},{name:"offline_idle_timeout_ms",type:"int"},{name:"online_cloud_timeout_ms",type:"int"},{name:"notify_cloud_delay_ms",type:"int"},{name:"notify_default_delay_ms",type:"int"},{name:"push_chat_period_ms",type:"int"},{name:"push_chat_limit",type:"int"},{name:"edit_time_limit",type:"int"},{name:"revoke_time_limit",type:"int"},{name:"revoke_pm_time_limit",type:"int"},{name:"rating_e_decay",type:"int"},{name:"stickers_recent_limit",type:"int"},{name:"channels_read_media_period",type:"int"},{name:"tmp_sessions",type:"flags.0?int"},{name:"call_receive_timeout_ms",type:"int"},{name:"call_ring_timeout_ms",type:"int"},{name:"call_connect_timeout_ms",type:"int"},{name:"call_packet_timeout_ms",type:"int"},{name:"me_url_prefix",type:"string"},{name:"autoupdate_url_prefix",type:"flags.7?string"},{name:"gif_search_username",type:"flags.9?string"},{name:"venue_search_username",type:"flags.10?string"},{name:"img_search_username",type:"flags.11?string"},{name:"static_maps_provider",type:"flags.12?string"},{name:"caption_length_max",type:"int"},{name:"message_length_max",type:"int"},{name:"webfile_dc_id",type:"int"},{name:"suggested_lang_code",type:"flags.2?string"},{name:"lang_pack_version",type:"flags.2?int"},{name:"base_lang_pack_version",type:"flags.2?int"},{name:"reactions_default",type:"flags.15?Reaction"},{name:"autologin_token",type:"flags.16?string"}],type:"Config"},{id:-1910892683,predicate:"nearestDc",params:[{name:"country",type:"string"},{name:"this_dc",type:"int"},{name:"nearest_dc",type:"int"}],type:"NearestDc"},{id:-860107216,predicate:"help.appUpdate",params:[{name:"flags",type:"#"},{name:"can_not_skip",type:"flags.0?true"},{name:"id",type:"int"},{name:"version",type:"string"},{name:"text",type:"string"},{name:"entities",type:"Vector<MessageEntity>"},{name:"document",type:"flags.1?Document"},{name:"url",type:"flags.2?string"},{name:"sticker",type:"flags.3?Document"}],type:"help.AppUpdate"},{id:-1000708810,predicate:"help.noAppUpdate",params:[],type:"help.AppUpdate"},{id:415997816,predicate:"help.inviteText",params:[{name:"message",type:"string"}],type:"help.InviteText"},{id:314359194,predicate:"updateNewEncryptedMessage",params:[{name:"message",type:"EncryptedMessage"},{name:"qts",type:"int"}],type:"Update"},{id:386986326,predicate:"updateEncryptedChatTyping",params:[{name:"chat_id",type:"int"}],type:"Update"},{id:-1264392051,predicate:"updateEncryption",params:[{name:"chat",type:"EncryptedChat"},{name:"date",type:"int"}],type:"Update"},{id:956179895,predicate:"updateEncryptedMessagesRead",params:[{name:"chat_id",type:"int"},{name:"max_date",type:"int"},{name:"date",type:"int"}],type:"Update"},{id:-1417756512,predicate:"encryptedChatEmpty",params:[{name:"id",type:"int"}],type:"EncryptedChat"},{id:1722964307,predicate:"encryptedChatWaiting",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"}],type:"EncryptedChat"},{id:1223809356,predicate:"encryptedChatRequested",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1643173063,predicate:"encryptedChat",params:[{name:"id",type:"int"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:505183301,predicate:"encryptedChatDiscarded",params:[{name:"flags",type:"#"},{name:"history_deleted",type:"flags.0?true"},{name:"id",type:"int"}],type:"EncryptedChat"},{id:-247351839,predicate:"inputEncryptedChat",params:[{name:"chat_id",type:"int"},{name:"access_hash",type:"long"}],type:"InputEncryptedChat"},{id:-1038136962,predicate:"encryptedFileEmpty",params:[],type:"EncryptedFile"},{id:-1476358952,predicate:"encryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"key_fingerprint",type:"int"}],type:"EncryptedFile"},{id:406307684,predicate:"inputEncryptedFileEmpty",params:[],type:"InputEncryptedFile"},{id:1690108678,predicate:"inputEncryptedFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1511503333,predicate:"inputEncryptedFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputEncryptedFile"},{id:-182231723,predicate:"inputEncryptedFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:-317144808,predicate:"encryptedMessage",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"},{name:"file",type:"EncryptedFile"}],type:"EncryptedMessage"},{id:594758406,predicate:"encryptedMessageService",params:[{name:"random_id",type:"long"},{name:"chat_id",type:"int"},{name:"date",type:"int"},{name:"bytes",type:"bytes"}],type:"EncryptedMessage"},{id:-1058912715,predicate:"messages.dhConfigNotModified",params:[{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:740433629,predicate:"messages.dhConfig",params:[{name:"g",type:"int"},{name:"p",type:"bytes"},{name:"version",type:"int"},{name:"random",type:"bytes"}],type:"messages.DhConfig"},{id:1443858741,predicate:"messages.sentEncryptedMessage",params:[{name:"date",type:"int"}],type:"messages.SentEncryptedMessage"},{id:-1802240206,predicate:"messages.sentEncryptedFile",params:[{name:"date",type:"int"},{name:"file",type:"EncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:-95482955,predicate:"inputFileBig",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"name",type:"string"}],type:"InputFile"},{id:767652808,predicate:"inputEncryptedFileBigUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"key_fingerprint",type:"int"}],type:"InputEncryptedFile"},{id:1037718609,predicate:"updateChatParticipantAdd",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"},{name:"version",type:"int"}],type:"Update"},{id:-483443337,predicate:"updateChatParticipantDelete",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"version",type:"int"}],type:"Update"},{id:-1906403213,predicate:"updateDcOptions",params:[{name:"dc_options",type:"Vector<DcOption>"}],type:"Update"},{id:1530447553,predicate:"inputMediaUploadedDocument",params:[{name:"flags",type:"#"},{name:"nosound_video",type:"flags.3?true"},{name:"force_file",type:"flags.4?true"},{name:"spoiler",type:"flags.5?true"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.2?InputFile"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector<DocumentAttribute>"},{name:"stickers",type:"flags.0?Vector<InputDocument>"},{name:"ttl_seconds",type:"flags.1?int"}],type:"InputMedia"},{id:860303448,predicate:"inputMediaDocument",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.2?true"},{name:"id",type:"InputDocument"},{name:"ttl_seconds",type:"flags.0?int"},{name:"query",type:"flags.1?string"}],type:"InputMedia"},{id:1291114285,predicate:"messageMediaDocument",params:[{name:"flags",type:"#"},{name:"nopremium",type:"flags.3?true"},{name:"spoiler",type:"flags.4?true"},{name:"video",type:"flags.6?true"},{name:"round",type:"flags.7?true"},{name:"voice",type:"flags.8?true"},{name:"document",type:"flags.0?Document"},{name:"alt_document",type:"flags.5?Document"},{name:"ttl_seconds",type:"flags.2?int"}],type:"MessageMedia"},{id:1928391342,predicate:"inputDocumentEmpty",params:[],type:"InputDocument"},{id:448771445,predicate:"inputDocument",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"}],type:"InputDocument"},{id:-1160743548,predicate:"inputDocumentFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:922273905,predicate:"documentEmpty",params:[{name:"id",type:"long"}],type:"Document"},{id:-1881881384,predicate:"document",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"date",type:"int"},{name:"mime_type",type:"string"},{name:"size",type:"long"},{name:"thumbs",type:"flags.0?Vector<PhotoSize>"},{name:"video_thumbs",type:"flags.1?Vector<VideoSize>"},{name:"dc_id",type:"int"},{name:"attributes",type:"Vector<DocumentAttribute>"}],type:"Document"},{id:398898678,predicate:"help.support",params:[{name:"phone_number",type:"string"},{name:"user",type:"User"}],type:"help.Support"},{id:-1613493288,predicate:"notifyPeer",params:[{name:"peer",type:"Peer"}],type:"NotifyPeer"},{id:-1261946036,predicate:"notifyUsers",params:[],type:"NotifyPeer"},{id:-1073230141,predicate:"notifyChats",params:[],type:"NotifyPeer"},{id:-1094555409,predicate:"updateNotifySettings",params:[{name:"peer",type:"NotifyPeer"},{name:"notify_settings",type:"PeerNotifySettings"}],type:"Update"},{id:381645902,predicate:"sendMessageTypingAction",params:[],type:"SendMessageAction"},{id:-44119819,predicate:"sendMessageCancelAction",params:[],type:"SendMessageAction"},{id:-1584933265,predicate:"sendMessageRecordVideoAction",params:[],type:"SendMessageAction"},{id:-378127636,predicate:"sendMessageUploadVideoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-718310409,predicate:"sendMessageRecordAudioAction",params:[],type:"SendMessageAction"},{id:-212740181,predicate:"sendMessageUploadAudioAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-774682074,predicate:"sendMessageUploadPhotoAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-1441998364,predicate:"sendMessageUploadDocumentAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:393186209,predicate:"sendMessageGeoLocationAction",params:[],type:"SendMessageAction"},{id:1653390447,predicate:"sendMessageChooseContactAction",params:[],type:"SendMessageAction"},{id:-1290580579,predicate:"contacts.found",params:[{name:"my_results",type:"Vector<Peer>"},{name:"results",type:"Vector<Peer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"contacts.Found"},{id:-337352679,predicate:"updateServiceNotification",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"invert_media",type:"flags.2?true"},{name:"inbox_date",type:"flags.1?int"},{name:"type",type:"string"},{name:"message",type:"string"},{name:"media",type:"MessageMedia"},{name:"entities",type:"Vector<MessageEntity>"}],type:"Update"},{id:2065268168,predicate:"userStatusRecently",params:[{name:"flags",type:"#"},{name:"by_me",type:"flags.0?true"}],type:"UserStatus"},{id:1410997530,predicate:"userStatusLastWeek",params:[{name:"flags",type:"#"},{name:"by_me",type:"flags.0?true"}],type:"UserStatus"},{id:1703516023,predicate:"userStatusLastMonth",params:[{name:"flags",type:"#"},{name:"by_me",type:"flags.0?true"}],type:"UserStatus"},{id:-298113238,predicate:"updatePrivacy",params:[{name:"key",type:"PrivacyKey"},{name:"rules",type:"Vector<PrivacyRule>"}],type:"Update"},{id:1335282456,predicate:"inputPrivacyKeyStatusTimestamp",params:[],type:"InputPrivacyKey"},{id:-1137792208,predicate:"privacyKeyStatusTimestamp",params:[],type:"PrivacyKey"},{id:218751099,predicate:"inputPrivacyValueAllowContacts",params:[],type:"InputPrivacyRule"},{id:407582158,predicate:"inputPrivacyValueAllowAll",params:[],type:"InputPrivacyRule"},{id:320652927,predicate:"inputPrivacyValueAllowUsers",params:[{name:"users",type:"Vector<InputUser>"}],type:"InputPrivacyRule"},{id:195371015,predicate:"inputPrivacyValueDisallowContacts",params:[],type:"InputPrivacyRule"},{id:-697604407,predicate:"inputPrivacyValueDisallowAll",params:[],type:"InputPrivacyRule"},{id:-1877932953,predicate:"inputPrivacyValueDisallowUsers",params:[{name:"users",type:"Vector<InputUser>"}],type:"InputPrivacyRule"},{id:-123988,predicate:"privacyValueAllowContacts",params:[],type:"PrivacyRule"},{id:1698855810,predicate:"privacyValueAllowAll",params:[],type:"PrivacyRule"},{id:-1198497870,predicate:"privacyValueAllowUsers",params:[{name:"users",type:"Vector<long>"}],type:"PrivacyRule"},{id:-125240806,predicate:"privacyValueDisallowContacts",params:[],type:"PrivacyRule"},{id:-1955338397,predicate:"privacyValueDisallowAll",params:[],type:"PrivacyRule"},{id:-463335103,predicate:"privacyValueDisallowUsers",params:[{name:"users",type:"Vector<long>"}],type:"PrivacyRule"},{id:1352683077,predicate:"account.privacyRules",params:[{name:"rules",type:"Vector<PrivacyRule>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"account.PrivacyRules"},{id:-1194283041,predicate:"accountDaysTTL",params:[{name:"days",type:"int"}],type:"AccountDaysTTL"},{id:88680979,predicate:"updateUserPhone",params:[{name:"user_id",type:"long"},{name:"phone",type:"string"}],type:"Update"},{id:1815593308,predicate:"documentAttributeImageSize",params:[{name:"w",type:"int"},{name:"h",type:"int"}],type:"DocumentAttribute"},{id:297109817,predicate:"documentAttributeAnimated",params:[],type:"DocumentAttribute"},{id:1662637586,predicate:"documentAttributeSticker",params:[{name:"flags",type:"#"},{name:"mask",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"},{name:"mask_coords",type:"flags.0?MaskCoords"}],type:"DocumentAttribute"},{id:-745541182,predicate:"documentAttributeVideo",params:[{name:"flags",type:"#"},{name:"round_message",type:"flags.0?true"},{name:"supports_streaming",type:"flags.1?true"},{name:"nosound",type:"flags.3?true"},{name:"duration",type:"double"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"preload_prefix_size",type:"flags.2?int"}],type:"DocumentAttribute"},{id:-1739392570,predicate:"documentAttributeAudio",params:[{name:"flags",type:"#"},{name:"voice",type:"flags.10?true"},{name:"duration",type:"int"},{name:"title",type:"flags.0?string"},{name:"performer",type:"flags.1?string"},{name:"waveform",type:"flags.2?bytes"}],type:"DocumentAttribute"},{id:358154344,predicate:"documentAttributeFilename",params:[{name:"file_name",type:"string"}],type:"DocumentAttribute"},{id:-244016606,predicate:"messages.stickersNotModified",params:[],type:"messages.Stickers"},{id:816245886,predicate:"messages.stickers",params:[{name:"hash",type:"long"},{name:"stickers",type:"Vector<Document>"}],type:"messages.Stickers"},{id:313694676,predicate:"stickerPack",params:[{name:"emoticon",type:"string"},{name:"documents",type:"Vector<long>"}],type:"StickerPack"},{id:-395967805,predicate:"messages.allStickersNotModified",params:[],type:"messages.AllStickers"},{id:-843329861,predicate:"messages.allStickers",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector<StickerSet>"}],type:"messages.AllStickers"},{id:-1667805217,predicate:"updateReadHistoryInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:791617983,predicate:"updateReadHistoryOutbox",params:[{name:"peer",type:"Peer"},{name:"max_id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-2066640507,predicate:"messages.affectedMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"messages.AffectedMessages"},{id:2139689491,predicate:"updateWebPage",params:[{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:555358088,predicate:"webPageEmpty",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"url",type:"flags.0?string"}],type:"WebPage"},{id:-1328464313,predicate:"webPagePending",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"url",type:"flags.0?string"},{name:"date",type:"int"}],type:"WebPage"},{id:-392411726,predicate:"webPage",params:[{name:"flags",type:"#"},{name:"has_large_media",type:"flags.13?true"},{name:"id",type:"long"},{name:"url",type:"string"},{name:"display_url",type:"string"},{name:"hash",type:"int"},{name:"type",type:"flags.0?string"},{name:"site_name",type:"flags.1?string"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"photo",type:"flags.4?Photo"},{name:"embed_url",type:"flags.5?string"},{name:"embed_type",type:"flags.5?string"},{name:"embed_width",type:"flags.6?int"},{name:"embed_height",type:"flags.6?int"},{name:"duration",type:"flags.7?int"},{name:"author",type:"flags.8?string"},{name:"document",type:"flags.9?Document"},{name:"cached_page",type:"flags.10?Page"},{name:"attributes",type:"flags.12?Vector<WebPageAttribute>"}],type:"WebPage"},{id:-571405253,predicate:"messageMediaWebPage",params:[{name:"flags",type:"#"},{name:"force_large_media",type:"flags.0?true"},{name:"force_small_media",type:"flags.1?true"},{name:"manual",type:"flags.3?true"},{name:"safe",type:"flags.4?true"},{name:"webpage",type:"WebPage"}],type:"MessageMedia"},{id:-1392388579,predicate:"authorization",params:[{name:"flags",type:"#"},{name:"current",type:"flags.0?true"},{name:"official_app",type:"flags.1?true"},{name:"password_pending",type:"flags.2?true"},{name:"encrypted_requests_disabled",type:"flags.3?true"},{name:"call_requests_disabled",type:"flags.4?true"},{name:"unconfirmed",type:"flags.5?true"},{name:"hash",type:"long"},{name:"device_model",type:"string"},{name:"platform",type:"string"},{name:"system_version",type:"string"},{name:"api_id",type:"int"},{name:"app_name",type:"string"},{name:"app_version",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"country",type:"string"},{name:"region",type:"string"}],type:"Authorization"},{id:1275039392,predicate:"account.authorizations",params:[{name:"authorization_ttl_days",type:"int"},{name:"authorizations",type:"Vector<Authorization>"}],type:"account.Authorizations"},{id:-1787080453,predicate:"account.password",params:[{name:"flags",type:"#"},{name:"has_recovery",type:"flags.0?true"},{name:"has_secure_values",type:"flags.1?true"},{name:"has_password",type:"flags.2?true"},{name:"current_algo",type:"flags.2?PasswordKdfAlgo"},{name:"srp_B",type:"flags.2?bytes"},{name:"srp_id",type:"flags.2?long"},{name:"hint",type:"flags.3?string"},{name:"email_unconfirmed_pattern",type:"flags.4?string"},{name:"new_algo",type:"PasswordKdfAlgo"},{name:"new_secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_random",type:"bytes"},{name:"pending_reset_date",type:"flags.5?int"},{name:"login_email_pattern",type:"flags.6?string"}],type:"account.Password"},{id:-1705233435,predicate:"account.passwordSettings",params:[{name:"flags",type:"#"},{name:"email",type:"flags.0?string"},{name:"secure_settings",type:"flags.1?SecureSecretSettings"}],type:"account.PasswordSettings"},{id:-1036572727,predicate:"account.passwordInputSettings",params:[{name:"flags",type:"#"},{name:"new_algo",type:"flags.0?PasswordKdfAlgo"},{name:"new_password_hash",type:"flags.0?bytes"},{name:"hint",type:"flags.0?string"},{name:"email",type:"flags.1?string"},{name:"new_secure_settings",type:"flags.2?SecureSecretSettings"}],type:"account.PasswordInputSettings"},{id:326715557,predicate:"auth.passwordRecovery",params:[{name:"email_pattern",type:"string"}],type:"auth.PasswordRecovery"},{id:-1052959727,predicate:"inputMediaVenue",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"InputMedia"},{id:784356159,predicate:"messageMediaVenue",params:[{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"MessageMedia"},{id:-1551583367,predicate:"receivedNotifyMessage",params:[{name:"id",type:"int"},{name:"flags",type:"int"}],type:"ReceivedNotifyMessage"},{id:179611673,predicate:"chatInviteExported",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.0?true"},{name:"permanent",type:"flags.5?true"},{name:"request_needed",type:"flags.6?true"},{name:"link",type:"string"},{name:"admin_id",type:"long"},{name:"date",type:"int"},{name:"start_date",type:"flags.4?int"},{name:"expire_date",type:"flags.1?int"},{name:"usage_limit",type:"flags.2?int"},{name:"usage",type:"flags.3?int"},{name:"requested",type:"flags.7?int"},{name:"title",type:"flags.8?string"}],type:"ExportedChatInvite"},{id:1516793212,predicate:"chatInviteAlready",params:[{name:"chat",type:"Chat"}],type:"ChatInvite"},{id:-840897472,predicate:"chatInvite",params:[{name:"flags",type:"#"},{name:"channel",type:"flags.0?true"},{name:"broadcast",type:"flags.1?true"},{name:"public",type:"flags.2?true"},{name:"megagroup",type:"flags.3?true"},{name:"request_needed",type:"flags.6?true"},{name:"verified",type:"flags.7?true"},{name:"scam",type:"flags.8?true"},{name:"fake",type:"flags.9?true"},{name:"title",type:"string"},{name:"about",type:"flags.5?string"},{name:"photo",type:"Photo"},{name:"participants_count",type:"int"},{name:"participants",type:"flags.4?Vector<User>"},{name:"color",type:"int"}],type:"ChatInvite"},{id:51520707,predicate:"messageActionChatJoinedByLink",params:[{name:"inviter_id",type:"long"}],type:"MessageAction"},{id:-131960447,predicate:"updateReadMessagesContents",params:[{name:"flags",type:"#"},{name:"messages",type:"Vector<int>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"flags.0?int"}],type:"Update"},{id:-4838507,predicate:"inputStickerSetEmpty",params:[],type:"InputStickerSet"},{id:-1645763991,predicate:"inputStickerSetID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputStickerSet"},{id:-2044933984,predicate:"inputStickerSetShortName",params:[{name:"short_name",type:"string"}],type:"InputStickerSet"},{id:768691932,predicate:"stickerSet",params:[{name:"flags",type:"#"},{name:"archived",type:"flags.1?true"},{name:"official",type:"flags.2?true"},{name:"masks",type:"flags.3?true"},{name:"emojis",type:"flags.7?true"},{name:"text_color",type:"flags.9?true"},{name:"channel_emoji_status",type:"flags.10?true"},{name:"creator",type:"flags.11?true"},{name:"installed_date",type:"flags.0?int"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumbs",type:"flags.4?Vector<PhotoSize>"},{name:"thumb_dc_id",type:"flags.4?int"},{name:"thumb_version",type:"flags.4?int"},{name:"thumb_document_id",type:"flags.8?long"},{name:"count",type:"int"},{name:"hash",type:"int"}],type:"StickerSet"},{id:1846886166,predicate:"messages.stickerSet",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector<StickerPack>"},{name:"keywords",type:"Vector<StickerKeyword>"},{name:"documents",type:"Vector<Document>"}],type:"messages.StickerSet"},{id:559694904,predicate:"user",params:[{name:"flags",type:"#"},{name:"self",type:"flags.10?true"},{name:"contact",type:"flags.11?true"},{name:"mutual_contact",type:"flags.12?true"},{name:"deleted",type:"flags.13?true"},{name:"bot",type:"flags.14?true"},{name:"bot_chat_history",type:"flags.15?true"},{name:"bot_nochats",type:"flags.16?true"},{name:"verified",type:"flags.17?true"},{name:"restricted",type:"flags.18?true"},{name:"min",type:"flags.20?true"},{name:"bot_inline_geo",type:"flags.21?true"},{name:"support",type:"flags.23?true"},{name:"scam",type:"flags.24?true"},{name:"apply_min_photo",type:"flags.25?true"},{name:"fake",type:"flags.26?true"},{name:"bot_attach_menu",type:"flags.27?true"},{name:"premium",type:"flags.28?true"},{name:"attach_menu_enabled",type:"flags.29?true"},{name:"flags2",type:"#"},{name:"bot_can_edit",type:"flags2.1?true"},{name:"close_friend",type:"flags2.2?true"},{name:"stories_hidden",type:"flags2.3?true"},{name:"stories_unavailable",type:"flags2.4?true"},{name:"contact_require_premium",type:"flags2.10?true"},{name:"bot_business",type:"flags2.11?true"},{name:"id",type:"long"},{name:"access_hash",type:"flags.0?long"},{name:"first_name",type:"flags.1?string"},{name:"last_name",type:"flags.2?string"},{name:"username",type:"flags.3?string"},{name:"phone",type:"flags.4?string"},{name:"photo",type:"flags.5?UserProfilePhoto"},{name:"status",type:"flags.6?UserStatus"},{name:"bot_info_version",type:"flags.14?int"},{name:"restriction_reason",type:"flags.18?Vector<RestrictionReason>"},{name:"bot_inline_placeholder",type:"flags.19?string"},{name:"lang_code",type:"flags.22?string"},{name:"emoji_status",type:"flags.30?EmojiStatus"},{name:"usernames",type:"flags2.0?Vector<Username>"},{name:"stories_max_id",type:"flags2.5?int"},{name:"color",type:"flags2.8?PeerColor"},{name:"profile_color",type:"flags2.9?PeerColor"}],type:"User"},{id:-1032140601,predicate:"botCommand",params:[{name:"command",type:"string"},{name:"description",type:"string"}],type:"BotCommand"},{id:-1892676777,predicate:"botInfo",params:[{name:"flags",type:"#"},{name:"user_id",type:"flags.0?long"},{name:"description",type:"flags.1?string"},{name:"description_photo",type:"flags.4?Photo"},{name:"description_document",type:"flags.5?Document"},{name:"commands",type:"flags.2?Vector<BotCommand>"},{name:"menu_button",type:"flags.3?BotMenuButton"}],type:"BotInfo"},{id:-1560655744,predicate:"keyboardButton",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:2002815875,predicate:"keyboardButtonRow",params:[{name:"buttons",type:"Vector<KeyboardButton>"}],type:"KeyboardButtonRow"},{id:-1606526075,predicate:"replyKeyboardHide",params:[{name:"flags",type:"#"},{name:"selective",type:"flags.2?true"}],type:"ReplyMarkup"},{id:-2035021048,predicate:"replyKeyboardForceReply",params:[{name:"flags",type:"#"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-2049074735,predicate:"replyKeyboardMarkup",params:[{name:"flags",type:"#"},{name:"resize",type:"flags.0?true"},{name:"single_use",type:"flags.1?true"},{name:"selective",type:"flags.2?true"},{name:"persistent",type:"flags.4?true"},{name:"rows",type:"Vector<KeyboardButtonRow>"},{name:"placeholder",type:"flags.3?string"}],type:"ReplyMarkup"},{id:-571955892,predicate:"inputPeerUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:-233744186,predicate:"inputUser",params:[{name:"user_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputUser"},{id:-1148011883,predicate:"messageEntityUnknown",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-100378723,predicate:"messageEntityMention",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1868782349,predicate:"messageEntityHashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1827637959,predicate:"messageEntityBotCommand",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1859134776,predicate:"messageEntityUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1692693954,predicate:"messageEntityEmail",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1117713463,predicate:"messageEntityBold",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-2106619040,predicate:"messageEntityItalic",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:681706865,predicate:"messageEntityCode",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1938967520,predicate:"messageEntityPre",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"language",type:"string"}],type:"MessageEntity"},{id:1990644519,predicate:"messageEntityTextUrl",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"url",type:"string"}],type:"MessageEntity"},{id:-1877614335,predicate:"updateShortSentMessage",params:[{name:"flags",type:"#"},{name:"out",type:"flags.1?true"},{name:"id",type:"int"},{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"date",type:"int"},{name:"media",type:"flags.9?MessageMedia"},{name:"entities",type:"flags.7?Vector<MessageEntity>"},{name:"ttl_period",type:"flags.25?int"}],type:"Updates"},{id:-292807034,predicate:"inputChannelEmpty",params:[],type:"InputChannel"},{id:-212145112,predicate:"inputChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputChannel"},{id:-1566230754,predicate:"peerChannel",params:[{name:"channel_id",type:"long"}],type:"Peer"},{id:666680316,predicate:"inputPeerChannel",params:[{name:"channel_id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPeer"},{id:179174543,predicate:"channel",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"left",type:"flags.2?true"},{name:"broadcast",type:"flags.5?true"},{name:"verified",type:"flags.7?true"},{name:"megagroup",type:"flags.8?true"},{name:"restricted",type:"flags.9?true"},{name:"signatures",type:"flags.11?true"},{name:"min",type:"flags.12?true"},{name:"scam",type:"flags.19?true"},{name:"has_link",type:"flags.20?true"},{name:"has_geo",type:"flags.21?true"},{name:"slowmode_enabled",type:"flags.22?true"},{name:"call_active",type:"flags.23?true"},{name:"call_not_empty",type:"flags.24?true"},{name:"fake",type:"flags.25?true"},{name:"gigagroup",type:"flags.26?true"},{name:"noforwards",type:"flags.27?true"},{name:"join_to_send",type:"flags.28?true"},{name:"join_request",type:"flags.29?true"},{name:"forum",type:"flags.30?true"},{name:"flags2",type:"#"},{name:"stories_hidden",type:"flags2.1?true"},{name:"stories_hidden_min",type:"flags2.2?true"},{name:"stories_unavailable",type:"flags2.3?true"},{name:"id",type:"long"},{name:"access_hash",type:"flags.13?long"},{name:"title",type:"string"},{name:"username",type:"flags.6?string"},{name:"photo",type:"ChatPhoto"},{name:"date",type:"int"},{name:"restriction_reason",type:"flags.9?Vector<RestrictionReason>"},{name:"admin_rights",type:"flags.14?ChatAdminRights"},{name:"banned_rights",type:"flags.15?ChatBannedRights"},{name:"default_banned_rights",type:"flags.18?ChatBannedRights"},{name:"participants_count",type:"flags.17?int"},{name:"usernames",type:"flags2.0?Vector<Username>"},{name:"stories_max_id",type:"flags2.4?int"},{name:"color",type:"flags2.7?PeerColor"},{name:"profile_color",type:"flags2.8?PeerColor"},{name:"emoji_status",type:"flags2.9?EmojiStatus"},{name:"level",type:"flags2.10?int"}],type:"Chat"},{id:399807445,predicate:"channelForbidden",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.5?true"},{name:"megagroup",type:"flags.8?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"title",type:"string"},{name:"until_date",type:"flags.16?int"}],type:"Chat"},{id:2131196633,predicate:"contacts.resolvedPeer",params:[{name:"peer",type:"Peer"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"contacts.ResolvedPeer"},{id:-1146407795,predicate:"channelFull",params:[{name:"flags",type:"#"},{name:"can_view_participants",type:"flags.3?true"},{name:"can_set_username",type:"flags.6?true"},{name:"can_set_stickers",type:"flags.7?true"},{name:"hidden_prehistory",type:"flags.10?true"},{name:"can_set_location",type:"flags.16?true"},{name:"has_scheduled",type:"flags.19?true"},{name:"can_view_stats",type:"flags.20?true"},{name:"blocked",type:"flags.22?true"},{name:"flags2",type:"#"},{name:"can_delete_channel",type:"flags2.0?true"},{name:"antispam",type:"flags2.1?true"},{name:"participants_hidden",type:"flags2.2?true"},{name:"translations_disabled",type:"flags2.3?true"},{name:"stories_pinned_available",type:"flags2.5?true"},{name:"view_forum_as_messages",type:"flags2.6?true"},{name:"restricted_sponsored",type:"flags2.11?true"},{name:"can_view_revenue",type:"flags2.12?true"},{name:"paid_media_allowed",type:"flags2.14?true"},{name:"can_view_stars_revenue",type:"flags2.15?true"},{name:"id",type:"long"},{name:"about",type:"string"},{name:"participants_count",type:"flags.0?int"},{name:"admins_count",type:"flags.1?int"},{name:"kicked_count",type:"flags.2?int"},{name:"banned_count",type:"flags.2?int"},{name:"online_count",type:"flags.13?int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"chat_photo",type:"Photo"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"exported_invite",type:"flags.23?ExportedChatInvite"},{name:"bot_info",type:"Vector<BotInfo>"},{name:"migrated_from_chat_id",type:"flags.4?long"},{name:"migrated_from_max_id",type:"flags.4?int"},{name:"pinned_msg_id",type:"flags.5?int"},{name:"stickerset",type:"flags.8?StickerSet"},{name:"available_min_id",type:"flags.9?int"},{name:"folder_id",type:"flags.11?int"},{name:"linked_chat_id",type:"flags.14?long"},{name:"location",type:"flags.15?ChannelLocation"},{name:"slowmode_seconds",type:"flags.17?int"},{name:"slowmode_next_send_date",type:"flags.18?int"},{name:"stats_dc",type:"flags.12?int"},{name:"pts",type:"int"},{name:"call",type:"flags.21?InputGroupCall"},{name:"ttl_period",type:"flags.24?int"},{name:"pending_suggestions",type:"flags.25?Vector<string>"},{name:"groupcall_default_join_as",type:"flags.26?Peer"},{name:"theme_emoticon",type:"flags.27?string"},{name:"requests_pending",type:"flags.28?int"},{name:"recent_requesters",type:"flags.28?Vector<long>"},{name:"default_send_as",type:"flags.29?Peer"},{name:"available_reactions",type:"flags.30?ChatReactions"},{name:"reactions_limit",type:"flags2.13?int"},{name:"stories",type:"flags2.4?PeerStories"},{name:"wallpaper",type:"flags2.7?WallPaper"},{name:"boosts_applied",type:"flags2.8?int"},{name:"boosts_unrestrict",type:"flags2.9?int"},{name:"emojiset",type:"flags2.10?StickerSet"}],type:"ChatFull"},{id:182649427,predicate:"messageRange",params:[{name:"min_id",type:"int"},{name:"max_id",type:"int"}],type:"MessageRange"},{id:-948520370,predicate:"messages.channelMessages",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"pts",type:"int"},{name:"count",type:"int"},{name:"offset_id_offset",type:"flags.2?int"},{name:"messages",type:"Vector<Message>"},{name:"topics",type:"Vector<ForumTopic>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.Messages"},{id:-1781355374,predicate:"messageActionChannelCreate",params:[{name:"title",type:"string"}],type:"MessageAction"},{id:277713951,predicate:"updateChannelTooLong",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"pts",type:"flags.0?int"}],type:"Update"},{id:1666927625,predicate:"updateChannel",params:[{name:"channel_id",type:"long"}],type:"Update"},{id:1656358105,predicate:"updateNewChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1842450928,predicate:"updateReadChannelInbox",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.0?int"},{name:"channel_id",type:"long"},{name:"max_id",type:"int"},{name:"still_unread_count",type:"int"},{name:"pts",type:"int"}],type:"Update"},{id:-1020437742,predicate:"updateDeleteChannelMessages",params:[{name:"channel_id",type:"long"},{name:"messages",type:"Vector<int>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-232346616,predicate:"updateChannelMessageViews",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"views",type:"int"}],type:"Update"},{id:1041346555,predicate:"updates.channelDifferenceEmpty",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"}],type:"updates.ChannelDifference"},{id:-1531132162,predicate:"updates.channelDifferenceTooLong",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"timeout",type:"flags.1?int"},{name:"dialog",type:"Dialog"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"updates.ChannelDifference"},{id:543450958,predicate:"updates.channelDifference",params:[{name:"flags",type:"#"},{name:"final",type:"flags.0?true"},{name:"pts",type:"int"},{name:"timeout",type:"flags.1?int"},{name:"new_messages",type:"Vector<Message>"},{name:"other_updates",type:"Vector<Update>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"updates.ChannelDifference"},{id:-1798033689,predicate:"channelMessagesFilterEmpty",params:[],type:"ChannelMessagesFilter"},{id:-847783593,predicate:"channelMessagesFilter",params:[{name:"flags",type:"#"},{name:"exclude_new_messages",type:"flags.1?true"},{name:"ranges",type:"Vector<MessageRange>"}],type:"ChannelMessagesFilter"},{id:-1072953408,predicate:"channelParticipant",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:900251559,predicate:"channelParticipantSelf",params:[{name:"flags",type:"#"},{name:"via_request",type:"flags.0?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChannelParticipant"},{id:803602899,predicate:"channelParticipantCreator",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.0?string"}],type:"ChannelParticipant"},{id:-566281095,predicate:"channelParticipantsRecent",params:[],type:"ChannelParticipantsFilter"},{id:-1268741783,predicate:"channelParticipantsAdmins",params:[],type:"ChannelParticipantsFilter"},{id:-1548400251,predicate:"channelParticipantsKicked",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-1699676497,predicate:"channels.channelParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector<ChannelParticipant>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"channels.ChannelParticipants"},{id:-541588713,predicate:"channels.channelParticipant",params:[{name:"participant",type:"ChannelParticipant"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"channels.ChannelParticipant"},{id:-462696732,predicate:"chatParticipantCreator",params:[{name:"user_id",type:"long"}],type:"ChatParticipant"},{id:-1600962725,predicate:"chatParticipantAdmin",params:[{name:"user_id",type:"long"},{name:"inviter_id",type:"long"},{name:"date",type:"int"}],type:"ChatParticipant"},{id:-674602590,predicate:"updateChatParticipantAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"long"},{name:"is_admin",type:"Bool"},{name:"version",type:"int"}],type:"Update"},{id:-519864430,predicate:"messageActionChatMigrateTo",params:[{name:"channel_id",type:"long"}],type:"MessageAction"},{id:-365344535,predicate:"messageActionChannelMigrateFrom",params:[{name:"title",type:"string"},{name:"chat_id",type:"long"}],type:"MessageAction"},{id:-1328445861,predicate:"channelParticipantsBots",params:[],type:"ChannelParticipantsFilter"},{id:2013922064,predicate:"help.termsOfService",params:[{name:"flags",type:"#"},{name:"popup",type:"flags.0?true"},{name:"id",type:"DataJSON"},{name:"text",type:"string"},{name:"entities",type:"Vector<MessageEntity>"},{name:"min_age_confirm",type:"flags.1?int"}],type:"help.TermsOfService"},{id:1753886890,predicate:"updateNewStickerSet",params:[{name:"stickerset",type:"messages.StickerSet"}],type:"Update"},{id:196268545,predicate:"updateStickerSetsOrder",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector<long>"}],type:"Update"},{id:834816008,predicate:"updateStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"}],type:"Update"},{id:-402498398,predicate:"messages.savedGifsNotModified",params:[],type:"messages.SavedGifs"},{id:-2069878259,predicate:"messages.savedGifs",params:[{name:"hash",type:"long"},{name:"gifs",type:"Vector<Document>"}],type:"messages.SavedGifs"},{id:-1821035490,predicate:"updateSavedGifs",params:[],type:"Update"},{id:864077702,predicate:"inputBotInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"invert_media",type:"flags.3?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1036876423,predicate:"inputBotInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"invert_media",type:"flags.3?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-2000710887,predicate:"inputBotInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?InputWebDocument"},{name:"content",type:"flags.5?InputWebDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1984755728,predicate:"botInlineMessageMediaAuto",params:[{name:"flags",type:"#"},{name:"invert_media",type:"flags.3?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1937807902,predicate:"botInlineMessageText",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.0?true"},{name:"invert_media",type:"flags.3?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:295067450,predicate:"botInlineResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"url",type:"flags.3?string"},{name:"thumb",type:"flags.4?WebDocument"},{name:"content",type:"flags.5?WebDocument"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-534646026,predicate:"messages.botResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"query_id",type:"long"},{name:"next_offset",type:"flags.1?string"},{name:"switch_pm",type:"flags.2?InlineBotSwitchPM"},{name:"switch_webview",type:"flags.3?InlineBotWebView"},{name:"results",type:"Vector<BotInlineResult>"},{name:"cache_time",type:"int"},{name:"users",type:"Vector<User>"}],type:"messages.BotResults"},{id:1232025500,predicate:"updateBotInlineQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"peer_type",type:"flags.1?InlineQueryPeerType"},{name:"offset",type:"string"}],type:"Update"},{id:317794823,predicate:"updateBotInlineSend",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"query",type:"string"},{name:"geo",type:"flags.0?GeoPoint"},{name:"id",type:"string"},{name:"msg_id",type:"flags.1?InputBotInlineMessageID"}],type:"Update"},{id:1358283666,predicate:"inputMessagesFilterVoice",params:[],type:"MessagesFilter"},{id:928101534,predicate:"inputMessagesFilterMusic",params:[],type:"MessagesFilter"},{id:-1107622874,predicate:"inputPrivacyKeyChatInvite",params:[],type:"InputPrivacyKey"},{id:1343122938,predicate:"privacyKeyChatInvite",params:[],type:"PrivacyKey"},{id:1571494644,predicate:"exportedMessageLink",params:[{name:"link",type:"string"},{name:"html",type:"string"}],type:"ExportedMessageLink"},{id:1313731771,predicate:"messageFwdHeader",params:[{name:"flags",type:"#"},{name:"imported",type:"flags.7?true"},{name:"saved_out",type:"flags.11?true"},{name:"from_id",type:"flags.0?Peer"},{name:"from_name",type:"flags.5?string"},{name:"date",type:"int"},{name:"channel_post",type:"flags.2?int"},{name:"post_author",type:"flags.3?string"},{name:"saved_from_peer",type:"flags.4?Peer"},{name:"saved_from_msg_id",type:"flags.4?int"},{name:"saved_from_id",type:"flags.8?Peer"},{name:"saved_from_name",type:"flags.9?string"},{name:"saved_date",type:"flags.10?int"},{name:"psa_type",type:"flags.6?string"}],type:"MessageFwdHeader"},{id:457133559,predicate:"updateEditChannelMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1799538451,predicate:"messageActionPinMessage",params:[],type:"MessageAction"},{id:1923290508,predicate:"auth.codeTypeSms",params:[],type:"auth.CodeType"},{id:1948046307,predicate:"auth.codeTypeCall",params:[],type:"auth.CodeType"},{id:577556219,predicate:"auth.codeTypeFlashCall",params:[],type:"auth.CodeType"},{id:1035688326,predicate:"auth.sentCodeTypeApp",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1073693790,predicate:"auth.sentCodeTypeSms",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1398007207,predicate:"auth.sentCodeTypeCall",params:[{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1425815847,predicate:"auth.sentCodeTypeFlashCall",params:[{name:"pattern",type:"string"}],type:"auth.SentCodeType"},{id:629866245,predicate:"keyboardButtonUrl",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:901503851,predicate:"keyboardButtonCallback",params:[{name:"flags",type:"#"},{name:"requires_password",type:"flags.0?true"},{name:"text",type:"string"},{name:"data",type:"bytes"}],type:"KeyboardButton"},{id:-1318425559,predicate:"keyboardButtonRequestPhone",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-59151553,predicate:"keyboardButtonRequestGeoLocation",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1816527947,predicate:"keyboardButtonSwitchInline",params:[{name:"flags",type:"#"},{name:"same_peer",type:"flags.0?true"},{name:"text",type:"string"},{name:"query",type:"string"},{name:"peer_types",type:"flags.1?Vector<InlineQueryPeerType>"}],type:"KeyboardButton"},{id:1218642516,predicate:"replyInlineMarkup",params:[{name:"rows",type:"Vector<KeyboardButtonRow>"}],type:"ReplyMarkup"},{id:911761060,predicate:"messages.botCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"has_url",type:"flags.3?true"},{name:"native_ui",type:"flags.4?true"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"messages.BotCallbackAnswer"},{id:-1177566067,predicate:"updateBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:649453030,predicate:"messages.messageEditData",params:[{name:"flags",type:"#"},{name:"caption",type:"flags.0?true"}],type:"messages.MessageEditData"},{id:-469536605,predicate:"updateEditMessage",params:[{name:"message",type:"Message"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1768777083,predicate:"inputBotInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:1098628881,predicate:"inputBotInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo_point",type:"InputGeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-1494368259,predicate:"inputBotInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:85477117,predicate:"botInlineMessageMediaGeo",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1970903652,predicate:"botInlineMessageMediaVenue",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:416402882,predicate:"botInlineMessageMediaContact",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"vcard",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1462213465,predicate:"inputBotInlineResultPhoto",params:[{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"InputPhoto"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:-459324,predicate:"inputBotInlineResultDocument",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"title",type:"flags.1?string"},{name:"description",type:"flags.2?string"},{name:"document",type:"InputDocument"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:400266251,predicate:"botInlineMediaResult",params:[{name:"flags",type:"#"},{name:"id",type:"string"},{name:"type",type:"string"},{name:"photo",type:"flags.0?Photo"},{name:"document",type:"flags.1?Document"},{name:"title",type:"flags.2?string"},{name:"description",type:"flags.3?string"},{name:"send_message",type:"BotInlineMessage"}],type:"BotInlineResult"},{id:-1995686519,predicate:"inputBotInlineMessageID",params:[{name:"dc_id",type:"int"},{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:1763610706,predicate:"updateInlineBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"msg_id",type:"InputBotInlineMessageID"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"},{name:"game_short_name",type:"flags.1?string"}],type:"Update"},{id:1008755359,predicate:"inlineBotSwitchPM",params:[{name:"text",type:"string"},{name:"start_param",type:"string"}],type:"InlineBotSwitchPM"},{id:863093588,predicate:"messages.peerDialogs",params:[{name:"dialogs",type:"Vector<Dialog>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"state",type:"updates.State"}],type:"messages.PeerDialogs"},{id:-305282981,predicate:"topPeer",params:[{name:"peer",type:"Peer"},{name:"rating",type:"double"}],type:"TopPeer"},{id:-1419371685,predicate:"topPeerCategoryBotsPM",params:[],type:"TopPeerCategory"},{id:344356834,predicate:"topPeerCategoryBotsInline",params:[],type:"TopPeerCategory"},{id:104314861,predicate:"topPeerCategoryCorrespondents",params:[],type:"TopPeerCategory"},{id:-1122524854,predicate:"topPeerCategoryGroups",params:[],type:"TopPeerCategory"},{id:371037736,predicate:"topPeerCategoryChannels",params:[],type:"TopPeerCategory"},{id:-75283823,predicate:"topPeerCategoryPeers",params:[{name:"category",type:"TopPeerCategory"},{name:"count",type:"int"},{name:"peers",type:"Vector<TopPeer>"}],type:"TopPeerCategoryPeers"},{id:-567906571,predicate:"contacts.topPeersNotModified",params:[],type:"contacts.TopPeers"},{id:1891070632,predicate:"contacts.topPeers",params:[{name:"categories",type:"Vector<TopPeerCategoryPeers>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"contacts.TopPeers"},{id:-595914432,predicate:"messageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"long"}],type:"MessageEntity"},{id:546203849,predicate:"inputMessageEntityMentionName",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"user_id",type:"InputUser"}],type:"MessageEntity"},{id:975236280,predicate:"inputMessagesFilterChatPhotos",params:[],type:"MessagesFilter"},{id:-1218471511,predicate:"updateReadChannelOutbox",params:[{name:"channel_id",type:"long"},{name:"max_id",type:"int"}],type:"Update"},{id:457829485,predicate:"updateDraftMessage",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"top_msg_id",type:"flags.0?int"},{name:"draft",type:"DraftMessage"}],type:"Update"},{id:453805082,predicate:"draftMessageEmpty",params:[{name:"flags",type:"#"},{name:"date",type:"flags.0?int"}],type:"DraftMessage"},{id:761606687,predicate:"draftMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"invert_media",type:"flags.6?true"},{name:"reply_to",type:"flags.4?InputReplyTo"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector<MessageEntity>"},{name:"media",type:"flags.5?InputMedia"},{name:"date",type:"int"},{name:"effect",type:"flags.7?long"}],type:"DraftMessage"},{id:-1615153660,predicate:"messageActionHistoryClear",params:[],type:"MessageAction"},{id:-958657434,predicate:"messages.featuredStickersNotModified",params:[{name:"count",type:"int"}],type:"messages.FeaturedStickers"},{id:-1103615738,predicate:"messages.featuredStickers",params:[{name:"flags",type:"#"},{name:"premium",type:"flags.0?true"},{name:"hash",type:"long"},{name:"count",type:"int"},{name:"sets",type:"Vector<StickerSetCovered>"},{name:"unread",type:"Vector<long>"}],type:"messages.FeaturedStickers"},{id:1461528386,predicate:"updateReadFeaturedStickers",params:[],type:"Update"},{id:186120336,predicate:"messages.recentStickersNotModified",params:[],type:"messages.RecentStickers"},{id:-1999405994,predicate:"messages.recentStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector<StickerPack>"},{name:"stickers",type:"Vector<Document>"},{name:"dates",type:"Vector<int>"}],type:"messages.RecentStickers"},{id:-1706939360,predicate:"updateRecentStickers",params:[],type:"Update"},{id:1338747336,predicate:"messages.archivedStickers",params:[{name:"count",type:"int"},{name:"sets",type:"Vector<StickerSetCovered>"}],type:"messages.ArchivedStickers"},{id:946083368,predicate:"messages.stickerSetInstallResultSuccess",params:[],type:"messages.StickerSetInstallResult"},{id:904138920,predicate:"messages.stickerSetInstallResultArchive",params:[{name:"sets",type:"Vector<StickerSetCovered>"}],type:"messages.StickerSetInstallResult"},{id:1678812626,predicate:"stickerSetCovered",params:[{name:"set",type:"StickerSet"},{name:"cover",type:"Document"}],type:"StickerSetCovered"},{id:-1574314746,predicate:"updateConfig",params:[],type:"Update"},{id:861169551,predicate:"updatePtsChanged",params:[],type:"Update"},{id:-440664550,predicate:"inputMediaPhotoExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:-78455655,predicate:"inputMediaDocumentExternal",params:[{name:"flags",type:"#"},{name:"spoiler",type:"flags.1?true"},{name:"url",type:"string"},{name:"ttl_seconds",type:"flags.0?int"}],type:"InputMedia"},{id:872932635,predicate:"stickerSetMultiCovered",params:[{name:"set",type:"StickerSet"},{name:"covers",type:"Vector<Document>"}],type:"StickerSetCovered"},{id:-1361650766,predicate:"maskCoords",params:[{name:"n",type:"int"},{name:"x",type:"double"},{name:"y",type:"double"},{name:"zoom",type:"double"}],type:"MaskCoords"},{id:-1744710921,predicate:"documentAttributeHasStickers",params:[],type:"DocumentAttribute"},{id:1251549527,predicate:"inputStickeredMediaPhoto",params:[{name:"id",type:"InputPhoto"}],type:"InputStickeredMedia"},{id:70813275,predicate:"inputStickeredMediaDocument",params:[{name:"id",type:"InputDocument"}],type:"InputStickeredMedia"},{id:-1107729093,predicate:"game",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"short_name",type:"string"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"Photo"},{name:"document",type:"flags.0?Document"}],type:"Game"},{id:1336154098,predicate:"inputBotInlineResultGame",params:[{name:"id",type:"string"},{name:"short_name",type:"string"},{name:"send_message",type:"InputBotInlineMessage"}],type:"InputBotInlineResult"},{id:1262639204,predicate:"inputBotInlineMessageGame",params:[{name:"flags",type:"#"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-38694904,predicate:"messageMediaGame",params:[{name:"game",type:"Game"}],type:"MessageMedia"},{id:-750828557,predicate:"inputMediaGame",params:[{name:"id",type:"InputGame"}],type:"InputMedia"},{id:53231223,predicate:"inputGameID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGame"},{id:-1020139510,predicate:"inputGameShortName",params:[{name:"bot_id",type:"InputUser"},{name:"short_name",type:"string"}],type:"InputGame"},{id:1358175439,predicate:"keyboardButtonGame",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1834538890,predicate:"messageActionGameScore",params:[{name:"game_id",type:"long"},{name:"score",type:"int"}],type:"MessageAction"},{id:1940093419,predicate:"highScore",params:[{name:"pos",type:"int"},{name:"user_id",type:"long"},{name:"score",type:"int"}],type:"HighScore"},{id:-1707344487,predicate:"messages.highScores",params:[{name:"scores",type:"Vector<HighScore>"},{name:"users",type:"Vector<User>"}],type:"messages.HighScores"},{id:1258196845,predicate:"updates.differenceTooLong",params:[{name:"pts",type:"int"}],type:"updates.Difference"},{id:791390623,predicate:"updateChannelWebPage",params:[{name:"channel_id",type:"long"},{name:"webpage",type:"WebPage"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:-1663561404,predicate:"messages.chatsSlice",params:[{name:"count",type:"int"},{name:"chats",type:"Vector<Chat>"}],type:"messages.Chats"},{id:-599948721,predicate:"textEmpty",params:[],type:"RichText"},{id:1950782688,predicate:"textPlain",params:[{name:"text",type:"string"}],type:"RichText"},{id:1730456516,predicate:"textBold",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-653089380,predicate:"textItalic",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1054465340,predicate:"textUnderline",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-1678197867,predicate:"textStrike",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1816074681,predicate:"textFixed",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:1009288385,predicate:"textUrl",params:[{name:"text",type:"RichText"},{name:"url",type:"string"},{name:"webpage_id",type:"long"}],type:"RichText"},{id:-564523562,predicate:"textEmail",params:[{name:"text",type:"RichText"},{name:"email",type:"string"}],type:"RichText"},{id:2120376535,predicate:"textConcat",params:[{name:"texts",type:"Vector<RichText>"}],type:"RichText"},{id:324435594,predicate:"pageBlockUnsupported",params:[],type:"PageBlock"},{id:1890305021,predicate:"pageBlockTitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1879401953,predicate:"pageBlockSubtitle",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1162877472,predicate:"pageBlockAuthorDate",params:[{name:"author",type:"RichText"},{name:"published_date",type:"int"}],type:"PageBlock"},{id:-1076861716,predicate:"pageBlockHeader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-248793375,predicate:"pageBlockSubheader",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:1182402406,predicate:"pageBlockParagraph",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-1066346178,predicate:"pageBlockPreformatted",params:[{name:"text",type:"RichText"},{name:"language",type:"string"}],type:"PageBlock"},{id:1216809369,predicate:"pageBlockFooter",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:-618614392,predicate:"pageBlockDivider",params:[],type:"PageBlock"},{id:-837994576,predicate:"pageBlockAnchor",params:[{name:"name",type:"string"}],type:"PageBlock"},{id:-454524911,predicate:"pageBlockList",params:[{name:"items",type:"Vector<PageListItem>"}],type:"PageBlock"},{id:641563686,predicate:"pageBlockBlockquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:1329878739,predicate:"pageBlockPullquote",params:[{name:"text",type:"RichText"},{name:"caption",type:"RichText"}],type:"PageBlock"},{id:391759200,predicate:"pageBlockPhoto",params:[{name:"flags",type:"#"},{name:"photo_id",type:"long"},{name:"caption",type:"PageCaption"},{name:"url",type:"flags.0?string"},{name:"webpage_id",type:"flags.0?long"}],type:"PageBlock"},{id:2089805750,predicate:"pageBlockVideo",params:[{name:"flags",type:"#"},{name:"autoplay",type:"flags.0?true"},{name:"loop",type:"flags.1?true"},{name:"video_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:972174080,predicate:"pageBlockCover",params:[{name:"cover",type:"PageBlock"}],type:"PageBlock"},{id:-1468953147,predicate:"pageBlockEmbed",params:[{name:"flags",type:"#"},{name:"full_width",type:"flags.0?true"},{name:"allow_scrolling",type:"flags.3?true"},{name:"url",type:"flags.1?string"},{name:"html",type:"flags.2?string"},{name:"poster_photo_id",type:"flags.4?long"},{name:"w",type:"flags.5?int"},{name:"h",type:"flags.5?int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-229005301,predicate:"pageBlockEmbedPost",params:[{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"author_photo_id",type:"long"},{name:"author",type:"string"},{name:"date",type:"int"},{name:"blocks",type:"Vector<PageBlock>"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1705048653,predicate:"pageBlockCollage",params:[{name:"items",type:"Vector<PageBlock>"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:52401552,predicate:"pageBlockSlideshow",params:[{name:"items",type:"Vector<PageBlock>"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1930545681,predicate:"webPageNotModified",params:[{name:"flags",type:"#"},{name:"cached_page_views",type:"flags.0?int"}],type:"WebPage"},{id:-88417185,predicate:"inputPrivacyKeyPhoneCall",params:[],type:"InputPrivacyKey"},{id:1030105979,predicate:"privacyKeyPhoneCall",params:[],type:"PrivacyKey"},{id:-580219064,predicate:"sendMessageGamePlayAction",params:[],type:"SendMessageAction"},{id:-2048646399,predicate:"phoneCallDiscardReasonMissed",params:[],type:"PhoneCallDiscardReason"},{id:-527056480,predicate:"phoneCallDiscardReasonDisconnect",params:[],type:"PhoneCallDiscardReason"},{id:1471006352,predicate:"phoneCallDiscardReasonHangup",params:[],type:"PhoneCallDiscardReason"},{id:-84416311,predicate:"phoneCallDiscardReasonBusy",params:[],type:"PhoneCallDiscardReason"},{id:1852826908,predicate:"updateDialogPinned",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-99664734,predicate:"updatePinnedDialogs",params:[{name:"flags",type:"#"},{name:"folder_id",type:"flags.1?int"},{name:"order",type:"flags.0?Vector<DialogPeer>"}],type:"Update"},{id:2104790276,predicate:"dataJSON",params:[{name:"data",type:"string"}],type:"DataJSON"},{id:-2095595325,predicate:"updateBotWebhookJSON",params:[{name:"data",type:"DataJSON"}],type:"Update"},{id:-1684914010,predicate:"updateBotWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"},{name:"timeout",type:"int"}],type:"Update"},{id:-886477832,predicate:"labeledPrice",params:[{name:"label",type:"string"},{name:"amount",type:"long"}],type:"LabeledPrice"},{id:1572428309,predicate:"invoice",params:[{name:"flags",type:"#"},{name:"test",type:"flags.0?true"},{name:"name_requested",type:"flags.1?true"},{name:"phone_requested",type:"flags.2?true"},{name:"email_requested",type:"flags.3?true"},{name:"shipping_address_requested",type:"flags.4?true"},{name:"flexible",type:"flags.5?true"},{name:"phone_to_provider",type:"flags.6?true"},{name:"email_to_provider",type:"flags.7?true"},{name:"recurring",type:"flags.9?true"},{name:"currency",type:"string"},{name:"prices",type:"Vector<LabeledPrice>"},{name:"max_tip_amount",type:"flags.8?long"},{name:"suggested_tip_amounts",type:"flags.8?Vector<long>"},{name:"terms_url",type:"flags.10?string"}],type:"Invoice"},{id:1080028941,predicate:"inputMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"flags.3?string"},{name:"provider_data",type:"DataJSON"},{name:"start_param",type:"flags.1?string"},{name:"extended_media",type:"flags.2?InputMedia"}],type:"InputMedia"},{id:-368917890,predicate:"paymentCharge",params:[{name:"id",type:"string"},{name:"provider_charge_id",type:"string"}],type:"PaymentCharge"},{id:-1892568281,predicate:"messageActionPaymentSentMe",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"charge",type:"PaymentCharge"}],type:"MessageAction"},{id:-156940077,predicate:"messageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"receipt_msg_id",type:"flags.2?int"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"start_param",type:"string"},{name:"extended_media",type:"flags.4?MessageExtendedMedia"}],type:"MessageMedia"},{id:512535275,predicate:"postAddress",params:[{name:"street_line1",type:"string"},{name:"street_line2",type:"string"},{name:"city",type:"string"},{name:"state",type:"string"},{name:"country_iso2",type:"string"},{name:"post_code",type:"string"}],type:"PostAddress"},{id:-1868808300,predicate:"paymentRequestedInfo",params:[{name:"flags",type:"#"},{name:"name",type:"flags.0?string"},{name:"phone",type:"flags.1?string"},{name:"email",type:"flags.2?string"},{name:"shipping_address",type:"flags.3?PostAddress"}],type:"PaymentRequestedInfo"},{id:-1344716869,predicate:"keyboardButtonBuy",params:[{name:"text",type:"string"}],type:"KeyboardButton"},{id:-1776926890,predicate:"messageActionPaymentSent",params:[{name:"flags",type:"#"},{name:"recurring_init",type:"flags.2?true"},{name:"recurring_used",type:"flags.3?true"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"invoice_slug",type:"flags.0?string"}],type:"MessageAction"},{id:-842892769,predicate:"paymentSavedCredentialsCard",params:[{name:"id",type:"string"},{name:"title",type:"string"}],type:"PaymentSavedCredentials"},{id:475467473,predicate:"webDocument",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector<DocumentAttribute>"}],type:"WebDocument"},{id:-1678949555,predicate:"inputWebDocument",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector<DocumentAttribute>"}],type:"InputWebDocument"},{id:-1036396922,predicate:"inputWebFileLocation",params:[{name:"url",type:"string"},{name:"access_hash",type:"long"}],type:"InputWebFileLocation"},{id:568808380,predicate:"upload.webFile",params:[{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"file_type",type:"storage.FileType"},{name:"mtime",type:"int"},{name:"bytes",type:"bytes"}],type:"upload.WebFile"},{id:-1610250415,predicate:"payments.paymentForm",params:[{name:"flags",type:"#"},{name:"can_save_credentials",type:"flags.2?true"},{name:"password_missing",type:"flags.3?true"},{name:"form_id",type:"long"},{name:"bot_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.5?WebDocument"},{name:"invoice",type:"Invoice"},{name:"provider_id",type:"long"},{name:"url",type:"string"},{name:"native_provider",type:"flags.4?string"},{name:"native_params",type:"flags.4?DataJSON"},{name:"additional_methods",type:"flags.6?Vector<PaymentFormMethod>"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"},{name:"saved_credentials",type:"flags.1?Vector<PaymentSavedCredentials>"},{name:"users",type:"Vector<User>"}],type:"payments.PaymentForm"},{id:-784000893,predicate:"payments.validatedRequestedInfo",params:[{name:"flags",type:"#"},{name:"id",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector<ShippingOption>"}],type:"payments.ValidatedRequestedInfo"},{id:1314881805,predicate:"payments.paymentResult",params:[{name:"updates",type:"Updates"}],type:"payments.PaymentResult"},{id:1891958275,predicate:"payments.paymentReceipt",params:[{name:"flags",type:"#"},{name:"date",type:"int"},{name:"bot_id",type:"long"},{name:"provider_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.2?WebDocument"},{name:"invoice",type:"Invoice"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping",type:"flags.1?ShippingOption"},{name:"tip_amount",type:"flags.3?long"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"credentials_title",type:"string"},{name:"users",type:"Vector<User>"}],type:"payments.PaymentReceipt"},{id:-74456004,predicate:"payments.savedInfo",params:[{name:"flags",type:"#"},{name:"has_saved_credentials",type:"flags.1?true"},{name:"saved_info",type:"flags.0?PaymentRequestedInfo"}],type:"payments.SavedInfo"},{id:-1056001329,predicate:"inputPaymentCredentialsSaved",params:[{name:"id",type:"string"},{name:"tmp_password",type:"bytes"}],type:"InputPaymentCredentials"},{id:873977640,predicate:"inputPaymentCredentials",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-614138572,predicate:"account.tmpPassword",params:[{name:"tmp_password",type:"bytes"},{name:"valid_until",type:"int"}],type:"account.TmpPassword"},{id:-1239335713,predicate:"shippingOption",params:[{name:"id",type:"string"},{name:"title",type:"string"},{name:"prices",type:"Vector<LabeledPrice>"}],type:"ShippingOption"},{id:-1246823043,predicate:"updateBotShippingQuery",params:[{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"shipping_address",type:"PostAddress"}],type:"Update"},{id:-1934976362,predicate:"updateBotPrecheckoutQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"payload",type:"bytes"},{name:"info",type:"flags.0?PaymentRequestedInfo"},{name:"shipping_option_id",type:"flags.1?string"},{name:"currency",type:"string"},{name:"total_amount",type:"long"}],type:"Update"},{id:853188252,predicate:"inputStickerSetItem",params:[{name:"flags",type:"#"},{name:"document",type:"InputDocument"},{name:"emoji",type:"string"},{name:"mask_coords",type:"flags.0?MaskCoords"},{name:"keywords",type:"flags.1?string"}],type:"InputStickerSetItem"},{id:-1425052898,predicate:"updatePhoneCall",params:[{name:"phone_call",type:"PhoneCall"}],type:"Update"},{id:506920429,predicate:"inputPhoneCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputPhoneCall"},{id:1399245077,predicate:"phoneCallEmpty",params:[{name:"id",type:"long"}],type:"PhoneCall"},{id:-987599081,predicate:"phoneCallWaiting",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"receive_date",type:"flags.0?int"}],type:"PhoneCall"},{id:347139340,predicate:"phoneCallRequested",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:912311057,predicate:"phoneCallAccepted",params:[{name:"flags",type:"#"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"PhoneCall"},{id:810769141,predicate:"phoneCall",params:[{name:"flags",type:"#"},{name:"p2p_allowed",type:"flags.5?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"date",type:"int"},{name:"admin_id",type:"long"},{name:"participant_id",type:"long"},{name:"g_a_or_b",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"},{name:"connections",type:"Vector<PhoneConnection>"},{name:"start_date",type:"int"},{name:"custom_parameters",type:"flags.7?DataJSON"}],type:"PhoneCall"},{id:1355435489,predicate:"phoneCallDiscarded",params:[{name:"flags",type:"#"},{name:"need_rating",type:"flags.2?true"},{name:"need_debug",type:"flags.3?true"},{name:"video",type:"flags.6?true"},{name:"id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"PhoneCall"},{id:-1665063993,predicate:"phoneConnection",params:[{name:"flags",type:"#"},{name:"tcp",type:"flags.0?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"peer_tag",type:"bytes"}],type:"PhoneConnection"},{id:-58224696,predicate:"phoneCallProtocol",params:[{name:"flags",type:"#"},{name:"udp_p2p",type:"flags.0?true"},{name:"udp_reflector",type:"flags.1?true"},{name:"min_layer",type:"int"},{name:"max_layer",type:"int"},{name:"library_versions",type:"Vector<string>"}],type:"PhoneCallProtocol"},{id:-326966976,predicate:"phone.phoneCall",params:[{name:"phone_call",type:"PhoneCall"},{name:"users",type:"Vector<User>"}],type:"phone.PhoneCall"},{id:-2134272152,predicate:"inputMessagesFilterPhoneCalls",params:[{name:"flags",type:"#"},{name:"missed",type:"flags.0?true"}],type:"MessagesFilter"},{id:-2132731265,predicate:"messageActionPhoneCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.2?true"},{name:"call_id",type:"long"},{name:"reason",type:"flags.0?PhoneCallDiscardReason"},{name:"duration",type:"flags.1?int"}],type:"MessageAction"},{id:2054952868,predicate:"inputMessagesFilterRoundVoice",params:[],type:"MessagesFilter"},{id:-1253451181,predicate:"inputMessagesFilterRoundVideo",params:[],type:"MessagesFilter"},{id:-1997373508,predicate:"sendMessageRecordRoundAction",params:[],type:"SendMessageAction"},{id:608050278,predicate:"sendMessageUploadRoundAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:-242427324,predicate:"upload.fileCdnRedirect",params:[{name:"dc_id",type:"int"},{name:"file_token",type:"bytes"},{name:"encryption_key",type:"bytes"},{name:"encryption_iv",type:"bytes"},{name:"file_hashes",type:"Vector<FileHash>"}],type:"upload.File"},{id:-290921362,predicate:"upload.cdnFileReuploadNeeded",params:[{name:"request_token",type:"bytes"}],type:"upload.CdnFile"},{id:-1449145777,predicate:"upload.cdnFile",params:[{name:"bytes",type:"bytes"}],type:"upload.CdnFile"},{id:-914167110,predicate:"cdnPublicKey",params:[{name:"dc_id",type:"int"},{name:"public_key",type:"string"}],type:"CdnPublicKey"},{id:1462101002,predicate:"cdnConfig",params:[{name:"public_keys",type:"Vector<CdnPublicKey>"}],type:"CdnConfig"},{id:-283684427,predicate:"pageBlockChannel",params:[{name:"channel",type:"Chat"}],type:"PageBlock"},{id:-892239370,predicate:"langPackString",params:[{name:"key",type:"string"},{name:"value",type:"string"}],type:"LangPackString"},{id:1816636575,predicate:"langPackStringPluralized",params:[{name:"flags",type:"#"},{name:"key",type:"string"},{name:"zero_value",type:"flags.0?string"},{name:"one_value",type:"flags.1?string"},{name:"two_value",type:"flags.2?string"},{name:"few_value",type:"flags.3?string"},{name:"many_value",type:"flags.4?string"},{name:"other_value",type:"string"}],type:"LangPackString"},{id:695856818,predicate:"langPackStringDeleted",params:[{name:"key",type:"string"}],type:"LangPackString"},{id:-209337866,predicate:"langPackDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"strings",type:"Vector<LangPackString>"}],type:"LangPackDifference"},{id:-288727837,predicate:"langPackLanguage",params:[{name:"flags",type:"#"},{name:"official",type:"flags.0?true"},{name:"rtl",type:"flags.2?true"},{name:"beta",type:"flags.3?true"},{name:"name",type:"string"},{name:"native_name",type:"string"},{name:"lang_code",type:"string"},{name:"base_lang_code",type:"flags.1?string"},{name:"plural_code",type:"string"},{name:"strings_count",type:"int"},{name:"translated_count",type:"int"},{name:"translations_url",type:"string"}],type:"LangPackLanguage"},{id:1180041828,predicate:"updateLangPackTooLong",params:[{name:"lang_code",type:"string"}],type:"Update"},{id:1442983757,predicate:"updateLangPack",params:[{name:"difference",type:"LangPackDifference"}],type:"Update"},{id:885242707,predicate:"channelParticipantAdmin",params:[{name:"flags",type:"#"},{name:"can_edit",type:"flags.0?true"},{name:"self",type:"flags.1?true"},{name:"user_id",type:"long"},{name:"inviter_id",type:"flags.1?long"},{name:"promoted_by",type:"long"},{name:"date",type:"int"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"flags.2?string"}],type:"ChannelParticipant"},{id:1844969806,predicate:"channelParticipantBanned",params:[{name:"flags",type:"#"},{name:"left",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"kicked_by",type:"long"},{name:"date",type:"int"},{name:"banned_rights",type:"ChatBannedRights"}],type:"ChannelParticipant"},{id:338142689,predicate:"channelParticipantsBanned",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:106343499,predicate:"channelParticipantsSearch",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:-421545947,predicate:"channelAdminLogEventActionChangeTitle",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1427671598,predicate:"channelAdminLogEventActionChangeAbout",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1783299128,predicate:"channelAdminLogEventActionChangeUsername",params:[{name:"prev_value",type:"string"},{name:"new_value",type:"string"}],type:"ChannelAdminLogEventAction"},{id:1129042607,predicate:"channelAdminLogEventActionChangePhoto",params:[{name:"prev_photo",type:"Photo"},{name:"new_photo",type:"Photo"}],type:"ChannelAdminLogEventAction"},{id:460916654,predicate:"channelAdminLogEventActionToggleInvites",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:648939889,predicate:"channelAdminLogEventActionToggleSignatures",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-370660328,predicate:"channelAdminLogEventActionUpdatePinned",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1889215493,predicate:"channelAdminLogEventActionEditMessage",params:[{name:"prev_message",type:"Message"},{name:"new_message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:1121994683,predicate:"channelAdminLogEventActionDeleteMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:405815507,predicate:"channelAdminLogEventActionParticipantJoin",params:[],type:"ChannelAdminLogEventAction"},{id:-124291086,predicate:"channelAdminLogEventActionParticipantLeave",params:[],type:"ChannelAdminLogEventAction"},{id:-484690728,predicate:"channelAdminLogEventActionParticipantInvite",params:[{name:"participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-422036098,predicate:"channelAdminLogEventActionParticipantToggleBan",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:-714643696,predicate:"channelAdminLogEventActionParticipantToggleAdmin",params:[{name:"prev_participant",type:"ChannelParticipant"},{name:"new_participant",type:"ChannelParticipant"}],type:"ChannelAdminLogEventAction"},{id:531458253,predicate:"channelAdminLogEvent",params:[{name:"id",type:"long"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"action",type:"ChannelAdminLogEventAction"}],type:"ChannelAdminLogEvent"},{id:-309659827,predicate:"channels.adminLogResults",params:[{name:"events",type:"Vector<ChannelAdminLogEvent>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"channels.AdminLogResults"},{id:-368018716,predicate:"channelAdminLogEventsFilter",params:[{name:"flags",type:"#"},{name:"join",type:"flags.0?true"},{name:"leave",type:"flags.1?true"},{name:"invite",type:"flags.2?true"},{name:"ban",type:"flags.3?true"},{name:"unban",type:"flags.4?true"},{name:"kick",type:"flags.5?true"},{name:"unkick",type:"flags.6?true"},{name:"promote",type:"flags.7?true"},{name:"demote",type:"flags.8?true"},{name:"info",type:"flags.9?true"},{name:"settings",type:"flags.10?true"},{name:"pinned",type:"flags.11?true"},{name:"edit",type:"flags.12?true"},{name:"delete",type:"flags.13?true"},{name:"group_call",type:"flags.14?true"},{name:"invites",type:"flags.15?true"},{name:"send",type:"flags.16?true"},{name:"forums",type:"flags.17?true"}],type:"ChannelAdminLogEventsFilter"},{id:511092620,predicate:"topPeerCategoryPhoneCalls",params:[],type:"TopPeerCategory"},{id:-2143067670,predicate:"pageBlockAudio",params:[{name:"audio_id",type:"long"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:1558266229,predicate:"popularContact",params:[{name:"client_id",type:"long"},{name:"importers",type:"int"}],type:"PopularContact"},{id:1200788123,predicate:"messageActionScreenshotTaken",params:[],type:"MessageAction"},{id:-1634752813,predicate:"messages.favedStickersNotModified",params:[],type:"messages.FavedStickers"},{id:750063767,predicate:"messages.favedStickers",params:[{name:"hash",type:"long"},{name:"packs",type:"Vector<StickerPack>"},{name:"stickers",type:"Vector<Document>"}],type:"messages.FavedStickers"},{id:-451831443,predicate:"updateFavedStickers",params:[],type:"Update"},{id:-366410403,predicate:"updateChannelReadMessagesContents",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"messages",type:"Vector<int>"}],type:"Update"},{id:-1040652646,predicate:"inputMessagesFilterMyMentions",params:[],type:"MessagesFilter"},{id:1887741886,predicate:"updateContactsReset",params:[],type:"Update"},{id:-1312568665,predicate:"channelAdminLogEventActionChangeStickerSet",params:[{name:"prev_stickerset",type:"InputStickerSet"},{name:"new_stickerset",type:"InputStickerSet"}],type:"ChannelAdminLogEventAction"},{id:-85549226,predicate:"messageActionCustomAction",params:[{name:"message",type:"string"}],type:"MessageAction"},{id:178373535,predicate:"inputPaymentCredentialsApplePay",params:[{name:"payment_data",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:-419271411,predicate:"inputMessagesFilterGeo",params:[],type:"MessagesFilter"},{id:-530392189,predicate:"inputMessagesFilterContacts",params:[],type:"MessagesFilter"},{id:-1304443240,predicate:"updateChannelAvailableMessages",params:[{name:"channel_id",type:"long"},{name:"available_min_id",type:"int"}],type:"Update"},{id:1599903217,predicate:"channelAdminLogEventActionTogglePreHistoryHidden",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1759532989,predicate:"inputMediaGeoLive",params:[{name:"flags",type:"#"},{name:"stopped",type:"flags.0?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"heading",type:"flags.2?int"},{name:"period",type:"flags.1?int"},{name:"proximity_notification_radius",type:"flags.3?int"}],type:"InputMedia"},{id:-1186937242,predicate:"messageMediaGeoLive",params:[{name:"flags",type:"#"},{name:"geo",type:"GeoPoint"},{name:"heading",type:"flags.0?int"},{name:"period",type:"int"},{name:"proximity_notification_radius",type:"flags.1?int"}],type:"MessageMedia"},{id:1189204285,predicate:"recentMeUrlUnknown",params:[{name:"url",type:"string"}],type:"RecentMeUrl"},{id:-1188296222,predicate:"recentMeUrlUser",params:[{name:"url",type:"string"},{name:"user_id",type:"long"}],type:"RecentMeUrl"},{id:-1294306862,predicate:"recentMeUrlChat",params:[{name:"url",type:"string"},{name:"chat_id",type:"long"}],type:"RecentMeUrl"},{id:-347535331,predicate:"recentMeUrlChatInvite",params:[{name:"url",type:"string"},{name:"chat_invite",type:"ChatInvite"}],type:"RecentMeUrl"},{id:-1140172836,predicate:"recentMeUrlStickerSet",params:[{name:"url",type:"string"},{name:"set",type:"StickerSetCovered"}],type:"RecentMeUrl"},{id:235081943,predicate:"help.recentMeUrls",params:[{name:"urls",type:"Vector<RecentMeUrl>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"help.RecentMeUrls"},{id:-266911767,predicate:"channels.channelParticipantsNotModified",params:[],type:"channels.ChannelParticipants"},{id:1951620897,predicate:"messages.messagesNotModified",params:[{name:"count",type:"int"}],type:"messages.Messages"},{id:482797855,predicate:"inputSingleMedia",params:[{name:"flags",type:"#"},{name:"media",type:"InputMedia"},{name:"random_id",type:"long"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector<MessageEntity>"}],type:"InputSingleMedia"},{id:-1493633966,predicate:"webAuthorization",params:[{name:"hash",type:"long"},{name:"bot_id",type:"long"},{name:"domain",type:"string"},{name:"browser",type:"string"},{name:"platform",type:"string"},{name:"date_created",type:"int"},{name:"date_active",type:"int"},{name:"ip",type:"string"},{name:"region",type:"string"}],type:"WebAuthorization"},{id:-313079300,predicate:"account.webAuthorizations",params:[{name:"authorizations",type:"Vector<WebAuthorization>"},{name:"users",type:"Vector<User>"}],type:"account.WebAuthorizations"},{id:-1502174430,predicate:"inputMessageID",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-1160215659,predicate:"inputMessageReplyTo",params:[{name:"id",type:"int"}],type:"InputMessage"},{id:-2037963464,predicate:"inputMessagePinned",params:[],type:"InputMessage"},{id:-1687559349,predicate:"messageEntityPhone",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1280209983,predicate:"messageEntityCashtag",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-988359047,predicate:"messageActionBotAllowed",params:[{name:"flags",type:"#"},{name:"attach_menu",type:"flags.1?true"},{name:"from_request",type:"flags.3?true"},{name:"domain",type:"flags.0?string"},{name:"app",type:"flags.2?BotApp"}],type:"MessageAction"},{id:-55902537,predicate:"inputDialogPeer",params:[{name:"peer",type:"InputPeer"}],type:"InputDialogPeer"},{id:-445792507,predicate:"dialogPeer",params:[{name:"peer",type:"Peer"}],type:"DialogPeer"},{id:223655517,predicate:"messages.foundStickerSetsNotModified",params:[],type:"messages.FoundStickerSets"},{id:-1963942446,predicate:"messages.foundStickerSets",params:[{name:"hash",type:"long"},{name:"sets",type:"Vector<StickerSetCovered>"}],type:"messages.FoundStickerSets"},{id:-207944868,predicate:"fileHash",params:[{name:"offset",type:"long"},{name:"limit",type:"int"},{name:"hash",type:"bytes"}],type:"FileHash"},{id:-104284986,predicate:"webDocumentNoProxy",params:[{name:"url",type:"string"},{name:"size",type:"int"},{name:"mime_type",type:"string"},{name:"attributes",type:"Vector<DocumentAttribute>"}],type:"WebDocument"},{id:1968737087,predicate:"inputClientProxy",params:[{name:"address",type:"string"},{name:"port",type:"int"}],type:"InputClientProxy"},{id:-483352705,predicate:"help.termsOfServiceUpdateEmpty",params:[{name:"expires",type:"int"}],type:"help.TermsOfServiceUpdate"},{id:686618977,predicate:"help.termsOfServiceUpdate",params:[{name:"expires",type:"int"},{name:"terms_of_service",type:"help.TermsOfService"}],type:"help.TermsOfServiceUpdate"},{id:859091184,predicate:"inputSecureFileUploaded",params:[{name:"id",type:"long"},{name:"parts",type:"int"},{name:"md5_checksum",type:"string"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"InputSecureFile"},{id:1399317950,predicate:"inputSecureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputSecureFile"},{id:-876089816,predicate:"inputSecureFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputFileLocation"},{id:1679398724,predicate:"secureFileEmpty",params:[],type:"SecureFile"},{id:2097791614,predicate:"secureFile",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"size",type:"long"},{name:"dc_id",type:"int"},{name:"date",type:"int"},{name:"file_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureFile"},{id:-1964327229,predicate:"secureData",params:[{name:"data",type:"bytes"},{name:"data_hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureData"},{id:2103482845,predicate:"securePlainPhone",params:[{name:"phone",type:"string"}],type:"SecurePlainData"},{id:569137759,predicate:"securePlainEmail",params:[{name:"email",type:"string"}],type:"SecurePlainData"},{id:-1658158621,predicate:"secureValueTypePersonalDetails",params:[],type:"SecureValueType"},{id:1034709504,predicate:"secureValueTypePassport",params:[],type:"SecureValueType"},{id:115615172,predicate:"secureValueTypeDriverLicense",params:[],type:"SecureValueType"},{id:-1596951477,predicate:"secureValueTypeIdentityCard",params:[],type:"SecureValueType"},{id:-1717268701,predicate:"secureValueTypeInternalPassport",params:[],type:"SecureValueType"},{id:-874308058,predicate:"secureValueTypeAddress",params:[],type:"SecureValueType"},{id:-63531698,predicate:"secureValueTypeUtilityBill",params:[],type:"SecureValueType"},{id:-1995211763,predicate:"secureValueTypeBankStatement",params:[],type:"SecureValueType"},{id:-1954007928,predicate:"secureValueTypeRentalAgreement",params:[],type:"SecureValueType"},{id:-1713143702,predicate:"secureValueTypePassportRegistration",params:[],type:"SecureValueType"},{id:-368907213,predicate:"secureValueTypeTemporaryRegistration",params:[],type:"SecureValueType"},{id:-1289704741,predicate:"secureValueTypePhone",params:[],type:"SecureValueType"},{id:-1908627474,predicate:"secureValueTypeEmail",params:[],type:"SecureValueType"},{id:411017418,predicate:"secureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?SecureFile"},{name:"reverse_side",type:"flags.2?SecureFile"},{name:"selfie",type:"flags.3?SecureFile"},{name:"translation",type:"flags.6?Vector<SecureFile>"},{name:"files",type:"flags.4?Vector<SecureFile>"},{name:"plain_data",type:"flags.5?SecurePlainData"},{name:"hash",type:"bytes"}],type:"SecureValue"},{id:-618540889,predicate:"inputSecureValue",params:[{name:"flags",type:"#"},{name:"type",type:"SecureValueType"},{name:"data",type:"flags.0?SecureData"},{name:"front_side",type:"flags.1?InputSecureFile"},{name:"reverse_side",type:"flags.2?InputSecureFile"},{name:"selfie",type:"flags.3?InputSecureFile"},{name:"translation",type:"flags.6?Vector<InputSecureFile>"},{name:"files",type:"flags.4?Vector<InputSecureFile>"},{name:"plain_data",type:"flags.5?SecurePlainData"}],type:"InputSecureValue"},{id:-316748368,predicate:"secureValueHash",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"}],type:"SecureValueHash"},{id:-391902247,predicate:"secureValueErrorData",params:[{name:"type",type:"SecureValueType"},{name:"data_hash",type:"bytes"},{name:"field",type:"string"},{name:"text",type:"string"}],type:"SecureValueError"},{id:12467706,predicate:"secureValueErrorFrontSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2037765467,predicate:"secureValueErrorReverseSide",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-449327402,predicate:"secureValueErrorSelfie",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:2054162547,predicate:"secureValueErrorFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:1717706985,predicate:"secureValueErrorFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector<bytes>"},{name:"text",type:"string"}],type:"SecureValueError"},{id:871426631,predicate:"secureCredentialsEncrypted",params:[{name:"data",type:"bytes"},{name:"hash",type:"bytes"},{name:"secret",type:"bytes"}],type:"SecureCredentialsEncrypted"},{id:-1389486888,predicate:"account.authorizationForm",params:[{name:"flags",type:"#"},{name:"required_types",type:"Vector<SecureRequiredType>"},{name:"values",type:"Vector<SecureValue>"},{name:"errors",type:"Vector<SecureValueError>"},{name:"users",type:"Vector<User>"},{name:"privacy_policy_url",type:"flags.0?string"}],type:"account.AuthorizationForm"},{id:-2128640689,predicate:"account.sentEmailCode",params:[{name:"email_pattern",type:"string"},{name:"length",type:"int"}],type:"account.SentEmailCode"},{id:455635795,predicate:"messageActionSecureValuesSentMe",params:[{name:"values",type:"Vector<SecureValue>"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"MessageAction"},{id:-648257196,predicate:"messageActionSecureValuesSent",params:[{name:"types",type:"Vector<SecureValueType>"}],type:"MessageAction"},{id:1722786150,predicate:"help.deepLinkInfoEmpty",params:[],type:"help.DeepLinkInfo"},{id:1783556146,predicate:"help.deepLinkInfo",params:[{name:"flags",type:"#"},{name:"update_app",type:"flags.0?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"}],type:"help.DeepLinkInfo"},{id:289586518,predicate:"savedPhoneContact",params:[{name:"phone",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"date",type:"int"}],type:"SavedContact"},{id:1304052993,predicate:"account.takeout",params:[{name:"id",type:"long"}],type:"account.Takeout"},{id:700340377,predicate:"inputTakeoutFileLocation",params:[],type:"InputFileLocation"},{id:-513517117,predicate:"updateDialogUnreadMark",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:-253500010,predicate:"messages.dialogsNotModified",params:[{name:"count",type:"int"}],type:"messages.Dialogs"},{id:-1625153079,predicate:"inputWebFileGeoPointLocation",params:[{name:"geo_point",type:"InputGeoPoint"},{name:"access_hash",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"zoom",type:"int"},{name:"scale",type:"int"}],type:"InputWebFileLocation"},{id:-1255369827,predicate:"contacts.topPeersDisabled",params:[],type:"contacts.TopPeers"},{id:-1685456582,predicate:"inputReportReasonCopyright",params:[],type:"ReportReason"},{id:-732254058,predicate:"passwordKdfAlgoUnknown",params:[],type:"PasswordKdfAlgo"},{id:4883767,predicate:"securePasswordKdfAlgoUnknown",params:[],type:"SecurePasswordKdfAlgo"},{id:-1141711456,predicate:"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:-2042159726,predicate:"securePasswordKdfAlgoSHA512",params:[{name:"salt",type:"bytes"}],type:"SecurePasswordKdfAlgo"},{id:354925740,predicate:"secureSecretSettings",params:[{name:"secure_algo",type:"SecurePasswordKdfAlgo"},{name:"secure_secret",type:"bytes"},{name:"secure_secret_id",type:"long"}],type:"SecureSecretSettings"},{id:982592842,predicate:"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow",params:[{name:"salt1",type:"bytes"},{name:"salt2",type:"bytes"},{name:"g",type:"int"},{name:"p",type:"bytes"}],type:"PasswordKdfAlgo"},{id:-1736378792,predicate:"inputCheckPasswordEmpty",params:[],type:"InputCheckPasswordSRP"},{id:-763367294,predicate:"inputCheckPasswordSRP",params:[{name:"srp_id",type:"long"},{name:"A",type:"bytes"},{name:"M1",type:"bytes"}],type:"InputCheckPasswordSRP"},{id:-2036501105,predicate:"secureValueError",params:[{name:"type",type:"SecureValueType"},{name:"hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-1592506512,predicate:"secureValueErrorTranslationFile",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"bytes"},{name:"text",type:"string"}],type:"SecureValueError"},{id:878931416,predicate:"secureValueErrorTranslationFiles",params:[{name:"type",type:"SecureValueType"},{name:"file_hash",type:"Vector<bytes>"},{name:"text",type:"string"}],type:"SecureValueError"},{id:-2103600678,predicate:"secureRequiredType",params:[{name:"flags",type:"#"},{name:"native_names",type:"flags.0?true"},{name:"selfie_required",type:"flags.1?true"},{name:"translation_required",type:"flags.2?true"},{name:"type",type:"SecureValueType"}],type:"SecureRequiredType"},{id:41187252,predicate:"secureRequiredTypeOneOf",params:[{name:"types",type:"Vector<SecureRequiredType>"}],type:"SecureRequiredType"},{id:-1078332329,predicate:"help.passportConfigNotModified",params:[],type:"help.PassportConfig"},{id:-1600596305,predicate:"help.passportConfig",params:[{name:"hash",type:"int"},{name:"countries_langs",type:"DataJSON"}],type:"help.PassportConfig"},{id:488313413,predicate:"inputAppEvent",params:[{name:"time",type:"double"},{name:"type",type:"string"},{name:"peer",type:"long"},{name:"data",type:"JSONValue"}],type:"InputAppEvent"},{id:-1059185703,predicate:"jsonObjectValue",params:[{name:"key",type:"string"},{name:"value",type:"JSONValue"}],type:"JSONObjectValue"},{id:1064139624,predicate:"jsonNull",params:[],type:"JSONValue"},{id:-952869270,predicate:"jsonBool",params:[{name:"value",type:"Bool"}],type:"JSONValue"},{id:736157604,predicate:"jsonNumber",params:[{name:"value",type:"double"}],type:"JSONValue"},{id:-1222740358,predicate:"jsonString",params:[{name:"value",type:"string"}],type:"JSONValue"},{id:-146520221,predicate:"jsonArray",params:[{name:"value",type:"Vector<JSONValue>"}],type:"JSONValue"},{id:-1715350371,predicate:"jsonObject",params:[{name:"value",type:"Vector<JSONObjectValue>"}],type:"JSONValue"},{id:-1311015810,predicate:"inputNotifyBroadcasts",params:[],type:"InputNotifyPeer"},{id:-703403793,predicate:"notifyBroadcasts",params:[],type:"NotifyPeer"},{id:-311786236,predicate:"textSubscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:-939827711,predicate:"textSuperscript",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:55281185,predicate:"textMarked",params:[{name:"text",type:"RichText"}],type:"RichText"},{id:483104362,predicate:"textPhone",params:[{name:"text",type:"RichText"},{name:"phone",type:"string"}],type:"RichText"},{id:136105807,predicate:"textImage",params:[{name:"document_id",type:"long"},{name:"w",type:"int"},{name:"h",type:"int"}],type:"RichText"},{id:504660880,predicate:"pageBlockKicker",params:[{name:"text",type:"RichText"}],type:"PageBlock"},{id:878078826,predicate:"pageTableCell",params:[{name:"flags",type:"#"},{name:"header",type:"flags.0?true"},{name:"align_center",type:"flags.3?true"},{name:"align_right",type:"flags.4?true"},{name:"valign_middle",type:"flags.5?true"},{name:"valign_bottom",type:"flags.6?true"},{name:"text",type:"flags.7?RichText"},{name:"colspan",type:"flags.1?int"},{name:"rowspan",type:"flags.2?int"}],type:"PageTableCell"},{id:-524237339,predicate:"pageTableRow",params:[{name:"cells",type:"Vector<PageTableCell>"}],type:"PageTableRow"},{id:-1085412734,predicate:"pageBlockTable",params:[{name:"flags",type:"#"},{name:"bordered",type:"flags.0?true"},{name:"striped",type:"flags.1?true"},{name:"title",type:"RichText"},{name:"rows",type:"Vector<PageTableRow>"}],type:"PageBlock"},{id:1869903447,predicate:"pageCaption",params:[{name:"text",type:"RichText"},{name:"credit",type:"RichText"}],type:"PageCaption"},{id:-1188055347,predicate:"pageListItemText",params:[{name:"text",type:"RichText"}],type:"PageListItem"},{id:635466748,predicate:"pageListItemBlocks",params:[{name:"blocks",type:"Vector<PageBlock>"}],type:"PageListItem"},{id:1577484359,predicate:"pageListOrderedItemText",params:[{name:"num",type:"string"},{name:"text",type:"RichText"}],type:"PageListOrderedItem"},{id:-1730311882,predicate:"pageListOrderedItemBlocks",params:[{name:"num",type:"string"},{name:"blocks",type:"Vector<PageBlock>"}],type:"PageListOrderedItem"},{id:-1702174239,predicate:"pageBlockOrderedList",params:[{name:"items",type:"Vector<PageListOrderedItem>"}],type:"PageBlock"},{id:1987480557,predicate:"pageBlockDetails",params:[{name:"flags",type:"#"},{name:"open",type:"flags.0?true"},{name:"blocks",type:"Vector<PageBlock>"},{name:"title",type:"RichText"}],type:"PageBlock"},{id:-1282352120,predicate:"pageRelatedArticle",params:[{name:"flags",type:"#"},{name:"url",type:"string"},{name:"webpage_id",type:"long"},{name:"title",type:"flags.0?string"},{name:"description",type:"flags.1?string"},{name:"photo_id",type:"flags.2?long"},{name:"author",type:"flags.3?string"},{name:"published_date",type:"flags.4?int"}],type:"PageRelatedArticle"},{id:370236054,predicate:"pageBlockRelatedArticles",params:[{name:"title",type:"RichText"},{name:"articles",type:"Vector<PageRelatedArticle>"}],type:"PageBlock"},{id:-1538310410,predicate:"pageBlockMap",params:[{name:"geo",type:"GeoPoint"},{name:"zoom",type:"int"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"caption",type:"PageCaption"}],type:"PageBlock"},{id:-1738178803,predicate:"page",params:[{name:"flags",type:"#"},{name:"part",type:"flags.0?true"},{name:"rtl",type:"flags.1?true"},{name:"v2",type:"flags.2?true"},{name:"url",type:"string"},{name:"blocks",type:"Vector<PageBlock>"},{name:"photos",type:"Vector<Photo>"},{name:"documents",type:"Vector<Document>"},{name:"views",type:"flags.3?int"}],type:"Page"},{id:-610373422,predicate:"inputPrivacyKeyPhoneP2P",params:[],type:"InputPrivacyKey"},{id:961092808,predicate:"privacyKeyPhoneP2P",params:[],type:"PrivacyKey"},{id:894777186,predicate:"textAnchor",params:[{name:"text",type:"RichText"},{name:"name",type:"string"}],type:"RichText"},{id:-1945767479,predicate:"help.supportName",params:[{name:"name",type:"string"}],type:"help.SupportName"},{id:-206688531,predicate:"help.userInfoEmpty",params:[],type:"help.UserInfo"},{id:32192344,predicate:"help.userInfo",params:[{name:"message",type:"string"},{name:"entities",type:"Vector<MessageEntity>"},{name:"author",type:"string"},{name:"date",type:"int"}],type:"help.UserInfo"},{id:-202219658,predicate:"messageActionContactSignUp",params:[],type:"MessageAction"},{id:-1398708869,predicate:"updateMessagePoll",params:[{name:"flags",type:"#"},{name:"poll_id",type:"long"},{name:"poll",type:"flags.0?Poll"},{name:"results",type:"PollResults"}],type:"Update"},{id:-15277366,predicate:"pollAnswer",params:[{name:"text",type:"TextWithEntities"},{name:"option",type:"bytes"}],type:"PollAnswer"},{id:1484026161,predicate:"poll",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"closed",type:"flags.0?true"},{name:"public_voters",type:"flags.1?true"},{name:"multiple_choice",type:"flags.2?true"},{name:"quiz",type:"flags.3?true"},{name:"question",type:"TextWithEntities"},{name:"answers",type:"Vector<PollAnswer>"},{name:"close_period",type:"flags.4?int"},{name:"close_date",type:"flags.5?int"}],type:"Poll"},{id:997055186,predicate:"pollAnswerVoters",params:[{name:"flags",type:"#"},{name:"chosen",type:"flags.0?true"},{name:"correct",type:"flags.1?true"},{name:"option",type:"bytes"},{name:"voters",type:"int"}],type:"PollAnswerVoters"},{id:2061444128,predicate:"pollResults",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"results",type:"flags.1?Vector<PollAnswerVoters>"},{name:"total_voters",type:"flags.2?int"},{name:"recent_voters",type:"flags.3?Vector<Peer>"},{name:"solution",type:"flags.4?string"},{name:"solution_entities",type:"flags.4?Vector<MessageEntity>"}],type:"PollResults"},{id:261416433,predicate:"inputMediaPoll",params:[{name:"flags",type:"#"},{name:"poll",type:"Poll"},{name:"correct_answers",type:"flags.0?Vector<bytes>"},{name:"solution",type:"flags.1?string"},{name:"solution_entities",type:"flags.1?Vector<MessageEntity>"}],type:"InputMedia"},{id:1272375192,predicate:"messageMediaPoll",params:[{name:"poll",type:"Poll"},{name:"results",type:"PollResults"}],type:"MessageMedia"},{id:-264117680,predicate:"chatOnlines",params:[{name:"onlines",type:"int"}],type:"ChatOnlines"},{id:1202287072,predicate:"statsURL",params:[{name:"url",type:"string"}],type:"StatsURL"},{id:-525288402,predicate:"photoStrippedSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:1605510357,predicate:"chatAdminRights",params:[{name:"flags",type:"#"},{name:"change_info",type:"flags.0?true"},{name:"post_messages",type:"flags.1?true"},{name:"edit_messages",type:"flags.2?true"},{name:"delete_messages",type:"flags.3?true"},{name:"ban_users",type:"flags.4?true"},{name:"invite_users",type:"flags.5?true"},{name:"pin_messages",type:"flags.7?true"},{name:"add_admins",type:"flags.9?true"},{name:"anonymous",type:"flags.10?true"},{name:"manage_call",type:"flags.11?true"},{name:"other",type:"flags.12?true"},{name:"manage_topics",type:"flags.13?true"},{name:"post_stories",type:"flags.14?true"},{name:"edit_stories",type:"flags.15?true"},{name:"delete_stories",type:"flags.16?true"}],type:"ChatAdminRights"},{id:-1626209256,predicate:"chatBannedRights",params:[{name:"flags",type:"#"},{name:"view_messages",type:"flags.0?true"},{name:"send_messages",type:"flags.1?true"},{name:"send_media",type:"flags.2?true"},{name:"send_stickers",type:"flags.3?true"},{name:"send_gifs",type:"flags.4?true"},{name:"send_games",type:"flags.5?true"},{name:"send_inline",type:"flags.6?true"},{name:"embed_links",type:"flags.7?true"},{name:"send_polls",type:"flags.8?true"},{name:"change_info",type:"flags.10?true"},{name:"invite_users",type:"flags.15?true"},{name:"pin_messages",type:"flags.17?true"},{name:"manage_topics",type:"flags.18?true"},{name:"send_photos",type:"flags.19?true"},{name:"send_videos",type:"flags.20?true"},{name:"send_roundvideos",type:"flags.21?true"},{name:"send_audios",type:"flags.22?true"},{name:"send_voices",type:"flags.23?true"},{name:"send_docs",type:"flags.24?true"},{name:"send_plain",type:"flags.25?true"},{name:"until_date",type:"int"}],type:"ChatBannedRights"},{id:1421875280,predicate:"updateChatDefaultBannedRights",params:[{name:"peer",type:"Peer"},{name:"default_banned_rights",type:"ChatBannedRights"},{name:"version",type:"int"}],type:"Update"},{id:-433014407,predicate:"inputWallPaper",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputWallPaper"},{id:1913199744,predicate:"inputWallPaperSlug",params:[{name:"slug",type:"string"}],type:"InputWallPaper"},{id:-1150621555,predicate:"channelParticipantsContacts",params:[{name:"q",type:"string"}],type:"ChannelParticipantsFilter"},{id:771095562,predicate:"channelAdminLogEventActionDefaultBannedRights",params:[{name:"prev_banned_rights",type:"ChatBannedRights"},{name:"new_banned_rights",type:"ChatBannedRights"}],type:"ChannelAdminLogEventAction"},{id:-1895328189,predicate:"channelAdminLogEventActionStopPoll",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:471437699,predicate:"account.wallPapersNotModified",params:[],type:"account.WallPapers"},{id:-842824308,predicate:"account.wallPapers",params:[{name:"hash",type:"long"},{name:"wallpapers",type:"Vector<WallPaper>"}],type:"account.WallPapers"},{id:-1390068360,predicate:"codeSettings",params:[{name:"flags",type:"#"},{name:"allow_flashcall",type:"flags.0?true"},{name:"current_number",type:"flags.1?true"},{name:"allow_app_hash",type:"flags.4?true"},{name:"allow_missed_call",type:"flags.5?true"},{name:"allow_firebase",type:"flags.7?true"},{name:"unknown_number",type:"flags.9?true"},{name:"logout_tokens",type:"flags.6?Vector<bytes>"},{name:"token",type:"flags.8?string"},{name:"app_sandbox",type:"flags.8?Bool"}],type:"CodeSettings"},{id:925826256,predicate:"wallPaperSettings",params:[{name:"flags",type:"#"},{name:"blur",type:"flags.1?true"},{name:"motion",type:"flags.2?true"},{name:"background_color",type:"flags.0?int"},{name:"second_background_color",type:"flags.4?int"},{name:"third_background_color",type:"flags.5?int"},{name:"fourth_background_color",type:"flags.6?int"},{name:"intensity",type:"flags.3?int"},{name:"rotation",type:"flags.4?int"},{name:"emoticon",type:"flags.7?string"}],type:"WallPaperSettings"},{id:-1163561432,predicate:"autoDownloadSettings",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"video_preload_large",type:"flags.1?true"},{name:"audio_preload_next",type:"flags.2?true"},{name:"phonecalls_less_data",type:"flags.3?true"},{name:"stories_preload",type:"flags.4?true"},{name:"photo_size_max",type:"int"},{name:"video_size_max",type:"long"},{name:"file_size_max",type:"long"},{name:"video_upload_maxbitrate",type:"int"},{name:"small_queue_active_operations_max",type:"int"},{name:"large_queue_active_operations_max",type:"int"}],type:"AutoDownloadSettings"},{id:1674235686,predicate:"account.autoDownloadSettings",params:[{name:"low",type:"AutoDownloadSettings"},{name:"medium",type:"AutoDownloadSettings"},{name:"high",type:"AutoDownloadSettings"}],type:"account.AutoDownloadSettings"},{id:-709641735,predicate:"emojiKeyword",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector<string>"}],type:"EmojiKeyword"},{id:594408994,predicate:"emojiKeywordDeleted",params:[{name:"keyword",type:"string"},{name:"emoticons",type:"Vector<string>"}],type:"EmojiKeyword"},{id:1556570557,predicate:"emojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"},{name:"version",type:"int"},{name:"keywords",type:"Vector<EmojiKeyword>"}],type:"EmojiKeywordsDifference"},{id:-1519029347,predicate:"emojiURL",params:[{name:"url",type:"string"}],type:"EmojiURL"},{id:-1275374751,predicate:"emojiLanguage",params:[{name:"lang_code",type:"string"}],type:"EmojiLanguage"},{id:-1529000952,predicate:"inputPrivacyKeyForwards",params:[],type:"InputPrivacyKey"},{id:1777096355,predicate:"privacyKeyForwards",params:[],type:"PrivacyKey"},{id:1461304012,predicate:"inputPrivacyKeyProfilePhoto",params:[],type:"InputPrivacyKey"},{id:-1777000467,predicate:"privacyKeyProfilePhoto",params:[],type:"PrivacyKey"},{id:1075322878,predicate:"inputPhotoFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"thumb_size",type:"string"}],type:"InputFileLocation"},{id:-667654413,predicate:"inputPhotoLegacyFileLocation",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"file_reference",type:"bytes"},{name:"volume_id",type:"long"},{name:"local_id",type:"int"},{name:"secret",type:"long"}],type:"InputFileLocation"},{id:925204121,predicate:"inputPeerPhotoFileLocation",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"photo_id",type:"long"}],type:"InputFileLocation"},{id:-1652231205,predicate:"inputStickerSetThumb",params:[{name:"stickerset",type:"InputStickerSet"},{name:"thumb_version",type:"int"}],type:"InputFileLocation"},{id:-11252123,predicate:"folder",params:[{name:"flags",type:"#"},{name:"autofill_new_broadcasts",type:"flags.0?true"},{name:"autofill_public_groups",type:"flags.1?true"},{name:"autofill_new_correspondents",type:"flags.2?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"photo",type:"flags.3?ChatPhoto"}],type:"Folder"},{id:1908216652,predicate:"dialogFolder",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"folder",type:"Folder"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"},{name:"unread_muted_peers_count",type:"int"},{name:"unread_unmuted_peers_count",type:"int"},{name:"unread_muted_messages_count",type:"int"},{name:"unread_unmuted_messages_count",type:"int"}],type:"Dialog"},{id:1684014375,predicate:"inputDialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"InputDialogPeer"},{id:1363483106,predicate:"dialogPeerFolder",params:[{name:"folder_id",type:"int"}],type:"DialogPeer"},{id:-70073706,predicate:"inputFolderPeer",params:[{name:"peer",type:"InputPeer"},{name:"folder_id",type:"int"}],type:"InputFolderPeer"},{id:-373643672,predicate:"folderPeer",params:[{name:"peer",type:"Peer"},{name:"folder_id",type:"int"}],type:"FolderPeer"},{id:422972864,predicate:"updateFolderPeers",params:[{name:"folder_peers",type:"Vector<FolderPeer>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:497305826,predicate:"inputUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputUser"},{id:1536380829,predicate:"inputChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputChannel"},{id:-1468331492,predicate:"inputPeerUserFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"user_id",type:"long"}],type:"InputPeer"},{id:-1121318848,predicate:"inputPeerChannelFromMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"channel_id",type:"long"}],type:"InputPeer"},{id:55761658,predicate:"inputPrivacyKeyPhoneNumber",params:[],type:"InputPrivacyKey"},{id:-778378131,predicate:"privacyKeyPhoneNumber",params:[],type:"PrivacyKey"},{id:-1472172887,predicate:"topPeerCategoryForwardUsers",params:[],type:"TopPeerCategory"},{id:-68239120,predicate:"topPeerCategoryForwardChats",params:[],type:"TopPeerCategory"},{id:84703944,predicate:"channelAdminLogEventActionChangeLinkedChat",params:[{name:"prev_value",type:"long"},{name:"new_value",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-398136321,predicate:"messages.searchCounter",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.1?true"},{name:"filter",type:"MessagesFilter"},{name:"count",type:"int"}],type:"messages.SearchCounter"},{id:280464681,predicate:"keyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.0?string"},{name:"url",type:"string"},{name:"button_id",type:"int"}],type:"KeyboardButton"},{id:-802258988,predicate:"inputKeyboardButtonUrlAuth",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"text",type:"string"},{name:"fwd_text",type:"flags.1?string"},{name:"url",type:"string"},{name:"bot",type:"InputUser"}],type:"KeyboardButton"},{id:-1831650802,predicate:"urlAuthResultRequest",params:[{name:"flags",type:"#"},{name:"request_write_access",type:"flags.0?true"},{name:"bot",type:"User"},{name:"domain",type:"string"}],type:"UrlAuthResult"},{id:-1886646706,predicate:"urlAuthResultAccepted",params:[{name:"url",type:"string"}],type:"UrlAuthResult"},{id:-1445536993,predicate:"urlAuthResultDefault",params:[],type:"UrlAuthResult"},{id:-2079962673,predicate:"inputPrivacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector<long>"}],type:"InputPrivacyRule"},{id:-380694650,predicate:"inputPrivacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector<long>"}],type:"InputPrivacyRule"},{id:1796427406,predicate:"privacyValueAllowChatParticipants",params:[{name:"chats",type:"Vector<long>"}],type:"PrivacyRule"},{id:1103656293,predicate:"privacyValueDisallowChatParticipants",params:[{name:"chats",type:"Vector<long>"}],type:"PrivacyRule"},{id:-1672577397,predicate:"messageEntityUnderline",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1090087980,predicate:"messageEntityStrike",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:1786671974,predicate:"updatePeerSettings",params:[{name:"peer",type:"Peer"},{name:"settings",type:"PeerSettings"}],type:"Update"},{id:-1078612597,predicate:"channelLocationEmpty",params:[],type:"ChannelLocation"},{id:547062491,predicate:"channelLocation",params:[{name:"geo_point",type:"GeoPoint"},{name:"address",type:"string"}],type:"ChannelLocation"},{id:-901375139,predicate:"peerLocated",params:[{name:"peer",type:"Peer"},{name:"expires",type:"int"},{name:"distance",type:"int"}],type:"PeerLocated"},{id:-1263546448,predicate:"updatePeerLocated",params:[{name:"peers",type:"Vector<PeerLocated>"}],type:"Update"},{id:241923758,predicate:"channelAdminLogEventActionChangeLocation",params:[{name:"prev_value",type:"ChannelLocation"},{name:"new_value",type:"ChannelLocation"}],type:"ChannelAdminLogEventAction"},{id:-606798099,predicate:"inputReportReasonGeoIrrelevant",params:[],type:"ReportReason"},{id:1401984889,predicate:"channelAdminLogEventActionToggleSlowMode",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:1148485274,predicate:"auth.authorizationSignUpRequired",params:[{name:"flags",type:"#"},{name:"terms_of_service",type:"flags.0?help.TermsOfService"}],type:"auth.Authorization"},{id:-666824391,predicate:"payments.paymentVerificationNeeded",params:[{name:"url",type:"string"}],type:"payments.PaymentResult"},{id:42402760,predicate:"inputStickerSetAnimatedEmoji",params:[],type:"InputStickerSet"},{id:967122427,predicate:"updateNewScheduledMessage",params:[{name:"message",type:"Message"}],type:"Update"},{id:-1870238482,predicate:"updateDeleteScheduledMessages",params:[{name:"peer",type:"Peer"},{name:"messages",type:"Vector<int>"}],type:"Update"},{id:-797791052,predicate:"restrictionReason",params:[{name:"platform",type:"string"},{name:"reason",type:"string"},{name:"text",type:"string"}],type:"RestrictionReason"},{id:1012306921,predicate:"inputTheme",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputTheme"},{id:-175567375,predicate:"inputThemeSlug",params:[{name:"slug",type:"string"}],type:"InputTheme"},{id:-1609668650,predicate:"theme",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"default",type:"flags.1?true"},{name:"for_chat",type:"flags.5?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?Document"},{name:"settings",type:"flags.3?Vector<ThemeSettings>"},{name:"emoticon",type:"flags.6?string"},{name:"installs_count",type:"flags.4?int"}],type:"Theme"},{id:-199313886,predicate:"account.themesNotModified",params:[],type:"account.Themes"},{id:-1707242387,predicate:"account.themes",params:[{name:"hash",type:"long"},{name:"themes",type:"Vector<Theme>"}],type:"account.Themes"},{id:-2112423005,predicate:"updateTheme",params:[{name:"theme",type:"Theme"}],type:"Update"},{id:-786326563,predicate:"inputPrivacyKeyAddedByPhone",params:[],type:"InputPrivacyKey"},{id:1124062251,predicate:"privacyKeyAddedByPhone",params:[],type:"PrivacyKey"},{id:-2027964103,predicate:"updateGeoLiveViewed",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"}],type:"Update"},{id:1448076945,predicate:"updateLoginToken",params:[],type:"Update"},{id:1654593920,predicate:"auth.loginToken",params:[{name:"expires",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:110008598,predicate:"auth.loginTokenMigrateTo",params:[{name:"dc_id",type:"int"},{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:957176926,predicate:"auth.loginTokenSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.LoginToken"},{id:1474462241,predicate:"account.contentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"},{name:"sensitive_can_change",type:"flags.1?true"}],type:"account.ContentSettings"},{id:-1456996667,predicate:"messages.inactiveChats",params:[{name:"dates",type:"Vector<int>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.InactiveChats"},{id:-1012849566,predicate:"baseThemeClassic",params:[],type:"BaseTheme"},{id:-69724536,predicate:"baseThemeDay",params:[],type:"BaseTheme"},{id:-1212997976,predicate:"baseThemeNight",params:[],type:"BaseTheme"},{id:1834973166,predicate:"baseThemeTinted",params:[],type:"BaseTheme"},{id:1527845466,predicate:"baseThemeArctic",params:[],type:"BaseTheme"},{id:-1770371538,predicate:"inputWallPaperNoFile",params:[{name:"id",type:"long"}],type:"InputWallPaper"},{id:-528465642,predicate:"wallPaperNoFile",params:[{name:"id",type:"long"},{name:"flags",type:"#"},{name:"default",type:"flags.1?true"},{name:"dark",type:"flags.4?true"},{name:"settings",type:"flags.2?WallPaperSettings"}],type:"WallPaper"},{id:-1881255857,predicate:"inputThemeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector<int>"},{name:"wallpaper",type:"flags.1?InputWallPaper"},{name:"wallpaper_settings",type:"flags.1?WallPaperSettings"}],type:"InputThemeSettings"},{id:-94849324,predicate:"themeSettings",params:[{name:"flags",type:"#"},{name:"message_colors_animated",type:"flags.2?true"},{name:"base_theme",type:"BaseTheme"},{name:"accent_color",type:"int"},{name:"outbox_accent_color",type:"flags.3?int"},{name:"message_colors",type:"flags.0?Vector<int>"},{name:"wallpaper",type:"flags.1?WallPaper"}],type:"ThemeSettings"},{id:1421174295,predicate:"webPageAttributeTheme",params:[{name:"flags",type:"#"},{name:"documents",type:"flags.0?Vector<Document>"},{name:"settings",type:"flags.1?ThemeSettings"}],type:"WebPageAttribute"},{id:619974263,predicate:"updateMessagePollVote",params:[{name:"poll_id",type:"long"},{name:"peer",type:"Peer"},{name:"options",type:"Vector<bytes>"},{name:"qts",type:"int"}],type:"Update"},{id:1218005070,predicate:"messages.votesList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"votes",type:"Vector<MessagePeerVote>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"next_offset",type:"flags.0?string"}],type:"messages.VotesList"},{id:-1144565411,predicate:"keyboardButtonRequestPoll",params:[{name:"flags",type:"#"},{name:"quiz",type:"flags.0?Bool"},{name:"text",type:"string"}],type:"KeyboardButton"},{id:1981704948,predicate:"messageEntityBankCard",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-177732982,predicate:"bankCardOpenUrl",params:[{name:"url",type:"string"},{name:"name",type:"string"}],type:"BankCardOpenUrl"},{id:1042605427,predicate:"payments.bankCardData",params:[{name:"title",type:"string"},{name:"open_urls",type:"Vector<BankCardOpenUrl>"}],type:"payments.BankCardData"},{id:-118740917,predicate:"peerSelfLocated",params:[{name:"expires",type:"int"}],type:"PeerLocated"},{id:1605718587,predicate:"dialogFilter",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"non_contacts",type:"flags.1?true"},{name:"groups",type:"flags.2?true"},{name:"broadcasts",type:"flags.3?true"},{name:"bots",type:"flags.4?true"},{name:"exclude_muted",type:"flags.11?true"},{name:"exclude_read",type:"flags.12?true"},{name:"exclude_archived",type:"flags.13?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"emoticon",type:"flags.25?string"},{name:"color",type:"flags.27?int"},{name:"pinned_peers",type:"Vector<InputPeer>"},{name:"include_peers",type:"Vector<InputPeer>"},{name:"exclude_peers",type:"Vector<InputPeer>"}],type:"DialogFilter"},{id:2004110666,predicate:"dialogFilterSuggested",params:[{name:"filter",type:"DialogFilter"},{name:"description",type:"string"}],type:"DialogFilterSuggested"},{id:654302845,predicate:"updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Update"},{id:-1512627963,predicate:"updateDialogFilterOrder",params:[{name:"order",type:"Vector<int>"}],type:"Update"},{id:889491791,predicate:"updateDialogFilters",params:[],type:"Update"},{id:-1237848657,predicate:"statsDateRangeDays",params:[{name:"min_date",type:"int"},{name:"max_date",type:"int"}],type:"StatsDateRangeDays"},{id:-884757282,predicate:"statsAbsValueAndPrev",params:[{name:"current",type:"double"},{name:"previous",type:"double"}],type:"StatsAbsValueAndPrev"},{id:-875679776,predicate:"statsPercentValue",params:[{name:"part",type:"double"},{name:"total",type:"double"}],type:"StatsPercentValue"},{id:1244130093,predicate:"statsGraphAsync",params:[{name:"token",type:"string"}],type:"StatsGraph"},{id:-1092839390,predicate:"statsGraphError",params:[{name:"error",type:"string"}],type:"StatsGraph"},{id:-1901828938,predicate:"statsGraph",params:[{name:"flags",type:"#"},{name:"json",type:"DataJSON"},{name:"zoom_token",type:"flags.0?string"}],type:"StatsGraph"},{id:963421692,predicate:"stats.broadcastStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"followers",type:"StatsAbsValueAndPrev"},{name:"views_per_post",type:"StatsAbsValueAndPrev"},{name:"shares_per_post",type:"StatsAbsValueAndPrev"},{name:"reactions_per_post",type:"StatsAbsValueAndPrev"},{name:"views_per_story",type:"StatsAbsValueAndPrev"},{name:"shares_per_story",type:"StatsAbsValueAndPrev"},{name:"reactions_per_story",type:"StatsAbsValueAndPrev"},{name:"enabled_notifications",type:"StatsPercentValue"},{name:"growth_graph",type:"StatsGraph"},{name:"followers_graph",type:"StatsGraph"},{name:"mute_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"interactions_graph",type:"StatsGraph"},{name:"iv_interactions_graph",type:"StatsGraph"},{name:"views_by_source_graph",type:"StatsGraph"},{name:"new_followers_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"reactions_by_emotion_graph",type:"StatsGraph"},{name:"story_interactions_graph",type:"StatsGraph"},{name:"story_reactions_by_emotion_graph",type:"StatsGraph"},{name:"recent_posts_interactions",type:"Vector<PostInteractionCounters>"}],type:"stats.BroadcastStats"},{id:-428884101,predicate:"inputMediaDice",params:[{name:"emoticon",type:"string"}],type:"InputMedia"},{id:1065280907,predicate:"messageMediaDice",params:[{name:"value",type:"int"},{name:"emoticon",type:"string"}],type:"MessageMedia"},{id:-427863538,predicate:"inputStickerSetDice",params:[{name:"emoticon",type:"string"}],type:"InputStickerSet"},{id:-1728664459,predicate:"help.promoDataEmpty",params:[{name:"expires",type:"int"}],type:"help.PromoData"},{id:-1942390465,predicate:"help.promoData",params:[{name:"flags",type:"#"},{name:"proxy",type:"flags.0?true"},{name:"expires",type:"int"},{name:"peer",type:"Peer"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"psa_type",type:"flags.1?string"},{name:"psa_message",type:"flags.2?string"}],type:"help.PromoData"},{id:-567037804,predicate:"videoSize",params:[{name:"flags",type:"#"},{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"size",type:"int"},{name:"video_start_ts",type:"flags.0?double"}],type:"VideoSize"},{id:643940105,predicate:"updatePhoneCallSignalingData",params:[{name:"phone_call_id",type:"long"},{name:"data",type:"bytes"}],type:"Update"},{id:1634294960,predicate:"chatInvitePeek",params:[{name:"chat",type:"Chat"},{name:"expires",type:"int"}],type:"ChatInvite"},{id:-1660637285,predicate:"statsGroupTopPoster",params:[{name:"user_id",type:"long"},{name:"messages",type:"int"},{name:"avg_chars",type:"int"}],type:"StatsGroupTopPoster"},{id:-682079097,predicate:"statsGroupTopAdmin",params:[{name:"user_id",type:"long"},{name:"deleted",type:"int"},{name:"kicked",type:"int"},{name:"banned",type:"int"}],type:"StatsGroupTopAdmin"},{id:1398765469,predicate:"statsGroupTopInviter",params:[{name:"user_id",type:"long"},{name:"invitations",type:"int"}],type:"StatsGroupTopInviter"},{id:-276825834,predicate:"stats.megagroupStats",params:[{name:"period",type:"StatsDateRangeDays"},{name:"members",type:"StatsAbsValueAndPrev"},{name:"messages",type:"StatsAbsValueAndPrev"},{name:"viewers",type:"StatsAbsValueAndPrev"},{name:"posters",type:"StatsAbsValueAndPrev"},{name:"growth_graph",type:"StatsGraph"},{name:"members_graph",type:"StatsGraph"},{name:"new_members_by_source_graph",type:"StatsGraph"},{name:"languages_graph",type:"StatsGraph"},{name:"messages_graph",type:"StatsGraph"},{name:"actions_graph",type:"StatsGraph"},{name:"top_hours_graph",type:"StatsGraph"},{name:"weekdays_graph",type:"StatsGraph"},{name:"top_posters",type:"Vector<StatsGroupTopPoster>"},{name:"top_admins",type:"Vector<StatsGroupTopAdmin>"},{name:"top_inviters",type:"Vector<StatsGroupTopInviter>"},{name:"users",type:"Vector<User>"}],type:"stats.MegagroupStats"},{id:1934380235,predicate:"globalPrivacySettings",params:[{name:"flags",type:"#"},{name:"archive_and_mute_new_noncontact_peers",type:"flags.0?true"},{name:"keep_archived_unmuted",type:"flags.1?true"},{name:"keep_archived_folders",type:"flags.2?true"},{name:"hide_read_marks",type:"flags.3?true"},{name:"new_noncontact_peers_require_premium",type:"flags.4?true"}],type:"GlobalPrivacySettings"},{id:1667228533,predicate:"phoneConnectionWebrtc",params:[{name:"flags",type:"#"},{name:"turn",type:"flags.0?true"},{name:"stun",type:"flags.1?true"},{name:"id",type:"long"},{name:"ip",type:"string"},{name:"ipv6",type:"string"},{name:"port",type:"int"},{name:"username",type:"string"},{name:"password",type:"string"}],type:"PhoneConnection"},{id:1107543535,predicate:"help.countryCode",params:[{name:"flags",type:"#"},{name:"country_code",type:"string"},{name:"prefixes",type:"flags.0?Vector<string>"},{name:"patterns",type:"flags.1?Vector<string>"}],type:"help.CountryCode"},{id:-1014526429,predicate:"help.country",params:[{name:"flags",type:"#"},{name:"hidden",type:"flags.0?true"},{name:"iso2",type:"string"},{name:"default_name",type:"string"},{name:"name",type:"flags.1?string"},{name:"country_codes",type:"Vector<help.CountryCode>"}],type:"help.Country"},{id:-1815339214,predicate:"help.countriesListNotModified",params:[],type:"help.CountriesList"},{id:-2016381538,predicate:"help.countriesList",params:[{name:"countries",type:"Vector<help.Country>"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:1163625789,predicate:"messageViews",params:[{name:"flags",type:"#"},{name:"views",type:"flags.0?int"},{name:"forwards",type:"flags.1?int"},{name:"replies",type:"flags.2?MessageReplies"}],type:"MessageViews"},{id:-761649164,predicate:"updateChannelMessageForwards",params:[{name:"channel_id",type:"long"},{name:"id",type:"int"},{name:"forwards",type:"int"}],type:"Update"},{id:-96535659,predicate:"photoSizeProgressive",params:[{name:"type",type:"string"},{name:"w",type:"int"},{name:"h",type:"int"},{name:"sizes",type:"Vector<int>"}],type:"PhotoSize"},{id:-1228606141,predicate:"messages.messageViews",params:[{name:"views",type:"Vector<MessageViews>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.MessageViews"},{id:-693004986,predicate:"updateReadChannelDiscussionInbox",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"},{name:"broadcast_id",type:"flags.0?long"},{name:"broadcast_post",type:"flags.0?int"}],type:"Update"},{id:1767677564,predicate:"updateReadChannelDiscussionOutbox",params:[{name:"channel_id",type:"long"},{name:"top_msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Update"},{id:-1506535550,predicate:"messages.discussionMessage",params:[{name:"flags",type:"#"},{name:"messages",type:"Vector<Message>"},{name:"max_id",type:"flags.0?int"},{name:"read_inbox_max_id",type:"flags.1?int"},{name:"read_outbox_max_id",type:"flags.2?int"},{name:"unread_count",type:"int"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.DiscussionMessage"},{id:-1346631205,predicate:"messageReplyHeader",params:[{name:"flags",type:"#"},{name:"reply_to_scheduled",type:"flags.2?true"},{name:"forum_topic",type:"flags.3?true"},{name:"quote",type:"flags.9?true"},{name:"reply_to_msg_id",type:"flags.4?int"},{name:"reply_to_peer_id",type:"flags.0?Peer"},{name:"reply_from",type:"flags.5?MessageFwdHeader"},{name:"reply_media",type:"flags.8?MessageMedia"},{name:"reply_to_top_id",type:"flags.1?int"},{name:"quote_text",type:"flags.6?string"},{name:"quote_entities",type:"flags.7?Vector<MessageEntity>"},{name:"quote_offset",type:"flags.10?int"}],type:"MessageReplyHeader"},{id:-2083123262,predicate:"messageReplies",params:[{name:"flags",type:"#"},{name:"comments",type:"flags.0?true"},{name:"replies",type:"int"},{name:"replies_pts",type:"int"},{name:"recent_repliers",type:"flags.1?Vector<Peer>"},{name:"channel_id",type:"flags.0?long"},{name:"max_id",type:"flags.2?int"},{name:"read_max_id",type:"flags.3?int"}],type:"MessageReplies"},{id:-337610926,predicate:"updatePeerBlocked",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"blocked_my_stories_from",type:"flags.1?true"},{name:"peer_id",type:"Peer"}],type:"Update"},{id:-386039788,predicate:"peerBlocked",params:[{name:"peer_id",type:"Peer"},{name:"date",type:"int"}],type:"PeerBlocked"},{id:-1937192669,predicate:"updateChannelUserTyping",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"top_msg_id",type:"flags.0?int"},{name:"from_id",type:"Peer"},{name:"action",type:"SendMessageAction"}],type:"Update"},{id:-1392895362,predicate:"inputMessageCallbackQuery",params:[{name:"id",type:"int"},{name:"query_id",type:"long"}],type:"InputMessage"},{id:453242886,predicate:"channelParticipantLeft",params:[{name:"peer",type:"Peer"}],type:"ChannelParticipant"},{id:-531931925,predicate:"channelParticipantsMentions",params:[{name:"flags",type:"#"},{name:"q",type:"flags.0?string"},{name:"top_msg_id",type:"flags.1?int"}],type:"ChannelParticipantsFilter"},{id:-309990731,predicate:"updatePinnedMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"messages",type:"Vector<int>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:1538885128,predicate:"updatePinnedChannelMessages",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"messages",type:"Vector<int>"},{name:"pts",type:"int"},{name:"pts_count",type:"int"}],type:"Update"},{id:464520273,predicate:"inputMessagesFilterPinned",params:[],type:"MessagesFilter"},{id:2145983508,predicate:"stats.messageStats",params:[{name:"views_graph",type:"StatsGraph"},{name:"reactions_by_emotion_graph",type:"StatsGraph"}],type:"stats.MessageStats"},{id:-1730095465,predicate:"messageActionGeoProximityReached",params:[{name:"from_id",type:"Peer"},{name:"to_id",type:"Peer"},{name:"distance",type:"int"}],type:"MessageAction"},{id:-668906175,predicate:"photoPathSize",params:[{name:"type",type:"string"},{name:"bytes",type:"bytes"}],type:"PhotoSize"},{id:-651419003,predicate:"speakingInGroupCallAction",params:[],type:"SendMessageAction"},{id:2004925620,predicate:"groupCallDiscarded",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"duration",type:"int"}],type:"GroupCall"},{id:-711498484,predicate:"groupCall",params:[{name:"flags",type:"#"},{name:"join_muted",type:"flags.1?true"},{name:"can_change_join_muted",type:"flags.2?true"},{name:"join_date_asc",type:"flags.6?true"},{name:"schedule_start_subscribed",type:"flags.8?true"},{name:"can_start_video",type:"flags.9?true"},{name:"record_video_active",type:"flags.11?true"},{name:"rtmp_stream",type:"flags.12?true"},{name:"listeners_hidden",type:"flags.13?true"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"participants_count",type:"int"},{name:"title",type:"flags.3?string"},{name:"stream_dc_id",type:"flags.4?int"},{name:"record_start_date",type:"flags.5?int"},{name:"schedule_date",type:"flags.7?int"},{name:"unmuted_video_count",type:"flags.10?int"},{name:"unmuted_video_limit",type:"int"},{name:"version",type:"int"}],type:"GroupCall"},{id:-659913713,predicate:"inputGroupCall",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputGroupCall"},{id:2047704898,predicate:"messageActionGroupCall",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"duration",type:"flags.0?int"}],type:"MessageAction"},{id:1345295095,predicate:"messageActionInviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector<long>"}],type:"MessageAction"},{id:-341428482,predicate:"groupCallParticipant",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"left",type:"flags.1?true"},{name:"can_self_unmute",type:"flags.2?true"},{name:"just_joined",type:"flags.4?true"},{name:"versioned",type:"flags.5?true"},{name:"min",type:"flags.8?true"},{name:"muted_by_you",type:"flags.9?true"},{name:"volume_by_admin",type:"flags.10?true"},{name:"self",type:"flags.12?true"},{name:"video_joined",type:"flags.15?true"},{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"active_date",type:"flags.3?int"},{name:"source",type:"int"},{name:"volume",type:"flags.7?int"},{name:"about",type:"flags.11?string"},{name:"raise_hand_rating",type:"flags.13?long"},{name:"video",type:"flags.6?GroupCallParticipantVideo"},{name:"presentation",type:"flags.14?GroupCallParticipantVideo"}],type:"GroupCallParticipant"},{id:-124097970,predicate:"updateChat",params:[{name:"chat_id",type:"long"}],type:"Update"},{id:-219423922,predicate:"updateGroupCallParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"participants",type:"Vector<GroupCallParticipant>"},{name:"version",type:"int"}],type:"Update"},{id:347227392,predicate:"updateGroupCall",params:[{name:"chat_id",type:"long"},{name:"call",type:"GroupCall"}],type:"Update"},{id:-1636664659,predicate:"phone.groupCall",params:[{name:"call",type:"GroupCall"},{name:"participants",type:"Vector<GroupCallParticipant>"},{name:"participants_next_offset",type:"string"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"phone.GroupCall"},{id:-193506890,predicate:"phone.groupParticipants",params:[{name:"count",type:"int"},{name:"participants",type:"Vector<GroupCallParticipant>"},{name:"next_offset",type:"string"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"version",type:"int"}],type:"phone.GroupParticipants"},{id:813821341,predicate:"inlineQueryPeerTypeSameBotPM",params:[],type:"InlineQueryPeerType"},{id:-2093215828,predicate:"inlineQueryPeerTypePM",params:[],type:"InlineQueryPeerType"},{id:-681130742,predicate:"inlineQueryPeerTypeChat",params:[],type:"InlineQueryPeerType"},{id:1589952067,predicate:"inlineQueryPeerTypeMegagroup",params:[],type:"InlineQueryPeerType"},{id:1664413338,predicate:"inlineQueryPeerTypeBroadcast",params:[],type:"InlineQueryPeerType"},{id:589338437,predicate:"channelAdminLogEventActionStartGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-610299584,predicate:"channelAdminLogEventActionDiscardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"ChannelAdminLogEventAction"},{id:-115071790,predicate:"channelAdminLogEventActionParticipantMute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:-431740480,predicate:"channelAdminLogEventActionParticipantUnmute",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1456906823,predicate:"channelAdminLogEventActionToggleGroupCallSetting",params:[{name:"join_muted",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-1966921727,predicate:"inputPaymentCredentialsGooglePay",params:[{name:"payment_token",type:"DataJSON"}],type:"InputPaymentCredentials"},{id:375566091,predicate:"messages.historyImport",params:[{name:"id",type:"long"}],type:"messages.HistoryImport"},{id:-606432698,predicate:"sendMessageHistoryImportAction",params:[{name:"progress",type:"int"}],type:"SendMessageAction"},{id:1578088377,predicate:"messages.historyImportParsed",params:[{name:"flags",type:"#"},{name:"pm",type:"flags.0?true"},{name:"group",type:"flags.1?true"},{name:"title",type:"flags.2?string"}],type:"messages.HistoryImportParsed"},{id:-170010905,predicate:"inputReportReasonFake",params:[],type:"ReportReason"},{id:-275956116,predicate:"messages.affectedFoundMessages",params:[{name:"pts",type:"int"},{name:"pts_count",type:"int"},{name:"offset",type:"int"},{name:"messages",type:"Vector<int>"}],type:"messages.AffectedFoundMessages"},{id:1007897979,predicate:"messageActionSetMessagesTTL",params:[{name:"flags",type:"#"},{name:"period",type:"int"},{name:"auto_setting_from",type:"flags.0?long"}],type:"MessageAction"},{id:-1147422299,predicate:"updatePeerHistoryTTL",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"ttl_period",type:"flags.0?int"}],type:"Update"},{id:-796432838,predicate:"updateChatParticipant",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChatParticipant"},{name:"new_participant",type:"flags.1?ChatParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1738720581,predicate:"updateChannelParticipant",params:[{name:"flags",type:"#"},{name:"via_chatlist",type:"flags.3?true"},{name:"channel_id",type:"long"},{name:"date",type:"int"},{name:"actor_id",type:"long"},{name:"user_id",type:"long"},{name:"prev_participant",type:"flags.0?ChannelParticipant"},{name:"new_participant",type:"flags.1?ChannelParticipant"},{name:"invite",type:"flags.2?ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-997782967,predicate:"updateBotStopped",params:[{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"stopped",type:"Bool"},{name:"qts",type:"int"}],type:"Update"},{id:-1940201511,predicate:"chatInviteImporter",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"via_chatlist",type:"flags.3?true"},{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"about",type:"flags.2?string"},{name:"approved_by",type:"flags.1?long"}],type:"ChatInviteImporter"},{id:-1111085620,predicate:"messages.exportedChatInvites",params:[{name:"count",type:"int"},{name:"invites",type:"Vector<ExportedChatInvite>"},{name:"users",type:"Vector<User>"}],type:"messages.ExportedChatInvites"},{id:410107472,predicate:"messages.exportedChatInvite",params:[{name:"invite",type:"ExportedChatInvite"},{name:"users",type:"Vector<User>"}],type:"messages.ExportedChatInvite"},{id:572915951,predicate:"messages.exportedChatInviteReplaced",params:[{name:"invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"},{name:"users",type:"Vector<User>"}],type:"messages.ExportedChatInvite"},{id:-2118733814,predicate:"messages.chatInviteImporters",params:[{name:"count",type:"int"},{name:"importers",type:"Vector<ChatInviteImporter>"},{name:"users",type:"Vector<User>"}],type:"messages.ChatInviteImporters"},{id:-219353309,predicate:"chatAdminWithInvites",params:[{name:"admin_id",type:"long"},{name:"invites_count",type:"int"},{name:"revoked_invites_count",type:"int"}],type:"ChatAdminWithInvites"},{id:-1231326505,predicate:"messages.chatAdminsWithInvites",params:[{name:"admins",type:"Vector<ChatAdminWithInvites>"},{name:"users",type:"Vector<User>"}],type:"messages.ChatAdminsWithInvites"},{id:-23084712,predicate:"channelAdminLogEventActionParticipantJoinByInvite",params:[{name:"flags",type:"#"},{name:"via_chatlist",type:"flags.0?true"},{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1515256996,predicate:"channelAdminLogEventActionExportedInviteDelete",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1091179342,predicate:"channelAdminLogEventActionExportedInviteRevoke",params:[{name:"invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:-384910503,predicate:"channelAdminLogEventActionExportedInviteEdit",params:[{name:"prev_invite",type:"ExportedChatInvite"},{name:"new_invite",type:"ExportedChatInvite"}],type:"ChannelAdminLogEventAction"},{id:1048537159,predicate:"channelAdminLogEventActionParticipantVolume",params:[{name:"participant",type:"GroupCallParticipant"}],type:"ChannelAdminLogEventAction"},{id:1855199800,predicate:"channelAdminLogEventActionChangeHistoryTTL",params:[{name:"prev_value",type:"int"},{name:"new_value",type:"int"}],type:"ChannelAdminLogEventAction"},{id:-1571952873,predicate:"messages.checkedHistoryImportPeer",params:[{name:"confirm_text",type:"string"}],type:"messages.CheckedHistoryImportPeer"},{id:93890858,predicate:"inputGroupCallStream",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"time_ms",type:"long"},{name:"scale",type:"int"},{name:"video_channel",type:"flags.0?int"},{name:"video_quality",type:"flags.0?int"}],type:"InputFileLocation"},{id:-1343921601,predicate:"phone.joinAsPeers",params:[{name:"peers",type:"Vector<Peer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"phone.JoinAsPeers"},{id:541839704,predicate:"phone.exportedGroupCallInvite",params:[{name:"link",type:"string"}],type:"phone.ExportedGroupCallInvite"},{id:-672693723,predicate:"inputBotInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?InputWebDocument"},{name:"invoice",type:"Invoice"},{name:"payload",type:"bytes"},{name:"provider",type:"string"},{name:"provider_data",type:"DataJSON"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:894081801,predicate:"botInlineMessageMediaInvoice",params:[{name:"flags",type:"#"},{name:"shipping_address_requested",type:"flags.1?true"},{name:"test",type:"flags.3?true"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.0?WebDocument"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:-1281329567,predicate:"messageActionGroupCallScheduled",params:[{name:"call",type:"InputGroupCall"},{name:"schedule_date",type:"int"}],type:"MessageAction"},{id:-592373577,predicate:"groupCallParticipantVideoSourceGroup",params:[{name:"semantics",type:"string"},{name:"sources",type:"Vector<int>"}],type:"GroupCallParticipantVideoSourceGroup"},{id:1735736008,predicate:"groupCallParticipantVideo",params:[{name:"flags",type:"#"},{name:"paused",type:"flags.0?true"},{name:"endpoint",type:"string"},{name:"source_groups",type:"Vector<GroupCallParticipantVideoSourceGroup>"},{name:"audio_source",type:"flags.1?int"}],type:"GroupCallParticipantVideo"},{id:192428418,predicate:"updateGroupCallConnection",params:[{name:"flags",type:"#"},{name:"presentation",type:"flags.0?true"},{name:"params",type:"DataJSON"}],type:"Update"},{id:-2046910401,predicate:"stickers.suggestedShortName",params:[{name:"short_name",type:"string"}],type:"stickers.SuggestedShortName"},{id:795652779,predicate:"botCommandScopeDefault",params:[],type:"BotCommandScope"},{id:1011811544,predicate:"botCommandScopeUsers",params:[],type:"BotCommandScope"},{id:1877059713,predicate:"botCommandScopeChats",params:[],type:"BotCommandScope"},{id:-1180016534,predicate:"botCommandScopeChatAdmins",params:[],type:"BotCommandScope"},{id:-610432643,predicate:"botCommandScopePeer",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:1071145937,predicate:"botCommandScopePeerAdmins",params:[{name:"peer",type:"InputPeer"}],type:"BotCommandScope"},{id:169026035,predicate:"botCommandScopePeerUser",params:[{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"BotCommandScope"},{id:-478701471,predicate:"account.resetPasswordFailedWait",params:[{name:"retry_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-370148227,predicate:"account.resetPasswordRequestedWait",params:[{name:"until_date",type:"int"}],type:"account.ResetPasswordResult"},{id:-383330754,predicate:"account.resetPasswordOk",params:[],type:"account.ResetPasswordResult"},{id:1299263278,predicate:"updateBotCommands",params:[{name:"peer",type:"Peer"},{name:"bot_id",type:"long"},{name:"commands",type:"Vector<BotCommand>"}],type:"Update"},{id:-1434950843,predicate:"messageActionSetChatTheme",params:[{name:"emoticon",type:"string"}],type:"MessageAction"},{id:-1336228175,predicate:"sendMessageChooseStickerAction",params:[],type:"SendMessageAction"},{id:-1108478618,predicate:"sponsoredMessage",params:[{name:"flags",type:"#"},{name:"recommended",type:"flags.5?true"},{name:"can_report",type:"flags.12?true"},{name:"random_id",type:"bytes"},{name:"url",type:"string"},{name:"title",type:"string"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"photo",type:"flags.6?Photo"},{name:"color",type:"flags.13?PeerColor"},{name:"button_text",type:"string"},{name:"sponsor_info",type:"flags.7?string"},{name:"additional_info",type:"flags.8?string"}],type:"SponsoredMessage"},{id:-907141753,predicate:"messages.sponsoredMessages",params:[{name:"flags",type:"#"},{name:"posts_between",type:"flags.0?int"},{name:"messages",type:"Vector<SponsoredMessage>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.SponsoredMessages"},{id:215889721,predicate:"inputStickerSetAnimatedEmojiAnimations",params:[],type:"InputStickerSet"},{id:630664139,predicate:"sendMessageEmojiInteraction",params:[{name:"emoticon",type:"string"},{name:"msg_id",type:"int"},{name:"interaction",type:"DataJSON"}],type:"SendMessageAction"},{id:-1234857938,predicate:"sendMessageEmojiInteractionSeen",params:[{name:"emoticon",type:"string"}],type:"SendMessageAction"},{id:-1227287081,predicate:"inputBotInlineMessageID64",params:[{name:"dc_id",type:"int"},{name:"owner_id",type:"long"},{name:"id",type:"int"},{name:"access_hash",type:"long"}],type:"InputBotInlineMessageID"},{id:-911191137,predicate:"searchResultsCalendarPeriod",params:[{name:"date",type:"int"},{name:"min_msg_id",type:"int"},{name:"max_msg_id",type:"int"},{name:"count",type:"int"}],type:"SearchResultsCalendarPeriod"},{id:343859772,predicate:"messages.searchResultsCalendar",params:[{name:"flags",type:"#"},{name:"inexact",type:"flags.0?true"},{name:"count",type:"int"},{name:"min_date",type:"int"},{name:"min_msg_id",type:"int"},{name:"offset_id_offset",type:"flags.1?int"},{name:"periods",type:"Vector<SearchResultsCalendarPeriod>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.SearchResultsCalendar"},{id:2137295719,predicate:"searchResultPosition",params:[{name:"msg_id",type:"int"},{name:"date",type:"int"},{name:"offset",type:"int"}],type:"SearchResultsPosition"},{id:1404185519,predicate:"messages.searchResultsPositions",params:[{name:"count",type:"int"},{name:"positions",type:"Vector<SearchResultsPosition>"}],type:"messages.SearchResultsPositions"},{id:-339958837,predicate:"messageActionChatJoinedByRequest",params:[],type:"MessageAction"},{id:1885586395,predicate:"updatePendingJoinRequests",params:[{name:"peer",type:"Peer"},{name:"requests_pending",type:"int"},{name:"recent_requesters",type:"Vector<long>"}],type:"Update"},{id:299870598,predicate:"updateBotChatInviteRequester",params:[{name:"peer",type:"Peer"},{name:"date",type:"int"},{name:"user_id",type:"long"},{name:"about",type:"string"},{name:"invite",type:"ExportedChatInvite"},{name:"qts",type:"int"}],type:"Update"},{id:-1347021750,predicate:"channelAdminLogEventActionParticipantJoinByRequest",params:[{name:"invite",type:"ExportedChatInvite"},{name:"approved_by",type:"long"}],type:"ChannelAdminLogEventAction"},{id:-376962181,predicate:"inputKeyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"InputUser"}],type:"KeyboardButton"},{id:814112961,predicate:"keyboardButtonUserProfile",params:[{name:"text",type:"string"},{name:"user_id",type:"long"}],type:"KeyboardButton"},{id:-191450938,predicate:"channels.sendAsPeers",params:[{name:"peers",type:"Vector<SendAsPeer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"channels.SendAsPeers"},{id:-886388890,predicate:"channelAdminLogEventActionToggleNoForwards",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:-738646805,predicate:"messages.stickerSetNotModified",params:[],type:"messages.StickerSet"},{id:997004590,predicate:"users.userFull",params:[{name:"full_user",type:"UserFull"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"users.UserFull"},{id:1753266509,predicate:"messages.peerSettings",params:[{name:"settings",type:"PeerSettings"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.PeerSettings"},{id:663693416,predicate:"channelAdminLogEventActionSendMessage",params:[{name:"message",type:"Message"}],type:"ChannelAdminLogEventAction"},{id:-702884114,predicate:"auth.codeTypeMissedCall",params:[],type:"auth.CodeType"},{id:-2113903484,predicate:"auth.sentCodeTypeMissedCall",params:[{name:"prefix",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:-1012759713,predicate:"auth.loggedOut",params:[{name:"flags",type:"#"},{name:"future_auth_token",type:"flags.0?bytes"}],type:"auth.LoggedOut"},{id:1578843320,predicate:"updateMessageReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"top_msg_id",type:"flags.0?int"},{name:"reactions",type:"MessageReactions"}],type:"Update"},{id:-1546531968,predicate:"reactionCount",params:[{name:"flags",type:"#"},{name:"chosen_order",type:"flags.0?int"},{name:"reaction",type:"Reaction"},{name:"count",type:"int"}],type:"ReactionCount"},{id:1328256121,predicate:"messageReactions",params:[{name:"flags",type:"#"},{name:"min",type:"flags.0?true"},{name:"can_see_list",type:"flags.2?true"},{name:"reactions_as_tags",type:"flags.3?true"},{name:"results",type:"Vector<ReactionCount>"},{name:"recent_reactions",type:"flags.1?Vector<MessagePeerReaction>"}],type:"MessageReactions"},{id:834488621,predicate:"messages.messageReactionsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"reactions",type:"Vector<MessagePeerReaction>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"next_offset",type:"flags.0?string"}],type:"messages.MessageReactionsList"},{id:-1065882623,predicate:"availableReaction",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"premium",type:"flags.2?true"},{name:"reaction",type:"string"},{name:"title",type:"string"},{name:"static_icon",type:"Document"},{name:"appear_animation",type:"Document"},{name:"select_animation",type:"Document"},{name:"activate_animation",type:"Document"},{name:"effect_animation",type:"Document"},{name:"around_animation",type:"flags.1?Document"},{name:"center_icon",type:"flags.1?Document"}],type:"AvailableReaction"},{id:-1626924713,predicate:"messages.availableReactionsNotModified",params:[],type:"messages.AvailableReactions"},{id:1989032621,predicate:"messages.availableReactions",params:[{name:"hash",type:"int"},{name:"reactions",type:"Vector<AvailableReaction>"}],type:"messages.AvailableReactions"},{id:852137487,predicate:"messageEntitySpoiler",params:[{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1102180616,predicate:"channelAdminLogEventActionChangeAvailableReactions",params:[{name:"prev_value",type:"ChatReactions"},{name:"new_value",type:"ChatReactions"}],type:"ChannelAdminLogEventAction"},{id:-1938180548,predicate:"messagePeerReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.0?true"},{name:"unread",type:"flags.1?true"},{name:"my",type:"flags.2?true"},{name:"peer_id",type:"Peer"},{name:"date",type:"int"},{name:"reaction",type:"Reaction"}],type:"MessagePeerReaction"},{id:-2132064081,predicate:"groupCallStreamChannel",params:[{name:"channel",type:"int"},{name:"scale",type:"int"},{name:"last_timestamp_ms",type:"long"}],type:"GroupCallStreamChannel"},{id:-790330702,predicate:"phone.groupCallStreamChannels",params:[{name:"channels",type:"Vector<GroupCallStreamChannel>"}],type:"phone.GroupCallStreamChannels"},{id:177124030,predicate:"inputReportReasonIllegalDrugs",params:[],type:"ReportReason"},{id:-1631091139,predicate:"inputReportReasonPersonalDetails",params:[],type:"ReportReason"},{id:767505458,predicate:"phone.groupCallStreamRtmpUrl",params:[{name:"url",type:"string"},{name:"key",type:"string"}],type:"phone.GroupCallStreamRtmpUrl"},{id:1165423600,predicate:"attachMenuBotIconColor",params:[{name:"name",type:"string"},{name:"color",type:"int"}],type:"AttachMenuBotIconColor"},{id:-1297663893,predicate:"attachMenuBotIcon",params:[{name:"flags",type:"#"},{name:"name",type:"string"},{name:"icon",type:"Document"},{name:"colors",type:"flags.0?Vector<AttachMenuBotIconColor>"}],type:"AttachMenuBotIcon"},{id:-653423106,predicate:"attachMenuBot",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"has_settings",type:"flags.1?true"},{name:"request_write_access",type:"flags.2?true"},{name:"show_in_attach_menu",type:"flags.3?true"},{name:"show_in_side_menu",type:"flags.4?true"},{name:"side_menu_disclaimer_needed",type:"flags.5?true"},{name:"bot_id",type:"long"},{name:"short_name",type:"string"},{name:"peer_types",type:"flags.3?Vector<AttachMenuPeerType>"},{name:"icons",type:"Vector<AttachMenuBotIcon>"}],type:"AttachMenuBot"},{id:-237467044,predicate:"attachMenuBotsNotModified",params:[],type:"AttachMenuBots"},{id:1011024320,predicate:"attachMenuBots",params:[{name:"hash",type:"long"},{name:"bots",type:"Vector<AttachMenuBot>"},{name:"users",type:"Vector<User>"}],type:"AttachMenuBots"},{id:-1816172929,predicate:"attachMenuBotsBot",params:[{name:"bot",type:"AttachMenuBot"},{name:"users",type:"Vector<User>"}],type:"AttachMenuBotsBot"},{id:397910539,predicate:"updateAttachMenuBots",params:[],type:"Update"},{id:1294139288,predicate:"webViewResultUrl",params:[{name:"flags",type:"#"},{name:"fullsize",type:"flags.1?true"},{name:"query_id",type:"flags.0?long"},{name:"url",type:"string"}],type:"WebViewResult"},{id:211046684,predicate:"webViewMessageSent",params:[{name:"flags",type:"#"},{name:"msg_id",type:"flags.0?InputBotInlineMessageID"}],type:"WebViewMessageSent"},{id:361936797,predicate:"updateWebViewResultSent",params:[{name:"query_id",type:"long"}],type:"Update"},{id:326529584,predicate:"keyboardButtonWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:-1598009252,predicate:"keyboardButtonSimpleWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"KeyboardButton"},{id:1205698681,predicate:"messageActionWebViewDataSentMe",params:[{name:"text",type:"string"},{name:"data",type:"string"}],type:"MessageAction"},{id:-1262252875,predicate:"messageActionWebViewDataSent",params:[{name:"text",type:"string"}],type:"MessageAction"},{id:347625491,predicate:"updateBotMenuButton",params:[{name:"bot_id",type:"long"},{name:"button",type:"BotMenuButton"}],type:"Update"},{id:1966318984,predicate:"botMenuButtonDefault",params:[],type:"BotMenuButton"},{id:1113113093,predicate:"botMenuButtonCommands",params:[],type:"BotMenuButton"},{id:-944407322,predicate:"botMenuButton",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"BotMenuButton"},{id:-67704655,predicate:"account.savedRingtonesNotModified",params:[],type:"account.SavedRingtones"},{id:-1041683259,predicate:"account.savedRingtones",params:[{name:"hash",type:"long"},{name:"ringtones",type:"Vector<Document>"}],type:"account.SavedRingtones"},{id:1960361625,predicate:"updateSavedRingtones",params:[],type:"Update"},{id:-1746354498,predicate:"notificationSoundDefault",params:[],type:"NotificationSound"},{id:1863070943,predicate:"notificationSoundNone",params:[],type:"NotificationSound"},{id:-2096391452,predicate:"notificationSoundLocal",params:[{name:"title",type:"string"},{name:"data",type:"string"}],type:"NotificationSound"},{id:-9666487,predicate:"notificationSoundRingtone",params:[{name:"id",type:"long"}],type:"NotificationSound"},{id:-1222230163,predicate:"account.savedRingtone",params:[],type:"account.SavedRingtone"},{id:523271863,predicate:"account.savedRingtoneConverted",params:[{name:"document",type:"Document"}],type:"account.SavedRingtone"},{id:2104224014,predicate:"attachMenuPeerTypeSameBotPM",params:[],type:"AttachMenuPeerType"},{id:-1020528102,predicate:"attachMenuPeerTypeBotPM",params:[],type:"AttachMenuPeerType"},{id:-247016673,predicate:"attachMenuPeerTypePM",params:[],type:"AttachMenuPeerType"},{id:84480319,predicate:"attachMenuPeerTypeChat",params:[],type:"AttachMenuPeerType"},{id:2080104188,predicate:"attachMenuPeerTypeBroadcast",params:[],type:"AttachMenuPeerType"},{id:-317687113,predicate:"chatInvitePublicJoinRequests",params:[],type:"ExportedChatInvite"},{id:-977967015,predicate:"inputInvoiceMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"InputInvoice"},{id:-1020867857,predicate:"inputInvoiceSlug",params:[{name:"slug",type:"string"}],type:"InputInvoice"},{id:-1362048039,predicate:"payments.exportedInvoice",params:[{name:"url",type:"string"}],type:"payments.ExportedInvoice"},{id:8703322,predicate:"updateTranscribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"text",type:"string"}],type:"Update"},{id:-809903785,predicate:"messages.transcribedAudio",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"transcription_id",type:"long"},{name:"text",type:"string"},{name:"trial_remains_num",type:"flags.1?int"},{name:"trial_remains_until_date",type:"flags.1?int"}],type:"messages.TranscribedAudio"},{id:909284270,predicate:"dialogFilterDefault",params:[],type:"DialogFilter"},{id:1395946908,predicate:"help.premiumPromo",params:[{name:"status_text",type:"string"},{name:"status_entities",type:"Vector<MessageEntity>"},{name:"video_sections",type:"Vector<string>"},{name:"videos",type:"Vector<Document>"},{name:"period_options",type:"Vector<PremiumSubscriptionOption>"},{name:"users",type:"Vector<User>"}],type:"help.PremiumPromo"},{id:-925956616,predicate:"messageEntityCustomEmoji",params:[{name:"offset",type:"int"},{name:"length",type:"int"},{name:"document_id",type:"long"}],type:"MessageEntity"},{id:-48981863,predicate:"documentAttributeCustomEmoji",params:[{name:"flags",type:"#"},{name:"free",type:"flags.0?true"},{name:"text_color",type:"flags.1?true"},{name:"alt",type:"string"},{name:"stickerset",type:"InputStickerSet"}],type:"DocumentAttribute"},{id:1087454222,predicate:"stickerSetFullCovered",params:[{name:"set",type:"StickerSet"},{name:"packs",type:"Vector<StickerPack>"},{name:"keywords",type:"Vector<StickerKeyword>"},{name:"documents",type:"Vector<Document>"}],type:"StickerSetCovered"},{id:-1502273946,predicate:"inputStorePaymentPremiumSubscription",params:[{name:"flags",type:"#"},{name:"restore",type:"flags.0?true"},{name:"upgrade",type:"flags.1?true"}],type:"InputStorePaymentPurpose"},{id:1634697192,predicate:"inputStorePaymentGiftPremium",params:[{name:"user_id",type:"InputUser"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:-935499028,predicate:"messageActionGiftPremium",params:[{name:"flags",type:"#"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"months",type:"int"},{name:"crypto_currency",type:"flags.0?string"},{name:"crypto_amount",type:"flags.0?long"}],type:"MessageAction"},{id:1958953753,predicate:"premiumGiftOption",params:[{name:"flags",type:"#"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumGiftOption"},{id:-930399486,predicate:"inputStickerSetPremiumGifts",params:[],type:"InputStickerSet"},{id:-78886548,predicate:"updateReadFeaturedEmojiStickers",params:[],type:"Update"},{id:-1360618136,predicate:"inputPrivacyKeyVoiceMessages",params:[],type:"InputPrivacyKey"},{id:110621716,predicate:"privacyKeyVoiceMessages",params:[],type:"PrivacyKey"},{id:-1996951013,predicate:"paymentFormMethod",params:[{name:"url",type:"string"},{name:"title",type:"string"}],type:"PaymentFormMethod"},{id:-193992412,predicate:"inputWebFileAudioAlbumThumbLocation",params:[{name:"flags",type:"#"},{name:"small",type:"flags.2?true"},{name:"document",type:"flags.0?InputDocument"},{name:"title",type:"flags.1?string"},{name:"performer",type:"flags.1?string"}],type:"InputWebFileLocation"},{id:769727150,predicate:"emojiStatusEmpty",params:[],type:"EmojiStatus"},{id:-1835310691,predicate:"emojiStatus",params:[{name:"document_id",type:"long"}],type:"EmojiStatus"},{id:-97474361,predicate:"emojiStatusUntil",params:[{name:"document_id",type:"long"},{name:"until",type:"int"}],type:"EmojiStatus"},{id:674706841,predicate:"updateUserEmojiStatus",params:[{name:"user_id",type:"long"},{name:"emoji_status",type:"EmojiStatus"}],type:"Update"},{id:821314523,predicate:"updateRecentEmojiStatuses",params:[],type:"Update"},{id:-796072379,predicate:"account.emojiStatusesNotModified",params:[],type:"account.EmojiStatuses"},{id:-1866176559,predicate:"account.emojiStatuses",params:[{name:"hash",type:"long"},{name:"statuses",type:"Vector<EmojiStatus>"}],type:"account.EmojiStatuses"},{id:2046153753,predicate:"reactionEmpty",params:[],type:"Reaction"},{id:455247544,predicate:"reactionEmoji",params:[{name:"emoticon",type:"string"}],type:"Reaction"},{id:-1992950669,predicate:"reactionCustomEmoji",params:[{name:"document_id",type:"long"}],type:"Reaction"},{id:-352570692,predicate:"chatReactionsNone",params:[],type:"ChatReactions"},{id:1385335754,predicate:"chatReactionsAll",params:[{name:"flags",type:"#"},{name:"allow_custom",type:"flags.0?true"}],type:"ChatReactions"},{id:1713193015,predicate:"chatReactionsSome",params:[{name:"reactions",type:"Vector<Reaction>"}],type:"ChatReactions"},{id:-1334846497,predicate:"messages.reactionsNotModified",params:[],type:"messages.Reactions"},{id:-352454890,predicate:"messages.reactions",params:[{name:"hash",type:"long"},{name:"reactions",type:"Vector<Reaction>"}],type:"messages.Reactions"},{id:1870160884,predicate:"updateRecentReactions",params:[],type:"Update"},{id:-2030252155,predicate:"updateMoveStickerSetToTop",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"stickerset",type:"long"}],type:"Update"},{id:-196020837,predicate:"auth.sentCodeTypeEmailCode",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"},{name:"email_pattern",type:"string"},{name:"length",type:"int"},{name:"reset_available_period",type:"flags.3?int"},{name:"reset_pending_date",type:"flags.4?int"}],type:"auth.SentCodeType"},{id:-1521934870,predicate:"auth.sentCodeTypeSetUpEmailRequired",params:[{name:"flags",type:"#"},{name:"apple_signin_allowed",type:"flags.0?true"},{name:"google_signin_allowed",type:"flags.1?true"}],type:"auth.SentCodeType"},{id:1128644211,predicate:"emailVerifyPurposeLoginSetup",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"EmailVerifyPurpose"},{id:1383932651,predicate:"emailVerifyPurposeLoginChange",params:[],type:"EmailVerifyPurpose"},{id:-1141565819,predicate:"emailVerifyPurposePassport",params:[],type:"EmailVerifyPurpose"},{id:-1842457175,predicate:"emailVerificationCode",params:[{name:"code",type:"string"}],type:"EmailVerification"},{id:-611279166,predicate:"emailVerificationGoogle",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:-1764723459,predicate:"emailVerificationApple",params:[{name:"token",type:"string"}],type:"EmailVerification"},{id:731303195,predicate:"account.emailVerified",params:[{name:"email",type:"string"}],type:"account.EmailVerified"},{id:-507835039,predicate:"account.emailVerifiedLogin",params:[{name:"email",type:"string"},{name:"sent_code",type:"auth.SentCode"}],type:"account.EmailVerified"},{id:1596792306,predicate:"premiumSubscriptionOption",params:[{name:"flags",type:"#"},{name:"current",type:"flags.1?true"},{name:"can_purchase_upgrade",type:"flags.2?true"},{name:"transaction",type:"flags.3?string"},{name:"months",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"bot_url",type:"string"},{name:"store_product",type:"flags.0?string"}],type:"PremiumSubscriptionOption"},{id:80008398,predicate:"inputStickerSetEmojiGenericAnimations",params:[],type:"InputStickerSet"},{id:701560302,predicate:"inputStickerSetEmojiDefaultStatuses",params:[],type:"InputStickerSet"},{id:-1206095820,predicate:"sendAsPeer",params:[{name:"flags",type:"#"},{name:"premium_required",type:"flags.0?true"},{name:"peer",type:"Peer"}],type:"SendAsPeer"},{id:-1386050360,predicate:"messageExtendedMediaPreview",params:[{name:"flags",type:"#"},{name:"w",type:"flags.0?int"},{name:"h",type:"flags.0?int"},{name:"thumb",type:"flags.1?PhotoSize"},{name:"video_duration",type:"flags.2?int"}],type:"MessageExtendedMedia"},{id:-297296796,predicate:"messageExtendedMedia",params:[{name:"media",type:"MessageMedia"}],type:"MessageExtendedMedia"},{id:-710666460,predicate:"updateMessageExtendedMedia",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"extended_media",type:"Vector<MessageExtendedMedia>"}],type:"Update"},{id:-50416996,predicate:"stickerKeyword",params:[{name:"document_id",type:"long"},{name:"keyword",type:"Vector<string>"}],type:"StickerKeyword"},{id:-1274595769,predicate:"username",params:[{name:"flags",type:"#"},{name:"editable",type:"flags.0?true"},{name:"active",type:"flags.1?true"},{name:"username",type:"string"}],type:"Username"},{id:-263212119,predicate:"channelAdminLogEventActionChangeUsernames",params:[{name:"prev_value",type:"Vector<string>"},{name:"new_value",type:"Vector<string>"}],type:"ChannelAdminLogEventAction"},{id:46949251,predicate:"channelAdminLogEventActionToggleForum",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1483767080,predicate:"channelAdminLogEventActionCreateTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-261103096,predicate:"channelAdminLogEventActionEditTopic",params:[{name:"prev_topic",type:"ForumTopic"},{name:"new_topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:-1374254839,predicate:"channelAdminLogEventActionDeleteTopic",params:[{name:"topic",type:"ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:1569535291,predicate:"channelAdminLogEventActionPinTopic",params:[{name:"flags",type:"#"},{name:"prev_topic",type:"flags.0?ForumTopic"},{name:"new_topic",type:"flags.1?ForumTopic"}],type:"ChannelAdminLogEventAction"},{id:37687451,predicate:"forumTopicDeleted",params:[{name:"id",type:"int"}],type:"ForumTopic"},{id:1903173033,predicate:"forumTopic",params:[{name:"flags",type:"#"},{name:"my",type:"flags.1?true"},{name:"closed",type:"flags.2?true"},{name:"pinned",type:"flags.3?true"},{name:"short",type:"flags.5?true"},{name:"hidden",type:"flags.6?true"},{name:"id",type:"int"},{name:"date",type:"int"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"},{name:"top_message",type:"int"},{name:"read_inbox_max_id",type:"int"},{name:"read_outbox_max_id",type:"int"},{name:"unread_count",type:"int"},{name:"unread_mentions_count",type:"int"},{name:"unread_reactions_count",type:"int"},{name:"from_id",type:"Peer"},{name:"notify_settings",type:"PeerNotifySettings"},{name:"draft",type:"flags.4?DraftMessage"}],type:"ForumTopic"},{id:913709011,predicate:"messages.forumTopics",params:[{name:"flags",type:"#"},{name:"order_by_create_date",type:"flags.0?true"},{name:"count",type:"int"},{name:"topics",type:"Vector<ForumTopic>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"pts",type:"int"}],type:"messages.ForumTopics"},{id:228168278,predicate:"messageActionTopicCreate",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"icon_color",type:"int"},{name:"icon_emoji_id",type:"flags.0?long"}],type:"MessageAction"},{id:-1064024032,predicate:"messageActionTopicEdit",params:[{name:"flags",type:"#"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"MessageAction"},{id:422509539,predicate:"updateChannelPinnedTopic",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"channel_id",type:"long"},{name:"topic_id",type:"int"}],type:"Update"},{id:1548122514,predicate:"inputNotifyForumTopic",params:[{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"int"}],type:"InputNotifyPeer"},{id:577659656,predicate:"notifyForumTopic",params:[{name:"peer",type:"Peer"},{name:"top_msg_id",type:"int"}],type:"NotifyPeer"},{id:1153562857,predicate:"inputStickerSetEmojiDefaultTopicIcons",params:[],type:"InputStickerSet"},{id:406407439,predicate:"messages.sponsoredMessagesEmpty",params:[],type:"messages.SponsoredMessages"},{id:-31881726,predicate:"updateChannelPinnedTopics",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"order",type:"flags.0?Vector<int>"}],type:"Update"},{id:1135897376,predicate:"defaultHistoryTTL",params:[{name:"period",type:"int"}],type:"DefaultHistoryTTL"},{id:116234636,predicate:"auth.codeTypeFragmentSms",params:[],type:"auth.CodeType"},{id:-648651719,predicate:"auth.sentCodeTypeFragmentSms",params:[{name:"url",type:"string"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:1103040667,predicate:"exportedContactToken",params:[{name:"url",type:"string"},{name:"expires",type:"int"}],type:"ExportedContactToken"},{id:1693675004,predicate:"channelAdminLogEventActionToggleAntiSpam",params:[{name:"new_value",type:"Bool"}],type:"ChannelAdminLogEventAction"},{id:1474192222,predicate:"messageActionSuggestProfilePhoto",params:[{name:"photo",type:"Photo"}],type:"MessageAction"},{id:2008112412,predicate:"stickerSetNoCovered",params:[{name:"set",type:"StickerSet"}],type:"StickerSetCovered"},{id:542282808,predicate:"updateUser",params:[{name:"user_id",type:"long"}],type:"Update"},{id:596704836,predicate:"auth.sentCodeSuccess",params:[{name:"authorization",type:"auth.Authorization"}],type:"auth.SentCode"},{id:827428507,predicate:"messageActionRequestedPeer",params:[{name:"button_id",type:"int"},{name:"peers",type:"Vector<Peer>"}],type:"MessageAction"},{id:1597737472,predicate:"requestPeerTypeUser",params:[{name:"flags",type:"#"},{name:"bot",type:"flags.0?Bool"},{name:"premium",type:"flags.1?Bool"}],type:"RequestPeerType"},{id:-906990053,predicate:"requestPeerTypeChat",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"bot_participant",type:"flags.5?true"},{name:"has_username",type:"flags.3?Bool"},{name:"forum",type:"flags.4?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:865857388,predicate:"requestPeerTypeBroadcast",params:[{name:"flags",type:"#"},{name:"creator",type:"flags.0?true"},{name:"has_username",type:"flags.3?Bool"},{name:"user_admin_rights",type:"flags.1?ChatAdminRights"},{name:"bot_admin_rights",type:"flags.2?ChatAdminRights"}],type:"RequestPeerType"},{id:1406648280,predicate:"keyboardButtonRequestPeer",params:[{name:"text",type:"string"},{name:"button_id",type:"int"},{name:"peer_type",type:"RequestPeerType"},{name:"max_quantity",type:"int"}],type:"KeyboardButton"},{id:1209970170,predicate:"emojiListNotModified",params:[],type:"EmojiList"},{id:2048790993,predicate:"emojiList",params:[{name:"hash",type:"long"},{name:"document_id",type:"Vector<long>"}],type:"EmojiList"},{id:10475318,predicate:"auth.sentCodeTypeFirebaseSms",params:[{name:"flags",type:"#"},{name:"nonce",type:"flags.0?bytes"},{name:"play_integrity_project_id",type:"flags.2?long"},{name:"play_integrity_nonce",type:"flags.2?bytes"},{name:"receipt",type:"flags.1?string"},{name:"push_timeout",type:"flags.1?int"},{name:"length",type:"int"}],type:"auth.SentCodeType"},{id:2056961449,predicate:"emojiGroup",params:[{name:"title",type:"string"},{name:"icon_emoji_id",type:"long"},{name:"emoticons",type:"Vector<string>"}],type:"EmojiGroup"},{id:1874111879,predicate:"messages.emojiGroupsNotModified",params:[],type:"messages.EmojiGroups"},{id:-2011186869,predicate:"messages.emojiGroups",params:[{name:"hash",type:"int"},{name:"groups",type:"Vector<EmojiGroup>"}],type:"messages.EmojiGroups"},{id:-128171716,predicate:"videoSizeEmojiMarkup",params:[{name:"emoji_id",type:"long"},{name:"background_colors",type:"Vector<int>"}],type:"VideoSize"},{id:228623102,predicate:"videoSizeStickerMarkup",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker_id",type:"long"},{name:"background_colors",type:"Vector<int>"}],type:"VideoSize"},{id:1964978502,predicate:"textWithEntities",params:[{name:"text",type:"string"},{name:"entities",type:"Vector<MessageEntity>"}],type:"TextWithEntities"},{id:870003448,predicate:"messages.translateResult",params:[{name:"result",type:"Vector<TextWithEntities>"}],type:"messages.TranslatedText"},{id:-934791986,predicate:"autoSaveSettings",params:[{name:"flags",type:"#"},{name:"photos",type:"flags.0?true"},{name:"videos",type:"flags.1?true"},{name:"video_max_size",type:"flags.2?long"}],type:"AutoSaveSettings"},{id:-2124403385,predicate:"autoSaveException",params:[{name:"peer",type:"Peer"},{name:"settings",type:"AutoSaveSettings"}],type:"AutoSaveException"},{id:1279133341,predicate:"account.autoSaveSettings",params:[{name:"users_settings",type:"AutoSaveSettings"},{name:"chats_settings",type:"AutoSaveSettings"},{name:"broadcasts_settings",type:"AutoSaveSettings"},{name:"exceptions",type:"Vector<AutoSaveException>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"account.AutoSaveSettings"},{id:-335171433,predicate:"updateAutoSaveSettings",params:[],type:"Update"},{id:2094949405,predicate:"help.appConfigNotModified",params:[],type:"help.AppConfig"},{id:-585598930,predicate:"help.appConfig",params:[{name:"hash",type:"int"},{name:"config",type:"JSONValue"}],type:"help.AppConfig"},{id:-1457472134,predicate:"inputBotAppID",params:[{name:"id",type:"long"},{name:"access_hash",type:"long"}],type:"InputBotApp"},{id:-1869872121,predicate:"inputBotAppShortName",params:[{name:"bot_id",type:"InputUser"},{name:"short_name",type:"string"}],type:"InputBotApp"},{id:1571189943,predicate:"botAppNotModified",params:[],type:"BotApp"},{id:-1778593322,predicate:"botApp",params:[{name:"flags",type:"#"},{name:"id",type:"long"},{name:"access_hash",type:"long"},{name:"short_name",type:"string"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"Photo"},{name:"document",type:"flags.0?Document"},{name:"hash",type:"long"}],type:"BotApp"},{id:-347034123,predicate:"messages.botApp",params:[{name:"flags",type:"#"},{name:"inactive",type:"flags.0?true"},{name:"request_write_access",type:"flags.1?true"},{name:"has_settings",type:"flags.2?true"},{name:"app",type:"BotApp"}],type:"messages.BotApp"},{id:-1250781739,predicate:"inlineBotWebView",params:[{name:"text",type:"string"},{name:"url",type:"string"}],type:"InlineBotWebView"},{id:1246753138,predicate:"readParticipantDate",params:[{name:"user_id",type:"long"},{name:"date",type:"int"}],type:"ReadParticipantDate"},{id:-1612542300,predicate:"dialogFilterChatlist",params:[{name:"flags",type:"#"},{name:"has_my_invites",type:"flags.26?true"},{name:"id",type:"int"},{name:"title",type:"string"},{name:"emoticon",type:"flags.25?string"},{name:"color",type:"flags.27?int"},{name:"pinned_peers",type:"Vector<InputPeer>"},{name:"include_peers",type:"Vector<InputPeer>"}],type:"DialogFilter"},{id:-203367885,predicate:"inputChatlistDialogFilter",params:[{name:"filter_id",type:"int"}],type:"InputChatlist"},{id:206668204,predicate:"exportedChatlistInvite",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"url",type:"string"},{name:"peers",type:"Vector<Peer>"}],type:"ExportedChatlistInvite"},{id:283567014,predicate:"chatlists.exportedChatlistInvite",params:[{name:"filter",type:"DialogFilter"},{name:"invite",type:"ExportedChatlistInvite"}],type:"chatlists.ExportedChatlistInvite"},{id:279670215,predicate:"chatlists.exportedInvites",params:[{name:"invites",type:"Vector<ExportedChatlistInvite>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"chatlists.ExportedInvites"},{id:-91752871,predicate:"chatlists.chatlistInviteAlready",params:[{name:"filter_id",type:"int"},{name:"missing_peers",type:"Vector<Peer>"},{name:"already_peers",type:"Vector<Peer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"chatlists.ChatlistInvite"},{id:500007837,predicate:"chatlists.chatlistInvite",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"emoticon",type:"flags.0?string"},{name:"peers",type:"Vector<Peer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"chatlists.ChatlistInvite"},{id:-1816295539,predicate:"chatlists.chatlistUpdates",params:[{name:"missing_peers",type:"Vector<Peer>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"chatlists.ChatlistUpdates"},{id:1348510708,predicate:"messageActionSetChatWallPaper",params:[{name:"flags",type:"#"},{name:"same",type:"flags.0?true"},{name:"for_both",type:"flags.1?true"},{name:"wallpaper",type:"WallPaper"}],type:"MessageAction"},{id:-391678544,predicate:"bots.botInfo",params:[{name:"name",type:"string"},{name:"about",type:"string"},{name:"description",type:"string"}],type:"bots.BotInfo"},{id:238759180,predicate:"inlineQueryPeerTypeBotPM",params:[],type:"InlineQueryPeerType"},{id:-1228133028,predicate:"messagePeerVote",params:[{name:"peer",type:"Peer"},{name:"option",type:"bytes"},{name:"date",type:"int"}],type:"MessagePeerVote"},{id:1959634180,predicate:"messagePeerVoteInputOption",params:[{name:"peer",type:"Peer"},{name:"date",type:"int"}],type:"MessagePeerVote"},{id:1177089766,predicate:"messagePeerVoteMultiple",params:[{name:"peer",type:"Peer"},{name:"options",type:"Vector<bytes>"},{name:"date",type:"int"}],type:"MessagePeerVote"},{id:941870144,predicate:"inputPrivacyKeyAbout",params:[],type:"InputPrivacyKey"},{id:-1534675103,predicate:"privacyKeyAbout",params:[],type:"PrivacyKey"},{id:-1923523370,predicate:"storyViews",params:[{name:"flags",type:"#"},{name:"has_viewers",type:"flags.1?true"},{name:"views_count",type:"int"},{name:"forwards_count",type:"flags.2?int"},{name:"reactions",type:"flags.3?Vector<ReactionCount>"},{name:"reactions_count",type:"flags.4?int"},{name:"recent_viewers",type:"flags.0?Vector<long>"}],type:"StoryViews"},{id:1374088783,predicate:"storyItemDeleted",params:[{name:"id",type:"int"}],type:"StoryItem"},{id:-5388013,predicate:"storyItemSkipped",params:[{name:"flags",type:"#"},{name:"close_friends",type:"flags.8?true"},{name:"id",type:"int"},{name:"date",type:"int"},{name:"expire_date",type:"int"}],type:"StoryItem"},{id:2041735716,predicate:"storyItem",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.5?true"},{name:"public",type:"flags.7?true"},{name:"close_friends",type:"flags.8?true"},{name:"min",type:"flags.9?true"},{name:"noforwards",type:"flags.10?true"},{name:"edited",type:"flags.11?true"},{name:"contacts",type:"flags.12?true"},{name:"selected_contacts",type:"flags.13?true"},{name:"out",type:"flags.16?true"},{name:"id",type:"int"},{name:"date",type:"int"},{name:"from_id",type:"flags.18?Peer"},{name:"fwd_from",type:"flags.17?StoryFwdHeader"},{name:"expire_date",type:"int"},{name:"caption",type:"flags.0?string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"media",type:"MessageMedia"},{name:"media_areas",type:"flags.14?Vector<MediaArea>"},{name:"privacy",type:"flags.2?Vector<PrivacyRule>"},{name:"views",type:"flags.3?StoryViews"},{name:"sent_reaction",type:"flags.15?Reaction"}],type:"StoryItem"},{id:1974712216,predicate:"updateStory",params:[{name:"peer",type:"Peer"},{name:"story",type:"StoryItem"}],type:"Update"},{id:-145845461,predicate:"updateReadStories",params:[{name:"peer",type:"Peer"},{name:"max_id",type:"int"}],type:"Update"},{id:291044926,predicate:"stories.allStoriesNotModified",params:[{name:"flags",type:"#"},{name:"state",type:"string"},{name:"stealth_mode",type:"StoriesStealthMode"}],type:"stories.AllStories"},{id:1862033025,predicate:"stories.allStories",params:[{name:"flags",type:"#"},{name:"has_more",type:"flags.0?true"},{name:"count",type:"int"},{name:"state",type:"string"},{name:"peer_stories",type:"Vector<PeerStories>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"stealth_mode",type:"StoriesStealthMode"}],type:"stories.AllStories"},{id:1673780490,predicate:"stories.stories",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"stories",type:"Vector<StoryItem>"},{name:"pinned_to_top",type:"flags.0?Vector<int>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"stories.Stories"},{id:793067081,predicate:"inputPrivacyValueAllowCloseFriends",params:[],type:"InputPrivacyRule"},{id:-135735141,predicate:"privacyValueAllowCloseFriends",params:[],type:"PrivacyRule"},{id:-1329730875,predicate:"storyView",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"blocked_my_stories_from",type:"flags.1?true"},{name:"user_id",type:"long"},{name:"date",type:"int"},{name:"reaction",type:"flags.2?Reaction"}],type:"StoryView"},{id:1507299269,predicate:"stories.storyViewsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"views_count",type:"int"},{name:"forwards_count",type:"int"},{name:"reactions_count",type:"int"},{name:"views",type:"Vector<StoryView>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"next_offset",type:"flags.0?string"}],type:"stories.StoryViewsList"},{id:-560009955,predicate:"stories.storyViews",params:[{name:"views",type:"Vector<StoryViews>"},{name:"users",type:"Vector<User>"}],type:"stories.StoryViews"},{id:583071445,predicate:"inputReplyToMessage",params:[{name:"flags",type:"#"},{name:"reply_to_msg_id",type:"int"},{name:"top_msg_id",type:"flags.0?int"},{name:"reply_to_peer_id",type:"flags.1?InputPeer"},{name:"quote_text",type:"flags.2?string"},{name:"quote_entities",type:"flags.3?Vector<MessageEntity>"},{name:"quote_offset",type:"flags.4?int"}],type:"InputReplyTo"},{id:1484862010,predicate:"inputReplyToStory",params:[{name:"peer",type:"InputPeer"},{name:"story_id",type:"int"}],type:"InputReplyTo"},{id:240843065,predicate:"messageReplyStoryHeader",params:[{name:"peer",type:"Peer"},{name:"story_id",type:"int"}],type:"MessageReplyHeader"},{id:468923833,predicate:"updateStoryID",params:[{name:"id",type:"int"},{name:"random_id",type:"long"}],type:"Update"},{id:1070138683,predicate:"exportedStoryLink",params:[{name:"link",type:"string"}],type:"ExportedStoryLink"},{id:-1979852936,predicate:"inputMediaStory",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"InputMedia"},{id:1758159491,predicate:"messageMediaStory",params:[{name:"flags",type:"#"},{name:"via_mention",type:"flags.1?true"},{name:"peer",type:"Peer"},{name:"id",type:"int"},{name:"story",type:"flags.0?StoryItem"}],type:"MessageMedia"},{id:781501415,predicate:"webPageAttributeStory",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"id",type:"int"},{name:"story",type:"flags.0?StoryItem"}],type:"WebPageAttribute"},{id:1898850301,predicate:"storiesStealthMode",params:[{name:"flags",type:"#"},{name:"active_until_date",type:"flags.0?int"},{name:"cooldown_until_date",type:"flags.1?int"}],type:"StoriesStealthMode"},{id:738741697,predicate:"updateStoriesStealthMode",params:[{name:"stealth_mode",type:"StoriesStealthMode"}],type:"Update"},{id:-808853502,predicate:"mediaAreaCoordinates",params:[{name:"flags",type:"#"},{name:"x",type:"double"},{name:"y",type:"double"},{name:"w",type:"double"},{name:"h",type:"double"},{name:"rotation",type:"double"},{name:"radius",type:"flags.0?double"}],type:"MediaAreaCoordinates"},{id:-1098720356,predicate:"mediaAreaVenue",params:[{name:"coordinates",type:"MediaAreaCoordinates"},{name:"geo",type:"GeoPoint"},{name:"title",type:"string"},{name:"address",type:"string"},{name:"provider",type:"string"},{name:"venue_id",type:"string"},{name:"venue_type",type:"string"}],type:"MediaArea"},{id:-1300094593,predicate:"inputMediaAreaVenue",params:[{name:"coordinates",type:"MediaAreaCoordinates"},{name:"query_id",type:"long"},{name:"result_id",type:"string"}],type:"MediaArea"},{id:-891992787,predicate:"mediaAreaGeoPoint",params:[{name:"flags",type:"#"},{name:"coordinates",type:"MediaAreaCoordinates"},{name:"geo",type:"GeoPoint"},{name:"address",type:"flags.0?GeoPointAddress"}],type:"MediaArea"},{id:2103604867,predicate:"updateSentStoryReaction",params:[{name:"peer",type:"Peer"},{name:"story_id",type:"int"},{name:"reaction",type:"Reaction"}],type:"Update"},{id:340088945,predicate:"mediaAreaSuggestedReaction",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"flipped",type:"flags.1?true"},{name:"coordinates",type:"MediaAreaCoordinates"},{name:"reaction",type:"Reaction"}],type:"MediaArea"},{id:-1707742823,predicate:"peerStories",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"max_read_id",type:"flags.0?int"},{name:"stories",type:"Vector<StoryItem>"}],type:"PeerStories"},{id:-890861720,predicate:"stories.peerStories",params:[{name:"stories",type:"PeerStories"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"stories.PeerStories"},{id:-44166467,predicate:"messages.webPage",params:[{name:"webpage",type:"WebPage"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.WebPage"},{id:-1551868097,predicate:"inputStorePaymentPremiumGiftCode",params:[{name:"flags",type:"#"},{name:"users",type:"Vector<InputUser>"},{name:"boost_peer",type:"flags.0?InputPeer"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:369444042,predicate:"inputStorePaymentPremiumGiveaway",params:[{name:"flags",type:"#"},{name:"only_new_subscribers",type:"flags.0?true"},{name:"winners_are_visible",type:"flags.3?true"},{name:"boost_peer",type:"InputPeer"},{name:"additional_peers",type:"flags.1?Vector<InputPeer>"},{name:"countries_iso2",type:"flags.2?Vector<string>"},{name:"prize_description",type:"flags.4?string"},{name:"random_id",type:"long"},{name:"until_date",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:-1734841331,predicate:"inputInvoicePremiumGiftCode",params:[{name:"purpose",type:"InputStorePaymentPurpose"},{name:"option",type:"PremiumGiftCodeOption"}],type:"InputInvoice"},{id:629052971,predicate:"premiumGiftCodeOption",params:[{name:"flags",type:"#"},{name:"users",type:"int"},{name:"months",type:"int"},{name:"store_product",type:"flags.0?string"},{name:"store_quantity",type:"flags.1?int"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"PremiumGiftCodeOption"},{id:675942550,predicate:"payments.checkedGiftCode",params:[{name:"flags",type:"#"},{name:"via_giveaway",type:"flags.2?true"},{name:"from_id",type:"flags.4?Peer"},{name:"giveaway_msg_id",type:"flags.3?int"},{name:"to_id",type:"flags.0?long"},{name:"date",type:"int"},{name:"months",type:"int"},{name:"used_date",type:"flags.1?int"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"payments.CheckedGiftCode"},{id:-626162256,predicate:"messageMediaGiveaway",params:[{name:"flags",type:"#"},{name:"only_new_subscribers",type:"flags.0?true"},{name:"winners_are_visible",type:"flags.2?true"},{name:"channels",type:"Vector<long>"},{name:"countries_iso2",type:"flags.1?Vector<string>"},{name:"prize_description",type:"flags.3?string"},{name:"quantity",type:"int"},{name:"months",type:"int"},{name:"until_date",type:"int"}],type:"MessageMedia"},{id:1737240073,predicate:"messageActionGiftCode",params:[{name:"flags",type:"#"},{name:"via_giveaway",type:"flags.0?true"},{name:"unclaimed",type:"flags.2?true"},{name:"boost_peer",type:"flags.1?Peer"},{name:"months",type:"int"},{name:"slug",type:"string"},{name:"currency",type:"flags.2?string"},{name:"amount",type:"flags.2?long"},{name:"crypto_currency",type:"flags.3?string"},{name:"crypto_amount",type:"flags.3?long"}],type:"MessageAction"},{id:858499565,predicate:"messageActionGiveawayLaunch",params:[],type:"MessageAction"},{id:1130879648,predicate:"payments.giveawayInfo",params:[{name:"flags",type:"#"},{name:"participating",type:"flags.0?true"},{name:"preparing_results",type:"flags.3?true"},{name:"start_date",type:"int"},{name:"joined_too_early_date",type:"flags.1?int"},{name:"admin_disallowed_chat_id",type:"flags.2?long"},{name:"disallowed_country",type:"flags.4?string"}],type:"payments.GiveawayInfo"},{id:13456752,predicate:"payments.giveawayInfoResults",params:[{name:"flags",type:"#"},{name:"winner",type:"flags.0?true"},{name:"refunded",type:"flags.1?true"},{name:"start_date",type:"int"},{name:"gift_code_slug",type:"flags.0?string"},{name:"finish_date",type:"int"},{name:"winners_count",type:"int"},{name:"activated_count",type:"int"}],type:"payments.GiveawayInfo"},{id:-238245204,predicate:"messageEntityBlockquote",params:[{name:"flags",type:"#"},{name:"collapsed",type:"flags.0?true"},{name:"offset",type:"int"},{name:"length",type:"int"}],type:"MessageEntity"},{id:-1303143084,predicate:"prepaidGiveaway",params:[{name:"id",type:"long"},{name:"months",type:"int"},{name:"quantity",type:"int"},{name:"date",type:"int"}],type:"PrepaidGiveaway"},{id:-1038383031,predicate:"inputMediaWebPage",params:[{name:"flags",type:"#"},{name:"force_large_media",type:"flags.0?true"},{name:"force_small_media",type:"flags.1?true"},{name:"optional",type:"flags.2?true"},{name:"url",type:"string"}],type:"InputMedia"},{id:-1109605104,predicate:"inputBotInlineMessageMediaWebPage",params:[{name:"flags",type:"#"},{name:"invert_media",type:"flags.3?true"},{name:"force_large_media",type:"flags.4?true"},{name:"force_small_media",type:"flags.5?true"},{name:"optional",type:"flags.6?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"url",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"InputBotInlineMessage"},{id:-2137335386,predicate:"botInlineMessageMediaWebPage",params:[{name:"flags",type:"#"},{name:"invert_media",type:"flags.3?true"},{name:"force_large_media",type:"flags.4?true"},{name:"force_small_media",type:"flags.5?true"},{name:"manual",type:"flags.7?true"},{name:"safe",type:"flags.8?true"},{name:"message",type:"string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"url",type:"string"},{name:"reply_markup",type:"flags.2?ReplyMarkup"}],type:"BotInlineMessage"},{id:706514033,predicate:"boost",params:[{name:"flags",type:"#"},{name:"gift",type:"flags.1?true"},{name:"giveaway",type:"flags.2?true"},{name:"unclaimed",type:"flags.3?true"},{name:"id",type:"string"},{name:"user_id",type:"flags.0?long"},{name:"giveaway_msg_id",type:"flags.2?int"},{name:"date",type:"int"},{name:"expires",type:"int"},{name:"used_gift_slug",type:"flags.4?string"},{name:"multiplier",type:"flags.5?int"}],type:"Boost"},{id:-2030542532,predicate:"premium.boostsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"boosts",type:"Vector<Boost>"},{name:"next_offset",type:"flags.0?string"},{name:"users",type:"Vector<User>"}],type:"premium.BoostsList"},{id:-1001897636,predicate:"myBoost",params:[{name:"flags",type:"#"},{name:"slot",type:"int"},{name:"peer",type:"flags.0?Peer"},{name:"date",type:"int"},{name:"expires",type:"int"},{name:"cooldown_until_date",type:"flags.1?int"}],type:"MyBoost"},{id:-1696454430,predicate:"premium.myBoosts",params:[{name:"my_boosts",type:"Vector<MyBoost>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"premium.MyBoosts"},{id:1230586490,predicate:"premium.boostsStatus",params:[{name:"flags",type:"#"},{name:"my_boost",type:"flags.2?true"},{name:"level",type:"int"},{name:"current_level_boosts",type:"int"},{name:"boosts",type:"int"},{name:"gift_boosts",type:"flags.4?int"},{name:"next_level_boosts",type:"flags.0?int"},{name:"premium_audience",type:"flags.1?StatsPercentValue"},{name:"boost_url",type:"string"},{name:"prepaid_giveaways",type:"flags.3?Vector<PrepaidGiveaway>"},{name:"my_boost_slots",type:"flags.2?Vector<int>"}],type:"premium.BoostsStatus"},{id:-1873947492,predicate:"updateBotChatBoost",params:[{name:"peer",type:"Peer"},{name:"boost",type:"Boost"},{name:"qts",type:"int"}],type:"Update"},{id:129403168,predicate:"updateChannelViewForumAsMessages",params:[{name:"channel_id",type:"long"},{name:"enabled",type:"Bool"}],type:"Update"},{id:715107781,predicate:"messageActionGiveawayResults",params:[{name:"winners_count",type:"int"},{name:"unclaimed_count",type:"int"}],type:"MessageAction"},{id:-1371598819,predicate:"updatePeerWallpaper",params:[{name:"flags",type:"#"},{name:"wallpaper_overridden",type:"flags.1?true"},{name:"peer",type:"Peer"},{name:"wallpaper",type:"flags.0?WallPaper"}],type:"Update"},{id:-1205411504,predicate:"storyFwdHeader",params:[{name:"flags",type:"#"},{name:"modified",type:"flags.3?true"},{name:"from",type:"flags.0?Peer"},{name:"from_name",type:"flags.1?string"},{name:"story_id",type:"flags.2?int"}],type:"StoryFwdHeader"},{id:-419066241,predicate:"postInteractionCountersMessage",params:[{name:"msg_id",type:"int"},{name:"views",type:"int"},{name:"forwards",type:"int"},{name:"reactions",type:"int"}],type:"PostInteractionCounters"},{id:-1974989273,predicate:"postInteractionCountersStory",params:[{name:"story_id",type:"int"},{name:"views",type:"int"},{name:"forwards",type:"int"},{name:"reactions",type:"int"}],type:"PostInteractionCounters"},{id:1355613820,predicate:"stats.storyStats",params:[{name:"views_graph",type:"StatsGraph"},{name:"reactions_by_emotion_graph",type:"StatsGraph"}],type:"stats.StoryStats"},{id:32685898,predicate:"publicForwardMessage",params:[{name:"message",type:"Message"}],type:"PublicForward"},{id:-302797360,predicate:"publicForwardStory",params:[{name:"peer",type:"Peer"},{name:"story",type:"StoryItem"}],type:"PublicForward"},{id:-1828487648,predicate:"stats.publicForwards",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"forwards",type:"Vector<PublicForward>"},{name:"next_offset",type:"flags.0?string"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"stats.PublicForwards"},{id:-1253352753,predicate:"peerColor",params:[{name:"flags",type:"#"},{name:"color",type:"flags.0?int"},{name:"background_emoji_id",type:"flags.1?long"}],type:"PeerColor"},{id:639736408,predicate:"help.peerColorSet",params:[{name:"colors",type:"Vector<int>"}],type:"help.PeerColorSet"},{id:1987928555,predicate:"help.peerColorProfileSet",params:[{name:"palette_colors",type:"Vector<int>"},{name:"bg_colors",type:"Vector<int>"},{name:"story_colors",type:"Vector<int>"}],type:"help.PeerColorSet"},{id:-1377014082,predicate:"help.peerColorOption",params:[{name:"flags",type:"#"},{name:"hidden",type:"flags.0?true"},{name:"color_id",type:"int"},{name:"colors",type:"flags.1?help.PeerColorSet"},{name:"dark_colors",type:"flags.2?help.PeerColorSet"},{name:"channel_min_level",type:"flags.3?int"},{name:"group_min_level",type:"flags.4?int"}],type:"help.PeerColorOption"},{id:732034510,predicate:"help.peerColorsNotModified",params:[],type:"help.PeerColors"},{id:16313608,predicate:"help.peerColors",params:[{name:"hash",type:"int"},{name:"colors",type:"Vector<help.PeerColorOption>"}],type:"help.PeerColors"},{id:-963047320,predicate:"messageMediaGiveawayResults",params:[{name:"flags",type:"#"},{name:"only_new_subscribers",type:"flags.0?true"},{name:"refunded",type:"flags.2?true"},{name:"channel_id",type:"long"},{name:"additional_peers_count",type:"flags.3?int"},{name:"launch_msg_id",type:"int"},{name:"winners_count",type:"int"},{name:"unclaimed_count",type:"int"},{name:"winners",type:"Vector<long>"},{name:"months",type:"int"},{name:"prize_description",type:"flags.1?string"},{name:"until_date",type:"int"}],type:"MessageMedia"},{id:1620104917,predicate:"storyReaction",params:[{name:"peer_id",type:"Peer"},{name:"date",type:"int"},{name:"reaction",type:"Reaction"}],type:"StoryReaction"},{id:-1146411453,predicate:"storyReactionPublicForward",params:[{name:"message",type:"Message"}],type:"StoryReaction"},{id:-808644845,predicate:"storyReactionPublicRepost",params:[{name:"peer_id",type:"Peer"},{name:"story",type:"StoryItem"}],type:"StoryReaction"},{id:-1436583780,predicate:"stories.storyReactionsList",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"reactions",type:"Vector<StoryReaction>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"},{name:"next_offset",type:"flags.0?string"}],type:"stories.StoryReactionsList"},{id:-1870436597,predicate:"storyViewPublicForward",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"blocked_my_stories_from",type:"flags.1?true"},{name:"message",type:"Message"}],type:"StoryView"},{id:-1116418231,predicate:"storyViewPublicRepost",params:[{name:"flags",type:"#"},{name:"blocked",type:"flags.0?true"},{name:"blocked_my_stories_from",type:"flags.1?true"},{name:"peer_id",type:"Peer"},{name:"story",type:"StoryItem"}],type:"StoryView"},{id:1469507456,predicate:"channelAdminLogEventActionChangePeerColor",params:[{name:"prev_value",type:"PeerColor"},{name:"new_value",type:"PeerColor"}],type:"ChannelAdminLogEventAction"},{id:1581742885,predicate:"channelAdminLogEventActionChangeProfilePeerColor",params:[{name:"prev_value",type:"PeerColor"},{name:"new_value",type:"PeerColor"}],type:"ChannelAdminLogEventAction"},{id:834362706,predicate:"channelAdminLogEventActionChangeWallpaper",params:[{name:"prev_value",type:"WallPaper"},{name:"new_value",type:"WallPaper"}],type:"ChannelAdminLogEventAction"},{id:1051328177,predicate:"channelAdminLogEventActionChangeEmojiStatus",params:[{name:"prev_value",type:"EmojiStatus"},{name:"new_value",type:"EmojiStatus"}],type:"ChannelAdminLogEventAction"},{id:1232373075,predicate:"inputStickerSetEmojiChannelDefaultStatuses",params:[],type:"InputStickerSet"},{id:1996756655,predicate:"mediaAreaChannelPost",params:[{name:"coordinates",type:"MediaAreaCoordinates"},{name:"channel_id",type:"long"},{name:"msg_id",type:"int"}],type:"MediaArea"},{id:577893055,predicate:"inputMediaAreaChannelPost",params:[{name:"coordinates",type:"MediaAreaCoordinates"},{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"MediaArea"},{id:-1407069234,predicate:"updateBotMessageReaction",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"date",type:"int"},{name:"actor",type:"Peer"},{name:"old_reactions",type:"Vector<Reaction>"},{name:"new_reactions",type:"Vector<Reaction>"},{name:"qts",type:"int"}],type:"Update"},{id:164329305,predicate:"updateBotMessageReactions",params:[{name:"peer",type:"Peer"},{name:"msg_id",type:"int"},{name:"date",type:"int"},{name:"reactions",type:"Vector<ReactionCount>"},{name:"qts",type:"int"}],type:"Update"},{id:-1115174036,predicate:"savedDialog",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"peer",type:"Peer"},{name:"top_message",type:"int"}],type:"SavedDialog"},{id:-1364222348,predicate:"updateSavedDialogPinned",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"DialogPeer"}],type:"Update"},{id:1751942566,predicate:"updatePinnedSavedDialogs",params:[{name:"flags",type:"#"},{name:"order",type:"flags.0?Vector<DialogPeer>"}],type:"Update"},{id:-130358751,predicate:"messages.savedDialogs",params:[{name:"dialogs",type:"Vector<SavedDialog>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.SavedDialogs"},{id:1153080793,predicate:"messages.savedDialogsSlice",params:[{name:"count",type:"int"},{name:"dialogs",type:"Vector<SavedDialog>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.SavedDialogs"},{id:-1071681560,predicate:"messages.savedDialogsNotModified",params:[{name:"count",type:"int"}],type:"messages.SavedDialogs"},{id:-881854424,predicate:"savedReactionTag",params:[{name:"flags",type:"#"},{name:"reaction",type:"Reaction"},{name:"title",type:"flags.0?string"},{name:"count",type:"int"}],type:"SavedReactionTag"},{id:-2003084817,predicate:"messages.savedReactionTagsNotModified",params:[],type:"messages.SavedReactionTags"},{id:844731658,predicate:"messages.savedReactionTags",params:[{name:"tags",type:"Vector<SavedReactionTag>"},{name:"hash",type:"long"}],type:"messages.SavedReactionTags"},{id:969307186,predicate:"updateSavedReactionTags",params:[],type:"Update"},{id:1001931436,predicate:"outboxReadDate",params:[{name:"date",type:"int"}],type:"OutboxReadDate"},{id:-872240531,predicate:"messageActionBoostApply",params:[{name:"boosts",type:"int"}],type:"MessageAction"},{id:1188577451,predicate:"channelAdminLogEventActionChangeEmojiStickerSet",params:[{name:"prev_stickerset",type:"InputStickerSet"},{name:"new_stickerset",type:"InputStickerSet"}],type:"ChannelAdminLogEventAction"},{id:-594852657,predicate:"smsjobs.eligibleToJoin",params:[{name:"terms_url",type:"string"},{name:"monthly_sent_sms",type:"int"}],type:"smsjobs.EligibilityToJoin"},{id:720277905,predicate:"smsjobs.status",params:[{name:"flags",type:"#"},{name:"allow_international",type:"flags.0?true"},{name:"recent_sent",type:"int"},{name:"recent_since",type:"int"},{name:"recent_remains",type:"int"},{name:"total_sent",type:"int"},{name:"total_since",type:"int"},{name:"last_gift_slug",type:"flags.1?string"},{name:"terms_url",type:"string"}],type:"smsjobs.Status"},{id:-245208620,predicate:"updateSmsJob",params:[{name:"job_id",type:"string"}],type:"Update"},{id:-425595208,predicate:"smsJob",params:[{name:"job_id",type:"string"},{name:"phone_number",type:"string"},{name:"text",type:"string"}],type:"SmsJob"},{id:302717625,predicate:"businessWeeklyOpen",params:[{name:"start_minute",type:"int"},{name:"end_minute",type:"int"}],type:"BusinessWeeklyOpen"},{id:-1936543592,predicate:"businessWorkHours",params:[{name:"flags",type:"#"},{name:"open_now",type:"flags.0?true"},{name:"timezone_id",type:"string"},{name:"weekly_open",type:"Vector<BusinessWeeklyOpen>"}],type:"BusinessWorkHours"},{id:-1403249929,predicate:"businessLocation",params:[{name:"flags",type:"#"},{name:"geo_point",type:"flags.0?GeoPoint"},{name:"address",type:"string"}],type:"BusinessLocation"},{id:1871393450,predicate:"inputBusinessRecipients",params:[{name:"flags",type:"#"},{name:"existing_chats",type:"flags.0?true"},{name:"new_chats",type:"flags.1?true"},{name:"contacts",type:"flags.2?true"},{name:"non_contacts",type:"flags.3?true"},{name:"exclude_selected",type:"flags.5?true"},{name:"users",type:"flags.4?Vector<InputUser>"}],type:"InputBusinessRecipients"},{id:554733559,predicate:"businessRecipients",params:[{name:"flags",type:"#"},{name:"existing_chats",type:"flags.0?true"},{name:"new_chats",type:"flags.1?true"},{name:"contacts",type:"flags.2?true"},{name:"non_contacts",type:"flags.3?true"},{name:"exclude_selected",type:"flags.5?true"},{name:"users",type:"flags.4?Vector<long>"}],type:"BusinessRecipients"},{id:-910564679,predicate:"businessAwayMessageScheduleAlways",params:[],type:"BusinessAwayMessageSchedule"},{id:-1007487743,predicate:"businessAwayMessageScheduleOutsideWorkHours",params:[],type:"BusinessAwayMessageSchedule"},{id:-867328308,predicate:"businessAwayMessageScheduleCustom",params:[{name:"start_date",type:"int"},{name:"end_date",type:"int"}],type:"BusinessAwayMessageSchedule"},{id:26528571,predicate:"inputBusinessGreetingMessage",params:[{name:"shortcut_id",type:"int"},{name:"recipients",type:"InputBusinessRecipients"},{name:"no_activity_days",type:"int"}],type:"InputBusinessGreetingMessage"},{id:-451302485,predicate:"businessGreetingMessage",params:[{name:"shortcut_id",type:"int"},{name:"recipients",type:"BusinessRecipients"},{name:"no_activity_days",type:"int"}],type:"BusinessGreetingMessage"},{id:-2094959136,predicate:"inputBusinessAwayMessage",params:[{name:"flags",type:"#"},{name:"offline_only",type:"flags.0?true"},{name:"shortcut_id",type:"int"},{name:"schedule",type:"BusinessAwayMessageSchedule"},{name:"recipients",type:"InputBusinessRecipients"}],type:"InputBusinessAwayMessage"},{id:-283809188,predicate:"businessAwayMessage",params:[{name:"flags",type:"#"},{name:"offline_only",type:"flags.0?true"},{name:"shortcut_id",type:"int"},{name:"schedule",type:"BusinessAwayMessageSchedule"},{name:"recipients",type:"BusinessRecipients"}],type:"BusinessAwayMessage"},{id:-7173643,predicate:"timezone",params:[{name:"id",type:"string"},{name:"name",type:"string"},{name:"utc_offset",type:"int"}],type:"Timezone"},{id:-1761146676,predicate:"help.timezonesListNotModified",params:[],type:"help.TimezonesList"},{id:2071260529,predicate:"help.timezonesList",params:[{name:"timezones",type:"Vector<Timezone>"},{name:"hash",type:"int"}],type:"help.TimezonesList"},{id:110563371,predicate:"quickReply",params:[{name:"shortcut_id",type:"int"},{name:"shortcut",type:"string"},{name:"top_message",type:"int"},{name:"count",type:"int"}],type:"QuickReply"},{id:609840449,predicate:"inputQuickReplyShortcut",params:[{name:"shortcut",type:"string"}],type:"InputQuickReplyShortcut"},{id:18418929,predicate:"inputQuickReplyShortcutId",params:[{name:"shortcut_id",type:"int"}],type:"InputQuickReplyShortcut"},{id:-963811691,predicate:"messages.quickReplies",params:[{name:"quick_replies",type:"Vector<QuickReply>"},{name:"messages",type:"Vector<Message>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"messages.QuickReplies"},{id:1603398491,predicate:"messages.quickRepliesNotModified",params:[],type:"messages.QuickReplies"},{id:-112784718,predicate:"updateQuickReplies",params:[{name:"quick_replies",type:"Vector<QuickReply>"}],type:"Update"},{id:-180508905,predicate:"updateNewQuickReply",params:[{name:"quick_reply",type:"QuickReply"}],type:"Update"},{id:1407644140,predicate:"updateDeleteQuickReply",params:[{name:"shortcut_id",type:"int"}],type:"Update"},{id:1040518415,predicate:"updateQuickReplyMessage",params:[{name:"message",type:"Message"}],type:"Update"},{id:1450174413,predicate:"updateDeleteQuickReplyMessages",params:[{name:"shortcut_id",type:"int"},{name:"messages",type:"Vector<int>"}],type:"Update"},{id:-1123645951,predicate:"connectedBot",params:[{name:"flags",type:"#"},{name:"can_reply",type:"flags.0?true"},{name:"bot_id",type:"long"},{name:"recipients",type:"BusinessBotRecipients"}],type:"ConnectedBot"},{id:400029819,predicate:"account.connectedBots",params:[{name:"connected_bots",type:"Vector<ConnectedBot>"},{name:"users",type:"Vector<User>"}],type:"account.ConnectedBots"},{id:718878489,predicate:"messages.dialogFilters",params:[{name:"flags",type:"#"},{name:"tags_enabled",type:"flags.0?true"},{name:"filters",type:"Vector<DialogFilter>"}],type:"messages.DialogFilters"},{id:1821253126,predicate:"birthday",params:[{name:"flags",type:"#"},{name:"day",type:"int"},{name:"month",type:"int"},{name:"year",type:"flags.0?int"}],type:"Birthday"},{id:-1964652166,predicate:"updateBotBusinessConnect",params:[{name:"connection",type:"BotBusinessConnection"},{name:"qts",type:"int"}],type:"Update"},{id:-1646578564,predicate:"updateBotNewBusinessMessage",params:[{name:"flags",type:"#"},{name:"connection_id",type:"string"},{name:"message",type:"Message"},{name:"reply_to_message",type:"flags.0?Message"},{name:"qts",type:"int"}],type:"Update"},{id:132077692,predicate:"updateBotEditBusinessMessage",params:[{name:"flags",type:"#"},{name:"connection_id",type:"string"},{name:"message",type:"Message"},{name:"reply_to_message",type:"flags.0?Message"},{name:"qts",type:"int"}],type:"Update"},{id:-1607821266,predicate:"updateBotDeleteBusinessMessage",params:[{name:"connection_id",type:"string"},{name:"peer",type:"Peer"},{name:"messages",type:"Vector<int>"},{name:"qts",type:"int"}],type:"Update"},{id:-1989921868,predicate:"botBusinessConnection",params:[{name:"flags",type:"#"},{name:"can_reply",type:"flags.0?true"},{name:"disabled",type:"flags.1?true"},{name:"connection_id",type:"string"},{name:"user_id",type:"long"},{name:"dc_id",type:"int"},{name:"date",type:"int"}],type:"BotBusinessConnection"},{id:163867085,predicate:"inputBusinessIntro",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"sticker",type:"flags.0?InputDocument"}],type:"InputBusinessIntro"},{id:1510606445,predicate:"businessIntro",params:[{name:"flags",type:"#"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"sticker",type:"flags.0?Document"}],type:"BusinessIntro"},{id:-83926371,predicate:"messages.myStickers",params:[{name:"count",type:"int"},{name:"sets",type:"Vector<StickerSetCovered>"}],type:"messages.MyStickers"},{id:-476815191,predicate:"inputCollectibleUsername",params:[{name:"username",type:"string"}],type:"InputCollectible"},{id:-1562241884,predicate:"inputCollectiblePhone",params:[{name:"phone",type:"string"}],type:"InputCollectible"},{id:1857945489,predicate:"fragment.collectibleInfo",params:[{name:"purchase_date",type:"int"},{name:"currency",type:"string"},{name:"amount",type:"long"},{name:"crypto_currency",type:"string"},{name:"crypto_amount",type:"long"},{name:"url",type:"string"}],type:"fragment.CollectibleInfo"},{id:-991587810,predicate:"inputBusinessBotRecipients",params:[{name:"flags",type:"#"},{name:"existing_chats",type:"flags.0?true"},{name:"new_chats",type:"flags.1?true"},{name:"contacts",type:"flags.2?true"},{name:"non_contacts",type:"flags.3?true"},{name:"exclude_selected",type:"flags.5?true"},{name:"users",type:"flags.4?Vector<InputUser>"},{name:"exclude_users",type:"flags.6?Vector<InputUser>"}],type:"InputBusinessBotRecipients"},{id:-1198722189,predicate:"businessBotRecipients",params:[{name:"flags",type:"#"},{name:"existing_chats",type:"flags.0?true"},{name:"new_chats",type:"flags.1?true"},{name:"contacts",type:"flags.2?true"},{name:"non_contacts",type:"flags.3?true"},{name:"exclude_selected",type:"flags.5?true"},{name:"users",type:"flags.4?Vector<long>"},{name:"exclude_users",type:"flags.6?Vector<long>"}],type:"BusinessBotRecipients"},{id:496600883,predicate:"contactBirthday",params:[{name:"contact_id",type:"long"},{name:"birthday",type:"Birthday"}],type:"ContactBirthday"},{id:290452237,predicate:"contacts.contactBirthdays",params:[{name:"contacts",type:"Vector<ContactBirthday>"},{name:"users",type:"Vector<User>"}],type:"contacts.ContactBirthdays"},{id:-698740276,predicate:"inputPrivacyKeyBirthday",params:[],type:"InputPrivacyKey"},{id:536913176,predicate:"privacyKeyBirthday",params:[],type:"PrivacyKey"},{id:2009975281,predicate:"inputPrivacyValueAllowPremium",params:[],type:"InputPrivacyRule"},{id:-320241333,predicate:"privacyValueAllowPremium",params:[],type:"PrivacyRule"},{id:1653379620,predicate:"missingInvitee",params:[{name:"flags",type:"#"},{name:"premium_would_allow_invite",type:"flags.0?true"},{name:"premium_required_for_pm",type:"flags.1?true"},{name:"user_id",type:"long"}],type:"MissingInvitee"},{id:2136862630,predicate:"messages.invitedUsers",params:[{name:"updates",type:"Updates"},{name:"missing_invitees",type:"Vector<MissingInvitee>"}],type:"messages.InvitedUsers"},{id:292003751,predicate:"inputBusinessChatLink",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector<MessageEntity>"},{name:"title",type:"flags.1?string"}],type:"InputBusinessChatLink"},{id:-1263638929,predicate:"businessChatLink",params:[{name:"flags",type:"#"},{name:"link",type:"string"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector<MessageEntity>"},{name:"title",type:"flags.1?string"},{name:"views",type:"int"}],type:"BusinessChatLink"},{id:-331111727,predicate:"account.businessChatLinks",params:[{name:"links",type:"Vector<BusinessChatLink>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"account.BusinessChatLinks"},{id:-1708937439,predicate:"account.resolvedBusinessChatLinks",params:[{name:"flags",type:"#"},{name:"peer",type:"Peer"},{name:"message",type:"string"},{name:"entities",type:"flags.0?Vector<MessageEntity>"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"account.ResolvedBusinessChatLinks"},{id:-701500310,predicate:"requestedPeerUser",params:[{name:"flags",type:"#"},{name:"user_id",type:"long"},{name:"first_name",type:"flags.0?string"},{name:"last_name",type:"flags.0?string"},{name:"username",type:"flags.1?string"},{name:"photo",type:"flags.2?Photo"}],type:"RequestedPeer"},{id:1929860175,predicate:"requestedPeerChat",params:[{name:"flags",type:"#"},{name:"chat_id",type:"long"},{name:"title",type:"flags.0?string"},{name:"photo",type:"flags.2?Photo"}],type:"RequestedPeer"},{id:-1952185372,predicate:"requestedPeerChannel",params:[{name:"flags",type:"#"},{name:"channel_id",type:"long"},{name:"title",type:"flags.0?string"},{name:"username",type:"flags.1?string"},{name:"photo",type:"flags.2?Photo"}],type:"RequestedPeer"},{id:-1816979384,predicate:"messageActionRequestedPeerSentMe",params:[{name:"button_id",type:"int"},{name:"peers",type:"Vector<RequestedPeer>"}],type:"MessageAction"},{id:-916050683,predicate:"inputKeyboardButtonRequestPeer",params:[{name:"flags",type:"#"},{name:"name_requested",type:"flags.0?true"},{name:"username_requested",type:"flags.1?true"},{name:"photo_requested",type:"flags.2?true"},{name:"text",type:"string"},{name:"button_id",type:"int"},{name:"peer_type",type:"RequestPeerType"},{name:"max_quantity",type:"int"}],type:"KeyboardButton"},{id:1124938064,predicate:"sponsoredMessageReportOption",params:[{name:"text",type:"string"},{name:"option",type:"bytes"}],type:"SponsoredMessageReportOption"},{id:-2073059774,predicate:"channels.sponsoredMessageReportResultChooseOption",params:[{name:"title",type:"string"},{name:"options",type:"Vector<SponsoredMessageReportOption>"}],type:"channels.SponsoredMessageReportResult"},{id:1044107055,predicate:"channels.sponsoredMessageReportResultAdsHidden",params:[],type:"channels.SponsoredMessageReportResult"},{id:-1384544183,predicate:"channels.sponsoredMessageReportResultReported",params:[],type:"channels.SponsoredMessageReportResult"},{id:1409802903,predicate:"stats.broadcastRevenueStats",params:[{name:"top_hours_graph",type:"StatsGraph"},{name:"revenue_graph",type:"StatsGraph"},{name:"balances",type:"BroadcastRevenueBalances"},{name:"usd_rate",type:"double"}],type:"stats.BroadcastRevenueStats"},{id:-328886473,predicate:"stats.broadcastRevenueWithdrawalUrl",params:[{name:"url",type:"string"}],type:"stats.BroadcastRevenueWithdrawalUrl"},{id:1434332356,predicate:"broadcastRevenueTransactionProceeds",params:[{name:"amount",type:"long"},{name:"from_date",type:"int"},{name:"to_date",type:"int"}],type:"BroadcastRevenueTransaction"},{id:1515784568,predicate:"broadcastRevenueTransactionWithdrawal",params:[{name:"flags",type:"#"},{name:"pending",type:"flags.0?true"},{name:"failed",type:"flags.2?true"},{name:"amount",type:"long"},{name:"date",type:"int"},{name:"provider",type:"string"},{name:"transaction_date",type:"flags.1?int"},{name:"transaction_url",type:"flags.1?string"}],type:"BroadcastRevenueTransaction"},{id:1121127726,predicate:"broadcastRevenueTransactionRefund",params:[{name:"amount",type:"long"},{name:"date",type:"int"},{name:"provider",type:"string"}],type:"BroadcastRevenueTransaction"},{id:-2028632986,predicate:"stats.broadcastRevenueTransactions",params:[{name:"count",type:"int"},{name:"transactions",type:"Vector<BroadcastRevenueTransaction>"}],type:"stats.BroadcastRevenueTransactions"},{id:1355547603,predicate:"webPageAttributeStickerSet",params:[{name:"flags",type:"#"},{name:"emojis",type:"flags.0?true"},{name:"text_color",type:"flags.1?true"},{name:"stickers",type:"Vector<Document>"}],type:"WebPageAttribute"},{id:-1161583078,predicate:"reactionNotificationsFromContacts",params:[],type:"ReactionNotificationsFrom"},{id:1268654752,predicate:"reactionNotificationsFromAll",params:[],type:"ReactionNotificationsFrom"},{id:1457736048,predicate:"reactionsNotifySettings",params:[{name:"flags",type:"#"},{name:"messages_notify_from",type:"flags.0?ReactionNotificationsFrom"},{name:"stories_notify_from",type:"flags.1?ReactionNotificationsFrom"},{name:"sound",type:"NotificationSound"},{name:"show_previews",type:"Bool"}],type:"ReactionsNotifySettings"},{id:405070859,predicate:"updateNewStoryReaction",params:[{name:"story_id",type:"int"},{name:"peer",type:"Peer"},{name:"reaction",type:"Reaction"}],type:"Update"},{id:-1542017919,predicate:"auth.sentCodeTypeSmsWord",params:[{name:"flags",type:"#"},{name:"beginning",type:"flags.0?string"}],type:"auth.SentCodeType"},{id:-1284008785,predicate:"auth.sentCodeTypeSmsPhrase",params:[{name:"flags",type:"#"},{name:"beginning",type:"flags.0?string"}],type:"auth.SentCodeType"},{id:-2133693241,predicate:"emojiGroupGreeting",params:[{name:"title",type:"string"},{name:"icon_emoji_id",type:"long"},{name:"emoticons",type:"Vector<string>"}],type:"EmojiGroup"},{id:154914612,predicate:"emojiGroupPremium",params:[{name:"title",type:"string"},{name:"icon_emoji_id",type:"long"}],type:"EmojiGroup"},{id:-2076642874,predicate:"broadcastRevenueBalances",params:[{name:"current_balance",type:"long"},{name:"available_balance",type:"long"},{name:"overall_revenue",type:"long"}],type:"BroadcastRevenueBalances"},{id:-539401739,predicate:"updateBroadcastRevenueTransactions",params:[{name:"peer",type:"Peer"},{name:"balances",type:"BroadcastRevenueBalances"}],type:"Update"},{id:-1815879042,predicate:"availableEffect",params:[{name:"flags",type:"#"},{name:"premium_required",type:"flags.2?true"},{name:"id",type:"long"},{name:"emoticon",type:"string"},{name:"static_icon_id",type:"flags.0?long"},{name:"effect_sticker_id",type:"long"},{name:"effect_animation_id",type:"flags.1?long"}],type:"AvailableEffect"},{id:-772957605,predicate:"messages.availableEffectsNotModified",params:[],type:"messages.AvailableEffects"},{id:-1109696146,predicate:"messages.availableEffects",params:[{name:"hash",type:"int"},{name:"effects",type:"Vector<AvailableEffect>"},{name:"documents",type:"Vector<Document>"}],type:"messages.AvailableEffects"},{id:-1197736753,predicate:"factCheck",params:[{name:"flags",type:"#"},{name:"need_check",type:"flags.0?true"},{name:"country",type:"flags.1?string"},{name:"text",type:"flags.1?TextWithEntities"},{name:"hash",type:"long"}],type:"FactCheck"},{id:-1779253276,predicate:"starsTransactionPeerUnsupported",params:[],type:"StarsTransactionPeer"},{id:-1269320843,predicate:"starsTransactionPeerAppStore",params:[],type:"StarsTransactionPeer"},{id:2069236235,predicate:"starsTransactionPeerPlayMarket",params:[],type:"StarsTransactionPeer"},{id:621656824,predicate:"starsTransactionPeerPremiumBot",params:[],type:"StarsTransactionPeer"},{id:-382740222,predicate:"starsTransactionPeerFragment",params:[],type:"StarsTransactionPeer"},{id:-670195363,predicate:"starsTransactionPeer",params:[{name:"peer",type:"Peer"}],type:"StarsTransactionPeer"},{id:1326377183,predicate:"inputStorePaymentStars",params:[{name:"flags",type:"#"},{name:"stars",type:"long"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"InputStorePaymentPurpose"},{id:198776256,predicate:"starsTopupOption",params:[{name:"flags",type:"#"},{name:"extended",type:"flags.1?true"},{name:"stars",type:"long"},{name:"store_product",type:"flags.0?string"},{name:"currency",type:"string"},{name:"amount",type:"long"}],type:"StarsTopupOption"},{id:497236696,predicate:"inputInvoiceStars",params:[{name:"option",type:"StarsTopupOption"}],type:"InputInvoice"},{id:766853519,predicate:"starsTransaction",params:[{name:"flags",type:"#"},{name:"refund",type:"flags.3?true"},{name:"pending",type:"flags.4?true"},{name:"failed",type:"flags.6?true"},{name:"id",type:"string"},{name:"stars",type:"long"},{name:"date",type:"int"},{name:"peer",type:"StarsTransactionPeer"},{name:"title",type:"flags.0?string"},{name:"description",type:"flags.1?string"},{name:"photo",type:"flags.2?WebDocument"},{name:"transaction_date",type:"flags.5?int"},{name:"transaction_url",type:"flags.5?string"},{name:"bot_payload",type:"flags.7?bytes"},{name:"msg_id",type:"flags.8?int"},{name:"extended_media",type:"flags.9?Vector<MessageMedia>"}],type:"StarsTransaction"},{id:-1930105248,predicate:"payments.starsStatus",params:[{name:"flags",type:"#"},{name:"balance",type:"long"},{name:"history",type:"Vector<StarsTransaction>"},{name:"next_offset",type:"flags.0?string"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"payments.StarsStatus"},{id:263737752,predicate:"updateStarsBalance",params:[{name:"balance",type:"long"}],type:"Update"},{id:2079764828,predicate:"payments.paymentFormStars",params:[{name:"flags",type:"#"},{name:"form_id",type:"long"},{name:"bot_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.5?WebDocument"},{name:"invoice",type:"Invoice"},{name:"users",type:"Vector<User>"}],type:"payments.PaymentForm"},{id:-625215430,predicate:"payments.paymentReceiptStars",params:[{name:"flags",type:"#"},{name:"date",type:"int"},{name:"bot_id",type:"long"},{name:"title",type:"string"},{name:"description",type:"string"},{name:"photo",type:"flags.2?WebDocument"},{name:"invoice",type:"Invoice"},{name:"currency",type:"string"},{name:"total_amount",type:"long"},{name:"transaction_id",type:"string"},{name:"users",type:"Vector<User>"}],type:"payments.PaymentReceipt"},{id:926421125,predicate:"mediaAreaUrl",params:[{name:"coordinates",type:"MediaAreaCoordinates"},{name:"url",type:"string"}],type:"MediaArea"},{id:-394605632,predicate:"foundStory",params:[{name:"peer",type:"Peer"},{name:"story",type:"StoryItem"}],type:"FoundStory"},{id:-488736969,predicate:"stories.foundStories",params:[{name:"flags",type:"#"},{name:"count",type:"int"},{name:"stories",type:"Vector<FoundStory>"},{name:"next_offset",type:"flags.0?string"},{name:"chats",type:"Vector<Chat>"},{name:"users",type:"Vector<User>"}],type:"stories.FoundStories"},{id:-565420653,predicate:"geoPointAddress",params:[{name:"flags",type:"#"},{name:"country_iso2",type:"string"},{name:"state",type:"flags.0?string"},{name:"city",type:"flags.1?string"},{name:"street",type:"flags.2?string"}],type:"GeoPointAddress"},{id:513998247,predicate:"updateBusinessBotCallbackQuery",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"user_id",type:"long"},{name:"connection_id",type:"string"},{name:"message",type:"Message"},{name:"reply_to_message",type:"flags.2?Message"},{name:"chat_instance",type:"long"},{name:"data",type:"flags.0?bytes"}],type:"Update"},{id:2033461574,predicate:"starsRevenueStatus",params:[{name:"flags",type:"#"},{name:"withdrawal_enabled",type:"flags.0?true"},{name:"current_balance",type:"long"},{name:"available_balance",type:"long"},{name:"overall_revenue",type:"long"},{name:"next_withdrawal_at",type:"flags.1?int"}],type:"StarsRevenueStatus"},{id:-919881925,predicate:"payments.starsRevenueStats",params:[{name:"revenue_graph",type:"StatsGraph"},{name:"status",type:"StarsRevenueStatus"},{name:"usd_rate",type:"double"}],type:"payments.StarsRevenueStats"},{id:497778871,predicate:"payments.starsRevenueWithdrawalUrl",params:[{name:"url",type:"string"}],type:"payments.StarsRevenueWithdrawalUrl"},{id:-1518030823,predicate:"updateStarsRevenueStatus",params:[{name:"peer",type:"Peer"},{name:"status",type:"StarsRevenueStatus"}],type:"Update"},{id:-1436147773,predicate:"inputMediaPaidMedia",params:[{name:"stars_amount",type:"long"},{name:"extended_media",type:"Vector<InputMedia>"}],type:"InputMedia"},{id:-1467669359,predicate:"messageMediaPaidMedia",params:[{name:"stars_amount",type:"long"},{name:"extended_media",type:"Vector<MessageExtendedMedia>"}],type:"MessageMedia"},{id:1617438738,predicate:"starsTransactionPeerAds",params:[],type:"StarsTransactionPeer"},{id:961445665,predicate:"payments.starsRevenueAdsAccountUrl",params:[{name:"url",type:"string"}],type:"payments.StarsRevenueAdsAccountUrl"},{id:543876817,predicate:"inputStarsTransaction",params:[{name:"flags",type:"#"},{name:"refund",type:"flags.0?true"},{name:"id",type:"string"}],type:"InputStarsTransaction"}],methods:[{id:-878758099,method:"invokeAfterMsg",params:[{name:"msg_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:1036301552,method:"invokeAfterMsgs",params:[{name:"msg_ids",type:"Vector<long>"},{name:"query",type:"!X"}],type:"X"},{id:-1502141361,method:"auth.sendCode",params:[{name:"phone_number",type:"string"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:-1429752041,method:"auth.signUp",params:[{name:"flags",type:"#"},{name:"no_joined_notifications",type:"flags.0?true"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"first_name",type:"string"},{name:"last_name",type:"string"}],type:"auth.Authorization"},{id:-1923962543,method:"auth.signIn",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"flags.0?string"},{name:"email_verification",type:"flags.1?EmailVerification"}],type:"auth.Authorization"},{id:1047706137,method:"auth.logOut",params:[],type:"auth.LoggedOut"},{id:-1616179942,method:"auth.resetAuthorizations",params:[],type:"Bool"},{id:-440401971,method:"auth.exportAuthorization",params:[{name:"dc_id",type:"int"}],type:"auth.ExportedAuthorization"},{id:-1518699091,method:"auth.importAuthorization",params:[{name:"id",type:"long"},{name:"bytes",type:"bytes"}],type:"auth.Authorization"},{id:-841733627,method:"auth.bindTempAuthKey",params:[{name:"perm_auth_key_id",type:"long"},{name:"nonce",type:"long"},{name:"expires_at",type:"int"},{name:"encrypted_message",type:"bytes"}],type:"Bool"},{id:-326762118,method:"account.registerDevice",params:[{name:"flags",type:"#"},{name:"no_muted",type:"flags.0?true"},{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"app_sandbox",type:"Bool"},{name:"secret",type:"bytes"},{name:"other_uids",type:"Vector<long>"}],type:"Bool"},{id:1779249670,method:"account.unregisterDevice",params:[{name:"token_type",type:"int"},{name:"token",type:"string"},{name:"other_uids",type:"Vector<long>"}],type:"Bool"},{id:-2067899501,method:"account.updateNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"},{name:"settings",type:"InputPeerNotifySettings"}],type:"Bool"},{id:313765169,method:"account.getNotifySettings",params:[{name:"peer",type:"InputNotifyPeer"}],type:"PeerNotifySettings"},{id:-612493497,method:"account.resetNotifySettings",params:[],type:"Bool"},{id:2018596725,method:"account.updateProfile",params:[{name:"flags",type:"#"},{name:"first_name",type:"flags.0?string"},{name:"last_name",type:"flags.1?string"},{name:"about",type:"flags.2?string"}],type:"User"},{id:1713919532,method:"account.updateStatus",params:[{name:"offline",type:"Bool"}],type:"Bool"},{id:127302966,method:"account.getWallPapers",params:[{name:"hash",type:"long"}],type:"account.WallPapers"},{id:-977650298,method:"account.reportPeer",params:[{name:"peer",type:"InputPeer"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:227648840,method:"users.getUsers",params:[{name:"id",type:"Vector<InputUser>"}],type:"Vector<User>"},{id:-1240508136,method:"users.getFullUser",params:[{name:"id",type:"InputUser"}],type:"users.UserFull"},{id:2061264541,method:"contacts.getContactIDs",params:[{name:"hash",type:"long"}],type:"Vector<int>"},{id:-995929106,method:"contacts.getStatuses",params:[],type:"Vector<ContactStatus>"},{id:1574346258,method:"contacts.getContacts",params:[{name:"hash",type:"long"}],type:"contacts.Contacts"},{id:746589157,method:"contacts.importContacts",params:[{name:"contacts",type:"Vector<InputContact>"}],type:"contacts.ImportedContacts"},{id:157945344,method:"contacts.deleteContacts",params:[{name:"id",type:"Vector<InputUser>"}],type:"Updates"},{id:269745566,method:"contacts.deleteByPhones",params:[{name:"phones",type:"Vector<string>"}],type:"Bool"},{id:774801204,method:"contacts.block",params:[{name:"flags",type:"#"},{name:"my_stories_from",type:"flags.0?true"},{name:"id",type:"InputPeer"}],type:"Bool"},{id:-1252994264,method:"contacts.unblock",params:[{name:"flags",type:"#"},{name:"my_stories_from",type:"flags.0?true"},{name:"id",type:"InputPeer"}],type:"Bool"},{id:-1702457472,method:"contacts.getBlocked",params:[{name:"flags",type:"#"},{name:"my_stories_from",type:"flags.0?true"},{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"contacts.Blocked"},{id:1673946374,method:"messages.getMessages",params:[{name:"id",type:"Vector<InputMessage>"}],type:"messages.Messages"},{id:-1594569905,method:"messages.getDialogs",params:[{name:"flags",type:"#"},{name:"exclude_pinned",type:"flags.0?true"},{name:"folder_id",type:"flags.1?int"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Dialogs"},{id:1143203525,method:"messages.getHistory",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:703497338,method:"messages.search",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"q",type:"string"},{name:"from_id",type:"flags.0?InputPeer"},{name:"saved_peer_id",type:"flags.2?InputPeer"},{name:"saved_reaction",type:"flags.3?Vector<Reaction>"},{name:"top_msg_id",type:"flags.1?int"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:238054714,method:"messages.readHistory",params:[{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"}],type:"messages.AffectedMessages"},{id:-1332768214,method:"messages.deleteHistory",params:[{name:"flags",type:"#"},{name:"just_clear",type:"flags.0?true"},{name:"revoke",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"},{name:"min_date",type:"flags.2?int"},{name:"max_date",type:"flags.3?int"}],type:"messages.AffectedHistory"},{id:-443640366,method:"messages.deleteMessages",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"},{name:"id",type:"Vector<int>"}],type:"messages.AffectedMessages"},{id:94983360,method:"messages.receivedMessages",params:[{name:"max_id",type:"int"}],type:"Vector<ReceivedNotifyMessage>"},{id:1486110434,method:"messages.setTyping",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"action",type:"SendMessageAction"}],type:"Bool"},{id:-1740662971,method:"messages.sendMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"invert_media",type:"flags.16?true"},{name:"peer",type:"InputPeer"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector<MessageEntity>"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"},{name:"quick_reply_shortcut",type:"flags.17?InputQuickReplyShortcut"},{name:"effect",type:"flags.18?long"}],type:"Updates"},{id:2018673486,method:"messages.sendMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"invert_media",type:"flags.16?true"},{name:"peer",type:"InputPeer"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"media",type:"InputMedia"},{name:"message",type:"string"},{name:"random_id",type:"long"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector<MessageEntity>"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"},{name:"quick_reply_shortcut",type:"flags.17?InputQuickReplyShortcut"},{name:"effect",type:"flags.18?long"}],type:"Updates"},{id:-721186296,method:"messages.forwardMessages",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"with_my_score",type:"flags.8?true"},{name:"drop_author",type:"flags.11?true"},{name:"drop_media_captions",type:"flags.12?true"},{name:"noforwards",type:"flags.14?true"},{name:"from_peer",type:"InputPeer"},{name:"id",type:"Vector<int>"},{name:"random_id",type:"Vector<long>"},{name:"to_peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.9?int"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"},{name:"quick_reply_shortcut",type:"flags.17?InputQuickReplyShortcut"}],type:"Updates"},{id:-820669733,method:"messages.reportSpam",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-270948702,method:"messages.getPeerSettings",params:[{name:"peer",type:"InputPeer"}],type:"messages.PeerSettings"},{id:-1991005362,method:"messages.report",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:1240027791,method:"messages.getChats",params:[{name:"id",type:"Vector<long>"}],type:"messages.Chats"},{id:-1364194508,method:"messages.getFullChat",params:[{name:"chat_id",type:"long"}],type:"messages.ChatFull"},{id:1937260541,method:"messages.editChatTitle",params:[{name:"chat_id",type:"long"},{name:"title",type:"string"}],type:"Updates"},{id:903730804,method:"messages.editChatPhoto",params:[{name:"chat_id",type:"long"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:-876162809,method:"messages.addChatUser",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"fwd_limit",type:"int"}],type:"messages.InvitedUsers"},{id:-1575461717,method:"messages.deleteChatUser",params:[{name:"flags",type:"#"},{name:"revoke_history",type:"flags.0?true"},{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:-1831936556,method:"messages.createChat",params:[{name:"flags",type:"#"},{name:"users",type:"Vector<InputUser>"},{name:"title",type:"string"},{name:"ttl_period",type:"flags.0?int"}],type:"messages.InvitedUsers"},{id:-304838614,method:"updates.getState",params:[],type:"updates.State"},{id:432207715,method:"updates.getDifference",params:[{name:"flags",type:"#"},{name:"pts",type:"int"},{name:"pts_limit",type:"flags.1?int"},{name:"pts_total_limit",type:"flags.0?int"},{name:"date",type:"int"},{name:"qts",type:"int"},{name:"qts_limit",type:"flags.2?int"}],type:"updates.Difference"},{id:166207545,method:"photos.updateProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.0?true"},{name:"bot",type:"flags.1?InputUser"},{name:"id",type:"InputPhoto"}],type:"photos.Photo"},{id:59286453,method:"photos.uploadProfilePhoto",params:[{name:"flags",type:"#"},{name:"fallback",type:"flags.3?true"},{name:"bot",type:"flags.5?InputUser"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.4?VideoSize"}],type:"photos.Photo"},{id:-2016444625,method:"photos.deletePhotos",params:[{name:"id",type:"Vector<InputPhoto>"}],type:"Vector<long>"},{id:-1291540959,method:"upload.saveFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1101843010,method:"upload.getFile",params:[{name:"flags",type:"#"},{name:"precise",type:"flags.0?true"},{name:"cdn_supported",type:"flags.1?true"},{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.File"},{id:-990308245,method:"help.getConfig",params:[],type:"Config"},{id:531836966,method:"help.getNearestDc",params:[],type:"NearestDc"},{id:1378703997,method:"help.getAppUpdate",params:[{name:"source",type:"string"}],type:"help.AppUpdate"},{id:1295590211,method:"help.getInviteText",params:[],type:"help.InviteText"},{id:-1848823128,method:"photos.getUserPhotos",params:[{name:"user_id",type:"InputUser"},{name:"offset",type:"int"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"photos.Photos"},{id:651135312,method:"messages.getDhConfig",params:[{name:"version",type:"int"},{name:"random_length",type:"int"}],type:"messages.DhConfig"},{id:-162681021,method:"messages.requestEncryption",params:[{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a",type:"bytes"}],type:"EncryptedChat"},{id:1035731989,method:"messages.acceptEncryption",params:[{name:"peer",type:"InputEncryptedChat"},{name:"g_b",type:"bytes"},{name:"key_fingerprint",type:"long"}],type:"EncryptedChat"},{id:-208425312,method:"messages.discardEncryption",params:[{name:"flags",type:"#"},{name:"delete_history",type:"flags.0?true"},{name:"chat_id",type:"int"}],type:"Bool"},{id:2031374829,method:"messages.setEncryptedTyping",params:[{name:"peer",type:"InputEncryptedChat"},{name:"typing",type:"Bool"}],type:"Bool"},{id:2135648522,method:"messages.readEncryptedHistory",params:[{name:"peer",type:"InputEncryptedChat"},{name:"max_date",type:"int"}],type:"Bool"},{id:1157265941,method:"messages.sendEncrypted",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1431914525,method:"messages.sendEncryptedFile",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"},{name:"file",type:"InputEncryptedFile"}],type:"messages.SentEncryptedMessage"},{id:852769188,method:"messages.sendEncryptedService",params:[{name:"peer",type:"InputEncryptedChat"},{name:"random_id",type:"long"},{name:"data",type:"bytes"}],type:"messages.SentEncryptedMessage"},{id:1436924774,method:"messages.receivedQueue",params:[{name:"max_qts",type:"int"}],type:"Vector<long>"},{id:1259113487,method:"messages.reportEncryptedSpam",params:[{name:"peer",type:"InputEncryptedChat"}],type:"Bool"},{id:-562337987,method:"upload.saveBigFilePart",params:[{name:"file_id",type:"long"},{name:"file_part",type:"int"},{name:"file_total_parts",type:"int"},{name:"bytes",type:"bytes"}],type:"Bool"},{id:-1043505495,method:"initConnection",params:[{name:"flags",type:"#"},{name:"api_id",type:"int"},{name:"device_model",type:"string"},{name:"system_version",type:"string"},{name:"app_version",type:"string"},{name:"system_lang_code",type:"string"},{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"proxy",type:"flags.0?InputClientProxy"},{name:"params",type:"flags.1?JSONValue"},{name:"query",type:"!X"}],type:"X"},{id:-1663104819,method:"help.getSupport",params:[],type:"help.Support"},{id:916930423,method:"messages.readMessageContents",params:[{name:"id",type:"Vector<int>"}],type:"messages.AffectedMessages"},{id:655677548,method:"account.checkUsername",params:[{name:"username",type:"string"}],type:"Bool"},{id:1040964988,method:"account.updateUsername",params:[{name:"username",type:"string"}],type:"User"},{id:301470424,method:"contacts.search",params:[{name:"q",type:"string"},{name:"limit",type:"int"}],type:"contacts.Found"},{id:-623130288,method:"account.getPrivacy",params:[{name:"key",type:"InputPrivacyKey"}],type:"account.PrivacyRules"},{id:-906486552,method:"account.setPrivacy",params:[{name:"key",type:"InputPrivacyKey"},{name:"rules",type:"Vector<InputPrivacyRule>"}],type:"account.PrivacyRules"},{id:-1564422284,method:"account.deleteAccount",params:[{name:"flags",type:"#"},{name:"reason",type:"string"},{name:"password",type:"flags.0?InputCheckPasswordSRP"}],type:"Bool"},{id:150761757,method:"account.getAccountTTL",params:[],type:"AccountDaysTTL"},{id:608323678,method:"account.setAccountTTL",params:[{name:"ttl",type:"AccountDaysTTL"}],type:"Bool"},{id:-627372787,method:"invokeWithLayer",params:[{name:"layer",type:"int"},{name:"query",type:"!X"}],type:"X"},{id:-113456221,method:"contacts.resolveUsername",params:[{name:"username",type:"string"}],type:"contacts.ResolvedPeer"},{id:-2108208411,method:"account.sendChangePhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1891839707,method:"account.changePhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"User"},{id:-710552671,method:"messages.getStickers",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"messages.Stickers"},{id:-1197432408,method:"messages.getAllStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:954152242,method:"account.updateDeviceLocked",params:[{name:"period",type:"int"}],type:"Bool"},{id:1738800940,method:"auth.importBotAuthorization",params:[{name:"flags",type:"int"},{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"bot_auth_token",type:"string"}],type:"auth.Authorization"},{id:-1956073268,method:"messages.getWebPagePreview",params:[{name:"flags",type:"#"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector<MessageEntity>"}],type:"MessageMedia"},{id:-484392616,method:"account.getAuthorizations",params:[],type:"account.Authorizations"},{id:-545786948,method:"account.resetAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1418342645,method:"account.getPassword",params:[],type:"account.Password"},{id:-1663767815,method:"account.getPasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"account.PasswordSettings"},{id:-1516564433,method:"account.updatePasswordSettings",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"new_settings",type:"account.PasswordInputSettings"}],type:"Bool"},{id:-779399914,method:"auth.checkPassword",params:[{name:"password",type:"InputCheckPasswordSRP"}],type:"auth.Authorization"},{id:-661144474,method:"auth.requestPasswordRecovery",params:[],type:"auth.PasswordRecovery"},{id:923364464,method:"auth.recoverPassword",params:[{name:"flags",type:"#"},{name:"code",type:"string"},{name:"new_settings",type:"flags.0?account.PasswordInputSettings"}],type:"auth.Authorization"},{id:-1080796745,method:"invokeWithoutUpdates",params:[{name:"query",type:"!X"}],type:"X"},{id:-1607670315,method:"messages.exportChatInvite",params:[{name:"flags",type:"#"},{name:"legacy_revoke_permanent",type:"flags.2?true"},{name:"request_needed",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"title",type:"flags.4?string"}],type:"ExportedChatInvite"},{id:1051570619,method:"messages.checkChatInvite",params:[{name:"hash",type:"string"}],type:"ChatInvite"},{id:1817183516,method:"messages.importChatInvite",params:[{name:"hash",type:"string"}],type:"Updates"},{id:-928977804,method:"messages.getStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"hash",type:"int"}],type:"messages.StickerSet"},{id:-946871200,method:"messages.installStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"archived",type:"Bool"}],type:"messages.StickerSetInstallResult"},{id:-110209570,method:"messages.uninstallStickerSet",params:[{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:-421563528,method:"messages.startBot",params:[{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"long"},{name:"start_param",type:"string"}],type:"Updates"},{id:1468322785,method:"messages.getMessagesViews",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"},{name:"increment",type:"Bool"}],type:"messages.MessageViews"},{id:-871347913,method:"channels.readHistory",params:[{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Bool"},{id:-2067661490,method:"channels.deleteMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector<int>"}],type:"messages.AffectedMessages"},{id:-196443371,method:"channels.reportSpam",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Bool"},{id:-1383294429,method:"channels.getMessages",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector<InputMessage>"}],type:"messages.Messages"},{id:2010044880,method:"channels.getParticipants",params:[{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelParticipantsFilter"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"channels.ChannelParticipants"},{id:-1599378234,method:"channels.getParticipant",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"channels.ChannelParticipant"},{id:176122811,method:"channels.getChannels",params:[{name:"id",type:"Vector<InputChannel>"}],type:"messages.Chats"},{id:141781513,method:"channels.getFullChannel",params:[{name:"channel",type:"InputChannel"}],type:"messages.ChatFull"},{id:-1862244601,method:"channels.createChannel",params:[{name:"flags",type:"#"},{name:"broadcast",type:"flags.0?true"},{name:"megagroup",type:"flags.1?true"},{name:"for_import",type:"flags.3?true"},{name:"forum",type:"flags.5?true"},{name:"title",type:"string"},{name:"about",type:"string"},{name:"geo_point",type:"flags.2?InputGeoPoint"},{name:"address",type:"flags.2?string"},{name:"ttl_period",type:"flags.4?int"}],type:"Updates"},{id:-751007486,method:"channels.editAdmin",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"admin_rights",type:"ChatAdminRights"},{name:"rank",type:"string"}],type:"Updates"},{id:1450044624,method:"channels.editTitle",params:[{name:"channel",type:"InputChannel"},{name:"title",type:"string"}],type:"Updates"},{id:-248621111,method:"channels.editPhoto",params:[{name:"channel",type:"InputChannel"},{name:"photo",type:"InputChatPhoto"}],type:"Updates"},{id:283557164,method:"channels.checkUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:890549214,method:"channels.updateUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"}],type:"Bool"},{id:615851205,method:"channels.joinChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:-130635115,method:"channels.leaveChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:-907854508,method:"channels.inviteToChannel",params:[{name:"channel",type:"InputChannel"},{name:"users",type:"Vector<InputUser>"}],type:"messages.InvitedUsers"},{id:-1072619549,method:"channels.deleteChannel",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:51854712,method:"updates.getChannelDifference",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"filter",type:"ChannelMessagesFilter"},{name:"pts",type:"int"},{name:"limit",type:"int"}],type:"updates.ChannelDifference"},{id:-1470377534,method:"messages.editChatAdmin",params:[{name:"chat_id",type:"long"},{name:"user_id",type:"InputUser"},{name:"is_admin",type:"Bool"}],type:"Bool"},{id:-1568189671,method:"messages.migrateChat",params:[{name:"chat_id",type:"long"}],type:"Updates"},{id:1271290010,method:"messages.searchGlobal",params:[{name:"flags",type:"#"},{name:"broadcasts_only",type:"flags.1?true"},{name:"folder_id",type:"flags.0?int"},{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"min_date",type:"int"},{name:"max_date",type:"int"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:2016638777,method:"messages.reorderStickerSets",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"order",type:"Vector<long>"}],type:"Bool"},{id:-1309538785,method:"messages.getDocumentByHash",params:[{name:"sha256",type:"bytes"},{name:"size",type:"long"},{name:"mime_type",type:"string"}],type:"Document"},{id:1559270965,method:"messages.getSavedGifs",params:[{name:"hash",type:"long"}],type:"messages.SavedGifs"},{id:846868683,method:"messages.saveGif",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:1364105629,method:"messages.getInlineBotResults",params:[{name:"flags",type:"#"},{name:"bot",type:"InputUser"},{name:"peer",type:"InputPeer"},{name:"geo_point",type:"flags.0?InputGeoPoint"},{name:"query",type:"string"},{name:"offset",type:"string"}],type:"messages.BotResults"},{id:-1156406247,method:"messages.setInlineBotResults",params:[{name:"flags",type:"#"},{name:"gallery",type:"flags.0?true"},{name:"private",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"results",type:"Vector<InputBotInlineResult>"},{name:"cache_time",type:"int"},{name:"next_offset",type:"flags.2?string"},{name:"switch_pm",type:"flags.3?InlineBotSwitchPM"},{name:"switch_webview",type:"flags.4?InlineBotWebView"}],type:"Bool"},{id:1052698730,method:"messages.sendInlineBotResult",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"hide_via",type:"flags.11?true"},{name:"peer",type:"InputPeer"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"random_id",type:"long"},{name:"query_id",type:"long"},{name:"id",type:"string"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"},{name:"quick_reply_shortcut",type:"flags.17?InputQuickReplyShortcut"}],type:"Updates"},{id:-432034325,method:"channels.exportMessageLink",params:[{name:"flags",type:"#"},{name:"grouped",type:"flags.0?true"},{name:"thread",type:"flags.1?true"},{name:"channel",type:"InputChannel"},{name:"id",type:"int"}],type:"ExportedMessageLink"},{id:527021574,method:"channels.toggleSignatures",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-890997469,method:"auth.resendCode",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"reason",type:"flags.0?string"}],type:"auth.SentCode"},{id:520357240,method:"auth.cancelCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"Bool"},{id:-39416522,method:"messages.getMessageEditData",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"messages.MessageEditData"},{id:-539934715,method:"messages.editMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"invert_media",type:"flags.16?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector<MessageEntity>"},{name:"schedule_date",type:"flags.15?int"},{name:"quick_reply_shortcut_id",type:"flags.17?int"}],type:"Updates"},{id:-2091549254,method:"messages.editInlineBotMessage",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"invert_media",type:"flags.16?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"message",type:"flags.11?string"},{name:"media",type:"flags.14?InputMedia"},{name:"reply_markup",type:"flags.2?ReplyMarkup"},{name:"entities",type:"flags.3?Vector<MessageEntity>"}],type:"Bool"},{id:-1824339449,method:"messages.getBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"game",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"data",type:"flags.0?bytes"},{name:"password",type:"flags.2?InputCheckPasswordSRP"}],type:"messages.BotCallbackAnswer"},{id:-712043766,method:"messages.setBotCallbackAnswer",params:[{name:"flags",type:"#"},{name:"alert",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"message",type:"flags.0?string"},{name:"url",type:"flags.2?string"},{name:"cache_time",type:"int"}],type:"Bool"},{id:-1758168906,method:"contacts.getTopPeers",params:[{name:"flags",type:"#"},{name:"correspondents",type:"flags.0?true"},{name:"bots_pm",type:"flags.1?true"},{name:"bots_inline",type:"flags.2?true"},{name:"phone_calls",type:"flags.3?true"},{name:"forward_users",type:"flags.4?true"},{name:"forward_chats",type:"flags.5?true"},{name:"groups",type:"flags.10?true"},{name:"channels",type:"flags.15?true"},{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"contacts.TopPeers"},{id:451113900,method:"contacts.resetTopPeerRating",params:[{name:"category",type:"TopPeerCategory"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-462373635,method:"messages.getPeerDialogs",params:[{name:"peers",type:"Vector<InputDialogPeer>"}],type:"messages.PeerDialogs"},{id:-747452978,method:"messages.saveDraft",params:[{name:"flags",type:"#"},{name:"no_webpage",type:"flags.1?true"},{name:"invert_media",type:"flags.6?true"},{name:"reply_to",type:"flags.4?InputReplyTo"},{name:"peer",type:"InputPeer"},{name:"message",type:"string"},{name:"entities",type:"flags.3?Vector<MessageEntity>"},{name:"media",type:"flags.5?InputMedia"},{name:"effect",type:"flags.7?long"}],type:"Bool"},{id:1782549861,method:"messages.getAllDrafts",params:[],type:"Updates"},{id:1685588756,method:"messages.getFeaturedStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:1527873830,method:"messages.readFeaturedStickers",params:[{name:"id",type:"Vector<long>"}],type:"Bool"},{id:-1649852357,method:"messages.getRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"hash",type:"long"}],type:"messages.RecentStickers"},{id:958863608,method:"messages.saveRecentSticker",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"},{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-1986437075,method:"messages.clearRecentStickers",params:[{name:"flags",type:"#"},{name:"attached",type:"flags.0?true"}],type:"Bool"},{id:1475442322,method:"messages.getArchivedStickers",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.1?true"},{name:"offset_id",type:"long"},{name:"limit",type:"int"}],type:"messages.ArchivedStickers"},{id:457157256,method:"account.sendConfirmPhoneCode",params:[{name:"hash",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1596029123,method:"account.confirmPhone",params:[{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-122669393,method:"channels.getAdminedPublicChannels",params:[{name:"flags",type:"#"},{name:"by_location",type:"flags.0?true"},{name:"check_limit",type:"flags.1?true"},{name:"for_personal",type:"flags.2?true"}],type:"messages.Chats"},{id:1678738104,method:"messages.getMaskStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:-866424884,method:"messages.getAttachedStickers",params:[{name:"media",type:"InputStickeredMedia"}],type:"Vector<StickerSetCovered>"},{id:-1907842680,method:"auth.dropTempAuthKeys",params:[{name:"except_auth_keys",type:"Vector<long>"}],type:"Bool"},{id:-1896289088,method:"messages.setGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Updates"},{id:363700068,method:"messages.setInlineGameScore",params:[{name:"flags",type:"#"},{name:"edit_message",type:"flags.0?true"},{name:"force",type:"flags.1?true"},{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"},{name:"score",type:"int"}],type:"Bool"},{id:-400399203,method:"messages.getGameHighScores",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:258170395,method:"messages.getInlineGameHighScores",params:[{name:"id",type:"InputBotInlineMessageID"},{name:"user_id",type:"InputUser"}],type:"messages.HighScores"},{id:-468934396,method:"messages.getCommonChats",params:[{name:"user_id",type:"InputUser"},{name:"max_id",type:"long"},{name:"limit",type:"int"}],type:"messages.Chats"},{id:-333262899,method:"help.setBotUpdatesStatus",params:[{name:"pending_updates_count",type:"int"},{name:"message",type:"string"}],type:"Bool"},{id:-1919511901,method:"messages.getWebPage",params:[{name:"url",type:"string"},{name:"hash",type:"int"}],type:"messages.WebPage"},{id:-1489903017,method:"messages.toggleDialogPin",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:991616823,method:"messages.reorderPinnedDialogs",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"folder_id",type:"int"},{name:"order",type:"Vector<InputDialogPeer>"}],type:"Bool"},{id:-692498958,method:"messages.getPinnedDialogs",params:[{name:"folder_id",type:"int"}],type:"messages.PeerDialogs"},{id:-1440257555,method:"bots.sendCustomRequest",params:[{name:"custom_method",type:"string"},{name:"params",type:"DataJSON"}],type:"DataJSON"},{id:-434028723,method:"bots.answerWebhookJSONQuery",params:[{name:"query_id",type:"long"},{name:"data",type:"DataJSON"}],type:"Bool"},{id:619086221,method:"upload.getWebFile",params:[{name:"location",type:"InputWebFileLocation"},{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"upload.WebFile"},{id:924093883,method:"payments.getPaymentForm",params:[{name:"flags",type:"#"},{name:"invoice",type:"InputInvoice"},{name:"theme_params",type:"flags.0?DataJSON"}],type:"payments.PaymentForm"},{id:611897804,method:"payments.getPaymentReceipt",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"payments.PaymentReceipt"},{id:-1228345045,method:"payments.validateRequestedInfo",params:[{name:"flags",type:"#"},{name:"save",type:"flags.0?true"},{name:"invoice",type:"InputInvoice"},{name:"info",type:"PaymentRequestedInfo"}],type:"payments.ValidatedRequestedInfo"},{id:755192367,method:"payments.sendPaymentForm",params:[{name:"flags",type:"#"},{name:"form_id",type:"long"},{name:"invoice",type:"InputInvoice"},{name:"requested_info_id",type:"flags.0?string"},{name:"shipping_option_id",type:"flags.1?string"},{name:"credentials",type:"InputPaymentCredentials"},{name:"tip_amount",type:"flags.2?long"}],type:"payments.PaymentResult"},{id:1151208273,method:"account.getTmpPassword",params:[{name:"password",type:"InputCheckPasswordSRP"},{name:"period",type:"int"}],type:"account.TmpPassword"},{id:578650699,method:"payments.getSavedInfo",params:[],type:"payments.SavedInfo"},{id:-667062079,method:"payments.clearSavedInfo",params:[{name:"flags",type:"#"},{name:"credentials",type:"flags.0?true"},{name:"info",type:"flags.1?true"}],type:"Bool"},{id:-436833542,method:"messages.setBotShippingResults",params:[{name:"flags",type:"#"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"},{name:"shipping_options",type:"flags.1?Vector<ShippingOption>"}],type:"Bool"},{id:163765653,method:"messages.setBotPrecheckoutResults",params:[{name:"flags",type:"#"},{name:"success",type:"flags.1?true"},{name:"query_id",type:"long"},{name:"error",type:"flags.0?string"}],type:"Bool"},{id:-1876841625,method:"stickers.createStickerSet",params:[{name:"flags",type:"#"},{name:"masks",type:"flags.0?true"},{name:"emojis",type:"flags.5?true"},{name:"text_color",type:"flags.6?true"},{name:"user_id",type:"InputUser"},{name:"title",type:"string"},{name:"short_name",type:"string"},{name:"thumb",type:"flags.2?InputDocument"},{name:"stickers",type:"Vector<InputStickerSetItem>"},{name:"software",type:"flags.3?string"}],type:"messages.StickerSet"},{id:-143257775,method:"stickers.removeStickerFromSet",params:[{name:"sticker",type:"InputDocument"}],type:"messages.StickerSet"},{id:-4795190,method:"stickers.changeStickerPosition",params:[{name:"sticker",type:"InputDocument"},{name:"position",type:"int"}],type:"messages.StickerSet"},{id:-2041315650,method:"stickers.addStickerToSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"sticker",type:"InputStickerSetItem"}],type:"messages.StickerSet"},{id:345405816,method:"messages.uploadMedia",params:[{name:"flags",type:"#"},{name:"business_connection_id",type:"flags.0?string"},{name:"peer",type:"InputPeer"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:1430593449,method:"phone.getCallConfig",params:[],type:"DataJSON"},{id:1124046573,method:"phone.requestCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"user_id",type:"InputUser"},{name:"random_id",type:"int"},{name:"g_a_hash",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:1003664544,method:"phone.acceptCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_b",type:"bytes"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:788404002,method:"phone.confirmCall",params:[{name:"peer",type:"InputPhoneCall"},{name:"g_a",type:"bytes"},{name:"key_fingerprint",type:"long"},{name:"protocol",type:"PhoneCallProtocol"}],type:"phone.PhoneCall"},{id:399855457,method:"phone.receivedCall",params:[{name:"peer",type:"InputPhoneCall"}],type:"Bool"},{id:-1295269440,method:"phone.discardCall",params:[{name:"flags",type:"#"},{name:"video",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"duration",type:"int"},{name:"reason",type:"PhoneCallDiscardReason"},{name:"connection_id",type:"long"}],type:"Updates"},{id:1508562471,method:"phone.setCallRating",params:[{name:"flags",type:"#"},{name:"user_initiative",type:"flags.0?true"},{name:"peer",type:"InputPhoneCall"},{name:"rating",type:"int"},{name:"comment",type:"string"}],type:"Updates"},{id:662363518,method:"phone.saveCallDebug",params:[{name:"peer",type:"InputPhoneCall"},{name:"debug",type:"DataJSON"}],type:"Bool"},{id:962554330,method:"upload.getCdnFile",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"},{name:"limit",type:"int"}],type:"upload.CdnFile"},{id:-1691921240,method:"upload.reuploadCdnFile",params:[{name:"file_token",type:"bytes"},{name:"request_token",type:"bytes"}],type:"Vector<FileHash>"},{id:1375900482,method:"help.getCdnConfig",params:[],type:"CdnConfig"},{id:-219008246,method:"langpack.getLangPack",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackDifference"},{id:-269862909,method:"langpack.getStrings",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"keys",type:"Vector<string>"}],type:"Vector<LangPackString>"},{id:-845657435,method:"langpack.getDifference",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"LangPackDifference"},{id:1120311183,method:"langpack.getLanguages",params:[{name:"lang_pack",type:"string"}],type:"Vector<LangPackLanguage>"},{id:-1763259007,method:"channels.editBanned",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:870184064,method:"channels.getAdminLog",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"string"},{name:"events_filter",type:"flags.0?ChannelAdminLogEventsFilter"},{name:"admins",type:"flags.1?Vector<InputUser>"},{name:"max_id",type:"long"},{name:"min_id",type:"long"},{name:"limit",type:"int"}],type:"channels.AdminLogResults"},{id:-1847836879,method:"upload.getCdnFileHashes",params:[{name:"file_token",type:"bytes"},{name:"offset",type:"long"}],type:"Vector<FileHash>"},{id:-1589618665,method:"messages.sendScreenshotNotification",params:[{name:"peer",type:"InputPeer"},{name:"reply_to",type:"InputReplyTo"},{name:"random_id",type:"long"}],type:"Updates"},{id:-359881479,method:"channels.setStickers",params:[{name:"channel",type:"InputChannel"},{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:82946729,method:"messages.getFavedStickers",params:[{name:"hash",type:"long"}],type:"messages.FavedStickers"},{id:-1174420133,method:"messages.faveSticker",params:[{name:"id",type:"InputDocument"},{name:"unfave",type:"Bool"}],type:"Bool"},{id:-357180360,method:"channels.readMessageContents",params:[{name:"channel",type:"InputChannel"},{name:"id",type:"Vector<int>"}],type:"Bool"},{id:-2020263951,method:"contacts.resetSaved",params:[],type:"Bool"},{id:-251140208,method:"messages.getUnreadMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:-1683319225,method:"channels.deleteHistory",params:[{name:"flags",type:"#"},{name:"for_everyone",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"max_id",type:"int"}],type:"Updates"},{id:1036054804,method:"help.getRecentMeUrls",params:[{name:"referer",type:"string"}],type:"help.RecentMeUrls"},{id:-356796084,method:"channels.togglePreHistoryHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:921026381,method:"messages.readMentions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1881817312,method:"messages.getRecentLocations",params:[{name:"peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:934757205,method:"messages.sendMultiMedia",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"background",type:"flags.6?true"},{name:"clear_draft",type:"flags.7?true"},{name:"noforwards",type:"flags.14?true"},{name:"update_stickersets_order",type:"flags.15?true"},{name:"invert_media",type:"flags.16?true"},{name:"peer",type:"InputPeer"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"multi_media",type:"Vector<InputSingleMedia>"},{name:"schedule_date",type:"flags.10?int"},{name:"send_as",type:"flags.13?InputPeer"},{name:"quick_reply_shortcut",type:"flags.17?InputQuickReplyShortcut"},{name:"effect",type:"flags.18?long"}],type:"Updates"},{id:1347929239,method:"messages.uploadEncryptedFile",params:[{name:"peer",type:"InputEncryptedChat"},{name:"file",type:"InputEncryptedFile"}],type:"EncryptedFile"},{id:405695855,method:"account.getWebAuthorizations",params:[],type:"account.WebAuthorizations"},{id:755087855,method:"account.resetWebAuthorization",params:[{name:"hash",type:"long"}],type:"Bool"},{id:1747789204,method:"account.resetWebAuthorizations",params:[],type:"Bool"},{id:896555914,method:"messages.searchStickerSets",params:[{name:"flags",type:"#"},{name:"exclude_featured",type:"flags.0?true"},{name:"q",type:"string"},{name:"hash",type:"long"}],type:"messages.FoundStickerSets"},{id:-1856595926,method:"upload.getFileHashes",params:[{name:"location",type:"InputFileLocation"},{name:"offset",type:"long"}],type:"Vector<FileHash>"},{id:749019089,method:"help.getTermsOfServiceUpdate",params:[],type:"help.TermsOfServiceUpdate"},{id:-294455398,method:"help.acceptTermsOfService",params:[{name:"id",type:"DataJSON"}],type:"Bool"},{id:-1299661699,method:"account.getAllSecureValues",params:[],type:"Vector<SecureValue>"},{id:1936088002,method:"account.getSecureValue",params:[{name:"types",type:"Vector<SecureValueType>"}],type:"Vector<SecureValue>"},{id:-1986010339,method:"account.saveSecureValue",params:[{name:"value",type:"InputSecureValue"},{name:"secure_secret_id",type:"long"}],type:"SecureValue"},{id:-1199522741,method:"account.deleteSecureValue",params:[{name:"types",type:"Vector<SecureValueType>"}],type:"Bool"},{id:-1865902923,method:"users.setSecureValueErrors",params:[{name:"id",type:"InputUser"},{name:"errors",type:"Vector<SecureValueError>"}],type:"Bool"},{id:-1456907910,method:"account.getAuthorizationForm",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"}],type:"account.AuthorizationForm"},{id:-202552205,method:"account.acceptAuthorization",params:[{name:"bot_id",type:"long"},{name:"scope",type:"string"},{name:"public_key",type:"string"},{name:"value_hashes",type:"Vector<SecureValueHash>"},{name:"credentials",type:"SecureCredentialsEncrypted"}],type:"Bool"},{id:-1516022023,method:"account.sendVerifyPhoneCode",params:[{name:"phone_number",type:"string"},{name:"settings",type:"CodeSettings"}],type:"auth.SentCode"},{id:1305716726,method:"account.verifyPhone",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"phone_code",type:"string"}],type:"Bool"},{id:-1730136133,method:"account.sendVerifyEmailCode",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"email",type:"string"}],type:"account.SentEmailCode"},{id:53322959,method:"account.verifyEmail",params:[{name:"purpose",type:"EmailVerifyPurpose"},{name:"verification",type:"EmailVerification"}],type:"account.EmailVerified"},{id:1072547679,method:"help.getDeepLinkInfo",params:[{name:"path",type:"string"}],type:"help.DeepLinkInfo"},{id:-2098076769,method:"contacts.getSaved",params:[],type:"Vector<SavedContact>"},{id:-2092831552,method:"channels.getLeftChannels",params:[{name:"offset",type:"int"}],type:"messages.Chats"},{id:-1896617296,method:"account.initTakeoutSession",params:[{name:"flags",type:"#"},{name:"contacts",type:"flags.0?true"},{name:"message_users",type:"flags.1?true"},{name:"message_chats",type:"flags.2?true"},{name:"message_megagroups",type:"flags.3?true"},{name:"message_channels",type:"flags.4?true"},{name:"files",type:"flags.5?true"},{name:"file_max_size",type:"flags.5?long"}],type:"account.Takeout"},{id:489050862,method:"account.finishTakeoutSession",params:[{name:"flags",type:"#"},{name:"success",type:"flags.0?true"}],type:"Bool"},{id:486505992,method:"messages.getSplitRanges",params:[],type:"Vector<MessageRange>"},{id:911373810,method:"invokeWithMessagesRange",params:[{name:"range",type:"MessageRange"},{name:"query",type:"!X"}],type:"X"},{id:-1398145746,method:"invokeWithTakeout",params:[{name:"takeout_id",type:"long"},{name:"query",type:"!X"}],type:"X"},{id:-1031349873,method:"messages.markDialogUnread",params:[{name:"flags",type:"#"},{name:"unread",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:585256482,method:"messages.getDialogUnreadMarks",params:[],type:"Vector<DialogPeer>"},{id:-2062238246,method:"contacts.toggleTopPeers",params:[{name:"enabled",type:"Bool"}],type:"Bool"},{id:2119757468,method:"messages.clearAllDrafts",params:[],type:"Bool"},{id:1642330196,method:"help.getAppConfig",params:[{name:"hash",type:"int"}],type:"help.AppConfig"},{id:1862465352,method:"help.saveAppLog",params:[{name:"events",type:"Vector<InputAppEvent>"}],type:"Bool"},{id:-966677240,method:"help.getPassportConfig",params:[{name:"hash",type:"int"}],type:"help.PassportConfig"},{id:1784243458,method:"langpack.getLanguage",params:[{name:"lang_pack",type:"string"},{name:"lang_code",type:"string"}],type:"LangPackLanguage"},{id:-760547348,method:"messages.updatePinnedMessage",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.0?true"},{name:"unpin",type:"flags.1?true"},{name:"pm_oneside",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"Updates"},{id:-1881204448,method:"account.confirmPasswordEmail",params:[{name:"code",type:"string"}],type:"Bool"},{id:2055154197,method:"account.resendPasswordEmail",params:[],type:"Bool"},{id:-1043606090,method:"account.cancelPasswordEmail",params:[],type:"Bool"},{id:-748624084,method:"help.getSupportName",params:[],type:"help.SupportName"},{id:59377875,method:"help.getUserInfo",params:[{name:"user_id",type:"InputUser"}],type:"help.UserInfo"},{id:1723407216,method:"help.editUserInfo",params:[{name:"user_id",type:"InputUser"},{name:"message",type:"string"},{name:"entities",type:"Vector<MessageEntity>"}],type:"help.UserInfo"},{id:-1626880216,method:"account.getContactSignUpNotification",params:[],type:"Bool"},{id:-806076575,method:"account.setContactSignUpNotification",params:[{name:"silent",type:"Bool"}],type:"Bool"},{id:1398240377,method:"account.getNotifyExceptions",params:[{name:"flags",type:"#"},{name:"compare_sound",type:"flags.1?true"},{name:"compare_stories",type:"flags.2?true"},{name:"peer",type:"flags.0?InputNotifyPeer"}],type:"Updates"},{id:283795844,method:"messages.sendVote",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"options",type:"Vector<bytes>"}],type:"Updates"},{id:1941660731,method:"messages.getPollResults",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1848369232,method:"messages.getOnlines",params:[{name:"peer",type:"InputPeer"}],type:"ChatOnlines"},{id:-554301545,method:"messages.editChatAbout",params:[{name:"peer",type:"InputPeer"},{name:"about",type:"string"}],type:"Bool"},{id:-1517917375,method:"messages.editChatDefaultBannedRights",params:[{name:"peer",type:"InputPeer"},{name:"banned_rights",type:"ChatBannedRights"}],type:"Updates"},{id:-57811990,method:"account.getWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"}],type:"WallPaper"},{id:-476410109,method:"account.uploadWallPaper",params:[{name:"flags",type:"#"},{name:"for_chat",type:"flags.0?true"},{name:"file",type:"InputFile"},{name:"mime_type",type:"string"},{name:"settings",type:"WallPaperSettings"}],type:"WallPaper"},{id:1817860919,method:"account.saveWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"unsave",type:"Bool"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-18000023,method:"account.installWallPaper",params:[{name:"wallpaper",type:"InputWallPaper"},{name:"settings",type:"WallPaperSettings"}],type:"Bool"},{id:-1153722364,method:"account.resetWallPapers",params:[],type:"Bool"},{id:1457130303,method:"account.getAutoDownloadSettings",params:[],type:"account.AutoDownloadSettings"},{id:1995661875,method:"account.saveAutoDownloadSettings",params:[{name:"flags",type:"#"},{name:"low",type:"flags.0?true"},{name:"high",type:"flags.1?true"},{name:"settings",type:"AutoDownloadSettings"}],type:"Bool"},{id:899735650,method:"messages.getEmojiKeywords",params:[{name:"lang_code",type:"string"}],type:"EmojiKeywordsDifference"},{id:352892591,method:"messages.getEmojiKeywordsDifference",params:[{name:"lang_code",type:"string"},{name:"from_version",type:"int"}],type:"EmojiKeywordsDifference"},{id:1318675378,method:"messages.getEmojiKeywordsLanguages",params:[{name:"lang_codes",type:"Vector<string>"}],type:"Vector<EmojiLanguage>"},{id:-709817306,method:"messages.getEmojiURL",params:[{name:"lang_code",type:"string"}],type:"EmojiURL"},{id:1749536939,method:"folders.editPeerFolders",params:[{name:"folder_peers",type:"Vector<InputFolderPeer>"}],type:"Updates"},{id:465367808,method:"messages.getSearchCounters",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"saved_peer_id",type:"flags.2?InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"filters",type:"Vector<MessagesFilter>"}],type:"Vector<messages.SearchCounter>"},{id:-170208392,method:"channels.getGroupsForDiscussion",params:[],type:"messages.Chats"},{id:1079520178,method:"channels.setDiscussionGroup",params:[{name:"broadcast",type:"InputChannel"},{name:"group",type:"InputChannel"}],type:"Bool"},{id:428848198,method:"messages.requestUrlAuth",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:-1322487515,method:"messages.acceptUrlAuth",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"peer",type:"flags.1?InputPeer"},{name:"msg_id",type:"flags.1?int"},{name:"button_id",type:"flags.1?int"},{name:"url",type:"flags.2?string"}],type:"UrlAuthResult"},{id:1336717624,method:"messages.hidePeerSettingsBar",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-386636848,method:"contacts.addContact",params:[{name:"flags",type:"#"},{name:"add_phone_privacy_exception",type:"flags.0?true"},{name:"id",type:"InputUser"},{name:"first_name",type:"string"},{name:"last_name",type:"string"},{name:"phone",type:"string"}],type:"Updates"},{id:-130964977,method:"contacts.acceptContact",params:[{name:"id",type:"InputUser"}],type:"Updates"},{id:-1892102881,method:"channels.editCreator",params:[{name:"channel",type:"InputChannel"},{name:"user_id",type:"InputUser"},{name:"password",type:"InputCheckPasswordSRP"}],type:"Updates"},{id:-750207932,method:"contacts.getLocated",params:[{name:"flags",type:"#"},{name:"background",type:"flags.1?true"},{name:"geo_point",type:"InputGeoPoint"},{name:"self_expires",type:"flags.0?int"}],type:"Updates"},{id:1491484525,method:"channels.editLocation",params:[{name:"channel",type:"InputChannel"},{name:"geo_point",type:"InputGeoPoint"},{name:"address",type:"string"}],type:"Bool"},{id:-304832784,method:"channels.toggleSlowMode",params:[{name:"channel",type:"InputChannel"},{name:"seconds",type:"int"}],type:"Updates"},{id:-183077365,method:"messages.getScheduledHistory",params:[{name:"peer",type:"InputPeer"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:-1111817116,method:"messages.getScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"messages.Messages"},{id:-1120369398,method:"messages.sendScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Updates"},{id:1504586518,method:"messages.deleteScheduledMessages",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Updates"},{id:473805619,method:"account.uploadTheme",params:[{name:"flags",type:"#"},{name:"file",type:"InputFile"},{name:"thumb",type:"flags.0?InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:1697530880,method:"account.createTheme",params:[{name:"flags",type:"#"},{name:"slug",type:"string"},{name:"title",type:"string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector<InputThemeSettings>"}],type:"Theme"},{id:737414348,method:"account.updateTheme",params:[{name:"flags",type:"#"},{name:"format",type:"string"},{name:"theme",type:"InputTheme"},{name:"slug",type:"flags.0?string"},{name:"title",type:"flags.1?string"},{name:"document",type:"flags.2?InputDocument"},{name:"settings",type:"flags.3?Vector<InputThemeSettings>"}],type:"Theme"},{id:-229175188,method:"account.saveTheme",params:[{name:"theme",type:"InputTheme"},{name:"unsave",type:"Bool"}],type:"Bool"},{id:-953697477,method:"account.installTheme",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"theme",type:"flags.1?InputTheme"},{name:"format",type:"flags.2?string"},{name:"base_theme",type:"flags.3?BaseTheme"}],type:"Bool"},{id:978872812,method:"account.getTheme",params:[{name:"format",type:"string"},{name:"theme",type:"InputTheme"}],type:"Theme"},{id:1913054296,method:"account.getThemes",params:[{name:"format",type:"string"},{name:"hash",type:"long"}],type:"account.Themes"},{id:-1210022402,method:"auth.exportLoginToken",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"except_ids",type:"Vector<long>"}],type:"auth.LoginToken"},{id:-1783866140,method:"auth.importLoginToken",params:[{name:"token",type:"bytes"}],type:"auth.LoginToken"},{id:-392909491,method:"auth.acceptLoginToken",params:[{name:"token",type:"bytes"}],type:"Authorization"},{id:-1250643605,method:"account.setContentSettings",params:[{name:"flags",type:"#"},{name:"sensitive_enabled",type:"flags.0?true"}],type:"Bool"},{id:-1952756306,method:"account.getContentSettings",params:[],type:"account.ContentSettings"},{id:300429806,method:"channels.getInactiveChannels",params:[],type:"messages.InactiveChats"},{id:1705865692,method:"account.getMultiWallPapers",params:[{name:"wallpapers",type:"Vector<InputWallPaper>"}],type:"Vector<WallPaper>"},{id:-1200736242,method:"messages.getPollVotes",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"option",type:"flags.0?bytes"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.VotesList"},{id:-1257951254,method:"messages.toggleStickerSets",params:[{name:"flags",type:"#"},{name:"uninstall",type:"flags.0?true"},{name:"archive",type:"flags.1?true"},{name:"unarchive",type:"flags.2?true"},{name:"stickersets",type:"Vector<InputStickerSet>"}],type:"Bool"},{id:779736953,method:"payments.getBankCardData",params:[{name:"number",type:"string"}],type:"payments.BankCardData"},{id:-271283063,method:"messages.getDialogFilters",params:[],type:"messages.DialogFilters"},{id:-1566780372,method:"messages.getSuggestedDialogFilters",params:[],type:"Vector<DialogFilterSuggested>"},{id:450142282,method:"messages.updateDialogFilter",params:[{name:"flags",type:"#"},{name:"id",type:"int"},{name:"filter",type:"flags.0?DialogFilter"}],type:"Bool"},{id:-983318044,method:"messages.updateDialogFiltersOrder",params:[{name:"order",type:"Vector<int>"}],type:"Bool"},{id:-1421720550,method:"stats.getBroadcastStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.BroadcastStats"},{id:1646092192,method:"stats.loadAsyncGraph",params:[{name:"flags",type:"#"},{name:"token",type:"string"},{name:"x",type:"flags.0?long"}],type:"StatsGraph"},{id:-1486204014,method:"stickers.setStickerSetThumb",params:[{name:"flags",type:"#"},{name:"stickerset",type:"InputStickerSet"},{name:"thumb",type:"flags.0?InputDocument"},{name:"thumb_document_id",type:"flags.1?long"}],type:"messages.StickerSet"},{id:85399130,method:"bots.setBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"},{name:"commands",type:"Vector<BotCommand>"}],type:"Bool"},{id:2127598753,method:"messages.getOldFeaturedStickers",params:[{name:"offset",type:"int"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-1063816159,method:"help.getPromoData",params:[],type:"help.PromoData"},{id:505748629,method:"help.hidePromoData",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-8744061,method:"phone.sendSignalingData",params:[{name:"peer",type:"InputPhoneCall"},{name:"data",type:"bytes"}],type:"Bool"},{id:-589330937,method:"stats.getMegagroupStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.MegagroupStats"},{id:-349483786,method:"account.getGlobalPrivacySettings",params:[],type:"GlobalPrivacySettings"},{id:517647042,method:"account.setGlobalPrivacySettings",params:[{name:"settings",type:"GlobalPrivacySettings"}],type:"GlobalPrivacySettings"},{id:-183649631,method:"help.dismissSuggestion",params:[{name:"peer",type:"InputPeer"},{name:"suggestion",type:"string"}],type:"Bool"},{id:1935116200,method:"help.getCountriesList",params:[{name:"lang_code",type:"string"},{name:"hash",type:"int"}],type:"help.CountriesList"},{id:584962828,method:"messages.getReplies",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:1147761405,method:"messages.getDiscussionMessage",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.DiscussionMessage"},{id:-147740172,method:"messages.readDiscussion",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"read_max_id",type:"int"}],type:"Bool"},{id:698914348,method:"contacts.blockFromReplies",params:[{name:"flags",type:"#"},{name:"delete_message",type:"flags.0?true"},{name:"delete_history",type:"flags.1?true"},{name:"report_spam",type:"flags.2?true"},{name:"msg_id",type:"int"}],type:"Updates"},{id:1595212100,method:"stats.getMessagePublicForwards",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"stats.PublicForwards"},{id:-1226791947,method:"stats.getMessageStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"stats.MessageStats"},{id:-299714136,method:"messages.unpinAllMessages",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:1221445336,method:"phone.createGroupCall",params:[{name:"flags",type:"#"},{name:"rtmp_stream",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"random_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"schedule_date",type:"flags.1?int"}],type:"Updates"},{id:-1322057861,method:"phone.joinGroupCall",params:[{name:"flags",type:"#"},{name:"muted",type:"flags.0?true"},{name:"video_stopped",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"join_as",type:"InputPeer"},{name:"invite_hash",type:"flags.1?string"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:1342404601,method:"phone.leaveGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"source",type:"int"}],type:"Updates"},{id:2067345760,method:"phone.inviteToGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"users",type:"Vector<InputUser>"}],type:"Updates"},{id:2054648117,method:"phone.discardGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1958458429,method:"phone.toggleGroupCallSettings",params:[{name:"flags",type:"#"},{name:"reset_invite_hash",type:"flags.1?true"},{name:"call",type:"InputGroupCall"},{name:"join_muted",type:"flags.0?Bool"}],type:"Updates"},{id:68699611,method:"phone.getGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"limit",type:"int"}],type:"phone.GroupCall"},{id:-984033109,method:"phone.getGroupParticipants",params:[{name:"call",type:"InputGroupCall"},{name:"ids",type:"Vector<InputPeer>"},{name:"sources",type:"Vector<int>"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"phone.GroupParticipants"},{id:-1248003721,method:"phone.checkGroupCall",params:[{name:"call",type:"InputGroupCall"},{name:"sources",type:"Vector<int>"}],type:"Vector<int>"},{id:1540419152,method:"messages.deleteChat",params:[{name:"chat_id",type:"long"}],type:"Bool"},{id:-104078327,method:"messages.deletePhoneCallHistory",params:[{name:"flags",type:"#"},{name:"revoke",type:"flags.0?true"}],type:"messages.AffectedFoundMessages"},{id:1140726259,method:"messages.checkHistoryImport",params:[{name:"import_head",type:"string"}],type:"messages.HistoryImportParsed"},{id:873008187,method:"messages.initHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"file",type:"InputFile"},{name:"media_count",type:"int"}],type:"messages.HistoryImport"},{id:713433234,method:"messages.uploadImportedMedia",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"},{name:"file_name",type:"string"},{name:"media",type:"InputMedia"}],type:"MessageMedia"},{id:-1271008444,method:"messages.startHistoryImport",params:[{name:"peer",type:"InputPeer"},{name:"import_id",type:"long"}],type:"Bool"},{id:-1565154314,method:"messages.getExportedChatInvites",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"},{name:"offset_date",type:"flags.2?int"},{name:"offset_link",type:"flags.2?string"},{name:"limit",type:"int"}],type:"messages.ExportedChatInvites"},{id:1937010524,method:"messages.getExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"messages.ExportedChatInvite"},{id:-1110823051,method:"messages.editExportedChatInvite",params:[{name:"flags",type:"#"},{name:"revoked",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"string"},{name:"expire_date",type:"flags.0?int"},{name:"usage_limit",type:"flags.1?int"},{name:"request_needed",type:"flags.3?Bool"},{name:"title",type:"flags.4?string"}],type:"messages.ExportedChatInvite"},{id:1452833749,method:"messages.deleteRevokedExportedChatInvites",params:[{name:"peer",type:"InputPeer"},{name:"admin_id",type:"InputUser"}],type:"Bool"},{id:-731601877,method:"messages.deleteExportedChatInvite",params:[{name:"peer",type:"InputPeer"},{name:"link",type:"string"}],type:"Bool"},{id:958457583,method:"messages.getAdminsWithInvites",params:[{name:"peer",type:"InputPeer"}],type:"messages.ChatAdminsWithInvites"},{id:-553329330,method:"messages.getChatInviteImporters",params:[{name:"flags",type:"#"},{name:"requested",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"},{name:"q",type:"flags.2?string"},{name:"offset_date",type:"int"},{name:"offset_user",type:"InputUser"},{name:"limit",type:"int"}],type:"messages.ChatInviteImporters"},{id:-1207017500,method:"messages.setHistoryTTL",params:[{name:"peer",type:"InputPeer"},{name:"period",type:"int"}],type:"Updates"},{id:-91437323,method:"account.reportProfilePhoto",params:[{name:"peer",type:"InputPeer"},{name:"photo_id",type:"InputPhoto"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:187239529,method:"channels.convertToGigagroup",params:[{name:"channel",type:"InputChannel"}],type:"Updates"},{id:1573261059,method:"messages.checkHistoryImportPeer",params:[{name:"peer",type:"InputPeer"}],type:"messages.CheckedHistoryImportPeer"},{id:-248985848,method:"phone.toggleGroupCallRecord",params:[{name:"flags",type:"#"},{name:"start",type:"flags.0?true"},{name:"video",type:"flags.2?true"},{name:"call",type:"InputGroupCall"},{name:"title",type:"flags.1?string"},{name:"video_portrait",type:"flags.2?Bool"}],type:"Updates"},{id:-1524155713,method:"phone.editGroupCallParticipant",params:[{name:"flags",type:"#"},{name:"call",type:"InputGroupCall"},{name:"participant",type:"InputPeer"},{name:"muted",type:"flags.0?Bool"},{name:"volume",type:"flags.1?int"},{name:"raise_hand",type:"flags.2?Bool"},{name:"video_stopped",type:"flags.3?Bool"},{name:"video_paused",type:"flags.4?Bool"},{name:"presentation_paused",type:"flags.5?Bool"}],type:"Updates"},{id:480685066,method:"phone.editGroupCallTitle",params:[{name:"call",type:"InputGroupCall"},{name:"title",type:"string"}],type:"Updates"},{id:-277077702,method:"phone.getGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"}],type:"phone.JoinAsPeers"},{id:-425040769,method:"phone.exportGroupCallInvite",params:[{name:"flags",type:"#"},{name:"can_self_unmute",type:"flags.0?true"},{name:"call",type:"InputGroupCall"}],type:"phone.ExportedGroupCallInvite"},{id:563885286,method:"phone.toggleGroupCallStartSubscription",params:[{name:"call",type:"InputGroupCall"},{name:"subscribed",type:"Bool"}],type:"Updates"},{id:1451287362,method:"phone.startScheduledGroupCall",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:1465786252,method:"phone.saveDefaultGroupCallJoinAs",params:[{name:"peer",type:"InputPeer"},{name:"join_as",type:"InputPeer"}],type:"Bool"},{id:-873829436,method:"phone.joinGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"},{name:"params",type:"DataJSON"}],type:"Updates"},{id:475058500,method:"phone.leaveGroupCallPresentation",params:[{name:"call",type:"InputGroupCall"}],type:"Updates"},{id:676017721,method:"stickers.checkShortName",params:[{name:"short_name",type:"string"}],type:"Bool"},{id:1303364867,method:"stickers.suggestShortName",params:[{name:"title",type:"string"}],type:"stickers.SuggestedShortName"},{id:1032708345,method:"bots.resetBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Bool"},{id:-481554986,method:"bots.getBotCommands",params:[{name:"scope",type:"BotCommandScope"},{name:"lang_code",type:"string"}],type:"Vector<BotCommand>"},{id:-1828139493,method:"account.resetPassword",params:[],type:"account.ResetPasswordResult"},{id:1284770294,method:"account.declinePasswordReset",params:[],type:"Bool"},{id:221691769,method:"auth.checkRecoveryPassword",params:[{name:"code",type:"string"}],type:"Bool"},{id:-700916087,method:"account.getChatThemes",params:[{name:"hash",type:"long"}],type:"account.Themes"},{id:-432283329,method:"messages.setChatTheme",params:[{name:"peer",type:"InputPeer"},{name:"emoticon",type:"string"}],type:"Updates"},{id:-1095836780,method:"channels.viewSponsoredMessage",params:[{name:"channel",type:"InputChannel"},{name:"random_id",type:"bytes"}],type:"Bool"},{id:-333377601,method:"channels.getSponsoredMessages",params:[{name:"channel",type:"InputChannel"}],type:"messages.SponsoredMessages"},{id:834782287,method:"messages.getMessageReadParticipants",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Vector<ReadParticipantDate>"},{id:1789130429,method:"messages.getSearchResultsCalendar",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"saved_peer_id",type:"flags.2?InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"}],type:"messages.SearchResultsCalendar"},{id:-1669386480,method:"messages.getSearchResultsPositions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"saved_peer_id",type:"flags.2?InputPeer"},{name:"filter",type:"MessagesFilter"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.SearchResultsPositions"},{id:2145904661,method:"messages.hideChatJoinRequest",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"Updates"},{id:-528091926,method:"messages.hideAllChatJoinRequests",params:[{name:"flags",type:"#"},{name:"approved",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"link",type:"flags.1?string"}],type:"Updates"},{id:-1323389022,method:"messages.toggleNoForwards",params:[{name:"peer",type:"InputPeer"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-855777386,method:"messages.saveDefaultSendAs",params:[{name:"peer",type:"InputPeer"},{name:"send_as",type:"InputPeer"}],type:"Bool"},{id:231174382,method:"channels.getSendAs",params:[{name:"peer",type:"InputPeer"}],type:"channels.SendAsPeers"},{id:-1081501024,method:"account.setAuthorizationTTL",params:[{name:"authorization_ttl_days",type:"int"}],type:"Bool"},{id:1089766498,method:"account.changeAuthorizationSettings",params:[{name:"flags",type:"#"},{name:"confirmed",type:"flags.3?true"},{name:"hash",type:"long"},{name:"encrypted_requests_disabled",type:"flags.0?Bool"},{name:"call_requests_disabled",type:"flags.1?Bool"}],type:"Bool"},{id:913655003,method:"channels.deleteParticipantHistory",params:[{name:"channel",type:"InputChannel"},{name:"participant",type:"InputPeer"}],type:"messages.AffectedHistory"},{id:-754091820,method:"messages.sendReaction",params:[{name:"flags",type:"#"},{name:"big",type:"flags.1?true"},{name:"add_to_recent",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"reaction",type:"flags.0?Vector<Reaction>"}],type:"Updates"},{id:-1950707482,method:"messages.getMessagesReactions",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Updates"},{id:1176190792,method:"messages.getMessageReactionsList",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction",type:"flags.0?Reaction"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"messages.MessageReactionsList"},{id:1511328724,method:"messages.setChatAvailableReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"available_reactions",type:"ChatReactions"},{name:"reactions_limit",type:"flags.0?int"}],type:"Updates"},{id:417243308,method:"messages.getAvailableReactions",params:[{name:"hash",type:"int"}],type:"messages.AvailableReactions"},{id:1330094102,method:"messages.setDefaultReaction",params:[{name:"reaction",type:"Reaction"}],type:"Bool"},{id:1662529584,method:"messages.translateText",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.0?InputPeer"},{name:"id",type:"flags.0?Vector<int>"},{name:"text",type:"flags.1?Vector<TextWithEntities>"},{name:"to_lang",type:"string"}],type:"messages.TranslatedText"},{id:841173339,method:"messages.getUnreadReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"},{name:"offset_id",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"}],type:"messages.Messages"},{id:1420459918,method:"messages.readReactions",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"top_msg_id",type:"flags.0?int"}],type:"messages.AffectedHistory"},{id:-1963375804,method:"contacts.resolvePhone",params:[{name:"phone",type:"string"}],type:"contacts.ResolvedPeer"},{id:447879488,method:"phone.getGroupCallStreamChannels",params:[{name:"call",type:"InputGroupCall"}],type:"phone.GroupCallStreamChannels"},{id:-558650433,method:"phone.getGroupCallStreamRtmpUrl",params:[{name:"peer",type:"InputPeer"},{name:"revoke",type:"Bool"}],type:"phone.GroupCallStreamRtmpUrl"},{id:276705696,method:"messages.searchSentMedia",params:[{name:"q",type:"string"},{name:"filter",type:"MessagesFilter"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:385663691,method:"messages.getAttachMenuBots",params:[{name:"hash",type:"long"}],type:"AttachMenuBots"},{id:1998676370,method:"messages.getAttachMenuBot",params:[{name:"bot",type:"InputUser"}],type:"AttachMenuBotsBot"},{id:1777704297,method:"messages.toggleBotInAttachMenu",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"bot",type:"InputUser"},{name:"enabled",type:"Bool"}],type:"Bool"},{id:647873217,method:"messages.requestWebView",params:[{name:"flags",type:"#"},{name:"from_bot_menu",type:"flags.4?true"},{name:"silent",type:"flags.5?true"},{name:"compact",type:"flags.7?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"url",type:"flags.1?string"},{name:"start_param",type:"flags.3?string"},{name:"theme_params",type:"flags.2?DataJSON"},{name:"platform",type:"string"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"send_as",type:"flags.13?InputPeer"}],type:"WebViewResult"},{id:-1328014717,method:"messages.prolongWebView",params:[{name:"flags",type:"#"},{name:"silent",type:"flags.5?true"},{name:"peer",type:"InputPeer"},{name:"bot",type:"InputUser"},{name:"query_id",type:"long"},{name:"reply_to",type:"flags.0?InputReplyTo"},{name:"send_as",type:"flags.13?InputPeer"}],type:"Bool"},{id:1094336115,method:"messages.requestSimpleWebView",params:[{name:"flags",type:"#"},{name:"from_switch_webview",type:"flags.1?true"},{name:"from_side_menu",type:"flags.2?true"},{name:"compact",type:"flags.7?true"},{name:"bot",type:"InputUser"},{name:"url",type:"flags.3?string"},{name:"start_param",type:"flags.4?string"},{name:"theme_params",type:"flags.0?DataJSON"},{name:"platform",type:"string"}],type:"WebViewResult"},{id:172168437,method:"messages.sendWebViewResultMessage",params:[{name:"bot_query_id",type:"string"},{name:"result",type:"InputBotInlineResult"}],type:"WebViewMessageSent"},{id:-603831608,method:"messages.sendWebViewData",params:[{name:"bot",type:"InputUser"},{name:"random_id",type:"long"},{name:"button_text",type:"string"},{name:"data",type:"string"}],type:"Updates"},{id:1157944655,method:"bots.setBotMenuButton",params:[{name:"user_id",type:"InputUser"},{name:"button",type:"BotMenuButton"}],type:"Bool"},{id:-1671369944,method:"bots.getBotMenuButton",params:[{name:"user_id",type:"InputUser"}],type:"BotMenuButton"},{id:-510647672,method:"account.getSavedRingtones",params:[{name:"hash",type:"long"}],type:"account.SavedRingtones"},{id:1038768899,method:"account.saveRingtone",params:[{name:"id",type:"InputDocument"},{name:"unsave",type:"Bool"}],type:"account.SavedRingtone"},{id:-2095414366,method:"account.uploadRingtone",params:[{name:"file",type:"InputFile"},{name:"file_name",type:"string"},{name:"mime_type",type:"string"}],type:"Document"},{id:2021942497,method:"bots.setBotBroadcastDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:-1839281686,method:"bots.setBotGroupDefaultAdminRights",params:[{name:"admin_rights",type:"ChatAdminRights"}],type:"Bool"},{id:1092913030,method:"phone.saveCallLog",params:[{name:"peer",type:"InputPhoneCall"},{name:"file",type:"InputFile"}],type:"Bool"},{id:-456419968,method:"channels.toggleJoinToSend",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:1277789622,method:"channels.toggleJoinRequest",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:261206117,method:"payments.exportInvoice",params:[{name:"invoice_media",type:"InputMedia"}],type:"payments.ExportedInvoice"},{id:647928393,method:"messages.transcribeAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"messages.TranscribedAudio"},{id:2132608815,method:"messages.rateTranscribedAudio",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"transcription_id",type:"long"},{name:"good",type:"Bool"}],type:"Bool"},{id:-2131921795,method:"payments.assignAppStoreTransaction",params:[{name:"receipt",type:"bytes"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-537046829,method:"payments.assignPlayMarketTransaction",params:[{name:"receipt",type:"DataJSON"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:-1614700874,method:"payments.canPurchasePremium",params:[{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Bool"},{id:-1206152236,method:"help.getPremiumPromo",params:[],type:"help.PremiumPromo"},{id:-643100844,method:"messages.getCustomEmojiDocuments",params:[{name:"document_id",type:"Vector<long>"}],type:"Vector<Document>"},{id:-67329649,method:"messages.getEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.AllStickers"},{id:248473398,method:"messages.getFeaturedEmojiStickers",params:[{name:"hash",type:"long"}],type:"messages.FeaturedStickers"},{id:-70001045,method:"account.updateEmojiStatus",params:[{name:"emoji_status",type:"EmojiStatus"}],type:"Bool"},{id:-696962170,method:"account.getDefaultEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:257392901,method:"account.getRecentEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:404757166,method:"account.clearRecentEmojiStatuses",params:[],type:"Bool"},{id:1063567478,method:"messages.reportReaction",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction_peer",type:"InputPeer"}],type:"Bool"},{id:-1149164102,method:"messages.getTopReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:960896434,method:"messages.getRecentReactions",params:[{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.Reactions"},{id:-1644236876,method:"messages.clearRecentReactions",params:[],type:"Bool"},{id:-2064119788,method:"messages.getExtendedMedia",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Updates"},{id:767062953,method:"auth.importWebTokenAuthorization",params:[{name:"api_id",type:"int"},{name:"api_hash",type:"string"},{name:"web_auth_token",type:"string"}],type:"auth.Authorization"},{id:-279966037,method:"account.reorderUsernames",params:[{name:"order",type:"Vector<string>"}],type:"Bool"},{id:1490465654,method:"account.toggleUsername",params:[{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:-1268978403,method:"channels.reorderUsernames",params:[{name:"channel",type:"InputChannel"},{name:"order",type:"Vector<string>"}],type:"Bool"},{id:1358053637,method:"channels.toggleUsername",params:[{name:"channel",type:"InputChannel"},{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:170155475,method:"channels.deactivateAllUsernames",params:[{name:"channel",type:"InputChannel"}],type:"Bool"},{id:-1540781271,method:"channels.toggleForum",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-200539612,method:"channels.createForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"title",type:"string"},{name:"icon_color",type:"flags.0?int"},{name:"icon_emoji_id",type:"flags.3?long"},{name:"random_id",type:"long"},{name:"send_as",type:"flags.2?InputPeer"}],type:"Updates"},{id:233136337,method:"channels.getForumTopics",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"q",type:"flags.0?string"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_topic",type:"int"},{name:"limit",type:"int"}],type:"messages.ForumTopics"},{id:-1333584199,method:"channels.getForumTopicsByID",params:[{name:"channel",type:"InputChannel"},{name:"topics",type:"Vector<int>"}],type:"messages.ForumTopics"},{id:-186670715,method:"channels.editForumTopic",params:[{name:"flags",type:"#"},{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"title",type:"flags.0?string"},{name:"icon_emoji_id",type:"flags.1?long"},{name:"closed",type:"flags.2?Bool"},{name:"hidden",type:"flags.3?Bool"}],type:"Updates"},{id:1814925350,method:"channels.updatePinnedForumTopic",params:[{name:"channel",type:"InputChannel"},{name:"topic_id",type:"int"},{name:"pinned",type:"Bool"}],type:"Updates"},{id:876830509,method:"channels.deleteTopicHistory",params:[{name:"channel",type:"InputChannel"},{name:"top_msg_id",type:"int"}],type:"messages.AffectedHistory"},{id:693150095,method:"channels.reorderPinnedForumTopics",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"channel",type:"InputChannel"},{name:"order",type:"Vector<int>"}],type:"Updates"},{id:1760814315,method:"channels.toggleAntiSpam",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-1471109485,method:"channels.reportAntiSpamFalsePositive",params:[{name:"channel",type:"InputChannel"},{name:"msg_id",type:"int"}],type:"Bool"},{id:-1632299963,method:"messages.setDefaultHistoryTTL",params:[{name:"period",type:"int"}],type:"Bool"},{id:1703637384,method:"messages.getDefaultHistoryTTL",params:[],type:"DefaultHistoryTTL"},{id:-127582169,method:"contacts.exportContactToken",params:[],type:"ExportedContactToken"},{id:318789512,method:"contacts.importContactToken",params:[{name:"token",type:"string"}],type:"User"},{id:-515093903,method:"photos.uploadContactProfilePhoto",params:[{name:"flags",type:"#"},{name:"suggest",type:"flags.3?true"},{name:"save",type:"flags.4?true"},{name:"user_id",type:"InputUser"},{name:"file",type:"flags.0?InputFile"},{name:"video",type:"flags.1?InputFile"},{name:"video_start_ts",type:"flags.2?double"},{name:"video_emoji_markup",type:"flags.5?VideoSize"}],type:"photos.Photo"},{id:1785624660,method:"channels.toggleParticipantsHidden",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-1850552224,method:"messages.sendBotRequestedPeer",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"button_id",type:"int"},{name:"requested_peers",type:"Vector<InputPeer>"}],type:"Updates"},{id:-495647960,method:"account.getDefaultProfilePhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1856479058,method:"account.getDefaultGroupPhotoEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:-1908857314,method:"auth.requestFirebaseSms",params:[{name:"flags",type:"#"},{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"safety_net_token",type:"flags.0?string"},{name:"play_integrity_token",type:"flags.2?string"},{name:"ios_push_secret",type:"flags.1?string"}],type:"Bool"},{id:1955122779,method:"messages.getEmojiGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:785209037,method:"messages.getEmojiStatusGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:564480243,method:"messages.getEmojiProfilePhotoGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:739360983,method:"messages.searchCustomEmoji",params:[{name:"emoticon",type:"string"},{name:"hash",type:"long"}],type:"EmojiList"},{id:-461589127,method:"messages.togglePeerTranslations",params:[{name:"flags",type:"#"},{name:"disabled",type:"flags.0?true"},{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-1379156774,method:"account.getAutoSaveSettings",params:[],type:"account.AutoSaveSettings"},{id:-694451359,method:"account.saveAutoSaveSettings",params:[{name:"flags",type:"#"},{name:"users",type:"flags.0?true"},{name:"chats",type:"flags.1?true"},{name:"broadcasts",type:"flags.2?true"},{name:"peer",type:"flags.3?InputPeer"},{name:"settings",type:"AutoSaveSettings"}],type:"Bool"},{id:1404829728,method:"account.deleteAutoSaveExceptions",params:[],type:"Bool"},{id:-179077444,method:"stickers.changeSticker",params:[{name:"flags",type:"#"},{name:"sticker",type:"InputDocument"},{name:"emoji",type:"flags.0?string"},{name:"mask_coords",type:"flags.1?MaskCoords"},{name:"keywords",type:"flags.2?string"}],type:"messages.StickerSet"},{id:306912256,method:"stickers.renameStickerSet",params:[{name:"stickerset",type:"InputStickerSet"},{name:"title",type:"string"}],type:"messages.StickerSet"},{id:-2022685804,method:"stickers.deleteStickerSet",params:[{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:889046467,method:"messages.getBotApp",params:[{name:"app",type:"InputBotApp"},{name:"hash",type:"long"}],type:"messages.BotApp"},{id:1398901710,method:"messages.requestAppWebView",params:[{name:"flags",type:"#"},{name:"write_allowed",type:"flags.0?true"},{name:"compact",type:"flags.7?true"},{name:"peer",type:"InputPeer"},{name:"app",type:"InputBotApp"},{name:"start_param",type:"flags.1?string"},{name:"theme_params",type:"flags.2?DataJSON"},{name:"platform",type:"string"}],type:"WebViewResult"},{id:282013987,method:"bots.setBotInfo",params:[{name:"flags",type:"#"},{name:"bot",type:"flags.2?InputUser"},{name:"lang_code",type:"string"},{name:"name",type:"flags.3?string"},{name:"about",type:"flags.0?string"},{name:"description",type:"flags.1?string"}],type:"Bool"},{id:-589753091,method:"bots.getBotInfo",params:[{name:"flags",type:"#"},{name:"bot",type:"flags.0?InputUser"},{name:"lang_code",type:"string"}],type:"bots.BotInfo"},{id:2123760019,method:"auth.resetLoginEmail",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"}],type:"auth.SentCode"},{id:-2072885362,method:"chatlists.exportChatlistInvite",params:[{name:"chatlist",type:"InputChatlist"},{name:"title",type:"string"},{name:"peers",type:"Vector<InputPeer>"}],type:"chatlists.ExportedChatlistInvite"},{id:1906072670,method:"chatlists.deleteExportedInvite",params:[{name:"chatlist",type:"InputChatlist"},{name:"slug",type:"string"}],type:"Bool"},{id:1698543165,method:"chatlists.editExportedInvite",params:[{name:"flags",type:"#"},{name:"chatlist",type:"InputChatlist"},{name:"slug",type:"string"},{name:"title",type:"flags.1?string"},{name:"peers",type:"flags.2?Vector<InputPeer>"}],type:"ExportedChatlistInvite"},{id:-838608253,method:"chatlists.getExportedInvites",params:[{name:"chatlist",type:"InputChatlist"}],type:"chatlists.ExportedInvites"},{id:1103171583,method:"chatlists.checkChatlistInvite",params:[{name:"slug",type:"string"}],type:"chatlists.ChatlistInvite"},{id:-1498291302,method:"chatlists.joinChatlistInvite",params:[{name:"slug",type:"string"},{name:"peers",type:"Vector<InputPeer>"}],type:"Updates"},{id:-1992190687,method:"chatlists.getChatlistUpdates",params:[{name:"chatlist",type:"InputChatlist"}],type:"chatlists.ChatlistUpdates"},{id:-527828747,method:"chatlists.joinChatlistUpdates",params:[{name:"chatlist",type:"InputChatlist"},{name:"peers",type:"Vector<InputPeer>"}],type:"Updates"},{id:1726252795,method:"chatlists.hideChatlistUpdates",params:[{name:"chatlist",type:"InputChatlist"}],type:"Bool"},{id:-37955820,method:"chatlists.getLeaveChatlistSuggestions",params:[{name:"chatlist",type:"InputChatlist"}],type:"Vector<Peer>"},{id:1962598714,method:"chatlists.leaveChatlist",params:[{name:"chatlist",type:"InputChatlist"},{name:"peers",type:"Vector<InputPeer>"}],type:"Updates"},{id:-1760972350,method:"bots.reorderUsernames",params:[{name:"bot",type:"InputUser"},{name:"order",type:"Vector<string>"}],type:"Bool"},{id:87861619,method:"bots.toggleUsername",params:[{name:"bot",type:"InputUser"},{name:"username",type:"string"},{name:"active",type:"Bool"}],type:"Bool"},{id:-1879389471,method:"messages.setChatWallPaper",params:[{name:"flags",type:"#"},{name:"for_both",type:"flags.3?true"},{name:"revert",type:"flags.4?true"},{name:"peer",type:"InputPeer"},{name:"wallpaper",type:"flags.0?InputWallPaper"},{name:"settings",type:"flags.2?WallPaperSettings"},{name:"id",type:"flags.1?int"}],type:"Updates"},{id:-896866118,method:"account.invalidateSignInCodes",params:[{name:"codes",type:"Vector<string>"}],type:"Bool"},{id:414170259,method:"channels.clickSponsoredMessage",params:[{name:"channel",type:"InputChannel"},{name:"random_id",type:"bytes"}],type:"Bool"},{id:-1167653392,method:"contacts.editCloseFriends",params:[{name:"id",type:"Vector<long>"}],type:"Bool"},{id:-941629475,method:"stories.canSendStory",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-454661813,method:"stories.sendStory",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.2?true"},{name:"noforwards",type:"flags.4?true"},{name:"fwd_modified",type:"flags.7?true"},{name:"peer",type:"InputPeer"},{name:"media",type:"InputMedia"},{name:"media_areas",type:"flags.5?Vector<MediaArea>"},{name:"caption",type:"flags.0?string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"privacy_rules",type:"Vector<InputPrivacyRule>"},{name:"random_id",type:"long"},{name:"period",type:"flags.3?int"},{name:"fwd_from_id",type:"flags.6?InputPeer"},{name:"fwd_from_story",type:"flags.6?int"}],type:"Updates"},{id:-1249658298,method:"stories.editStory",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"media",type:"flags.0?InputMedia"},{name:"media_areas",type:"flags.3?Vector<MediaArea>"},{name:"caption",type:"flags.1?string"},{name:"entities",type:"flags.1?Vector<MessageEntity>"},{name:"privacy_rules",type:"flags.2?Vector<InputPrivacyRule>"}],type:"Updates"},{id:-1369842849,method:"stories.deleteStories",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Vector<int>"},{id:-1703566865,method:"stories.togglePinned",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"},{name:"pinned",type:"Bool"}],type:"Vector<int>"},{id:-290400731,method:"stories.getAllStories",params:[{name:"flags",type:"#"},{name:"next",type:"flags.1?true"},{name:"hidden",type:"flags.2?true"},{name:"state",type:"flags.0?string"}],type:"stories.AllStories"},{id:1478600156,method:"stories.getPinnedStories",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"stories.Stories"},{id:-1271586794,method:"stories.getStoriesArchive",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"stories.Stories"},{id:1467271796,method:"stories.getStoriesByID",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"stories.Stories"},{id:2082822084,method:"stories.toggleAllStoriesHidden",params:[{name:"hidden",type:"Bool"}],type:"Bool"},{id:-1521034552,method:"stories.readStories",params:[{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"}],type:"Vector<int>"},{id:-1308456197,method:"stories.incrementStoryViews",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Bool"},{id:2127707223,method:"stories.getStoryViewsList",params:[{name:"flags",type:"#"},{name:"just_contacts",type:"flags.0?true"},{name:"reactions_first",type:"flags.2?true"},{name:"forwards_first",type:"flags.3?true"},{name:"peer",type:"InputPeer"},{name:"q",type:"flags.1?string"},{name:"id",type:"int"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"stories.StoryViewsList"},{id:685862088,method:"stories.getStoriesViews",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"stories.StoryViews"},{id:2072899360,method:"stories.exportStoryLink",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"ExportedStoryLink"},{id:421788300,method:"stories.report",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"},{name:"reason",type:"ReportReason"},{name:"message",type:"string"}],type:"Bool"},{id:1471926630,method:"stories.activateStealthMode",params:[{name:"flags",type:"#"},{name:"past",type:"flags.0?true"},{name:"future",type:"flags.1?true"}],type:"Updates"},{id:-1798939530,method:"contacts.setBlocked",params:[{name:"flags",type:"#"},{name:"my_stories_from",type:"flags.0?true"},{name:"id",type:"Vector<InputPeer>"},{name:"limit",type:"int"}],type:"Bool"},{id:2144810674,method:"stories.sendReaction",params:[{name:"flags",type:"#"},{name:"add_to_recent",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"story_id",type:"int"},{name:"reaction",type:"Reaction"}],type:"Updates"},{id:324662502,method:"bots.canSendMessage",params:[{name:"bot",type:"InputUser"}],type:"Bool"},{id:-248323089,method:"bots.allowSendMessage",params:[{name:"bot",type:"InputUser"}],type:"Updates"},{id:142591463,method:"bots.invokeWebViewCustomMethod",params:[{name:"bot",type:"InputUser"},{name:"custom_method",type:"string"},{name:"params",type:"DataJSON"}],type:"DataJSON"},{id:743103056,method:"stories.getPeerStories",params:[{name:"peer",type:"InputPeer"}],type:"stories.PeerStories"},{id:-1688541191,method:"stories.getAllReadPeerStories",params:[],type:"Updates"},{id:1398375363,method:"stories.getPeerMaxIDs",params:[{name:"id",type:"Vector<InputPeer>"}],type:"Vector<int>"},{id:-1519744160,method:"stories.getChatsToSend",params:[],type:"messages.Chats"},{id:-1123805756,method:"stories.togglePeerStoriesHidden",params:[{name:"peer",type:"InputPeer"},{name:"hidden",type:"Bool"}],type:"Bool"},{id:660060756,method:"payments.getPremiumGiftCodeOptions",params:[{name:"flags",type:"#"},{name:"boost_peer",type:"flags.0?InputPeer"}],type:"Vector<PremiumGiftCodeOption>"},{id:-1907247935,method:"payments.checkGiftCode",params:[{name:"slug",type:"string"}],type:"payments.CheckedGiftCode"},{id:-152934316,method:"payments.applyGiftCode",params:[{name:"slug",type:"string"}],type:"Updates"},{id:-198994907,method:"payments.getGiveawayInfo",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"payments.GiveawayInfo"},{id:1609928480,method:"payments.launchPrepaidGiveaway",params:[{name:"peer",type:"InputPeer"},{name:"giveaway_id",type:"long"},{name:"purpose",type:"InputStorePaymentPurpose"}],type:"Updates"},{id:2096079197,method:"account.updateColor",params:[{name:"flags",type:"#"},{name:"for_profile",type:"flags.1?true"},{name:"color",type:"flags.2?int"},{name:"background_emoji_id",type:"flags.0?long"}],type:"Bool"},{id:-659933583,method:"channels.updateColor",params:[{name:"flags",type:"#"},{name:"for_profile",type:"flags.1?true"},{name:"channel",type:"InputChannel"},{name:"color",type:"flags.2?int"},{name:"background_emoji_id",type:"flags.0?long"}],type:"Updates"},{id:-1509246514,method:"account.getDefaultBackgroundEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:1626764896,method:"premium.getBoostsList",params:[{name:"flags",type:"#"},{name:"gifts",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"premium.BoostsList"},{id:199719754,method:"premium.getMyBoosts",params:[],type:"premium.MyBoosts"},{id:1803396934,method:"premium.applyBoost",params:[{name:"flags",type:"#"},{name:"slots",type:"flags.0?Vector<int>"},{name:"peer",type:"InputPeer"}],type:"premium.MyBoosts"},{id:70197089,method:"premium.getBoostsStatus",params:[{name:"peer",type:"InputPeer"}],type:"premium.BoostsStatus"},{id:965037343,method:"premium.getUserBoosts",params:[{name:"peer",type:"InputPeer"},{name:"user_id",type:"InputUser"}],type:"premium.BoostsList"},{id:-1757889771,method:"channels.toggleViewForumAsMessages",params:[{name:"channel",type:"InputChannel"},{name:"enabled",type:"Bool"}],type:"Updates"},{id:-1833678516,method:"messages.searchEmojiStickerSets",params:[{name:"flags",type:"#"},{name:"exclude_featured",type:"flags.0?true"},{name:"q",type:"string"},{name:"hash",type:"long"}],type:"messages.FoundStickerSets"},{id:631707458,method:"channels.getChannelRecommendations",params:[{name:"flags",type:"#"},{name:"channel",type:"flags.0?InputChannel"}],type:"messages.Chats"},{id:927985472,method:"stats.getStoryStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"}],type:"stats.StoryStats"},{id:-1505526026,method:"stats.getStoryPublicForwards",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"stats.PublicForwards"},{id:-629083089,method:"help.getPeerColors",params:[{name:"hash",type:"int"}],type:"help.PeerColors"},{id:-1412453891,method:"help.getPeerProfileColors",params:[{name:"hash",type:"int"}],type:"help.PeerColors"},{id:-1179482081,method:"stories.getStoryReactionsList",params:[{name:"flags",type:"#"},{name:"forwards_first",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"id",type:"int"},{name:"reaction",type:"flags.0?Reaction"},{name:"offset",type:"flags.1?string"},{name:"limit",type:"int"}],type:"stories.StoryReactionsList"},{id:-254548312,method:"channels.updateEmojiStatus",params:[{name:"channel",type:"InputChannel"},{name:"emoji_status",type:"EmojiStatus"}],type:"Updates"},{id:1999087573,method:"account.getChannelDefaultEmojiStatuses",params:[{name:"hash",type:"long"}],type:"account.EmojiStatuses"},{id:900325589,method:"account.getChannelRestrictedStatusEmojis",params:[{name:"hash",type:"long"}],type:"EmojiList"},{id:1401016858,method:"messages.getSavedDialogs",params:[{name:"flags",type:"#"},{name:"exclude_pinned",type:"flags.0?true"},{name:"offset_date",type:"int"},{name:"offset_id",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"limit",type:"int"},{name:"hash",type:"long"}],type:"messages.SavedDialogs"},{id:1033519437,method:"messages.getSavedHistory",params:[{name:"peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"offset_date",type:"int"},{name:"add_offset",type:"int"},{name:"limit",type:"int"},{name:"max_id",type:"int"},{name:"min_id",type:"int"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:1855459371,method:"messages.deleteSavedHistory",params:[{name:"flags",type:"#"},{name:"peer",type:"InputPeer"},{name:"max_id",type:"int"},{name:"min_date",type:"flags.2?int"},{name:"max_date",type:"flags.3?int"}],type:"messages.AffectedHistory"},{id:-700607264,method:"messages.getPinnedSavedDialogs",params:[],type:"messages.SavedDialogs"},{id:-1400783906,method:"messages.toggleSavedDialogPin",params:[{name:"flags",type:"#"},{name:"pinned",type:"flags.0?true"},{name:"peer",type:"InputDialogPeer"}],type:"Bool"},{id:-1955502713,method:"messages.reorderPinnedSavedDialogs",params:[{name:"flags",type:"#"},{name:"force",type:"flags.0?true"},{name:"order",type:"Vector<InputDialogPeer>"}],type:"Bool"},{id:909631579,method:"messages.getSavedReactionTags",params:[{name:"flags",type:"#"},{name:"peer",type:"flags.0?InputPeer"},{name:"hash",type:"long"}],type:"messages.SavedReactionTags"},{id:1613331948,method:"messages.updateSavedReactionTag",params:[{name:"flags",type:"#"},{name:"reaction",type:"Reaction"},{name:"title",type:"flags.0?string"}],type:"Bool"},{id:-1107741656,method:"messages.getDefaultTagReactions",params:[{name:"hash",type:"long"}],type:"messages.Reactions"},{id:-1941176739,method:"messages.getOutboxReadDate",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"OutboxReadDate"},{id:-1507677680,method:"users.getIsPremiumRequiredToContact",params:[{name:"id",type:"Vector<InputUser>"}],type:"Vector<Bool>"},{id:-1388733202,method:"channels.setBoostsToUnblockRestrictions",params:[{name:"channel",type:"InputChannel"},{name:"boosts",type:"int"}],type:"Updates"},{id:1020866743,method:"channels.setEmojiStickers",params:[{name:"channel",type:"InputChannel"},{name:"stickerset",type:"InputStickerSet"}],type:"Bool"},{id:249313744,method:"smsjobs.isEligibleToJoin",params:[],type:"smsjobs.EligibilityToJoin"},{id:-1488007635,method:"smsjobs.join",params:[],type:"Bool"},{id:-1734824589,method:"smsjobs.leave",params:[],type:"Bool"},{id:155164863,method:"smsjobs.updateSettings",params:[{name:"flags",type:"#"},{name:"allow_international",type:"flags.0?true"}],type:"Bool"},{id:279353576,method:"smsjobs.getStatus",params:[],type:"smsjobs.Status"},{id:2005766191,method:"smsjobs.getSmsJob",params:[{name:"job_id",type:"string"}],type:"SmsJob"},{id:1327415076,method:"smsjobs.finishJob",params:[{name:"flags",type:"#"},{name:"job_id",type:"string"},{name:"error",type:"flags.0?string"}],type:"Bool"},{id:1236468288,method:"help.getTimezonesList",params:[{name:"hash",type:"int"}],type:"help.TimezonesList"},{id:1258348646,method:"account.updateBusinessWorkHours",params:[{name:"flags",type:"#"},{name:"business_work_hours",type:"flags.0?BusinessWorkHours"}],type:"Bool"},{id:-1637149926,method:"account.updateBusinessLocation",params:[{name:"flags",type:"#"},{name:"geo_point",type:"flags.1?InputGeoPoint"},{name:"address",type:"flags.0?string"}],type:"Bool"},{id:1724755908,method:"account.updateBusinessGreetingMessage",params:[{name:"flags",type:"#"},{name:"message",type:"flags.0?InputBusinessGreetingMessage"}],type:"Bool"},{id:-1570078811,method:"account.updateBusinessAwayMessage",params:[{name:"flags",type:"#"},{name:"message",type:"flags.0?InputBusinessAwayMessage"}],type:"Bool"},{id:-729550168,method:"messages.getQuickReplies",params:[{name:"hash",type:"long"}],type:"messages.QuickReplies"},{id:1613961479,method:"messages.reorderQuickReplies",params:[{name:"order",type:"Vector<int>"}],type:"Bool"},{id:-237962285,method:"messages.checkQuickReplyShortcut",params:[{name:"shortcut",type:"string"}],type:"Bool"},{id:1543519471,method:"messages.editQuickReplyShortcut",params:[{name:"shortcut_id",type:"int"},{name:"shortcut",type:"string"}],type:"Bool"},{id:1019234112,method:"messages.deleteQuickReplyShortcut",params:[{name:"shortcut_id",type:"int"}],type:"Bool"},{id:-1801153085,method:"messages.getQuickReplyMessages",params:[{name:"flags",type:"#"},{name:"shortcut_id",type:"int"},{name:"id",type:"flags.0?Vector<int>"},{name:"hash",type:"long"}],type:"messages.Messages"},{id:1819610593,method:"messages.sendQuickReplyMessages",params:[{name:"peer",type:"InputPeer"},{name:"shortcut_id",type:"int"},{name:"id",type:"Vector<int>"},{name:"random_id",type:"Vector<long>"}],type:"Updates"},{id:-519706352,method:"messages.deleteQuickReplyMessages",params:[{name:"shortcut_id",type:"int"},{name:"id",type:"Vector<int>"}],type:"Updates"},{id:1138250269,method:"account.updateConnectedBot",params:[{name:"flags",type:"#"},{name:"can_reply",type:"flags.0?true"},{name:"deleted",type:"flags.1?true"},{name:"bot",type:"InputUser"},{name:"recipients",type:"InputBusinessBotRecipients"}],type:"Updates"},{id:1319421967,method:"account.getConnectedBots",params:[],type:"account.ConnectedBots"},{id:-47326647,method:"messages.toggleDialogFilterTags",params:[{name:"enabled",type:"Bool"}],type:"Bool"},{id:-584540274,method:"invokeWithBusinessConnection",params:[{name:"connection_id",type:"string"},{name:"query",type:"!X"}],type:"X"},{id:1990746736,method:"account.getBotBusinessConnection",params:[{name:"connection_id",type:"string"}],type:"Updates"},{id:-1508585420,method:"account.updateBusinessIntro",params:[{name:"flags",type:"#"},{name:"intro",type:"flags.0?InputBusinessIntro"}],type:"Bool"},{id:1184253338,method:"stickers.replaceSticker",params:[{name:"sticker",type:"InputDocument"},{name:"new_sticker",type:"InputStickerSetItem"}],type:"messages.StickerSet"},{id:-793386500,method:"messages.getMyStickers",params:[{name:"offset_id",type:"long"},{name:"limit",type:"int"}],type:"messages.MyStickers"},{id:-1105295942,method:"fragment.getCollectibleInfo",params:[{name:"collectible",type:"InputCollectible"}],type:"fragment.CollectibleInfo"},{id:1684934807,method:"account.toggleConnectedBotPaused",params:[{name:"peer",type:"InputPeer"},{name:"paused",type:"Bool"}],type:"Bool"},{id:1581481689,method:"account.disablePeerConnectedBot",params:[{name:"peer",type:"InputPeer"}],type:"Bool"},{id:-865203183,method:"account.updateBirthday",params:[{name:"flags",type:"#"},{name:"birthday",type:"flags.0?Birthday"}],type:"Bool"},{id:-621959068,method:"contacts.getBirthdays",params:[],type:"contacts.ContactBirthdays"},{id:-2007898482,method:"account.createBusinessChatLink",params:[{name:"link",type:"InputBusinessChatLink"}],type:"BusinessChatLink"},{id:-1942744913,method:"account.editBusinessChatLink",params:[{name:"slug",type:"string"},{name:"link",type:"InputBusinessChatLink"}],type:"BusinessChatLink"},{id:1611085428,method:"account.deleteBusinessChatLink",params:[{name:"slug",type:"string"}],type:"Bool"},{id:1869667809,method:"account.getBusinessChatLinks",params:[],type:"account.BusinessChatLinks"},{id:1418913262,method:"account.resolveBusinessChatLink",params:[{name:"slug",type:"string"}],type:"account.ResolvedBusinessChatLinks"},{id:-649919008,method:"account.updatePersonalChannel",params:[{name:"channel",type:"InputChannel"}],type:"Bool"},{id:-1349519687,method:"channels.reportSponsoredMessage",params:[{name:"channel",type:"InputChannel"},{name:"random_id",type:"bytes"},{name:"option",type:"bytes"}],type:"channels.SponsoredMessageReportResult"},{id:1977595505,method:"stats.getBroadcastRevenueStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"channel",type:"InputChannel"}],type:"stats.BroadcastRevenueStats"},{id:711323507,method:"stats.getBroadcastRevenueWithdrawalUrl",params:[{name:"channel",type:"InputChannel"},{name:"password",type:"InputCheckPasswordSRP"}],type:"stats.BroadcastRevenueWithdrawalUrl"},{id:6891535,method:"stats.getBroadcastRevenueTransactions",params:[{name:"channel",type:"InputChannel"},{name:"offset",type:"int"},{name:"limit",type:"int"}],type:"stats.BroadcastRevenueTransactions"},{id:-1696000743,method:"channels.restrictSponsoredMessages",params:[{name:"channel",type:"InputChannel"},{name:"restricted",type:"Bool"}],type:"Updates"},{id:-1176919155,method:"account.toggleSponsoredMessages",params:[{name:"enabled",type:"Bool"}],type:"Bool"},{id:187268763,method:"stories.togglePinnedToTop",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<int>"}],type:"Bool"},{id:115172684,method:"account.getReactionsNotifySettings",params:[],type:"ReactionsNotifySettings"},{id:829220168,method:"account.setReactionsNotifySettings",params:[{name:"settings",type:"ReactionsNotifySettings"}],type:"ReactionsNotifySettings"},{id:-878841866,method:"auth.reportMissingCode",params:[{name:"phone_number",type:"string"},{name:"phone_code_hash",type:"string"},{name:"mnc",type:"string"}],type:"Bool"},{id:500711669,method:"messages.getEmojiStickerGroups",params:[{name:"hash",type:"int"}],type:"messages.EmojiGroups"},{id:502868356,method:"invokeWithGooglePlayIntegrity",params:[{name:"nonce",type:"string"},{name:"token",type:"string"},{name:"query",type:"!X"}],type:"X"},{id:229528824,method:"invokeWithApnsSecret",params:[{name:"nonce",type:"string"},{name:"secret",type:"string"},{name:"query",type:"!X"}],type:"X"},{id:-559805895,method:"messages.getAvailableEffects",params:[{name:"hash",type:"int"}],type:"messages.AvailableEffects"},{id:-778069893,method:"channels.searchPosts",params:[{name:"hashtag",type:"string"},{name:"offset_rate",type:"int"},{name:"offset_peer",type:"InputPeer"},{name:"offset_id",type:"int"},{name:"limit",type:"int"}],type:"messages.Messages"},{id:92925557,method:"messages.editFactCheck",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"},{name:"text",type:"TextWithEntities"}],type:"Updates"},{id:-774204404,method:"messages.deleteFactCheck",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"int"}],type:"Updates"},{id:-1177696786,method:"messages.getFactCheck",params:[{name:"peer",type:"InputPeer"},{name:"msg_id",type:"Vector<int>"}],type:"Vector<FactCheck>"},{id:-1072773165,method:"payments.getStarsTopupOptions",params:[],type:"Vector<StarsTopupOption>"},{id:273665959,method:"payments.getStarsStatus",params:[{name:"peer",type:"InputPeer"}],type:"payments.StarsStatus"},{id:-1751937702,method:"payments.getStarsTransactions",params:[{name:"flags",type:"#"},{name:"inbound",type:"flags.0?true"},{name:"outbound",type:"flags.1?true"},{name:"ascending",type:"flags.2?true"},{name:"peer",type:"InputPeer"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"payments.StarsStatus"},{id:45839133,method:"payments.sendStarsForm",params:[{name:"flags",type:"#"},{name:"form_id",type:"long"},{name:"invoice",type:"InputInvoice"}],type:"payments.PaymentResult"},{id:632196938,method:"payments.refundStarsCharge",params:[{name:"user_id",type:"InputUser"},{name:"charge_id",type:"string"}],type:"Updates"},{id:1827279210,method:"stories.searchPosts",params:[{name:"flags",type:"#"},{name:"hashtag",type:"flags.0?string"},{name:"area",type:"flags.1?MediaArea"},{name:"offset",type:"string"},{name:"limit",type:"int"}],type:"stories.FoundStories"},{id:-652215594,method:"payments.getStarsRevenueStats",params:[{name:"flags",type:"#"},{name:"dark",type:"flags.0?true"},{name:"peer",type:"InputPeer"}],type:"payments.StarsRevenueStats"},{id:331081907,method:"payments.getStarsRevenueWithdrawalUrl",params:[{name:"peer",type:"InputPeer"},{name:"stars",type:"long"},{name:"password",type:"InputCheckPasswordSRP"}],type:"payments.StarsRevenueWithdrawalUrl"},{id:-774377531,method:"payments.getStarsRevenueAdsAccountUrl",params:[{name:"peer",type:"InputPeer"}],type:"payments.StarsRevenueAdsAccountUrl"},{id:662973742,method:"payments.getStarsTransactionsByID",params:[{name:"peer",type:"InputPeer"},{name:"id",type:"Vector<InputStarsTransaction>"}],type:"payments.StarsStatus"}]},layer:183},Ns={exports:{}};/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(o,e){(function(t,a){a(e)})(Ei,function(t){var a=(b,E,g,W)=>{let K=65535&b|0,q=b>>>16&65535|0,se=0;for(;g!==0;){se=g>2e3?2e3:g,g-=se;do K=K+E[W++]|0,q=q+K|0;while(--se);K%=65521,q%=65521}return K|q<<16|0};const s=new Uint32Array((()=>{let b,E=[];for(var g=0;g<256;g++){b=g;for(var W=0;W<8;W++)b=1&b?3988292384^b>>>1:b>>>1;E[g]=b}return E})());var n=(b,E,g,W)=>{const K=s,q=W+g;b^=-1;for(let se=W;se<q;se++)b=b>>>8^K[255&(b^E[se])];return-1^b};const i=16209;var r=function(b,E){let g,W,K,q,se,Y,ve,V,N,tt,pe,$,at,Se,ie,De,me,te,ye,Re,ne,be,ge,de;const ue=b.state;g=b.next_in,ge=b.input,W=g+(b.avail_in-5),K=b.next_out,de=b.output,q=K-(E-b.avail_out),se=K+(b.avail_out-257),Y=ue.dmax,ve=ue.wsize,V=ue.whave,N=ue.wnext,tt=ue.window,pe=ue.hold,$=ue.bits,at=ue.lencode,Se=ue.distcode,ie=(1<<ue.lenbits)-1,De=(1<<ue.distbits)-1;e:do{$<15&&(pe+=ge[g++]<<$,$+=8,pe+=ge[g++]<<$,$+=8),me=at[pe&ie];t:for(;;){if(te=me>>>24,pe>>>=te,$-=te,te=me>>>16&255,te===0)de[K++]=65535&me;else{if(!(16&te)){if(!(64&te)){me=at[(65535&me)+(pe&(1<<te)-1)];continue t}if(32&te){ue.mode=16191;break e}b.msg="invalid literal/length code",ue.mode=i;break e}ye=65535&me,te&=15,te&&($<te&&(pe+=ge[g++]<<$,$+=8),ye+=pe&(1<<te)-1,pe>>>=te,$-=te),$<15&&(pe+=ge[g++]<<$,$+=8,pe+=ge[g++]<<$,$+=8),me=Se[pe&De];a:for(;;){if(te=me>>>24,pe>>>=te,$-=te,te=me>>>16&255,!(16&te)){if(!(64&te)){me=Se[(65535&me)+(pe&(1<<te)-1)];continue a}b.msg="invalid distance code",ue.mode=i;break e}if(Re=65535&me,te&=15,$<te&&(pe+=ge[g++]<<$,$+=8,$<te&&(pe+=ge[g++]<<$,$+=8)),Re+=pe&(1<<te)-1,Re>Y){b.msg="invalid distance too far back",ue.mode=i;break e}if(pe>>>=te,$-=te,te=K-q,Re>te){if(te=Re-te,te>V&&ue.sane){b.msg="invalid distance too far back",ue.mode=i;break e}if(ne=0,be=tt,N===0){if(ne+=ve-te,te<ye){ye-=te;do de[K++]=tt[ne++];while(--te);ne=K-Re,be=de}}else if(N<te){if(ne+=ve+N-te,te-=N,te<ye){ye-=te;do de[K++]=tt[ne++];while(--te);if(ne=0,N<ye){te=N,ye-=te;do de[K++]=tt[ne++];while(--te);ne=K-Re,be=de}}}else if(ne+=N-te,te<ye){ye-=te;do de[K++]=tt[ne++];while(--te);ne=K-Re,be=de}for(;ye>2;)de[K++]=be[ne++],de[K++]=be[ne++],de[K++]=be[ne++],ye-=3;ye&&(de[K++]=be[ne++],ye>1&&(de[K++]=be[ne++]))}else{ne=K-Re;do de[K++]=de[ne++],de[K++]=de[ne++],de[K++]=de[ne++],ye-=3;while(ye>2);ye&&(de[K++]=de[ne++],ye>1&&(de[K++]=de[ne++]))}break}}break}}while(g<W&&K<se);ye=$>>3,g-=ye,$-=ye<<3,pe&=(1<<$)-1,b.next_in=g,b.next_out=K,b.avail_in=g<W?W-g+5:5-(g-W),b.avail_out=K<se?se-K+257:257-(K-se),ue.hold=pe,ue.bits=$};const p=15,d=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),f=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),c=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),l=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var m=(b,E,g,W,K,q,se,Y)=>{const ve=Y.bits;let V,N,tt,pe,$,at,Se=0,ie=0,De=0,me=0,te=0,ye=0,Re=0,ne=0,be=0,ge=0,de=null;const ue=new Uint16Array(16),dt=new Uint16Array(16);let ya,Oa,Va,Na=null;for(Se=0;Se<=p;Se++)ue[Se]=0;for(ie=0;ie<W;ie++)ue[E[g+ie]]++;for(te=ve,me=p;me>=1&&ue[me]===0;me--);if(te>me&&(te=me),me===0)return K[q++]=20971520,K[q++]=20971520,Y.bits=1,0;for(De=1;De<me&&ue[De]===0;De++);for(te<De&&(te=De),ne=1,Se=1;Se<=p;Se++)if(ne<<=1,ne-=ue[Se],ne<0)return-1;if(ne>0&&(b===0||me!==1))return-1;for(dt[1]=0,Se=1;Se<p;Se++)dt[Se+1]=dt[Se]+ue[Se];for(ie=0;ie<W;ie++)E[g+ie]!==0&&(se[dt[E[g+ie]]++]=ie);if(b===0?(de=Na=se,at=20):b===1?(de=d,Na=f,at=257):(de=c,Na=l,at=0),ge=0,ie=0,Se=De,$=q,ye=te,Re=0,tt=-1,be=1<<te,pe=be-1,b===1&&be>852||b===2&&be>592)return 1;for(;;){ya=Se-Re,se[ie]+1<at?(Oa=0,Va=se[ie]):se[ie]>=at?(Oa=Na[se[ie]-at],Va=de[se[ie]-at]):(Oa=96,Va=0),V=1<<Se-Re,N=1<<ye,De=N;do N-=V,K[$+(ge>>Re)+N]=ya<<24|Oa<<16|Va|0;while(N!==0);for(V=1<<Se-1;ge&V;)V>>=1;if(V!==0?(ge&=V-1,ge+=V):ge=0,ie++,--ue[Se]==0){if(Se===me)break;Se=E[g+se[ie]]}if(Se>te&&(ge&pe)!==tt){for(Re===0&&(Re=te),$+=De,ye=Se-Re,ne=1<<ye;ye+Re<me&&(ne-=ue[ye+Re],!(ne<=0));)ye++,ne<<=1;if(be+=1<<ye,b===1&&be>852||b===2&&be>592)return 1;tt=ge&pe,K[tt]=te<<24|ye<<16|$-q|0}}return ge!==0&&(K[$+ge]=Se-Re<<24|64<<16|0),Y.bits=te,0},u={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:M,Z_BLOCK:A,Z_TREES:w,Z_OK:C,Z_STREAM_END:I,Z_NEED_DICT:F,Z_STREAM_ERROR:L,Z_DATA_ERROR:z,Z_MEM_ERROR:j,Z_BUF_ERROR:Z,Z_DEFLATED:X}=u,O=16180,B=16190,y=16191,P=16192,S=16194,v=16199,Q=16200,T=16206,R=16209,ee=b=>(b>>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24);function le(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ze=b=>{if(!b)return 1;const E=b.state;return!E||E.strm!==b||E.mode<O||E.mode>16211?1:0},Ne=b=>{if(ze(b))return L;const E=b.state;return b.total_in=b.total_out=E.total=0,b.msg="",E.wrap&&(b.adler=1&E.wrap),E.mode=O,E.last=0,E.havedict=0,E.flags=-1,E.dmax=32768,E.head=null,E.hold=0,E.bits=0,E.lencode=E.lendyn=new Int32Array(852),E.distcode=E.distdyn=new Int32Array(592),E.sane=1,E.back=-1,C},Fe=b=>{if(ze(b))return L;const E=b.state;return E.wsize=0,E.whave=0,E.wnext=0,Ne(b)},mt=(b,E)=>{let g;if(ze(b))return L;const W=b.state;return E<0?(g=0,E=-E):(g=5+(E>>4),E<48&&(E&=15)),E&&(E<8||E>15)?L:(W.window!==null&&W.wbits!==E&&(W.window=null),W.wrap=g,W.wbits=E,Fe(b))},Qe=(b,E)=>{if(!b)return L;const g=new le;b.state=g,g.strm=b,g.window=null,g.mode=O;const W=mt(b,E);return W!==C&&(b.state=null),W};let xe,bt,_t=!0;const Kt=b=>{if(_t){xe=new Int32Array(512),bt=new Int32Array(32);let E=0;for(;E<144;)b.lens[E++]=8;for(;E<256;)b.lens[E++]=9;for(;E<280;)b.lens[E++]=7;for(;E<288;)b.lens[E++]=8;for(m(1,b.lens,0,288,xe,0,b.work,{bits:9}),E=0;E<32;)b.lens[E++]=5;m(2,b.lens,0,32,bt,0,b.work,{bits:5}),_t=!1}b.lencode=xe,b.lenbits=9,b.distcode=bt,b.distbits=5},Ct=(b,E,g,W)=>{let K;const q=b.state;return q.window===null&&(q.wsize=1<<q.wbits,q.wnext=0,q.whave=0,q.window=new Uint8Array(q.wsize)),W>=q.wsize?(q.window.set(E.subarray(g-q.wsize,g),0),q.wnext=0,q.whave=q.wsize):(K=q.wsize-q.wnext,K>W&&(K=W),q.window.set(E.subarray(g-W,g-W+K),q.wnext),(W-=K)?(q.window.set(E.subarray(g-W,g),0),q.wnext=W,q.whave=q.wsize):(q.wnext+=K,q.wnext===q.wsize&&(q.wnext=0),q.whave<q.wsize&&(q.whave+=K))),0};var Ke={inflateReset:Fe,inflateReset2:mt,inflateResetKeep:Ne,inflateInit:b=>Qe(b,15),inflateInit2:Qe,inflate:(b,E)=>{let g,W,K,q,se,Y,ve,V,N,tt,pe,$,at,Se,ie,De,me,te,ye,Re,ne,be,ge=0;const de=new Uint8Array(4);let ue,dt;const ya=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ze(b)||!b.output||!b.input&&b.avail_in!==0)return L;g=b.state,g.mode===y&&(g.mode=P),se=b.next_out,K=b.output,ve=b.avail_out,q=b.next_in,W=b.input,Y=b.avail_in,V=g.hold,N=g.bits,tt=Y,pe=ve,be=C;e:for(;;)switch(g.mode){case O:if(g.wrap===0){g.mode=P;break}for(;N<16;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(2&g.wrap&&V===35615){g.wbits===0&&(g.wbits=15),g.check=0,de[0]=255&V,de[1]=V>>>8&255,g.check=n(g.check,de,2,0),V=0,N=0,g.mode=16181;break}if(g.head&&(g.head.done=!1),!(1&g.wrap)||(((255&V)<<8)+(V>>8))%31){b.msg="incorrect header check",g.mode=R;break}if((15&V)!==X){b.msg="unknown compression method",g.mode=R;break}if(V>>>=4,N-=4,ne=8+(15&V),g.wbits===0&&(g.wbits=ne),ne>15||ne>g.wbits){b.msg="invalid window size",g.mode=R;break}g.dmax=1<<g.wbits,g.flags=0,b.adler=g.check=1,g.mode=512&V?16189:y,V=0,N=0;break;case 16181:for(;N<16;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(g.flags=V,(255&g.flags)!==X){b.msg="unknown compression method",g.mode=R;break}if(57344&g.flags){b.msg="unknown header flags set",g.mode=R;break}g.head&&(g.head.text=V>>8&1),512&g.flags&&4&g.wrap&&(de[0]=255&V,de[1]=V>>>8&255,g.check=n(g.check,de,2,0)),V=0,N=0,g.mode=16182;case 16182:for(;N<32;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.head&&(g.head.time=V),512&g.flags&&4&g.wrap&&(de[0]=255&V,de[1]=V>>>8&255,de[2]=V>>>16&255,de[3]=V>>>24&255,g.check=n(g.check,de,4,0)),V=0,N=0,g.mode=16183;case 16183:for(;N<16;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.head&&(g.head.xflags=255&V,g.head.os=V>>8),512&g.flags&&4&g.wrap&&(de[0]=255&V,de[1]=V>>>8&255,g.check=n(g.check,de,2,0)),V=0,N=0,g.mode=16184;case 16184:if(1024&g.flags){for(;N<16;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.length=V,g.head&&(g.head.extra_len=V),512&g.flags&&4&g.wrap&&(de[0]=255&V,de[1]=V>>>8&255,g.check=n(g.check,de,2,0)),V=0,N=0}else g.head&&(g.head.extra=null);g.mode=16185;case 16185:if(1024&g.flags&&($=g.length,$>Y&&($=Y),$&&(g.head&&(ne=g.head.extra_len-g.length,g.head.extra||(g.head.extra=new Uint8Array(g.head.extra_len)),g.head.extra.set(W.subarray(q,q+$),ne)),512&g.flags&&4&g.wrap&&(g.check=n(g.check,W,$,q)),Y-=$,q+=$,g.length-=$),g.length))break e;g.length=0,g.mode=16186;case 16186:if(2048&g.flags){if(Y===0)break e;$=0;do ne=W[q+$++],g.head&&ne&&g.length<65536&&(g.head.name+=String.fromCharCode(ne));while(ne&&$<Y);if(512&g.flags&&4&g.wrap&&(g.check=n(g.check,W,$,q)),Y-=$,q+=$,ne)break e}else g.head&&(g.head.name=null);g.length=0,g.mode=16187;case 16187:if(4096&g.flags){if(Y===0)break e;$=0;do ne=W[q+$++],g.head&&ne&&g.length<65536&&(g.head.comment+=String.fromCharCode(ne));while(ne&&$<Y);if(512&g.flags&&4&g.wrap&&(g.check=n(g.check,W,$,q)),Y-=$,q+=$,ne)break e}else g.head&&(g.head.comment=null);g.mode=16188;case 16188:if(512&g.flags){for(;N<16;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(4&g.wrap&&V!==(65535&g.check)){b.msg="header crc mismatch",g.mode=R;break}V=0,N=0}g.head&&(g.head.hcrc=g.flags>>9&1,g.head.done=!0),b.adler=g.check=0,g.mode=y;break;case 16189:for(;N<32;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}b.adler=g.check=ee(V),V=0,N=0,g.mode=B;case B:if(g.havedict===0)return b.next_out=se,b.avail_out=ve,b.next_in=q,b.avail_in=Y,g.hold=V,g.bits=N,F;b.adler=g.check=1,g.mode=y;case y:if(E===A||E===w)break e;case P:if(g.last){V>>>=7&N,N-=7&N,g.mode=T;break}for(;N<3;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}switch(g.last=1&V,V>>>=1,N-=1,3&V){case 0:g.mode=16193;break;case 1:if(Kt(g),g.mode=v,E===w){V>>>=2,N-=2;break e}break;case 2:g.mode=16196;break;case 3:b.msg="invalid block type",g.mode=R}V>>>=2,N-=2;break;case 16193:for(V>>>=7&N,N-=7&N;N<32;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if((65535&V)!=(V>>>16^65535)){b.msg="invalid stored block lengths",g.mode=R;break}if(g.length=65535&V,V=0,N=0,g.mode=S,E===w)break e;case S:g.mode=16195;case 16195:if($=g.length,$){if($>Y&&($=Y),$>ve&&($=ve),$===0)break e;K.set(W.subarray(q,q+$),se),Y-=$,q+=$,ve-=$,se+=$,g.length-=$;break}g.mode=y;break;case 16196:for(;N<14;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(g.nlen=257+(31&V),V>>>=5,N-=5,g.ndist=1+(31&V),V>>>=5,N-=5,g.ncode=4+(15&V),V>>>=4,N-=4,g.nlen>286||g.ndist>30){b.msg="too many length or distance symbols",g.mode=R;break}g.have=0,g.mode=16197;case 16197:for(;g.have<g.ncode;){for(;N<3;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.lens[ya[g.have++]]=7&V,V>>>=3,N-=3}for(;g.have<19;)g.lens[ya[g.have++]]=0;if(g.lencode=g.lendyn,g.lenbits=7,ue={bits:g.lenbits},be=m(0,g.lens,0,19,g.lencode,0,g.work,ue),g.lenbits=ue.bits,be){b.msg="invalid code lengths set",g.mode=R;break}g.have=0,g.mode=16198;case 16198:for(;g.have<g.nlen+g.ndist;){for(;ge=g.lencode[V&(1<<g.lenbits)-1],ie=ge>>>24,De=ge>>>16&255,me=65535&ge,!(ie<=N);){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(me<16)V>>>=ie,N-=ie,g.lens[g.have++]=me;else{if(me===16){for(dt=ie+2;N<dt;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(V>>>=ie,N-=ie,g.have===0){b.msg="invalid bit length repeat",g.mode=R;break}ne=g.lens[g.have-1],$=3+(3&V),V>>>=2,N-=2}else if(me===17){for(dt=ie+3;N<dt;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}V>>>=ie,N-=ie,ne=0,$=3+(7&V),V>>>=3,N-=3}else{for(dt=ie+7;N<dt;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}V>>>=ie,N-=ie,ne=0,$=11+(127&V),V>>>=7,N-=7}if(g.have+$>g.nlen+g.ndist){b.msg="invalid bit length repeat",g.mode=R;break}for(;$--;)g.lens[g.have++]=ne}}if(g.mode===R)break;if(g.lens[256]===0){b.msg="invalid code -- missing end-of-block",g.mode=R;break}if(g.lenbits=9,ue={bits:g.lenbits},be=m(1,g.lens,0,g.nlen,g.lencode,0,g.work,ue),g.lenbits=ue.bits,be){b.msg="invalid literal/lengths set",g.mode=R;break}if(g.distbits=6,g.distcode=g.distdyn,ue={bits:g.distbits},be=m(2,g.lens,g.nlen,g.ndist,g.distcode,0,g.work,ue),g.distbits=ue.bits,be){b.msg="invalid distances set",g.mode=R;break}if(g.mode=v,E===w)break e;case v:g.mode=Q;case Q:if(Y>=6&&ve>=258){b.next_out=se,b.avail_out=ve,b.next_in=q,b.avail_in=Y,g.hold=V,g.bits=N,r(b,pe),se=b.next_out,K=b.output,ve=b.avail_out,q=b.next_in,W=b.input,Y=b.avail_in,V=g.hold,N=g.bits,g.mode===y&&(g.back=-1);break}for(g.back=0;ge=g.lencode[V&(1<<g.lenbits)-1],ie=ge>>>24,De=ge>>>16&255,me=65535&ge,!(ie<=N);){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(De&&!(240&De)){for(te=ie,ye=De,Re=me;ge=g.lencode[Re+((V&(1<<te+ye)-1)>>te)],ie=ge>>>24,De=ge>>>16&255,me=65535&ge,!(te+ie<=N);){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}V>>>=te,N-=te,g.back+=te}if(V>>>=ie,N-=ie,g.back+=ie,g.length=me,De===0){g.mode=16205;break}if(32&De){g.back=-1,g.mode=y;break}if(64&De){b.msg="invalid literal/length code",g.mode=R;break}g.extra=15&De,g.mode=16201;case 16201:if(g.extra){for(dt=g.extra;N<dt;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.length+=V&(1<<g.extra)-1,V>>>=g.extra,N-=g.extra,g.back+=g.extra}g.was=g.length,g.mode=16202;case 16202:for(;ge=g.distcode[V&(1<<g.distbits)-1],ie=ge>>>24,De=ge>>>16&255,me=65535&ge,!(ie<=N);){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(!(240&De)){for(te=ie,ye=De,Re=me;ge=g.distcode[Re+((V&(1<<te+ye)-1)>>te)],ie=ge>>>24,De=ge>>>16&255,me=65535&ge,!(te+ie<=N);){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}V>>>=te,N-=te,g.back+=te}if(V>>>=ie,N-=ie,g.back+=ie,64&De){b.msg="invalid distance code",g.mode=R;break}g.offset=me,g.extra=15&De,g.mode=16203;case 16203:if(g.extra){for(dt=g.extra;N<dt;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}g.offset+=V&(1<<g.extra)-1,V>>>=g.extra,N-=g.extra,g.back+=g.extra}if(g.offset>g.dmax){b.msg="invalid distance too far back",g.mode=R;break}g.mode=16204;case 16204:if(ve===0)break e;if($=pe-ve,g.offset>$){if($=g.offset-$,$>g.whave&&g.sane){b.msg="invalid distance too far back",g.mode=R;break}$>g.wnext?($-=g.wnext,at=g.wsize-$):at=g.wnext-$,$>g.length&&($=g.length),Se=g.window}else Se=K,at=se-g.offset,$=g.length;$>ve&&($=ve),ve-=$,g.length-=$;do K[se++]=Se[at++];while(--$);g.length===0&&(g.mode=Q);break;case 16205:if(ve===0)break e;K[se++]=g.length,ve--,g.mode=Q;break;case T:if(g.wrap){for(;N<32;){if(Y===0)break e;Y--,V|=W[q++]<<N,N+=8}if(pe-=ve,b.total_out+=pe,g.total+=pe,4&g.wrap&&pe&&(b.adler=g.check=g.flags?n(g.check,K,pe,se-pe):a(g.check,K,pe,se-pe)),pe=ve,4&g.wrap&&(g.flags?V:ee(V))!==g.check){b.msg="incorrect data check",g.mode=R;break}V=0,N=0}g.mode=16207;case 16207:if(g.wrap&&g.flags){for(;N<32;){if(Y===0)break e;Y--,V+=W[q++]<<N,N+=8}if(4&g.wrap&&V!==(4294967295&g.total)){b.msg="incorrect length check",g.mode=R;break}V=0,N=0}g.mode=16208;case 16208:be=I;break e;case R:be=z;break e;case 16210:return j;default:return L}return b.next_out=se,b.avail_out=ve,b.next_in=q,b.avail_in=Y,g.hold=V,g.bits=N,(g.wsize||pe!==b.avail_out&&g.mode<R&&(g.mode<T||E!==M))&&Ct(b,b.output,b.next_out,pe-b.avail_out),tt-=b.avail_in,pe-=b.avail_out,b.total_in+=tt,b.total_out+=pe,g.total+=pe,4&g.wrap&&pe&&(b.adler=g.check=g.flags?n(g.check,K,pe,b.next_out-pe):a(g.check,K,pe,b.next_out-pe)),b.data_type=g.bits+(g.last?64:0)+(g.mode===y?128:0)+(g.mode===v||g.mode===S?256:0),(tt===0&&pe===0||E===M)&&be===C&&(be=Z),be},inflateEnd:b=>{if(ze(b))return L;let E=b.state;return E.window&&(E.window=null),b.state=null,C},inflateGetHeader:(b,E)=>{if(ze(b))return L;const g=b.state;return 2&g.wrap?(g.head=E,E.done=!1,C):L},inflateSetDictionary:(b,E)=>{const g=E.length;let W,K,q;return ze(b)?L:(W=b.state,W.wrap!==0&&W.mode!==B?L:W.mode===B&&(K=1,K=a(K,E,g,0),K!==W.check)?z:(q=Ct(b,E,g,g),q?(W.mode=16210,j):(W.havedict=1,C)))},inflateInfo:"pako inflate (from Nodeca project)"};const ht=(b,E)=>Object.prototype.hasOwnProperty.call(b,E);var Pt=function(b){const E=Array.prototype.slice.call(arguments,1);for(;E.length;){const g=E.shift();if(g){if(typeof g!="object")throw new TypeError(g+"must be non-object");for(const W in g)ht(g,W)&&(b[W]=g[W])}}return b},kt=b=>{let E=0;for(let W=0,K=b.length;W<K;W++)E+=b[W].length;const g=new Uint8Array(E);for(let W=0,K=0,q=b.length;W<q;W++){let se=b[W];g.set(se,K),K+=se.length}return g};let na=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{na=!1}const Jt=new Uint8Array(256);for(let b=0;b<256;b++)Jt[b]=b>=252?6:b>=248?5:b>=240?4:b>=224?3:b>=192?2:1;Jt[254]=Jt[254]=1;var fs=b=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(b);let E,g,W,K,q,se=b.length,Y=0;for(K=0;K<se;K++)g=b.charCodeAt(K),(64512&g)==55296&&K+1<se&&(W=b.charCodeAt(K+1),(64512&W)==56320&&(g=65536+(g-55296<<10)+(W-56320),K++)),Y+=g<128?1:g<2048?2:g<65536?3:4;for(E=new Uint8Array(Y),q=0,K=0;q<Y;K++)g=b.charCodeAt(K),(64512&g)==55296&&K+1<se&&(W=b.charCodeAt(K+1),(64512&W)==56320&&(g=65536+(g-55296<<10)+(W-56320),K++)),g<128?E[q++]=g:g<2048?(E[q++]=192|g>>>6,E[q++]=128|63&g):g<65536?(E[q++]=224|g>>>12,E[q++]=128|g>>>6&63,E[q++]=128|63&g):(E[q++]=240|g>>>18,E[q++]=128|g>>>12&63,E[q++]=128|g>>>6&63,E[q++]=128|63&g);return E},Ra=(b,E)=>{const g=E||b.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(b.subarray(0,E));let W,K;const q=new Array(2*g);for(K=0,W=0;W<g;){let se=b[W++];if(se<128){q[K++]=se;continue}let Y=Jt[se];if(Y>4)q[K++]=65533,W+=Y-1;else{for(se&=Y===2?31:Y===3?15:7;Y>1&&W<g;)se=se<<6|63&b[W++],Y--;Y>1?q[K++]=65533:se<65536?q[K++]=se:(se-=65536,q[K++]=55296|se>>10&1023,q[K++]=56320|1023&se)}}return((se,Y)=>{if(Y<65534&&se.subarray&&na)return String.fromCharCode.apply(null,se.length===Y?se:se.subarray(0,Y));let ve="";for(let V=0;V<Y;V++)ve+=String.fromCharCode(se[V]);return ve})(q,K)},cs=(b,E)=>{(E=E||b.length)>b.length&&(E=b.length);let g=E-1;for(;g>=0&&(192&b[g])==128;)g--;return g<0||g===0?E:g+Jt[b[g]]>E?g:E},Lt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ba=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},xa=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const La=Object.prototype.toString,{Z_NO_FLUSH:re,Z_FINISH:Ot,Z_OK:h,Z_STREAM_END:_,Z_NEED_DICT:D,Z_STREAM_ERROR:k,Z_DATA_ERROR:x,Z_MEM_ERROR:U}=u;function G(b){this.options=Pt({chunkSize:65536,windowBits:15,to:""},b||{});const E=this.options;E.raw&&E.windowBits>=0&&E.windowBits<16&&(E.windowBits=-E.windowBits,E.windowBits===0&&(E.windowBits=-15)),!(E.windowBits>=0&&E.windowBits<16)||b&&b.windowBits||(E.windowBits+=32),E.windowBits>15&&E.windowBits<48&&!(15&E.windowBits)&&(E.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ba,this.strm.avail_out=0;let g=Ke.inflateInit2(this.strm,E.windowBits);if(g!==h)throw new Error(Lt[g]);if(this.header=new xa,Ke.inflateGetHeader(this.strm,this.header),E.dictionary&&(typeof E.dictionary=="string"?E.dictionary=fs(E.dictionary):La.call(E.dictionary)==="[object ArrayBuffer]"&&(E.dictionary=new Uint8Array(E.dictionary)),E.raw&&(g=Ke.inflateSetDictionary(this.strm,E.dictionary),g!==h)))throw new Error(Lt[g])}function H(b,E){const g=new G(E);if(g.push(b),g.err)throw g.msg||Lt[g.err];return g.result}G.prototype.push=function(b,E){const g=this.strm,W=this.options.chunkSize,K=this.options.dictionary;let q,se,Y;if(this.ended)return!1;for(se=E===~~E?E:E===!0?Ot:re,La.call(b)==="[object ArrayBuffer]"?g.input=new Uint8Array(b):g.input=b,g.next_in=0,g.avail_in=g.input.length;;){for(g.avail_out===0&&(g.output=new Uint8Array(W),g.next_out=0,g.avail_out=W),q=Ke.inflate(g,se),q===D&&K&&(q=Ke.inflateSetDictionary(g,K),q===h?q=Ke.inflate(g,se):q===x&&(q=D));g.avail_in>0&&q===_&&g.state.wrap>0&&b[g.next_in]!==0;)Ke.inflateReset(g),q=Ke.inflate(g,se);switch(q){case k:case x:case D:case U:return this.onEnd(q),this.ended=!0,!1}if(Y=g.avail_out,g.next_out&&(g.avail_out===0||q===_))if(this.options.to==="string"){let ve=cs(g.output,g.next_out),V=g.next_out-ve,N=Ra(g.output,ve);g.next_out=V,g.avail_out=W-V,V&&g.output.set(g.output.subarray(ve,ve+V),0),this.onData(N)}else this.onData(g.output.length===g.next_out?g.output:g.output.subarray(0,g.next_out));if(q!==h||Y!==0){if(q===_)return q=Ke.inflateEnd(this.strm),this.onEnd(q),this.ended=!0,!0;if(g.avail_in===0)break}}return!0},G.prototype.onData=function(b){this.chunks.push(b)},G.prototype.onEnd=function(b){b===h&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=kt(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg};var J=G,oe=H,he=function(b,E){return(E=E||{}).raw=!0,H(b,E)},fe=H,Me=u,pt={Inflate:J,inflate:oe,inflateRaw:he,ungzip:fe,constants:Me};t.Inflate=J,t.constants=Me,t.default=pt,t.inflate=oe,t.inflateRaw=he,t.ungzip=fe,Object.defineProperty(t,"__esModule",{value:!0})})})(Ns,Ns.exports);var Hd=Ns.exports,Wd=Ui(Hd);function zd(o,e){return Wd.inflate(o,void 0)}function wn(o){return o>>>0}function Ni(o,e){return o=wn(o),e=wn(e),$e(o).shiftLeft(32).add($e(e))}const qi=+gt.API.constructors.find(o=>o.predicate==="boolFalse").id,ji=+gt.API.constructors.find(o=>o.predicate==="boolTrue").id,Gi=+gt.API.constructors.find(o=>o.predicate==="vector").id,Kd=+gt.MTProto.constructors.find(o=>o.predicate==="gzip_packed").id,Ds="slice";class ft{constructor(e={}){this.maxLength=2048,this.offset=0,this.mtproto=!1,this.debug=!1,this.maxLength=e.startMaxLength||2048,this.mtproto=e.mtproto||!1,this.createBuffer()}createBuffer(){this.buffer=new ArrayBuffer(this.maxLength),this.intView=new Int32Array(this.buffer),this.byteView=new Uint8Array(this.buffer)}getArray(){const e=new ArrayBuffer(this.offset),t=new Int32Array(e);return t.set(this.intView.subarray(0,this.offset/4)),t}getBuffer(){return this.getArray().buffer}getBytes(e=!0){if(e){const a=new ArrayBuffer(this.offset),s=new Uint8Array(a);return s.set(this.byteView.subarray(0,this.offset)),s}const t=new Array(this.offset);for(let a=0;a<this.offset;++a)t[a]=this.byteView[a];return t}getOffset(){return this.offset}checkLength(e){if(this.offset+e<this.maxLength)return;this.maxLength=Math.ceil(Math.max(this.maxLength*2,this.offset+e+16)/4)*4;const t=this.buffer,a=new Int32Array(t);this.createBuffer(),new Int32Array(this.buffer).set(a)}writeInt(e,t){this.debug&&console.log(">>>",e.toString(16),e,t);const a=this.offset/4;return this.checkLength(4),this.intView[a]=e,this.offset+=4,a}storeInt(e,t){return this.writeInt(e,(t||"")+":int")}storeBool(e,t){e?this.writeInt(ji,(t||"")+":bool"):this.writeInt(qi,(t||"")+":bool")}storeLongP(e,t,a){this.writeInt(t,(a||"")+":long[low]"),this.writeInt(e,(a||"")+":long[high]")}storeLong(e,t){if(Array.isArray(e))return e.length===2?this.storeLongP(e[0],e[1],t):this.storeIntBytes(e,64,t);const a=sd($e(e)),{quotient:s,remainder:n}=a.divmod(4294967296),i=s.toJSNumber(),r=n.toJSNumber();this.writeInt(r,(t||"")+":long[low]"),this.writeInt(i,(t||"")+":long[high]")}storeDouble(e,t){const a=new ArrayBuffer(8),s=new Int32Array(a),n=new Float64Array(a);n[0]=e,this.writeInt(s[0],(t||"")+":double[low]"),this.writeInt(s[1],(t||"")+":double[high]")}storeString(e,t){this.debug&&console.log(">>>",e,(t||"")+":string"),e===void 0&&(e="");const a=unescape(encodeURIComponent(e));this.checkLength(a.length+8);const s=a.length;s<=253?this.byteView[this.offset++]=s:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=s&255,this.byteView[this.offset++]=(s&65280)>>8,this.byteView[this.offset++]=(s&16711680)>>16);for(let n=0;n<s;++n)this.byteView[this.offset++]=a.charCodeAt(n);for(;this.offset%4;)this.byteView[this.offset++]=0}storeBytes(e,t){e instanceof ArrayBuffer?e=new Uint8Array(e):e===void 0&&(e=[]),this.debug&&console.log(">>>",Te(e),(t||"")+":bytes");const a=e.length;for(this.checkLength(a+8),a<=253?this.byteView[this.offset++]=a:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=a&255,this.byteView[this.offset++]=(a&65280)>>8,this.byteView[this.offset++]=(a&16711680)>>16),this.byteView.set(e,this.offset),this.offset+=a;this.offset%4;)this.byteView[this.offset++]=0}storeIntBytes(e,t,a){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const s=e.length;if(t%32||s*8!==t){const n=new Error("Invalid bits: "+t+", "+s);throw console.error(n,e,a),n}this.debug&&console.log(">>>",Te(e),(a||"")+":int"+t),this.checkLength(s),this.byteView.set(e,this.offset),this.offset+=s}storeRawBytes(e,t){e instanceof ArrayBuffer&&(e=new Uint8Array(e));const a=e.length;this.debug&&console.log(">>>",Te(e),t||""),this.checkLength(a),this.byteView.set(e,this.offset),this.offset+=a}storeMethod(e,t){const s=(this.mtproto?gt.MTProto:gt.API).methods.find(n=>n.method===e);if(!s)throw new Error("No method "+e+" found");return this.storeInt(s.id,e+"[id]"),this.storeBody(t,s,e),s.type}storeObject(e,t,a){switch(t){case"#":e||(e=0);case"int":return this.storeInt(e,a);case"long":return this.storeLong(e,a);case"int128":return this.storeIntBytes(e,128,a);case"int256":return this.storeIntBytes(e,256,a);case"int512":return this.storeIntBytes(e,512,a);case"string":return this.storeString(e,a);case"bytes":return this.storeBytes(e,a);case"double":return this.storeDouble(e,a);case"Bool":return this.storeBool(e,a);case"true":return}if(Array.isArray(e)){if(t.substr(0,6)==="Vector")this.writeInt(Gi,a+"[id]");else if(t.substr(0,6)!=="vector")throw new Error("Invalid vector type "+t);const p=t.substr(7,t.length-8);this.writeInt(e.length,a+"[count]");for(let d=0;d<e.length;++d)this.storeObject(e[d],p,a+"["+d+"]");return!0}else if(t.substr(0,6).toLowerCase()==="vector")throw new Error("Invalid vector object");if(!et(e))throw new Error("Invalid object for type "+t);const s=this.mtproto?gt.MTProto:gt.API,n=e._;let i=!1;const r=s.constructors.find(p=>p.predicate===n);if((i=t.charAt(0)==="%")&&(t=t.substr(1)),!r)throw new Error("No predicate "+n+" found");return n===t&&(i=!0),i||this.writeInt(r.id,a+"["+n+"][id]"),this.storeBody(e,r,a+"["+n+"]"),r.type}storeBody(e,t,a){const s=e.pFlags||e;let n;for(const i of t.params){let r=i.type;if(r.indexOf("?")!==-1){const f=r.split("?"),c=f[0].split(".");if(f[1]==="true"?s?.[i.name]:e[i.name]!==void 0)n[c[0]].flags|=1<<+c[1];else continue;r=f[1]}const p=r==="#";p&&((n??(n={}))[i.name]={flags:0});const d=this.storeObject(p?n[i.name].flags:e[i.name],r,a+"["+i.name+"]");p&&(n[i.name].offset=d)}for(const i in n){const{flags:r,offset:p}=n[i];this.intView[p]=r}}}class jt{constructor(e,t={}){this.offset=0,this.mtproto=!1,e instanceof ArrayBuffer?(this.buffer=e,this.intView=new Int32Array(e),this.byteView=new Uint8Array(this.buffer)):(this.buffer=e.buffer,this.intView=new Int32Array(e.buffer,e.byteOffset,e.byteLength/4),this.byteView=e),this.override=t.override||{},this.mtproto=!!t.mtproto,this.debug=t.debug!==void 0?t.debug:!1}readInt(e){if(this.byteView.length-this.offset<4)throw console.error(this.byteView,this.offset),new Error("Nothing to fetch: "+e);const t=this.intView[this.offset/4];return this.debug&&console.log("<<<",t.toString(16),t,e,this.byteView.slice(this.offset-16,this.offset+16),Te(this.byteView.slice(this.offset-16,this.offset+16))),this.offset+=4,t}fetchInt(e){return this.readInt((e||"")+":int")}fetchDouble(e){const t=new ArrayBuffer(8),a=new Int32Array(t),s=new Float64Array(t);return a[0]=this.readInt((e||"")+":double[low]"),a[1]=this.readInt((e||"")+":double[high]"),s[0]}fetchLong(e){const t=this.readInt((e||"")+":long[low]"),a=this.readInt((e||"")+":long[high]");let s=Ni(a,t);return this.mtproto||(s=ad(s)),!this.mtproto&&Xp.greaterOrEquals(s.abs())?s.toJSNumber():s.toString(10)}fetchBool(e){const t=this.readInt((e||"")+":bool");return t===ji?!0:t===qi?!1:(this.offset-=4,this.fetchObject("Object",e))}fetchString(e){let t=this.byteView[this.offset++];t===254&&(t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16);let a="";for(let n=0;n<t;++n)a+=String.fromCharCode(this.byteView[this.offset++]);for(;this.offset%4;)++this.offset;let s;try{s=decodeURIComponent(escape(a))}catch{s=a}return this.debug&&console.log("<<<",s,(e||"")+":string"),s}fetchBytes(e){let t=this.byteView[this.offset++];t===254&&(t=this.byteView[this.offset++]|this.byteView[this.offset++]<<8|this.byteView[this.offset++]<<16);const a=this.byteView[Ds](this.offset,this.offset+t);for(this.offset+=t;this.offset%4;)++this.offset;return this.debug&&console.log("<<<",Te(a),(e||"")+":bytes"),a}fetchIntBytes(e,t=!0,a){if(e%32)throw new Error("Invalid bits: "+e);const s=e/8;if(t){const i=this.byteView[Ds](this.offset,this.offset+s);return this.offset+=s,i}const n=new Array(s);for(let i=0;i<s;++i)n[i]=this.byteView[this.offset++];return this.debug&&console.log("<<<",Te(n),(a||"")+":int"+e),n}fetchRawBytes(e,t=!0,a){if(e===!1&&(e=this.readInt((a||"")+"_length"),e>this.byteView.byteLength))throw new Error("Invalid raw bytes length: "+e+", buffer len: "+this.byteView.byteLength);if(t){const n=new Uint8Array(e);return n.set(this.byteView[Ds](this.offset,this.offset+e)),this.offset+=e,n}const s=new Array(e);for(let n=0;n<e;++n)s[n]=this.byteView[this.offset++];return this.debug&&console.log("<<<",Te(s),a||""),s}fetchVector(e,t){const a=this.readInt(t+"[count]"),s=new Array(a);if(a>0){const n=e.substr(7,e.length-8);for(let i=0;i<a;++i)s[i]=this.fetchObject(n,t+"["+i+"]")}return s}fetchObject(e,t){switch(e){case"#":case"int":return this.fetchInt(t);case"long":return this.fetchLong(t);case"int128":return this.fetchIntBytes(128,!0,t);case"int256":return this.fetchIntBytes(256,!0,t);case"int512":return this.fetchIntBytes(512,!0,t);case"string":return this.fetchString(t);case"bytes":return this.fetchBytes(t);case"double":return this.fetchDouble(t);case"Bool":return this.fetchBool(t);case"true":return!0}if(t=t||e||"Object",e.charAt(0)==="v"&&e.substr(1,5)==="ector")return this.fetchVector(e,t);const a=this.mtproto?gt.MTProto:gt.API;let s=null,n=!1;if(e.charAt(0)==="%"){const d=e.substr(1);if(s=a.constructors.find(f=>f.type===d),!s)throw new Error("Constructor not found for type: "+e)}else{const d=this.readInt(t+"[id]");if(d===Kd){const l=this.fetchBytes(t+"[packed_string]"),m=zd(l);return new jt(m).fetchObject(e,t)}if(d===Gi)return this.fetchVector(e,t);let f=a.constructorsIndex;if(!f){a.constructorsIndex=f={};for(let l=0,m=a.constructors.length;l<m;++l)f[a.constructors[l].id]=l}const c=f[d];if(c!==void 0&&(s=a.constructors[c]),!s&&this.mtproto){const l=gt.API;for(let m=0,u=l.constructors.length;m<u;++m)if(+l.constructors[m].id===d){s=l.constructors[m],delete this.mtproto,n=!0;break}}if(!s){console.error("Constructor not found:",d);let l,m;try{l=this.fetchInt(t),m=this.fetchInt(t)}catch{}throw new Error("Constructor not found: "+d+" "+l+" "+m+" "+t)}}const i=s.predicate,r={_:i},p=(this.mtproto?"mt_":"")+i;if(this.override[p])this.override[p](r,t+"["+i+"]");else{let d={};for(let f=0,c=s.params.length;f<c;++f){const l=s.params[f];let m=l.type;const u=m==="#";u&&(r.pFlags??(r.pFlags={}),(d??(d={}))[l.name]=0);const M=m.indexOf("?")!==-1;if(M){const w=m.split("?"),C=w[0].split(".");if(!(d[C[0]]&1<<+C[1]))continue;m=w[1]}const A=this.fetchObject(m,t+"["+i+"]["+l.name+"]");M&&m==="true"?r.pFlags[l.name]=A:(u?d:r)[l.name]=A}}return n&&(this.mtproto=!0),e==="JSONValue"?this.formatJSONValue(r):r}formatJSONValue(e){if(!e._)return e;switch(e._){case"jsonNull":return null;case"jsonObject":{const t={},a=e.value;for(let s=0,n=a.length;s<n;++s){const i=a[s];t[i.key]=this.formatJSONValue(i.value)}return t}default:return e.value}}getOffset(){return this.offset}setOffset(e){this.offset=e}}Ue.TLDeserialization=jt;Ue.TLSerialization=ft;function qs(o,e=16,t,a=!1,s=!1){const n=o.byteLength||o.length,i=a?e-n:e-n%e;if(i>0&&i<e){const r=new Uint8Array(i);if(t)for(let p=0;p<i;++p)r[p]=0;else Tt(r);return o instanceof ArrayBuffer?(s?$t(r,o):$t(o,r)).buffer:o instanceof Uint8Array?s?$t(r,o):$t(o,r):s?[...r].concat(o):o.concat([...r])}return o}function Jd(o){const e=td($e(o)).reverse();return qs(e,8,!0,!1,!1)}function kn(o){return o instanceof Uint8Array?o:typeof o=="string"?new TextEncoder().encode(o):new Uint8Array(o)}function Qd(o){return o.map(e=>$e(e)).sort((e,t)=>e.compare(t)).map(e=>e.toString(10))}const An=!0,Fn=15,Yd=1e4,En={client:{disconnectDelayMin:7,disconnectDelayMax:20,pingInterval:2e3,pingMaxTime:5,connectionTimeout:5e3},file:{disconnectDelayMin:10,disconnectDelayMax:24,pingInterval:3e3,pingMaxTime:7,connectionTimeout:7500}},$d={notContentRelated:!0,noSchedule:!0},Un={notContentRelated:!0,canCleanup:!0,longPoll:!0};let Wa,Zd=0;class Xd{constructor(e,t,a,s,n,i,r={}){this.networkerFactory=e,this.timeManager=t,this.dcId=a,this.authKey=s,this.authKeyId=n,this.lastServerMessages=new Set,this.sentMessages={},this.pendingMessages={},this.pendingAcks=[],this.pendingResendReq=[],this.sentResendReq=new Map,this.nextReq=0,this.checkConnectionPeriod=0,this.offline=!1,this.isOnline=!1,this.status=Mt.Closed,this.lastResponseTime=0,this.debug=Ae.debug,this.activeRequests=0,this.sendPingDelayDisconnect=()=>{if(this.pingDelayDisconnectDeferred||!this.transport||!this.transport.connected)return;const d=this.pingDelayDisconnectDeferred=Pe(),f=this.delays,c=this.delays.pingMaxTime,l=Math.min(this.lastPingTime??0,c),m=Math.round(f.disconnectDelayMin+l/c*(f.disconnectDelayMax-f.disconnectDelayMin)),u=m*1e3,M=this.lastPingStartTime=Date.now(),A=this.lastPingDelayDisconnectId=qt(),w={notContentRelated:!0,canCleanup:!0};this.wrapMtpCall("ping_delay_disconnect",{ping_id:A,disconnect_delay:m},w);const C=this.log.bindPrefix("sendPingDelayDisconnect");C.debug(`ping, timeout=${u}, lastPingTime=${this.lastPingTime}, msgId=${w.messageId}, pingId=${A}`);const I=we.setTimeout(d.reject.bind(d),u),F=j=>{clearTimeout(I);const Z=Date.now()-M;if(this.lastPingTime=Z/1e3,C.debug(`pong, reason='${j}', time=${l}, msgId=${w.messageId}`),Z>u)throw void 0;return rt(Math.max(0,this.delays.pingInterval-Z))},L=()=>{clearTimeout(I);const j=this.transport;this.pingDelayDisconnectDeferred!==d||!j?.connection||(C.error("catch, closing connection",this.lastPingTime,w.messageId),j.connection.close())},z=()=>{this.pingDelayDisconnectDeferred===d&&(this.pingDelayDisconnectDeferred=void 0,this.sendPingDelayDisconnect())};d.then(F).catch(L).finally(z)},this.checkLongPoll=()=>{if(this.isFileNetworker&&!An)return;const d=this.log.bindPrefix("checkLongPoll");if(this.offline||this.longPollPending&&Date.now()<this.longPollPending||this.isStopped()){d("no lp this time");return}d("check",this.longPollPending);const f=this.cleanupSent();nt.get("dc").then(c=>{if(f&&(c!==this.dcId||this.sleepAfter&&Date.now()>this.sleepAfter)){d.warn("send long-poll for DC is delayed",this.sleepAfter);return}this.sendLongPoll()})},this.checkConnection=d=>{const f=this.log.bindPrefix("checkConnection");if(f("check connection",d),this.clearCheckConnectionTimeout(),!this.transport){f.warn("no transport for checkConnection");return}const c=new ft({mtproto:!0}),l=qt();c.storeMethod("ping",{ping_id:l});const m={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),body:c.getBytes(!0)};this.offline&&this.setConnectionStatus(Mt.Connecting),this.sendEncryptedRequest(m).then(()=>{f("got ping"),this.toggleOffline(!1)},()=>{f("still error, delay",this.checkConnectionPeriod*1e3),this.checkConnectionTimeout=we.setTimeout(()=>this.checkConnection("from failed checkConnection request"),this.checkConnectionPeriod*1e3|0),this.checkConnectionPeriod=Math.min(Fn,this.checkConnectionPeriod*1.5)})},this.authKeyUint8=kn(this.authKey),this.serverSalt=kn(i),this.isFileUpload=!!r.fileUpload,this.isFileDownload=!!r.fileDownload,this.isFileNetworker=this.isFileUpload||this.isFileDownload,this.delays=this.isFileNetworker?En.file:En.client;const p=this.isFileUpload?"-U":this.isFileDownload?"-D":"";this.name="NET-"+a+p,this.log=We(this.name+(p?"":"-C")+"-"+Zd++,ke.Log|ke.Error|ke.Warn|(this.debug?ke.Debug:0)),this.log("constructor"),this.updateSession()}updateSession(){this.seqNo=0,this.prevSessionId=this.sessionId,this.sessionId=Tt(new Uint8Array(8))}updateSentMessage(e){const t=this.log.bindPrefix("updateSentMessage"),a=this.sentMessages[e];if(!a)return t.error("no sentMessage",e),!1;if(t("updating",a),delete this.sentMessages[e],a.container){let s=!1;if(Et(a.inner,(n,i)=>{const r=this.updateSentMessage(n);r?a.inner[i]=r.msg_id:(a.inner.splice(i,1),s=!0)}),s&&!a.inner.length){t("deleted container",a);return}}return a.msg_id=this.timeManager.generateId(),a.seq_no=this.generateSeqNo(a.notContentRelated),t("old and new",e,a.msg_id),this.sentMessages[a.msg_id]=a,a}generateSeqNo(e){let t=this.seqNo*2;return e||(t++,this.seqNo++),t}wrapMtpCall(e,t,a){const s=new ft({mtproto:!0});s.storeMethod(e,t);const n=this.timeManager.generateId(),i=this.generateSeqNo(),r={msg_id:n,seq_no:i,body:s.getBytes(!0),humanReadable:e};return Ae.debug&&this.log("MT call",e,t,n,i),this.pushMessage(r,a)}wrapMtpMessage(e,t){const a=new ft({mtproto:!0});a.storeObject(e,"Object");const s=this.timeManager.generateId(),n=this.generateSeqNo(t.notContentRelated),i={msg_id:s,seq_no:n,body:a.getBytes(!0),humanReadable:e._};return Ae.debug&&this.log("MT message",e,s,n),this.pushMessage(i,t)}wrapApiCall(e,t={},a={}){const s=this.log.bindPrefix("wrapApiCall"),n=new ft(a);if(!this.connectionInited){s("adding invokeWithLayer");const d=gt.API.methods.find(c=>c.method==="invokeWithLayer");if(!d)throw new Error("no invokeWithLayer!");n.storeInt(+d.id,"invokeWithLayer"),n.storeInt(gt.layer,"layer");const f=gt.API.methods.find(c=>c.method==="initConnection");if(!f)throw new Error("no initConnection!");n.storeInt(+f.id,"initConnection"),n.storeInt(0,"flags"),n.storeInt(Ve.id,"api_id"),n.storeString(Rt().USER_AGENT||"Unknown UserAgent","device_model"),n.storeString(navigator.platform||"Unknown Platform","system_version"),n.storeString(Ve.version+(Ve.isMainDomain?" "+Ve.suffix:""),"app_version"),n.storeString(navigator.language||"en","system_lang_code"),n.storeString(Ve.langPack,"lang_pack"),n.storeString(this.networkerFactory.language,"lang_code")}if(a.afterMessageId){if(Wa===void 0){const d=gt.API.methods.find(f=>f.method==="invokeAfterMsg");Wa=d?+d.id:0}Wa?(s("store invokeAfterMsg"),n.storeInt(Wa,"invokeAfterMsg"),n.storeLong(a.afterMessageId,"msg_id")):s.error("no invokeAfterMsg")}a.resultType=n.storeMethod(e,t);const i=this.timeManager.generateId(),r=this.generateSeqNo(),p={msg_id:i,seq_no:r,body:n.getBytes(!0),isAPI:!0,humanReadable:e};return s("call",e,p,t,a),this.pushMessage(p,a)}changeTransport(e){const t=this.transport;t&&(t.destroy(),this.clearNextReq(),this.connectionInited=!1,this.longPollInterval&&(clearInterval(this.longPollInterval),this.longPollInterval=void 0),this.clearCheckConnectionTimeout()),this.log("change transport",e,t),this.clearPingDelayDisconnect(),this.transport=e,e&&(e.networker=this,e instanceof Nt&&((!this.isFileNetworker||An)&&(this.longPollInterval=we.setInterval(this.checkLongPoll,1e4),this.checkLongPoll()),this.checkConnection("changed transport")),e.connection&&e.connected&&this.setConnectionStatus(Mt.Connected),this.resend())}destroy(){this.log("destroy")}forceReconnectTimeout(){this.transport.reconnect?this.transport.reconnect():this.resend()}forceReconnect(){this.transport.forceReconnect?this.transport.forceReconnect():this.checkConnection("force reconnect")}clearPingDelayDisconnect(){const e=this.pingDelayDisconnectDeferred;this.pingDelayDisconnectDeferred=void 0,this.lastPingDelayDisconnectId=void 0,e&&e.reject()}sendLongPoll(){const e=this.log.bindPrefix("sendLongPoll");if(this.sendingLongPoll){e("already sending");return}this.sendingLongPoll=!0;const t=25e3;this.longPollPending=Date.now()+t,e("send",this.longPollPending),this.wrapMtpCall("http_wait",{max_delay:500,wait_after:150,max_wait:t},{...Un,noResponse:!0}).then(()=>{e("success"),this.longPollPending=void 0,setTimeout(this.checkLongPoll,0)},a=>{e("failed",a)}).finally(()=>{this.sendingLongPoll=void 0})}clearCheckConnectionTimeout(){this.checkConnectionTimeout&&(clearTimeout(this.checkConnectionTimeout),this.checkConnectionTimeout=void 0)}toggleOffline(e){if(this.offline!==e)if(this.offline=e,this.clearCheckConnectionTimeout(),e){this.clearNextReq(),this.checkConnectionPeriod<1.5&&(this.checkConnectionPeriod=0);const t=this.checkConnectionPeriod*1e3|0;this.checkConnectionRetryAt=Date.now()+t,this.setConnectionStatus(Mt.Closed,this.checkConnectionRetryAt),this.checkConnectionTimeout=we.setTimeout(()=>this.checkConnection("from toggleOffline"),t),this.checkConnectionPeriod=Math.min(Fn,(1+this.checkConnectionPeriod)*1.5)}else this.onTransportOpen(),this.checkLongPoll();else this.setConnectionStatus(e?Mt.Closed:Mt.Connected,e?this.checkConnectionRetryAt:void 0)}handleSentEncryptedRequestHTTP(e,t,a){e.then(async s=>(this.toggleOffline(!1),await this.onTransportData(s),this.checkLongPoll(),this.checkConnectionPeriod=Math.max(1.1,Math.sqrt(this.checkConnectionPeriod)),!0),s=>(this.log.error("encrypted request failed",s,t),this.pushResend(t.msg_id),this.toggleOffline(!0),!1)).then(s=>{const n=this.sentMessages;a.forEach(i=>{const r=n[i];if(r){const{deferred:p}=r;delete n[i],delete this.pendingMessages[i],s?p.resolve():p.reject()}})})}pushMessage(e,t){let a;return(!t.notContentRelated||t.noResponse)&&(a=Pe()),this.sentMessages[e.msg_id]=Object.assign(e,t,a?{deferred:a}:void 0),this.pendingMessages[e.msg_id]=0,t.noSchedule||this.scheduleRequest(),et(t)&&(t.messageId=e.msg_id),a}attachPromise(e,t){const a=setTimeout(()=>{this.lastResponseTime&&Date.now()-this.lastResponseTime<this.delays.connectionTimeout||(this.log.error("timeout",t),this.isOnline&&this.setConnectionStatus(Mt.TimedOut))},this.delays.connectionTimeout);e.catch(Ge).finally(()=>{clearTimeout(a),this.setConnectionStatus(Mt.Connected),--this.activeRequests,this.setDrainTimeout()}),++this.activeRequests,this.onDrainTimeout&&(clearTimeout(this.onDrainTimeout),this.onDrainTimeout=void 0)}setDrainTimeout(){!this.activeRequests&&this.onDrain&&!this.onDrainTimeout&&(this.onDrainTimeout=we.setTimeout(()=>{this.onDrainTimeout=void 0,this.log("drain"),this.onDrain()},Yd))}setConnectionStatus(e,t,a=!0){const s=e===Mt.Connected,n=this.status!==e;this.isOnline=s,this.status=e,n&&(this.networkerFactory.onConnectionStatusChange&&this.networkerFactory.onConnectionStatusChange({_:"networkerStatus",status:e,dcId:this.dcId,name:this.name,isFileNetworker:this.isFileNetworker,isFileDownload:this.isFileDownload,isFileUpload:this.isFileUpload,retryAt:t}),this.isOnline&&a&&this.scheduleRequest(),this.transport?.connection&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect()))}onTransportOpen(){this.setConnectionStatus(Mt.Connected),this.cleanupSent(),this.resend()}pushResend(e,t=100){const a=this.log.bindPrefix("pushResend"),s=this.sentMessages[e];if(!s){a.warn("no sentMessage",e);return}const n=t?Date.now()+t:0;if(s.container){for(const i of s.inner)this.pushResend(i,t);a("deleting container",e),delete this.sentMessages[e]}else{if(this.pendingMessages[e]!==void 0&&this.pendingMessages[e]<=n){a("already pending",e);return}this.pendingMessages[e]=n}s.acked&&a.error("acked message?",s),a("push",s,t),this.scheduleRequest(t)}async getMsgKey(e,t){const a=t?0:8,s=$t(this.authKeyUint8.subarray(88+a,88+a+32),e),n=await _e.invokeCrypto("sha256",s);return new Uint8Array(n).subarray(8,24)}async getAesKeyIv(e,t){const a=t?0:8,s=new Uint8Array(52),n=new Uint8Array(52),i=[];s.set(e,0),s.set(this.authKeyUint8.subarray(a,a+36),16),i.push(_e.invokeCrypto("sha256",s)),n.set(this.authKeyUint8.subarray(40+a,40+a+36),0),n.set(e,36),i.push(_e.invokeCrypto("sha256",n));const r=await Promise.all(i),p=new Uint8Array(32),d=new Uint8Array(32),f=new Uint8Array(r[0]),c=new Uint8Array(r[1]);return p.set(f.subarray(0,8)),p.set(c.subarray(8,24),8),p.set(f.subarray(24,32),24),d.set(c.subarray(0,8)),d.set(f.subarray(8,24),8),d.set(c.subarray(24,32),24),[p,d]}isStopped(){return this.networkerFactory.akStopped&&!this.isFileNetworker}performScheduledRequest(){const e=this.log.bindPrefix("performScheduledRequest");if(this.isStopped())return e("is stopped"),!1;let t=!1,a,s;if(a=s=!1,this.pendingAcks.length){const l=this.pendingAcks.splice(0,Math.min(8192,this.pendingAcks.length));this.wrapMtpMessage({_:"msgs_ack",msg_ids:l},{canCleanup:!0,notContentRelated:!0,noSchedule:!0}),e.debug("acking messages",l),this.pendingAcks.length&&(t=!0)}const n=this.pendingResendReq.length;if(n){const l=this.pendingResendReq.splice(0,Math.min(8192,n)),m={...$d,resending:new Set(l)};this.wrapMtpMessage({_:"msg_resend_req",msg_ids:l},m);const u=this.sentMessages[m.messageId];l.forEach(M=>{this.sentResendReq.set(M,u)}),e.debug("resending requests",m.messageId,l),a=!0,this.pendingResendReq.length&&(t=!0)}let i;const r=[];let p=0;const d=Qd(Object.keys(this.pendingMessages));for(const l of d){const m=this.sentMessages[l];if(m?.body){const u=m.body.length+32;if(p+u>655360&&(e.warn("length overflow",m,r),t=!0,i))break;r.push(m),p+=u,m.isAPI?a=!0:m.longPoll&&(s=!0),i=m}else e.error("no body",m,l);delete this.pendingMessages[l]}if(this.transport instanceof Nt&&a&&!s){const l={...Un,noSchedule:!0};this.wrapMtpCall("http_wait",{max_delay:500,wait_after:150,max_wait:3e3},l);const m=this.sentMessages[l.messageId];r.push(m),delete this.pendingMessages[m.msg_id],e("appended http_wait",m.msg_id)}if(!r.length){e("no messages to send");return}let f;if(f=r.filter(l=>l.noResponse).map(l=>l.msg_id),r.length>1){const l=this.generateContainerMessage(p,r);i=l.messageWithBody,this.sentMessages[i.msg_id]=l.message}else this.sentMessages[i.msg_id]=i;const c=this.sendEncryptedRequest(i);this.transport instanceof Nt&&this.handleSentEncryptedRequestHTTP(c,i,f),this.cleanupSent(),t&&(e("scheduling next request because of overflow"),this.scheduleRequest())}generateContainerMessage(e,t){const a=new ft({mtproto:!0,startMaxLength:e+64});a.storeInt(1945237724,"CONTAINER[id]"),a.storeInt(t.length,"CONTAINER[count]");const s=t.map((i,r)=>(a.storeLong(i.msg_id,"CONTAINER["+r+"][msg_id]"),a.storeInt(i.seq_no,"CONTAINER["+r+"][seq_no]"),a.storeInt(i.body.length,"CONTAINER["+r+"][bytes]"),a.storeRawBytes(i.body,"CONTAINER["+r+"][body]"),i.msg_id)),n={msg_id:this.timeManager.generateId(),seq_no:this.generateSeqNo(!0),container:!0,inner:s,notContentRelated:!0};return this.log.warn("container",n.msg_id,n.seq_no,s),{message:n,messageWithBody:Object.assign({body:a.getBytes(!0)},n)}}async getEncryptedMessage(e){const t=await this.getMsgKey(e,!0),a=await this.getAesKeyIv(t,!0);return{bytes:await _e.invokeCrypto("aes-encrypt",e,a[0],a[1]),msgKey:t}}async getDecryptedMessage(e,t){const a=await this.getAesKeyIv(e,!1);return _e.invokeCrypto("aes-decrypt",t,a[0],a[1])}async getEncryptedOutput(e){const t=new ft({startMaxLength:e.body.length+2048});t.storeIntBytes(this.serverSalt,64,"salt"),t.storeIntBytes(this.sessionId,64,"session_id"),t.storeLong(e.msg_id,"message_id"),t.storeInt(e.seq_no,"seq_no"),t.storeInt(e.body.length,"message_data_length"),t.storeRawBytes(e.body,"message_data");const a=t.getBuffer(),s=16-t.getOffset()%16+16*(1+ha(8)%5),n=Tt(new Uint8Array(s)),i=$t(a,n),r=await this.getEncryptedMessage(i),p=new ft({startMaxLength:r.bytes.length+256});return p.storeIntBytes(this.authKeyId,64,"auth_key_id"),p.storeIntBytes(r.msgKey,128,"msg_key"),p.storeRawBytes(r.bytes,"encrypted_data"),p.getBytes(!0)}async sendEncryptedRequest(e){const t=this.log.bindPrefix("sendEncryptedRequest"),a=await this.getEncryptedOutput(e);this.transport||t.error("trying to send something when offline",this.transport,this),t.debug("sending",e,[e.msg_id].concat(e.inner||[]),a.length);const s=this.transport?this.transport.send(a):Promise.reject({});if(!(this.transport instanceof Nt))return s;const n={code:406,type:"NETWORK_BAD_RESPONSE",transport:this.transport};return s.then(i=>{if(!i?.byteLength)throw n;return i},i=>{throw!i.message&&!i.type&&(i=Object.assign(n,{type:"NETWORK_BAD_REQUEST",originalError:i})),i})}async onTransportData(e,t=Date.now()){const a=await this.parseResponse(e);this.processMessage(a.response,a.messageId,a.sessionId,t)}async parseResponse(e){this.lastResponseTime=Date.now();let t=new jt(e);const a=t.fetchIntBytes(64,!0,"auth_key_id");if(!Ze(a,this.authKeyId))throw new Error("[MT] Invalid server auth_key_id: "+Te(a));const s=t.fetchIntBytes(128,!0,"msg_key"),n=t.fetchRawBytes(e.byteLength-t.getOffset(),!0,"encrypted_data"),i=await this.getDecryptedMessage(s,n),r=await this.getMsgKey(i,!1);if(!Ze(s,r))throw this.log.warn("[MT] msg_keys",s,r),this.updateSession(),new Error("[MT] server msgKey mismatch, updating session");t=new jt(i,{mtproto:!0}),t.fetchIntBytes(64,!0,"salt");const p=t.fetchIntBytes(64,!0,"session_id"),d=t.fetchLong("message_id");if(!Ze(p,this.sessionId)&&(!this.prevSessionId||!Ze(p,this.prevSessionId)))throw this.log.warn("sessions",p,this.sessionId,this.prevSessionId,i),new Error("[MT] Invalid server session_id: "+Te(p));const f=t.fetchInt("seq_no"),c=i.byteLength,l=t.fetchInt("message_data[length]");let m=t.getOffset();if(l%4||l>c-m)throw new Error("[MT] Invalid body length: "+l);const u=t.fetchRawBytes(l,!0,"message_data");m=t.getOffset();const M=c-m;if(M<12||M>1024)throw new Error("[MT] Invalid padding length: "+M);return{response:this.parseResponseMessageBody(u),messageId:d,sessionId:p,seqNo:f}}parseResponseMessageBody(e){const t=new jt(e,{mtproto:!0,override:{mt_message:(a,s)=>{a.msg_id=t.fetchLong(s+"[msg_id]"),a.seqno=t.fetchInt(s+"[seqno]"),a.bytes=t.fetchInt(s+"[bytes]");const n=t.getOffset();try{a.body=t.fetchObject("Object",s+"[body]")}catch(i){this.log.error("parse error",i.message,i.stack),a.body={_:"parse_error",error:i}}t.getOffset()!==n+a.bytes&&t.setOffset(n+a.bytes)},mt_rpc_result:(a,s)=>{a.req_msg_id=t.fetchLong(s+"[req_msg_id]");const n=this.sentMessages[a.req_msg_id],i=n&&n.resultType||"Object";a.req_msg_id&&!n||(a.result=t.fetchObject(i,s+"[result]"))}}});return t.fetchObject("","INPUT")}applyServerSalt(e){const t=Jd(e);nt.set({["dc"+this.dcId+"_server_salt"]:Te(t)}),this.serverSalt=new Uint8Array(t)}clearNextReq(){const e=this.log.bindPrefix("clearNextReq").debug;if(!this.nextReq){e("nothing to clear");return}this.nextReqTimeout&&(e("clear"),clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0),this.nextReq=0}scheduleRequest(e){const t=this.log.bindPrefix("scheduleRequest").debug;this.transport instanceof Nt&&(this.offline&&this.checkConnection("forced schedule"),e||(e=0));const a=Date.now()+(e||0);if(this.nextReq&&(e===void 0||this.nextReq<=a)){t("already has nextReq",this.nextReq,a);return}t("delay",e);const s=()=>{if(n&&t("timeout delay",performance.now()-n),this.clearNextReq(),this.transport instanceof Nt&&this.offline){t("cancel scheduled");return}this.performScheduledRequest()};let n;e!==void 0?(n=performance.now(),this.nextReqTimeout&&(clearTimeout(this.nextReqTimeout),this.nextReqTimeout=0),this.nextReq=a,this.nextReqTimeout=we.setTimeout(s,e)):s()}ackMessage(e){this.pendingAcks.push(e);let t;this.transport instanceof Nt&&(t=3e4),this.scheduleRequest(t)}processResentReqMessage(e){const t=this.sentResendReq.get(e);t&&(t.resending.delete(e),t.resending.size||delete this.sentMessages[t.msg_id],this.sentResendReq.delete(e))}reqResend(e){this.log.debug("req resend",e),this.pendingResendReq.includes(e)||this.pendingResendReq.push(e),this.scheduleRequest(100)}cleanupSent(){const e=this.log.bindPrefix("cleanupSent",this.debug?ke.Log:ke.None);let t=!1;const a=this.sentMessages;return e.group("start"),Object.keys(a).forEach(s=>{const n=a[s];if(n.canCleanup&&this.pendingMessages[s]===void 0)e("clean canCleanup",s),delete a[s];else if(n.container){for(const i of n.inner)if(a[i]){e(`clean failed, found item=${i} in container=${s}`),t=!0;return}e("clean container",s),delete a[s]}else e("clean failed",s),t=!0}),e("end",t),e.groupEnd(),!t}processMessageAck(e){const t=this.sentMessages[e];t&&!t.acked&&(t.acked=!0)}processError(e){const t=(e.error_message||"").match(/^([A-Z_0-9]+\b)(: (.+))?/)||[];return e.error_code=e.error_code,{code:!e.error_code||e.error_code<=0?500:e.error_code,type:t[1]||"UNKNOWN",description:t[3]||"CODE#"+e.error_code+" "+e.error_message,originalError:e}}resend(){this.log.warn("resending all messages");const e=this.sentMessages;for(const t in e){const a=e[t];(a.body||a.container)&&this.pushResend(t)}this.transport.connection&&(this.clearPingDelayDisconnect(),this.sendPingDelayDisconnect())}applyServerTime(e){const t=$e(e).shiftRight(32).toJSNumber();return this.log("applying server time",t),this.timeManager.applyServerTime(t)}processMessage(e,t,a,s){const n=this.log.bindPrefix("processMessage");if(e._==="messageEmpty"){n.warn("messageEmpty",e,t);return}if(parseInt(t.substr(0,-10),10)%2){n.warn("server even message id",t,e);return}switch(n.debug("process message",e,t,s?Date.now()-s:void 0),this.pingDelayDisconnectDeferred?.resolve("any message"),e._){case"msg_container":{for(const r of e.messages)this.processMessage(r,r.msg_id,a);break}case"bad_server_salt":{n("bad server salt",e),this.applyServerSalt(e.new_server_salt),this.sentMessages[e.bad_msg_id]&&this.pushResend(e.bad_msg_id),this.ackMessage(t);break}case"bad_msg_notification":{switch(n.error("bad msg notification",e),e.error_code){case 16:case 17:case 32:case 33:case 64:{const r=this.applyServerTime(t);(e.error_code===17||r)&&(n("update session"),this.updateSession());const p=this.updateSentMessage(e.bad_msg_id);p&&this.pushResend(p.msg_id)}}break}case"message":{if(this.lastServerMessages.has(t)){n.warn("server same messageId",t,e),this.ackMessage(t);return}if(this.lastServerMessages.add(t),this.lastServerMessages.size>100){const r=this.lastServerMessages.values().next().value;this.lastServerMessages.delete(r)}this.processMessage(e.body,e.msg_id,a);break}case"new_session_created":{this.ackMessage(t),n.debug("new_session_created",e),this.processMessageAck(e.first_msg_id),this.applyServerSalt(e.server_salt),nt.get("dc").then(r=>{r===this.dcId&&!this.isFileNetworker&&this.networkerFactory.updatesProcessor?.(e)});break}case"msgs_ack":{n.debug("got acks",e.msg_ids);for(const r of e.msg_ids)this.processMessageAck(r);break}case"msg_detailed_info":if(!this.sentMessages[e.msg_id]){this.ackMessage(e.answer_msg_id);break}case"msg_new_detailed_info":{if(this.pendingAcks.includes(e.answer_msg_id))break;this.reqResend(e.answer_msg_id);break}case"msgs_state_info":{const r=e.req_msg_id,p=this.sentMessages[r];n("got msgs_state_info",p,e),p&&delete this.sentMessages[r];const d=[[this.lastResendReq,this.pendingResendReq]];for(const[f,c]of d)if(f?.reqMsgId===r&&c.length)for(const l of f.msgIds)Oe(c,l);break}case"rpc_result":{this.ackMessage(t);const r=e.req_msg_id,p=this.sentMessages[r];if(this.processMessageAck(r),p){const{deferred:d}=p,{result:f}=e;if(f._==="rpc_error"){const c=this.processError(f);n("rpc error",f,p,c),d?.reject(c)}else n("rpc result",f,p),d?.resolve(f),p.isAPI&&!this.connectionInited&&(this.connectionInited=!0);this.processResentReqMessage(t),delete this.sentMessages[r]}else n("rpc result for unknown message:",r,e);break}case"pong":{const r=e.ping_id;if(this.lastPingDelayDisconnectId===r){const p=this.pingDelayDisconnectDeferred;p?p.resolve("pong"):n("ping deferred deleted",r)}break}default:this.ackMessage(t),this.networkerFactory.updatesProcessor!==null&&this.networkerFactory.updatesProcessor(e);break}}}class ef extends ce{constructor(){super(...arguments),this.networkers=[],this.language=navigator.language||Ve.langPackCode,this.updatesProcessor=null,this.akStopped=!1}onConnectionStatusChange(e){this.rootScope.dispatchEvent("connection_status_change",e)}removeNetworker(e){Oe(this.networkers,e)}setUpdatesProcessor(e){this.updatesProcessor=e}getNetworker(e,t,a,s,n){const i=new Xd(this,this.timeManager,e,t,a,s,n);return this.networkers.push(i),i}startAll(){if(this.akStopped){const e=this.networkers.filter(t=>t.isStopped());this.akStopped=!1,this.updatesProcessor&&this.updatesProcessor({_:"new_session_created"});for(const t of e)t.scheduleRequest()}}stopAll(){this.akStopped=!0}setLanguage(e){this.language=e;for(const t of this.networkers)t.isFileNetworker||(t.connectionInited=!1)}unsetConnectionInited(){for(const e of this.networkers)e.connectionInited=!1}forceReconnectTimeout(){for(const e of this.networkers)e.forceReconnectTimeout()}forceReconnect(){for(const e of this.networkers)if(!e.isFileNetworker){e.forceReconnect();break}}}class tf{constructor(){this.testPublicKeysHex=[{modulus:"c8c11d635691fac091dd9489aedced2932aa8a0bcefef05fa800892d9b52ed03200865c9e97211cb2ee6c7ae96d3fb0e15aeffd66019b44a08a240cfdd2868a85e1f54d6fa5deaa041f6941ddf302690d61dc476385c2fa655142353cb4e4b59f6e5b6584db76fe8b1370263246c010c93d011014113ebdf987d093f9d37c2be48352d69a1683f8f6e6c2167983c761e3ab169fde5daaa12123fa1beab621e4da5935e9c198f82f35eae583a99386d8110ea6bd1abb0f568759f62694419ea5f69847c43462abef858b4cb5edc84e7b9226cd7bd7e183aa974a712c079dde85b9dc063b8a5c08e8f859c0ee5dcd824c7807f20153361a7f63cfd2a433a1be7f5",exponent:"010001"}],this.publisKeysHex=[{modulus:"e8bb3305c0b52c6cf2afdf7637313489e63e05268e5badb601af417786472e5f93b85438968e20e6729a301c0afc121bf7151f834436f7fda680847a66bf64accec78ee21c0b316f0edafe2f41908da7bd1f4a5107638eeb67040ace472a14f90d9f7c2b7def99688ba3073adb5750bb02964902a359fe745d8170e36876d4fd8a5d41b2a76cbff9a13267eb9580b2d06d10357448d20d9da2191cb5d8c93982961cdfdeda629e37f1fb09a0722027696032fe61ed663db7a37f6f263d370f69db53a0dc0a1748bdaaff6209d5645485e6e001d1953255757e4b8e42813347b11da6ab500fd0ace7e6dfa3736199ccaf9397ed0745a427dcfa6cd67bcb1acff3",exponent:"010001"}],this.publicKeysParsed={},this.prepared=!1,this.preparePromise=null,Ae.test&&(this.publisKeysHex=this.testPublicKeysHex)}prepare(){return this.preparePromise?this.preparePromise:this.prepared?Promise.resolve():this.preparePromise=Promise.all(this.publisKeysHex.map(e=>{const t=new ft;t.storeBytes(sa(e.modulus),"n"),t.storeBytes(sa(e.exponent),"e");const a=t.getBuffer();return _e.invokeCrypto("sha1",a).then(s=>{const n=s.slice(-8);n.reverse(),this.publicKeysParsed[Te(n).toLowerCase()]={modulus:e.modulus,exponent:e.exponent}})})).then(()=>{this.prepared=!0,this.preparePromise=null})}async select(e){await this.prepare();for(let t=0;t<e.length;++t){let a=$e(e[t]).toString(16).toLowerCase();a.length<16&&(a=new Array(16-a.length).fill("0").join("")+a);const s=this.publicKeysParsed[a];if(s)return Object.assign({fingerprint:e[t]},s)}}}var Tn=new tf;function Rn(o,e){const t=o.length,a=new Uint8Array(t);for(let s=0;s<t;++s)a[s]=o[s]^e[s];return a}class af extends ce{constructor(){super(...arguments),this.getTransportType=()=>{if(Ae.multipleTransports)return this.getTransportTypePromise?this.getTransportTypePromise:this.getTransportTypePromise=ma.pingTransports().then(({websocket:e})=>{this.transportType=e?"websocket":"https",this.log("will use transport:",this.transportType)})}}after(){this.cached={},this.log=We("AUTHORIZER",ke.Error|ke.Log)}sendPlainRequest(e,t){const a=t.byteLength,s=new ft;s.storeLongP(0,0,"auth_key_id"),s.storeLong(this.timeManager.generateId(),"msg_id"),s.storeInt(a,"request_length");const n=s.getBytes(!0),i=new Uint8Array(n.byteLength+a);i.set(n),i.set(t,n.length);const r=this.dcConfigurator.chooseServer(e,"client",this.transportType),p={code:406,type:"NETWORK_BAD_RESPONSE"};return qe&&this.log("mtpSendPlainRequest: creating requestPromise"),r.send(i).then(f=>{if(qe&&this.log("mtpSendPlainRequest: in good sector",f),!f||!f.byteLength)throw p;try{const c=new jt(f,{mtproto:!0});if(f.length===4){const M=c.fetchInt();throw this.log.error("mtpSendPlainRequest: wrong response, error code:",M),M}const l=c.fetchLong("auth_key_id");l!=="0"&&this.log.error("auth_key_id !== 0",l);const m=c.fetchLong("msg_id");m==="0"&&this.log.error("msg_id === 0",m);const u=c.fetchInt("msg_len");return u||this.log.error("no msg_len",u),c}catch(c){throw this.log.error("mtpSendPlainRequest: deserialization went bad",c),Object.assign(p,{originalError:c})}},f=>{throw!f.message&&!f.type&&(f=Object.assign(p,{originalError:f})),f})}async sendReqPQ(e){const t=new ft({mtproto:!0});t.storeMethod("req_pq_multi",{nonce:e.nonce}),qe&&this.log("Send req_pq",Te(e.nonce));let a;try{const r=this.sendPlainRequest(e.dcId,t.getBytes(!0));Tn.prepare(),a=await r}catch(r){throw this.log.error("req_pq error",r.message),r}const s=a.fetchObject("ResPQ");if(s._!=="resPQ")throw new Error("[MT] resPQ response invalid: "+s._);if(!Ze(e.nonce,s.nonce))throw this.log.error(e.nonce,s.nonce),new Error("[MT] resPQ nonce mismatch");e.serverNonce=s.server_nonce,e.pq=s.pq,e.fingerprints=s.server_public_key_fingerprints,qe&&this.log("Got ResPQ",Te(e.serverNonce),Te(e.pq),e.fingerprints);const n=await Tn.select(e.fingerprints);if(!n)throw new Error("[MT] No public key found");e.publicKey=n,qe&&this.log("PQ factorization start",e.pq);try{var i=await _e.invokeCrypto("factorize",e.pq)}catch(r){throw this.log.error("worker error factorize",r),r}return e.p=i[0],e.q=i[1],qe&&this.log("PQ factorization done",i),this.sendReqDhParams(e)}async sendReqDhParams(e){e.newNonce=Tt(new Uint8Array(32));const t={_:"p_q_inner_data_dc",pq:e.pq,p:e.p,q:e.q,nonce:e.nonce,server_nonce:e.serverNonce,new_nonce:e.newNonce,dc:0},a=new ft({mtproto:!0});a.storeObject(t,"P_Q_inner_data","DECRYPTED_DATA");const s=a.getBytes(!0);if(s.length>144)throw"DH_params: data is more than 144 bytes!";const n=qs(s,192,!1,!0,!1),i=n.slice().reverse(),p=await(async()=>{for(;;){const M=Tt(new Uint8Array(32)),A=i.concat(await _e.invokeCrypto("sha256",M.concat(n)));if(A.length!==224)throw"DH_params: dataWithHash !== 224 bytes!";const w=await _e.invokeCrypto("aes-encrypt",A,M,new Uint8Array([0])),I=Rn(M,await _e.invokeCrypto("sha256",w)).concat(w),F=Ls(I),L=$e(e.publicKey.modulus,16);if(F.compare(L)===-1)return I}})(),d=qs(await _e.invokeCrypto("rsa-encrypt",p,e.publicKey),256,!0,!0,!0),f={nonce:e.nonce,server_nonce:e.serverNonce,p:e.p,q:e.q,public_key_fingerprint:e.publicKey.fingerprint,encrypted_data:d},c=new ft({mtproto:!0});c.storeMethod("req_DH_params",f);const l=c.getBytes(!0);qe&&this.log("Send req_DH_params",f);let m;try{m=await this.sendPlainRequest(e.dcId,l)}catch(M){throw this.log.error("Send req_DH_params FAIL!",M),M}const u=m.fetchObject("Server_DH_Params","RESPONSE");if(qe&&this.log("Sent req_DH_params, response:",u),u._!=="server_DH_params_fail"&&u._!=="server_DH_params_ok")throw new Error("[MT] Server_DH_Params response invalid: "+u._);if(!Ze(e.nonce,u.nonce))throw new Error("[MT] Server_DH_Params nonce mismatch");if(!Ze(e.serverNonce,u.server_nonce))throw new Error("[MT] Server_DH_Params server_nonce mismatch");if(u._==="server_DH_params_fail"){const M=(await _e.invokeCrypto("sha1",e.newNonce)).slice(-16);throw Ze(M,u.new_nonce_hash)?new Error("[MT] server_DH_params_fail"):new Error("[MT] server_DH_params_fail new_nonce_hash mismatch")}try{await this.decryptServerDhDataAnswer(e,u.encrypted_answer)}catch(M){throw this.log.error("mtpDecryptServerDhDataAnswer FAILED!",M),M}return this.sendSetClientDhParams(e)}async decryptServerDhDataAnswer(e,t){e.localTime=Date.now(),e.tmpAesKey=(await _e.invokeCrypto("sha1",e.newNonce.concat(e.serverNonce))).concat((await _e.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(0,12)),e.tmpAesIv=(await _e.invokeCrypto("sha1",e.serverNonce.concat(e.newNonce))).slice(12).concat(await _e.invokeCrypto("sha1",e.newNonce.concat(e.newNonce)),e.newNonce.slice(0,4));const a=new Uint8Array(await _e.invokeCrypto("aes-decrypt",t,e.tmpAesKey,e.tmpAesIv)),s=a.slice(0,20),n=a.slice(20),i=new jt(n,{mtproto:!0}),r=i.fetchObject("Server_DH_inner_data");if(r._!=="server_DH_inner_data")throw new Error("[MT] server_DH_inner_data response invalid: "+r);if(!Ze(e.nonce,r.nonce))throw new Error("[MT] server_DH_inner_data nonce mismatch");if(!Ze(e.serverNonce,r.server_nonce))throw new Error("[MT] server_DH_inner_data serverNonce mismatch");qe&&this.log("Done decrypting answer"),e.g=r.g,e.dhPrime=r.dh_prime,e.gA=r.g_a,e.serverTime=r.server_time,e.retry=0,this.verifyDhParams(e.g,e.dhPrime,e.gA);const p=i.getOffset();if(!Ze(s,await _e.invokeCrypto("sha1",n.slice(0,p))))throw new Error("[MT] server_DH_inner_data SHA1 mismatch");this.timeManager.applyServerTime(e.serverTime,e.localTime)}verifyDhParams(e,t,a){qe&&this.log("Verifying DH params",e,t,a);const s=Te(t);if(e!==3||s!=="c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b")throw new Error("[MT] DH params are not verified: unknown dhPrime");qe&&this.log("dhPrime cmp OK");const n=Ls(a),i=$e(s,16);if(n.compare($e.one)<=0)throw new Error("[MT] DH params are not verified: gA <= 1");if(n.compare(i.subtract($e.one))>=0)throw new Error("[MT] DH params are not verified: gA >= dhPrime - 1");qe&&this.log("1 < gA < dhPrime-1 OK");const r=$e(2).pow(1984);if(n.compare(r)<0)throw new Error("[MT] DH params are not verified: gA < 2^{2048-64}");if(n.compare(i.subtract(r))>=0)throw new Error("[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}");return qe&&this.log("2^{2048-64} < gA < dhPrime-2^{2048-64} OK"),!0}async sendSetClientDhParams(e){const t=sa(e.g.toString(16));e.b=Tt(new Uint8Array(256));try{var a=await _e.invokeCrypto("mod-pow",t,e.b,e.dhPrime)}catch(u){throw u}const s=new ft({mtproto:!0});s.storeObject({_:"client_DH_inner_data",nonce:e.nonce,server_nonce:e.serverNonce,retry_id:[0,e.retry++],g_b:a},"Client_DH_Inner_Data");const n=(await _e.invokeCrypto("sha1",s.getBuffer())).concat(s.getBytes(!0)),i=await _e.invokeCrypto("aes-encrypt",n,e.tmpAesKey,e.tmpAesIv),r=new ft({mtproto:!0});r.storeMethod("set_client_DH_params",{nonce:e.nonce,server_nonce:e.serverNonce,encrypted_data:i}),qe&&this.log("Send set_client_DH_params");let p;try{p=await this.sendPlainRequest(e.dcId,r.getBytes(!0))}catch(u){throw u}const d=p.fetchObject("Set_client_DH_params_answer");if(d._!=="dh_gen_ok"&&d._!=="dh_gen_retry"&&d._!=="dh_gen_fail")throw new Error("[MT] Set_client_DH_params_answer response invalid: "+d._);if(!Ze(e.nonce,d.nonce))throw new Error("[MT] Set_client_DH_params_answer nonce mismatch");if(!Ze(e.serverNonce,d.server_nonce))throw new Error("[MT] Set_client_DH_params_answer server_nonce mismatch");try{var f=await _e.invokeCrypto("mod-pow",e.gA,e.b,e.dhPrime)}catch{throw f}const c=await _e.invokeCrypto("sha1",f),l=c.slice(0,8),m=c.slice(-8);switch(qe&&this.log("Got Set_client_DH_params_answer",d._,f),d._){case"dh_gen_ok":{const u=(await _e.invokeCrypto("sha1",e.newNonce.concat([1],l))).slice(-16);if(!Ze(u,d.new_nonce_hash1))throw this.log.error("Set_client_DH_params_answer new_nonce_hash1 mismatch",u,d),new Error("new_nonce_hash1 mismatch");const M=Rn(e.newNonce.slice(0,8),e.serverNonce.slice(0,8));return qe&&this.log("Auth successfull!",m,f,M),e.authKeyId=m,e.authKey=f,e.serverSalt=M,e}case"dh_gen_retry":{const u=(await _e.invokeCrypto("sha1",e.newNonce.concat([2],l))).slice(-16);if(!Ze(u,d.new_nonce_hash2))throw new Error("[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch");return this.sendSetClientDhParams(e)}case"dh_gen_fail":{const u=(await _e.invokeCrypto("sha1",e.newNonce.concat([3],l))).slice(-16);throw Ze(u,d.new_nonce_hash3)?new Error("[MT] Set_client_DH_params_answer fail"):new Error("[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch")}}}auth(e){let t=this.cached[e];return t||(t=new Promise(async(a,s)=>{await this.getTransportType();let n,i=1;for(;i++<=3;)try{const r={dcId:e,nonce:Tt(new Uint8Array(16))},p=this.sendReqPQ(r);a(await p);return}catch(r){n=r}s(n)}),this.cached[e]=t)}}class sf extends ce{after(){this.lastMessageId=[0,0],this.timeOffset=0,nt.get("server_time_offset").then(e=>{e&&(this.timeOffset=e)})}getServerTimeOffset(){return this.timeOffset}generateId(){const e=Date.now(),t=Math.floor(e/1e3)+this.timeOffset,a=e%1e3,s=ha(16);let n=[t,a<<21|s<<3|4];return(this.lastMessageId[0]>n[0]||this.lastMessageId[0]===n[0]&&this.lastMessageId[1]>=n[1])&&(n=[this.lastMessageId[0],this.lastMessageId[1]+4]),this.lastMessageId=n,Ni(n[0],n[1]).toString(10)}applyServerTime(e,t){t=(t||Date.now())/1e3|0;const a=e-t,s=Math.abs(this.timeOffset-a)>10;return this.lastMessageId=[0,0],this.timeOffset!==a&&(nt.set({server_time_offset:a}),this.timeOffset=a),s}}class nf{saveWebDocument(e){if(!e)return;const t=e.attributes.find(a=>a._==="documentAttributeImageSize");return t&&(e.w=t.w,e.h=t.h),e}}class rf extends ce{constructor(){super(...arguments),this.saveStarsStatus=e=>(this.appPeersManager.saveApiPeers(e),e.history.forEach(t=>{const a=t.peer,s=a&&this.appPeersManager.getPeerId(a.peer);t.msg_id&&(t.msg_id=this.appMessagesIdsManager.generateMessageId(t.msg_id,this.appPeersManager.isChannel(s)?s.toChatId():void 0)),t.extended_media&&t.extended_media.forEach(n=>{this.appMessagesManager.saveMessageMedia({media:n},{type:"starsTransaction",peerId:s,mid:t.msg_id})})}),e),this.processPaymentResult=e=>(e._==="payments.paymentResult"&&this.apiUpdatesManager.processUpdateMessage(e.updates),e),this.onUpdateStarsBalance=e=>{const{starsStatus:t}=this;!t||t instanceof Promise||(t.balance=e.balance,this.rootScope.dispatchEvent("stars_balance",e.balance))}}after(){this.rootScope.addEventListener("premium_toggle",()=>{this.getPremiumPromo(!0)}),this.apiUpdatesManager.addMultipleEventsListeners({updateStarsBalance:this.onUpdateStarsBalance})}getInputInvoiceBySlug(e){return{_:"inputInvoiceSlug",slug:e}}getInputInvoiceByPeerId(e,t){return{_:"inputInvoiceMessage",peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}}getPaymentForm(e){return this.apiManager.invokeApi("payments.getPaymentForm",{invoice:e,theme_params:this.apiManager.getThemeParams()}).then(t=>(this.appPeersManager.saveApiPeers(t),t.photo=this.appWebDocsManager.saveWebDocument(t.photo),t))}getPaymentReceipt(e,t){return this.apiManager.invokeApi("payments.getPaymentReceipt",{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}).then(a=>(this.appPeersManager.saveApiPeers(a),a.photo=this.appWebDocsManager.saveWebDocument(a.photo),a))}validateRequestedInfo(e,t,a){return this.apiManager.invokeApi("payments.validateRequestedInfo",{save:a,invoice:e,info:t})}sendPaymentForm(e,t,a,s,n,i){return this.apiManager.invokeApi("payments.sendPaymentForm",{form_id:t,invoice:e,requested_info_id:a,shipping_option_id:s,credentials:n,tip_amount:i||void 0}).then(this.processPaymentResult)}clearSavedInfo(e,t){return this.apiManager.invokeApi("payments.clearSavedInfo",{info:e,credentials:t})}getPremiumGiftCodeOptions(e){return this.apiManager.invokeApiSingleProcess({method:"payments.getPremiumGiftCodeOptions",params:{boost_peer:this.appPeersManager.getInputPeerById(e)},processResult:t=>t})}getPremiumPromo(e){return e&&this.premiumPromo&&(this.premiumPromo=void 0),this.premiumPromo??(this.premiumPromo=this.apiManager.invokeApiSingleProcess({method:"help.getPremiumPromo",params:{},processResult:t=>(this.appPeersManager.saveApiPeers(t),t.videos=t.videos.map(a=>this.appDocsManager.saveDoc(a,{type:"premiumPromo"})),this.premiumPromo=t)}))}checkGiftCode(e){return this.apiManager.invokeApiSingleProcess({method:"payments.checkGiftCode",params:{slug:e},processResult:t=>{if(this.appPeersManager.saveApiPeers(t),t.slug=e,t.giveaway_msg_id){const a=t.from_id&&this.appPeersManager.getPeerId(t.from_id);t.giveaway_msg_id=this.appMessagesIdsManager.generateMessageId(t.giveaway_msg_id,!a||a.isUser()?void 0:a.toChatId())}return t}})}applyGiftCode(e){return this.apiManager.invokeApiSingleProcess({method:"payments.applyGiftCode",params:{slug:e},processResult:t=>{this.apiUpdatesManager.processUpdateMessage(t)}})}getGiveawayInfo(e,t){return this.apiManager.invokeApiSingleProcess({method:"payments.getGiveawayInfo",params:{peer:this.appPeersManager.getInputPeerById(e),msg_id:ae(t)}})}launchPrepaidGiveaway(e,t,a){return this.apiManager.invokeApiSingleProcess({method:"payments.launchPrepaidGiveaway",params:{peer:this.appPeersManager.getInputPeerById(e),giveaway_id:t,purpose:a},processResult:s=>{this.apiUpdatesManager.processUpdateMessage(s)}})}getStarsTopupOptions(){return this.apiManager.invokeApi("payments.getStarsTopupOptions")}getStarsStatus(e){return e&&(this.starsStatus=void 0),this.starsStatus??(this.starsStatus=this.apiManager.invokeApiSingleProcess({method:"payments.getStarsStatus",params:{peer:this.appPeersManager.getInputPeerById(this.rootScope.myId)},processResult:t=>this.starsStatus=this.saveStarsStatus(t)}))}getStarsTransactions(e="",t){return this.apiManager.invokeApiSingleProcess({method:"payments.getStarsTransactions",params:{peer:this.appPeersManager.getInputPeerById(this.rootScope.myId),offset:e,inbound:t,outbound:t===!1,limit:30},processResult:this.saveStarsStatus})}sendStarsForm(e,t){return this.apiManager.invokeApi("payments.sendStarsForm",{form_id:t,invoice:e}).then(this.processPaymentResult)}}function of(o){if(o)return o.icons.find(e=>e.name===sr)}const pf=!0;class df extends ce{constructor(){super(...arguments),this.clear=(e=!1)=>{e?this.attachMenuBots=new Map:(this.attachMenuBots.clear(),this.attachMenuBotsArr=void 0)},this.onUpdateAttachMenuBots=e=>{this.clear(),this.getAttachMenuBots()},this.onUpdateWebViewResultSent=e=>{this.rootScope.dispatchEvent("web_view_result_sent",e.query_id)}}after(){this.clear(!0),this.apiUpdatesManager.addMultipleEventsListeners({updateAttachMenuBots:this.onUpdateAttachMenuBots,updateWebViewResultSent:this.onUpdateWebViewResultSent}),this.rootScope.addEventListener("user_auth",()=>{this.appAttachMenuBotsManager.getAttachMenuBots(),setInterval(()=>{this.onUpdateAttachMenuBots({_:"updateAttachMenuBots"})},30*6e4)})}onLanguageChange(){this.attachMenuBots?.size&&this.onUpdateAttachMenuBots({_:"updateAttachMenuBots"})}saveAttachMenuBot(e){this.attachMenuBots.set(e.bot_id,e);const t=of(e);return t&&(t.icon=this.appDocsManager.saveDoc(t.icon,{type:"attachMenuBotIcon",botId:e.bot_id}),this.apiFileManager.downloadMedia({media:t.icon})),this.rootScope.dispatchEvent("attach_menu_bot",e),e}saveAttachMenuBots(e){e.saved||(e.saved=!0,e.forEach(t=>this.saveAttachMenuBot(t)))}saveBotApp(e,t){if(!t)return;const a={type:"botApp",botId:e,appName:t.short_name};return t.photo=this.appPhotosManager.savePhoto(t.photo,a),t.document=this.appDocsManager.saveDoc(t.document,a),t}getAttachMenuBots(){return this.attachMenuBotsArr??this.apiManager.invokeApiSingleProcess({method:"messages.getAttachMenuBots",processResult:e=>(this.appUsersManager.saveApiUsers(e.users),this.saveAttachMenuBots(e.bots),this.attachMenuBotsArr=e.bots.slice(0,void 0))})}getAttachMenuBotCached(e){return this.attachMenuBots.get(e)}getAttachMenuBot(e,t){if(!this.appUsersManager.isAttachMenuBot(e)||!pf)throw Ee("BOT_INVALID");return(!t&&this.getAttachMenuBotCached(e))??this.apiManager.invokeApiSingleProcess({method:"messages.getAttachMenuBot",params:{bot:this.appUsersManager.getUserInput(e)},processResult:a=>(this.appUsersManager.saveApiUsers(a.users),this.saveAttachMenuBot(a.bot))})}requestWebView(e){const{botId:t,peerId:a,url:s,fromBotMenu:n,fromSwitchWebView:i,fromSideMenu:r,themeParams:p=this.apiManager.getThemeParams(),silent:d,sendAsPeerId:f,startParam:c,isSimpleWebView:l,app:m,writeAllowed:u}=e,M="web";return m?this.apiManager.invokeApiSingleProcess({method:"messages.requestAppWebView",params:{peer:this.appPeersManager.getInputPeerById(a),start_param:c,theme_params:p,platform:M,write_allowed:u,app:{_:"inputBotAppID",access_hash:m.access_hash,id:m.id}}}):l?this.apiManager.invokeApiSingleProcess({method:"messages.requestSimpleWebView",params:{bot:this.appUsersManager.getUserInput(t),url:s,platform:M,from_switch_webview:i,from_side_menu:r,theme_params:p,start_param:c}}):this.apiManager.invokeApiSingleProcess({method:"messages.requestWebView",params:{peer:this.appPeersManager.getInputPeerById(a),bot:this.appUsersManager.getUserInput(t),silent:d,platform:M,url:s,reply_to:this.appMessagesManager.getInputReplyTo(e),from_bot_menu:n,theme_params:p,send_as:f?this.appPeersManager.getInputPeerById(f):void 0,start_param:c}})}prolongWebView(e){return this.apiManager.invokeApiSingleProcess({method:"messages.prolongWebView",params:{peer:this.appPeersManager.getInputPeerById(e.peerId),bot:this.appUsersManager.getUserInput(e.botId),query_id:e.queryId,silent:e.silent,reply_to:this.appMessagesManager.getInputReplyTo(e),send_as:e.sendAsPeerId?this.appPeersManager.getInputPeerById(e.sendAsPeerId):void 0}})}toggleBotInAttachMenu(e,t,a){return this.apiManager.invokeApiSingleProcess({method:"messages.toggleBotInAttachMenu",params:{bot:this.appUsersManager.getUserInput(e),enabled:t,write_allowed:a}})}sendWebViewData(e,t,a){return this.apiManager.invokeApi("messages.sendWebViewData",{bot:this.appUsersManager.getUserInput(e),button_text:t,data:a,random_id:qt()}).then(s=>{this.apiUpdatesManager.processUpdateMessage(s)})}getBotApp(e,t){return this.apiManager.invokeApiSingleProcess({method:"messages.getBotApp",params:{app:{_:"inputBotAppShortName",bot_id:this.appUsersManager.getUserInput(e),short_name:t},hash:0},processResult:a=>(a.app=this.saveBotApp(e,a.app),a)})}invokeWebViewCustomMethod(e,t,a){return this.apiManager.invokeApi("bots.invokeWebViewCustomMethod",{bot:this.appUsersManager.getUserInput(e),custom_method:t,params:{_:"dataJSON",data:JSON.stringify(a)}})}}class ff extends ce{requestUrlAuth(e,t,a,s){return this.apiManager.invokeApi("messages.requestUrlAuth",{button_id:s,msg_id:a?ae(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e}).then(n=>(n._==="urlAuthResultRequest"&&this.appUsersManager.saveApiUser(n.bot),n))}acceptUrlAuth(e,t,a,s,n){return this.apiManager.invokeApi("messages.acceptUrlAuth",{button_id:s,msg_id:a?ae(a):void 0,peer:t?this.appPeersManager.getInputPeerById(t):void 0,url:e,write_allowed:n}).then(i=>i)}getWebAuthorizations(){return this.apiManager.invokeApi("account.getWebAuthorizations").then(e=>(this.appUsersManager.saveApiUsers(e.users),e.authorizations))}resetWebAuthorization(e){return this.apiManager.invokeApi("account.resetWebAuthorization",{hash:e})}resetWebAuthorizations(){return this.apiManager.invokeApi("account.resetWebAuthorizations")}}class cf extends ce{after(){return this.wallPapers={},this.wallPapersBySlug={},this.rootScope.addEventListener("user_auth",()=>{this.getThemes()}),this.appStateManager.getState().then(e=>{try{this.saveAccountThemes(e.accountThemes)}catch{}})}saveWallPaper(e){if(!e)return e;let t;return e._!=="wallPaperNoFile"&&(t=e.slug,e.document=this.appDocsManager.saveDoc(e.document,{type:"wallPaper",wallPaperId:e.id})),this.wallPapers[e.id]=e,t&&(this.wallPapersBySlug[t]=e),e}getWallPaper(e){return this.apiManager.invokeApiSingleProcess({method:"account.getWallPaper",params:{wallpaper:e},processResult:t=>this.saveWallPaper(t)})}getInputWallPaper(e){return typeof e=="string"?{_:"inputWallPaperSlug",slug:e}:e._==="wallPaperNoFile"?{_:"inputWallPaperNoFile",id:e.id}:{_:"inputWallPaper",id:e.id,access_hash:e.access_hash}}getWallPaperById(e){const t=this.wallPapers[e];return this.getWallPaper(this.getInputWallPaper(t))}getWallPaperBySlug(e){const t=this.wallPapersBySlug[e];return t||this.getWallPaper(this.getInputWallPaper(e))}saveAccountThemes(e){e.themes?.forEach(t=>{t.settings&&t.settings.forEach(a=>{a.wallpaper=this.saveWallPaper(a.wallpaper)})})}async getThemes(){const t=(await this.appStateManager.getState()).accountThemes;return this.apiManager.invokeApiSingleProcess({method:"account.getThemes",params:{format:"macos",hash:t?.hash??0},processResult:async a=>a._==="account.themesNotModified"?t.themes:(this.saveAccountThemes(a),await this.appStateManager.pushToState("accountThemes",a),a.themes)})}getWallPapers(){return this.apiManager.invokeApiHashable({method:"account.getWallPapers"}).then(e=>{const t=e.wallpapers;return t.forEach((a,s,n)=>{n[s]=this.saveWallPaper(a)}),t})}}class lf extends ce{toggleUsername({username:e,active:t,peerId:a}){if(!a||a===this.appUsersManager.userId)return this.apiManager.invokeApi("account.toggleUsername",{username:e,active:t});if(a.isAnyChat()){const s=a.toChatId(),n=this.apiManager.invokeApi("channels.toggleUsername",{channel:this.appChatsManager.getChannelInput(s),username:e,active:t});return this.appChatsManager.refreshChatAfterRequest(s,n)}else return this.apiManager.invokeApi("bots.toggleUsername",{bot:this.appUsersManager.getUserInput(a),username:e,active:t})}reorderUsernames({peerId:e,order:t}){if(e)if(e.isAnyChat()){const a=e.toChatId(),s=this.apiManager.invokeApi("channels.reorderUsernames",{channel:this.appChatsManager.getChannelInput(a),order:t});return this.appChatsManager.refreshChatAfterRequest(a,s)}else return this.apiManager.invokeApi("bots.reorderUsernames",{bot:this.appUsersManager.getUserInput(e),order:t});else return this.apiManager.invokeApi("account.reorderUsernames",{order:t})}}class gf extends ce{after(){this.apiUpdatesManager.addMultipleEventsListeners({updatePendingJoinRequests:async e=>{const t=He(e.peer),a=await this.appStateManager.getState();delete a.hideChatJoinRequests[t],this.appStateManager.pushToState("hideChatJoinRequests",a.hideChatJoinRequests),this.rootScope.dispatchEvent("chat_requests",{chatId:t.toChatId(),recentRequesters:e.recent_requesters,requestsPending:e.requests_pending})}})}saveChatInvite(e,t){if(t)return t.chat&&this.appChatsManager.saveApiChat(t.chat,!0),t.photo&&(t.photo=this.appPhotosManager.savePhoto(t.photo,{type:"chatInvite",hash:e})),t}exportChatInvite({chatId:e,expireDate:t,usageLimit:a,requestNeeded:s,title:n}){return this.apiManager.invokeApi("messages.exportChatInvite",{peer:this.appChatsManager.getInputPeer(e),expire_date:t,usage_limit:a,request_needed:s,title:n})}checkChatInvite(e){return this.apiManager.invokeApi("messages.checkChatInvite",{hash:e}).then(t=>this.appChatInvitesManager.saveChatInvite(e,t))}importChatInvite(e){return this.apiManager.invokeApi("messages.importChatInvite",{hash:e}).then(t=>(this.apiUpdatesManager.processUpdateMessage(t),t.chats[0].id))}getExportedChatInvites({chatId:e,revoked:t,adminId:a}){return this.apiManager.invokeApi("messages.getExportedChatInvites",{peer:this.appChatsManager.getInputPeer(e),admin_id:a?this.appUsersManager.getUserInput(a):{_:"inputUserSelf"},limit:50,revoked:t}).then(s=>(this.appUsersManager.saveApiUsers(s.users),s))}editExportedChatInvite({chatId:e,link:t,expireDate:a,usageLimit:s,requestNeeded:n,title:i,revoked:r}){return this.apiManager.invokeApi("messages.editExportedChatInvite",{peer:this.appChatsManager.getInputPeer(e),revoked:r,link:t,expire_date:a,usage_limit:s,request_needed:n,title:i}).then(p=>(this.appUsersManager.saveApiUsers(p.users),p))}deleteRevokedExportedChatInvites(e,t){return this.apiManager.invokeApi("messages.deleteRevokedExportedChatInvites",{peer:this.appChatsManager.getInputPeer(e),admin_id:this.appUsersManager.getUserInput(t)})}deleteExportedChatInvite(e,t){return this.apiManager.invokeApi("messages.deleteExportedChatInvite",{peer:this.appChatsManager.getInputPeer(e),link:t})}getAdminsWithInvites(e){return this.apiManager.invokeApi("messages.getAdminsWithInvites",{peer:this.appChatsManager.getInputPeer(e)}).then(t=>(this.appUsersManager.saveApiUsers(t.users),t))}getChatInviteImporters({chatId:e,limit:t=50,offsetDate:a=0,offsetUserId:s,link:n,q:i,requested:r}){const p=s?this.appUsersManager.getUserInput(s):{_:"inputUserEmpty"};return this.apiManager.invokeApi("messages.getChatInviteImporters",{peer:this.appChatsManager.getInputPeer(e),limit:t,offset_date:a,offset_user:p,link:n,q:i,requested:r}).then(d=>(this.appUsersManager.saveApiUsers(d.users),d))}}var vt=(o=>(o.Stories="stories",o.Pinned="pinnedStories",o.Archive="archiveStories",o))(vt||{});function ws(o,e,t,a,s){const n=e.id;return a===vt.Pinned?Bt(o,n,i=>{const r=i,p=s.get(r);return p!==void 0?4294967295-p:r}):a===vt.Archive?Bt(o,n,i=>i):Bt(o,n,i=>4294967295-i)}class mf extends ce{constructor(){super(...arguments),this.clear=e=>{this.cache={},this.lists={stories:[],archive:[]},this.expiring=[]},this.setChangelogPeerIdFromAppConfig=e=>{const t=e.stories_changelog_user_id;return this.changelogPeerId=t?t.toPeerId(!1):As},this.onUpdateStory=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=this.getPeerStoriesCache(t);let{story:s}=e;if(s._==="storyItemDeleted"){this.handleDeletedStory(a,s.id);return}if(a.maxReadId===void 0){Promise.resolve(this.getPeerStories(t)).then(r=>{this.rootScope.dispatchEvent("stories_stories",r)});return}const n=this.isStoryExpired(s)?void 0:this.getCacheTypeForPeerId(t),i=a.storiesMap.has(s.id);s=this.saveStoryItems([e.story],a,n)[0],!i&&n&&this.rootScope.dispatchEvent("story_new",{peerId:t,story:s,cacheType:n,maxReadId:a.maxReadId})},this.onUpdateReadStories=e=>{const t=this.appPeersManager.getPeerId(e.peer),a=this.getPeerStoriesCache(t);a.maxReadId=e.max_id,this.updateListCachePosition(a),this.rootScope.dispatchEvent("stories_read",{peerId:t,maxReadId:a.maxReadId})}}after(){this.clear(!0),this.changelogPeerId=As,this.apiUpdatesManager.addMultipleEventsListeners({updateStory:this.onUpdateStory,updateReadStories:this.onUpdateReadStories}),this.rootScope.addEventListener("app_config",this.setChangelogPeerIdFromAppConfig),this.rootScope.addEventListener("contacts_update",e=>{this.onSubscriptionUpdate(e.toPeerId(!1))}),this.rootScope.addEventListener("chat_participation",({chatId:e})=>{this.onSubscriptionUpdate(e.toPeerId(!0))}),this.rootScope.addEventListener("peer_stories_hidden",({peerId:e})=>{const t=this.getPeerStoriesCache(e,!1);t&&(this.updateListCachePosition(t),this.rootScope.dispatchEvent("stories_stories",this.convertPeerStoriesCache(t)))}),this.rootScope.addEventListener("user_auth",()=>{setTimeout(()=>{this.getAllStories(!1,void 0,!0)},2e3)}),setInterval(()=>this.checkExpired(),5e3)}onSubscriptionUpdate(e){const t=this.getPeer(e);if(!t)return;const a=this.getPeerStoriesCache(e,!1);if(!a){const n=this.isSubcribedToPeer(e),i=t.stories_max_id!==void 0;n&&i&&Promise.resolve(this.getPeerStories(e)).then(r=>{this.rootScope.dispatchEvent("stories_stories",r)});return}const s=a.position;this.updateListCachePosition(a),!s&&a.position&&this.rootScope.dispatchEvent("stories_stories",this.convertPeerStoriesCache(a))}checkExpired(){const e=Ie(!0);let t;for(;(t=this.expiring[0])&&!(t.timestamp>e);){this.expiring.shift();const a=this.getPeerStoriesCache(t.peerId,!1);if(!a)continue;Oe(a.stories,t.id)!==void 0&&(this.updateListCachePosition(a),this.rootScope.dispatchEvent("story_expired",{peerId:a.peerId,id:t.id}))}}getChangelogPeerId(){return this.changelogPeerId||Ce(this.apiManager.getAppConfig(),this.setChangelogPeerIdFromAppConfig)}generateSortIndexForCache(e){if(!this.getCacheTypeForPeerId(e.peerId))return;const a=e.stories[e.stories.length-1];if(!a)return;const s=e.storiesMap.get(a),n=this.getUnreadType(e.peerId),i=e.peerId===this.rootScope.myId,r=n!=="read",p=e.peerId===this.changelogPeerId,d=e.peerId.isUser()?this.appUsersManager.isPremium(e.peerId.toUserId()):!1;return+([i,r,p,d].map(c=>+c).join("")+s.date)}generateListCachePosition(e){const t=this.generateSortIndexForCache(e);return t?{type:this.appPeersManager.getPeer(e.peerId).pFlags.stories_hidden?"archive":"stories",index:t}:void 0}updateListCachePosition(e){const t=e.position,a=this.generateListCachePosition(e);if(!St(t,a)){if(t&&t.type!==a?.type){const s=this.lists[t.type];Oe(s,e.peerId)}if(e.position=a,a){const s=this.lists[a.type];Bt(s,e.peerId,n=>this.getPeerStoriesCache(n).position.index)}this.rootScope.dispatchEvent("stories_position",{peerId:e.peerId,position:a})}}getPeerStoriesCache(e,t=!0){var a;return(a=this.cache)[e]??(a[e]=t?{peerId:e,stories:[],pinnedStories:[],archiveStories:[],pinnedToTop:new Map,storiesMap:new Map,getStoriesPromises:new Map,deleted:new Set}:void 0)}convertPeerStoriesCache(e){return{_:"peerStories",peer:this.appPeersManager.getOutputPeer(e.peerId),stories:e.stories.map(t=>e.storiesMap.get(t)),max_read_id:e.maxReadId}}saveStoryItem(e,t,a){if(!e||e._==="storyItemDeleted")return;const s=t.storiesMap.get(e.id),n=s?._==="storyItemSkipped",i=e._==="storyItemSkipped";if(i&&s&&!n)return s;if(!i){const c={type:"storyItem",peerId:t.peerId,storyId:e.id};this.appMessagesManager.saveMessageMedia(e,c),e.media_areas?.forEach(m=>{m.msg_id=this.appMessagesIdsManager.generateMessageId(m.msg_id,m.channel_id)})}const r=t.pinnedToTop.get(e.id),p=e.pinnedIndex!==r;p&&(e.pinnedIndex=r);let d;if(a!==vt.Pinned){const c=!!s?.pFlags?.pinned,l=!!e.pFlags?.pinned;c!==l&&(l?(t.pinnedLoadedAll||t.pinnedStories.length&&e.id>t.pinnedStories[t.pinnedStories.length-1])&&(ws(t.pinnedStories,e,!0,vt.Pinned,t.pinnedToTop),d=!0):Oe(t.pinnedStories,e.id)&&(d=!0))}let f;if(a!==vt.Archive&&t.peerId===this.appPeersManager.peerId&&!t.archiveStories.includes(e.id)&&(t.archiveLoadedAll||t.archiveStories.length&&e.id>t.archiveStories[t.archiveStories.length-1])&&(ws(t.archiveStories,e,!0,vt.Archive),f=!0),a===vt.Stories){const c=this.expiring.findIndex(l=>l.peerId===t.peerId&&l.id===e.id);Bt(this.expiring,{peerId:t.peerId,id:e.id,timestamp:e.expire_date},l=>2147483647-l.timestamp,c)}if(a){const c=t[a];ws(c,e,!0,a,t.pinnedToTop)}if(!s)t.storiesMap.set(e.id,e);else{if(!n&&!i&&e.pFlags.min){const c=["privacy","views"];for(const l of c)e[l]=s[l]}if(!n&&!i&&e.pFlags.min){const c=["out"];for(const l of c)e.pFlags[l]=s.pFlags[l]}Wt(s,e)}return(s||d||f||p)&&this.rootScope.dispatchEvent("story_update",{peerId:t.peerId,story:s||e,modifiedPinned:d,modifiedArchive:f,modifiedPinnedToTop:p}),s||e}saveStoryItems(e,t,a){const s=[],n=e.map((i,r)=>(i=this.saveStoryItem(i,t,a),i||s.push(r),i));if(Et(s,i=>{n.splice(i,1)}),t.stories.length&&a===vt.Stories){const i=this.getPeer(t.peerId);if(!i.stories_max_id){const r={...i,stories_max_id:t.storiesMap.get(t.stories[t.stories.length-1]).id};t.peerId.isUser()?this.appUsersManager.saveApiUsers([r]):this.appChatsManager.saveApiChats([r])}}return this.updateListCachePosition(t),n}getPeer(e){return this.appPeersManager.getPeer(e)}saveApiPeerStories(e,t){if(e._!=="channel"&&e._!=="user")return;const a=t.stories_max_id?!0:t.pFlags.stories_unavailable?!1:void 0;let s=e.stories_max_id?!0:e.pFlags.stories_unavailable?!1:void 0;a!==s&&s===void 0&&(a&&(e.stories_max_id=t.stories_max_id),s=a);const n=t.pFlags.stories_hidden,i=e.pFlags.stories_hidden;return()=>{const r=e.id.toPeerId(e._!=="user");a!==s&&s!==void 0&&this.rootScope.dispatchEvent("peer_stories",{peerId:r,available:s}),n!==i&&this.rootScope.dispatchEvent("peer_stories_hidden",{peerId:r,hidden:i})}}saveStoriesStories(e,t,a){return this.appPeersManager.saveApiPeers(e),this.saveStoryItems(e.stories,t,a)}savePeerStories(e){const t=this.appPeersManager.getPeerId(e.peer),a=this.getPeerStoriesCache(t),s=this.getCacheTypeForPeerId(t,!0);return a.maxReadId=e.max_read_id??0,e.stories=this.saveStoryItems(e.stories,a,s),a.dispatchStoriesEvent&&(delete a.dispatchStoriesEvent,this.rootScope.dispatchEvent("peer_stories",{peerId:t,available:a.stories.length>0})),e}getUnreadType(e,t,a=this.getPeerStoriesCache(e)){if(t??(t=a.stories[a.stories.length-1]),!t&&!a.dispatchStoriesEvent&&(a.dispatchStoriesEvent=!0,this.getPeerStories(e)),!!t)return t>a.maxReadId?a.storiesMap.get(t).pFlags.close_friends?"close":"unread":"read"}getPeerStoriesSegments(e){const t=this.getPeerStoriesCache(e);if(t.maxReadId===void 0)return Ce(this.getPeerStories(e),()=>this.getPeerStoriesSegments(e));if(!t.stories.length)return;const a=[];let s;return t.stories.forEach(n=>{const i=this.getUnreadType(e,n,t);s?.type!==i?(s={length:1,type:i},a.push(s)):++s.length}),a}deleteStories(e,t){return this.apiManager.invokeApiSingleProcess({method:"stories.deleteStories",params:{peer:this.appPeersManager.getInputPeerById(e),id:t},processResult:a=>{a.forEach(s=>{this.apiUpdatesManager.processLocalUpdate({_:"updateStory",peer:this.appPeersManager.getOutputPeer(e),story:{_:"storyItemDeleted",id:s}})})}})}togglePinned(e,t,a){return t=Xs(t),this.apiManager.invokeApiSingleProcess({method:"stories.togglePinned",params:{peer:this.appPeersManager.getInputPeerById(e),id:t,pinned:a},processResult:s=>{if(!s.length)return;const n=this.getPeerStoriesCache(this.rootScope.myId),i=s.map(r=>{const p=n.storiesMap.get(r);if(p?._==="storyItem")return{...p,pFlags:{...p.pFlags,pinned:a||void 0}}});this.saveStoryItems(i,n)}})}async togglePinnedToTop(e,t,a){const s=[...this.getPeerStoriesCache(e).pinnedToTop.entries()].sort((p,d)=>p[1]-d[1]).map(([p])=>p),n=a?s.concat(t):s.filter(p=>!t.includes(p)),r=(await this.apiManager.getAppConfig()).stories_pinned_to_top_count_max??3;if(n.length>r){const p=Ee("STORY_ID_TOO_MANY");throw p.limit=r,p}return this.apiManager.invokeApiSingleProcess({method:"stories.togglePinnedToTop",params:{peer:this.appPeersManager.getInputPeerById(e),id:n},processResult:()=>{const p=this.getPeerStoriesCache(e),d=p.pinnedToTop;t.forEach(f=>{const c=this.getStoryByIdCached(e,f);a?d.set(f,d.size):d.delete(f),this.saveStoryItem(c,p,vt.Pinned)})}})}hasArchive(){return this.lists.archive.length>0}getAllStories(e,t,a){return this.apiManager.invokeApiSingleProcess({method:"stories.getAllStories",params:{next:e,state:t,hidden:a},processResult:s=>(this.appPeersManager.saveApiPeers(s),s.peer_stories=s.peer_stories.map(n=>this.savePeerStories(n)).filter(n=>n.stories.length),s)})}getPeerStories(e){const t=this.getPeerStoriesCache(e);return t.maxReadId!==void 0?this.convertPeerStoriesCache(t):this.apiManager.invokeApiSingleProcess({method:"stories.getPeerStories",params:{peer:this.appPeersManager.getInputPeerById(e)},processResult:a=>(this.appPeersManager.saveApiPeers(a),this.savePeerStories(a.stories))})}getCachedStories(e,t,a,s){let n=t?e.pinnedStories:e.archiveStories;t&&e.pinnedToTop?.size&&s&&(n=n.slice(e.pinnedToTop.size));const i=s?n.findIndex(r=>r<s):0;if(i!==-1){const r=n.slice(i,i+a);if(r.length===a||(t?e.pinnedLoadedAll:e.archiveLoadedAll))return r.map(p=>e.storiesMap.get(p))}}processLoadedStoriesStories(e,t,a,s){t&&(e.pinnedToTop=new Map((s.pinned_to_top||[]).map((p,d)=>[p,d])));const n=s.stories.length,i=this.saveStoriesStories(s,e,t?vt.Pinned:vt.Archive);return e.count=s.count,((t?e.pinnedStories:e.archiveStories).length===s.count||n<a)&&(t?e.pinnedLoadedAll=!0:e.archiveLoadedAll=!0),{count:s.count,stories:i,pinnedToTop:t?e.pinnedToTop:void 0}}getPinnedStories(e,t,a=0){const s=this.getPeerStoriesCache(e),n=this.getCachedStories(s,!0,t,a);return n?{count:s.count,stories:n,pinnedToTop:s.pinnedToTop}:this.apiManager.invokeApiSingleProcess({method:"stories.getPinnedStories",params:{peer:this.appPeersManager.getInputPeerById(e),limit:t,offset_id:a},processResult:i=>(this.processLoadedStoriesStories(s,!0,t,i),this.getPinnedStories(e,t,a))})}getStoriesArchive(e,t,a=0){const s=this.getPeerStoriesCache(e),n=this.getCachedStories(s,!1,t,a);return n?{count:s.count,stories:n,pinnedToTop:void 0}:this.apiManager.invokeApiSingleProcess({method:"stories.getStoriesArchive",params:{peer:this.appPeersManager.getInputPeerById(e),limit:t,offset_id:a},processResult:this.processLoadedStoriesStories.bind(this,s,!1,t)})}fetchSingleStories(e){return e.getStoriesPromise??(e.getStoriesPromise=rt(0).then(()=>{const t=[...e.getStoriesPromises.keys()],a=this.apiManager.invokeApi("stories.getStoriesByID",{peer:this.appPeersManager.getInputPeerById(e.peerId),id:t},{floodMaxTimeout:1/0}),s=n=>{const i=new Map(n.map(r=>[r.id,r]));for(const r of t){const p=i.get(r);p||this.handleDeletedStory(e,r);const d=e.getStoriesPromises.get(r);e.getStoriesPromises.delete(r),d.resolve(p)}};a.then(n=>{const i=this.saveStoriesStories(n,e);s(i)},()=>{s([])}).then(()=>{e.getStoriesPromise=void 0,e.getStoriesPromises.size&&this.fetchSingleStories(e),this.rootScope.dispatchEvent("stories_downloaded",{peerId:e.peerId,ids:t})})}))}getStoryByIdCached(e,t){return this.getPeerStoriesCache(e).storiesMap.get(t)}getStoryById(e,t,a){const s=this.getPeerStoriesCache(e),n=s.storiesMap.get(t);if(!s.deleted.has(t)){if(n?._==="storyItem"&&!a)return n;{let i=s.getStoriesPromises.get(t);return i||(s.getStoriesPromises.set(t,i=Pe()),this.fetchSingleStories(s),i)}}}getStoriesById(e,t,a){const s=t.map(i=>this.getStoryById(e,i,a));return s.some(i=>i instanceof Promise)?Promise.all(s):s}readStories(e,t){const a=this.getPeerStoriesCache(e);if(!(a.maxReadId!==void 0&&a.maxReadId>=t))return this.apiUpdatesManager.processLocalUpdate({_:"updateReadStories",peer:this.appPeersManager.getOutputPeer(e),max_id:t}),this.apiManager.invokeApiSingleProcess({method:"stories.readStories",params:{peer:this.appPeersManager.getInputPeerById(e),max_id:t}})}incrementStoryViews(e,t){return this.apiManager.invokeApiSingleProcess({method:"stories.incrementStoryViews",params:{peer:this.appPeersManager.getInputPeerById(e),id:t}})}getStoryViewsList(e,t,a,s="",n,i){return this.apiManager.invokeApiSingleProcess({method:"stories.getStoryViewsList",params:{peer:this.appPeersManager.getInputPeerById(e),id:t,limit:a,offset:s,q:n,just_contacts:i},processResult:r=>{this.appPeersManager.saveApiPeers(r),r.views.forEach(d=>{d.message=this.appMessagesManager.saveMessage(d.message),d.story=d.story&&this.appStoriesManager.saveStoryItem(d.story,this.appStoriesManager.getPeerStoriesCache(this.appPeersManager.getPeerId(d.peer_id)))});const p=r.views.filter(d=>d._==="storyView");return{count:r.count,views:p,nextOffset:r.next_offset}}})}getStoriesViews(e,t){return this.apiManager.invokeApiSingleProcess({method:"stories.getStoriesViews",params:{peer:this.appPeersManager.getInputPeerById(e),id:t},processResult:a=>{this.appPeersManager.saveApiPeers(a);const s=this.getPeerStoriesCache(this.appPeersManager.peerId);return a.views.forEach((n,i)=>{const r=t[i],p=s.storiesMap.get(r);p&&this.saveStoryItems([{...p,views:n}],s)}),a.views}})}report(e,t,a,s){return this.apiManager.invokeApiSingleProcess({method:"stories.report",params:{peer:this.appPeersManager.getInputPeerById(e),id:t,reason:{_:a},message:s}})}sendReaction(e,t,a){a??(a={_:"reactionEmpty"});const s=this.getStoryByIdCached(e,t),n=s.views,i=a._==="reactionEmpty"?void 0:a;if(n){const r=()=>{const p=n.reactions?.find(d=>ut(d.reaction,s.sent_reaction));p&&(--p.count,p.count||Oe(n.reactions,p))};if(n.reactions_count??(n.reactions_count=0),!s.sent_reaction&&i?++n.reactions_count:s.sent_reaction&&!i&&--n.reactions_count,r(),i){let p=n.reactions?.find(d=>ut(d.reaction,i));p||(n.reactions??(n.reactions=[]),n.reactions.push(p={_:"reactionCount",reaction:i,count:0})),++p.count}}return this.saveStoryItems([{...s,sent_reaction:i}],this.getPeerStoriesCache(e)),this.apiManager.invokeApiSingleProcess({method:"stories.sendReaction",params:{peer:this.appPeersManager.getInputPeerById(e),reaction:a,story_id:t},processResult:r=>{this.apiUpdatesManager.processUpdateMessage(r)}})}handleDeletedStory(e,t){e.deleted.add(t),e.storiesMap.delete(t)&&([e.stories,e.pinnedStories,e.archiveStories].forEach(a=>{Oe(a,t)}),this.updateListCachePosition(e),this.rootScope.dispatchEvent("story_deleted",{peerId:e.peerId,id:t}))}isSubcribedToPeer(e){if(e.isUser())return this.appUsersManager.isContact(e.toUserId());{const t=e.toChatId();return(this.appChatsManager.isBroadcast(t)||this.appChatsManager.isMegagroup(t))&&this.appChatsManager.isInChat(t)}}getCacheTypeForPeerId(e,t){if(!(!this.isSubcribedToPeer(e)&&e!==this.changelogPeerId&&!t))return vt.Stories}isStoryExpired(e){return e.expire_date<=Ie(!0)}hasRights(e,t,a){if(e.isUser())return this.appPeersManager.peerId===e;const s=e.toChatId(),i=!!this.getStoryByIdCached(e,t).pFlags.out,r=this.appChatsManager.hasRights(s,"edit_stories"),p=this.appChatsManager.hasRights(s,"post_stories"),d=this.appChatsManager.hasRights(s,"delete_stories");switch(a){case"send":return p;case"edit":return i?p:r;case"delete":return i?p:d;case"archive":return r;case"pin":return r;default:return!1}}cantPinDeleteStories(e,t){let a=!t.length,s=!t.length;for(const n of t)if(a||(a=!this.hasRights(e,n,"pin")),s||(s=!this.hasRights(e,n,"delete")),a&&s)break;return{cantPin:a,cantDelete:s}}toggleStoriesHidden(e,t){return this.apiManager.invokeApiSingleProcess({method:"stories.togglePeerStoriesHidden",params:{peer:this.appPeersManager.getInputPeerById(e),hidden:t},processResult:()=>{const a=this.getPeer(e),s={...a.pFlags};t?s.stories_hidden=!0:delete s.stories_hidden;const n={...a,pFlags:s};e.isUser()?this.appUsersManager.saveApiUsers([n]):this.appChatsManager.saveApiChats([n]),this.appNotificationsManager.toggleStoriesMute(e,t,!0)}})}}class hf extends ce{canSendMessage(e){return this.apiManager.invokeApiSingleProcess({method:"bots.canSendMessage",params:{bot:this.appUsersManager.getUserInput(e)}})}allowSendMessage(e){return this.apiManager.invokeApiSingleProcess({method:"bots.allowSendMessage",params:{bot:this.appUsersManager.getUserInput(e)},processResult:t=>{this.apiUpdatesManager.processUpdateMessage(t)}})}}class uf extends ce{saveBoost(e,t){return t.giveaway_msg_id&&(t.giveaway_msg_id=this.appMessagesIdsManager.generateMessageId(t.giveaway_msg_id,this.appPeersManager.isChannel(e)?e.toChatId():void 0)),t}saveBoosts(e,t){return!t||t.saved||(t.saved=!0,t.forEach((a,s,n)=>{n[s]=this.saveBoost(e,a)})),t}getBoostsList({peerId:e,limit:t,offset:a,gifts:s}){return this.apiManager.invokeApi("premium.getBoostsList",{peer:this.appPeersManager.getInputPeerById(e),limit:t,offset:a,gifts:s}).then(n=>(this.appPeersManager.saveApiPeers(n),n.boosts=this.saveBoosts(e,n.boosts),n))}getMyBoosts(){return this.apiManager.invokeApiSingleProcess({method:"premium.getMyBoosts",processResult:e=>(this.appPeersManager.saveApiPeers(e),e)})}getBoostsStatus(e){return this.apiManager.invokeApiSingleProcess({method:"premium.getBoostsStatus",params:{peer:this.appPeersManager.getInputPeerById(e)}})}applyBoost(e,t){return this.apiManager.invokeApiSingleProcess({method:"premium.applyBoost",params:{peer:this.appPeersManager.getInputPeerById(e),slots:t}})}}class yf extends ce{constructor(){super(...arguments),this.processPublicForwards=e=>(this.appPeersManager.saveApiPeers(e),e.forwards.forEach(t=>{t.message=this.appMessagesManager.saveMessage(t.message),t.story=t.story&&this.appStoriesManager.saveStoryItem(t.story,this.appStoriesManager.getPeerStoriesCache(this.appPeersManager.getPeerId(t.peer)))}),e)}async getInvokeOptions({peerId:e,dcId:t}){const a={};return e.isUser()||(t??(t=await Ce(this.appProfileManager.getChatFull(e.toChatId()),async s=>{let n=s.stats_dc;return n===void 0&&(n=await this.apiManager.getBaseDcId()),n})),a.dcId=t),a}async getBroadcastStats(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getBroadcastStats",params:{channel:this.appChatsManager.getChannelInput(e.peerId.toChatId()),dark:e.dark},processResult:a=>(a.recent_posts_interactions.forEach(s=>{s._==="postInteractionCountersMessage"&&(s.msg_id=this.appMessagesIdsManager.generateMessageId(s.msg_id,e.peerId.toChatId()))}),{stats:a,dcId:t.dcId}),options:t})}loadAsyncGraph(e,t,a){return this.apiManager.invokeApiSingleProcess({method:"stats.loadAsyncGraph",params:{token:e,x:t},options:{dcId:a}})}async getMegagroupStats(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getMegagroupStats",params:{channel:this.appChatsManager.getChannelInput(e.peerId.toChatId()),dark:e.dark},processResult:a=>(this.appPeersManager.saveApiPeers(a),{stats:a,dcId:t.dcId}),options:t})}async getMessagePublicForwards(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getMessagePublicForwards",params:{channel:this.appChatsManager.getChannelInput(e.peerId.toChatId()),msg_id:ae(e.mid),offset:e.offset,limit:e.limit},processResult:this.processPublicForwards,options:t})}async getMessageStats(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getMessageStats",params:{channel:this.appChatsManager.getChannelInput(e.peerId.toChatId()),dark:e.dark,msg_id:ae(e.mid)},processResult:a=>({stats:a,dcId:t.dcId}),options:t})}async getStoryStats(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getStoryStats",params:{peer:this.appPeersManager.getInputPeerById(e.peerId),dark:e.dark,id:e.storyId},processResult:a=>({stats:a,dcId:t.dcId}),options:t})}async getStoryPublicForwards(e){const t=await this.getInvokeOptions(e);return this.apiManager.invokeApiSingleProcess({method:"stats.getStoryPublicForwards",params:{peer:this.appPeersManager.getInputPeerById(e.peerId),id:e.id,limit:e.limit,offset:e.offset},processResult:this.processPublicForwards,options:t})}}class _f extends ce{saveBusinessIntro(e,t){if(t)return t.sticker=this.appDocsManager.saveDoc(t.sticker,{type:"userFull",userId:e}),t}resolveBusinessChatLink(e){return this.apiManager.invokeApiSingleProcess({method:"account.resolveBusinessChatLink",params:{slug:e},processResult:t=>{this.appPeersManager.saveApiPeers(t);const a=He(t.peer),{message:s,entities:n}=t;return{peerId:a,message:s,entities:n}}})}}const Pf=20;class Mf extends ce{constructor(){super(...arguments),this.translateTextBatch={},this.triedToTranslateMessages=new Map,this.processTextWithEntities=e=>(this.appMessagesManager.wrapMessageEntities(e),e)}hasTriedToTranslateMessage(e,t){return this.triedToTranslateMessages.has(`${e}_${t}`)}resetMessageTranslations(e,t){const a=`${e}_${t}`,s=this.triedToTranslateMessages.get(a);if(s){for(const n of s){const i=this.translateTextBatch[n];if(!i)continue;const r=i.messages.get(e);r&&r.delete(t)}this.triedToTranslateMessages.delete(a)}}batchTranslation(e,t,a,s){if(!(!t||![...t.values()].some(n=>n instanceof Promise)))return rt(0).then(async()=>{const n=[...t.entries()].filter(([d,f])=>f instanceof Promise).slice(0,Pf),i=new Map(n),r=n.map(([d])=>d),p=await this.apiManager.invokeApi("messages.translateText",{...a(r),to_lang:e}).catch(d=>{r.forEach(f=>{const c=i.get(f);t.delete(f),c.reject(d)})});p&&p.result.forEach((d,f)=>{this.processTextWithEntities(d);const c=r[f],l=i.get(c);s?t.delete(c):t.set(c,d),l.resolve(d)})})}batchMessageTranslation(e,t){const a=this.translateTextBatch[e];if(!a||a.messagesPromises.get(t))return;const s=a.messages.get(t),n=this.batchTranslation(e,s,i=>({peer:this.appPeersManager.getInputPeerById(t),id:i.map(r=>ae(r))}));n&&a.messagesPromises.set(t,n),n?.then(()=>{a.messagesPromises.delete(t),this.batchMessageTranslation(e,t)})}batchTextTranslation(e){const t=this.translateTextBatch[e];if(!t||t.textPromise)return;const a=t.text,s=this.batchTranslation(e,a,n=>({text:n.map(i=>({entities:[],...JSON.parse(i)}))}),!0);s&&(t.textPromise=s),t.textPromise?.then(()=>{t.textPromise=void 0,this.batchTextTranslation(e)})}translateText(e){var s,n;(s=this.translateTextBatch)[n=e.lang]??(s[n]={text:new Map,messages:new Map,messagesPromises:new Map});const t=this.translateTextBatch[e.lang];if("peerId"in e){let i=t.messages.get(e.peerId);i||t.messages.set(e.peerId,i=new Map);let r=i.get(e.mid);if(r||e.onlyCache)return r;r=Pe(),i.set(e.mid,r);const p=`${e.peerId}_${e.mid}`;let d=this.triedToTranslateMessages.get(p);return d||this.triedToTranslateMessages.set(p,d=new Set),d.add(e.lang),this.batchMessageTranslation(e.lang,e.peerId),r}else{const i=JSON.stringify(e.text);let r=t.text.get(i);return r||e.onlyCache||(r=Pe(),t.text.set(i,r),this.batchTextTranslation(e.lang)),r}}togglePeerTranslations(e,t){return this.appProfileManager.modifyCachedFullPeer(e,a=>{t?a.pFlags.translations_disabled=!0:delete a.pFlags.translations_disabled}),this.apiManager.invokeApi("messages.togglePeerTranslations",{peer:this.appPeersManager.getInputPeerById(e),disabled:t})}}class vf extends ce{after(){this.rootScope.addEventListener("user_auth",()=>{this.rootScope.addEventListener("app_config",()=>this.onGifsUpdated())}),this.apiUpdatesManager.addMultipleEventsListeners({updateSavedGifs:()=>this.onGifsUpdated()})}async onGifsUpdated(){const e=await this.getGifs(!0);this.rootScope.dispatchEvent("gifs_updated",e)}getGifs(e){return e&&Array.isArray(this.gifs)&&(this.gifs=void 0),this.gifs??(this.gifs=this.apiManager.invokeApi("messages.getSavedGifs").then(t=>this.gifs=t.gifs.map(a=>this.appDocsManager.saveDoc(a)).filter(Boolean)))}async searchGifs(e,t){const a=(await this.appUsersManager.resolveUsername("gif")).id.toPeerId(!1),{results:s,next_offset:n}=await this.appInlineBotsManager.getInlineResults(lt,a,e,t);return{documents:s.map(r=>r.document).filter(Boolean),nextOffset:n}}async saveGif(e,t){const[a,s]=await Promise.all([this.apiManager.getLimit("gifs"),this.getGifs()]),n=this.appDocsManager.getDoc(e);return wt(s,i=>i.id===n.id),t||(s.unshift(n),s.splice(a,s.length-a)),this.rootScope.dispatchEvent("gifs_updated",s),this.rootScope.dispatchEvent("gif_updated",{saved:!t,document:n}),this.apiManager.invokeApi("messages.saveGif",{id:ss(n),unsave:t}).then(()=>{t&&this.onGifsUpdated()})}}function Sf(o,e){const t={appPeersManager:new jp,appChatsManager:new uo,appDocsManager:new ip,appPhotosManager:new Gp,appPollsManager:new Hp,appUsersManager:new md,appWebPagesManager:new ud,appDraftsManager:new pp,appProfileManager:new Kp,appNotificationsManager:new Lp,apiUpdatesManager:new ai,appAvatarsManager:new lo,appGroupCallsManager:new fp,appCallsManager:new mo,appReactionsManager:new od,appMessagesManager:new Bp,appMessagesIdsManager:new gp,appPrivacyManager:new Wp,appInlineBotsManager:new lp,appStickersManager:new fd,referenceDatabase:new Er,appEmojiManager:new Rs,filtersStorage:new Yr,dialogsStorage:new zr,apiManager:new qd,cryptoWorker:_e,passwordManager:new Fr,apiFileManager:new xd,peersStorage:new Vi,thumbsStorage:new Gd,networkerFactory:new ef,rootScope:new zn,authorizer:new af,dcConfigurator:new Ca,timeManager:new sf,appStoragesManager:o,appStateManager:ra,appWebDocsManager:new nf,appPaymentsManager:new rf,appAttachMenuBotsManager:new df,appSeamlessLoginManager:new ff,appThemesManager:new cf,appUsernamesManager:new lf,appChatInvitesManager:new gf,appStoriesManager:new mf,appBotsManager:new hf,appBoostsManager:new uf,appStatisticsManager:new yf,appBusinessManager:new _f,appTranslationsManager:new Mf,appGifsManager:new vf};for(const n in t){const i=t[n];i&&(i.setManagers&&(i.setManagers(t),delete i.setManagers),we[n]=i)}const a=[];let s=Object.keys(t);s.unshift("appUsersManager","appChatsManager","appNotificationsManager","appMessagesManager","dialogsStorage"),s=Ua(s);for(const n of s){const i=t[n];if(i?.after){const r=i.after();a.push(r)}}return e&&t.apiManager.setUserAuth(e),Promise.all(a).then(()=>(t.rootScope.dispatchEventSingle("managers_ready"),t))}const bf=!0;class Cf{constructor(){this._isServiceWorkerOnline=bf,this.cryptoWorkersURLs=[],this.cryptoPortsAttached=0,this.cryptoPortPromise=Pe(),this.cryptoPortPromise.then(()=>{this.cryptoPortPromise=void 0})}start(){const e=Be.getInstance();e.addEventListener("manager",({name:t,method:a,args:s})=>Ce(this.getManagers(),n=>n[t][a](...s))),e.addEventListener("cryptoPort",(t,a,s)=>{const n=s.ports[0];if(this.cryptoPortsAttached>=this.cryptoWorkersURLs.length){n.close();return}++this.cryptoPortsAttached,_e.attachPort(n),this.cryptoPortPromise?.resolve()}),e.addEventListener("createProxyWorkerURLs",({originalUrl:t,blob:a})=>{let s=this.cryptoWorkersURLs.length;s||(this.cryptoWorkersURLs.push(t),++s);const n=Ve.cryptoWorkers;if(s===n)return this.cryptoWorkersURLs;const i=new Array(n-s).fill(void 0).map(()=>URL.createObjectURL(a));return this.cryptoWorkersURLs.push(...i),this.cryptoWorkersURLs})}async createManagers(){const e=new Ar;await Promise.all([e.loadStorages(),this.cryptoPortPromise]);const t=await Sf(e,ra.userId);return this.managers=t}getManagers(){return this.managers??(this.managers=this.createManagers())}get isServiceWorkerOnline(){return this._isServiceWorkerOnline}set isServiceWorkerOnline(e){this._isServiceWorkerOnline=e}getServiceMessagePort(){return this._isServiceWorkerOnline?this.serviceMessagePort:void 0}onServiceWorkerPort(e){this.serviceMessagePort?(this.serviceMessagePort.detachPort(this._serviceMessagePort),this._serviceMessagePort=void 0):(this.serviceMessagePort=new Sr,this.serviceMessagePort.addMultipleEventsListeners({requestFilePart:t=>Ce(pa.getManagers(),a=>{const{docId:s,dcId:n,offset:i,limit:r}=t;return a.appDocsManager.requestDocPart(s,n,i,r)}),cancelFilePartRequests:t=>Ce(pa.getManagers(),a=>a.appDocsManager.cancelDocPartsRequests(t)),requestRtmpState(t){return Ce(pa.getManagers(),a=>a.appGroupCallsManager.fetchRtmpState(t))},requestRtmpPart(t){return Ce(pa.getManagers(),a=>{const{request:s,dcId:n}=t;return a.appGroupCallsManager.fetchRtmpPart(s,n)})}})),(this._serviceMessagePort=e.ports[0])&&this.serviceMessagePort.attachPort(this._serviceMessagePort)}}const pa=new Cf;Ue&&(Ue.appManagersManager=pa);var xt=pa;function If(o,e,t){const a=(s,n)=>{o.attachListenPort(s),n&&o.attachSendPort(n),e?.(s)};o.setOnPortDisconnect(t),typeof SharedWorkerGlobalScope<"u"?we.addEventListener("connect",s=>a(s.source,s.source)):typeof ServiceWorkerGlobalScope<"u"?a(we,null):a(we,we)}const js=We("MTPROTO"),Ja=new Be;Ja.addMultipleEventsListeners({environment:o=>{er(o),Ae.multipleTransports&&ma.waitForWebSocket()},crypto:({method:o,args:e})=>_e.invokeCrypto(o,...e),state:({state:o,resetStorages:e,pushedKeys:t,newVersion:a,oldVersion:s,userId:n})=>{js("got state",o,t),ra.userId=n,ra.newVersion=a,ra.oldVersion=s,Qn.resolve({storages:e,callback:()=>{Object.keys(o).forEach(i=>{ra.pushToState(i,o[i],!0,!t.includes(i))})}})},toggleStorages:({enabled:o,clearWrite:e})=>Oi(o,e),event:(o,e)=>{js("will redirect event",o,e),Ja.invokeExceptSource("event",o,e)},serviceWorkerOnline:o=>{xt.isServiceWorkerOnline=o},serviceWorkerPort:(o,e,t)=>{xt.onServiceWorkerPort(t),Ja.invokeVoid("receivedServiceMessagePort",void 0,e)},createObjectURL:o=>URL.createObjectURL(o)});js("MTProto start");xt.start();xt.getManagers();Aa.start();let Bn=!0;If(Ja,o=>{Aa.addTab(o),Bn?Bn=!1:Ce(xt.getManagers(),e=>{e.thumbsStorage.mirrorAll(o),e.appPeersManager.mirrorAllPeers(o),e.appMessagesManager.mirrorAllMessages(o)})},o=>{Aa.deleteTab(o)});
|
||
//# sourceMappingURL=mtproto.worker-CNB1eRAp.js.map
|