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