telegram-tt/dist/409.8ade632d34e500adc543.js

2 lines
110 KiB
JavaScript
Raw Normal View History

2022-01-28 21:02:07 +01:00
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[409],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(6752),i=n(3657),o=n(6202),c=n(692),l=n(5296),d=n(4399),u=n(7799);const m=(0,a.X$)((({sticker:e,effect:t,isOwn:n,soundId:m,size:h="medium",observeIntersection:f,lastSyncTime:v,forceLoadPreview:p,messageId:Z,chatId:g,activeEmojiInteraction:E})=>{var P;const{markAnimationLoaded:y,isAnimationLoaded:C,ref:b,width:N,style:w,handleClick:k,playKey:I}=(0,l.Z)(h,g,Z,m,E,n,void 0,null==t?void 0:t.emoji),T=`sticker${e.id}`,S=(0,i.Op)(b,f),M=null===(P=e.thumbnail)||void 0===P?void 0:P.dataUri,L=(0,o.Z)(`${T}?size=m`,!S&&!p,r.IU.BlobUrl,v),x=(0,c.Z)(L),$=(0,o.Z)(T,!S,r.IU.Lottie,v),O=Boolean($);return a.ZP.createElement("div",{ref:b,className:(0,s.Z)("AnimatedEmoji media-inner",e.id===d.wB&&"like-sticker-thumb"),style:w,onClick:k},!C&&M&&a.ZP.createElement("img",{src:M,alt:""}),!C&&L&&a.ZP.createElement("img",{src:L,className:x,alt:""}),O&&T&&a.ZP.createElement(u.Z,{key:T,id:T,animationData:$,size:N,quality:1,play:S&&I,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:y}))}))},4752:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(4050),r=n(5116),s=n(6137),i=n(1713),o=n(7361),c=n(790),l=n(8415),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),Z=n(9107),g=n(1174),E=n(6202),P=n(396),y=n(711),C=n(231),b=n(9196),N=n(8033);const w=o.wB?20:25,k=o.wB?50:75;function I(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},a.ZP.createElement("span",{className:"seekline-buffered-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const T=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:T,origin:S,date:M,lastSyncTime:L,className:x,isSelectable:$,isSelected:O,isDownloading:F,onPlay:A,onReadMedia:D,onCancelUpload:R,onDateClick:U})=>{const{content:{audio:B,voice:X,video:Y},isMediaUnread:K}=t,V=Boolean(X||Y),j=(0,a.sO)(!1),z=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,Z.Z)(),{isRtl:W}=q,J=(0,r.uC)(),[_,G]=(0,a.eJ)(!1),Q=L,ee=(0,l.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,l.Ti)(t,"inline"),!Q,(0,l.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,l.Ti)(t,"download"),!F),re=(0,a.I4)((()=>{G(!0),A(t.id,t.chatId)}),[t,A]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:ce,checkBuffering:le}=(0,v.Z)(),{isPlaying:de,playProgress:ue,playPause:me,play:he,pause:fe,setCurrentTime:ve,duration:pe}=(0,p.Z)((0,P.An)(t),(0,l.XV)(t),V?"voice":"audio",ne,ce,void 0,le,_,re,se,(0,l.CI)(t)),Ze=(0,l.B4)(t),ge=function(e,t,n=0,r=!1){const s=(0,a.sO)(null),{data:i,peak:o}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const a=Math.min(n/10,1),r=Math.round(w+(k-w)*a);return function(e,t){let n=0;const a=new Array(t),r=e.length/t,s=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var o,c,l;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(c=e[t])&&void 0!==c?c:s)+(null!==(l=e[t+1])&&void 0!==l?l:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=r[t]+(r[t+1]<<8);a[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),o=r[s]+(r[s+1]<<8);return a[n-1]=o>>i&31,a}(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=s.current;t&&i&&void 0!==o&&function(e,t,n,{peak:a,fillStyle:r,progressFillStyle:s}){const i=4*t.length;e.width=2*i,e.height=46,e.style.width=`${i}px`,e.style.height="23px";const o=e.getContext("2d");o.scale(2,2),t.forEach(((e,i)=>{o.globalAlpha=i/t.length>=n?.5:1,o.fillStyle=n>i/t.length?s:r;const c=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,r,s){2<2*s&&(s=1),r<2*s&&(s=r/2),e.beginPath(),e.moveTo(t+s
//# sourceMappingURL=409.8ade632d34e500adc543.js.map