"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1989],{70172:(e,t,n)=>{n.d(t,{Z:()=>g});var r=n(14050),o=n(33555),c=n(6137),s=n(83716),l=n(83158),i=n(2155),a=n(46752),d=n(32340),u=n(6202),v=n(31212),m=n(59107),f=n(3657),p=n(21747);const h=(0,a.y)("Avatar");h.media=h("media"),h.icon=h("icon");const g=(0,r.X$)((e=>{var t,n,g;let{className:Z,size:b="large",chat:I,user:w,photo:E,userStatus:y,text:P,isSavedMessages:A,noVideo:k,noLoop:C,lastSyncTime:T,observeIntersection:N,onClick:B}=e;const{loadFullUser:S}=(0,o.Sv)(),O=(0,r.sO)(null),U=(0,r.sO)(null),L=(0,f.Op)(O,N),R=w&&(0,l.NB)(w),M=w&&(0,l.pK)(w.id);let q,x;const F=null===(t=w||I)||void 0===t?void 0:t.hasVideoAvatar,D=(null==w||null===(n=w.fullInfo)||void 0===n?void 0:n.profilePhoto)||(null==I||null===(g=I.fullInfo)||void 0===g?void 0:g.profilePhoto),V=!k&&Boolean((null==w?void 0:w.isPremium)&&(null==D?void 0:D.isVideo)),z=L&&V,H="jumbo"===b;A||R||(V&&(x=(0,l.RT)(w,void 0,"video")),w?q=(0,l.RT)(w,H?"big":void 0):I?q=(0,l.RT)(I,H?"big":void 0):E&&(q=`photo${E.id}?size=m`)),(0,p.Z)(U,z),(0,r.d4)((()=>{const e=U.current;if(!e||!C)return;const t=()=>{e.currentTime=0};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)}),[C]),(0,r.d4)((()=>{L&&!k&&w&&F&&!D&&S({userId:w.id})}),[F,D,S,w,k,L]);const j=(0,u.Z)(q,!1,c.IU.BlobUrl,T),J=(0,u.Z)(x,!1,c.IU.BlobUrl,T),$=Boolean(j||J),{transitionClassNames:K}=(0,v.Z)($,void 0,$,"slow"),X=(0,m.Z)();let _;const Y=w?(0,l.Js)(w):I?(0,l.U)(X,I):P;if(A)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-avatar-saved-messages"),"aria-label":Y});else if(R)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-avatar-deleted-account"),"aria-label":Y});else if(M)_=r.ZP.createElement("i",{className:(0,a.Z)(h.icon,"icon-reply-filled"),"aria-label":Y});else if($)_=r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("img",{src:j,className:(0,a.Z)(h.media,"avatar-media",K,J&&"poster"),alt:Y,decoding:"async"}),J&&r.ZP.createElement("video",{ref:U,src:J,className:(0,a.Z)(h.media,"avatar-media",K),muted:!0,autoPlay:!0,loop:!C,playsInline:!0}));else if(w){const e=(0,l.Js)(w);_=e?(0,i.Xv)(e,2):void 0}else if(I){const e=(0,l.U)(X,I);_=e&&(0,i.Xv)(e,(0,l.YC)(I.id)?2:1)}else P&&(_=(0,i.Xv)(P,2));const W=!A&&w&&y&&(0,l.kM)(w,y),G=(0,a.Z)(`Avatar size-${b}`,Z,`color-bg-${(0,l.Rs)(w||I)}`,A&&"saved-messages",R&&"deleted-account",M&&"replies-bot-account",W&&"online",B&&"interactive",!A&&!j&&"no-photo"),Q=Boolean(A||j),ee=(0,r.I4)((e=>{B&&B(e,Q)}),[B,Q]),te=(w||I)&&(w||I).id;return r.ZP.createElement("div",{ref:O,className:G,onClick:ee,"data-test-sender-id":s.Cg?te:void 0,"aria-label":"string"==typeof _?Y:void 0},"string"==typeof _?(0,d.Z)(_,["jumbo"===b?"hq_emoji":"emoji"]):_)}))},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.I4)((()=>{e.current&&(i.current=!e.current.paused,i.current&&e.current.pause())}),[e]),u=(0,r.I4)((()=>{e.current&&i.current&&a.current&&document.body.contains(e.current)&&(0,c.Z)(e.current)}),[e]),v=(0,r.I4)((()=>{(0,o.T2)(u)}),[u]);(0,s.Z)(d,v),(0,l.ZP)(d,u)}},21273:(e,t,n)=>{n.d(t,{Z:()=>v});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,v=e=>{let{ref:t,className:n,onLoadMore:v,onScroll:m,onKeyDown:f,items:p,itemSelector:h=a,preloadBackwards:g=d,sensitiveArea:Z=u,withAbsolutePositioning:b,maxHeight:I,noScrollRestore:w=!1,noScrollRestoreOnTop:E=!1,noFastList:y,cacheBuster:P,children:A}=e,k=(0,o.sO)(null);t&&(k=t);const C=(0,o.sO)({}),[T,N]=(0,o.Ye)((()=>v?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];v({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{v({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[v,p]);(0,o.d4)((()=>{if(!T)return;if(g>0&&(!p||p.length{const e=k.current,t=C.current;let n;if(t.listItemElements=e.querySelectorAll(h),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}b||w||E&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[p,h,w,E,P,b]);const B=(0,o.I4)((e=>{if(N&&T){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=C.current,r=C.current.listItemElements;if(e)return void(C.current.isScrollTopJustUpdated=!1);const o=r.length,c=k.current,{scrollTop:s,scrollHeight:l,offsetHeight:i}=c,a=s<=(o?r[0].offsetTop:0)+Z,d=(o?r[o-1].offsetTop+r[o-1].offsetHeight:l)-(s+i)<=Z;let u=!1;if(a){const e=r[0];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o>n&&(C.current.currentAnchor=e,C.current.currentAnchorTop=r,u=!0,N())}}if(d){const e=r[o-1];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o{n.d(t,{Z:()=>m});var r=n(14050),o=n(517),c=n(46752),s=n(18674),l=n(31212),i=n(274),a=n(59107),d=n(46590),u=n(231),v=n(62898);const m=e=>{let{dialogRef:t,title:n,className:m,isOpen:f,header:p,hasCloseButton:h,noBackdrop:g,children:Z,style:b,onClose:I,onCloseAnimationEnd:w,onEnter:E,shouldSkipHistoryAnimations:y}=e;const{shouldRender:P,transitionClassNames:A}=(0,l.Z)(f,w,y,void 0,y),k=(0,r.sO)(null);(0,r.d4)((()=>f?(0,o.Z)({onEsc:I,onEnter:E}):void 0),[f,I,E]),(0,r.d4)((()=>f&&k.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const r=n.findIndex((e=>e.isSameNode(document.activeElement)));let o=0;r>=0&&(o=t.shiftKey?r>0?r-1:n.length-1:r{document.removeEventListener("keydown",t,!1)}}(k.current):void 0),[f]),(0,d.Z)({isActive:f,onBack:I}),(0,i.Z)((e=>{let[t]=e;return document.body.classList.toggle("has-open-dialog",f),(f||!f&&void 0!==t)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")}}),[f]);const C=(0,a.Z)();if(!P)return;const T=(0,c.Z)("Modal",m,A,g&&"transparent-backdrop");return r.ZP.createElement(v.Z,null,r.ZP.createElement("div",{ref:k,className:T,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:I}),r.ZP.createElement("div",{className:"modal-dialog",ref:t},p||(n?r.ZP.createElement("div",{className:"modal-header"},h&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:C("Close"),onClick:I},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},n)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll",style:b},Z)))))}},62898:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(14050),o=n(31664);const c=e=>{let{containerId:t,className:n,children:c}=e;const s=(0,r.sO)();return s.current||(s.current=document.createElement("div")),(0,r.bt)((()=>{const e=document.querySelector(t||"#portals");if(!e)return;const r=s.current;return n&&r.classList.add(n),e.appendChild(r),()=>{o.Z.render(void 0,r),e.removeChild(r)}}),[n,t]),o.Z.render(c,s.current)}},9211:(e,t,n)=>{n.d(t,{M:()=>c,P:()=>s});var r=n(86087),o=n(83716);function c(e,t){var n;const{appConfig:c}=e;if(!c)return o.pr[t][0];const s=(0,r.wV)(e),{limits:l}=c,i=null!==(n=l[t][s?1:0])&&void 0!==n?n:o.pr[t][s?1:0];return"dialogFilters"===t?i+1:i}function s(e,t){const{appConfig:n}=e;if(!n)return o.pr[t][1];const{limits:r}=n;return r[t][1]}},27407:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(14050),o=n(91713),c=n(60782),s=n(65326),l=n(87204);function i(e,t,n,r){const{length:c}=e,s=r?e.indexOf(r):0,l=t===o.Uq.Forwards?s:s+1||c,i=Math.max(0,l-n),a=l+n-1,d=e.slice(Math.max(0,i),a+1);let u,v;switch(t){case o.Uq.Forwards:u=l>0,v=i>=0;break;case o.Uq.Backwards:u=l2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;const d=(0,r.sO)(),u=(0,r.sO)((()=>{if(!t||d.current)return;const{newViewportIds:e}=i(t,o.Uq.Forwards,a,t[0]);return e})()),v=(0,s.Z)();n&&(d.current={});const m=(0,l.Z)(t),f=(0,l.Z)(n);if(!t||n||t===m&&n===f)t||(u.current=void 0);else{const{offsetId:e=t[0],direction:n=o.Uq.Forwards}=d.current||{},{newViewportIds:r}=i(t,n,a,e);u.current&&(0,c.et)(u.current,r)||(u.current=r)}const p=(0,r.I4)((n=>{let{direction:r,noScroll:s}=n;const l=u.current,m=l?r===o.Uq.Backwards?l[l.length-1]:l[0]:void 0;if(!t)return void(e&&e({offsetId:m}));s||(d.current={...d.current,direction:r,offsetId:m});const{newViewportIds:f,areSomeLocal:p,areAllLocal:h}=i(t,r,a,m);!p||l&&(0,c.et)(l,f)||(u.current=f,v()),!h&&e&&e({offsetId:m})}),[t,a,e,v]);return n?[t]:[u.current,p]}},3657:(e,t,n)=>{n.d(t,{Op:()=>i,S1:()=>s,_N:()=>l});var r=n(14050),o=n(69118),c=n(18674);function s(e,t){let{rootRef:n,throttleMs:s,debounceMs:l,shouldSkipFirst:i,margin:a,threshold:d,isDisabled:u}=e;const v=(0,r.sO)(),m=(0,r.sO)(),f=(0,r.sO)(0),p=(0,r.sO)();m.current=t;const h=(0,r.I4)((()=>{f.current++}),[]),g=(0,r.I4)((()=>{f.current&&(f.current--,!f.current&&p.current&&(p.current(),p.current=void 0))}),[]);return(0,c.ZP)(h,g),(0,r.d4)((()=>{if(!u)return()=>{v.current&&(v.current.observer.disconnect(),v.current.callbacks.clear(),v.current=void 0)}}),[u]),{observe:(0,r.I4)(((e,t)=>{v.current||function(){const e=new Map,t=new Map,r=()=>{const n=Array.from(t.values());n.forEach((t=>{const r=e.get(t.target);r&&r(t,n)})),m.current&&m.current(n),t.clear()},c=s?o.P2:l?o.Ds:void 0,u=c?c(r,s||l,!i):r,h=new IntersectionObserver((e=>{e.forEach((e=>{t.set(e.target,e)})),f.current?p.current=()=>{u()}:u()}),{root:n.current,rootMargin:a?`${a}px`:void 0,threshold:d});v.current={observer:h,callbacks:e}}();const r=v.current;return r.observer.observe(e),t&&r.callbacks.set(e,t),()=>{t&&r.callbacks.delete(e),r.observer.unobserve(e)}}),[u]),freeze:h,unfreeze:g}}function l(e,t,n){(0,r.d4)((()=>t?t(e.current,n):void 0),[])}function i(e,t,n){const[o,c]=(0,r.eJ)(!t);return l(e,t,(e=>{c(e.isIntersecting),n&&n(e)})),o}},62357:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(14050);const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=(0,r.sO)(e);(0,r.bt)((()=>{o.current=e}),[e]),(0,r.d4)((()=>{if(void 0===t)return;const e=setInterval((()=>o.current()),t);return n||o.current(),()=>clearInterval(e)}),[t,n])}},6202:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(14050),o=n(6137),c=n(40647),s=n(65326);const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.IU.BlobUrl,l=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const a=e?c.UV(e):void 0,d=(0,s.Z)();return(0,r.d4)((()=>{if(!t&&e&&!a){const t=Date.now();c.he(e,n).then((()=>{const e=Date.now()-t;!i||e>=i?d():setTimeout(d,i-e)}))}}),[t,e,a,n,l,d,i]),a}},87675:(e,t,n)=>{n.d(t,{Z:()=>s,z:()=>c});var r=n(77361),o=n(82972);function c(e){e.style.display="none",(0,o.Z)(e),e.style.display=""}const s=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")}},74753:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(83716);const o=e=>{e.play().catch((t=>{r.eM&&console.warn(t,e)}))}}}]); //# sourceMappingURL=1989.770621cd3dc5c36bdc6e.js.map