mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-14 18:27:10 +01:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[2305],{70172:(e,t,n)=>{n.d(t,{Z:()=>P});var r=n(14050),o=n(33555),c=n(6137),l=n(83716),s=n(77361),a=n(83158),i=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 P=(0,r.X$)((e=>{var t;let{className:n,size:P="large",chat:y,user:E,photo:I,userStatus:b,text:C,isSavedMessages:w,withVideo:A,noLoop:N,lastSyncTime:T,animationLevel:k,observeIntersection:B,onClick:S}=e;const{loadFullUser:L}=(0,o.Sv)(),O=(0,r.sO)(null),R=(0,r.sO)(null),U=(0,r.sO)(0),x=(0,p.Op)(O,B),q=E&&(0,a.NB)(E),F=E&&(0,a.pK)(E.id);let D,V;const M=!s.as&&k===l.zy&&x&&A&&(null==E?void 0:E.isPremium)&&(null==E?void 0:E.hasVideoAvatar),j=null==E||null===(t=E.fullInfo)||void 0===t?void 0:t.profilePhoto,H=M&&(null==j?void 0:j.isVideo),$="jumbo"===P;w||q||(E?D=(0,a.RT)(E,$?"big":void 0):y?D=(0,a.RT)(y,$?"big":void 0):I&&(D=`photo${I.id}?size=m`),H&&(V=(0,a.RT)(E,void 0,"video")));const z=(0,m.Z)(D,!1,c.IU.BlobUrl,T),J=(0,m.Z)(V,!H,c.IU.BlobUrl,T),X=Boolean(z||J),_=Boolean(x&&J),{transitionClassNames:K}=(0,v.Z)(X,void 0,X,"slow"),{handlePlaying:Y}=(0,g.Z)(R,_);(0,h.Z)(R,[_]),(0,r.d4)((()=>{const e=R.current;if(!e||!J)return;const t=()=>{U.current+=1,U.current>=3||N?e.style.display="none":e.play()};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)}),[N,J]);const G=null==E?void 0:E.id;(0,r.d4)((()=>{M&&!j&&L({userId:G})}),[L,j,G,M]);const W=(0,f.Z)();let Q;const ee=E?(0,a.Js)(E):y?(0,a.U)(W,y):C;if(w)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-avatar-saved-messages"),role:"img","aria-label":ee});else if(q)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-avatar-deleted-account"),role:"img","aria-label":ee});else if(F)Q=r.ZP.createElement("i",{className:(0,d.Z)(Z.icon,"icon-reply-filled"),role:"img","aria-label":ee});else if(X)Q=r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("img",{src:z,className:(0,d.Z)(Z.media,"avatar-media",K,J&&"poster"),alt:ee,decoding:"async"}),_&&r.ZP.createElement("video",{ref:R,src:J,className:(0,d.Z)(Z.media,"avatar-media"),muted:!0,autoPlay:!0,disablePictureInPicture:!0,playsInline:!0,onPlaying:Y}));else if(E){const e=(0,a.Js)(E);Q=e?(0,i.Xv)(e,2):void 0}else if(y){const e=(0,a.U)(W,y);Q=e&&(0,i.Xv)(e,(0,a.YC)(y.id)?2:1)}else C&&(Q=(0,i.Xv)(C,2));const te=!w&&E&&b&&(0,a.kM)(E,b),ne=(0,d.Z)(`Avatar size-${P}`,n,`color-bg-${(0,a.Rs)(E||y)}`,w&&"saved-messages",q&&"deleted-account",F&&"replies-bot-account",te&&"online",S&&"interactive",!w&&!z&&"no-photo"),re=Boolean(w||z),oe=(0,r.I4)((e=>{S&&S(e,re)}),[S,re]),ce=(E||y)&&(E||y).id;return r.ZP.createElement("div",{ref:O,className:ne,onClick:oe,"data-test-sender-id":l.Cg?ce:void 0,"aria-label":"string"==typeof Q?ee:void 0},"string"==typeof Q?(0,u.Z)(Q,["jumbo"===P?"hq_emoji":"emoji"]):Q)}))},21747:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(14050),o=n(69118),c=n(74753),l=n(45332),s=n(18674);function a(e,t){var n;const a=(0,r.sO)(null===(n=e.current)||void 0===n?void 0:n.paused),i=(0,r.sO)();i.current=t;const d=(0,r.sO)(),u=(0,r.I4)((()=>{d.current=!0,e.current&&(a.current=!e.current.paused,a.current&&e.current.pause())}),[e]),m=(0,r.I4)((()=>{d.current=!1,e.current&&a.current&&i.current&&document.body.contains(e.current)&&(0,c.Z)(e.current)}),[e]),v=(0,r.I4)((()=>{(0,o.T2)(m)}),[m]);return(0,l.Z)(u,v),(0,s.ZP)(u,m),{handlePlaying:(0,r.I4)((()=>{d.current&&(a.current=!0,e.current.pause())}),[e])}}},22275:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(14050),o=n(33555),c=n(11192),l=n(83158),s=n(32340),a=n(59107),i=n(13103),d=n(231);const u=(0,r.X$)((0,o.c$)(((e,t)=>{let{userId:n}=t;const r=(0,c.jr)(e),o=n&&(0,c.dy)(e,n);return{chat:r,contactName:o?(0,l.Vl)(o):void 0}}))((e=>{let{isOpen:t,chat:n,userId:c,contactName:l,onClose:u}=e;const{deleteChatMember:m}=(0,o.Sv)(),v=(0,a.Z)(),f=(0,r.I4)((()=>{m({chatId:n.id,userId:c}),u()}),[n,m,u,c]);if(n&&c)return r.ZP.createElement(i.Z,{isOpen:t,onClose:u,onEnter:f,className:"delete",title:v("GroupRemoved.Remove")},r.ZP.createElement("p",n
|
||
|
//# sourceMappingURL=2305.39f8bb954e6546753460.js.map
|