TelegramPWA/dist/8346.4533933c305c5c058b29.js
Alexander Zinchuk f10033115d [Build]
2023-12-28 14:40:42 +01:00

2 lines
259 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[8346],{4794:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(33555),i=n(7054),s=n(42431),r=n(46752),c=n(18360),l=n(59107),d=n(31212),u=n(70172),m=n(231);const h=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const n=(0,i.Z1J)(e,t),a=(0,s.Bj)(e,t);return{groupCall:a,isActive:((0,i.jUK)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==a?.id&&Boolean(a?a.participantsCount>0&&a.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}}))((({chatId:e,isActive:t,className:n,groupCall:i,hasPinnedOffset:s})=>{const{requestMasterAndJoinGroupCall:h,subscribeToGroupCallUpdates:p}=(0,o.Sv)(),Z=(0,l.Z)(),g=(0,a.I4)((()=>{h({chatId:e})}),[h,e]),f=i?.participants,v=(0,a.Ye)((()=>{if(!f)return[];const e=(0,o.Rd)().users.byId,t=(0,o.Rd)().chats.byId;return Object.values(f).slice(0,3).map((({id:n})=>e[n]||t[n])).filter(Boolean)}),[f]);(0,a.d4)((()=>{if(i?.id&&(t||!i.isLoaded))return p({id:i.id,subscribed:!0}),()=>{p({id:i.id,subscribed:!1})}}),[i?.id,i?.isLoaded,t,p]);const{shouldRender:P,transitionClassNames:E}=(0,d.Z)(Boolean(i&&t)),y=(0,c.Z)(i?.participantsCount,!0),b=(0,c.Z)(v,!0);if(P)return a.ZP.createElement("div",{className:(0,r.Z)("GroupCallTopPane",s&&"has-pinned-offset",n,E),onClick:g},a.ZP.createElement("div",{className:"info"},a.ZP.createElement("span",{className:"title"},Z("VoipGroupVoiceChat")),a.ZP.createElement("span",{className:"participants"},Z("Participants",y??0,"i"))),a.ZP.createElement("div",{className:"avatars"},b?.map((e=>a.ZP.createElement(u.Z,{key:e.id,peer:e})))),a.ZP.createElement(m.Z,{round:!0,className:"join"},Z("VoipChatJoin")))})))},34076:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(33555),i=n(7054),s=n(46752),r=n(60706),c=n(59107);const l=({text:e,className:t})=>{const n=(0,c.Z)(),l=(0,a.sO)(),[d,u,m]=(0,r.Z)(!1),h=(0,i.FOo)((0,o.Rd)()),p=(0,a.Ye)((()=>{if(!h)return e;if(!d)return l.current||e;const t=l.current,n=[];for(let o=0;o<e.length;o++)t&&e[o]!==t[o]?n.push(a.ZP.createElement("div",{className:"LTqDt1MFKRDBjNZxKii4"},a.ZP.createElement("div",{className:"o1u1ctUWtWa2FWlC_BuT"},e[o]),a.ZP.createElement("div",{className:"tzggk5evL9EPqVAtvWEu",onAnimationEnd:m},t[o]),a.ZP.createElement("div",{className:"q6poDASGW35qQiXsD99c",onAnimationEnd:m},e[o]))):n.push(a.ZP.createElement("span",null,e[o]));return l.current=e,n}),[h,d,e]);return(0,a.d4)((()=>{u()}),[e]),a.ZP.createElement("span",{className:(0,s.Z)("Tx2CpCmpZZrHnCMUksg2",t),dir:n.isRtl?"rtl":void 0},p)}},45601:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(6137),i=n(4463),s=n(6202),r=n(21179);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c.apply(this,arguments)}const l=(0,a.X$)((function(e){const{sticker:t,noLoad:n,forcePreview:l,...d}=e,u=t?.thumbnail?.dataUri,m=t&&`sticker${t.id}`,h=(0,s.Z)(t?(0,i.RK)(t.id):void 0,n&&!l,o.IU.BlobUrl),p=(0,s.Z)(m,n);return a.ZP.createElement(r.Z,c({tgsUrl:p,previewUrl:h,thumbDataUri:u},d))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(46752),i=n(80036),s=n(60706),r=n(25190),c=n(70692),l=n(58912);const d="gp5OwinzPeHwkesmaEIR";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u.apply(this,arguments)}const m=new Set,h=(0,a.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:h,...p}=e,[Z,,g]=(0,s.Z)(Boolean(n)),f=(0,c.Z)(Z),[v,P,E]=(0,s.Z)(m.has(t)),y=(0,c.Z)(v),[b,C]=(0,s.Z)(!1),w=(0,r.Z)((()=>{P(),m.add(t)})),S=(0,r.Z)((()=>{g(),E(),setTimeout(C,300)})),{size:N}=e;return a.ZP.createElement("div",{className:(0,o.Z)(h,"oGmd77AsTbJeJk8CV6gl"),style:(0,i.Z)(void 0!==N&&`width: ${N}px; height: ${N}px;`)},n&&!b&&a.ZP.createElement("img",{src:n,className:(0,o.Z)(d,f),draggable:!1}),t&&!b&&a.ZP.createElement("img",{src:t,className:(0,o.Z)(d,y),draggable:!1,onLoad:w}),a.ZP.createElement(l.Z,u({},p,{onLoad:S})))}))},54752:(e,t,n)=>{n.d(t,{ZP:()=>M});var a=n(60748),o=n(33555),i=n(6137),s=n(91713),r=n(4463),c=n(10396),l=n(46752),d=n(64963),u=n(790),m=n(15376),h=n(32340);var p=n(42797),Z=n(23186),g=n(12019),f=n(59107),v=n(25190),P=n(6202),E=n(6701),y=n(31212),b=n(231),C=n(8337),w=n(39196);const S=window.matchMedia("(max-width: 375px)"),N=window.matchMedia("(max-width: 410px)");function I(e,t,n){return a.ZP.createElement("div",{className:"seekline",ref:n},t.map((({start:e,end:t})=>a.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`}))),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})))}const M=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:M,origin:k,date:T,noAvatars:x,className:A,isSelectable:R,isSelected:O,isDownloading:L,isTranscribing:B,isTranscriptionHidden:F,isTranscribed:D,isTranscriptionError:$,canDownload:U,canTranscribe:j,onHideTranscription:H,onPlay:z,onReadMedia:_,onCancelUpload:V,onDateClick:q})=>{const{cancelMessageMediaDownload:W,downloadMessageMedia:Y,transcribeAudio:G}=(0,o.Sv)(),{content:{audio:X,voice:K,video:J},isMediaUnread:Q}=t,ee=Boolean(K||J),te=(0,a.sO)(!1),ne=(0,a.sO)(null),ae=(0,f.Z)(),{isRtl:oe}=ae,{isMobile:ie}=(0,p.ZP)(),[se,re]=(0,a.eJ)(!1),ce=se||!0,le=(0,r.Ti)(t,"pictogram"),de=(0,P.Z)(le,!1,i.IU.BlobUrl),ue=(0,P.Z)((0,r.Ti)(t,"inline"),!ce,(0,r.kG)(t,"inline")),{loadProgress:me}=(0,E.Z)((0,r.Ti)(t,"download"),!L,(0,r.kG)(t,"download")),he=(0,v.Z)((()=>{re(!0),z(t.id,t.chatId)})),pe=(0,v.Z)((()=>{re(!1)})),{isBuffered:Ze,bufferedRanges:ge,bufferingHandlers:fe,checkBuffering:ve}=(0,g.Z)(),{isPlaying:Pe,playProgress:Ee,playPause:ye,setCurrentTime:be,duration:Ce}=(0,Z.Z)((0,c.An)(t),(0,r.XV)(t),ee?"voice":"audio",ue,fe,void 0,ve,se,he,pe,(0,r.CI)(t)),we=(0,r.B4)(t),Se=function(e,t,n=0,o=!1,i=!1,s=!1){const r=(0,a.sO)(null),{data:c,peak:l}=(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{MIN_SPIKES:a,MAX_SPIKES:o}=function(e,t){return{MIN_SPIKES:e?S.matches?16:20:25,MAX_SPIKES:e?S.matches?35:t&&N.matches?40:45:75}}(s,i),r=Math.min(n/10,1),c=Math.round(a+(o-a)*r);return function(e,t){let n=0;const a=new Array(t),o=e.length/t,i=e[0],s=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*o),c=((e[t-1]??i)+(e[t]??i)+(e[t+1]??s))/3;a[r]=c,n<c&&(n=c)}return{data:a,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),o=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=o[t]+(o[t+1]<<8);a[e]=i>>n&31}const i=Math.floor(5*(n-1)/8),s=Math.floor(5*(n-1)%8),r=o[i]+(o[i+1]<<8);return a[n-1]=r>>s&31,a}(new Uint8Array(e)),c)}),[s,t,i])||{};return(0,a.bt)((()=>{const t=r.current;t&&c&&void 0!==l&&function(e,t,n,{peak:a,fillStyle:o,progressFillStyle:i}){const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach(((e,s)=>{r.globalAlpha=s/t.length>=n?.5:1,r.fillStyle=n>s/t.length?i:o;const c=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,o,i){2<2*i&&(i=1),o<2*i&&(i=o/2),e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+2,n,t+2,n-o,i),e.arcTo(t+2,n-o,t,n-o,i),e.arcTo(t,n-o,t,n,i),e.arcTo(t,n,t+2,n,i),e.closePath()}(r,4*s,(23+c)/2,0,c,1),r.fill()}))}(t,c,n,{peak:l,fillStyle:o?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:o?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[o,l,n,c,e]),r}(e,K,Q&&!we?1:Ee,we,!x,ie),Ne=Pe||Ee>0&&Ee<1;(0,a.d4)((()=>{re(Pe)}),[Pe]);const Ie=se&&!Ze,{isUploading:Me,isTransferring:ke,transferProgress:Te}=(0,r.Sc)(t,M||me,Ie||L),{shouldRender:xe,transitionClassNames:Ae}=(0,y.Z)(ke),Re=xe&&(Ie||Me),Oe=(0,v.Z)((()=>{Me?V?.():(Pe||z(t.id,t.chatId),(0,o.Sv)().setAudioPlayerOrigin({origin:k}),re(!se),ye())}));(0,a.d4)((()=>{_&&Q&&(Pe||L)&&_()}),[Pe,Q,_,L]);const Le=(0,v.Z)((()=>{L?W({message:t}):Y({message:t})})),Be=(0,v.Z)((e=>{if(te.current&&ne.current){const{width:t,left:n}=ne.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),be(Math.max(Math.min(Ce*((a-n)/t),Ce-.1),.001))}})),Fe=(0,v.Z)((e=>{e instanceof MouseEvent&&2===e.button||(te.current=!0,Be(e))})),De=(0,v.Z)((()=>{te.current=!1})),$e=(0,v.Z)((()=>{q(t.id,t.chatId)})),Ue=(0,v.Z)((()=>{G({chatId:t.chatId,messageId:t.id})}));function je(){if(ee)return n||"Voice";const{title:e,fileName:t}=X;return e||t}(0,a.d4)((()=>{if(ne.current&&Ne)return(0,d.sf)(ne.current,{onCapture:Fe,onRelease:De,onClick:De,onDrag:Be})}),[Ne,Fe,Be,De]);const He=(0,l.Z)("Audio",A,k===s.Cr.Inline&&"inline",we&&k===s.Cr.Inline&&"own",(k===s.Cr.Search||k===s.Cr.SharedMedia)&&"bigger",O&&"audio-is-selected"),ze=["toggle-play"];Re?ze.push("loading"):ze.push(Pe?"pause":"play");const _e=(0,l.Z)("content",Ne&&"with-seekline");function Ve(){return a.ZP.createElement("div",{className:_e},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:je()},(0,h.Z)(je())),a.ZP.createElement("div",{className:"message-date"},Boolean(T)&&a.ZP.createElement(C.Z,{className:"date",onClick:$e},(0,u.VX)(ae,1e3*T)))),Ne&&a.ZP.createElement("div",{className:"meta search-result",dir:oe?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},Ee<1&&`${(0,u.k9)(Ce*Ee,Ce)}`),I(Ee,ge,ne)),!Ne&&function(){if(ee)return a.ZP.createElement("div",{className:"meta",dir:oe?"rtl":void 0},(0,u.k9)((K||J).duration));const{performer:e}=X;return a.ZP.createElement("div",{className:"meta",dir:oe?"rtl":void 0},(0,u.k9)(Ce),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,h.Z)(e)),e&&n&&a.ZP.createElement("span",{className:"bullet"},"•"),n&&a.ZP.createElement("span",{title:n},(0,h.Z)(n)))}())}return a.ZP.createElement("div",{className:He,dir:ae.isRtl?"rtl":"ltr"},R&&a.ZP.createElement("div",{className:"message-select-control"},O&&a.ZP.createElement("i",{className:"icon icon-select"})),a.ZP.createElement(b.Z,{round:!0,ripple:!ie,size:"smaller",color:de?"translucent-white":"primary",className:ze.join(" "),ariaLabel:Pe?"Pause audio":"Play audio",onClick:Oe,isRtl:ae.isRtl,backgroundImage:de},a.ZP.createElement("i",{className:"icon icon-play"}),a.ZP.createElement("i",{className:"icon icon-pause"})),xe&&a.ZP.createElement("div",{className:(0,l.Z)("media-loading",Ae,Re&&"interactive")},a.ZP.createElement(w.Z,{progress:Te,transparent:!0,size:"m",onClick:Re?Oe:void 0,noCross:!Re})),X&&U&&!Me&&a.ZP.createElement(b.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:L?"Cancel download":"Download",onClick:Le},a.ZP.createElement("i",{className:(0,l.Z)("icon",L?"icon-close":"icon-arrow-down")})),k===s.Cr.Search&&Ve(),k!==s.Cr.Search&&X&&function(e,t,n,o,i,s,r,c,l,d,p){const{title:Z,performer:g,fileName:f}=t,v=o||i>0&&i<1,{isRtl:P}=e;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:Z},(0,h.Z)(Z||f)),v&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,u.k9)(n*i,n)),I(i,s,r)),!v&&c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},d?`${(0,m.yW)(t.size*d)} / `:void 0,(0,m.yW)(t.size)),!v&&!c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,u.k9)(n)),g&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:g},(0,h.Z)(g))),Boolean(l)&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(C.Z,{className:"date",onClick:p},(0,u.ZK)(e,1e3*l,!0)))))}(ae,X,Ce,Pe,Ee,ge,ne,L||Me,T,Te,q?$e:void 0),k===s.Cr.SharedMedia&&(K||J)&&Ve(),k===s.Cr.Inline&&K&&function(e,t,n,o,i,s,r,c,d,m,h){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform-wrapper"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),m&&a.ZP.createElement(b.Z,{onClick:()=>{(c||d)&&h?h(!r):s||m()}},a.ZP.createElement("i",{className:(0,l.Z)("transcribe-icon","icon",c||d?"icon-down":"icon-transcribe",(c||d)&&!r&&"transcribe-shown")}),s&&a.ZP.createElement("svg",{viewBox:"0 0 32 24",className:"loading-svg"},a.ZP.createElement("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"var(--accent-color)","stroke-dashoffset":"1","stroke-dasharray":"32,68"})))),a.ZP.createElement("p",{className:(0,l.Z)("voice-duration",i&&"unread"),dir:"auto"},0===o?(0,u.k9)(e.duration):(0,u.k9)(e.duration*o)))}(K,ne,Se,Ee,Q,B,F,D,$,j?Ue:void 0,H))}))},65351:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),i=n(59107),s=n(70172);const r={root:"ahi3up0oMwlFJTE6hkxG","size-micro":"DOhAE8mniLY2g2i7rkfz",sizeMicro:"DOhAE8mniLY2g2i7rkfz","size-mini":"gF82cRdQRxqmTN8fLb9i",sizeMini:"gF82cRdQRxqmTN8fLb9i","size-tiny":"ecJbjvbrCkoUdtVrdBYi",sizeTiny:"ecJbjvbrCkoUdtVrdBYi","size-small":"iaKZOfQnH3hROD8QK_fq",sizeSmall:"iaKZOfQnH3hROD8QK_fq","size-small-mobile":"YP90v9JGup97HOcD2duf",sizeSmallMobile:"YP90v9JGup97HOcD2duf","size-medium":"TmYXjEqVbt0gwaoWlRHv",sizeMedium:"TmYXjEqVbt0gwaoWlRHv","size-large":"YIuShtdEPpbCXrGgmeFv",sizeLarge:"YIuShtdEPpbCXrGgmeFv","size-jumbo":"D9X7fMnC8YtoUm_wjoSA",sizeJumbo:"D9X7fMnC8YtoUm_wjoSA",avatar:"PTpUqAuoZL9Uou6MqJXX"},c=(0,a.X$)((({peers:e,size:t,className:n})=>{const c=(0,i.Z)();return a.ZP.createElement("div",{className:(0,o.Z)(n,r.root,r[`size-${t}`]),dir:c.isRtl?"rtl":"ltr"},e?.map((e=>a.ZP.createElement(s.Z,{size:t,peer:e,className:r.avatar}))))}))},70180:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),i=n(6137),s=n(83716),r=n(4463),c=n(7054),l=n(64319),d=n(6272),u=n(69118),m=n(3858),h=n(32340),p=n(274),Z=n(59107),g=n(25190),f=n(31876),v=n(83321);const P=(0,u.Ds)((e=>e()),500,!1),E=(0,a.X$)((0,o.c$)(((e,{chatOrUserId:t})=>{const{countryList:{phoneCodes:n}}=e,a=t?(0,c.Z1J)(e,t):void 0,o=(0,r.YC)(t)?(0,c.dyD)(e,t):void 0,i=a?.isForum,s=a&&(0,r.i4)(a,(0,c.dZI)(e),(0,c.NJL)(e)),{threadId:l}=(0,c.Btg)(e)||{},d=i?l:void 0,u=a?(0,c.x67)(e,a.id)?.inviteLink:void 0;let m=o?(0,c.ccz)(e,o.id)?.bio:void 0;return!m&&a&&(m=(0,c.x67)(e,a.id)?.about),{phoneCodeList:n,chat:a,user:o,canInviteUsers:a&&!o&&(!(0,r.eA)(a)&&!(0,r.Mg)(a,"inviteUsers")||(0,r.VE)(a,"inviteUsers")),isMuted:s,topicId:d,chatInviteLink:u,description:m,topicLink:d?(0,c.Pn)(e,t,d):void 0}}))((({user:e,chat:t,forceShowSelf:n,canInviteUsers:c,isMuted:u,phoneCodeList:E,topicId:y,description:b,chatInviteLink:C,topicLink:w})=>{const{loadFullUser:S,showNotification:N,updateChatMutedState:I,updateTopicMutedState:M,loadPeerStories:k}=(0,o.Sv)(),{id:T,usernames:x,phoneNumber:A,isSelf:R}=e||{},{id:O,usernames:L}=t||{},B=T||O,F=(0,Z.Z)(),[D,$]=(0,a.eJ)(!u);(0,a.d4)((()=>{$(!u)}),[u]),(0,a.d4)((()=>{T&&S({userId:T})}),[T]),(0,p.Z)((([n])=>{B&&n!==B&&(e||t&&(0,r.eA)(t))&&k({peerId:B})}),[B,t,e]);const U=Boolean(y&&y!==i._f),j=(0,a.Ye)((()=>{const e=x?.filter((e=>e.isActive));return e?.length?e:void 0}),[x]),H=(0,a.Ye)((()=>{const t=e?void 0:L?.filter((e=>e.isActive));return t?.length?t:void 0}),[L,e]),z=(0,a.Ye)((()=>{if(t)return U?w:(0,r.hu)(t)||C}),[t,U,w,C]),_=(0,g.Z)((()=>{$((e=>{const t=!e;return P((()=>{U?M({chatId:O,topicId:y,isMuted:!t}):I({chatId:O,isMuted:!t})})),t}))}));if(!t||t.isRestricted||R&&!n)return;function V(e,t){(0,l.TE)(e),N({message:`${t} was copied`})}const q=A&&(0,d.WZ)(E,A);function W(e,t){const[n,...o]=e,i=o.length?F("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?a.ZP.createElement(a.ZP.Fragment,null,o.map((({username:e},n)=>{const o=t?`${s.zHP}${e}`:`@${e}`;return a.ZP.createElement(a.ZP.Fragment,null,n>0?", ":"",a.ZP.createElement("a",{key:e,href:`${s.zHP}${e}`,onClick:e=>{(0,m.Z)(e),V(o,F(t?"Link":"Username"))},className:"text-entity-link username-link"},`@${e}`))}))):e)):void 0,r=t?`t.me/${n.username}`:n.username,c=t?`${s.zHP}${n.username}`:`@${n.username}`;return a.ZP.createElement(f.Z,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(c,F(t?"Link":"Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},r),a.ZP.createElement("span",{className:"subtitle"},i&&a.ZP.createElement("span",{className:"other-usernames"},i),F(t?"Link":"Username")))}return a.ZP.createElement("div",{className:"ChatExtra"},q&&Boolean(q.length)&&a.ZP.createElement(f.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(q,F("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},q),a.ZP.createElement("span",{className:"subtitle"},F("Phone"))),j&&W(j),b&&Boolean(b.length)&&a.ZP.createElement(f.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,h.Z)(b,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},F(T?"UserBio":"Info"))),H&&!U&&W(H,!0),(!H&&c||U)&&z&&a.ZP.createElement(f.Z,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(z,F("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},z),a.ZP.createElement("span",{className:"subtitle"},F("SetUrlPlaceholder"))),!n&&a.ZP.createElement(f.Z,{icon:"unmute",ripple:!0,onClick:_},a.ZP.createElement("span",null,F("Notifications")),a.ZP.createElement(v.Z,{id:"group-notifications",label:T?"Toggle User Notifications":"Toggle Chat Notifications",checked:D,inactive:!0})))})))},36103:(e,t,n)=>{n.d(t,{Z:()=>Rt});var a=n(60748),o=n(33555),i=n(6137),s=n(83716),r=n(57710),c=n(4463),l=n(7054),d=n(9211),u=n(46752),m=n(74288),h=n(790),p=n(65723),Z=n(70735),g=n(89455),f=n(41098),v=n(82267),P=n(97184),E=n(43858);let y;function b(e){y.focus(),e.focus()}P.cj&&(y=document.createElement("input"),y.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(y));var C=n(71394),w=n(93447);const S=20,N=/\.[^/.]+$/;async function I(e,t,a){const o=URL.createObjectURL(t),{type:i,size:r}=t;let c,l,d,u;if(s.oGt.has(i)){const n=await(0,C.pt)(o),{width:r,height:l}=n;u=!k(r,l);const m=Math.max(r,l)>1280,h=i===s.s11;if(!u){if(!a?.compressedBlobUrl&&!h&&(m||"image/jpeg"!==i)){const n=await(0,w.j)(o,m?1280/Math.max(r,l):1,"image/jpeg");return URL.revokeObjectURL(o),I(e,t,{compressedBlobUrl:n})}"image/jpeg"===i&&(e=e.replace(N,".jpg")),c={width:r,height:l}}d=Math.max(r,l)>40?await(0,w.j)(o,40/Math.max(r,l),"image/jpeg"):o}else if(s.wGh.has(i)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,C.jj)(o);u=!k(e,t),u||(c={width:e,height:t,duration:n})}catch(e){u=!0}d=await(0,C.ud)(o)}else if(s.e74.has(i)){const{duration:e,title:t,performer:a,coverUrl:i}=await async function(e){const{fetchFromUrl:t,selectCover:a}=await n.e(8505).then(n.t.bind(n,38505,23)),o=await t(e),{common:{title:i,artist:s,picture:r},format:{duration:c}}=o,l=a(r);return{title:i,performer:s,duration:c,coverUrl:l?`data:${l.format};base64,${l.data.toString("base64")}`:void 0}}(o);l={duration:e||0,title:t,performer:a},d=i}return{blobUrl:o,filename:e,mimeType:i,size:r,quick:c,audio:l,previewBlobUrl:d,shouldSendAsFile:u||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...a}}function M(e,t){return e.map((e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!e.voice||void 0,shouldSendAsSpoiler:void 0}))}function k(e,t){return Math.max(e,t)/Math.min(e,t)<=S}const T=/id="docs-internal-guid/i,x={BOLD:"700",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"line-through",SUPERSCRIPT:"super",SUBSCRIPT:"sub"},A={ANCHOR:"a",BOLD:"strong",ITALIC:"em",UNDERLINE:"u",BLOCKQUOTE:"blockquote",STRIKETHROUGH:"del",SUPERSCRIPT:"sup",SUBSCRIPT:"sub"},R=["H1","H2","H3","H4","H5","H6"];function O(e){return(new DOMParser).parseFromString(e,"text/html").body}function L(e,t){const n=document.createElement(A.ANCHOR);return n.href=t,n.appendChild(e.cloneNode(!0)),n}function B(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function F(e,t){let n=t.cloneNode(!0);return e?(e.style&&e.style.fontWeight===x.BOLD&&(n=B(n,A.BOLD)),e.style&&e.style.fontStyle===x.ITALIC&&(n=B(n,A.ITALIC)),e.style&&e.style.textDecoration===x.UNDERLINE&&(n=B(n,A.UNDERLINE)),e.style&&e.style.textDecoration===x.STRIKETHROUGH&&(n=B(n,A.STRIKETHROUGH)),e.style&&e.style.verticalAlign===x.SUPERSCRIPT&&(n=B(n,A.SUPERSCRIPT)),e.style&&e.style.verticalAlign===x.SUBSCRIPT&&(n=B(n,A.SUBSCRIPT)),n):n}function D(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),a=t;return"A"===t.nodeName&&(n=L(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(a=t.childNodes[0])),n=F(a,n),n}function $(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const a=[];for(let t=0;t<e.childNodes.length;t++)a.push(...$(e.childNodes[t]));a.map((e=>n.appendChild(e)))}else-1!==R.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=D(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),a=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(a=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=L(n.cloneNode(!0),t.childNodes[0].href),a=t.childNodes[0].childNodes[0]),n=F(a,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=D(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...$(e.childNodes[n]));return t}return[e]}function U(e){return 8!==e.nodeType}const j=/<style>(.*?)<\/style>/gs;var H=n(44139),z=n(96391),_=n(33780),V=n(32340),q=n(4809),W=n(17240),Y=n(86203),G=n(274),X=n(60706),K=n(69156),J=n(62357),Q=n(59107),ee=n(25190),te=n(87204),ne=n(33057),ae=n(56389),oe=n(31212),ie=n(33799),se=n(70971),re=n(34446),ce=n(28183);function le(e){return e.shouldSendAsFile?"file":s.oGt.has(e.mimeType)?"image":s.wGh.has(e.mimeType)?"video":s.e74.has(e.mimeType)?"audio":"file"}var de=n(52400),ue=n(11309),me=n(71790);const he=/^\/([\w@]{1,32})?$/i;var pe=n(56266),Ze=n(21262);const ge=(e,t,n,o,r,c,l)=>{(0,a.d4)((()=>{if(e)return document.addEventListener("paste",a,!1),()=>{document.removeEventListener("paste",a,!1)};async function a(e){if(!e.clipboardData)return;const a=document.activeElement;if(a&&![s.R2F,s.nYf,s.Cic].includes(a.id))return;const d=e.clipboardData.getData("text").substring(0,4096),u=e.clipboardData.getData("text/html");let m=u?(0,g.ZP)(function(e){let t=document.createElement("div");try{e=(n=e).match(T)?function(e){const t=document.createElement("body"),n=e.childNodes,a=Array.from(n).filter(U),o=[];for(const e of a)o.push(...$(e));for(let e=0;e<o.length;e++)t.appendChild(o[e].cloneNode(!0));return t}(O(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:O(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){s.eMD&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(j,"");const a=t.querySelectorAll(".text-content");return a.length&&(t=a[a.length-1]),Array.from(t.getElementsByTagName("*")).forEach((e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),g.xe[e.tagName]&&e.setAttribute("data-entity-type",g.xe[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case i.Vv.MentionName:e.replaceWith(e.textContent||"");break;case i.Vv.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()})),t.innerHTML.trimEnd()}(u),void 0,!0):void 0;m&&(0,pe.Lo)(m)&&c&&(m=(0,pe.If)(m),l?.());const{items:h}=e.clipboardData;let p=[];if(e.preventDefault(),h.length>0&&(p=await(0,Ze.Z)(h)),!p?.length&&!d)return;const Z=m?.entities?.length?m:{text:d};let f=!1;try{f="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(u,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const v=Z&&Z.text,P=p?.length&&!r&&!f;if(P){const e=await Promise.all(p.map((e=>I(e.name,e))));n((t=>t.concat(e)))}v&&(P?o(Z):t(Z,a?.id))}}),[t,r,n,e,c,l,o])};var fe=n(60130),ve=n(45332),Pe=n(58637),Ee=n(72645),ye=n(88957);let be=!1;const Ce=new Set([i.Vv.TextUrl,i.Vv.Url]);var we=n(28353),Se=n(16580);const Ne=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Ie=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Me={username:"",query:"",canShowHelp:!1,usernameLowered:""},ke=document.createElement("div");const Te=(0,Se.Z)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var xe=n(29295),Ae=n(33681),Re=n(94462);const Oe=new RegExp(`^${s.t8f.source}$`,"g");var Le=n(23989);const Be={encoderPath:new URL(n(68973),n.b).href,reuseWorker:!0},Fe={type:"audio/ogg"};let De,$e,Ue;async function je(){return De||(De=n.e(1161).then(n.t.bind(n,1161,23)),$e=(await De).default,Ue=new $e(Be)),De}async function He(e){await async function(){await je(),await Ue.start()}();const t=Date.now();let n;const a=[],o=[];Ue.ondataavailable=e=>{a.push(e)};const i=function(t,n){const a=t.sourceNode,i=a.context.createAnalyser();i.fftSize=64,a.connect(i);const s=i.frequencyBinCount,c=new Uint8Array(s);let l=!1;return function t(){if(l)return;i.getByteFrequencyData(c);const n=c.reduce(((e,t)=>e+t),0)/s/255;(t=>{o.push(255*t),e(t)})(n<.1?0:n),(0,r.i$)(t)}(),()=>{l=!0}}(Ue);return{stop:()=>new Promise(((e,s)=>{Ue.onstop=()=>{e({blob:new Blob(a,Fe),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},Ue.onerror=s;const r=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Ue.stop(),i()}),r)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Ue.pause(),n=Date.now(),i()}),e)}}}var ze=n(99203),_e=n(48778);const Ve=e=>{const{attachments:t}=e,n=(0,_e.Z)(ze.gl.Extra,"AttachmentModal",!t.length);return n?a.ZP.createElement(n,e):void 0};var qe=n(30879),We=n(85655),Ye=n(56503),Ge=n(52328),Xe=n(58964),Ke=n(43521),Je=n(43159);const Qe=(0,a.X$)((({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:o,canAttachPolls:i,canSendPhotos:r,canSendVideos:c,canSendDocuments:l,canSendAudios:d,attachBots:u,peerType:m,isScheduled:h,theme:p,shouldCollectDebugLogs:Z,onFileSelect:g,onMenuOpen:f,onMenuClose:v,onPollCreate:E})=>{const[y,b,w]=(0,X.Z)(),[S,N,I]=(0,Ye.Z)(y,w),M=r&&c,k=r||c,[T,x,A]=(0,X.Z)(),R=y||T;(0,a.d4)((()=>{y&&I()}),[y,I]),(0,a.d4)((()=>{R?f():v()}),[R,v,f]);const O=(0,ee.Z)((()=>{y?w():b()})),L=(0,ee.Z)(((e,t)=>{const{files:n}=e.target,a=(0,C.ox)(n);a?.length&&g(a,t)})),B=(0,ee.Z)((()=>{(0,We.g)(Array.from(M?s.dII:r?s.oGt:s.wGh).join(","),(e=>L(e,!0)))})),F=(0,ee.Z)((()=>{(0,We.g)(!l&&d?Array.from(s.e74).join(","):"*",(e=>L(e,!1)))})),D=(0,ee.Z)((()=>{const e=new File([(0,qe.aZ)()],s.Wpe,{type:"text/plain"});g([e])})),$=(0,a.Ye)((()=>u?Object.values(u).filter((t=>!(!m||!t.isForAttachMenu)&&(!("bots"!==m||t.id!==e||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(m)))):void 0),[u,e,m]),U=(0,Q.Z)();if(n)return a.ZP.createElement("div",{className:"AttachMenu"},a.ZP.createElement(Ke.Z,{id:"attach-menu-button",className:y?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:O,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0},a.ZP.createElement("i",{className:"icon icon-attach"})),a.ZP.createElement(Ge.Z,{id:"attach-menu-controls",isOpen:R,autoClose:!0,positionX:"right",positionY:"bottom",onClose:w,className:"AttachMenu--menu fluid",onCloseAnimationEnd:w,onMouseEnter:P.$b?void 0:S,onMouseLeave:P.$b?void 0:N,noCloseOnBackdrop:!P.$b,ariaLabelledBy:"attach-menu-button"},!o&&a.ZP.createElement(Xe.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),o&&a.ZP.createElement(a.ZP.Fragment,null,k&&a.ZP.createElement(Xe.Z,{icon:"photo",onClick:B},U(M?"AttachmentMenu.PhotoOrVideo":r?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(l||d)&&a.ZP.createElement(Xe.Z,{icon:"document",onClick:F},U(!l&&d?"InputAttach.Popover.Music":"AttachDocument")),l&&Z&&a.ZP.createElement(Xe.Z,{icon:"bug",onClick:D},U("DebugSendLogs"))),i&&a.ZP.createElement(Xe.Z,{icon:"poll",onClick:E},U("Poll")),o&&!h&&$?.map((n=>a.ZP.createElement(Je.Z,{bot:n,chatId:e,threadId:t,theme:p,onMenuOpened:x,onMenuClosed:A})))))})),et=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"BotCommandMenu",!t);return n?a.ZP.createElement(n,e):void 0},tt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"BotCommandTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var nt=n(231);const at=(0,a.X$)((0,o.c$)(((e,{messageId:t})=>{const{chatId:n}=(0,l.Btg)(e)||{};return n?{message:(0,l.hjO)(e,n,t)}:{}}))((({isOpen:e,message:t,onClose:n})=>{const{clickBotInlineButton:i}=(0,o.Sv)(),[s,r]=(0,Ye.Z)(e,n),{isKeyboardSingleUse:c}=t||{};if(t&&t.keyboardButtons)return a.ZP.createElement(Ge.Z,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:n,className:"BotKeyboardMenu",onCloseAnimationEnd:n,onMouseEnter:P.$b?void 0:s,onMouseLeave:P.$b?void 0:r,noCompact:!0},a.ZP.createElement("div",{className:"content custom-scroll"},t.keyboardButtons.map((e=>a.ZP.createElement("div",{className:"row"},e.map((e=>a.ZP.createElement(nt.Z,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>i({messageId:t.id,button:e})},e.text))))))))}))),ot=(0,a.X$)((({isOpen:e,onClick:t,text:n,isDisabled:o})=>{const i=(0,a.sO)(null);return(0,a.d4)((()=>{const e=i.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[e,n]),(0,a.d4)((()=>{const e=i.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),a.ZP.createElement(nt.Z,{className:(0,u.Z)("bot-menu",e&&"open"),round:!0,color:"translucent",disabled:o,onClick:t,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:(0,u.Z)("bot-menu-icon","icon","icon-webapp",e&&"open")}),a.ZP.createElement("span",{ref:i,className:"bot-menu-text"},n))}));var it=n(12644),st=n(17891),rt=n(32683),ct=n(65979),lt=n(66902);const dt=(0,a.X$)((0,o.c$)(((e,{shouldForceShowEditing:t})=>{const{chatId:n,threadId:a,type:o}=(0,l.Btg)(e)||{};if(!n||!a||!o)return{};const{forwardMessages:{fromChatId:i,toChatId:s,messageIds:r,noAuthors:c,noCaptions:d}}=(0,l.jUK)(e),u="scheduled"===o?(0,l.nBP)(e,n):(0,l._$9)(e,n,a),m=(0,l.FOo)(e),h=s===n,p=r?.map((t=>(0,l.hjO)(e,i,t))),Z=(0,l.Mst)(e,n,a),g=Z?.replyInfo;let f,v;if(g&&!t?f=(0,l.hjO)(e,g.replyToPeerId||n,g.replyToMsgId):u?f=(0,l.kKD)(e,n,a,o):h&&1===r.length&&(f=p?.[0]),g&&f&&!t){const{forwardInfo:t}=f,a=(0,l.FM1)(e,n);t&&(t.isChannelPost||a)&&(v=(0,l.cve)(e,f)),v||t?.hiddenUserName&&!Boolean(g.quoteText)||(v=(0,l.Urc)(e,f))}else h?(f&&(v=(0,l.cve)(e,f),v||(v=(0,l.Urc)(e,f))),v||(v=(0,l.RGZ)(e,i))):u&&f&&(v=(0,l.Urc)(e,f));const P=p?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),E=h&&1===r.length&&Boolean(f?.content.storyData),y=g?.replyToMsgId===a&&!g.replyToPeerId;return{replyInfo:g,editingId:u,message:f,sender:v,shouldAnimate:m,forwardedMessagesCount:h?r.length:void 0,noAuthors:c,noCaptions:d,forwardsHaveCaptions:P,isCurrentUserPremium:(0,l.wVz)(e),isContextMenuDisabled:E,isReplyToDiscussion:y}}))((({replyInfo:e,editingId:t,message:n,sender:i,shouldAnimate:s,forwardedMessagesCount:r,noAuthors:l,noCaptions:d,forwardsHaveCaptions:m,shouldForceShowEditing:h,isCurrentUserPremium:p,isContextMenuDisabled:Z,isReplyToDiscussion:g,onClear:f})=>{const{resetDraftReplyInfo:v,setEditingId:P,focusMessage:E,changeForwardRecipient:y,setForwardNoAuthors:b,setForwardNoCaptions:C,exitForwardMode:w}=(0,o.Sv)(),S=(0,a.sO)(null),N=(0,Q.Z)(),I="topicCreate"===n?.content.action?.type,M=Boolean(r),k=Boolean((e||t)&&n||i&&r),T=(0,st.Z)([k],k?300:void 0),{shouldRender:x,transitionClassNames:A}=(0,oe.Z)(T&&k&&!I&&!g,void 0,!s,void 0,!s),R=(0,ee.Z)((()=>{e&&!h?v():t?P({messageId:void 0}):r&&w(),f?.()}));(0,a.d4)((()=>k?(0,Le.Z)(R):void 0),[k,R]);const O=(0,ee.Z)((()=>{M||E({chatId:n.chatId,messageId:n.id,noForumTopicPanel:!0})})),L=(0,ee.Z)((e=>{e.stopPropagation(),R()})),B=(0,ee.Z)((()=>{y()})),{isContextMenuOpen:F,contextMenuPosition:D,handleContextMenu:$,handleContextMenuClose:U,handleContextMenuHide:j}=(0,W.Z)(S),H=(0,ee.Z)((()=>S.current)),z=(0,ee.Z)((()=>S.current)),V=(0,ee.Z)((()=>S.current.querySelector(".forward-context-menu .bubble"))),{positionX:q,positionY:Y,transformOriginX:G,transformOriginY:X,style:K}=(0,it.Z)(D,H,z,V);(0,a.d4)((()=>{x||U()}),[U,x]);const J=(0,u.Z)("ComposerEmbeddedMessage",A),te=(0,u.Z)("ComposerEmbeddedMessage_inner",(0,_.D)(i)),ne=e&&!h,ae=(0,a.Ye)((()=>ne?"reply":t?"edit":M?"forward":void 0),[t,M,ne]),ie=r&&r>1?N("ForwardedMessageCount",r):void 0,se=(0,a.Ye)((()=>{if(!n||!M||!n.content.text||!l||p)return n;const e=(0,c.If)(n.content.text);return{...n,content:{...n.content,text:e}}}),[p,M,n,l]);if(x)return a.ZP.createElement("div",{className:J,ref:S,onContextMenu:$,onClick:$},a.ZP.createElement("div",{className:te},a.ZP.createElement("div",{className:"embedded-left-icon"},ae&&a.ZP.createElement(ct.Z,{name:ae}),Boolean(e?.quoteText)&&a.ZP.createElement(ct.Z,{name:"quote",className:"quote-reply"})),a.ZP.createElement(rt.Z,{className:"inside-input",replyInfo:e,isInComposer:!0,message:se,sender:l?void 0:i,customText:ie,title:t&&!ne?N("EditMessage"):l?N("HiddenSendersNameDescription"):void 0,onClick:O}),a.ZP.createElement(nt.Z,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:N("Cancel"),onClick:L},a.ZP.createElement("i",{className:"icon icon-close"})),M&&!Z&&a.ZP.createElement(Ge.Z,{isOpen:F,transformOriginX:G,transformOriginY:X,positionX:q,positionY:Y,style:K,className:"forward-context-menu",onClose:U,onCloseAnimationEnd:j},a.ZP.createElement(Xe.Z,{icon:l?void 0:"message-succeeded",customIcon:l?a.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>b({noAuthors:!1})},N(r>1?"ShowSenderNames":"ShowSendersName")),a.ZP.createElement(Xe.Z,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:a.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>b({noAuthors:!0})},N(r>1?"HideSenderNames":"HideSendersName")),m&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(lt.Z,null),a.ZP.createElement(Xe.Z,{icon:d?void 0:"message-succeeded",customIcon:d?a.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>C({noCaptions:!1})},N(r>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),a.ZP.createElement(Xe.Z,{icon:d?"message-succeeded":void 0,customIcon:d?void 0:a.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>C({noCaptions:!0})},N(r>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),a.ZP.createElement(lt.Z,null),a.ZP.createElement(Xe.Z,{icon:"replace",onClick:B},N("ChangeRecipient")))))})));var ut=n(93219),mt=n(67146),ht=n(12420);const pt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"DropArea",!t);return n?a.ZP.createElement(n,e):void 0};var Zt=n(19830);const gt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"InlineBotTooltip",!t);return n?a.ZP.createElement(n,e):void 0},ft=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"MentionTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var vt=n(49841);const Pt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"PollModal",!t);return n?a.ZP.createElement(n,e):void 0},Et=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"SendAsMenu",!t);return n?a.ZP.createElement(n,e):void 0},yt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"StickerTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var bt=n(23522),Ct=n(18360),wt=n(54659);const St=new RegExp(s.FM6,"i"),Nt=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const a=(0,l.tVX)(e,t,n);return{theme:(0,l.Puy)(e),webPagePreview:(0,l.jUK)(e).webPagePreview,noWebPage:a}}))((({chatId:e,threadId:t,getHtml:n,isDisabled:s,webPagePreview:r,noWebPage:c,theme:l})=>{const{loadWebPagePreview:d,clearWebPagePreview:m,toggleMessageWebPage:h}=(0,o.Sv)(),p=(0,a.sO)(),Z=(0,ue.iD)((()=>{const e=(0,g.ZP)(n()),t=e.entities?.find((e=>e.type===i.Vv.TextUrl));return p.current=e,t?.url||e.text.match(St)?.[0]}),[n],300,!0),f=(0,me.Z)(Z,[Z,n],!0);(0,a.d4)((()=>{const n=f(),a=p.current;n?d({text:a}):(m(),h({chatId:e,threadId:t}))}),[f,e,t]),(0,re.Z)((()=>{m(),h({chatId:e,threadId:t})}),[e,m,t,h]);const v=(0,Y.Z)((()=>Boolean(r&&n()&&!c&&!s)),[s,n,c,r]),{shouldRender:P,transitionClassNames:E}=(0,oe.Z)(v),y=(0,Ct.Z)(r,!0),b=(0,ee.Z)((()=>{h({chatId:e,threadId:t,noWebPage:!0})}));if(!P||!y)return;const{photo:C,...w}=y,S={content:{webPage:w}};return a.ZP.createElement("div",{className:(0,u.Z)("WebPagePreview",E)},a.ZP.createElement("div",{className:"WebPagePreview_inner"},a.ZP.createElement("div",{className:"WebPagePreview-left-icon"},a.ZP.createElement("i",{className:"icon icon-link"})),a.ZP.createElement(wt.Z,{message:S,inPreview:!0,theme:l}),a.ZP.createElement(nt.Z,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:b},a.ZP.createElement("i",{className:"icon icon-close"}))))})));var It=n(18428),Mt=n(49204),kt=n(70172);const Tt=e=>{const{isOpen:t}=e,n=(0,_e.Z)(ze.gl.Extra,"DeleteMessageModal",!t);return n?a.ZP.createElement(n,e):void 0};var xt=n(36368),At=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e}(At||{});const Rt=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n,storyId:a,messageListType:o,isMobile:r,type:u})=>{const m=(0,l.Z1J)(e,t),h=t!==s.FVh?(0,l.kBx)(e,t):void 0,p=Boolean(h),Z=(0,l.FM1)(e,t),g=(0,c.YC)(t),f=p?(0,l.ccz)(e,h.id):void 0,v=g?void 0:(0,l.x67)(e,t),P=(p||!g)&&(0,l.FTG)(e,t,n),E=(0,l.qyA)(e,t,n),{language:y,shouldSuggestStickers:b,shouldSuggestCustomEmoji:C,shouldUpdateStickerSetOrder:w}=e.settings.byKey,S=e.emojiKeywords[s.pRL],N=y!==s.pRL?e.emojiKeywords[y]:void 0,I=P?P.id:void 0,M=I?(0,l.hjO)(e,t,I):void 0,{currentUserId:k}=e,T=(0,l.dyD)(e,k),x=v?v?.sendAsId||k:void 0,A=m?.sendAsPeerIds&&x&&(m.sendAsPeerIds.some((e=>e.id===x))?x:m?.adminRights?.anonymous?m?.id:void 0),R=A?(0,l.dyD)(e,A):void 0,O=!R&&A?(0,l.Z1J)(e,A):void 0,L=(0,l.uHr)(e,t),B=(0,l.nAc)(e,t),F=(0,l.jUK)(e),D=Boolean(F.storyViewer.storyId),$=(0,l.Btg)(e),U=t===$?.chatId&&n===$?.threadId&&o===$?.type&&!D,j=(0,l.dyD)(e,t),H=(j&&!(0,l.ccz)(e,j.id)?.noVoiceMessages)??!0,z=v?.slowMode,_=(0,l.wVz)(e),V="scheduled"===o?(0,l.hI0)(e,t):(0,l.saH)(e,t,n),q=a&&(0,l.JrV)(e,t,a),W=q&&"sentReaction"in q?q.sentReaction:void 0,Y=(0,l.Mst)(e,t,n),G=Y?.replyInfo?(0,l.hjO)(e,t,Y.replyInfo.replyToMsgId):void 0,X=m?.isForum&&m.isForumAsMessages&&n===i._f&&G?(0,l.p$s)(e,G):void 0;return{availableReactions:"story"===u?e.availableReactions:void 0,topReactions:"story"===u?e.topReactions:void 0,isOnActiveTab:!F.isBlurred,editingMessage:(0,l.kKD)(e,t,n,o),draft:Y,chat:m,isChatWithBot:p,isChatWithSelf:Z,isForCurrentMessageList:U,canScheduleUntilOnline:(0,l.Eh5)(e,t),isChannel:m?(0,c.eA)(m):void 0,isRightColumnShown:(0,l.Jf5)(e,r),isSelectModeActive:(0,l.CAb)(e),withScheduledButton:"thread"===o&&Boolean(E?.length),shouldSchedule:"scheduled"===o,botKeyboardMessageId:I,botKeyboardPlaceholder:M?.keyboardPlaceholder,isForwarding:t===F.forwardMessages.toChatId,pollModal:F.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,groupChatMembers:v?.members,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:k,currentUser:T,contentToBeScheduled:F.contentToBeScheduled,shouldSuggestStickers:b,shouldSuggestCustomEmoji:C,shouldUpdateStickerSetOrder:w,recentEmojis:e.recentEmojis,baseEmojiKeywords:S?.keywords,emojiKeywords:N?.keywords,inlineBots:F.inlineBots.byUsername,isInlineBotLoading:F.inlineBots.isLoading,chatBotCommands:v?.botCommands,botCommands:f?f.botInfo?.commands||!1:void 0,botMenuButton:f?.botInfo?.menuButton,sendAsUser:R,sendAsChat:O,sendAsId:A,editingDraft:V,requestedDraftText:L,requestedDraftFiles:B,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,l.taM)(e,t),theme:(0,l.Puy)(e),fileSizeLimit:(0,d.M)(e,"uploadMaxFileparts")*s.pJM,captionLimit:(0,d.M)(e,"captionLength"),isCurrentUserPremium:_,canSendVoiceByPrivacy:H,attachmentSettings:e.attachmentSettings,slowMode:z,currentMessageList:$,isReactionPickerOpen:(0,l.Io8)(e),canBuyPremium:!_&&!(0,l.oe5)(e),canPlayAnimatedEmojis:(0,l.W9H)(e),shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:W,stealthMode:e.stories.stealthMode,replyToTopic:X}}))((({type:e,isOnActiveTab:t,dropAreaState:n,shouldSchedule:l,canScheduleUntilOnline:d,isReady:y,isMobile:C,onDropHide:w,onFocus:S,onBlur:N,editingMessage:k,chatId:T,threadId:x,storyId:A,currentMessageList:R,messageListType:O,draft:L,chat:B,replyToTopic:F,isForCurrentMessageList:D,isCurrentUserPremium:$,canSendVoiceByPrivacy:U,isChatWithBot:j,isChatWithSelf:pe,isChannel:Ze,fileSizeLimit:Se,isRightColumnShown:Be,isSelectModeActive:Fe,isReactionPickerOpen:De,isForwarding:$e,pollModal:Ue,botKeyboardMessageId:ze,botKeyboardPlaceholder:_e,inputPlaceholder:qe,withScheduledButton:We,stickersForEmoji:Ye,customEmojiForEmoji:Ge,groupChatMembers:Xe,topInlineBotIds:Je,currentUserId:it,currentUser:st,captionLimit:rt,contentToBeScheduled:ct,shouldSuggestStickers:lt,shouldSuggestCustomEmoji:Ct,baseEmojiKeywords:wt,emojiKeywords:St,recentEmojis:Rt,inlineBots:Ot,isInlineBotLoading:Lt,botCommands:Bt,chatBotCommands:Ft,sendAsUser:Dt,sendAsChat:$t,sendAsId:Ut,editingDraft:jt,requestedDraftText:Ht,requestedDraftFiles:zt,botMenuButton:_t,attachBots:Vt,attachMenuPeerType:qt,attachmentSettings:Wt,theme:Yt,slowMode:Gt,shouldUpdateStickerSetOrder:Xt,editableInputCssSelector:Kt,editableInputId:Jt,inputId:Qt,className:en,availableReactions:tn,topReactions:nn,canBuyPremium:an,canPlayAnimatedEmojis:on,shouldCollectDebugLogs:sn,sentStoryReaction:rn,stealthMode:cn,onForward:ln})=>{const{sendMessage:dn,clearDraft:un,showDialog:mn,forwardMessages:hn,openPollModal:pn,closePollModal:Zn,loadScheduledHistory:gn,openThread:fn,addRecentEmoji:vn,sendInlineBotResult:Pn,loadSendAs:En,resetOpenChatWithDraft:yn,callAttachBot:bn,addRecentCustomEmoji:Cn,showNotification:wn,showAllowedMessageTypesNotification:Sn,openStoryReactionPicker:Nn,closeReactionPicker:In,sendStoryReaction:Mn}=(0,o.Sv)(),kn=(0,Q.Z)(),Tn=(0,a.sO)(null),xn=(0,a.sO)(null),[An,Rn]=(0,ie.Z)(""),[On,Ln]=(0,a.eJ)(!1),Bn=(0,K.Z)(Kt),Fn=(0,a.sO)(),Dn=(0,te.Z)(n),{width:$n}=E.Z.get(),Un="messageList"===e,jn="story"===e,Hn=Un?B?.sendAsPeerIds:void 0,zn=Hn&&(Hn.length>1||!Hn.some((e=>e.id===it))),[_n,Vn,qn]=(0,X.Z)(),Wn=(0,ae.Z)(T,x),[Yn,Gn,Xn]=(0,X.Z)(),[Kn,Jn,Qn]=(0,X.Z)(),ea=!(!rn||!("emoticon"in rn))&&rn.emoticon===s.mzt.emoticon;(0,a.d4)(m.AU,[An]);const ta=(0,a.sO)(0),[na,aa]=(0,ne.Z)(Un&&d,qn);(0,ce.Z)((()=>{Ln(!0)}),430),(0,a.d4)((()=>{Un||In()}),[Un,A]),(0,a.d4)((()=>{Fn.current=void 0}),[T]),(0,a.d4)((()=>{T&&y&&!jn&&gn({chatId:T})}),[y,T,x,jn]),(0,a.d4)((()=>{T&&B&&!Hn&&y&&(0,c.ZV)(B)&&En({chatId:T})}),[B,T,y,En,Hn]);const oa=(0,a.sO)(!1);(0,re.Z)((([e,t])=>{oa.current=Boolean(T===e&&Hn&&!t)}),[T,Hn]);const[ia,sa]=(0,a.eJ)([]),ra=Boolean(ia.length),[ca,la]=(0,a.eJ)(void 0),{canSendStickers:da,canSendGifs:ua,canAttachMedia:ma,canAttachPolls:ha,canAttachEmbedLinks:pa,canSendVoices:Za,canSendPlainText:ga,canSendAudios:fa,canSendVideos:va,canSendPhotos:Pa,canSendDocuments:Ea}=(0,a.Ye)((()=>(0,c.H5)(B,j,jn)),[B,j,jn]),ya=!ga&&!k,ba=(0,ee.Z)(((e,t=Jt)=>{if(t===Jt&&ya)return;const n=window.getSelection();let a;if(a=t===Jt?document.querySelector(Kt):document.getElementById(t),n.rangeCount){const o=n.getRangeAt(0);if((0,z.R)(o,t))return(0,f.tx)(e),void a.dispatchEvent(new Event("input",{bubbles:!0}))}Rn(`${An()}${e}`),(0,r.Yq)((()=>{(0,p.Z)(a)}))})),Ca=(0,ee.Z)(((e,t=Jt)=>{const n=(0,V.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");ba(n,t)})),wa=(0,ee.Z)(((e,t=Jt)=>{const n=(0,q.z)(e);ba(n,t)})),Sa=(0,ee.Z)(((e,t=Jt)=>{ba((0,H.yR)(e),t)})),Na=(0,ee.Z)((()=>{ca&&(wa(ca,Jt),la(void 0))})),{shouldSuggestCompression:Ia,shouldForceCompression:Ma,shouldForceAsFile:ka,handleAppendFiles:Ta,handleFileSelect:xa,onCaptionUpdate:Aa,handleClearAttachments:Ra,handleSetAttachments:Oa}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:i,chatId:s,canSendAudios:r,canSendVideos:c,canSendPhotos:l,canSendDocuments:d,insertNextText:u}){const{openLimitReachedModal:m,showAllowedMessageTypesNotification:h}=(0,o.Sv)(),[p,g]=(0,a.eJ)(!1),[f,v]=(0,a.eJ)(!1),[P,E]=(0,a.eJ)(void 0),y=(0,ee.Z)((()=>{i(Z.D),u()})),b=(0,ee.Z)((n=>{const a="function"==typeof n?n(e):n;if(a.length)if(a.some((e=>{const t=le(e);return"audio"===t&&!r&&!d||"video"===t&&!c&&!d||"image"===t&&!l&&!d||"file"===t&&!d})))h({chatId:s});else if(a.some((({size:e})=>e>t)))m({limit:"uploadMaxFileparts"});else{i(a);const e=a.some((e=>{const t=le(e);return"audio"===t&&!r||"video"===t&&!c||"image"===t&&!l}));g(Boolean(e&&d)),v(!d),E(void 0)}else y()}));return{shouldSuggestCompression:P,handleAppendFiles:(0,ee.Z)((async(t,n)=>{b([...e,...await Promise.all(t.map((e=>I(e.name,e,{shouldSendAsSpoiler:n||void 0}))))])})),handleFileSelect:(0,ee.Z)((async(e,t)=>{b(await Promise.all(e.map((e=>I(e.name,e))))),E(t)})),onCaptionUpdate:n,handleClearAttachments:y,handleSetAttachments:b,shouldForceCompression:f,shouldForceAsFile:p}}({attachments:ia,setHtml:Rn,setAttachments:sa,fileSizeLimit:Se,chatId:T,canSendAudios:fa,canSendVideos:va,canSendPhotos:Pa,canSendDocuments:Ea,insertNextText:Na}),[La,Ba,Fa]=(0,X.Z)(),[Da,$a,Ua]=(0,X.Z)(),[ja,Ha,za]=(0,X.Z)(),[_a,Va,qa]=(0,X.Z)(),[Wa,Ya,Ga]=(0,X.Z)(),[Xa,Ka,Ja]=(0,X.Z)(),{startRecordingVoice:Qa,stopRecordingVoice:eo,pauseRecordingVoice:to,activeVoiceRecording:no,currentRecordTime:ao,recordButtonRef:oo,startRecordTimeRef:io}=(()=>{const e=(0,a.sO)(null),[t,n]=(0,a.eJ)(),o=(0,a.sO)(),[i,s]=(0,a.eJ)();(0,a.d4)((()=>{P.s$&&P.mh&&je()}),[]);const c=(0,ee.Z)((async()=>{try{const{stop:t,pause:a}=await He((t=>{e.current&&(o.current&&Date.now()%4==0&&(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)})),s(Date.now()))}));o.current=Date.now(),s(Date.now()),n({stop:t,pause:a})}catch(e){console.error(e)}})),l=(0,ee.Z)((()=>{if(t){(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),d=(0,ee.Z)((()=>{if(t){n(void 0),o.current=void 0,s(void 0),(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));return(0,a.d4)((()=>t?(0,Le.Z)(d):void 0),[t,d]),{startRecordingVoice:c,pauseRecordingVoice:l,stopRecordingVoice:d,activeVoiceRecording:t,currentRecordTime:i,recordButtonRef:e,startRecordTimeRef:o}})(),so=D&&!jn;(0,J.Z)((()=>{Wn({type:"recordAudio"})}),so?no&&s.o_S:void 0),(0,a.d4)((()=>{D&&!jn&&(no||Wn({type:"cancel"}))}),[no,D,jn,Wn]);const ro=(0,se.Y)(Boolean(k));(0,a.d4)((()=>{D&&!jn&&An()&&!ro.current&&Wn({type:"typing"})}),[An,ro,D,jn,Wn]);const co=B&&(0,c.Nl)(B),{isEmojiTooltipOpen:lo,closeEmojiTooltip:uo,filteredEmojis:mo,filteredCustomEmojis:ho,insertEmoji:po}=(0,we.Z)(Boolean(y&&t&&(jn||D)&&lt&&!ra),An,Rn,void 0,Rt,wt,St),{isCustomEmojiTooltipOpen:Zo,closeCustomEmojiTooltip:go,insertCustomEmoji:fo}=(0,fe.Z)(Boolean(y&&t&&(jn||D)&&Ct&&!ra),An,Rn,Bn,Tn,Ge),{isStickerTooltipOpen:vo,closeStickerTooltip:Po}=function(e,t,n){const{loadStickersForEmoji:i,clearStickersForEmoji:r}=(0,o.Sv)(),[c,l,d]=(0,X.Z)(!1),u=(0,me.Z)((()=>{const n=t();if(!e||!n||P.op&&n.length>8)return;if(!n.match(P.op?Ae.Z:s.t8f))return;const a=(0,de._)(n);return a&&(P.op&&1===(0,Re.Z)(a)||!P.op&&Boolean(n.match(Oe)))?P.op?a:a.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),m=(0,Y.Z)((()=>Boolean(u())),[u]),h=Boolean(n?.length);return(0,a.d4)((()=>{if(!e||!m)return;const t=u();t?h||i({emoji:t}):r()}),[e,m,u,h,i,r]),(0,a.d4)(d,[d,t]),{isStickerTooltipOpen:Boolean(m&&h&&!c),closeStickerTooltip:l}}(Boolean(y&&t&&(jn||D)&&lt&&da&&!ra),An,Ye),{isMentionTooltipOpen:Eo,closeMentionTooltip:yo,insertMention:bo,mentionFilteredUsers:Co}=(0,xe.Z)(Boolean(Un&&y&&D&&!ra),An,Rn,Bn,Tn,Xe,Je,it),{isOpen:wo,botId:So,isGallery:No,switchPm:Io,switchWebview:Mo,results:ko,closeTooltip:To,help:xo,loadMore:Ao}=function(e,t,n,i){const{queryInlineBot:s,resetInlineBot:r,resetAllInlineBots:c}=(0,o.Sv)(),[l,d,u]=(0,X.Z)(!1),m=(0,ue.CH)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Me;const t=function(e){return ke.innerHTML=e.replace(/<br>/g,"\n"),ke.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),ke.innerText}(e),n=t.match(Ne);return n?Te(n[1],n[2],""===n[2]&&!t.match(Ie)):Me}(t):Me}),[n,e],300),{username:h,query:p,canShowHelp:Z,usernameLowered:g}=(0,Y.Z)(m,[m,n],!0);(0,re.Z)((([e])=>{e&&r({username:e})}),[h,r]),(0,a.d4)((()=>{g&&s({chatId:t,username:g,query:p})}),[t,p,s,g]),(0,a.d4)(u,[u,n]);const{id:f,switchPm:v,switchWebview:P,offset:E,results:y,isGallery:b,help:C}=g&&i?.[g]||{},w=Boolean((y?.length||v)&&!l);(0,a.d4)((()=>{w||h||c()}),[w,c,h]);const S=(0,ee.Z)((()=>{g&&s({chatId:t,username:g,query:p,offset:E})}));return{isOpen:w,botId:f,isGallery:b,switchPm:v,switchWebview:P,results:y,closeTooltip:d,help:Z&&C?`@${h} ${C}`:void 0,loadMore:S}}(Boolean(Un&&y&&D&&!ra),T,An,Ot),{isOpen:Ro,close:Oo,filteredBotCommands:Lo}=function(e,t,n,o){const[i,s]=(0,a.eJ)(),[r,c,l]=(0,X.Z)(!1),d=(0,ue.CH)((()=>{const n=t();return e&&n.startsWith("/")?(0,de._)(n).match(he)?.[0].trim():void 0}),[t,e],300),u=(0,me.Z)(d,[d,t],!0);return(0,a.d4)((()=>{const e=u(),t=n||o;if(!e||!t)return void s(void 0);const a=e.substring(1),i=t.filter((e=>!a||e.command.startsWith(a)));s(i?.length?i:void 0)}),[u,n,o]),(0,a.d4)(l,[l,t]),{isOpen:Boolean(i?.length&&!r),close:c,filteredBotCommands:i}}(Boolean(Un&&y&&D&&(Bt&&Bt?.length||Ft?.length)),An,Bt,Ft);(({draft:e,chatId:t,threadId:n,getHtml:c,setHtml:l,editedMessage:d,isDisabled:u})=>{const{saveDraft:m,clearDraft:h,loadCustomEmojis:Z}=(0,o.Sv)(),f=(0,a.sO)(!1);(0,a.d4)((()=>{const t=c(),n=void 0!==e?.isLocal;(0,q.z)(e?.text)!==t||n?f.current=!0:f.current=!1}),[e,c]),(0,a.d4)((()=>{f.current=!1}),[t,n]);const v=Boolean(d),E=(0,ee.Z)(((e={})=>{if(u||v||!f.current)return;const a=c();a?m({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,g.ZP)(a)}):h({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0})})),y=(0,ye.Z)(s.r_R,!0,void 0,[t,n]);(0,Ee.Z)((([a,o,c])=>{if(u)return;const m=f.current;if(t===a&&n===o){if(m&&!e)return;if(!e&&c&&l(""),m)return}if(d||!e)return;l((0,q.z)(e.text));const h=e.text?.entities?.map((e=>e.type===i.Vv.CustomEmoji&&e.documentId)).filter(Boolean)||[];h.length&&Z({ids:h}),P.$b||(0,r.Yq)((()=>{const e=document.querySelector(s.Edp);e&&(0,p.Z)(e,!0)}))}),[t,n,e,c,l,d,u]),(0,a.d4)((()=>{if(!u)return()=>{v||E({chatId:t,threadId:n}),be=!0,(0,r.i$)((()=>{be=!1}))}}),[t,n,v,E,u]);const b=(0,se.Y)(t),C=(0,se.Y)(n);(0,a.d4)((()=>{if(u||be)return;if(!c())return void E();const e=b.current,t=C.current;y((()=>{b.current===e&&C.current===t&&E()}))}),[b,c,u,y,C,E]),(0,ve.Z)(E),(0,Pe.Z)(E)})({draft:L,chatId:T,threadId:x,getHtml:An,setHtml:Rn,editedMessage:k,isDisabled:jn});const Bo=(0,ee.Z)(((e=!1)=>{e||Rn(""),sa(Z.D),la(void 0),uo(),go(),Po(),yo(),C?setTimeout((()=>za()),350):za()})),[Fo,Do,$o]=((e,t,n,i,l,d,u,m,h,Z)=>{const{editMessage:f,setEditingDraft:v,toggleMessageWebPage:P}=(0,o.Sv)(),[E,y]=(0,a.eJ)(!1),b=h?.replyInfo?.replyToMsgId;(0,G.Z)((([e,a])=>{if(!n)return;if(b&&a!==b)return t(""),void y(!1);if(e?.id===n.id&&b===a)return;const o=!e&&Z?.text.length?Z:n.content.text,i=(0,q.z)(o);t(i),y(!0),(0,r.Yq)((()=>{const e=document.querySelector(s.Edp);e&&(0,p.Z)(e,!0)}))}),[n,b,Z,t]),(0,a.d4)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ce.has(e.type)));P({chatId:d,threadId:u,noWebPage:e})}),[d,u,n]),(0,a.d4)((()=>{if(n)return()=>{const t=(0,g.ZP)(e()),n=t.text.length?t:void 0;v({chatId:d,threadId:u,type:m,text:n})}}),[d,n,e,v,u,m]);const C=(0,ue.iD)((()=>{if(!n)return!1;const t=(0,g.ZP)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ce.has(e.type)))&&!t.entities?.some((e=>Ce.has(e.type)))}),[n,e],300,!0),w=(0,me.Z)(C,[C,e],!0);(0,G.Z)((([e])=>{n&&e?.id===n.id&&w()&&P({chatId:d,threadId:u,noWebPage:!1})}),[n,d,e,u,w]);const S=(0,ee.Z)((()=>{h&&(0,r.i$)((()=>{t((0,q.z)(h.text)),(0,r.Yq)((()=>{const e=document.querySelector(s.Edp);e&&(0,p.Z)(e,!0)}))}))})),N=(0,ee.Z)((()=>{i(),S()})),I=(0,ee.Z)((()=>{const{text:t,entities:a}=(0,g.ZP)(e());n&&(t||(0,c.u8)(n)?(f({messageList:{chatId:d,threadId:u,type:m},text:t,entities:a}),i(),S()):l())})),M=(0,ee.Z)((()=>{if(!n)return;const t=(0,g.ZP)(e()),a=t.text.length?t:void 0;v({chatId:d,threadId:u,type:m,text:a})}));return(0,ve.Z)(M),(0,Pe.Z)(M),[I,N,E]})(An,Rn,k,Bo,Ya,T,x,O,L,jt),Uo=(0,se.Y)(Bo),jo=(0,se.Y)(eo);(0,a.d4)((()=>()=>{jo.current(),Uo.current()}),[T,x,Uo,jo]);const Ho=(0,ee.Z)((()=>{const e=ta.current;wn(e?{message:kn("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:it,shouldReplaceHistory:!0}},actionText:kn("Open")}:{message:kn("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:kn("PremiumMore")}),ta.current=Number(!e)})),zo=(0,Y.Z)((()=>Yn||!ln||An()&&!ra?k&&$o?At.Edit:!P.mh||no||$e||An()&&!ra?l?At.Schedule:At.Send:At.Record:At.Forward),[no,k,An,ra,$e,Yn,ln,$o,l]),_o=!l,{isContextMenuOpen:Vo,handleContextMenu:qo,handleContextMenuClose:Wo,handleContextMenuHide:Yo}=(0,W.Z)(oo,!(zo===At.Send&&_o)),{contextMenuPosition:Go,handleContextMenu:Xo,handleBeforeContextMenu:Ko,handleContextMenuHide:Jo}=(0,W.Z)(xn,!jn);(0,a.d4)((()=>{De||Go&&(Nn({peerId:T,storyId:A,position:Go}),Jo())}),[T,Jo,De,A,Go]),ge(D||jn,wa,Oa,la,k,!$&&!pe,Ho);const Qo=(0,ee.Z)((()=>{k&&Do()})),ei=(0,ee.Z)(((e,t)=>{const n=t?rt:4096;if(e?.length>n){const t=e.length-n;return mn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),ti=(0,ee.Z)((()=>{if(Gt&&!co){const e=document.querySelector(Kt),t=(0,v.bp)(),n=Fn.current&&Math.floor(t-Fn.current),a=Gt.nextSendDate&&Gt.nextSendDate>t;if(n&&n<Gt.seconds||a){const o=a?Gt.nextSendDate-t:Gt.seconds-n;return mn({data:{message:kn("SlowModeHint",(0,h.k9)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),ni=(0,ee.Z)((({attachments:e,sendCompressed:t=Wt.shouldCompress,sendGrouped:n=Wt.shouldSendGrouped,isSilent:a,scheduledAt:o})=>{if(!R&&!A)return;const{text:i,entities:s}=(0,g.ZP)(An());(i||e.length)&&ei(i,!0)&&ti()&&(dn({messageList:R,text:i,entities:s,scheduledAt:o,isSilent:a,shouldUpdateStickerSetOrder:Xt,attachments:M(e,t),shouldGroupMessages:n}),Fn.current=(0,v.bp)(),un({chatId:T,isLocalOnly:!0}),(0,r.i$)((()=>{Bo()})))})),ai=(0,ee.Z)(((e,t,n,a)=>{ni({attachments:ia,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:a})})),oi=(0,ee.Z)((async(e=!1,t)=>{if(!R&&!A)return;let n=ia;if(no){const e=await eo();if(e){const{blob:t,duration:a,waveform:o}=e;n=[await I("wonderful-voice-message.ogg",t,{voice:{duration:a,waveform:o}})]}}const{text:a,entities:o}=(0,g.ZP)(An());if(n.length)return void ni({attachments:n,scheduledAt:t,isSilent:e});if(!a&&!$e)return;if(!ei(a))return;const i=document.querySelector(Kt);if(a){if(!ti())return;dn({messageList:R,text:a,entities:o,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Xt})}$e&&hn({scheduledAt:t,isSilent:e}),Fn.current=(0,v.bp)(),un({chatId:T,isLocalOnly:!0}),P.cj&&i&&i===document.activeElement&&b(i),(0,r.i$)((()=>{Bo()}))})),ii=(0,ee.Z)((()=>{"webApp"===_t?.type&&bn({chatId:T,url:_t.url,threadId:x})})),si=(0,ee.Z)((()=>{za(),$a()})),ri=(0,ee.Z)(((e,t,n)=>{if(e&&"queryId"in e){const{id:a,queryId:o,isSilent:i}=e;return void Pn({id:a,queryId:o,scheduledAt:t,isSilent:i,messageList:n})}const{isSilent:a,...o}=e||{};if(e&&0!==Object.keys(o).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:o=!1}=e;ai(n,o,a,t)}else dn({...e,messageList:n,scheduledAt:t});else oi(Boolean(a),t)}));(0,G.Z)((([e])=>{R&&ct&&ct!==e&&na((e=>{ri(ct,e,R)}))}),[ct,R,ri,na]),(0,a.d4)((()=>{Ht&&(Rn(function(e){const t=document.createElement("div"),n=document.createTextNode(e);return t.appendChild(n),t.innerHTML}(Ht)),yn(),(0,r.Yq)((()=>{const e=document.getElementById(Jt);(0,p.Z)(e,!0)})))}),[Jt,Ht,yn,Rn]),(0,a.d4)((()=>{zt?.length&&(xa(zt),yn())}),[xa,zt,yn]);const ci=(0,ee.Z)(((e,t)=>{e.isFree||$||pe?Sa(e,t):Ho()})),li=(0,ee.Z)((e=>{ci(e,s.nYf)})),di=(0,ee.Z)(((e,t,n)=>{(R||A)&&(l||n?(Vn(),na((n=>{qn(),ri({gif:e,isSilent:t},n,R),(0,r.i$)((()=>{Bo(!0)}))}))):(dn({messageList:R,gif:e,isSilent:t}),(0,r.i$)((()=>{Bo(!0)}))))})),ui=(0,ee.Z)(((e,t,n,a=!1,o)=>{(R||A)&&(e={...e,isPreloadedGlobally:!0},l||n?(Vn(),na((n=>{qn(),ri({sticker:e,isSilent:t},n,R),(0,r.i$)((()=>{Bo(a)}))}))):(dn({messageList:R,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Xt&&o}),(0,r.i$)((()=>{Bo(a)}))))})),mi=(0,ee.Z)(((e,t,n)=>{if(!R&&!A)return;l||n?na((n=>{ri({id:e.id,queryId:e.queryId,isSilent:t},n,R)})):Pn({id:e.id,queryId:e.queryId,isSilent:t,messageList:R});const a=document.querySelector(Kt);P.cj&&a&&a===document.activeElement&&b(a),un({chatId:T,isLocalOnly:!0}),(0,r.i$)((()=>{Bo()}))})),hi=(0,ee.Z)((()=>{un({chatId:T,isLocalOnly:!0}),(0,r.i$)((()=>{Bo()}))})),pi=(0,ee.Z)((e=>{R&&(l?(na((t=>{ri({poll:e},t,R)})),Zn()):(dn({messageList:R,poll:e}),Zn()))})),Zi=(0,ee.Z)((e=>{if(l)na((t=>{ri({...e,isSilent:!0},t,R)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;ai(t,n,!0)}else oi(!0)})),gi=(0,ee.Z)((()=>{const e=document.querySelector(Kt);if(!C||e!==document.activeElement)return Ua(),za(),void Va();e?.blur(),setTimeout((()=>{Ua(),za(),Va()}),100)}));(0,a.d4)((()=>{ya&&Rn("")}),[ya,Rn,ia]);const fi=(0,ee.Z)((e=>{Ca(e,s.nYf)})),vi=(0,ee.Z)(((e=Jt)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,z.R)(n,e))return void document.execCommand("delete",!1)}Rn(function(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const a=n.textContent.length,o=document.createRange(),i=window.getSelection();o.setStart(n,a),o.setEnd(n,a),i.removeAllRanges(),i.addRange(o),document.execCommand("delete",!1);const s=t.innerHTML;return document.body.removeChild(t),s}(An()))})),Pi=(0,ee.Z)((()=>{vi(s.nYf)})),Ei=(0,ee.Z)((()=>{fn({chatId:T,threadId:x,type:"scheduled",noForumTopicPanel:!0})}));(0,a.d4)((()=>{Be&&C&&za()}),[Be,za,C]),(0,a.d4)((()=>{y&&(Fe?Ka():setTimeout((()=>{Ja()}),200))}),[Fe,Ja,Ka,y]);const yi=j&&"webApp"===_t?.type&&!k,bi=(0,Y.Z)((()=>yi&&!An()&&!no),[yi,An,no]),[Ci,wi]=(0,a.Ye)((()=>Gt?.nextSendDate?["SlowModeWait",Gt.nextSendDate]:cn?.activeUntil&&jn?["StealthModeActiveHint",cn.activeUntil]:[]),[jn,Gt?.nextSendDate,cn?.activeUntil]),Si=La||ja||lo||_a||Eo||wo||Wa||Da||Kn||vo||Ro||Zo||bi||Vo||Boolean(no)||ia.length>0||Yn,Ni=Si&&!De&&jn&&!Kn&&!ja,Ii=B?.isForum&&B?.isForumAsMessages&&x===i._f?F?kn("Chat.InputPlaceholderReplyInTopic",F.title):kn("Message.Placeholder.MessageInGeneral"):void 0;(0,a.d4)((()=>{Si?S?.():N?.()}),[Si,N,S]);const{shouldRender:Mi,transitionClassNames:ki}=(0,oe.Z)(Ni),Ti=!(zo!==At.Record||ma&&U&&Za),xi=(0,ee.Z)((()=>{switch(zo){case At.Forward:ln?.();break;case At.Send:oi();break;case At.Record:Ti?U?Za||Sn({chatId:T}):wn({message:kn("VoiceMessagesRestrictedByPrivacy",B?.title)}):Qa();break;case At.Edit:Fo();break;case At.Schedule:if(no&&to(),!R)return;na((e=>{ri({},e,R)}))}})),Ai=(0,te.Z)(k,!0),Ri=k||Ai,Oi=new Date;Oi.setSeconds(0),Oi.setMilliseconds(0);const Li=new Date;Li.setFullYear(Li.getFullYear()+1);let Bi="SendMessage";switch(zo){case At.Forward:Bi="Forward";break;case At.Edit:Bi="Save edited message";break;case At.Record:Bi=ma?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Fi=(0,u.Z)("Composer",!Fe&&"shown",Xa&&"hover-disabled",On&&"mounted",en),Di=(0,ee.Z)((e=>{let t,n;if("emoticon"in e)t=e.emoticon;else{const a=(0,o.Rd)().customEmojis.byId[e.documentId];if(!a)return;if(!a.isFree&&!$&&!pe)return void Ho();const i=(0,g.ZP)((0,H.yR)(a));t=i.text,n=i.entities}dn({text:t,entities:n,isReaction:!0}),In()})),$i=(0,ee.Z)((e=>{Nn({peerId:T,storyId:A,position:e,sendAsMessage:!0})})),Ui=(0,ee.Z)((()=>{const e=rn?void 0:s.mzt;Mn({peerId:T,storyId:A,containerId:(0,c.hl)(T,A),reaction:e})})),ji=(0,ee.Z)((()=>{na((e=>{ri({},e,R)}))})),Hi=(0,ee.Z)((()=>{Zi()})),zi=(0,ee.Z)((()=>{ri({},s.t4X,R)})),_i=(0,ee.Z)(((e,t)=>{na((n=>{ri({sendCompressed:e,sendGrouped:t},n,R)}))})),Vi=(0,ee.Z)(((e,t)=>{Zi({sendCompressed:e,sendGrouped:t})})),qi=(0,a.Ye)((()=>{switch(zo){case At.Edit:return Fo;case At.Schedule:return ji;default:return oi}}),[zo,Fo]),Wi=j&&"commands"===_t?.type&&!k&&!1!==Bt&&!no;return a.ZP.createElement("div",{className:Fi},Un&&ma&&y&&a.ZP.createElement(pt,{isOpen:n!==ht.t.None,withQuick:n===ht.t.QuickFile||Dn===ht.t.QuickFile,onHide:w,onFileSelect:xa}),Mi&&a.ZP.createElement(It.Z,{topReactions:nn,allAvailableReactions:tn,onToggleReaction:Di,isPrivate:!0,isReady:y,canBuyPremium:an,isCurrentUserPremium:$,canPlayAnimatedEmojis:on,onShowMore:$i,className:ki}),a.ZP.createElement(Ve,{chatId:T,threadId:x,canShowCustomSendMenu:_o,attachments:ia,getHtml:An,isReady:y,shouldSuggestCompression:Ia,shouldForceCompression:Ma,shouldForceAsFile:ka,isForCurrentMessageList:D,isForMessage:Un,shouldSchedule:l,forceDarkTheme:jn,onCaptionUpdate:Aa,onSendSilent:Vi,onSend:ai,onSendScheduled:_i,onFileAppend:Ta,onClear:Ra,onAttachmentsUpdate:Oa,onCustomEmojiSelect:li,onRemoveSymbol:Pi,onEmojiSelect:fi}),a.ZP.createElement(Pt,{isOpen:Ue.isOpen,isQuiz:Ue.isQuiz,shouldBeAnonymous:Ze,onClear:Zn,onSend:pi}),Ri&&a.ZP.createElement(Tt,{isOpen:Wa,isSchedule:"scheduled"===O,onClose:Ga,message:Ri}),a.ZP.createElement(Et,{isOpen:_a,onClose:qa,chatId:T,selectedSendAsId:Ut,sendAsPeerIds:Hn,isCurrentUserPremium:$}),a.ZP.createElement(ft,{isOpen:Eo,filteredUsers:Co,onInsertUserName:bo,onClose:yo}),a.ZP.createElement(tt,{isOpen:Ro,withUsername:Boolean(Ft),botCommands:Lo,getHtml:An,onClick:hi,onClose:Oo}),a.ZP.createElement("div",{className:(0,u.Z)("composer-wrapper",jn&&"with-story-tweaks")},a.ZP.createElement("svg",{className:"svg-appendix",width:"9",height:"20"},a.ZP.createElement("defs",null,a.ZP.createElement("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix"},a.ZP.createElement("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.ZP.createElement("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.ZP.createElement("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"}))),a.ZP.createElement("g",{fill:"none","fill-rule":"evenodd"},a.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#000",filter:"url(#composerAppendix)"}),a.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"}))),Un&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(gt,{isOpen:wo,botId:So,isGallery:No,inlineBotResults:ko,switchPm:Io,switchWebview:Mo,loadMore:Ao,isSavedMessages:pe,canSendGifs:ua,isCurrentUserPremium:$,onSelectResult:mi,onClose:To}),a.ZP.createElement(dt,{onClear:Qo,shouldForceShowEditing:Boolean($o&&k)}),a.ZP.createElement(Nt,{chatId:T,threadId:x,getHtml:An,isDisabled:!pa||ra})),a.ZP.createElement("div",{className:(0,u.Z)("message-input-wrapper",(0,_.D)(st))},Un&&a.ZP.createElement(a.ZP.Fragment,null,yi&&a.ZP.createElement(ot,{isOpen:bi,text:_t.text,isDisabled:Boolean(no),onClick:ii}),Wi&&a.ZP.createElement(Ke.Z,{className:(0,u.Z)("bot-commands",Da&&"activated"),round:!0,disabled:void 0===Bt,color:"translucent",onActivate:si,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:"icon icon-bot-commands-filled"})),zn&&(Dt||$t)&&a.ZP.createElement(nt.Z,{round:!0,color:"translucent",onClick:_a?qa:gi,ariaLabel:kn("SendMessageAsTitle"),className:(0,u.Z)("send-as-button",oa.current&&"appear-animation")},a.ZP.createElement(kt.Z,{peer:Dt||$t,size:"tiny"}))),(!ya||ua||da)&&a.ZP.createElement(bt.Z,{chatId:T,threadId:x,isMobile:C,isReady:y,isSymbolMenuOpen:ja,openSymbolMenu:Ha,closeSymbolMenu:za,canSendStickers:da,canSendGifs:ua,isMessageComposer:Un,onGifSelect:di,onStickerSelect:ui,onCustomEmojiSelect:ci,onRemoveSymbol:vi,onEmojiSelect:Ca,closeBotCommandMenu:Ua,closeSendAsMenu:qa,isSymbolMenuForced:_n,canSendPlainText:!ya,inputCssSelector:Kt,idPrefix:e,forceDarkTheme:jn}),a.ZP.createElement(vt.Z,{ref:Tn,id:Qt,editableInputId:Jt,customEmojiPrefix:e,isStoryInput:jn,chatId:T,canSendPlainText:!ya,threadId:x,isReady:y,isActive:!ra,getHtml:An,placeholder:no&&$n<=600?"":ya?kn("Chat.PlaceholderTextNotAllowed"):_e||qe||kn(Ii||"Message"),timedPlaceholderDate:wi,timedPlaceholderLangKey:Ci,forcedPlaceholder:xo,canAutoFocus:y&&D&&!ra&&Un,noFocusInterception:ra,shouldSuppressFocus:C&&ja,shouldSuppressTextFormatter:lo||Eo||wo,onUpdate:Rn,onSend:qi,onSuppressedFocus:za,onFocus:Gn,onBlur:Xn}),Un&&a.ZP.createElement(a.ZP.Fragment,null,Lt&&Boolean(So)&&a.ZP.createElement(Mt.Z,{color:"gray"}),We&&a.ZP.createElement(nt.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Ei,ariaLabel:"Open scheduled messages"},a.ZP.createElement("i",{className:"icon icon-schedule"})),Boolean(ze)&&!no&&!k&&a.ZP.createElement(Ke.Z,{className:La?"activated":"",round:!0,color:"translucent",onActivate:Ba,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:"icon icon-bot-command"}))),no&&Boolean(ao)&&a.ZP.createElement("span",{className:"recording-state"},(0,h.rM)(ao-io.current)),a.ZP.createElement(Qe,{chatId:T,threadId:x,isButtonVisible:!no&&!k,canAttachMedia:ma,canAttachPolls:ha,canSendPhotos:Pa,canSendVideos:va,canSendDocuments:Ea,canSendAudios:fa,onFileSelect:xa,onPollCreate:pn,isScheduled:l,attachBots:Un?Vt:void 0,peerType:qt,shouldCollectDebugLogs:sn,theme:Yt,onMenuOpen:Jn,onMenuClose:Qn}),Un&&Boolean(ze)&&a.ZP.createElement(at,{messageId:ze,isOpen:La,onClose:Fa}),Un&&Bt&&a.ZP.createElement(et,{isOpen:Da,botCommands:Bt,onClose:Ua}),a.ZP.createElement(ut.Z,{key:`custom-emoji-tooltip-${Jt}`,chatId:T,isOpen:Zo,onCustomEmojiSelect:fo,addRecentCustomEmoji:Cn,onClose:go}),a.ZP.createElement(yt,{key:`sticker-tooltip-${Jt}`,chatId:T,threadId:x,isOpen:vo,onStickerSelect:ui,onClose:Po}),a.ZP.createElement(Zt.Z,{key:`emoji-tooltip-${Jt}`,isOpen:lo,emojis:mo,customEmojis:ho,addRecentEmoji:vn,addRecentCustomEmoji:Cn,onEmojiSelect:po,onCustomEmojiSelect:po,onClose:uo}))),no&&a.ZP.createElement(nt.Z,{round:!0,color:"danger",className:"cancel",onClick:eo,ariaLabel:"Cancel voice recording"},a.ZP.createElement("i",{className:"icon icon-delete"})),jn&&!no&&a.ZP.createElement(nt.Z,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Ui,onContextMenu:Xo,onMouseDown:Ko,ariaLabel:kn("AccDescrLike"),ref:xn},rn&&a.ZP.createElement(xt.Z,{key:"documentId"in rn?rn.documentId:rn.emoticon,containerId:(0,c.hl)(T,A),reaction:rn,withEffectOnly:ea}),(!rn||ea)&&a.ZP.createElement("i",{className:(0,u.Z)("icon","icon-heart",ea&&"story-reaction-heart"),"aria-hidden":!0})),a.ZP.createElement(nt.Z,{ref:oo,round:!0,color:"secondary",className:(0,u.Z)(zo,"main-button",!y&&"not-ready",no&&"recording"),disabled:Ti,allowDisabledClick:!0,noFastClick:!0,ariaLabel:kn(Bi),onClick:xi,onContextMenu:zo===At.Send&&_o?qo:void 0},a.ZP.createElement("i",{className:"icon icon-send"}),a.ZP.createElement("i",{className:"icon icon-microphone-alt"}),ln&&a.ZP.createElement("i",{className:"icon icon-forward"}),Un&&a.ZP.createElement("i",{className:"icon icon-schedule"}),Un&&a.ZP.createElement("i",{className:"icon icon-check"})),_o&&a.ZP.createElement(mt.Z,{isOpen:Vo,canSchedule:Un,canScheduleUntilOnline:d,onSendSilent:pe?void 0:Hi,onSendSchedule:l?void 0:ji,onSendWhenOnline:zi,onClose:Wo,onCloseAnimationEnd:Yo,isSavedMessages:pe}),aa)})))},40329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(33555),i=n(4463),s=n(7054),r=n(32340),c=n(59107),l=n(231),d=n(34563),u=n(70172);const m=(0,a.X$)((0,o.c$)(((e,{chat:t})=>{const n=(0,i.YC)(t.id),a=(0,s.FM1)(e,t.id),o=n&&(0,s.dyD)(e,(0,i.zX)(t)),r=o&&(0,i.cS)(o)&&!t.isSupport,c=n&&!a&&!r,l=n?(0,i.Vl)((0,s.dyD)(e,(0,i.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:r,isChannel:(0,i.eA)(t),isBasicGroup:(0,i.G9)(t),isSuperGroup:(0,i.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:s,isChatWithSelf:m,isBot:h,isBasicGroup:p,isSuperGroup:Z,currentUserId:g,canDeleteForAll:f,contactName:v,onClose:P,onCloseAnimationEnd:E})=>{const{leaveChannel:y,deleteHistory:b,deleteChannel:C,deleteChatUser:w,blockUser:S}=(0,o.Sv)(),N=(0,c.Z)(),I=(0,i.U)(N,t),M=(0,a.I4)((()=>{b({chatId:t.id,shouldDeleteForAll:!0}),P()}),[b,t.id,P]),k=(0,a.I4)((()=>{b({chatId:t.id,shouldDeleteForAll:!0}),S({userId:t.id}),P()}),[t.id,P]),T=(0,a.I4)((()=>{s?b({chatId:t.id,shouldDeleteForAll:!1}):p?(w({chatId:t.id,userId:g}),b({chatId:t.id,shouldDeleteForAll:!1})):!n&&!Z||t.isCreator?(n||Z)&&t.isCreator&&C({chatId:t.id}):y({chatId:t.id}),P()}),[s,p,n,Z,g,t.isCreator,t.id,P,b,w,y,C]),x=(0,a.I4)((()=>{n||Z?(y({chatId:t.id}),P()):T()}),[t.id,T,n,Z,y,P]);return a.ZP.createElement(d.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:N.isRtl?"rtl":void 0},a.ZP.createElement(u.Z,{size:"tiny",peer:t,isSavedMessages:m}),a.ZP.createElement("h3",{className:"modal-title"},N(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":p||Z?"Group.LeaveGroup":"DeleteChatUser"))),onClose:P,onCloseAnimationEnd:E},n&&t.isCreator?a.ZP.createElement("p",null,(0,r.Z)(N("ChatList.DeleteAndLeaveGroupConfirmation",I),["simple_markdown","emoji"])):n&&!t.isCreator||p||Z?a.ZP.createElement("p",null,(0,r.Z)(N("ChannelLeaveAlertWithName",I),["simple_markdown","emoji"])):a.ZP.createElement("p",null,(0,r.Z)(N("ChatList.DeleteChatConfirmation",v),["simple_markdown","emoji"])),a.ZP.createElement("div",{className:"dialog-buttons-column"},h&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},N("DeleteAndStop")),f&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},v?(0,r.Z)(N("ChatList.DeleteForEveryone",v)):N("DeleteForAll")),!s&&t.isCreator&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},N("DeleteForAll")),a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:s?T:x},N(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":p||Z?"Group.LeaveGroup":f?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:P},N("Cancel"))))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),i=n(83716),s=n(4463),r=n(15376),c=n(60706),l=n(3657),d=n(59107),u=n(25190),m=n(6202),h=n(6701),p=n(14605),Z=n(17551),g=n(47002);const f=new Set(["svg","svgz"]),v=(0,a.X$)((({message:e,observeIntersection:t,smaller:n,canAutoLoad:v,autoLoadFileMaxSizeMb:P,uploadProgress:E,withDate:y,datetime:b,className:C,sender:w,isSelected:S,isSelectable:N,shouldWarnAboutSvg:I,isDownloading:M,onCancelUpload:k,onMediaClick:T,onDateClick:x})=>{const{cancelMessageMediaDownload:A,downloadMessageMedia:R,setSettingOption:O}=(0,o.Sv)(),L=(0,a.sO)(null),B=(0,d.Z)(),[F,D,$]=(0,c.Z)(),[U,j]=(0,a.eJ)(!1),H=e.content.document,{fileName:z,size:_,timestamp:V}=H,q=(0,r.K2)(H)||"",W=(0,l.Op)(L,t),[Y,G]=(0,c.Z)();(0,a.d4)((()=>{W&&G()}),[W,G]);const[X,K]=(0,a.eJ)(v&&(!P||_<=1048576*P)),J=Boolean(M||X&&Y),Q=(0,s.Ti)(e,"download"),{loadProgress:ee,mediaData:te}=(0,h.Z)(Q,!J,(0,s.kG)(e,"download"),void 0,!0),ne=Boolean(te),{isUploading:ae,isTransferring:oe,transferProgress:ie}=(0,s.Sc)(e,E||ee,J&&!ne),se=(0,r.v6)(H),re=se?(0,s.DH)(e):void 0,ce=se?H.previewBlobUrl:void 0,le=(0,m.Z)((0,s.Ti)(e,"pictogram"),!W),de=T&&Boolean(H.mediaType)&&(i.wGh.has(H.mimeType)||i.oGt.has(H.mimeType)),ue=(0,u.Z)((()=>{R({message:e})})),me=(0,u.Z)((()=>{ae?k&&k():M?A({message:e}):oe?K(!1):de?T():f.has(q)&&I?D():ue()})),he=(0,u.Z)((()=>{O({shouldWarnAboutSvg:!U}),$(),ue()})),pe=(0,u.Z)((()=>{x(e.id,e.chatId)}));return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(g.Z,{ref:L,name:z,extension:q,size:_,timestamp:y?b||V:void 0,thumbnailDataUri:re,previewData:ce||le,smaller:n,isTransferring:oe,isUploading:ae,transferProgress:ie,className:C,sender:w,isSelectable:N,isSelected:S,actionIcon:de?(0,s.hC)(e)?"play":"eye":"download",onClick:me,onDateClick:x?pe:void 0}),a.ZP.createElement(Z.Z,{isOpen:F,onClose:$,confirmHandler:he},B("lng_launch_svg_warning"),a.ZP.createElement(p.Z,{className:"dialog-checkbox",checked:U,label:B("lng_launch_exe_dont_ask"),onCheck:j})))}))},78780:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(46752),i=n(32340),s=n(59107);const r=({content:e,className:t})=>{const n=(0,s.Z)();return a.ZP.createElement("span",{className:(0,o.Z)("DotAnimation",t),dir:n.isRtl?"rtl":"auto"},(0,i.Z)(e),a.ZP.createElement("span",{className:"ellipsis"}))}},47002:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(60748),o=n(46752),i=n(790),s=n(97184),r=n(15376),c=n(74399),l=n(32340),d=n(42797),u=n(15866),m=n(59107),h=n(70692),p=n(31212),Z=n(8337),g=n(39196);const f=(0,a.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:P,thumbnailDataUri:E,previewData:y,className:b,smaller:C,isTransferring:w,isUploading:S,isSelectable:N,isSelected:I,transferProgress:M,actionIcon:k,onClick:T,onDateClick:x})=>{const A=(0,m.Z)();let R=(0,a.sO)(null);e&&(R=e);const{isMobile:O}=(0,d.ZP)(),[L]=(0,a.eJ)(!y),B=Boolean(y),F=(0,u.Z)(E,B,O&&!s.vX),D=(0,h.Z)(!B),{shouldRender:$,transitionClassNames:U}=(0,p.Z)(w,void 0,!0),j=(0,r.Oh)(f),H=(0,r.yW)(n),z=(0,a.Ye)((()=>w&&M?`${(0,r.yW)(n*M)} / ${H}`:H),[w,n,H,M]),{width:_,height:V}=(0,c.lE)(C),q=(0,o.Z)("File",b,C&&"smaller",T&&!S&&"interactive",I&&"file-is-selected");return a.ZP.createElement("div",{ref:R,className:q,dir:A.isRtl?"rtl":void 0},N&&a.ZP.createElement("div",{className:"message-select-control"},I&&a.ZP.createElement("i",{className:"icon icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:S?void 0:T},E||y?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:y,className:"full-media",width:_,height:V,draggable:!1,alt:""}),L&&a.ZP.createElement("canvas",{ref:F,className:(0,o.Z)("thumbnail",D)})):a.ZP.createElement("div",{className:`file-icon ${j}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),$&&a.ZP.createElement("div",{className:(0,o.Z)("file-progress",j,U)},a.ZP.createElement(g.Z,{progress:M,size:C?"s":"m",onClick:S?T:void 0})),T&&a.ZP.createElement("i",{className:(0,o.Z)("action-icon","icon",k?`icon-${k}`:"icon-download",$&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto",title:t},(0,l.Z)(t)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,z),P&&a.ZP.createElement("span",{className:"file-sender"},(0,l.Z)(P)),!P&&Boolean(v)&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(Z.Z,{onClick:x},(0,i.ZK)(A,1e3*v,!0))))),P&&Boolean(v)&&a.ZP.createElement(Z.Z,{onClick:x},(0,i.VX)(A,1e3*v)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),i=n(91713),s=n(4463),r=n(7054),c=n(46752),l=n(74399),d=n(32340),u=n(59107),m=n(25190),h=n(70172),p=n(78780),Z=n(2153),g=n(65979),f=n(2995),v=n(68729);const P=2.5*l.Gw,E=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const a=(0,r.Z1J)(e,t),o=n?(0,r.tZg)(e,t,n):void 0,i=a?(0,r.YK0)(e,a):void 0,s=Boolean((0,r.Zwk)(e,t)),c=n?a?.topics?.[n]:void 0;return{chat:a,threadInfo:o,onlineCount:i,topic:c,areMessagesLoaded:s,messagesCount:c&&(0,r.xxG)(e,t,n)}}))((({typingStatus:e,className:t,statusIcon:n,avatarSize:r="medium",noAvatar:l,status:E,withDots:y,withMediaViewer:b,withUsername:C,withFullInfo:w,withUpdatingStatus:S,withChatType:N,threadInfo:I,noRtl:M,chat:k,onlineCount:T,areMessagesLoaded:x,topic:A,messagesCount:R,noStatusOrTyping:O,withStory:L,storyViewerOrigin:B,noEmojiStatus:F,emojiStatusSize:D,onClick:$})=>{const{loadFullChat:U,openMediaViewer:j,loadProfilePhotos:H}=(0,o.Sv)(),z=(0,u.Z)(),_=k&&(0,s.ZV)(k),V=Boolean(k?.isForum&&I&&A),{id:q,isMin:W,isRestricted:Y}=k||{};(0,a.d4)((()=>{q&&!W&&(w&&U({chatId:q}),b&&H({profileId:q}))}),[q,W,w,U,H,_,b]);const G=(0,m.Z)(((e,t)=>{k&&t&&(e.stopPropagation(),j({avatarOwnerId:k.id,mediaId:0,origin:"jumbo"===r?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),X=(0,a.Ye)((()=>k&&C&&(0,s.WS)(k)),[k,C]);if(k)return a.ZP.createElement("div",{className:(0,c.Z)("ChatInfo",t),dir:!M&&z.isRtl?"rtl":void 0,onClick:$},!l&&!V&&a.ZP.createElement(h.Z,{key:k.id,size:r,peer:k,withStory:L,storyViewerOrigin:B,storyViewerMode:"single-peer",onClick:b?G:void 0}),V&&a.ZP.createElement(f.Z,{topic:A,className:"topic-header-icon",size:P}),a.ZP.createElement("div",{className:"info"},A?a.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,d.Z)(A.title)):a.ZP.createElement(Z.Z,{peer:k,emojiStatusSize:D,withEmojiStatus:!F}),!O&&function(){if(E)return y?a.ZP.createElement(p.Z,{className:"status",content:E}):a.ZP.createElement("span",{className:"status",dir:"auto"},n&&a.ZP.createElement(g.Z,{className:"status-icon",name:n}),(0,d.Z)(E));if(S&&!x&&!Y)return a.ZP.createElement(p.Z,{className:"status",content:z("Updating")});if(!k)return;if(e)return a.ZP.createElement(v.Z,{typingStatus:e});if(V)return a.ZP.createElement("span",{className:"status",dir:"auto"},R?z("messages",R,"i"):(0,d.Z)(k.title));if(N)return a.ZP.createElement("span",{className:"status",dir:"auto"},z((0,s.l6)(k)));const t=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}(z,k),o=T?`, ${z("OnlineCount",T,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},X&&a.ZP.createElement("span",{className:"handle withStatus"},X),a.ZP.createElement("span",{className:"group-status"},t),o&&a.ZP.createElement("span",{className:"online-status"},o))}()))})))},65979:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(46752);const i=({name:e,className:t,style:n})=>a.ZP.createElement("i",{className:(0,o.Z)(`icon icon-${e}`,t),style:n,"aria-hidden":!0})},76844:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(790),i=n(59107),s=n(8018);const r=(0,a.X$)((({message:e,outgoingStatus:t,draftDate:n})=>{const r=(0,i.Z)(),c=n&&n>e.date;return a.ZP.createElement("div",{className:"LastMessageMeta"},t&&!c&&a.ZP.createElement(s.Z,{status:t}),a.ZP.createElement("span",{className:"time"},(0,o.VX)(r,1e3*(c?n:e.date))))}))},12007:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(60748),o=n(33555),i=n(46752),s=n(64319),r=n(42797),c=n(59107),l=n(25190),d=n(231),u=n(53106),m=n(58964),h=n(65979);const p=(0,a.X$)((({title:e,link:t,isDisabled:n,className:p,withShare:Z,onRevoke:g})=>{const f=(0,c.Z)(),{showNotification:v,openChatWithDraft:P}=(0,o.Sv)(),{isMobile:E}=(0,r.ZP)(),y=!g,b=(0,l.Z)((()=>{(0,s.TE)(t),v({message:f("LinkCopied")})})),C=(0,l.Z)((()=>{n||b()})),w=(0,l.Z)((()=>{P({text:t})})),S=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(d.Z,{round:!0,ripple:!E,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:f("AccDescrOpenMenu2")},a.ZP.createElement("i",{className:"icon icon-more"}))),[E,f]);return a.ZP.createElement("div",{className:p},a.ZP.createElement("p",{className:"teihdlkVODIhiAWnOJtr"},f(e||"InviteLink.InviteLink")),a.ZP.createElement("div",{className:"n_u0sMwb5oen1kZQ0pTB"},a.ZP.createElement("input",{className:(0,i.Z)("form-control","jehrl4eCR56s7i_qnPJr"),value:t,readOnly:!0,onClick:C}),y?a.ZP.createElement(d.Z,{color:"translucent",className:"kiphUJhXSSQktqe2YGV_",size:"smaller",round:!0,disabled:n,onClick:C},a.ZP.createElement(h.Z,{name:"copy"})):a.ZP.createElement(u.Z,{className:"NCIcjJKDloynKk14TiXg",trigger:S,positionX:"right"},a.ZP.createElement(m.Z,{icon:"copy",onClick:C,disabled:n},f("Copy")),g&&a.ZP.createElement(m.Z,{icon:"delete",onClick:g,destructive:!0},f("RevokeButton")))),Z&&a.ZP.createElement(d.Z,{size:"smaller",disabled:n,onClick:w},f("FolderLinkScreen.LinkActionShare")))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(60748),o=n(4463),i=n(46752),s=n(790),r=n(3858),c=n(60706),l=n(3657),d=n(25190),u=n(6202),m=n(70692),h=n(62230);const p=(0,a.X$)((({message:e,idPrefix:t="shared-media",isProtected:n,observeIntersection:p,onClick:Z})=>{const g=(0,a.sO)(null),f=(0,l.Op)(g,p),v=(0,o.DH)(e),P=(0,u.Z)((0,o.Ti)(e,"pictogram"),!f),E=(0,m.Z)(P),y=(0,o.b7)(e),b=(0,o.NE)(e),[C,,w]=(0,c.Z)(b),S=(0,d.Z)((()=>{w(),Z(e.id,e.chatId)}));return a.ZP.createElement("div",{ref:g,id:`${t}${(0,o.d0)(e.id)}`,className:"Media scroll-item",onClick:Z?S:void 0},a.ZP.createElement("img",{src:v,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.Z:void 0}),a.ZP.createElement("img",{src:P,className:(0,i.Z)("full-media","media-miniature",E),alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.Z:void 0}),b&&a.ZP.createElement(h.Z,{thumbDataUri:P||v,isVisible:C,className:"media-spoiler"}),y&&a.ZP.createElement("span",{className:"video-duration"},y.isGif?"GIF":(0,s.k9)(y.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},62230:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),i=n(15866),s=n(25190),r=n(31212);const c=(0,a.X$)((({isVisible:e,withAnimation:t,thumbDataUri:n,className:c,width:l,height:d})=>{const u=(0,a.sO)(null),{shouldRender:m,transitionClassNames:h}=(0,r.Z)(e,void 0,!0,!t&&void 0,void 0,500),p=(0,i.Z)(n,!m,void 0,25,l,d),Z=(0,s.Z)((e=>{if(!u.current)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top,o=n-t.width/2,i=a-t.height/2;u.current.setAttribute("style",`--click-shift-x: ${o}px; --click-shift-y: ${i}px`)}));if(m)return a.ZP.createElement("div",{className:(0,o.Z)("MbgQHglBDZLEAHDebnxc",h,c,t&&"zFmCa6knHOC8UhmcYHq8"),ref:u,onClick:t?Z:void 0},a.ZP.createElement("canvas",{ref:p,className:"oQmroREXWSylQXgjAdIB",width:l,height:d}),a.ZP.createElement("div",{className:"leAfUrALDfdpl4i8VEmv"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(2255),i=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(i||{});const s=(0,a.X$)((({status:e})=>a.ZP.createElement("div",{className:"MessageOutgoingStatus"},a.ZP.createElement(o.ZP,{name:"reveal",activeKey:i[e]},"failed"===e?a.ZP.createElement("div",{className:"MessageOutgoingStatus--failed"},a.ZP.createElement("i",{className:"icon icon-message-failed"})):a.ZP.createElement("i",{className:`icon icon-message-${e}`})))))},47262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),i=n(32340),s=n(59107),r=n(31212);const c=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,s.Z)(),{transitionClassNames:c}=(0,r.Z)(!0);return a.ZP.createElement("div",{className:(0,o.Z)("NothingFound",c,t&&"with-description")},e,t&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(n(t),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(83716),i=n(57710),s=n(46752),r=n(3858),c=n(97184),l=n(42797),d=n(59107),u=n(28183),m=n(231);const h=(0,a.X$)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:h,placeholder:p="Password",submitLabel:Z="Next",description:g,shouldShowSubmit:f,shouldResetValue:v,shouldDisablePasswordManager:P=!1,noRipple:E=!1,clearError:y,onChangePasswordVisibility:b,onInputChange:C,onSubmit:w})=>{const S=(0,a.sO)(null),N=(0,d.Z)(),{isMobile:I}=(0,l.ZP)(),[M,k]=(0,a.eJ)(""),[T,x]=(0,a.eJ)(!1),A=I?550:400;return(0,a.d4)((()=>{v&&k("")}),[v]),(0,u.Z)((()=>{c.$b||S.current.focus()}),A),(0,a.d4)((()=>{n&&(0,i.WM)((()=>{S.current.focus(),S.current.select()}))}),[n]),a.ZP.createElement("form",{action:"",onSubmit:w?function(t){t.preventDefault(),e||T&&w(M)}:r.Z,autoComplete:"off"},a.ZP.createElement("div",{className:(0,s.Z)("input-group password-input",M&&"touched",n&&"error"),dir:N.isRtl?"rtl":void 0},P&&a.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),a.ZP.createElement("input",{ref:S,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:M||"",autoComplete:P?"one-time-code":"current-password",onChange:function(e){n&&y();const{target:t}=e;k(t.value),x(t.value.length>=o.loe),C&&C(t.value)},maxLength:256,dir:"auto"}),a.ZP.createElement("label",null,n||h||p),a.ZP.createElement("div",{className:"div-button toggle-password",onClick:function(){b(!t)},role:"button",tabIndex:0,title:"Toggle password visibility","aria-label":"Toggle password visibility"},a.ZP.createElement("i",{className:(0,s.Z)("icon",t?"icon-eye":"icon-eye-closed")}))),g&&a.ZP.createElement("p",{className:"description"},g),w&&(T||f)&&a.ZP.createElement(m.Z,{type:"submit",ripple:!E,isLoading:e,disabled:!T},Z))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(60748),o=n(57710),i=n(4463),s=n(46752),r=n(70735),c=n(27407),l=n(59107),d=n(25190),u=n(14605),m=n(21273),h=n(97687),p=n(31876),Z=n(34288),g=n(98799),f=n(49187),v=n(6058);const P=(0,a.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:P,notFoundText:E,searchInputId:y,isLoading:b,noScrollRestore:C,isSearchable:w,isRoundCheckbox:S,lockedIds:N,forceShowSelf:I,onSelectedIdsChange:M,onFilterChange:k,onDisabledClick:T,onLoadMore:x})=>{const A=(0,a.sO)(null),R=t.length>10;(0,a.d4)((()=>{w&&setTimeout((()=>{(0,o.WM)((()=>{A.current.focus()}))}),500)}),[w]);const[O,L]=(0,a.Ye)((()=>{if(!N?.length)return[r.D,t];const e=t.filter((e=>!N.includes(e)));return[N,e]}),[t,N]),B=(0,a.Ye)((()=>new Set(N)),[N]),F=(0,a.Ye)((()=>e.sort(((e,t)=>{const n=B.has(e),a=B.has(t);return n&&!a?-1:!n&&a?1:0}))),[e,B]),D=(0,d.Z)((e=>{if(B.has(e))return void T?.(e);const n=t.slice();n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),M?.(n),k?.("")})),$=(0,d.Z)((e=>{const{value:t}=e.currentTarget;k?.(t)})),[U,j]=(0,c.Z)(x,F,Boolean(n)),H=(0,l.Z)();return a.ZP.createElement("div",{className:"Picker"},w&&a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:H.isRtl?"rtl":void 0},O.map(((e,n)=>a.ZP.createElement(f.Z,{peerId:e,isMinimized:R&&n<t.length-5,forceShowSelf:I,onClick:D,clickArg:e}))),L.map(((e,n)=>a.ZP.createElement(f.Z,{peerId:e,isMinimized:R&&n+O.length<t.length-5,canClose:!0,onClick:D,clickArg:e}))),a.ZP.createElement(h.Z,{id:y,ref:A,value:n,onChange:$,placeholder:P||H("SelectChat")})),U?.length?a.ZP.createElement(m.Z,{className:"picker-list custom-scroll",items:U,onLoadMore:j,noScrollRestore:C},U.map((e=>{const n=()=>a.ZP.createElement(u.Z,{label:"",disabled:B.has(e),checked:t.includes(e),round:S});return a.ZP.createElement(p.Z,{key:e,className:(0,s.Z)("chat-item-clickable picker-list-item",S&&"chat-item"),disabled:B.has(e),allowDisabledClick:Boolean(T),onClick:()=>D(e),ripple:!0},S?void 0:n(),(0,i.YC)(e)?a.ZP.createElement(v.Z,{forceShowSelf:I,userId:e}):a.ZP.createElement(g.Z,{chatId:e}),S?n():void 0)}))):b||!U||U.length?a.ZP.createElement(Z.Z,null):a.ZP.createElement("p",{className:"no-results"},E||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(33555),i=n(4463),s=n(7054),r=n(46752),c=n(33780),l=n(32340),d=n(59107),u=n(70172);const m=(0,a.X$)((0,o.c$)(((e,{peerId:t,forceShowSelf:n})=>{if(!t)return{};const a=(0,s.Z1J)(e,t),o=(0,s.dyD)(e,t);return{chat:a,user:o,isSavedMessages:!n&&o&&o.isSelf}}))((({icon:e,title:t,isMinimized:n,canClose:o,clickArg:s,chat:m,user:h,className:p,fluid:Z,isSavedMessages:g,withPeerColors:f,onClick:v})=>{const P=(0,d.Z)();let E,y;if(e&&t)E=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:(0,r.Z)("icon",`icon-${e}`)})),y=t;else if(h||m){E=a.ZP.createElement(u.Z,{peer:h||m,size:"small",isSavedMessages:g});const e=!m||h&&!g?(0,i.Vl)(h):(0,i.U)(P,m,g);y=e?(0,l.Z)(e):void 0}const b=(0,r.Z)("PickerSelectedItem",p,m?.isForum&&"forum-avatar",n&&"minimized",o&&"closeable",Z&&"fluid",f&&(0,c.D)(m||h));return a.ZP.createElement("div",{className:b,onClick:()=>v(s),title:n?y:void 0,dir:P.isRtl?"rtl":void 0},E,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},y),o&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon icon-close"})))})))},66:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(46752),i=n(80036),s=n(59107),r=n(65979);const c="OP8qshGP9fzy9bbMvWn2",l="EjQP1rE5iExOnGWJyYIe",d=(0,a.X$)((({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:d,progress:u,className:m})=>{const h=(0,s.Z)(),p=Boolean(d||n),Z=Boolean(u)&&u>.99,g=u&&(u<.1?0:u>.9?1:.5);return a.ZP.createElement("div",{className:(0,o.Z)("qhFxTh5sx1oGuGccrzTb",p&&"fltQkzCy9DRS9QWsAAH5",m),style:(0,i.Z)(void 0!==u&&`--progress: ${u}`,void 0!==g&&`--tail-position: ${g}`)},p&&a.ZP.createElement("div",{className:"ZGxYvTYQkAjpjvgBHMdH"},a.ZP.createElement("div",{className:"pAGwoR5ceC4Y2MoDqG1g"},a.ZP.createElement("div",{className:"N8o73q2OT6d_kUTyUcg5"},d&&a.ZP.createElement(r.Z,{name:d,className:"_qQItdFB5DScaFdSJR2a"}),n&&a.ZP.createElement("div",{className:"h46zskGqCT1b3onjQB26",dir:h.isRtl?"rtl":void 0},n)),a.ZP.createElement("div",{className:"m6YwWsobe1cb3cqf0Xei"},a.ZP.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},a.ZP.createElement("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"#7E85FF"}))))),a.ZP.createElement("div",{className:c},a.ZP.createElement("span",null,e)),a.ZP.createElement("div",{className:l},a.ZP.createElement("span",null,t)),a.ZP.createElement("div",{className:(0,o.Z)("ASLJoYhAmOvHasjzMKYg",Z&&"tmwWY_SiGqqKrC8oUUDW")},a.ZP.createElement("div",{className:c},a.ZP.createElement("span",null,e)),a.ZP.createElement("div",{className:l},a.ZP.createElement("span",null,t))))}))},6058:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),i=n(91713),s=n(4463),r=n(7054),c=n(46752),l=n(32340),d=n(59107),u=n(25190),m=n(68512),h=n(70172),p=n(78780),Z=n(2153),g=n(65979),f=n(68729);const v=(0,a.X$)((0,o.c$)(((e,{userId:t,forceShowSelf:n})=>{const a=(0,r.dyD)(e,t);return{user:a,userStatus:(0,r.ssc)(e,t),isSavedMessages:!n&&a&&a.isSelf,areMessagesLoaded:Boolean((0,r.Zwk)(e,t))}}))((({typingStatus:e,avatarSize:t="medium",status:n,statusIcon:r,withDots:v,withMediaViewer:P,withUsername:E,withStory:y,withFullInfo:b,withUpdatingStatus:C,emojiStatusSize:w,noStatusOrTyping:S,noEmojiStatus:N,noRtl:I,user:M,userStatus:k,isSavedMessages:T,areMessagesLoaded:x,adminMember:A,ripple:R,className:O,storyViewerOrigin:L,onEmojiStatusClick:B})=>{const{loadFullUser:F,openMediaViewer:D,loadProfilePhotos:$}=(0,o.Sv)(),U=(0,d.Z)(),{id:j}=M||{};(0,a.d4)((()=>{j&&(b&&F({userId:j}),P&&$({profileId:j}))}),[j,b,P]);const H=(0,u.Z)(((e,n)=>{M&&n&&(e.stopPropagation(),D({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===t?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),z=(0,a.Ye)((()=>M&&E&&(0,s.WS)(M)),[M,E]);if(!M)return;const _=A?A.customTitle||U(A.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return a.ZP.createElement("div",{className:(0,c.Z)("ChatInfo",O),dir:!I&&U.isRtl?"rtl":void 0},a.ZP.createElement(h.Z,{key:M.id,size:t,peer:M,isSavedMessages:T,withStory:y,storyViewerOrigin:L,storyViewerMode:"single-peer",onClick:P?H:void 0}),a.ZP.createElement("div",{className:"info"},_?a.ZP.createElement("div",{className:"info-name-title"},a.ZP.createElement(Z.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:T,onEmojiStatusClick:B}),_&&a.ZP.createElement("span",{className:"custom-title"},_)):a.ZP.createElement(Z.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:T,onEmojiStatusClick:B}),(n||!T&&!S)&&function(){if(n)return v?a.ZP.createElement(p.Z,{className:"status",content:n}):a.ZP.createElement("span",{className:"status",dir:"auto"},r&&a.ZP.createElement(g.Z,{className:"status-icon",name:r}),(0,l.Z)(n));if(C&&!x)return a.ZP.createElement(p.Z,{className:"status",content:U("Updating")});if(!M)return;if(e)return a.ZP.createElement(f.Z,{typingStatus:e});const t=(0,s.Tq)(U,M,k),o=(0,c.Z)("handle",t&&"withStatus");return a.ZP.createElement("span",{className:(0,c.Z)("status",(0,s.kM)(M,k)&&"online")},z&&a.ZP.createElement("span",{className:o},z),t&&a.ZP.createElement("span",{className:"user-status",dir:"auto"},t))}()),R&&a.ZP.createElement(m.Z,null))})))},16568:(e,t,n)=>{n.d(t,{Z:()=>$});var a=n(60748),o=n(33555),i=n(91713),s=n(4463),r=n(7054),c=n(46752),l=n(64963),d=n(70735),u=n(97184),m=n(32340),h=n(59107),p=n(25190),Z=n(87204),g=n(70971),f=n(6137),v=n(40647),P=n(2255),E=n(70172),y=n(2153),b=n(2155),C=n(33780),w=n(42797),S=n(15866),N=n(60706),I=n(6202),M=n(70692),k=n(57080),T=n(49204);const x=(0,a.X$)((({chat:e,user:t,photo:n,isSavedMessages:o,canPlayVideo:i,onClick:r})=>{const l=(0,a.sO)(null),d=(0,h.Z)(),{isMobile:p}=(0,w.ZP)(),Z=t&&(0,s.NB)(t),g=e&&(0,s.pK)(e.id),f=t||e,v=f&&!o&&!Z&&!g,{isVideo:P}=n||{},E=v&&(0,s.RT)(f,"normal"),y=(0,I.Z)(E),x=v&&n&&!P&&`photo${n.id}?size=c`,A=(0,I.Z)(x),R=v&&n&&P&&(0,s.Dk)(n),O=(0,I.Z)(R)||A,[L,B]=(0,N.Z)(),F=Boolean(O&&(!P||L)),D=(0,M.Z)(F),$=v&&!F&&!y&&n?.thumbnail?.dataUri,U=(0,S.Z)(n?.thumbnail?.dataUri,!$,p&&!u.vX),j=n||y||$;let H;if((0,a.d4)((()=>{l.current&&!i&&(l.current.currentTime=0)}),[i]),o)H=a.ZP.createElement("i",{className:"icon icon-avatar-saved-messages"});else if(Z)H=a.ZP.createElement("i",{className:"icon icon-avatar-deleted-account"});else if(g)H=a.ZP.createElement("i",{className:"icon icon-reply-filled"});else if(j)H=a.ZP.createElement(a.ZP.Fragment,null,$?a.ZP.createElement("canvas",{ref:U,className:"thumb"}):a.ZP.createElement("img",{src:y,draggable:!1,className:"thumb",alt:""}),n&&(P?a.ZP.createElement(k.Z,{canPlay:i,ref:l,src:O,className:(0,c.Z)("avatar-media",D),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:B}):a.ZP.createElement("img",{src:O,className:(0,c.Z)("avatar-media",D),alt:""})));else if(t){const e=(0,s.Js)(t);H=e?(0,b.Xv)(e,2):void 0}else if(e){const t=(0,s.U)(d,e);H=t&&(0,b.Xv)(t,(0,s.YC)(e.id)?2:1)}else H=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(T.Z,{color:"white"}));const z=(0,c.Z)("ProfilePhoto",(0,C.D)(f),o&&"saved-messages",Z&&"deleted-account",g&&"replies-bot-account",!o&&!j&&"no-photo");return a.ZP.createElement("div",{className:z,onClick:j?r:void 0},"string"==typeof H?(0,m.Z)(H,["hq_emoji"]):H)}));var A=n(2995);const R="DwTvYuXwYiyH8P8HGyEw",O="a_azkhZzdtjRO5pWnNno",L="NVXGZpj7iFHkn7HaGsey",B="zPvRR0bFn0HFuXDjj1wU",F="YvztuUsksHhhNiXGWWbN",D="rcKy8wQruH_z84yRjAry",$=(0,a.X$)((0,o.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:a}=e,o=(0,r.dyD)(e,t),i=(0,s.YC)(t),c=(0,r.ssc)(e,t),l=(0,r.Z1J)(e,t),d=!n&&o&&o.isSelf,{mediaId:u,avatarOwnerId:m}=(0,r.jUK)(e).mediaViewer,h=l?.isForum,{threadId:p}=(0,r.Btg)(e)||{},Z=h&&p?l?.topics?.[p]:void 0,g=i?(0,r.ccz)(e,t):void 0,f=i?void 0:(0,r.x67)(e,t);return{connectionState:a,user:o,userStatus:c,chat:l,userPersonalPhoto:g?.personalPhoto,userProfilePhoto:g?.profilePhoto,userFallbackPhoto:g?.fallbackPhoto,chatProfilePhoto:f?.profilePhoto,isSavedMessages:d,mediaId:u,avatarOwnerId:m,...Z&&{topic:Z,messagesCount:(0,r.xxG)(e,t,p)}}}))((({forceShowSelf:e,canPlayVideo:t,user:n,userStatus:r,chat:b,isSavedMessages:C,connectionState:w,mediaId:S,avatarOwnerId:N,topic:I,messagesCount:M,userPersonalPhoto:k,userProfilePhoto:T,userFallbackPhoto:$,chatProfilePhoto:U})=>{const{loadFullUser:j,openMediaViewer:H,openPremiumModal:z}=(0,o.Sv)(),_=(0,h.Z)(),{id:V}=n||{},{id:q}=b||{},W=n?.photos||b?.photos||d.D,Y=(0,Z.Z)(S),G=(0,Z.Z)(N),X=(0,g.Y)(S),[K,J]=(0,a.eJ)(!0),Q=K?_.isRtl?"slideRtl":"slide":"none",[ee,te]=(0,a.eJ)(0),ne=C||W.length<=1||0===ee,ae=C||W.length<=1||ee===W.length-1;(0,a.d4)((()=>{G&&void 0!==Y&&void 0===S&&(J(!1),te(Y))}),[S,Y,G]),(0,a.d4)((()=>{J(!1),te(X.current||0)}),[X,W]),(0,a.d4)((()=>{ee>W.length&&(J(!1),te(Math.max(0,W.length-1)))}),[ee,W.length]),(0,a.d4)((()=>{"connectionStateReady"===w&&V&&!e&&j({userId:V})}),[V,j,w,e]),function(e,t){(0,a.d4)((()=>{e.slice(t,t+4).forEach((e=>{v.UV(`photo${e.id}?size=c`)||v.he(`photo${e.id}?size=c`,f.IU.BlobUrl)}))}),[t,e])}(W,ee);const oe=(0,p.Z)((()=>{H({avatarOwnerId:V||q,mediaId:ee,origin:e?i.bZ.SettingsAvatar:i.bZ.ProfileAvatar})})),ie=(0,p.Z)((()=>{V&&z({fromUserId:V})})),se=(0,p.Z)((()=>{ne||(J(!0),te(ee-1))})),re=(0,p.Z)((()=>{ae||(J(!0),te(ee+1))}));if((0,a.d4)((()=>{const e=document.querySelector(`.${F}`);if(e)return(0,l.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:u.$b?(e,t)=>t===l.eM.Right?(se(),!0):t===l.eM.Left&&(re(),!0):void 0})}),[re,se]),n||b)return I?a.ZP.createElement("div",{className:"Dlmqly7y8H7bCtaGNFIO"},a.ZP.createElement(A.Z,{topic:I,size:120,className:"Bv321I_wzF0fdNw63dxB",letterClassName:"MwfYq2acbtWIp8pGf9kI",noLoopLimit:!0}),a.ZP.createElement("h3",{className:"eMDgnAzVXSNlBUAgdBPK",dir:_.isRtl?"rtl":void 0},(0,m.Z)(I.title)),a.ZP.createElement("p",{className:"YrvPEuAvDVR3BLU68aIN"},M?_("Chat.Title.Topic",M,"i"):_("lng_forum_no_messages"))):a.ZP.createElement("div",{className:(0,c.Z)("ProfileInfo",e&&"M4GWpBd7i7ViA2xNTvH4"),dir:_.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:F},function(){if(!(C||!W||W.length<=1))return a.ZP.createElement("div",{className:"UXIlP1uQpXVG_DNB26iC"},W.map(((e,t)=>a.ZP.createElement("span",{className:(0,c.Z)("Ay_dhoiSuGWjH2hVOy7i",t===ee&&"xWzV6TAYO756R70Pzfmb")}))))}(),!e&&k&&a.ZP.createElement("div",{className:(0,c.Z)(O,ne&&B)},a.ZP.createElement("div",{className:L},_(k.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto"))),e&&$&&a.ZP.createElement("div",{className:(0,c.Z)(O,(ne||ae)&&B)},a.ZP.createElement("div",{className:L,onClick:function(){ne&&(J(!0),te(W.length-1))}},!ae&&a.ZP.createElement(E.Z,{photo:$,className:"IG9hcS9__jiZjU59BA1U",size:"mini"}),_($.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),a.ZP.createElement(P.ZP,{activeKey:ee,name:Q},ce),!ne&&a.ZP.createElement("button",{type:"button",dir:_.isRtl?"rtl":void 0,className:(0,c.Z)(D,"IrGNErqISNgGY687XP5I"),"aria-label":_("AccDescrPrevious"),onClick:se}),!ae&&a.ZP.createElement("button",{type:"button",dir:_.isRtl?"rtl":void 0,className:(0,c.Z)(D,"mERrfFjC7wKBhpVCjGgg"),"aria-label":_("Next"),onClick:re})),a.ZP.createElement("div",{className:"uHKuP7J67YWxko9FiDo9",dir:_.isRtl?"rtl":"auto"},(n||b)&&a.ZP.createElement(y.Z,{peer:n||b,withEmojiStatus:!0,emojiStatusSize:24,isSavedMessages:C,onEmojiStatusClick:ie,noLoopLimit:!0,canCopyTitle:!0}),!C&&(n?a.ZP.createElement("div",{className:(0,c.Z)(R,"status",(0,s.kM)(n,r)&&"online")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,s.Tq)(_,n,r))):a.ZP.createElement("span",{className:(0,c.Z)(R,"status"),dir:"auto"},(0,s.eA)(b)?_("Subscribers",b.membersCount??0,"i"):_("Members",b.membersCount??0,"i")))));function ce(e){const o=(!C&&W.length>0?W[ee]:void 0)||k||T||U||$;return a.ZP.createElement(x,{key:ee,user:n,chat:b,photo:o,isSavedMessages:C,canPlayVideo:Boolean(e&&t),onClick:oe})}})))},48198:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(6137),i=n(4463),s=n(46752),r=n(6202),c=n(70692),l=n(96459),d=n(69123);const u=(0,a.X$)((({reaction:e,availableReactions:t,className:n,size:u,withIconHeart:m,observeIntersection:h})=>{const p="documentId"in e,Z=(0,a.Ye)((()=>t?.find((t=>(0,i.Hl)(t.reaction,e)))),[t,e]),g=Z?.staticIcon?.id,f=(0,r.Z)(`document${g}`,!g,o.IU.BlobUrl),v=(0,c.Z)(f),P="emoticon"in e&&"🦄"===e.emoticon,E=m&&"emoticon"in e&&""===e.emoticon;return p?a.ZP.createElement(l.Z,{documentId:e.documentId,className:(0,s.Z)("ReactionStaticEmoji",n),size:u,observeIntersectionForPlaying:h}):E?a.ZP.createElement("i",{className:"ReactionStaticEmoji icon icon-heart",style:`font-size: ${u}px; width: ${u}px`}):a.ZP.createElement("img",{className:(0,s.Z)("ReactionStaticEmoji",P&&"with-unicorn-fix",v,n),style:u?`width: ${u}px; height: ${u}px`:void 0,src:f||d,alt:Z?.title,draggable:!1})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(33555),i=n(46752),s=n(59107),r=n(25190),c=n(231),l=n(97687),d=n(34563),u=n(14434);const m=(0,a.X$)((({isOpen:e,subject:t="messages",peerId:n,photo:m,messageIds:h,storyId:p,onClose:Z,onCloseAnimationEnd:g})=>{const{reportMessages:f,reportPeer:v,reportProfilePhoto:P,reportStory:E,exitMessageSelectMode:y}=(0,o.Sv)(),[b,C]=(0,a.eJ)("spam"),[w,S]=(0,a.eJ)(""),N=(0,r.Z)((()=>{switch(t){case"messages":f({messageIds:h,reason:b,description:w}),y();break;case"peer":v({chatId:n,reason:b,description:w});break;case"media":P({chatId:n,photo:m,reason:b,description:w});break;case"story":E({peerId:n,storyId:p,reason:b,description:w})}Z()})),I=(0,r.Z)((e=>{C(e)})),M=(0,r.Z)((e=>{S(e.target.value)})),k=(0,s.Z)(),T=(0,a.Ye)((()=>[{value:"spam",label:k("lng_report_reason_spam")},{value:"violence",label:k("lng_report_reason_violence")},{value:"pornography",label:k("lng_report_reason_pornography")},{value:"childAbuse",label:k("lng_report_reason_child_abuse")},{value:"copyright",label:k("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:k("lng_report_reason_other")}]),[k]);if("messages"===t&&!h||"peer"===t&&!n||"media"===t&&(!n||!m)||"story"===t&&(!p||!n))return;const x=k("messages"===t?"lng_report_message_title":"ReportPeer.Report");return a.ZP.createElement(d.Z,{isOpen:e,onClose:Z,onEnter:e?N:void 0,onCloseAnimationEnd:g,className:(0,i.Z)("narrow","story"===t&&"component-theme-dark"),title:x},a.ZP.createElement(u.Z,{name:"report-message",options:T,onChange:I,selected:b}),a.ZP.createElement(l.Z,{label:k("lng_report_reason_description"),value:w,onChange:M}),a.ZP.createElement("div",{className:"dialog-buttons"},a.ZP.createElement(c.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:N},k("lng_report_button")),a.ZP.createElement(c.Z,{className:"confirm-dialog-button",isText:!0,onClick:Z},k("Cancel"))))}))},2995:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(96459),i=n(58987);const s=(0,a.X$)((({topic:e,className:t,letterClassName:n,size:s,noLoopLimit:r,observeIntersection:c,onClick:l})=>e.iconEmojiId&&"0"!==e.iconEmojiId?a.ZP.createElement(o.Z,{documentId:e.iconEmojiId,className:t,size:s,observeIntersectionForPlaying:c,loopLimit:r?void 0:2,onClick:l}):a.ZP.createElement(i.Z,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:l})))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(33555),i=n(4463),s=n(7054),r=n(32340),c=n(59107),l=n(78780);const d=(0,a.X$)((0,o.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dyD)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),o=t&&!t.isSelf&&(0,i.Vl)(t),s=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return a.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},o&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,r.Z)(o)),a.ZP.createElement(l.Z,{content:s}))})))},45418:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(60748),o=n(4463),i=n(46752),s=n(790),r=n(48035),c=n(996),l=n(32340),d=n(59107),u=n(25190),m=n(8337),h=n(13709),p=n(10088);const Z=(0,a.X$)((({message:e,senderTitle:t,isProtected:n,observeIntersection:Z,onMessageClick:g})=>{const f=(0,d.Z)();let v=(0,o.s1)(e);if(!v){const t=(0,o.T7)(e);if(t){const{url:n,domain:a}=t;v={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,o.UD)(e)!==n?(0,c.e)(f,e,void 0,void 0,170):void 0}}}const P=(0,u.Z)((()=>{g(e.id,e.chatId)}));if(!v)return;const{siteName:E,url:y,displayUrl:b,title:C,description:w,formattedDescription:S,photo:N,video:I}=v,M=!t&&w&&(0,r.Z)(w,170),k=(0,i.Z)("WebLink scroll-item",!N&&!I&&"without-media"),T=y.replace("mailto:","")||b;return a.ZP.createElement("div",{className:k,"data-initial":(E||b)[0],dir:f.isRtl?"rtl":void 0},N&&a.ZP.createElement(h.Z,{message:e,isProtected:n,observeIntersection:Z}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(m.Z,{isRtl:f.isRtl,className:"site-title",onClick:P},(0,l.Z)(C||E||b)),(M||S)&&a.ZP.createElement(m.Z,{isRtl:f.isRtl,className:"site-description",onClick:P},S||M&&(0,l.Z)(M)),a.ZP.createElement(p.Z,{url:y,className:"site-name",text:T,isRtl:f.isRtl}),t&&a.ZP.createElement("div",{className:"sender-name"},(0,l.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(m.Z,{className:"date",onClick:P,isRtl:f.isRtl},(0,s.VX)(f,1e3*e.date))))}))},32683:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(4463),i=n(46752),s=n(74399),r=n(33780),c=n(32340),l=n(4809),d=n(39415),u=n(3657),m=n(59107),h=n(6202),p=n(2903),Z=n(75368),g=n(78323),f=n(65979),v=n(62230),P=n(45370),E=n(41278);const y=({className:e,message:t,replyInfo:n,sender:y,senderChat:b,forwardSender:C,title:w,customText:S,isProtected:N,isInComposer:I,noUserColors:M,chatTranslations:k,requestedChatTranslationLanguage:T,observeIntersectionForLoading:x,observeIntersectionForPlaying:A,onClick:R})=>{const O=(0,a.sO)(null),L=(0,u.Op)(O,x),B=(0,a.Ye)((()=>{const e="message"===n?.type&&n.replyMedia;if(e)return{content:e}}),[n]),F=(0,h.Z)(t&&(0,o.Ti)(t,"pictogram"),!L),D=(0,p.Z)(t||B),$=Boolean(t&&(0,o.Y5)(t)),U=Boolean(t&&(0,o.NE)(t)),j=Boolean("message"===n?.type&&n.isQuote),H="message"===n?.type?n.replyFrom:void 0,z=t&&(0,o.cT)(t),{translatedText:_}=(0,Z.Z)(k,t?.chatId,z?t?.id:void 0,T),V=(0,m.Z)(),q=y?(0,o.OU)(V,y):H?.hiddenUserName||t?.forwardInfo?.hiddenUserName,W=b?(0,o.OU)(V,b):t?.forwardInfo?.hiddenUserName,Y=C?(0,o.OU)(V,C):t?.forwardInfo?.hiddenUserName,G=y?.id===C?.id,{handleClick:X,handleMouseDown:K}=(0,d.m)(R);return a.ZP.createElement("div",{ref:O,className:(0,i.Z)("EmbeddedMessage",e,(0,r.D)(y,M,!0),j&&"is-quote",D&&"with-thumb"),dir:V.isRtl?"rtl":void 0,onClick:X,onMouseDown:K},D&&function(e,t,n,o,r){const{width:c,height:l}=(0,s.W7)(),d=t||e;return a.ZP.createElement("div",{className:(0,i.Z)("embedded-thumb",n&&"round")},!r&&a.ZP.createElement("img",{src:d,width:c,height:l,alt:"",className:"pictogram",draggable:!1}),a.ZP.createElement(v.Z,{thumbDataUri:d,isVisible:Boolean(r),width:c,height:l}),o&&a.ZP.createElement("span",{className:"protector"}))}(D,F,$,N,U),y?.color?.backgroundEmojiId&&a.ZP.createElement(E.Z,{emojiDocumentId:y.color.backgroundEmojiId,className:"EmbeddedMessage--background-icons"}),a.ZP.createElement("div",{className:"message-text"},a.ZP.createElement("p",{className:(0,i.Z)("embedded-text-wrapper",j&&"multiline")},"message"===n?.type&&n.quoteText?(0,l.H)({text:n.quoteText.text,entities:n.quoteText.entities,noLineBreaks:I}):t?(0,o.FT)(t)?a.ZP.createElement(g.Z,{message:t,isEmbedded:!0,observeIntersectionForLoading:x,observeIntersectionForPlaying:A}):a.ZP.createElement(P.Z,{lang:V,message:t,noEmoji:Boolean(D),translatedText:_,observeIntersectionForLoading:x,observeIntersectionForPlaying:A,emojiSize:17}):S||" "),a.ZP.createElement("div",{className:"message-title"},function(){if(w)return(0,c.Z)(w);if(!q)return" ";let e;b&&((0,o.eA)(b)&&(e="channel-filled"),(0,o.Bf)(b)&&(e="group-filled"));const t=b?.id===y?.id,i=I&&Boolean(n&&"quoteText"in n&&n?.quoteText);return a.ZP.createElement(a.ZP.Fragment,null,!t&&a.ZP.createElement("span",{className:"embedded-sender"},(0,c.Z)(i?V("ReplyToQuote",q):q)),e&&a.ZP.createElement(f.Z,{name:e,className:"embedded-chat-icon"}),e&&W&&(0,c.Z)(W))}(),Y&&!G&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(f.Z,{name:C?"share-filled":"forward",className:"embedded-origin-icon"}),(0,c.Z)(Y)))))}},41278:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),i=n(80036),s=n(96459);const r=[{inline:5,block:15,opacity:.35,scale:1},{inline:10,block:45,opacity:.3,scale:.9},{inline:20,block:75,opacity:.3,scale:.75},{inline:40,block:20,opacity:.25,scale:.8},{inline:60,block:50,opacity:.25,scale:.85},{inline:55,block:-5,opacity:.2,scale:.75},{inline:80,block:15,opacity:.15,scale:.95},{inline:100,block:70,opacity:.15,scale:.9},{inline:120,block:25,opacity:.1,scale:.65},{inline:140,block:0,opacity:.1,scale:.75}],c=(0,a.X$)((({emojiDocumentId:e,className:t})=>a.ZP.createElement("div",{className:(0,o.Z)("Ypqi0benYTguShBFVcsL",t)},r.map((t=>{const{inline:n,block:o,opacity:r,scale:c}=t,l=(0,i.Z)(`inset-inline-end: ${n}px`,`inset-block-start: ${o}px`,`opacity: ${r}`,`transform: scale(${c})`);return a.ZP.createElement(s.Z,{documentId:e,className:"nFlcFpLQg_eQdDkZUxVp",noPlay:!0,style:l})})))))},4830:(e,t,n)=>{function a(e,t){const{level:n,boosts:a,currentLevelBoosts:o,nextLevelBoosts:i,hasMyBoost:s}=e,r=t&&a===o&&s;return{currentLevel:r?n-1:n,hasNextLevel:Boolean(i),boosts:a,levelProgress:!i||r?1:(a-o)/(i-o),remainingBoosts:i?i-a:0}}n.d(t,{k:()=>a})},996:(e,t,n)=>{n.d(t,{X:()=>c,e:()=>l});var a=n(6137),o=n(4463),i=n(48035),s=n(32340),r=n(4809);function c({message:e,highlight:t,emojiSize:n,isSimple:a,truncateLength:s,isProtected:c,forcePlayback:l,shouldRenderAsHtml:d,isForMediaViewer:u}){const{text:m,entities:h}=e.content.text||{};if(!m){const t=(0,o.UD)(e);return t?[(0,i.Z)(t,s)]:void 0}const p=(0,o.Tp)(e);return(0,r.H)({text:(0,i.Z)(m,s),entities:h,highlight:t,emojiSize:n,shouldRenderAsHtml:d,containerId:`${u?"mv-":""}${p}`,isSimple:a,isProtected:c,forcePlayback:l})}function l(e,t,n=!1,r,l=o.lN){const{entities:d}=t.content.text||{},u=d?.some((e=>e.type===a.Vv.Spoiler)),m=d?.some((e=>e.type===a.Vv.CustomEmoji));if(!u&&!m){const a=(0,i.Z)((0,o.MK)(e,t,n),l);return r?(0,s.Z)(a,["emoji","highlight"],{highlight:r}):(0,s.Z)(a)}const h=!n&&(0,o.Eb)(t),p=h?`${h} `:"",Z=c({message:t,highlight:r,isSimple:!0,truncateLength:l}),g=(0,o.Kk)(e,t,Z);return[...(0,s.Z)(p),...Array.isArray(g)?g:[g]].filter(Boolean)}},67427:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(4463),i=n(46752),s=n(80036),r=n(97184),c=n(6202),l=n(96459);const d="zSAQoiw2P8dHog4GGC6Y",u=(0,a.X$)((({reaction:e,isLottie:t,className:n,particleSize:u,onEnded:m})=>{const h=(0,o.RK)(e.documentId),p=(0,c.Z)(t?void 0:h),Z=(0,a.Ye)((()=>r._G?Array.from({length:7}).map((()=>function(e=20){const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(u))):[]),[u]);if(p||t)return a.ZP.createElement("div",{className:(0,i.Z)("CBuciapCXTFHGIT8QJjp",n),style:(0,s.Z)(Boolean(u)&&`--particle-size: ${u}px`)},Z.map(((n,o)=>{const i=`--offset-path: path('${n}');`;return t?a.ZP.createElement(l.Z,{documentId:e.documentId,className:d,style:i,withSharedAnimation:!0,size:u,onAnimationEnd:0===o?m:void 0}):a.ZP.createElement("img",{src:p,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?m:void 0})})))}))},36368:(e,t,n)=>{n.d(t,{Z:()=>w});var a=n(60748),o=n(33555),i=n(4463),s=n(7054),r=n(46752),c=n(28712),l=n(74399),d=n(60706),u=n(3657),m=n(25190),h=n(6202),p=n(31212),Z=n(60422),g=n(97799),f=n(96459),v=n(48198),P=n(67427);const E={root:"UoQ7Ahl_08BYJER7dkXg","animated-icon":"m6I0yrKxFYZrVajqEjYY",animatedIcon:"m6I0yrKxFYZrVajqEjYY",effect:"DUYRztiKh76RsdbcJpu8",animating:"_sWZKdctR4GWBAZk5LvT",withEffectOnly:"bcQvAAQmccIErVUj7YDo"},y=1.5*l.Gw,b=6.5*l.Gw,C=l.Gw,w=(0,a.X$)((0,o.c$)(((e,{containerId:t})=>{const{availableReactions:n,genericEmojiEffects:a}=e,{activeReactions:o}=(0,s.jUK)(e),i=(0,s.$Yd)(e,"reactionEffects");return{activeReactions:o?.[t],availableReactions:n,genericEffects:a,withEffects:i}}))((({containerId:e,reaction:t,className:n,size:s=y,effectSize:l=b,activeReactions:w,availableReactions:S,genericEffects:N,withEffects:I,withEffectOnly:M,shouldPause:k,shouldLoop:T,observeIntersection:x})=>{const{stopActiveReaction:A}=(0,o.Sv)(),R=(0,a.sO)(null),O="documentId"in t,L=(0,a.Ye)((()=>S?.find((e=>(0,i.Hl)(e.reaction,t)))),[S,t]),B=L?.centerIcon?.id,{customEmoji:F}=(0,Z.Z)(O?t.documentId:void 0),D=(0,a.Ye)((()=>{if(!O)return L?.aroundAnimation?.id;if(!F)return;const e=S?.find((e=>e.reaction.emoticon===F.emoji))?.aroundAnimation?.id;return e}),[L,S,F,O]),$=(0,a.Ye)((()=>{if(D)return D;if(!N?.stickers)return;const{stickers:e}=N;return e[Math.floor(Math.random()*e.length)].id}),[D,N]),U=(0,u.Op)(R,x),j=B&&`sticker${B}`,H=$&&`sticker${$}`,z=(0,h.Z)(j,!B),_=(0,h.Z)(H,!$),V=(0,a.Ye)((()=>w?.find((e=>(0,i.Hl)(e,t)))),[w,t]),q=Boolean(I&&V&&(O||z)&&_),W=U&&(q&&!M||T),{shouldRender:Y,transitionClassNames:G}=(0,p.Z)(q,void 0,!0,"slow"),{shouldRender:X,transitionClassNames:K}=(0,p.Z)(W,void 0,!0,"slow"),J=(0,m.Z)((()=>{A({containerId:e,reaction:t})})),[Q,ee,te]=(0,d.Z)(),ne=!(O||W&&Q),{shouldRender:ae,transitionClassNames:oe}=(0,p.Z)(ne,void 0,!0),ie=(0,r.Z)(E.root,Y&&E.animating,M&&E.withEffectOnly,n);return a.ZP.createElement("div",{className:ie,ref:R},!M&&ae&&a.ZP.createElement(v.Z,{className:oe,reaction:t,availableReactions:S,size:s,observeIntersection:x}),!M&&O&&a.ZP.createElement(f.Z,{documentId:t.documentId,className:E.customEmoji,size:s,noPlay:k,forceAlways:!0,observeIntersectionForPlaying:x}),X&&!O&&a.ZP.createElement(g.Z,{key:`${B}-${s}`,className:(0,r.Z)(E.animatedIcon,K),size:(0,c.gO)(1.9*s),tgsUrl:z,play:U&&!k,noLoop:!T,forceAlways:!0,onLoad:ee,onEnded:te}),Y&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(g.Z,{key:`${$}-${l}`,className:(0,r.Z)(E.effect,G),size:l,tgsUrl:_,play:U,noLoop:!0,forceAlways:!0,onEnded:J}),O&&!D&&U&&a.ZP.createElement(P.Z,{reaction:t,className:G,particleSize:Math.max(.5*s,C),onEnded:J})))})))},50742:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}},79347:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"MuteChatModal",!t);return n?a.ZP.createElement(n,e):void 0}},77699:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(46752),i=n(19369),s=n(2155),r=n(86203),c=n(34076),l=n(40126);const d=(0,a.X$)((({topic:e,chat:t,isPinned:n,isMuted:d,shouldShowOnlyMostImportant:u,wasTopicOpened:m,forceHidden:h})=>{const{unreadMentionsCount:p=0,unreadReactionsCount:Z=0}=t.isForum?{}:t,g=!n&&e&&!m,f=t.isForum&&!e,v=(0,a.Ye)((()=>f&&t?.topics?Object.values(t.topics).filter((({unreadCount:e})=>e)):void 0),[t,f]),P=(0,a.Ye)((()=>f?d&&v?.filter((e=>!1===e.isMuted)).length||v?.length:(e||t).unreadCount),[t,e,v,f,d]),E=(0,a.Ye)((()=>{const e=t.topics&&Object.values(t.topics).some((e=>!e.isMuted&&e.unreadCount));return d||t.topics&&!e}),[t,d]),y=!e&&t.hasUnreadMark,b=!(0,r.Z)((()=>(0,i.$Z)(h)?h():h),[h])&&Boolean(P||p||y||n||Z||g),C=Boolean(P||y),w=(0,o.Z)("ChatBadge",E&&"muted",!C&&n&&"pinned",C&&"unread");return a.ZP.createElement(l.Z,{isCustom:!0,className:"ChatBadge-transition",isOpen:b},function(){const e=Z&&a.ZP.createElement("div",{className:(0,o.Z)("ChatBadge reaction",E&&"muted")},a.ZP.createElement("i",{className:"icon icon-heart"})),t=p&&a.ZP.createElement("div",{className:"ChatBadge mention"},a.ZP.createElement("i",{className:"icon icon-mention"})),i=g&&a.ZP.createElement("div",{className:(0,o.Z)("ChatBadge unopened",E&&"muted")}),r=y||P?a.ZP.createElement("div",{className:w},!y&&a.ZP.createElement(c.Z,{text:(0,s.bi)(P)})):void 0,l=n&&!r&&!t&&!e&&a.ZP.createElement("div",{className:w},a.ZP.createElement("i",{className:"icon icon-pinned-chat"})),d=[i,e,t,r,l].filter(Boolean);if(0!==d.length)return 1===d.length?d[0]:u?[t,r,e,l].filter(Boolean)[0]:a.ZP.createElement("div",{className:"ChatBadge-wrapper"},d)}())}))},40340:(e,t,n)=>{n.d(t,{Z:()=>le});var a=n(60748),o=n(33555),i=n(91713),s=n(83716),r=n(46752),c=n(16974),l=n(82267),d=n(97184),u=n(13995),m=n(57710),h=n(87675),p=n(67360),Z=n(25190),g=n(95616),f=n(73541),v=n(27407),P=n(3657),E=n(61204),y=n(21273),b=n(34288),C=n(4463),w=n(60782),S=n(2155),N=n(32340),I=n(59107),M=n(95481),k=n(31876);const T={root:"QNEU55wdWY0UBHKcohz_",minimized:"HJvl22k3BH70ntnjhIP0",button:"RF4n_8QOkb5FMXcpbmBW",title:"XFFMu4VlEHKxRihwcGTm","unread-count":"jYYtPy1W31sqUc_gw9RW",unreadCount:"jYYtPy1W31sqUc_gw9RW",info:"fvlwjR3heR1XQKFT_jiv",name:"Njj0lF4z1QQ96mlTyHt_",icon:"EKj05B3RNFnEMtMNttAq",avatarWrapper:"qx5qdiOt16oub2O9sYeg",avatar:"n8grGxKGGUr4oa8NVGFW",chatsPreview:"m7P0WNHzg_kxle3rxniA",unread:"mee_ERQMDxZsfb47JEBb"},x=(0,a.X$)((({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:i}=(0,o.Sv)(),c=(0,I.Z)(),l=(0,g.d7)(s.WSp),d=(0,g.yi)(),u=d[s.WSp]?.chatsCount,m=(0,a.Ye)((()=>{if(!l?.length)return c("Loading");const e=(0,o.Rd)().chats.byId;return l.slice(0,5).map(((t,n,o)=>{const i=n===o.length-1,s=e[t];if(!s)return;const l=(0,C.U)(c,s);return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:(0,r.Z)(T.chat,u&&s.unreadCount&&T.unread)},(0,N.Z)(l)),i?"":", ")}))}),[l,c,u]),h=(0,a.Ye)((()=>{const t=!e.isMinimized&&{title:c("lng_context_archive_collapse"),icon:"collapse",handler:()=>{i({isMinimized:!0})}},n=e.isMinimized&&{title:c("lng_context_archive_expand"),icon:"expand",handler:()=>{i({isMinimized:!1})}},a={title:c("lng_context_archive_to_menu"),icon:"archive-to-main",handler:()=>{i({isHidden:!0})}};return(0,w.oA)([t,n,a])}),[e.isMinimized,c,i]),p=(0,a.I4)((e=>{e.preventDefault(),t?.()}),[t]);return a.ZP.createElement(k.Z,{onClick:n,onDragEnter:p,className:(0,r.Z)(T.root,e.isMinimized&&T.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:T.button,contextActions:h,withPortalForMenu:!0},e.isMinimized?a.ZP.createElement("div",{className:(0,r.Z)(T.info,"info")},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,r.Z)("title",T.title)},a.ZP.createElement("h3",{dir:"auto",className:(0,r.Z)(T.name,"fullName")},a.ZP.createElement("i",{className:(0,r.Z)(T.icon,"icon","icon-archive-filled")}),c("ArchivedChats"))),a.ZP.createElement(M.Z,{className:T.unreadCount,text:u?(0,S.bi)(u):void 0}))):a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:(0,r.Z)("status",T.avatarWrapper)},a.ZP.createElement("div",{className:(0,r.Z)("Avatar",T.avatar)},a.ZP.createElement("i",{className:"icon icon-archive-filled"}))),a.ZP.createElement("div",{className:(0,r.Z)(T.info,"info")},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,r.Z)("title",T.title)},a.ZP.createElement("h3",{dir:"auto",className:(0,r.Z)(T.name,"fullName")},c("ArchivedChats")))),a.ZP.createElement("div",{className:"subtitle"},a.ZP.createElement("div",{className:(0,r.Z)("status",T.chatsPreview)},m),a.ZP.createElement(M.Z,{className:T.unreadCount,text:u?(0,S.bi)(u):void 0})))))}));var A=n(6137),R=n(26646),O=n(7054),L=n(15780),B=n(42797),F=n(41470),D=n(60706),$=n(65116),U=n(19369),j=n(7792);const H=new Map;(0,$.ll)((e=>{for(const[t,{setter:n}]of H)n(t(e))}));var z=n(31212),_=n(44499),V=n(70172),q=n(40329),W=n(2153),Y=n(76844),G=n(66534),X=n(50742),K=n(79347),J=n(77699);const Q="mem3FdA38CqQltSSxUwi",ee=(0,a.X$)((({isSelected:e,isActive:t,isMobile:n})=>a.ZP.createElement("div",{className:(0,r.Z)("wYxzEPxIxq51N_1Jvb22",t&&"AtRfJ5hbKIb7giL05RZz",e&&!n&&"J83lhIRMV9uenQVCQJpB")},a.ZP.createElement("div",{className:"GjqQzJt4PhbEBMchbPMg"},a.ZP.createElement("div",{className:Q}),a.ZP.createElement("div",{className:Q}),a.ZP.createElement("div",{className:Q}))))),te=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const n=(0,O.Z1J)(e,t);if(!n)return{};const{lastMessage:a}=n,{senderId:o,isOutgoing:i}=a||{},s=a&&(0,R.H)(a)?.replyToMsgId,r=o?(0,O.dyD)(e,o)||(0,O.Z1J)(e,o):void 0,c=a?(0,C.N5)(a):void 0,l=c&&s?(0,O.hjO)(e,n.id,s):void 0,{targetUserIds:d,targetChatId:u}=c||{},m=(0,C.zX)(n),{chatId:h,threadId:p,type:Z}=(0,O.Btg)(e)||{},g=t===h&&p===A._f,f=n.isForum&&t===h||t===(0,O.jUK)(e).forumPanelChatId,v=m?(0,O.dyD)(e,m):void 0,P=m?(0,O.ssc)(e,m):void 0,E=a&&(0,O.p$s)(e,a),y=(0,O.WPz)(e,t,A._f,"typingStatus");return{chat:n,isMuted:(0,C.i4)(n,(0,O.dZI)(e),(0,O.NJL)(e)),lastMessageSender:r,actionTargetUserIds:d,actionTargetChatId:u,actionTargetMessage:l,draft:(0,O.Mst)(e,t,A._f),isSelected:g,isSelectedForum:f,isForumPanelOpen:(0,O.nd)(e),canScrollDown:g&&"thread"===Z,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...i&&a&&{lastMessageOutgoingStatus:(0,O.dTW)(e,a)},user:v,userStatus:P,lastMessageTopic:E,typingStatus:y,withInterfaceAnimations:(0,O.FOo)(e)}}))((({chatId:e,folderId:t,orderDiff:n,animationType:s,isPinned:c,observeIntersection:l,chat:u,isMuted:m,user:h,userStatus:p,actionTargetUserIds:g,lastMessageSender:f,lastMessageOutgoingStatus:v,actionTargetMessage:E,actionTargetChatId:y,offsetTop:b,draft:w,withInterfaceAnimations:S,isSelected:N,isSelectedForum:I,isForumPanelOpen:M,canScrollDown:T,canChangeFolder:x,lastMessageTopic:R,typingStatus:$,onDragEnter:Q})=>{const{openChat:te,focusLastMessage:ne,loadTopics:ae,openForumPanel:oe,closeForumPanel:ie}=(0,o.Sv)(),{isMobile:se}=(0,B.ZP)(),[re,ce,le]=(0,D.Z)(),[de,ue,me]=(0,D.Z)(),[he,pe,Ze]=(0,D.Z)(),[ge,fe,ve]=(0,D.Z)(),[Pe,Ee,ye]=(0,D.Z)(),[be,Ce,we]=(0,D.Z)(),[Se,Ne,Ie]=(0,D.Z)(),[Me,ke,Te]=(0,D.Z)(),{lastMessage:xe,isForum:Ae,isForumAsMessages:Re}=u||{},{renderSubtitle:Oe,ref:Le}=(0,_.Z)({chat:u,chatId:e,lastMessage:xe,typingStatus:$,draft:w,actionTargetMessage:E,actionTargetUserIds:g,actionTargetChatId:y,lastMessageTopic:R,lastMessageSender:f,observeIntersection:l,animationType:s,withInterfaceAnimations:S,orderDiff:n}),Be=function(e){let t=H.get(e);if(!t){const[n,a]=(0,U.gQ)(e((0,o.Rd)()));t={clientsCount:0,getter:n,setter:a},H.set(e,t)}return(0,j.Z)((()=>(t.clientsCount++,()=>{t.clientsCount--,t.clientsCount||H.delete(e)}))),t.getter}(O.hqL),Fe=(0,Z.Z)((()=>{const t=se&&Re;if(Ae){if(M)return void ie(void 0,{forceOnHeavyAnimation:!0});if(t||oe({chatId:e},{forceOnHeavyAnimation:!0}),!Re)return}te({id:e,noForumTopicPanel:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),N&&T&&ne()})),De=(0,Z.Z)((t=>{t.preventDefault(),Q?.(e)})),$e=(0,Z.Z)((()=>{Ee(),ce()})),Ue=(0,Z.Z)((()=>{Ce(),ue()})),je=(0,Z.Z)((()=>{Ne(),pe()})),He=(0,Z.Z)((()=>{ke(),fe()})),ze=(0,F.Z)({chat:u,user:h,handleDelete:$e,handleMute:Ue,handleChatFolderChange:je,handleReport:He,folderId:t,isPinned:c,isMuted:m,canChangeFolder:x}),_e=(0,P.Op)(Le,u?l:void 0);(0,a.d4)((()=>{_e&&Ae&&u&&void 0===u.listedTopicIds&&ae({chatId:e})}),[u,e,Ae,_e]);const Ve=h&&p&&(0,C.kM)(h,p),{hasShownClass:qe}=(0,z.Z)(Ve);if(!u)return;const We=h||u,Ye=(0,r.Z)("Chat chat-item-clickable",(0,C.YC)(e)?"private":"group",Ae&&"forum",N&&"selected",I&&"selected-forum");return a.ZP.createElement(k.Z,{ref:Le,className:Ye,href:d.IT?`#${(0,L.tB)(e,"thread",A._f)}`:void 0,style:`top: ${b}px`,ripple:!Ae&&!se,contextActions:ze,onClick:Fe,onDragEnter:De,withPortalForMenu:!0},a.ZP.createElement("div",{className:(0,r.Z)("status","status-clickable")},a.ZP.createElement(V.Z,{peer:We,isSavedMessages:h?.isSelf,withStory:!h?.isSelf,withStoryGap:qe,storyViewerOrigin:i.ze.ChatList,storyViewerMode:"single-peer"}),a.ZP.createElement("div",{className:"avatar-badge-wrapper"},a.ZP.createElement("div",{className:(0,r.Z)("avatar-online",qe&&"avatar-online-shown")}),a.ZP.createElement(J.Z,{chat:u,isMuted:m,shouldShowOnlyMostImportant:!0,forceHidden:Be})),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(ee,{isMobile:se,isSelected:N,isActive:S})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement(W.Z,{peer:We,withEmojiStatus:!0,isSavedMessages:e===h?.id&&h?.isSelf,observeIntersection:l}),m&&a.ZP.createElement("i",{className:"icon icon-muted"}),a.ZP.createElement("div",{className:"separator"}),u.lastMessage&&a.ZP.createElement(Y.Z,{message:u.lastMessage,outgoingStatus:v,draftDate:w?.date})),a.ZP.createElement("div",{className:"subtitle"},Oe(),a.ZP.createElement(J.Z,{chat:u,isPinned:c,isMuted:m}))),Pe&&a.ZP.createElement(q.Z,{isOpen:re,onClose:le,onCloseAnimationEnd:ye,chat:u}),be&&a.ZP.createElement(K.Z,{isOpen:de,onClose:me,onCloseAnimationEnd:we,chatId:e}),Se&&a.ZP.createElement(X.Z,{isOpen:he,onClose:Ze,onCloseAnimationEnd:Ie,chatId:e}),Me&&a.ZP.createElement(G.Z,{isOpen:ge,onClose:ve,onCloseAnimationEnd:Te,peerId:e,subject:"peer"}))})));var ne=n(45601),ae=n(231);const oe=(0,a.X$)((0,o.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,O.MwT)(e,t):void 0,animatedEmoji:(0,O.zB_)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onSettingsScreenSelect:o})=>{const s=(0,I.Z)(),{isMobile:r}=(0,B.ZP)(),c=(0,a.I4)((()=>{n({type:"editFolder",payload:e}),o(i.MT.FoldersEditFolderFromChatList)}),[e,n,o]);return a.ZP.createElement("div",{className:"SQg81XcAI_8yUrDTZsuO"},a.ZP.createElement("div",{className:"wJbYOMkKbFvBF3ETHcTe"},t&&a.ZP.createElement(ne.Z,{sticker:t,size:96})),a.ZP.createElement("h3",{className:"aAjnCIjqnZ5azP_wg1ax",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"xkUox6hbodMU0tsgwbai",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&a.ZP.createElement(ae.Z,{ripple:!r,fluid:!0,pill:!0,onClick:c,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon icon-settings"}),a.ZP.createElement("div",{className:"avAW55GP937eCr8UmpfS"},s("ChatList.EmptyChatListEditFilter"))))})));var ie=n(78722);const se="D0dko7sVnw0KDtqjY0bH",re=(0,a.X$)((({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:i,showNotification:s}=(0,o.Sv)(),r=(0,a.sO)(null),c=(0,I.Z)();(0,ie.Z)(r,(e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)}));const l=(0,a.Ye)((()=>Object.values(e).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[e]),d=(0,a.Ye)((()=>[l.deviceModel,l.region,l.country].filter(Boolean).join(", ")),[l]),u=(0,Z.Z)((()=>{n({hash:l.hash,isConfirmed:!0})})),m=(0,Z.Z)((()=>{i({hash:l.hash}),s({title:c("UnconfirmedAuthDeniedTitle",1),message:c("UnconfirmedAuthDeniedMessageSingle",d)})}));return a.ZP.createElement("div",{className:"auVVCT950ajs6Uf4jI_w",ref:r},a.ZP.createElement("h2",{className:"RrIwnolHiQkojIfDEmg3"},c("UnconfirmedAuthTitle")),a.ZP.createElement("p",{className:"W7svz8CjmnPmDhwiz6cJ"},c("UnconfirmedAuthSingle",d)),a.ZP.createElement("div",{className:"lV9Uc02uJwQff0VQsKTj"},a.ZP.createElement(ae.Z,{fluid:!0,isText:!0,size:"smaller",className:se,onClick:u},c("UnconfirmedAuthConfirm")),a.ZP.createElement(ae.Z,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:m,className:se},c("UnconfirmedAuthDeny"))))})),ce=new Set(["9","0"]),le=(0,a.X$)((({folderType:e,folderId:t,isActive:n,isForumPanelOpen:C,canDisplayArchive:w,archiveSettings:S,sessions:N,foldersDispatch:I,onSettingsScreenSelect:M,onLeftColumnContentChange:k})=>{const{openChat:T,openNextChat:A,closeForumPanel:R,toggleStoryRibbon:O}=(0,o.Sv)(),L=(0,a.sO)(null),B=(0,a.sO)(!1),[F,D]=(0,a.eJ)(0),$="archived"===e,U="all"===e,j=U?s.NfV:$?s.WSp:t,H=U&&w,z=(0,g.d7)(j);(0,u.Z)(z);const _=(z?.length||0)*s.rSj,V=H?S.isMinimized?s.RBO:s.rSj:0,{orderDiffById:q,getAnimationType:W}=(0,E.Z)(z),[Y,G]=(0,v.Z)(void 0,z,void 0,s.t_F),X=(0,a.Ye)((()=>{const e=Object.values(N||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,l.bp)()-t.dateCreated<s.I0B)&&U&&e.some((e=>e.isUnconfirmed))}),[U,N]);(0,a.d4)((()=>{X||D(0)}),[X]),(0,f.y)(n&&z?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),A({targetIndexDelta:-1,orderedIds:z})},"Alt+ArrowDown":e=>{e.preventDefault(),A({targetIndexDelta:1,orderedIds:z})}}:void 0),(0,a.d4)((()=>{if(n&&z&&d.RM)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((d.jm&&e.metaKey||!d.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||ce.has(t))return;const n=H&&!S.isMinimized,a=n?-1:0,o=Number(t)+a-1;if(n&&-1===o)return void k(i.du.Archived);if(o>z.length-1)return;T({id:z[o],shouldReplaceHistory:!0})}}}),[S,n,k,T,A,z,H]);const{observe:K}=(0,P.S1)({rootRef:L,throttleMs:200}),J=(0,Z.Z)((()=>{k(i.du.Archived),R()})),Q=(0,Z.Z)((()=>{B.current?B.current=!1:J()})),ee=(0,p.Z)((e=>{B.current?B.current=!1:T({id:e,shouldReplaceHistory:!0})}),[T],500,!0),ne=(0,Z.Z)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top;n<t.width||a<t.y||(B.current=!0)})),ae=function(e,t,n){const o=(0,a.sO)(null),i=(0,a.sO)(!1),s=(0,a.sO)(0),r=(0,a.sO)(!1),c=(0,a.sO)(!0),l=(0,a.sO)(0),u=(0,a.sO)(!1),g=(0,Z.Z)(((t=!1)=>{r.current||o.current&&e.current&&(o.current.style.display="block",e.current.scrollTop=1,d.s$||t||(0,h.n)(e.current),i.current=!0,s.current=1,r.current=!0,c.current=!0)})),f=(0,Z.Z)((()=>{r.current&&o.current&&(o.current.style.display="none",r.current=!1)})),v=(0,Z.Z)((()=>{if(!e.current)return;if(i.current)return void(i.current=!1);const a=e.current.scrollTop,d=a>s.current,h=a<s.current,p=0===a,Z=Date.now()-l.current;if(o.current){if(p&&!r.current)return void(0,m.x4)(g,[e.current,o.current]);(0,m.x4)(f,o.current)}h&&(c.current&&Z>100||a<0&&u.current)?t?.():d&&a>0&&n?.(),s.current=a,c.current=p,l.current=Date.now(),u.current=d&&a<0})),P=(0,p.Z)((a=>{if(!e.current)return;const o=e.current;o.scrollHeight>o.offsetHeight||0===a.deltaY||(a.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,a.d4)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,m.WM)((()=>{g(!0)})),t.addEventListener("scroll",v,{passive:!0}),t.addEventListener("wheel",P,{passive:!0}),()=>{t.removeEventListener("scroll",v),t.removeEventListener("wheel",P)}}),[e,P]),d.cj?void 0:a.ZP.createElement("div",{ref:o,className:"overscroll-trigger",key:"overscroll-trigger"})}(L,(0,Z.Z)((()=>{O({isShown:!0,isArchived:$})})),(0,Z.Z)((()=>{O({isShown:!1,isArchived:$})})));return a.ZP.createElement(y.Z,{className:(0,r.Z)("chat-list custom-scroll",C&&"forum-panel-open"),ref:L,items:Y,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:s.t_F,withAbsolutePositioning:!0,beforeChildren:ae,maxHeight:_+V+F,onLoadMore:G,onDragLeave:ne},X&&a.ZP.createElement(re,{key:"unconfirmed",sessions:N,onHeightChange:D}),H&&a.ZP.createElement(x,{key:"archive",archiveSettings:S,onClick:J,onDragEnter:Q}),Y?.length?function(){const e=z.indexOf(Y[0]),n=(0,c.aE)(j)||0;return Y.map(((o,i)=>{const r=e+i<n,l=F+V+(e+i)*s.rSj;return a.ZP.createElement(te,{key:o,teactOrderKey:r?i:(0,c.jK)(o),chatId:o,isPinned:r,folderId:t,animationType:W(o),orderDiff:q[o],offsetTop:l,observeIntersection:K,onDragEnter:ee})}))}():Y&&!Y.length?a.ZP.createElement(oe,{folderId:t,folderType:e,foldersDispatch:I,onSettingsScreenSelect:M}):a.ZP.createElement(b.Z,{key:"loading"}))}))},59690:(e,t,n)=>{n.d(t,{Z:()=>Y});var a=n(60748),o=n(33555),i=n(6137),s=n(83716),r=n(57710),c=n(4463),l=n(7054),d=n(46752),u=n(23989),m=n(64963),h=n(1279),p=n(97184),Z=n(42797),g=n(18674),f=n(46590),v=n(27407),P=n(3657),E=n(59107),y=n(25190),b=n(87204),C=n(61204),w=n(4794),S=n(98799),N=n(59188),I=n(231),M=n(21273),k=n(34288),T=n(74399),x=n(45601);const A={root:"ZyX_vkPmR8lkPavXpJ8t","button-text":"eyTT7Nz45S4tsccfs60O",buttonText:"eyTT7Nz45S4tsccfs60O",sticker:"qtGErqZ1CIiAYG3E4UcJ",title:"xpDHtODGvlK2Esrg3kFa",description:"xqeZm45hTFw3abdn8dYe","is-ios":"G5wtv6cwHgiIpRWtvIvu",isIos:"G5wtv6cwHgiIpRWtvIvu","is-macos":"H92rL6BfAuzokrWOXdQr",isMacos:"H92rL6BfAuzokrWOXdQr"},R=7*T.Gw,O=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const n=(0,l.Z1J)(e,t),a=n&&(n.isCreator||(0,c.VE)(n,"manageTopics"));return{animatedEmoji:(0,l.zB_)(e,"🐣"),canManageTopics:a}}))((({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:i}=(0,o.Sv)(),s=(0,E.Z)(),{isMobile:r}=(0,Z.ZP)(),c=(0,a.I4)((()=>{i({chatId:e})}),[e,i]);return a.ZP.createElement("div",{className:A.root},a.ZP.createElement("div",{className:A.sticker},t&&a.ZP.createElement(x.Z,{sticker:t,size:R})),a.ZP.createElement("h3",{className:A.title,dir:"auto"},s("ChatList.EmptyTopicsTitle")),a.ZP.createElement("p",{className:(0,d.Z)(A.description,A.centered),dir:"auto"},s("ChatList.EmptyTopicsDescription")),n&&a.ZP.createElement(I.Z,{ripple:!r,fluid:!0,onClick:c,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("div",{className:A.buttonText},s("ChatList.EmptyTopicsCreate"))))})));var L=n(26646),B=n(15780),F=n(32340),D=n(60706),$=n(44499),U=n(60782),j=n(76844),H=n(2995),z=n(17551),_=n(31876),V=n(79347),q=n(77699);const W=(0,a.X$)((0,o.c$)(((e,{chatId:t,topic:n,isSelected:a})=>{const o=(0,l.Z1J)(e,t),i=(0,l.hjO)(e,t,n.lastMessageId),{senderId:s,isOutgoing:r}=i||{},d=i&&(0,L.H)(i)?.replyToMsgId,u=s?(0,l.dyD)(e,s)||(0,l.Z1J)(e,s):void 0,m=i?(0,c.N5)(i):void 0,h=m&&d?(0,l.hjO)(e,t,d):void 0,{targetUserIds:p,targetChatId:Z}=m||{},g=(0,l.WPz)(e,t,n.id,"typingStatus"),f=(0,l.Mst)(e,t,n.id),v=(0,l.tZg)(e,t,n.id),P=Boolean(v?.lastReadInboxMessageId),{chatId:E,threadId:y}=(0,l.Btg)(e)||{};return{chat:o,lastMessage:i,actionTargetUserIds:p,actionTargetChatId:Z,actionTargetMessage:h,lastMessageSender:u,typingStatus:g,canDelete:(0,l.nt7)(e,t,n.id),withInterfaceAnimations:(0,l.FOo)(e),draft:f,...r&&i&&{lastMessageOutgoingStatus:(0,l.dTW)(e,i)},canScrollDown:a&&o?.id===E&&y===n.id,wasTopicOpened:P}}))((({topic:e,isSelected:t,chatId:n,chat:i,style:s,lastMessage:r,canScrollDown:l,lastMessageOutgoingStatus:u,observeIntersection:m,canDelete:h,actionTargetMessage:Z,actionTargetUserIds:g,actionTargetChatId:f,lastMessageSender:v,animationType:P,withInterfaceAnimations:b,orderDiff:C,typingStatus:w,draft:S,wasTopicOpened:N})=>{const{openThread:I,deleteTopic:M,focusLastMessage:k,setViewForumAsMessages:T}=(0,o.Sv)(),x=(0,E.Z)(),[A,R,O]=(0,D.Z)(),[L,W,Y]=(0,D.Z)(),[G,X,K]=(0,D.Z)(),[J,Q,ee]=(0,D.Z)(),{isPinned:te,isClosed:ne}=e,ae=e.isMuted||void 0===e.isMuted&&i.isMuted,oe=(0,y.Z)((()=>{X(),R()})),ie=(0,y.Z)((()=>{M({chatId:i.id,topicId:e.id})})),se=(0,y.Z)((()=>{Q(),W()})),{renderSubtitle:re,ref:ce}=(0,$.Z)({chat:i,chatId:n,lastMessage:r,draft:S,actionTargetMessage:Z,actionTargetUserIds:g,actionTargetChatId:f,lastMessageSender:v,lastMessageTopic:e,observeIntersection:m,isTopic:!0,typingStatus:w,animationType:P,withInterfaceAnimations:b,orderDiff:C}),le=(0,y.Z)((()=>{I({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),T({chatId:n,isEnabled:!1}),l&&k()})),de=function({topic:e,chat:t,wasOpened:n,canDelete:i,handleDelete:s,handleMute:r}){const l=(0,E.Z)();return(0,a.Ye)((()=>{const{isPinned:a,isMuted:d,isClosed:u,id:m}=e,h=t.id,{editTopic:Z,toggleTopicPinned:g,markTopicRead:f,updateTopicMutedState:v,openChatInNewTab:P}=(0,o.Sv)(),E=(0,c.GU)(t,e),y=t.isCreator||(0,c.VE)(t,"manageTopics"),b=p.IT&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{P({chatId:t.id,threadId:m})}},C=e.unreadCount||!n?{title:l("MarkAsRead"),icon:"readchats",handler:()=>{f({chatId:h,topicId:m})}}:void 0,w=y?a?{title:l("UnpinFromTop"),icon:"unpin",handler:()=>g({chatId:h,topicId:m,isPinned:!1})}:{title:l("PinToTop"),icon:"pin",handler:()=>g({chatId:h,topicId:m,isPinned:!0})}:void 0,S=t.isMuted&&!1!==d||!0===d?{title:l("ChatList.Unmute"),icon:"unmute",handler:()=>v({chatId:h,topicId:m,isMuted:!1})}:{title:`${l("ChatList.Mute")}...`,icon:"mute",handler:r},N=E?u?{title:l("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>Z({chatId:h,topicId:m,isClosed:!1})}:{title:l("lng_forum_topic_close"),icon:"close-topic",handler:()=>Z({chatId:h,topicId:m,isClosed:!0})}:void 0,I=i?{title:l("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:s}:void 0;return(0,U.oA)([b,w,C,S,N,I])}),[e,t,n,l,i,s,r])}({topic:e,chat:i,wasOpened:N,canDelete:h,handleDelete:oe,handleMute:se});return a.ZP.createElement(_.Z,{className:(0,d.Z)("YmRS2ZiwKMtqCF87Nsw8","Chat",t&&"selected","chat-item-clickable"),onClick:le,style:s,href:p.IT?`#${(0,B.tB)(n,"thread",e.id)}`:void 0,contextActions:de,withPortalForMenu:!0,ref:ce},a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,d.Z)("title")},a.ZP.createElement(H.Z,{topic:e,className:"TB99wQ9nHBumZ6E9ByUz",observeIntersection:m}),a.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,F.Z)(e.title))),e.isMuted&&a.ZP.createElement("i",{className:"icon icon-muted"}),a.ZP.createElement("div",{className:"separator"}),ne&&a.ZP.createElement("i",{className:(0,d.Z)("icon","icon-lock-badge","K6QDMKEV2GXbuOQWOS73")}),r&&a.ZP.createElement(j.Z,{message:r,outgoingStatus:u})),a.ZP.createElement("div",{className:"subtitle"},re(),a.ZP.createElement(q.Z,{chat:i,isPinned:te,isMuted:ae,topic:e,wasTopicOpened:N}))),G&&a.ZP.createElement(z.Z,{isOpen:A,onClose:O,onCloseAnimationEnd:K,confirmIsDestructive:!0,confirmHandler:ie,text:x("lng_forum_topic_delete_sure"),confirmLabel:x("Delete")}),J&&a.ZP.createElement(V.Z,{isOpen:L,onClose:Y,onCloseAnimationEnd:ee,chatId:n,topicId:e.id}))}))),Y=(0,a.X$)((0,o.c$)((e=>{const t=(0,l.jUK)(e).forumPanelChatId,n=t?(0,l.Z1J)(e,t):void 0,{chatId:a,threadId:o}=(0,l.Btg)(e)||{};return{chat:n,currentTopicId:t===a?o:void 0,withInterfaceAnimations:(0,l.FOo)(e)}}),(e=>(0,l.nd)(e)))((({chat:e,currentTopicId:t,isOpen:n,isHidden:l,onTopicSearch:T,onCloseAnimationEnd:x,onOpenAnimationStart:A,withInterfaceAnimations:R})=>{const{closeForumPanel:L,openChatWithInfo:B,loadTopics:F}=(0,o.Sv)(),D=(0,a.sO)(null),$=(0,a.sO)(null),U=(0,a.sO)(null),{isMobile:j}=(0,Z.ZP)();(0,a.d4)((()=>{e&&!e.topics&&F({chatId:e.id})}),[e,F]);const[H,z]=(0,a.eJ)(!1),_=(0,E.Z)(),V=(0,y.Z)((()=>{L()}));(0,a.d4)((()=>{R||n||x?.()}),[R,n,x]);const q=(0,y.Z)((()=>{e&&B({id:e.id,shouldReplaceHistory:!0})})),{observe:Y}=(0,P.S1)({rootRef:$,throttleMs:200});(0,P._N)(U,Y,(({isIntersecting:e})=>{z(!e)}));const G=(0,a.Ye)((()=>e?.topics?(0,c.AY)(Object.values(e.topics),e.orderedPinnedTopicIds).map((({id:e})=>e)):[]),[e]),{orderDiffById:X,getAnimationType:K}=(0,C.Z)(G,e?.id),[J,Q]=(0,v.Z)((()=>{e&&F({chatId:e.id})}),G,!e?.topicsCount||G.length>=e.topicsCount,s.C1M),ee=(0,a.sO)(!1),te=n&&!l,ne=(0,b.Z)(te);ne!==te&&(ee.current=!1),(0,f.Z)({isActive:te,onBack:V}),(0,a.d4)((()=>te?(0,u.Z)(V):void 0),[V,te]),(0,a.d4)((()=>{ne!==te&&(0,r.Yq)((()=>{if(!D.current)return;const e=(0,g.YW)();(0,h.L)(D.current,e),A?.(),te?(ee.current=!0,D.current.style.transform="none"):(ee.current=!1,D.current.style.transform="")}))}),[te,A,ne]),(0,a.d4)((()=>{if(p.$b)return(0,m.sf)(D.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(_.isRtl?m.eM.Left:m.eM.Right)&&(L(),!0)})}),[L,_.isRtl]);const ae=void 0===e?.topics;return a.ZP.createElement("div",{ref:D,className:(0,d.Z)("GUOX6Q0XzHRhNZvBwjQ9",H&&"h_YBka1L8eRICjrO5dF5",_.isRtl&&"_1XehUpS3aX91hWXDmcu",!R&&"mPOFnJvncopcVbbyZrzs"),onTransitionEnd:n?void 0:x},a.ZP.createElement("div",{id:"TopicListHeader",className:"left-header"},a.ZP.createElement(I.Z,{round:!0,size:"smaller",color:"translucent",onClick:V,ariaLabel:_("Close")},a.ZP.createElement("i",{className:"icon icon-close"})),e&&a.ZP.createElement(S.Z,{noAvatar:!0,className:"mzucaTAH77gNB1V006lS",chatId:e.id,onClick:q}),e&&a.ZP.createElement(N.Z,{chatId:e.id,threadId:i._f,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:j,onTopicSearch:T})),e&&a.ZP.createElement(w.Z,{chatId:e.id,hasPinnedOffset:!1,className:"OH0LaRqoNDIvvHsCtEte"}),a.ZP.createElement("div",{className:"UhjDQykjZBYhiVclJl16"}),a.ZP.createElement(M.Z,{className:"chat-list custom-scroll",ref:$,items:J,preloadBackwards:s.C1M,withAbsolutePositioning:!0,maxHeight:(G?.length||0)*s.oDu,onLoadMore:Q,sensitiveArea:s.BtI,beforeChildren:a.ZP.createElement("div",{ref:U,className:"cO3iiLSh70tyWuNCUFtX"})},Boolean(J?.length)&&function(){const n=G.indexOf(J[0]);return J?.map(((o,i)=>a.ZP.createElement(W,{key:o,chatId:e.id,topic:e.topics[o],style:`top: ${(n+i)*s.oDu}px;`,isSelected:t===o,observeIntersection:Y,animationType:K(o),orderDiff:X[o]})))}(),ae&&!J?.length&&a.ZP.createElement(k.Z,{key:"loading"})),!ae&&1===J?.length&&J[0]===s.OxA&&a.ZP.createElement(O,{chatId:e.id}))})))},9950:(e,t,n)=>{n.d(t,{b:()=>o,w:()=>i});var a=n(60748);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function i(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 i=e[t];return 0===i?o.None:i===1/0||i===-1/0||n<=a&&i<0||a<n&&i>0?o.Opacity:o.Move}}),[e])}},44499:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(60748),o=n(33555),i=n(83716),s=n(57710),r=n(4463),c=n(26646),l=n(46752),d=n(18005),u=n(32340),m=n(4809),h=n(9950),p=n(75790),Z=n(59107),g=n(6202),f=n(74399),v=n(42797),P=n(39415),E=n(2995);const y="GrFgsvT5YSYldl56Hnzu",b="yHnVWii5hDMte2XGiGio",C="H4WbKWl7lQI8hw8ryOgF",w="DGAWy9KRwAZqof7Bt1nx",S=Number(f.Gw),N=(0,a.X$)((({chat:e,renderLastMessage:t,observeIntersection:n})=>{const{openThread:i}=(0,o.Sv)(),s=(0,a.sO)(null),c=(0,a.sO)(null),d=(0,Z.Z)(),[m,...h]=(0,a.Ye)((()=>e.topics?(0,r.AY)(Object.values(e.topics),void 0,!0).slice(0,3):[]),[e.topics]),[p,g]=(0,a.eJ)(!1),[f,N]=(0,a.eJ)(void 0),{handleClick:I,handleMouseDown:M}=(0,P.m)((t=>{0===m.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),i({chatId:e.id,threadId:m.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,v.W7)()}))}));return(0,a.d4)((()=>{const e=s.current,t=c.current;if(!e||!t)return;const n=e.offsetWidth,a=t.offsetWidth;Math.abs(n-a)<S?N(Math.max(n,a)):N(void 0),g(n>a)}),[m,t]),a.ZP.createElement("div",{className:(0,l.Z)("gljGvMdlFlsKhrMPQ_xa",p&&"RJ0NXk_lx9qewdoGgJsT",f&&"e4cE7B51DN3MrEY9WuKx"),dir:d.isRtl?"rtl":void 0,style:f?`--overwritten-width: ${f}px`:void 0},m&&a.ZP.createElement("div",{className:y},a.ZP.createElement("div",{className:(0,l.Z)("VUe4FFBCwClvaU9aiXG1",m.unreadCount&&b),ref:c,onClick:I,onMouseDown:M},a.ZP.createElement(E.Z,{topic:m,observeIntersection:n}),a.ZP.createElement("div",{className:"WeBppBs2KkOXzHRzQ2_W"},(0,u.Z)(m.title)),!f&&p&&a.ZP.createElement("div",{className:C},a.ZP.createElement("div",{className:w}))),a.ZP.createElement("div",{className:"FJt1oTIn6WgfvH9iKMg3"},h.map((e=>a.ZP.createElement("div",{className:(0,l.Z)("RhuR5wto63HGEeY1NdXg",e.unreadCount&&b),key:e.id},a.ZP.createElement(E.Z,{topic:e,className:"mrAD_CKmksSYVhfxgz_w",observeIntersection:n}),a.ZP.createElement("span",{className:"Ub9bpPYaMAw0qMouq5_O"},(0,u.Z)(e.title)))))),a.ZP.createElement("div",{className:"RL7lx7aP0Fg2LakRlxHp"})),!m&&a.ZP.createElement("div",{className:(0,l.Z)(y,"bYI9fzK27IbEWGTzvRGf")},d("Loading")),a.ZP.createElement("div",{className:(0,l.Z)("OyHxp9apV7oixvvxGFDx",m?.unreadCount&&b),ref:s,onClick:I,onMouseDown:M},t(),!f&&!p&&a.ZP.createElement("div",{className:C},a.ZP.createElement("div",{className:w}))))}));var I=n(45370),M=n(68729);const k=200;function T({chat:e,lastMessage:t,chatId:n,typingStatus:f,draft:v,actionTargetMessage:P,actionTargetUserIds:E,lastMessageTopic:y,lastMessageSender:b,actionTargetChatId:C,observeIntersection:w,animationType:S,orderDiff:T,withInterfaceAnimations:x,isTopic:A}){const R=(0,Z.Z)(),O=(0,a.sO)(null),L=t&&(0,r.FT)(t),B=t&&(0,c.H)(t)?.replyToMsgId;(0,p.Z)(n,L?B:void 0,P);const F=t&&!(0,r.bf)(t)?(0,r.DH)(t):void 0,D=(0,g.Z)(t?(0,r.Ti)(t,"micro"):void 0),$=Boolean(t&&(0,r.Y5)(t)),U=(0,a.Ye)((()=>{if(!E)return;const e=(0,o.Rd)().users.byId;return E.map((t=>e[t])).filter(Boolean)}),[E]),j=(0,a.I4)((()=>{if(f&&t&&f.timestamp>1e3*t.date)return a.ZP.createElement(M.Z,{typingStatus:f});const o=v&&v.replyInfo?.replyToMsgId===y?.id,i=v?.replyInfo&&!v.text&&v.isLocal;if(!e?.isForum&&v&&!i&&(!A||!o))return a.ZP.createElement("p",{className:"last-message",dir:R.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},R("Draft")),(0,m.H)({text:v.text?.text||"",entities:v.text?.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!t)return;if(L){const n=e&&((0,r.eA)(e)||t.senderId===t.chatId);return a.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:R.isRtl?"auto":"ltr"},(0,d.D)(R,t,n?void 0:b,n?e:void 0,U,P,C,y,{isEmbedded:!0},void 0,void 0))}const s=(0,r.zF)(R,n,b);return a.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:R.isRtl?"auto":"ltr"},s&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,u.Z)(s)),a.ZP.createElement("span",{className:"colon"},":")),t.forwardInfo&&a.ZP.createElement("i",{className:"icon icon-share-filled chat-prefix-icon"}),"story"===t.replyInfo?.type&&a.ZP.createElement("i",{className:"icon icon-story-reply chat-prefix-icon"}),function(e,t,n,o,i){const s=a.ZP.createElement(I.Z,{lang:e,message:t,noEmoji:Boolean(o),observeIntersectionForLoading:n,inChatList:!0});if(!o)return s;const c=(0,r.NE)(t);return a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:o,alt:"",className:(0,l.Z)("media-preview--image",i&&"round",c&&"media-preview-spoiler"),draggable:!1}),(0,r.b7)(t)&&a.ZP.createElement("i",{className:"icon icon-play"}),s)}(R,t,w,D||F,$))}),[C,P,U,e,n,v,L,$,A,R,t,b,y,D,F,w,f]);return(0,a.bt)((()=>{const e=O.current;if(x&&e){if(S===h.b.Opacity)e.style.opacity="0",(0,s.WM)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(S!==h.b.Move)return;e.style.transform=`translate3d(0, ${-T*i.rSj}px, 0)`,(0,s.WM)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,s.WM)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),k+i.fK3)}}),[x,T,S]),{renderSubtitle:function(){return e?.isForum&&!A?a.ZP.createElement(N,{chat:e,renderLastMessage:j,observeIntersection:w}):j()},ref:O}}},73217:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(65326),i=n(87204);function s(e){const t=(0,o.Z)(),n=(0,a.sO)(e),s=(0,i.Z)(e);return!1===e&&s!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},61204:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(60782),i=n(9950),s=n(87204);function r(e,t){const n=(0,a.Ye)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),r=(0,s.Z)(n),c=(0,s.Z)(t),l=(0,a.Ye)((()=>n&&r&&t===c?(0,o.Q8)(n,((e,t)=>void 0!==r[t]?e-r[t]:-1/0)):{}),[t,n,c,r]);return{orderDiffById:l,getAnimationType:(0,i.w)(l)}}},91:(e,t,n)=>{n.d(t,{F:()=>o});var a=n(4463);function o(e,t,n,o){const{senderId:i}=t;if(!i)return;const s=(0,a.YC)(i)?o[i]:n[i];let r=(0,a.OU)(e,s);const c=n[t.chatId];return c&&("isSelf"in s&&s.isSelf?r=`${e("FromYou")} ${(0,a.U)(e,c)}`:(0,a.Bf)(c)&&(r+=` ${(0,a.U)(e,c)}`)),r}},78323:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(60748),o=n(33555),i=n(4463),s=n(26646),r=n(7054),c=n(46752),l=n(18005),d=n(32340),u=n(30386),m=n(17240),h=n(75790),p=n(60706),Z=n(3657),g=n(59107),f=n(31212),v=n(45277),P=n(45601),E=n(6137),y=n(91713),b=n(40647),C=n(25190),w=n(6202),S=n(70172),N=n(17551),I=n(66735);const M=(0,a.X$)((({message:e,renderContent:t})=>{const{openMediaViewer:n,uploadProfilePhoto:s,showNotification:r}=(0,o.Sv)(),{isOutgoing:c}=e,l=(0,g.Z)(),[d,u]=(0,a.eJ)(),[m,h,Z]=(0,p.Z)(!1),f=(0,w.Z)((0,i.Ti)(e,"full")),v=e.content.action.photo?.isVideo,P=(0,C.Z)((()=>{r({title:l("ApplyAvatarHintTitle"),message:l("ApplyAvatarHint"),action:{action:"requestNextSettingsScreen",payload:{screen:y.MT.Main}},actionText:l("Open")})})),M=(0,C.Z)((e=>{u(void 0),s({file:e}),P()})),k=(0,C.Z)((()=>{u(void 0)})),T=(0,C.Z)((async()=>{Z(),P();const t=e.content.action.photo,n=await b.he(`videoAvatar${t.id}?size=u`,E.IU.BlobUrl),a=await fetch(n).then((e=>e.blob()));s({file:new File([a],"avatar.mp4"),isVideo:!0,videoTs:t.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return a.ZP.createElement("span",{className:"action-message-suggested-avatar",tabIndex:0,role:"button",onClick:async()=>{!c&&f?v?h():u(await fetch(f).then((e=>e.blob()))):n({chatId:e.chatId,mediaId:e.id,threadId:E._f,origin:y.bZ.SuggestedAvatar})}},a.ZP.createElement(S.Z,{photo:e.content.action.photo,loopIndefinitely:!0,withVideo:v,size:"jumbo"}),a.ZP.createElement("span",null,t()),a.ZP.createElement("span",{className:"action-message-button"},l(v?"ViewVideoAction":"ViewPhotoAction")),a.ZP.createElement(I.Z,{file:d,onClose:k,onChange:M}),a.ZP.createElement(N.Z,{isOpen:m,title:l("SuggestedVideo"),confirmHandler:T,onClose:Z,textParts:t()}))}));var k=n(97182);const T=(0,a.X$)((0,o.c$)(((e,{message:t,threadId:n})=>{const{chatId:a,senderId:o,content:c}=t,l=o,{targetUserIds:d,targetChatId:u}=c.action||{},m=(0,s.H)(t)?.replyToMsgId,h=m?(0,r.hjO)(e,a,m):void 0,p=!!n&&(0,r._XY)(e,t,n),{direction:Z,noHighlight:g}=p&&(0,r.jUK)(e).focusedMessage||{},f=(0,r.Z1J)(e,a),v=f&&((0,i.eA)(f)||l===a),P=!v&&l?(0,r.dyD)(e,l):void 0,E=v?f:void 0,y=u?(0,r.Z1J)(e,u):void 0,b=c.action?.months;return{senderUser:P,senderChat:E,targetChat:y,targetChatId:u,targetUserIds:d,targetMessage:h,isFocused:p,premiumGiftSticker:(0,r.PGA)(e,b),topic:(0,r.p$s)(e,t),canPlayAnimatedEmojis:(0,r.W9H)(e),...p&&{focusDirection:Z,noFocusHighlight:g}}}))((({message:e,isEmbedded:t,appearanceOrder:n=0,isJustAdded:s,isLastInList:r,senderUser:E,senderChat:y,targetUserIds:b,targetMessage:C,targetChatId:w,targetChat:S,isFocused:N,focusDirection:I,noFocusHighlight:T,premiumGiftSticker:x,isInsideTopic:A,topic:R,memoFirstUnreadIdRef:O,canPlayAnimatedEmojis:L,observeIntersectionForReading:B,observeIntersectionForLoading:F,observeIntersectionForPlaying:D,onPinnedIntersectionChange:$})=>{const{openPremiumModal:U,requestConfetti:j,checkGiftCode:H}=(0,o.Sv)(),z=(0,g.Z)(),_=(0,a.sO)(null);(0,Z._N)(_,B),(0,h.Z)(e.chatId,"message"===e.replyInfo?.type?e.replyInfo.replyToMsgId:void 0,C),(0,v.Z)(_,e.chatId,N,I,T,s),(0,a.d4)((()=>{if(e.isPinned)return()=>{$?.({viewportPinnedIdsToRemove:[e.id],isUnmount:!0})}}),[$,e.isPinned,e.id]);const V=n<=0,[q,W]=(0,p.Z)(V),Y=Boolean(e.content.action?.text.startsWith("ActionGift")),G=Boolean(e.content.action?.text.startsWith("BoostingReceivedGift")),X="suggestProfilePhoto"===e.content.action?.type&&e.content.action.photo;(0,a.d4)((()=>{V||setTimeout(W,10*n)}),[n,W,V]);const K=(0,Z.Op)(_,D),J=(0,a.sO)((()=>{const t=O?.current&&e.id>=O.current;return Y&&!e.isOutgoing&&t})());(0,a.d4)((()=>{K&&J.current&&(J.current=!1,j({}))}),[K,j]);const{transitionClassNames:Q}=(0,f.Z)(q,void 0,V,!1),ee=(0,o.Rd)().users.byId,te=(0,a.Ye)((()=>b?b.map((e=>ee?.[e])).filter(Boolean):void 0),[b,ee]),ne=(0,a.I4)((()=>(0,l.D)(z,e,E,y,te,C,w,R,{isEmbedded:t},F,D)),[t,z,e,F,D,y,E,w,C,te,R]),{isContextMenuOpen:ae,contextMenuPosition:oe,handleBeforeContextMenu:ie,handleContextMenu:se,handleContextMenuClose:re,handleContextMenuHide:ce}=(0,m.Z)(_),le=void 0!==oe,de=()=>{const t=e.content.action?.slug;t&&H({slug:t,message:{chatId:e.chatId,messageId:e.id}})};if(A&&"TopicWasCreatedAction"===e.content.action?.text)return a.ZP.createElement("span",{ref:_});if(t)return a.ZP.createElement("span",{ref:_,className:"embedded-action-message"},ne());const ue=(0,c.Z)("ActionMessage message-list-item",N&&!T&&"focused",(Y||X)&&"centered-action",le&&"has-menu-open",r&&"last-in-list",Q);return a.ZP.createElement("div",{ref:_,id:(0,i.d0)(e.id),className:ue,"data-message-id":e.id,"data-is-pinned":e.isPinned||void 0,onMouseDown:e=>{(0,u.q)(e),ie(e)},onContextMenu:se},!X&&!G&&a.ZP.createElement("span",{className:"action-message-content"},ne()),Y&&a.ZP.createElement("span",{className:"action-message-gift",tabIndex:0,role:"button",onClick:()=>{U({isGift:!0,fromUserId:E?.id,toUserId:b?.[0],monthsAmount:e.content.action?.months||0})}},a.ZP.createElement(P.Z,{key:e.id,sticker:x,play:L,noLoop:!0,nonInteractive:!0}),a.ZP.createElement("strong",null,z("ActionGiftPremiumTitle")),a.ZP.createElement("span",null,z("ActionGiftPremiumSubtitle",z("Months",e.content.action?.months,"i"))),a.ZP.createElement("span",{className:"action-message-button"},z("ActionGiftPremiumView"))),G&&function(){const t=e.content.action?.isGiveaway,n=e.content.action?.isUnclaimed;return a.ZP.createElement("span",{className:"action-message-gift action-message-gift-code",tabIndex:0,role:"button",onClick:de},a.ZP.createElement(P.Z,{key:e.id,sticker:x,play:L,noLoop:!0,nonInteractive:!0}),a.ZP.createElement("strong",null,z(n?"BoostingUnclaimedPrize":"BoostingCongratulations")),a.ZP.createElement("span",{className:"action-message-subtitle"},(0,d.Z)(z(t?"BoostingReceivedGiftFrom":n?"BoostingReceivedPrizeFrom":"BoostingYouHaveUnclaimedPrize",(0,i.U)(z,S)),["simple_markdown"])),a.ZP.createElement("span",{className:"action-message-subtitle"},(0,d.Z)(z("BoostingUnclaimedPrizeDuration",z("Months",e.content.action?.months,"i")),["simple_markdown"])),a.ZP.createElement("span",{className:"action-message-button"},z("BoostingReceivedGiftOpenBtn")))}(),X&&a.ZP.createElement(M,{message:e,renderContent:ne}),oe&&a.ZP.createElement(k.Z,{isOpen:ae,anchor:oe,message:e,messageListType:"thread",onClose:re,onCloseAnimationEnd:ce}))})))},59188:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),i=n(6137),s=n(91713),r=n(57710),c=n(4463),l=n(7054),d=n(97184),u=n(73541),m=n(59107),h=n(25190),p=n(231),Z=n(53106),g=n(58964),f=n(66902),v=n(99203),P=n(48778);const E=e=>{const{isOpen:t}=e,n=(0,P.Z)(v.gl.Extra,"HeaderMenuContainer",!t);return n?a.ZP.createElement(n,e):void 0},y=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n,messageListType:a,isMobile:o})=>{const s=(0,l.Z1J)(e,t),r=Boolean(s&&(0,c.eA)(s)),u=(0,l.rB0)(e),m=(0,l.Mc4)(e),h=(0,c.YC)(t),{doNotTranslate:p}=e.settings.byKey;if(!s||s.isRestricted||(0,l.CAb)(e))return{noMenu:!0,language:u,translationLanguage:m,doNotTranslate:p};const Z=(0,l.kBx)(e,t),g=h?void 0:(0,l.x67)(e,t),f=h?(0,l.ccz)(e,t):void 0,v=g||f,P=(0,l.FM1)(e,t),E="thread"===a&&n===i._f,y="thread"===a&&n!==i._f,b=(0,l.Jf5)(e,o),C=!!h&&(0,l.s4q)(e,t),w=Boolean(Z&&C),S=!w&&Boolean((0,l.pkN)(e,t)),N=C&&!Z,I=Boolean((E||s.isForum)&&(r||(0,c.ZV)(s))&&s.isNotJoined),M=E||y,k=d.Bi&&(0,c.YC)(s.id)&&!P&&!Z,T=E&&!P&&!I,x=E&&!I,A=d.Bi&&E&&s.isCallActive,R=d.Bi&&E&&!s.isCallActive&&(s.adminRights?.manageCall||s.isCreator&&(0,c.G9)(s)),O=E&&g?.canViewStatistics,L=E&&r&&(O||(0,c.VE)(s,"postStories")),B=E?g?.requestsPending:void 0,F=Boolean(s?.isNotJoined&&s.isJoinToSend),D=Boolean(s?.isNotJoined&&s.isJoinRequest),$=!(0,l.FOo)(e),U=Boolean((0,l.lpX)(e,t));return{noMenu:!1,isChannel:r,isRightColumnShown:b,canStartBot:S,canRestartBot:w,canSubscribe:I,canSearch:M,canCall:k,canMute:T,canViewStatistics:O,canViewBoosts:L,canLeave:x,canEnterVoiceChat:A,canCreateVoiceChat:R,pendingJoinRequests:B,shouldJoinToSend:F,shouldSendJoinRequest:D,noAnimation:$,canTranslate:(0,l.GDM)(e,t)&&!v?.isTranslationDisabled,isTranslating:U,translationLanguage:m,language:u,doNotTranslate:p,detectedChatLanguage:s.detectedLanguage,canUnblock:N}}))((({chatId:e,threadId:t,noMenu:n,isMobile:i,isChannel:c,canStartBot:l,canRestartBot:v,canUnblock:P,canSubscribe:y,canSearch:C,canCall:w,canMute:S,canViewStatistics:N,canViewBoosts:I,canLeave:M,canEnterVoiceChat:k,canCreateVoiceChat:T,pendingJoinRequests:x,isRightColumnShown:A,isForForum:R,canExpandActions:O,shouldJoinToSend:L,shouldSendJoinRequest:B,noAnimation:F,canTranslate:D,isTranslating:$,translationLanguage:U,language:j,detectedChatLanguage:H,doNotTranslate:z,onTopicSearch:_})=>{const{joinChannel:V,sendBotCommand:q,openLocalTextSearch:W,restartBot:Y,requestMasterAndRequestCall:G,requestNextManagementScreen:X,showNotification:K,openChat:J,requestChatTranslation:Q,togglePeerTranslations:ee,openChatLanguageModal:te,setSettingOption:ne,unblockUser:ae,setViewForumAsMessages:oe}=(0,o.Sv)(),ie=(0,a.sO)(null),se=(0,m.Z)(),[re,ce]=(0,a.eJ)(!1),[le,de]=(0,a.eJ)(void 0),ue=(0,h.Z)((()=>{ce(!0);const e=ie.current.getBoundingClientRect();de({x:e.right,y:e.bottom})})),me=(0,h.Z)((()=>{ce(!1)})),he=(0,h.Z)((()=>{de(void 0)})),pe=(0,h.Z)((()=>{V({chatId:e}),B&&K({message:se(c?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),Ze=(0,h.Z)((()=>{q({command:"/start"})})),ge=(0,h.Z)((()=>{Y({chatId:e})})),fe=(0,h.Z)((()=>{ae({userId:e})})),ve=(0,h.Z)((()=>{Q($?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:U})})),Pe=(0,h.Z)((()=>{X({screen:s.u1.JoinRequests})})),Ee=(0,h.Z)((()=>{R?_?.():(W(),i?document.querySelector("#MobileSearch input").focus():F?(0,r.i$)((()=>{(0,r.Yq)(b)})):setTimeout(b,320))})),ye=(0,h.Z)((()=>{J({id:e}),oe({chatId:e,isEnabled:!0})})),be=(0,h.Z)((e=>{C&&d.RM&&!e.shiftKey&&(e.preventDefault(),Ee())})),Ce=(0,h.Z)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,a=se(n);if(a!==n)return se(e,a);const o=new Intl.DisplayNames([j],{type:"language"}).of(t);return se(`${e}Other`,o)})),we=(0,a.Ye)((()=>$?se("ShowOriginalButton"):Ce("TranslateToButton",U)),[U,Ce,$,se]),Se=(0,a.Ye)((()=>{if(H)return Ce("DoNotTranslateLanguage",H)}),[Ce,H]),Ne=(0,h.Z)((()=>{ee({chatId:e,isEnabled:!1}),Q({chatId:e,toLanguageCode:void 0})})),Ie=(0,h.Z)((()=>{te({chatId:e})})),Me=(0,h.Z)((()=>{H&&(ne({doNotTranslate:[...z,H]}),Q({chatId:e,toLanguageCode:void 0}),K({message:Ce("AddedToDoNotTranslate",H)}))}));(0,u.y)({"Mod+F":be});const ke=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(p.Z,{round:!0,ripple:A,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:se("TranslateMessage")},a.ZP.createElement("i",{className:"icon icon-language","aria-hidden":!0}))),[A,se]);return a.ZP.createElement("div",{className:"HeaderActions"},!R&&D&&a.ZP.createElement(Z.Z,{className:"stickers-more-menu with-menu-transitions",trigger:ke,positionX:"right"},a.ZP.createElement(g.Z,{icon:"language",onClick:ve},we),a.ZP.createElement(g.Z,{icon:"replace",onClick:Ie},se("Chat.Translate.Menu.To")),a.ZP.createElement(f.Z,null),H&&a.ZP.createElement(g.Z,{icon:"hand-stop",onClick:Me},Se),a.ZP.createElement(g.Z,{icon:"close-circle",onClick:Ne},se("Hide"))),!i&&a.ZP.createElement(a.ZP.Fragment,null,O&&!B&&(y||L)&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:pe},se(c?"ProfileJoinChannel":"ProfileJoinGroup")),O&&B&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:pe},se("ChannelJoinRequest")),O&&l&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:Ze},se("BotStart")),O&&v&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:ge},se("BotRestart")),O&&P&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:fe},se("Unblock")),C&&a.ZP.createElement(p.Z,{round:!0,ripple:A,color:"translucent",size:"smaller",onClick:Ee,ariaLabel:se("Conversation.SearchPlaceholder")},a.ZP.createElement("i",{className:"icon icon-search","aria-hidden":!0})),w&&a.ZP.createElement(p.Z,{round:!0,color:"translucent",size:"smaller",onClick:function(){G({userId:e})},ariaLabel:"Call"},a.ZP.createElement("i",{className:"icon icon-phone","aria-hidden":!0}))),!R&&Boolean(x)&&a.ZP.createElement(p.Z,{round:!0,className:"badge-button",ripple:A,color:"translucent",size:"smaller",onClick:Pe,ariaLabel:se(c?"SubscribeRequests":"MemberRequests")},a.ZP.createElement("i",{className:"icon icon-user","aria-hidden":!0}),a.ZP.createElement("div",{className:"badge"},x)),a.ZP.createElement(p.Z,{ref:ie,className:re?"active":"",round:!0,ripple:!i,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:ue},a.ZP.createElement("i",{className:"icon icon-more","aria-hidden":!0})),le&&a.ZP.createElement(E,{chatId:e,threadId:t,isOpen:re,anchor:le,withExtraActions:i||!O,isChannel:c,canStartBot:l,canSubscribe:y,canSearch:C,canCall:w,canMute:S,canViewStatistics:N,canViewBoosts:I,canLeave:M,canEnterVoiceChat:k,canCreateVoiceChat:T,pendingJoinRequests:x,onJoinRequestsClick:Pe,withForumActions:R,onSubscribeChannel:pe,onSearchClick:Ee,onAsMessagesClick:ye,onClose:me,onCloseAnimationEnd:he}))})));function b(){const e=document.querySelector(".RightHeader .SearchInput input");e?.focus()}},43159:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),i=n(60706),s=n(59107),r=n(25190),c=n(52328),l=n(58964),d=n(6137),u=n(4463),m=n(46752),h=n(42797),p=n(6202);const Z="N3E1geoPu1vesCKf545F",g=/#fff/gi,f=(0,a.X$)((({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,h.ZP)(),o=(0,p.Z)((0,u.ym)(e),!1,d.IU.Text),i=(0,a.Ye)((()=>{if(!o)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=o.replace(g,e),a=(new DOMParser).parseFromString(n,"image/svg+xml");return a.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${a.documentElement.outerHTML}`}),[o,t]);return a.ZP.createElement("i",{className:(0,m.Z)("vL8HfVVnjTeFmp1ECFj8","icon",!n&&Z)},a.ZP.createElement("img",{src:i,alt:"",className:(0,m.Z)("Fb4aIyDYEwOlaqY8oZkV",!n&&Z),draggable:!1}))})),v=(0,a.X$)((({bot:e,theme:t,chatId:n,threadId:d,isInSideMenu:u,canShowNew:m,onMenuOpened:h,onMenuClosed:p})=>{const{callAttachBot:Z,toggleAttachBot:g}=(0,o.Sv)(),v=(0,s.Z)(),P=(0,a.Ye)((()=>e.icons.find((({name:e})=>"default_static"===e))?.document),[e.icons]),[E,y,b]=(0,i.Z)(),[C,w]=(0,a.eJ)(void 0),S=(0,r.Z)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();w({x:t.right,y:t.bottom}),h(),y()})),N=(0,r.Z)((()=>{Z(u?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:d})})),I=(0,r.Z)((()=>{b(),p()})),M=(0,r.Z)((()=>{w(void 0)})),k=(0,r.Z)((()=>{g({botId:e.id,isEnabled:!1})}));return a.ZP.createElement(l.Z,{key:e.id,customIcon:P&&a.ZP.createElement(f,{icon:P,theme:t}),icon:P?void 0:"bots",onClick:N,onContextMenu:S},e.shortName,m&&e.isDisclaimerNeeded&&a.ZP.createElement("span",{className:"menu-item-badge"},v("New")),C&&a.ZP.createElement(c.Z,{isOpen:E,positionX:"right",style:`left: ${C.x}px;top: ${C.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:I,onCloseAnimationEnd:M},a.ZP.createElement(l.Z,{icon:"stop",destructive:!0,onClick:k},v("WebApp.RemoveBot"))))}))},93219:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"CustomEmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}},67146:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"CustomSendMenu",!t);return n?a.ZP.createElement(n,e):void 0}},12420:(e,t,n)=>{n.d(t,{t:()=>h,Z:()=>p});var a=n(60748),o=n(46752),i=n(23989),s=n(21262),r=n(25190),c=n(87204),l=n(31212),d=n(62898),u=n(60706);const m=(0,a.X$)((({isQuick:e,isGeneric:t,onFileSelect:n})=>{const[i,s,r]=(0,u.Z)(),c=(0,o.Z)("DropTarget",i&&"hovered");return a.ZP.createElement("div",{className:c,onDrop:n,onDragEnter:s,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),r()},"data-dropzone":!0},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),!t&&a.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let h=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const p=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:u})=>{const h=(0,a.sO)(null),p=(0,c.Z)(t),{shouldRender:Z,transitionClassNames:g}=(0,l.Z)(e);(0,a.d4)((()=>e?(0,i.Z)(n):void 0),[e,n]);const f=(0,r.Z)((async e=>{const{dataTransfer:a}=e;let o=[];if(!(a.files&&a.files.length>0)||a.items&&a.items.length){if(a.items&&a.items.length>0){const e=await(0,s.Z)(a.items);e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(a.files));n(),u(o,!t&&void 0)})),v=(0,r.Z)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),u(Array.from(t.files),!0))})),P=(0,r.Z)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;!t.matches(".DropTarget, .DropArea")||a&&a.matches(".DropTarget, .DropArea")||(h.current=window.setTimeout((()=>{n()}),150))}));if(!Z)return;const E=t||p,y=(0,o.Z)("DropArea",g);return a.ZP.createElement(d.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:y,onDragLeave:P,onDragOver:()=>{h.current&&window.clearTimeout(h.current)},onDrop:n,onClick:n},a.ZP.createElement(m,{onFileSelect:f,isGeneric:!E}),E&&a.ZP.createElement(m,{onFileSelect:v,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}},49841:(e,t,n)=>{n.d(t,{Z:()=>z});var a=n(60748),o=n(33555),i=n(83716),s=n(57710),r=n(7054),c=n(46752),l=n(517),d=n(98069),u=n(65723),m=n(94462),h=n(69118),p=n(97184),Z=n(32340),g=n(96391),f=n(42797),v=n(86203),P=n(60706),E=n(18674),y=n(59107),b=n(25190),C=n(84089),w=n(74753);function S(e,t,n){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?a:String(a))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class N{constructor(e,t,n){this.container=t,this.options=n,S(this,"video",void 0),S(this,"isPlaying",!1),this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,s.WM)((()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()}))}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,w.Z)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,s.i$)((()=>{if(!this.video)return;const a=this.video,{width:o,height:i}=this.container.getBoundingClientRect();(0,s.WM)((()=>{a.style.left=`${Math.round(t*o)}px`,a.style.top=`${Math.round(n*i)}px`,a.style.width=`${e}px`,a.style.height=`${e}px`}))}))}}var I=n(74288),M=n(28712),k=n(27370),T=n(74399),x=n(22268),A=n(92085),R=n(45332),O=n(274),L=n(78722),B=n(3927);const F=1.25*T.Gw;var D=n(4292),$=n(72087);const U="input-scroller",j=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],z=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyInfo:t&&n?(0,r.Mst)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.CAb)(e),canPlayAnimatedEmojis:(0,r.W9H)(e)}}))((({ref:e,id:t,chatId:n,captionLimit:w,isAttachmentModalInput:S,isStoryInput:T,customEmojiPrefix:z,editableInputId:_,isReady:V,isActive:q,getHtml:W,placeholder:Y,timedPlaceholderLangKey:G,timedPlaceholderDate:X,forcedPlaceholder:K,canSendPlainText:J,canAutoFocus:Q,noFocusInterception:ee,shouldSuppressFocus:te,shouldSuppressTextFormatter:ne,replyInfo:ae,isSelectModeActive:oe,canPlayAnimatedEmojis:ie,messageSendKeyCombo:se,onUpdate:re,onSuppressedFocus:ce,onSend:le,onScroll:de,onFocus:ue,onBlur:me})=>{const{editLastMessage:he,replyToNextMessage:pe,showAllowedMessageTypesNotification:Ze}=(0,o.Sv)();let ge=(0,a.sO)(null);e&&(ge=e);const fe=(0,a.sO)(null),ve=(0,a.sO)(null),Pe=(0,a.sO)(null),Ee=(0,a.sO)(null),ye=(0,a.sO)(null),be=(0,a.sO)(null),Ce=(0,y.Z)(),we=(0,a.sO)(!1),[Se,Ne,Ie]=(0,P.Z)(),[Me,ke]=(0,a.eJ)(),[Te,xe]=(0,a.eJ)(),[Ae,Re]=(0,a.eJ)(!1),{isMobile:Oe}=(0,f.ZP)(),Le=Oe&&(p.cj||p.wZ),[Be,Fe]=(0,a.eJ)(!1);(0,a.d4)((()=>{Fe(Boolean(G&&X))}),[X,G]);const De=(0,b.Z)((()=>{Fe(!1)}));!function(e,t,n,i,c,l,d,u,m){const h=(0,A.Z)(t,!u),p=(0,x.Z)(h,!0),Z=(0,a.sO)(new Map),g=(0,b.Z)((e=>{e.forEach((e=>{const t=Z.current.get(e);t&&(t.destroy(),Z.current.delete(e))}))})),f=(0,b.Z)((()=>{if(!(u&&t.current&&n.current&&i.current))return;const e=(0,o.Rd)(),a=new Set(Z.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const o=`${l}${t.dataset.uniqueId}${h||""}`,s=t.dataset.documentId;a.delete(o);const u=(0,I.XH)(s);if(!u)return;const m=n.current.getBoundingClientRect(),g=t.getBoundingClientRect(),f=(0,M.NM)((g.left-m.left)/m.width,4),v=(0,M.NM)((g.top-m.top)/m.height,4);if(Z.current.has(o))return void Z.current.get(o).updatePosition(f,v);const P=e.customEmojis.byId[s];if(!P)return;const E=P?.stickerSetInfo&&(0,r.Si0)(e,P.stickerSetInfo),y=[l,s,h].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:a,renderId:o,viewId:i,mediaUrl:s,position:r,isHq:c,textColor:l,colorFilter:d}){if(e.isLottie){const a=e.shouldUseTextColor&&l?(0,k.oo)(l):void 0,d=(await(0,C.t)()).init(s,c?n.current:t.current,o,{size:F,coords:r,isLowPriority:!c},i,a?[a.r,a.g,a.b]:void 0);return{play:()=>d.play(),pause:()=>d.pause(),destroy:()=>d.removeView(i),updatePosition:(e,t)=>d.setSharedCanvasCoords(i,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&d?`filter: ${d};`:void 0,n=new N(s,a.current,{size:F,position:r,style:t});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:P,sharedCanvasRef:n,sharedCanvasHqRef:i,absoluteContainerRef:c,renderId:y,viewId:o,mediaUrl:u,isHq:E,position:{x:f,y:v},textColor:h,colorFilter:p}).then((e=>{d&&e.play(),Z.current.set(o,e)}))})),g(Array.from(a))}));(0,a.d4)((()=>(0,I.bn)(f)),[f]),(0,a.d4)((()=>{e()&&t.current&&n.current&&m&&u?(0,s.i$)((()=>{f()})):g(Array.from(Z.current.keys()))}),[e,f,t,g,n,m,u]),(0,a.bt)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,O.Z)((([e])=>{void 0!==e&&h!==e&&f()}),[h,f]);const v=(0,B.Z)(f,[f],300,!1);(0,L.Z)(n,v);const P=(0,b.Z)((()=>{Z.current.forEach((e=>{e.pause()}))})),E=(0,b.Z)((()=>{d&&Z.current?.forEach((e=>{e.play()}))})),y=(0,b.Z)((()=>{(0,s.i$)(E)}));(0,R.Z)(P,y)}(W,ge,Ee,ye,be,z,ie,V,q);const $e=S?160:T?128:Oe?256:416,Ue=(0,b.Z)(((e=!1)=>{(0,s.lT)((()=>{const t=ge.current.closest(`.${U}`),n=Number(t.style.height.replace("px","")),a=Pe.current,{scrollHeight:o}=a,i=Math.min(o,$e);if(i===n)return;const r=o>$e;function c(){const e=Math.round(50*Math.log(Math.abs(i-n)));t.style.height=`${i}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,s.WM)(c):c}))}));(0,a.bt)((()=>{S&&Ue(!1)}),[S,Ue]);const je=(0,a.sO)(W());(0,a.bt)((()=>{const e=q?W():"";e!==ge.current.innerHTML&&(ge.current.innerHTML=e),e!==ve.current.innerHTML&&(ve.current.innerHTML=e),e!==je.current&&(je.current=e,Ue(!e))}),[W,q,Ue]),(0,a.sO)(n).current=n;const He=(0,b.Z)((()=>{ge.current&&((0,E.zG)()?setTimeout(He,350):(0,u.Z)(ge.current))})),ze=(0,b.Z)((()=>{Ie(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function _e(){if(p.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||we.current)return Ie(),p.wZ&&Re(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(ne||!(0,g.R)(t,_||i.R2F)||!n||(0,m.Z)(n)||!t.START_TO_END)||(Ie(),!1)}function Ve(){if(!_e())return;if(Ae)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=ge.current.closest(`.${U}`).getBoundingClientRect();let a=t.left+t.width/2-n.left;a<j?a=j:a>n.width-j&&(a=n.width-j),ke({x:a,y:t.top-n.top}),xe(e),Ne()}function qe(){fe.current&&window.clearTimeout(fe.current),fe.current=window.setTimeout(Ve,260)}(0,a.d4)((()=>{p.$b||Q&&He()}),[n,He,ae,Q]),(0,a.d4)((()=>{if(!n||_!==i.R2F||ee||Le||oe)return;const e=e=>{if((0,d.wT)())return;const{key:t}=e,n=e.target;if(!n||H.includes(t))return;const a=ge.current,o=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!o||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&a&&n!==a&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,u.Z)(a,!0,!0);const t=new KeyboardEvent(e.type,e);a.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[n,_,Le,oe,ee]),(0,a.d4)((()=>{const e=(0,h.Ds)((e=>{"Tab"!==e.key||(0,d.wT)()||(e.preventDefault(),(0,s.WM)(He))}),2e3,!0,!1);return(0,l.Z)({onTab:e})}),[He]),(0,a.d4)((()=>{const e=ge.current;function t(){e.blur()}return te&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[te]);const We=(0,v.Z)((()=>Boolean(q&&W())),[q,W]),Ye=(0,c.Z)("form-control allow-selection",We&&"touched",te&&"focus-disabled");return a.ZP.createElement("div",{id:t,onClick:te?ce:void 0,dir:Ce.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:(0,c.Z)("custom-scroll",U),onScroll:de,onClick:S||J?void 0:function(){S||J||Ze({chatId:n})}},a.ZP.createElement("div",{className:"input-scroller-content"},a.ZP.createElement("div",{ref:ge,id:_||i.R2F,className:Ye,contentEditable:S||J,role:"textbox",dir:"auto",tabIndex:0,onClick:He,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(re("<br>"===t?"":t),!p.$b&&(!n||!n.length)&&(p.op||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(ge.current.blur(),e.removeAllRanges(),(0,u.Z)(ge.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=W();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void pe({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",qe,{once:!0}):(e.preventDefault(),he()):!Le&&("enter"===se&&!e.shiftKey||"ctrl-enter"===se&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Ie(),le())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{we.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?we.current||(we.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",qe,{once:!0})},onContextMenu:p.wZ?function(e){_e()&&(Re(!Ae),Ae?Ie():(e.preventDefault(),e.stopPropagation(),Ve()))}:void 0,onTouchCancel:p.wZ?qe:void 0,"aria-label":Y,onFocus:ue,onBlur:me}),!K&&a.ZP.createElement("span",{className:(0,c.Z)("placeholder-text",!S&&!J&&"with-icon"),dir:"auto"},!S&&!J&&a.ZP.createElement("i",{className:"icon icon-lock-badge placeholder-icon"}),Be?a.ZP.createElement(D.Z,{langKey:G,endsAt:X,onEnd:De}):Y),a.ZP.createElement("canvas",{ref:Ee,className:"shared-canvas"}),a.ZP.createElement("canvas",{ref:ye,className:"shared-canvas"}),a.ZP.createElement("div",{ref:be,className:"absolute-video-container"}))),a.ZP.createElement("div",{ref:Pe,className:(0,c.Z)("custom-scroll",U,"clone")},a.ZP.createElement("div",{className:"input-scroller-content"},a.ZP.createElement("div",{ref:ve,className:(0,c.Z)(Ye,"clone"),dir:"auto"}))),void 0!==w&&a.ZP.createElement("div",{className:"max-length-indicator",dir:"auto"},w),a.ZP.createElement($.Z,{isOpen:Se,anchorPosition:Me,selectedRange:Te,setSelectedRange:xe,onClose:ze}),K&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,Z.Z)(K)))})))},23522:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(60748),o=n(33555),i=n(83716),s=n(46752),r=n(60706),c=n(25190),l=n(12644),d=n(231),u=n(43521),m=n(49204),h=n(99203),p=n(48778);const Z=e=>{const{isOpen:t}=e,n=(0,p.Z)(h.gl.Extra,"SymbolMenu",!t);return n?a.ZP.createElement(n,e):void 0},g=(0,a.X$)((({chatId:e,threadId:t,isMobile:n,canSendGifs:h,canSendStickers:p,isMessageComposer:g,isReady:f,isSymbolMenuOpen:v,idPrefix:P,isAttachmentModal:E,canSendPlainText:y,isSymbolMenuForced:b,className:C,forceDarkTheme:w,inputCssSelector:S=i.Edp,openSymbolMenu:N,closeSymbolMenu:I,onCustomEmojiSelect:M,onStickerSelect:k,onGifSelect:T,onRemoveSymbol:x,onEmojiSelect:A,closeBotCommandMenu:R,closeSendAsMenu:O})=>{const{setStickerSearchQuery:L,setGifSearchQuery:B,addRecentEmoji:F,addRecentCustomEmoji:D}=(0,o.Sv)(),$=(0,a.sO)(null),[U,j]=(0,r.Z)(),[H,z]=(0,a.eJ)(void 0),_=(0,s.Z)("mobile-symbol-menu-button",!f&&"not-ready",U?v&&"menu-opened":v&&"is-loading"),V=(0,c.Z)((()=>{R?.(),O?.(),N();const e=$.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();z({x:t,y:n})})),q=(0,c.Z)((e=>{"stickers"===e?(L({query:""}),B({query:void 0})):(B({query:""}),L({query:void 0}))})),W=(0,c.Z)((()=>{const e=document.querySelector(E?i.VEm:S);n&&e===document.activeElement?(e?.blur(),setTimeout((()=>{R?.(),N()}),100)):N()})),Y=(0,c.Z)((()=>$.current)),G=(0,c.Z)((()=>$.current?.closest(".custom-scroll, .no-scrollbar"))),X=(0,c.Z)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),K=(0,c.Z)((()=>({withPortal:!0}))),{positionX:J,positionY:Q,transformOriginX:ee,transformOriginY:te,style:ne}=(0,l.Z)(H,Y,G,X,K);return a.ZP.createElement(a.ZP.Fragment,null,n?a.ZP.createElement(d.Z,{className:_,round:!0,color:"translucent",onClick:v?I:W,ariaLabel:"Choose emoji, sticker or GIF"},a.ZP.createElement("i",{className:"icon icon-smile"}),a.ZP.createElement("i",{className:"icon icon-keyboard"}),v&&!U&&a.ZP.createElement(m.Z,{color:"gray"})):a.ZP.createElement(u.Z,{className:(0,s.Z)("symbol-menu-button",v&&"activated"),round:!0,color:"translucent",onActivate:V,ariaLabel:"Choose emoji, sticker or GIF"},a.ZP.createElement("div",{ref:$,className:"symbol-menu-trigger"}),a.ZP.createElement("i",{className:"icon icon-smile"})),a.ZP.createElement(Z,{chatId:e,threadId:t,isOpen:v||Boolean(b),canSendGifs:h,canSendStickers:p,isMessageComposer:g,idPrefix:P,onLoad:j,onClose:I,onEmojiSelect:A,onStickerSelect:k,onCustomEmojiSelect:M,onGifSelect:T,onRemoveSymbol:x,onSearchOpen:q,addRecentEmoji:F,addRecentCustomEmoji:D,isAttachmentModal:E,canSendPlainText:y,className:(0,s.Z)(C,w&&"component-theme-dark"),positionX:E?J:void 0,positionY:E?Q:void 0,transformOriginX:E?ee:void 0,transformOriginY:E?te:void 0,style:E?ne:void 0}))}))},72087:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(60748),o=n(6137),i=n(83716),s=n(46752),r=n(23989),c=n(81396),l=n(3858),d=n(44139),u=n(60706),m=n(59107),h=n(25190),p=n(31212),Z=n(58758),g=n(231);const f={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},v=document.createElement("div"),P=(0,a.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,setSelectedRange:P,onClose:E})=>{const y=(0,a.sO)(null),b=(0,a.sO)(null),{shouldRender:C,transitionClassNames:w}=(0,p.Z)(e),[S,N,I]=(0,u.Z)(),[M,k]=(0,a.eJ)(""),[T,x]=(0,a.eJ)(!1),[A,R]=(0,a.eJ)(),[O,L]=(0,a.eJ)({});(0,a.d4)((()=>e?(0,r.Z)(E):void 0),[e,E]),(0,Z.Z)(e,y,E,!0),(0,a.d4)((()=>{S?b.current.focus():(k(""),x(!1))}),[S]),(0,a.d4)((()=>{C||(I(),L({}),R(void 0))}),[I,C]),(0,a.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==i.R2F;){const e=f[a.tagName];e&&(t[e]=!0),a=a.parentElement}L(t)}),[e,n,N]);const B=(0,h.Z)((()=>{if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))})),F=(0,h.Z)((()=>{const e=window.getSelection();e&&P(e.getRangeAt(0))})),D=(0,h.Z)((e=>{if(n)return v.replaceChildren(n.cloneContents()),e&&v.querySelectorAll(d.fJ).forEach((e=>{e.replaceWith(e.getAttribute("alt"))})),v.innerHTML})),$=(0,h.Z)((()=>{if(n)return n.commonAncestorContainer.parentElement}));function U(){const e=b.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void R(void 0);let o="";a<n-t&&(o="mask-right"),a>0&&(o+=" mask-left"),R(o)}function j(e){if(O[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(O).some((t=>t!==e&&Boolean(O[t]))))return"disabled"}else if(O.monospace||O.strikethrough)return"disabled"}const H=(0,h.Z)((()=>{if(O.spoiler){const e=$();if(!n||!e||e.dataset.entityType!==o.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,spoiler:!1})))}const e=D();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${o.Vv.Spoiler}">${e}</span>`),E()})),z=(0,h.Z)((()=>{L((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),F(),{...e,bold:!e.bold})))})),_=(0,h.Z)((()=>{document.execCommand("italic"),F(),L((e=>({...e,italic:!e.italic})))})),V=(0,h.Z)((()=>{document.execCommand("underline"),F(),L((e=>({...e,underline:!e.underline})))})),q=(0,h.Z)((()=>{if(O.strikethrough){const e=$();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,strikethrough:!1})))}const e=D();document.execCommand("insertHTML",!1,`<del>${e}</del>`),E()})),W=(0,h.Z)((()=>{if(O.monospace){const e=$();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void L((e=>({...e,monospace:!1})))}const e=D(!0);document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),E()})),Y=(0,h.Z)((()=>{const e=((0,c.X)(M)||"").split("%").map(encodeURI).join("%");if(T){const t=$();if(!t||"A"!==t.tagName)return;return t.href=e,void E()}const t=D(!0);B(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),E()})),G=(0,h.Z)((e=>{const t={k:N,b:z,u:V,i:_,m:W,s:q,p:H}[function(e){const t=e.key||e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}));(0,a.d4)((()=>(e&&document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G))),[e,G]);const X=(0,m.Z)();if(!C)return;const K=(0,s.Z)("TextFormatter",w,S&&"link-control-shown"),J=(0,s.Z)("TextFormatter-link-url-confirm",Boolean(M.length)&&"shown"),Q=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.ZP.createElement("div",{ref:y,className:K,style:Q,onKeyDown:function(e){"Enter"===e.key&&S&&(Y(),e.preventDefault())},onMouseDown:l.Z},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Spoiler text",className:j("spoiler"),onClick:H},a.ZP.createElement("i",{className:"icon icon-eye-closed"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Bold text",className:j("bold"),onClick:z},a.ZP.createElement("i",{className:"icon icon-bold"})),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Italic text",className:j("italic"),onClick:_},a.ZP.createElement("i",{className:"icon icon-italic"})),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Underlined text",className:j("underline"),onClick:V},a.ZP.createElement("i",{className:"icon icon-underlined"})),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:j("strikethrough"),onClick:q},a.ZP.createElement("i",{className:"icon icon-strikethrough"})),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:"Monospace text",className:j("monospace"),onClick:W},a.ZP.createElement("i",{className:"icon icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:X("TextFormat.AddLinkTitle"),onClick:N},a.ZP.createElement("i",{className:"icon icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:X("Cancel"),onClick:I},a.ZP.createElement("i",{className:"icon icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",A)},a.ZP.createElement("input",{ref:b,className:"TextFormatter-link-url-input",type:"text",value:M,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){k(e.target.value),U()},onScroll:U})),a.ZP.createElement("div",{className:J},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(g.Z,{color:"translucent",ariaLabel:X("Save"),className:"color-primary",onClick:Y},a.ZP.createElement("i",{className:"icon icon-check"}))))))}))},21262:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(71394);async function o(e){const t=[];function n(e,a){return new Promise((o=>{if(e instanceof File)t.push(e),o(e);else if(e.isFile){const n=a.getAsFile();e.file((e=>{t.push(e),o(e)}),(()=>{n&&t.push(n),o(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let o=0;o<e.length;o++)t.push(n(e[o],a));o(Promise.all(t))}))}))}const o=[];for(let t=0;t<e.length;t++){const a=e[t];if("file"===a.kind){const e=a.webkitGetAsEntry()||a.getAsFile();e&&o.push(n(e,a))}}return await Promise.all(o),(0,a.ox)(t)}},52400:(e,t,n)=>{n.d(t,{_:()=>r});const a=/(<br>|<br\s?\/>)/g,o=/(&nbsp;|\u00A0)/g,i=/(<div>|<\/div>)/gi,s=/\n$/i;function r(e){return e.replace(o," ").replace(a,"\n").replace(i,"").replace(s,"")}},96391:(e,t,n)=>{n.d(t,{R:()=>o});const a=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,i=1;for(;o&&o.id!==t&&i<a;)o=o.parentElement,i++;return Boolean(o&&o.id===t)}},60130:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),i=n(83716),s=n(57710),r=n(33681),c=n(65723),l=n(41098),d=n(97184),u=n(44139),m=n(11309),h=n(71790),p=n(86203),Z=n(60706),g=n(25190);const f=300,v=new RegExp(`(${r.Z.source})$`,"g"),P=new RegExp(`${i.t8f.source}$`,"g");function E(e,t,n,E,y,b){const{loadCustomEmojiForEmoji:C,clearCustomEmojiForEmoji:w}=(0,o.Sv)(),[S,N,I]=(0,Z.Z)(!1),M=(0,m.CH)((()=>{const n=t();if(!e||!n||!E()?.collapsed)return;if(!n.match(d.op?r.Z:i.t8f))return;const a=(0,l.gJ)(y.current);return a.match(d.op?v:P)?.[0]}),[t,E,y,e],f),k=(0,h.Z)(M,[M,t,E],!0),T=(0,p.Z)((()=>Boolean(k())),[k]),x=Boolean(b?.length);(0,a.d4)((()=>{if(!e||!T)return;const t=k();t?x||C({emoji:d.op?t:t.match(/.+alt="(.+)"/)?.[1]}):w()}),[e,T,k,x,w,C]);const A=(0,g.Z)((t=>{const a=k();if(!e||!a)return;const o=y.current,i=(0,l.gJ)(o),r=d.op?a:a.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),m=new RegExp(`(${r})\\1*$`,""),h=i.match(m)[0].length/a.length,p=i.replace(m,(0,u.yR)(t).repeat(h)),Z=o.innerHTML.substring(i.length);n(`${p}${Z}`),(0,s.Yq)((()=>{(0,c.Z)(o,!0,!0)}))}));return(0,a.d4)(I,[I,t]),{isCustomEmojiTooltipOpen:Boolean(T&&x&&!S),closeCustomEmojiTooltip:N,insertCustomEmoji:A}}},28353:(e,t,n)=>{n.d(t,{Z:()=>x});var a=n(60748),o=n(33555),i=n(83716),s=n(57710),r=n(7054),c=n(34284),l=n(65723),d=n(60782),u=n(70735),m=n(16580),h=n(32340),p=n(44139),Z=n(52400),g=n(11309),f=n(71790),v=n(60706),P=n(25190);let E,y,b,C,w;const S=36,N=2,I=300,M=(0,m.Z)((function(e,t,n){return e&&t.length?Object.values((0,d.q0)(e,t)).slice(0,n):u.D})),k=(0,m.Z)((function(e,t,n){const a=Object.values(e),o=(0,d.ee)(a,"native"),i=t?(0,d.Q8)(t,(e=>Object.values((0,d.q0)(o,e)))):{},s=n?(0,d.Q8)(n,(e=>Object.values((0,d.q0)(o,e)))):{},r={...i,...s},c=[].concat(Object.keys(i),Object.keys(s)),l=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),u=Object.keys(l),m=c.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:r,keywords:c,byName:l,names:u,maxKeyLength:m}})),T=(0,m.Z)((function(e,t,n){const{byKeyword:a,keywords:o,byName:i,names:s,maxKeyLength:r}=e;let c=[];if(t.length>r)return u.D;const l=o.filter((e=>e.startsWith(t))).sort();c=c.concat(Object.values((0,d.q0)(a,l)).flat());const m=s.filter((e=>e.startsWith(t)));return c=c.concat(Object.values((0,d.q0)(i,m)).flat()),c=(0,d.Tw)(c),c.length?c.slice(0,n):u.D}));try{C=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,w=/\p{Ll}/u}catch(e){C=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,w=/[a-zяёґєії]/}function x(e,t,m,x=i.R2F,A,R,O){const[L,B,F]=(0,v.Z)(!1),[D,$]=(0,a.eJ)(),[U,j]=(0,a.eJ)(u.D),[H,z]=(0,a.eJ)(u.D);(0,a.d4)((()=>{function t(){$(b.emojis)}e&&(b?t():async function(){return E||(E=n.e(7501).then(n.t.bind(n,47501,19)),y=(await E).default,b=(0,c.NM)(y)),E}().then(t))}),[e]);const _=(0,g.CH)((()=>{const n=t();return e&&n.includes(":")?(0,Z._)(n).match(C)?.[0].trim():void 0}),[t,e],I),V=(0,f.Z)(_,[_,t],!0),q=(0,P.Z)((e=>{if(j(e),e===u.D)return void z(u.D);const t=e.map((e=>e.native)),n=(0,d.od)((0,r.iXW)((0,o.Rd)(),t),"id");z(n)})),W=(0,P.Z)(((e,n=!1)=>{const a=t();if(!a)return;const o=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==o){const t="string"==typeof e?(0,h.Z)(e,["emoji_html"]):(0,p.yR)(e);m(`${a.substring(0,o)}${t}`);const n=x===i.R2F?document.querySelector(i.Edp):document.getElementById(x);(0,s.Yq)((()=>{(0,l.Z)(n,!0,!0)}))}q(u.D)}));return(0,a.d4)((()=>{const e=V();if(!e||!D)return void q(u.D);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let a=u.D;if(n){if(1===n.length&&w.test(n)||n.length>=N){const e=k(D,R,O);a=T(e,n.toLowerCase(),S)}}else a=M(D,A,S);a.length?t?W(a[0].native,!0):q(a):q(u.D)}),[R,D,V,O,W,A,q]),(0,a.d4)(F,[F,t]),{isEmojiTooltipOpen:Boolean(U.length||H.length)&&!L,closeEmojiTooltip:B,filteredEmojis:U,filteredCustomEmojis:H,insertEmoji:W}}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),i=n(6137),s=n(57710),r=n(4463),c=n(65723),l=n(60782),d=n(41098),u=n(52400),m=n(11309),h=n(71790),p=n(60706),Z=n(25190);const g=300;let f;try{f=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){f=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function v(e,t,n,v,E,y,b,C){const[w,S]=(0,a.eJ)(),[N,I,M]=(0,p.Z)(!1),k=(0,m.CH)((()=>{const n=t();if(!e||!v()?.collapsed||!n.includes("@"))return;const a=(0,d.gJ)(E.current);return(0,u._)(a).match(f)?.[0].trim()}),[e,t,v,E],g),T=(0,h.Z)(k,[k,t,v],!0),x=(0,h.Z)((()=>e&&t().startsWith("@")),[t,e]);(0,a.d4)((()=>{const e=T();if(!e||!y&&!b)return void S(void 0);const t=(0,o.Rd)().users.byId;if(!t)return void S(void 0);const n=y?.reduce(((e,t)=>(t.userId!==C&&e.push(t.userId),e)),[]),a=e.substring(1),i=(0,r.kK)((0,l.Tw)([...x()&&b||[],...n||[]]),t,a);S(Object.values((0,l.q0)(t,i)))}),[C,y,b,T,x]);const A=(0,Z.Z)(((e,t=!1)=>{if(!e.usernames&&!(0,r.Vl)(e))return;const a=(0,r.WS)(e),o=(0,r.Vl)(e)||"",l=a?`@${a}`:`<a\n class="text-entity-link"\n data-entity-type="${i.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${o}</a>`,u=E.current,m=P((0,d.gJ)(u)),h=m.lastIndexOf("@"),p=(a?a.length+1:o.length)-(m.length-h);if(-1!==h){const e=`${m.substr(0,h)}${l}&nbsp;`,a=P(u.innerHTML).substring(m.length),o=(0,d.qK)(u);n(`${e}${a}`),(0,s.Yq)((()=>{const e=o+p+1;(0,c.Z)(u,t),e>=0&&(0,d.Mq)(u,e)}))}S(void 0)}));return(0,a.d4)(M,[M,t]),{isMentionTooltipOpen:Boolean(w?.length&&!N),closeMentionTooltip:I,insertMention:A,mentionFilteredUsers:w}}function P(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},93609:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(60748),o=n(33555),i=n(4463),s=n(46752),r=n(790),c=n(97184),l=n(42797),d=n(15866),u=n(18360),m=n(59107),h=n(25190),p=n(6202),Z=n(31212),g=n(42175);const f=(0,a.X$)((function({story:e,isPreview:t,isProtected:n,isConnected:f}){const{openStoryViewer:v,loadPeerStoriesByIds:P,showNotification:E}=(0,o.Sv)(),y=(0,m.Z)(),{isMobile:b}=(0,l.ZP)(),C=e&&"isDeleted"in e,w=e&&"content"in e,S=w?e.content.video:void 0,N=w?(0,i.Cc)(e):void 0,I=(0,p.Z)(N),M=w?S?S.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,k=(0,u.Z)(I,!0),{shouldRender:T,transitionClassNames:x}=(0,Z.Z)(Boolean(k)),A=(0,d.Z)(M,C&&!t,b&&!c.vX),R=(0,s.Z)("u1iXUR7f9a1fJ3oKj6UR","media-inner",(!f||C)&&"sM8Yb5GJn63Lqe7WGyxs",C&&"GU6ftk8mOSKG68G3clJz",t&&"PdT0BgaOGO3KQ6uAMywg");(0,a.d4)((()=>{!e||w||C||P({peerId:e.peerId,storyIds:[e.id]})}),[e,C,w]);const O=(0,h.Z)((()=>{C?E({message:y("StoryNotFound")}):v({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})}));return a.ZP.createElement("div",{className:R,onClick:f?O:void 0},!C&&t&&a.ZP.createElement("canvas",{ref:A,className:"thumbnail blurred-bg"}),T&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("img",{src:k,alt:"",className:(0,s.Z)("bCVEWkiPlJ2vOFKdsOZn",t&&"VjvrVyctay2XnrWkF6Pm",x),draggable:!1}),w&&a.ZP.createElement(g.Z,{story:e,className:x})),C&&a.ZP.createElement("span",null,a.ZP.createElement("i",{className:(0,s.Z)("C6JcJFH05QLPlgncYbFX","icon icon-story-expired"),"aria-hidden":!0}),y("StoryExpiredSubtitle")),Boolean(S?.duration)&&a.ZP.createElement("div",{className:"message-media-duration"},(0,r.k9)(S.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},97182:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(99203),i=n(48778);const s=e=>{const{isOpen:t}=e,n=(0,i.Z)(o.gl.Extra,"ContextMenuContainer",!t);return n?a.ZP.createElement(n,e):void 0}},95822:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(60748),o=n(83716),i=n(57710),s=n(4463),r=n(46752),c=n(26593),l=n(83967),d=n(42797),u=n(60706),m=n(3657),h=n(25190),p=n(72645),Z=n(70692),g=n(6701),f=n(87204),v=n(31212),P=n(41280),E=n(62230),y=n(39196);const b=({id:e,message:t,observeIntersection:n,noAvatars:b,canAutoLoad:C,isInSelectMode:w,isSelected:S,uploadProgress:N,forcedWidth:I,size:M="inline",dimensions:k,asForwarded:T,nonInteractive:x,shouldAffectAppendix:A,isDownloading:R,isProtected:O,theme:L,onClick:B,onCancelUpload:F})=>{const D=(0,a.sO)(null),$=(0,s.O$)(t)||(0,s.F$)(t),U=$.blobUrl,j=(0,m.Op)(D,n),{isMobile:H}=(0,d.ZP)(),[z,_]=(0,a.eJ)(C),V=z&&j,{mediaData:q,loadProgress:W}=(0,g.Z)((0,s.Ti)(t,M),!V),Y=U||q,G=Boolean(I),[X]=(0,a.eJ)(!Y),K=Boolean(Y),J=(0,P.Z)(t,K),Q=(0,P.Z)(t,!G),ee=(0,Z.Z)(!K),te=(0,s.DH)(t),[ne,,ae]=(0,u.Z)($.isSpoiler),{loadProgress:oe}=(0,g.Z)((0,s.Ti)(t,"download"),!R,(0,s.kG)(t,"download")),{isUploading:ie,isTransferring:se,transferProgress:re}=(0,s.Sc)(t,N||(R?oe:W),V&&!Y),ce=!1===(0,f.Z)(z),{shouldRender:le,transitionClassNames:de}=(0,v.Z)(se,void 0,ce,"slow"),{shouldRender:ue,transitionClassNames:me}=(0,v.Z)(!Y&&!z),he=(0,h.Z)((()=>{ie?F?.(t):Y?ne?ae():B?.(t.id):_((e=>!e))})),pe=(0,s.B4)(t);(0,p.Z)((([e])=>{if(!A)return void(e&&D.current.closest(o.be_).removeAttribute(o.s22));const t=D.current.closest(o.be_);Y?(0,c.Z)(Y,pe,S,L).then((e=>{(0,i.WM)((()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(o.s22,"")}))})):t.classList.add("has-appendix-thumb")}),[A,Y,pe,w,S,L]);const{width:Ze,height:ge,isSmall:fe}=k||(0,l.GH)(t,T,b,H),ve=(0,r.Z)("media-inner",!ie&&!x&&"interactive",fe&&"small-image",Ze===ge&&"square-image",ge<l.Xo&&"fix-min-height"),Pe=k?` width: ${Ze}px; left: ${k.x}px; top: ${k.y}px;`:"",Ee="inline"===M?`height: ${ge}px;${Pe}`:void 0;return a.ZP.createElement("div",{id:e,ref:D,className:ve,style:Ee,onClick:ie?void 0:he},G&&a.ZP.createElement("canvas",{ref:Q,className:"thumbnail blurred-bg"}),a.ZP.createElement("img",{src:Y,className:(0,r.Z)("full-media",G&&"with-blurred-bg"),alt:"",style:I?`width: ${I}px`:void 0,draggable:!O}),X&&a.ZP.createElement("canvas",{ref:J,className:(0,r.Z)("thumbnail",ee)}),O&&a.ZP.createElement("span",{className:"protector"}),le&&!ue&&a.ZP.createElement("div",{className:`media-loading ${de}`},a.ZP.createElement(y.Z,{progress:re,onClick:ie?he:void 0})),ue&&a.ZP.createElement("i",{className:(0,r.Z)("icon","icon-download",me)}),a.ZP.createElement(E.Z,{isVisible:ne,withAnimation:!0,thumbDataUri:te,width:Ze,height:ge,className:"media-spoiler"}),se&&a.ZP.createElement("span",{className:"message-transfer-progress"},Math.round(100*re),"%"))}},18428:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(4463),i=n(46752),s=n(59107),r=n(25190),c=n(231),l=n(74399),d=n(96459);const u=2*l.Gw,m=(0,i.y)("ReactionSelectorReaction"),h=(0,a.X$)((({reaction:e,chosen:t,isReady:n,noAppearAnimation:o,style:i,onToggleReaction:s})=>a.ZP.createElement("div",{className:m("&","custom",t&&"chosen",!o&&n&&"custom-animated",o&&"visible"),style:i,onClick:function(){s(e)}},a.ZP.createElement(d.Z,{documentId:e.documentId,size:u}))));var p=n(60706),Z=n(6202),g=n(97799);const f=2*l.Gw,v=(0,i.y)("ReactionSelectorReaction"),P=(0,a.X$)((({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,onToggleReaction:i})=>{const s=(0,Z.Z)(`sticker${e.appearAnimation?.id}`,!t||n),r=(0,Z.Z)(`document${e.selectAnimation?.id}`,!t||n),c=(0,Z.Z)(`document${e.staticIcon?.id}`,!n),[l,d]=(0,p.Z)(),[u,,m]=(0,p.Z)(!0),[h,P,E]=(0,p.Z)();return a.ZP.createElement("div",{className:v("&",o&&"chosen"),onClick:function(){i(e.reaction)},onMouseEnter:t&&!u?P:void 0},n&&a.ZP.createElement("img",{className:v("static-icon"),src:c,alt:e.reaction.emoticon,draggable:!1}),!l&&!n&&a.ZP.createElement(g.Z,{key:e.appearAnimation?.id,tgsUrl:s,play:u,noLoop:!0,size:f,onEnded:m,forceAlways:!0}),!u&&!n&&a.ZP.createElement(g.Z,{key:e.selectAnimation?.id,tgsUrl:r,play:h,noLoop:!0,size:f,onLoad:d,onEnded:E,forceAlways:!0}))})),E=(0,i.y)("ReactionSelector"),y=(0,a.X$)((({allAvailableReactions:e,topReactions:t,enabledReactions:n,currentReactions:l,maxUniqueReactions:d,isPrivate:u,isReady:m,canPlayAnimatedEmojis:p,className:Z,onToggleReaction:g,onShowMore:f})=>{const v=(0,a.sO)(null),y=(0,s.Z)(),b=(0,a.Ye)((()=>{const a="some"===n?.type&&n.allowed||e?.map((e=>e.reaction)),i=a?.map((t=>{const a="documentId"in t,i=e?.find((e=>(0,o.Hl)(e.reaction,t)));if((a||i)&&!i?.isInactive&&(u||n&&(0,o.XU)(t,n))&&(!(d&&l&&l.length>=d)||l.some((({reaction:e})=>(0,o.Hl)(t,e)))))return a?t:i})).filter(Boolean)||[];return(0,o.PO)(i,t)}),[e,l,n,u,d,t]),C=(0,a.Ye)((()=>7===b.length?b:b.slice(0,6)),[b]),w=C.length<b.length,S=(0,a.Ye)((()=>{const e=l?.filter((({chosenOrder:e})=>void 0!==e))||[];return new Set(e.map((({reaction:e})=>C.findIndex((t=>t&&(0,o.Hl)("reaction"in t?t.reaction:t,e))))))}),[l,C]),N=(0,r.Z)((()=>{const e=v.current?.getBoundingClientRect()||{x:0,y:0};f({x:e.x,y:e.y})}));if(C.length)return a.ZP.createElement("div",{className:(0,i.Z)(E("&",y.isRtl&&"isRtl"),Z),ref:v},a.ZP.createElement("div",{className:E("bubble-small",y.isRtl&&"isRtl")}),a.ZP.createElement("div",{className:E("items-wrapper")},a.ZP.createElement("div",{className:E("bubble-big",y.isRtl&&"isRtl")}),a.ZP.createElement("div",{className:E("items"),dir:y.isRtl?"rtl":void 0},C.map(((e,t)=>"reaction"in e?a.ZP.createElement(P,{key:(0,o.$d)(e.reaction),isReady:m,onToggleReaction:g,reaction:e,noAppearAnimation:!p,chosen:S.has(t)}):a.ZP.createElement(h,{key:(0,o.$d)(e),isReady:m,onToggleReaction:g,reaction:e,noAppearAnimation:!p,chosen:S.has(t),style:`--_animation-delay: ${20*(6-t)}ms`}))),w&&a.ZP.createElement(c.Z,{color:"translucent",className:E("show-more"),onClick:N},a.ZP.createElement("i",{className:"icon icon-down"})))))}))},35269:(e,t,n)=>{n.d(t,{Z:()=>S});var a=n(60748),o=n(33555),i=n(4463),s=n(46752),r=n(790),c=n(40647),l=n(74399),d=n(83967),u=n(13617),m=n(42797),h=n(60706),p=n(3657),Z=n(25190),g=n(6202),f=n(70692),v=n(6701),P=n(87204),E=n(31212),y=n(41280),b=n(62230),C=n(57080),w=n(39196);const S=({id:e,message:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:S,noAvatars:N,canAutoLoad:I,canAutoPlay:M,uploadProgress:k,forcedWidth:T,dimensions:x,asForwarded:A,isDownloading:R,isProtected:O,onClick:L,onCancelUpload:B})=>{const F=(0,a.sO)(null),D=(0,a.sO)(null),$=(0,i.b7)(t)||(0,i.Cg)(t),U=$.blobUrl,[j,,H]=(0,h.Z)($.isSpoiler),z=(0,p.Op)(F,n),_=(0,p.Op)(F,S)&&z,V=(0,a.sO)(z);_&&!V.current&&(V.current=!0);const{isMobile:q}=(0,m.ZP)(),[W,Y]=(0,a.eJ)(I),G=Boolean(W&&z),[X,K]=(0,a.eJ)(Boolean(M&&!j)),J=(0,i.Ti)(t,"inline"),[Q]=(0,a.eJ)(Boolean(J&&c.UV(J))),{mediaData:ee,loadProgress:te}=(0,v.Z)(J,!G,(0,i.kG)(t,"inline")),ne=U||ee,[ae,oe]=(0,h.Z)(),ie=(0,i.DH)(t),se=Boolean(ie),re=Boolean(T),ce=(0,i.Ti)(t,"preview"),[le]=(0,a.eJ)(Boolean(ce&&c.UV(ce))),de=z,ue=(0,g.Z)(ce,!de),me=(0,f.Z)((se||ue)&&!ae),he=!se||ue||ae,pe=(0,y.Z)(t,he),Ze=(0,y.Z)(t,!re),ge=(0,f.Z)(!he),fe=ne&&V.current,ve=(0,u.Z)(D,!0,!fe),{loadProgress:Pe}=(0,v.Z)((0,i.Ti)(t,"download"),!R,(0,i.kG)(t,"download")),{isUploading:Ee,isTransferring:ye,transferProgress:be}=(0,i.Sc)(t,k||(R?Pe:te),G&&!ae&&!Q||R),Ce=!1===(0,P.Z)(W),{shouldRender:we,transitionClassNames:Se}=(0,E.Z)(ye&&!ve,void 0,Ce),{transitionClassNames:Ne}=(0,E.Z)(Boolean((W||ne)&&!X&&!we)),[Ie,Me]=(0,a.eJ)(0),ke=(0,Z.Z)((e=>{Me(Math.max(0,e.currentTarget.currentTime-1))})),Te=(Number.isFinite(D.current?.duration)?D.current?.duration:$.duration)||0,xe=(0,i.B4)(t),Ae=Boolean((0,i.Cg)(t)),{width:Re,height:Oe}=x||(0,l.GC)($,xe,A,Ae,N,q),Le=(0,Z.Z)((()=>{Ee?B?.(t):R?(0,o.Sv)().cancelMessageMediaDownload({message:t}):ne?(ne&&!X&&K(!0),j?H():L?.(t.id)):Y((e=>!e))})),Be=(0,s.Z)("media-inner dark",!Ee&&"interactive",Oe<d.Xo&&"fix-min-height"),Fe=`height: ${Oe}px;${x?` width: ${Re}px; left: ${x.x}px; top: ${x.y}px;`:""}`;return a.ZP.createElement("div",{ref:F,id:e,className:Be,style:Fe,onClick:Ee?void 0:Le},re&&a.ZP.createElement("canvas",{ref:Ze,className:"thumbnail blurred-bg"}),fe&&a.ZP.createElement(C.Z,{ref:D,src:ne,className:(0,s.Z)("full-media",re&&"with-blurred-bg"),canPlay:X&&_&&!ve,muted:!0,loop:!0,playsInline:!0,draggable:!O,onTimeUpdate:ke,onReady:oe,style:T?`width: ${T}px`:void 0}),a.ZP.createElement("img",{src:ue,className:(0,s.Z)("thumbnail",me,re&&"with-blurred-bg"),alt:"",style:T?`width: ${T}px;`:void 0,draggable:!O}),se&&!le&&a.ZP.createElement("canvas",{ref:pe,className:(0,s.Z)("thumbnail",ge)}),O&&a.ZP.createElement("span",{className:"protector"}),a.ZP.createElement("i",{className:(0,s.Z)("icon","icon-large-play",Ne)}),a.ZP.createElement(b.Z,{isVisible:j,withAnimation:!0,thumbDataUri:ie,width:Re,height:Oe,className:"media-spoiler"}),we&&a.ZP.createElement("div",{className:(0,s.Z)("media-loading",Se)},a.ZP.createElement(w.Z,{progress:be,onClick:Le})),!W&&!ne&&a.ZP.createElement("i",{className:"icon icon-download"}),!ye||ve&&!R?a.ZP.createElement("div",{className:"message-media-duration"},$.isGif?"GIF":(0,r.k9)(Math.max(Te-Ie,0)),ve&&a.ZP.createElement("i",{className:"icon icon-message-failed playback-failed"})):a.ZP.createElement("span",{className:"message-transfer-progress"},Ee||R?`${Math.round(100*be)}%`:"..."))}},54659:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(60748),o=n(33555),i=n(4463),s=n(46752),r=n(48035),c=n(32340),l=n(83967),d=n(42797),u=n(31526),m=n(59107),h=n(25190),p=n(10088),Z=n(231),g=n(93609),f=n(95822),v=n(35269);const P=(0,a.X$)((({message:e,observeIntersection:t,noAvatars:n,canAutoLoad:P,canAutoPlay:E,inPreview:y,asForwarded:b,isDownloading:C=!1,isProtected:w,isConnected:S,story:N,theme:I,onMediaClick:M,onCancelMediaTransfer:k})=>{const{openTelegramLink:T}=(0,o.Sv)(),x=(0,i.s1)(e),{isMobile:A}=(0,d.ZP)(),R=(0,m.Z)(),O=(0,h.Z)((()=>{M()})),L=(0,h.Z)((()=>{x&&T({url:x.url})})),{story:B}=x||{};if((0,u.Z)(B?.peerId,B?.id,N),!x)return;const{siteName:F,url:D,displayUrl:$,title:U,description:j,photo:H,video:z,type:_}=x,V="telegram_story"===_,q=y||N&&"isDeleted"in N?void 0:function(e){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"lng_view_button_request_join";case"telegram_message":return"lng_view_button_message";case"telegram_bot":return"lng_view_button_bot";case"telegram_voicechat":return"lng_view_button_voice_chat";case"telegram_livestream":return"lng_view_button_voice_chat_channel";case"telegram_megagroup":case"telegram_chat":return"lng_view_button_group";case"telegram_channel":return"lng_view_button_channel";case"telegram_user":return"lng_view_button_user";case"telegram_botapp":return"lng_view_button_bot_app";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"lng_view_button_story";case"telegram_channel_boost":return"lng_view_button_boost";default:return}}(_),W=(0,r.Z)(j,170),Y=Boolean(W||U||F);let G=!1;if(Y&&x?.photo&&!x.video){const{width:t,height:n}=(0,l.GH)(e,void 0,void 0,A);G=t===n}const X=(H||z)&&M&&!G,K=(0,s.Z)("WebPage",y&&"in-preview",G&&"with-square-photo",!H&&!z&&!y&&"without-media",z&&"with-video",!Y&&"no-article",q&&"with-quick-button");return a.ZP.createElement("div",{className:K,"data-initial":(F||$)[0],dir:"auto"},a.ZP.createElement("div",{className:(0,s.Z)("WebPage--content",V&&"is-story")},V&&a.ZP.createElement(g.Z,{story:N,isProtected:w,isConnected:S,isPreview:!0}),H&&!z&&a.ZP.createElement(f.Z,{message:e,observeIntersection:t,noAvatars:n,canAutoLoad:P,size:G?"pictogram":"inline",asForwarded:b,nonInteractive:!X,isDownloading:C,isProtected:w,theme:I,onClick:X?O:void 0,onCancelUpload:k}),Y&&a.ZP.createElement("div",{className:"WebPage-text"},a.ZP.createElement(p.Z,{className:"site-name",url:D,text:F||$}),!y&&U&&a.ZP.createElement("p",{className:"site-title"},(0,c.Z)(U)),W&&a.ZP.createElement("p",{className:"site-description"},(0,c.Z)(W,["emoji","br"]))),!y&&z&&a.ZP.createElement(v.Z,{message:e,observeIntersectionForLoading:t,noAvatars:n,canAutoLoad:P,canAutoPlay:E,asForwarded:b,isDownloading:C,isProtected:w,onClick:X?O:void 0,onCancelUpload:k})),q&&(J=q,a.ZP.createElement(Z.Z,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,onClick:L},R(J))));var J}))},26593:(e,t,n)=>{n.d(t,{Z:()=>o});const a={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function o(e,t,n,o){return n?Promise.resolve(a[o||"light"][t?"outgoing":"incoming"]):async function(e,t){const n=new Image;n.src=e,n.crossOrigin="anonymous",n.width||await new Promise((e=>{n.onload=e}));const a=document.createElement("canvas"),o=a.getContext("2d");a.width=n.width,a.height=n.height,o.drawImage(n,0,0,n.width,n.height);const i=t?n.width-1:0,s=n.height-1;return`rgba(${Array.from(o.getImageData(i,s,1,1).data).join(",")})`}(e,t)}},83967:(e,t,n)=>{n.d(t,{GH:()=>u,Pw:()=>d,Vx:()=>r,Xo:()=>l});var a=n(4463),o=n(74399);const i=12,s=40,r=20*o.Gw,c=i*o.Gw,l=5*o.Gw;function d(e,t){return(e?.length??0)>s||t?r:c}function u(e,t,n,s){const r=(0,a.B4)(e),c=(0,a.O$)(e)||(0,a.F$)(e),u=(0,a.b7)(e),m=Boolean((0,a.F$)(e)),h=Boolean((0,a.Cg)(e)),{width:p,height:Z}=c?(0,o.Eh)(c,r,t,m,n,s):(0,o.GC)(u,r,t,h,n,s),g=d((0,a.UD)(e));let f=1;p<g&&g-p<i&&(f=g/p),Z*f<l&&l-Z*f<i&&(f=l/Z);const v=Math.round(p*f),P=Math.round(Z*f);return{width:v,height:P,isSmall:v<g||P<l}}},41280:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4463),o=n(97184),i=n(42797),s=n(15866);function r(e,t,n){const{isMobile:r}=(0,i.ZP)(),c=n||(0,a.DH)(e);return(0,s.Z)(c,Boolean(t),r&&!o.vX)}},45277:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(31664),i=n(57710),s=n(81740);const r=500,c=750,l=20;function d(e,t,n,d,u,m,h,p){const Z=(0,a.sO)(!h);(0,a.bt)((()=>{const t=Z.current;if(Z.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),a=u,h=()=>{const t=(0,s.ZP)(n,e.current,a?"end":"centerOrTop",l,void 0!==d?a?r:c:void 0,d,void 0,m,!0);if(p){const t=e.current.querySelector(".is-quote");t&&(0,i.WM)((()=>{(0,o.D_)(t,"animate")}))}return t};t?(0,i.lT)(h):(0,i.i$)((()=>{(0,i.WM)(h())}))}}),[e,t,n,d,u,m,p])}},75368:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(33555),i=n(69118);const s=new Map;function r(e,t,n,i){const r=i&&n?e?.byLangCode[i]?.[n]:void 0,{isPending:l,text:d}=r||{};return(0,a.d4)((()=>{t&&n&&!d&&void 0===l&&i&&function(e,t,n){const a=s.get(n)||new Map,i=a.get(e)||[];i.includes(t)||(i.push(t),a.set(e,i),s.set(n,a),(0,o.Sv)().markMessagesTranslationPending({chatId:e,messageIds:i,toLanguageCode:n})),c()}(t,n,i)}),[t,d,l,n,i]),t&&n?{isPending:l,translatedText:d}:{isPending:!1,translatedText:void 0}}const c=(0,i.P2)((function(){const{translateMessages:e}=(0,o.Sv)();let t=!1;s.forEach(((n,a)=>{n.forEach(((n,o)=>{const i=n.slice(0,20);i.length<n.length&&(t=!0),e({chatId:o,messageIds:i,toLanguageCode:a}),function(e,t,n){const a=s.get(n);if(!a?.size)return void s.delete(n);const o=a.get(e);if(!o?.length)return void a.delete(e);const i=o.filter((e=>!t.includes(e)));if(!i?.length)return a.delete(e),void(a.size||s.delete(n));a.set(e,i)}(o,i,a)}))})),t&&c()}),500)},17891:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(65326),i=n(34446);function s(e,t){const n=void 0===t,s=(0,a.sO)(n),r=(0,a.sO)(),c=(0,o.Z)();return(0,i.Z)((()=>{n||(s.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))}),e),(0,a.d4)((()=>{if(n||s.current)return;const e=()=>{s.current=!0,c()};t>0?r.current=window.setTimeout(e,t):e()}),e),s.current}},16289:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(60748),o=n(46752),i=n(790),s=n(2155),r=n(59107);const c="Wi6tadyqvllR7l_pkcxR",l="NpALvYqpe5N2L1ddrYlS",d="ypRrr0fjurHlSvEwWzcm",u=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],m=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],h=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],p=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],Z=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],g=(0,a.X$)((({title:e,type:t,statistics:n,className:g})=>{const f=(0,r.Z)(),{period:v}=n,P=function(e){switch(e){case"group":return m;case"message":return h;case"boost":return Z;case"story":return p;default:return u}}(t);return a.ZP.createElement("div",{className:(0,o.Z)("x62SJD7nuLUpIIlnJTv6",g)},a.ZP.createElement("div",{className:"IjmUGHMAuPEVp35VsCgx"},e&&a.ZP.createElement("div",{className:"_dn8co5wdJt5b2UaxFfX"},e),v&&a.ZP.createElement("div",{className:"ezmH45dow7OBiLlOipZt"},(0,i.Tu)(f,1e3*v.minDate)," ",(0,i.Tu)(f,1e3*v.maxDate))),a.ZP.createElement("table",{className:"g7t0KObI5uHkotdVoD9N"},P.map((e=>a.ZP.createElement("tr",null,e.map((e=>{const t=n[e.name];return e.isPlain?a.ZP.createElement("td",{className:c},a.ZP.createElement("b",{className:d},`${e.isApproximate?"":""}${(0,s.kh)(t)}`),a.ZP.createElement("h3",{className:l},f(e.title))):e.isPercentage?a.ZP.createElement("td",{className:c},e.withAbsoluteValue&&a.ZP.createElement("span",{className:d},`${e.isApproximate?"":""}${(0,s.kh)(t.part)}`),a.ZP.createElement("span",{className:e.withAbsoluteValue?"SXPAsM3uNS_a8KThhOt6":d},t.percentage,"%"),a.ZP.createElement("h3",{className:l},f(e.title))):a.ZP.createElement("td",{className:c},a.ZP.createElement("b",{className:d},(0,s.bi)(t.current))," ",(({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return a.ZP.createElement("span",{className:(0,o.Z)("pcCb3zfdimbZ84SPtVhy",n&&"WT9VmQr51xZyJy3_21rk")},n?`-${(0,s.bi)(Math.abs(e))}`:`+${(0,s.bi)(e)}`,t&&a.ZP.createElement(a.ZP.Fragment,null," ","(",t,"%)"))})(t),a.ZP.createElement("h3",{className:l},f(e.title)))})))))))}))},47505:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),i=n(46752),s=n(42797),r=n(78781),c=n(59107),l=n(91713),d=n(4463),u=n(30386),m=n(17240),h=n(25190),p=n(12644),Z=n(19156),g=n(70172),f=n(52328),v=n(58964),P=n(41372);const E=(0,a.X$)((function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:s,openStoryViewer:r,toggleStoriesHidden:E}=(0,o.Sv)(),y=(0,c.Z)(),b=(0,a.sO)(null),C="isSelf"in e&&e.isSelf,w=!(0,d.YC)(e.id);(0,Z.Z)(e.id);const{isContextMenuOpen:S,contextMenuPosition:N,handleBeforeContextMenu:I,handleContextMenu:M,handleContextMenuClose:k,handleContextMenuHide:T}=(0,m.Z)(b),x=(0,h.Z)((()=>b.current)),A=(0,h.Z)((()=>document.body)),R=(0,h.Z)((()=>b.current.querySelector(".story-peer-context-menu .bubble"))),O=(0,h.Z)((()=>({withPortal:!0,isDense:!0}))),{positionX:L,positionY:B,transformOriginX:F,transformOriginY:D,style:$}=(0,p.Z)(N,x,A,R,O),U=(0,h.Z)((()=>{S||r({peerId:e.id,origin:l.ze.StoryRibbon})})),j=(0,h.Z)((e=>{(0,u.b)(e),I(e)})),H=(0,h.Z)((()=>{s({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})})),z=(0,h.Z)((()=>{s({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),_=(0,h.Z)((()=>{n({id:e.id,shouldReplaceHistory:!0})})),V=(0,h.Z)((()=>{s({id:e.id,shouldReplaceHistory:!0})})),q=(0,h.Z)((()=>{E({peerId:e.id,isHidden:!t})}));return a.ZP.createElement("div",{ref:b,role:"button","data-peer-id":e.id,tabIndex:0,className:P.Z.peer,onMouseDown:j,onClick:U,onContextMenu:M},a.ZP.createElement(g.Z,{peer:e,withStory:!0,storyViewerOrigin:l.ze.StoryRibbon,storyViewerMode:"full"}),a.ZP.createElement("div",{className:(0,i.Z)(P.Z.name,e.hasUnreadStories&&P.Z.name_hasUnreadStory)},C?y("MyStory"):(0,d.OU)(y,e)),void 0!==N&&a.ZP.createElement(f.Z,{isOpen:S,transformOriginX:F,transformOriginY:D,positionX:L,positionY:B,style:$,className:(0,i.Z)("story-peer-context-menu",P.Z.contextMenu),autoClose:!0,withPortal:!0,onClose:k,onCloseAnimationEnd:T},C?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(v.Z,{onClick:H,icon:"play-story"},y("StoryList.Context.SavedStories")),a.ZP.createElement(v.Z,{onClick:z,icon:"archive"},y("StoryList.Context.ArchivedStories"))):a.ZP.createElement(a.ZP.Fragment,null,!w&&a.ZP.createElement(v.Z,{onClick:_,icon:"message"},y("SendMessageTitle")),w?a.ZP.createElement(v.Z,{onClick:V,icon:"channel"},y("ChatList.ContextOpenChannel")):a.ZP.createElement(v.Z,{onClick:V,icon:"user"},y("StoryList.Context.ViewProfile")),a.ZP.createElement(v.Z,{onClick:q,icon:t?"unarchive":"archive"},y(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")))))})),y=(0,a.X$)((0,o.c$)(((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:a}}=e.stories;return{orderedPeerIds:t?a:n,usersById:e.users.byId,chatsById:e.chats.byId}}))((function({isArchived:e,className:t,orderedPeerIds:n,usersById:o,chatsById:l,isClosing:d}){const u=(0,c.Z)(),m=(0,i.Z)(P.Z.root,!n.length&&P.Z.hidden,d&&P.Z.closing,t,"no-scrollbar"),h=(0,a.sO)(null);return(0,r.Z)(h,(0,s.W7)()),a.ZP.createElement("div",{ref:h,id:"StoryRibbon",className:m,dir:u.isRtl?"rtl":void 0},n.map((t=>{const n=o[t]||l[t];if(n)return a.ZP.createElement(E,{key:t,peer:n,isArchived:e})})))})))},85194:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(60748),o=n(33555),i=n(83716),s=n(7054),r=n(46752),c=n(32136),l=n(18674),d=n(59107),u=n(31212),m=n(19156),h=n(70172),p=n(4710);const Z=(0,a.X$)((0,o.c$)(((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:a}}=e.stories,{storyViewer:{isRibbonShown:o,isArchivedRibbonShown:i}}=(0,s.jUK)(e),r=(0,s.nd)(e),c=(0,s.$Yd)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:a,isShown:t?!i:!o,isForumPanelOpen:r,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId}}))((function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:s,canShow:Z,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:P}){const{toggleStoryRibbon:E}=(0,o.Sv)(),y=(0,d.Z)(),b=(0,a.Ye)((()=>1===t.length?[n[t[0]]||s[t[0]]]:t.map((e=>n[e]||s[e])).filter((t=>t&&t.id!==e)).slice(0,i.Ob7).reverse()),[e,t,n,s]),C=(0,a.Ye)((()=>t.slice(0,5)),[t]);(0,m.Z)(C);const w=Z&&g,{shouldRender:S,transitionClassNames:N}=(0,u.Z)(w,void 0,void 0,"slow");if((0,a.d4)((()=>{P&&!f&&(w?((0,l.YW)(c.zn+i.fK3),(0,c.V$)(v)):((0,l.YW)(c.zn+i.fK3),(0,c.DO)(v)))}),[v,w,P,f]),S)return a.ZP.createElement("button",{type:"button",id:"StoryToggler",className:(0,r.Z)(p.Z.root,N),"aria-label":y("Chat.Context.Peer.OpenStory"),onClick:()=>E({isShown:!0,isArchived:v}),dir:y.isRtl?"rtl":void 0},b.map((e=>a.ZP.createElement(h.Z,{key:e.id,peer:e,size:"tiny",className:p.Z.avatar,withStorySolid:!0}))))})))},32136:(e,t,n)=>{n.d(t,{DO:()=>g,V$:()=>f,zn:()=>d});var a=n(83716),o=n(57710),i=n(9933),s=n(3858),r=n(74399),c=n(41372),l=n(4710);const d=250,u=.25*r.Gw,m=11,h=.1875*r.Gw,p=.125*r.Gw,Z=new Set;function g(e){C();const{container:t,toggler:n,leftMainHeader:s,ribbonPeers:r,toggleAvatars:c}=v(e);if(!(n&&c&&r&&t&&s))return;const{bottom:p,right:g}=s.getBoundingClientRect(),f=p+u,w=c[0],S=c[c.length-1],N=E(w);Array.from(r).reverse().forEach(((e,s,{length:r})=>{const c=E(e);if(!c)return;const u=c===N;let p=y(n,c),v=m+s+1;if(p||(p=s===r-1?S:w,v=m),!p)return;let{top:C,left:I,width:M}=p.getBoundingClientRect();const{left:k,width:T}=e.getBoundingClientRect();if(k>g)return;I-=h,M+=2*h;const x=I-k,A=C-f,R=M/T;C-=h;const O=k-I+2*h,L=f-C+h,B=T/(M+2*h);(0,o.WM)((()=>{if(!p)return;const n=P(e);let s;v>m?(s=P(p),u&&s.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName),(0,i.Zs)(n,{top:`${f}px`,left:`${k}px`,zIndex:`${v}`,opacity:s?"0":"",transform:`translate3d(${x}px, ${A}px, 0) scale(${R})`}),s&&(0,i.Zs)(s,{top:`${C}px`,left:`${I}px`,zIndex:`${v}`}),t.appendChild(n),s&&t.appendChild(s),p.classList.add("animating"),e.classList.add("animating"),(0,o.WM)((()=>{(0,i.Zs)(n,{opacity:"",transform:""}),s?(0,i.Zs)(s,{opacity:"0",transform:`translate3d(${O}px, ${L}px, 0) scale(${B})`}):n.classList.add(l.Z.ghostRevealName);const r=b((()=>{(0,o.WM)((()=>{t.contains(n)&&t.removeChild(n),s&&t.contains(s)&&t.removeChild(s),p?.classList.remove("animating"),e.classList.remove("animating")}))}),d+a.fK3);Z.add(r)}))}))}))}function f(e){C();const{container:t,toggler:n,toggleAvatars:s,ribbonPeers:r,leftMainHeader:c}=v(e);if(!(n&&s&&r&&t&&c))return;const{right:u}=c.getBoundingClientRect(),g=s[0],f=s[s.length-1],w=E(g);Array.from(r).reverse().forEach(((e,s,{length:r})=>{const c=E(e);if(!c)return;const v=c===w;let C=y(n,c),S=m+s+1;if(C||(C=s===r-1?f:g,S=m),!C)return;const{top:N,left:I,width:M}=e.getBoundingClientRect();let{left:k,width:T,top:x}=C.getBoundingClientRect();if(I>u)return;k-=h,T+=2*h;const A=k-I,R=x-N-p,O=T/M;x-=h;const L=I-k+2*h,B=N-x+h,F=M/(T+2*h);(0,o.WM)((()=>{const n=P(e);let s;S>m?(s=P(C),v&&s.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName,l.Z.ghostRevealName),(0,i.Zs)(n,{top:`${N}px`,left:`${I}px`,width:`${M}px`,zIndex:`${S}`}),s&&(0,i.Zs)(s,{top:`${x}px`,left:`${k}px`,zIndex:`${S}`,opacity:"0",transform:`translate3d(${L}px, ${B}px, 0) scale(${F})`}),e.classList.add("animating"),C.classList.add("animating"),t.appendChild(n),s&&t.appendChild(s),(0,o.WM)((()=>{(0,i.Zs)(n,{opacity:s?"0":"",transform:`translate3d(${A}px, ${R}px, 0) scale(${O})`}),s?(0,i.Zs)(s,{opacity:"",transform:""}):n.classList.remove(l.Z.ghostRevealName);const r=b((()=>{(0,o.WM)((()=>{t.contains(n)&&t.removeChild(n),s&&t.contains(s)&&t.removeChild(s),e.classList.remove("animating"),C.classList.remove("animating")}))}),d+a.fK3);Z.add(r)}))}))}))}function v(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),a=t.querySelector("#StoryRibbon"),o=t.querySelector(".left-header"),i=a?.querySelectorAll(`.${c.Z.peer}`),s=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:o,ribbonPeers:i,toggleAvatars:s}}function P(e){const t=e.cloneNode(!0);t.classList.add(l.Z.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=s.Z;const n=e.querySelector("canvas");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return t}function E(e){return e?.getAttribute("data-peer-id")}function y(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function C(){Z.forEach((e=>e())),Z.clear()}},29497:(e,t,n)=>{n.d(t,{M:()=>a,X:()=>o});const a="video/mp4; codecs=hvc1.1.6.L63.00",o="video/mp4; codecs=avc1.64001E"},19156:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(60748),o=n(33555),i=n(6137),s=n(4463),r=n(7054),c=n(40647),l=n(80793),d=n(69118),u=n(29497),m=n(87712);const h={},p=(0,d.wO)(1e3),Z=function(e,t){(0,a.d4)((()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,o.Rd)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await p,e.forEach((({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,l.z)((0,c.Oj)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):c.he(e,t).then((e=>{t===i.IU.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout((()=>{n.pause(),n.src="",n.load(),t.removeChild(n)}),1e3)}(e)}))}))})(function(e,t){const n=(0,r.nST)((0,o.Rd)(),e);if(!n||!n.orderedIds?.length)return[];const a=function(e,t,n){const a=e.indexOf(t);return e.slice(a-5,a+5)}(n.orderedIds,t),c=[];return a.forEach((t=>{if(h[e]?.has(t))return;const a=n.byId[t];a&&"content"in a&&(c.push({hash:(0,s.Cc)(a,"full"),format:a.content.video?i.IU.Progressive:i.IU.BlobUrl,isStream:(0,m.U)(u.M)}),c.push({hash:(0,s.Cc)(a),format:i.IU.BlobUrl}),a.content.altVideo&&c.push({hash:(0,s.Cc)(a,"full",!0),format:i.IU.Progressive}),h[e]=(h[e]||new Set).add(t))})),c}(e,n))}))}),[t,e])}},42175:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),i=n(83716),s=n(57710),r=n(46752),c=n(80036),l=n(12255),d=n(4463),u=n(74399),m=n(274),h=n(25190),p=n(78722),Z=n(36368);const g="qF5NAjzN826sfFvUwCi1",f=(0,a.X$)((({story:e,mediaArea:t,index:n,className:i,style:s,isPreview:l})=>{const{sendStoryReaction:g}=(0,o.Sv)(),f=(0,a.sO)(null),[v,P]=(0,a.eJ)(1.5*u.Gw),{peerId:E,id:y,views:b}=e,{reactions:C}=b||{},{reaction:w,isDark:S,isFlipped:N}=t,I=!(0,d.YC)(E),M=`${(0,d.hl)(E,y)}-${n}-${l?"preview":"viewer"}`,k=(0,a.Ye)((()=>C?.find((e=>(0,d.Hl)(e.reaction,w)))?.count),[w,C]),T=!l&&Boolean(k)&&I,x=(0,h.Z)((()=>{if(!f.current)return;const e=f.current.clientHeight;P(Math.round(.6*e))}));(0,m.Z)((([e])=>{Boolean(k)!==Boolean(e)&&x()}),[k]),(0,p.Z)(f,x);const A=(0,h.Z)((()=>{g({peerId:E,storyId:y,containerId:M,reaction:w})}));return a.ZP.createElement("div",{ref:f,className:(0,r.Z)("K8z7QedYZHumSrLQCrZq",S&&"cKzIdSabAL8MJ9G60u77",i),style:(0,c.Z)(s,`--custom-emoji-size: ${v}px`),onClick:A},a.ZP.createElement("div",{className:(0,r.Z)("QxSGHD_yTaeyLhKS2qqz",N&&"CiCfsJ1VaeHZ624tudjv")}),Boolean(v)&&a.ZP.createElement(Z.Z,{className:(0,r.Z)("Oi4FupikW1BQIPXxj9a7",T&&"dCSRvNsQTjKPeBul8iIX"),reaction:w,containerId:M,size:v,effectSize:4*v,shouldPause:l,shouldLoop:!l}),T&&a.ZP.createElement("span",{className:"WAKY7bjrmisH3k1XFQMZ"},k))})),v=9/16;function P(e){const{x:t,y:n,width:a,height:o,rotation:i}=e.coordinates;return(0,c.Z)(`left: ${t}%`,`top: ${n}%`,`width: ${a}%`,`height: ${o}%`,`transform: rotate(${i}deg) translate(-50%, -50%)`)}const E=(0,a.X$)((({story:e,isActive:t,className:n})=>{const{openMapModal:c,focusMessage:d,closeStoryViewer:u}=(0,o.Sv)(),m=(0,a.sO)(null),h=(0,l.Z)();(0,a.d4)((()=>{if(!m.current||!t)return;const e=m.current;if(h.width>i.l35)return void(0,s.WM)((()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")}));const n=h.width/h.height,a=n<v?e.clientHeight*v:e.clientWidth,o=n<v?e.clientHeight:e.clientWidth/v;(0,s.WM)((()=>{e.style.setProperty("--media-width",`${a}px`),e.style.setProperty("--media-height",`${o}px`)}))}),[t,h]);const p=e.mediaAreas;return a.ZP.createElement("div",{className:(0,r.Z)("oWM0Zdb5uhUcOVtc99aS",!t&&"dDrvIyufIoAgicpd5jBf",n),ref:m},p?.map(((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":{const e=t&&("geoPoint"===n.type||"venue"===n.type);return a.ZP.createElement("div",{className:(0,r.Z)(g,e&&"mHQ5t7g14fbpeDSyTLcd"),style:P(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":c({geoPoint:e.geo});break;case"channelPost":d({chatId:e.channelId,messageId:e.messageId}),u()}})(n)})}case"suggestedReaction":return a.ZP.createElement(f,{key:`${n.type}-${o}`,story:e,mediaArea:n,index:o,isPreview:!t,className:g,style:P(n)});default:return}})))}))},13617:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(33555),i=n(97184),s=n(59107),r=n(25190);const c=8e3;function l(e,t,n){const{showNotification:l}=(0,o.Sv)(),d=(0,s.Z)(),[u,m]=(0,a.eJ)(!1),h=(0,r.Z)((()=>{m(!0),t||l({message:i.q$?d("Video.Unsupported.Mobile"):d("Video.Unsupported.Desktop"),duration:c})})),p=(0,r.Z)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())})),Z=(0,r.Z)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()}));return(0,a.d4)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",Z),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",Z)}):void 0}),[n,e]),u}},13995:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(33555),i=n(4463),s=n(7054),r=n(69118);const c=36e5,l=new Map;let d=new Set;const u=(0,r.P2)((()=>{const e=Array.from(d),t=e.slice(0,100),n=e.slice(101);(0,o.Sv)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>l.set(e,Date.now()))),d=new Set(n),d.size&&u()}),500);function m(e){const t=(0,a.Ye)((()=>{const t=(0,o.Rd)();return e?.map((e=>(0,s.RGZ)(t,e))).filter(Boolean)}),[e]),n=(0,a.Ye)((()=>{const e=(0,o.Rd)();return t?.filter((t=>{const n=l.get(t.id)||0;if(Date.now()-n<c)return!1;if((0,i.YC)(t.id)){const n=t,a=(0,s.ssc)(e,n.id),o=a&&"userStatusEmpty"!==a.type;return!n.isContact&&!n.isSelf&&!(0,i.cS)(n)&&!t.isSupport&&o}{const e=t;return(0,i.eA)(e)}})).map((e=>e.id))}),[t]);(0,a.d4)((()=>{n?.length&&(n.forEach((e=>d.add(e))),u())}),[n])}},53455:(e,t,n)=>{n.d(t,{Yy:()=>s,ZP:()=>h,fi:()=>i,vb:()=>l});var a=n(60782),o=n(91090);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"}],r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let o=[],i=[];if("included"===t){const{includedChatIds:t,...s}=n?e.includeFilters||{}:(0,a.ei)(e.folder,r);o=t||[],i=Object.keys(s).filter((e=>Boolean(s[e])))}else{const{excludedChatIds:t,...s}=n?e.excludeFilters||{}:(0,a.ei)(e.folder,c);o=t||[],i=Object.keys(s).filter((e=>Boolean(s[e])))}return{selectedChatIds:o,selectedChatTypes:i}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||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"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,a.ei)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,a.ei)(e.folder,c)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,a.CE)(e.folder,r),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,a.CE)(e.folder,c),...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"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"reset":return u;default:return e}},h=()=>(0,o.Z)(m,u)},11309:(e,t,n)=>{n.d(t,{CH:()=>s,Vr:()=>l,WR:()=>r,iD:()=>c});var a=n(67360),o=n(71790),i=n(3927);function s(e,t,n,a=!1){return(0,i.Z)((t=>{t(e())}),t,n,a)}function r(e,t,n=!1){const a=s((()=>e()),[e],t,n);return(0,o.Z)(a,[a,e],!0)}function c(e,t,n,o=!1,i=!1){return(0,a.Z)((t=>{t(e())}),t,n,o,i)}function l(e,t,n=!1,a=!1){const i=c((()=>e()),[e],t,n,a);return(0,o.Z)(i,[i,e],!0)}},23186:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(33555),i=n(83716),s=n(7054),r=n(10396),c=n(64532),l=n(85266),d=n(274),u=n(25190),m=n(34446);const h=(e,t,n,h,p,Z,g,f=!1,v,P,E=!1,y=!1)=>{const b=(0,a.sO)(null),[C,w]=(0,a.eJ)(!1);let S=C;const[N,I]=(0,a.eJ)(0),M=(0,u.Z)((()=>{w(!1),P&&P()}));(0,m.Z)((()=>{b.current=(0,r.z2)(e,n,((e,a)=>{switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:a,toggleMuted:r,proxy:l}=b.current;w(!0),(0,c.N)(Z,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:i,proxy:s,requestNextTrack:r,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(s.src)},pause:()=>{a()},stop:()=>{a(),i(0),(0,o.Sv)().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=()=>{r()}),l()||(t.previoustrack=()=>{c()})}return t}(b)),(0,c.pC)("playing");const{audioPlayer:d}=(0,s.jUK)((0,o.Rd)());e(d.volume),r(Boolean(d.isMuted));const u=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||u>i.J0S)&&a(d.playbackRate),(0,c.NS)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.currentTime});break}case"onRateChange":{const{proxy:e}=b.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":w(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=b.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;y||I(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}p?.[e]?.(a)}),v,M);const{proxy:a}=b.current;C||a.paused||(w(!0),S=!0),g&&g(a)}),[e]),(0,a.d4)((()=>{C&&Z&&(0,c.Ym)(Z)}),[Z,C]);const{play:k,pause:T,setCurrentTime:x,proxy:A,destroy:R,setVolume:O,stop:L,isFirst:B,isLast:F,requestNextTrack:D,requestPreviousTrack:$,setPlaybackRate:U,toggleMuted:j}=b.current,H=A.duration&&Number.isFinite(A.duration)?A.duration:t;(0,a.d4)((()=>{!H||(0,l.z)(A)||y||I(A.currentTime/H)}),[H,N,A,y]),(0,a.d4)((()=>()=>{R(E)}),[R,E]),(0,d.Z)((([e,t])=>{e===f&&h===t||A.src&&A.paused||f&&h&&!C&&k(h)}),[f,h,C,k,A.src,A.paused]);const z=(0,u.Z)((()=>{h&&k(h)})),_=(0,u.Z)((()=>{C?T():z()})),V=(0,u.Z)((e=>{x(e),H&&I(A.currentTime/H)}));return{isPlaying:S,playProgress:N,playPause:_,pause:T,play:z,stop:L,setCurrentTime:V,setVolume:O,audioProxy:A,duration:H,requestNextTrack:D,requestPreviousTrack:$,isFirst:B,isLast:F,setPlaybackRate:U,toggleMuted:j}}},58637:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(69118),i=n(25190);function s(e){const t=(0,i.Z)(e);(0,a.d4)((()=>(0,o.Gq)(t)),[t])}},15866:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(96264),i=n(57710),s=n(97184),r=n(34446);const c=2,l=2;function d(e,t=!1,n,d=c,u,m){const h=(0,a.sO)(null),p=(0,a.sO)();return(0,r.Z)((()=>{t||(p.current=!1)}),[e,t]),(0,a.d4)((()=>{const a=h.current;if(!e||!a||t||p.current)return;p.current=!0;const r=new Image,c=()=>{const e=u||r.width,t=m||r.height,n=a.getContext("2d",{alpha:!1});(0,i.WM)((()=>{a.width=e,a.height=t,s.vX&&(n.filter=`blur(${d}px)`),n.drawImage(r,2*-d,2*-d,e+4*d,t+4*d),s.vX||(0,o.Z)(n,0,0,e,t,d,l)}))};r.onload=()=>{n?(0,i.i$)(c):c()},r.src=e}),[e,t,m,u,d,n]),h}},41470:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(33555),i=n(83716),s=n(4463),r=n(60782),c=n(97184),l=n(59107);const d=({chat:e,user:t,folderId:n,isPinned:d,isMuted:u,canChangeFolder:m,handleDelete:h,handleMute:p,handleChatFolderChange:Z,handleReport:g},f=!1)=>{const v=(0,l.Z)(),{isSelf:P}=t||{},E=t?.id===i.awM;return(0,a.Ye)((()=>{if(!e)return;const{toggleChatPinned:a,updateChatMutedState:i,toggleChatArchived:l,toggleChatUnread:y,openChatInNewTab:b}=(0,o.Sv)(),C=c.IT&&{title:c.D$?"Open in new window":"Open in new tab",icon:"open-in-new-tab",handler:()=>{b({chatId:e.id})}},w=m?{title:v("ChatList.Filter.AddToFolder"),icon:"folder",handler:Z}:void 0,S=d?{title:v("UnpinFromTop"),icon:"unpin",handler:()=>a({id:e.id,folderId:n})}:{title:v("PinToTop"),icon:"pin",handler:()=>a({id:e.id,folderId:n})},N=u?{title:v("ChatList.Unmute"),icon:"unmute",handler:()=>i({chatId:e.id,isMuted:!1})}:{title:`${v("ChatList.Mute")}...`,icon:"mute",handler:p};if(f)return(0,r.oA)([C,S,w,N]);const I=e.unreadCount||e.hasUnreadMark?{title:v("MarkAsRead"),icon:"readchats",handler:()=>y({id:e.id})}:void 0,M=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:v("MarkAsUnread"),icon:"unread",handler:()=>y({id:e.id})},k=(0,s.pE)(e)?{title:v("Unarchive"),icon:"unarchive",handler:()=>l({id:e.id})}:{title:v("Archive"),icon:"archive",handler:()=>l({id:e.id})},T=g&&((0,s.eA)(e)||(0,s.Bf)(e)||t&&!t.isSelf)?{title:v("ReportPeer.Report"),icon:"flag",handler:g}:void 0,x={title:(0,s.YC)(e.id)?v("Delete"):v((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:h},A=void 0!==n;return(0,r.oA)([C,w,I,M,S,!P&&N,!P&&!E&&!A&&k,T,x])}),[e,t,m,v,Z,d,f,u,h,p,g,n,P,E])}},71790:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(33799),o=n(93862),i=n(70971),s=n(34446);const r=function(e,t,n=!1){const r=t?e:()=>e;t??(t=[e]);const[c,l]=(0,a.Z)(),d=(0,i.Y)(r);function u(){const e=d.current;n?e(l):l(e())}return(0,s.Z)(u,t),(0,o.b)(u,t),c}},86203:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(65326),i=n(93862),s=n(70971),r=n(34446);const c=function(e,t,n=!1){const c=t?e:()=>e();t??(t=[e]);const l=(0,a.sO)(),d=(0,o.Z)(),u=(0,s.Y)(c);function m(e=!1){const t=u.current;if(n)t((e=>{l.current!==e&&(l.current=e,d())}));else{const n=t();l.current!==n&&(l.current=n,e||d())}}return(0,r.Z)((()=>{m(!0)}),t),(0,i.b)(m,t),l.current}},75790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(33555);function i(e,t,n,i,s){const{loadMessage:r}=(0,o.Sv)();(0,a.d4)((()=>{s||t&&!n&&r({chatId:e,messageId:t,replyOriginForId:i})}),[s,e,n,t,i])}},31526:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(33555),i=n(69118);const s=function(e,t,n){const{loadPeerStoriesByIds:s}=(0,o.Sv)(),r=(0,a.Ye)((()=>{const n=(0,i.P2)(s,200,!0);return()=>{n({peerId:e,storyIds:[t]})}}),[t,e]);(0,a.d4)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()}),[r,n,t,e])}},95616:(e,t,n)=>{n.d(t,{d7:()=>s,mE:()=>c,yi:()=>r});var a=n(60748),o=n(16974),i=n(65326);function s(e){const t=(0,i.Z)();return(0,a.d4)((()=>(0,o.M2)(e,t)),[e,t]),(0,o.gO)(e)}function r(){const e=(0,i.Z)();return(0,a.d4)((()=>(0,o.O6)(e)),[e]),(0,o.wC)()}function c(){const e=(0,i.Z)();return(0,a.d4)((()=>(0,o.r_)(e)),[e]),(0,o.Yz)()}},54416:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(65326),i=n(25190),s=n(34446);function r(e=!1){const t=(0,a.sO)(e),n=(0,a.sO)(!1),r=(0,o.Z)();(0,s.Z)((()=>{e&&(t.current=!0)}),[e]);const c=(0,i.Z)((()=>{t.current=!1,n.current=!1,r()})),l=(0,i.Z)((()=>{n.current=!0,r()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:c,handleForumPanelAnimationStart:l}}},69156:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(33799);function i(e){const[t,n]=(0,o.Z)();return(0,a.d4)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const a=t.getRangeAt(0);if(!a)return;if(!document.querySelector(e))return;const{commonAncestorContainer:o}=a;(o instanceof Element?o:o.parentElement).closest(e)&&n(a)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},78781:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(60748);const o=(e,t,n=!1)=>{(0,a.d4)((()=>{if(t)return;const a=e.current;function o(e){e.deltaX||(a.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return a.addEventListener("wheel",o,{passive:!n}),()=>{a.removeEventListener("wheel",o)}}),[e,t,n])}},73541:(e,t,n)=>{n.d(t,{y:()=>r});var a=n(60748),o=n(16063);const i=new Set(["INPUT","TEXTAREA","SELECT"]),s=(0,o._)();function r(e){(0,a.d4)((()=>{if(!e)return;const t=Object.entries(e);return s.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!i.has(e.target.tagName)})(e)&&t.forEach((([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:a,meta:o,mod:i,shift:s,key:r}=e,{altKey:c,ctrlKey:l,metaKey:d,shiftKey:u,key:m}=t;if(n!==c)return!1;if(i){if(!l&&!d)return!1}else{if(a!==l)return!1;if(o!==d)return!1}return s===u&&Boolean(r&&(m.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},a=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!a.includes(e)))}}(e),t)})(t)(e)&&n(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",s.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(57710),i=n(42797);const s=500,r=300;function c(e,t,n){const{isMobile:c}=(0,i.ZP)();(0,a.d4)((()=>{t?c||setTimeout((()=>{(0,o.WM)((()=>{e.current?.isConnected&&e.current.focus()}))}),s):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,r))}),[e,c,t,n])}},6701:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(6137),i=n(40647),s=n(69118),r=n(97184),c=n(65326),l=n(27704);const d=.75,u=1500,m=500;function h(e,t=!1,n=o.IU.BlobUrl,h,p=!1){const Z=e?i.UV(e):void 0,g=r.I_&&n===o.IU.Progressive,f=(0,c.Z)(),v=(0,l.Z)(),[P,E]=(0,a.eJ)(Z&&!g?1:0),y=(0,a.sO)(),b=(0,a.Ye)((()=>(0,s.P2)((e=>{y.current&&(!h||Date.now()-y.current>h)&&E(e)}),m,!0)),[h]);return(0,a.d4)((()=>{!t&&e&&(Z?g&&setTimeout((()=>{E(d)}),u):(E(0),y.current&&i.cC(b),y.current=Date.now(),i.he(e,n,p,b,v).then((()=>{const e=Date.now()-y.current;y.current=void 0,!h||e>=h?f():setTimeout(f,h-e)}))))}),[t,e,Z,n,f,g,h,b,p,v]),(0,a.d4)((()=>{t&&y.current&&(i.cC(b),E(0),y.current=void 0)}),[b,t]),(0,a.d4)((()=>()=>{e&&i.Iq(e,v)}),[v,e]),{mediaData:Z,loadProgress:P}}},56503:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(97184),i=n(25190);const s=250;let r;function c(e,t,n=s,c=!1){const l=(0,a.sO)(!1),d=(0,i.Z)((()=>{l.current=!0}));return(0,a.d4)((()=>{r&&(clearTimeout(r),r=void 0),!e||o.$b||c||(r=window.setTimeout((()=>{l.current||t()}),2*n))}),[c,e,n,t]),[(0,i.Z)((()=>{l.current=!0})),(0,i.Z)((()=>{l.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{l.current||t()}),n)})),d]}},52678:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(65326),i=n(87204),s=n(34446);function r(e,t){const n=(0,i.Z)(e,!0),r=(0,a.sO)(),c=(0,o.Z)(),l=null!=e,d=null!=n;return l&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,s.Z)((()=>{t&&!l&&d&&!r.current&&(r.current=window.setTimeout((()=>{r.current=void 0,c()}),t))}),[t,c,l,d]),r.current&&t&&!l?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(65326);function i(e,t){const n=(0,o.Z)(),i=(0,a.sO)(e),s=(0,a.sO)(t),r=(0,a.I4)((e=>(s.current=i.current(s.current,e),n(),s.current)),[]);return[s.current,r]}},88957:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(67360);function o(e,t,n,o=[]){return(0,a.Z)((e=>{e()}),o,e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(83716),i=n(790),s=n(82267),r=n(59107),c=n(25190),l=n(99203),d=n(48778);const u=e=>{const{isOpen:t}=e,n=(0,d.Z)(l.gl.Extra,"CalendarModal",!t);return n?a.ZP.createElement(n,e):void 0},m=(e,t,n)=>{const l=(0,r.Z)(),[d,m]=(0,a.eJ)(),h=(0,c.Z)(((e,t=!1)=>{const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,s.Qj)());d?.(n),m(void 0)})),p=(0,c.Z)((()=>{h(new Date(1e3*o.t4X),!0)})),Z=(0,c.Z)((()=>{m(void 0),t?.()})),g=(0,c.Z)((e=>{m((()=>e))})),f=n?new Date(1e3*n):new Date;f.setSeconds(0),f.setMilliseconds(0);const v=new Date;return v.setFullYear(v.getFullYear()+1),[g,a.ZP.createElement(u,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:f.getTime(),maxAt:(0,i._F)(v),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:Z,onSubmit:h,onSecondButtonClick:e?p:void 0})]}},56389:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(33555),i=n(83716),s=n(69118);const r=(e,t)=>(0,a.Ye)((()=>(0,s.P2)((n=>{e&&t&&(0,o.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),i.o_S)),[e,t])},33799:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(19369);function i(e){const t=(0,a.sO)();return t.current??(t.current=(0,o.gQ)(e)),t.current}},93862:(e,t,n)=>{n.d(t,{b:()=>s});var a=n(60748),o=n(19369),i=n(7792);function s(e,t){const n=(0,a.sO)(!0);n.current&&(n.current=!1,t?.forEach((t=>{(0,o.$Z)(t)&&t.subscribe(e)}))),(0,i.Z)((()=>()=>{(0,o.Dc)(e)}))}},87712:(e,t,n)=>{n.d(t,{F:()=>d,U:()=>u});var a=n(60748),o=n(83716),i=n(57710),s=n(9933),r=n(80793),c=n(97184);const l=100;function d(e,t,n){(0,a.d4)((()=>{if(!t||!e.current)return;const a=p(),o=e.current;if(!c.s$||!n||!a?.isTypeSupported(n))return;const d=new a;function u(){if(!t||!n)return;const e=d.addSourceBuffer(n),a=(0,r.z)(t);e.addEventListener("updateend",(function(){a.next().then((({value:t,done:n})=>{"open"===d.readyState&&(n?h(d):m(e,t))}))})),a.next().then((({value:t,done:n})=>{n||"open"!==d.readyState||((0,i.WM)((()=>{o.style.display="block",setTimeout((()=>{(0,i.WM)((()=>{(0,s.Zs)(o,{opacity:"1"})}))}),l)})),m(e,t))}))}return d.addEventListener("sourceopen",u,{once:!0}),(0,i.WM)((()=>{(0,s.Zs)(o,{display:"none",opacity:"0"}),o.src=URL.createObjectURL(d)})),()=>{d.removeEventListener("sourceopen",u),"open"===d.readyState&&h(d),URL.revokeObjectURL(o.src),(0,i.WM)((()=>{o.src="",(0,s.Zs)(o,{display:"none",opacity:"0"})}))}}),[n,t,e])}function u(e){if(!c.s$)return!1;const t=p();return Boolean(t&&t.isTypeSupported(e))}function m(e,t){try{e.appendBuffer(t)}catch(e){o.eMD&&console.warn("[Stream] failed to append buffer",e)}}function h(e){try{e.endOfStream()}catch(e){o.eMD&&console.warn("[Stream] failed to end stream",e)}}function p(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},28183:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(25190);const i=function(e,t,n=[]){const i=(0,o.Z)(e);(0,a.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>i()),t);return()=>clearTimeout(e)}),[t,i,...n])}},74095:(e,t,n)=>{n.d(t,{K:()=>s});var a=n(69995);function o(e,t,n){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?a:String(a))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i{constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n,o(this,"requestStates",new Map),o(this,"requestStatesByCallback",new Map)}destroy(){}init(...e){this.postMessage({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,o=(0,a.Z)(),i={type:"callMethod",messageId:o,...e},s={messageId:o},r=new Promise(((e,t)=>{Object.assign(s,{resolve:e,reject:t})}));if("function"==typeof i.args[i.args.length-1]){i.withCallback=!0;const e=i.args.pop();s.callback=e,n.set(e,s)}return t.set(o,s),r.catch((()=>{})).finally((()=>{t.delete(o),s.callback&&n.delete(s.callback)})),this.postMessage(i),r}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessage({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;if(e.channel===n)if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)}postMessage(e){e.channel=this.channel,this.target.postMessage(e)}}function s(e,t,n){const a=new i(e,t,n);function o({data:e}){a.onMessage(e)}return e.addEventListener("message",o),a.destroy=()=>{e.removeEventListener("message",o)},a}},8582:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(33555),o=n(57710),i=n(7054),s=n(9933);const r=300,c=new Map;function l(e,t,n=r){(0,i.FOo)((0,a.Rd)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:m,dataset:{scrollId:h}}=e;let p=t-d;if(p<0){const e=-d*(l?-1:1);p=Math.max(p,e)}else if(p>0){const e=m-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();h&&c.has(h)&&c.get(h)();const Z=d+p;return new Promise((t=>{(0,o.WM)((()=>{if(0===n)return e.scrollLeft=Z,void t();let a=!1;const i=Math.random().toString();e.dataset.scrollId=i,c.set(i,(()=>{a=!0})),e.style.scrollSnapType="none";const r=Date.now();(0,s.jt)((()=>{if(a)return!1;const o=Math.min((Date.now()-r)/n,1),s=p*(1-function(e){return 1-(1-e)**3.5}(o));return e.scrollLeft=Math.round(Z-s),o>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,c.delete(i),t()),o<1}),o.WM)}))}))}},81740:(e,t,n)=>{n.d(t,{Ni:()=>g,ZP:()=>h,wA:()=>p});var a=n(33555),o=n(91713),i=n(83716),s=n(57710),r=n(7054),c=n(9933),l=n(97184),d=n(18674);let u,m=!1;function h(...e){u=e.slice(0,8);const t=Z(...u);if(e[8])return t;(0,s.WM)(t)}function p(){m&&((0,c.vR)(),(0,s.i$)((()=>{(0,s.WM)(Z(...u))})))}function Z(e,t,n,h=0,p=i.V$q,Z,g,P){Z!==o.fo.Static&&(0,r.FOo)((0,a.Rd)())||(g=0);const{offsetTop:E,offsetHeight:y}=t,{scrollTop:b,offsetHeight:C,scrollHeight:w}=e,S=P&&e.dataset.normalHeight?Number(e.dataset.normalHeight):C;let N;switch(n){case"start":N=E-h+(l.wZ?1:0);break;case"end":N=E+y+h-S;break;case"nearest":case"center":case"centerOrTop":N=y<S?E+y/2-S/2:E-h}const I=function(e,t,n=i.V$q,a){const{scrollTop:s}=e;if(void 0===a){const e=t-s;if(e<-n)return s+(e+n);if(e>n)return s+(e-n)}else{if(a===o.fo.Up)return t+n;if(a===o.fo.Down)return Math.max(0,t-n)}return s}(e,N,p,Z);let M=N-I;if(M<0){const e=-I;M=Math.max(M,e)}else if(M>0){const e=w-(I+S);M=Math.min(M,e)}const k=Math.abs(M);return()=>{if(k<1)return void(b!==I&&(e.scrollTop=I));const t=I+M;if(0===g)return void(e.scrollTop=t);m=!0;const n=k<=i.xnK?f:v,a=g||i.bKs+k/i.V$q*(i.ckE-i.bKs),o=Date.now(),r=(0,d.YW)();(0,c.cK)((()=>{const i=Math.min((Date.now()-o)/a,1),s=M*(1-n(i)),c=Math.round(t-s);return e.scrollTop=c,m=i<1&&c!==t,m||(u=void 0,r()),m}),s.WM)}}function g(){return m}function f(e){return 1-(1-e)**3.5}function v(e){return 1-(1-e)**6.5}},10396:(e,t,n)=>{n.d(t,{An:()=>P,Es:()=>g,z2:()=>f});var a=n(33555),o=n(91713),i=n(57710),s=n(4463),r=n(7054),c=n(85266),l=n(74753),d=n(97184);const u=new Map;let m,h=[],p=[];function Z(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const i=v(e,(0,r.jUK)((0,a.Rd)()).audioPlayer.origin||o.Cr.Inline,t);if(!i)return;if(!u.has(i))return void(0,a.Sv)().openAudioPlayer((0,s.Ak)(E(i).messageKey));const c=u.get(i);c.onForcePlay&&c.onForcePlay(),m=i,c.audio.src&&(0,l.Z)(c.audio)}function g(){const e=m&&u.get(m);e&&e.audio.pause()}function f(e,t,n,g,f){if(!u.has(e)){const n=function(e,t,n,a){const o=new Audio;function i(t){return n=>{u.has(e)&&((0,c.z)(o)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return o.addEventListener("timeupdate",i("onTimeUpdate")),o.addEventListener("play",i("onPlay")),o.addEventListener("pause",i("onPause")),o.addEventListener("loadstart",i("onLoadStart")),o.addEventListener("loadeddata",i("onLoadedData")),o.addEventListener("playing",i("onPlaying")),o.addEventListener("ended",(()=>{u.has(e)&&((0,c.z)(o)||Z(e))})),{audio:o,type:t,proxy:new Proxy(o,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,g,f);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(y)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(y))}(n,e)}const{audio:P,proxy:b,handlers:C}=u.get(e);return C.push(n),{play(n){if(!P.paused)return;const i=m&&u.get(m);i&&m!==e&&(i.audio.pause(),i.audio.currentTime=0,(0,c.z)(i.audio)&&(i.audio.dataset.preventPlayAfterPatch="true"),i.onTrackChange&&i.onTrackChange()),m=e,P.src||(P.src=n,P.preload="auto",n.includes("/progressive/")&&d.s$&&(delete P.dataset.preventPlayAfterPatch,(0,c.B)(P))),(0,l.Z)(P),function(e,t){if((0,r.jUK)((0,a.Rd)()).globalSearch.currentContent===o.nJ.Music)return;const{chatId:n}=(0,s.Ak)(E(t).messageKey),i=(0,r.Btg)((0,a.Rd)())?.chatId,c=e=>e.startsWith(`msg${n}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(p=p.filter(c)),"voice"===e&&(h=h.filter(c))}(t,e)},pause(){m===e&&P.pause()},stop(){if(m===e){const e=P.src;P.pause(),(0,i.Yq)((()=>{P.src="",P.src=e}))}},setCurrentTime(t){m===e&&(P.fastSeek?P.fastSeek(t):P.currentTime=t)},setVolume(t){m===e&&(P.volume=t,P.muted=!1)},setPlaybackRate(t){m===e&&(P.playbackRate=t)},toggleMuted(e){P.muted=void 0===e?!P.muted:e},proxy:b,requestNextTrack(){Z(e)},isLast:()=>!v(e,(0,r.jUK)((0,a.Rd)()).audioPlayer.origin),isFirst:()=>!v(e,(0,r.jUK)((0,a.Rd)()).audioPlayer.origin,!0),requestPreviousTrack(){Z(e,!0)},destroy(t=!1){const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function v(e,t=o.Cr.Inline,n){const a=function(e){switch(e.type){case"audio":return p;case"voice":return h;default:return}}(u.get(e));if(!a)return;if(t===o.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:i}=(0,s.Ak)(E(e).messageKey),r=a.filter((e=>e.startsWith(`msg${i}`))),c=r.indexOf(e);if(c<0)return;let l=t===o.Cr.Inline?-1:1;return n&&(l*=-1),r[c+l]}function P(e){return`${(0,s.Tp)(e)}-${e.date}`}function E(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function y(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=E(e),{date:o,messageKey:i}=E(t),s=o-n;return 0===s?i.localeCompare(a):s}},75851:(e,t,n)=>{n.d(t,{CO:()=>i,eb:()=>r,ix:()=>c,rZ:()=>l,uR:()=>d,wK:()=>o,xP:()=>s});var a=n(71394);function o(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function i(e){const t=e[0].toString(16),n=e[1].toString(16),a=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==n.length?"0"+n:n)+(1==a.length?"0"+a:a)}function s([e,t,n]){e/=255,t/=255,n/=255;let a,o,i=Math.max(e,t,n),s=Math.min(e,t,n),r=i,c=i-s;if(o=0==i?0:c/i,i==s)a=0;else{switch(i){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return[a,o,r]}function r([e,t,n]){let a,o,i,s=Math.floor(6*e),r=6*e-s,c=n*(1-t),l=n*(1-r*t),d=n*(1-(1-r)*t);switch(s%6){case 0:a=n,o=d,i=c;break;case 1:a=l,o=n,i=c;break;case 2:a=c,o=n,i=d;break;case 3:a=c,o=l,i=n;break;case 4:a=d,o=c,i=n;break;case 5:a=n,o=c,i=l}return[Math.round(255*a),Math.round(255*o),Math.round(255*i)]}async function c(e){const t=[0,0,0];let n,o,i,s,r=-4,c=[0,0,0],l=0;const d=document.createElement("canvas"),u=d.getContext&&d.getContext("2d");if(!u)return t;const m=await(0,a.pt)(e);i=m.naturalHeight||m.offsetHeight||m.height,o=m.naturalWidth||m.offsetWidth||m.width,d.height=i,d.width=o,u.drawImage(m,0,0);try{n=u.getImageData(0,0,o,i)}catch(e){return t}for(s=n.data.length;(r+=20)<s;)0!==n.data[r+3]&&(++l,c[0]+=n.data[r],c[1]+=n.data[r+1],c[2]+=n.data[r+2]);return c[0]=Math.floor(c[0]/l),c[1]=Math.floor(c[1]/l),c[2]=Math.floor(c[2]/l),c}function l(e){const[t,n,a]=e;return.2126*t+.7152*n+.0722*a}function d(e){let[t,n,a]=s(e);return n=Math.min(1,n+.05+.1*(1-n)),a=a>.5?Math.max(0,.65*a):Math.max(0,Math.min(1,1-.65*a)),`hsla(${360*t}, ${100*n}%, ${100*a}%, .4)`}},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},6562:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(69118);const o=10,i=1e3;let s=[],r=!1;function c(e,t){s.push({url:e,filename:t}),r||(r=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of s)l(t),e++,e===o&&(await(0,a.wO)(i),e=0);s=[]}(),r=!1}),i))}function l({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.download=t;try{n.click()}catch(e){console.error(e)}}},65723:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(97184);function o(e,t,n){if(!t&&e===document.activeElement)return;const o=window.getSelection(),i=document.createRange(),s=e.lastChild||e;a.$b||n||s&&s.nodeValue?(i.selectNodeContents(n?e:s),i.collapse(!1),o.removeAllRanges(),o.addRange(i)):e.focus()}},60998:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(83716);const o=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&s(e.focusNode,a.gnl);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce(((e,t)=>t.nodeType===o&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):t.nodeType===o&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||i.pop(),i}function s(e,t){return!(e.nodeType!==o||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},93447:(e,t,n)=>{n.d(t,{j:()=>i,t:()=>s});var a=n(75851);const o=240;function i(e,t,n="image/png"){const a=e instanceof Blob?URL.createObjectURL(e):e,o=new Image;return new Promise((i=>{o.onload=()=>{r(o,o.width*t,o.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},o.src=a}))}function s(e,t,n,a="image/png"){const o=e instanceof Blob?URL.createObjectURL(e):e,i=new Image;return new Promise((s=>{i.onload=()=>{r(i,t,n,a).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(s).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(o)}))},i.src=o}))}async function r(e,t,n,i="image/png"){if(!("createImageBitmap"in window))return c(e,t,n,void 0,i);try{const s=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(s.height!==n||s.width!==t)throw new Error("Image bitmap resize not supported!");const r=await(0,a.ix)(e.src),c=(0,a.rZ)(r)<o?"#fff":"#000";return await new Promise((e=>{const t=document.createElement("canvas");t.width=s.width,t.height=s.height;const n=t.getContext("2d");n.fillStyle=c,n.fillRect(0,0,t.width,t.height);const a=t.getContext("bitmaprenderer");a?a.transferFromImageBitmap(s):n.drawImage(s,0,0),t.toBlob(e,i)}))}catch(a){return c(e,t,n,void 0,i)}}async function c(e,t,n,i=.5,s="image/png"){const r=document.createElement("canvas"),c=r.getContext("2d"),l=document.createElement("canvas"),d=l.getContext("2d");if(r.width=t,r.height=n,e.width*i>t){const n=1/i;let a={width:Math.floor(e.width*i),height:Math.floor(e.height*i)};for(l.width=a.width,l.height=a.height,d.drawImage(e,0,0,a.width,a.height);a.width*i>t;)a={width:Math.floor(a.width*i),height:Math.floor(a.height*i)},d.drawImage(l,0,0,a.width*n,a.height*n,0,0,a.width,a.height);c.drawImage(l,0,0,a.width,a.height,0,0,r.width,r.height)}else c.drawImage(e,0,0,r.width,r.height);const u=await(0,a.ix)(e.src),m=(0,a.rZ)(u)<o?"#fff":"#000";return c.fillStyle=m,c.globalCompositeOperation="destination-over",c.fillRect(0,0,r.width,r.height),new Promise((e=>{r.toBlob(e,s)}))}},55254:(e,t,n)=>{n.d(t,{P:()=>o});var a=n(43858);function o(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.Z.get();return t.top<=n&&t.top+t.height>=0}},91489:(e,t,n)=>{n.d(t,{Qw:()=>r,k4:()=>l,lZ:()=>c,zY:()=>s});const a={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},o=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),i=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function s(e,t,n=15){const{lat:o,long:i}=t,s=a[e];switch(e){case"google":return`${s}/place/${o}+${i}/@${o},${i},${n}z`;case"bing":return`${s}?cp=${o}~${i}&lvl=${n}&sp=point.${o}_${i}`;case"apple":return`${s}?q=${o},${i}`;default:return`${s}/?mlat=${o}&mlon=${i}&zoom=${n}`}}function r(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function c(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?o.get(e)||o.get(e.split("/")[0])||i[(t=e,t.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0)%i.length)]:"#008df2";var t}},64532:(e,t,n)=>{n.d(t,{Ay:()=>r,N:()=>o,NS:()=>l,Of:()=>d,Ym:()=>i,pC:()=>c});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 o(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=e??null)}function s(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,s(a),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function c(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function d({title:e,artist:t,album:n,artwork:a}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:a})}},16580:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60782);const o=new WeakMap;function i(e){return(...t)=>{const n=o.get(e);if(n&&(0,a.et)(n.lastArgs,t))return n.lastResult;const i=e(...t);return o.set(e,{lastArgs:t,lastResult:i}),i}}},94462:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(33681);const o=new RegExp(`^(?:${a.Z.source})+$`,""),i=e=>{const t=e.split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(o)))return!1;const i=t.map((e=>{let t=0;for(;a.Z.exec(e);)if(t++,t>100)return a.Z.lastIndex=0,-1;return t}));let s=t.length;for(let e=0;e<i.length;e++){if(-1===i[e])return!1;i[e]>s&&(s=i[e])}return s}},89455:(e,t,n)=>{n.d(t,{ZP:()=>c,fu:()=>l,xe:()=>s});var a=n(6137),o=n(83716),i=n(97184);const s={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,INS:a.Vv.Underline,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},r=3;function c(e,t=!1,n=!1){const c=document.createElement("div");c.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.op||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${a.Vv.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.FM6}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}(e):e),l(c);const d=c.innerText.trim().replace(/\u200b+/g,"");let u=-c.innerText.indexOf(d[0]),m=0;const h=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const o=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?a.Vv.CustomEmoji:void 0}(e);if(!o||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),r=i>=0?i:n,c=t.substring(0,r).length,{length:l}=t.substring(r,r+e.textContent.length);return o===a.Vv.TextUrl?{index:r,entity:{type:o,offset:c,length:l,url:e.href}}:o===a.Vv.MentionName?{index:r,entity:{type:o,offset:c,length:l,userId:e.dataset.userId}}:o===a.Vv.Pre?{index:r,entity:{type:o,offset:c,length:l,language:e.dataset.language}}:o===a.Vv.CustomEmoji?{index:r,entity:{type:o,offset:c,length:l,documentId:e.dataset.documentId}}:{index:r,entity:{type:o,offset:c,length:l}}}(e,d,u);if(n)u=t,h.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;u+=e.textContent.length}e.hasChildNodes()&&m<=r&&(m+=1,Array.from(e.childNodes).forEach(p))}return Array.from(c.childNodes).forEach((e=>{m=1,p(e)})),{text:d,entities:h.length?h:void 0}}function l(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}},80793:(e,t,n)=>{n.d(t,{z:()=>o});const a=262144;async function*o(e,t=a){let n,o=0;for(;;){let a=o+t-1;n&&a>n&&(a=n-1);const i=await fetch(e,{headers:{Range:`bytes=${o}-${a}`}});if(!i.ok)return;if(!n){const e=i.headers.get("Content-Range"),t=e?.match(/\/(\d+)$/);if(n=t?Number(t[1]):void 0,!n)return}const s=await i.arrayBuffer();if(yield s,o=a+1,o>=n)return}}},41098:(e,t,n)=>{n.d(t,{Mq:()=>r,dG:()=>c,gJ:()=>i,qK:()=>s,tx:()=>o});const a=document.createElement("div");function o(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const a=n.createContextualFragment(e),o=a.lastChild;n.insertNode(a),o?(n.setStartAfter(o),n.setEndAfter(o)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function i(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const o=n.getRangeAt(0).cloneRange();return o.intersectsNode(e)?t||e.contains(o.commonAncestorContainer)?(o.collapse(!0),o.setStart(e,0),a.innerHTML="",a.appendChild(o.cloneContents()),a.innerHTML):"":e.innerHTML}function s(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const a=n.getRangeAt(0),o=a.cloneRange();return o.selectNodeContents(e),o.setEnd(a.endContainer,a.endOffset),t=o.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),a=window.getSelection();return e.setStart(n,t),e.collapse(!0),a.removeAllRanges(),a.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function c(){const e=window.getSelection();e?.removeAllRanges()}},85655:(e,t,n)=>{let a;function o(e="*",t,n=!1){a||(a=document.createElement("input"),a.setAttribute("type","file")),a.setAttribute("accept",e),n?a.removeAttribute("multiple"):a.setAttribute("multiple","multiple"),a.onchange=null,a.value="",a.onchange=t,a.click()}n.d(t,{g:()=>o})},49160:(e,t,n)=>{n.d(t,{Au:()=>o,ME:()=>i,ZR:()=>a,js:()=>s});const a=5,o=32,i=/^\D([a-zA-Z0-9_]+)$/;function s(e){return 0===e.length||e.length>=a&&e.length<=o&&i.test(e)}},41372:(e,t,n)=>{n.d(t,{Z:()=>a});const a={root:"J2OUAM1NNJzVPwPvfhkE",fadeIn:"M0CnDOPqsqgp07DpRE7u",closing:"U1ngPxxXOIuHX2rXUTdq",peer:"N26JMlalq5jDriKQ7nFD",name:"M4TMTYSSXa3H49Go9t9g",name_hasUnreadStory:"kUi0jmHQpokhzBJI5FJA",nameHasUnreadStory:"kUi0jmHQpokhzBJI5FJA",hidden:"c5X6suR_qxO1W64dH2j3",contextMenu:"nAc8FkZyj9PHGgGm0BO7"}},4710:(e,t,n)=>{n.d(t,{Z:()=>a});const a={name:"M4TMTYSSXa3H49Go9t9g",root:"laLpjZnhOwW8cdBN3mEv",avatar:"ewhbkm9F8nGqLpj_toQg",avatarHidden:"aPEbisewADPmseTVcQxO",ghost:"bVo8M4JDvB9c6gUvnHTE",ghostAnimateName:"DuJzmNpO8VBweCzETZQJ",ghostRevealName:"ghy_xXQVvFUwJrNg9uhA",ghostLast:"_mqUJoir6gIYUJWb0zFw"}},68973:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.8ea62f6317fbac7d4558.js"}}]);
//# sourceMappingURL=8346.4533933c305c5c058b29.js.map