telegram-tt/dist/1989.834f949acc5977e509ff.js

2 lines
11 KiB
JavaScript
Raw Normal View History

2022-09-15 10:20:00 +02:00
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1989],{70172:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(14050),o=n(33555),c=n(6137),s=n(83716),l=n(77361),i=n(83158),a=n(2155),d=n(46752),u=n(32340),m=n(6202),v=n(31212),f=n(59107),p=n(3657),g=n(21747),h=n(46898);const Z=(0,d.y)("Avatar");Z.media=Z("media"),Z.icon=Z("icon");const y=(0,r.X$)((e=>{var t;let{className:n,size:y="large",chat:P,user:E,photo:b,userStatus:I,text:w,isSavedMessages:A,withVideo:C,noLoop:T,lastSyncTime:B,animationLevel:N,observeIntersection:k,onClick:L}=e;const{loadFullUser:S}=(0,o.Sv)(),O=(0,r.sO)(null),U=(0,r.sO)(null),R=(0,r.sO)(0),q=(0,p.Op)(O,k),x=E&&(0,i.NB)(E),F=E&&(0,i.pK)(E.id);let D,V;const H=!l.as&&N===s.zy&&q&&C&&(null==E?void 0:E.isPremium)&&(null==E?void 0:E.hasVideoAvatar),M=null==E||null===(t=E.fullInfo)||void 0===t?void 0:t.profilePhoto,j=H&&(null==M?void 0:M.isVideo),z="jumbo"===y;A||x||(E?D=(0,i.RT)(E,z?"big":void 0):P?D=(0,i.RT)(P,z?"big":void 0):b&&(D=`photo${b.id}?size=m`),j&&(V=(0,i.RT)(E,void 0,"video")));const J=(0,m.Z)(D,!1,c.IU.BlobUrl,B),$=(0,m.Z)(V,!j,c.IU.BlobUrl,B),K=Boolean(J||$),X=Boolean(q&&$),{transitionClassNames:Y}=(0,v.Z)(K,void 0,K,"slow"),{handlePlaying:_}=(0,g.Z)(U,X);(0,h.Z)(U,[X]),(0,r.d4)((()=>{const e=U.current;if(!e||!$)return;const t=()=>{R.current+=1,R.current>=3||T?e.style.display="none":e.play()};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)}),[T,$]);const W=null==E?void 0:E.id;(0,r.d4)((()=>{H&&!M&&S({userId:W})}),[S,M,W,H]);const G=(0,f.Z)();let Q;const ee=E?(0,i.Js)(E):P?(0,i.U)(G,P):w;if(A)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-avatar-saved-messages"),"aria-label":ee});else if(x)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-avatar-deleted-account"),"aria-label":ee});else if(F)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-reply-filled"),"aria-label":ee});else if(K)Q=r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("img",{src:J,className:(0,d.Z)(Z.media,"avatar-media",Y,$&&"poster"),alt:ee,decoding:"async"}),X&&r.ZP.createElement("video",{ref:U,src:$,className:(0,d.Z)(Z.media,"avatar-media"),muted:!0,autoPlay:!0,disablePictureInPicture:!0,playsInline:!0,onPlaying:_}));else if(E){const e=(0,i.Js)(E);Q=e?(0,a.Xv)(e,2):void 0}else if(P){const e=(0,i.U)(G,P);Q=e&&(0,a.Xv)(e,(0,i.YC)(P.id)?2:1)}else w&&(Q=(0,a.Xv)(w,2));const te=!A&&E&&I&&(0,i.kM)(E,I),ne=(0,d.Z)(`Avatar size-${y}`,n,`color-bg-${(0,i.Rs)(E||P)}`,A&&"saved-messages",x&&"deleted-account",F&&"replies-bot-account",te&&"online",L&&"interactive",!A&&!J&&"no-photo"),re=Boolean(A||J),oe=(0,r.I4)((e=>{L&&L(e,re)}),[L,re]),ce=(E||P)&&(E||P).id;return r.ZP.createElement("div",{ref:O,className:ne,onClick:oe,"data-test-sender-id":s.Cg?ce:void 0,"aria-label":"string"==typeof Q?ee:void 0},"string"==typeof Q?(0,u.Z)(Q,["jumbo"===y?"hq_emoji":"emoji"]):Q)}))},21747:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(14050),o=n(69118),c=n(74753),s=n(45332),l=n(18674);function i(e,t){var n;const i=(0,r.sO)(null===(n=e.current)||void 0===n?void 0:n.paused),a=(0,r.sO)();a.current=t;const d=(0,r.sO)(),u=(0,r.I4)((()=>{d.current=!0,e.current&&(i.current=!e.current.paused,i.current&&e.current.pause())}),[e]),m=(0,r.I4)((()=>{d.current=!1,e.current&&i.current&&a.current&&document.body.contains(e.current)&&(0,c.Z)(e.current)}),[e]),v=(0,r.I4)((()=>{(0,o.T2)(m)}),[m]);return(0,s.Z)(u,v),(0,l.ZP)(u,m),{handlePlaying:(0,r.I4)((()=>{d.current&&(i.current=!0,e.current.pause())}),[e])}}},21273:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(91713),o=n(14050),c=n(69118),s=n(87675),l=n(77361),i=n(80036);const a=".ListItem",d=20,u=800,m=e=>{let{ref:t,className:n,items:m,itemSelector:v=a,preloadBackwards:f=d,sensitiveArea:p=u,withAbsolutePositioning:g,maxHeight:h,noScrollRestore:Z=!1,noScrollRestoreOnTop:y=!1,noFastList:P,cacheBuster:E,children:b,onLoadMore:I,onScroll:w,onKeyDown:A,onDragOver:C,onDragLeave:T}=e,B=(0,o.sO)(null);t&&(B=t);const N=(0,o.sO)({}),[k,L]=(0,o.Ye)((()=>I?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];I({direction:r.Uq.Backwards,noScroll:e})})
//# sourceMappingURL=1989.834f949acc5977e509ff.js.map