TelegramPWA/dist/9722.4dc347cc44a0530388ca.js
Alexander Zinchuk 1dd81931e2 [Build]
2024-09-11 02:08:41 +02:00

2 lines
12 KiB
JavaScript

(()=>{"use strict";var e,t,r={79722:(e,t,r)=>{var i=r(87784),o=r(49357);let a;importScripts(new URL(r(25404),r.b));const s=new Promise((e=>{Module.onRuntimeInitialized=()=>{a={init:Module.cwrap("lottie_init","",[]),destroy:Module.cwrap("lottie_destroy","",["number"]),resize:Module.cwrap("lottie_resize","",["number","number","number"]),buffer:Module.cwrap("lottie_buffer","number",["number"]),render:Module.cwrap("lottie_render","",["number","number"]),loadFromData:Module.cwrap("lottie_load_from_data","number",["number","number"])},e()}})),n=new Map;async function c(e){const t=await fetch(e),r=t.headers.get("Content-Type");if(r?.startsWith("text/"))return t.text();const o=await t.arrayBuffer();return(0,i.inflate)(o,{to:"string"})}function l(e,t,r){const i=t?30:60,o=JSON.parse(e).fr||i,a=o%i==0?o/i:1;return{reduceFactor:a,msPerFrame:1e3/(o/a),reducedFramesCount:Math.ceil(r/a)}}const d={"rlottie:init":async function(e,t,r,i,o,d){a||await s;const u=await c(t),f=allocate(intArrayFromString(u),"i8",0),h=a.init(),m=a.loadFromData(h,f);a.resize(h,r,r);const p=new ImageData(r,r),{reduceFactor:v,msPerFrame:g,reducedFramesCount:w}=l(u,i,m);n.set(e,{imgSize:r,reduceFactor:v,handle:h,imageData:p,customColor:o}),d(v,g,w)},"rlottie:changeData":async function(e,t,r,i){a||await s;const o=await c(t),d=allocate(intArrayFromString(o),"i8",0),{handle:u}=n.get(e),f=a.loadFromData(u,d),{reduceFactor:h,msPerFrame:m,reducedFramesCount:p}=l(o,r,f);i(h,m,p)},"rlottie:renderFrames":async function(e,t,r){a||await s;const{imgSize:i,reduceFactor:o,handle:c,imageData:l,customColor:d}=n.get(e),u=t*o;a.render(c,u);const f=a.buffer(c),h=Module.HEAPU8.subarray(f,f+i*i*4);if(d){const e=new Uint8ClampedArray(h);!function(e,t){for(let r=0;r<e.length;r+=4)e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2]}(e,d),l.data.set(e)}else l.data.set(h);r(t,await createImageBitmap(l))},"rlottie:destroy":function e(t){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{const e=n.get(t);a.destroy(e.handle),n.delete(t)}catch(i){r||setTimeout((()=>e(t,!0)),1e3)}}};(0,o.C)(d,"media");var u=r(65905),f=r(37836);const h=new Map;function m(e,t,r){var i;return(t="symbol"==typeof(i=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?i:i+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}self.addEventListener("message",(e=>{const{type:t,messageId:r,result:i}=e.data;if("partResponse"===t){const e=h.get(r);e&&e.resolve(i)}}));const p=1024;var v=function(e){return e.loading="loading",e.ready="ready",e.closed="closed",e}(v||{});class g{constructor(e,t){let{onConfig:r,onChunk:i,stepOffset:o,stepMultiplier:a,isPolyfill:s,maxFrames:n}=t;m(this,"url",void 0),m(this,"file",void 0),m(this,"status",v.loading),m(this,"stepOffset",void 0),m(this,"stepMultiplier",void 0),m(this,"maxFrames",void 0),m(this,"isPolyfill",void 0),m(this,"decodedSamples",new Set),m(this,"lastSample",0),m(this,"onConfig",void 0),m(this,"onChunk",void 0),this.url=e,this.stepOffset=o,this.stepMultiplier=a,this.maxFrames=n,this.isPolyfill=s,this.onConfig=r,this.onChunk=i,this.file=u.createFile(),this.file.onError=e=>{console.error(e)},this.file.onReady=this.onReady.bind(this),this.file.onSamples=this.onSamples.bind(this),this.loadMetadata()}async loadMetadata(){let e=0;for(;void 0!==e;){try{e=await this.requestPart(e,131072)}catch(e){console.error(e)}if(this.status===v.ready)break}}async loadNextFrames(e,t,r){let i=e*this.stepOffset,o=0,a=this.file.seek(i,!0);for(;this.status!==v.closed;)try{if(await this.requestPart(a.offset,r),i>t)break;this.lastSample>1&&o<this.lastSample&&(i+=e*this.stepMultiplier,o=this.lastSample),a=this.file.seek(i,!0)}catch(e){console.error(e)}this.file.flush()}async requestPart(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=e%p,o=e-i,a=o+t-1;let s=await function(e){const t=Date.now().toString(36)+Math.random().toString(36).slice(2),r={};let i=!1;const o=Promise.race([(0,f.v7)(3e4).then((()=>i?void 0:Promise.reject(new Error("ERROR_PART_TIMEOUT")))),new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}))]);return h.set(t,r),o.catch((()=>{})).finally((()=>{h.delete(t),i=!0})),postMessage({type:"requestPart",messageId:t,params:e}),o}({url:this.url,start:o,end:a});if(!s)return;i&&(s=s.slice(i)),s.fileStart=e;const n=this.file.appendBuffer(s);return r?n:e+s.byteLength}description(e){const t=this.file.getTrackById(e.id);for(const e of t.mdia.minf.stbl.stsd.entries)if(e.avcC||e.hvcC||e.av1C){const t=new u.DataStream(void 0,0,u.DataStream.BIG_ENDIAN);return e.avcC?e.avcC.write(t):e.hvcC?e.hvcC.write(t):e.av1C&&e.av1C.write(t),new Uint8Array(t.buffer,8)}throw new Error("avcC, hvcC ro av1C not found")}onReady(e){const t=e.videoTracks[0];let r=t.codec;r.startsWith("avc1")&&(r="avc1.4d001f"),this.onConfig({codec:r,codedHeight:t.video.height,codedWidth:t.video.width,description:this.description(t)});const i=e.duration/e.timescale,o=this.isPolyfill?24:12,a=(s=t.bitrate/o)+p-s%p;var s;const n=function(e,t){return Math.round((e+t)/t)}(i,this.maxFrames);this.file.setExtractionOptions(t.id,void 0,{nbSamples:1}),this.file.start(),this.status=v.ready,this.loadNextFrames(n,i,a)}onSamples(e,t,r){if(this.status===v.ready)for(const t of r){const r=t.cts/t.timescale,i=t.is_sync?"key":"delta",o=`${i}${t.number}`;this.decodedSamples.has(o)||(this.onChunk(new EncodedVideoChunk({type:i,timestamp:1e6*r,duration:1e6*t.duration/t.timescale,data:t.data})),this.decodedSamples.add(o),this.lastSample=parseInt(t.number,10),t.is_sync&&this.file.releaseUsedSamples(e,t.number))}}close(){this.file.flush(),this.file.stop(),this.status=v.closed}}let w,y,b;const C={"video-preview:init":function(e,t,r,i,o){const a="VideoDecoder"in globalThis;if(!a)return console.log("[Video Preview] WebCodecs not supported"),new Promise((e=>{b=e}));const s=new Set;return w=new VideoDecoder({async output(e){const t=e.timestamp/1e6,r=Math.floor(t);if(!s.has(r)){const t=await createImageBitmap(e);s.add(r),o(r,t)}e.close()},error(e){console.error("[Video Preview] error",e)}}),y=new g(e,{stepOffset:r,stepMultiplier:i,isPolyfill:!a,maxFrames:t,onConfig(e){w?.configure(e)},onChunk(e){"configured"===w?.state&&w?.decode(e)}}),new Promise((e=>{b=e}))},"video-preview:destroy":function(){try{w?.close(),y?.close()}catch{}w=void 0,y=void 0,b?.()}};(0,o.C)(C,"media");const P=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],S=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18],F={blurThumb:async function(e,t,r){const i=t.startsWith("data:")?await function(e){const t=atob(e.split(",")[1]),r=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),o=new Uint8Array(i);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);const a=new Blob([i],{type:r});return createImageBitmap(a)}(t):await async function(e){const t=await fetch(e),r=await t.blob();return createImageBitmap(r)}(t),{width:o,height:a}=e,s=e.getContext("2d"),n="filter"in s;n&&(s.filter=`blur(${r}px)`),s.drawImage(i,2*-r,2*-r,o+4*r,a+4*r),n||function(e,t,r,i,o,a,s){if(Number.isNaN(a)||a<1)return;a|=0,Number.isNaN(s)&&(s=1),(s|=0)>3&&(s=3),s<1&&(s=1);const n=e.getImageData(0,0,i,o),c=n.data;let l,d,u,f,h,m,p,v,g,w,y,b,C=i-1,F=o-1,M=a+1,x=[],O=[],k=[],I=P[a],D=S[a],_=[],j=[];for(;s-- >0;){for(b=y=0,h=0;h<o;h++){for(l=c[b]*M,d=c[b+1]*M,u=c[b+2]*M,m=1;m<=a;m++)p=b+((m>C?C:m)<<2),l+=c[p++],d+=c[p++],u+=c[p++];for(f=0;f<i;f++)x[y]=l,O[y]=d,k[y]=u,0==h&&(_[f]=((p=f+M)<C?p:C)<<2,j[f]=(p=f-a)>0?p<<2:0),v=b+_[f],g=b+j[f],l+=c[v++]-c[g++],d+=c[v++]-c[g++],u+=c[v++]-c[g++],y++;b+=i<<2}for(f=0;f<i;f++){for(w=f,l=x[w]*M,d=O[w]*M,u=k[w]*M,m=1;m<=a;m++)w+=m>F?0:i,l+=x[w],d+=O[w],u+=k[w];for(y=f<<2,h=0;h<o;h++)c[y]=l*I>>>D,c[y+1]=d*I>>>D,c[y+2]=u*I>>>D,0==f&&(_[h]=((p=h+M)<F?p:F)*i,j[h]=(p=h-a)>0?p*i:0),v=f+_[h],g=f+j[h],l+=x[v]-x[g],d+=O[v]-O[g],u+=k[v]-k[g],y+=i<<2}}e.putImageData(n,0,0)}(s,0,0,o,a,r,2)}};(0,o.C)(F,"media")},37836:(e,t,r)=>{function i(e){return function(e,t){let r,i=!1;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];r=a,i||(i=!0,e((()=>{i=!1,t(...r)})))}}(s,e)}r.d(t,{Fe:()=>i,v7:()=>o});const o=e=>new Promise((t=>{setTimeout((()=>t()),e)}));let a;function s(e){a?a.push(e):(a=[e],Promise.resolve().then((()=>{const e=a;a=void 0,e.forEach((e=>e()))})))}},25404:(e,t,r)=>{e.exports=r.p+"rlottie-wasm.f013598f1b2ba719f25e.js"}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var a=i[e]={exports:{}};return r[e].call(a.exports,a,a.exports,o),a.exports}o.m=r,o.x=()=>{var e=o.O(void 0,[7784,5905,9357],(()=>o(79722)));return o.O(e)},e=[],o.O=(t,r,i,a)=>{if(!r){var s=1/0;for(d=0;d<e.length;d++){for(var[r,i,a]=e[d],n=!0,c=0;c<r.length;c++)(!1&a||s>=a)&&Object.keys(o.O).every((e=>o.O[e](r[c])))?r.splice(c--,1):(n=!1,a<s&&(s=a));if(n){e.splice(d--,1);var l=i();void 0!==l&&(t=l)}}return t}a=a||0;for(var d=e.length;d>0&&e[d-1][2]>a;d--)e[d]=e[d-1];e[d]=[r,i,a]},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+"."+{5905:"efaeccc9ed0bc890f551",7784:"4e167a928464165e6412",9357:"444e5f625aa40248651e"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=self.location+"";var e={9722:1};o.f.i=(t,r)=>{e[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],r=t.push.bind(t);t.push=t=>{var[i,a,s]=t;for(var n in a)o.o(a,n)&&(o.m[n]=a[n]);for(s&&s(o);i.length;)e[i.pop()]=1;r(t)}})(),t=o.x,o.x=()=>Promise.all([7784,5905,9357].map(o.e,o)).then(t),o.x()})();
//# sourceMappingURL=9722.4dc347cc44a0530388ca.js.map