telegram-tt/dist/886.2870895152d4462e05bf.js
Alexander Zinchuk 0350a62177 [Build]
2022-01-07 19:58:37 +01:00

2 lines
109 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[886],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(4399),i=n(3657),o=n(6202),l=n(692),c=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,a.sO)(null),[p,g]=(0,c.Z)(),Z=`sticker${e.id}`,E=(0,i.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,o.Z)(`${Z}?size=m`,!E&&!h,r.IU.BlobUrl,m),C=(0,l.Z)(y),b=(0,o.Z)(Z,!E,r.IU.Lottie,m),N=Boolean(b),[w,k]=(0,a.eJ)(String(Math.random())),I=(0,a.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],M=`width: ${T}px; height: ${T}px;`;return a.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:M,onClick:I},!p&&P&&a.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&a.ZP.createElement("img",{src:y,className:C,alt:""}),N&&a.ZP.createElement(d.Z,{key:Z,id:Z,animationData:b,size:T,quality:1,play:E&&w,noLoop:!0,onLoad:g}))}},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),l=n(790),c=n(2858),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),g=n(9107),Z=n(1174),E=n(6202),P=n(396),y=n(663),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:M,date:S,lastSyncTime:x,className:L,isSelectable:$,isSelected:F,isDownloading:A,onPlay:O,onReadMedia:R,onCancelUpload:D,onDateClick:U})=>{const{content:{audio:B,voice:V,video:X},isMediaUnread:z}=t,K=Boolean(V||X),Y=(0,a.sO)(!1),j=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,g.Z)(),{isRtl:W}=q,_=(0,r.uC)(),[J,G]=(0,a.eJ)(!1),Q=x,ee=(0,c.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,c.Ti)(t,"inline"),!Q,(0,c.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,c.Ti)(t,"download"),!A),re=(0,a.I4)((()=>{G(!0),O(t.id,t.chatId)}),[t,O]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:le,checkBuffering:ce}=(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,c.XV)(t),K?"voice":"audio",ne,le,void 0,ce,J,re,se,(0,c.CI)(t)),ge=(0,c.B4)(t),Ze=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,l,c;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(l=e[t])&&void 0!==l?l:s)+(null!==(c=e[t+1])&&void 0!==c?c: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 l=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,n),e.arcTo(t+2,n,t+2,n-r,s),e.arcTo(t+2,n-r,t,n-r,s),e.arcTo(t,n-r,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(o,4*i,23,0,l,1),o.fill()}))}(t,i,n,{peak:o,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,o,n,i,e]),s}(e,V,z&&!ge?1:ue,ge),Ee=de||ue>0&&ue<1;(0,a.d4)((()=>{G(de)}),[de]);const Pe=J&&!ie,{isUploading:ye,isTransferring:Ce,transferProgress:be}=(0,c.Sc)(t,T||ae,Pe||A),{shouldRender:Ne,transitionClassNames:we}=(0,f.Z)(Ce),ke=Ne&&(Pe||ye),Ie=(0,a.I4)((()=>{ye?null==D||D():(de||O(t.id,t.chatId),(0,r.uC)().setAudioPlayerOrigin({origin:M}),G(!J),me())}),[ye,de,J,me,D,O,t.id,t.chatId,M]);(0,a.d4)((()=>{R&&z&&(de||A)&&R()}),[de,z,R,A]);const Te=(0,a.I4)((()=>{A?_.cancelMessageMediaDownload({message:t}):_.downloadMessageMedia({message:t})}),[_,A,t]),Me=(0,a.I4)((e=>{if(Y.current&&H.current){const{width:t,left:n}=H.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),ve(Math.max(Math.min(pe*((a-n)/t),pe-.1),.001))}}),[pe,ve]),Se=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(Y.current=!0,j.current=de,fe(),Me(e))}),[Me,fe,de]),xe=(0,a.I4)((()=>{Y.current=!1,j.current&&he()}),[he]),Le=(0,a.I4)((()=>{U(t.id,t.chatId)}),[U,t.id,t.chatId]);function $e(){if(K)return n||"Voice";const{title:e,fileName:t}=B;return e||t}(0,a.d4)((()=>{if(H.current&&Ee)return(0,Z.s)(H.current,{onCapture:Se,onRelease:xe,onClick:xe,onDrag:Me})}),[Ee,Se,Me,xe]);const Fe=(0,d.Z)("Audio",L,ge&&M===i.Cr.Inline&&"own",(M===i.Cr.Search||M===i.Cr.SharedMedia)&&"bigger",F&&"audio-is-selected"),Ae=["toggle-play"];ke?Ae.push("loading"):de?Ae.push("pause"):de||Ae.push("play");const Oe=(0,d.Z)("content",Ee&&"with-seekline");function Re(){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:Oe},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:$e()},(0,u.Z)($e())),a.ZP.createElement("div",{className:"message-date"},S&&a.ZP.createElement(N.Z,{className:"date",onClick:Le},(0,l.VX)(q,1e3*S)))),Ee&&a.ZP.createElement("div",{className:"meta search-result",dir:W?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},ue<1&&`${(0,l.k9)(pe*ue,pe)}`),I(ue,oe,H)),!Ee&&function(){if(K)return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,l.k9)((V||X).duration));const{performer:e}=B;return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,l.k9)(pe),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,u.Z)(e)),e&&n&&a.ZP.createElement("span",{className:"bullet"},"•"),n&&a.ZP.createElement("span",{title:n},(0,u.Z)(n)))}()))}return a.ZP.createElement("div",{className:Fe,dir:q.isRtl?"rtl":"ltr"},$&&a.ZP.createElement("div",{className:"message-select-control"},F&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(C.Z,{round:!0,ripple:!o.wB,size:"smaller",color:te?"translucent-white":"primary",className:Ae.join(" "),ariaLabel:de?"Pause audio":"Play audio",onClick:Ie,isRtl:q.isRtl,backgroundImage:te},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),Ne&&a.ZP.createElement("div",{className:(0,d.Z)("media-loading",we,ke&&"interactive")},a.ZP.createElement(b.Z,{progress:be,transparent:!0,size:"m",onClick:ke?Ie:void 0,noCross:!ke})),B&&!ye&&a.ZP.createElement(C.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:A?"Cancel download":"Download",onClick:Te},a.ZP.createElement("i",{className:A?"icon-close":"icon-arrow-down"})),M===i.Cr.Search&&Re(),M!==i.Cr.Search&&B&&function(e,t,n,r,s,i,o,c,d,h,f){const{title:v,performer:p,fileName:g}=t,Z=r||s>0&&s<1,{isRtl:E}=y.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:v},(0,u.Z)(v||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,l.k9)(n*s,n)),I(s,i,o)),!Z&&c&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},h?`${(0,m.yW)(t.size*h)} / `:void 0,(0,m.yW)(t.size)),!Z&&!c&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,l.k9)(n)),a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:p},(0,u.Z)(p||"Unknown")),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(N.Z,{className:"date",onClick:f},(0,l.ZK)(e,1e3*d,!0)))))}(q,B,pe,de,ue,oe,H,A||ye,S,be,U?Le:void 0),M===i.Cr.SharedMedia&&(V||X)&&Re(),M===i.Cr.Inline&&V&&function(e,t,n,r,s){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),a.ZP.createElement("p",{className:(0,d.Z)("voice-duration",s&&"unread"),dir:"auto"},0===r?(0,l.k9)(e.duration):(0,l.k9)(e.duration*r)))}(V,H,Ze,ue,z))}))},180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),l=n(4319),c=n(6272),d=n(9107),u=n(1876),m=n(3321);const h=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n,countryList:{phoneCodes:a}}=e,r=t?(0,s.Z1)(e,t):void 0,o=(0,i.YC)(t)?(0,s.dy)(e,t):void 0,l=r&&(0,i.i4)(r,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,phoneCodeList:a,chat:r,user:o,canInviteUsers:r&&!o&&(!(0,i.eA)(r)&&!(0,i.Mg)(r,"inviteUsers")||(0,i.VE)(r,"inviteUsers")),isMuted:l}}))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:s,canInviteUsers:h,isMuted:f,phoneCodeList:v})=>{const{loadFullUser:p,showNotification:g,updateChatMutedState:Z}=(0,r.uC)(),{id:E,fullInfo:P,username:y,phoneNumber:C,isSelf:b}=t||{},{id:N}=n||{},w=(0,d.Z)();(0,a.d4)((()=>{e&&E&&p({userId:E})}),[p,E,e]);const k=(0,a.I4)((()=>{Z({chatId:N,isMuted:!f})}),[N,f,Z]);if(!n||n.isRestricted||b&&!s)return;function I(e,t){(0,l.TE)(e),g({message:`${t} was copied`})}const T=C&&(0,c.WZ)(v,C),M=(0,i.hu)(n),S=(null==P?void 0:P.bio)||(0,i.GM)(n);return a.ZP.createElement("div",{className:"ChatExtra"},T&&!!T.length&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(T,w("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},T),a.ZP.createElement("span",{className:"subtitle"},w("Phone"))),y&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(`@${y}`,w("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(y)),a.ZP.createElement("span",{className:"subtitle"},w("Username"))),S&&!!S.length&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(S,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},w(E?"UserBio":"Info"))),(h||!y)&&M&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(M,w("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},M),a.ZP.createElement("span",{className:"subtitle"},w("SetUrlPlaceholder"))),!s&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:k},a.ZP.createElement("span",null,w("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:E?"Toggle User Notifications":"Toggle Chat Notifications",checked:!f,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(9107),l=n(2340),c=n(172),d=n(3103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,{chat:t})=>{const n=(0,i.YC)(t.id),a=(0,s.FM)(e,t.id),r=n&&(0,s.dy)(e,(0,i.zX)(t)),o=r&&(0,i.cS)(r)&&!t.isSupport,l=n&&!a&&!o,c=n?(0,i.Vl)((0,s.dy)(e,(0,i.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:o,isChannel:(0,i.eA)(t),isBasicGroup:(0,i.G9)(t),isSuperGroup:(0,i.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:c}}))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:s,isChatWithSelf:m,isBot:h,isBasicGroup:f,isSuperGroup:v,currentUserId:p,canDeleteForAll:g,contactName:Z,onClose:E,onCloseAnimationEnd:P})=>{const{leaveChannel:y,deleteHistory:C,deleteChannel:b,deleteChatUser:N,blockContact:w}=(0,r.uC)(),k=(0,o.Z)(),I=(0,i.U)(k,t),T=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),E()}),[C,t.id,E]),M=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),w({contactId:t.id,accessHash:t.accessHash}),E()}),[C,t.id,t.accessHash,w,E]),S=(0,a.I4)((()=>{s?C({chatId:t.id,shouldDeleteForAll:!1}):f?(N({chatId:t.id,userId:p}),C({chatId:t.id,shouldDeleteForAll:!1})):!n&&!v||t.isCreator?(n||v)&&t.isCreator&&b({chatId:t.id}):y({chatId:t.id}),E()}),[s,f,n,v,p,t.isCreator,t.id,E,C,N,y,b]);return a.ZP.createElement(d.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:k.isRtl?"rtl":void 0},a.ZP.createElement(c.Z,{size:"tiny",chat:t,isSavedMessages:m}),a.ZP.createElement("h3",{className:"modal-title"},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:P},n&&t.isCreator?a.ZP.createElement("p",null,(0,l.Z)(k("ChatList.DeleteAndLeaveGroupConfirmation",I),["simple_markdown"])):n&&!t.isCreator||f||v?a.ZP.createElement("p",null,(0,l.Z)(k("ChannelLeaveAlertWithName",I),["simple_markdown"])):a.ZP.createElement("p",null,(0,l.Z)(k("ChatList.DeleteChatConfirmation",Z),["simple_markdown"])),h&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},k("DeleteAndStop")),g&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},Z?(0,l.Z)(k("ChatList.DeleteForEveryone",Z)):k("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":f||v?"Group.LeaveGroup":g?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},k("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(5376),i=n(2858),o=n(3657),l=n(2566),c=n(6202),d=n(706),u=n(7002);const m=(0,a.X$)((({message:e,observeIntersection:t,smaller:n,canAutoLoad:m,autoLoadFileMaxSizeMb:h,uploadProgress:f,withDate:v,datetime:p,className:g,sender:Z,isSelected:E,isSelectable:P,onCancelUpload:y,onMediaClick:C,onDateClick:b,isDownloading:N})=>{const w=(0,r.uC)(),k=(0,a.sO)(null),I=e.content.document,{fileName:T,size:M,timestamp:S}=I,x=(0,s.K2)(I)||"",L=(0,o.Op)(k,t),[$,F]=(0,d.Z)();(0,a.d4)((()=>{L&&F()}),[L,F]);const[A,O]=(0,a.eJ)(m&&(!h||M<=1048576*h)),R=Boolean(N||A&&$),D=(0,i.Ti)(e,"download"),{loadProgress:U,mediaData:B}=(0,l.Z)(D,!R,void 0,void 0,void 0,!0),V=Boolean(B),{isUploading:X,isTransferring:z,transferProgress:K}=(0,i.Sc)(e,f||U,R&&!V),Y=(0,s.v6)(I),j=Y?(0,i.DH)(e):void 0,H=Y?I.previewBlobUrl:void 0,q=(0,c.Z)((0,i.Ti)(e,"pictogram"),!L),W=C&&Boolean(I.mediaType),_=(0,a.I4)((()=>{X?y&&y():N?w.cancelMessageMediaDownload({message:e}):z?O(!1):W?C():w.downloadMessageMedia({message:e})}),[X,N,z,W,y,w,e,C]),J=(0,a.I4)((()=>{b(e.id,e.chatId)}),[b,e.id,e.chatId]);return a.ZP.createElement(u.Z,{ref:k,name:T,extension:x,size:M,timestamp:v?p||S:void 0,thumbnailDataUri:j,previewData:H||q,smaller:n,isTransferring:z,isUploading:X,transferProgress:K,className:g,sender:Z,isSelectable:P,isSelected:E,actionIcon:W?(0,i.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:_,onDateClick:b?J:void 0})}))},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(1212),s=n(692),i=n(6752),o=n(790),l=n(5376),c=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,a.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:p,thumbnailDataUri:g,previewData:Z,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const M=(0,u.Z)();let S=(0,a.sO)(null);e&&(S=e);const x=(0,s.Z)(Z),{shouldRender:L,transitionClassNames:$}=(0,r.Z)(y,void 0,!0),F=(0,l.Oh)(f),A=(0,l.yW)(n),{width:O,height:R}=(0,c.lE)(P),D=(0,i.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:S,className:D,dir:M.isRtl?"rtl":void 0},b&&a.ZP.createElement("div",{className:"message-select-control"},N&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},g||Z?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:g,width:O,height:R,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:Z,className:(0,i.Z)("full-media",x),width:O,height:R,alt:""})):a.ZP.createElement("div",{className:`file-icon ${F}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),L&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",F,$)},a.ZP.createElement(m.Z,{progress:w,size:P?"s":"m",onClick:C?I:void 0})),I&&a.ZP.createElement("i",{className:(0,i.Z)("action-icon",k||"icon-download",L&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,y&&w?`${Math.round(100*w)}%`:A),p&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:T},(0,o.ZK)(M,1e3*v,!0))))),p&&v&&a.ZP.createElement(h.Z,{onClick:T},(0,o.VX)(M,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1713),i=n(2858),o=n(1638),l=n(2340),c=n(9107),d=n(172),u=n(9411),m=n(8729);const h=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=(0,o.Z1)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?(0,o.YK)(e,a):void 0,areMessagesLoaded:Boolean((0,o.Zw)(e,t))}}))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:o,withFullInfo:h,withUpdatingStatus:f,withChatType:v,noRtl:p,chat:g,onlineCount:Z,areMessagesLoaded:E,lastSyncTime:P})=>{const{loadFullChat:y,openMediaViewer:C}=(0,r.uC)(),b=g&&(0,i.ZV)(g),{id:N,isMin:w,isRestricted:k}=g||{};(0,a.d4)((()=>{N&&!w&&h&&P&&y({chatId:N})}),[N,w,P,h,y,b]);const I=(0,a.I4)(((e,n)=>{g&&n&&(e.stopPropagation(),C({avatarOwnerId:g.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[g,t,C]),T=(0,c.Z)();if(g)return a.ZP.createElement("div",{className:"ChatInfo",dir:!p&&T.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:g.id,size:t,chat:g,onClick:n?I:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,l.Z)((0,i.U)(T,g))),g.isVerified&&a.ZP.createElement(u.Z,null)),function(){if(f&&!E&&!k)return a.ZP.createElement("span",{className:"status",dir:"auto"},T("Updating"));if(!g)return;if(e)return a.ZP.createElement(m.Z,{typingStatus:e});if(v)return a.ZP.createElement("div",{className:"status",dir:"auto"},T((0,i.l6)(g)));const t=o?g.username:void 0,n=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(T,g),r=Z?`, ${T("OnlineCount",Z,"i")}`:void 0;return a.ZP.createElement("div",{className:"status"},t&&a.ZP.createElement("span",{className:"handle"},t),a.ZP.createElement("span",{className:"group-status"},n),r&&a.ZP.createElement("span",{className:"online-status"},r))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(790),s=n(9107),i=n(8018);const o=(0,a.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},t&&a.ZP.createElement(i.Z,{status:t}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(790),s=n(3227),i=n(2858),o=n(6752),l=n(6202),c=n(692);const d=(0,a.X$)((({message:e,idPrefix:t="shared-media",isProtected:n,onClick:d})=>{const u=(0,a.I4)((()=>{d(e.id,e.chatId)}),[e.id,e.chatId,d]),m=(0,i.DH)(e),h=(0,l.Z)((0,i.Ti)(e,"pictogram")),f=(0,c.Z)(h),v=(0,i.b7)(e);return a.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:d?u:void 0},a.ZP.createElement("img",{src:m,alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),a.ZP.createElement("img",{src:h,className:(0,o.Z)("full-media",f),alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),v&&a.ZP.createElement("span",{className:"video-duration"},v.isGif?"GIF":(0,r.k9)(v.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>i});var a,r=n(4050),s=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const i=(0,r.X$)((({status:e})=>r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(s.Z,{name:"reveal",activeKey:a[e]},(()=>r.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(6752),s=n(1212),i=n(2340),o=n(9107);const l=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,o.Z)(),{transitionClassNames:l}=(0,s.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",l,t&&"with-description")},e,t&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(2858),s=n(1273),i=n(4605),o=n(7687),l=n(1876),c=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),f=n(4288);const v=(0,a.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:v,notFoundText:p,searchInputId:g,isLoading:Z,noScrollRestore:E,onSelectedIdsChange:P,onFilterChange:y,onLoadMore:C})=>{const b=(0,a.sO)(null),N=t.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const w=(0,a.I4)((e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),P(n),y("")}),[t,P,y]),k=(0,a.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),M=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:M.isRtl?"rtl":void 0},t.map(((e,n)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&n<t.length-5,canClose:!0,onClick:w,clickArg:e}))),a.ZP.createElement(o.Z,{id:g,ref:b,value:n,onChange:k,placeholder:v||M("SelectChat")})),null!=I&&I.length?a.ZP.createElement(s.Z,{className:"picker-list custom-scroll",items:I,onLoadMore:T,noScrollRestore:E},I.map((e=>a.ZP.createElement(l.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>w(e),ripple:!0},a.ZP.createElement(i.Z,{label:"",checked:t.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(c.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):Z||!I||I.length?a.ZP.createElement(f.Z,null):a.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),l=n(6752),c=n(9107),d=n(172);const u=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,i.YC)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:r,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,c.Z)();let p,g;if(e&&t)p=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${e}`})),g=t;else if(m||h){p=a.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,i.Vl)(h):(0,i.U)(v,m,h);g=e?(0,o.Z)(e):void 0}const Z=(0,l.Z)("PickerSelectedItem",f,n&&"minimized",r&&"closeable");return a.ZP.createElement("div",{className:Z,onClick:()=>s(u),title:n?g:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},g),r&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1713),i=n(1638),o=n(2858),l=n(2340),c=n(9107),d=n(172),u=n(9411),m=n(8729);const h=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,s=(0,i.dy)(e,t);return{lastSyncTime:a,user:s,userStatus:(0,i.ss)(e,t),isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,i.Zw)(e,t)),serverTimeOffset:r}}))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:i,withUsername:h,withFullInfo:f,withUpdatingStatus:v,noStatusOrTyping:p,noRtl:g,user:Z,userStatus:E,isSavedMessages:P,areMessagesLoaded:y,lastSyncTime:C,serverTimeOffset:b})=>{const{loadFullUser:N,openMediaViewer:w}=(0,r.uC)(),{id:k}=Z||{},I=(0,o.Js)(Z);(0,a.d4)((()=>{f&&C&&k&&N({userId:k})}),[k,N,C,f]);const T=(0,a.I4)(((e,n)=>{Z&&n&&(e.stopPropagation(),w({avatarOwnerId:Z.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[Z,t,w]),M=(0,c.Z)();if(Z)return a.ZP.createElement("div",{className:"ChatInfo",dir:!g&&M.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:Z.id,size:t,user:Z,isSavedMessages:P,onClick:i?T:void 0}),a.ZP.createElement("div",{className:"info"},P?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,M("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},I&&(0,l.Z)(I)),(null==Z?void 0:Z.isVerified)&&a.ZP.createElement(u.Z,null)),(n||!P&&!p)&&(n?a.ZP.createElement("span",{className:"status",dir:"auto"},n):v&&!y?a.ZP.createElement("span",{className:"status",dir:"auto"},M("Updating")):Z?e?a.ZP.createElement(m.Z,{typingStatus:e}):a.ZP.createElement("div",{className:"status "+((0,o.kM)(Z,E)?"online":"")},h&&Z.username&&a.ZP.createElement("span",{className:"handle"},Z.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,o.Tq)(M,Z,E,b))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(4050),r=n(5116),s=n(1713),i=n(7361),o=n(1638),l=n(2858),c=n(2340),d=n(1174),u=n(6752),m=n(6137),h=n(647),f=n(9107),v=n(9411),p=n(2155),g=n(6202),Z=n(2937),E=n(7204),P=n(9204);const y=(0,a.X$)((({chat:e,user:t,photo:n,isFirstPhoto:r,isSavedMessages:s,lastSyncTime:i,onClick:o})=>{const d=(0,f.Z)(),h=t&&(0,l.NB)(t),v=e&&(0,l.pK)(e.id);function y(a,r){if(n&&!r)return`photo${n.id}?size=c`;let i;return s||h||v||(t?i=(0,l.RT)(t,a):e&&(i=(0,l.RT)(e,a))),i}const C=(0,g.Z)(y("big"),!1,m.IU.BlobUrl,i),b=r&&!C?y("normal",!0):void 0,N=(0,g.Z)(b,!1,m.IU.BlobUrl,i),w=(0,Z.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),k=C||N||w,I=(0,E.Z)(k);let T="";if(s)T=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(h)T=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(v)T=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(k)T=a.ZP.createElement("img",{src:k,className:"avatar-media",alt:"",decoding:"async"});else if(!k&&t){const e=(0,l.Js)(t);T=e?(0,p.Xv)(e,2):void 0}else if(!k&&e){const t=(0,l.U)(d,e);T=t&&(0,p.Xv)(t,(0,l.YC)(e.id)?2:1)}else T=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(P.Z,{color:"white"}));const M=(0,u.Z)("ProfilePhoto",`color-bg-${(0,l.Rs)(t||e)}`,s&&"saved-messages",h&&"deleted-account",v&&"replies-bot-account",!s&&!k&&"no-photo");return a.ZP.createElement("div",{className:M,onClick:k?o:void 0},I&&k&&I!==k&&a.ZP.createElement("img",{src:I,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof T?(0,c.Z)(T,["hq_emoji"]):T)}));var C=n(2255);const b=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:a,serverTimeOffset:r}=e,s=(0,o.dy)(e,t),i=(0,o.ss)(e,t),l=(0,o.Z1)(e,t),c=!n&&s&&s.isSelf,{animationLevel:d}=e.settings.byKey;return{connectionState:a,user:s,userStatus:i,chat:l,isSavedMessages:c,animationLevel:d,serverTimeOffset:r}}))((({forceShowSelf:e,user:t,userStatus:n,chat:o,isSavedMessages:p,connectionState:g,animationLevel:Z,serverTimeOffset:E})=>{var P;const{loadFullUser:b,openMediaViewer:N}=(0,r.uC)(),w=(0,f.Z)(),{id:k}=t||{},{id:I}=o||{},T=t?(0,l.Js)(t):o?o.title:"",M=(null==t?void 0:t.photos)||(null==o?void 0:o.photos)||[],S=Z>=1?w.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[x,L]=(0,a.eJ)(0),$=p||M.length<=1||0===x,F=p||M.length<=1||x===M.length-1;(0,a.d4)((()=>{x>M.length&&L(Math.max(0,M.length-1))}),[x,M.length]),(0,a.d4)((()=>{"connectionStateReady"===g&&k&&!e&&b({userId:k})}),[k,b,g,e]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{h.UV(`photo${e.id}?size=c`)||h.he(`photo${e.id}?size=c`,m.IU.BlobUrl)}))}),[n,t])}(0,M,x);const A=(0,a.I4)((()=>{N({avatarOwnerId:k||I,profilePhotoIndex:x,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[N,k,I,x,e]),O=(0,a.I4)((()=>{$||L(x-1)}),[x,$]),R=(0,a.I4)((()=>{F||L(x+1)}),[x,F]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,d.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===d.e.Right?(O(),!0):t===d.e.Left&&(R(),!0):void 0})}),[R,O]),!t&&!o)return;function D(){const e=!p&&M&&M.length>0?M[x]:void 0;return a.ZP.createElement(y,{key:x,user:t,chat:o,photo:e,isSavedMessages:p,isFirstPhoto:$,onClick:A})}const U=null===(P=t||o)||void 0===P?void 0:P.isVerified;return a.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",e&&"self"),dir:w.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(p||!M||M.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},M.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===x?"current":"")}))))}(),a.ZP.createElement(C.Z,{activeKey:x,name:S,className:"profile-slide-container"},D),!$&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":w("AccDescrPrevious"),onClick:O}),!F&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":w("Next"),onClick:R})),a.ZP.createElement("div",{className:"info",dir:w.isRtl?"rtl":"auto"},p?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},w("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},T&&(0,c.Z)(T)),U&&a.ZP.createElement(v.Z,null)),!p&&(t?a.ZP.createElement("div",{className:"status "+((0,l.kM)(t,n)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,l.Tq)(w,t,n,E))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,l.eA)(o)?w("Subscribers",null!==(B=o.membersCount)&&void 0!==B?B:0,"i"):w("Members",null!==(V=o.membersCount)&&void 0!==V?V:0,"i")))));var B,V})))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(6137),s=n(3657),i=n(6202),o=n(1212),l=n(706),c=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,a.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:g,onUnfaveClick:Z})=>{const E=(0,a.sO)(null),P=`sticker${e.id}`,y=`sticker-button-${e.id}`,C=(0,s.Op)(E,n),b=e.thumbnail?e.thumbnail.dataUri:void 0,N=(0,i.Z)(`${P}?size=m`,!C,r.IU.BlobUrl),w=C&&!h,k=(0,i.Z)(e.isAnimated&&P,!w,r.IU.Lottie),[I,T,M]=(0,l.Z)(Boolean(k)),S=I&&w,{transitionClassNames:x}=(0,o.Z)(Boolean(N||S),void 0,void 0,"slow");(0,a.d4)((()=>{w||M()}),[M,w]);const L=(0,c.Z)("StickerButton",p&&"interactive",e.isAnimated&&"animated",y,v),$=b&&!S?`background-image: url('${b}');`:"";return a.ZP.createElement("div",{ref:E,className:L,title:f||(null==e?void 0:e.emoji),style:$,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(g)}},!S&&a.ZP.createElement("img",{src:N,className:x}),w&&k&&a.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),Z&&a.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),Z(e)}},a.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),l=n(9107);const c=(0,a.X$)((0,r.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,l.Z)(),r=t&&!t.isSelf&&(0,i.Vl)(t);return a.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},r&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,o.Z)(r)),n(e.action).replace("{user}","").trim(),a.ZP.createElement("span",{className:"ellipsis"}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=()=>a.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(2858),s=n(6752),i=n(8035),o=n(2340),l=n(790),c=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,a.X$)((({message:e,senderTitle:t,isProtected:n,onMessageClick:h})=>{const f=(0,c.Z)();let v=(0,r.s1)(e);if(!v){const t=(0,r.T7)(e);if(t){const{url:n,domain:a}=t,s=(0,r.MK)(f,e);v={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const p=(0,a.I4)((()=>{h(e.id,e.chatId)}),[h,e.id,e.chatId]);if(!v)return;const{siteName:g,url:Z,displayUrl:E,title:P,description:y,photo:C,video:b}=v,N=!t&&(0,i.Z)(y,170),w=(0,s.Z)("WebLink scroll-item",!C&&!b&&"without-media");return a.ZP.createElement("div",{className:w,"data-initial":(g||E)[0],dir:f.isRtl?"rtl":void 0},C&&a.ZP.createElement(d.Z,{message:e,isProtected:n}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-title",onClick:p},(0,o.Z)(P||g||E)),N&&a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-description",onClick:p},(0,o.Z)(N)),a.ZP.createElement(m.Z,{url:Z,className:"site-name",text:"",isRtl:f.isRtl},Z.replace("mailto:","")||E),t&&a.ZP.createElement("div",{className:"sender-name"},(0,o.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(u.Z,{className:"date",onClick:p,isRtl:f.isRtl},(0,l.VX)(f,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>o,Gw:()=>l,Rj:()=>c,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>Z,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var a=n(3716),r=n(7361),s=n(3858),i=n(2858);const o="(max-height: 640px)",l=parseInt(getComputedStyle(document.documentElement).fontSize,10),c=240,d={width:640,height:640},u="1258816259753933",m={width:100,height:100};let h,f,v;function p(e,t,n,a){const i=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=s.Z.get();return h||(h=Math.min(30,a/l-4.5)),f||(f=Math.min(29,a/l-7)),v||(v=Math.min(29,a/l-4.5)),e?h:t?v:f}(e,a)-i)*l}function g({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:s,noAvatars:i}){const o=t/e,c=p(n,a,r,i),d=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*l:27*l}(s,o),u=s?Math.max(300,e):e;return w(c,d,u,s?t*(u/e):t)}function Z(e,t){const n=window.matchMedia(o),{width:a,height:r}=s.Z.get();let i=t&&n.matches?10:8.25;return e&&(i=n.matches?10:15),{width:a,height:r-i*l}}function E(e,t,n,a,r){const{width:s,height:o}=(0,i.HV)(e)||m;return g({width:s,height:o,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function P(e,t,n,a){const{width:r,height:s}=(0,i.jC)(e)||m;return g({width:r,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*l,height:2*l}}function C(e){return e?{width:3*l,height:3*l}:{width:3.375*l,height:3.375*l}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,i=l*(r.wB?a.w7:a.K7),o=s?i*s:i;return s&&o>i?{width:Math.round(i/s),height:i}:{width:i,height:o}}function N({width:e,height:t},n,a=!1){const{width:r,height:s}=Z(n,a);return w(r,s,e,t)}function w(e,t,n,a){const r=a/n,s=Math.min(n,e);return Math.round(s*r)>t?{width:Math.round(t/r),height:t}:{width:s,height:Math.round(s*r)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var a=n(4050),r=n(5116),s=n(6137),i=n(2858),o=n(2340),l=n(7373),c=n(88);function d(e,t,n){const a=e.content.text;if(!a||!a.text){const t=(0,i.UD)(e);return t?[t]:void 0}const{text:r,entities:s}=a;return h(r,s,t,n)}function u(e,t,n,a){const{offset:r,length:s}=e,i=new Set([t]);if(a.has(t))return;const o=[];return n.filter(((e,n)=>n>t&&e.offset>=r&&e.offset<r+s)).map((e=>u(e,n.indexOf(e),n,a))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||i.has(e)||(t=!0),i.add(e)})),t&&o.push(e)})),{entity:e,organizedIndexes:i,nestedEntities:o}}function m(e){const t=new Set,n=[];return e.forEach(((a,r)=>{if(t.has(r))return;const s=u(a,r,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,r,i){if(!t||!t.length)return f(e,n,r,i);const d=[];let u=!1;const h=m(t);function Z(t,d,m,h){const E=[],{entity:P,nestedEntities:y}=m,{offset:C,length:b,type:N}=P;let w=e.substring(t,C);const k=w.length;w&&(u&&w.length>0&&"\n"===w[0]&&(w=w.substr(1),u=!1),w&&E.push(...f(w,n,r,i)));const I=t+k,T=I+b;let M=e.substring(C,C+b);const S=[];if(u&&M.length>0&&"\n"===M[0]&&(M=M.substr(1),u=!1),N===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(e,T,t,n===y.length-1);S.push(...a),e=r}))}const x=i?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):(0,o.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case s.Vv.Bold:return`<b>${r}</b>`;case s.Vv.Italic:return`<i>${r}</i>`;case s.Vv.Underline:return`<u>${r}</u>`;case s.Vv.Code:return`<code class="text-entity-code">${r}</code>`;case s.Vv.Pre:return`\`\`\`<br/>${r}<br/>\`\`\``;case s.Vv.Strike:return`<del>${r}</del>`;case s.Vv.MentionName:return`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.userId}"\n contenteditable="false"\n dir="auto"\n >${r}</a>`;case s.Vv.Url:case s.Vv.TextUrl:return`<a\n class="text-entity-link"\n href=${v(a,e)}\n data-entity-type="${e.type}"\n dir="auto"\n >${r}</a>`;default:return r}}(P,M,S):function(e,t,n){const r="string"==typeof t&&t,i=n.length?n:t;if(!r)return f(i);switch(e.type){case s.Vv.Bold:return a.ZP.createElement("strong",null,f(i));case s.Vv.Blockquote:return a.ZP.createElement("blockquote",null,f(i));case s.Vv.BotCommand:return a.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Hashtag:case s.Vv.Cashtag:return a.ZP.createElement("a",{onClick:g,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Code:return a.ZP.createElement("code",{className:"text-entity-code"},f(i));case s.Vv.Email:return a.ZP.createElement("a",{href:`mailto:${r}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Italic:return a.ZP.createElement("em",null,f(i));case s.Vv.MentionName:return a.ZP.createElement(l.Z,{userId:e.userId},f(i));case s.Vv.Mention:return a.ZP.createElement(l.Z,{username:r},f(i));case s.Vv.Phone:return a.ZP.createElement("a",{href:`tel:${r}`,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Pre:return a.ZP.createElement("pre",{className:"text-entity-pre"},f(i));case s.Vv.Strike:return a.ZP.createElement("del",null,f(i));case s.Vv.TextUrl:case s.Vv.Url:return a.ZP.createElement(c.Z,{url:v(r,e),text:r},f(i));case s.Vv.Underline:return a.ZP.createElement("ins",null,f(i));default:return f(i)}}(P,M,S);if(Array.isArray(x)?E.push(...x):E.push(x),h&&T<d){let t=e.substring(T,d);u&&t.length>0&&"\n"===t[0]&&(t=t.substring(1)),t&&E.push(...f(t,n,r,i))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(E,e.length,t,n===h.length-1);d.push(...a),E=r})),d}function f(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach((e=>{r.push(...f(e,t,n,a))})),r}if(a)return(0,o.Z)(e,["escape_html","emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?(0,o.Z)(e,[r,"br","highlight"],{highlight:t}):(0,o.Z)(e,[r,"br"])}function v(e,t){const{type:n,url:a}=t;return n===s.Vv.TextUrl&&a?a:e}function p(e){(0,r.uC)().sendBotCommand({command:e.currentTarget.innerText})}function g(e){(0,r.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,r.uC)().searchTextMessagesLocal()}},742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>X});var a=n(4050),r=n(5116),s=n(3716),i=n(7361),o=n(7204),l=n(782),c=n(2858),d=n(1638),u=n(7407);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),f=n(4288),v=n(9107),p=n(6137),g=n(8005),Z=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(172),k=n(9411),I=n(8729),T=n(6844),M=n(329),S=n(1876),x=n(2155),L=n(126);const $=(0,a.X$)((({chat:e,isPinned:t,isMuted:n})=>{const r=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function i(){return e.unreadCount?e.unreadMentionsCount?a.ZP.createElement("div",{className:"Badge-wrapper"},a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount))):a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount)):e.hasUnreadMark?a.ZP.createElement("div",{className:s}):t?a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.ZP.createElement(L.Z,{isCustom:!0,className:"Badge-transition",isOpen:r},i)}));var F=n(742);const A=(0,a.X$)((({isSelected:e,isActive:t})=>a.ZP.createElement("div",{className:(0,P.Z)("ChatCallStatus",t&&"active",e&&!i.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null))))),O=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{var n;const a=(0,d.Z1)(e,t);if(!a||!a.lastMessage)return{};const{senderId:r,replyToMessageId:s,isOutgoing:i}=a.lastMessage,o=r?(0,d.dy)(e,r):void 0,l=(0,c.N5)(a.lastMessage),u=l&&s?(0,d.hj)(e,a.id,s):void 0,{targetUserIds:m,targetChatId:h}=l||{},f=(0,c.zX)(a),{byId:v}=e.users,{chatId:g,threadId:Z,type:E}=(0,d.Bt)(e)||{},P=t===g&&Z===p._f;return{chat:a,isMuted:(0,c.i4)(a,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:m,actionTargetChatId:h,actionTargetMessage:u,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:P,canScrollDown:P&&"thread"===E,canChangeFolder:Boolean(null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length),lastSyncTime:e.lastSyncTime,...i&&{lastMessageOutgoingStatus:(0,d.dT)(e,a.lastMessage)},...f&&{user:(0,d.dy)(e,f),userStatus:(0,d.ss)(e,f)},...m&&{usersById:v}}}))((({style:e,chatId:t,folderId:n,orderDiff:o,animationType:l,isPinned:d,chat:u,isMuted:h,user:f,userStatus:p,actionTargetUserIds:x,usersById:L,lastMessageSender:O,lastMessageOutgoingStatus:R,actionTargetMessage:D,actionTargetChatId:U,draft:B,animationLevel:V,isSelected:X,canScrollDown:z,canChangeFolder:K,lastSyncTime:Y})=>{const{openChat:j,focusLastMessage:H}=(0,r.uC)(),q=(0,a.sO)(null),[W,_,J]=(0,b.Z)(),[G,Q,ee]=(0,b.Z)(),[te,ne,ae]=(0,b.Z)(),[re,se,ie]=(0,b.Z)(),{lastMessage:oe,typingStatus:le}=u||{},ce=oe&&(0,c.Lo)(oe);(0,y.Z)(t,ce?oe.replyToMessageId:void 0,D);const de=oe&&!(0,c.bf)(oe)?(0,c.DH)(oe):void 0,ue=(0,N.Z)(oe?(0,c.Ti)(oe,"micro"):void 0),me=Boolean(oe&&(0,c.Y5)(oe)),he=(0,a.Ye)((()=>x?x.map((e=>null==L?void 0:L[e])).filter(Boolean):void 0),[x,L]);(0,a.bt)((()=>{const e=q.current;if(0!==V&&e){if(l===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(l!==m.Move)return;e.style.transform=`translate3d(0, ${100*-o}%, 0)`,(0,E.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,E.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK)}}),[V,o,l]);const fe=(0,a.I4)((()=>{j({id:t,shouldReplaceHistory:!0}),X&&z&&H()}),[X,z,j,t,H]),ve=(0,C.Z)({chat:u,user:f,handleDelete:function(){ne(),_()},handleChatFolderChange:function(){se(),Q()},folderId:n,isPinned:d,isMuted:h,canChangeFolder:K}),pe=(0,v.Z)();if(!u)return;const ge=(0,P.Z)("Chat chat-item-clickable",(0,c.YC)(t)?"private":"group",X&&"selected");return a.ZP.createElement(S.Z,{ref:q,className:ge,style:e,ripple:!i.wB,contextActions:ve,onClick:fe},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(w.Z,{chat:u,user:f,userStatus:p,isSavedMessages:null==f?void 0:f.isSelf,lastSyncTime:Y}),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(A,{isSelected:X,isActive:0!==V})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,Z.Z)((0,c.U)(pe,u,f))),u.isVerified&&a.ZP.createElement(k.Z,null),h&&a.ZP.createElement("i",{className:"icon-muted"}),u.lastMessage&&a.ZP.createElement(T.Z,{message:u.lastMessage,outgoingStatus:R})),a.ZP.createElement("div",{className:"subtitle"},function(){if(le&&oe&&le.timestamp>1e3*oe.date)return a.ZP.createElement(I.Z,{typingStatus:le});if(null!=B&&B.text.length)return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},pe("Draft")),(0,Z.Z)(B.text));if(!oe)return;if(ce){const e=u&&((0,c.eA)(u)||oe.senderId===oe.chatId)?u:O;return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},(0,Z.Z)((0,g.D)(pe,oe,e,he,D,U,{asPlain:!0})))}const e=(0,c.zF)(pe,t,O);return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,Z.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,c.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,Z.Z)((0,c.MK)(e,t,!0))):(0,Z.Z)((0,c.MK)(e,t))}(pe,oe,ue||de,me))}(),a.ZP.createElement($,{chat:u,isPinned:d,isMuted:h}))),te&&a.ZP.createElement(M.Z,{isOpen:W,onClose:J,onCloseAnimationEnd:ae,chat:u}),re&&a.ZP.createElement(F.Z,{isOpen:G,onClose:ee,onCloseAnimationEnd:ie,chatId:t}))})));var R=n(1713),D=n(231),U=n(7854);const B=(0,a.X$)((0,r.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,d.Mw)(e,t):void 0,animatedEmoji:(0,d.zB)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:r})=>{const s=(0,v.Z)(),o=(0,a.I4)((()=>{n({type:"editFolder",payload:e}),r(R.MT.FoldersEditFolderFromChatList)}),[e,n,r]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},t&&a.ZP.createElement(U.Z,{sticker:t})),a.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&r&&a.ZP.createElement(D.Z,{ripple:!i.wB,fluid:!0,pill:!0,onClick:o,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var V;!function(e){e.all="active",e.archived="archived"}(V||(V={}));const X=(0,a.X$)((0,r.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:s},users:{byId:i},lastSyncTime:o}=e,l="folder"!==t?V[t]:void 0,c=n?(0,d.Mw)(e,n):void 0;return{allListIds:a,chatsById:r,usersById:i,lastSyncTime:o,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...l?{listIds:a[l],orderedPinnedIds:s[l]}:{chatFolder:c}}}))((({folderType:e,folderId:t,isActive:n,allListIds:d,chatsById:v,usersById:p,listIds:g,orderedPinnedIds:Z,chatFolder:E,lastSyncTime:P,notifySettings:y,notifyExceptions:C,foldersDispatch:b,onScreenSelect:N})=>{const{loadMoreChats:w,preloadTopChatMessages:k,preloadArchivedChats:I,openChat:T,openNextChat:M}=(0,r.uC)(),[S,x]=(0,a.Ye)((()=>"folder"===e&&E?(0,c.P4)(d,v,p,E,y,C):[g,Z]),[e,E,d,v,p,y,C,g,Z]),[L,$,F]=(0,a.Ye)((()=>{if(!S||"folder"===e&&!E)return[];const t=(0,c.O)(v,S,x,e),n=[].concat(t.pinnedChats,t.otherChats),a=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),a,t]}),[S,x,e,E,v]),A=(0,o.Z)(L),R=(0,a.Ye)((()=>L&&A?(0,l.Q8)(L,((e,t)=>void 0!==A[t]?e-A[t]:-1/0)):{}),[L,A]),D=(0,a.I4)((()=>{w({listType:"archived"===e?"archived":"active"})}),[w,e]),[U,V]=(0,u.Z)(P?D:void 0,$,void 0,s.t_,"all"===e&&!s.NM),X=(0,a.Ye)((()=>{if(U&&F)return(0,c.wG)(F,U)}),[F,U]);(0,a.d4)((()=>{P&&"all"===e&&(k(),I())}),[P,e,k,I]),(0,a.d4)((()=>{if(n&&$)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if(i.fl&&(i.jm&&e.metaKey||!i.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>$.length-1)return;T({id:$[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),M({targetIndexDelta:t,orderedIds:$})}}}),[n,T,M,$]);const z=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a<n&&r>0?m.Opacity:m.Move}}),[e])}(R);return a.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:U,onLoadMore:V,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=U&&U.length&&X?function(){const e=$.indexOf(U[0]),n=e+X.pinnedChats.length;return a.ZP.createElement("div",{className:"scroll-container",style:i.wZ?`height: ${$.length*s.rS}px`:void 0,teactFastList:!0},X.pinnedChats.map((({id:n},r)=>a.ZP.createElement(O,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:z(n),orderDiff:R[n],style:`top: ${(e+r)*s.rS}px;`}))),X.otherChats.map(((e,r)=>a.ZP.createElement(O,{key:e.id,teactOrderKey:(0,c.OE)(e),chatId:e.id,folderId:t,animationType:z(e.id),orderDiff:R[e.id],style:`top: ${(n+r)*s.rS}px;`}))))}():U&&!U.length?a.ZP.createElement(B,{folderId:t,folderType:e,foldersDispatch:b,onScreenSelect:N}):a.ZP.createElement(f.Z,{key:"loading"}))})))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(2858);function r(e,t,n,r){const{senderId:s}=t;if(!s)return;const i=(0,a.YC)(s)?r[s]:n[s];let o=(0,a.OU)(e,i);const l=n[t.chatId];return l&&((0,a.YC)(s)&&i.isSelf?o=`${e("FromYou")}${(0,a.U)(e,l)}`:(0,a.Bf)(l)&&(o+=`${(0,a.U)(e,l)}`)),o}},2420:(e,t,n)=>{n.d(t,{t:()=>d,Z:()=>u});var a=n(4050),r=n(1212),s=n(6752),i=n(3989),o=n(7204),l=n(706);const c=(0,a.X$)((({isQuick:e,onFileSelect:t})=>{const[n,r,i]=(0,l.Z)(),o=(0,s.Z)("DropTarget",n&&"hovered");return a.ZP.createElement("div",{className:o,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),i()}},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));const u=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:l})=>{const d=(0,a.sO)(null),u=(0,o.Z)(t),{shouldRender:m,transitionClassNames:h}=(0,r.Z)(e);(0,a.d4)((()=>e?(0,i.Z)(n):void 0),[e,n]);const f=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!1))}),[l,n]),v=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!0))}),[l,n]),p=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(d.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!m)return;const g=(0,s.Z)("DropArea",h);return a.ZP.createElement("div",{className:g,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},a.ZP.createElement(c,{onFileSelect:f}),(t||u)&&a.ZP.createElement(c,{onFileSelect:v,isQuick:!0}))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(4050),r=n(5116),s=n(3716),i=n(1638),o=n(9118),l=n(5723),c=n(6752),d=n(7361),u=n(517),m=n(2645),h=n(706),f=n(8674),v=n(6389),p=n(9107),g=n(4784),Z=n(6391),E=n(2340),P=n(3283);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyingToId:t&&n?(0,i.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}))((({id:e,chatId:t,threadId:n,isAttachmentModalInput:i,editableInputId:C,html:b,placeholder:N,forcedPlaceholder:w,canAutoFocus:k,shouldSuppressFocus:I,shouldSuppressTextFormatter:T,replyingToId:M,noTabCapture:S,messageSendKeyCombo:x,onUpdate:L,onSuppressedFocus:$,onSend:F})=>{const{editLastMessage:A,replyToNextMessage:O}=(0,r.uC)(),R=(0,a.sO)(null),D=(0,a.sO)(null),U=(0,p.Z)(),B=(0,a.sO)(!1),[V,X,z]=(0,h.Z)(),[K,Y]=(0,a.eJ)(),[j,H]=(0,a.eJ)(),q=(0,v.Z)(t,n);(0,a.d4)((()=>{i&&Q(!1)}),[i]),(0,m.Z)((([e])=>{b!==R.current.innerHTML&&(R.current.innerHTML=b),b!==D.current.innerHTML&&(D.current.innerHTML=b),void 0!==e&&e!==b&&Q(!b.length)}),[b]),(0,a.sO)(t).current=t;const W=(0,a.I4)((()=>{(0,f.zG)()?setTimeout(W,350):(0,l.Z)(R.current)}),[]),_=(0,a.I4)((()=>{z(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[z]);function J(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||B.current)return z(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(T||!(0,Z.R)(t,C||s.R2)||!n||(0,g.Z)(n)||!t.START_TO_END)||(z(),!1)}function G(){if(!J())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=R.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),Y({x:a,y:t.top-n.top}),H(e),X()}function Q(e=!1){const t=R.current,n=D.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const s=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(i):i()}(0,a.d4)((()=>{d.$b||k&&W()}),[t,W,M,k]),(0,a.d4)((()=>{if(S)return;const e=(0,o.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(W))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[W,S]),(0,a.d4)((()=>{const e=R.current;function t(){e.blur()}return I&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[I]);const ee=(0,c.Z)("form-control custom-scroll",b.length>0&&"touched",I&&"focus-disabled");return a.ZP.createElement("div",{id:e,onClick:I?$:void 0,dir:U.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:R,id:C||s.R2,className:ee,contentEditable:!0,dir:"auto",onClick:W,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(L("<br>"===t?"":t),q({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(R.current.blur(),e.removeAllRanges(),(0,l.Z)(R.current,!0))}},onKeyDown:function(e){if(!b.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void O({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||b.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",(function t(){G(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),A()):d.cj||d.wZ||!("enter"===x&&!e.shiftKey||"ctrl-enter"===x&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),z(),F())},onMouseDown:function(e){2===e.button?!0!==B.current&&(B.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{B.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{B.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){G(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:d.wZ?function(e){J()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?G:void 0}),a.ZP.createElement("div",{ref:D,className:(0,c.Z)(ee,"clone"),dir:"auto"}),!w&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},N),a.ZP.createElement(P.Z,{isOpen:V,anchorPosition:K,selectedRange:j,setSelectedRange:H,onClose:_}),w&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,E.Z)(w)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(4050),r=n(3716),s=n(6752),i=n(1396),o=n(3989),l=n(7529),c=n(1212),d=n(8758),u=n(706),m=n(9107),h=n(231);const f={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},v=document.createElement("div"),p=(0,a.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,setSelectedRange:p,onClose:g})=>{const Z=(0,a.sO)(null),E=(0,a.sO)(null),{shouldRender:P,transitionClassNames:y}=(0,c.Z)(e),[C,b,N]=(0,u.Z)(),[w,k]=(0,a.eJ)(""),[I,T]=(0,a.eJ)(!1),[M,S]=(0,a.eJ)(),[x,L]=(0,a.eJ)({});(0,a.d4)((()=>e?(0,o.Z)(g):void 0),[e,g]),(0,d.Z)(e,Z,g),(0,a.d4)((()=>{C?E.current.focus():(k(""),T(!1))}),[C]),(0,a.d4)((()=>{P||(N(),L({}),S(void 0))}),[N,P]),(0,a.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.R2;){const e=f[a.tagName];e&&(t[e]=!0),a=a.parentElement}L(t)}),[e,n,b]);const $=(0,a.I4)((()=>{const e=window.getSelection();e&&p(e.getRangeAt(0))}),[p]),F=(0,a.I4)((()=>{if(n)return v.innerText=n.toString(),v.innerHTML}),[n]),A=(0,a.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function O(){const e=E.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void S(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),S(r)}function R(e){if(x[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(x).some((t=>t!==e&&!!x[t])))return"disabled"}else if(x.monospace||x.strikethrough)return"disabled"}const D=(0,a.I4)((()=>{L((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),$(),{...e,bold:!e.bold})))}),[$]),U=(0,a.I4)((()=>{document.execCommand("italic"),$(),L((e=>({...e,italic:!e.italic})))}),[$]),B=(0,a.I4)((()=>{document.execCommand("underline"),$(),L((e=>({...e,underline:!e.underline})))}),[$]),V=(0,a.I4)((()=>{if(x.strikethrough){const e=A();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,strikethrough:!1})))}const e=F();document.execCommand("insertHTML",!1,`<del>${e}</del>`),g()}),[A,F,g,n,x.strikethrough]),X=(0,a.I4)((()=>{if(x.monospace){const e=A();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,monospace:!1})))}const e=F();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),g()}),[A,F,g,n,x.monospace]);function z(){const e=encodeURI((0,i.X)(w)||"");if(I){const t=A();if(!t||"A"!==t.tagName)return;return t.href=e,void g()}const t=F();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),g()}const K=(0,a.I4)((e=>{const t={k:b,b:D,u:B,i:U,m:X,s:V}[(0,l.Z)(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[D,U,B,X,V,b]);(0,a.d4)((()=>(e&&document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K))),[e,K]);const Y=(0,m.Z)();if(!P)return;const j=(0,s.Z)("TextFormatter",y,C&&"link-control-shown"),H=(0,s.Z)("TextFormatter-link-url-confirm",!!w.length&&"shown"),q=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.ZP.createElement("div",{ref:Z,className:j,style:q,onKeyDown:function(e){"Enter"===e.key&&C&&(z(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Bold text",className:R("bold"),onClick:D},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Italic text",className:R("italic"),onClick:U},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Underlined text",className:R("underline"),onClick:B},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:R("strikethrough"),onClick:V},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Monospace text",className:R("monospace"),onClick:X},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:Y("TextFormat.AddLinkTitle"),onClick:b},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:Y("Cancel"),onClick:N},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",M)},a.ZP.createElement("input",{ref:E,className:"TextFormatter-link-url-input",type:"text",value:w,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){k(e.target.value),O()},onScroll:O})),a.ZP.createElement("div",{className:H},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:Y("Save"),className:"color-primary",onClick:z},a.ZP.createElement("i",{className:"icon-check"}))))))}))},2400:(e,t,n)=>{n.d(t,{_:()=>o});const a=/(<br>|<br\s?\/>)/g,r=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,i=/\n$/i;function o(e){return e.replace(r," ").replace(a,"\n").replace(s,"").replace(i,"")}},6391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},3575:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(4050),r=n(3716),s=n(735),i=n(2400),o=n(4284),l=n(5723),c=n(782);const d=new WeakMap;function u(e){return(...t)=>{const n=d.get(e);if(n&&(0,c.et)(n.lastArgs,t))return n.lastResult;const a=e(...t);return d.set(e,{lastArgs:t,lastResult:a}),a}}var m=n(706);let h,f,v,p;const g=u((function(e,t,n){return e&&t.length?Object.values((0,c.q0)(e,t)).slice(0,n):s.D})),Z=u((function(e,t,n){const a=Object.values(e),r=(0,c.ee)(a,"native"),s=t?(0,c.Q8)(t,(e=>Object.values((0,c.q0)(r,e)))):{},i=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(r,e)))):{},o={...s,...i},l=[].concat(Object.keys(s),Object.keys(i)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:o,keywords:l,byName:d,names:Object.keys(d)}})),E=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:o}=e;let l=s.D;const d=r.filter((e=>e.startsWith(t))).sort();l=l.concat((0,c.xH)(Object.values((0,c.q0)(a,d))));const u=o.filter((e=>e.startsWith(t)));return l=l.concat((0,c.xH)(Object.values((0,c.q0)(i,u)))),l=(0,c.Tw)(l),l.slice(0,n)}));try{p=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){p=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function P(e,t,c,d=r.R2,u,P,y,C=!1){const[b,N,w]=(0,m.Z)(),[k,I]=(0,a.eJ)(),[T,M]=(0,a.eJ)(!1),[S,x]=(0,a.eJ)(s.D);(0,a.d4)((()=>{if(C)return;const e=()=>{I(v.emojis)};v?e():async function(){return h||(h=n.e(501).then(n.t.bind(n,7501,19)),f=(await h).default,v=(0,o.NM)(f)),h}().then(e)}),[C]),(0,a.d4)((()=>{if(!e||!t||!k||C)return void w();const n=t.includes(":")&&function(e){const t=(0,i._)(e).match(p);return t?t[0].trim():void 0}(t);if(!n)return x(s.D),void w();const a=n.length>2&&n.endsWith(":"),r=n.substr(1,a?n.length-2:void 0);let o=s.D;if(M(a),r){if(r.length>=2){const e=Z(k,P,y);o=E(e,r,36)}}else o=g(k,c,36);o.length?(a||N(),x(o)):w()}),[k,t,e,N,c,w,M,C,P,y]);const L=(0,a.I4)(((e,n)=>{const a=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==a){u(`${t.substr(0,a)}${e}`);const n=document.getElementById(d);requestAnimationFrame((()=>{(0,l.Z)(n,!0)}))}w()}),[t,d,u,w]);return(0,a.d4)((()=>{b&&T&&S.length&&L(S[0].native,!0)}),[S,L,b,T]),{isEmojiTooltipOpen:b,closeEmojiTooltip:w,filteredEmojis:S,insertEmoji:L}}},9295:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(6137),i=n(3716),o=n(2858),l=n(2400),c=n(5723),d=n(706),u=n(782);const m=(0,n(9118).P2)((e=>e()),500,!0);let h;try{h=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){h=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function f(e,t,n,f=i.R2,v,p,g){const[Z,E,P]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(v||p)&&n?m((()=>{const a=null==v?void 0:v.reduce(((e,t)=>(t.userId!==g&&e.push(t.userId),e)),[]),r=(0,o.kK)((0,u.Tw)([...t&&p||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[g,v,p]);(0,a.d4)((()=>{if(!e||!t.length)return void P();const n=t.includes("@")&&function(e){const t=(0,l._)(e).match(h);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";b(e,function(e){return e.startsWith("@")}(t))}else P()}),[e,t,b,E,P]),(0,a.d4)((()=>{null!=y&&y.length?E():P()}),[E,P,y]);const N=(0,a.I4)(((e,a=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const r=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,o.Vl)(e)}</a>`,i=t.lastIndexOf("@");if(-1!==i){n(`${t.substr(0,i)}${r}&nbsp;`);const e=document.getElementById(f);requestAnimationFrame((()=>{(0,c.Z)(e,a)}))}P()}),[t,f,n,P]);return{isMentionTooltipOpen:Z,closeMentionTooltip:P,insertMention:N,mentionFilteredUsers:y}}},7891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9290),s=n(5326);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),o=(0,a.sO)(),l=(0,s.Z)();return(0,r.Z)((()=>{n||(i.current=!1,o.current&&(clearTimeout(o.current),o.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,l()};t>0?o.current=window.setTimeout(e,t):e()}),e),i.current}},1218:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(4605);const s=(0,a.X$)((({id:e,options:t,selected:n=[],disabled:s,round:i,loadingOptions:o,onChange:l})=>{const[c,d]=(0,a.eJ)(n||[]),u=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...c,t]:c.filter((e=>e!==t)),d(a),l(a)}),[l,c]);return a.ZP.createElement("div",{id:e,className:"radio-group"},t.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==n.indexOf(e.value),disabled:s,round:i,isLoading:o?-1!==o.indexOf(e.value):void 0,onChange:u}))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(231);const i=({isShown:e,className:t,color:n="primary",ariaLabel:i,disabled:o,onClick:l,children:c})=>{const d=(0,r.Z)("FloatingActionButton",e&&"revealed",t);return a.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:o,onClick:e&&!o?l:void 0,ariaLabel:i,tabIndex:-1},c)}},1876:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(7361),s=n(9118),i=n(6752),o=n(7240),l=n(3394),c=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964);const f=e=>{const{ref:t,buttonRef:n,icon:f,className:v,style:p,children:g,disabled:Z,ripple:E,narrow:P,inactive:y,focus:C,destructive:b,multiline:N,isStatic:w,contextActions:k,onMouseDown:I,onClick:T}=e;let M=(0,a.sO)(null);t&&(M=t);const[S,x,L]=(0,c.Z)(),{isContextMenuOpen:$,contextMenuPosition:F,handleBeforeContextMenu:A,handleContextMenu:O,handleContextMenuClose:R,handleContextMenuHide:D}=(0,o.Z)(M,!k),U=(0,a.I4)((()=>M.current),[]),B=(0,a.I4)((()=>M.current.closest(".custom-scroll")),[]),V=(0,a.I4)((()=>M.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:X,positionY:z,style:K}=(0,l.Z)(F,U,B,V),Y=(0,a.I4)((e=>{!Z&&T&&(T(e),r.$b&&!E&&(x(),(0,s.T2)(L)))}),[Z,x,T,E,L]),j=(0,a.I4)((e=>{y||r.$b||(!k||2!==e.button&&T||A(e),0===e.button&&(T?Y(e):O(e)))}),[y,k,T,A,O,Y]),H=(0,d.Z)(),q=(0,i.Z)("ListItem",v,!w&&"no-selection",E&&"has-ripple",P&&"narrow",Z&&"disabled",y&&"inactive",F&&"has-menu-open",C&&"focus",b&&"destructive",N&&"multiline",w&&"is-static");return a.ZP.createElement("div",{ref:M,className:q,dir:H.isRtl?"rtl":void 0,style:p,onMouseDown:I},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",S&&"active"),role:"button",ref:n,tabIndex:0,onClick:!y&&r.$b?Y:void 0,onMouseDown:j,onContextMenu:!y&&k?O:void 0},f&&a.ZP.createElement("i",{className:`icon-${f}`}),N&&a.ZP.createElement("div",{className:"multiline-item"},g),!N&&g,!Z&&!y&&E&&a.ZP.createElement(u.Z,null)),k&&void 0!==F&&a.ZP.createElement(m.Z,{isOpen:$,positionX:X,positionY:z,style:K,className:"ListItem-context-menu",autoClose:!0,onClose:R,onCloseAnimationEnd:D},k.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(3716),s=n(1212),i=n(6752),o=n(3989),l=n(2898);const c=({message:e,duration:t=3e3,containerId:n,onDismiss:c})=>{const[d,u]=(0,a.eJ)(!0),m=(0,a.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,a.I4)((()=>{u(!1),setTimeout(c,150+r.fK)}),[c]);(0,a.d4)((()=>d?(0,o.Z)(f):void 0),[d,f]),(0,a.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,a.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,a.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return a.ZP.createElement(l.Z,{className:"Notification-container",containerId:n},a.ZP.createElement("div",{className:(0,i.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},a.ZP.createElement("div",{className:"content"},e)))}},9196:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752);const s={s:22,m:25,l:28,xl:20},i=(0,a.X$)((({progress:e=0,size:t="l",square:n,transparent:i,noCross:o,onClick:l})=>{const c=s[t],d=c-4,u=c-1,m=2*d*Math.PI,h=(0,a.sO)(null);(0,a.d4)((()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`<svg\n viewBox="0 0 ${2*u} ${2*u}"\n height="${2*u}"\n width="${2*u}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${m} ${m}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${d}\n cx=${u}\n cy=${u}\n />\n </svg>`}),[h,m,u,d,e]);const f=(0,r.Z)(`ProgressSpinner size-${t}`,i&&"transparent",n&&"square",o&&"no-cross");return a.ZP.createElement("div",{ref:h,className:f,onClick:l})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(6752),s=n(9107),i=n(9204);const o=(0,a.X$)((({id:e,label:t,subLabel:n,value:o,name:l,checked:c,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,r.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return a.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:l,value:o,id:e,checked:c,onChange:h,disabled:d||u}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&a.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&a.ZP.createElement(i.Z,null))})),l=(0,a.X$)((({id:e,name:t,options:n,selected:r,disabled:s,loadingOption:i,onChange:l})=>{const c=(0,a.I4)((e=>{const{value:t}=e.currentTarget;l(t)}),[l]);return a.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>a.ZP.createElement(o,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:s,isLoading:i?i===e.value:void 0,onChange:c}))))}))},8051:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(9107);const i=(0,a.X$)((({options:e,min:t=0,max:n=(e?e.length-1:100),step:i=1,label:o,value:l,renderValue:c,disabled:d,onChange:u})=>{const m=(0,s.Z)(),h=(0,a.I4)((e=>{u(Number(e.currentTarget.value))}),[u]),f=(0,r.Z)("RangeSlider",d&&"disabled"),v=(0,a.Ye)((()=>e?l/(e.length-1)*100:(l-t)/((n-t)/i)*100),[e,l,n,t,i]);return a.ZP.createElement("div",{className:f},o&&a.ZP.createElement("div",{className:"slider-top-row",dir:m.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},o),!e&&a.ZP.createElement("span",{className:"value",dir:"auto"},c?c(l):l)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${v}%`}),a.ZP.createElement("input",{min:t,max:n,value:l,step:i,type:"range",onChange:h}),e&&a.ZP.createElement("div",{className:"slider-options"},e.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===l&&"active"),onClick:()=>u(t)},e))))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(6752),s=n(706),i=n(9107),o=n(2515),l=n(4288),c=n(231);const d=(0,a.X$)((({ref:e,children:t,parentContainerClassName:n,value:d,inputId:u,className:m,focused:h,isLoading:f,placeholder:v,disabled:p,autoComplete:g,canClose:Z,autoFocusSearch:E,onChange:P,onReset:y,onFocus:C,onBlur:b})=>{let N=(0,a.sO)(null);e&&(N=e);const[w,k,I]=(0,s.Z)(h);(0,o.Z)(N,E,I),(0,a.d4)((()=>{N.current&&(h?N.current.focus():N.current.blur())}),[h,v]);const T=(0,i.Z)(),M=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",m,w&&"has-focus"),dir:T.isRtl?"rtl":void 0},t,a.ZP.createElement("input",{ref:N,id:u,type:"text",dir:"auto",placeholder:v||T("Search"),className:"form-control",value:d,disabled:p,autoComplete:g,onChange:function(e){const{currentTarget:t}=e;P(t.value)},onFocus:function(){k(),C&&C()},onBlur:function(){I(),b&&b()},onKeyDown:M}),a.ZP.createElement("i",{className:"icon-search"}),f&&a.ZP.createElement(l.Z,null),!f&&(d||Z)&&y&&a.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:y},a.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(1212),s=n(7204),i=n(6752);const o=({isOpen:e,isCustom:t,id:n,className:o,onClick:l,children:c})=>{const{shouldRender:d,transitionClassNames:u}=(0,r.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(c),f=(0,a.sO)();return m&&!e&&(f.current=h),d&&a.ZP.createElement("div",{id:n,className:(0,i.Z)(o,u),onClick:l},e?c():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752);const s=(0,a.X$)((({id:e,name:t,value:n,label:s,checked:i=!1,disabled:o,inactive:l,noAnimation:c,onChange:d,onCheck:u})=>{const m=(0,a.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,r.Z)("Switcher",o&&"disabled",l&&"inactive",c&&"no-animation");return a.ZP.createElement("label",{className:h,title:s},a.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:o,onChange:m}),a.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(7361),s=n(1367),i=n(7204),o=n(8781),l=n(9107),c=n(6752),d=n(2972),u=n(2340);const m="Tab--active",h=(0,a.X$)((({className:e,title:t,isActive:n,badgeCount:r,isBadgeActive:s,previousActiveTab:i,onClick:o,clickArg:l})=>{const h=(0,a.sO)(null);return(0,a.d4)((()=>{if(n&&void 0===i&&h.current&&h.current.classList.add(m),!n||void 0===i)return;const e=h.current,t=e.parentElement.children[i];if(!t)return;const a=e.querySelector("i"),r=t.querySelector("i"),s=r.parentElement.offsetLeft-a.parentElement.offsetLeft,o=r.clientWidth/a.clientWidth;r.classList.remove("animate"),a.classList.remove("animate"),a.style.transform=`translate3d(${s}px, 0, 0) scale3d(${o}, 1, 1)`,(0,d.Z)(a),a.classList.add("animate"),a.style.transform="none",t.classList.remove(m),e.classList.add(m)}),[n,i]),a.ZP.createElement("div",{className:(0,c.Z)("Tab",e),onClick:()=>o(l),ref:h},a.ZP.createElement("span",null,(0,u.Z)(t),!!r&&a.ZP.createElement("span",{className:(0,c.Z)("badge",s&&"Tab__badge--active")},r),a.ZP.createElement("i",null)))})),f=r.cj?450:r.wZ?400:300,v=(0,a.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:r})=>{const c=(0,a.sO)(null),d=(0,i.Z)(t);(0,o.Z)(c.current),(0,a.d4)((()=>{const e=c.current,{scrollWidth:n,offsetWidth:a,scrollLeft:r}=e;if(n<=a)return;const i=e.childNodes[t];if(!i)return;const{offsetLeft:o,offsetWidth:l}=i,d=o-a/2+l/2;Math.abs(d-r)<16||(0,s.Z)(e,d,f)}),[t]);const u=(0,l.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:c,dir:u.isRtl?"rtl":void 0},e.map(((e,n)=>a.ZP.createElement(h,{key:e.title,title:u(e.title),isActive:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:d,onClick:r,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(3716),i=n(6752),o=n(2972),l=n(1279),c=n(5326),d=n(7204),u=n(8674);const m=Symbol("CLEANED_UP"),h="Transition__slide--active",f=({ref:e,activeKey:t,name:n,direction:f="auto",renderCount:v,shouldRestoreHeight:p,shouldCleanup:g,cleanupExceptionKey:Z,id:E,className:P,onStart:y,onStop:C,children:b})=>{const{animationLevel:N}=(0,r.Rd)().settings.byKey,w=(0,a.sO)();let k=(0,a.sO)(null);e&&(k=e);const I=(0,a.sO)({}),T=(0,d.Z)(t),M=(0,c.Z)(),S=void 0!==T&&t!==T;!v&&S&&(I.current={[T]:I.current[T]}),I.current[t]=b,(0,a.bt)((()=>{function e(){!g||void 0!==Z&&Z===T||(I.current={[T]:m},M())}const a=k.current,r=a.children;if(1===r.length&&!S)return n.startsWith("slide-optimized")&&(r[0].style.transition="none",r[0].style.transform="translate3d(0, 0, 0)"),void r[0].classList.add(h);const i=Array.from(a.childNodes);if(!S||!i.length)return;w.current=t;const c=-1===f||"auto"===f&&T>t||"inverse"===f&&T<t,d=Object.keys(I.current).map(Number),E=v?T:d.indexOf(T),P=v?t:d.indexOf(t);if("slide-optimized"===n||"slide-optimized-rtl"===n)return void function(e,t,n,a,r,i,c,d,m,f,v,p){if(!p||!v)return;if(e===s.oB)return p.style.transition="none",p.style.transform="",p.classList.remove(h),v.style.transition="none",v.style.transform="translate3d(0, 0, 0)",v.classList.add(h),void a();"slide-optimized-rtl"===t&&(n=!n);const g=(0,u.YW)();requestAnimationFrame((()=>{null==m||m(),p.style.transition="none",p.style.transform="translate3d(0, 0, 0)",v.style.transition="none",v.style.transform=`translate3d(${n?"-":""}100%, 0, 0)`,(0,o.Z)(v),p.style.transition="",p.style.transform=`translate3d(${n?"":"-"}100%, 0, 0)`,v.style.transition="",v.style.transform="translate3d(0, 0, 0)",p.classList.remove(h),v.classList.add(h),(0,l.L)(p,(()=>{r===i.current&&(p.style.transition="none",p.style.transform="",d&&(v.style.height="auto",c.style.height=`${v.clientHeight}px`),null==f||f(),g(),a())}))}))}(N,n,c,e,t,w,a,p,y,C,i[P],i[E]);if(a.classList.remove("animating"),a.classList.toggle("backwards",c),"none"===n||N===s.oB)return i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),void e();i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove(h),e.classList.toggle("from",t===E),e.classList.toggle("through",t>E&&t<P||t<E&&t>P),e.classList.toggle("to",t===P))}));const b=(0,u.YW)();requestAnimationFrame((()=>{var r;function s(){requestAnimationFrame((()=>{if(t===w.current){if(a.classList.remove("animating","backwards"),i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),p){const e=a.querySelector(`.${h}`);e&&(e.style.height="auto",a.style.height=`${e.clientHeight}px`)}null==C||C(),b(),e()}}))}a.classList.add("animating"),null==y||y();const o="mv-slide"===n?null===(r=i[P])||void 0===r?void 0:r.firstChild:"reveal"===n&&c?i[E]:i[P];o?(0,l.f)(o,s):s()}))}),[t,T,S,f,n,y,C,v,p,g,Z,N,M]),(0,a.bt)((()=>{if(p){const e=k.current,t=e.querySelector(`.${h}`)||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[p,b]);const x=I.current,L=Object.keys(v?new Array(v).fill(void 0):x).map(Number).map((e=>{const n=x[e];return"function"==typeof n?a.ZP.createElement("div",{key:e,teactOrderKey:e},n(e===t,e===T,t)):void 0}));return a.ZP.createElement("div",{ref:k,id:E,className:(0,i.Z)("Transition",P,n),teactFastList:!v&&!g},L)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>i,vb:()=>c,ZP:()=>h});var a=n(1090),r=n(782);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],o=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],s=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,r.ei)(e.folder,o);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,l);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:a,selectedChatTypes:s}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,o)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,l)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,o),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,l),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(5116),s=n(396),i=n(274),o=n(5266),l=n(9290),c=n(4532);const d=(e,t,n,d,u,m,h,f=!1,v,p,g=!1,Z=!1)=>{const E=(0,a.sO)(null),[P,y]=(0,a.eJ)(!1);let C=P;const[b,N]=(0,a.eJ)(0),w=(0,a.I4)((()=>{y(!1),p&&p()}),[p]);(0,l.Z)((()=>{E.current=(0,s.z2)(e,n,((e,a)=>{var s;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:t,toggleMuted:a,proxy:s}=E.current;y(!0),(0,c.N)(m,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:s,proxy:i,requestNextTrack:o,requestPreviousTrack:l,isFirst:c,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),s(0),(0,r.uC)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},d()||(t.nexttrack=()=>{o()}),c()||(t.previoustrack=()=>{l()})}return t}(E)),(0,c.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(!!(0,r.Rd)().audioPlayer.isMuted),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,c.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=E.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":y(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=E.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;Z||N(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}null==u||null===(s=u[e])||void 0===s||s.call(u,a)}),v,w);const{proxy:a}=E.current;P||a.paused||(y(!0),C=!0),h&&h(a)}),[e]),(0,a.d4)((()=>{P&&m&&(0,c.Ym)(m)}),[m,P]);const{play:k,pause:I,setCurrentTime:T,proxy:M,destroy:S,setVolume:x,stop:L,isFirst:$,isLast:F,requestNextTrack:A,requestPreviousTrack:O,setPlaybackRate:R,toggleMuted:D}=E.current,U=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,a.d4)((()=>{!U||(0,o.z)(M)||Z||N(M.currentTime/U)}),[U,b,M,Z]),(0,a.d4)((()=>()=>{S(g)}),[S,g]),(0,i.Z)((([e,t])=>{e===f&&d===t||M.src&&M.paused||f&&d&&!P&&k(d)}),[f,d,P,k,M.src,M.paused]);const B=(0,a.I4)((()=>{d&&k(d)}),[d,k]),V=(0,a.I4)((()=>{P?I():B()}),[I,B,P]),X=(0,a.I4)((e=>{T(e),U&&N(M.currentTime/U)}),[U,M,T]);return{isPlaying:C,playProgress:b,playPause:V,pause:I,play:B,stop:L,setCurrentTime:X,setVolume:x,audioProxy:M,duration:U,requestNextTrack:A,requestPreviousTrack:O,isFirst:$,isLast:F,setPlaybackRate:R,toggleMuted:D}}},2937:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6264),s=n(9290),i=n(1394),o=n(5326);const l=new Map;function c(e){const t=(0,a.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const s=(0,i.ao)(a);(0,r.Z)(s.getContext("2d"),0,0,s.width,s.height,2,2),t.current=s.toDataURL()}),[e]);const c=function(e,t=!1,n){const s=(0,a.sO)(e?l.get(e):void 0),c=(0,a.sO)(),d=(0,o.Z)();return c.current&&t&&(clearTimeout(c.current),c.current=void 0),(0,a.d4)((()=>{if(!e||s.current||t)return;const a=new Image;a.onload=()=>{const t=(0,i.ao)(a);(0,r.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();s.current=n,d(),l.size>=1e3&&l.clear(),l.set(e,n)},n?c.current=window.setTimeout((()=>{a.src=e}),n):a.src=e}),[e,n,d,t]),s.current}(e||void 0,Boolean(t.current));return t.current||!n&&c||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9118),s=n(5266);const i=(e=!1)=>{const[t,n]=(0,a.eJ)(!e),[i,o]=(0,a.eJ)(0),l=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),c=(0,a.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&o(t.buffered.end(0)/t.duration),l(t.readyState>=3||t.currentTime>0))}),[l]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:c,onPlaying:c,onLoadStart:c,onPause:c,onTimeUpdate:c,onProgress:c},checkBuffering(e){l(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(6264),s=n(5326),i=n(7361);function o(e,t=!1,n){const o=(0,a.sO)(null),l=(0,s.Z)();return(0,a.d4)((()=>{const a=o.current;if(!e||!a||t)return;const s=new Image,l=()=>{a.width=s.width,a.height=s.height;const e=a.getContext("2d",{alpha:!1});i.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,a.width+8,a.height+8),i.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};s.onload=()=>{n?requestAnimationFrame(l):l()},s.src=e}),[o,e,l,t,n]),o}},1470:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(5116),s=n(2858),i=n(782),o=n(9107);const l=({chat:e,user:t,handleDelete:n,handleChatFolderChange:l,folderId:c,isPinned:d,isMuted:u,canChangeFolder:m},h=!1)=>{const f=(0,o.Z)(),{isSelf:v}=t||{};return(0,a.Ye)((()=>{if(!e)return;const{toggleChatPinned:t,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:p}=(0,r.uC)(),g=m?{title:f("ChatList.Filter.AddToFolder"),icon:"folder",handler:l}:void 0,Z=d?{title:f("UnpinFromTop"),icon:"unpin",handler:()=>t({id:e.id,folderId:c})}:{title:f("PinToTop"),icon:"pin",handler:()=>t({id:e.id,folderId:c})};if(h)return(0,i.oA)([Z,g]);const E=e.unreadCount||e.hasUnreadMark?{title:f("MarkAsRead"),icon:"readchats",handler:()=>p({id:e.id})}:{title:f("MarkAsUnread"),icon:"unread",handler:()=>p({id:e.id})},P=u?{title:f("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:e.id,isMuted:!1})}:{title:f("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:e.id,isMuted:!0})},y=(0,s.pE)(e)?{title:f("Unarchive"),icon:"unarchive",handler:()=>o({id:e.id})}:{title:f("Archive"),icon:"archive",handler:()=>o({id:e.id})},C={title:(0,s.YC)(e.id)?f("Delete"):f((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n},b=void 0!==c;return(0,i.oA)([g,E,Z,!v&&P,!v&&!b&&y,C])}),[e,m,f,l,d,h,u,n,c,v])}},7240:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);function s(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const i=(e,t,n,i)=>{const[o,l]=(0,a.eJ)(!1),[c,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(l(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,c]),h=(0,a.I4)((()=>{l(!1)}),[]),f=(0,a.I4)((()=>{d(void 0),document.body.classList.remove("no-selection")}),[]);return(0,a.d4)((()=>{if(t||!r.$b||i)return;const a=e.current;if(!a)return;let o;const u=()=>{o&&(clearTimeout(o),o=void 0)},m=e=>{t||r.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(u(),o=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:i,target:o}=e.touches[0];c||n&&o.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),s(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),s(t)}),!0),document.body.classList.add("no-selection"),l(!0),d({x:t,y:i}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[c,t,i,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:f}}},3394:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t,n,r,s=0,i=0)=>{const[o,l]=(0,a.eJ)("right"),[c,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(!1),[h,f]=(0,a.eJ)(""),[v,p]=(0,a.eJ)("");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:o,y:c}=e;const u={width:0,left:0,height:0,top:0},h=r(),v=n(),g=a.getBoundingClientRect(),Z=h?{width:h.offsetWidth,height:h.offsetHeight}:u,E=v?v.getBoundingClientRect():u;let P;o+Z.width+s<E.width+E.left?(o+=3,P="left"):o-Z.width>0?(P="right",o-=3):(P="left",o=16),l(P),c+Z.height<E.height+E.top?d("top"):(d("bottom"),c-Z.height<E.top+i&&(c=E.top+E.height));const y="left"===P?Math.min(o-g.left,E.width-Z.width-16):Math.max(o-g.left,Z.width+16),C=Math.min(E.height-g.top+g.height-12,c-g.top),b=E.height-12;m(b<Z.height),p(`max-height: ${b}px;`),f(`left: ${y}px; top: ${C}px`)}),[e,s,i,r,n,t]),{positionX:o,positionY:c,style:h,menuStyle:v,withScroll:u}}},2202:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t,n){return(0,a.Ye)((()=>(0,r.Ds)((e=>e()),e,t,n)),[e,t,n])}},5790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(5116),s=n(9118);const i=(e,t,n,i)=>{const{loadMessage:o}=(0,r.uC)(),l=(0,a.Ye)((()=>{const n=(0,s.P2)(o,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}}),[o,e,t,i]);(0,a.d4)((()=>{t&&!n&&l()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t)=>{(0,a.d4)((()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},2515:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7361);function s(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},3657:(e,t,n)=>{n.d(t,{S1:()=>i,_N:()=>o,Op:()=>l});var a=n(4050),r=n(9118),s=n(8674);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:o,threshold:l,isDisabled:c},d){const u=(0,a.sO)(),m=(0,a.sO)(),h=(0,a.sO)(0),f=(0,a.sO)();m.current=d;const v=(0,a.I4)((()=>{h.current++}),[]),p=(0,a.I4)((()=>{h.current&&(h.current--,!h.current&&f.current&&(f.current(),f.current=void 0))}),[]);return(0,s.ZP)(v,p),(0,a.d4)((()=>{if(!c)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[c]),{observe:(0,a.I4)(((a,s)=>{u.current||function(){const a=new Map,s=new Map,c=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=a.get(t.target);n&&n(t,e)})),m.current&&m.current(e),s.clear()},d=t?r.P2:n?r.Ds:void 0,v=d?d(c,t||n,!i):c,p=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),h.current?f.current=()=>{v()}:v()}),{root:e.current,rootMargin:o?`${o}px`:void 0,threshold:l});u.current={observer:p,callbacks:a}}();const c=u.current;return c.observer.observe(a),s&&c.callbacks.set(a,s),()=>{s&&c.callbacks.delete(a),c.observer.unobserve(a)}}),[c]),freeze:v,unfreeze:p}}function o(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function l(e,t,n){const[r,s]=(0,a.eJ)(!t);return o(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),r}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7204);const s=(e,t,n)=>{const s=(0,r.Z)(t);return(0,a.bt)((()=>e(s||[])),t,n)}},692:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(1212);function r(e){const t=Boolean(e),{transitionClassNames:n}=(0,a.Z)(t,void 0,t,"slow");return n}},2566:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(7361),s=n(6137),i=n(9118),o=n(647),l=n(5326),c=n(6926);const d={};function u(e,t=!1,n=s.IU.BlobUrl,u,m,h=!1){const f=e?o.UV(e):void 0,v=n===s.IU.Stream||r.I_&&n===s.IU.Progressive,p=(0,l.Z)(),g=(()=>{const e=(0,a.sO)();return e.current||(e.current=(0,c.Z)(d),d[e.current]=!0),e.current})(),[Z,E]=(0,a.eJ)(f&&!v?1:0),P=(0,a.sO)(),y=(0,a.Ye)((()=>(0,i.P2)((e=>{P.current&&(!m||Date.now()-P.current>m)&&E(e)}),500,!0)),[m]);return(0,a.d4)((()=>{!t&&e&&(f?v&&setTimeout((()=>{E(.75)}),1500):(E(0),P.current&&o.cC(y),P.current=Date.now(),o.he(e,n,h,y,g).then((()=>{const e=Date.now()-P.current;P.current=void 0,!m||e>=m?p():setTimeout(p,m-e)}))))}),[t,e,f,n,u,p,v,m,y,h,g]),(0,a.d4)((()=>{t&&P.current&&(o.cC(y),E(0),P.current=void 0)}),[y,t]),(0,a.d4)((()=>()=>{e&&o.Iq(e,g)}),[g,e]),{mediaData:f,loadProgress:Z}}},6503:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);let s;function i(e,t,n=250,i=!1){const o=(0,a.sO)(!1),l=(0,a.I4)((()=>{o.current=!0}),[]);return(0,a.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||r.$b||i||(s=window.setTimeout((()=>{o.current||t()}),2*n))}),[i,e,n,t]),[(0,a.I4)((()=>{o.current=!0}),[]),(0,a.I4)((()=>{o.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{o.current||t()}),n)}),[n,t]),l]}},2678:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(7204),s=n(5326),i=n(9290);function o(e,t){const n=(0,r.Z)(e,!0),o=(0,a.sO)(),l=(0,s.Z)(),c=null!=e,d=null!=n;return c&&o.current&&(clearTimeout(o.current),o.current=void 0),(0,i.Z)((()=>{t&&!c&&d&&!o.current&&(o.current=window.setTimeout((()=>{o.current=void 0,l()}),t))}),[e]),o.current&&t&&!c?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);function r(e,t){const n=(0,a.sO)(e),[r,s]=(0,a.eJ)(t);return[r,(0,a.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},6389:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(5116),s=n(3716),i=n(9118);const o=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{(0,r.uC)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.o_)),[e,t])},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const a=[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],r=[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];function s(e,t,n,s,i,o,l){if(Number.isNaN(o)||o<1)return;o|=0,Number.isNaN(l)&&(l=1),(l|=0)>3&&(l=3),l<1&&(l=1);const c=e.getImageData(t,n,s,i),d=c.data;let u,m,h,f,v,p,g,Z,E,P,y,C,b=s-1,N=i-1,w=o+1,k=[],I=[],T=[],M=a[o],S=r[o],x=[],L=[];for(;l-- >0;){for(C=y=0,v=0;v<i;v++){for(u=d[C]*w,m=d[C+1]*w,h=d[C+2]*w,p=1;p<=o;p++)g=C+((p>b?b:p)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(f=0;f<s;f++)k[y]=u,I[y]=m,T[y]=h,0==v&&(x[f]=((g=f+w)<b?g:b)<<2,L[f]=(g=f-o)>0?g<<2:0),Z=C+x[f],E=C+L[f],u+=d[Z++]-d[E++],m+=d[Z++]-d[E++],h+=d[Z++]-d[E++],y++;C+=s<<2}for(f=0;f<s;f++){for(P=f,u=k[P]*w,m=I[P]*w,h=T[P]*w,p=1;p<=o;p++)P+=p>N?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v<i;v++)d[y]=u*M>>>S,d[y+1]=m*M>>>S,d[y+2]=h*M>>>S,0==f&&(x[v]=((g=v+w)<N?g:N)*s,L[v]=(g=v-o)>0?g*s:0),Z=f+x[v],E=f+L[v],u+=k[Z]-k[E],m+=I[Z]-I[E],h+=T[Z]-T[E],y+=s<<2}}e.putImageData(c,t,n)}},396:(e,t,n)=>{n.d(t,{Es:()=>p,z2:()=>g,An:()=>E});var a=n(5116),r=n(1713),s=n(7361),i=n(4753),o=n(5266),l=n(2858),c=n(9118),d=n(1638);const u=new Map;let m,h=[],f=[];function v(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=Z(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!s)return;if(!u.has(s))return void(0,a.uC)().openAudioPlayer((0,l.Ak)(P(s).messageKey));const o=u.get(s);o.onForcePlay&&o.onForcePlay(),m=s,o.audio.src&&(0,i.Z)(o.audio)}function p(){const e=m&&u.get(m);e&&e.audio.pause()}function g(e,t,n,p,g){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function s(t){return n=>{u.has(e)&&((0,o.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",s("onTimeUpdate")),r.addEventListener("play",s("onPlay")),r.addEventListener("pause",s("onPause")),r.addEventListener("loadstart",s("onLoadStart")),r.addEventListener("loadeddata",s("onLoadedData")),r.addEventListener("playing",s("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,o.z)(r)||v(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,p,g);u.set(e,n),function(e,t){"audio"!==e.type||f.includes(t)||(f.push(t),f.sort(y)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(y))}(n,e)}const{audio:E,proxy:C,handlers:b}=u.get(e);return b.push(n),{play(n){if(!E.paused)return;const c=m&&u.get(m);c&&m!==e&&(c.audio.pause(),c.audio.currentTime=0,(0,o.z)(c.audio)&&(c.audio.dataset.preventPlayAfterPatch="true"),c.onTrackChange&&c.onTrackChange()),m=e,E.src||(E.src=n,E.preload="auto",n.includes("/progressive/")&&s.s$&&(delete E.dataset.preventPlayAfterPatch,(0,o.B)(E))),(0,i.Z)(E),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:s}=(0,l.Ak)(P(t).messageKey),i=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,o=e=>e.startsWith(`msg${s}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(f=f.filter(o)),"voice"===e&&(h=h.filter(o))}(t,e)},pause(){m===e&&E.pause()},stop(){if(m===e){const e=E.src;E.pause(),(0,c.T2)((()=>{E.src="",E.src=e}))}},setCurrentTime(t){m===e&&(E.fastSeek?E.fastSeek(t):E.currentTime=t)},setVolume(t){m===e&&(E.volume=t,E.muted=!1)},setPlaybackRate(t){m===e&&(E.playbackRate=t)},toggleMuted(e){E.muted=void 0===e?!E.muted:e},proxy:C,requestNextTrack(){v(e)},isLast:()=>!Z(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!Z(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){v(e,!0)},destroy(t=!1){const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(f=f.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function Z(e,t=r.Cr.Inline,n){const a=function(e){switch(e.type){case"audio":return f;case"voice":return h;default:return}}(u.get(e));if(!a)return;if(t===r.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:s}=(0,l.Ak)(P(e).messageKey),i=a.filter((e=>e.startsWith(`msg${s}`))),o=i.indexOf(e);if(o<0)return;let c=t===r.Cr.Inline?-1:1;return n&&(c*=-1),i[o+c]}function E(e){return`${(0,l.Tp)(e)}-${e.date}`}function P(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function y(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=P(e),{date:r,messageKey:s}=P(t),i=r-n;return 0===i?s.localeCompare(a):i}},1174:(e,t,n)=>{n.d(t,{e:()=>r,s:()=>l});var a=n(7361);let r;function s(e,t){return t?Math.sqrt((t.pageX-e.pageX)**2+(t.pageY-e.pageY)**2):0}function i(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(r||(r={}));let o=0;function l(e,t){let n,l,c=!1,d=!1,u=0,m={x:window.innerWidth/2,y:window.innerHeight/2};function h(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",v),document.addEventListener("mouseup",f),t.onDoubleClick&&Date.now()-o<300&&t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),o=Date.now();else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",v,{passive:!0}),t.addEventListener("touchend",f),t.addEventListener("touchcancel",f),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(u=s(e.touches[0],e.touches[1]),m=i(e.touches[0],e.touches[1])))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function f(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",v),n.target.removeEventListener("touchcancel",f),n.target.removeEventListener("touchend",f),n.target.removeEventListener("touchmove",v),n=void 0,a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),c?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),c=!1,d=!1,u=0,l=void 0,m={x:window.innerWidth/2,y:window.innerHeight/2}}function v(e){if(n){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&u>0&&2===e.touches.length)){const n=s(e.touches[0],e.touches[1]),a=i(e.touches[0],e.touches[1]),r=a.x-m.x,o=a.y-m.y,l=n/u;t.onZoom(e,{zoomFactor:l,initialCenterX:m.x,initialCenterY:m.y,dragOffsetX:r,dragOffsetY:o,currentCenterX:a.x,currentCenterY:a.y}),1!==l&&(c=!0)}const o=e.pageX-n.pageX,h=e.pageY-n.pageY;(Math.abs(o)>=15||Math.abs(h)>=15)&&(c=!0);let f=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:o,dragOffsetY:h}),f=!0),t.onSwipe&&!d&&(d=function(e,n,s){if(a.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),o=Math.abs(s);if(n&&s&&Math.max(i,o)/Math.min(i,o)<2)return!1;let c;if(i>=50?c="x":o>=50&&(c="y"),!c)return!1;if(l){if(l!==c)return!1}else l=c;return function(e,t,n,a,s){return"x"===t?s(e,n<0?r.Left:r.Right):"y"===t&&s(e,a<0?r.Up:r.Down)}(e,c,n,s,t.onSwipe)}(e,o,h),f=d),a.cj&&f&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",h),e.addEventListener("touchstart",h,{passive:!t.isNotPassive}),()=>{e.removeEventListener("mousedown",h),e.removeEventListener("touchstart",h)}}},1279:(e,t,n)=>{function a(e,t,n){s("transitionend",e,t,n)}function r(e,t,n){s("animationend",e,t,n)}function s(e,t,n,a){let r=!1;t.addEventListener(e,(function s(i){r||i.target!==i.currentTarget||a&&(i instanceof TransitionEvent&&i.propertyName===a||i instanceof AnimationEvent&&i.animationName===a)||(r=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>a,f:()=>r})},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},539:(e,t,n)=>{n.d(t,{Z:()=>d,N:()=>u});var a=n(5116),r=n(1713),s=n(3716),i=n(7361),o=n(8674),l=n(9933);let c=!1;function d(e,t,n,i=0,o=s.V$,l,c,d){const u=function(e,t,n=s.V$,a){const{offsetTop:i}=t,{scrollTop:o}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return o+(t+n);if(t>n)return o+(t-n)}else{if(a===r.fo.Up)return i+n;if(a===r.fo.Down)return Math.max(0,i-n)}return o}(e,t,o,l);l!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===s.oB&&(c=0),m(e,t,u,n,i,c,d)):m(e,t,u,n,i,0)}function u(){return c}function m(e,t,n,a,r=0,d,u){const{offsetTop:m,offsetHeight:v}=t,{scrollTop:p,offsetHeight:g,scrollHeight:Z}=e,E=u&&e.dataset.normalHeight?Number(e.dataset.normalHeight):g;let P;switch(p!==n&&(e.scrollTop=n),a){case"start":P=m-r-n+(i.wZ?1:0);break;case"end":P=m+v+r-(n+E);break;case"nearest":case"center":case"centerOrTop":P=v<E?m+v/2-(n+E/2):m-r-n}if(P<0){const e=-n;P=Math.max(P,e)}else if(P>0){const e=Z-(n+E);P=Math.min(P,e)}if(0===P)return;const y=n+P;if(0===d)return void(e.scrollTop=y);c=!0;const C=Math.abs(P),b=C<s.xn?f:h,N=d||s.bK+C/s.V$*(s.ck-s.bK),w=Date.now(),k=(0,o.YW)();(0,l.cK)((()=>{const t=Math.min((Date.now()-w)/N,1),n=P*(1-b(t));return e.scrollTop=Math.round(y-n),c=t<1,c||k(),c}))}function h(e){return 1-(1-e)**5}function f(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(5116),r=n(3716),s=n(9933);function i(e,t,n=300){(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),function(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:i,scrollWidth:o}=e;let l=t-r;if(l<0){const e=-r*(a?-1:1);l=Math.max(l,e)}else if(l>0){const e=o-(r+i);l=Math.min(l,e)}if(0===l)return;const c=r+l;if(0===n)return void(e.scrollLeft=c);const d=Date.now();(0,s.jt)((()=>{const t=Math.min((Date.now()-d)/n,1),a=l*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(c-a),t<1}))}(e,t,n)}},5723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(7361);function r(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),r=document.createRange(),s=e.lastChild||e;a.$b||s&&s.nodeValue?(r.selectNodeContents(s),r.collapse(!1),n.removeAllRanges(),n.addRange(r)):e.focus()}},7529:(e,t,n)=>{function a(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}n.d(t,{Z:()=>a})},4532:(e,t,n)=>{n.d(t,{N:()=>r,Ym:()=>s,Ay:()=>o,pC:()=>l,NS:()=>c,Of:()=>d});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function o(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function l(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d({title:e,artist:t,album:n,artwork:a}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:a})}},3099:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(6137),r=n(7361);const s={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function i(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return r.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/<\/?span([^>]*)?>/g,""),t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"<code>$1</code>"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<b>$2</b>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<i>$2</i>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<s>$2</s>$3"),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let i=0,o=0;const l=[];function c(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),o=i>=0?i:n,l=t.substring(0,o).length,{length:c}=t.substring(o,o+e.textContent.length);let d,u;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),{index:o,entity:{type:r,offset:l,length:c,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,l.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(c))}return Array.from(t.childNodes).forEach((e=>{o=1,c(e)})),{text:n,entities:l.length?l:void 0}}},5266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3227:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}}}]);
//# sourceMappingURL=886.2870895152d4462e05bf.js.map