"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7941],{67941:(t,e,s)=>{s.r(e),s.d(e,{default:()=>f});var i=s(77361),n=s(26926);function r(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}class h{constructor(t){this.worker=t,r(this,"requestStates",new Map),r(this,"requestStatesByCallback",new Map),this.subscribe()}request(t){const{worker:e,requestStates:s,requestStatesByCallback:i}=this,r=(0,n.Z)(s),h={type:"callMethod",messageId:r,...t},a={messageId:r},o=new Promise(((t,e)=>{Object.assign(a,{resolve:t,reject:e})}));if("function"==typeof h.args[h.args.length-1]){h.withCallback=!0;const t=h.args.pop();a.callback=t,i.set(t,a)}return s.set(r,a),o.catch((()=>{})).finally((()=>{s.delete(r),a.callback&&i.delete(a.callback)})),e.postMessage(h),o}cancelCallback(t){t.isCanceled=!0;const{messageId:e}=this.requestStatesByCallback.get(t)||{};e&&this.worker.postMessage({type:"cancelProgress",messageId:e})}subscribe(){const{worker:t,requestStates:e}=this;t.addEventListener("message",(t=>{let{data:s}=t;if("methodResponse"===s.type){const t=e.get(s.messageId);t&&(s.error?t.reject(s.error):t.resolve(s.response))}else if("methodCallback"===s.type){var i;const t=e.get(s.messageId);null==t||null===(i=t.callback)||void 0===i||i.call(t,...s.callbackArgs)}else if("unhandledError"===s.type){var n;throw new Error(null===(n=s.error)||void 0===n?void 0:n.message)}}))}}var a=s(9933),o=s(3570);function d(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const c=i.wB?.75:1,u=i.wZ?.5:.75,l=i.s$?2:4,m=new Map,g=new Array(4).fill(void 0).map((()=>new h(new Worker(new URL(s.p+s.u(2993),s.b)))));let p=-1;class k{static init(){for(var t=arguments.length,e=new Array(t),s=0;s0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1?arguments[1]:void 0;e&&(this.containers.get(e).isPaused=!1),this.isEnded&&t&&(this.approxFrameIndex=Math.floor(0)),this.stopFrameIndex=void 0,this.direction=1,this.doPlay()}pause(t){if(t&&(this.containers.get(t).isPaused=!0,!Array.from(this.containers.values()).every((t=>{let{isPaused:e}=t;return e}))))return;this.isWaiting?this.stopFrameIndex=this.approxFrameIndex:this.isAnimating=!1;const e=this.getChunkIndex(this.approxFrameIndex);this.chunks=this.chunks.map(((t,s)=>s===e?t:void 0))}playSegment(t){let[e,s]=t;this.approxFrameIndex=Math.floor(e/this.reduceFactor),this.stopFrameIndex=Math.floor(s/this.reduceFactor),this.direction=e{if(this.isDestroyed)return!1;if(!this.isAnimating)return!1;const t=Math.round(this.approxFrameIndex),e=this.getChunkIndex(t),s=this.chunks[e];if(!s||0===s.length)return this.requestChunk(e),this.isAnimating=!1,this.isWaiting=!0,!1;if(this.cacheModulo&&e%this.cacheModulo==0&&this.cleanupPrevChunk(e),t!==this.prevFrameIndex){const e=this.getFrame(t);if(!e)return this.isAnimating=!1,this.isWaiting=!0,!1;const s=new Uint8ClampedArray(e);if(this.customColor)for(let t=0;t{const{ctx:e,isLoaded:s,isPaused:n,onLoad:r}=t;s&&n||e.putImageData(i,0,0),s||(t.isLoaded=!0,null==r||r())})),this.prevFrameIndex=t}const i=Date.now(),n=this.lastRenderAt?this.msPerFrame/(i-this.lastRenderAt):1,r=Math.min(1,this.direction*this.speed/n),h=Math.round(this.approxFrameIndex+r);if(this.lastRenderAt=i,r>0&&(t===this.framesCount-1||h>this.framesCount-1)){var a,o;if(this.params.noLoop)return this.isAnimating=!1,this.isEnded=!0,null===(o=this.onEnded)||void 0===o||o.call(this),!1;null===(a=this.onLoop)||void 0===a||a.call(this),this.approxFrameIndex=0}else if(r<0&&(0===t||h<0)){var d,c;if(this.params.noLoop)return this.isAnimating=!1,this.isEnded=!0,null===(c=this.onEnded)||void 0===c||c.call(this),!1;null===(d=this.onLoop)||void 0===d||d.call(this),this.approxFrameIndex=this.framesCount-1}else{if(void 0!==this.stopFrameIndex&&(t===this.stopFrameIndex||r>0&&h>this.stopFrameIndex||r<0&&h{function i(t,e){return e-Math.floor(e/t)*t}s.d(e,{Z:()=>i})}}]); //# sourceMappingURL=7941.6bbddbd535d4073d252c.js.map